diff --git a/config.toml b/config.toml index db8650a71..6ace522f0 100644 --- a/config.toml +++ b/config.toml @@ -238,6 +238,12 @@ twitter = "GoHugoIO" identifier = "themes" url = "https://themes.gohugo.io/" + [[menu.global]] + name = "Showcase" + weight = 20 + identifier = "showcase" + url = "/showcase/" + # Anything with a weight > 100 gets an external icon [[menu.global]] name = "Community" diff --git a/content/showcase/1password.md b/content/showcase/1password.md new file mode 100644 index 000000000..9784214b6 --- /dev/null +++ b/content/showcase/1password.md @@ -0,0 +1,12 @@ +--- +title: "1 Password" +date: 2018-01-22T17:31:17-05:00 +description: +sitelink: https://1password.com/ +repo: +creator: + - name: + link: +images: + - /images/showcase/showcase-1password.png +--- diff --git a/content/showcase/boomtown-fair.md b/content/showcase/boomtown-fair.md new file mode 100644 index 000000000..213adbdca --- /dev/null +++ b/content/showcase/boomtown-fair.md @@ -0,0 +1,11 @@ +--- +title: Boomtown Fair +date: 2017-01-09T12:00:00-05:00 +sitelink: 'http://www.boomtownfair.co.uk/' +repo: +creator: + - name: + link: +images: + - /images/showcase/screenshot-hugo-datocms-boomtown.jpg +--- diff --git a/content/showcase/brightline-org.md b/content/showcase/brightline-org.md new file mode 100644 index 000000000..621175edb --- /dev/null +++ b/content/showcase/brightline-org.md @@ -0,0 +1,12 @@ +--- +title: Brightline Initiative +date: 2018-01-19T12:00:00-05:00 +sitelink: https://www.brightline.org/ +repo: +creator: + - name: Sérgio Jardim + link: +images: + - /images/showcase/showcase-brightline-org-hugo-netlify-cloudinary.jpg +--- +The goal of this TED Women 2017, held in New Orleans, was to surface bold ideas from women and those who support them. We heard from an entrepreneur with an idea poised to transform how we consume power and from an architect who sees her work as being a healer. In this report, you can read these and others TEDWomen 2017 event's takeaways. diff --git a/content/showcase/crossref.md b/content/showcase/crossref.md new file mode 100644 index 000000000..35daffa0e --- /dev/null +++ b/content/showcase/crossref.md @@ -0,0 +1,12 @@ +--- +title: Crossref +date: 2017-10-05T12:00:00-05:00 +description: +sitelink: +repo: +creator: + - name: + link: +images: + - /images/showcase/crossref.png +--- diff --git a/content/showcase/esolia.md b/content/showcase/esolia.md new file mode 100644 index 000000000..f324fc5a0 --- /dev/null +++ b/content/showcase/esolia.md @@ -0,0 +1,13 @@ +--- +title: "eSolia" +date: 2015-07-09T13:18:00.000Z +description: +sitelink: http://esolia.com/ +repo: +creator: + - name: eSolia Inc. + link: +images: + - /images/showcase/1436586928778_thenewdynamic-showcase-esolia-com-150710.jpg +--- +eSolia had experimented with various other site generators, both proprietary and open source, and with server-side CMSs. We wanted the superior security and performance of a static site, without having to deal with development environment dependencies, meaning having to keep various libraries updated. [Hugo](http://gohugo.io/), written in the modern Go language, fits that requirement perfectly. It is not only available as a single, easy-to-install binary file for Mac, Linux and Windows, it was written to be insanely great in terms of speed and performance. Most sites build in milliseconds; in fact it takes longer to sync them to your web host than it does to generate the site! We like it so much that we built my personal site [Rick Cogley Central](http://rick.cogley.info/), eSolia's [English esolia.com](http://esolia.com/) and [Japanese esolia.co.jp](http://esolia.co.jp/) sites, and finally, eSolia's professional blog at [eSolia.pro](http://esolia.pro/) in it. As of July 2015, Hugo's community is vibrant, development is actively proceeding, and we'd love to welcome new users to the fold. Also see:[Why Hugo? A static site generator optimized for performance](http://esolia.pro/en/why-did-esolia-choose-hugo/)[](http://esolia.pro/en/why-did-esolia-choose-hugo/) diff --git a/content/showcase/forest-giant.md b/content/showcase/forest-giant.md new file mode 100644 index 000000000..0c41b4aec --- /dev/null +++ b/content/showcase/forest-giant.md @@ -0,0 +1,14 @@ +--- +title: Forest Giant +date: 2016-12-17T12:00:00-05:00 +sitelink: 'https://www.forestgiant.com/' +repo: +creator: + - name: + link: +images: + - /images/showcase/hugo-forestgiant.jpg +--- + + +A Netlify [Site of the Week](https://www.netlify.com/site-of-the-week/forest-giant/) diff --git a/content/showcase/forestry.md b/content/showcase/forestry.md new file mode 100644 index 000000000..3b922192f --- /dev/null +++ b/content/showcase/forestry.md @@ -0,0 +1,11 @@ +--- +title: Forestry.io +date: 2017-10-13T12:00:00-05:00 +sitelink: https://forestry.io/ +repo: https://github.com/forestryio +creator: + - name: + link: +images: + - /images/showcase/forestry.png +--- diff --git a/content/showcase/labs-us-gov-hugo.md b/content/showcase/labs-us-gov-hugo.md new file mode 100644 index 000000000..2cd9ce761 --- /dev/null +++ b/content/showcase/labs-us-gov-hugo.md @@ -0,0 +1,13 @@ +--- +title: labs.usa.gov +date: 2017-01-09T12:00:00-05:00 +tools: + - hugo +sitelink: 'https://labs.usa.gov/' +repo: +creator: + - name: + link: +images: + - /images/showcase/labs-us-gov-hugo.jpg +--- diff --git a/content/showcase/lets-encrypt.md b/content/showcase/lets-encrypt.md new file mode 100644 index 000000000..79eb21045 --- /dev/null +++ b/content/showcase/lets-encrypt.md @@ -0,0 +1,12 @@ +--- +title: "Lets Encrypt" +date: 2018-01-22T17:30:15-05:00 +description: +sitelink: https://letsencrypt.org/ +repo: +creator: + - name: + link: +images: + - /images/showcase/letsencrypt.jpg +--- diff --git a/content/showcase/linkingart-gallery.md b/content/showcase/linkingart-gallery.md new file mode 100644 index 000000000..a7228c09d --- /dev/null +++ b/content/showcase/linkingart-gallery.md @@ -0,0 +1,11 @@ +--- +title: Linking Art Gallery +date: 2017-03-03T12:00:00-05:00 +sitelink: 'http://www.linkingart.gallery/' +repo: +creator: + - name: Cantiere Creativo + link: https://www.cantierecreativo.net/ +images: + - /images/showcase/linking-art-middleman-datocms.jpg +--- diff --git a/content/showcase/netlify.md b/content/showcase/netlify.md new file mode 100644 index 000000000..15ad47a20 --- /dev/null +++ b/content/showcase/netlify.md @@ -0,0 +1,11 @@ +--- +title: Netlify +date: 2017-10-15T12:00:00-05:00 +sitelink: https://www.netlify.com/ +repo: +creator: + - name: + link: +images: + - /images/showcase/netlify.png +--- diff --git a/content/showcase/prettyflyfpv.md b/content/showcase/prettyflyfpv.md new file mode 100644 index 000000000..2b433420b --- /dev/null +++ b/content/showcase/prettyflyfpv.md @@ -0,0 +1,12 @@ +--- +title: "Prettyflyfpv" +date: 2018-01-22T17:31:06-05:00 +description: "" +sitelink: https://prettyflyfpv.com/ +repo: +creator: + - name: + link: +images: + - /images/showcase/showcase-prettyflyfpv.jpg +--- diff --git a/content/showcase/smashing-magazine.md b/content/showcase/smashing-magazine.md new file mode 100644 index 000000000..2f8a6e595 --- /dev/null +++ b/content/showcase/smashing-magazine.md @@ -0,0 +1,11 @@ +--- +title: "Smashing Magazine" +date: 2018-01-22T17:30:00-05:00 +description: "" +repo: +creator: + - name: + link: +images: + - /images/showcase/showcase-smashingmag.jpg +--- diff --git a/content/showcase/upframe.md b/content/showcase/upframe.md new file mode 100644 index 000000000..f19a7f9c5 --- /dev/null +++ b/content/showcase/upframe.md @@ -0,0 +1,11 @@ +--- +title: upframe +date: 2017-01-15T12:00:00-05:00 +sitelink: https://upframe.co +repo: https://github.com/upframe/upframe.co +creator: + - name: + link: +images: + - /images/showcase/upframe.png +--- diff --git a/src/package-lock.json b/src/package-lock.json new file mode 100644 index 000000000..48e341a09 --- /dev/null +++ b/src/package-lock.json @@ -0,0 +1,3 @@ +{ + "lockfileVersion": 1 +} diff --git a/static/images/showcase/1436586928778_thenewdynamic-showcase-esolia-com-150710.jpg b/static/images/showcase/1436586928778_thenewdynamic-showcase-esolia-com-150710.jpg new file mode 100644 index 000000000..dd23926f9 Binary files /dev/null and b/static/images/showcase/1436586928778_thenewdynamic-showcase-esolia-com-150710.jpg differ diff --git a/static/images/showcase/borisfx.jpg b/static/images/showcase/borisfx.jpg new file mode 100644 index 000000000..54ceaa64d Binary files /dev/null and b/static/images/showcase/borisfx.jpg differ diff --git a/static/images/showcase/cinematt.jpg b/static/images/showcase/cinematt.jpg new file mode 100644 index 000000000..5b3f01dd7 Binary files /dev/null and b/static/images/showcase/cinematt.jpg differ diff --git a/static/images/showcase/crossref.png b/static/images/showcase/crossref.png new file mode 100644 index 000000000..463f3d238 Binary files /dev/null and b/static/images/showcase/crossref.png differ diff --git a/static/images/showcase/forestry.png b/static/images/showcase/forestry.png new file mode 100644 index 000000000..50f8fe319 Binary files /dev/null and b/static/images/showcase/forestry.png differ diff --git a/static/images/showcase/hugo-forestgiant.jpg b/static/images/showcase/hugo-forestgiant.jpg new file mode 100644 index 000000000..753d82dbf Binary files /dev/null and b/static/images/showcase/hugo-forestgiant.jpg differ diff --git a/static/images/showcase/labs-us-gov-hugo.jpg b/static/images/showcase/labs-us-gov-hugo.jpg new file mode 100644 index 000000000..af1181f58 Binary files /dev/null and b/static/images/showcase/labs-us-gov-hugo.jpg differ diff --git a/static/images/showcase/letsencrypt.jpg b/static/images/showcase/letsencrypt.jpg new file mode 100644 index 000000000..c362725a9 Binary files /dev/null and b/static/images/showcase/letsencrypt.jpg differ diff --git a/static/images/showcase/linking-art-middleman-datocms.jpg b/static/images/showcase/linking-art-middleman-datocms.jpg new file mode 100644 index 000000000..4ef1b7ce0 Binary files /dev/null and b/static/images/showcase/linking-art-middleman-datocms.jpg differ diff --git a/static/images/showcase/netlify.png b/static/images/showcase/netlify.png new file mode 100644 index 000000000..5372f7d39 Binary files /dev/null and b/static/images/showcase/netlify.png differ diff --git a/static/images/showcase/screenshot-hugo-datocms-boomtown.jpg b/static/images/showcase/screenshot-hugo-datocms-boomtown.jpg new file mode 100644 index 000000000..2d7fd25bf Binary files /dev/null and b/static/images/showcase/screenshot-hugo-datocms-boomtown.jpg differ diff --git a/static/images/showcase/showcase-1password.png b/static/images/showcase/showcase-1password.png new file mode 100644 index 000000000..6c0a07085 Binary files /dev/null and b/static/images/showcase/showcase-1password.png differ diff --git a/static/images/showcase/showcase-brightline-org-hugo-netlify-cloudinary.jpg b/static/images/showcase/showcase-brightline-org-hugo-netlify-cloudinary.jpg new file mode 100644 index 000000000..54b323797 Binary files /dev/null and b/static/images/showcase/showcase-brightline-org-hugo-netlify-cloudinary.jpg differ diff --git a/static/images/showcase/showcase-prettyflyfpv.jpg b/static/images/showcase/showcase-prettyflyfpv.jpg new file mode 100644 index 000000000..9b25d2e48 Binary files /dev/null and b/static/images/showcase/showcase-prettyflyfpv.jpg differ diff --git a/static/images/showcase/showcase-smashingmag.jpg b/static/images/showcase/showcase-smashingmag.jpg new file mode 100644 index 000000000..afdd4a4e3 Binary files /dev/null and b/static/images/showcase/showcase-smashingmag.jpg differ diff --git a/static/images/showcase/upframe.png b/static/images/showcase/upframe.png new file mode 100644 index 000000000..04346d92f Binary files /dev/null and b/static/images/showcase/upframe.png differ diff --git a/themes/gohugoioTheme/archetypes/showcase.md b/themes/gohugoioTheme/archetypes/showcase.md new file mode 100644 index 000000000..5e318366f --- /dev/null +++ b/themes/gohugoioTheme/archetypes/showcase.md @@ -0,0 +1,11 @@ +--- +title: "{{ replace .TranslationBaseName "-" " " | title }}" +date: {{ .Date }} +description: +sitelink: +repo: +creator: + - name: + link: +images: [] +--- diff --git a/themes/gohugoioTheme/layouts/index.html b/themes/gohugoioTheme/layouts/index.html index 5e8ebbdd4..9dcee424d 100644 --- a/themes/gohugoioTheme/layouts/index.html +++ b/themes/gohugoioTheme/layouts/index.html @@ -9,6 +9,8 @@ {{- partial "home-page-sections/features-icons" . -}} + {{- partial "home-page-sections/showcase.html" . -}} + {{- partial "home-page-sections/features-single" . -}}
diff --git a/themes/gohugoioTheme/layouts/partials/boxes-showcase-items.html b/themes/gohugoioTheme/layouts/partials/boxes-showcase-items.html new file mode 100644 index 000000000..ecf133b8d --- /dev/null +++ b/themes/gohugoioTheme/layouts/partials/boxes-showcase-items.html @@ -0,0 +1,12 @@ + +
+ {{with .Params.images}} + + {{end}} +
{{/* the margin aligns to the bottom */}} +

+ {{- .Title -}} +

+
+
+
diff --git a/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html b/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html new file mode 100644 index 000000000..c074a80fe --- /dev/null +++ b/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html @@ -0,0 +1,30 @@ +
+

Showcase

+{{/* NOTE: transitions for this section are in themes/gohugoioTheme/src/css/_carousel.css */}} + + {{/* END */}} + +
{{/* using Flex to make the button show up on the right side */}} + See All +
+ +
diff --git a/themes/gohugoioTheme/layouts/partials/previous-next-links-in-section-with-title.html b/themes/gohugoioTheme/layouts/partials/previous-next-links-in-section-with-title.html new file mode 100644 index 000000000..68fa81551 --- /dev/null +++ b/themes/gohugoioTheme/layouts/partials/previous-next-links-in-section-with-title.html @@ -0,0 +1,14 @@ +{{ if or .PrevInSection .NextInSection }} +{{/* this div holds these a tags as a unit for flex-box display */}} +
+ {{if .NextInSection}} + {{ partial "svg/ic_chevron_left_black_24px.svg" (dict "fill" "#0594CB" "size" "12px") }} {{.NextInSection.Title}} + {{end}} + + {{if .PrevInSection}} + + {{.PrevInSection.Title}} {{ partial "svg/ic_chevron_right_black_24px.svg" (dict "fill" "#0594CB" "size" "12px") }} + + {{end}} +
+{{ end }} diff --git a/themes/gohugoioTheme/layouts/showcase/list.html b/themes/gohugoioTheme/layouts/showcase/list.html new file mode 100644 index 000000000..650b09f29 --- /dev/null +++ b/themes/gohugoioTheme/layouts/showcase/list.html @@ -0,0 +1,23 @@ +{{ define "main" }} +
+
+

+ {{ .Title }} +

+
+ {{ .Content }} +
+
+
+
+ {{ range (.Paginator 20).Pages }} + {{ partial "boxes-showcase-items.html" . }} + {{ end }} +
+
+ +
+{{ end }} diff --git a/themes/gohugoioTheme/layouts/showcase/single.html b/themes/gohugoioTheme/layouts/showcase/single.html new file mode 100644 index 000000000..0049aecab --- /dev/null +++ b/themes/gohugoioTheme/layouts/showcase/single.html @@ -0,0 +1,71 @@ +{{ define "main" }} +
+ +
+

+ + {{ .Title }} + +

+
+
+
+ {{ with .Params.images }} + Featured Image for {{ $.Title }} + {{ end }} + {{with .Content}} + + {{end}} +
+ +
+ {{/* bottom row */}} +
+ Last Update: {{ .Lastmod.Format "January 2, 2006" }}
+ {{ partial "page-edit.html" . }} +
+
+{{ end }} diff --git a/themes/gohugoioTheme/src/css/_carousel.css b/themes/gohugoioTheme/src/css/_carousel.css new file mode 100644 index 000000000..11fae8702 --- /dev/null +++ b/themes/gohugoioTheme/src/css/_carousel.css @@ -0,0 +1,25 @@ +/* These styles enhance the home page carousel, located here: themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html */ +.overflow-x-scroll{ + -webkit-overflow-scrolling: touch; +} +.row { + transition: 450ms transform; + font-size: 0; +} +.tile { + transition: 450ms all; +} +.details { + background: -webkit-gradient(linear, left bottom, left top, from(rgba(0,0,0,0.9)), to(rgba(0,0,0,0))); + background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%); + transition: 450ms opacity; +} +.tile:hover .details { + opacity: 1; +} +.row:hover .tile { + opacity: 0.3; +} +.row:hover .tile:hover { + opacity: 1; +} diff --git a/themes/gohugoioTheme/src/css/main.css b/themes/gohugoioTheme/src/css/main.css index 912bf5ce5..3f59a8c06 100755 --- a/themes/gohugoioTheme/src/css/main.css +++ b/themes/gohugoioTheme/src/css/main.css @@ -11,6 +11,7 @@ @import '_documentation-styles'; @import '_algolia'; +@import '_carousel'; @import '_code'; @import '_color-scheme'; @import '_columns'; diff --git a/themes/gohugoioTheme/src/js/lazysizes.js b/themes/gohugoioTheme/src/js/lazysizes.js index dc4ab1186..4eb3950af 100644 --- a/themes/gohugoioTheme/src/js/lazysizes.js +++ b/themes/gohugoioTheme/src/js/lazysizes.js @@ -1,2 +1,3 @@ var lazysizes = require('lazysizes'); // var lsnoscript = require('lazysizes/plugins/noscript/ls.noscript.js'); +var unveilhooks = require('lazysizes/plugins/unveilhooks/ls.unveilhooks.js'); diff --git a/themes/gohugoioTheme/src/package-lock.json b/themes/gohugoioTheme/src/package-lock.json index a977ac90a..c07d45b2f 100644 --- a/themes/gohugoioTheme/src/package-lock.json +++ b/themes/gohugoioTheme/src/package-lock.json @@ -2585,14 +2585,6 @@ } } }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, "string-width": { "version": "1.0.2", "bundled": true, @@ -2603,6 +2595,14 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, "stringstream": { "version": "0.0.5", "bundled": true, @@ -5411,15 +5411,6 @@ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", "dev": true }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -5431,6 +5422,15 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", diff --git a/themes/gohugoioTheme/src/package.json b/themes/gohugoioTheme/src/package.json index f0847492b..04bd261f3 100755 --- a/themes/gohugoioTheme/src/package.json +++ b/themes/gohugoioTheme/src/package.json @@ -8,7 +8,7 @@ "license": "MIT", "scripts": { "build:production": "rm -rf ../static/dist && webpack -p", - "build": "webpack --progress --colors --watch", + "build": "webpack --progress --colors --watch", "start": "npm run build" }, "devDependencies": { diff --git a/themes/gohugoioTheme/static/dist/app.bundle.js b/themes/gohugoioTheme/static/dist/app.bundle.js index 47a0fa0e0..fc757f71c 100644 --- a/themes/gohugoioTheme/static/dist/app.bundle.js +++ b/themes/gohugoioTheme/static/dist/app.bundle.js @@ -1,11708 +1,22 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // identity function for calling harmony imports with the correct context -/******/ __webpack_require__.i = function(value) { return value; }; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 10); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** -* Anchor for ID BPNY -**/ -var anchorForId = function anchorForId(id) { - var anchor = document.createElement("a"); - anchor.className = "header-link"; - anchor.href = "#" + id; - anchor.innerHTML = ' '; - return anchor; -}; - -var linkifyAnchors = function linkifyAnchors(level, containingElement) { - var headers = containingElement.getElementsByTagName("h" + level); - for (var h = 0; h < headers.length; h++) { - var header = headers[h]; - - if (typeof header.id !== "undefined" && header.id !== "") { - header.appendChild(anchorForId(header.id)); - } - } -}; - -document.onreadystatechange = function () { - if (this.readyState === "complete") { - var contentBlock = document.getElementsByClassName("prose")[0]; - if (!contentBlock) { - return; - } - for (var level = 2; level <= 2; level++) { - linkifyAnchors(level, contentBlock); - } - } -}; - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Clipboard = __webpack_require__(11); -new Clipboard('.copy', { - target: function target(trigger) { - return trigger.nextElementSibling; - } -}).on('success', function (e) { - successMessage(e.trigger, 'Copied!'); - e.clearSelection(); -}).on('error', function (e) { - successMessage(e.trigger, fallbackMessage(e.action)); -}); - -function successMessage(elem, msg) { - elem.setAttribute('class', 'copied bg-primary-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2'); - elem.setAttribute('aria-label', msg); -} - -function fallbackMessage(elem, action) { - var actionMsg = ''; - var actionKey = action === 'cut' ? 'X' : 'C'; - if (isMac) { - actionMsg = 'Press ⌘-' + actionKey; - } else { - actionMsg = 'Press Ctrl-' + actionKey; - } - return actionMsg; -} - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var article = document.getElementById('prose'); - -if (article) { - var codeBlocks = article.getElementsByTagName('code'); - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.entries(codeBlocks)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _ref = _step.value; - - var _ref2 = _slicedToArray(_ref, 2); - - var key = _ref2[0]; - var codeBlock = _ref2[1]; - - var widthDif = codeBlock.scrollWidth - codeBlock.clientWidth; - if (widthDif > 0) codeBlock.parentNode.classList.add('expand'); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } -} - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var docsearch = __webpack_require__(12); -docsearch({ - apiKey: '167e7998590aebda7f9fedcf86bc4a55', - indexName: 'hugodocs', - inputSelector: '#search-input', - debug: true // Set debug to true if you want to inspect the dropdown -}); - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var lazysizes = __webpack_require__(13); -// var lsnoscript = require('lazysizes/plugins/noscript/ls.noscript.js'); - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// Grab any element that has the 'js-toggle' class and add an event listner for the toggleClass function -var toggleBtns = document.getElementsByClassName('js-toggle'); -for (var i = 0; i < toggleBtns.length; i++) { - toggleBtns[i].addEventListener('click', toggleClass, false); -} - -function toggleClass() { - // Define the data target via the dataset "target" (e.g. data-target=".docsmenu") - var content = this.dataset.target.split(' '); - // Find any menu items that are open - var mobileCurrentlyOpen = document.querySelector('.mobilemenu:not(.dn)'); - var desktopCurrentlyOpen = document.querySelector('.desktopmenu:not(.dn)'); - var desktopActive = document.querySelector('.desktopmenu:not(.dn)'); - - // Loop through the targets' divs - for (var i = 0; i < content.length; i++) { - var matches = document.querySelectorAll(content[i]); - //for each, if the div has the 'dn' class (which is "display:none;"), remove it, otherwise, add that class - [].forEach.call(matches, function (dom) { - dom.classList.contains('dn') ? dom.classList.remove('dn') : dom.classList.add('dn'); - return false; - }); - // close the currently open menu items - if (mobileCurrentlyOpen) mobileCurrentlyOpen.classList.add('dn'); - if (desktopCurrentlyOpen) desktopCurrentlyOpen.classList.add('dn'); - if (desktopActive) desktopActive.classList.remove('db'); - } -} - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/, 'js'); - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var scrollDir = __webpack_require__(14); - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// query selector targets Hugo TOC -(function () { - - 'use strict'; - - // Feature Test - - if ('querySelector' in document && 'addEventListener' in window && Array.prototype.forEach) { - - // Function to animate the scroll - var smoothScroll = function smoothScroll(anchor, duration) { - - // Calculate how far and how fast to scroll - var startLocation = window.pageYOffset; - var endLocation = anchor.offsetTop; - var distance = endLocation - startLocation; - var increments = distance / (duration / 16); - var stopAnimation; - - // Scroll the page by an increment, and check if it's time to stop - var animateScroll = function animateScroll() { - window.scrollBy(0, increments); - stopAnimation(); - }; - - // If scrolling down - if (increments >= 0) { - // Stop animation when you reach the anchor OR the bottom of the page - stopAnimation = function stopAnimation() { - var travelled = window.pageYOffset; - if (travelled >= endLocation - increments || window.innerHeight + travelled >= document.body.offsetHeight) { - clearInterval(runAnimation); - } - }; - } - // If scrolling up - else { - // Stop animation when you reach the anchor OR the top of the page - stopAnimation = function stopAnimation() { - var travelled = window.pageYOffset; - if (travelled <= (endLocation || 0)) { - clearInterval(runAnimation); - } - }; - } - - // Loop the animation function - var runAnimation = setInterval(animateScroll, 16); - }; - - // Define smooth scroll links - var scrollToggle = document.querySelectorAll('#TableOfContents ul li a'); - - // For each smooth scroll link - [].forEach.call(scrollToggle, function (toggle) { - - // When the smooth scroll link is clicked - toggle.addEventListener('click', function (e) { - - // Prevent the default link behavior - e.preventDefault(); - - // Get anchor link and calculate distance from the top - var dataID = toggle.getAttribute('href'); - var dataTarget = document.querySelector(dataID); - var dataSpeed = toggle.getAttribute('data-speed'); - - // If the anchor exists - if (dataTarget) { - // Scroll to the anchor - smoothScroll(dataTarget, dataSpeed || 500); - } - }, false); - }); - } -})(); - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _main = __webpack_require__(9); - -var _main2 = _interopRequireDefault(_main); - -__webpack_require__(0); - -__webpack_require__(1); - -__webpack_require__(2); - -__webpack_require__(3); - -__webpack_require__(4); - -__webpack_require__(5); - -__webpack_require__(7); - -__webpack_require__(8); - -__webpack_require__(6); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -var require;var require;/*! +!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=10)}([function(t,e,n){"use strict";var r=function(t){var e=document.createElement("a");return e.className="header-link",e.href="#"+t,e.innerHTML=' ',e},i=function(t,e){for(var n=e.getElementsByTagName("h"+t),i=0;i0&&p.parentNode.classList.add("expand")}}catch(t){a=!0,u=t}finally{try{!s&&l.return&&l.return()}finally{if(a)throw u}}}},function(t,e,n){"use strict";n(12)({apiKey:"167e7998590aebda7f9fedcf86bc4a55",indexName:"hugodocs",inputSelector:"#search-input",debug:!0})},function(t,e,n){"use strict";n(13),n(14)},function(t,e,n){"use strict";function r(){for(var t=this.dataset.target.split(" "),e=document.querySelector(".mobilemenu:not(.dn)"),n=document.querySelector(".desktopmenu:not(.dn)"),r=document.querySelector(".desktopmenu:not(.dn)"),i=0;i=0?function(){var t=window.pageYOffset;(t>=i-s||window.innerHeight+t>=document.body.offsetHeight)&&clearInterval(u)}:function(){window.pageYOffset<=(i||0)&&clearInterval(u)};var u=setInterval(a,16)},e=document.querySelectorAll("#TableOfContents ul li a");[].forEach.call(e,function(e){e.addEventListener("click",function(n){n.preventDefault();var r=e.getAttribute("href"),i=document.querySelector(r),o=e.getAttribute("data-speed");i&&t(i,o||500)},!1)})}}()},function(t,e){},function(t,e,n){"use strict";var r=n(9);!function(t){t&&t.__esModule}(r);n(0),n(1),n(2),n(3),n(4),n(5),n(7),n(8),n(6)},function(t,e,n){var r,r;/*! * clipboard.js v1.7.1 * https://zenorocha.github.io/clipboard.js * * Licensed MIT © Zeno Rocha */ -(function(f){if(true){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Clipboard = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 && arguments[0] !== undefined ? arguments[0] : {}; - - this.action = options.action; - this.container = options.container; - this.emitter = options.emitter; - this.target = options.target; - this.text = options.text; - this.trigger = options.trigger; - - this.selectedText = ''; - } - }, { - key: 'initSelection', - value: function initSelection() { - if (this.text) { - this.selectFake(); - } else if (this.target) { - this.selectTarget(); - } - } - }, { - key: 'selectFake', - value: function selectFake() { - var _this = this; - - var isRTL = document.documentElement.getAttribute('dir') == 'rtl'; - - this.removeFake(); - - this.fakeHandlerCallback = function () { - return _this.removeFake(); - }; - this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true; - - this.fakeElem = document.createElement('textarea'); - // Prevent zooming on iOS - this.fakeElem.style.fontSize = '12pt'; - // Reset box model - this.fakeElem.style.border = '0'; - this.fakeElem.style.padding = '0'; - this.fakeElem.style.margin = '0'; - // Move element out of screen horizontally - this.fakeElem.style.position = 'absolute'; - this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px'; - // Move element to the same position vertically - var yPosition = window.pageYOffset || document.documentElement.scrollTop; - this.fakeElem.style.top = yPosition + 'px'; - - this.fakeElem.setAttribute('readonly', ''); - this.fakeElem.value = this.text; - - this.container.appendChild(this.fakeElem); - - this.selectedText = (0, _select2.default)(this.fakeElem); - this.copyText(); - } - }, { - key: 'removeFake', - value: function removeFake() { - if (this.fakeHandler) { - this.container.removeEventListener('click', this.fakeHandlerCallback); - this.fakeHandler = null; - this.fakeHandlerCallback = null; - } - - if (this.fakeElem) { - this.container.removeChild(this.fakeElem); - this.fakeElem = null; - } - } - }, { - key: 'selectTarget', - value: function selectTarget() { - this.selectedText = (0, _select2.default)(this.target); - this.copyText(); - } - }, { - key: 'copyText', - value: function copyText() { - var succeeded = void 0; - - try { - succeeded = document.execCommand(this.action); - } catch (err) { - succeeded = false; - } - - this.handleResult(succeeded); - } - }, { - key: 'handleResult', - value: function handleResult(succeeded) { - this.emitter.emit(succeeded ? 'success' : 'error', { - action: this.action, - text: this.selectedText, - trigger: this.trigger, - clearSelection: this.clearSelection.bind(this) - }); - } - }, { - key: 'clearSelection', - value: function clearSelection() { - if (this.trigger) { - this.trigger.focus(); - } - - window.getSelection().removeAllRanges(); - } - }, { - key: 'destroy', - value: function destroy() { - this.removeFake(); - } - }, { - key: 'action', - set: function set() { - var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy'; - - this._action = action; - - if (this._action !== 'copy' && this._action !== 'cut') { - throw new Error('Invalid "action" value, use either "copy" or "cut"'); - } - }, - get: function get() { - return this._action; - } - }, { - key: 'target', - set: function set(target) { - if (target !== undefined) { - if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) { - if (this.action === 'copy' && target.hasAttribute('disabled')) { - throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); - } - - if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { - throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); - } - - this._target = target; - } else { - throw new Error('Invalid "target" value, use a valid Element'); - } - } - }, - get: function get() { - return this._target; - } - }]); - - return ClipboardAction; - }(); - - module.exports = ClipboardAction; -}); - -},{"select":5}],8:[function(require,module,exports){ -(function (global, factory) { - if (typeof define === "function" && define.amd) { - define(['module', './clipboard-action', 'tiny-emitter', 'good-listener'], factory); - } else if (typeof exports !== "undefined") { - factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener')); - } else { - var mod = { - exports: {} - }; - factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener); - global.clipboard = mod.exports; - } -})(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) { - 'use strict'; - - var _clipboardAction2 = _interopRequireDefault(_clipboardAction); - - var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter); - - var _goodListener2 = _interopRequireDefault(_goodListener); - - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; - } - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - var _createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); - - function _possibleConstructorReturn(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return call && (typeof call === "object" || typeof call === "function") ? call : self; - } - - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; - } - - var Clipboard = function (_Emitter) { - _inherits(Clipboard, _Emitter); - - /** - * @param {String|HTMLElement|HTMLCollection|NodeList} trigger - * @param {Object} options - */ - function Clipboard(trigger, options) { - _classCallCheck(this, Clipboard); - - var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this)); - - _this.resolveOptions(options); - _this.listenClick(trigger); - return _this; - } - - /** - * Defines if attributes would be resolved using internal setter functions - * or custom functions that were passed in the constructor. - * @param {Object} options - */ - - - _createClass(Clipboard, [{ - key: 'resolveOptions', - value: function resolveOptions() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - this.action = typeof options.action === 'function' ? options.action : this.defaultAction; - this.target = typeof options.target === 'function' ? options.target : this.defaultTarget; - this.text = typeof options.text === 'function' ? options.text : this.defaultText; - this.container = _typeof(options.container) === 'object' ? options.container : document.body; - } - }, { - key: 'listenClick', - value: function listenClick(trigger) { - var _this2 = this; - - this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) { - return _this2.onClick(e); - }); - } - }, { - key: 'onClick', - value: function onClick(e) { - var trigger = e.delegateTarget || e.currentTarget; - - if (this.clipboardAction) { - this.clipboardAction = null; - } - - this.clipboardAction = new _clipboardAction2.default({ - action: this.action(trigger), - target: this.target(trigger), - text: this.text(trigger), - container: this.container, - trigger: trigger, - emitter: this - }); - } - }, { - key: 'defaultAction', - value: function defaultAction(trigger) { - return getAttributeValue('action', trigger); - } - }, { - key: 'defaultTarget', - value: function defaultTarget(trigger) { - var selector = getAttributeValue('target', trigger); - - if (selector) { - return document.querySelector(selector); - } - } - }, { - key: 'defaultText', - value: function defaultText(trigger) { - return getAttributeValue('text', trigger); - } - }, { - key: 'destroy', - value: function destroy() { - this.listener.destroy(); - - if (this.clipboardAction) { - this.clipboardAction.destroy(); - this.clipboardAction = null; - } - } - }], [{ - key: 'isSupported', - value: function isSupported() { - var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; - - var actions = typeof action === 'string' ? [action] : action; - var support = !!document.queryCommandSupported; - - actions.forEach(function (action) { - support = support && !!document.queryCommandSupported(action); - }); - - return support; - } - }]); - - return Clipboard; - }(_tinyEmitter2.default); - - /** - * Helper function to retrieve attribute value. - * @param {String} suffix - * @param {Element} element - */ - function getAttributeValue(suffix, element) { - var attribute = 'data-clipboard-' + suffix; - - if (!element.hasAttribute(attribute)) { - return; - } - - return element.getAttribute(attribute); - } - - module.exports = Clipboard; -}); - -},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8) -}); - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -/*! docsearch 2.4.1 | © Algolia | github.com/algolia/docsearch */ -(function webpackUniversalModuleDefinition(root, factory) { - if(true) - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["docsearch"] = factory(); - else - root["docsearch"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // identity function for calling harmony imports with the correct context -/******/ __webpack_require__.i = function(value) { return value; }; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 46); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var DOM = __webpack_require__(1); - -function escapeRegExp(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); -} - -module.exports = { - // those methods are implemented differently - // depending on which build it is, using - // $... or angular... or Zepto... or require(...) - isArray: null, - isFunction: null, - isObject: null, - bind: null, - each: null, - map: null, - mixin: null, - - isMsie: function() { - // from https://github.com/ded/bowser/blob/master/bowser.js - return (/(msie|trident)/i).test(navigator.userAgent) ? - navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false; - }, - - // http://stackoverflow.com/a/6969486 - escapeRegExChars: function(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); - }, - - isNumber: function(obj) { return typeof obj === 'number'; }, - - toStr: function toStr(s) { - return s === undefined || s === null ? '' : s + ''; - }, - - cloneDeep: function cloneDeep(obj) { - var clone = this.mixin({}, obj); - var self = this; - this.each(clone, function(value, key) { - if (value) { - if (self.isArray(value)) { - clone[key] = [].concat(value); - } else if (self.isObject(value)) { - clone[key] = self.cloneDeep(value); - } - } - }); - return clone; - }, - - error: function(msg) { - throw new Error(msg); - }, - - every: function(obj, test) { - var result = true; - if (!obj) { - return result; - } - this.each(obj, function(val, key) { - result = test.call(null, val, key, obj); - if (!result) { - return false; - } - }); - return !!result; - }, - - any: function(obj, test) { - var found = false; - if (!obj) { - return found; - } - this.each(obj, function(val, key) { - if (test.call(null, val, key, obj)) { - found = true; - return false; - } - }); - return found; - }, - - getUniqueId: (function() { - var counter = 0; - return function() { return counter++; }; - })(), - - templatify: function templatify(obj) { - if (this.isFunction(obj)) { - return obj; - } - var $template = DOM.element(obj); - if ($template.prop('tagName') === 'SCRIPT') { - return function template() { return $template.text(); }; - } - return function template() { return String(obj); }; - }, - - defer: function(fn) { setTimeout(fn, 0); }, - - noop: function() {}, - - formatPrefix: function(prefix, noPrefix) { - return noPrefix ? '' : prefix + '-'; - }, - - className: function(prefix, clazz, skipDot) { - return (skipDot ? '' : '.') + prefix + clazz; - }, - - escapeHighlightedString: function(str, highlightPreTag, highlightPostTag) { - highlightPreTag = highlightPreTag || ''; - var pre = document.createElement('div'); - pre.appendChild(document.createTextNode(highlightPreTag)); - - highlightPostTag = highlightPostTag || ''; - var post = document.createElement('div'); - post.appendChild(document.createTextNode(highlightPostTag)); - - var div = document.createElement('div'); - div.appendChild(document.createTextNode(str)); - return div.innerHTML - .replace(RegExp(escapeRegExp(pre.innerHTML), 'g'), highlightPreTag) - .replace(RegExp(escapeRegExp(post.innerHTML), 'g'), highlightPostTag); - } -}; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = { - element: null -}; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - - -var hasOwn = Object.prototype.hasOwnProperty; -var toString = Object.prototype.toString; - -module.exports = function forEach (obj, fn, ctx) { - if (toString.call(fn) !== '[object Function]') { - throw new TypeError('iterator must be a function'); - } - var l = obj.length; - if (l === +l) { - for (var i = 0; i < l; i++) { - fn.call(ctx, obj[i], i, obj); - } - } else { - for (var k in obj) { - if (hasOwn.call(obj, k)) { - fn.call(ctx, obj[k], k, obj); - } - } - } -}; - - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -module.exports = function clone(obj) { - return JSON.parse(JSON.stringify(obj)); -}; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// This file hosts our error definitions -// We use custom error "types" so that we can act on them when we need it -// e.g.: if error instanceof errors.UnparsableJSON then.. - -var inherits = __webpack_require__(20); - -function AlgoliaSearchError(message, extraProperties) { - var forEach = __webpack_require__(2); - - var error = this; - - // try to get a stacktrace - if (typeof Error.captureStackTrace === 'function') { - Error.captureStackTrace(this, this.constructor); - } else { - error.stack = (new Error()).stack || 'Cannot get a stacktrace, browser is too old'; - } - - this.name = 'AlgoliaSearchError'; - this.message = message || 'Unknown error'; - - if (extraProperties) { - forEach(extraProperties, function addToErrorObject(value, key) { - error[key] = value; - }); - } -} - -inherits(AlgoliaSearchError, Error); - -function createCustomError(name, message) { - function AlgoliaSearchCustomError() { - var args = Array.prototype.slice.call(arguments, 0); - - // custom message not set, use default - if (typeof args[0] !== 'string') { - args.unshift(message); - } - - AlgoliaSearchError.apply(this, args); - this.name = 'AlgoliaSearch' + name + 'Error'; - } - - inherits(AlgoliaSearchCustomError, AlgoliaSearchError); - - return AlgoliaSearchCustomError; -} - -// late exports to let various fn defs and inherits take place -module.exports = { - AlgoliaSearchError: AlgoliaSearchError, - UnparsableJSON: createCustomError( - 'UnparsableJSON', - 'Could not parse the incoming response as JSON, see err.more for details' - ), - RequestTimeout: createCustomError( - 'RequestTimeout', - 'Request timedout before getting a response' - ), - Network: createCustomError( - 'Network', - 'Network issue, see err.more for details' - ), - JSONPScriptFail: createCustomError( - 'JSONPScriptFail', - '