From 52cb555e78df4ae0597c3543fc3598d7b423af2f Mon Sep 17 00:00:00 2001 From: George Ho Date: Thu, 3 Jan 2019 09:26:15 +0000 Subject: [PATCH] ENH: upgrade minimal mistakes (#11) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * New comment (#1715) * New comment (#1716) * Update french labels (#1741) * Update CHANGELOG and history * Add note about updating Gemfile when forking theme * Fix link * Update font awesome (#1754) * Update scripts.html * update to 5.2.0 REF: https://github.com/FortAwesome/Font-Awesome/releases * Update CHANGELOG and history * Allow time to be shown with a header image overlay (#1756) Fix `read_time` logic in header image overlay * Update CHANGELOG and history * Add french translations (#1769) * Update CHANGELOG and history * remove the slash at the beginning of the 'path' in staticman.yml's example (#1772) * Remove slash at the beginning of `path` in staticman.yml example * Bump dependencies * Release 4.12.1 💎 * Update CHANGELOG and history * Add `{{ content }}` to `home` layout (#1775) * Add `{{ content }}` to `home` layout Allow the author to add content which will appear above the list of recent posts. This also allows the `home` layout to be extended. Add text to index.html in tests to indicate that the content appears in the correct spot. * Add paragraph markup Since this is a HTML file, proper paragraph markup is needed. * Update CHANGELOG and history * Improve side navigation spacing in relation to masthead * Style archive links with appropriate link color * Adjust feature row spacing and font-sizes * Use sentence case for better readability * Increase font-size to improve readability * Update CHANGELOG and history * Increase navigation min-height * Switch `$nav-height` to a relative unit * Update Staticman commit message to include name * Adjust height of navigation toggle * Add test menu items * Fixing scaling issue w. emoji in Sidebar Author Profile (#1780) * Fixing scaling issue w. emoji in Sidebar Author Profile Had the same issue as in mmistakes#1554 So should there be more demand for having emojis in sidebar, this style change fixes it * Fix indendation and nesting * Update CHANGELOG and history * Fix: use relative links for menu items when possible (#1783) (#1784) * Update CHANGELOG and history * Fix capitalization * Reduce padding and adjust toc `font-size` Fit more text to handle indentation better. Ref: #1782 * Allow heading levels 1-6 in table of contents Adjust minimum and maximum levels to allow all headings and fix CSS to style indentation and nested lists properly in jekyll-toc and Kramdown generated table of contents. Fixes #1782 * Add table of contents test posts * Add table of contents test post * Update jekyll-toc to v1.0.5 * Update CHANGELOG and history * Add table of contents test posts * Adjust toc indents * Fix heading levels in comments section * Fix TOC icon * Wrap Liquid tag with `{% raw %}` * New comment by Richard Rich Steinmetz (#1796) * Add Italian translation for search (#1793) * Add missing translation texts * Update CHANGELOG and history * Release 4.12.2 💎 * Update CHANGELOG and history * Place `:hover` declarations after `:visited` to fix hover animation Fixes #1820 * Update CHANGELOG and history * Fix sidebar navigation list toggle. Prettier managled `@include breakpoint` media queries causing the input/checkbox toggle hack styles to go missing. Fixes #1819 * Add support to gallery helper for defining column layout e.g. `{% include gallery id="gallery" layout="half" caption="2 column gallery caption" %} Fixes #1821 * Add header `actions` array support for multiple call to action links ``` header: overlay_image: /assets/images/unsplash-image-1.jpg og_image: /assets/images/page-header-og-image.png caption: "Photo credit: [**Unsplash**](https://unsplash.com)" actions: - label: "Learn More" url: "https://unsplash.com" ``` Fixes #1461 * Improve author link flexibility Deprecate social networking links in `_config.yml` in favor or new `author.links` array for any link and in any order. All of Font Awesome's icons are available for use. ``` author: links: - label: "Your Website" icon: "fas fa-fw fa-link" url: "https://your-site.com" - label: "Twitter" icon: "fab fa-fw fa-twitter-square" url: "https://twitter.com/username" - label: "GitHub" icon: "fab fa-fw fa-github" url: "https://github.com/username" - label: "Instagram" icon: "fab fa-fw fa-instagram" url: "https://instagram.com/username" ``` Fixes #1581 * Improve footer link flexibility Deprecate hardcoded footer links in favor or new `footer.links` array for any link and in any order. All of Font Awesome's icons are available for use. ``` footer: links: - label: "Twitter" icon: "fab fa-fw fa-twitter-square" url: "https://twitter.com/username" - label: "GitHub" icon: "fab fa-fw fa-github" url: "https://github.com/username" - label: "Instagram" icon: "fab fa-fw fa-instagram" url: "https://instagram.com/username" ``` * Update CHANGELOG and history * Add social icon colors for Reddit and Mastodon * Update ui-text.yml with Romanian translation (#1814) * Update ui-text.yml with Romanian translation Added the translations for Romanian * Update ui-text.yml Corrected „less_than” with a proper translation for the context where it is being used * Update docs Added Romanian to the languages list * Add Romanian localized UI text strings * Release 4.13.0 💎 * Remove deprecated `base_path` include helper * Properly apply `relative_url` filter to internal links in header overlay `actions` array * Always load Google 404 Linkhelp script over HTTPS (#1829) Also removed unneeded type * Update CHANGELOG and history * Update Font Awesome to latest version (#1830) * Update CHANGELOG and history * Remove unneeded HandheldFriendly and MobileOptimized meta tags (#1837) Fixes: #1835 * Update CHANGELOG and history * Update algolia-search-scripts.html (#1836) not needed for HTML5 and saves a few bytes by removing * Update CHANGELOG and history * Allow custom Staticman endpoints (#1845) * Update CHANGELOG and history * Change GitHub issue templates * New comment by Bobby (#1863) * Make entire archive/feature item "clickable" (#1864) * Make entire feature item "clickable" Use a pseudo element on the call to action button to cover the entire feature item and make it "clickable". * Make entire archive item "clickable" Use a pseudo element on the `` element to cover the entire archive item and make it "clickable". * Update CHANGELOG and history * Reference issue * Cache "static" includes to improve build performance (#1874) * Add jekyll-include-cache plugin * Cache "static" includes to improve build performance * Update CHANGELOG and history "Static" refers to those includes that don't rely on data passed from the page content. * Add notice for fixing `Unknown tag 'include_cached'` Fixes #1875 * Add jekyll-include-cache to docs `Gemfile` * Move jekyll-include-cache notice up * Fix Lunr search index merging words (#1884) Close #1883 * Update CHANGELOG and history * Update LUNR to 2.3.3 (#1885) Close #1882 * Update CHANGELOG and history * Update license (#1886) * Fix license path * Fix Algolia search link positioning (#1904) * Add link for testing purposes * Fix excerpt link positioning in Algolia search results * Fix Algolia search input color * Update CHANGELOG and history Fixes #1903 * Revert caching for comments and analytics. Fixes #1905 (#1907) * Update history * Hindi Translation of ui-text #1887 (#1888) * Hindi Translation of ui-text #1887 * Update README.md and about.md * Update CHANGELOG and history * New comment by Jair G (#1911) * Fix breadcrumb navigation alignment Fixes #1917 * Improve color contrast of primary buttons and links * Remove unnecessary closing bracket (#1915) * Update CHANGELOG and history * Fix link * Fix link * Fix broken link in layout documentation Close #1940 * add integrity hash for Font Awesome script (#1922) * add integrity hash for Font Awesome script As the script is loaded from an external CDN (use.fontawesome.com), its integrity must be ensured mainly for security reasons. This hash must be updated together with the exact version of Font Awesome, as given on their website. * Update to FontAwesome 5.5.0 * Update CHANGELOG and history * Add rel attribute to social media links in author profile and fotter (#1924) * Update CHANGELOG and history * Add `crossorigin` attribute to FontAwesome script ref #1922 * Fix FontAwesome script ref #1922 * Add `jekyll-include-cache` installation instructions * Update 05-configuration.md (#1956) * Update last modified time * Added missing ref attribute (#1959) As suggested by @mmistakes in https://github.com/mmistakes/minimal-mistakes/issues/1948#issuecomment-439888193 * Use privacy aware embed options for YouTube & Vimeo (#1964) * Update CHANGELOG and history * Punjabi Translation of ui-text (#1962) * Punjabi Translation of ui-text There are more than 100 million native speakers of Punjabi language. I am one of them. More details about [punjabi on wikipedia](https://en.wikipedia.org/wiki/Punjabi_language). All the punjabi translations are perfect with the following exceptions- - in the variable name (_config.yml and words_per_minute) which are intentionally left in english. - meta_label is empty * Update CHANGELOG and history * Add support for utterances (#1966) * Add support for utterances * Add utterances config documentation * Update CHANGELOG and history Close #1909 * Update localized text list * Update README.md * Update theme documentation * Increase font-size * Increase padding * Add focus color * Adjust navigation toggles * Use dark syntax highlighting * Update CHANGELOG and history * Add Google Drive as video provider (#1967) * Add Google Drive provider documentation * Update CHANGELOG and history * Changed schema.org to secure links (https) (#1969) * Update CHANGELOG and history * Prevent current post from showing in the "You may also enjoy" (related (#1976) posts) section * Update CHANGELOG and history * Change teaser image * Disable comments * Add hover state * Release 4.14.0 💎 * Update CHANGELOG * Fix closed navicon on hover * Release 4.14.1 gem * Update NPM dependencies cc/ #1977 * Change remaining schema.org markup to `https` (#1978) * Update CHANGELOG and history * Update about.md (#1981) Just a minor addition, the word Hindi written in devnagri script (the script used for this language). Makes it easier to visually understand what script we are talking about. * Update README.md (#1982) Just a minor addition, the word Hindi written in devnagri script (the script used for this language). Makes it easier to visually understand what script we are talking about. * Fix function name for Google Custom Search (#1983) fbafe58e40b1bd4a2628aef1eb5955ab57dcfaf4 renamed the function in the scripts file, but did not rename the call sites. * Update CHANGELOG and history * Allow sidebar navs with custom sidebar content Multiple sidebar navs can also be included on a page: ``` sidebar: - title: Navigation 1 nav: nav1 - title: Navigation 2 nav: nav2 ``` Fixes #1986 * Update test post * Update CHANGELOG and history * Update YAML example * Fix broken image Close #1994 * Fix broken image * HTTPS Twitter short link (#2001) * Fixed Netlify typo (#2013) * update font awesome (#1995) REF: https://fontawesome.com/changelog/latest * Update CHANGELOG and history * Remove unused variables (#1996) * Update CHANGELOG and history * [Bug fix]: Added missing Staticman Spanish UI text (#1997) Taken from line 91 of 5d-eu/messages.php@ec56008 * Update CHANGELOG and history * Persian Translation of UI Elements (#2004) * Add Persian translation to ui-text.yml * Mention the added Persian translation in the documentation * Update CHANGELOG and history * shorter IE conditional statement (#2006) saves 5 bytes :-) * Update CHANGELOG and history * Fix typo * lunr 2.3.5 update (#2010) * Update CHANGELOG and history * Fix wide tables that overflow parent container Close #2008 * Accessibility: Add aria-label to the search button (#2014) * Accessibility: Add aria-label to the search button * Update button aria text * Add aria text to menu toggle * Add span for search toggle * Update span for menu label & remove aria * Update ui-text.yml to add search_label * Update * Update CHANGELOG and history * Update copyright year * Release 4.14.2 💎 * MAINT: remove .github directory * BUG: fixed minor typo --- LICENSE | 21 + LICENSE.txt | 63 - _config.yml | 76 +- _data/ui-text.yml | 197 +- _includes/archive-single.html | 2 +- _includes/author-profile-custom-links.html | 2 +- _includes/author-profile.html | 104 +- _includes/base_path | 5 - _includes/breadcrumbs.html | 6 +- _includes/comment.html | 4 +- _includes/comments-providers/scripts.html | 2 + _includes/comments-providers/staticman.html | 4 +- .../comments-providers/staticman_v2.html | 4 +- _includes/comments-providers/utterances.html | 20 + _includes/comments.html | 7 +- _includes/footer.html | 22 +- _includes/gallery | 14 +- _includes/head.html | 8 +- _includes/masthead.html | 21 +- _includes/page__hero.html | 13 +- _includes/scripts.html | 8 +- _includes/search/algolia-search-scripts.html | 6 +- _includes/search/search_form.html | 4 +- _includes/seo.html | 4 +- _includes/sidebar.html | 1 + _includes/toc.html | 36 +- _includes/video | 6 +- _layouts/default.html | 16 +- _layouts/search.html | 4 +- _layouts/single.html | 9 +- _layouts/splash.html | 2 +- _pages/404.md | 6 +- _posts/2018-08-31-bayesian-bandits.md | 2 +- _sass/minimal-mistakes.scss | 6 +- _sass/minimal-mistakes/_archive.scss | 90 +- _sass/minimal-mistakes/_base.scss | 13 +- _sass/minimal-mistakes/_buttons.scss | 8 +- _sass/minimal-mistakes/_masthead.scss | 9 +- _sass/minimal-mistakes/_mixins.scss | 4 +- _sass/minimal-mistakes/_navigation.scss | 78 +- _sass/minimal-mistakes/_page.scss | 2 +- _sass/minimal-mistakes/_search.scss | 9 +- _sass/minimal-mistakes/_sidebar.scss | 20 +- _sass/minimal-mistakes/_tables.scss | 2 + _sass/minimal-mistakes/_utilities.scss | 27 +- _sass/minimal-mistakes/_variables.scss | 17 +- _sass/minimal-mistakes/skins/_dark.scss | 22 +- _sass/minimal-mistakes/skins/_neon.scss | 4 + _sass/minimal-mistakes/skins/_plum.scss | 4 + assets/js/lunr/lunr-en.js | 4 +- assets/js/lunr/lunr-gr.js | 4 +- assets/js/lunr/lunr-store.js | 6 +- assets/js/lunr/lunr.js | 687 ++++- assets/js/lunr/lunr.min.js | 7 +- assets/js/main.min.js | 12 +- package-lock.json | 2321 +++++++++++++++++ package.json | 22 +- 57 files changed, 3640 insertions(+), 437 deletions(-) create mode 100644 LICENSE delete mode 100644 LICENSE.txt delete mode 100644 _includes/base_path create mode 100644 _includes/comments-providers/utterances.html create mode 100644 package-lock.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..af1e9d4727c9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013-2019 Michael Rose and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index afcb825ce2e9..000000000000 --- a/LICENSE.txt +++ /dev/null @@ -1,63 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2018 Michael Rose and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Minimal Mistakes incorporates icons from [The Noun Project](https://thenounproject.com/) -creators Garrett Knoll, Arthur Shlain, and Tracy Tam. -Icons are distributed under Creative Commons Attribution 3.0 United States (CC BY 3.0 US). - -Minimal Mistakes incorporates [Font Awesome](http://fontawesome.io/), -Copyright (c) 2017 Dave Gandy. -Font Awesome is distributed under the terms of the [SIL OFL 1.1](http://scripts.sil.org/OFL) -and [MIT License](http://opensource.org/licenses/MIT). - -Minimal Mistakes incorporates photographs from [Unsplash](https://unsplash.com). - -Minimal Mistakes incorporates [Susy](http://susy.oddbird.net/), -Copyright (c) 2017, Miriam Eric Suzanne. -Susy is distributed under the terms of the [BSD 3-clause "New" or "Revised" License](https://opensource.org/licenses/BSD-3-Clause). - -Minimal Mistakes incorporates [Breakpoint](http://breakpoint-sass.com/). -Breakpoint is distributed under the terms of the [MIT/GPL Licenses](http://opensource.org/licenses/MIT). - -Minimal Mistakes incorporates [FitVids.js](https://github.com/davatron5000/FitVids.js/), -Copyright (c) 2013 Dave Rubert and Chris Coyier. -FitVids is distributed under the terms of the [WTFPL License](http://sam.zoy.org/wtfpl/). - -Minimal Mistakes incorporates [Magnific Popup](http://dimsemenov.com/plugins/magnific-popup/), -Copyright (c) 2014-2016 Dmitry Semenov, http://dimsemenov.com. -Magnific Popup is distributed under the terms of the MIT License. - -Minimal Mistakes incorporates [jQuery Smooth Scroll](https://github.com/kswedberg/jquery-smooth-scroll), -Copyright (c) 2017 Karl Swedberg. -jQuery Smooth Scroll is distributed under the terms of the [MIT License](http://opensource.org/licenses/MIT). - -Minimal Mistakes incorporates [GreedyNav.js](https://github.com/lukejacksonn/GreedyNav), -Copyright (c) 2015 Luke Jackson. -GreedyNav.js is distributed under the terms of the [MIT License](http://opensource.org/licenses/MIT). - -Minimal Mistakes incorporates [Jekyll Group-By-Array](https://github.com/mushishi78/jekyll-group-by-array), -Copyright (c) 2015 Max White . -Jekyll Group-By-Array is distributed under the terms of the [MIT License](http://opensource.org/licenses/MIT). - -Minimal Mistakes incorporates [Lunr](http://lunrjs.com), -Copyright (c) 2017 Oliver Nightingale. -Lunr is distributed under the terms of the [MIT License](http://opensource.org/licenses/MIT). diff --git a/_config.yml b/_config.yml index e8a8d2c2ccb9..21d54d05348b 100644 --- a/_config.yml +++ b/_config.yml @@ -25,7 +25,7 @@ teaser : # path of fallback teaser image, e.g. "/assets/images #breadcrumbs : true # true, false (default) words_per_minute : 150 comments: - provider : "disqus" # false (default), "disqus", "discourse", "facebook", "google-plus", "staticman", "staticman_v2" "custom" + provider : "disqus" # false (default), "disqus", "discourse", "facebook", "google-plus", "staticman", "staticman_v2", "utterances", "custom" disqus: shortname : "eigenfoo" # https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname- discourse: @@ -35,8 +35,25 @@ comments: appid : num_posts : # 5 (default) colorscheme : # "light" (default), "dark" + utterances: + theme : # "github-light" (default), "github-dark" staticman: - branch : + allowedFields : # ['name', 'email', 'url', 'message'] + branch : # "master" + commitMessage : # "New comment by {fields.name}" + filename : # comment-{@timestamp} + format : # "yml" + moderation : # true + path : # "/_data/comments/{options.slug}" (default) + requiredFields : # ['name', 'email', 'message'] + transforms: + email : # "md5" + generatedFields: + date: + type : # "date" + options: + format : # "iso8601" (default), "timestamp-seconds", "timestamp-milliseconds" + endpoint : # URL of your own deployment with trailing slash, will fallback to the public instance reCaptcha: siteKey : secret : @@ -89,33 +106,32 @@ author: avatar : /assets/images/profile-pic.jpg # path of avatar image, e.g. "/assets/images/bio-photo.jpg" bio : "PyData ninja, machine learner, coffee addict and general practitioner (get it, GP?) of Bayesian necromancy." location : "NYC | HKG" - email : https://github.com/raw/eigenfoo/eigenfoo.xyz/master/assets/images/email.png - uri : - home : # null (default), "absolute or relative url to link to author home" - bitbucket : - codepen : - dribbble : - flickr : - facebook : - foursquare : - github : eigenfoo - gitlab : - google_plus : - keybase : - instagram : - lastfm : - linkedin : eigenfoo # "john-doe-12345678" (the last part of your profile url, e.g. https://www.linkedin.com/in/john-doe-12345678) - medium : - pinterest : - soundcloud : - stackoverflow : # "123456/username" (the last part of your profile url, e.g. https://stackoverflow.com/users/123456/username) - steam : # "steamId" (the last part of your profile url, e.g. https://steamcommunity.com/id/steamId/) - tumblr : - twitter : _eigenfoo - vine : - weibo : - xing : - youtube : # "https://youtube.com/c/MichaelRoseDesign" + links: + - label: "Email" + icon: "fas fa-fw fa-envelope-square" + url: https://github.com/raw/eigenfoo/eigenfoo.xyz/master/assets/images/email.png + - label: "Twitter" + icon: "fab fa-fw fa-twitter-square" + url: "https://twitter.com/@_eigenfoo/" + - label: "GitHub" + icon: "fab fa-fw fa-github" + url: "https://github.com/eigenfoo/" + - label: "LinkedIn" + icon: "fab fa-fw fa-linkedin" + url: "https://www.linkedin.com/in/eigenfoo/" + +# Site Footer +footer: + links: + - label: "Twitter" + icon: "fab fa-fw fa-twitter-square" + url: "https://twitter.com/@_eigenfoo/" + - label: "GitHub" + icon: "fab fa-fw fa-github" + url: "https://github.com/eigenfoo/" + - label: "LinkedIn" + icon: "fab fa-fw fa-linkedin" + url: "https://www.linkedin.com/in/eigenfoo/" # Reading Files @@ -196,6 +212,7 @@ plugins: - jekyll-gist - jekyll-feed - jemoji + - jekyll-include-cache # mimic GitHub Pages with --safe whitelist: @@ -204,6 +221,7 @@ whitelist: - jekyll-gist - jekyll-feed - jemoji + - jekyll-include-cache # Archives diff --git a/_data/ui-text.yml b/_data/ui-text.yml index 7dd16f36e2ed..d0d0da85ff72 100644 --- a/_data/ui-text.yml +++ b/_data/ui-text.yml @@ -8,9 +8,10 @@ en: &DEFAULT_EN pagination_next : "Next" breadcrumb_home_label : "Home" breadcrumb_separator : "/" - menu_label : "Toggle Menu" - toc_label : "On This Page" - ext_link_label : "Direct Link" + menu_label : "Toggle menu" + search_label : "Toggle search" + toc_label : "On this page" + ext_link_label : "Direct link" less_than : "less than" minute_read : "minute read" share_on_label : "Share on" @@ -18,16 +19,16 @@ en: &DEFAULT_EN tags_label : "Tags:" categories_label : "Categories:" date_label : "Updated:" - comments_label : "Leave a Comment" + comments_label : "Leave a comment" comments_title : "Comments" - more_label : "Learn More" - related_label : "You Might Like" + more_label : "Learn more" + related_label : "You may also enjoy" follow_label : "Follow:" feed_label : "Feed" powered_by : "Powered by" website_label : "Website" email_label : "Email" - recent_posts : "Recent Posts" + recent_posts : "Recent posts" undefined_wpm : "Undefined parameter words_per_minute at _config.yml" comment_form_info : "Your email address will not be published. Required fields are marked" comment_form_comment_label : "Comment" @@ -35,7 +36,7 @@ en: &DEFAULT_EN comment_form_name_label : "Name" comment_form_email_label : "Email address" comment_form_website_label : "Website (optional)" - comment_btn_submit : "Submit Comment" + comment_btn_submit : "Submit comment" comment_btn_submitted : "Submitted" comment_success_msg : "Thanks for your comment! It will show on the site once it has been approved." comment_error_msg : "Sorry, there was an error with your submission. Please make sure all required fields have been completed and try again." @@ -61,6 +62,7 @@ es: &DEFAULT_ES breadcrumb_home_label : "Inicio" breadcrumb_separator : "/" menu_label : + search_label : toc_label : "Contenidos" ext_link_label : "Enlace" less_than : "menos de" @@ -70,8 +72,8 @@ es: &DEFAULT_ES tags_label : "Etiquetas:" categories_label : "Categorías:" date_label : "Actualizado:" - comments_label : "Comentar" - comments_title : + comments_label : "Dejar un comentario" + comments_title : "Comentar" more_label : "Ver más" related_label : "Podrías ver también" follow_label : "Seguir:" @@ -105,18 +107,19 @@ fr: &DEFAULT_FR pagination_next : "Suivant" breadcrumb_home_label : "Accueil" breadcrumb_separator : "/" - menu_label : + menu_label : "Menu" + search_label : toc_label : "Sur cette page" ext_link_label : "Lien direct" less_than : "moins de" - minute_read : "minute de lecture" + minute_read : "minute(s) de lecture" share_on_label : "Partager sur" meta_label : tags_label : "Tags :" categories_label : "Catégories :" date_label : "Mis à jour :" comments_label : "Laisser un commentaire" - comments_title : + comments_title : "Commentaires" more_label : "Lire plus" related_label : "Vous pourriez aimer aussi" follow_label : "Contact" @@ -126,7 +129,6 @@ fr: &DEFAULT_FR email_label : "Email" recent_posts : "Posts récents" undefined_wpm : "Le paramètre words_per_minute n'est pas défini dans _config.yml" - comments_title : "Commentaires" comment_form_info : "Votre adresse email ne sera pas visible. Les champs obligatoires sont marqués" comment_form_comment_label : "Commentaire" comment_form_md_info : "Markdown est supporté." @@ -138,6 +140,9 @@ fr: &DEFAULT_FR comment_success_msg : "Merci pour votre commentaire, il sera visible sur le site une fois approuvé." comment_error_msg : "Désolé, une erreur est survenue lors de la soumission. Vérifiez que les champs obligatoires ont été remplis et réessayez." loading_label : "Chargement..." + search_placeholder_text : "Entrez votre recherche..." + results_found : "Aucun résultat trouvé" + back_to_top : "Retour en haut" fr-FR: <<: *DEFAULT_FR fr-BE: @@ -154,6 +159,7 @@ tr: &DEFAULT_TR breadcrumb_home_label : "Ana Sayfa" breadcrumb_separator : "/" menu_label : + search_label : toc_label : "İçindekiler" ext_link_label : "Doğrudan Bağlantı" less_than : "Şu süreden az: " @@ -197,6 +203,7 @@ pt: &DEFAULT_PT breadcrumb_home_label : "Início" breadcrumb_separator : "/" menu_label : + search_label : toc_label : "Nesta Página" ext_link_label : "Link Direto" less_than : "menos de" @@ -238,6 +245,7 @@ pt-BR: breadcrumb_home_label : "Home" breadcrumb_separator : "/" menu_label : + search_label : toc_label : "Nesta página" ext_link_label : "Link direto" less_than : "menos que" @@ -279,6 +287,7 @@ it: &DEFAULT_IT breadcrumb_home_label : "Home" breadcrumb_separator : "/" menu_label : + search_label : toc_label : "Indice della pagina" ext_link_label : "Link" less_than : "meno di" @@ -310,6 +319,9 @@ it: &DEFAULT_IT comment_success_msg : "Grazie per il tuo commento! Verrà visualizzato nel sito una volta che sarà approvato." comment_error_msg : "C'è stato un errore con il tuo invio. Assicurati che tutti i campi richiesti siano stati completati e riprova." loading_label : "Caricamento..." + search_placeholder_text : "Inserisci termini di ricerca..." + results_found : "Risultati" + back_to_top : "Vai su" it-IT: <<: *DEFAULT_IT @@ -322,6 +334,7 @@ zh: &DEFAULT_ZH_HANS breadcrumb_home_label : "首页" breadcrumb_separator : "/" menu_label : "切换菜单" + search_label : toc_label : "在本页上" ext_link_label : "直接链接" less_than : "少于" @@ -365,6 +378,7 @@ zh-TW: &DEFAULT_ZH_HANT breadcrumb_home_label : "首頁" breadcrumb_separator : "/" menu_label : "切換選單" + search_label : toc_label : "本頁" ext_link_label : "外部連結" less_than : "少於" @@ -408,6 +422,7 @@ de: &DEFAULT_DE breadcrumb_home_label : "Start" breadcrumb_separator : "/" menu_label : "Menü ein-/ausschalten" + search_label : toc_label : "Auf dieser Seite" ext_link_label : "Direkter Link" less_than : "weniger als" @@ -463,6 +478,7 @@ ne: &DEFAULT_NE breadcrumb_home_label : "गृह" breadcrumb_separator : "/" menu_label : "टगल मेनु" + search_label : toc_label : "यो पृष्‍ठमा" ext_link_label : "सिधा सम्पर्क" less_than : "कम्तिमा" @@ -506,6 +522,7 @@ ko: &DEFAULT_KO breadcrumb_home_label : "Home" breadcrumb_separator : "/" menu_label : "토글 메뉴" + search_label : toc_label : "On This Page" ext_link_label : "직접 링크" less_than : "최대" @@ -549,6 +566,7 @@ ru: &DEFAULT_RU breadcrumb_home_label : "Главная" breadcrumb_separator : "/" menu_label : "Выпадающее меню" + search_label : toc_label : "Содержание" ext_link_label : "Прямая ссылка" less_than : "менее" @@ -594,6 +612,7 @@ lt: &DEFAULT_LT breadcrumb_home_label : "Pagrindinis" breadcrumb_separator : "/" menu_label : "Meniu rodymas" + search_label : toc_label : "Turinys" ext_link_label : "Tiesioginė nuoroda" less_than : "mažiau nei" @@ -637,6 +656,7 @@ gr: &DEFAULT_GR breadcrumb_home_label : "Αρχική" breadcrumb_separator : "/" menu_label : "Μενού" + search_label : toc_label : "Περιεχόμενα" ext_link_label : "Εξωτερικός Σύνδεσμος" less_than : "Λιγότερο από" @@ -682,6 +702,7 @@ sv: &DEFAULT_SV breadcrumb_home_label : "Hem" breadcrumb_separator : "/" menu_label : "Meny ridå" + search_label : toc_label : "På denna sida" ext_link_label : "Direkt länk" less_than : "mindre än" @@ -727,6 +748,7 @@ nl: &DEFAULT_NL breadcrumb_home_label : "Home" breadcrumb_separator : "/" menu_label : "Wissel Menu" + search_label : toc_label : "Op deze pagina" ext_link_label : "Directe Link" less_than : "minder dan" @@ -772,6 +794,7 @@ id: &DEFAULT_ID breadcrumb_home_label : "Home" breadcrumb_separator : "/" menu_label : "Menu Toggle" + search_label : toc_label : "Pada Halaman Ini" ext_link_label : "Link langsung" less_than : "Kurang dari" @@ -815,6 +838,7 @@ vi: &DEFAULT_VI breadcrumb_home_label : "Trang chủ" breadcrumb_separator : "/" menu_label : "Menu" + search_label : toc_label : "Tại trang này" ext_link_label : "Đường dẫn trực tiếp" less_than : "nhỏ hơn" @@ -858,6 +882,7 @@ da: &DEFAULT_DA breadcrumb_home_label : "Home" breadcrumb_separator : "/" menu_label : "Vis/skjul menu" + search_label : toc_label : "På denne side" ext_link_label : "Direkte link" less_than : "mindre end" @@ -904,6 +929,7 @@ pl: &DEFAULT_PL breadcrumb_home_label : "Strona główna" breadcrumb_separator : "/" menu_label : "Przełącz menu" + search_label : toc_label : "Spis treści" ext_link_label : "Link bezpośredni" less_than : "mniej niż" @@ -947,6 +973,7 @@ ja: &DEFAULT_JA breadcrumb_home_label : "ホーム" breadcrumb_separator : "/" menu_label : "メニュー" + search_label : toc_label : "目次" ext_link_label : "リンク" less_than : @@ -992,6 +1019,7 @@ sk: &DEFAULT_SK breadcrumb_home_label : "Domov" breadcrumb_separator : "/" menu_label : "Menu" + search_label : toc_label : "Obsah" ext_link_label : "Priamy odkaz" less_than : "menej ako" @@ -1038,6 +1066,7 @@ hu: &DEFAULT_HU breadcrumb_home_label : "Kezdőlap" breadcrumb_separator : "/" menu_label : "Menü nyit/zár" + search_label : toc_label : "Ezen az oldalon" ext_link_label : "Közvetlen Link" less_than : "kevesebb mint" @@ -1075,6 +1104,146 @@ hu: &DEFAULT_HU hu-HU: <<: *DEFAULT_HU +# Romanian +# ----------------- +ro: &DEFAULT_RO + page : "Pagina" + pagination_previous : "Anterior" + pagination_next : "Următor" + breadcrumb_home_label : "Acasă" + breadcrumb_separator : "/" + menu_label : "Comută meniul" + search_label : + toc_label : "Pe această pagină" + ext_link_label : "Link direct" + less_than : "mai puțin de" + minute_read : "minute de citit" + share_on_label : "Distribuie pe" + meta_label : + tags_label : "Etichete:" + categories_label : "Categorii:" + date_label : "Actualizat:" + comments_label : "Lasă un comentariu" + comments_title : "Comentarii" + more_label : "Citește mai departe" + related_label : "S-ar putea să-ți placă" + follow_label : "Urmărește:" + feed_label : "Feed RSS" + powered_by : "Cu sprijinul" + website_label : "Site" + email_label : "Email" + recent_posts : "Articole recente" + undefined_wpm : "Parametru words_per_minute nedefinit în _config.yml" + comment_form_info : "Adresa ta de email nu va fi făcută publică. Câmpurile marcate sunt obligatorii" + comment_form_comment_label : "Comentariu" + comment_form_md_info : "Markdown este suportat." + comment_form_name_label : "Nume" + comment_form_email_label : "Adresă de email" + comment_form_website_label : "Site (opțional)" + comment_btn_submit : "Trimite comentariul" + comment_btn_submitted : "Trimis" + comment_success_msg : "Mulțumesc pentru comentariu! Va apărea pe site în momentul în care va fi aprobat." + comment_error_msg : "Scuze, este o problemă cu comentariul tău. Asigură-te că toate câmpurile obligatorii au fost completate și încearcă din nou." + loading_label : "Se încarcă..." + search_placeholder_text : "Caută ceva..." + results_found : "Rezultate găsite" + back_to_top : "Înapoi în susul paginii" +ro-RO: + <<: *DEFAULT_RO + +# Punjabi +# ----------------- +pa: &DEFAULT_PA + page : "ਸਫ਼ਾ" + pagination_previous : "ਪਿਛਲਾ" + pagination_next : "ਅਗਲਾ " + breadcrumb_home_label : "ਘਰ" + breadcrumb_separator : "/" + menu_label : "ਟੌਗਲ ਮੀਨੂ" + search_label : + toc_label : "ਇਸ ਸਫ਼ੇ 'ਤੇ" + ext_link_label : "ਸਿੱਧਾ ਸੰਪਰਕ" + less_than : "ਤੋਂ ਘੱਟ" + minute_read : "ਮਿੰਟ ਵਿੱਚ ਪੜਿਆ ਜਾ ਸਕਦਾ ਹੈ" + share_on_label : "ਸਾਂਝਾ ਕਰੋ" + meta_label : + tags_label : "ਟੈਗ" + categories_label : "ਵਰਗ" + date_label : "ਅਪਡੇਟ ਕੀਤਾ:" + comments_label : "ਇੱਕ ਟਿੱਪਣੀ ਛੱਡੋ" + comments_title : "ਟਿੱਪਣੀਆਂ" + more_label : "ਹੋਰ ਜਾਣੋ" + related_label : "ਤੁਸੀਂ ਇਸਦਾ ਆਨੰਦ ਵੀ ਲੈ ਸਕਦੇ ਹੋ" + follow_label : "ਫਾਲੋ ਅੱਪ ਕਰੋ:" + feed_label : "ਫੀਡ" + powered_by : "ਦੁਆਰਾ ਸੰਚਾਲਿਤ" + website_label : "ਵੈੱਬਸਾਇਟ" + email_label : "ਈਮੇਲ" + recent_posts : "ਹਾਲ ਹੀ ਦੇ ਪੋਸਟ" + undefined_wpm : "_config.yml ਤੇ ਅਣ-ਪ੍ਰਭਾਸ਼ਿਤ ਪੈਰਾਮੀਟਰ words_per_minute" + comment_form_info : "ਤੁਹਾਡਾ ਈਮੇਲ ਪਤਾ ਪ੍ਰਕਾਸ਼ਿਤ ਨਹੀਂ ਕੀਤਾ ਜਾਵੇਗਾ। ਅਨੁਮਾਨਿਤ ਸਥਾਨਾਂ ਨੂੰ ਅੰਡਰਲਾਈਨ ਕੀਤਾ ਗਿਆ ਹੈ" + comment_form_comment_label : "ਟਿੱਪਣੀ" + comment_form_md_info : "ਮਾਰਕਡਾਊਨ ਵਰਤ ਸਕਦੇ ਹੋ।" + comment_form_name_label : "ਨਾਮ" + comment_form_email_label : "ਈਮੇਲ ਪਤਾ" + comment_form_website_label : "ਵੈਬਸਾਈਟ (ਵਿਕਲਪਿਕ)" + comment_btn_submit : "ਕੋਈ ਟਿੱਪਣੀ ਭੇਜੋ" + comment_btn_submitted : "ਪੇਸ਼ ਕੀਤਾ" + comment_success_msg : "ਤੁਹਾਡੀਆਂ ਟਿੱਪਣੀਆਂ ਲਈ ਧੰਨਵਾਦ! ਇਹ ਮਨਜ਼ੂਰੀ ਮਿਲਣ ਦੇ ਬਾਅਦ ਸਾਈਟ 'ਤੇ ਦਿਖਾਇਆ ਜਾਵੇਗਾ।" + comment_error_msg : "ਮੁਆਫ ਕਰਨਾ, ਤੁਹਾਡੀ ਅਧੀਨਗੀ ਵਿੱਚ ਕੋਈ ਗਲਤੀ ਹੋਈ ਸੀ ਕਿਰਪਾ ਕਰਕੇ ਯਕੀਨੀ ਬਣਾਓ ਕਿ ਸਾਰੇ ਲੋੜੀਂਦੇ ਖੇਤਰ ਪੂਰੇ ਹੋ ਗਏ ਹਨ ਅਤੇ ਦੁਬਾਰਾ ਕੋਸ਼ਿਸ਼ ਕਰੋ।" + loading_label : "ਲੋਡ ਹੋ ਰਿਹਾ ਹੈ..." + search_placeholder_text : "ਆਪਣੀ ਖੋਜ ਦੇ ਸ਼ਬਦ ਨੂੰ ਦਰਜ ਕਰੋ..." + results_found : "ਨਤੀਜਾ ਮਿਲਿਆ/ਮਿਲੇ" + back_to_top : "ਵਾਪਸ ਚੋਟੀ 'ਤੇ ਜਾਓ" +pa-IN: + <<: *DEFAULT_PA + +# Persian (Farsi) +# -------------- +fa: &DEFAULT_FA + page : "صفحه" + pagination_previous : "قبلی" + pagination_next : "بعدی" + breadcrumb_home_label : "صفحه اصلی" + breadcrumb_separator : "/" + menu_label : "فهرست" + toc_label : "در این صفحه" + ext_link_label : "لینک مستقیم" + less_than : " " + minute_read : "(طول مطالعه (دقیقه" + share_on_label : "اشتراک گذاری در" + meta_label : + tags_label : "تگ ها: " + categories_label : "دسته بندی ها: " + date_label : "به روز شده در: " + comments_label : "ارسال نظر" + comments_title : "نظرات" + more_label : "ادامه مطلب" + related_label : "ممکن است از این مطالب نیز لذت ببرید" + follow_label : "دنبال کنید: " + feed_label : "خوراک" + powered_by : "طراحی شده توسط" + website_label : "سایت اینترنتی" + email_label : "پست الکترونیک" + recent_posts : "آخرین مطالب" + undefined_wpm : ".(words_per_minute) _config.yml متغیر اشتباه در" + comment_form_info : ".آدرس ایمیل شما منتشر نخواهد شد. فیلدهای اجباری مشخص شده اند" + comment_form_comment_label : "دیدگاه" + comment_form_md_info : ".پشتیبانی می شود Markdown" + comment_form_name_label : "نام" + comment_form_email_label : "پست الکترونیک" + comment_form_website_label : "سایت اینترنتی (اختیاری)" + comment_btn_submit : "ارسال نظر" + comment_btn_submitted : "ارسال شد" + comment_success_msg : ".باتشکر از ارسال دیدگاه! پس از تأیید، این دیدگاه در سایت نشان داده خواهد شد" + comment_error_msg : ".متاسفانه در ارسال شما خطایی بود. لطفا مطمئن شوید تمام فیلدهای مورد نیاز تکمیل شده و دوباره امتحان کنید" + loading_label : "...بارگذاری" + search_placeholder_text : "...عبارت جستجوی خود را وارد کنید" + results_found : "نتایج" + back_to_top : "بازگشت به بالا" +fa-IR: + <<: *DEFAULT_FA + # Another locale # -------------- # diff --git a/_includes/archive-single.html b/_includes/archive-single.html index 530a4e00eb3a..f47e90deb692 100644 --- a/_includes/archive-single.html +++ b/_includes/archive-single.html @@ -11,7 +11,7 @@ {% endif %}
-
+
{% if include.type == "grid" and teaser %}
- + Custom Social Profile Link diff --git a/_includes/author-profile.html b/_includes/author-profile.html index de344c5257f2..aa0afa720fbc 100644 --- a/_includes/author-profile.html +++ b/_includes/author-profile.html @@ -1,7 +1,7 @@ {% assign author = page.author | default: page.authors[0] | default: site.author %} {% assign author = site.data.authors[author] | default: author %} -
+
{% if author.avatar %}
@@ -43,11 +43,19 @@

{{ author.name }}

diff --git a/_includes/gallery b/_includes/gallery index ab2fd618ecf8..97022aa881da 100644 --- a/_includes/gallery +++ b/_includes/gallery @@ -4,12 +4,16 @@ {% assign gallery = page.gallery %} {% endif %} -{% if gallery.size == 2 %} - {% assign gallery_layout = 'half' %} -{% elsif gallery.size >= 3 %} - {% assign gallery_layout = 'third' %} +{% if include.layout %} + {% assign gallery_layout = include.layout %} {% else %} - {% assign gallery_layout = '' %} + {% if gallery.size == 2 %} + {% assign gallery_layout = 'half' %} + {% elsif gallery.size >= 3 %} + {% assign gallery_layout = 'third' %} + {% else %} + {% assign gallery_layout = '' %} + {% endif %} {% endif %} -## Final remarks +## Final Remarks None of this theory is new: I'm just advertising it :blush:. See Cam Davidson-Pilon's great blog post about Bayesian bandits[^2] for a much more diff --git a/_sass/minimal-mistakes.scss b/_sass/minimal-mistakes.scss index 19dbdccea022..cf6adaeb5fe6 100644 --- a/_sass/minimal-mistakes.scss +++ b/_sass/minimal-mistakes.scss @@ -1,7 +1,7 @@ /*! - * Minimal Mistakes Jekyll Theme 4.12.0 by Michael Rose - * Copyright 2013-2018 Michael Rose - mademistakes.com | @mmistakes - * Licensed under MIT (https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt) + * Minimal Mistakes Jekyll Theme 4.14.2 by Michael Rose + * Copyright 2013-2019 Michael Rose - mademistakes.com | @mmistakes + * Licensed under MIT (https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE) */ /* Variables */ diff --git a/_sass/minimal-mistakes/_archive.scss b/_sass/minimal-mistakes/_archive.scss index 40d156e28cfa..cd42e137efe9 100644 --- a/_sass/minimal-mistakes/_archive.scss +++ b/_sass/minimal-mistakes/_archive.scss @@ -3,6 +3,7 @@ ========================================================================== */ .archive { + margin-top: 1em; margin-bottom: 2em; @include breakpoint($large) { @@ -17,6 +18,10 @@ } } +.archive__item { + position: relative; +} + .archive__subtitle { margin: 1.414em 0 0; padding-bottom: 0.5em; @@ -36,8 +41,13 @@ overflow: hidden; text-overflow: ellipsis; - a { - color: inherit; + a::before { + content: ''; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; } a + a { @@ -60,6 +70,10 @@ & + p { text-indent: 0; } + + a { + position: relative; + } } .archive__item-teaser { @@ -211,11 +225,16 @@ @include clearfix(); margin-bottom: 2em; border-bottom: 1px solid $border-color; + + .archive__item-title { + margin-bottom: 0; + } } .feature__item { + position: relative; margin-bottom: 2em; - font-size: 1.25rem; + font-size: 1.125em; @include breakpoint($small) { float: left; @@ -243,18 +262,46 @@ } } + .archive__item-body { + padding-left: gutter(1 of 12); + padding-right: gutter(1 of 12); + } + + a.btn::before { + content: ''; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + } + &--left { + position: relative; float: left; margin-left: 0; margin-right: 0; width: 100%; clear: both; - font-size: 1.25rem; + font-size: 1.125em; + + .archive__item { + float: left; + } .archive__item-teaser { margin-bottom: 2em; } + a.btn::before { + content: ''; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + } + @include breakpoint($small) { .archive__item-teaser { float: left; @@ -271,17 +318,31 @@ } &--right { + position: relative; float: left; margin-left: 0; margin-right: 0; width: 100%; clear: both; - font-size: 1.25rem; + font-size: 1.125em; + + .archive__item { + float: left; + } .archive__item-teaser { margin-bottom: 2em; } + a.btn::before { + content: ''; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + } + @include breakpoint($small) { text-align: right; @@ -291,7 +352,7 @@ } .archive__item-body { - float: right; + float: left; width: span(7 of 12); padding-left: gutter(0.5 of 12); padding-right: gutter(1 of 12); @@ -300,17 +361,32 @@ } &--center { + position: relative; float: left; margin-left: 0; margin-right: 0; width: 100%; clear: both; - font-size: 1.25rem; + font-size: 1.125em; + + .archive__item { + float: left; + width: 100%; + } .archive__item-teaser { margin-bottom: 2em; } + a.btn::before { + content: ''; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + } + @include breakpoint($small) { text-align: center; diff --git a/_sass/minimal-mistakes/_base.scss b/_sass/minimal-mistakes/_base.scss index 82d5e63d85f8..dd94cda17d60 100644 --- a/_sass/minimal-mistakes/_base.scss +++ b/_sass/minimal-mistakes/_base.scss @@ -130,15 +130,14 @@ a { @extend %tab-focus; } - &:hover, - &:active { - color: $link-color-hover; - outline: 0; - } - &:visited { color: $link-color-visited; } + + &:hover { + color: $link-color-hover; + outline: 0; + } } /* buttons */ @@ -168,7 +167,7 @@ figcaption > code, td > code { padding-top: 0.1rem; padding-bottom: 0.1rem; - font-size: $type-size-6; + font-size: 0.8em; background: $code-background-color; border-radius: $border-radius; diff --git a/_sass/minimal-mistakes/_buttons.scss b/_sass/minimal-mistakes/_buttons.scss index 6027eac73d78..e4394a193eb5 100644 --- a/_sass/minimal-mistakes/_buttons.scss +++ b/_sass/minimal-mistakes/_buttons.scss @@ -52,13 +52,13 @@ border: 1px solid #fff; } - &:hover { - @include yiq-contrasted(mix(#000, $color, 20%)); - } - &:visited { @include yiq-contrasted($color); } + + &:hover { + @include yiq-contrasted(mix(#000, $color, 20%)); + } } } diff --git a/_sass/minimal-mistakes/_masthead.scss b/_sass/minimal-mistakes/_masthead.scss index 3317c7fda8e2..2dfaed617a6d 100644 --- a/_sass/minimal-mistakes/_masthead.scss +++ b/_sass/minimal-mistakes/_masthead.scss @@ -18,8 +18,10 @@ padding: 1em; max-width: 100%; display: -webkit-box; + display: -ms-flexbox; display: flex; -webkit-box-pack: justify; + -ms-flex-pack: justify; justify-content: space-between; font-family: $sans-serif-narrow; @@ -39,11 +41,10 @@ .site-title { display: -webkit-box; + display: -ms-flexbox; display: flex; - padding: 0.5rem 0; - align-self: stretch; - -webkit-box-align: center; - align-items: center; + -ms-flex-item-align: center; + align-self: center; font-weight: bold; z-index: 20; } diff --git a/_sass/minimal-mistakes/_mixins.scss b/_sass/minimal-mistakes/_mixins.scss index 1d221fc8091e..4aa9eb09ca80 100644 --- a/_sass/minimal-mistakes/_mixins.scss +++ b/_sass/minimal-mistakes/_mixins.scss @@ -4,9 +4,9 @@ %tab-focus { /* Default*/ - outline: thin dotted $warning-color; + outline: thin dotted $focus-color; /* Webkit*/ - outline: 5px auto $warning-color; + outline: 5px auto $focus-color; outline-offset: -2px; } diff --git a/_sass/minimal-mistakes/_navigation.scss b/_sass/minimal-mistakes/_navigation.scss index b6606e633259..d0fe14eebc40 100644 --- a/_sass/minimal-mistakes/_navigation.scss +++ b/_sass/minimal-mistakes/_navigation.scss @@ -10,19 +10,14 @@ @include clearfix; margin: 0 auto; max-width: 100%; - padding-left: 2em; - padding-right: 2em; + padding-left: 1em; + padding-right: 1em; font-family: $sans-serif; -webkit-animation: $intro-transition; animation: $intro-transition; -webkit-animation-delay: 0.3s; animation-delay: 0.3s; - @include breakpoint($large) { - padding-left: 1em; - padding-right: 1em; - } - @include breakpoint($x-large) { max-width: $x-large; } @@ -34,11 +29,11 @@ @include breakpoint($large) { float: right; - width: span(10 of 12); + width: calc(100% - #{$right-sidebar-width-narrow}); } @include breakpoint($x-large) { - padding-left: gutter(0.5 of 12); + width: calc(100% - #{$right-sidebar-width}); } } @@ -176,15 +171,17 @@ .greedy-nav { position: relative; display: -webkit-box; + display: -ms-flexbox; display: flex; -webkit-box-align: center; + -ms-flex-align: center; align-items: center; + min-height: $nav-height; background: $background-color; a { display: block; margin: 0 1rem; - padding: 0.5rem 0; color: $masthead-link-color; text-decoration: none; @@ -198,26 +195,30 @@ } &__toggle { - padding: 0 0.5rem; - align-self: stretch; + -ms-flex-item-align: center; + align-self: center; + height: $nav-toggle-height; border: 0; outline: none; - color: #fff; - background-color: $primary-color; + background-color: transparent; cursor: pointer; } .visible-links { display: -webkit-box; + display: -ms-flexbox; display: flex; -webkit-box-pack: end; + -ms-flex-pack: end; justify-content: flex-end; -webkit-box-flex: 1; + -ms-flex: 1; flex: 1; overflow: hidden; li { -webkit-box-flex: 0; + -ms-flex: none; flex: none; } @@ -235,13 +236,13 @@ -webkit-transition: $global-transition; transition: $global-transition; -webkit-transform: scaleX(0) translate3d(0, 0, 0); - transform: scaleX(0) translate3d(0, 0, 0); /* hide*/ + transform: scaleX(0) translate3d(0, 0, 0); // hide } &:hover:before { -webkit-transform: scaleX(1); -ms-transform: scaleX(1); - transform: scaleX(1); /* reveal*/ + transform: scaleX(1); // reveal } } } @@ -255,6 +256,8 @@ border: 1px solid $border-color; border-radius: $border-radius; background: $background-color; + -webkit-box-shadow: 0 2px 4px 0 rgba(#000, 0.16), + 0 2px 10px 0 rgba(#000, 0.12); box-shadow: 0 2px 4px 0 rgba(#000, 0.16), 0 2px 10px 0 rgba(#000, 0.12); &.hidden { @@ -331,7 +334,7 @@ display: none; } - @include breakpoint(max-width ($large - 1px)) { + @include breakpoint(max-width $large - 1px) { label { position: relative; display: inline-block; @@ -437,7 +440,7 @@ font-weight: bold; } - @include breakpoint(max-width ($large - 1px)) { + @include breakpoint(max-width $large - 1px) { position: relative; max-height: 0; opacity: 0%; @@ -451,7 +454,7 @@ } } -@include breakpoint(max-width ($large - 1px)) { +@include breakpoint(max-width $large - 1px) { .nav__list input:checked ~ .nav__items { -webkit-transition: 0.5s ease-in-out; transition: 0.5s ease-in-out; @@ -467,7 +470,7 @@ .nav__title { margin: 0; - padding: 0.5rem 1rem; + padding: 0.5rem 0.75rem; font-family: $sans-serif-narrow; font-size: $type-size-5; font-weight: bold; @@ -476,7 +479,7 @@ .nav__sub-title { display: block; margin: 0.5rem 0; - padding: 0.5rem 0; + padding: 0.25rem 0; font-family: $sans-serif-narrow; font-size: $type-size-6; font-weight: bold; @@ -491,11 +494,10 @@ .toc { font-family: $sans-serif-narrow; color: $gray; - text-transform: uppercase; - letter-spacing: 1px; background-color: $background-color; border: 1px solid $border-color; border-radius: $border-radius; + -webkit-box-shadow: $box-shadow; box-shadow: $box-shadow; .nav__title { @@ -512,13 +514,16 @@ padding: 0; width: 100%; list-style: none; - font-size: 0.8rem; + font-size: $type-size-6; + + @include breakpoint($large) { + font-size: $type-size-7; + } a { display: block; - padding: 0.5rem 1rem; + padding: 0.25rem 0.75rem; color: $muted-text-color; - font-size: $type-size-7; font-weight: bold; line-height: 1.5; border-bottom: 1px solid $border-color; @@ -529,16 +534,23 @@ } li ul > li a { - padding-left: 1.75rem; + padding-left: 1.25rem; font-weight: normal; } - /* hide sub sub links on small screens*/ - li > ul li { - display: none; + li ul li ul > li a { + padding-left: 1.75rem; + } - @include breakpoint($medium) { - display: block; - } + li ul li ul li ul > li a { + padding-left: 2.25rem; + } + + li ul li ul li ul li ul > li a { + padding-left: 2.75rem; + } + + li ul li ul li ul li ul li ul > li a { + padding-left: 3.25rem } } diff --git a/_sass/minimal-mistakes/_page.scss b/_sass/minimal-mistakes/_page.scss index 78fc9bd917d1..7a37a1f8116a 100644 --- a/_sass/minimal-mistakes/_page.scss +++ b/_sass/minimal-mistakes/_page.scss @@ -5,7 +5,6 @@ #main { @include clearfix; margin-left: auto; - margin-top: 2em; margin-right: auto; padding-left: 1em; padding-right: 1em; @@ -34,6 +33,7 @@ .page__inner-wrap { float: left; + margin-top: 1em; margin-left: 0; margin-right: 0; width: 100%; diff --git a/_sass/minimal-mistakes/_search.scss b/_sass/minimal-mistakes/_search.scss index fe3c4367ea90..5ee24517a628 100644 --- a/_sass/minimal-mistakes/_search.scss +++ b/_sass/minimal-mistakes/_search.scss @@ -11,16 +11,17 @@ .search__toggle { margin-left: 1rem; margin-right: 1rem; + height: $nav-toggle-height; border: 0; outline: none; - color: $muted-text-color; + color: $primary-color; background-color: transparent; cursor: pointer; -webkit-transition: 0.2s; transition: 0.2s; &:hover { - color: $text-color; + color: mix(#000, $primary-color, 25%); } } @@ -114,12 +115,12 @@ } .archive__item-title .ais-Highlight { - color: $link-color; + color: $primary-color; font-style: normal; text-decoration: underline; } .archive__item-excerpt .ais-Highlight { - color: $link-color; + color: $primary-color; font-style: normal; font-weight: bold; } diff --git a/_sass/minimal-mistakes/_sidebar.scss b/_sass/minimal-mistakes/_sidebar.scss index 5eff7901e1a7..f7fc72dc4963 100644 --- a/_sass/minimal-mistakes/_sidebar.scss +++ b/_sass/minimal-mistakes/_sidebar.scss @@ -8,8 +8,6 @@ .sidebar { @include clearfix(); - margin-bottom: 1em; - @include breakpoint(max-width $large) { /* fix z-index order of follow links */ position: relative; @@ -31,10 +29,10 @@ &.sticky { overflow-y: auto; - /* calculate height of nav list */ - height: calc( - 100vh - 90px - 2em - ); // viewport height - approx. masthead height - main content top margin + /* calculate height of nav list + viewport height - nav height - masthead x-padding + */ + height: calc(100vh - #{$nav-height} - 2em); } } @@ -42,6 +40,11 @@ width: calc(#{$right-sidebar-width} - 1em); } + > * { + margin-top: 1em; + margin-bottom: 1em; + } + h2, h3, h4, @@ -60,6 +63,11 @@ img { width: 100%; + + &.emoji { + width: 20px; + height: 20px; + } } } diff --git a/_sass/minimal-mistakes/_tables.scss b/_sass/minimal-mistakes/_tables.scss index 05211df05344..c270a775bfa4 100644 --- a/_sass/minimal-mistakes/_tables.scss +++ b/_sass/minimal-mistakes/_tables.scss @@ -3,11 +3,13 @@ ========================================================================== */ table { + display: block; margin-bottom: 1em; width: 100%; font-family: $global-font-family; font-size: $type-size-6; border-collapse: collapse; + overflow-x: auto; & + table { margin-top: 1em; diff --git a/_sass/minimal-mistakes/_utilities.scss b/_sass/minimal-mistakes/_utilities.scss index d539dd12a2fc..b15f67147520 100644 --- a/_sass/minimal-mistakes/_utilities.scss +++ b/_sass/minimal-mistakes/_utilities.scss @@ -248,12 +248,21 @@ body:hover .visually-hidden button { color: $linkedin-color; } + .fa-mastodon, + .fa-mastodon-square { + color: $mastodon-color; + } + .fa-pinterest, .fa-pinterest-p, .fa-pinterest-square { color: $pinterest-color; } + .fa-reddit { + color: $reddit-color; + } + .fa-rss, .fa-rss-square { color: $rss-color; @@ -306,7 +315,7 @@ body:hover .visually-hidden button { position: relative; width: $navicon-width; height: $navicon-height; - background: #fff; + background: $primary-color; margin: auto; -webkit-transition: 0.3s; transition: 0.3s; @@ -318,7 +327,7 @@ body:hover .visually-hidden button { left: 0; width: $navicon-width; height: $navicon-height; - background: #fff; + background: $primary-color; -webkit-transition: 0.3s; transition: 0.3s; } @@ -357,6 +366,20 @@ body:hover .visually-hidden button { } } +.greedy-nav__toggle:hover { + .navicon, + .navicon:before, + .navicon:after { + background: mix(#000, $primary-color, 25%); + } + + &.close { + .navicon { + background: transparent; + } + } +} + /* Sticky, fixed to top content ========================================================================== */ diff --git a/_sass/minimal-mistakes/_variables.scss b/_sass/minimal-mistakes/_variables.scss index 4cf8b014209d..14fe3e3385a7 100644 --- a/_sass/minimal-mistakes/_variables.scss +++ b/_sass/minimal-mistakes/_variables.scss @@ -65,11 +65,12 @@ $border-color: $lighter-gray !default; $form-background-color: $lighter-gray !default; $footer-background-color: $lighter-gray !default; -$primary-color: #7a8288 !default; -$success-color: #62c462 !default; -$warning-color: #f89406 !default; +$primary-color: #6f777d !default; +$success-color: #3fa63f !default; +$warning-color: #d67f05 !default; $danger-color: #ee5f5b !default; -$info-color: #52adc8 !default; +$info-color: #3b9cba !default; +$focus-color: $primary-color !default; /* YIQ color contrast */ $yiq-contrasted-dark-default: $dark-gray !default; @@ -90,7 +91,9 @@ $google-plus-color: #dd4b39 !default; $instagram-color: #517fa4 !default; $lastfm-color: #d51007 !default; $linkedin-color: #007bb6 !default; +$mastodon-color: #2b90d9 !default; $pinterest-color: #cb2027 !default; +$reddit-color: #ff4500 !default; $rss-color: #fa9b39 !default; $soundcloud-color: #ff3300 !default; $stackoverflow-color: #fe7a15 !default; @@ -102,9 +105,9 @@ $youtube-color: #bb0000 !default; $xing-color: #006567 !default; /* links */ -$link-color: $info-color !default; +$link-color: mix(#000, $info-color, 15%) !default; $link-color-hover: mix(#000, $link-color, 25%) !default; -$link-color-visited: mix(#fff, $link-color, 25%) !default; +$link-color-visited: mix(#fff, $link-color, 15%) !default; $masthead-link-color: $primary-color !default; $masthead-link-color-hover: mix(#000, $primary-color, 25%) !default; $navicon-link-color-hover: mix(#fff, $primary-color, 75%) !default; @@ -151,6 +154,8 @@ $right-sidebar-width-wide: 400px !default; $border-radius: 4px !default; $box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125) !default; +$nav-height: 2em !default; +$nav-toggle-height: 2rem !default; $navicon-width: 1.5rem !default; $navicon-height: 0.25rem !default; $global-transition: all 0.2s ease-in-out !default; diff --git a/_sass/minimal-mistakes/skins/_dark.scss b/_sass/minimal-mistakes/skins/_dark.scss index 4f0a77e0028d..44f1bda06fdd 100644 --- a/_sass/minimal-mistakes/skins/_dark.scss +++ b/_sass/minimal-mistakes/skins/_dark.scss @@ -18,25 +18,11 @@ $masthead-link-color: $text-color !default; $masthead-link-color-hover: mix(#000, $text-color, 20%) !default; $navicon-link-color-hover: mix(#000, $background-color, 30%) !default; -/* dark syntax highlighting (base16) */ -$base00: #ffffff !default; -$base01: #e0e0e0 !default; -$base02: #d0d0d0 !default; -$base03: #b0b0b0 !default; -$base04: #000000 !default; -$base05: #101010 !default; -$base06: #151515 !default; -$base07: #202020 !default; -$base08: #ff0086 !default; -$base09: #fd8900 !default; -$base0a: #aba800 !default; -$base0b: #00c918 !default; -$base0c: #1faaaa !default; -$base0d: #3777e6 !default; -$base0e: #ad00a1 !default; -$base0f: #cc6633 !default; - .author__urls.social-icons .svg-inline--fa, .page__footer-follow .social-icons .svg-inline--fa { color: inherit; } + +.ais-search-box .ais-search-box--input { + background-color: $form-background-color; +} \ No newline at end of file diff --git a/_sass/minimal-mistakes/skins/_neon.scss b/_sass/minimal-mistakes/skins/_neon.scss index 5da3688f8183..649cbff28233 100644 --- a/_sass/minimal-mistakes/skins/_neon.scss +++ b/_sass/minimal-mistakes/skins/_neon.scss @@ -51,3 +51,7 @@ $base0f: #cc6633 !default; color: $text-color; } } + +.ais-search-box .ais-search-box--input { + background-color: $form-background-color; +} \ No newline at end of file diff --git a/_sass/minimal-mistakes/skins/_plum.scss b/_sass/minimal-mistakes/skins/_plum.scss index b777a8ea1657..67975d502786 100644 --- a/_sass/minimal-mistakes/skins/_plum.scss +++ b/_sass/minimal-mistakes/skins/_plum.scss @@ -58,3 +58,7 @@ $base0f: #cc6633 !default; color: $text-color; } } + +.ais-search-box .ais-search-box--input { + background-color: $form-background-color; +} \ No newline at end of file diff --git a/assets/js/lunr/lunr-en.js b/assets/js/lunr/lunr-en.js index c0a7c0ed8ed2..5ecfe13bab50 100644 --- a/assets/js/lunr/lunr-en.js +++ b/assets/js/lunr/lunr-en.js @@ -47,7 +47,7 @@ $(document).ready(function() { if(store[ref].teaser){ var searchitem = '
'+ - '
'+ + '
'+ '

'+ ''+store[ref].title+''+ '

'+ @@ -61,7 +61,7 @@ $(document).ready(function() { else{ var searchitem = '
'+ - '
'+ + '
'+ '

'+ ''+store[ref].title+''+ '

'+ diff --git a/assets/js/lunr/lunr-gr.js b/assets/js/lunr/lunr-gr.js index ef540cdb6681..bdde6a7ac367 100644 --- a/assets/js/lunr/lunr-gr.js +++ b/assets/js/lunr/lunr-gr.js @@ -500,7 +500,7 @@ $(document).ready(function() { if(store[ref].teaser){ var searchitem = '
'+ - '
'+ + '
'+ '

'+ ''+store[ref].title+''+ '

'+ @@ -514,7 +514,7 @@ $(document).ready(function() { else{ var searchitem = '
'+ - '
'+ + '
'+ '

'+ ''+store[ref].title+''+ '

'+ diff --git a/assets/js/lunr/lunr-store.js b/assets/js/lunr/lunr-store.js index 434b59978bee..660e9f2b23ed 100644 --- a/assets/js/lunr/lunr-store.js +++ b/assets/js/lunr/lunr-store.js @@ -18,7 +18,8 @@ var store = [ "title": {{ doc.title | jsonify }}, "excerpt": {%- if site.search_full_content == true -%} - {{ doc.content | + {{ doc.content | newline_to_br | + replace:"
", " " | replace:"

", " " | replace:"", " " | replace:"", " " | @@ -28,7 +29,8 @@ var store = [ replace:"", " "| strip_html | strip_newlines | jsonify }}, {%- else -%} - {{ doc.content | + {{ doc.content | newline_to_br | + replace:"
", " " | replace:"

", " " | replace:"", " " | replace:"", " " | diff --git a/assets/js/lunr/lunr.js b/assets/js/lunr/lunr.js index f208eba5a7a5..b37984ab68f3 100644 --- a/assets/js/lunr/lunr.js +++ b/assets/js/lunr/lunr.js @@ -1,6 +1,6 @@ /** - * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.1.5 - * Copyright (C) 2017 Oliver Nightingale + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.5 + * Copyright (C) 2018 Oliver Nightingale * @license MIT */ @@ -54,14 +54,15 @@ var lunr = function (config) { return builder.build() } -lunr.version = "2.1.5" +lunr.version = "2.3.5" /*! * lunr.utils - * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2018 Oliver Nightingale */ /** * A namespace containing utils for the rest of the lunr library + * @namespace lunr.utils */ lunr.utils = {} @@ -69,7 +70,8 @@ lunr.utils = {} * Print a warning message to the console. * * @param {String} message The message to be printed. - * @memberOf Utils + * @memberOf lunr.utils + * @function */ lunr.utils.warn = (function (global) { /* eslint-disable no-console */ @@ -90,7 +92,7 @@ lunr.utils.warn = (function (global) { * * @param {Any} obj The object to convert to a string. * @return {String} string representation of the passed object. - * @memberOf Utils + * @memberOf lunr.utils */ lunr.utils.asString = function (obj) { if (obj === void 0 || obj === null) { @@ -99,6 +101,52 @@ lunr.utils.asString = function (obj) { return obj.toString() } } + +/** + * Clones an object. + * + * Will create a copy of an existing object such that any mutations + * on the copy cannot affect the original. + * + * Only shallow objects are supported, passing a nested object to this + * function will cause a TypeError. + * + * Objects with primitives, and arrays of primitives are supported. + * + * @param {Object} obj The object to clone. + * @return {Object} a clone of the passed object. + * @throws {TypeError} when a nested object is passed. + * @memberOf Utils + */ +lunr.utils.clone = function (obj) { + if (obj === null || obj === undefined) { + return obj + } + + var clone = Object.create(null), + keys = Object.keys(obj) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i], + val = obj[key] + + if (Array.isArray(val)) { + clone[key] = val.slice() + continue + } + + if (typeof val === 'string' || + typeof val === 'number' || + typeof val === 'boolean') { + clone[key] = val + continue + } + + throw new TypeError("clone is not deep and does not support nested objects") + } + + return clone +} lunr.FieldRef = function (docRef, fieldName, stringValue) { this.docRef = docRef this.fieldName = fieldName @@ -127,6 +175,139 @@ lunr.FieldRef.prototype.toString = function () { return this._stringValue } +/*! + * lunr.Set + * Copyright (C) 2018 Oliver Nightingale + */ + +/** + * A lunr set. + * + * @constructor + */ +lunr.Set = function (elements) { + this.elements = Object.create(null) + + if (elements) { + this.length = elements.length + + for (var i = 0; i < this.length; i++) { + this.elements[elements[i]] = true + } + } else { + this.length = 0 + } +} + +/** + * A complete set that contains all elements. + * + * @static + * @readonly + * @type {lunr.Set} + */ +lunr.Set.complete = { + intersect: function (other) { + return other + }, + + union: function (other) { + return other + }, + + contains: function () { + return true + } +} + +/** + * An empty set that contains no elements. + * + * @static + * @readonly + * @type {lunr.Set} + */ +lunr.Set.empty = { + intersect: function () { + return this + }, + + union: function (other) { + return other + }, + + contains: function () { + return false + } +} + +/** + * Returns true if this set contains the specified object. + * + * @param {object} object - Object whose presence in this set is to be tested. + * @returns {boolean} - True if this set contains the specified object. + */ +lunr.Set.prototype.contains = function (object) { + return !!this.elements[object] +} + +/** + * Returns a new set containing only the elements that are present in both + * this set and the specified set. + * + * @param {lunr.Set} other - set to intersect with this set. + * @returns {lunr.Set} a new set that is the intersection of this and the specified set. + */ + +lunr.Set.prototype.intersect = function (other) { + var a, b, elements, intersection = [] + + if (other === lunr.Set.complete) { + return this + } + + if (other === lunr.Set.empty) { + return other + } + + if (this.length < other.length) { + a = this + b = other + } else { + a = other + b = this + } + + elements = Object.keys(a.elements) + + for (var i = 0; i < elements.length; i++) { + var element = elements[i] + if (element in b.elements) { + intersection.push(element) + } + } + + return new lunr.Set (intersection) +} + +/** + * Returns a new set combining the elements of this and the specified set. + * + * @param {lunr.Set} other - set to union with this set. + * @return {lunr.Set} a new set that is the union of this and the specified set. + */ + +lunr.Set.prototype.union = function (other) { + if (other === lunr.Set.complete) { + return lunr.Set.complete + } + + if (other === lunr.Set.empty) { + return this + } + + return new lunr.Set(Object.keys(this.elements).concat(Object.keys(other.elements))) +} /** * A function to calculate the inverse document frequency for * a posting. This is shared between the builder and the index @@ -208,7 +389,7 @@ lunr.Token.prototype.clone = function (fn) { } /*! * lunr.tokenizer - * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2018 Oliver Nightingale */ /** @@ -220,18 +401,26 @@ lunr.Token.prototype.clone = function (fn) { * then will split this string on the character in `lunr.tokenizer.separator`. * Arrays will have their elements converted to strings and wrapped in a lunr.Token. * + * Optional metadata can be passed to the tokenizer, this metadata will be cloned and + * added as metadata to every token that is created from the object to be tokenized. + * * @static * @param {?(string|object|object[])} obj - The object to convert into tokens + * @param {?object} metadata - Optional metadata to associate with every token * @returns {lunr.Token[]} + * @see {@link lunr.Pipeline} */ -lunr.tokenizer = function (obj) { +lunr.tokenizer = function (obj, metadata) { if (obj == null || obj == undefined) { return [] } if (Array.isArray(obj)) { return obj.map(function (t) { - return new lunr.Token(lunr.utils.asString(t).toLowerCase()) + return new lunr.Token( + lunr.utils.asString(t).toLowerCase(), + lunr.utils.clone(metadata) + ) }) } @@ -246,11 +435,15 @@ lunr.tokenizer = function (obj) { if ((char.match(lunr.tokenizer.separator) || sliceEnd == len)) { if (sliceLength > 0) { + var tokenMetadata = lunr.utils.clone(metadata) || {} + tokenMetadata["position"] = [sliceStart, sliceLength] + tokenMetadata["index"] = tokens.length + tokens.push( - new lunr.Token (str.slice(sliceStart, sliceEnd), { - position: [sliceStart, sliceLength], - index: tokens.length - }) + new lunr.Token ( + str.slice(sliceStart, sliceEnd), + tokenMetadata + ) ) } @@ -272,7 +465,7 @@ lunr.tokenizer = function (obj) { lunr.tokenizer.separator = /[\s\-]+/ /*! * lunr.Pipeline - * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2018 Oliver Nightingale */ /** @@ -475,14 +668,23 @@ lunr.Pipeline.prototype.run = function (tokens) { for (var i = 0; i < stackLength; i++) { var fn = this._stack[i] + var memo = [] - tokens = tokens.reduce(function (memo, token, j) { - var result = fn(token, j, tokens) + for (var j = 0; j < tokens.length; j++) { + var result = fn(tokens[j], j, tokens) - if (result === void 0 || result === '') return memo + if (result === void 0 || result === '') continue - return memo.concat(result) - }, []) + if (Array.isArray(result)) { + for (var k = 0; k < result.length; k++) { + memo.push(result[k]) + } + } else { + memo.push(result) + } + } + + tokens = memo } return tokens @@ -494,10 +696,12 @@ lunr.Pipeline.prototype.run = function (tokens) { * token and mapping the resulting tokens back to strings. * * @param {string} str - The string to pass through the pipeline. + * @param {?object} metadata - Optional metadata to associate with the token + * passed to the pipeline. * @returns {string[]} */ -lunr.Pipeline.prototype.runString = function (str) { - var token = new lunr.Token (str) +lunr.Pipeline.prototype.runString = function (str, metadata) { + var token = new lunr.Token (str, metadata) return this.run([token]).map(function (t) { return t.toString() @@ -528,7 +732,7 @@ lunr.Pipeline.prototype.toJSON = function () { } /*! * lunr.Vector - * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2018 Oliver Nightingale */ /** @@ -689,15 +893,14 @@ lunr.Vector.prototype.dot = function (otherVector) { } /** - * Calculates the cosine similarity between this vector and another - * vector. + * Calculates the similarity between this vector and another vector. * * @param {lunr.Vector} otherVector - The other vector to calculate the * similarity with. * @returns {Number} */ lunr.Vector.prototype.similarity = function (otherVector) { - return this.dot(otherVector) / (this.magnitude() * otherVector.magnitude()) + return this.dot(otherVector) / this.magnitude() || 0 } /** @@ -726,7 +929,7 @@ lunr.Vector.prototype.toJSON = function () { /* eslint-disable */ /*! * lunr.stemmer - * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2018 Oliver Nightingale * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt */ @@ -739,6 +942,7 @@ lunr.Vector.prototype.toJSON = function () { * @param {lunr.Token} token - The string to stem * @returns {lunr.Token} * @see {@link lunr.Pipeline} + * @function */ lunr.stemmer = (function(){ var step2list = { @@ -947,7 +1151,7 @@ lunr.stemmer = (function(){ lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer') /*! * lunr.stopWordFilter - * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2018 Oliver Nightingale */ /** @@ -957,6 +1161,7 @@ lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer') * The built in lunr.stopWordFilter is built using this generator and can be used * to generate custom stopWordFilters for applications or non English languages. * + * @function * @param {Array} token The token to pass through the filter * @returns {lunr.PipelineFunction} * @see lunr.Pipeline @@ -980,6 +1185,7 @@ lunr.generateStopWordFilter = function (stopWords) { * This is intended to be used in the Pipeline. If the token does not pass the * filter then undefined will be returned. * + * @function * @implements {lunr.PipelineFunction} * @params {lunr.Token} token - A token to check for being a stop word. * @returns {lunr.Token} @@ -1110,7 +1316,7 @@ lunr.stopWordFilter = lunr.generateStopWordFilter([ lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter') /*! * lunr.trimmer - * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2018 Oliver Nightingale */ /** @@ -1137,7 +1343,7 @@ lunr.trimmer = function (token) { lunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer') /*! * lunr.TokenSet - * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2018 Oliver Nightingale */ /** @@ -1254,13 +1460,13 @@ lunr.TokenSet.fromFuzzyString = function (str, editDistance) { if (frame.str.length == 1) { noEditNode.final = true - } else { - stack.push({ - node: noEditNode, - editsRemaining: frame.editsRemaining, - str: frame.str.slice(1) - }) } + + stack.push({ + node: noEditNode, + editsRemaining: frame.editsRemaining, + str: frame.str.slice(1) + }) } // deletion @@ -1379,14 +1585,13 @@ lunr.TokenSet.fromFuzzyString = function (str, editDistance) { */ lunr.TokenSet.fromString = function (str) { var node = new lunr.TokenSet, - root = node, - wildcardFound = false + root = node /* * Iterates through all characters within the passed string * appending a node for each character. * - * As soon as a wildcard character is found then a self + * When a wildcard character is found then a self * referencing edge is introduced to continually match * any number of any characters. */ @@ -1395,7 +1600,6 @@ lunr.TokenSet.fromString = function (str) { final = (i == len - 1) if (char == "*") { - wildcardFound = true node.edges[char] = node node.final = final @@ -1405,11 +1609,6 @@ lunr.TokenSet.fromString = function (str) { node.edges[char] = next node = next - - // TODO: is this needed anymore? - if (wildcardFound) { - node.edges["*"] = root - } } } @@ -1436,6 +1635,11 @@ lunr.TokenSet.prototype.toArray = function () { len = edges.length if (frame.node.final) { + /* In Safari, at this point the prefix is sometimes corrupted, see: + * https://github.com/olivernn/lunr.js/issues/279 Calling any + * String.prototype method forces Safari to "cast" this string to what + * it's supposed to be, fixing the bug. */ + frame.prefix.charAt(0) words.push(frame.prefix) } @@ -1632,7 +1836,7 @@ lunr.TokenSet.Builder.prototype.minimize = function (downTo) { } /*! * lunr.Index - * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2018 Oliver Nightingale */ /** @@ -1646,7 +1850,7 @@ lunr.TokenSet.Builder.prototype.minimize = function (downTo) { * @constructor * @param {Object} attrs - The attributes of the built search index. * @param {Object} attrs.invertedIndex - An index of term/field to document reference. - * @param {Object} attrs.documentVectors - Document vectors keyed by document reference. + * @param {Object} attrs.fieldVectors - Field vectors * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens. * @param {string[]} attrs.fields - The names of indexed document fields. * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms. @@ -1692,6 +1896,12 @@ lunr.Index = function (attrs) { * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2. * Avoid large values for edit distance to improve query performance. * + * Each term also supports a presence modifier. By default a term's presence in document is optional, however + * this can be changed to either required or prohibited. For a term's presence to be required in a document the + * term should be prefixed with a '+', e.g. `+foo bar` is a search for documents that must contain 'foo' and + * optionally contain 'bar'. Conversely a leading '-' sets the terms presence to prohibited, i.e. it must not + * appear in a document, e.g. `-foo bar` is a search for documents that do not contain 'foo' but may contain 'bar'. + * * To escape special characters the backslash character '\' can be used, this allows searches to include * characters that would normally be considered modifiers, e.g. `foo\~2` will search for a term "foo~2" instead * of attempting to apply a boost of 2 to the search term "foo". @@ -1707,13 +1917,16 @@ lunr.Index = function (attrs) { * hello^10 * @example term with an edit distance of 2 * hello~2 + * @example terms with presence modifiers + * -foo +bar baz */ /** * Performs a search against the index using lunr query syntax. * * Results will be returned sorted by their score, the most relevant results - * will be returned first. + * will be returned first. For details on how the score is calculated, please see + * the {@link https://lunrjs.com/guides/searching.html#scoring|guide}. * * For more programmatic querying use lunr.Index#query. * @@ -1764,7 +1977,18 @@ lunr.Index.prototype.query = function (fn) { var query = new lunr.Query(this.fields), matchingFields = Object.create(null), queryVectors = Object.create(null), - termFieldCache = Object.create(null) + termFieldCache = Object.create(null), + requiredMatches = Object.create(null), + prohibitedMatches = Object.create(null) + + /* + * To support field level boosts a query vector is created per + * field. An empty vector is eagerly created to support negated + * queries. + */ + for (var i = 0; i < this.fields.length; i++) { + queryVectors[this.fields[i]] = new lunr.Vector + } fn.call(query, query) @@ -1778,10 +2002,13 @@ lunr.Index.prototype.query = function (fn) { * for a single query term. */ var clause = query.clauses[i], - terms = null + terms = null, + clauseMatches = lunr.Set.complete if (clause.usePipeline) { - terms = this.pipeline.runString(clause.term) + terms = this.pipeline.runString(clause.term, { + fields: clause.fields + }) } else { terms = [clause.term] } @@ -1805,6 +2032,21 @@ lunr.Index.prototype.query = function (fn) { var termTokenSet = lunr.TokenSet.fromClause(clause), expandedTerms = this.tokenSet.intersect(termTokenSet).toArray() + /* + * If a term marked as required does not exist in the tokenSet it is + * impossible for the search to return any matches. We set all the field + * scoped required matches set to empty and stop examining any further + * clauses. + */ + if (expandedTerms.length === 0 && clause.presence === lunr.Query.presence.REQUIRED) { + for (var k = 0; k < clause.fields.length; k++) { + var field = clause.fields[k] + requiredMatches[field] = lunr.Set.empty + } + + break + } + for (var j = 0; j < expandedTerms.length; j++) { /* * For each term get the posting and termIndex, this is required for @@ -1826,26 +2068,50 @@ lunr.Index.prototype.query = function (fn) { var field = clause.fields[k], fieldPosting = posting[field], matchingDocumentRefs = Object.keys(fieldPosting), - termField = expandedTerm + "/" + field + termField = expandedTerm + "/" + field, + matchingDocumentsSet = new lunr.Set(matchingDocumentRefs) /* - * To support field level boosts a query vector is created per - * field. This vector is populated using the termIndex found for - * the term and a unit value with the appropriate boost applied. + * if the presence of this term is required ensure that the matching + * documents are added to the set of required matches for this clause. * - * If the query vector for this field does not exist yet it needs - * to be created. */ - if (queryVectors[field] === undefined) { - queryVectors[field] = new lunr.Vector + if (clause.presence == lunr.Query.presence.REQUIRED) { + clauseMatches = clauseMatches.union(matchingDocumentsSet) + + if (requiredMatches[field] === undefined) { + requiredMatches[field] = lunr.Set.complete + } + } + + /* + * if the presence of this term is prohibited ensure that the matching + * documents are added to the set of prohibited matches for this field, + * creating that set if it does not yet exist. + */ + if (clause.presence == lunr.Query.presence.PROHIBITED) { + if (prohibitedMatches[field] === undefined) { + prohibitedMatches[field] = lunr.Set.empty + } + + prohibitedMatches[field] = prohibitedMatches[field].union(matchingDocumentsSet) + + /* + * Prohibited matches should not be part of the query vector used for + * similarity scoring and no metadata should be extracted so we continue + * to the next field + */ + continue } /* + * The query field vector is populated using the termIndex found for + * the term and a unit value with the appropriate boost applied. * Using upsert because there could already be an entry in the vector * for the term we are working with. In that case we just add the scores * together. */ - queryVectors[field].upsert(termIndex, 1 * clause.boost, function (a, b) { return a + b }) + queryVectors[field].upsert(termIndex, clause.boost, function (a, b) { return a + b }) /** * If we've already seen this term, field combo then we've already collected @@ -1879,12 +2145,65 @@ lunr.Index.prototype.query = function (fn) { } } } + + /** + * If the presence was required we need to update the requiredMatches field sets. + * We do this after all fields for the term have collected their matches because + * the clause terms presence is required in _any_ of the fields not _all_ of the + * fields. + */ + if (clause.presence === lunr.Query.presence.REQUIRED) { + for (var k = 0; k < clause.fields.length; k++) { + var field = clause.fields[k] + requiredMatches[field] = requiredMatches[field].intersect(clauseMatches) + } + } + } + + /** + * Need to combine the field scoped required and prohibited + * matching documents into a global set of required and prohibited + * matches + */ + var allRequiredMatches = lunr.Set.complete, + allProhibitedMatches = lunr.Set.empty + + for (var i = 0; i < this.fields.length; i++) { + var field = this.fields[i] + + if (requiredMatches[field]) { + allRequiredMatches = allRequiredMatches.intersect(requiredMatches[field]) + } + + if (prohibitedMatches[field]) { + allProhibitedMatches = allProhibitedMatches.union(prohibitedMatches[field]) + } } var matchingFieldRefs = Object.keys(matchingFields), results = [], matches = Object.create(null) + /* + * If the query is negated (contains only prohibited terms) + * we need to get _all_ fieldRefs currently existing in the + * index. This is only done when we know that the query is + * entirely prohibited terms to avoid any cost of getting all + * fieldRefs unnecessarily. + * + * Additionally, blank MatchData must be created to correctly + * populate the results. + */ + if (query.isNegated()) { + matchingFieldRefs = Object.keys(this.fieldVectors) + + for (var i = 0; i < matchingFieldRefs.length; i++) { + var matchingFieldRef = matchingFieldRefs[i] + var fieldRef = lunr.FieldRef.fromString(matchingFieldRef) + matchingFields[matchingFieldRef] = new lunr.MatchData + } + } + for (var i = 0; i < matchingFieldRefs.length; i++) { /* * Currently we have document fields that match the query, but we @@ -1895,8 +2214,17 @@ lunr.Index.prototype.query = function (fn) { * above, and combined into a final document score using addition. */ var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]), - docRef = fieldRef.docRef, - fieldVector = this.fieldVectors[fieldRef], + docRef = fieldRef.docRef + + if (!allRequiredMatches.contains(docRef)) { + continue + } + + if (allProhibitedMatches.contains(docRef)) { + continue + } + + var fieldVector = this.fieldVectors[fieldRef], score = queryVectors[fieldRef.fieldName].similarity(fieldVector), docMatch @@ -1961,7 +2289,7 @@ lunr.Index.load = function (serializedIndex) { var attrs = {}, fieldVectors = {}, serializedVectors = serializedIndex.fieldVectors, - invertedIndex = {}, + invertedIndex = Object.create(null), serializedInvertedIndex = serializedIndex.invertedIndex, tokenSetBuilder = new lunr.TokenSet.Builder, pipeline = lunr.Pipeline.load(serializedIndex.pipeline) @@ -2000,7 +2328,7 @@ lunr.Index.load = function (serializedIndex) { } /*! * lunr.Builder - * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2018 Oliver Nightingale */ /** @@ -2029,7 +2357,8 @@ lunr.Index.load = function (serializedIndex) { */ lunr.Builder = function () { this._ref = "id" - this._fields = [] + this._fields = Object.create(null) + this._documents = Object.create(null) this.invertedIndex = Object.create(null) this.fieldTermFrequencies = {} this.fieldLengths = {} @@ -2059,6 +2388,20 @@ lunr.Builder.prototype.ref = function (ref) { this._ref = ref } +/** + * A function that is used to extract a field from a document. + * + * Lunr expects a field to be at the top level of a document, if however the field + * is deeply nested within a document an extractor function can be used to extract + * the right field for indexing. + * + * @callback fieldExtractor + * @param {object} doc - The document being added to the index. + * @returns {?(string|object|object[])} obj - The object that will be indexed for this field. + * @example Extracting a nested field + * function (doc) { return doc.nested.field } + */ + /** * Adds a field to the list of document fields that will be indexed. Every document being * indexed should have this field. Null values for this field in indexed documents will @@ -2067,10 +2410,22 @@ lunr.Builder.prototype.ref = function (ref) { * All fields should be added before adding documents to the index. Adding fields after * a document has been indexed will have no effect on already indexed documents. * - * @param {string} field - The name of a field to index in all documents. + * Fields can be boosted at build time. This allows terms within that field to have more + * importance when ranking search results. Use a field boost to specify that matches within + * one field are more important than other fields. + * + * @param {string} fieldName - The name of a field to index in all documents. + * @param {object} attributes - Optional attributes associated with this field. + * @param {number} [attributes.boost=1] - Boost applied to all terms within this field. + * @param {fieldExtractor} [attributes.extractor] - Function to extract a field from a document. + * @throws {RangeError} fieldName cannot contain unsupported characters '/' */ -lunr.Builder.prototype.field = function (field) { - this._fields.push(field) +lunr.Builder.prototype.field = function (fieldName, attributes) { + if (/\//.test(fieldName)) { + throw new RangeError ("Field '" + fieldName + "' contains illegal character '/'") + } + + this._fields[fieldName] = attributes || {} } /** @@ -2112,17 +2467,27 @@ lunr.Builder.prototype.k1 = function (number) { * it should have all fields defined for indexing, though null or undefined values will not * cause errors. * + * Entire documents can be boosted at build time. Applying a boost to a document indicates that + * this document should rank higher in search results than other documents. + * * @param {object} doc - The document to add to the index. + * @param {object} attributes - Optional attributes associated with this document. + * @param {number} [attributes.boost=1] - Boost applied to all terms within this document. */ -lunr.Builder.prototype.add = function (doc) { - var docRef = doc[this._ref] +lunr.Builder.prototype.add = function (doc, attributes) { + var docRef = doc[this._ref], + fields = Object.keys(this._fields) + this._documents[docRef] = attributes || {} this.documentCount += 1 - for (var i = 0; i < this._fields.length; i++) { - var fieldName = this._fields[i], - field = doc[fieldName], - tokens = this.tokenizer(field), + for (var i = 0; i < fields.length; i++) { + var fieldName = fields[i], + extractor = this._fields[fieldName].extractor, + field = extractor ? extractor(doc) : doc[fieldName], + tokens = this.tokenizer(field, { + fields: [fieldName] + }), terms = this.pipeline.run(tokens), fieldRef = new lunr.FieldRef (docRef, fieldName), fieldTerms = Object.create(null) @@ -2150,8 +2515,8 @@ lunr.Builder.prototype.add = function (doc) { posting["_index"] = this.termIndex this.termIndex += 1 - for (var k = 0; k < this._fields.length; k++) { - posting[this._fields[k]] = Object.create(null) + for (var k = 0; k < fields.length; k++) { + posting[fields[k]] = Object.create(null) } this.invertedIndex[term] = posting @@ -2202,9 +2567,11 @@ lunr.Builder.prototype.calculateAverageFieldLengths = function () { accumulator[field] += this.fieldLengths[fieldRef] } - for (var i = 0; i < this._fields.length; i++) { - var field = this._fields[i] - accumulator[field] = accumulator[field] / documentsWithField[field] + var fields = Object.keys(this._fields) + + for (var i = 0; i < fields.length; i++) { + var fieldName = fields[i] + accumulator[fieldName] = accumulator[fieldName] / documentsWithField[fieldName] } this.averageFieldLength = accumulator @@ -2223,13 +2590,17 @@ lunr.Builder.prototype.createFieldVectors = function () { for (var i = 0; i < fieldRefsLength; i++) { var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), - field = fieldRef.fieldName, + fieldName = fieldRef.fieldName, fieldLength = this.fieldLengths[fieldRef], fieldVector = new lunr.Vector, termFrequencies = this.fieldTermFrequencies[fieldRef], terms = Object.keys(termFrequencies), termsLength = terms.length + + var fieldBoost = this._fields[fieldName].boost || 1, + docBoost = this._documents[fieldRef.docRef].boost || 1 + for (var j = 0; j < termsLength; j++) { var term = terms[j], tf = termFrequencies[term], @@ -2243,7 +2614,9 @@ lunr.Builder.prototype.createFieldVectors = function () { idf = termIdfCache[term] } - score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[field])) + tf) + score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[fieldName])) + tf) + score *= fieldBoost + score *= docBoost scoreWithPrecision = Math.round(score * 1000) / 1000 // Converts 1.23456789 to 1.234. // Reducing the precision so that the vectors take up less @@ -2289,7 +2662,7 @@ lunr.Builder.prototype.build = function () { invertedIndex: this.invertedIndex, fieldVectors: this.fieldVectors, tokenSet: this.tokenSet, - fields: this._fields, + fields: Object.keys(this._fields), pipeline: this.searchPipeline }) } @@ -2327,7 +2700,7 @@ lunr.Builder.prototype.use = function (fn) { */ lunr.MatchData = function (term, field, metadata) { var clonedMetadata = Object.create(null), - metadataKeys = Object.keys(metadata) + metadataKeys = Object.keys(metadata || {}) // Cloning the metadata to prevent the original // being mutated during match data combination. @@ -2340,8 +2713,11 @@ lunr.MatchData = function (term, field, metadata) { } this.metadata = Object.create(null) - this.metadata[term] = Object.create(null) - this.metadata[term][field] = clonedMetadata + + if (term !== undefined) { + this.metadata[term] = Object.create(null) + this.metadata[term][field] = clonedMetadata + } } /** @@ -2456,11 +2832,42 @@ lunr.Query = function (allFields) { * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING * }) */ + lunr.Query.wildcard = new String ("*") lunr.Query.wildcard.NONE = 0 lunr.Query.wildcard.LEADING = 1 lunr.Query.wildcard.TRAILING = 2 +/** + * Constants for indicating what kind of presence a term must have in matching documents. + * + * @constant + * @enum {number} + * @see lunr.Query~Clause + * @see lunr.Query#clause + * @see lunr.Query#term + * @example query term with required presence + * query.term('foo', { presence: lunr.Query.presence.REQUIRED }) + */ +lunr.Query.presence = { + /** + * Term's presence in a document is optional, this is the default value. + */ + OPTIONAL: 1, + + /** + * Term's presence in a document is required, documents that do not contain + * this term will not be returned. + */ + REQUIRED: 2, + + /** + * Term's presence in a document is prohibited, documents that do contain + * this term will not be returned. + */ + PROHIBITED: 3 +} + /** * A single clause in a {@link lunr.Query} contains a term and details on how to * match that term against a {@link lunr.Index}. @@ -2470,7 +2877,8 @@ lunr.Query.wildcard.TRAILING = 2 * @property {number} [boost=1] - Any boost that should be applied when matching this clause. * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be. * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline. - * @property {number} [wildcard=0] - Whether the term should have wildcards appended or prepended. + * @property {number} [wildcard=lunr.Query.wildcard.NONE] - Whether the term should have wildcards appended or prepended. + * @property {number} [presence=lunr.Query.presence.OPTIONAL] - The terms presence in any matching documents. */ /** @@ -2508,17 +2916,44 @@ lunr.Query.prototype.clause = function (clause) { clause.term = "" + clause.term + "*" } + if (!('presence' in clause)) { + clause.presence = lunr.Query.presence.OPTIONAL + } + this.clauses.push(clause) return this } +/** + * A negated query is one in which every clause has a presence of + * prohibited. These queries require some special processing to return + * the expected results. + * + * @returns boolean + */ +lunr.Query.prototype.isNegated = function () { + for (var i = 0; i < this.clauses.length; i++) { + if (this.clauses[i].presence != lunr.Query.presence.PROHIBITED) { + return false + } + } + + return true +} + /** * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause} * to the list of clauses that make up this query. * - * @param {string} term - The term to add to the query. - * @param {Object} [options] - Any additional properties to add to the query clause. + * The term is used as is, i.e. no tokenization will be performed by this method. Instead conversion + * to a token or token-like string should be done before calling this method. + * + * The term will be converted to a string by calling `toString`. Multiple terms can be passed as an + * array, each term in the array will share the same options. + * + * @param {object|object[]} term - The term(s) to add to the query. + * @param {object} [options] - Any additional properties to add to the query clause. * @returns {lunr.Query} * @see lunr.Query#clause * @see lunr.Query~Clause @@ -2530,10 +2965,17 @@ lunr.Query.prototype.clause = function (clause) { * boost: 10, * wildcard: lunr.Query.wildcard.TRAILING * }) + * @example using lunr.tokenizer to convert a string to tokens before using them as terms + * query.term(lunr.tokenizer("foo bar")) */ lunr.Query.prototype.term = function (term, options) { + if (Array.isArray(term)) { + term.forEach(function (t) { this.term(t, lunr.utils.clone(options)) }, this) + return this + } + var clause = options || {} - clause.term = term + clause.term = term.toString() this.clause(clause) @@ -2645,6 +3087,7 @@ lunr.QueryLexer.FIELD = 'FIELD' lunr.QueryLexer.TERM = 'TERM' lunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE' lunr.QueryLexer.BOOST = 'BOOST' +lunr.QueryLexer.PRESENCE = 'PRESENCE' lunr.QueryLexer.lexField = function (lexer) { lexer.backup() @@ -2733,6 +3176,22 @@ lunr.QueryLexer.lexText = function (lexer) { return lunr.QueryLexer.lexBoost } + // "+" indicates term presence is required + // checking for length to ensure that only + // leading "+" are considered + if (char == "+" && lexer.width() === 1) { + lexer.emit(lunr.QueryLexer.PRESENCE) + return lunr.QueryLexer.lexText + } + + // "-" indicates term presence is prohibited + // checking for length to ensure that only + // leading "-" are considered + if (char == "-" && lexer.width() === 1) { + lexer.emit(lunr.QueryLexer.PRESENCE) + return lunr.QueryLexer.lexText + } + if (char.match(lunr.QueryLexer.termSeparator)) { return lunr.QueryLexer.lexTerm } @@ -2750,7 +3209,7 @@ lunr.QueryParser.prototype.parse = function () { this.lexer.run() this.lexemes = this.lexer.lexemes - var state = lunr.QueryParser.parseFieldOrTerm + var state = lunr.QueryParser.parseClause while (state) { state = state(this) @@ -2775,7 +3234,7 @@ lunr.QueryParser.prototype.nextClause = function () { this.currentClause = {} } -lunr.QueryParser.parseFieldOrTerm = function (parser) { +lunr.QueryParser.parseClause = function (parser) { var lexeme = parser.peekLexeme() if (lexeme == undefined) { @@ -2783,6 +3242,8 @@ lunr.QueryParser.parseFieldOrTerm = function (parser) { } switch (lexeme.type) { + case lunr.QueryLexer.PRESENCE: + return lunr.QueryParser.parsePresence case lunr.QueryLexer.FIELD: return lunr.QueryParser.parseField case lunr.QueryLexer.TERM: @@ -2798,6 +3259,43 @@ lunr.QueryParser.parseFieldOrTerm = function (parser) { } } +lunr.QueryParser.parsePresence = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + switch (lexeme.str) { + case "-": + parser.currentClause.presence = lunr.Query.presence.PROHIBITED + break + case "+": + parser.currentClause.presence = lunr.Query.presence.REQUIRED + break + default: + var errorMessage = "unrecognised presence operator'" + lexeme.str + "'" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + var errorMessage = "expecting term or field, found nothing" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.FIELD: + return lunr.QueryParser.parseField + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expecting term or field, found '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + lunr.QueryParser.parseField = function (parser) { var lexeme = parser.consumeLexeme() @@ -2861,6 +3359,9 @@ lunr.QueryParser.parseTerm = function (parser) { return lunr.QueryParser.parseEditDistance case lunr.QueryLexer.BOOST: return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence default: var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) @@ -2901,6 +3402,9 @@ lunr.QueryParser.parseEditDistance = function (parser) { return lunr.QueryParser.parseEditDistance case lunr.QueryLexer.BOOST: return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence default: var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) @@ -2941,6 +3445,9 @@ lunr.QueryParser.parseBoost = function (parser) { return lunr.QueryParser.parseEditDistance case lunr.QueryLexer.BOOST: return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence default: var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) diff --git a/assets/js/lunr/lunr.min.js b/assets/js/lunr/lunr.min.js index 75f6a2b749be..f45a81eb800c 100644 --- a/assets/js/lunr/lunr.min.js +++ b/assets/js/lunr/lunr.min.js @@ -1,6 +1 @@ -/** - * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.1.5 - * Copyright (C) 2017 Oliver Nightingale - * @license MIT - */ -!function(){var e=function(t){var r=new e.Builder;return r.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),r.searchPipeline.add(e.stemmer),t.call(r,r),r.build()};e.version="2.1.5",e.utils={},e.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),e.utils.asString=function(e){return void 0===e||null===e?"":e.toString()},e.FieldRef=function(e,t,r){this.docRef=e,this.fieldName=t,this._stringValue=r},e.FieldRef.joiner="/",e.FieldRef.fromString=function(t){var r=t.indexOf(e.FieldRef.joiner);if(-1===r)throw"malformed field ref string";var i=t.slice(0,r),n=t.slice(r+1);return new e.FieldRef(n,i,t)},e.FieldRef.prototype.toString=function(){return void 0==this._stringValue&&(this._stringValue=this.fieldName+e.FieldRef.joiner+this.docRef),this._stringValue},e.idf=function(e,t){var r=0;for(var i in e)"_index"!=i&&(r+=Object.keys(e[i]).length);var n=(t-r+.5)/(r+.5);return Math.log(1+Math.abs(n))},e.Token=function(e,t){this.str=e||"",this.metadata=t||{}},e.Token.prototype.toString=function(){return this.str},e.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},e.Token.prototype.clone=function(t){return t=t||function(e){return e},new e.Token(t(this.str,this.metadata),this.metadata)},e.tokenizer=function(t){if(null==t||void 0==t)return[];if(Array.isArray(t))return t.map(function(t){return new e.Token(e.utils.asString(t).toLowerCase())});for(var r=t.toString().trim().toLowerCase(),i=r.length,n=[],s=0,o=0;i>=s;s++){var a=r.charAt(s),u=s-o;(a.match(e.tokenizer.separator)||s==i)&&(u>0&&n.push(new e.Token(r.slice(o,s),{position:[o,u],index:n.length})),o=s+1)}return n},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(-1==i)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(-1==i)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;t>r;r++){var i=this._stack[r];e=e.reduce(function(t,r,n){var s=i(r,n,e);return void 0===s||""===s?t:t.concat(s)},[])}return e},e.Pipeline.prototype.runString=function(t){var r=new e.Token(t);return this.run([r]).map(function(e){return e.toString()})},e.Pipeline.prototype.reset=function(){this._stack=[]},e.Pipeline.prototype.toJSON=function(){return this._stack.map(function(t){return e.Pipeline.warnIfFunctionNotRegistered(t),t.label})},e.Vector=function(e){this._magnitude=0,this.elements=e||[]},e.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,r=this.elements.length/2,i=r-t,n=Math.floor(i/2),s=this.elements[2*n];i>1&&(e>s&&(t=n),s>e&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:e>s?2*(n+1):void 0},e.Vector.prototype.insert=function(e,t){this.upsert(e,t,function(){throw"duplicate index"})},e.Vector.prototype.upsert=function(e,t,r){this._magnitude=0;var i=this.positionForIndex(e);this.elements[i]==e?this.elements[i+1]=r(this.elements[i+1],t):this.elements.splice(i,0,e,t)},e.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,r=1;t>r;r+=2){var i=this.elements[r];e+=i*i}return this._magnitude=Math.sqrt(e)},e.Vector.prototype.dot=function(e){for(var t=0,r=this.elements,i=e.elements,n=r.length,s=i.length,o=0,a=0,u=0,l=0;n>u&&s>l;)o=r[u],a=i[l],a>o?u+=2:o>a?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/(this.magnitude()*e.magnitude())},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;ti;i++)r.insert(t[i]);return r.finish(),r.root},e.TokenSet.fromClause=function(t){return"editDistance"in t?e.TokenSet.fromFuzzyString(t.term,t.editDistance):e.TokenSet.fromString(t.term)},e.TokenSet.fromFuzzyString=function(t,r){for(var i=new e.TokenSet,n=[{node:i,editsRemaining:r,str:t}];n.length;){var s=n.pop();if(s.str.length>0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length?o["final"]=!0:n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining>0&&s.str.length>1){var u,a=s.str.charAt(1);a in s.node.edges?u=s.node.edges[a]:(u=new e.TokenSet,s.node.edges[a]=u),s.str.length<=2?u["final"]=!0:n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(2)})}if(s.editsRemaining>0&&1==s.str.length&&(s.node["final"]=!0),s.editsRemaining>0&&s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length?l["final"]=!0:n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.editsRemaining>0){if("*"in s.node.edges)var d=s.node.edges["*"];else{var d=new e.TokenSet;s.node.edges["*"]=d}0==s.str.length?d["final"]=!0:n.push({node:d,editsRemaining:s.editsRemaining-1,str:s.str})}if(s.editsRemaining>0&&s.str.length>1){var h,c=s.str.charAt(0),f=s.str.charAt(1);f in s.node.edges?h=s.node.edges[f]:(h=new e.TokenSet,s.node.edges[f]=h),1==s.str.length?h["final"]=!0:n.push({node:h,editsRemaining:s.editsRemaining-1,str:c+s.str.slice(2)})}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=!1,s=0,o=t.length;o>s;s++){var a=t[s],u=s==o-1;if("*"==a)n=!0,r.edges[a]=r,r["final"]=u;else{var l=new e.TokenSet;l["final"]=u,r.edges[a]=l,r=l,n&&(r.edges["*"]=i)}}return i},e.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var r=t.pop(),i=Object.keys(r.node.edges),n=i.length;r.node["final"]&&e.push(r.prefix);for(var s=0;n>s;s++){var o=i[s];t.push({prefix:r.prefix.concat(o),node:r.node.edges[o]})}}return e},e.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this["final"]?"1":"0",t=Object.keys(this.edges).sort(),r=t.length,i=0;r>i;i++){var n=t[i],s=this.edges[n];e=e+n+s.id}return e},e.TokenSet.prototype.intersect=function(t){for(var r=new e.TokenSet,i=void 0,n=[{qNode:t,output:r,node:this}];n.length;){i=n.pop();for(var s=Object.keys(i.qNode.edges),o=s.length,a=Object.keys(i.node.edges),u=a.length,l=0;o>l;l++)for(var d=s[l],h=0;u>h;h++){var c=a[h];if(c==d||"*"==d){var f=i.node.edges[c],p=i.qNode.edges[d],y=f["final"]&&p["final"],m=void 0;c in i.output.edges?(m=i.output.edges[c],m["final"]=m["final"]||y):(m=new e.TokenSet,m["final"]=y,i.output.edges[c]=m),n.push({qNode:p,output:m,node:f})}}}return r},e.TokenSet.Builder=function(){this.previousWord="",this.root=new e.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},e.TokenSet.Builder.prototype.insert=function(t){var r,i=0;if(t=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null);t.call(r,r);for(var o=0;oe?this._b=0:e>1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t){var r=t[this._ref];this.documentCount+=1;for(var i=0;is;s++){var o=e.FieldRef.fromString(t[s]),a=o.fieldName;n[a]||(n[a]=0),n[a]+=1,i[a]||(i[a]=0),i[a]+=this.fieldLengths[o]}for(var s=0;ss;s++){for(var o=e.FieldRef.fromString(r[s]),a=o.fieldName,u=this.fieldLengths[o],l=new e.Vector,d=this.fieldTermFrequencies[o],h=Object.keys(d),c=h.length,f=0;c>f;f++){var p,y,m,v=h[f],g=d[v],x=this.invertedIndex[v]._index;void 0===n[v]?(p=e.idf(this.invertedIndex[v],this.documentCount),n[v]=p):p=n[v],y=p*((this._k1+1)*g)/(this._k1*(1-this._b+this._b*(u/this.averageFieldLength[a]))+g),m=Math.round(1e3*y)/1e3,l.insert(x,m)}t[o]=l}this.fieldVectors=t},e.Builder.prototype.createTokenSet=function(){this.tokenSet=e.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},e.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new e.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:this._fields,pipeline:this.searchPipeline})},e.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},e.MatchData=function(e,t,r){for(var i=Object.create(null),n=Object.keys(r),s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&58>r);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more()?e.QueryLexer.lexText:void 0},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseFieldOrTerm;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseFieldOrTerm=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(-1==t.query.allFields.indexOf(r.str)){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),-1!=r.str.indexOf("*")&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(); \ No newline at end of file +!function(){var t,l,c,e,r,h,d,f,p,y,m,g,x,v,w,Q,k,S,E,L,b,P,T,O,I,i,n,s,z=function(e){var t=new z.Builder;return t.pipeline.add(z.trimmer,z.stopWordFilter,z.stemmer),t.searchPipeline.add(z.stemmer),e.call(t,t),t.build()};z.version="2.3.5",z.utils={},z.utils.warn=(t=this,function(e){t.console&&console.warn&&console.warn(e)}),z.utils.asString=function(e){return null==e?"":e.toString()},z.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),r=Object.keys(e),i=0;i=this.length)return z.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},z.QueryLexer.prototype.width=function(){return this.pos-this.start},z.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},z.QueryLexer.prototype.backup=function(){this.pos-=1},z.QueryLexer.prototype.acceptDigitRun=function(){for(var e,t;47<(t=(e=this.next()).charCodeAt(0))&&t<58;);e!=z.QueryLexer.EOS&&this.backup()},z.QueryLexer.prototype.more=function(){return this.pos0&&t-1 in e)}function o(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function a(e,t,n){return ye(t)?we.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?we.grep(e,function(e){return e===t!==n}):"string"!=typeof t?we.grep(e,function(e){return fe.call(t,e)>-1!==n}):we.filter(t,e,n)}function s(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function l(e){var t={};return we.each(e.match(Le)||[],function(e,n){t[n]=!0}),t}function u(e){return e}function c(e){throw e}function f(e,t,n,r){var i;try{e&&ye(i=e.promise)?i.call(e).done(t).fail(n):e&&ye(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}function d(){ae.removeEventListener("DOMContentLoaded",d),e.removeEventListener("load",d),we.ready()}function p(e,t){return t.toUpperCase()}function h(e){return e.replace(He,"ms-").replace(Me,p)}function m(){this.expando=we.expando+m.uid++}function g(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Fe.test(e)?JSON.parse(e):e)}function v(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ze,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=g(n)}catch(e){}$e.set(e,t,n)}else n=void 0;return n}function y(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return we.css(e,t,"")},l=s(),u=n&&n[3]||(we.cssNumber[t]?"":"px"),c=(we.cssNumber[t]||"px"!==u&&+l)&&We.exec(we.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)we.style(e,t,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,we.style(e,t,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}function x(e){var t,n=e.ownerDocument,r=e.nodeName,i=Ye[r];return i||(t=n.body.appendChild(n.createElement(r)),i=we.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Ye[r]=i,i)}function b(e,t){for(var n,r,i=[],o=0,a=e.length;o-1)o&&o.push(a);else if(c=we.contains(a.ownerDocument,a),s=w(d.appendChild(a),"script"),c&&C(s),n)for(f=0;a=s[f++];)Ke.test(a.type||"")&&n.push(a);return d}function k(){return!0}function S(){return!1}function E(){try{return ae.activeElement}catch(e){}}function j(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)j(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=S;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return we().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=we.guid++)),e.each(function(){we.event.add(this,t,i,r,n)})}function N(e,t){return o(e,"table")&&o(11!==t.nodeType?t:t.firstChild,"tr")?we(e).children("tbody")[0]||e:e}function A(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function D(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function I(e,t){var n,r,i,o,a,s,l,u;if(1===t.nodeType){if(Be.hasData(e)&&(o=Be.access(e),a=Be.set(t,o),u=o.events)){delete a.handle,a.events={};for(i in u)for(n=0,r=u[i].length;n1&&"string"==typeof h&&!ve.checkClone&&at.test(h))return e.each(function(n){var o=e.eq(n);m&&(t[0]=h.call(this,n,o.html())),O(o,t,r,i)});if(d&&(o=T(t,e[0].ownerDocument,!1,e,i),a=o.firstChild,1===o.childNodes.length&&(o=a),a||i)){for(l=(s=we.map(w(o,"script"),A)).length;f=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))),l}function F(e,t,n){var r=ut(e),i=q(e,t,r),o="border-box"===we.css(e,"boxSizing",!1,r),a=o;if(lt.test(i)){if(!n)return i;i="auto"}return a=a&&(ve.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===we.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+$(e,t,n||(o?"border":"content"),a,r,i)+"px"}function z(e,t,n,r,i){return new z.prototype.init(e,t,n,r,i)}function R(){yt&&(!1===ae.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(R):e.setTimeout(R,we.fx.interval),we.fx.tick())}function W(){return e.setTimeout(function(){vt=void 0}),vt=Date.now()}function U(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Ue[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function X(e,t,n){for(var r,i=(G.tweeners[t]||[]).concat(G.tweeners["*"]),o=0,a=i.length;o=0&&nw.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[_]=!0,e}function i(e){var t=I.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Ce(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&void 0!==e.getElementsByTagName&&e}function c(){}function f(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function h(e,n,r){for(var i=0,o=n.length;i-1&&(r[u]=!(a[u]=f))}}else x=m(x===a?x.splice(g,x.length):x),o?o(null,a,x,l):Z.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=d(function(e){return e===t},a,!0),u=d(function(e){return Q(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==j)||((t=n).nodeType?l(e,n,r):u(e,n,r));return t=null,i}];s1&&p(c),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(oe,"$1"),n,s0,o=e.length>0,a=function(r,a,s,l,u){var c,f,d,p=0,h="0",g=r&&[],v=[],y=j,x=r||o&&w.find.TAG("*",u),b=$+=null==y?1:Math.random()||.1,C=x.length;for(u&&(j=a===I||a||u);h!==C&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===I||(D(c),s=!O);d=e[f++];)if(d(c,a||I,s)){l.push(c);break}u&&($=b)}i&&((c=!d&&c)&&p--,r&&g.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,v,a,s);if(r){if(p>0)for(;h--;)g[h]||v[h]||(v[h]=Y.call(l));v=m(v)}Z.apply(l,v),u&&!r&&v.length>0&&p+n.length>1&&t.uniqueSort(l)}return u&&($=b,j=y),g};return i?r(a):a}var x,b,w,C,T,k,S,E,j,N,A,D,I,L,O,P,q,H,M,_="sizzle"+1*new Date,B=e.document,$=0,F=0,z=n(),R=n(),W=n(),U=function(e,t){return e===t&&(A=!0),0},X={}.hasOwnProperty,V=[],Y=V.pop,G=V.push,Z=V.push,K=V.slice,Q=function(e,t){for(var n=0,r=e.length;n+~]|"+ee+")"+ee+"*"),le=new RegExp("="+ee+"*([^\\]'\"]*?)"+ee+"*\\]","g"),ue=new RegExp(re),ce=new RegExp("^"+te+"$"),fe={ID:new RegExp("^#("+te+")"),CLASS:new RegExp("^\\.("+te+")"),TAG:new RegExp("^("+te+"|[*])"),ATTR:new RegExp("^"+ne),PSEUDO:new RegExp("^"+re),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ee+"*(even|odd|(([+-]|)(\\d*)n|)"+ee+"*(?:([+-]|)"+ee+"*(\\d+)|))"+ee+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+ee+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ee+"*((?:-\\d)?\\d*)"+ee+"*\\)|)(?=[^-]|$)","i")},de=/^(?:input|select|textarea|button)$/i,pe=/^h\d$/i,he=/^[^{]+\{\s*\[native \w/,me=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ge=/[+~]/,ve=new RegExp("\\\\([\\da-f]{1,6}"+ee+"?|("+ee+")|.)","ig"),ye=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},xe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,be=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},we=function(){D()},Ce=d(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{Z.apply(V=K.call(B.childNodes),B.childNodes),V[B.childNodes.length].nodeType}catch(e){Z={apply:V.length?function(e,t){G.apply(e,K.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}b=t.support={},T=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},D=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:B;return r!==I&&9===r.nodeType&&r.documentElement?(I=r,L=I.documentElement,O=!T(I),B!==I&&(n=I.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",we,!1):n.attachEvent&&n.attachEvent("onunload",we)),b.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),b.getElementsByTagName=i(function(e){return e.appendChild(I.createComment("")),!e.getElementsByTagName("*").length}),b.getElementsByClassName=he.test(I.getElementsByClassName),b.getById=i(function(e){return L.appendChild(e).id=_,!I.getElementsByName||!I.getElementsByName(_).length}),b.getById?(w.filter.ID=function(e){var t=e.replace(ve,ye);return function(e){return e.getAttribute("id")===t}},w.find.ID=function(e,t){if(void 0!==t.getElementById&&O){var n=t.getElementById(e);return n?[n]:[]}}):(w.filter.ID=function(e){var t=e.replace(ve,ye);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},w.find.ID=function(e,t){if(void 0!==t.getElementById&&O){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),w.find.TAG=b.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):b.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=b.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&O)return t.getElementsByClassName(e)},q=[],P=[],(b.qsa=he.test(I.querySelectorAll))&&(i(function(e){L.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+ee+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+ee+"*(?:value|"+J+")"),e.querySelectorAll("[id~="+_+"-]").length||P.push("~="),e.querySelectorAll(":checked").length||P.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||P.push(".#.+[+~]")}),i(function(e){e.innerHTML="";var t=I.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+ee+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&P.push(":enabled",":disabled"),L.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(b.matchesSelector=he.test(H=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){b.disconnectedMatch=H.call(e,"*"),H.call(e,"[s!='']:x"),q.push("!=",re)}),P=P.length&&new RegExp(P.join("|")),q=q.length&&new RegExp(q.join("|")),t=he.test(L.compareDocumentPosition),M=t||he.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!b.sortDetached&&t.compareDocumentPosition(e)===n?e===I||e.ownerDocument===B&&M(B,e)?-1:t===I||t.ownerDocument===B&&M(B,t)?1:N?Q(N,e)-Q(N,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],l=[t];if(!i||!o)return e===I?-1:t===I?1:i?-1:o?1:N?Q(N,e)-Q(N,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;s[r]===l[r];)r++;return r?a(s[r],l[r]):s[r]===B?-1:l[r]===B?1:0},I):I},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==I&&D(e),n=n.replace(le,"='$1']"),b.matchesSelector&&O&&!W[n+" "]&&(!q||!q.test(n))&&(!P||!P.test(n)))try{var r=H.call(e,n);if(r||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,I,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==I&&D(e),M(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==I&&D(e);var n=w.attrHandle[t.toLowerCase()],r=n&&X.call(w.attrHandle,t.toLowerCase())?n(e,t,!O):void 0;return void 0!==r?r:b.attributes||!O?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(xe,be)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!b.detectDuplicates,N=!b.sortStable&&e.slice(0),e.sort(U),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return N=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},(w=t.selectors={cacheLength:50,createPseudo:r,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ve,ye),e[3]=(e[3]||e[4]||e[5]||"").replace(ve,ye),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&ue.test(n)&&(t=k(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ve,ye).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=z[e+" "];return t||(t=new RegExp("(^|"+ee+")"+e+"("+ee+"|$)"))&&z(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ie," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,f,d,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s,x=!1;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(x=(p=(u=(c=(f=(d=g)[_]||(d[_]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===$&&u[1])&&u[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[$,p,x];break}}else if(y&&(x=p=(u=(c=(f=(d=t)[_]||(d[_]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===$&&u[1]),!1===x)for(;(d=++p&&d&&d[m]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++x||(y&&((c=(f=d[_]||(d[_]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]=[$,x]),d!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=w.pseudos[e]||w.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[_]?o(n):o.length>1?(i=[e,e,"",n],w.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)e[r=Q(e,i[a])]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(oe,"$1"));return i[_]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(ve,ye),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return ce.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ve,ye).toLowerCase(),function(t){var n;do{if(n=O?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===L},focus:function(e){return e===I.activeElement&&(!I.hasFocus||I.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:s(!1),disabled:s(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){ -for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return pe.test(e.nodeName)},input:function(e){return de.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(a=o[0]).type&&9===t.nodeType&&O&&w.relative[o[1].type]){if(!(t=(w.find.ID(a.matches[0].replace(ve,ye),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=fe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(ve,ye),ge.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&f(o)))return Z.apply(n,r),n;break}}return(c||S(e,d))(r,t,!O,n,!t||ge.test(e)&&u(t.parentNode)||t),n},b.sortStable=_.split("").sort(U).join("")===_,b.detectDuplicates=!!A,D(),b.sortDetached=i(function(e){return 1&e.compareDocumentPosition(I.createElement("fieldset"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),b.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(J,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);we.find=Te,we.expr=Te.selectors,we.expr[":"]=we.expr.pseudos,we.uniqueSort=we.unique=Te.uniqueSort,we.text=Te.getText,we.isXMLDoc=Te.isXML,we.contains=Te.contains,we.escapeSelector=Te.escape;var ke=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&we(e).is(n))break;r.push(e)}return r},Se=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Ee=we.expr.match.needsContext,je=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;we.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?we.find.matchesSelector(r,e)?[r]:[]:we.find.matches(e,we.grep(t,function(e){return 1===e.nodeType}))},we.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(we(e).filter(function(){for(t=0;t1?we.uniqueSort(n):n},filter:function(e){return this.pushStack(a(this,e||[],!1))},not:function(e){return this.pushStack(a(this,e||[],!0))},is:function(e){return!!a(this,"string"==typeof e&&Ee.test(e)?we(e):e||[],!1).length}});var Ne,Ae=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(we.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Ne,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Ae.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof we?t[0]:t,we.merge(this,we.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:ae,!0)),je.test(r[1])&&we.isPlainObject(t))for(r in t)ye(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=ae.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):ye(e)?void 0!==n.ready?n.ready(e):e(we):we.makeArray(e,this)}).prototype=we.fn,Ne=we(ae);var De=/^(?:parents|prev(?:Until|All))/,Ie={children:!0,contents:!0,next:!0,prev:!0};we.fn.extend({has:function(e){var t=we(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&we.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?we.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?fe.call(we(e),this[0]):fe.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(we.uniqueSort(we.merge(this.get(),we(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),we.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ke(e,"parentNode")},parentsUntil:function(e,t,n){return ke(e,"parentNode",n)},next:function(e){return s(e,"nextSibling")},prev:function(e){return s(e,"previousSibling")},nextAll:function(e){return ke(e,"nextSibling")},prevAll:function(e){return ke(e,"previousSibling")},nextUntil:function(e,t,n){return ke(e,"nextSibling",n)},prevUntil:function(e,t,n){return ke(e,"previousSibling",n)},siblings:function(e){return Se((e.parentNode||{}).firstChild,e)},children:function(e){return Se(e.firstChild)},contents:function(e){return o(e,"iframe")?e.contentDocument:(o(e,"template")&&(e=e.content||e),we.merge([],e.childNodes))}},function(e,t){we.fn[e]=function(n,r){var i=we.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=we.filter(r,i)),this.length>1&&(Ie[e]||we.uniqueSort(i),De.test(e)&&i.reverse()),this.pushStack(i)}});var Le=/[^\x20\t\r\n\f]+/g;we.Callbacks=function(e){e="string"==typeof e?l(e):we.extend({},e);var t,n,i,o,a=[],s=[],u=-1,c=function(){for(o=o||e.once,i=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?we.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return o=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return o=s=[],n||t||(a=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!i}};return f},we.extend({Deferred:function(t){var n=[["notify","progress",we.Callbacks("memory"),we.Callbacks("memory"),2],["resolve","done",we.Callbacks("once memory"),we.Callbacks("once memory"),0,"resolved"],["reject","fail",we.Callbacks("once memory"),we.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return we.Deferred(function(t){we.each(n,function(n,r){var i=ye(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&ye(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){function o(t,n,r,i){return function(){var s=this,l=arguments,f=function(){var e,f;if(!(t=a&&(r!==c&&(s=void 0,l=[e]),n.rejectWith(s,l))}};t?d():(we.Deferred.getStackHook&&(d.stackTrace=we.Deferred.getStackHook()),e.setTimeout(d))}}var a=0;return we.Deferred(function(e){n[0][3].add(o(0,e,ye(i)?i:u,e.notifyWith)),n[1][3].add(o(0,e,ye(t)?t:u)),n[2][3].add(o(0,e,ye(r)?r:c))}).promise()},promise:function(e){return null!=e?we.extend(e,i):i}},o={};return we.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=le.call(arguments),o=we.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?le.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(f(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||ye(i[n]&&i[n].then)))return o.then();for(;n--;)f(i[n],a(n),o.reject);return o.promise()}});var Oe=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;we.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Oe.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},we.readyException=function(t){e.setTimeout(function(){throw t})};var Pe=we.Deferred();we.fn.ready=function(e){return Pe.then(e).catch(function(e){we.readyException(e)}),this},we.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--we.readyWait:we.isReady)||(we.isReady=!0,!0!==e&&--we.readyWait>0||Pe.resolveWith(ae,[we]))}}),we.ready.then=Pe.then,"complete"===ae.readyState||"loading"!==ae.readyState&&!ae.documentElement.doScroll?e.setTimeout(we.ready):(ae.addEventListener("DOMContentLoaded",d),e.addEventListener("load",d));var qe=function(e,t,n,i,o,a,s){var l=0,u=e.length,c=null==n;if("object"===r(n)){o=!0;for(l in n)qe(e,t,l,n[l],!0,a,s)}else if(void 0!==i&&(o=!0,ye(i)||(s=!0),c&&(s?(t.call(e,i),t=null):(c=t,t=function(e,t,n){return c.call(we(e),n)})),t))for(;l1,null,!0)},removeData:function(e){return this.each(function(){$e.remove(this,e)})}}),we.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Be.get(e,t),n&&(!r||Array.isArray(n)?r=Be.access(e,t,we.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=we.queue(e,t),r=n.length,i=n.shift(),o=we._queueHooks(e,t),a=function(){we.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Be.get(e,n)||Be.access(e,n,{empty:we.Callbacks("once memory").add(function(){Be.remove(e,[t+"queue",n])})})}}),we.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,Ke=/^$|^module$|\/(?:java|ecma)script/i,Qe={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Qe.optgroup=Qe.option,Qe.tbody=Qe.tfoot=Qe.colgroup=Qe.caption=Qe.thead,Qe.th=Qe.td;var Je=/<|&#?\w+;/;!function(){var e=ae.createDocumentFragment().appendChild(ae.createElement("div")),t=ae.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),ve.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",ve.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var et=ae.documentElement,tt=/^key/,nt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rt=/^([^.]*)(?:\.(.+)|)/;we.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,f,d,p,h,m,g=Be.get(e);if(g)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&we.find.matchesSelector(et,i),n.guid||(n.guid=we.guid++),(l=g.events)||(l=g.events={}),(a=g.handle)||(a=g.handle=function(t){return void 0!==we&&we.event.triggered!==t.type?we.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(Le)||[""]).length;u--;)p=m=(s=rt.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),p&&(f=we.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=we.event.special[p]||{},c=we.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&we.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=l[p])||((d=l[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),we.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,u,c,f,d,p,h,m,g=Be.hasData(e)&&Be.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(Le)||[""]).length;u--;)if(s=rt.exec(t[u])||[],p=m=s[1],h=(s[2]||"").split(".").sort(),p){for(f=we.event.special[p]||{},d=l[p=(r?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,h,g.handle)||we.removeEvent(e,p,g.handle),delete l[p])}else for(p in l)we.event.remove(e,p+t[u],n,r,!0);we.isEmptyObject(l)&&Be.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=we.event.fix(e),l=new Array(arguments.length),u=(Be.get(this,"events")||{})[s.type]||[],c=we.event.special[s.type]||{};for(l[0]=s,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},n=0;n-1:we.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,ot=/\s*$/g;we.extend({htmlPrefilter:function(e){return e.replace(it,"<$1>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=we.contains(e.ownerDocument,e);if(!(ve.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||we.isXMLDoc(e)))for(a=w(s),r=0,i=(o=w(e)).length;r0&&C(a,!l&&w(e,"script")),s},cleanData:function(e){for(var t,n,r,i=we.event.special,o=0;void 0!==(n=e[o]);o++)if(_e(n)){if(t=n[Be.expando]){if(t.events)for(r in t.events)i[r]?we.event.remove(n,r):we.removeEvent(n,r,t.handle);n[Be.expando]=void 0}n[$e.expando]&&(n[$e.expando]=void 0)}}}),we.fn.extend({detach:function(e){return P(this,e,!0)},remove:function(e){return P(this,e)},text:function(e){return qe(this,function(e){return void 0===e?we.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return O(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||N(this,e).appendChild(e)})},prepend:function(){return O(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=N(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return O(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return O(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(we.cleanData(w(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return we.clone(this,e,t)})},html:function(e){return qe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ot.test(e)&&!Qe[(Ze.exec(e)||["",""])[1].toLowerCase()]){e=we.htmlPrefilter(e);try{for(;n1)}}),we.Tween=z,z.prototype={constructor:z,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||we.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(we.cssNumber[n]?"":"px")},cur:function(){var e=z.propHooks[this.prop];return e&&e.get?e.get(this):z.propHooks._default.get(this)},run:function(e){var t,n=z.propHooks[this.prop];return this.options.duration?this.pos=t=we.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):z.propHooks._default.set(this),this}},z.prototype.init.prototype=z.prototype,z.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=we.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){we.fx.step[e.prop]?we.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[we.cssProps[e.prop]]&&!we.cssHooks[e.prop]?e.elem[e.prop]=e.now:we.style(e.elem,e.prop,e.now+e.unit)}}},z.propHooks.scrollTop=z.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},we.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},we.fx=z.prototype.init,we.fx.step={};var vt,yt,xt=/^(?:toggle|show|hide)$/,bt=/queueHooks$/;we.Animation=we.extend(G,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return y(n.elem,e,We.exec(t),n),n}]},tweener:function(e,t){ye(e)?(t=e,e=["*"]):e=e.match(Le);for(var n,r=0,i=e.length;r1)},removeAttr:function(e){return this.each(function(){we.removeAttr(this,e)})}}),we.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?we.prop(e,t,n):(1===o&&we.isXMLDoc(e)||(i=we.attrHooks[t.toLowerCase()]||(we.expr.match.bool.test(t)?wt:void 0)),void 0!==n?null===n?void we.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=we.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!ve.radioValue&&"radio"===t&&o(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(Le);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),wt={set:function(e,t,n){return!1===t?we.removeAttr(e,n):e.setAttribute(n,n),n}},we.each(we.expr.match.bool.source.match(/\w+/g),function(e,t){var n=Ct[t]||we.find.attr;Ct[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=Ct[a],Ct[a]=i,i=null!=n(e,t,r)?a:null,Ct[a]=o),i}});var Tt=/^(?:input|select|textarea|button)$/i,kt=/^(?:a|area)$/i;we.fn.extend({prop:function(e,t){return qe(this,we.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[we.propFix[e]||e]})}}),we.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&we.isXMLDoc(e)||(t=we.propFix[t]||t,i=we.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=we.find.attr(e,"tabindex");return t?parseInt(t,10):Tt.test(e.nodeName)||kt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),ve.optSelected||(we.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),we.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){we.propFix[this.toLowerCase()]=this}),we.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,l=0;if(ye(e))return this.each(function(t){we(this).addClass(e.call(this,t,K(this)))});if((t=Q(e)).length)for(;n=this[l++];)if(i=K(n),r=1===n.nodeType&&" "+Z(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=Z(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,l=0;if(ye(e))return this.each(function(t){we(this).removeClass(e.call(this,t,K(this)))});if(!arguments.length)return this.attr("class","");if((t=Q(e)).length)for(;n=this[l++];)if(i=K(n),r=1===n.nodeType&&" "+Z(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=Z(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):ye(e)?this.each(function(n){we(this).toggleClass(e.call(this,n,K(this),t),t)}):this.each(function(){var t,i,o,a;if(r)for(i=0,o=we(this),a=Q(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=K(this))&&Be.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Be.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+Z(K(n))+" ").indexOf(t)>-1)return!0;return!1}});var St=/\r/g;we.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=ye(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,we(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=we.map(i,function(e){return null==e?"":e+""})),(t=we.valHooks[this.type]||we.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=we.valHooks[i.type]||we.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(St,""):null==n?"":n:void 0}}),we.extend({valHooks:{option:{get:function(e){var t=we.find.attr(e,"value");return null!=t?t:Z(we.text(e))}},select:{get:function(e){var t,n,r,i=e.options,a=e.selectedIndex,s="select-one"===e.type,l=s?null:[],u=s?a+1:i.length;for(r=a<0?u:s?a:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),we.each(["radio","checkbox"],function(){we.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=we.inArray(we(e).val(),t)>-1}},ve.checkOn||(we.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),ve.focusin="onfocusin"in e;var Et=/^(?:focusinfocus|focusoutblur)$/,jt=function(e){e.stopPropagation()};we.extend(we.event,{trigger:function(t,n,r,i){var o,a,s,l,u,c,f,d,p=[r||ae],h=he.call(t,"type")?t.type:t,m=he.call(t,"namespace")?t.namespace.split("."):[];if(a=d=s=r=r||ae,3!==r.nodeType&&8!==r.nodeType&&!Et.test(h+we.event.triggered)&&(h.indexOf(".")>-1&&(h=(m=h.split(".")).shift(),m.sort()),u=h.indexOf(":")<0&&"on"+h,t=t[we.expando]?t:new we.Event(h,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:we.makeArray(n,[t]),f=we.event.special[h]||{},i||!f.trigger||!1!==f.trigger.apply(r,n))){if(!i&&!f.noBubble&&!xe(r)){for(l=f.delegateType||h,Et.test(l+h)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(r.ownerDocument||ae)&&p.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=p[o++])&&!t.isPropagationStopped();)d=a,t.type=o>1?l:f.bindType||h,(c=(Be.get(a,"events")||{})[t.type]&&Be.get(a,"handle"))&&c.apply(a,n),(c=u&&a[u])&&c.apply&&_e(a)&&(t.result=c.apply(a,n),!1===t.result&&t.preventDefault());return t.type=h,i||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(p.pop(),n)||!_e(r)||u&&ye(r[h])&&!xe(r)&&((s=r[u])&&(r[u]=null),we.event.triggered=h,t.isPropagationStopped()&&d.addEventListener(h,jt),r[h](),t.isPropagationStopped()&&d.removeEventListener(h,jt),we.event.triggered=void 0,s&&(r[u]=s)),t.result}},simulate:function(e,t,n){var r=we.extend(new we.Event,n,{type:e,isSimulated:!0});we.event.trigger(r,null,t)}}),we.fn.extend({trigger:function(e,t){return this.each(function(){we.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return we.event.trigger(e,t,n,!0)}}),ve.focusin||we.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){we.event.simulate(t,e.target,we.event.fix(e))};we.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Be.access(r,t);i||r.addEventListener(e,n,!0),Be.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Be.access(r,t)-1;i?Be.access(r,t,i):(r.removeEventListener(e,n,!0),Be.remove(r,t))}}});var Nt=e.location,At=Date.now(),Dt=/\?/;we.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||we.error("Invalid XML: "+t),n};var It=/\[\]$/,Lt=/\r?\n/g,Ot=/^(?:submit|button|image|reset|file)$/i,Pt=/^(?:input|select|textarea|keygen)/i;we.param=function(e,t){var n,r=[],i=function(e,t){var n=ye(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!we.isPlainObject(e))we.each(e,function(){i(this.name,this.value)});else for(n in e)J(n,e[n],t,i);return r.join("&")},we.fn.extend({serialize:function(){return we.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=we.prop(this,"elements");return e?we.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!we(this).is(":disabled")&&Pt.test(this.nodeName)&&!Ot.test(e)&&(this.checked||!Ge.test(e))}).map(function(e,t){var n=we(this).val();return null==n?null:Array.isArray(n)?we.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var qt=/%20/g,Ht=/#.*$/,Mt=/([?&])_=[^&]*/,_t=/^(.*?):[ \t]*([^\r\n]*)$/gm,Bt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,$t=/^(?:GET|HEAD)$/,Ft=/^\/\//,zt={},Rt={},Wt="*/".concat("*"),Ut=ae.createElement("a");Ut.href=Nt.href,we.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Nt.href,type:"GET",isLocal:Bt.test(Nt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Wt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":we.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ne(ne(e,we.ajaxSettings),t):ne(we.ajaxSettings,e)},ajaxPrefilter:ee(zt),ajaxTransport:ee(Rt),ajax:function(t,n){function r(t,n,r,s){var u,d,p,b,w,C=n;c||(c=!0,l&&e.clearTimeout(l),i=void 0,a=s||"",T.readyState=t>0?4:0,u=t>=200&&t<300||304===t,r&&(b=re(h,T,r)),b=ie(h,b,T,u),u?(h.ifModified&&((w=T.getResponseHeader("Last-Modified"))&&(we.lastModified[o]=w),(w=T.getResponseHeader("etag"))&&(we.etag[o]=w)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,d=b.data,u=!(p=b.error))):(p=C,!t&&C||(C="error",t<0&&(t=0))),T.status=t,T.statusText=(n||C)+"",u?v.resolveWith(m,[d,C,T]):v.rejectWith(m,[T,C,p]),T.statusCode(x),x=void 0,f&&g.trigger(u?"ajaxSuccess":"ajaxError",[T,h,u?d:p]),y.fireWith(m,[T,C]),f&&(g.trigger("ajaxComplete",[T,h]),--we.active||we.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,l,u,c,f,d,p,h=we.ajaxSetup({},n),m=h.context||h,g=h.context&&(m.nodeType||m.jquery)?we(m):we.event,v=we.Deferred(),y=we.Callbacks("once memory"),x=h.statusCode||{},b={},w={},C="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=_t.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)T.always(e[T.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),r(0,t),this}};if(v.promise(T),h.url=((t||h.url||Nt.href)+"").replace(Ft,Nt.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(Le)||[""],null==h.crossDomain){u=ae.createElement("a");try{u.href=h.url,u.href=u.href,h.crossDomain=Ut.protocol+"//"+Ut.host!=u.protocol+"//"+u.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=we.param(h.data,h.traditional)),te(zt,h,n,T),c)return T;(f=we.event&&h.global)&&0==we.active++&&we.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!$t.test(h.type),o=h.url.replace(Ht,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(p=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(Dt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Mt,"$1"),p=(Dt.test(o)?"&":"?")+"_="+At+++p),h.url=o+p),h.ifModified&&(we.lastModified[o]&&T.setRequestHeader("If-Modified-Since",we.lastModified[o]),we.etag[o]&&T.setRequestHeader("If-None-Match",we.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&T.setRequestHeader("Content-Type",h.contentType),T.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Wt+"; q=0.01":""):h.accepts["*"]);for(d in h.headers)T.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(!1===h.beforeSend.call(m,T,h)||c))return T.abort();if(C="abort",y.add(h.complete),T.done(h.success),T.fail(h.error),i=te(Rt,h,n,T)){if(T.readyState=1,f&&g.trigger("ajaxSend",[T,h]),c)return T;h.async&&h.timeout>0&&(l=e.setTimeout(function(){T.abort("timeout")},h.timeout));try{c=!1,i.send(b,r)}catch(e){if(c)throw e;r(-1,e)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return we.get(e,t,n,"json")},getScript:function(e,t){return we.get(e,void 0,t,"script")}}),we.each(["get","post"],function(e,t){we[t]=function(e,n,r,i){return ye(n)&&(i=i||r,r=n,n=void 0),we.ajax(we.extend({url:e,type:t,dataType:i,data:n,success:r},we.isPlainObject(e)&&e))}}),we._evalUrl=function(e){return we.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},we.fn.extend({wrapAll:function(e){var t;return this[0]&&(ye(e)&&(e=e.call(this[0])),t=we(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return ye(e)?this.each(function(t){we(this).wrapInner(e.call(this,t))}):this.each(function(){var t=we(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ye(e);return this.each(function(n){we(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){we(this).replaceWith(this.childNodes)}),this}}),we.expr.pseudos.hidden=function(e){return!we.expr.pseudos.visible(e)},we.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},we.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Xt={0:200,1223:204},Vt=we.ajaxSettings.xhr();ve.cors=!!Vt&&"withCredentials"in Vt,ve.ajax=Vt=!!Vt,we.ajaxTransport(function(t){var n,r;if(ve.cors||Vt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Xt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),we.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),we.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return we.globalEval(e),e}}}),we.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),we.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=we("