foundation-rails 5.5.3.2 → 6.6.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -2
- data/.ruby-version +1 -1
- data/.travis.yml +17 -4
- data/Appraisals +19 -0
- data/Gemfile +5 -2
- data/Gemfile.lock +210 -0
- data/LICENSE.txt +1 -1
- data/README.md +64 -28
- data/Rakefile +30 -0
- data/app/views/foundation/rails/styleguide/show.html.erb +10 -13
- data/bower.json +3 -2
- data/foundation-rails.gemspec +12 -7
- data/gemfiles/rails_4.1.gemfile +10 -0
- data/gemfiles/rails_4.1.gemfile.lock +181 -0
- data/gemfiles/rails_4.2.gemfile +10 -0
- data/gemfiles/rails_4.2.gemfile.lock +181 -0
- data/gemfiles/rails_5.0.gemfile +10 -0
- data/gemfiles/rails_5.0.gemfile.lock +196 -0
- data/gemfiles/rails_5.1.gemfile +10 -0
- data/gemfiles/rails_5.1.gemfile.lock +196 -0
- data/gemfiles/rails_5.2.gemfile +10 -0
- data/gemfiles/rails_5.2.gemfile.lock +196 -0
- data/lib/foundation/rails/engine.rb +2 -3
- data/lib/foundation/rails/version.rb +1 -1
- data/lib/foundation-rails.rb +1 -0
- data/lib/generators/foundation/install_generator.rb +39 -27
- data/lib/generators/foundation/templates/_settings.scss +895 -0
- data/lib/generators/foundation/templates/application.html.erb +1 -2
- data/lib/generators/foundation/templates/application.html.haml +2 -4
- data/lib/generators/foundation/templates/application.html.slim +1 -3
- data/lib/generators/foundation/templates/browserslist +4 -0
- data/lib/generators/foundation/templates/foundation_and_overrides.scss +56 -0
- data/spec/features/generator_spec.rb +1 -1
- data/spec/support/helpers.rb +8 -2
- data/vendor/assets/_vendor/sassy-lists/stylesheets/functions/_contain.scss +31 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/functions/_purge.scss +38 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/functions/_remove.scss +31 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/functions/_replace.scss +46 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/functions/_to-list.scss +27 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/helpers/_missing-dependencies.scss +25 -0
- data/vendor/assets/_vendor/sassy-lists/stylesheets/helpers/_true.scss +13 -0
- data/vendor/assets/js/foundation.cjs.js +12529 -0
- data/vendor/assets/js/foundation.cjs.js.map +1 -0
- data/vendor/assets/js/foundation.es6.js +11006 -0
- data/vendor/assets/js/foundation.es6.js.map +1 -0
- data/vendor/assets/js/foundation.esm.js +12490 -0
- data/vendor/assets/js/foundation.esm.js.map +1 -0
- data/vendor/assets/js/foundation.js +13897 -0
- data/vendor/assets/js/foundation.js.map +1 -0
- data/vendor/assets/js/foundation.min.js +2 -0
- data/vendor/assets/js/foundation.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.abide.js +1142 -0
- data/vendor/assets/js/plugins/foundation.abide.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.abide.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.abide.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.accordion.js +661 -0
- data/vendor/assets/js/plugins/foundation.accordion.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.accordion.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.accordion.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.accordionMenu.js +616 -0
- data/vendor/assets/js/plugins/foundation.accordionMenu.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.accordionMenu.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.accordionMenu.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.core.js +1180 -0
- data/vendor/assets/js/plugins/foundation.core.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.core.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.core.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.drilldown.js +968 -0
- data/vendor/assets/js/plugins/foundation.drilldown.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.drilldown.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.drilldown.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.dropdown.js +1328 -0
- data/vendor/assets/js/plugins/foundation.dropdown.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.dropdown.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.dropdown.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.dropdownMenu.js +799 -0
- data/vendor/assets/js/plugins/foundation.dropdownMenu.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.dropdownMenu.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.dropdownMenu.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.equalizer.js +614 -0
- data/vendor/assets/js/plugins/foundation.equalizer.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.equalizer.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.equalizer.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.interchange.js +796 -0
- data/vendor/assets/js/plugins/foundation.interchange.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.interchange.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.interchange.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.magellan.js +850 -0
- data/vendor/assets/js/plugins/foundation.magellan.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.magellan.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.magellan.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.offcanvas.js +1318 -0
- data/vendor/assets/js/plugins/foundation.offcanvas.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.offcanvas.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.offcanvas.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.orbit.js +886 -0
- data/vendor/assets/js/plugins/foundation.orbit.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.orbit.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.orbit.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.js +585 -0
- data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.responsiveAccordionTabs.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.responsiveMenu.js +413 -0
- data/vendor/assets/js/plugins/foundation.responsiveMenu.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.responsiveMenu.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.responsiveMenu.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.responsiveToggle.js +394 -0
- data/vendor/assets/js/plugins/foundation.responsiveToggle.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.responsiveToggle.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.responsiveToggle.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.reveal.js +1275 -0
- data/vendor/assets/js/plugins/foundation.reveal.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.reveal.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.reveal.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.slider.js +1346 -0
- data/vendor/assets/js/plugins/foundation.slider.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.slider.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.slider.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.smoothScroll.js +359 -0
- data/vendor/assets/js/plugins/foundation.smoothScroll.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.smoothScroll.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.smoothScroll.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.sticky.js +1105 -0
- data/vendor/assets/js/plugins/foundation.sticky.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.sticky.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.sticky.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.tabs.js +792 -0
- data/vendor/assets/js/plugins/foundation.tabs.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.tabs.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.tabs.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.toggler.js +704 -0
- data/vendor/assets/js/plugins/foundation.toggler.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.toggler.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.toggler.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.tooltip.js +1333 -0
- data/vendor/assets/js/plugins/foundation.tooltip.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.tooltip.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.tooltip.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.box.js +354 -0
- data/vendor/assets/js/plugins/foundation.util.box.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.box.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.util.box.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.imageLoader.js +218 -0
- data/vendor/assets/js/plugins/foundation.util.imageLoader.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.imageLoader.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.util.imageLoader.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.keyboard.js +341 -0
- data/vendor/assets/js/plugins/foundation.util.keyboard.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.keyboard.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.util.keyboard.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.mediaQuery.js +509 -0
- data/vendor/assets/js/plugins/foundation.util.mediaQuery.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.mediaQuery.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.util.mediaQuery.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.motion.js +274 -0
- data/vendor/assets/js/plugins/foundation.util.motion.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.motion.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.util.motion.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.nest.js +240 -0
- data/vendor/assets/js/plugins/foundation.util.nest.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.nest.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.util.nest.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.timer.js +226 -0
- data/vendor/assets/js/plugins/foundation.util.timer.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.timer.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.util.timer.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.touch.js +365 -0
- data/vendor/assets/js/plugins/foundation.util.touch.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.touch.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.util.touch.min.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.triggers.js +470 -0
- data/vendor/assets/js/plugins/foundation.util.triggers.js.map +1 -0
- data/vendor/assets/js/plugins/foundation.util.triggers.min.js +2 -0
- data/vendor/assets/js/plugins/foundation.util.triggers.min.js.map +1 -0
- data/vendor/assets/scss/_global.scss +244 -0
- data/vendor/assets/scss/components/_accordion-menu.scss +174 -0
- data/vendor/assets/scss/components/_accordion.scss +164 -0
- data/vendor/assets/scss/components/_badge.scss +63 -0
- data/vendor/assets/scss/components/_breadcrumbs.scss +119 -0
- data/vendor/assets/scss/components/_button-group.scss +304 -0
- data/vendor/assets/scss/components/_button.scss +428 -0
- data/vendor/assets/scss/components/_callout.scss +108 -0
- data/vendor/assets/scss/components/_card.scss +129 -0
- data/vendor/assets/scss/components/_close-button.scss +127 -0
- data/vendor/assets/scss/components/_drilldown.scss +140 -0
- data/vendor/assets/scss/components/_dropdown-menu.scss +279 -0
- data/vendor/assets/scss/components/_dropdown.scss +82 -0
- data/vendor/assets/scss/components/_flex-video.scss +1 -0
- data/vendor/assets/scss/components/_flex.scss +119 -0
- data/vendor/assets/scss/components/_float.scss +27 -0
- data/vendor/assets/scss/components/_label.scss +64 -0
- data/vendor/assets/scss/components/_media-object.scss +114 -0
- data/vendor/assets/scss/components/_menu-icon.scss +9 -0
- data/vendor/assets/scss/components/_menu.scss +495 -0
- data/vendor/assets/scss/components/_off-canvas.scss +511 -0
- data/vendor/assets/scss/components/_orbit.scss +197 -0
- data/vendor/assets/scss/components/_pagination.scss +201 -0
- data/vendor/assets/scss/components/_progress-bar.scss +63 -0
- data/vendor/assets/scss/components/_responsive-embed.scss +57 -0
- data/vendor/assets/scss/components/_reveal.scss +185 -0
- data/vendor/assets/scss/components/_slider.scss +137 -0
- data/vendor/assets/scss/components/_sticky.scss +39 -0
- data/vendor/assets/scss/components/_switch.scss +261 -0
- data/vendor/assets/scss/components/_table.scss +328 -0
- data/vendor/assets/scss/components/_tabs.scss +193 -0
- data/vendor/assets/scss/components/_thumbnail.scss +67 -0
- data/vendor/assets/scss/components/_title-bar.scss +84 -0
- data/vendor/assets/scss/components/_tooltip.scss +160 -0
- data/vendor/assets/scss/components/_top-bar.scss +175 -0
- data/vendor/assets/scss/components/_visibility.scss +135 -0
- data/vendor/assets/scss/forms/_checkbox.scss +41 -0
- data/vendor/assets/scss/forms/_error.scss +89 -0
- data/vendor/assets/scss/forms/_fieldset.scss +53 -0
- data/vendor/assets/scss/forms/_forms.scss +34 -0
- data/vendor/assets/scss/forms/_help-text.scss +30 -0
- data/vendor/assets/scss/forms/_input-group.scss +142 -0
- data/vendor/assets/scss/forms/_label.scss +50 -0
- data/vendor/assets/scss/forms/_meter.scss +116 -0
- data/vendor/assets/scss/forms/_progress.scss +94 -0
- data/vendor/assets/scss/forms/_range.scss +149 -0
- data/vendor/assets/scss/forms/_select.scss +90 -0
- data/vendor/assets/scss/forms/_text.scss +179 -0
- data/vendor/assets/scss/foundation.scss +155 -0
- data/vendor/assets/scss/grid/_classes.scss +189 -0
- data/vendor/assets/scss/grid/_column.scss +78 -0
- data/vendor/assets/scss/grid/_flex-grid.scss +260 -0
- data/vendor/assets/scss/grid/_grid.scss +48 -0
- data/vendor/assets/scss/grid/_gutter.scss +67 -0
- data/vendor/assets/scss/grid/_layout.scss +76 -0
- data/vendor/assets/scss/grid/_position.scss +100 -0
- data/vendor/assets/scss/grid/_row.scss +99 -0
- data/vendor/assets/scss/grid/_size.scss +24 -0
- data/vendor/assets/scss/motion-ui/_classes.scss +109 -0
- data/vendor/assets/scss/motion-ui/_settings.scss +62 -0
- data/vendor/assets/scss/motion-ui/effects/_fade.scss +29 -0
- data/vendor/assets/scss/motion-ui/effects/_hinge.scss +66 -0
- data/vendor/assets/scss/motion-ui/effects/_shake.scss +15 -0
- data/vendor/assets/scss/motion-ui/effects/_slide.scss +42 -0
- data/vendor/assets/scss/motion-ui/effects/_spin.scss +29 -0
- data/vendor/assets/scss/motion-ui/effects/_wiggle.scss +13 -0
- data/vendor/assets/scss/motion-ui/effects/_zoom.scss +15 -0
- data/vendor/assets/scss/motion-ui/motion-ui.scss +31 -0
- data/vendor/assets/scss/motion-ui/transitions/_fade.scss +30 -0
- data/vendor/assets/scss/motion-ui/transitions/_hinge.scss +44 -0
- data/vendor/assets/scss/motion-ui/transitions/_slide.scss +43 -0
- data/vendor/assets/scss/motion-ui/transitions/_spin.scss +40 -0
- data/vendor/assets/scss/motion-ui/transitions/_zoom.scss +41 -0
- data/vendor/assets/scss/motion-ui/util/_animation.scss +7 -0
- data/vendor/assets/scss/motion-ui/util/_args.scss +15 -0
- data/vendor/assets/scss/motion-ui/util/_function.scss +94 -0
- data/vendor/assets/scss/motion-ui/util/_keyframe.scss +136 -0
- data/vendor/assets/scss/motion-ui/util/_selector.scss +23 -0
- data/vendor/assets/scss/motion-ui/util/_series.scss +57 -0
- data/vendor/assets/scss/motion-ui/util/_string.scss +36 -0
- data/vendor/assets/scss/motion-ui/util/_transition.scss +45 -0
- data/vendor/assets/scss/motion-ui/util/_unit.scss +7 -0
- data/vendor/assets/scss/prototype/_arrow.scss +36 -0
- data/vendor/assets/scss/prototype/_border-box.scss +35 -0
- data/vendor/assets/scss/prototype/_border-none.scss +35 -0
- data/vendor/assets/scss/prototype/_bordered.scss +54 -0
- data/vendor/assets/scss/prototype/_box.scss +23 -0
- data/vendor/assets/scss/prototype/_display.scss +50 -0
- data/vendor/assets/scss/prototype/_font-styling.scss +95 -0
- data/vendor/assets/scss/prototype/_list-style-type.scss +95 -0
- data/vendor/assets/scss/prototype/_overflow.scss +72 -0
- data/vendor/assets/scss/prototype/_position.scss +114 -0
- data/vendor/assets/scss/prototype/_prototype.scss +87 -0
- data/vendor/assets/scss/prototype/_relation.scss +157 -0
- data/vendor/assets/scss/prototype/_rotate.scss +31 -0
- data/vendor/assets/scss/prototype/_rounded.scss +61 -0
- data/vendor/assets/scss/prototype/_separator.scss +96 -0
- data/vendor/assets/scss/prototype/_shadow.scss +43 -0
- data/vendor/assets/scss/prototype/_sizing.scss +73 -0
- data/vendor/assets/scss/prototype/_spacing.scss +179 -0
- data/vendor/assets/scss/prototype/_text-decoration.scss +48 -0
- data/vendor/assets/scss/prototype/_text-transformation.scss +48 -0
- data/vendor/assets/scss/prototype/_text-utilities.scss +88 -0
- data/vendor/assets/scss/settings/_settings.scss +895 -0
- data/vendor/assets/scss/typography/_alignment.scss +22 -0
- data/vendor/assets/scss/typography/_base.scss +474 -0
- data/vendor/assets/scss/typography/_helpers.scss +180 -0
- data/vendor/assets/scss/typography/_print.scss +96 -0
- data/vendor/assets/scss/typography/_typography.scss +26 -0
- data/vendor/assets/scss/util/_breakpoint.scss +435 -0
- data/vendor/assets/scss/util/_color.scss +139 -0
- data/vendor/assets/scss/util/_direction.scss +31 -0
- data/vendor/assets/scss/util/_flex.scss +90 -0
- data/vendor/assets/scss/util/_math.scss +147 -0
- data/vendor/assets/scss/util/_mixins.scss +373 -0
- data/vendor/assets/scss/util/_selector.scss +41 -0
- data/vendor/assets/scss/util/_typography.scss +26 -0
- data/vendor/assets/scss/util/_unit.scss +152 -0
- data/vendor/assets/scss/util/_util.scss +14 -0
- data/vendor/assets/scss/util/_value.scss +200 -0
- data/vendor/assets/scss/vendor/normalize.scss +281 -0
- data/vendor/assets/scss/xy-grid/_cell.scss +272 -0
- data/vendor/assets/scss/xy-grid/_classes.scss +493 -0
- data/vendor/assets/scss/xy-grid/_collapse.scss +75 -0
- data/vendor/assets/scss/xy-grid/_frame.scss +86 -0
- data/vendor/assets/scss/xy-grid/_grid.scss +37 -0
- data/vendor/assets/scss/xy-grid/_gutters.scss +45 -0
- data/vendor/assets/scss/xy-grid/_layout.scss +36 -0
- data/vendor/assets/scss/xy-grid/_position.scss +55 -0
- data/vendor/assets/scss/xy-grid/_xy-grid.scss +51 -0
- metadata +342 -83
- data/update-gem.sh +0 -20
- data/vendor/assets/javascripts/foundation/foundation.abide.js +0 -426
- data/vendor/assets/javascripts/foundation/foundation.accordion.js +0 -125
- data/vendor/assets/javascripts/foundation/foundation.alert.js +0 -43
- data/vendor/assets/javascripts/foundation/foundation.clearing.js +0 -586
- data/vendor/assets/javascripts/foundation/foundation.dropdown.js +0 -468
- data/vendor/assets/javascripts/foundation/foundation.equalizer.js +0 -104
- data/vendor/assets/javascripts/foundation/foundation.interchange.js +0 -360
- data/vendor/assets/javascripts/foundation/foundation.joyride.js +0 -935
- data/vendor/assets/javascripts/foundation/foundation.js +0 -732
- data/vendor/assets/javascripts/foundation/foundation.magellan.js +0 -214
- data/vendor/assets/javascripts/foundation/foundation.offcanvas.js +0 -225
- data/vendor/assets/javascripts/foundation/foundation.orbit.js +0 -476
- data/vendor/assets/javascripts/foundation/foundation.reveal.js +0 -522
- data/vendor/assets/javascripts/foundation/foundation.slider.js +0 -296
- data/vendor/assets/javascripts/foundation/foundation.tab.js +0 -247
- data/vendor/assets/javascripts/foundation/foundation.tooltip.js +0 -348
- data/vendor/assets/javascripts/foundation/foundation.topbar.js +0 -458
- data/vendor/assets/javascripts/foundation.js +0 -17
- data/vendor/assets/javascripts/vendor/modernizr.js +0 -1406
- data/vendor/assets/stylesheets/foundation/_functions.scss +0 -156
- data/vendor/assets/stylesheets/foundation/_settings.scss +0 -1489
- data/vendor/assets/stylesheets/foundation/components/_accordion.scss +0 -161
- data/vendor/assets/stylesheets/foundation/components/_alert-boxes.scss +0 -128
- data/vendor/assets/stylesheets/foundation/components/_block-grid.scss +0 -133
- data/vendor/assets/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
- data/vendor/assets/stylesheets/foundation/components/_button-groups.scss +0 -208
- data/vendor/assets/stylesheets/foundation/components/_buttons.scss +0 -261
- data/vendor/assets/stylesheets/foundation/components/_clearing.scss +0 -260
- data/vendor/assets/stylesheets/foundation/components/_dropdown-buttons.scss +0 -130
- data/vendor/assets/stylesheets/foundation/components/_dropdown.scss +0 -269
- data/vendor/assets/stylesheets/foundation/components/_flex-video.scss +0 -51
- data/vendor/assets/stylesheets/foundation/components/_forms.scss +0 -607
- data/vendor/assets/stylesheets/foundation/components/_global.scss +0 -566
- data/vendor/assets/stylesheets/foundation/components/_grid.scss +0 -292
- data/vendor/assets/stylesheets/foundation/components/_icon-bar.scss +0 -460
- data/vendor/assets/stylesheets/foundation/components/_inline-lists.scss +0 -58
- data/vendor/assets/stylesheets/foundation/components/_joyride.scss +0 -220
- data/vendor/assets/stylesheets/foundation/components/_keystrokes.scss +0 -60
- data/vendor/assets/stylesheets/foundation/components/_labels.scss +0 -106
- data/vendor/assets/stylesheets/foundation/components/_magellan.scss +0 -34
- data/vendor/assets/stylesheets/foundation/components/_offcanvas.scss +0 -606
- data/vendor/assets/stylesheets/foundation/components/_orbit.scss +0 -388
- data/vendor/assets/stylesheets/foundation/components/_pagination.scss +0 -163
- data/vendor/assets/stylesheets/foundation/components/_panels.scss +0 -107
- data/vendor/assets/stylesheets/foundation/components/_pricing-tables.scss +0 -150
- data/vendor/assets/stylesheets/foundation/components/_progress-bars.scss +0 -85
- data/vendor/assets/stylesheets/foundation/components/_range-slider.scss +0 -177
- data/vendor/assets/stylesheets/foundation/components/_reveal.scss +0 -212
- data/vendor/assets/stylesheets/foundation/components/_side-nav.scss +0 -120
- data/vendor/assets/stylesheets/foundation/components/_split-buttons.scss +0 -203
- data/vendor/assets/stylesheets/foundation/components/_sub-nav.scss +0 -125
- data/vendor/assets/stylesheets/foundation/components/_switches.scss +0 -241
- data/vendor/assets/stylesheets/foundation/components/_tables.scss +0 -135
- data/vendor/assets/stylesheets/foundation/components/_tabs.scss +0 -142
- data/vendor/assets/stylesheets/foundation/components/_thumbs.scss +0 -66
- data/vendor/assets/stylesheets/foundation/components/_tooltips.scss +0 -142
- data/vendor/assets/stylesheets/foundation/components/_top-bar.scss +0 -745
- data/vendor/assets/stylesheets/foundation/components/_type.scss +0 -525
- data/vendor/assets/stylesheets/foundation/components/_visibility.scss +0 -425
- data/vendor/assets/stylesheets/foundation.scss +0 -42
- data/vendor/assets/stylesheets/normalize.scss +0 -424
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./js/entries/foundation.js","webpack:///./js/foundation.abide.js","webpack:///./js/foundation.accordion.js","webpack:///./js/foundation.accordionMenu.js","webpack:///./js/foundation.core.js","webpack:///./js/foundation.core.plugin.js","webpack:///./js/foundation.core.utils.js","webpack:///./js/foundation.drilldown.js","webpack:///./js/foundation.dropdown.js","webpack:///./js/foundation.dropdownMenu.js","webpack:///./js/foundation.equalizer.js","webpack:///./js/foundation.interchange.js","webpack:///./js/foundation.magellan.js","webpack:///./js/foundation.offcanvas.js","webpack:///./js/foundation.orbit.js","webpack:///./js/foundation.positionable.js","webpack:///./js/foundation.responsiveAccordionTabs.js","webpack:///./js/foundation.responsiveMenu.js","webpack:///./js/foundation.responsiveToggle.js","webpack:///./js/foundation.reveal.js","webpack:///./js/foundation.slider.js","webpack:///./js/foundation.smoothScroll.js","webpack:///./js/foundation.sticky.js","webpack:///./js/foundation.tabs.js","webpack:///./js/foundation.toggler.js","webpack:///./js/foundation.tooltip.js","webpack:///./js/foundation.util.box.js","webpack:///./js/foundation.util.imageLoader.js","webpack:///./js/foundation.util.keyboard.js","webpack:///./js/foundation.util.mediaQuery.js","webpack:///./js/foundation.util.motion.js","webpack:///./js/foundation.util.nest.js","webpack:///./js/foundation.util.timer.js","webpack:///./js/foundation.util.touch.js","webpack:///./js/foundation.util.triggers.js","webpack:///external {\"root\":[\"jQuery\"],\"amd\":\"jquery\",\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\"}"],"names":["Foundation","addToJquery","$","rtl","CoreUtils","GetYoDigits","transitionend","RegExpEscape","onLoad","Box","onImagesLoaded","Keyboard","MediaQuery","Motion","Move","Nest","Timer","Touch","init","Triggers","_init","plugin","Abide","Accordion","AccordionMenu","Drilldown","Dropdown","DropdownMenu","Equalizer","Interchange","Magellan","OffCanvas","Orbit","ResponsiveMenu","ResponsiveToggle","Reveal","Slider","SmoothScroll","Sticky","Tabs","Toggler","Tooltip","ResponsiveAccordionTabs","element","options","$element","extend","defaults","data","isEnabled","formnovalidate","className","$inputs","merge","find","not","$submits","$globalErrors","a11yAttributes","each","i","input","addA11yAttributes","error","addGlobalErrorA11yAttributes","_events","off","on","resetForm","validateForm","e","key","preventDefault","target","getAttribute","submit","validateOn","validateInput","liveValidate","validateOnBlur","length","$el","attr","isGood","type","checked","opt","val","failedValidators","id","$error","siblings","formErrorSelector","parent","add","forEach","v","$label","closest","$els","labels","map","el","findLabel","$formError","findFormError","addClass","labelErrorClass","formErrorClass","inputErrorClass","$errors","$labels","filter","first","errorId","elemId","label","end","a11yErrorLevel","groupName","findRadioLabels","$formErrors","removeClass","findCheckboxLabels","removeRadioErrorClasses","removeCheckboxErrorClasses","clearRequire","requiredCheck","validator","manageErrorClasses","_validationIsDisabled","is","validateRadio","push","validateCheckbox","validateText","required","split","validators","equalTo","goodToGo","message","dependentElements","_this","removeErrorClasses","addErrorClasses","trigger","acc","checkboxGroupName","initialized","noError","indexOf","elem","$elem","css","pattern","inputText","valid","patterns","hasOwnProperty","test","RegExp","$group","prop","minRequired","parseInt","clear","$form","opts","Plugin","alpha","alpha_numeric","integer","number","card","cvv","email","url","domain","datetime","date","time","dateISO","month_day_year","day_month_year","color","website","text","register","_isInitializing","$tabs","children","idx","$content","linkId","$initActive","_initialAnchor","prev","_openSingleTab","_checkDeepLink","anchor","window","location","hash","$anchor","$link","isOwnAnchor","hasClass","_closeAllTabs","deepLinkSmudge","offset","animate","scrollTop","top","deepLinkSmudgeOffset","deepLinkSmudgeDelay","deepLink","$tabContent","toggle","handleKey","next","$a","focus","multiExpand","previous","handled","$target","console","info","up","down","updateHistory","history","pushState","replaceState","_openTab","$targetItem","$othersItems","allowAllClosed","_closeTab","$activeContents","targetContentId","stop","slideDown","slideSpeed","slideUp","$activeTabs","Feather","multiOpen","$menuLinks","$sub","subId","isActive","parentLink","clone","prependTo","wrap","submenuToggle","after","submenuToggleText","initPanes","$submenu","$elements","$prevElement","$nextElement","eq","Math","max","min","parents","open","close","closeAll","hideAll","$targetBranch","parentsUntil","$othersActiveSubmenus","$submenus","$allmenus","detach","remove","Burn","FOUNDATION_VERSION","version","_plugins","_uuids","name","functionName","attrName","hyphenate","registerPlugin","pluginName","constructor","toLowerCase","uuid","unregisterPlugin","splice","removeAttr","removeData","reInit","plugins","isJQ","fns","plgs","p","foundation","Object","keys","err","reflow","addBack","option","_index","trim","parseValue","er","getFnName","method","$noJS","args","Array","prototype","slice","call","arguments","plugClass","apply","ReferenceError","TypeError","fn","util","throttle","func","delay","timer","context","setTimeout","Date","now","getTime","vendors","requestAnimationFrame","vp","cancelAnimationFrame","navigator","userAgent","lastTime","callback","nextTime","clearTimeout","performance","start","Function","bind","oThis","aArgs","fToBind","fNOP","fBound","concat","funcNameRegex","results","exec","toString","str","isNaN","parseFloat","replace","_setup","getPluginName","_destroy","obj","namespace","chars","charsLength","floor","random","transitions","document","createElement","transition","style","triggerHandler","handler","didLoad","readyState","eventType","cb","one","ignoreMousedisappear","ignoreLeaveWindow","ignoreReappear","leaveEventHandler","eLeave","rest","relatedTarget","leaveEventDebouncer","hasFocus","reenterEventHandler","eReenter","currentTarget","has","autoApplyClass","$submenuAnchors","$menuItems","$currentMenu","_prepareMenu","_registerEvents","_keyboardEvents","$menu","$back","backButtonPosition","append","backButton","prepend","_back","autoHeight","$wrapper","wrapper","animateHeight","_getMaxDims","_show","closeOnClick","$body","contains","_hideAll","_bindHandler","_scrollTop","_resize","$scrollTopElement","scrollTopElement","scrollPos","scrollTopOffset","animationDuration","animationEasing","_hide","calcHeight","height","parentSubMenu","autoFocus","$expandedSubmenus","index","_setHideSubMenuClasses","isLastChild","_setShowSubMenuClasses","blur","maxHeight","result","numOfElems","GetDimensions","getBoundingClientRect","width","unwrap","$id","$anchors","_setCurrentAnchor","parentClass","$parent","$currentAnchor","position","match","horizontalPosition","alignment","hasTouch","ontouchstart","_setPosition","forceFollow","hover","bodyData","whatinput","timeout","hoverDelay","hoverPane","visibleFocusableElements","findFocusable","body","$focusable","_addBodyHandler","trapFocus","releaseFocus","hide","Positionable","vOffset","hOffset","allowOverlap","allowBottomOverlap","subs","verticalClass","rightClass","Rtl","changed","parClass","handleClickFn","hasSub","hasClicked","clickOpen","stopImmediatePropagation","closeOnClickInside","disableHover","autoclose","closingTime","isTab","nextSibling","prevSibling","openSub","closeSub","functions","_isVertical","_isRtl","_removeBodyHandler","isItself","$sibs","ImNotTouchingYou","oldClass","$parentLi","$toClose","somethingToClose","$activeItem","eqId","$watched","hasNested","isNested","isOn","onResizeMeBound","_onResizeMe","onPostEqualizedBound","_onPostEqualized","imgs","tooSmall","equalizeOn","_checkMQ","_reflow","_pauseEvents","equalizeOnStack","_isStacked","equalizeByRow","getHeightsByRow","applyHeightByRow","getHeights","applyHeight","heights","len","offsetHeight","lastElTopOffset","groups","group","elOffsetTop","j","ln","get","groupsILength","lenJ","rules","currentPath","_parseOptions","_addBreakpoints","_generateRules","rule","matchMedia","query","matches","path","types","log","queries","SPECIAL_QUERIES","value","rulesList","join","nodeName","response","html","calcPoints","$targets","$links","$active","pageYOffset","documentElement","points","winHeight","round","innerHeight","clientHeight","docHeight","scrollHeight","$tar","pt","threshold","targetPoint","deepLinking","scrollToLoc","_updateActive","onLoadListener","arrival","_deepLinkScroll","loc","_inTransition","newScrollPos","isScrollingUp","activeIdx","visibleLinks","$oldActive","activeHash","isNewActive","isNewHash","activeClass","pathname","search","contentClasses","base","reveal","$lastTrigger","$triggers","nested","$sticky","isInCanvas","contentId","warn","contentOverlay","overlay","overlayPosition","setAttribute","$overlay","insertAfter","revealOnRegExp","revealClass","revealOnClass","isRevealed","revealOn","_setMQChecker","transitionTime","contentScroll","inCanvasFor","inCanvasOn","_checkInCanvas","_removeContentClasses","_handleKeyboard","atLeast","hasReveal","_","topVal","absoluteTopVal","stickyData","_addContentClasses","event","allowUp","allowDown","lastY","originalEvent","pageY","stopPropagation","hasAttribute","forceTo","scrollTo","_stopScrolling","_recordScrollable","_stopScrollPropagation","canvasFocus","_fixStickyElements","_unfixStickyElements","_reset","containerClass","$slides","slideClass","$images","initActive","useMUI","_prepareForOrbit","bullets","_loadBullets","autoPlay","geoSync","accessible","$bullets","boxOfBullets","duration","timerDelay","infinite","changeSlide","_setWrapperHeight","temp","counter","swipe","pauseOnHover","pause","navButtons","$controls","nextClass","prevClass","ltr","$slide","restart","show","_updateBullets","isLTR","chosenSlide","$curSlide","$firstSlide","$lastSlide","last","dirIn","dirOut","$newSlide","infiniteWrap","animateIn","animateOut","isPaused","$oldBullet","$othersBullets","$newBullet","activeStateDescriptor","spans","spanCountInOthersBullets","toArray","b","every","count","animInFromRight","animOutToRight","animInFromLeft","animOutToLeft","POSITIONS","VERTICAL_ALIGNMENTS","HORIZONTAL_ALIGNMENTS","ALIGNMENTS","nextItem","item","array","currentIdx","triedPositions","_getDefaultPosition","_getDefaultAlignment","originalPosition","originalAlignment","_alignmentsExhausted","_realign","_addTriedPosition","isExhausted","GetExplicitOffsets","_getVOffset","_getHOffset","minOverlap","minCoordinates","_positionsExhausted","overlap","OverlapArea","_reposition","MenuPlugins","tabs","cssClass","selectTab","accordion","storezfData","currentMq","currentRule","currentPlugin","rulesTree","ruleSize","rulePlugin","_getAllOptions","isEmptyObject","_checkMediaQueries","allOptions","dummyPlugin","tmpPlugin","keyKey","objObj","destroy","_changedZfMediaQueryHandler","matchedMq","_handleMarkup","toSet","fromString","$panels","tabsTitle","linkClass","tabsPanel","panelClass","$liHeads","$liHeadsA","display","visibility","appendTo","$tabsContent","$placeholder","tempValue","_target","dropdown","drilldown","targetID","$targetMenu","$toggler","animationIn","animationOut","_update","_updateMqHandler","toggleMenu","hideFor","cached","mq","current","fullScreen","_makeOverlay","additionalOverlayClasses","outerWidth","outerHeight","left","margin","_updatePosition","_handleState","$activeAnchor","activeElement","multipleOpened","_disableScroll","afterAnimation","_addGlobalClasses","focusableElements","showDelay","_addGlobalListeners","updateScrollbarClass","toggleClass","closeOnEsc","finishUp","hideDelay","_removeGlobalClasses","_enableScroll","resetOnClose","urlWithoutHash","title","inputs","handles","$handle","$input","$fill","vertical","disabled","disabledClass","binding","_setInitAttr","doubleSided","$handle2","$input2","setHandles","_setHandlePos","pctOfBar","percent","positionValueFunction","_logTransform","_powTransform","toFixed","baseLog","nonLinearBase","pow","$hndl","isDbl","h2Val","step","h1Val","vert","hOrW","lOrT","handleDim","elemDim","_pctOfBar","pxToMove","movement","decimal","_setValues","isLeftHndl","dim","handlePct","handlePos","initialStart","moveTime","changedDelay","initVal","initialEnd","hasVal","param","direction","eventOffset","pageX","barDim","windowScroll","scrollLeft","elemOffset","clientY","eventFromBar","barXY","offsetPct","_value","_adjustValue","firstHndlPos","absPosition","secndHndlPos","div","prev_val","next_val","_eventsForHandle","curHandle","handleChangeEvent","_handleEvent","keyCode","clickSelect","draggable","addTouch","_$handle","oldValue","newValue","decrease","increase","decrease_fast","increase_fast","invertVertical","frac","num","dir","clickPos","abs","_linkClickListener","_handleLinkClick","$loc","$container","wasWrapped","container","stickyClass","scrollCount","checkEvery","isStuck","containerHeight","elemHeight","_parsePoints","_setSizes","scroll","_calc","_removeSticky","topPoint","reverse","topAnchor","btm","btmAnchor","pts","breaks","place","scrollListener","canStick","_eventsHandler","_pauseListeners","checkSizes","bottomPoint","_setSticky","stickTo","mrgn","notStuckTo","isTop","stickToTop","anchorPt","anchorHeight","topOrBottom","stickyOn","newElemWidth","comp","getComputedStyle","pdngl","pdngr","dynamicHeight","newContainerHeight","_setBreakPoints","mTop","emCalc","marginTop","mBtm","marginBottom","bottom","em","fontSize","$tabTitles","linkActiveClass","matchHeight","_setHeight","anchorNoHash","_collapse","_addKeyHandler","_addClickHandler","_setHeightMqHandler","_handleTabChange","which","wrapOnKeys","historyHandled","activeCollapse","$oldTab","$tabLink","$targetContent","_collapseTab","panelActiveClass","$target_anchor","$activeTab","idStr","hashIdStr","panel","toggler","Error","$trigger","controls","containsId","_updateARIA","undefined","isClick","tipText","template","_buildTemplate","allowHtml","triggerClass","elementClassName","SVGElement","baseVal","tooltipWidth","tooltipHeight","templateClasses","tooltipClass","$template","showOn","fadeIn","fadeInDuration","fadeOut","fadeOutDuration","isFocus","disableForTouch","touchCloseText","lrOnly","tbOnly","ignoreBottom","eleDims","topOver","bottomOver","leftOver","rightOver","parDims","windowDims","sqrt","rect","parRect","parentNode","winRect","winY","winX","pageXOffset","parentDims","isOverflow","$eleDims","$anchorDims","leftVal","images","self","unloaded","complete","naturalWidth","singleImageLoaded","image","Image","events","me","src","keyCodes","commands","parseKey","String","fromCharCode","toUpperCase","shiftKey","ctrlKey","altKey","getKeyCodes","component","commandList","cmds","command","zfIsKeyHandled","returnValue","unhandled","componentName","$firstFocusable","$lastFocusable","kcs","k","kc","defaultQueries","landscape","portrait","retina","styleMedia","media","script","getElementsByTagName","head","appendChild","insertBefore","currentStyle","matchMedium","styleSheet","cssText","textContent","isInitialized","$meta","extractedStyles","namedQueries","parseStyleToObject","_getCurrentSize","_watcher","_reInit","size","only","upTo","nextSize","parts","bpSize","bpModifier","queryIndex","findIndex","q","_getQueryName","nextQuery","matched","newSize","currentSize","styleObject","reduce","ret","decodeURIComponent","isArray","initClasses","activeClasses","animation","anim","prog","move","ts","isIn","initClass","reset","offsetWidth","finish","transitionDuration","menu","items","subMenuClass","subItemClass","hasSubClass","applyAria","$item","nameSpace","remain","startPosX","startPosY","startTime","elapsedTime","startEvent","isMoving","didMoved","onTouchEnd","removeEventListener","onTouchMove","tapEvent","Event","spotSwipe","x","touches","y","dx","dy","moveThreshold","timeThreshold","assign","onTouchStart","addEventListener","teardown","SpotSwipe","enabled","special","setup","tap","noop","setupSpotSwipe","setupTouchHandler","handleTouch","changedTouches","eventTypes","touchstart","touchmove","touchend","simulatedEvent","MouseEvent","screenX","screenY","clientX","createEvent","initMouseEvent","dispatchEvent","MutationObserver","prefixes","triggers","Listeners","Basic","Global","Initializers","openListener","closeListener","toggleListener","closeableListener","toggleFocusListener","addOpenListener","addCloseListener","addToggleListener","addCloseableListener","addToggleFocusListener","resizeListener","$nodes","closeMeListener","pluginId","addClosemeListener","yetiBoxes","plugNames","listeners","debounceGlobalListener","debounce","listener","addResizeListener","addScrollListener","addMutationEventsListener","listeningElementsMutation","mutationRecordsList","attributeName","elementObserver","observe","attributes","childList","characterData","subtree","attributeFilter","addSimpleListeners","$document","addGlobalListeners","triggersInitialized","IHearYou"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BA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ACbA,cAAU,CAACmB,QAAX,GAAsBA,QAAtB,CADa,CAEb;;AACAnB,cAAU,CAAC2tC,QAAX,GAAsBxsC,QAAQ,CAACiqC,YAAT,CAAsBqC,kBAA5C;AACD;AACF,CAdD;;;;;;;;;;;;;;;;;;;;;;;;;ACrPA,oD","file":"foundation.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"jquery\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"jquery\")) : factory(root[\"jQuery\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function(__WEBPACK_EXTERNAL_MODULE_jquery__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import $ from 'jquery';\n\nimport { Foundation } from '../foundation.core';\nimport * as CoreUtils from '../foundation.core.utils';\nimport { Box } from '../foundation.util.box'\nimport { onImagesLoaded } from '../foundation.util.imageLoader';\nimport { Keyboard } from '../foundation.util.keyboard';\nimport { MediaQuery } from '../foundation.util.mediaQuery';\nimport { Motion, Move } from '../foundation.util.motion';\nimport { Nest } from '../foundation.util.nest';\nimport { Timer } from '../foundation.util.timer';\nimport { Touch } from '../foundation.util.touch';\nimport { Triggers } from '../foundation.util.triggers';\nimport { Abide } from '../foundation.abide';\nimport { Accordion } from '../foundation.accordion';\nimport { AccordionMenu } from '../foundation.accordionMenu';\nimport { Drilldown } from '../foundation.drilldown';\nimport { Dropdown } from '../foundation.dropdown';\nimport { DropdownMenu } from '../foundation.dropdownMenu';\nimport { Equalizer } from '../foundation.equalizer';\nimport { Interchange } from '../foundation.interchange';\nimport { Magellan } from '../foundation.magellan';\nimport { OffCanvas } from '../foundation.offcanvas';\nimport { Orbit } from '../foundation.orbit';\nimport { ResponsiveMenu } from '../foundation.responsiveMenu';\nimport { ResponsiveToggle } from '../foundation.responsiveToggle';\nimport { Reveal } from '../foundation.reveal';\nimport { Slider } from '../foundation.slider';\nimport { SmoothScroll } from '../foundation.smoothScroll';\nimport { Sticky } from '../foundation.sticky';\nimport { Tabs } from '../foundation.tabs';\nimport { Toggler } from '../foundation.toggler';\nimport { Tooltip } from '../foundation.tooltip';\nimport { ResponsiveAccordionTabs } from '../foundation.responsiveAccordionTabs';\n\nFoundation.addToJquery($);\n\n// Add Foundation Utils to Foundation global namespace for backwards\n// compatibility.\nFoundation.rtl = CoreUtils.rtl;\nFoundation.GetYoDigits = CoreUtils.GetYoDigits;\nFoundation.transitionend = CoreUtils.transitionend;\nFoundation.RegExpEscape = CoreUtils.RegExpEscape;\nFoundation.onLoad = CoreUtils.onLoad;\n\nFoundation.Box = Box;\nFoundation.onImagesLoaded = onImagesLoaded;\nFoundation.Keyboard = Keyboard;\nFoundation.MediaQuery = MediaQuery;\nFoundation.Motion = Motion;\nFoundation.Move = Move;\nFoundation.Nest = Nest;\nFoundation.Timer = Timer;\n\n// Touch and Triggers previously were almost purely sede effect driven,\n// so no need to add it to Foundation, just init them.\nTouch.init($);\nTriggers.init($, Foundation);\nMediaQuery._init();\n\nFoundation.plugin(Abide, 'Abide');\nFoundation.plugin(Accordion, 'Accordion');\nFoundation.plugin(AccordionMenu, 'AccordionMenu');\nFoundation.plugin(Drilldown, 'Drilldown');\nFoundation.plugin(Dropdown, 'Dropdown');\nFoundation.plugin(DropdownMenu, 'DropdownMenu');\nFoundation.plugin(Equalizer, 'Equalizer');\nFoundation.plugin(Interchange, 'Interchange');\nFoundation.plugin(Magellan, 'Magellan');\nFoundation.plugin(OffCanvas, 'OffCanvas');\nFoundation.plugin(Orbit, 'Orbit');\nFoundation.plugin(ResponsiveMenu, 'ResponsiveMenu');\nFoundation.plugin(ResponsiveToggle, 'ResponsiveToggle');\nFoundation.plugin(Reveal, 'Reveal');\nFoundation.plugin(Slider, 'Slider');\nFoundation.plugin(SmoothScroll, 'SmoothScroll');\nFoundation.plugin(Sticky, 'Sticky');\nFoundation.plugin(Tabs, 'Tabs');\nFoundation.plugin(Toggler, 'Toggler');\nFoundation.plugin(Tooltip, 'Tooltip');\nFoundation.plugin(ResponsiveAccordionTabs, 'ResponsiveAccordionTabs');\n\nexport {\n Foundation,\n CoreUtils,\n Box,\n onImagesLoaded,\n Keyboard,\n MediaQuery,\n Motion,\n Nest,\n Timer,\n Touch,\n Triggers,\n Abide,\n Accordion,\n AccordionMenu,\n Drilldown,\n Dropdown,\n DropdownMenu,\n Equalizer,\n Interchange,\n Magellan,\n OffCanvas,\n Orbit,\n ResponsiveMenu,\n ResponsiveToggle,\n Reveal,\n Slider,\n SmoothScroll,\n Sticky,\n Tabs,\n Toggler,\n Tooltip,\n ResponsiveAccordionTabs\n}\n\nexport default Foundation;\n\n","'use strict';\n\nimport $ from 'jquery';\nimport { Plugin } from './foundation.core.plugin';\nimport { GetYoDigits } from './foundation.core.utils';\n\n/**\n * Abide module.\n * @module foundation.abide\n */\n\nclass Abide extends Plugin {\n /**\n * Creates a new instance of Abide.\n * @class\n * @name Abide\n * @fires Abide#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options = {}) {\n this.$element = element;\n this.options = $.extend(true, {}, Abide.defaults, this.$element.data(), options);\n this.isEnabled = true;\n this.formnovalidate = null;\n\n this.className = 'Abide'; // ie9 back compat\n this._init();\n }\n\n /**\n * Initializes the Abide plugin and calls functions to get Abide functioning on load.\n * @private\n */\n _init() {\n this.$inputs = $.merge( // Consider as input to validate:\n this.$element.find('input').not('[type=\"submit\"]'), // * all input fields expect submit\n this.$element.find('textarea, select') // * all textareas and select fields\n );\n this.$submits = this.$element.find('[type=\"submit\"]');\n const $globalErrors = this.$element.find('[data-abide-error]');\n\n // Add a11y attributes to all fields\n if (this.options.a11yAttributes) {\n this.$inputs.each((i, input) => this.addA11yAttributes($(input)));\n $globalErrors.each((i, error) => this.addGlobalErrorA11yAttributes($(error)));\n }\n\n this._events();\n }\n\n /**\n * Initializes events for Abide.\n * @private\n */\n _events() {\n this.$element.off('.abide')\n .on('reset.zf.abide', () => {\n this.resetForm();\n })\n .on('submit.zf.abide', () => {\n return this.validateForm();\n });\n\n this.$submits\n .off('click.zf.abide keydown.zf.abide')\n .on('click.zf.abide keydown.zf.abide', (e) => {\n if (!e.key || (e.key === ' ' || e.key === 'Enter')) {\n e.preventDefault();\n this.formnovalidate = e.target.getAttribute('formnovalidate') !== null;\n this.$element.submit();\n }\n });\n\n if (this.options.validateOn === 'fieldChange') {\n this.$inputs\n .off('change.zf.abide')\n .on('change.zf.abide', (e) => {\n this.validateInput($(e.target));\n });\n }\n\n if (this.options.liveValidate) {\n this.$inputs\n .off('input.zf.abide')\n .on('input.zf.abide', (e) => {\n this.validateInput($(e.target));\n });\n }\n\n if (this.options.validateOnBlur) {\n this.$inputs\n .off('blur.zf.abide')\n .on('blur.zf.abide', (e) => {\n this.validateInput($(e.target));\n });\n }\n }\n\n /**\n * Calls necessary functions to update Abide upon DOM change\n * @private\n */\n _reflow() {\n this._init();\n }\n\n /**\n * Checks whether the submitted form should be validated or not, consodering formnovalidate and isEnabled\n * @returns {Boolean}\n * @private\n */\n _validationIsDisabled() {\n if (this.isEnabled === false) { // whole validation disabled\n return true;\n } else if (typeof this.formnovalidate === 'boolean') { // triggered by $submit\n return this.formnovalidate;\n }\n // triggered by Enter in non-submit input\n return this.$submits.length ? this.$submits[0].getAttribute('formnovalidate') !== null : false;\n }\n\n /**\n * Enables the whole validation\n */\n enableValidation() {\n this.isEnabled = true;\n }\n\n /**\n * Disables the whole validation\n */\n disableValidation() {\n this.isEnabled = false;\n }\n\n /**\n * Checks whether or not a form element has the required attribute and if it's checked or not\n * @param {Object} element - jQuery object to check for required attribute\n * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty\n */\n requiredCheck($el) {\n if (!$el.attr('required')) return true;\n\n var isGood = true;\n\n switch ($el[0].type) {\n case 'checkbox':\n isGood = $el[0].checked;\n break;\n\n case 'select':\n case 'select-one':\n case 'select-multiple':\n var opt = $el.find('option:selected');\n if (!opt.length || !opt.val()) isGood = false;\n break;\n\n default:\n if (!$el.val() || !$el.val().length) isGood = false;\n }\n\n return isGood;\n }\n\n /**\n * Get:\n * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order:\n * 1. The element's direct sibling('s).\n * 2. The element's parent's children.\n * - Element(s) with the attribute `[data-form-error-for]` set with the element's id.\n *\n * This allows for multiple form errors per input, though if none are found, no form errors will be shown.\n *\n * @param {Object} $el - jQuery object to use as reference to find the form error selector.\n * @param {String[]} [failedValidators] - List of failed validators.\n * @returns {Object} jQuery object with the selector.\n */\n findFormError($el, failedValidators) {\n var id = $el.length ? $el[0].id : '';\n var $error = $el.siblings(this.options.formErrorSelector);\n\n if (!$error.length) {\n $error = $el.parent().find(this.options.formErrorSelector);\n }\n\n if (id) {\n $error = $error.add(this.$element.find(`[data-form-error-for=\"${id}\"]`));\n }\n\n if (!!failedValidators) {\n $error = $error.not('[data-form-error-on]')\n\n failedValidators.forEach((v) => {\n $error = $error.add($el.siblings(`[data-form-error-on=\"${v}\"]`));\n $error = $error.add(this.$element.find(`[data-form-error-for=\"${id}\"][data-form-error-on=\"${v}\"]`));\n });\n }\n\n return $error;\n }\n\n /**\n * Get the first element in this order:\n * 2. The <label> with the attribute `[for=\"someInputId\"]`\n * 3. The `.closest()` <label>\n *\n * @param {Object} $el - jQuery object to check for required attribute\n * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty\n */\n findLabel($el) {\n var id = $el[0].id;\n var $label = this.$element.find(`label[for=\"${id}\"]`);\n\n if (!$label.length) {\n return $el.closest('label');\n }\n\n return $label;\n }\n\n /**\n * Get the set of labels associated with a set of radio els in this order\n * 2. The <label> with the attribute `[for=\"someInputId\"]`\n * 3. The `.closest()` <label>\n *\n * @param {Object} $el - jQuery object to check for required attribute\n * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty\n */\n findRadioLabels($els) {\n var labels = $els.map((i, el) => {\n var id = el.id;\n var $label = this.$element.find(`label[for=\"${id}\"]`);\n\n if (!$label.length) {\n $label = $(el).closest('label');\n }\n return $label[0];\n });\n\n return $(labels);\n }\n\n /**\n * Get the set of labels associated with a set of checkbox els in this order\n * 2. The <label> with the attribute `[for=\"someInputId\"]`\n * 3. The `.closest()` <label>\n *\n * @param {Object} $el - jQuery object to check for required attribute\n * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty\n */\n findCheckboxLabels($els) {\n var labels = $els.map((i, el) => {\n var id = el.id;\n var $label = this.$element.find(`label[for=\"${id}\"]`);\n\n if (!$label.length) {\n $label = $(el).closest('label');\n }\n return $label[0];\n });\n\n return $(labels);\n }\n\n /**\n * Adds the CSS error class as specified by the Abide settings to the label, input, and the form\n * @param {Object} $el - jQuery object to add the class to\n * @param {String[]} [failedValidators] - List of failed validators.\n */\n addErrorClasses($el, failedValidators) {\n var $label = this.findLabel($el);\n var $formError = this.findFormError($el, failedValidators);\n\n if ($label.length) {\n $label.addClass(this.options.labelErrorClass);\n }\n\n if ($formError.length) {\n $formError.addClass(this.options.formErrorClass);\n }\n\n $el.addClass(this.options.inputErrorClass).attr({\n 'data-invalid': '',\n 'aria-invalid': true\n });\n }\n\n /**\n * Adds [for] and [role=alert] attributes to all form error targetting $el,\n * and [aria-describedby] attribute to $el toward the first form error.\n * @param {Object} $el - jQuery object\n */\n addA11yAttributes($el) {\n let $errors = this.findFormError($el);\n let $labels = $errors.filter('label');\n let $error = $errors.first();\n if (!$errors.length) return;\n\n // Set [aria-describedby] on the input toward the first form error if it is not set\n if (typeof $el.attr('aria-describedby') === 'undefined') {\n // Get the first error ID or create one\n let errorId = $error.attr('id');\n if (typeof errorId === 'undefined') {\n errorId = GetYoDigits(6, 'abide-error');\n $error.attr('id', errorId);\n }\n\n $el.attr('aria-describedby', errorId);\n }\n\n if ($labels.filter('[for]').length < $labels.length) {\n // Get the input ID or create one\n let elemId = $el.attr('id');\n if (typeof elemId === 'undefined') {\n elemId = GetYoDigits(6, 'abide-input');\n $el.attr('id', elemId);\n }\n\n // For each label targeting $el, set [for] if it is not set.\n $labels.each((i, label) => {\n const $label = $(label);\n if (typeof $label.attr('for') === 'undefined')\n $label.attr('for', elemId);\n });\n }\n\n // For each error targeting $el, set [role=alert] if it is not set.\n $errors.each((i, label) => {\n const $label = $(label);\n if (typeof $label.attr('role') === 'undefined')\n $label.attr('role', 'alert');\n }).end();\n }\n\n /**\n * Adds [aria-live] attribute to the given global form error $el.\n * @param {Object} $el - jQuery object to add the attribute to\n */\n addGlobalErrorA11yAttributes($el) {\n if (typeof $el.attr('aria-live') === 'undefined')\n $el.attr('aria-live', this.options.a11yErrorLevel);\n }\n\n /**\n * Remove CSS error classes etc from an entire radio button group\n * @param {String} groupName - A string that specifies the name of a radio button group\n *\n */\n removeRadioErrorClasses(groupName) {\n var $els = this.$element.find(`:radio[name=\"${groupName}\"]`);\n var $labels = this.findRadioLabels($els);\n var $formErrors = this.findFormError($els);\n\n if ($labels.length) {\n $labels.removeClass(this.options.labelErrorClass);\n }\n\n if ($formErrors.length) {\n $formErrors.removeClass(this.options.formErrorClass);\n }\n\n $els.removeClass(this.options.inputErrorClass).attr({\n 'data-invalid': null,\n 'aria-invalid': null\n });\n\n }\n\n /**\n * Remove CSS error classes etc from an entire checkbox group\n * @param {String} groupName - A string that specifies the name of a checkbox group\n *\n */\n removeCheckboxErrorClasses(groupName) {\n var $els = this.$element.find(`:checkbox[name=\"${groupName}\"]`);\n var $labels = this.findCheckboxLabels($els);\n var $formErrors = this.findFormError($els);\n\n if ($labels.length) {\n $labels.removeClass(this.options.labelErrorClass);\n }\n\n if ($formErrors.length) {\n $formErrors.removeClass(this.options.formErrorClass);\n }\n\n $els.removeClass(this.options.inputErrorClass).attr({\n 'data-invalid': null,\n 'aria-invalid': null\n });\n\n }\n\n /**\n * Removes CSS error class as specified by the Abide settings from the label, input, and the form\n * @param {Object} $el - jQuery object to remove the class from\n */\n removeErrorClasses($el) {\n // radios need to clear all of the els\n if ($el[0].type == 'radio') {\n return this.removeRadioErrorClasses($el.attr('name'));\n }\n // checkboxes need to clear all of the els\n else if ($el[0].type == 'checkbox') {\n return this.removeCheckboxErrorClasses($el.attr('name'));\n }\n\n var $label = this.findLabel($el);\n var $formError = this.findFormError($el);\n\n if ($label.length) {\n $label.removeClass(this.options.labelErrorClass);\n }\n\n if ($formError.length) {\n $formError.removeClass(this.options.formErrorClass);\n }\n\n $el.removeClass(this.options.inputErrorClass).attr({\n 'data-invalid': null,\n 'aria-invalid': null\n });\n }\n\n /**\n * Goes through a form to find inputs and proceeds to validate them in ways specific to their type.\n * Ignores inputs with data-abide-ignore, type=\"hidden\" or disabled attributes set\n * @fires Abide#invalid\n * @fires Abide#valid\n * @param {Object} element - jQuery object to validate, should be an HTML input\n * @returns {Boolean} goodToGo - If the input is valid or not.\n */\n validateInput($el) {\n var clearRequire = this.requiredCheck($el),\n validator = $el.attr('data-validator'),\n failedValidators = [],\n manageErrorClasses = true;\n\n // skip validation if disabled\n if (this._validationIsDisabled()) {\n return true;\n }\n\n // don't validate ignored inputs or hidden inputs or disabled inputs\n if ($el.is('[data-abide-ignore]') || $el.is('[type=\"hidden\"]') || $el.is('[disabled]')) {\n return true;\n }\n\n switch ($el[0].type) {\n case 'radio':\n this.validateRadio($el.attr('name')) || failedValidators.push('required');\n break;\n\n case 'checkbox':\n this.validateCheckbox($el.attr('name')) || failedValidators.push('required');\n // validateCheckbox() adds/removes error classes\n manageErrorClasses = false;\n break;\n\n case 'select':\n case 'select-one':\n case 'select-multiple':\n clearRequire || failedValidators.push('required');\n break;\n\n default:\n clearRequire || failedValidators.push('required');\n this.validateText($el) || failedValidators.push('pattern');\n }\n\n if (validator) {\n const required = $el.attr('required') ? true : false;\n\n validator.split(' ').forEach((v) => {\n this.options.validators[v]($el, required, $el.parent()) || failedValidators.push(v);\n });\n }\n\n if ($el.attr('data-equalto')) {\n this.options.validators.equalTo($el) || failedValidators.push('equalTo');\n }\n\n var goodToGo = failedValidators.length === 0;\n var message = (goodToGo ? 'valid' : 'invalid') + '.zf.abide';\n\n if (goodToGo) {\n // Re-validate inputs that depend on this one with equalto\n const dependentElements = this.$element.find(`[data-equalto=\"${$el.attr('id')}\"]`);\n if (dependentElements.length) {\n let _this = this;\n dependentElements.each(function() {\n if ($(this).val()) {\n _this.validateInput($(this));\n }\n });\n }\n }\n\n if (manageErrorClasses) {\n this.removeErrorClasses($el);\n\n if (!goodToGo) {\n this.addErrorClasses($el, failedValidators);\n }\n }\n\n /**\n * Fires when the input is done checking for validation. Event trigger is either `valid.zf.abide` or `invalid.zf.abide`\n * Trigger includes the DOM element of the input.\n * @event Abide#valid\n * @event Abide#invalid\n */\n $el.trigger(message, [$el]);\n\n return goodToGo;\n }\n\n /**\n * Goes through a form and if there are any invalid inputs, it will display the form error element\n * @returns {Boolean} noError - true if no errors were detected...\n * @fires Abide#formvalid\n * @fires Abide#forminvalid\n */\n validateForm() {\n var acc = [];\n var _this = this;\n var checkboxGroupName;\n\n // Remember first form submission to prevent specific checkbox validation (more than one required) until form got initially submitted\n if (!this.initialized) {\n this.initialized = true;\n }\n\n // skip validation if disabled\n if (this._validationIsDisabled()) {\n this.formnovalidate = null;\n return true;\n }\n\n this.$inputs.each(function() {\n\n // Only use one checkbox per group since validateCheckbox() iterates over all associated checkboxes\n if ($(this)[0].type === 'checkbox') {\n if ($(this).attr('name') === checkboxGroupName) return true;\n checkboxGroupName = $(this).attr('name');\n }\n\n acc.push(_this.validateInput($(this)));\n });\n\n var noError = acc.indexOf(false) === -1;\n\n this.$element.find('[data-abide-error]').each((i, elem) => {\n const $elem = $(elem);\n // Ensure a11y attributes are set\n if (this.options.a11yAttributes) this.addGlobalErrorA11yAttributes($elem);\n // Show or hide the error\n $elem.css('display', (noError ? 'none' : 'block'));\n });\n\n /**\n * Fires when the form is finished validating. Event trigger is either `formvalid.zf.abide` or `forminvalid.zf.abide`.\n * Trigger includes the element of the form.\n * @event Abide#formvalid\n * @event Abide#forminvalid\n */\n this.$element.trigger((noError ? 'formvalid' : 'forminvalid') + '.zf.abide', [this.$element]);\n\n return noError;\n }\n\n /**\n * Determines whether or a not a text input is valid based on the pattern specified in the attribute. If no matching pattern is found, returns true.\n * @param {Object} $el - jQuery object to validate, should be a text input HTML element\n * @param {String} pattern - string value of one of the RegEx patterns in Abide.options.patterns\n * @returns {Boolean} Boolean value depends on whether or not the input value matches the pattern specified\n */\n validateText($el, pattern) {\n // A pattern can be passed to this function, or it will be infered from the input's \"pattern\" attribute, or it's \"type\" attribute\n pattern = (pattern || $el.attr('data-pattern') || $el.attr('pattern') || $el.attr('type'));\n var inputText = $el.val();\n var valid = true;\n\n if (inputText.length) {\n // If the pattern attribute on the element is in Abide's list of patterns, then test that regexp\n if (this.options.patterns.hasOwnProperty(pattern)) {\n valid = this.options.patterns[pattern].test(inputText);\n }\n // If the pattern name isn't also the type attribute of the field, then test it as a regexp\n else if (pattern !== $el.attr('type')) {\n valid = new RegExp(pattern).test(inputText);\n }\n }\n\n return valid;\n }\n\n /**\n * Determines whether or a not a radio input is valid based on whether or not it is required and selected. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all radio buttons in its group.\n * @param {String} groupName - A string that specifies the name of a radio button group\n * @returns {Boolean} Boolean value depends on whether or not at least one radio input has been selected (if it's required)\n */\n validateRadio(groupName) {\n // If at least one radio in the group has the `required` attribute, the group is considered required\n // Per W3C spec, all radio buttons in a group should have `required`, but we're being nice\n var $group = this.$element.find(`:radio[name=\"${groupName}\"]`);\n var valid = false, required = false;\n\n // For the group to be required, at least one radio needs to be required\n $group.each((i, e) => {\n if ($(e).attr('required')) {\n required = true;\n }\n });\n if (!required) valid=true;\n\n if (!valid) {\n // For the group to be valid, at least one radio needs to be checked\n $group.each((i, e) => {\n if ($(e).prop('checked')) {\n valid = true;\n }\n });\n }\n\n return valid;\n }\n\n /**\n * Determines whether or a not a checkbox input is valid based on whether or not it is required and checked. Although the function targets a single `<input>`, it validates by checking the `required` and `checked` properties of all checkboxes in its group.\n * @param {String} groupName - A string that specifies the name of a checkbox group\n * @returns {Boolean} Boolean value depends on whether or not at least one checkbox input has been checked (if it's required)\n */\n validateCheckbox(groupName) {\n // If at least one checkbox in the group has the `required` attribute, the group is considered required\n // Per W3C spec, all checkboxes in a group should have `required`, but we're being nice\n var $group = this.$element.find(`:checkbox[name=\"${groupName}\"]`);\n var valid = false, required = false, minRequired = 1, checked = 0;\n\n // For the group to be required, at least one checkbox needs to be required\n $group.each((i, e) => {\n if ($(e).attr('required')) {\n required = true;\n }\n });\n if (!required) valid=true;\n\n if (!valid) {\n // Count checked checkboxes within the group\n // Use data-min-required if available (default: 1)\n $group.each((i, e) => {\n if ($(e).prop('checked')) {\n checked++;\n }\n if (typeof $(e).attr('data-min-required') !== 'undefined') {\n minRequired = parseInt($(e).attr('data-min-required'));\n }\n });\n\n // For the group to be valid, the minRequired amount of checkboxes have to be checked\n if (checked >= minRequired) {\n valid = true;\n }\n }\n\n // Skip validation if more than 1 checkbox have to be checked AND if the form hasn't got submitted yet (otherwise it will already show an error during the first fill in)\n if (this.initialized !== true && minRequired > 1) {\n return true;\n }\n\n // Refresh error class for all input\n $group.each((i, e) => {\n if (!valid) {\n this.addErrorClasses($(e), ['required']);\n } else {\n this.removeErrorClasses($(e));\n }\n });\n\n return valid;\n }\n\n /**\n * Determines if a selected input passes a custom validation function. Multiple validations can be used, if passed to the element with `data-validator=\"foo bar baz\"` in a space separated listed.\n * @param {Object} $el - jQuery input element.\n * @param {String} validators - a string of function names matching functions in the Abide.options.validators object.\n * @param {Boolean} required - self explanatory?\n * @returns {Boolean} - true if validations passed.\n */\n matchValidation($el, validators, required) {\n required = required ? true : false;\n\n var clear = validators.split(' ').map((v) => {\n return this.options.validators[v]($el, required, $el.parent());\n });\n return clear.indexOf(false) === -1;\n }\n\n /**\n * Resets form inputs and styles\n * @fires Abide#formreset\n */\n resetForm() {\n var $form = this.$element,\n opts = this.options;\n\n $(`.${opts.labelErrorClass}`, $form).not('small').removeClass(opts.labelErrorClass);\n $(`.${opts.inputErrorClass}`, $form).not('small').removeClass(opts.inputErrorClass);\n $(`${opts.formErrorSelector}.${opts.formErrorClass}`).removeClass(opts.formErrorClass);\n $form.find('[data-abide-error]').css('display', 'none');\n $(':input', $form).not(':button, :submit, :reset, :hidden, :radio, :checkbox, [data-abide-ignore]').val('').attr({\n 'data-invalid': null,\n 'aria-invalid': null\n });\n $(':input:radio', $form).not('[data-abide-ignore]').prop('checked',false).attr({\n 'data-invalid': null,\n 'aria-invalid': null\n });\n $(':input:checkbox', $form).not('[data-abide-ignore]').prop('checked',false).attr({\n 'data-invalid': null,\n 'aria-invalid': null\n });\n /**\n * Fires when the form has been reset.\n * @event Abide#formreset\n */\n $form.trigger('formreset.zf.abide', [$form]);\n }\n\n /**\n * Destroys an instance of Abide.\n * Removes error styles and classes from elements, without resetting their values.\n */\n _destroy() {\n var _this = this;\n this.$element\n .off('.abide')\n .find('[data-abide-error]')\n .css('display', 'none');\n\n this.$inputs\n .off('.abide')\n .each(function() {\n _this.removeErrorClasses($(this));\n });\n\n this.$submits\n .off('.abide');\n }\n}\n\n/**\n * Default settings for plugin\n */\nAbide.defaults = {\n /**\n * The default event to validate inputs. Checkboxes and radios validate immediately.\n * Remove or change this value for manual validation.\n * @option\n * @type {?string}\n * @default 'fieldChange'\n */\n validateOn: 'fieldChange',\n\n /**\n * Class to be applied to input labels on failed validation.\n * @option\n * @type {string}\n * @default 'is-invalid-label'\n */\n labelErrorClass: 'is-invalid-label',\n\n /**\n * Class to be applied to inputs on failed validation.\n * @option\n * @type {string}\n * @default 'is-invalid-input'\n */\n inputErrorClass: 'is-invalid-input',\n\n /**\n * Class selector to use to target Form Errors for show/hide.\n * @option\n * @type {string}\n * @default '.form-error'\n */\n formErrorSelector: '.form-error',\n\n /**\n * Class added to Form Errors on failed validation.\n * @option\n * @type {string}\n * @default 'is-visible'\n */\n formErrorClass: 'is-visible',\n\n /**\n * If true, automatically insert when possible:\n * - `[aria-describedby]` on fields\n * - `[role=alert]` on form errors and `[for]` on form error labels\n * - `[aria-live]` on global errors `[data-abide-error]` (see option `a11yErrorLevel`).\n * @option\n * @type {boolean}\n * @default true\n */\n a11yAttributes: true,\n\n /**\n * [aria-live] attribute value to be applied on global errors `[data-abide-error]`.\n * Options are: 'assertive', 'polite' and 'off'/null\n * @option\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions\n * @type {string}\n * @default 'assertive'\n */\n a11yErrorLevel: 'assertive',\n\n /**\n * Set to true to validate text inputs on any value change.\n * @option\n * @type {boolean}\n * @default false\n */\n liveValidate: false,\n\n /**\n * Set to true to validate inputs on blur.\n * @option\n * @type {boolean}\n * @default false\n */\n validateOnBlur: false,\n\n patterns: {\n alpha : /^[a-zA-Z]+$/,\n alpha_numeric : /^[a-zA-Z0-9]+$/,\n integer : /^[-+]?\\d+$/,\n number : /^[-+]?\\d*(?:[\\.\\,]\\d+)?$/,\n\n // amex, visa, diners\n card : /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(?:222[1-9]|2[3-6][0-9]{2}|27[0-1][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$/,\n cvv : /^([0-9]){3,4}$/,\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address\n email : /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/,\n\n // From CommonRegexJS (@talyssonoc)\n // https://github.com/talyssonoc/CommonRegexJS/blob/e2901b9f57222bc14069dc8f0598d5f412555411/lib/commonregex.js#L76\n // For more restrictive URL Regexs, see https://mathiasbynens.be/demo/url-regex.\n url: /^((?:(https?|ftps?|file|ssh|sftp):\\/\\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\((?:[^\\s()<>]+|(?:\\([^\\s()<>]+\\)))*\\))+(?:\\((?:[^\\s()<>]+|(?:\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:\\'\".,<>?\\xab\\xbb\\u201c\\u201d\\u2018\\u2019]))$/,\n\n // abc.de\n domain : /^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,8}$/,\n\n datetime : /^([0-2][0-9]{3})\\-([0-1][0-9])\\-([0-3][0-9])T([0-5][0-9])\\:([0-5][0-9])\\:([0-5][0-9])(Z|([\\-\\+]([0-1][0-9])\\:00))$/,\n // YYYY-MM-DD\n date : /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,\n // HH:MM:SS\n time : /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,\n dateISO : /^\\d{4}[\\/\\-]\\d{1,2}[\\/\\-]\\d{1,2}$/,\n // MM/DD/YYYY\n month_day_year : /^(0[1-9]|1[012])[- \\/.](0[1-9]|[12][0-9]|3[01])[- \\/.]\\d{4}$/,\n // DD/MM/YYYY\n day_month_year : /^(0[1-9]|[12][0-9]|3[01])[- \\/.](0[1-9]|1[012])[- \\/.]\\d{4}$/,\n\n // #FFF or #FFFFFF\n color : /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,\n\n // Domain || URL\n website: {\n test: (text) => {\n return Abide.defaults.patterns['domain'].test(text) || Abide.defaults.patterns['url'].test(text);\n }\n }\n },\n\n /**\n * Optional validation functions to be used. `equalTo` being the only default included function.\n * Functions should return only a boolean if the input is valid or not. Functions are given the following arguments:\n * el : The jQuery element to validate.\n * required : Boolean value of the required attribute be present or not.\n * parent : The direct parent of the input.\n * @option\n */\n validators: {\n equalTo: function (el, required, parent) {\n return $(`#${el.attr('data-equalto')}`).val() === el.val();\n }\n }\n}\n\nexport { Abide };\n","'use strict';\n\nimport $ from 'jquery';\nimport { Plugin } from './foundation.core.plugin';\nimport { onLoad, GetYoDigits } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\n\n/**\n * Accordion module.\n * @module foundation.accordion\n * @requires foundation.util.keyboard\n */\n\nclass Accordion extends Plugin {\n /**\n * Creates a new instance of an accordion.\n * @class\n * @name Accordion\n * @fires Accordion#init\n * @param {jQuery} element - jQuery object to make into an accordion.\n * @param {Object} options - a plain object with settings to override the default options.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Accordion.defaults, this.$element.data(), options);\n\n this.className = 'Accordion'; // ie9 back compat\n this._init();\n\n Keyboard.register('Accordion', {\n 'ENTER': 'toggle',\n 'SPACE': 'toggle',\n 'ARROW_DOWN': 'next',\n 'ARROW_UP': 'previous'\n });\n }\n\n /**\n * Initializes the accordion by animating the preset active pane(s).\n * @private\n */\n _init() {\n this._isInitializing = true;\n\n this.$element.attr('role', 'tablist');\n this.$tabs = this.$element.children('[data-accordion-item]');\n\n this.$tabs.attr({'role': 'presentation'});\n\n this.$tabs.each(function(idx, el) {\n var $el = $(el),\n $content = $el.children('[data-tab-content]'),\n id = $content[0].id || GetYoDigits(6, 'accordion'),\n linkId = (el.id) ? `${el.id}-label` : `${id}-label`;\n\n $el.find('a:first').attr({\n 'aria-controls': id,\n 'role': 'tab',\n 'id': linkId,\n 'aria-expanded': false,\n 'aria-selected': false\n });\n\n $content.attr({'role': 'tabpanel', 'aria-labelledby': linkId, 'aria-hidden': true, 'id': id});\n });\n\n var $initActive = this.$element.find('.is-active').children('[data-tab-content]');\n if ($initActive.length) {\n // Save up the initial hash to return to it later when going back in history\n this._initialAnchor = $initActive.prev('a').attr('href');\n this._openSingleTab($initActive);\n }\n\n this._checkDeepLink = () => {\n var anchor = window.location.hash;\n\n if (!anchor.length) {\n // If we are still initializing and there is no anchor, then there is nothing to do\n if (this._isInitializing) return;\n // Otherwise, move to the initial anchor\n if (this._initialAnchor) anchor = this._initialAnchor;\n }\n\n var $anchor = anchor && $(anchor);\n var $link = anchor && this.$element.find(`[href$=\"${anchor}\"]`);\n // Whether the anchor element that has been found is part of this element\n var isOwnAnchor = !!($anchor.length && $link.length);\n\n if (isOwnAnchor) {\n // If there is an anchor for the hash, open it (if not already active)\n if ($anchor && $link && $link.length) {\n if (!$link.parent('[data-accordion-item]').hasClass('is-active')) {\n this._openSingleTab($anchor);\n }\n }\n // Otherwise, close everything\n else {\n this._closeAllTabs();\n }\n\n // Roll up a little to show the titles\n if (this.options.deepLinkSmudge) {\n onLoad($(window), () => {\n var offset = this.$element.offset();\n $('html, body').animate({ scrollTop: offset.top - this.options.deepLinkSmudgeOffset }, this.options.deepLinkSmudgeDelay);\n });\n }\n\n /**\n * Fires when the plugin has deeplinked at pageload\n * @event Accordion#deeplink\n */\n this.$element.trigger('deeplink.zf.accordion', [$link, $anchor]);\n }\n }\n\n //use browser to open a tab, if it exists in this tabset\n if (this.options.deepLink) {\n this._checkDeepLink();\n }\n\n this._events();\n\n this._isInitializing = false;\n }\n\n /**\n * Adds event handlers for items within the accordion.\n * @private\n */\n _events() {\n var _this = this;\n\n this.$tabs.each(function() {\n var $elem = $(this);\n var $tabContent = $elem.children('[data-tab-content]');\n if ($tabContent.length) {\n $elem.children('a').off('click.zf.accordion keydown.zf.accordion')\n .on('click.zf.accordion', function(e) {\n e.preventDefault();\n _this.toggle($tabContent);\n }).on('keydown.zf.accordion', function(e) {\n Keyboard.handleKey(e, 'Accordion', {\n toggle: function() {\n _this.toggle($tabContent);\n },\n next: function() {\n var $a = $elem.next().find('a').focus();\n if (!_this.options.multiExpand) {\n $a.trigger('click.zf.accordion')\n }\n },\n previous: function() {\n var $a = $elem.prev().find('a').focus();\n if (!_this.options.multiExpand) {\n $a.trigger('click.zf.accordion')\n }\n },\n handled: function() {\n e.preventDefault();\n }\n });\n });\n }\n });\n if (this.options.deepLink) {\n $(window).on('hashchange', this._checkDeepLink);\n }\n }\n\n /**\n * Toggles the selected content pane's open/close state.\n * @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`).\n * @function\n */\n toggle($target) {\n if ($target.closest('[data-accordion]').is('[disabled]')) {\n console.info('Cannot toggle an accordion that is disabled.');\n return;\n }\n if ($target.parent().hasClass('is-active')) {\n this.up($target);\n } else {\n this.down($target);\n }\n //either replace or update browser history\n if (this.options.deepLink) {\n var anchor = $target.prev('a').attr('href');\n\n if (this.options.updateHistory) {\n history.pushState({}, '', anchor);\n } else {\n history.replaceState({}, '', anchor);\n }\n }\n }\n\n /**\n * Opens the accordion tab defined by `$target`.\n * @param {jQuery} $target - Accordion pane to open (`.accordion-content`).\n * @fires Accordion#down\n * @function\n */\n down($target) {\n if ($target.closest('[data-accordion]').is('[disabled]')) {\n console.info('Cannot call down on an accordion that is disabled.');\n return;\n }\n\n if (this.options.multiExpand)\n this._openTab($target);\n else\n this._openSingleTab($target);\n }\n\n /**\n * Closes the tab defined by `$target`.\n * It may be ignored if the Accordion options don't allow it.\n *\n * @param {jQuery} $target - Accordion tab to close (`.accordion-content`).\n * @fires Accordion#up\n * @function\n */\n up($target) {\n if (this.$element.is('[disabled]')) {\n console.info('Cannot call up on an accordion that is disabled.');\n return;\n }\n\n // Don't close the item if it is already closed\n const $targetItem = $target.parent();\n if (!$targetItem.hasClass('is-active')) return;\n\n // Don't close the item if there is no other active item (unless with `allowAllClosed`)\n const $othersItems = $targetItem.siblings();\n if (!this.options.allowAllClosed && !$othersItems.hasClass('is-active')) return;\n\n this._closeTab($target);\n }\n\n /**\n * Make the tab defined by `$target` the only opened tab, closing all others tabs.\n * @param {jQuery} $target - Accordion tab to open (`.accordion-content`).\n * @function\n * @private\n */\n _openSingleTab($target) {\n // Close all the others active tabs.\n const $activeContents = this.$element.children('.is-active').children('[data-tab-content]');\n if ($activeContents.length) {\n this._closeTab($activeContents.not($target));\n }\n\n // Then open the target.\n this._openTab($target);\n }\n\n /**\n * Opens the tab defined by `$target`.\n * @param {jQuery} $target - Accordion tab to open (`.accordion-content`).\n * @fires Accordion#down\n * @function\n * @private\n */\n _openTab($target) {\n const $targetItem = $target.parent();\n const targetContentId = $target.attr('aria-labelledby');\n\n $target.attr('aria-hidden', false);\n $targetItem.addClass('is-active');\n\n $(`#${targetContentId}`).attr({\n 'aria-expanded': true,\n 'aria-selected': true\n });\n\n $target.stop().slideDown(this.options.slideSpeed, () => {\n /**\n * Fires when the tab is done opening.\n * @event Accordion#down\n */\n this.$element.trigger('down.zf.accordion', [$target]);\n });\n }\n\n /**\n * Closes the tab defined by `$target`.\n * @param {jQuery} $target - Accordion tab to close (`.accordion-content`).\n * @fires Accordion#up\n * @function\n * @private\n */\n _closeTab($target) {\n const $targetItem = $target.parent();\n const targetContentId = $target.attr('aria-labelledby');\n\n $target.attr('aria-hidden', true)\n $targetItem.removeClass('is-active');\n\n $(`#${targetContentId}`).attr({\n 'aria-expanded': false,\n 'aria-selected': false\n });\n\n $target.stop().slideUp(this.options.slideSpeed, () => {\n /**\n * Fires when the tab is done collapsing up.\n * @event Accordion#up\n */\n this.$element.trigger('up.zf.accordion', [$target]);\n });\n }\n\n /**\n * Closes all active tabs\n * @fires Accordion#up\n * @function\n * @private\n */\n _closeAllTabs() {\n var $activeTabs = this.$element.children('.is-active').children('[data-tab-content]');\n if ($activeTabs.length) {\n this._closeTab($activeTabs);\n }\n }\n\n /**\n * Destroys an instance of an accordion.\n * @fires Accordion#destroyed\n * @function\n */\n _destroy() {\n this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');\n this.$element.find('a').off('.zf.accordion');\n if (this.options.deepLink) {\n $(window).off('hashchange', this._checkDeepLink);\n }\n\n }\n}\n\nAccordion.defaults = {\n /**\n * Amount of time to animate the opening of an accordion pane.\n * @option\n * @type {number}\n * @default 250\n */\n slideSpeed: 250,\n /**\n * Allow the accordion to have multiple open panes.\n * @option\n * @type {boolean}\n * @default false\n */\n multiExpand: false,\n /**\n * Allow the accordion to close all panes.\n * @option\n * @type {boolean}\n * @default false\n */\n allowAllClosed: false,\n /**\n * Link the location hash to the open pane.\n * Set the location hash when the opened pane changes, and open and scroll to the corresponding pane when the location changes.\n * @option\n * @type {boolean}\n * @default false\n */\n deepLink: false,\n /**\n * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the accordion panel is visible\n * @option\n * @type {boolean}\n * @default false\n */\n deepLinkSmudge: false,\n /**\n * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment\n * @option\n * @type {number}\n * @default 300\n */\n deepLinkSmudgeDelay: 300,\n /**\n * If `deepLinkSmudge` is enabled, the offset for scrollToTtop to prevent overlap by a sticky element at the top of the page\n * @option\n * @type {number}\n * @default 0\n */\n deepLinkSmudgeOffset: 0,\n /**\n * If `deepLink` is enabled, update the browser history with the open accordion\n * @option\n * @type {boolean}\n * @default false\n */\n updateHistory: false\n};\n\nexport { Accordion };\n","'use strict';\n\n\nimport $ from 'jquery';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { Nest } from './foundation.util.nest';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * AccordionMenu module.\n * @module foundation.accordionMenu\n * @requires foundation.util.keyboard\n * @requires foundation.util.nest\n */\n\nclass AccordionMenu extends Plugin {\n /**\n * Creates a new instance of an accordion menu.\n * @class\n * @name AccordionMenu\n * @fires AccordionMenu#init\n * @param {jQuery} element - jQuery object to make into an accordion menu.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, AccordionMenu.defaults, this.$element.data(), options);\n this.className = 'AccordionMenu'; // ie9 back compat\n\n this._init();\n\n Keyboard.register('AccordionMenu', {\n 'ENTER': 'toggle',\n 'SPACE': 'toggle',\n 'ARROW_RIGHT': 'open',\n 'ARROW_UP': 'up',\n 'ARROW_DOWN': 'down',\n 'ARROW_LEFT': 'close',\n 'ESCAPE': 'closeAll'\n });\n }\n\n\n\n /**\n * Initializes the accordion menu by hiding all nested menus.\n * @private\n */\n _init() {\n Nest.Feather(this.$element, 'accordion');\n\n var _this = this;\n\n this.$element.find('[data-submenu]').not('.is-active').slideUp(0);//.find('a').css('padding-left', '1rem');\n this.$element.attr({\n 'role': 'tree',\n 'aria-multiselectable': this.options.multiOpen\n });\n\n this.$menuLinks = this.$element.find('.is-accordion-submenu-parent');\n this.$menuLinks.each(function() {\n var linkId = this.id || GetYoDigits(6, 'acc-menu-link'),\n $elem = $(this),\n $sub = $elem.children('[data-submenu]'),\n subId = $sub[0].id || GetYoDigits(6, 'acc-menu'),\n isActive = $sub.hasClass('is-active');\n\n if (_this.options.parentLink) {\n let $anchor = $elem.children('a');\n $anchor.clone().prependTo($sub).wrap('<li data-is-parent-link class=\"is-submenu-parent-item is-submenu-item is-accordion-submenu-item\"></li>');\n }\n\n if (_this.options.submenuToggle) {\n $elem.addClass('has-submenu-toggle');\n $elem.children('a').after('<button id=\"' + linkId + '\" class=\"submenu-toggle\" aria-controls=\"' + subId + '\" aria-expanded=\"' + isActive + '\" title=\"' + _this.options.submenuToggleText + '\"><span class=\"submenu-toggle-text\">' + _this.options.submenuToggleText + '</span></button>');\n } else {\n $elem.attr({\n 'aria-controls': subId,\n 'aria-expanded': isActive,\n 'id': linkId\n });\n }\n $sub.attr({\n 'aria-labelledby': linkId,\n 'aria-hidden': !isActive,\n 'role': 'group',\n 'id': subId\n });\n });\n this.$element.find('li').attr({\n 'role': 'treeitem'\n });\n var initPanes = this.$element.find('.is-active');\n if (initPanes.length) {\n initPanes.each(function() {\n _this.down($(this));\n });\n }\n this._events();\n }\n\n /**\n * Adds event handlers for items within the menu.\n * @private\n */\n _events() {\n var _this = this;\n\n this.$element.find('li').each(function() {\n var $submenu = $(this).children('[data-submenu]');\n\n if ($submenu.length) {\n if (_this.options.submenuToggle) {\n $(this).children('.submenu-toggle').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function(e) {\n _this.toggle($submenu);\n });\n } else {\n $(this).children('a').off('click.zf.accordionMenu').on('click.zf.accordionMenu', function(e) {\n e.preventDefault();\n _this.toggle($submenu);\n });\n }\n }\n }).on('keydown.zf.accordionMenu', function(e) {\n var $element = $(this),\n $elements = $element.parent('ul').children('li'),\n $prevElement,\n $nextElement,\n $target = $element.children('[data-submenu]');\n\n $elements.each(function(i) {\n if ($(this).is($element)) {\n $prevElement = $elements.eq(Math.max(0, i-1)).find('a').first();\n $nextElement = $elements.eq(Math.min(i+1, $elements.length-1)).find('a').first();\n\n if ($(this).children('[data-submenu]:visible').length) { // has open sub menu\n $nextElement = $element.find('li:first-child').find('a').first();\n }\n if ($(this).is(':first-child')) { // is first element of sub menu\n $prevElement = $element.parents('li').first().find('a').first();\n } else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) { // if previous element has open sub menu\n $prevElement = $prevElement.parents('li').find('li:last-child').find('a').first();\n }\n if ($(this).is(':last-child')) { // is last element of sub menu\n $nextElement = $element.parents('li').first().next('li').find('a').first();\n }\n\n return;\n }\n });\n\n Keyboard.handleKey(e, 'AccordionMenu', {\n open: function() {\n if ($target.is(':hidden')) {\n _this.down($target);\n $target.find('li').first().find('a').first().focus();\n }\n },\n close: function() {\n if ($target.length && !$target.is(':hidden')) { // close active sub of this item\n _this.up($target);\n } else if ($element.parent('[data-submenu]').length) { // close currently open sub\n _this.up($element.parent('[data-submenu]'));\n $element.parents('li').first().find('a').first().focus();\n }\n },\n up: function() {\n $prevElement.focus();\n return true;\n },\n down: function() {\n $nextElement.focus();\n return true;\n },\n toggle: function() {\n if (_this.options.submenuToggle) {\n return false;\n }\n if ($element.children('[data-submenu]').length) {\n _this.toggle($element.children('[data-submenu]'));\n return true;\n }\n },\n closeAll: function() {\n _this.hideAll();\n },\n handled: function(preventDefault) {\n if (preventDefault) {\n e.preventDefault();\n }\n }\n });\n });//.attr('tabindex', 0);\n }\n\n /**\n * Closes all panes of the menu.\n * @function\n */\n hideAll() {\n this.up(this.$element.find('[data-submenu]'));\n }\n\n /**\n * Opens all panes of the menu.\n * @function\n */\n showAll() {\n this.down(this.$element.find('[data-submenu]'));\n }\n\n /**\n * Toggles the open/close state of a submenu.\n * @function\n * @param {jQuery} $target - the submenu to toggle\n */\n toggle($target) {\n if (!$target.is(':animated')) {\n if (!$target.is(':hidden')) {\n this.up($target);\n }\n else {\n this.down($target);\n }\n }\n }\n\n /**\n * Opens the sub-menu defined by `$target`.\n * @param {jQuery} $target - Sub-menu to open.\n * @fires AccordionMenu#down\n */\n down($target) {\n // If having multiple submenus active is disabled, close all the submenus\n // that are not parents or children of the targeted submenu.\n if (!this.options.multiOpen) {\n // The \"branch\" of the targetted submenu, from the component root to\n // the active submenus nested in it.\n const $targetBranch = $target.parentsUntil(this.$element)\n .add($target)\n .add($target.find('.is-active'));\n // All the active submenus that are not in the branch.\n const $othersActiveSubmenus = this.$element.find('.is-active').not($targetBranch);\n\n this.up($othersActiveSubmenus);\n }\n\n $target\n .addClass('is-active')\n .attr({ 'aria-hidden': false });\n\n if (this.options.submenuToggle) {\n $target.prev('.submenu-toggle').attr({'aria-expanded': true});\n }\n else {\n $target.parent('.is-accordion-submenu-parent').attr({'aria-expanded': true});\n }\n\n $target.slideDown(this.options.slideSpeed, () => {\n /**\n * Fires when the menu is done opening.\n * @event AccordionMenu#down\n */\n this.$element.trigger('down.zf.accordionMenu', [$target]);\n });\n }\n\n /**\n * Closes the sub-menu defined by `$target`. All sub-menus inside the target will be closed as well.\n * @param {jQuery} $target - Sub-menu to close.\n * @fires AccordionMenu#up\n */\n up($target) {\n const $submenus = $target.find('[data-submenu]');\n const $allmenus = $target.add($submenus);\n\n $submenus.slideUp(0);\n $allmenus\n .removeClass('is-active')\n .attr('aria-hidden', true);\n\n if (this.options.submenuToggle) {\n $allmenus.prev('.submenu-toggle').attr('aria-expanded', false);\n }\n else {\n $allmenus.parent('.is-accordion-submenu-parent').attr('aria-expanded', false);\n }\n\n $target.slideUp(this.options.slideSpeed, () => {\n /**\n * Fires when the menu is done collapsing up.\n * @event AccordionMenu#up\n */\n this.$element.trigger('up.zf.accordionMenu', [$target]);\n });\n }\n\n /**\n * Destroys an instance of accordion menu.\n * @fires AccordionMenu#destroyed\n */\n _destroy() {\n this.$element.find('[data-submenu]').slideDown(0).css('display', '');\n this.$element.find('a').off('click.zf.accordionMenu');\n this.$element.find('[data-is-parent-link]').detach();\n\n if (this.options.submenuToggle) {\n this.$element.find('.has-submenu-toggle').removeClass('has-submenu-toggle');\n this.$element.find('.submenu-toggle').remove();\n }\n\n Nest.Burn(this.$element, 'accordion');\n }\n}\n\nAccordionMenu.defaults = {\n /**\n * Adds the parent link to the submenu.\n * @option\n * @type {boolean}\n * @default false\n */\n parentLink: false,\n /**\n * Amount of time to animate the opening of a submenu in ms.\n * @option\n * @type {number}\n * @default 250\n */\n slideSpeed: 250,\n /**\n * Adds a separate submenu toggle button. This allows the parent item to have a link.\n * @option\n * @example true\n */\n submenuToggle: false,\n /**\n * The text used for the submenu toggle if enabled. This is used for screen readers only.\n * @option\n * @example true\n */\n submenuToggleText: 'Toggle menu',\n /**\n * Allow the menu to have multiple open panes.\n * @option\n * @type {boolean}\n * @default true\n */\n multiOpen: true\n};\n\nexport { AccordionMenu };\n","\"use strict\";\n\nimport $ from 'jquery';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { MediaQuery } from './foundation.util.mediaQuery';\n\nvar FOUNDATION_VERSION = '6.6.2';\n\n// Global Foundation object\n// This is attached to the window, or used as a module for AMD/Browserify\nvar Foundation = {\n version: FOUNDATION_VERSION,\n\n /**\n * Stores initialized plugins.\n */\n _plugins: {},\n\n /**\n * Stores generated unique ids for plugin instances\n */\n _uuids: [],\n\n /**\n * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing.\n * @param {Object} plugin - The constructor of the plugin.\n */\n plugin: function(plugin, name) {\n // Object key to use when adding to global Foundation object\n // Examples: Foundation.Reveal, Foundation.OffCanvas\n var className = (name || functionName(plugin));\n // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin\n // Examples: data-reveal, data-off-canvas\n var attrName = hyphenate(className);\n\n // Add to the Foundation object and the plugins list (for reflowing)\n this._plugins[attrName] = this[className] = plugin;\n },\n /**\n * @function\n * Populates the _uuids array with pointers to each individual plugin instance.\n * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls.\n * Also fires the initialization event for each plugin, consolidating repetitive code.\n * @param {Object} plugin - an instance of a plugin, usually `this` in context.\n * @param {String} name - the name of the plugin, passed as a camelCased string.\n * @fires Plugin#init\n */\n registerPlugin: function(plugin, name){\n var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase();\n plugin.uuid = GetYoDigits(6, pluginName);\n\n if(!plugin.$element.attr(`data-${pluginName}`)){ plugin.$element.attr(`data-${pluginName}`, plugin.uuid); }\n if(!plugin.$element.data('zfPlugin')){ plugin.$element.data('zfPlugin', plugin); }\n /**\n * Fires when the plugin has initialized.\n * @event Plugin#init\n */\n plugin.$element.trigger(`init.zf.${pluginName}`);\n\n this._uuids.push(plugin.uuid);\n\n return;\n },\n /**\n * @function\n * Removes the plugins uuid from the _uuids array.\n * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute.\n * Also fires the destroyed event for the plugin, consolidating repetitive code.\n * @param {Object} plugin - an instance of a plugin, usually `this` in context.\n * @fires Plugin#destroyed\n */\n unregisterPlugin: function(plugin){\n var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor));\n\n this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1);\n plugin.$element.removeAttr(`data-${pluginName}`).removeData('zfPlugin')\n /**\n * Fires when the plugin has been destroyed.\n * @event Plugin#destroyed\n */\n .trigger(`destroyed.zf.${pluginName}`);\n for(var prop in plugin){\n plugin[prop] = null;//clean up script to prep for garbage collection.\n }\n return;\n },\n\n /**\n * @function\n * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc.\n * @param {String} plugins - optional string of an individual plugin key, attained by calling `$(element).data('pluginName')`, or string of a plugin class i.e. `'dropdown'`\n * @default If no argument is passed, reflow all currently active plugins.\n */\n reInit: function(plugins){\n var isJQ = plugins instanceof $;\n try{\n if(isJQ){\n plugins.each(function(){\n $(this).data('zfPlugin')._init();\n });\n }else{\n var type = typeof plugins,\n _this = this,\n fns = {\n 'object': function(plgs){\n plgs.forEach(function(p){\n p = hyphenate(p);\n $('[data-'+ p +']').foundation('_init');\n });\n },\n 'string': function(){\n plugins = hyphenate(plugins);\n $('[data-'+ plugins +']').foundation('_init');\n },\n 'undefined': function(){\n this['object'](Object.keys(_this._plugins));\n }\n };\n fns[type](plugins);\n }\n }catch(err){\n console.error(err);\n }finally{\n return plugins;\n }\n },\n\n /**\n * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized.\n * @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object.\n * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything.\n */\n reflow: function(elem, plugins) {\n\n // If plugins is undefined, just grab everything\n if (typeof plugins === 'undefined') {\n plugins = Object.keys(this._plugins);\n }\n // If plugins is a string, convert it to an array with one item\n else if (typeof plugins === 'string') {\n plugins = [plugins];\n }\n\n var _this = this;\n\n // Iterate through each plugin\n $.each(plugins, function(i, name) {\n // Get the current plugin\n var plugin = _this._plugins[name];\n\n // Localize the search to all elements inside elem, as well as elem itself, unless elem === document\n var $elem = $(elem).find('[data-'+name+']').addBack('[data-'+name+']').filter(function () {\n return typeof $(this).data(\"zfPlugin\") === 'undefined';\n });\n\n // For each plugin found, initialize it\n $elem.each(function() {\n var $el = $(this),\n opts = { reflow: true };\n\n if($el.attr('data-options')){\n $el.attr('data-options').split(';').forEach(function(option, _index){\n var opt = option.split(':').map(function(el){ return el.trim(); });\n if(opt[0]) opts[opt[0]] = parseValue(opt[1]);\n });\n }\n try{\n $el.data('zfPlugin', new plugin($(this), opts));\n }catch(er){\n console.error(er);\n }finally{\n return;\n }\n });\n });\n },\n getFnName: functionName,\n\n addToJquery: function($) {\n // TODO: consider not making this a jQuery function\n // TODO: need way to reflow vs. re-initialize\n /**\n * The Foundation jQuery method.\n * @param {String|Array} method - An action to perform on the current jQuery object.\n */\n var foundation = function(method) {\n var type = typeof method,\n $noJS = $('.no-js');\n\n if($noJS.length){\n $noJS.removeClass('no-js');\n }\n\n if(type === 'undefined'){//needs to initialize the Foundation object, or an individual plugin.\n MediaQuery._init();\n Foundation.reflow(this);\n }else if(type === 'string'){//an individual method to invoke on a plugin or group of plugins\n var args = Array.prototype.slice.call(arguments, 1);//collect all the arguments, if necessary\n var plugClass = this.data('zfPlugin');//determine the class of plugin\n\n if(typeof plugClass !== 'undefined' && typeof plugClass[method] !== 'undefined'){//make sure both the class and method exist\n if(this.length === 1){//if there's only one, call it directly.\n plugClass[method].apply(plugClass, args);\n }else{\n this.each(function(i, el){//otherwise loop through the jQuery collection and invoke the method on each\n plugClass[method].apply($(el).data('zfPlugin'), args);\n });\n }\n }else{//error for no class or no method\n throw new ReferenceError(\"We're sorry, '\" + method + \"' is not an available method for \" + (plugClass ? functionName(plugClass) : 'this element') + '.');\n }\n }else{//error for invalid argument type\n throw new TypeError(`We're sorry, ${type} is not a valid parameter. You must use a string representing the method you wish to invoke.`);\n }\n return this;\n };\n $.fn.foundation = foundation;\n return $;\n }\n};\n\nFoundation.util = {\n /**\n * Function for applying a debounce effect to a function call.\n * @function\n * @param {Function} func - Function to be called at end of timeout.\n * @param {Number} delay - Time in ms to delay the call of `func`.\n * @returns function\n */\n throttle: function (func, delay) {\n var timer = null;\n\n return function () {\n var context = this, args = arguments;\n\n if (timer === null) {\n timer = setTimeout(function () {\n func.apply(context, args);\n timer = null;\n }, delay);\n }\n };\n }\n};\n\nwindow.Foundation = Foundation;\n\n// Polyfill for requestAnimationFrame\n(function() {\n if (!Date.now || !window.Date.now)\n window.Date.now = Date.now = function() { return new Date().getTime(); };\n\n var vendors = ['webkit', 'moz'];\n for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {\n var vp = vendors[i];\n window.requestAnimationFrame = window[vp+'RequestAnimationFrame'];\n window.cancelAnimationFrame = (window[vp+'CancelAnimationFrame']\n || window[vp+'CancelRequestAnimationFrame']);\n }\n if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)\n || !window.requestAnimationFrame || !window.cancelAnimationFrame) {\n var lastTime = 0;\n window.requestAnimationFrame = function(callback) {\n var now = Date.now();\n var nextTime = Math.max(lastTime + 16, now);\n return setTimeout(function() { callback(lastTime = nextTime); },\n nextTime - now);\n };\n window.cancelAnimationFrame = clearTimeout;\n }\n /**\n * Polyfill for performance.now, required by rAF\n */\n if(!window.performance || !window.performance.now){\n window.performance = {\n start: Date.now(),\n now: function(){ return Date.now() - this.start; }\n };\n }\n})();\nif (!Function.prototype.bind) {\n Function.prototype.bind = function(oThis) {\n if (typeof this !== 'function') {\n // closest thing possible to the ECMAScript 5\n // internal IsCallable function\n throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');\n }\n\n var aArgs = Array.prototype.slice.call(arguments, 1),\n fToBind = this,\n fNOP = function() {},\n fBound = function() {\n return fToBind.apply(this instanceof fNOP\n ? this\n : oThis,\n aArgs.concat(Array.prototype.slice.call(arguments)));\n };\n\n if (this.prototype) {\n // native functions don't have a prototype\n fNOP.prototype = this.prototype;\n }\n fBound.prototype = new fNOP();\n\n return fBound;\n };\n}\n// Polyfill to get the name of a function in IE9\nfunction functionName(fn) {\n if (typeof Function.prototype.name === 'undefined') {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = (funcNameRegex).exec((fn).toString());\n return (results && results.length > 1) ? results[1].trim() : \"\";\n }\n else if (typeof fn.prototype === 'undefined') {\n return fn.constructor.name;\n }\n else {\n return fn.prototype.constructor.name;\n }\n}\nfunction parseValue(str){\n if ('true' === str) return true;\n else if ('false' === str) return false;\n else if (!isNaN(str * 1)) return parseFloat(str);\n return str;\n}\n// Convert PascalCase to kebab-case\n// Thank you: http://stackoverflow.com/a/8955580\nfunction hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\nexport {Foundation};\n","'use strict';\n\nimport $ from 'jquery';\nimport { GetYoDigits } from './foundation.core.utils';\n\n// Abstract class for providing lifecycle hooks. Expect plugins to define AT LEAST\n// {function} _setup (replaces previous constructor),\n// {function} _destroy (replaces previous destroy)\nclass Plugin {\n\n constructor(element, options) {\n this._setup(element, options);\n var pluginName = getPluginName(this);\n this.uuid = GetYoDigits(6, pluginName);\n\n if(!this.$element.attr(`data-${pluginName}`)){ this.$element.attr(`data-${pluginName}`, this.uuid); }\n if(!this.$element.data('zfPlugin')){ this.$element.data('zfPlugin', this); }\n /**\n * Fires when the plugin has initialized.\n * @event Plugin#init\n */\n this.$element.trigger(`init.zf.${pluginName}`);\n }\n\n destroy() {\n this._destroy();\n var pluginName = getPluginName(this);\n this.$element.removeAttr(`data-${pluginName}`).removeData('zfPlugin')\n /**\n * Fires when the plugin has been destroyed.\n * @event Plugin#destroyed\n */\n .trigger(`destroyed.zf.${pluginName}`);\n for(var prop in this){\n this[prop] = null;//clean up script to prep for garbage collection.\n }\n }\n}\n\n// Convert PascalCase to kebab-case\n// Thank you: http://stackoverflow.com/a/8955580\nfunction hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\nfunction getPluginName(obj) {\n return hyphenate(obj.className);\n}\n\nexport {Plugin};\n","\"use strict\";\n\nimport $ from 'jquery';\n\n// Core Foundation Utilities, utilized in a number of places.\n\n /**\n * Returns a boolean for RTL support\n */\nfunction rtl() {\n return $('html').attr('dir') === 'rtl';\n}\n\n/**\n * returns a random base-36 uid with namespacing\n * @function\n * @param {Number} length - number of random base-36 digits desired. Increase for more random strings.\n * @param {String} namespace - name of plugin to be incorporated in uid, optional.\n * @default {String} '' - if no plugin name is provided, nothing is appended to the uid.\n * @returns {String} - unique id\n */\nfunction GetYoDigits(length = 6, namespace){\n let str = '';\n const chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n const charsLength = chars.length;\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * charsLength)];\n }\n return namespace ? `${str}-${namespace}` : str;\n}\n\n/**\n * Escape a string so it can be used as a regexp pattern\n * @function\n * @see https://stackoverflow.com/a/9310752/4317384\n *\n * @param {String} str - string to escape.\n * @returns {String} - escaped string\n */\nfunction RegExpEscape(str){\n return str.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n}\n\nfunction transitionend($elem){\n var transitions = {\n 'transition': 'transitionend',\n 'WebkitTransition': 'webkitTransitionEnd',\n 'MozTransition': 'transitionend',\n 'OTransition': 'otransitionend'\n };\n var elem = document.createElement('div'),\n end;\n\n for (let transition in transitions){\n if (typeof elem.style[transition] !== 'undefined'){\n end = transitions[transition];\n }\n }\n if (end) {\n return end;\n } else {\n setTimeout(function(){\n $elem.triggerHandler('transitionend', [$elem]);\n }, 1);\n return 'transitionend';\n }\n}\n\n/**\n * Return an event type to listen for window load.\n *\n * If `$elem` is passed, an event will be triggered on `$elem`. If window is already loaded, the event will still be triggered.\n * If `handler` is passed, attach it to the event on `$elem`.\n * Calling `onLoad` without handler allows you to get the event type that will be triggered before attaching the handler by yourself.\n * @function\n *\n * @param {Object} [] $elem - jQuery element on which the event will be triggered if passed.\n * @param {Function} [] handler - function to attach to the event.\n * @returns {String} - event type that should or will be triggered.\n */\nfunction onLoad($elem, handler) {\n const didLoad = document.readyState === 'complete';\n const eventType = (didLoad ? '_didLoad' : 'load') + '.zf.util.onLoad';\n const cb = () => $elem.triggerHandler(eventType);\n\n if ($elem) {\n if (handler) $elem.one(eventType, handler);\n\n if (didLoad)\n setTimeout(cb);\n else\n $(window).one('load', cb);\n }\n\n return eventType;\n}\n\n/**\n * Retuns an handler for the `mouseleave` that ignore disappeared mouses.\n *\n * If the mouse \"disappeared\" from the document (like when going on a browser UI element, See https://git.io/zf-11410),\n * the event is ignored.\n * - If the `ignoreLeaveWindow` is `true`, the event is ignored when the user actually left the window\n * (like by switching to an other window with [Alt]+[Tab]).\n * - If the `ignoreReappear` is `true`, the event will be ignored when the mouse will reappear later on the document\n * outside of the element it left.\n *\n * @function\n *\n * @param {Function} [] handler - handler for the filtered `mouseleave` event to watch.\n * @param {Object} [] options - object of options:\n * - {Boolean} [false] ignoreLeaveWindow - also ignore when the user switched windows.\n * - {Boolean} [false] ignoreReappear - also ignore when the mouse reappeared outside of the element it left.\n * @returns {Function} - filtered handler to use to listen on the `mouseleave` event.\n */\nfunction ignoreMousedisappear(handler, { ignoreLeaveWindow = false, ignoreReappear = false } = {}) {\n return function leaveEventHandler(eLeave, ...rest) {\n const callback = handler.bind(this, eLeave, ...rest);\n\n // The mouse left: call the given callback if the mouse entered elsewhere\n if (eLeave.relatedTarget !== null) {\n return callback();\n }\n\n // Otherwise, check if the mouse actually left the window.\n // In firefox if the user switched between windows, the window sill have the focus by the time\n // the event is triggered. We have to debounce the event to test this case.\n setTimeout(function leaveEventDebouncer() {\n if (!ignoreLeaveWindow && document.hasFocus && !document.hasFocus()) {\n return callback();\n }\n\n // Otherwise, wait for the mouse to reeapear outside of the element,\n if (!ignoreReappear) {\n $(document).one('mouseenter', function reenterEventHandler(eReenter) {\n if (!$(eLeave.currentTarget).has(eReenter.target).length) {\n // Fill where the mouse finally entered.\n eLeave.relatedTarget = eReenter.target;\n callback();\n }\n });\n }\n\n }, 0);\n };\n}\n\n\nexport { rtl, GetYoDigits, RegExpEscape, transitionend, onLoad, ignoreMousedisappear };\n","'use strict';\n\nimport $ from 'jquery';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { Nest } from './foundation.util.nest';\nimport { GetYoDigits, transitionend } from './foundation.core.utils';\nimport { Box } from './foundation.util.box';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * Drilldown module.\n * @module foundation.drilldown\n * @requires foundation.util.keyboard\n * @requires foundation.util.nest\n * @requires foundation.util.box\n */\n\nclass Drilldown extends Plugin {\n /**\n * Creates a new instance of a drilldown menu.\n * @class\n * @name Drilldown\n * @param {jQuery} element - jQuery object to make into an accordion menu.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Drilldown.defaults, this.$element.data(), options);\n this.className = 'Drilldown'; // ie9 back compat\n\n this._init();\n\n Keyboard.register('Drilldown', {\n 'ENTER': 'open',\n 'SPACE': 'open',\n 'ARROW_RIGHT': 'next',\n 'ARROW_UP': 'up',\n 'ARROW_DOWN': 'down',\n 'ARROW_LEFT': 'previous',\n 'ESCAPE': 'close',\n 'TAB': 'down',\n 'SHIFT_TAB': 'up'\n });\n }\n\n /**\n * Initializes the drilldown by creating jQuery collections of elements\n * @private\n */\n _init() {\n Nest.Feather(this.$element, 'drilldown');\n\n if(this.options.autoApplyClass) {\n this.$element.addClass('drilldown');\n }\n\n this.$element.attr({\n 'role': 'tree',\n 'aria-multiselectable': false\n });\n this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a');\n this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group');\n this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'treeitem').find('a');\n\n // Set the main menu as current by default (unless a submenu is selected)\n // Used to set the wrapper height when the drilldown is closed/reopened from any (sub)menu\n this.$currentMenu = this.$element;\n\n this.$element.attr('data-mutate', (this.$element.attr('data-drilldown') || GetYoDigits(6, 'drilldown')));\n\n this._prepareMenu();\n this._registerEvents();\n\n this._keyboardEvents();\n }\n\n /**\n * prepares drilldown menu by setting attributes to links and elements\n * sets a min height to prevent content jumping\n * wraps the element if not already wrapped\n * @private\n * @function\n */\n _prepareMenu() {\n var _this = this;\n // if(!this.options.holdOpen){\n // this._menuLinkEvents();\n // }\n this.$submenuAnchors.each(function(){\n var $link = $(this);\n var $sub = $link.parent();\n if(_this.options.parentLink){\n $link.clone().prependTo($sub.children('[data-submenu]')).wrap('<li data-is-parent-link class=\"is-submenu-parent-item is-submenu-item is-drilldown-submenu-item\" role=\"none\"></li>');\n }\n $link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0);\n $link.children('[data-submenu]')\n .attr({\n 'aria-hidden': true,\n 'tabindex': 0,\n 'role': 'group'\n });\n _this._events($link);\n });\n this.$submenus.each(function(){\n var $menu = $(this),\n $back = $menu.find('.js-drilldown-back');\n if(!$back.length){\n switch (_this.options.backButtonPosition) {\n case \"bottom\":\n $menu.append(_this.options.backButton);\n break;\n case \"top\":\n $menu.prepend(_this.options.backButton);\n break;\n default:\n console.error(\"Unsupported backButtonPosition value '\" + _this.options.backButtonPosition + \"'\");\n }\n }\n _this._back($menu);\n });\n\n this.$submenus.addClass('invisible');\n if(!this.options.autoHeight) {\n this.$submenus.addClass('drilldown-submenu-cover-previous');\n }\n\n // create a wrapper on element if it doesn't exist.\n if(!this.$element.parent().hasClass('is-drilldown')){\n this.$wrapper = $(this.options.wrapper).addClass('is-drilldown');\n if(this.options.animateHeight) this.$wrapper.addClass('animate-height');\n this.$element.wrap(this.$wrapper);\n }\n // set wrapper\n this.$wrapper = this.$element.parent();\n this.$wrapper.css(this._getMaxDims());\n }\n\n _resize() {\n this.$wrapper.css({'max-width': 'none', 'min-height': 'none'});\n // _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths\n this.$wrapper.css(this._getMaxDims());\n }\n\n /**\n * Adds event handlers to elements in the menu.\n * @function\n * @private\n * @param {jQuery} $elem - the current menu item to add handlers to.\n */\n _events($elem) {\n var _this = this;\n\n $elem.off('click.zf.drilldown')\n .on('click.zf.drilldown', function(e){\n if($(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')){\n e.preventDefault();\n }\n\n // if(e.target !== e.currentTarget.firstElementChild){\n // return false;\n // }\n _this._show($elem.parent('li'));\n\n if(_this.options.closeOnClick){\n var $body = $('body');\n $body.off('.zf.drilldown').on('click.zf.drilldown', function(e){\n if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) { return; }\n e.preventDefault();\n _this._hideAll();\n $body.off('.zf.drilldown');\n });\n }\n });\n }\n\n /**\n * Adds event handlers to the menu element.\n * @function\n * @private\n */\n _registerEvents() {\n if(this.options.scrollTop){\n this._bindHandler = this._scrollTop.bind(this);\n this.$element.on('open.zf.drilldown hide.zf.drilldown close.zf.drilldown closed.zf.drilldown',this._bindHandler);\n }\n this.$element.on('mutateme.zf.trigger', this._resize.bind(this));\n }\n\n /**\n * Scroll to Top of Element or data-scroll-top-element\n * @function\n * @fires Drilldown#scrollme\n */\n _scrollTop() {\n var _this = this;\n var $scrollTopElement = _this.options.scrollTopElement!=''?$(_this.options.scrollTopElement):_this.$element,\n scrollPos = parseInt($scrollTopElement.offset().top+_this.options.scrollTopOffset, 10);\n $('html, body').stop(true).animate({ scrollTop: scrollPos }, _this.options.animationDuration, _this.options.animationEasing,function(){\n /**\n * Fires after the menu has scrolled\n * @event Drilldown#scrollme\n */\n if(this===$('html')[0])_this.$element.trigger('scrollme.zf.drilldown');\n });\n }\n\n /**\n * Adds keydown event listener to `li`'s in the menu.\n * @private\n */\n _keyboardEvents() {\n var _this = this;\n\n this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function(e){\n var $element = $(this),\n $elements = $element.parent('li').parent('ul').children('li').children('a'),\n $prevElement,\n $nextElement;\n\n $elements.each(function(i) {\n if ($(this).is($element)) {\n $prevElement = $elements.eq(Math.max(0, i-1));\n $nextElement = $elements.eq(Math.min(i+1, $elements.length-1));\n return;\n }\n });\n\n Keyboard.handleKey(e, 'Drilldown', {\n next: function() {\n if ($element.is(_this.$submenuAnchors)) {\n _this._show($element.parent('li'));\n $element.parent('li').one(transitionend($element), function(){\n $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();\n });\n return true;\n }\n },\n previous: function() {\n _this._hide($element.parent('li').parent('ul'));\n $element.parent('li').parent('ul').one(transitionend($element), function(){\n setTimeout(function() {\n $element.parent('li').parent('ul').parent('li').children('a').first().focus();\n }, 1);\n });\n return true;\n },\n up: function() {\n $prevElement.focus();\n // Don't tap focus on first element in root ul\n return !$element.is(_this.$element.find('> li:first-child > a'));\n },\n down: function() {\n $nextElement.focus();\n // Don't tap focus on last element in root ul\n return !$element.is(_this.$element.find('> li:last-child > a'));\n },\n close: function() {\n // Don't close on element in root ul\n if (!$element.is(_this.$element.find('> li > a'))) {\n _this._hide($element.parent().parent());\n $element.parent().parent().siblings('a').focus();\n }\n },\n open: function() {\n if (_this.options.parentLink && $element.attr('href')) { // Link with href\n return false;\n } else if (!$element.is(_this.$menuItems)) { // not menu item means back button\n _this._hide($element.parent('li').parent('ul'));\n $element.parent('li').parent('ul').one(transitionend($element), function(){\n setTimeout(function() {\n $element.parent('li').parent('ul').parent('li').children('a').first().focus();\n }, 1);\n });\n return true;\n } else if ($element.is(_this.$submenuAnchors)) { // Sub menu item\n _this._show($element.parent('li'));\n $element.parent('li').one(transitionend($element), function(){\n $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();\n });\n return true;\n }\n },\n handled: function(preventDefault) {\n if (preventDefault) {\n e.preventDefault();\n }\n }\n });\n }); // end keyboardAccess\n }\n\n /**\n * Closes all open elements, and returns to root menu.\n * @function\n * @fires Drilldown#close\n * @fires Drilldown#closed\n */\n _hideAll() {\n var $elem = this.$element.find('.is-drilldown-submenu.is-active')\n $elem.addClass('is-closing');\n\n if (this.options.autoHeight) {\n const calcHeight = $elem.parent().closest('ul').data('calcHeight');\n this.$wrapper.css({ height: calcHeight });\n }\n\n /**\n * Fires when the menu is closing.\n * @event Drilldown#close\n */\n this.$element.trigger('close.zf.drilldown');\n\n $elem.one(transitionend($elem), () => {\n $elem.removeClass('is-active is-closing');\n\n /**\n * Fires when the menu is fully closed.\n * @event Drilldown#closed\n */\n this.$element.trigger('closed.zf.drilldown');\n });\n }\n\n /**\n * Adds event listener for each `back` button, and closes open menus.\n * @function\n * @fires Drilldown#back\n * @param {jQuery} $elem - the current sub-menu to add `back` event.\n */\n _back($elem) {\n var _this = this;\n $elem.off('click.zf.drilldown');\n $elem.children('.js-drilldown-back')\n .on('click.zf.drilldown', function(e){\n // console.log('mouseup on back');\n _this._hide($elem);\n\n // If there is a parent submenu, call show\n let parentSubMenu = $elem.parent('li').parent('ul').parent('li');\n if (parentSubMenu.length) {\n _this._show(parentSubMenu);\n }\n });\n }\n\n /**\n * Adds event listener to menu items w/o submenus to close open menus on click.\n * @function\n * @private\n */\n _menuLinkEvents() {\n var _this = this;\n this.$menuItems.not('.is-drilldown-submenu-parent')\n .off('click.zf.drilldown')\n .on('click.zf.drilldown', function(e){\n setTimeout(function(){\n _this._hideAll();\n }, 0);\n });\n }\n\n /**\n * Sets the CSS classes for submenu to show it.\n * @function\n * @private\n * @param {jQuery} $elem - the target submenu (`ul` tag)\n * @param {boolean} trigger - trigger drilldown event\n */\n _setShowSubMenuClasses($elem, trigger) {\n $elem.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);\n $elem.parent('li').attr('aria-expanded', true);\n if (trigger === true) {\n this.$element.trigger('open.zf.drilldown', [$elem]);\n }\n }\n\n /**\n * Sets the CSS classes for submenu to hide it.\n * @function\n * @private\n * @param {jQuery} $elem - the target submenu (`ul` tag)\n * @param {boolean} trigger - trigger drilldown event\n */\n _setHideSubMenuClasses($elem, trigger) {\n $elem.removeClass('is-active').addClass('invisible').attr('aria-hidden', true);\n $elem.parent('li').attr('aria-expanded', false);\n if (trigger === true) {\n $elem.trigger('hide.zf.drilldown', [$elem]);\n }\n }\n\n /**\n * Opens a specific drilldown (sub)menu no matter which (sub)menu in it is currently visible.\n * Compared to _show() this lets you jump into any submenu without clicking through every submenu on the way to it.\n * @function\n * @fires Drilldown#open\n * @param {jQuery} $elem - the target (sub)menu (`ul` tag)\n * @param {boolean} autoFocus - if true the first link in the target (sub)menu gets auto focused\n */\n _showMenu($elem, autoFocus) {\n\n var _this = this;\n\n // Reset drilldown\n var $expandedSubmenus = this.$element.find('li[aria-expanded=\"true\"] > ul[data-submenu]');\n $expandedSubmenus.each(function(index) {\n _this._setHideSubMenuClasses($(this));\n });\n\n // Save the menu as the currently displayed one.\n this.$currentMenu = $elem;\n\n // If target menu is root, focus first link & exit\n if ($elem.is('[data-drilldown]')) {\n if (autoFocus === true) $elem.find('li[role=\"treeitem\"] > a').first().focus();\n if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight'));\n return;\n }\n\n // Find all submenus on way to root incl. the element itself\n var $submenus = $elem.children().first().parentsUntil('[data-drilldown]', '[data-submenu]');\n\n // Open target menu and all submenus on its way to root\n $submenus.each(function(index) {\n\n // Update height of first child (target menu) if autoHeight option true\n if (index === 0 && _this.options.autoHeight) {\n _this.$wrapper.css('height', $(this).data('calcHeight'));\n }\n\n var isLastChild = index == $submenus.length - 1;\n\n // Add transitionsend listener to last child (root due to reverse order) to open target menu's first link\n // Last child makes sure the event gets always triggered even if going through several menus\n if (isLastChild === true) {\n $(this).one(transitionend($(this)), () => {\n if (autoFocus === true) {\n $elem.find('li[role=\"treeitem\"] > a').first().focus();\n }\n });\n }\n\n _this._setShowSubMenuClasses($(this), isLastChild);\n });\n }\n\n /**\n * Opens a submenu.\n * @function\n * @fires Drilldown#open\n * @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag.\n */\n _show($elem) {\n const $submenu = $elem.children('[data-submenu]');\n\n $elem.attr('aria-expanded', true);\n\n this.$currentMenu = $submenu;\n $submenu.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);\n if (this.options.autoHeight) {\n this.$wrapper.css({ height: $submenu.data('calcHeight') });\n }\n\n /**\n * Fires when the submenu has opened.\n * @event Drilldown#open\n */\n this.$element.trigger('open.zf.drilldown', [$elem]);\n }\n\n /**\n * Hides a submenu\n * @function\n * @fires Drilldown#hide\n * @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag.\n */\n _hide($elem) {\n if(this.options.autoHeight) this.$wrapper.css({height:$elem.parent().closest('ul').data('calcHeight')});\n var _this = this;\n $elem.parent('li').attr('aria-expanded', false);\n $elem.attr('aria-hidden', true);\n $elem.addClass('is-closing')\n .one(transitionend($elem), function(){\n $elem.removeClass('is-active is-closing');\n $elem.blur().addClass('invisible');\n });\n /**\n * Fires when the submenu has closed.\n * @event Drilldown#hide\n */\n $elem.trigger('hide.zf.drilldown', [$elem]);\n }\n\n /**\n * Iterates through the nested menus to calculate the min-height, and max-width for the menu.\n * Prevents content jumping.\n * @function\n * @private\n */\n _getMaxDims() {\n var maxHeight = 0, result = {}, _this = this;\n\n // Recalculate menu heights and total max height\n this.$submenus.add(this.$element).each(function(){\n var numOfElems = $(this).children('li').length;\n var height = Box.GetDimensions(this).height;\n\n maxHeight = height > maxHeight ? height : maxHeight;\n\n if(_this.options.autoHeight) {\n $(this).data('calcHeight',height);\n }\n });\n\n if (this.options.autoHeight)\n result['height'] = this.$currentMenu.data('calcHeight');\n else\n result['min-height'] = `${maxHeight}px`;\n\n result['max-width'] = `${this.$element[0].getBoundingClientRect().width}px`;\n\n return result;\n }\n\n /**\n * Destroys the Drilldown Menu\n * @function\n */\n _destroy() {\n if(this.options.scrollTop) this.$element.off('.zf.drilldown',this._bindHandler);\n this._hideAll();\n\t this.$element.off('mutateme.zf.trigger');\n Nest.Burn(this.$element, 'drilldown');\n this.$element.unwrap()\n .find('.js-drilldown-back, .is-submenu-parent-item').remove()\n .end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu')\n .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');\n this.$submenuAnchors.each(function() {\n $(this).off('.zf.drilldown');\n });\n\n this.$element.find('[data-is-parent-link]').detach();\n this.$submenus.removeClass('drilldown-submenu-cover-previous invisible');\n\n this.$element.find('a').each(function(){\n var $link = $(this);\n $link.removeAttr('tabindex');\n if($link.data('savedHref')){\n $link.attr('href', $link.data('savedHref')).removeData('savedHref');\n }else{ return; }\n });\n };\n}\n\nDrilldown.defaults = {\n /**\n * Drilldowns depend on styles in order to function properly; in the default build of Foundation these are\n * on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization.\n * @option\n * @type {boolean}\n * @default true\n */\n autoApplyClass: true,\n /**\n * Markup used for JS generated back button. Prepended or appended (see backButtonPosition) to submenu lists and deleted on `destroy` method, 'js-drilldown-back' class required. Remove the backslash (`\\`) if copy and pasting.\n * @option\n * @type {string}\n * @default '<li class=\"js-drilldown-back\"><a tabindex=\"0\">Back</a></li>'\n */\n backButton: '<li class=\"js-drilldown-back\"><a tabindex=\"0\">Back</a></li>',\n /**\n * Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`.\n * @option\n * @type {string}\n * @default top\n */\n backButtonPosition: 'top',\n /**\n * Markup used to wrap drilldown menu. Use a class name for independent styling; the JS applied class: `is-drilldown` is required. Remove the backslash (`\\`) if copy and pasting.\n * @option\n * @type {string}\n * @default '<div></div>'\n */\n wrapper: '<div></div>',\n /**\n * Adds the parent link to the submenu.\n * @option\n * @type {boolean}\n * @default false\n */\n parentLink: false,\n /**\n * Allow the menu to return to root list on body click.\n * @option\n * @type {boolean}\n * @default false\n */\n closeOnClick: false,\n /**\n * Allow the menu to auto adjust height.\n * @option\n * @type {boolean}\n * @default false\n */\n autoHeight: false,\n /**\n * Animate the auto adjust height.\n * @option\n * @type {boolean}\n * @default false\n */\n animateHeight: false,\n /**\n * Scroll to the top of the menu after opening a submenu or navigating back using the menu back button\n * @option\n * @type {boolean}\n * @default false\n */\n scrollTop: false,\n /**\n * String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken\n * @option\n * @type {string}\n * @default ''\n */\n scrollTopElement: '',\n /**\n * ScrollTop offset\n * @option\n * @type {number}\n * @default 0\n */\n scrollTopOffset: 0,\n /**\n * Scroll animation duration\n * @option\n * @type {number}\n * @default 500\n */\n animationDuration: 500,\n /**\n * Scroll animation easing. Can be `'swing'` or `'linear'`.\n * @option\n * @type {string}\n * @see {@link https://api.jquery.com/animate|JQuery animate}\n * @default 'swing'\n */\n animationEasing: 'swing'\n // holdOpen: false\n};\n\nexport {Drilldown};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { GetYoDigits, ignoreMousedisappear } from './foundation.core.utils';\nimport { Positionable } from './foundation.positionable';\n\nimport { Triggers } from './foundation.util.triggers';\nimport { Touch } from './foundation.util.touch'\n\n/**\n * Dropdown module.\n * @module foundation.dropdown\n * @requires foundation.util.keyboard\n * @requires foundation.util.box\n * @requires foundation.util.touch\n * @requires foundation.util.triggers\n */\nclass Dropdown extends Positionable {\n /**\n * Creates a new instance of a dropdown.\n * @class\n * @name Dropdown\n * @param {jQuery} element - jQuery object to make into a dropdown.\n * Object should be of the dropdown panel, rather than its anchor.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Dropdown.defaults, this.$element.data(), options);\n this.className = 'Dropdown'; // ie9 back compat\n\n // Touch and Triggers init are idempotent, just need to make sure they are initialized\n Touch.init($);\n Triggers.init($);\n\n this._init();\n\n Keyboard.register('Dropdown', {\n 'ENTER': 'toggle',\n 'SPACE': 'toggle',\n 'ESCAPE': 'close'\n });\n }\n\n /**\n * Initializes the plugin by setting/checking options and attributes, adding helper variables, and saving the anchor.\n * @function\n * @private\n */\n _init() {\n var $id = this.$element.attr('id');\n\n this.$anchors = $(`[data-toggle=\"${$id}\"]`).length ? $(`[data-toggle=\"${$id}\"]`) : $(`[data-open=\"${$id}\"]`);\n this.$anchors.attr({\n 'aria-controls': $id,\n 'data-is-focus': false,\n 'data-yeti-box': $id,\n 'aria-haspopup': true,\n 'aria-expanded': false\n });\n\n this._setCurrentAnchor(this.$anchors.first());\n\n if(this.options.parentClass){\n this.$parent = this.$element.parents('.' + this.options.parentClass);\n }else{\n this.$parent = null;\n }\n\n // Set [aria-labelledby] on the Dropdown if it is not set\n if (typeof this.$element.attr('aria-labelledby') === 'undefined') {\n // Get the anchor ID or create one\n if (typeof this.$currentAnchor.attr('id') === 'undefined') {\n this.$currentAnchor.attr('id', GetYoDigits(6, 'dd-anchor'));\n }\n\n this.$element.attr('aria-labelledby', this.$currentAnchor.attr('id'));\n }\n\n this.$element.attr({\n 'aria-hidden': 'true',\n 'data-yeti-box': $id,\n 'data-resize': $id,\n });\n\n super._init();\n this._events();\n }\n\n _getDefaultPosition() {\n // handle legacy classnames\n var position = this.$element[0].className.match(/(top|left|right|bottom)/g);\n if(position) {\n return position[0];\n } else {\n return 'bottom'\n }\n }\n\n _getDefaultAlignment() {\n // handle legacy float approach\n var horizontalPosition = /float-(\\S+)/.exec(this.$currentAnchor.attr('class'));\n if(horizontalPosition) {\n return horizontalPosition[1];\n }\n\n return super._getDefaultAlignment();\n }\n\n\n\n /**\n * Sets the position and orientation of the dropdown pane, checks for collisions if allow-overlap is not true.\n * Recursively calls itself if a collision is detected, with a new position class.\n * @function\n * @private\n */\n _setPosition() {\n this.$element.removeClass(`has-position-${this.position} has-alignment-${this.alignment}`);\n super._setPosition(this.$currentAnchor, this.$element, this.$parent);\n this.$element.addClass(`has-position-${this.position} has-alignment-${this.alignment}`);\n }\n\n /**\n * Make it a current anchor.\n * Current anchor as the reference for the position of Dropdown panes.\n * @param {HTML} el - DOM element of the anchor.\n * @function\n * @private\n */\n _setCurrentAnchor(el) {\n this.$currentAnchor = $(el);\n }\n\n /**\n * Adds event listeners to the element utilizing the triggers utility library.\n * @function\n * @private\n */\n _events() {\n var _this = this,\n hasTouch = 'ontouchstart' in window || (typeof window.ontouchstart !== 'undefined');\n\n this.$element.on({\n 'open.zf.trigger': this.open.bind(this),\n 'close.zf.trigger': this.close.bind(this),\n 'toggle.zf.trigger': this.toggle.bind(this),\n 'resizeme.zf.trigger': this._setPosition.bind(this)\n });\n\n this.$anchors.off('click.zf.trigger')\n .on('click.zf.trigger', function(e) {\n _this._setCurrentAnchor(this);\n\n if (\n // if forceFollow false, always prevent default action\n (_this.options.forceFollow === false) ||\n // if forceFollow true and hover option true, only prevent default action on 1st click\n // on 2nd click (dropown opened) the default action (e.g. follow a href) gets executed\n (hasTouch && _this.options.hover && _this.$element.hasClass('is-open') === false)\n ) {\n e.preventDefault();\n }\n });\n\n if(this.options.hover){\n this.$anchors.off('mouseenter.zf.dropdown mouseleave.zf.dropdown')\n .on('mouseenter.zf.dropdown', function(){\n _this._setCurrentAnchor(this);\n\n var bodyData = $('body').data();\n if(typeof(bodyData.whatinput) === 'undefined' || bodyData.whatinput === 'mouse') {\n clearTimeout(_this.timeout);\n _this.timeout = setTimeout(function(){\n _this.open();\n _this.$anchors.data('hover', true);\n }, _this.options.hoverDelay);\n }\n }).on('mouseleave.zf.dropdown', ignoreMousedisappear(function(){\n clearTimeout(_this.timeout);\n _this.timeout = setTimeout(function(){\n _this.close();\n _this.$anchors.data('hover', false);\n }, _this.options.hoverDelay);\n }));\n if(this.options.hoverPane){\n this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown')\n .on('mouseenter.zf.dropdown', function(){\n clearTimeout(_this.timeout);\n }).on('mouseleave.zf.dropdown', ignoreMousedisappear(function(){\n clearTimeout(_this.timeout);\n _this.timeout = setTimeout(function(){\n _this.close();\n _this.$anchors.data('hover', false);\n }, _this.options.hoverDelay);\n }));\n }\n }\n this.$anchors.add(this.$element).on('keydown.zf.dropdown', function(e) {\n\n var $target = $(this),\n visibleFocusableElements = Keyboard.findFocusable(_this.$element);\n\n Keyboard.handleKey(e, 'Dropdown', {\n open: function() {\n if ($target.is(_this.$anchors) && !$target.is('input, textarea')) {\n _this.open();\n _this.$element.attr('tabindex', -1).focus();\n e.preventDefault();\n }\n },\n close: function() {\n _this.close();\n _this.$anchors.focus();\n }\n });\n });\n }\n\n /**\n * Adds an event handler to the body to close any dropdowns on a click.\n * @function\n * @private\n */\n _addBodyHandler() {\n var $body = $(document.body).not(this.$element),\n _this = this;\n $body.off('click.zf.dropdown tap.zf.dropdown')\n .on('click.zf.dropdown tap.zf.dropdown', function (e) {\n if(_this.$anchors.is(e.target) || _this.$anchors.find(e.target).length) {\n return;\n }\n if(_this.$element.is(e.target) || _this.$element.find(e.target).length) {\n return;\n }\n _this.close();\n $body.off('click.zf.dropdown tap.zf.dropdown');\n });\n }\n\n /**\n * Opens the dropdown pane, and fires a bubbling event to close other dropdowns.\n * @function\n * @fires Dropdown#closeme\n * @fires Dropdown#show\n */\n open() {\n // var _this = this;\n /**\n * Fires to close other open dropdowns, typically when dropdown is opening\n * @event Dropdown#closeme\n */\n this.$element.trigger('closeme.zf.dropdown', this.$element.attr('id'));\n this.$anchors.addClass('hover')\n .attr({'aria-expanded': true});\n // this.$element/*.show()*/;\n\n this.$element.addClass('is-opening');\n this._setPosition();\n this.$element.removeClass('is-opening').addClass('is-open')\n .attr({'aria-hidden': false});\n\n if(this.options.autoFocus){\n var $focusable = Keyboard.findFocusable(this.$element);\n if($focusable.length){\n $focusable.eq(0).focus();\n }\n }\n\n if(this.options.closeOnClick){ this._addBodyHandler(); }\n\n if (this.options.trapFocus) {\n Keyboard.trapFocus(this.$element);\n }\n\n /**\n * Fires once the dropdown is visible.\n * @event Dropdown#show\n */\n this.$element.trigger('show.zf.dropdown', [this.$element]);\n }\n\n /**\n * Closes the open dropdown pane.\n * @function\n * @fires Dropdown#hide\n */\n close() {\n if(!this.$element.hasClass('is-open')){\n return false;\n }\n this.$element.removeClass('is-open')\n .attr({'aria-hidden': true});\n\n this.$anchors.removeClass('hover')\n .attr('aria-expanded', false);\n\n /**\n * Fires once the dropdown is no longer visible.\n * @event Dropdown#hide\n */\n this.$element.trigger('hide.zf.dropdown', [this.$element]);\n\n if (this.options.trapFocus) {\n Keyboard.releaseFocus(this.$element);\n }\n }\n\n /**\n * Toggles the dropdown pane's visibility.\n * @function\n */\n toggle() {\n if(this.$element.hasClass('is-open')){\n if(this.$anchors.data('hover')) return;\n this.close();\n }else{\n this.open();\n }\n }\n\n /**\n * Destroys the dropdown.\n * @function\n */\n _destroy() {\n this.$element.off('.zf.trigger').hide();\n this.$anchors.off('.zf.dropdown');\n $(document.body).off('click.zf.dropdown tap.zf.dropdown');\n\n }\n}\n\nDropdown.defaults = {\n /**\n * Class that designates bounding container of Dropdown (default: window)\n * @option\n * @type {?string}\n * @default null\n */\n parentClass: null,\n /**\n * Amount of time to delay opening a submenu on hover event.\n * @option\n * @type {number}\n * @default 250\n */\n hoverDelay: 250,\n /**\n * Allow submenus to open on hover events\n * @option\n * @type {boolean}\n * @default false\n */\n hover: false,\n /**\n * Don't close dropdown when hovering over dropdown pane\n * @option\n * @type {boolean}\n * @default false\n */\n hoverPane: false,\n /**\n * Number of pixels between the dropdown pane and the triggering element on open.\n * @option\n * @type {number}\n * @default 0\n */\n vOffset: 0,\n /**\n * Number of pixels between the dropdown pane and the triggering element on open.\n * @option\n * @type {number}\n * @default 0\n */\n hOffset: 0,\n /**\n * Position of dropdown. Can be left, right, bottom, top, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n position: 'auto',\n /**\n * Alignment of dropdown relative to anchor. Can be left, right, bottom, top, center, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n alignment: 'auto',\n /**\n * Allow overlap of container/window. If false, dropdown will first try to position as defined by data-position and data-alignment, but reposition if it would cause an overflow.\n * @option\n * @type {boolean}\n * @default false\n */\n allowOverlap: false,\n /**\n * Allow overlap of only the bottom of the container. This is the most common\n * behavior for dropdowns, allowing the dropdown to extend the bottom of the\n * screen but not otherwise influence or break out of the container.\n * @option\n * @type {boolean}\n * @default true\n */\n allowBottomOverlap: true,\n /**\n * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands.\n * @option\n * @type {boolean}\n * @default false\n */\n trapFocus: false,\n /**\n * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening.\n * @option\n * @type {boolean}\n * @default false\n */\n autoFocus: false,\n /**\n * Allows a click on the body to close the dropdown.\n * @option\n * @type {boolean}\n * @default false\n */\n closeOnClick: false,\n /**\n * If true the default action of the toggle (e.g. follow a link with href) gets executed on click. If hover option is also true the default action gets prevented on first click for mobile / touch devices and executed on second click.\n * @option\n * @type {boolean}\n * @default true\n */\n forceFollow: true\n};\n\nexport {Dropdown};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Plugin } from './foundation.core.plugin';\nimport { rtl as Rtl, ignoreMousedisappear } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { Nest } from './foundation.util.nest';\nimport { Box } from './foundation.util.box';\nimport { Touch } from './foundation.util.touch'\n\n\n/**\n * DropdownMenu module.\n * @module foundation.dropdownMenu\n * @requires foundation.util.keyboard\n * @requires foundation.util.box\n * @requires foundation.util.nest\n * @requires foundation.util.touch\n */\n\nclass DropdownMenu extends Plugin {\n /**\n * Creates a new instance of DropdownMenu.\n * @class\n * @name DropdownMenu\n * @fires DropdownMenu#init\n * @param {jQuery} element - jQuery object to make into a dropdown menu.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, DropdownMenu.defaults, this.$element.data(), options);\n this.className = 'DropdownMenu'; // ie9 back compat\n\n Touch.init($); // Touch init is idempotent, we just need to make sure it's initialied.\n\n this._init();\n\n Keyboard.register('DropdownMenu', {\n 'ENTER': 'open',\n 'SPACE': 'open',\n 'ARROW_RIGHT': 'next',\n 'ARROW_UP': 'up',\n 'ARROW_DOWN': 'down',\n 'ARROW_LEFT': 'previous',\n 'ESCAPE': 'close'\n });\n }\n\n /**\n * Initializes the plugin, and calls _prepareMenu\n * @private\n * @function\n */\n _init() {\n Nest.Feather(this.$element, 'dropdown');\n\n var subs = this.$element.find('li.is-dropdown-submenu-parent');\n this.$element.children('.is-dropdown-submenu-parent').children('.is-dropdown-submenu').addClass('first-sub');\n\n this.$menuItems = this.$element.find('li[role=\"none\"]');\n this.$tabs = this.$element.children('li[role=\"none\"]');\n this.$tabs.find('ul.is-dropdown-submenu').addClass(this.options.verticalClass);\n\n if (this.options.alignment === 'auto') {\n if (this.$element.hasClass(this.options.rightClass) || Rtl() || this.$element.parents('.top-bar-right').is('*')) {\n this.options.alignment = 'right';\n subs.addClass('opens-left');\n } else {\n this.options.alignment = 'left';\n subs.addClass('opens-right');\n }\n } else {\n if (this.options.alignment === 'right') {\n subs.addClass('opens-left');\n } else {\n subs.addClass('opens-right');\n }\n }\n this.changed = false;\n this._events();\n };\n\n _isVertical() {\n return this.$tabs.css('display') === 'block' || this.$element.css('flex-direction') === 'column';\n }\n\n _isRtl() {\n return this.$element.hasClass('align-right') || (Rtl() && !this.$element.hasClass('align-left'));\n }\n\n /**\n * Adds event listeners to elements within the menu\n * @private\n * @function\n */\n _events() {\n var _this = this,\n hasTouch = 'ontouchstart' in window || (typeof window.ontouchstart !== 'undefined'),\n parClass = 'is-dropdown-submenu-parent';\n\n // used for onClick and in the keyboard handlers\n var handleClickFn = function(e) {\n var $elem = $(e.target).parentsUntil('ul', `.${parClass}`),\n hasSub = $elem.hasClass(parClass),\n hasClicked = $elem.attr('data-is-click') === 'true',\n $sub = $elem.children('.is-dropdown-submenu');\n\n if (hasSub) {\n if (hasClicked) {\n if (!_this.options.closeOnClick\n || (!_this.options.clickOpen && !hasTouch)\n || (_this.options.forceFollow && hasTouch)) {\n return;\n }\n e.stopImmediatePropagation();\n e.preventDefault();\n _this._hide($elem);\n }\n else {\n e.stopImmediatePropagation();\n e.preventDefault();\n _this._show($sub);\n $elem.add($elem.parentsUntil(_this.$element, `.${parClass}`)).attr('data-is-click', true);\n }\n }\n };\n\n if (this.options.clickOpen || hasTouch) {\n this.$menuItems.on('click.zf.dropdownMenu touchstart.zf.dropdownMenu', handleClickFn);\n }\n\n // Handle Leaf element Clicks\n if(_this.options.closeOnClickInside){\n this.$menuItems.on('click.zf.dropdownMenu', function(e) {\n var $elem = $(this),\n hasSub = $elem.hasClass(parClass);\n if(!hasSub){\n _this._hide();\n }\n });\n }\n\n if (!this.options.disableHover) {\n this.$menuItems.on('mouseenter.zf.dropdownMenu', function (e) {\n var $elem = $(this),\n hasSub = $elem.hasClass(parClass);\n\n if (hasSub) {\n clearTimeout($elem.data('_delay'));\n $elem.data('_delay', setTimeout(function () {\n _this._show($elem.children('.is-dropdown-submenu'));\n }, _this.options.hoverDelay));\n }\n }).on('mouseleave.zf.dropdownMenu', ignoreMousedisappear(function (e) {\n var $elem = $(this),\n hasSub = $elem.hasClass(parClass);\n if (hasSub && _this.options.autoclose) {\n if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) { return false; }\n\n clearTimeout($elem.data('_delay'));\n $elem.data('_delay', setTimeout(function () {\n _this._hide($elem);\n }, _this.options.closingTime));\n }\n }));\n }\n this.$menuItems.on('keydown.zf.dropdownMenu', function(e) {\n var $element = $(e.target).parentsUntil('ul', '[role=\"none\"]'),\n isTab = _this.$tabs.index($element) > -1,\n $elements = isTab ? _this.$tabs : $element.siblings('li').add($element),\n $prevElement,\n $nextElement;\n\n $elements.each(function(i) {\n if ($(this).is($element)) {\n $prevElement = $elements.eq(i-1);\n $nextElement = $elements.eq(i+1);\n return;\n }\n });\n\n var nextSibling = function() {\n $nextElement.children('a:first').focus();\n e.preventDefault();\n }, prevSibling = function() {\n $prevElement.children('a:first').focus();\n e.preventDefault();\n }, openSub = function() {\n var $sub = $element.children('ul.is-dropdown-submenu');\n if ($sub.length) {\n _this._show($sub);\n $element.find('li > a:first').focus();\n e.preventDefault();\n } else { return; }\n }, closeSub = function() {\n //if ($element.is(':first-child')) {\n var close = $element.parent('ul').parent('li');\n close.children('a:first').focus();\n _this._hide(close);\n e.preventDefault();\n //}\n };\n var functions = {\n open: openSub,\n close: function() {\n _this._hide(_this.$element);\n _this.$menuItems.eq(0).children('a').focus(); // focus to first element\n e.preventDefault();\n }\n };\n\n if (isTab) {\n if (_this._isVertical()) { // vertical menu\n if (_this._isRtl()) { // right aligned\n $.extend(functions, {\n down: nextSibling,\n up: prevSibling,\n next: closeSub,\n previous: openSub\n });\n } else { // left aligned\n $.extend(functions, {\n down: nextSibling,\n up: prevSibling,\n next: openSub,\n previous: closeSub\n });\n }\n } else { // horizontal menu\n if (_this._isRtl()) { // right aligned\n $.extend(functions, {\n next: prevSibling,\n previous: nextSibling,\n down: openSub,\n up: closeSub\n });\n } else { // left aligned\n $.extend(functions, {\n next: nextSibling,\n previous: prevSibling,\n down: openSub,\n up: closeSub\n });\n }\n }\n } else { // not tabs -> one sub\n if (_this._isRtl()) { // right aligned\n $.extend(functions, {\n next: closeSub,\n previous: openSub,\n down: nextSibling,\n up: prevSibling\n });\n } else { // left aligned\n $.extend(functions, {\n next: openSub,\n previous: closeSub,\n down: nextSibling,\n up: prevSibling\n });\n }\n }\n Keyboard.handleKey(e, 'DropdownMenu', functions);\n\n });\n }\n\n /**\n * Adds an event handler to the body to close any dropdowns on a click.\n * @function\n * @private\n */\n _addBodyHandler() {\n const $body = $(document.body);\n this._removeBodyHandler();\n $body.on('click.zf.dropdownMenu tap.zf.dropdownMenu', (e) => {\n var isItself = !!$(e.target).closest(this.$element).length;\n if (isItself) return;\n\n this._hide();\n this._removeBodyHandler();\n });\n }\n\n /**\n * Remove the body event handler. See `_addBodyHandler`.\n * @function\n * @private\n */\n _removeBodyHandler() {\n $(document.body).off('click.zf.dropdownMenu tap.zf.dropdownMenu');\n }\n\n /**\n * Opens a dropdown pane, and checks for collisions first.\n * @param {jQuery} $sub - ul element that is a submenu to show\n * @function\n * @private\n * @fires DropdownMenu#show\n */\n _show($sub) {\n var idx = this.$tabs.index(this.$tabs.filter(function(i, el) {\n return $(el).find($sub).length > 0;\n }));\n var $sibs = $sub.parent('li.is-dropdown-submenu-parent').siblings('li.is-dropdown-submenu-parent');\n this._hide($sibs, idx);\n $sub.css('visibility', 'hidden').addClass('js-dropdown-active')\n .parent('li.is-dropdown-submenu-parent').addClass('is-active');\n var clear = Box.ImNotTouchingYou($sub, null, true);\n if (!clear) {\n var oldClass = this.options.alignment === 'left' ? '-right' : '-left',\n $parentLi = $sub.parent('.is-dropdown-submenu-parent');\n $parentLi.removeClass(`opens${oldClass}`).addClass(`opens-${this.options.alignment}`);\n clear = Box.ImNotTouchingYou($sub, null, true);\n if (!clear) {\n $parentLi.removeClass(`opens-${this.options.alignment}`).addClass('opens-inner');\n }\n this.changed = true;\n }\n $sub.css('visibility', '');\n if (this.options.closeOnClick) { this._addBodyHandler(); }\n /**\n * Fires when the new dropdown pane is visible.\n * @event DropdownMenu#show\n */\n this.$element.trigger('show.zf.dropdownMenu', [$sub]);\n }\n\n /**\n * Hides a single, currently open dropdown pane, if passed a parameter, otherwise, hides everything.\n * @function\n * @param {jQuery} $elem - element with a submenu to hide\n * @param {Number} idx - index of the $tabs collection to hide\n * @fires DropdownMenu#hide\n * @private\n */\n _hide($elem, idx) {\n var $toClose;\n if ($elem && $elem.length) {\n $toClose = $elem;\n } else if (typeof idx !== 'undefined') {\n $toClose = this.$tabs.not(function(i, el) {\n return i === idx;\n });\n }\n else {\n $toClose = this.$element;\n }\n var somethingToClose = $toClose.hasClass('is-active') || $toClose.find('.is-active').length > 0;\n\n if (somethingToClose) {\n var $activeItem = $toClose.find('li.is-active');\n $activeItem.add($toClose).attr({\n 'data-is-click': false\n }).removeClass('is-active');\n\n $toClose.find('ul.js-dropdown-active').removeClass('js-dropdown-active');\n\n if (this.changed || $toClose.find('opens-inner').length) {\n var oldClass = this.options.alignment === 'left' ? 'right' : 'left';\n $toClose.find('li.is-dropdown-submenu-parent').add($toClose)\n .removeClass(`opens-inner opens-${this.options.alignment}`)\n .addClass(`opens-${oldClass}`);\n this.changed = false;\n }\n\n clearTimeout($activeItem.data('_delay'));\n this._removeBodyHandler();\n\n /**\n * Fires when the open menus are closed.\n * @event DropdownMenu#hide\n */\n this.$element.trigger('hide.zf.dropdownMenu', [$toClose]);\n }\n }\n\n /**\n * Destroys the plugin.\n * @function\n */\n _destroy() {\n this.$menuItems.off('.zf.dropdownMenu').removeAttr('data-is-click')\n .removeClass('is-right-arrow is-left-arrow is-down-arrow opens-right opens-left opens-inner');\n $(document.body).off('.zf.dropdownMenu');\n Nest.Burn(this.$element, 'dropdown');\n }\n}\n\n/**\n * Default settings for plugin\n */\nDropdownMenu.defaults = {\n /**\n * Disallows hover events from opening submenus\n * @option\n * @type {boolean}\n * @default false\n */\n disableHover: false,\n /**\n * Allow a submenu to automatically close on a mouseleave event, if not clicked open.\n * @option\n * @type {boolean}\n * @default true\n */\n autoclose: true,\n /**\n * Amount of time to delay opening a submenu on hover event.\n * @option\n * @type {number}\n * @default 50\n */\n hoverDelay: 50,\n /**\n * Allow a submenu to open/remain open on parent click event. Allows cursor to move away from menu.\n * @option\n * @type {boolean}\n * @default false\n */\n clickOpen: false,\n /**\n * Amount of time to delay closing a submenu on a mouseleave event.\n * @option\n * @type {number}\n * @default 500\n */\n\n closingTime: 500,\n /**\n * Position of the menu relative to what direction the submenus should open. Handled by JS. Can be `'auto'`, `'left'` or `'right'`.\n * @option\n * @type {string}\n * @default 'auto'\n */\n alignment: 'auto',\n /**\n * Allow clicks on the body to close any open submenus.\n * @option\n * @type {boolean}\n * @default true\n */\n closeOnClick: true,\n /**\n * Allow clicks on leaf anchor links to close any open submenus.\n * @option\n * @type {boolean}\n * @default true\n */\n closeOnClickInside: true,\n /**\n * Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class.\n * @option\n * @type {string}\n * @default 'vertical'\n */\n verticalClass: 'vertical',\n /**\n * Class applied to right-side oriented menus, Foundation default is `align-right`. Update this if using your own class.\n * @option\n * @type {string}\n * @default 'align-right'\n */\n rightClass: 'align-right',\n /**\n * Boolean to force overide the clicking of links to perform default action, on second touch event for mobile.\n * @option\n * @type {boolean}\n * @default true\n */\n forceFollow: true\n};\n\nexport {DropdownMenu};\n","'use strict';\n\nimport $ from 'jquery';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { onImagesLoaded } from './foundation.util.imageLoader';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * Equalizer module.\n * @module foundation.equalizer\n * @requires foundation.util.mediaQuery\n * @requires foundation.util.imageLoader if equalizer contains images\n */\n\nclass Equalizer extends Plugin {\n /**\n * Creates a new instance of Equalizer.\n * @class\n * @name Equalizer\n * @fires Equalizer#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options){\n this.$element = element;\n this.options = $.extend({}, Equalizer.defaults, this.$element.data(), options);\n this.className = 'Equalizer'; // ie9 back compat\n\n this._init();\n }\n\n /**\n * Initializes the Equalizer plugin and calls functions to get equalizer functioning on load.\n * @private\n */\n _init() {\n var eqId = this.$element.attr('data-equalizer') || '';\n var $watched = this.$element.find(`[data-equalizer-watch=\"${eqId}\"]`);\n\n MediaQuery._init();\n\n this.$watched = $watched.length ? $watched : this.$element.find('[data-equalizer-watch]');\n this.$element.attr('data-resize', (eqId || GetYoDigits(6, 'eq')));\n this.$element.attr('data-mutate', (eqId || GetYoDigits(6, 'eq')));\n\n this.hasNested = this.$element.find('[data-equalizer]').length > 0;\n this.isNested = this.$element.parentsUntil(document.body, '[data-equalizer]').length > 0;\n this.isOn = false;\n this._bindHandler = {\n onResizeMeBound: this._onResizeMe.bind(this),\n onPostEqualizedBound: this._onPostEqualized.bind(this)\n };\n\n var imgs = this.$element.find('img');\n var tooSmall;\n if(this.options.equalizeOn){\n tooSmall = this._checkMQ();\n $(window).on('changed.zf.mediaquery', this._checkMQ.bind(this));\n }else{\n this._events();\n }\n if((typeof tooSmall !== 'undefined' && tooSmall === false) || typeof tooSmall === 'undefined'){\n if(imgs.length){\n onImagesLoaded(imgs, this._reflow.bind(this));\n }else{\n this._reflow();\n }\n }\n }\n\n /**\n * Removes event listeners if the breakpoint is too small.\n * @private\n */\n _pauseEvents() {\n this.isOn = false;\n this.$element.off({\n '.zf.equalizer': this._bindHandler.onPostEqualizedBound,\n 'resizeme.zf.trigger': this._bindHandler.onResizeMeBound,\n\t 'mutateme.zf.trigger': this._bindHandler.onResizeMeBound\n });\n }\n\n /**\n * function to handle $elements resizeme.zf.trigger, with bound this on _bindHandler.onResizeMeBound\n * @private\n */\n _onResizeMe(e) {\n this._reflow();\n }\n\n /**\n * function to handle $elements postequalized.zf.equalizer, with bound this on _bindHandler.onPostEqualizedBound\n * @private\n */\n _onPostEqualized(e) {\n if(e.target !== this.$element[0]){ this._reflow(); }\n }\n\n /**\n * Initializes events for Equalizer.\n * @private\n */\n _events() {\n var _this = this;\n this._pauseEvents();\n if(this.hasNested){\n this.$element.on('postequalized.zf.equalizer', this._bindHandler.onPostEqualizedBound);\n }else{\n this.$element.on('resizeme.zf.trigger', this._bindHandler.onResizeMeBound);\n\t this.$element.on('mutateme.zf.trigger', this._bindHandler.onResizeMeBound);\n }\n this.isOn = true;\n }\n\n /**\n * Checks the current breakpoint to the minimum required size.\n * @private\n */\n _checkMQ() {\n var tooSmall = !MediaQuery.is(this.options.equalizeOn);\n if(tooSmall){\n if(this.isOn){\n this._pauseEvents();\n this.$watched.css('height', 'auto');\n }\n }else{\n if(!this.isOn){\n this._events();\n }\n }\n return tooSmall;\n }\n\n /**\n * A noop version for the plugin\n * @private\n */\n _killswitch() {\n return;\n }\n\n /**\n * Calls necessary functions to update Equalizer upon DOM change\n * @private\n */\n _reflow() {\n if(!this.options.equalizeOnStack){\n if(this._isStacked()){\n this.$watched.css('height', 'auto');\n return false;\n }\n }\n if (this.options.equalizeByRow) {\n this.getHeightsByRow(this.applyHeightByRow.bind(this));\n }else{\n this.getHeights(this.applyHeight.bind(this));\n }\n }\n\n /**\n * Manually determines if the first 2 elements are *NOT* stacked.\n * @private\n */\n _isStacked() {\n if (!this.$watched[0] || !this.$watched[1]) {\n return true;\n }\n return this.$watched[0].getBoundingClientRect().top !== this.$watched[1].getBoundingClientRect().top;\n }\n\n /**\n * Finds the outer heights of children contained within an Equalizer parent and returns them in an array\n * @param {Function} cb - A non-optional callback to return the heights array to.\n * @returns {Array} heights - An array of heights of children within Equalizer container\n */\n getHeights(cb) {\n var heights = [];\n for(var i = 0, len = this.$watched.length; i < len; i++){\n this.$watched[i].style.height = 'auto';\n heights.push(this.$watched[i].offsetHeight);\n }\n cb(heights);\n }\n\n /**\n * Finds the outer heights of children contained within an Equalizer parent and returns them in an array\n * @param {Function} cb - A non-optional callback to return the heights array to.\n * @returns {Array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child\n */\n getHeightsByRow(cb) {\n var lastElTopOffset = (this.$watched.length ? this.$watched.first().offset().top : 0),\n groups = [],\n group = 0;\n //group by Row\n groups[group] = [];\n for(var i = 0, len = this.$watched.length; i < len; i++){\n this.$watched[i].style.height = 'auto';\n //maybe could use this.$watched[i].offsetTop\n var elOffsetTop = $(this.$watched[i]).offset().top;\n if (elOffsetTop!=lastElTopOffset) {\n group++;\n groups[group] = [];\n lastElTopOffset=elOffsetTop;\n }\n groups[group].push([this.$watched[i],this.$watched[i].offsetHeight]);\n }\n\n for (var j = 0, ln = groups.length; j < ln; j++) {\n var heights = $(groups[j]).map(function(){ return this[1]; }).get();\n var max = Math.max.apply(null, heights);\n groups[j].push(max);\n }\n cb(groups);\n }\n\n /**\n * Changes the CSS height property of each child in an Equalizer parent to match the tallest\n * @param {array} heights - An array of heights of children within Equalizer container\n * @fires Equalizer#preequalized\n * @fires Equalizer#postequalized\n */\n applyHeight(heights) {\n var max = Math.max.apply(null, heights);\n /**\n * Fires before the heights are applied\n * @event Equalizer#preequalized\n */\n this.$element.trigger('preequalized.zf.equalizer');\n\n this.$watched.css('height', max);\n\n /**\n * Fires when the heights have been applied\n * @event Equalizer#postequalized\n */\n this.$element.trigger('postequalized.zf.equalizer');\n }\n\n /**\n * Changes the CSS height property of each child in an Equalizer parent to match the tallest by row\n * @param {array} groups - An array of heights of children within Equalizer container grouped by row with element,height and max as last child\n * @fires Equalizer#preequalized\n * @fires Equalizer#preequalizedrow\n * @fires Equalizer#postequalizedrow\n * @fires Equalizer#postequalized\n */\n applyHeightByRow(groups) {\n /**\n * Fires before the heights are applied\n */\n this.$element.trigger('preequalized.zf.equalizer');\n for (var i = 0, len = groups.length; i < len ; i++) {\n var groupsILength = groups[i].length,\n max = groups[i][groupsILength - 1];\n if (groupsILength<=2) {\n $(groups[i][0][0]).css({'height':'auto'});\n continue;\n }\n /**\n * Fires before the heights per row are applied\n * @event Equalizer#preequalizedrow\n */\n this.$element.trigger('preequalizedrow.zf.equalizer');\n for (var j = 0, lenJ = (groupsILength-1); j < lenJ ; j++) {\n $(groups[i][j][0]).css({'height':max});\n }\n /**\n * Fires when the heights per row have been applied\n * @event Equalizer#postequalizedrow\n */\n this.$element.trigger('postequalizedrow.zf.equalizer');\n }\n /**\n * Fires when the heights have been applied\n */\n this.$element.trigger('postequalized.zf.equalizer');\n }\n\n /**\n * Destroys an instance of Equalizer.\n * @function\n */\n _destroy() {\n this._pauseEvents();\n this.$watched.css('height', 'auto');\n }\n}\n\n/**\n * Default settings for plugin\n */\nEqualizer.defaults = {\n /**\n * Enable height equalization when stacked on smaller screens.\n * @option\n * @type {boolean}\n * @default false\n */\n equalizeOnStack: false,\n /**\n * Enable height equalization row by row.\n * @option\n * @type {boolean}\n * @default false\n */\n equalizeByRow: false,\n /**\n * String representing the minimum breakpoint size the plugin should equalize heights on.\n * @option\n * @type {string}\n * @default ''\n */\n equalizeOn: ''\n};\n\nexport {Equalizer};\n","'use strict';\n\nimport $ from 'jquery';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Plugin } from './foundation.core.plugin';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Triggers } from './foundation.util.triggers';\n\n/**\n * Interchange module.\n * @module foundation.interchange\n * @requires foundation.util.mediaQuery\n */\n\nclass Interchange extends Plugin {\n /**\n * Creates a new instance of Interchange.\n * @class\n * @name Interchange\n * @fires Interchange#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Interchange.defaults, this.$element.data(), options);\n this.rules = [];\n this.currentPath = '';\n this.className = 'Interchange'; // ie9 back compat\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n \n this._init();\n this._events();\n }\n\n /**\n * Initializes the Interchange plugin and calls functions to get interchange functioning on load.\n * @function\n * @private\n */\n _init() {\n MediaQuery._init();\n\n var id = this.$element[0].id || GetYoDigits(6, 'interchange');\n this.$element.attr({\n 'data-resize': id,\n 'id': id\n });\n\n this._parseOptions();\n this._addBreakpoints();\n this._generateRules();\n this._reflow();\n }\n\n /**\n * Initializes events for Interchange.\n * @function\n * @private\n */\n _events() {\n this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', () => this._reflow());\n }\n\n /**\n * Calls necessary functions to update Interchange upon DOM change\n * @function\n * @private\n */\n _reflow() {\n var match;\n\n // Iterate through each rule, but only save the last match\n for (var i in this.rules) {\n if(this.rules.hasOwnProperty(i)) {\n var rule = this.rules[i];\n if (window.matchMedia(rule.query).matches) {\n match = rule;\n }\n }\n }\n\n if (match) {\n this.replace(match.path);\n }\n }\n\n /**\n * Check options valifity and set defaults for:\n * - `data-interchange-type`: if set, enforce the type of replacement (auto, src, background or html)\n * @function\n * @private\n */\n _parseOptions() {\n var types = ['auto', 'src', 'background', 'html'];\n if (typeof this.options.type === 'undefined')\n this.options.type = 'auto';\n else if (types.indexOf(this.options.type) === -1) {\n console.log(`Warning: invalid value \"${this.options.type}\" for Interchange option \"type\"`);\n this.options.type = 'auto';\n }\n }\n\n /**\n * Gets the Foundation breakpoints and adds them to the Interchange.SPECIAL_QUERIES object.\n * @function\n * @private\n */\n _addBreakpoints() {\n for (var i in MediaQuery.queries) {\n if (MediaQuery.queries.hasOwnProperty(i)) {\n var query = MediaQuery.queries[i];\n Interchange.SPECIAL_QUERIES[query.name] = query.value;\n }\n }\n }\n\n /**\n * Checks the Interchange element for the provided media query + content pairings\n * @function\n * @private\n * @param {Object} element - jQuery object that is an Interchange instance\n * @returns {Array} scenarios - Array of objects that have 'mq' and 'path' keys with corresponding keys\n */\n _generateRules(element) {\n var rulesList = [];\n var rules;\n\n if (this.options.rules) {\n rules = this.options.rules;\n }\n else {\n rules = this.$element.data('interchange');\n }\n\n rules = typeof rules === 'string' ? rules.match(/\\[.*?, .*?\\]/g) : rules;\n\n for (var i in rules) {\n if(rules.hasOwnProperty(i)) {\n var rule = rules[i].slice(1, -1).split(', ');\n var path = rule.slice(0, -1).join('');\n var query = rule[rule.length - 1];\n\n if (Interchange.SPECIAL_QUERIES[query]) {\n query = Interchange.SPECIAL_QUERIES[query];\n }\n\n rulesList.push({\n path: path,\n query: query\n });\n }\n }\n\n this.rules = rulesList;\n }\n\n /**\n * Update the `src` property of an image, or change the HTML of a container, to the specified path.\n * @function\n * @param {String} path - Path to the image or HTML partial.\n * @fires Interchange#replaced\n */\n replace(path) {\n if (this.currentPath === path) return;\n\n var trigger = 'replaced.zf.interchange';\n\n var type = this.options.type;\n if (type === 'auto') {\n if (this.$element[0].nodeName === 'IMG')\n type = 'src';\n else if (path.match(/\\.(gif|jpe?g|png|svg|tiff)([?#].*)?/i))\n type = 'background';\n else\n type = 'html';\n }\n\n // Replacing images\n if (type === 'src') {\n this.$element.attr('src', path)\n .on('load', () => { this.currentPath = path; })\n .trigger(trigger);\n }\n // Replacing background images\n else if (type === 'background') {\n path = path.replace(/\\(/g, '%28').replace(/\\)/g, '%29');\n this.$element\n .css({ 'background-image': 'url(' + path + ')' })\n .trigger(trigger);\n }\n // Replacing HTML\n else if (type === 'html') {\n $.get(path, (response) => {\n this.$element\n .html(response)\n .trigger(trigger);\n $(response).foundation();\n this.currentPath = path;\n });\n }\n\n /**\n * Fires when content in an Interchange element is done being loaded.\n * @event Interchange#replaced\n */\n // this.$element.trigger('replaced.zf.interchange');\n }\n\n /**\n * Destroys an instance of interchange.\n * @function\n */\n _destroy() {\n this.$element.off('resizeme.zf.trigger')\n }\n}\n\n/**\n * Default settings for plugin\n */\nInterchange.defaults = {\n /**\n * Rules to be applied to Interchange elements. Set with the `data-interchange` array notation.\n * @option\n * @type {?array}\n * @default null\n */\n rules: null,\n\n /**\n * Type of the responsive ressource to replace. It can take the following options:\n * - `auto` (default): choose the type according to the element tag or the ressource extension,\n * - `src`: replace the `[src]` attribute, recommended for images `<img>`.\n * - `background`: replace the `background-image` CSS property.\n * - `html`: replace the element content.\n * @option\n * @type {string}\n * @default 'auto'\n */\n type: 'auto'\n};\n\nInterchange.SPECIAL_QUERIES = {\n 'landscape': 'screen and (orientation: landscape)',\n 'portrait': 'screen and (orientation: portrait)',\n 'retina': 'only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx)'\n};\n\nexport {Interchange};\n","'use strict';\n\n\nimport $ from 'jquery';\nimport { Plugin } from './foundation.core.plugin';\nimport { onLoad, GetYoDigits } from './foundation.core.utils';\nimport { SmoothScroll } from './foundation.smoothScroll';\n\nimport { Triggers } from './foundation.util.triggers';\n\n/**\n * Magellan module.\n * @module foundation.magellan\n * @requires foundation.smoothScroll\n * @requires foundation.util.triggers\n */\n\nclass Magellan extends Plugin {\n /**\n * Creates a new instance of Magellan.\n * @class\n * @name Magellan\n * @fires Magellan#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Magellan.defaults, this.$element.data(), options);\n this.className = 'Magellan'; // ie9 back compat\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n\n this._init();\n this.calcPoints();\n }\n\n /**\n * Initializes the Magellan plugin and calls functions to get equalizer functioning on load.\n * @private\n */\n _init() {\n var id = this.$element[0].id || GetYoDigits(6, 'magellan');\n var _this = this;\n this.$targets = $('[data-magellan-target]');\n this.$links = this.$element.find('a');\n this.$element.attr({\n 'data-resize': id,\n 'data-scroll': id,\n 'id': id\n });\n this.$active = $();\n this.scrollPos = parseInt(window.pageYOffset, 10);\n\n this._events();\n }\n\n /**\n * Calculates an array of pixel values that are the demarcation lines between locations on the page.\n * Can be invoked if new elements are added or the size of a location changes.\n * @function\n */\n calcPoints() {\n var _this = this,\n body = document.body,\n html = document.documentElement;\n\n this.points = [];\n this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight));\n this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight));\n\n this.$targets.each(function(){\n var $tar = $(this),\n pt = Math.round($tar.offset().top - _this.options.threshold);\n $tar.targetPoint = pt;\n _this.points.push(pt);\n });\n }\n\n /**\n * Initializes events for Magellan.\n * @private\n */\n _events() {\n var _this = this;\n\n $(window).one('load', function(){\n if(_this.options.deepLinking){\n if(location.hash){\n _this.scrollToLoc(location.hash);\n }\n }\n _this.calcPoints();\n _this._updateActive();\n });\n\n _this.onLoadListener = onLoad($(window), function () {\n _this.$element\n .on({\n 'resizeme.zf.trigger': _this.reflow.bind(_this),\n 'scrollme.zf.trigger': _this._updateActive.bind(_this)\n })\n .on('click.zf.magellan', 'a[href^=\"#\"]', function (e) {\n e.preventDefault();\n var arrival = this.getAttribute('href');\n _this.scrollToLoc(arrival);\n });\n });\n\n this._deepLinkScroll = function(e) {\n if(_this.options.deepLinking) {\n _this.scrollToLoc(window.location.hash);\n }\n };\n\n $(window).on('hashchange', this._deepLinkScroll);\n }\n\n /**\n * Function to scroll to a given location on the page.\n * @param {String} loc - a properly formatted jQuery id selector. Example: '#foo'\n * @function\n */\n scrollToLoc(loc) {\n this._inTransition = true;\n var _this = this;\n\n var options = {\n animationEasing: this.options.animationEasing,\n animationDuration: this.options.animationDuration,\n threshold: this.options.threshold,\n offset: this.options.offset\n };\n\n SmoothScroll.scrollToLoc(loc, options, function() {\n _this._inTransition = false;\n })\n }\n\n /**\n * Calls necessary functions to update Magellan upon DOM change\n * @function\n */\n reflow() {\n this.calcPoints();\n this._updateActive();\n }\n\n /**\n * Updates the visibility of an active location link, and updates the url hash for the page, if deepLinking enabled.\n * @private\n * @function\n * @fires Magellan#update\n */\n _updateActive(/*evt, elem, scrollPos*/) {\n if(this._inTransition) return;\n\n const newScrollPos = parseInt(window.pageYOffset, 10);\n const isScrollingUp = this.scrollPos > newScrollPos;\n this.scrollPos = newScrollPos;\n\n let activeIdx;\n // Before the first point: no link\n if(newScrollPos < this.points[0]){ /* do nothing */ }\n // At the bottom of the page: last link\n else if(newScrollPos + this.winHeight === this.docHeight){ activeIdx = this.points.length - 1; }\n // Otherwhise, use the last visible link\n else{\n const visibleLinks = this.points.filter((p, i) => {\n return (p - this.options.offset - (isScrollingUp ? this.options.threshold : 0)) <= newScrollPos;\n });\n activeIdx = visibleLinks.length ? visibleLinks.length - 1 : 0;\n }\n\n // Get the new active link\n const $oldActive = this.$active;\n let activeHash = '';\n if(typeof activeIdx !== 'undefined'){\n this.$active = this.$links.filter('[href=\"#' + this.$targets.eq(activeIdx).data('magellan-target') + '\"]');\n if (this.$active.length) activeHash = this.$active[0].getAttribute('href');\n }else{\n this.$active = $();\n }\n const isNewActive = !(!this.$active.length && !$oldActive.length) && !this.$active.is($oldActive);\n const isNewHash = activeHash !== window.location.hash;\n\n // Update the active link element\n if(isNewActive) {\n $oldActive.removeClass(this.options.activeClass);\n this.$active.addClass(this.options.activeClass);\n }\n\n // Update the hash (it may have changed with the same active link)\n if(this.options.deepLinking && isNewHash){\n if(window.history.pushState){\n // Set or remove the hash (see: https://stackoverflow.com/a/5298684/4317384\n const url = activeHash ? activeHash : window.location.pathname + window.location.search;\n if(this.options.updateHistory){\n window.history.pushState({}, '', url);\n }else{\n window.history.replaceState({}, '', url);\n }\n }else{\n window.location.hash = activeHash;\n }\n }\n\n if (isNewActive) {\n /**\n * Fires when magellan is finished updating to the new active element.\n * @event Magellan#update\n */\n \tthis.$element.trigger('update.zf.magellan', [this.$active]);\n\t }\n }\n\n /**\n * Destroys an instance of Magellan and resets the url of the window.\n * @function\n */\n _destroy() {\n this.$element.off('.zf.trigger .zf.magellan')\n .find(`.${this.options.activeClass}`).removeClass(this.options.activeClass);\n\n if(this.options.deepLinking){\n var hash = this.$active[0].getAttribute('href');\n window.location.hash.replace(hash, '');\n }\n\n $(window).off('hashchange', this._deepLinkScroll)\n if (this.onLoadListener) $(window).off(this.onLoadListener);\n }\n}\n\n/**\n * Default settings for plugin\n */\nMagellan.defaults = {\n /**\n * Amount of time, in ms, the animated scrolling should take between locations.\n * @option\n * @type {number}\n * @default 500\n */\n animationDuration: 500,\n /**\n * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.\n * @option\n * @type {string}\n * @default 'linear'\n * @see {@link https://api.jquery.com/animate|Jquery animate}\n */\n animationEasing: 'linear',\n /**\n * Number of pixels to use as a marker for location changes.\n * @option\n * @type {number}\n * @default 50\n */\n threshold: 50,\n /**\n * Class applied to the active locations link on the magellan container.\n * @option\n * @type {string}\n * @default 'is-active'\n */\n activeClass: 'is-active',\n /**\n * Allows the script to manipulate the url of the current page, and if supported, alter the history.\n * @option\n * @type {boolean}\n * @default false\n */\n deepLinking: false,\n /**\n * Update the browser history with the active link, if deep linking is enabled.\n * @option\n * @type {boolean}\n * @default false\n */\n updateHistory: false,\n /**\n * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.\n * @option\n * @type {number}\n * @default 0\n */\n offset: 0\n}\n\nexport {Magellan};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Plugin } from './foundation.core.plugin';\nimport { onLoad, transitionend, RegExpEscape } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { MediaQuery } from './foundation.util.mediaQuery';\n\nimport { Triggers } from './foundation.util.triggers';\n\n/**\n * OffCanvas module.\n * @module foundation.offCanvas\n * @requires foundation.util.keyboard\n * @requires foundation.util.mediaQuery\n * @requires foundation.util.triggers\n */\n\nclass OffCanvas extends Plugin {\n /**\n * Creates a new instance of an off-canvas wrapper.\n * @class\n * @name OffCanvas\n * @fires OffCanvas#init\n * @param {Object} element - jQuery object to initialize.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.className = 'OffCanvas'; // ie9 back compat\n this.$element = element;\n this.options = $.extend({}, OffCanvas.defaults, this.$element.data(), options);\n this.contentClasses = { base: [], reveal: [] };\n this.$lastTrigger = $();\n this.$triggers = $();\n this.position = 'left';\n this.$content = $();\n this.nested = !!(this.options.nested);\n this.$sticky = $();\n this.isInCanvas = false;\n\n // Defines the CSS transition/position classes of the off-canvas content container.\n $(['push', 'overlap']).each((index, val) => {\n this.contentClasses.base.push('has-transition-'+val);\n });\n $(['left', 'right', 'top', 'bottom']).each((index, val) => {\n this.contentClasses.base.push('has-position-'+val);\n this.contentClasses.reveal.push('has-reveal-'+val);\n });\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n MediaQuery._init();\n\n this._init();\n this._events();\n\n Keyboard.register('OffCanvas', {\n 'ESCAPE': 'close'\n });\n\n }\n\n /**\n * Initializes the off-canvas wrapper by adding the exit overlay (if needed).\n * @function\n * @private\n */\n _init() {\n var id = this.$element.attr('id');\n\n this.$element.attr('aria-hidden', 'true');\n\n // Find off-canvas content, either by ID (if specified), by siblings or by closest selector (fallback)\n if (this.options.contentId) {\n this.$content = $('#'+this.options.contentId);\n } else if (this.$element.siblings('[data-off-canvas-content]').length) {\n this.$content = this.$element.siblings('[data-off-canvas-content]').first();\n } else {\n this.$content = this.$element.closest('[data-off-canvas-content]').first();\n }\n\n if (!this.options.contentId) {\n // Assume that the off-canvas element is nested if it isn't a sibling of the content\n this.nested = this.$element.siblings('[data-off-canvas-content]').length === 0;\n\n } else if (this.options.contentId && this.options.nested === null) {\n // Warning if using content ID without setting the nested option\n // Once the element is nested it is required to work properly in this case\n console.warn('Remember to use the nested option if using the content ID option!');\n }\n\n if (this.nested === true) {\n // Force transition overlap if nested\n this.options.transition = 'overlap';\n // Remove appropriate classes if already assigned in markup\n this.$element.removeClass('is-transition-push');\n }\n\n this.$element.addClass(`is-transition-${this.options.transition} is-closed`);\n\n // Find triggers that affect this element and add aria-expanded to them\n this.$triggers = $(document)\n .find('[data-open=\"'+id+'\"], [data-close=\"'+id+'\"], [data-toggle=\"'+id+'\"]')\n .attr('aria-expanded', 'false')\n .attr('aria-controls', id);\n\n // Get position by checking for related CSS class\n this.position = this.$element.is('.position-left, .position-top, .position-right, .position-bottom') ? this.$element.attr('class').match(/position\\-(left|top|right|bottom)/)[1] : this.position;\n\n // Add an overlay over the content if necessary\n if (this.options.contentOverlay === true) {\n var overlay = document.createElement('div');\n var overlayPosition = $(this.$element).css(\"position\") === 'fixed' ? 'is-overlay-fixed' : 'is-overlay-absolute';\n overlay.setAttribute('class', 'js-off-canvas-overlay ' + overlayPosition);\n this.$overlay = $(overlay);\n if(overlayPosition === 'is-overlay-fixed') {\n $(this.$overlay).insertAfter(this.$element);\n } else {\n this.$content.append(this.$overlay);\n }\n }\n\n // Get the revealOn option from the class.\n var revealOnRegExp = new RegExp(RegExpEscape(this.options.revealClass) + '([^\\\\s]+)', 'g');\n var revealOnClass = revealOnRegExp.exec(this.$element[0].className);\n if (revealOnClass) {\n this.options.isRevealed = true;\n this.options.revealOn = this.options.revealOn || revealOnClass[1];\n }\n\n // Ensure the `reveal-on-*` class is set.\n if (this.options.isRevealed === true && this.options.revealOn) {\n this.$element.first().addClass(`${this.options.revealClass}${this.options.revealOn}`);\n this._setMQChecker();\n }\n\n if (this.options.transitionTime) {\n this.$element.css('transition-duration', this.options.transitionTime);\n }\n\n // Find fixed elements that should stay fixed while off-canvas is opened\n this.$sticky = this.$content.find('[data-off-canvas-sticky]');\n if (this.$sticky.length > 0 && this.options.transition === 'push') {\n // If there's at least one match force contentScroll:false because the absolute top value doesn't get recalculated on scroll\n // Limit to push transition since there's no transform scope for overlap\n this.options.contentScroll = false;\n }\n\n let inCanvasFor = this.$element.attr('class').match(/\\bin-canvas-for-(\\w+)/);\n if (inCanvasFor && inCanvasFor.length === 2) {\n // Set `inCanvasOn` option if found in-canvas-for-[BREAKPONT] CSS class\n this.options.inCanvasOn = inCanvasFor[1];\n } else if (this.options.inCanvasOn) {\n // Ensure the CSS class is set\n this.$element.addClass(`in-canvas-for-${this.options.inCanvasOn}`);\n }\n\n if (this.options.inCanvasOn) {\n this._checkInCanvas();\n }\n\n // Initally remove all transition/position CSS classes from off-canvas content container.\n this._removeContentClasses();\n }\n\n /**\n * Adds event handlers to the off-canvas wrapper and the exit overlay.\n * @function\n * @private\n */\n _events() {\n this.$element.off('.zf.trigger .zf.offCanvas').on({\n 'open.zf.trigger': this.open.bind(this),\n 'close.zf.trigger': this.close.bind(this),\n 'toggle.zf.trigger': this.toggle.bind(this),\n 'keydown.zf.offCanvas': this._handleKeyboard.bind(this)\n });\n\n if (this.options.closeOnClick === true) {\n var $target = this.options.contentOverlay ? this.$overlay : this.$content;\n $target.on({'click.zf.offCanvas': this.close.bind(this)});\n }\n\n if (this.options.inCanvasOn) {\n $(window).on('changed.zf.mediaquery', () => {\n this._checkInCanvas();\n });\n }\n\n }\n\n /**\n * Applies event listener for elements that will reveal at certain breakpoints.\n * @private\n */\n _setMQChecker() {\n var _this = this;\n\n this.onLoadListener = onLoad($(window), function () {\n if (MediaQuery.atLeast(_this.options.revealOn)) {\n _this.reveal(true);\n }\n });\n\n $(window).on('changed.zf.mediaquery', function () {\n if (MediaQuery.atLeast(_this.options.revealOn)) {\n _this.reveal(true);\n } else {\n _this.reveal(false);\n }\n });\n }\n\n /**\n * Checks if InCanvas on current breakpoint and adjust off-canvas accordingly\n * @private\n */\n _checkInCanvas() {\n this.isInCanvas = MediaQuery.atLeast(this.options.inCanvasOn);\n if (this.isInCanvas === true) {\n this.close();\n }\n }\n\n /**\n * Removes the CSS transition/position classes of the off-canvas content container.\n * Removing the classes is important when another off-canvas gets opened that uses the same content container.\n * @param {Boolean} hasReveal - true if related off-canvas element is revealed.\n * @private\n */\n _removeContentClasses(hasReveal) {\n if (typeof hasReveal !== 'boolean') {\n this.$content.removeClass(this.contentClasses.base.join(' '));\n } else if (hasReveal === false) {\n this.$content.removeClass(`has-reveal-${this.position}`);\n }\n }\n\n /**\n * Adds the CSS transition/position classes of the off-canvas content container, based on the opening off-canvas element.\n * Beforehand any transition/position class gets removed.\n * @param {Boolean} hasReveal - true if related off-canvas element is revealed.\n * @private\n */\n _addContentClasses(hasReveal) {\n this._removeContentClasses(hasReveal);\n if (typeof hasReveal !== 'boolean') {\n this.$content.addClass(`has-transition-${this.options.transition} has-position-${this.position}`);\n } else if (hasReveal === true) {\n this.$content.addClass(`has-reveal-${this.position}`);\n }\n }\n\n /**\n * Preserves the fixed behavior of sticky elements on opening an off-canvas with push transition.\n * Since the off-canvas container has got a transform scope in such a case, it is done by calculating position absolute values.\n * @private\n */\n _fixStickyElements() {\n this.$sticky.each((_, el) => {\n const $el = $(el);\n\n // If sticky element is currently fixed, adjust its top value to match absolute position due to transform scope\n // Limit to push transition because postion:fixed works without problems for overlap (no transform scope)\n if ($el.css('position') === 'fixed') {\n\n // Save current inline styling to restore it if undoing the absolute fixing\n let topVal = parseInt($el.css('top'), 10);\n $el.data('offCanvasSticky', { top: topVal });\n\n let absoluteTopVal = $(document).scrollTop() + topVal;\n $el.css({ top: `${absoluteTopVal}px`, width: '100%', transition: 'none' });\n }\n });\n }\n\n /**\n * Restores the original fixed styling of sticky elements after having closed an off-canvas that got pseudo fixed beforehand.\n * This reverts the changes of _fixStickyElements()\n * @private\n */\n _unfixStickyElements() {\n this.$sticky.each((_, el) => {\n const $el = $(el);\n let stickyData = $el.data('offCanvasSticky');\n\n // If sticky element has got data object with prior values (meaning it was originally fixed) restore these values once off-canvas is closed\n if (typeof stickyData === 'object') {\n $el.css({ top: `${stickyData.top}px`, width: '', transition: '' })\n $el.data('offCanvasSticky', '');\n }\n });\n }\n\n /**\n * Handles the revealing/hiding the off-canvas at breakpoints, not the same as open.\n * @param {Boolean} isRevealed - true if element should be revealed.\n * @function\n */\n reveal(isRevealed) {\n if (isRevealed) {\n this.close();\n this.isRevealed = true;\n this.$element.attr('aria-hidden', 'false');\n this.$element.off('open.zf.trigger toggle.zf.trigger');\n this.$element.removeClass('is-closed');\n } else {\n this.isRevealed = false;\n this.$element.attr('aria-hidden', 'true');\n this.$element.off('open.zf.trigger toggle.zf.trigger').on({\n 'open.zf.trigger': this.open.bind(this),\n 'toggle.zf.trigger': this.toggle.bind(this)\n });\n this.$element.addClass('is-closed');\n }\n this._addContentClasses(isRevealed);\n }\n\n /**\n * Stops scrolling of the body when OffCanvas is open on mobile Safari and other troublesome browsers.\n * @function\n * @private\n */\n _stopScrolling(event) {\n return false;\n }\n\n /**\n * Tag the element given as context whether it can be scrolled up and down.\n * Used to allow or prevent it to scroll. See `_stopScrollPropagation`.\n *\n * Taken and adapted from http://stackoverflow.com/questions/16889447/prevent-full-page-scrolling-ios\n * Only really works for y, not sure how to extend to x or if we need to.\n *\n * @function\n * @private\n */\n _recordScrollable(event) {\n let elem = this; // called from event handler context with this as elem\n\n // If the element is scrollable (content overflows), then...\n if (elem.scrollHeight !== elem.clientHeight) {\n // If we're at the top, scroll down one pixel to allow scrolling up\n if (elem.scrollTop === 0) {\n elem.scrollTop = 1;\n }\n // If we're at the bottom, scroll up one pixel to allow scrolling down\n if (elem.scrollTop === elem.scrollHeight - elem.clientHeight) {\n elem.scrollTop = elem.scrollHeight - elem.clientHeight - 1;\n }\n }\n elem.allowUp = elem.scrollTop > 0;\n elem.allowDown = elem.scrollTop < (elem.scrollHeight - elem.clientHeight);\n elem.lastY = event.originalEvent.pageY;\n }\n\n /**\n * Prevent the given event propagation if the element given as context can scroll.\n * Used to preserve the element scrolling on mobile (`touchmove`) when the document\n * scrolling is prevented. See https://git.io/zf-9707.\n * @function\n * @private\n */\n _stopScrollPropagation(event) {\n let elem = this; // called from event handler context with this as elem\n let parent; // off-canvas elem if called from inner scrollbox\n let up = event.pageY < elem.lastY;\n let down = !up;\n elem.lastY = event.pageY;\n\n if((up && elem.allowUp) || (down && elem.allowDown)) {\n // It is not recommended to stop event propagation (the user cannot watch it),\n // but in this case this is the only solution we have.\n event.stopPropagation();\n\n // If elem is inner scrollbox we are scrolling the outer off-canvas down/up once the box end has been reached\n // This lets the user continue to touch move the off-canvas without the need to place the finger outside the scrollbox\n if (elem.hasAttribute('data-off-canvas-scrollbox')) {\n parent = elem.closest('[data-off-canvas], [data-off-canvas-scrollbox-outer]');\n if (elem.scrollTop <= 1 && parent.scrollTop > 0) {\n parent.scrollTop--;\n } else if (elem.scrollTop >= elem.scrollHeight - elem.clientHeight - 1 && parent.scrollTop < parent.scrollHeight - parent.clientHeight) {\n parent.scrollTop++;\n }\n }\n\n } else {\n event.preventDefault();\n }\n }\n\n /**\n * Opens the off-canvas menu.\n * @function\n * @param {Object} event - Event object passed from listener.\n * @param {jQuery} trigger - element that triggered the off-canvas to open.\n * @fires OffCanvas#opened\n * @todo also trigger 'open' event?\n */\n open(event, trigger) {\n if (this.$element.hasClass('is-open') || this.isRevealed || this.isInCanvas) { return; }\n var _this = this;\n\n if (trigger) {\n this.$lastTrigger = trigger;\n }\n\n if (this.options.forceTo === 'top') {\n window.scrollTo(0, 0);\n } else if (this.options.forceTo === 'bottom') {\n window.scrollTo(0,document.body.scrollHeight);\n }\n\n if (this.options.transitionTime && this.options.transition !== 'overlap') {\n this.$element.siblings('[data-off-canvas-content]').css('transition-duration', this.options.transitionTime);\n } else {\n this.$element.siblings('[data-off-canvas-content]').css('transition-duration', '');\n }\n\n this.$element.addClass('is-open').removeClass('is-closed');\n\n this.$triggers.attr('aria-expanded', 'true');\n this.$element.attr('aria-hidden', 'false');\n\n this.$content.addClass('is-open-' + this.position);\n\n // If `contentScroll` is set to false, add class and disable scrolling on touch devices.\n if (this.options.contentScroll === false) {\n $('body').addClass('is-off-canvas-open').on('touchmove', this._stopScrolling);\n this.$element.on('touchstart', this._recordScrollable);\n this.$element.on('touchmove', this._stopScrollPropagation);\n this.$element.on('touchstart', '[data-off-canvas-scrollbox]', this._recordScrollable);\n this.$element.on('touchmove', '[data-off-canvas-scrollbox]', this._stopScrollPropagation);\n }\n\n if (this.options.contentOverlay === true) {\n this.$overlay.addClass('is-visible');\n }\n\n if (this.options.closeOnClick === true && this.options.contentOverlay === true) {\n this.$overlay.addClass('is-closable');\n }\n\n if (this.options.autoFocus === true) {\n this.$element.one(transitionend(this.$element), function() {\n if (!_this.$element.hasClass('is-open')) {\n return; // exit if prematurely closed\n }\n var canvasFocus = _this.$element.find('[data-autofocus]');\n if (canvasFocus.length) {\n canvasFocus.eq(0).focus();\n } else {\n _this.$element.find('a, button').eq(0).focus();\n }\n });\n }\n\n if (this.options.trapFocus === true) {\n this.$content.attr('tabindex', '-1');\n Keyboard.trapFocus(this.$element);\n }\n\n if (this.options.transition === 'push') {\n this._fixStickyElements();\n }\n\n this._addContentClasses();\n\n /**\n * Fires when the off-canvas menu opens.\n * @event OffCanvas#opened\n */\n this.$element.trigger('opened.zf.offCanvas');\n\n /**\n * Fires when the off-canvas menu open transition is done.\n * @event OffCanvas#openedEnd\n */\n this.$element.one(transitionend(this.$element), () => {\n this.$element.trigger('openedEnd.zf.offCanvas');\n });\n }\n\n /**\n * Closes the off-canvas menu.\n * @function\n * @param {Function} cb - optional cb to fire after closure.\n * @fires OffCanvas#close\n * @fires OffCanvas#closed\n */\n close(cb) {\n if (!this.$element.hasClass('is-open') || this.isRevealed) { return; }\n\n /**\n * Fires when the off-canvas menu closes.\n * @event OffCanvas#close\n */\n this.$element.trigger('close.zf.offCanvas');\n\n var _this = this;\n\n this.$element.removeClass('is-open');\n\n this.$element.attr('aria-hidden', 'true');\n\n this.$content.removeClass('is-open-left is-open-top is-open-right is-open-bottom');\n\n if (this.options.contentOverlay === true) {\n this.$overlay.removeClass('is-visible');\n }\n\n if (this.options.closeOnClick === true && this.options.contentOverlay === true) {\n this.$overlay.removeClass('is-closable');\n }\n\n this.$triggers.attr('aria-expanded', 'false');\n\n\n // Listen to transitionEnd: add class, re-enable scrolling and release focus when done.\n this.$element.one(transitionend(this.$element), (e) => {\n\n this.$element.addClass('is-closed');\n this._removeContentClasses();\n\n if (this.options.transition === 'push') {\n this._unfixStickyElements();\n }\n\n // If `contentScroll` is set to false, remove class and re-enable scrolling on touch devices.\n if (this.options.contentScroll === false) {\n $('body').removeClass('is-off-canvas-open').off('touchmove', this._stopScrolling);\n this.$element.off('touchstart', this._recordScrollable);\n this.$element.off('touchmove', this._stopScrollPropagation);\n this.$element.off('touchstart', '[data-off-canvas-scrollbox]', this._recordScrollable);\n this.$element.off('touchmove', '[data-off-canvas-scrollbox]', this._stopScrollPropagation);\n }\n\n if (this.options.trapFocus === true) {\n this.$content.removeAttr('tabindex');\n Keyboard.releaseFocus(this.$element);\n }\n\n /**\n * Fires when the off-canvas menu close transition is done.\n * @event OffCanvas#closed\n */\n this.$element.trigger('closed.zf.offCanvas');\n });\n }\n\n /**\n * Toggles the off-canvas menu open or closed.\n * @function\n * @param {Object} event - Event object passed from listener.\n * @param {jQuery} trigger - element that triggered the off-canvas to open.\n */\n toggle(event, trigger) {\n if (this.$element.hasClass('is-open')) {\n this.close(event, trigger);\n }\n else {\n this.open(event, trigger);\n }\n }\n\n /**\n * Handles keyboard input when detected. When the escape key is pressed, the off-canvas menu closes, and focus is restored to the element that opened the menu.\n * @function\n * @private\n */\n _handleKeyboard(e) {\n Keyboard.handleKey(e, 'OffCanvas', {\n close: () => {\n this.close();\n this.$lastTrigger.focus();\n return true;\n },\n handled: () => {\n e.preventDefault();\n }\n });\n }\n\n /**\n * Destroys the OffCanvas plugin.\n * @function\n */\n _destroy() {\n this.close();\n this.$element.off('.zf.trigger .zf.offCanvas');\n this.$overlay.off('.zf.offCanvas');\n if (this.onLoadListener) $(window).off(this.onLoadListener);\n }\n}\n\nOffCanvas.defaults = {\n /**\n * Allow the user to click outside of the menu to close it.\n * @option\n * @type {boolean}\n * @default true\n */\n closeOnClick: true,\n\n /**\n * Adds an overlay on top of `[data-off-canvas-content]`.\n * @option\n * @type {boolean}\n * @default true\n */\n contentOverlay: true,\n\n /**\n * Target an off-canvas content container by ID that may be placed anywhere. If null the closest content container will be taken.\n * @option\n * @type {?string}\n * @default null\n */\n contentId: null,\n\n /**\n * Define the off-canvas element is nested in an off-canvas content. This is required when using the contentId option for a nested element.\n * @option\n * @type {boolean}\n * @default null\n */\n nested: null,\n\n /**\n * Enable/disable scrolling of the main content when an off canvas panel is open.\n * @option\n * @type {boolean}\n * @default true\n */\n contentScroll: true,\n\n /**\n * Amount of time the open and close transition requires, including the appropriate milliseconds (`ms`) or seconds (`s`) unit (e.g. `500ms`, `.75s`) If none selected, pulls from body style.\n * @option\n * @type {string}\n * @default null\n */\n transitionTime: null,\n\n /**\n * Type of transition for the OffCanvas menu. Options are 'push', 'detached' or 'slide'.\n * @option\n * @type {string}\n * @default push\n */\n transition: 'push',\n\n /**\n * Force the page to scroll to top or bottom on open.\n * @option\n * @type {?string}\n * @default null\n */\n forceTo: null,\n\n /**\n * Allow the OffCanvas to remain open for certain breakpoints.\n * @option\n * @type {boolean}\n * @default false\n */\n isRevealed: false,\n\n /**\n * Breakpoint at which to reveal. JS will use a RegExp to target standard classes, if changing classnames, pass your class with the `revealClass` option.\n * @option\n * @type {?string}\n * @default null\n */\n revealOn: null,\n\n /**\n * Breakpoint at which the off-canvas gets moved into canvas content and acts as regular page element.\n * @option\n * @type {?string}\n * @default null\n */\n inCanvasOn: null,\n\n /**\n * Force focus to the offcanvas on open. If true, will focus the opening trigger on close.\n * @option\n * @type {boolean}\n * @default true\n */\n autoFocus: true,\n\n /**\n * Class used to force an OffCanvas to remain open. Foundation defaults for this are `reveal-for-large` & `reveal-for-medium`.\n * @option\n * @type {string}\n * @default reveal-for-\n * @todo improve the regex testing for this.\n */\n revealClass: 'reveal-for-',\n\n /**\n * Triggers optional focus trapping when opening an OffCanvas. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes.\n * @option\n * @type {boolean}\n * @default false\n */\n trapFocus: false\n}\n\nexport {OffCanvas};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { Motion } from './foundation.util.motion';\nimport { Timer } from './foundation.util.timer';\nimport { onImagesLoaded } from './foundation.util.imageLoader';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\nimport { Touch } from './foundation.util.touch'\n\n\n/**\n * Orbit module.\n * @module foundation.orbit\n * @requires foundation.util.keyboard\n * @requires foundation.util.motion\n * @requires foundation.util.timer\n * @requires foundation.util.imageLoader\n * @requires foundation.util.touch\n */\n\nclass Orbit extends Plugin {\n /**\n * Creates a new instance of an orbit carousel.\n * @class\n * @name Orbit\n * @param {jQuery} element - jQuery object to make into an Orbit Carousel.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options){\n this.$element = element;\n this.options = $.extend({}, Orbit.defaults, this.$element.data(), options);\n this.className = 'Orbit'; // ie9 back compat\n\n Touch.init($); // Touch init is idempotent, we just need to make sure it's initialied.\n\n this._init();\n\n Keyboard.register('Orbit', {\n 'ltr': {\n 'ARROW_RIGHT': 'next',\n 'ARROW_LEFT': 'previous'\n },\n 'rtl': {\n 'ARROW_LEFT': 'next',\n 'ARROW_RIGHT': 'previous'\n }\n });\n }\n\n /**\n * Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation.\n * @function\n * @private\n */\n _init() {\n // @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide\n this._reset();\n\n this.$wrapper = this.$element.find(`.${this.options.containerClass}`);\n this.$slides = this.$element.find(`.${this.options.slideClass}`);\n\n var $images = this.$element.find('img'),\n initActive = this.$slides.filter('.is-active'),\n id = this.$element[0].id || GetYoDigits(6, 'orbit');\n\n this.$element.attr({\n 'data-resize': id,\n 'id': id\n });\n\n if (!initActive.length) {\n this.$slides.eq(0).addClass('is-active');\n }\n\n if (!this.options.useMUI) {\n this.$slides.addClass('no-motionui');\n }\n\n if ($images.length) {\n onImagesLoaded($images, this._prepareForOrbit.bind(this));\n } else {\n this._prepareForOrbit();//hehe\n }\n\n if (this.options.bullets) {\n this._loadBullets();\n }\n\n this._events();\n\n if (this.options.autoPlay && this.$slides.length > 1) {\n this.geoSync();\n }\n\n if (this.options.accessible) { // allow wrapper to be focusable to enable arrow navigation\n this.$wrapper.attr('tabindex', 0);\n }\n }\n\n /**\n * Creates a jQuery collection of bullets, if they are being used.\n * @function\n * @private\n */\n _loadBullets() {\n this.$bullets = this.$element.find(`.${this.options.boxOfBullets}`).find('button');\n }\n\n /**\n * Sets a `timer` object on the orbit, and starts the counter for the next slide.\n * @function\n */\n geoSync() {\n var _this = this;\n this.timer = new Timer(\n this.$element,\n {\n duration: this.options.timerDelay,\n infinite: false\n },\n function() {\n _this.changeSlide(true);\n });\n this.timer.start();\n }\n\n /**\n * Sets wrapper and slide heights for the orbit.\n * @function\n * @private\n */\n _prepareForOrbit() {\n var _this = this;\n this._setWrapperHeight();\n }\n\n /**\n * Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height.\n * @function\n * @private\n * @param {Function} cb - a callback function to fire when complete.\n */\n _setWrapperHeight(cb) {//rewrite this to `for` loop\n var max = 0, temp, counter = 0, _this = this;\n\n this.$slides.each(function() {\n temp = this.getBoundingClientRect().height;\n $(this).attr('data-slide', counter);\n\n // hide all slides but the active one\n if (!/mui/g.test($(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) {\n $(this).css({'display': 'none'});\n }\n max = temp > max ? temp : max;\n counter++;\n });\n\n if (counter === this.$slides.length) {\n this.$wrapper.css({'height': max}); //only change the wrapper height property once.\n if(cb) {cb(max);} //fire callback with max height dimension.\n }\n }\n\n /**\n * Sets the max-height of each slide.\n * @function\n * @private\n */\n _setSlideHeight(height) {\n this.$slides.each(function() {\n $(this).css('max-height', height);\n });\n }\n\n /**\n * Adds event listeners to basically everything within the element.\n * @function\n * @private\n */\n _events() {\n var _this = this;\n\n //***************************************\n //**Now using custom event - thanks to:**\n //** Yohai Ararat of Toronto **\n //***************************************\n //\n this.$element.off('.resizeme.zf.trigger').on({\n 'resizeme.zf.trigger': this._prepareForOrbit.bind(this)\n })\n if (this.$slides.length > 1) {\n\n if (this.options.swipe) {\n this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit')\n .on('swipeleft.zf.orbit', function(e){\n e.preventDefault();\n _this.changeSlide(true);\n }).on('swiperight.zf.orbit', function(e){\n e.preventDefault();\n _this.changeSlide(false);\n });\n }\n //***************************************\n\n if (this.options.autoPlay) {\n this.$slides.on('click.zf.orbit', function() {\n _this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true);\n _this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start']();\n });\n\n if (this.options.pauseOnHover) {\n this.$element.on('mouseenter.zf.orbit', function() {\n _this.timer.pause();\n }).on('mouseleave.zf.orbit', function() {\n if (!_this.$element.data('clickedOn')) {\n _this.timer.start();\n }\n });\n }\n }\n\n if (this.options.navButtons) {\n var $controls = this.$element.find(`.${this.options.nextClass}, .${this.options.prevClass}`);\n $controls.attr('tabindex', 0)\n //also need to handle enter/return and spacebar key presses\n .on('click.zf.orbit touchend.zf.orbit', function(e){\n\t e.preventDefault();\n _this.changeSlide($(this).hasClass(_this.options.nextClass));\n });\n }\n\n if (this.options.bullets) {\n this.$bullets.on('click.zf.orbit touchend.zf.orbit', function() {\n if (/is-active/g.test(this.className)) { return false; }//if this is active, kick out of function.\n var idx = $(this).data('slide'),\n ltr = idx > _this.$slides.filter('.is-active').data('slide'),\n $slide = _this.$slides.eq(idx);\n\n _this.changeSlide(ltr, $slide, idx);\n });\n }\n\n if (this.options.accessible) {\n this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function(e) {\n // handle keyboard event with keyboard util\n Keyboard.handleKey(e, 'Orbit', {\n next: function() {\n _this.changeSlide(true);\n },\n previous: function() {\n _this.changeSlide(false);\n },\n handled: function() { // if bullet is focused, make sure focus moves\n if ($(e.target).is(_this.$bullets)) {\n _this.$bullets.filter('.is-active').focus();\n }\n }\n });\n });\n }\n }\n }\n\n /**\n * Resets Orbit so it can be reinitialized\n */\n _reset() {\n // Don't do anything if there are no slides (first run)\n if (typeof this.$slides == 'undefined') {\n return;\n }\n\n if (this.$slides.length > 1) {\n // Remove old events\n this.$element.off('.zf.orbit').find('*').off('.zf.orbit')\n\n // Restart timer if autoPlay is enabled\n if (this.options.autoPlay) {\n this.timer.restart();\n }\n\n // Reset all sliddes\n this.$slides.each(function(el) {\n $(el).removeClass('is-active is-active is-in')\n .removeAttr('aria-live')\n .hide();\n });\n\n // Show the first slide\n this.$slides.first().addClass('is-active').show();\n\n // Triggers when the slide has finished animating\n this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]);\n\n // Select first bullet if bullets are present\n if (this.options.bullets) {\n this._updateBullets(0);\n }\n }\n }\n\n /**\n * Changes the current slide to a new one.\n * @function\n * @param {Boolean} isLTR - if true the slide moves from right to left, if false the slide moves from left to right.\n * @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected.\n * @param {Number} idx - the index of the new slide in its collection, if one chosen.\n * @fires Orbit#slidechange\n */\n changeSlide(isLTR, chosenSlide, idx) {\n if (!this.$slides) {return; } // Don't freak out if we're in the middle of cleanup\n var $curSlide = this.$slides.filter('.is-active').eq(0);\n\n if (/mui/g.test($curSlide[0].className)) { return false; } //if the slide is currently animating, kick out of the function\n\n var $firstSlide = this.$slides.first(),\n $lastSlide = this.$slides.last(),\n dirIn = isLTR ? 'Right' : 'Left',\n dirOut = isLTR ? 'Left' : 'Right',\n _this = this,\n $newSlide;\n\n if (!chosenSlide) { //most of the time, this will be auto played or clicked from the navButtons.\n $newSlide = isLTR ? //if wrapping enabled, check to see if there is a `next` or `prev` sibling, if not, select the first or last slide to fill in. if wrapping not enabled, attempt to select `next` or `prev`, if there's nothing there, the function will kick out on next step. CRAZY NESTED TERNARIES!!!!!\n (this.options.infiniteWrap ? $curSlide.next(`.${this.options.slideClass}`).length ? $curSlide.next(`.${this.options.slideClass}`) : $firstSlide : $curSlide.next(`.${this.options.slideClass}`))//pick next slide if moving left to right\n :\n (this.options.infiniteWrap ? $curSlide.prev(`.${this.options.slideClass}`).length ? $curSlide.prev(`.${this.options.slideClass}`) : $lastSlide : $curSlide.prev(`.${this.options.slideClass}`));//pick prev slide if moving right to left\n } else {\n $newSlide = chosenSlide;\n }\n\n if ($newSlide.length) {\n /**\n * Triggers before the next slide starts animating in and only if a next slide has been found.\n * @event Orbit#beforeslidechange\n */\n this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]);\n\n if (this.options.bullets) {\n idx = idx || this.$slides.index($newSlide); //grab index to update bullets\n this._updateBullets(idx);\n }\n\n if (this.options.useMUI && !this.$element.is(':hidden')) {\n Motion.animateIn(\n $newSlide.addClass('is-active'),\n this.options[`animInFrom${dirIn}`],\n function(){\n $newSlide.css({'display': 'block'}).attr('aria-live', 'polite');\n });\n\n Motion.animateOut(\n $curSlide.removeClass('is-active'),\n this.options[`animOutTo${dirOut}`],\n function(){\n $curSlide.removeAttr('aria-live');\n if(_this.options.autoPlay && !_this.timer.isPaused){\n _this.timer.restart();\n }\n //do stuff?\n });\n } else {\n $curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide();\n $newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show();\n if (this.options.autoPlay && !this.timer.isPaused) {\n this.timer.restart();\n }\n }\n /**\n * Triggers when the slide has finished animating in.\n * @event Orbit#slidechange\n */\n this.$element.trigger('slidechange.zf.orbit', [$newSlide]);\n }\n }\n\n /**\n * Updates the active state of the bullets, if displayed.\n * Move the descriptor of the current slide `[data-slide-active-label]` to the newly active bullet.\n * If no `[data-slide-active-label]` is set, will move the exceeding `span` element.\n *\n * @function\n * @private\n * @param {Number} idx - the index of the current slide.\n */\n _updateBullets(idx) {\n var $oldBullet = this.$bullets.filter('.is-active');\n var $othersBullets = this.$bullets.not('.is-active');\n var $newBullet = this.$bullets.eq(idx);\n\n $oldBullet.removeClass('is-active').blur();\n $newBullet.addClass('is-active');\n\n // Find the descriptor for the current slide to move it to the new slide button\n var activeStateDescriptor = $oldBullet.children('[data-slide-active-label]').last();\n\n // If not explicitely given, search for the last \"exceeding\" span element (compared to others bullets).\n if (!activeStateDescriptor.length) {\n var spans = $oldBullet.children('span');\n var spanCountInOthersBullets = $othersBullets.toArray().map(b => $(b).children('span').length);\n\n // If there is an exceeding span element, use it as current slide descriptor\n if (spanCountInOthersBullets.every(count => count < spans.length)) {\n activeStateDescriptor = spans.last();\n activeStateDescriptor.attr('data-slide-active-label', '');\n }\n }\n\n // Move the current slide descriptor to the new slide button\n if (activeStateDescriptor.length) {\n activeStateDescriptor.detach();\n $newBullet.append(activeStateDescriptor);\n }\n }\n\n /**\n * Destroys the carousel and hides the element.\n * @function\n */\n _destroy() {\n this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();\n }\n}\n\nOrbit.defaults = {\n /**\n * Tells the JS to look for and loadBullets.\n * @option\n * @type {boolean}\n * @default true\n */\n bullets: true,\n /**\n * Tells the JS to apply event listeners to nav buttons\n * @option\n * @type {boolean}\n * @default true\n */\n navButtons: true,\n /**\n * motion-ui animation class to apply\n * @option\n * @type {string}\n * @default 'slide-in-right'\n */\n animInFromRight: 'slide-in-right',\n /**\n * motion-ui animation class to apply\n * @option\n * @type {string}\n * @default 'slide-out-right'\n */\n animOutToRight: 'slide-out-right',\n /**\n * motion-ui animation class to apply\n * @option\n * @type {string}\n * @default 'slide-in-left'\n *\n */\n animInFromLeft: 'slide-in-left',\n /**\n * motion-ui animation class to apply\n * @option\n * @type {string}\n * @default 'slide-out-left'\n */\n animOutToLeft: 'slide-out-left',\n /**\n * Allows Orbit to automatically animate on page load.\n * @option\n * @type {boolean}\n * @default true\n */\n autoPlay: true,\n /**\n * Amount of time, in ms, between slide transitions\n * @option\n * @type {number}\n * @default 5000\n */\n timerDelay: 5000,\n /**\n * Allows Orbit to infinitely loop through the slides\n * @option\n * @type {boolean}\n * @default true\n */\n infiniteWrap: true,\n /**\n * Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library\n * @option\n * @type {boolean}\n * @default true\n */\n swipe: true,\n /**\n * Allows the timing function to pause animation on hover.\n * @option\n * @type {boolean}\n * @default true\n */\n pauseOnHover: true,\n /**\n * Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys\n * @option\n * @type {boolean}\n * @default true\n */\n accessible: true,\n /**\n * Class applied to the container of Orbit\n * @option\n * @type {string}\n * @default 'orbit-container'\n */\n containerClass: 'orbit-container',\n /**\n * Class applied to individual slides.\n * @option\n * @type {string}\n * @default 'orbit-slide'\n */\n slideClass: 'orbit-slide',\n /**\n * Class applied to the bullet container. You're welcome.\n * @option\n * @type {string}\n * @default 'orbit-bullets'\n */\n boxOfBullets: 'orbit-bullets',\n /**\n * Class applied to the `next` navigation button.\n * @option\n * @type {string}\n * @default 'orbit-next'\n */\n nextClass: 'orbit-next',\n /**\n * Class applied to the `previous` navigation button.\n * @option\n * @type {string}\n * @default 'orbit-previous'\n */\n prevClass: 'orbit-previous',\n /**\n * Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatibility.\n * @option\n * @type {boolean}\n * @default true\n */\n useMUI: true\n};\n\nexport {Orbit};\n","'use strict';\n\nimport { Box } from './foundation.util.box';\nimport { Plugin } from './foundation.core.plugin';\nimport { rtl as Rtl } from './foundation.core.utils';\n\nconst POSITIONS = ['left', 'right', 'top', 'bottom'];\nconst VERTICAL_ALIGNMENTS = ['top', 'bottom', 'center'];\nconst HORIZONTAL_ALIGNMENTS = ['left', 'right', 'center'];\n\nconst ALIGNMENTS = {\n 'left': VERTICAL_ALIGNMENTS,\n 'right': VERTICAL_ALIGNMENTS,\n 'top': HORIZONTAL_ALIGNMENTS,\n 'bottom': HORIZONTAL_ALIGNMENTS\n}\n\nfunction nextItem(item, array) {\n var currentIdx = array.indexOf(item);\n if(currentIdx === array.length - 1) {\n return array[0];\n } else {\n return array[currentIdx + 1];\n }\n}\n\n\nclass Positionable extends Plugin {\n /**\n * Abstract class encapsulating the tether-like explicit positioning logic\n * including repositioning based on overlap.\n * Expects classes to define defaults for vOffset, hOffset, position,\n * alignment, allowOverlap, and allowBottomOverlap. They can do this by\n * extending the defaults, or (for now recommended due to the way docs are\n * generated) by explicitly declaring them.\n *\n **/\n\n _init() {\n this.triedPositions = {};\n this.position = this.options.position === 'auto' ? this._getDefaultPosition() : this.options.position;\n this.alignment = this.options.alignment === 'auto' ? this._getDefaultAlignment() : this.options.alignment;\n this.originalPosition = this.position;\n this.originalAlignment = this.alignment;\n }\n\n _getDefaultPosition () {\n return 'bottom';\n }\n\n _getDefaultAlignment() {\n switch(this.position) {\n case 'bottom':\n case 'top':\n return Rtl() ? 'right' : 'left';\n case 'left':\n case 'right':\n return 'bottom';\n }\n }\n\n /**\n * Adjusts the positionable possible positions by iterating through alignments\n * and positions.\n * @function\n * @private\n */\n _reposition() {\n if(this._alignmentsExhausted(this.position)) {\n this.position = nextItem(this.position, POSITIONS);\n this.alignment = ALIGNMENTS[this.position][0];\n } else {\n this._realign();\n }\n }\n\n /**\n * Adjusts the dropdown pane possible positions by iterating through alignments\n * on the current position.\n * @function\n * @private\n */\n _realign() {\n this._addTriedPosition(this.position, this.alignment)\n this.alignment = nextItem(this.alignment, ALIGNMENTS[this.position])\n }\n\n _addTriedPosition(position, alignment) {\n this.triedPositions[position] = this.triedPositions[position] || []\n this.triedPositions[position].push(alignment);\n }\n\n _positionsExhausted() {\n var isExhausted = true;\n for(var i = 0; i < POSITIONS.length; i++) {\n isExhausted = isExhausted && this._alignmentsExhausted(POSITIONS[i]);\n }\n return isExhausted;\n }\n\n _alignmentsExhausted(position) {\n return this.triedPositions[position] && this.triedPositions[position].length == ALIGNMENTS[position].length;\n }\n\n\n // When we're trying to center, we don't want to apply offset that's going to\n // take us just off center, so wrap around to return 0 for the appropriate\n // offset in those alignments. TODO: Figure out if we want to make this\n // configurable behavior... it feels more intuitive, especially for tooltips, but\n // it's possible someone might actually want to start from center and then nudge\n // slightly off.\n _getVOffset() {\n return this.options.vOffset;\n }\n\n _getHOffset() {\n return this.options.hOffset;\n }\n\n _setPosition($anchor, $element, $parent) {\n if($anchor.attr('aria-expanded') === 'false'){ return false; }\n\n if (!this.options.allowOverlap) {\n // restore original position & alignment before checking overlap\n this.position = this.originalPosition;\n this.alignment = this.originalAlignment;\n }\n\n $element.offset(Box.GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));\n\n if(!this.options.allowOverlap) {\n var minOverlap = 100000000;\n // default coordinates to how we start, in case we can't figure out better\n var minCoordinates = {position: this.position, alignment: this.alignment};\n while(!this._positionsExhausted()) {\n let overlap = Box.OverlapArea($element, $parent, false, false, this.options.allowBottomOverlap);\n if(overlap === 0) {\n return;\n }\n\n if(overlap < minOverlap) {\n minOverlap = overlap;\n minCoordinates = {position: this.position, alignment: this.alignment};\n }\n\n this._reposition();\n\n $element.offset(Box.GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));\n }\n // If we get through the entire loop, there was no non-overlapping\n // position available. Pick the version with least overlap.\n this.position = minCoordinates.position;\n this.alignment = minCoordinates.alignment;\n $element.offset(Box.GetExplicitOffsets($element, $anchor, this.position, this.alignment, this._getVOffset(), this._getHOffset()));\n }\n }\n\n}\n\nPositionable.defaults = {\n /**\n * Position of positionable relative to anchor. Can be left, right, bottom, top, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n position: 'auto',\n /**\n * Alignment of positionable relative to anchor. Can be left, right, bottom, top, center, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n alignment: 'auto',\n /**\n * Allow overlap of container/window. If false, dropdown positionable first\n * try to position as defined by data-position and data-alignment, but\n * reposition if it would cause an overflow.\n * @option\n * @type {boolean}\n * @default false\n */\n allowOverlap: false,\n /**\n * Allow overlap of only the bottom of the container. This is the most common\n * behavior for dropdowns, allowing the dropdown to extend the bottom of the\n * screen but not otherwise influence or break out of the container.\n * @option\n * @type {boolean}\n * @default true\n */\n allowBottomOverlap: true,\n /**\n * Number of pixels the positionable should be separated vertically from anchor\n * @option\n * @type {number}\n * @default 0\n */\n vOffset: 0,\n /**\n * Number of pixels the positionable should be separated horizontally from anchor\n * @option\n * @type {number}\n * @default 0\n */\n hOffset: 0,\n}\n\nexport {Positionable};\n","'use strict';\n\nimport $ from 'jquery';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin }from './foundation.core.plugin';\n\nimport { Accordion } from './foundation.accordion';\nimport { Tabs } from './foundation.tabs';\n\n// The plugin matches the plugin classes with these plugin instances.\nvar MenuPlugins = {\n tabs: {\n cssClass: 'tabs',\n plugin: Tabs,\n open: (plugin, target) => plugin.selectTab(target),\n close: null /* not supported */,\n toggle: null /* not supported */,\n },\n accordion: {\n cssClass: 'accordion',\n plugin: Accordion,\n open: (plugin, target) => plugin.down($(target)),\n close: (plugin, target) => plugin.up($(target)),\n toggle: (plugin, target) => plugin.toggle($(target)),\n }\n};\n\n\n/**\n * ResponsiveAccordionTabs module.\n * @module foundation.responsiveAccordionTabs\n * @requires foundation.util.motion\n * @requires foundation.accordion\n * @requires foundation.tabs\n */\n\nclass ResponsiveAccordionTabs extends Plugin{\n constructor(element, options) {\n super(element, options);\n return this.options.reflow && this.storezfData || this;\n }\n\n /**\n * Creates a new instance of a responsive accordion tabs.\n * @class\n * @name ResponsiveAccordionTabs\n * @fires ResponsiveAccordionTabs#init\n * @param {jQuery} element - jQuery object to make into Responsive Accordion Tabs.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = $(element);\n this.$element.data('zfPluginBase', this);\n this.options = $.extend({}, ResponsiveAccordionTabs.defaults, this.$element.data(), options);\n\n this.rules = this.$element.data('responsive-accordion-tabs');\n this.currentMq = null;\n this.currentRule = null;\n this.currentPlugin = null;\n this.className = 'ResponsiveAccordionTabs'; // ie9 back compat\n if (!this.$element.attr('id')) {\n this.$element.attr('id',GetYoDigits(6, 'responsiveaccordiontabs'));\n }\n\n this._init();\n this._events();\n }\n\n /**\n * Initializes the Menu by parsing the classes from the 'data-responsive-accordion-tabs' attribute on the element.\n * @function\n * @private\n */\n _init() {\n MediaQuery._init();\n\n // The first time an Interchange plugin is initialized, this.rules is converted from a string of \"classes\" to an object of rules\n if (typeof this.rules === 'string') {\n let rulesTree = {};\n\n // Parse rules from \"classes\" pulled from data attribute\n let rules = this.rules.split(' ');\n\n // Iterate through every rule found\n for (let i = 0; i < rules.length; i++) {\n let rule = rules[i].split('-');\n let ruleSize = rule.length > 1 ? rule[0] : 'small';\n let rulePlugin = rule.length > 1 ? rule[1] : rule[0];\n\n if (MenuPlugins[rulePlugin] !== null) {\n rulesTree[ruleSize] = MenuPlugins[rulePlugin];\n }\n }\n\n this.rules = rulesTree;\n }\n\n this._getAllOptions();\n\n if (!$.isEmptyObject(this.rules)) {\n this._checkMediaQueries();\n }\n }\n\n _getAllOptions() {\n //get all defaults and options\n var _this = this;\n _this.allOptions = {};\n for (var key in MenuPlugins) {\n if (MenuPlugins.hasOwnProperty(key)) {\n var obj = MenuPlugins[key];\n try {\n var dummyPlugin = $('<ul></ul>');\n var tmpPlugin = new obj.plugin(dummyPlugin,_this.options);\n for (var keyKey in tmpPlugin.options) {\n if (tmpPlugin.options.hasOwnProperty(keyKey) && keyKey !== 'zfPlugin') {\n var objObj = tmpPlugin.options[keyKey];\n _this.allOptions[keyKey] = objObj;\n }\n }\n tmpPlugin.destroy();\n }\n catch(e) {\n }\n }\n }\n }\n\n /**\n * Initializes events for the Menu.\n * @function\n * @private\n */\n _events() {\n this._changedZfMediaQueryHandler = this._checkMediaQueries.bind(this);\n $(window).on('changed.zf.mediaquery', this._changedZfMediaQueryHandler);\n }\n\n /**\n * Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out.\n * @function\n * @private\n */\n _checkMediaQueries() {\n var matchedMq, _this = this;\n // Iterate through each rule and find the last matching rule\n $.each(this.rules, function(key) {\n if (MediaQuery.atLeast(key)) {\n matchedMq = key;\n }\n });\n\n // No match? No dice\n if (!matchedMq) return;\n\n // Plugin already initialized? We good\n if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return;\n\n // Remove existing plugin-specific CSS classes\n $.each(MenuPlugins, function(key, value) {\n _this.$element.removeClass(value.cssClass);\n });\n\n // Add the CSS class for the new plugin\n this.$element.addClass(this.rules[matchedMq].cssClass);\n\n // Create an instance of the new plugin\n if (this.currentPlugin) {\n //don't know why but on nested elements data zfPlugin get's lost\n if (!this.currentPlugin.$element.data('zfPlugin') && this.storezfData) this.currentPlugin.$element.data('zfPlugin',this.storezfData);\n this.currentPlugin.destroy();\n }\n this._handleMarkup(this.rules[matchedMq].cssClass);\n this.currentRule = this.rules[matchedMq];\n this.currentPlugin = new this.currentRule.plugin(this.$element, this.options);\n this.storezfData = this.currentPlugin.$element.data('zfPlugin');\n\n }\n\n _handleMarkup(toSet){\n var _this = this, fromString = 'accordion';\n var $panels = $('[data-tabs-content='+this.$element.attr('id')+']');\n if ($panels.length) fromString = 'tabs';\n if (fromString === toSet) {\n return;\n }\n\n var tabsTitle = _this.allOptions.linkClass?_this.allOptions.linkClass:'tabs-title';\n var tabsPanel = _this.allOptions.panelClass?_this.allOptions.panelClass:'tabs-panel';\n\n this.$element.removeAttr('role');\n var $liHeads = this.$element.children('.'+tabsTitle+',[data-accordion-item]').removeClass(tabsTitle).removeClass('accordion-item').removeAttr('data-accordion-item');\n var $liHeadsA = $liHeads.children('a').removeClass('accordion-title');\n\n if (fromString === 'tabs') {\n $panels = $panels.children('.'+tabsPanel).removeClass(tabsPanel).removeAttr('role').removeAttr('aria-hidden').removeAttr('aria-labelledby');\n $panels.children('a').removeAttr('role').removeAttr('aria-controls').removeAttr('aria-selected');\n } else {\n $panels = $liHeads.children('[data-tab-content]').removeClass('accordion-content');\n }\n\n $panels.css({display:'',visibility:''});\n $liHeads.css({display:'',visibility:''});\n if (toSet === 'accordion') {\n $panels.each(function(key,value){\n $(value).appendTo($liHeads.get(key)).addClass('accordion-content').attr('data-tab-content','').removeClass('is-active').css({height:''});\n $('[data-tabs-content='+_this.$element.attr('id')+']').after('<div id=\"tabs-placeholder-'+_this.$element.attr('id')+'\"></div>').detach();\n $liHeads.addClass('accordion-item').attr('data-accordion-item','');\n $liHeadsA.addClass('accordion-title');\n });\n } else if (toSet === 'tabs') {\n var $tabsContent = $('[data-tabs-content='+_this.$element.attr('id')+']');\n var $placeholder = $('#tabs-placeholder-'+_this.$element.attr('id'));\n if ($placeholder.length) {\n $tabsContent = $('<div class=\"tabs-content\"></div>').insertAfter($placeholder).attr('data-tabs-content',_this.$element.attr('id'));\n $placeholder.remove();\n } else {\n $tabsContent = $('<div class=\"tabs-content\"></div>').insertAfter(_this.$element).attr('data-tabs-content',_this.$element.attr('id'));\n }\n $panels.each(function(key,value){\n var tempValue = $(value).appendTo($tabsContent).addClass(tabsPanel);\n var hash = $liHeadsA.get(key).hash.slice(1);\n var id = $(value).attr('id') || GetYoDigits(6, 'accordion');\n if (hash !== id) {\n if (hash !== '') {\n $(value).attr('id',hash);\n } else {\n hash = id;\n $(value).attr('id',hash);\n $($liHeadsA.get(key)).attr('href',$($liHeadsA.get(key)).attr('href').replace('#','')+'#'+hash);\n }\n }\n var isActive = $($liHeads.get(key)).hasClass('is-active');\n if (isActive) {\n tempValue.addClass('is-active');\n }\n });\n $liHeads.addClass(tabsTitle);\n };\n }\n\n /**\n * Opens the plugin pane defined by `target`.\n * @param {jQuery | String} target - jQuery object or string of the id of the pane to open.\n * @see Accordion.down\n * @see Tabs.selectTab\n * @function\n */\n open(_target) {\n if (this.currentRule && typeof this.currentRule.open === 'function') {\n return this.currentRule.open(this.currentPlugin, ...arguments);\n }\n }\n\n /**\n * Closes the plugin pane defined by `target`. Not availaible for Tabs.\n * @param {jQuery | String} target - jQuery object or string of the id of the pane to close.\n * @see Accordion.up\n * @function\n */\n close(_target) {\n if (this.currentRule && typeof this.currentRule.close === 'function') {\n return this.currentRule.close(this.currentPlugin, ...arguments);\n }\n }\n\n /**\n * Toggles the plugin pane defined by `target`. Not availaible for Tabs.\n * @param {jQuery | String} target - jQuery object or string of the id of the pane to toggle.\n * @see Accordion.toggle\n * @function\n */\n toggle(_target) {\n if (this.currentRule && typeof this.currentRule.toggle === 'function') {\n return this.currentRule.toggle(this.currentPlugin, ...arguments);\n }\n }\n\n /**\n * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.\n * @function\n */\n _destroy() {\n if (this.currentPlugin) this.currentPlugin.destroy();\n $(window).off('changed.zf.mediaquery', this._changedZfMediaQueryHandler);\n }\n}\n\nResponsiveAccordionTabs.defaults = {};\n\nexport {ResponsiveAccordionTabs};\n","'use strict';\n\nimport $ from 'jquery';\n\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\n\nimport { DropdownMenu } from './foundation.dropdownMenu';\nimport { Drilldown } from './foundation.drilldown';\nimport { AccordionMenu } from './foundation.accordionMenu';\n\nlet MenuPlugins = {\n dropdown: {\n cssClass: 'dropdown',\n plugin: DropdownMenu\n },\n drilldown: {\n cssClass: 'drilldown',\n plugin: Drilldown\n },\n accordion: {\n cssClass: 'accordion-menu',\n plugin: AccordionMenu\n }\n};\n\n // import \"foundation.util.triggers.js\";\n\n\n/**\n * ResponsiveMenu module.\n * @module foundation.responsiveMenu\n * @requires foundation.util.triggers\n * @requires foundation.util.mediaQuery\n */\n\nclass ResponsiveMenu extends Plugin {\n /**\n * Creates a new instance of a responsive menu.\n * @class\n * @name ResponsiveMenu\n * @fires ResponsiveMenu#init\n * @param {jQuery} element - jQuery object to make into a dropdown menu.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = $(element);\n this.rules = this.$element.data('responsive-menu');\n this.currentMq = null;\n this.currentPlugin = null;\n this.className = 'ResponsiveMenu'; // ie9 back compat\n\n this._init();\n this._events();\n }\n\n /**\n * Initializes the Menu by parsing the classes from the 'data-ResponsiveMenu' attribute on the element.\n * @function\n * @private\n */\n _init() {\n\n MediaQuery._init();\n // The first time an Interchange plugin is initialized, this.rules is converted from a string of \"classes\" to an object of rules\n if (typeof this.rules === 'string') {\n let rulesTree = {};\n\n // Parse rules from \"classes\" pulled from data attribute\n let rules = this.rules.split(' ');\n\n // Iterate through every rule found\n for (let i = 0; i < rules.length; i++) {\n let rule = rules[i].split('-');\n let ruleSize = rule.length > 1 ? rule[0] : 'small';\n let rulePlugin = rule.length > 1 ? rule[1] : rule[0];\n\n if (MenuPlugins[rulePlugin] !== null) {\n rulesTree[ruleSize] = MenuPlugins[rulePlugin];\n }\n }\n\n this.rules = rulesTree;\n }\n\n if (!$.isEmptyObject(this.rules)) {\n this._checkMediaQueries();\n }\n // Add data-mutate since children may need it.\n this.$element.attr('data-mutate', (this.$element.attr('data-mutate') || GetYoDigits(6, 'responsive-menu')));\n }\n\n /**\n * Initializes events for the Menu.\n * @function\n * @private\n */\n _events() {\n var _this = this;\n\n $(window).on('changed.zf.mediaquery', function() {\n _this._checkMediaQueries();\n });\n // $(window).on('resize.zf.ResponsiveMenu', function() {\n // _this._checkMediaQueries();\n // });\n }\n\n /**\n * Checks the current screen width against available media queries. If the media query has changed, and the plugin needed has changed, the plugins will swap out.\n * @function\n * @private\n */\n _checkMediaQueries() {\n var matchedMq, _this = this;\n // Iterate through each rule and find the last matching rule\n $.each(this.rules, function(key) {\n if (MediaQuery.atLeast(key)) {\n matchedMq = key;\n }\n });\n\n // No match? No dice\n if (!matchedMq) return;\n\n // Plugin already initialized? We good\n if (this.currentPlugin instanceof this.rules[matchedMq].plugin) return;\n\n // Remove existing plugin-specific CSS classes\n $.each(MenuPlugins, function(key, value) {\n _this.$element.removeClass(value.cssClass);\n });\n\n // Add the CSS class for the new plugin\n this.$element.addClass(this.rules[matchedMq].cssClass);\n\n // Create an instance of the new plugin\n if (this.currentPlugin) this.currentPlugin.destroy();\n this.currentPlugin = new this.rules[matchedMq].plugin(this.$element, {});\n }\n\n /**\n * Destroys the instance of the current plugin on this element, as well as the window resize handler that switches the plugins out.\n * @function\n */\n _destroy() {\n this.currentPlugin.destroy();\n $(window).off('.zf.ResponsiveMenu');\n }\n}\n\nResponsiveMenu.defaults = {};\n\nexport {ResponsiveMenu};\n","'use strict';\n\nimport $ from 'jquery';\n\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Motion } from './foundation.util.motion';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * ResponsiveToggle module.\n * @module foundation.responsiveToggle\n * @requires foundation.util.mediaQuery\n * @requires foundation.util.motion\n */\n\nclass ResponsiveToggle extends Plugin {\n /**\n * Creates a new instance of Tab Bar.\n * @class\n * @name ResponsiveToggle\n * @fires ResponsiveToggle#init\n * @param {jQuery} element - jQuery object to attach tab bar functionality to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = $(element);\n this.options = $.extend({}, ResponsiveToggle.defaults, this.$element.data(), options);\n this.className = 'ResponsiveToggle'; // ie9 back compat\n\n this._init();\n this._events();\n }\n\n /**\n * Initializes the tab bar by finding the target element, toggling element, and running update().\n * @function\n * @private\n */\n _init() {\n MediaQuery._init();\n var targetID = this.$element.data('responsive-toggle');\n if (!targetID) {\n console.error('Your tab bar needs an ID of a Menu as the value of data-tab-bar.');\n }\n\n this.$targetMenu = $(`#${targetID}`);\n this.$toggler = this.$element.find('[data-toggle]').filter(function() {\n var target = $(this).data('toggle');\n return (target === targetID || target === \"\");\n });\n this.options = $.extend({}, this.options, this.$targetMenu.data());\n\n // If they were set, parse the animation classes\n if(this.options.animate) {\n let input = this.options.animate.split(' ');\n\n this.animationIn = input[0];\n this.animationOut = input[1] || null;\n }\n\n this._update();\n }\n\n /**\n * Adds necessary event handlers for the tab bar to work.\n * @function\n * @private\n */\n _events() {\n var _this = this;\n\n this._updateMqHandler = this._update.bind(this);\n\n $(window).on('changed.zf.mediaquery', this._updateMqHandler);\n\n this.$toggler.on('click.zf.responsiveToggle', this.toggleMenu.bind(this));\n }\n\n /**\n * Checks the current media query to determine if the tab bar should be visible or hidden.\n * @function\n * @private\n */\n _update() {\n // Mobile\n if (!MediaQuery.atLeast(this.options.hideFor)) {\n this.$element.show();\n this.$targetMenu.hide();\n }\n\n // Desktop\n else {\n this.$element.hide();\n this.$targetMenu.show();\n }\n }\n\n /**\n * Toggles the element attached to the tab bar. The toggle only happens if the screen is small enough to allow it.\n * @function\n * @fires ResponsiveToggle#toggled\n */\n toggleMenu() {\n if (!MediaQuery.atLeast(this.options.hideFor)) {\n /**\n * Fires when the element attached to the tab bar toggles.\n * @event ResponsiveToggle#toggled\n */\n if(this.options.animate) {\n if (this.$targetMenu.is(':hidden')) {\n Motion.animateIn(this.$targetMenu, this.animationIn, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n this.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger');\n });\n }\n else {\n Motion.animateOut(this.$targetMenu, this.animationOut, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n });\n }\n }\n else {\n this.$targetMenu.toggle(0);\n this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger');\n this.$element.trigger('toggled.zf.responsiveToggle');\n }\n }\n };\n\n _destroy() {\n this.$element.off('.zf.responsiveToggle');\n this.$toggler.off('.zf.responsiveToggle');\n\n $(window).off('changed.zf.mediaquery', this._updateMqHandler);\n }\n}\n\nResponsiveToggle.defaults = {\n /**\n * The breakpoint after which the menu is always shown, and the tab bar is hidden.\n * @option\n * @type {string}\n * @default 'medium'\n */\n hideFor: 'medium',\n\n /**\n * To decide if the toggle should be animated or not.\n * @option\n * @type {boolean}\n * @default false\n */\n animate: false\n};\n\nexport { ResponsiveToggle };\n","'use strict';\n\nimport $ from 'jquery';\nimport { Plugin } from './foundation.core.plugin';\nimport { onLoad } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Motion } from './foundation.util.motion';\nimport { Triggers } from './foundation.util.triggers';\nimport { Touch } from './foundation.util.touch'\n\n/**\n * Reveal module.\n * @module foundation.reveal\n * @requires foundation.util.keyboard\n * @requires foundation.util.touch\n * @requires foundation.util.triggers\n * @requires foundation.util.mediaQuery\n * @requires foundation.util.motion if using animations\n */\n\nclass Reveal extends Plugin {\n /**\n * Creates a new instance of Reveal.\n * @class\n * @name Reveal\n * @param {jQuery} element - jQuery object to use for the modal.\n * @param {Object} options - optional parameters.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Reveal.defaults, this.$element.data(), options);\n this.className = 'Reveal'; // ie9 back compat\n this._init();\n\n // Touch and Triggers init are idempotent, just need to make sure they are initialized\n Touch.init($);\n Triggers.init($);\n\n Keyboard.register('Reveal', {\n 'ESCAPE': 'close',\n });\n }\n\n /**\n * Initializes the modal by adding the overlay and close buttons, (if selected).\n * @private\n */\n _init() {\n MediaQuery._init();\n this.id = this.$element.attr('id');\n this.isActive = false;\n this.cached = {mq: MediaQuery.current};\n\n this.$anchor = $(`[data-open=\"${this.id}\"]`).length ? $(`[data-open=\"${this.id}\"]`) : $(`[data-toggle=\"${this.id}\"]`);\n this.$anchor.attr({\n 'aria-controls': this.id,\n 'aria-haspopup': true,\n 'tabindex': 0\n });\n\n if (this.options.fullScreen || this.$element.hasClass('full')) {\n this.options.fullScreen = true;\n this.options.overlay = false;\n }\n if (this.options.overlay && !this.$overlay) {\n this.$overlay = this._makeOverlay(this.id);\n }\n\n this.$element.attr({\n 'role': 'dialog',\n 'aria-hidden': true,\n 'data-yeti-box': this.id,\n 'data-resize': this.id\n });\n\n if(this.$overlay) {\n this.$element.detach().appendTo(this.$overlay);\n } else {\n this.$element.detach().appendTo($(this.options.appendTo));\n this.$element.addClass('without-overlay');\n }\n this._events();\n if (this.options.deepLink && window.location.hash === ( `#${this.id}`)) {\n this.onLoadListener = onLoad($(window), () => this.open());\n }\n }\n\n /**\n * Creates an overlay div to display behind the modal.\n * @private\n */\n _makeOverlay() {\n var additionalOverlayClasses = '';\n\n if (this.options.additionalOverlayClasses) {\n additionalOverlayClasses = ' ' + this.options.additionalOverlayClasses;\n }\n\n return $('<div></div>')\n .addClass('reveal-overlay' + additionalOverlayClasses)\n .appendTo(this.options.appendTo);\n }\n\n /**\n * Updates position of modal\n * TODO: Figure out if we actually need to cache these values or if it doesn't matter\n * @private\n */\n _updatePosition() {\n var width = this.$element.outerWidth();\n var outerWidth = $(window).width();\n var height = this.$element.outerHeight();\n var outerHeight = $(window).height();\n var left, top = null;\n if (this.options.hOffset === 'auto') {\n left = parseInt((outerWidth - width) / 2, 10);\n } else {\n left = parseInt(this.options.hOffset, 10);\n }\n if (this.options.vOffset === 'auto') {\n if (height > outerHeight) {\n top = parseInt(Math.min(100, outerHeight / 10), 10);\n } else {\n top = parseInt((outerHeight - height) / 4, 10);\n }\n } else if (this.options.vOffset !== null) {\n top = parseInt(this.options.vOffset, 10);\n }\n\n if (top !== null) {\n this.$element.css({top: top + 'px'});\n }\n\n // only worry about left if we don't have an overlay or we have a horizontal offset,\n // otherwise we're perfectly in the middle\n if (!this.$overlay || (this.options.hOffset !== 'auto')) {\n this.$element.css({left: left + 'px'});\n this.$element.css({margin: '0px'});\n }\n\n }\n\n /**\n * Adds event handlers for the modal.\n * @private\n */\n _events() {\n var _this = this;\n\n this.$element.on({\n 'open.zf.trigger': this.open.bind(this),\n 'close.zf.trigger': (event, $element) => {\n if ((event.target === _this.$element[0]) ||\n ($(event.target).parents('[data-closable]')[0] === $element)) { // only close reveal when it's explicitly called\n return this.close.apply(this);\n }\n },\n 'toggle.zf.trigger': this.toggle.bind(this),\n 'resizeme.zf.trigger': function() {\n _this._updatePosition();\n }\n });\n\n if (this.options.closeOnClick && this.options.overlay) {\n this.$overlay.off('.zf.reveal').on('click.zf.dropdown tap.zf.dropdown', function(e) {\n if (e.target === _this.$element[0] ||\n $.contains(_this.$element[0], e.target) ||\n !$.contains(document, e.target)) {\n return;\n }\n _this.close();\n });\n }\n if (this.options.deepLink) {\n $(window).on(`hashchange.zf.reveal:${this.id}`, this._handleState.bind(this));\n }\n }\n\n /**\n * Handles modal methods on back/forward button clicks or any other event that triggers hashchange.\n * @private\n */\n _handleState(e) {\n if(window.location.hash === ( '#' + this.id) && !this.isActive){ this.open(); }\n else{ this.close(); }\n }\n\n /**\n * Disables the scroll when Reveal is shown to prevent the background from shifting\n * @param {number} scrollTop - Scroll to visually apply, window current scroll by default\n */\n _disableScroll(scrollTop) {\n scrollTop = scrollTop || $(window).scrollTop();\n if ($(document).height() > $(window).height()) {\n $(\"html\")\n .css(\"top\", -scrollTop);\n }\n }\n\n /**\n * Reenables the scroll when Reveal closes\n * @param {number} scrollTop - Scroll to restore, html \"top\" property by default (as set by `_disableScroll`)\n */\n _enableScroll(scrollTop) {\n scrollTop = scrollTop || parseInt($(\"html\").css(\"top\"));\n if ($(document).height() > $(window).height()) {\n $(\"html\")\n .css(\"top\", \"\");\n $(window).scrollTop(-scrollTop);\n }\n }\n\n\n /**\n * Opens the modal controlled by `this.$anchor`, and closes all others by default.\n * @function\n * @fires Reveal#closeme\n * @fires Reveal#open\n */\n open() {\n // either update or replace browser history\n const hash = `#${this.id}`;\n if (this.options.deepLink && window.location.hash !== hash) {\n\n if (window.history.pushState) {\n if (this.options.updateHistory) {\n window.history.pushState({}, '', hash);\n } else {\n window.history.replaceState({}, '', hash);\n }\n } else {\n window.location.hash = hash;\n }\n }\n\n // Remember anchor that opened it to set focus back later, have general anchors as fallback\n this.$activeAnchor = $(document.activeElement).is(this.$anchor) ? $(document.activeElement) : this.$anchor;\n\n this.isActive = true;\n\n // Make elements invisible, but remove display: none so we can get size and positioning\n this.$element\n .css({ 'visibility': 'hidden' })\n .show()\n .scrollTop(0);\n if (this.options.overlay) {\n this.$overlay.css({'visibility': 'hidden'}).show();\n }\n\n this._updatePosition();\n\n this.$element\n .hide()\n .css({ 'visibility': '' });\n\n if(this.$overlay) {\n this.$overlay.css({'visibility': ''}).hide();\n if(this.$element.hasClass('fast')) {\n this.$overlay.addClass('fast');\n } else if (this.$element.hasClass('slow')) {\n this.$overlay.addClass('slow');\n }\n }\n\n\n if (!this.options.multipleOpened) {\n /**\n * Fires immediately before the modal opens.\n * Closes any other modals that are currently open\n * @event Reveal#closeme\n */\n this.$element.trigger('closeme.zf.reveal', this.id);\n }\n\n if ($('.reveal:visible').length === 0) {\n this._disableScroll();\n }\n\n var _this = this;\n\n // Motion UI method of reveal\n if (this.options.animationIn) {\n function afterAnimation(){\n _this.$element\n .attr({\n 'aria-hidden': false,\n 'tabindex': -1\n })\n .focus();\n _this._addGlobalClasses();\n Keyboard.trapFocus(_this.$element);\n }\n if (this.options.overlay) {\n Motion.animateIn(this.$overlay, 'fade-in');\n }\n Motion.animateIn(this.$element, this.options.animationIn, () => {\n if(this.$element) { // protect against object having been removed\n this.focusableElements = Keyboard.findFocusable(this.$element);\n afterAnimation();\n }\n });\n }\n // jQuery method of reveal\n else {\n if (this.options.overlay) {\n this.$overlay.show(0);\n }\n this.$element.show(this.options.showDelay);\n }\n\n // handle accessibility\n this.$element\n .attr({\n 'aria-hidden': false,\n 'tabindex': -1\n })\n .focus();\n Keyboard.trapFocus(this.$element);\n\n this._addGlobalClasses();\n\n this._addGlobalListeners();\n\n /**\n * Fires when the modal has successfully opened.\n * @event Reveal#open\n */\n this.$element.trigger('open.zf.reveal');\n }\n\n /**\n * Adds classes and listeners on document required by open modals.\n *\n * The following classes are added and updated:\n * - `.is-reveal-open` - Prevents the scroll on document\n * - `.zf-has-scroll` - Displays a disabled scrollbar on document if required like if the\n * scroll was not disabled. This prevent a \"shift\" of the page content due\n * the scrollbar disappearing when the modal opens.\n *\n * @private\n */\n _addGlobalClasses() {\n const updateScrollbarClass = () => {\n $('html').toggleClass('zf-has-scroll', !!($(document).height() > $(window).height()));\n };\n\n this.$element.on('resizeme.zf.trigger.revealScrollbarListener', () => updateScrollbarClass());\n updateScrollbarClass();\n $('html').addClass('is-reveal-open');\n }\n\n /**\n * Removes classes and listeners on document that were required by open modals.\n * @private\n */\n _removeGlobalClasses() {\n this.$element.off('resizeme.zf.trigger.revealScrollbarListener');\n $('html').removeClass('is-reveal-open');\n $('html').removeClass('zf-has-scroll');\n }\n\n /**\n * Adds extra event handlers for the body and window if necessary.\n * @private\n */\n _addGlobalListeners() {\n var _this = this;\n if(!this.$element) { return; } // If we're in the middle of cleanup, don't freak out\n this.focusableElements = Keyboard.findFocusable(this.$element);\n\n if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) {\n $('body').on('click.zf.dropdown tap.zf.dropdown', function(e) {\n if (e.target === _this.$element[0] ||\n $.contains(_this.$element[0], e.target) ||\n !$.contains(document, e.target)) { return; }\n _this.close();\n });\n }\n\n if (this.options.closeOnEsc) {\n $(window).on('keydown.zf.reveal', function(e) {\n Keyboard.handleKey(e, 'Reveal', {\n close: function() {\n if (_this.options.closeOnEsc) {\n _this.close();\n }\n }\n });\n });\n }\n }\n\n /**\n * Closes the modal.\n * @function\n * @fires Reveal#closed\n */\n close() {\n if (!this.isActive || !this.$element.is(':visible')) {\n return false;\n }\n var _this = this;\n\n // Motion UI method of hiding\n if (this.options.animationOut) {\n if (this.options.overlay) {\n Motion.animateOut(this.$overlay, 'fade-out');\n }\n\n Motion.animateOut(this.$element, this.options.animationOut, finishUp);\n }\n // jQuery method of hiding\n else {\n this.$element.hide(this.options.hideDelay);\n\n if (this.options.overlay) {\n this.$overlay.hide(0, finishUp);\n }\n else {\n finishUp();\n }\n }\n\n // Conditionals to remove extra event listeners added on open\n if (this.options.closeOnEsc) {\n $(window).off('keydown.zf.reveal');\n }\n\n if (!this.options.overlay && this.options.closeOnClick) {\n $('body').off('click.zf.dropdown tap.zf.dropdown');\n }\n\n this.$element.off('keydown.zf.reveal');\n\n function finishUp() {\n\n // Get the current top before the modal is closed and restore the scroll after.\n // TODO: use component properties instead of HTML properties\n // See https://github.com/foundation/foundation-sites/pull/10786\n var scrollTop = parseInt($(\"html\").css(\"top\"));\n\n if ($('.reveal:visible').length === 0) {\n _this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal\n }\n\n Keyboard.releaseFocus(_this.$element);\n\n _this.$element.attr('aria-hidden', true);\n\n if ($('.reveal:visible').length === 0) {\n _this._enableScroll(scrollTop);\n }\n\n /**\n * Fires when the modal is done closing.\n * @event Reveal#closed\n */\n _this.$element.trigger('closed.zf.reveal');\n }\n\n /**\n * Resets the modal content\n * This prevents a running video to keep going in the background\n */\n if (this.options.resetOnClose) {\n this.$element.html(this.$element.html());\n }\n\n this.isActive = false;\n // If deepLink and we did not switched to an other modal...\n if (_this.options.deepLink && window.location.hash === `#${this.id}`) {\n // Remove the history hash\n if (window.history.replaceState) {\n const urlWithoutHash = window.location.pathname + window.location.search;\n if (this.options.updateHistory) {\n window.history.pushState({}, '', urlWithoutHash); // remove the hash\n } else {\n window.history.replaceState('', document.title, urlWithoutHash);\n }\n } else {\n window.location.hash = '';\n }\n }\n\n this.$activeAnchor.focus();\n }\n\n /**\n * Toggles the open/closed state of a modal.\n * @function\n */\n toggle() {\n if (this.isActive) {\n this.close();\n } else {\n this.open();\n }\n };\n\n /**\n * Destroys an instance of a modal.\n * @function\n */\n _destroy() {\n if (this.options.overlay) {\n this.$element.appendTo($(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin()\n this.$overlay.hide().off().remove();\n }\n this.$element.hide().off();\n this.$anchor.off('.zf');\n $(window).off(`.zf.reveal:${this.id}`)\n if (this.onLoadListener) $(window).off(this.onLoadListener);\n\n if ($('.reveal:visible').length === 0) {\n this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal\n }\n };\n}\n\nReveal.defaults = {\n /**\n * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide.\n * @option\n * @type {string}\n * @default ''\n */\n animationIn: '',\n /**\n * Motion-UI class to use for animated elements. If none used, defaults to simple show/hide.\n * @option\n * @type {string}\n * @default ''\n */\n animationOut: '',\n /**\n * Time, in ms, to delay the opening of a modal after a click if no animation used.\n * @option\n * @type {number}\n * @default 0\n */\n showDelay: 0,\n /**\n * Time, in ms, to delay the closing of a modal after a click if no animation used.\n * @option\n * @type {number}\n * @default 0\n */\n hideDelay: 0,\n /**\n * Allows a click on the body/overlay to close the modal.\n * @option\n * @type {boolean}\n * @default true\n */\n closeOnClick: true,\n /**\n * Allows the modal to close if the user presses the `ESCAPE` key.\n * @option\n * @type {boolean}\n * @default true\n */\n closeOnEsc: true,\n /**\n * If true, allows multiple modals to be displayed at once.\n * @option\n * @type {boolean}\n * @default false\n */\n multipleOpened: false,\n /**\n * Distance, in pixels, the modal should push down from the top of the screen.\n * @option\n * @type {number|string}\n * @default auto\n */\n vOffset: 'auto',\n /**\n * Distance, in pixels, the modal should push in from the side of the screen.\n * @option\n * @type {number|string}\n * @default auto\n */\n hOffset: 'auto',\n /**\n * Allows the modal to be fullscreen, completely blocking out the rest of the view. JS checks for this as well.\n * @option\n * @type {boolean}\n * @default false\n */\n fullScreen: false,\n /**\n * Allows the modal to generate an overlay div, which will cover the view when modal opens.\n * @option\n * @type {boolean}\n * @default true\n */\n overlay: true,\n /**\n * Allows the modal to remove and reinject markup on close. Should be true if using video elements w/o using provider's api, otherwise, videos will continue to play in the background.\n * @option\n * @type {boolean}\n * @default false\n */\n resetOnClose: false,\n /**\n * Link the location hash to the modal.\n * Set the location hash when the modal is opened/closed, and open/close the modal when the location changes.\n * @option\n * @type {boolean}\n * @default false\n */\n deepLink: false,\n /**\n * If `deepLink` is enabled, update the browser history with the open modal\n * @option\n * @default false\n */\n updateHistory: false,\n /**\n * Allows the modal to append to custom div.\n * @option\n * @type {string}\n * @default \"body\"\n */\n appendTo: \"body\",\n /**\n * Allows adding additional class names to the reveal overlay.\n * @option\n * @type {string}\n * @default ''\n */\n additionalOverlayClasses: ''\n};\n\nexport {Reveal};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { Move } from './foundation.util.motion';\nimport { GetYoDigits, rtl as Rtl } from './foundation.core.utils';\n\nimport { Plugin } from './foundation.core.plugin';\n\nimport { Touch } from './foundation.util.touch';\n\nimport { Triggers } from './foundation.util.triggers';\n/**\n * Slider module.\n * @module foundation.slider\n * @requires foundation.util.motion\n * @requires foundation.util.triggers\n * @requires foundation.util.keyboard\n * @requires foundation.util.touch\n */\n\nclass Slider extends Plugin {\n /**\n * Creates a new instance of a slider control.\n * @class\n * @name Slider\n * @param {jQuery} element - jQuery object to make into a slider control.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Slider.defaults, this.$element.data(), options);\n this.className = 'Slider'; // ie9 back compat\n\n // Touch and Triggers inits are idempotent, we just need to make sure it's initialied.\n Touch.init($);\n Triggers.init($);\n\n this._init();\n\n Keyboard.register('Slider', {\n 'ltr': {\n 'ARROW_RIGHT': 'increase',\n 'ARROW_UP': 'increase',\n 'ARROW_DOWN': 'decrease',\n 'ARROW_LEFT': 'decrease',\n 'SHIFT_ARROW_RIGHT': 'increase_fast',\n 'SHIFT_ARROW_UP': 'increase_fast',\n 'SHIFT_ARROW_DOWN': 'decrease_fast',\n 'SHIFT_ARROW_LEFT': 'decrease_fast',\n 'HOME': 'min',\n 'END': 'max'\n },\n 'rtl': {\n 'ARROW_LEFT': 'increase',\n 'ARROW_RIGHT': 'decrease',\n 'SHIFT_ARROW_LEFT': 'increase_fast',\n 'SHIFT_ARROW_RIGHT': 'decrease_fast'\n }\n });\n }\n\n /**\n * Initilizes the plugin by reading/setting attributes, creating collections and setting the initial position of the handle(s).\n * @function\n * @private\n */\n _init() {\n this.inputs = this.$element.find('input');\n this.handles = this.$element.find('[data-slider-handle]');\n\n this.$handle = this.handles.eq(0);\n this.$input = this.inputs.length ? this.inputs.eq(0) : $(`#${this.$handle.attr('aria-controls')}`);\n this.$fill = this.$element.find('[data-slider-fill]').css(this.options.vertical ? 'height' : 'width', 0);\n\n var _this = this;\n if (this.options.disabled || this.$element.hasClass(this.options.disabledClass)) {\n this.options.disabled = true;\n this.$element.addClass(this.options.disabledClass);\n }\n if (!this.inputs.length) {\n this.inputs = $().add(this.$input);\n this.options.binding = true;\n }\n\n this._setInitAttr(0);\n\n if (this.handles[1]) {\n this.options.doubleSided = true;\n this.$handle2 = this.handles.eq(1);\n this.$input2 = this.inputs.length > 1 ? this.inputs.eq(1) : $(`#${this.$handle2.attr('aria-controls')}`);\n\n if (!this.inputs[1]) {\n this.inputs = this.inputs.add(this.$input2);\n }\n\n // this.$handle.triggerHandler('click.zf.slider');\n this._setInitAttr(1);\n }\n\n // Set handle positions\n this.setHandles();\n\n this._events();\n }\n\n setHandles() {\n if(this.handles[1]) {\n this._setHandlePos(this.$handle, this.inputs.eq(0).val(), () => {\n this._setHandlePos(this.$handle2, this.inputs.eq(1).val());\n });\n } else {\n this._setHandlePos(this.$handle, this.inputs.eq(0).val());\n }\n }\n\n _reflow() {\n this.setHandles();\n }\n /**\n * @function\n * @private\n * @param {Number} value - floating point (the value) to be transformed using to a relative position on the slider (the inverse of _value)\n */\n _pctOfBar(value) {\n var pctOfBar = percent(value - this.options.start, this.options.end - this.options.start)\n\n switch(this.options.positionValueFunction) {\n case \"pow\":\n pctOfBar = this._logTransform(pctOfBar);\n break;\n case \"log\":\n pctOfBar = this._powTransform(pctOfBar);\n break;\n }\n\n return pctOfBar.toFixed(2)\n }\n\n /**\n * @function\n * @private\n * @param {Number} pctOfBar - floating point, the relative position of the slider (typically between 0-1) to be transformed to a value\n */\n _value(pctOfBar) {\n switch(this.options.positionValueFunction) {\n case \"pow\":\n pctOfBar = this._powTransform(pctOfBar);\n break;\n case \"log\":\n pctOfBar = this._logTransform(pctOfBar);\n break;\n }\n\n var value\n if (this.options.vertical) {\n // linear interpolation which is working with negative values for start\n // https://math.stackexchange.com/a/1019084\n value = parseFloat(this.options.end) + pctOfBar * (this.options.start - this.options.end)\n } else {\n value = (this.options.end - this.options.start) * pctOfBar + parseFloat(this.options.start);\n }\n\n return value\n }\n\n /**\n * @function\n * @private\n * @param {Number} value - floating point (typically between 0-1) to be transformed using the log function\n */\n _logTransform(value) {\n return baseLog(this.options.nonLinearBase, ((value*(this.options.nonLinearBase-1))+1))\n }\n\n /**\n * @function\n * @private\n * @param {Number} value - floating point (typically between 0-1) to be transformed using the power function\n */\n _powTransform(value) {\n return (Math.pow(this.options.nonLinearBase, value) - 1) / (this.options.nonLinearBase - 1)\n }\n\n /**\n * Sets the position of the selected handle and fill bar.\n * @function\n * @private\n * @param {jQuery} $hndl - the selected handle to move.\n * @param {Number} location - floating point between the start and end values of the slider bar.\n * @param {Function} cb - callback function to fire on completion.\n * @fires Slider#moved\n * @fires Slider#changed\n */\n _setHandlePos($hndl, location, cb) {\n // don't move if the slider has been disabled since its initialization\n if (this.$element.hasClass(this.options.disabledClass)) {\n return;\n }\n //might need to alter that slightly for bars that will have odd number selections.\n location = parseFloat(location);//on input change events, convert string to number...grumble.\n\n // prevent slider from running out of bounds, if value exceeds the limits set through options, override the value to min/max\n if (location < this.options.start) { location = this.options.start; }\n else if (location > this.options.end) { location = this.options.end; }\n\n var isDbl = this.options.doubleSided;\n\n if (isDbl) { //this block is to prevent 2 handles from crossing eachother. Could/should be improved.\n if (this.handles.index($hndl) === 0) {\n var h2Val = parseFloat(this.$handle2.attr('aria-valuenow'));\n location = location >= h2Val ? h2Val - this.options.step : location;\n } else {\n var h1Val = parseFloat(this.$handle.attr('aria-valuenow'));\n location = location <= h1Val ? h1Val + this.options.step : location;\n }\n }\n\n var _this = this,\n vert = this.options.vertical,\n hOrW = vert ? 'height' : 'width',\n lOrT = vert ? 'top' : 'left',\n handleDim = $hndl[0].getBoundingClientRect()[hOrW],\n elemDim = this.$element[0].getBoundingClientRect()[hOrW],\n //percentage of bar min/max value based on click or drag point\n pctOfBar = this._pctOfBar(location),\n //number of actual pixels to shift the handle, based on the percentage obtained above\n pxToMove = (elemDim - handleDim) * pctOfBar,\n //percentage of bar to shift the handle\n movement = (percent(pxToMove, elemDim) * 100).toFixed(this.options.decimal);\n //fixing the decimal value for the location number, is passed to other methods as a fixed floating-point value\n location = parseFloat(location.toFixed(this.options.decimal));\n // declare empty object for css adjustments, only used with 2 handled-sliders\n var css = {};\n\n this._setValues($hndl, location);\n\n // TODO update to calculate based on values set to respective inputs??\n if (isDbl) {\n var isLeftHndl = this.handles.index($hndl) === 0,\n //empty variable, will be used for min-height/width for fill bar\n dim,\n //percentage w/h of the handle compared to the slider bar\n handlePct = ~~(percent(handleDim, elemDim) * 100);\n //if left handle, the math is slightly different than if it's the right handle, and the left/top property needs to be changed for the fill bar\n if (isLeftHndl) {\n //left or top percentage value to apply to the fill bar.\n css[lOrT] = `${movement}%`;\n //calculate the new min-height/width for the fill bar.\n dim = parseFloat(this.$handle2[0].style[lOrT]) - movement + handlePct;\n //this callback is necessary to prevent errors and allow the proper placement and initialization of a 2-handled slider\n //plus, it means we don't care if 'dim' isNaN on init, it won't be in the future.\n if (cb && typeof cb === 'function') { cb(); }//this is only needed for the initialization of 2 handled sliders\n } else {\n //just caching the value of the left/bottom handle's left/top property\n var handlePos = parseFloat(this.$handle[0].style[lOrT]);\n //calculate the new min-height/width for the fill bar. Use isNaN to prevent false positives for numbers <= 0\n //based on the percentage of movement of the handle being manipulated, less the opposing handle's left/top position, plus the percentage w/h of the handle itself\n dim = movement - (isNaN(handlePos) ? (this.options.initialStart - this.options.start)/((this.options.end-this.options.start)/100) : handlePos) + handlePct;\n }\n // assign the min-height/width to our css object\n css[`min-${hOrW}`] = `${dim}%`;\n }\n\n this.$element.one('finished.zf.animate', function() {\n /**\n * Fires when the handle is done moving.\n * @event Slider#moved\n */\n _this.$element.trigger('moved.zf.slider', [$hndl]);\n });\n\n //because we don't know exactly how the handle will be moved, check the amount of time it should take to move.\n var moveTime = this.$element.data('dragging') ? 1000/60 : this.options.moveTime;\n\n Move(moveTime, $hndl, function() {\n // adjusting the left/top property of the handle, based on the percentage calculated above\n // if movement isNaN, that is because the slider is hidden and we cannot determine handle width,\n // fall back to next best guess.\n if (isNaN(movement)) {\n $hndl.css(lOrT, `${pctOfBar * 100}%`);\n }\n else {\n $hndl.css(lOrT, `${movement}%`);\n }\n\n if (!_this.options.doubleSided) {\n //if single-handled, a simple method to expand the fill bar\n _this.$fill.css(hOrW, `${pctOfBar * 100}%`);\n } else {\n //otherwise, use the css object we created above\n _this.$fill.css(css);\n }\n });\n\n\n /**\n * Fires when the value has not been change for a given time.\n * @event Slider#changed\n */\n clearTimeout(_this.timeout);\n _this.timeout = setTimeout(function(){\n _this.$element.trigger('changed.zf.slider', [$hndl]);\n }, _this.options.changedDelay);\n }\n\n /**\n * Sets the initial attribute for the slider element.\n * @function\n * @private\n * @param {Number} idx - index of the current handle/input to use.\n */\n _setInitAttr(idx) {\n var initVal = (idx === 0 ? this.options.initialStart : this.options.initialEnd)\n var id = this.inputs.eq(idx).attr('id') || GetYoDigits(6, 'slider');\n this.inputs.eq(idx).attr({\n 'id': id,\n 'max': this.options.end,\n 'min': this.options.start,\n 'step': this.options.step\n });\n this.inputs.eq(idx).val(initVal);\n this.handles.eq(idx).attr({\n 'role': 'slider',\n 'aria-controls': id,\n 'aria-valuemax': this.options.end,\n 'aria-valuemin': this.options.start,\n 'aria-valuenow': initVal,\n 'aria-orientation': this.options.vertical ? 'vertical' : 'horizontal',\n 'tabindex': 0\n });\n }\n\n /**\n * Sets the input and `aria-valuenow` values for the slider element.\n * @function\n * @private\n * @param {jQuery} $handle - the currently selected handle.\n * @param {Number} val - floating point of the new value.\n */\n _setValues($handle, val) {\n var idx = this.options.doubleSided ? this.handles.index($handle) : 0;\n this.inputs.eq(idx).val(val);\n $handle.attr('aria-valuenow', val);\n }\n\n /**\n * Handles events on the slider element.\n * Calculates the new location of the current handle.\n * If there are two handles and the bar was clicked, it determines which handle to move.\n * @function\n * @private\n * @param {Object} e - the `event` object passed from the listener.\n * @param {jQuery} $handle - the current handle to calculate for, if selected.\n * @param {Number} val - floating point number for the new value of the slider.\n * TODO clean this up, there's a lot of repeated code between this and the _setHandlePos fn.\n */\n _handleEvent(e, $handle, val) {\n var value, hasVal;\n if (!val) {//click or drag events\n e.preventDefault();\n var _this = this,\n vertical = this.options.vertical,\n param = vertical ? 'height' : 'width',\n direction = vertical ? 'top' : 'left',\n eventOffset = vertical ? e.pageY : e.pageX,\n barDim = this.$element[0].getBoundingClientRect()[param],\n windowScroll = vertical ? $(window).scrollTop() : $(window).scrollLeft();\n\n var elemOffset = this.$element.offset()[direction];\n\n // touch events emulated by the touch util give position relative to screen, add window.scroll to event coordinates...\n // best way to guess this is simulated is if clientY == pageY\n if (e.clientY === e.pageY) { eventOffset = eventOffset + windowScroll; }\n var eventFromBar = eventOffset - elemOffset;\n var barXY;\n if (eventFromBar < 0) {\n barXY = 0;\n } else if (eventFromBar > barDim) {\n barXY = barDim;\n } else {\n barXY = eventFromBar;\n }\n var offsetPct = percent(barXY, barDim);\n\n value = this._value(offsetPct);\n\n // turn everything around for RTL, yay math!\n if (Rtl() && !this.options.vertical) {value = this.options.end - value;}\n\n value = _this._adjustValue(null, value);\n //boolean flag for the setHandlePos fn, specifically for vertical sliders\n hasVal = false;\n\n if (!$handle) {//figure out which handle it is, pass it to the next function.\n var firstHndlPos = absPosition(this.$handle, direction, barXY, param),\n secndHndlPos = absPosition(this.$handle2, direction, barXY, param);\n $handle = firstHndlPos <= secndHndlPos ? this.$handle : this.$handle2;\n }\n\n } else {//change event on input\n value = this._adjustValue(null, val);\n hasVal = true;\n }\n\n this._setHandlePos($handle, value);\n }\n\n /**\n * Adjustes value for handle in regard to step value. returns adjusted value\n * @function\n * @private\n * @param {jQuery} $handle - the selected handle.\n * @param {Number} value - value to adjust. used if $handle is falsy\n */\n _adjustValue($handle, value) {\n var val,\n step = this.options.step,\n div = parseFloat(step/2),\n left, prev_val, next_val;\n if (!!$handle) {\n val = parseFloat($handle.attr('aria-valuenow'));\n }\n else {\n val = value;\n }\n if (val >= 0) {\n left = val % step;\n } else {\n left = step + (val % step);\n }\n prev_val = val - left;\n next_val = prev_val + step;\n if (left === 0) {\n return val;\n }\n val = val >= prev_val + div ? next_val : prev_val;\n return val;\n }\n\n /**\n * Adds event listeners to the slider elements.\n * @function\n * @private\n */\n _events() {\n this._eventsForHandle(this.$handle);\n if(this.handles[1]) {\n this._eventsForHandle(this.$handle2);\n }\n }\n\n\n /**\n * Adds event listeners a particular handle\n * @function\n * @private\n * @param {jQuery} $handle - the current handle to apply listeners to.\n */\n _eventsForHandle($handle) {\n var _this = this,\n curHandle;\n\n const handleChangeEvent = function(e) {\n const idx = _this.inputs.index($(this));\n _this._handleEvent(e, _this.handles.eq(idx), $(this).val());\n };\n\n // IE only triggers the change event when the input loses focus which strictly follows the HTML specification\n // listen for the enter key and trigger a change\n // @see https://html.spec.whatwg.org/multipage/input.html#common-input-element-events\n this.inputs.off('keyup.zf.slider').on('keyup.zf.slider', function (e) {\n if(e.keyCode == 13) handleChangeEvent.call(this, e);\n });\n\n this.inputs.off('change.zf.slider').on('change.zf.slider', handleChangeEvent);\n\n if (this.options.clickSelect) {\n this.$element.off('click.zf.slider').on('click.zf.slider', function(e) {\n if (_this.$element.data('dragging')) { return false; }\n\n if (!$(e.target).is('[data-slider-handle]')) {\n if (_this.options.doubleSided) {\n _this._handleEvent(e);\n } else {\n _this._handleEvent(e, _this.$handle);\n }\n }\n });\n }\n\n if (this.options.draggable) {\n this.handles.addTouch();\n\n var $body = $('body');\n $handle\n .off('mousedown.zf.slider')\n .on('mousedown.zf.slider', function(e) {\n $handle.addClass('is-dragging');\n _this.$fill.addClass('is-dragging');//\n _this.$element.data('dragging', true);\n\n curHandle = $(e.currentTarget);\n\n $body.on('mousemove.zf.slider', function(e) {\n e.preventDefault();\n _this._handleEvent(e, curHandle);\n\n }).on('mouseup.zf.slider', function(e) {\n _this._handleEvent(e, curHandle);\n\n $handle.removeClass('is-dragging');\n _this.$fill.removeClass('is-dragging');\n _this.$element.data('dragging', false);\n\n $body.off('mousemove.zf.slider mouseup.zf.slider');\n });\n })\n // prevent events triggered by touch\n .on('selectstart.zf.slider touchmove.zf.slider', function(e) {\n e.preventDefault();\n });\n }\n\n $handle.off('keydown.zf.slider').on('keydown.zf.slider', function(e) {\n var _$handle = $(this),\n idx = _this.options.doubleSided ? _this.handles.index(_$handle) : 0,\n oldValue = parseFloat(_this.inputs.eq(idx).val()),\n newValue;\n\n // handle keyboard event with keyboard util\n Keyboard.handleKey(e, 'Slider', {\n decrease: function() {\n newValue = oldValue - _this.options.step;\n },\n increase: function() {\n newValue = oldValue + _this.options.step;\n },\n decrease_fast: function() {\n newValue = oldValue - _this.options.step * 10;\n },\n increase_fast: function() {\n newValue = oldValue + _this.options.step * 10;\n },\n min: function() {\n newValue = _this.options.start;\n },\n max: function() {\n newValue = _this.options.end;\n },\n handled: function() { // only set handle pos when event was handled specially\n e.preventDefault();\n _this._setHandlePos(_$handle, newValue);\n }\n });\n /*if (newValue) { // if pressed key has special function, update value\n e.preventDefault();\n _this._setHandlePos(_$handle, newValue);\n }*/\n });\n }\n\n /**\n * Destroys the slider plugin.\n */\n _destroy() {\n this.handles.off('.zf.slider');\n this.inputs.off('.zf.slider');\n this.$element.off('.zf.slider');\n\n clearTimeout(this.timeout);\n }\n}\n\nSlider.defaults = {\n /**\n * Minimum value for the slider scale.\n * @option\n * @type {number}\n * @default 0\n */\n start: 0,\n /**\n * Maximum value for the slider scale.\n * @option\n * @type {number}\n * @default 100\n */\n end: 100,\n /**\n * Minimum value change per change event.\n * @option\n * @type {number}\n * @default 1\n */\n step: 1,\n /**\n * Value at which the handle/input *(left handle/first input)* should be set to on initialization.\n * @option\n * @type {number}\n * @default 0\n */\n initialStart: 0,\n /**\n * Value at which the right handle/second input should be set to on initialization.\n * @option\n * @type {number}\n * @default 100\n */\n initialEnd: 100,\n /**\n * Allows the input to be located outside the container and visible. Set to by the JS\n * @option\n * @type {boolean}\n * @default false\n */\n binding: false,\n /**\n * Allows the user to click/tap on the slider bar to select a value.\n * @option\n * @type {boolean}\n * @default true\n */\n clickSelect: true,\n /**\n * Set to true and use the `vertical` class to change alignment to vertical.\n * @option\n * @type {boolean}\n * @default false\n */\n vertical: false,\n /**\n * Allows the user to drag the slider handle(s) to select a value.\n * @option\n * @type {boolean}\n * @default true\n */\n draggable: true,\n /**\n * Disables the slider and prevents event listeners from being applied. Double checked by JS with `disabledClass`.\n * @option\n * @type {boolean}\n * @default false\n */\n disabled: false,\n /**\n * Allows the use of two handles. Double checked by the JS. Changes some logic handling.\n * @option\n * @type {boolean}\n * @default false\n */\n doubleSided: false,\n /**\n * Potential future feature.\n */\n // steps: 100,\n /**\n * Number of decimal places the plugin should go to for floating point precision.\n * @option\n * @type {number}\n * @default 2\n */\n decimal: 2,\n /**\n * Time delay for dragged elements.\n */\n // dragDelay: 0,\n /**\n * Time, in ms, to animate the movement of a slider handle if user clicks/taps on the bar. Needs to be manually set if updating the transition time in the Sass settings.\n * @option\n * @type {number}\n * @default 200\n */\n moveTime: 200,//update this if changing the transition time in the sass\n /**\n * Class applied to disabled sliders.\n * @option\n * @type {string}\n * @default 'disabled'\n */\n disabledClass: 'disabled',\n /**\n * Will invert the default layout for a vertical<span data-tooltip title=\"who would do this???\"> </span>slider.\n * @option\n * @type {boolean}\n * @default false\n */\n invertVertical: false,\n /**\n * Milliseconds before the `changed.zf-slider` event is triggered after value change.\n * @option\n * @type {number}\n * @default 500\n */\n changedDelay: 500,\n /**\n * Basevalue for non-linear sliders\n * @option\n * @type {number}\n * @default 5\n */\n nonLinearBase: 5,\n /**\n * Basevalue for non-linear sliders, possible values are: `'linear'`, `'pow'` & `'log'`. Pow and Log use the nonLinearBase setting.\n * @option\n * @type {string}\n * @default 'linear'\n */\n positionValueFunction: 'linear',\n};\n\nfunction percent(frac, num) {\n return (frac / num);\n}\nfunction absPosition($handle, dir, clickPos, param) {\n return Math.abs(($handle.position()[dir] + ($handle[param]() / 2)) - clickPos);\n}\nfunction baseLog(base, value) {\n return Math.log(value)/Math.log(base)\n}\n\nexport {Slider};\n","import $ from 'jquery';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { Plugin } from './foundation.core.plugin';\n\n/**\n * SmoothScroll module.\n * @module foundation.smoothScroll\n */\nclass SmoothScroll extends Plugin {\n /**\n * Creates a new instance of SmoothScroll.\n * @class\n * @name SmoothScroll\n * @fires SmoothScroll#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, SmoothScroll.defaults, this.$element.data(), options);\n this.className = 'SmoothScroll'; // ie9 back compat\n\n this._init();\n }\n\n /**\n * Initialize the SmoothScroll plugin\n * @private\n */\n _init() {\n const id = this.$element[0].id || GetYoDigits(6, 'smooth-scroll');\n this.$element.attr({ id });\n\n this._events();\n }\n\n /**\n * Initializes events for SmoothScroll.\n * @private\n */\n _events() {\n this._linkClickListener = this._handleLinkClick.bind(this);\n this.$element.on('click.zf.smoothScroll', this._linkClickListener);\n this.$element.on('click.zf.smoothScroll', 'a[href^=\"#\"]', this._linkClickListener);\n }\n\n /**\n * Handle the given event to smoothly scroll to the anchor pointed by the event target.\n * @param {*} e - event\n * @function\n * @private\n */\n _handleLinkClick(e) {\n // Follow the link if it does not point to an anchor.\n if (!$(e.currentTarget).is('a[href^=\"#\"]')) return;\n\n const arrival = e.currentTarget.getAttribute('href');\n\n this._inTransition = true;\n\n SmoothScroll.scrollToLoc(arrival, this.options, () => {\n this._inTransition = false;\n });\n\n e.preventDefault();\n };\n\n /**\n * Function to scroll to a given location on the page.\n * @param {String} loc - A properly formatted jQuery id selector. Example: '#foo'\n * @param {Object} options - The options to use.\n * @param {Function} callback - The callback function.\n * @static\n * @function\n */\n static scrollToLoc(loc, options = SmoothScroll.defaults, callback) {\n const $loc = $(loc);\n\n // Do nothing if target does not exist to prevent errors\n if (!$loc.length) return false;\n\n var scrollPos = Math.round($loc.offset().top - options.threshold / 2 - options.offset);\n\n $('html, body').stop(true).animate(\n { scrollTop: scrollPos },\n options.animationDuration,\n options.animationEasing,\n () => {\n if (typeof callback === 'function'){\n callback();\n }\n }\n );\n }\n\n /**\n * Destroys the SmoothScroll instance.\n * @function\n */\n _destroy() {\n this.$element.off('click.zf.smoothScroll', this._linkClickListener)\n this.$element.off('click.zf.smoothScroll', 'a[href^=\"#\"]', this._linkClickListener);\n }\n}\n\n/**\n * Default settings for plugin.\n */\nSmoothScroll.defaults = {\n /**\n * Amount of time, in ms, the animated scrolling should take between locations.\n * @option\n * @type {number}\n * @default 500\n */\n animationDuration: 500,\n /**\n * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.\n * @option\n * @type {string}\n * @default 'linear'\n * @see {@link https://api.jquery.com/animate|Jquery animate}\n */\n animationEasing: 'linear',\n /**\n * Number of pixels to use as a marker for location changes.\n * @option\n * @type {number}\n * @default 50\n */\n threshold: 50,\n /**\n * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.\n * @option\n * @type {number}\n * @default 0\n */\n offset: 0\n}\n\nexport {SmoothScroll}\n","'use strict';\n\nimport $ from 'jquery';\nimport { Plugin } from './foundation.core.plugin';\nimport { onLoad, GetYoDigits } from './foundation.core.utils';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Triggers } from './foundation.util.triggers';\n\n/**\n * Sticky module.\n * @module foundation.sticky\n * @requires foundation.util.triggers\n * @requires foundation.util.mediaQuery\n */\n\nclass Sticky extends Plugin {\n /**\n * Creates a new instance of a sticky thing.\n * @class\n * @name Sticky\n * @param {jQuery} element - jQuery object to make sticky.\n * @param {Object} options - options object passed when creating the element programmatically.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Sticky.defaults, this.$element.data(), options);\n this.className = 'Sticky'; // ie9 back compat\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n\n this._init();\n }\n\n /**\n * Initializes the sticky element by adding classes, getting/setting dimensions, breakpoints and attributes\n * @function\n * @private\n */\n _init() {\n MediaQuery._init();\n\n var $parent = this.$element.parent('[data-sticky-container]'),\n id = this.$element[0].id || GetYoDigits(6, 'sticky'),\n _this = this;\n\n if($parent.length){\n this.$container = $parent;\n } else {\n this.wasWrapped = true;\n this.$element.wrap(this.options.container);\n this.$container = this.$element.parent();\n }\n this.$container.addClass(this.options.containerClass);\n\n this.$element.addClass(this.options.stickyClass).attr({ 'data-resize': id, 'data-mutate': id });\n if (this.options.anchor !== '') {\n $('#' + _this.options.anchor).attr({ 'data-mutate': id });\n }\n\n this.scrollCount = this.options.checkEvery;\n this.isStuck = false;\n this.onLoadListener = onLoad($(window), function () {\n //We calculate the container height to have correct values for anchor points offset calculation.\n _this.containerHeight = _this.$element.css(\"display\") == \"none\" ? 0 : _this.$element[0].getBoundingClientRect().height;\n _this.$container.css('height', _this.containerHeight);\n _this.elemHeight = _this.containerHeight;\n if (_this.options.anchor !== '') {\n _this.$anchor = $('#' + _this.options.anchor);\n } else {\n _this._parsePoints();\n }\n\n _this._setSizes(function () {\n var scroll = window.pageYOffset;\n _this._calc(false, scroll);\n //Unstick the element will ensure that proper classes are set.\n if (!_this.isStuck) {\n _this._removeSticky((scroll >= _this.topPoint) ? false : true);\n }\n });\n _this._events(id.split('-').reverse().join('-'));\n });\n }\n\n /**\n * If using multiple elements as anchors, calculates the top and bottom pixel values the sticky thing should stick and unstick on.\n * @function\n * @private\n */\n _parsePoints() {\n var top = this.options.topAnchor == \"\" ? 1 : this.options.topAnchor,\n btm = this.options.btmAnchor== \"\" ? document.documentElement.scrollHeight : this.options.btmAnchor,\n pts = [top, btm],\n breaks = {};\n for (var i = 0, len = pts.length; i < len && pts[i]; i++) {\n var pt;\n if (typeof pts[i] === 'number') {\n pt = pts[i];\n } else {\n var place = pts[i].split(':'),\n anchor = $(`#${place[0]}`);\n\n pt = anchor.offset().top;\n if (place[1] && place[1].toLowerCase() === 'bottom') {\n pt += anchor[0].getBoundingClientRect().height;\n }\n }\n breaks[i] = pt;\n }\n\n\n this.points = breaks;\n return;\n }\n\n /**\n * Adds event handlers for the scrolling element.\n * @private\n * @param {String} id - pseudo-random id for unique scroll event listener.\n */\n _events(id) {\n var _this = this,\n scrollListener = this.scrollListener = `scroll.zf.${id}`;\n if (this.isOn) { return; }\n if (this.canStick) {\n this.isOn = true;\n $(window).off(scrollListener)\n .on(scrollListener, function(e) {\n if (_this.scrollCount === 0) {\n _this.scrollCount = _this.options.checkEvery;\n _this._setSizes(function() {\n _this._calc(false, window.pageYOffset);\n });\n } else {\n _this.scrollCount--;\n _this._calc(false, window.pageYOffset);\n }\n });\n }\n\n this.$element.off('resizeme.zf.trigger')\n .on('resizeme.zf.trigger', function(e, el) {\n _this._eventsHandler(id);\n });\n\n this.$element.on('mutateme.zf.trigger', function (e, el) {\n _this._eventsHandler(id);\n });\n\n if(this.$anchor) {\n this.$anchor.on('mutateme.zf.trigger', function (e, el) {\n _this._eventsHandler(id);\n });\n }\n }\n\n /**\n * Handler for events.\n * @private\n * @param {String} id - pseudo-random id for unique scroll event listener.\n */\n _eventsHandler(id) {\n var _this = this,\n scrollListener = this.scrollListener = `scroll.zf.${id}`;\n\n _this._setSizes(function() {\n _this._calc(false);\n if (_this.canStick) {\n if (!_this.isOn) {\n _this._events(id);\n }\n } else if (_this.isOn) {\n _this._pauseListeners(scrollListener);\n }\n });\n }\n\n /**\n * Removes event handlers for scroll and change events on anchor.\n * @fires Sticky#pause\n * @param {String} scrollListener - unique, namespaced scroll listener attached to `window`\n */\n _pauseListeners(scrollListener) {\n this.isOn = false;\n $(window).off(scrollListener);\n\n /**\n * Fires when the plugin is paused due to resize event shrinking the view.\n * @event Sticky#pause\n * @private\n */\n this.$element.trigger('pause.zf.sticky');\n }\n\n /**\n * Called on every `scroll` event and on `_init`\n * fires functions based on booleans and cached values\n * @param {Boolean} checkSizes - true if plugin should recalculate sizes and breakpoints.\n * @param {Number} scroll - current scroll position passed from scroll event cb function. If not passed, defaults to `window.pageYOffset`.\n */\n _calc(checkSizes, scroll) {\n if (checkSizes) { this._setSizes(); }\n\n if (!this.canStick) {\n if (this.isStuck) {\n this._removeSticky(true);\n }\n return false;\n }\n\n if (!scroll) { scroll = window.pageYOffset; }\n\n if (scroll >= this.topPoint) {\n if (scroll <= this.bottomPoint) {\n if (!this.isStuck) {\n this._setSticky();\n }\n } else {\n if (this.isStuck) {\n this._removeSticky(false);\n }\n }\n } else {\n if (this.isStuck) {\n this._removeSticky(true);\n }\n }\n }\n\n /**\n * Causes the $element to become stuck.\n * Adds `position: fixed;`, and helper classes.\n * @fires Sticky#stuckto\n * @function\n * @private\n */\n _setSticky() {\n var _this = this,\n stickTo = this.options.stickTo,\n mrgn = stickTo === 'top' ? 'marginTop' : 'marginBottom',\n notStuckTo = stickTo === 'top' ? 'bottom' : 'top',\n css = {};\n\n css[mrgn] = `${this.options[mrgn]}em`;\n css[stickTo] = 0;\n css[notStuckTo] = 'auto';\n this.isStuck = true;\n this.$element.removeClass(`is-anchored is-at-${notStuckTo}`)\n .addClass(`is-stuck is-at-${stickTo}`)\n .css(css)\n /**\n * Fires when the $element has become `position: fixed;`\n * Namespaced to `top` or `bottom`, e.g. `sticky.zf.stuckto:top`\n * @event Sticky#stuckto\n */\n .trigger(`sticky.zf.stuckto:${stickTo}`);\n this.$element.on(\"transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd\", function() {\n _this._setSizes();\n });\n }\n\n /**\n * Causes the $element to become unstuck.\n * Removes `position: fixed;`, and helper classes.\n * Adds other helper classes.\n * @param {Boolean} isTop - tells the function if the $element should anchor to the top or bottom of its $anchor element.\n * @fires Sticky#unstuckfrom\n * @private\n */\n _removeSticky(isTop) {\n var stickTo = this.options.stickTo,\n stickToTop = stickTo === 'top',\n css = {},\n anchorPt = (this.points ? this.points[1] - this.points[0] : this.anchorHeight) - this.elemHeight,\n mrgn = stickToTop ? 'marginTop' : 'marginBottom',\n topOrBottom = isTop ? 'top' : 'bottom';\n\n css[mrgn] = 0;\n\n css['bottom'] = 'auto';\n if(isTop) {\n css['top'] = 0;\n } else {\n css['top'] = anchorPt;\n }\n\n this.isStuck = false;\n this.$element.removeClass(`is-stuck is-at-${stickTo}`)\n .addClass(`is-anchored is-at-${topOrBottom}`)\n .css(css)\n /**\n * Fires when the $element has become anchored.\n * Namespaced to `top` or `bottom`, e.g. `sticky.zf.unstuckfrom:bottom`\n * @event Sticky#unstuckfrom\n */\n .trigger(`sticky.zf.unstuckfrom:${topOrBottom}`);\n }\n\n /**\n * Sets the $element and $container sizes for plugin.\n * Calls `_setBreakPoints`.\n * @param {Function} cb - optional callback function to fire on completion of `_setBreakPoints`.\n * @private\n */\n _setSizes(cb) {\n this.canStick = MediaQuery.is(this.options.stickyOn);\n if (!this.canStick) {\n if (cb && typeof cb === 'function') { cb(); }\n }\n\n var _this = this,\n newElemWidth = this.$container[0].getBoundingClientRect().width,\n comp = window.getComputedStyle(this.$container[0]),\n pdngl = parseInt(comp['padding-left'], 10),\n pdngr = parseInt(comp['padding-right'], 10);\n\n if (this.$anchor && this.$anchor.length) {\n this.anchorHeight = this.$anchor[0].getBoundingClientRect().height;\n } else {\n this._parsePoints();\n }\n\n this.$element.css({\n 'max-width': `${newElemWidth - pdngl - pdngr}px`\n });\n\n // Recalculate the height only if it is \"dynamic\"\n if (this.options.dynamicHeight || !this.containerHeight) {\n // Get the sticked element height and apply it to the container to \"hold the place\"\n var newContainerHeight = this.$element[0].getBoundingClientRect().height || this.containerHeight;\n newContainerHeight = this.$element.css(\"display\") == \"none\" ? 0 : newContainerHeight;\n this.$container.css('height', newContainerHeight);\n this.containerHeight = newContainerHeight;\n }\n this.elemHeight = this.containerHeight;\n\n if (!this.isStuck) {\n if (this.$element.hasClass('is-at-bottom')) {\n var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight;\n this.$element.css('top', anchorPt);\n }\n }\n\n this._setBreakPoints(this.containerHeight, function() {\n if (cb && typeof cb === 'function') { cb(); }\n });\n }\n\n /**\n * Sets the upper and lower breakpoints for the element to become sticky/unsticky.\n * @param {Number} elemHeight - px value for sticky.$element height, calculated by `_setSizes`.\n * @param {Function} cb - optional callback function to be called on completion.\n * @private\n */\n _setBreakPoints(elemHeight, cb) {\n if (!this.canStick) {\n if (cb && typeof cb === 'function') { cb(); }\n else { return false; }\n }\n var mTop = emCalc(this.options.marginTop),\n mBtm = emCalc(this.options.marginBottom),\n topPoint = this.points ? this.points[0] : this.$anchor.offset().top,\n bottomPoint = this.points ? this.points[1] : topPoint + this.anchorHeight,\n // topPoint = this.$anchor.offset().top || this.points[0],\n // bottomPoint = topPoint + this.anchorHeight || this.points[1],\n winHeight = window.innerHeight;\n\n if (this.options.stickTo === 'top') {\n topPoint -= mTop;\n bottomPoint -= (elemHeight + mTop);\n } else if (this.options.stickTo === 'bottom') {\n topPoint -= (winHeight - (elemHeight + mBtm));\n bottomPoint -= (winHeight - mBtm);\n } else {\n //this would be the stickTo: both option... tricky\n }\n\n this.topPoint = topPoint;\n this.bottomPoint = bottomPoint;\n\n if (cb && typeof cb === 'function') { cb(); }\n }\n\n /**\n * Destroys the current sticky element.\n * Resets the element to the top position first.\n * Removes event listeners, JS-added css properties and classes, and unwraps the $element if the JS added the $container.\n * @function\n */\n _destroy() {\n this._removeSticky(true);\n\n this.$element.removeClass(`${this.options.stickyClass} is-anchored is-at-top`)\n .css({\n height: '',\n top: '',\n bottom: '',\n 'max-width': ''\n })\n .off('resizeme.zf.trigger')\n .off('mutateme.zf.trigger');\n if (this.$anchor && this.$anchor.length) {\n this.$anchor.off('change.zf.sticky');\n }\n if (this.scrollListener) $(window).off(this.scrollListener)\n if (this.onLoadListener) $(window).off(this.onLoadListener)\n\n if (this.wasWrapped) {\n this.$element.unwrap();\n } else {\n this.$container.removeClass(this.options.containerClass)\n .css({\n height: ''\n });\n }\n }\n}\n\nSticky.defaults = {\n /**\n * Customizable container template. Add your own classes for styling and sizing.\n * @option\n * @type {string}\n * @default '<div data-sticky-container></div>'\n */\n container: '<div data-sticky-container></div>',\n /**\n * Location in the view the element sticks to. Can be `'top'` or `'bottom'`.\n * @option\n * @type {string}\n * @default 'top'\n */\n stickTo: 'top',\n /**\n * If anchored to a single element, the id of that element.\n * @option\n * @type {string}\n * @default ''\n */\n anchor: '',\n /**\n * If using more than one element as anchor points, the id of the top anchor.\n * @option\n * @type {string}\n * @default ''\n */\n topAnchor: '',\n /**\n * If using more than one element as anchor points, the id of the bottom anchor.\n * @option\n * @type {string}\n * @default ''\n */\n btmAnchor: '',\n /**\n * Margin, in `em`'s to apply to the top of the element when it becomes sticky.\n * @option\n * @type {number}\n * @default 1\n */\n marginTop: 1,\n /**\n * Margin, in `em`'s to apply to the bottom of the element when it becomes sticky.\n * @option\n * @type {number}\n * @default 1\n */\n marginBottom: 1,\n /**\n * Breakpoint string that is the minimum screen size an element should become sticky.\n * @option\n * @type {string}\n * @default 'medium'\n */\n stickyOn: 'medium',\n /**\n * Class applied to sticky element, and removed on destruction. Foundation defaults to `sticky`.\n * @option\n * @type {string}\n * @default 'sticky'\n */\n stickyClass: 'sticky',\n /**\n * Class applied to sticky container. Foundation defaults to `sticky-container`.\n * @option\n * @type {string}\n * @default 'sticky-container'\n */\n containerClass: 'sticky-container',\n /**\n * If true (by default), keep the sticky container the same height as the element. Otherwise, the container height is set once and does not change.\n * @option\n * @type {boolean}\n * @default true\n */\n dynamicHeight: true,\n /**\n * Number of scroll events between the plugin's recalculating sticky points. Setting it to `0` will cause it to recalc every scroll event, setting it to `-1` will prevent recalc on scroll.\n * @option\n * @type {number}\n * @default -1\n */\n checkEvery: -1\n};\n\n/**\n * Helper function to calculate em values\n * @param Number {em} - number of em's to calculate into pixels\n */\nfunction emCalc(em) {\n return parseInt(window.getComputedStyle(document.body, null).fontSize, 10) * em;\n}\n\nexport {Sticky};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Plugin } from './foundation.core.plugin';\nimport { onLoad } from './foundation.core.utils';\nimport { Keyboard } from './foundation.util.keyboard';\nimport { onImagesLoaded } from './foundation.util.imageLoader';\n/**\n * Tabs module.\n * @module foundation.tabs\n * @requires foundation.util.keyboard\n * @requires foundation.util.imageLoader if tabs contain images\n */\n\nclass Tabs extends Plugin {\n /**\n * Creates a new instance of tabs.\n * @class\n * @name Tabs\n * @fires Tabs#init\n * @param {jQuery} element - jQuery object to make into tabs.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Tabs.defaults, this.$element.data(), options);\n this.className = 'Tabs'; // ie9 back compat\n\n this._init();\n Keyboard.register('Tabs', {\n 'ENTER': 'open',\n 'SPACE': 'open',\n 'ARROW_RIGHT': 'next',\n 'ARROW_UP': 'previous',\n 'ARROW_DOWN': 'next',\n 'ARROW_LEFT': 'previous'\n // 'TAB': 'next',\n // 'SHIFT_TAB': 'previous'\n });\n }\n\n /**\n * Initializes the tabs by showing and focusing (if autoFocus=true) the preset active tab.\n * @private\n */\n _init() {\n var _this = this;\n this._isInitializing = true;\n\n this.$element.attr({'role': 'tablist'});\n this.$tabTitles = this.$element.find(`.${this.options.linkClass}`);\n this.$tabContent = $(`[data-tabs-content=\"${this.$element[0].id}\"]`);\n\n this.$tabTitles.each(function(){\n var $elem = $(this),\n $link = $elem.find('a'),\n isActive = $elem.hasClass(`${_this.options.linkActiveClass}`),\n hash = $link.attr('data-tabs-target') || $link[0].hash.slice(1),\n linkId = $link[0].id ? $link[0].id : `${hash}-label`,\n $tabContent = $(`#${hash}`);\n\n $elem.attr({'role': 'presentation'});\n\n $link.attr({\n 'role': 'tab',\n 'aria-controls': hash,\n 'aria-selected': isActive,\n 'id': linkId,\n 'tabindex': isActive ? '0' : '-1'\n });\n\n $tabContent.attr({\n 'role': 'tabpanel',\n 'aria-labelledby': linkId\n });\n\n // Save up the initial hash to return to it later when going back in history\n if (isActive) {\n _this._initialAnchor = `#${hash}`;\n }\n\n if(!isActive) {\n $tabContent.attr('aria-hidden', 'true');\n }\n\n if(isActive && _this.options.autoFocus){\n _this.onLoadListener = onLoad($(window), function() {\n $('html, body').animate({ scrollTop: $elem.offset().top }, _this.options.deepLinkSmudgeDelay, () => {\n $link.focus();\n });\n });\n }\n });\n\n if(this.options.matchHeight) {\n var $images = this.$tabContent.find('img');\n\n if ($images.length) {\n onImagesLoaded($images, this._setHeight.bind(this));\n } else {\n this._setHeight();\n }\n }\n\n // Current context-bound function to open tabs on page load or history hashchange\n this._checkDeepLink = () => {\n var anchor = window.location.hash;\n\n if (!anchor.length) {\n // If we are still initializing and there is no anchor, then there is nothing to do\n if (this._isInitializing) return;\n // Otherwise, move to the initial anchor\n if (this._initialAnchor) anchor = this._initialAnchor;\n }\n\n var anchorNoHash = anchor.indexOf('#') >= 0 ? anchor.slice(1) : anchor;\n var $anchor = anchorNoHash && $(`#${anchorNoHash}`);\n var $link = anchor && this.$element.find(`[href$=\"${anchor}\"],[data-tabs-target=\"${anchorNoHash}\"]`).first();\n // Whether the anchor element that has been found is part of this element\n var isOwnAnchor = !!($anchor.length && $link.length);\n\n if (isOwnAnchor) {\n // If there is an anchor for the hash, select it\n if ($anchor && $anchor.length && $link && $link.length) {\n this.selectTab($anchor, true);\n }\n // Otherwise, collapse everything\n else {\n this._collapse();\n }\n\n // Roll up a little to show the titles\n if (this.options.deepLinkSmudge) {\n var offset = this.$element.offset();\n $('html, body').animate({ scrollTop: offset.top }, this.options.deepLinkSmudgeDelay);\n }\n\n /**\n * Fires when the plugin has deeplinked at pageload\n * @event Tabs#deeplink\n */\n this.$element.trigger('deeplink.zf.tabs', [$link, $anchor]);\n }\n }\n\n //use browser to open a tab, if it exists in this tabset\n if (this.options.deepLink) {\n this._checkDeepLink();\n }\n\n this._events();\n\n this._isInitializing = false;\n }\n\n /**\n * Adds event handlers for items within the tabs.\n * @private\n */\n _events() {\n this._addKeyHandler();\n this._addClickHandler();\n this._setHeightMqHandler = null;\n\n if (this.options.matchHeight) {\n this._setHeightMqHandler = this._setHeight.bind(this);\n\n $(window).on('changed.zf.mediaquery', this._setHeightMqHandler);\n }\n\n if(this.options.deepLink) {\n $(window).on('hashchange', this._checkDeepLink);\n }\n }\n\n /**\n * Adds click handlers for items within the tabs.\n * @private\n */\n _addClickHandler() {\n var _this = this;\n\n this.$element\n .off('click.zf.tabs')\n .on('click.zf.tabs', `.${this.options.linkClass}`, function(e){\n e.preventDefault();\n _this._handleTabChange($(this));\n });\n }\n\n /**\n * Adds keyboard event handlers for items within the tabs.\n * @private\n */\n _addKeyHandler() {\n var _this = this;\n\n this.$tabTitles.off('keydown.zf.tabs').on('keydown.zf.tabs', function(e){\n if (e.which === 9) return;\n\n\n var $element = $(this),\n $elements = $element.parent('ul').children('li'),\n $prevElement,\n $nextElement;\n\n $elements.each(function(i) {\n if ($(this).is($element)) {\n if (_this.options.wrapOnKeys) {\n $prevElement = i === 0 ? $elements.last() : $elements.eq(i-1);\n $nextElement = i === $elements.length -1 ? $elements.first() : $elements.eq(i+1);\n } else {\n $prevElement = $elements.eq(Math.max(0, i-1));\n $nextElement = $elements.eq(Math.min(i+1, $elements.length-1));\n }\n return;\n }\n });\n\n // handle keyboard event with keyboard util\n Keyboard.handleKey(e, 'Tabs', {\n open: function() {\n $element.find('[role=\"tab\"]').focus();\n _this._handleTabChange($element);\n },\n previous: function() {\n $prevElement.find('[role=\"tab\"]').focus();\n _this._handleTabChange($prevElement);\n },\n next: function() {\n $nextElement.find('[role=\"tab\"]').focus();\n _this._handleTabChange($nextElement);\n },\n handled: function() {\n e.preventDefault();\n }\n });\n });\n }\n\n /**\n * Opens the tab `$targetContent` defined by `$target`. Collapses active tab.\n * @param {jQuery} $target - Tab to open.\n * @param {boolean} historyHandled - browser has already handled a history update\n * @fires Tabs#change\n * @function\n */\n _handleTabChange($target, historyHandled) {\n\n // With `activeCollapse`, if the target is the active Tab, collapse it.\n if ($target.hasClass(`${this.options.linkActiveClass}`)) {\n if(this.options.activeCollapse) {\n this._collapse();\n }\n return;\n }\n\n var $oldTab = this.$element.\n find(`.${this.options.linkClass}.${this.options.linkActiveClass}`),\n $tabLink = $target.find('[role=\"tab\"]'),\n target = $tabLink.attr('data-tabs-target'),\n anchor = target && target.length ? `#${target}` : $tabLink[0].hash,\n $targetContent = this.$tabContent.find(anchor);\n\n //close old tab\n this._collapseTab($oldTab);\n\n //open new tab\n this._openTab($target);\n\n //either replace or update browser history\n if (this.options.deepLink && !historyHandled) {\n if (this.options.updateHistory) {\n history.pushState({}, '', anchor);\n } else {\n history.replaceState({}, '', anchor);\n }\n }\n\n /**\n * Fires when the plugin has successfully changed tabs.\n * @event Tabs#change\n */\n this.$element.trigger('change.zf.tabs', [$target, $targetContent]);\n\n //fire to children a mutation event\n $targetContent.find(\"[data-mutate]\").trigger(\"mutateme.zf.trigger\");\n }\n\n /**\n * Opens the tab `$targetContent` defined by `$target`.\n * @param {jQuery} $target - Tab to open.\n * @function\n */\n _openTab($target) {\n var $tabLink = $target.find('[role=\"tab\"]'),\n hash = $tabLink.attr('data-tabs-target') || $tabLink[0].hash.slice(1),\n $targetContent = this.$tabContent.find(`#${hash}`);\n\n $target.addClass(`${this.options.linkActiveClass}`);\n\n $tabLink.attr({\n 'aria-selected': 'true',\n 'tabindex': '0'\n });\n\n $targetContent\n .addClass(`${this.options.panelActiveClass}`).removeAttr('aria-hidden');\n }\n\n /**\n * Collapses `$targetContent` defined by `$target`.\n * @param {jQuery} $target - Tab to collapse.\n * @function\n */\n _collapseTab($target) {\n var $target_anchor = $target\n .removeClass(`${this.options.linkActiveClass}`)\n .find('[role=\"tab\"]')\n .attr({\n 'aria-selected': 'false',\n 'tabindex': -1\n });\n\n $(`#${$target_anchor.attr('aria-controls')}`)\n .removeClass(`${this.options.panelActiveClass}`)\n .attr({ 'aria-hidden': 'true' })\n }\n\n /**\n * Collapses the active Tab.\n * @fires Tabs#collapse\n * @function\n */\n _collapse() {\n var $activeTab = this.$element.find(`.${this.options.linkClass}.${this.options.linkActiveClass}`);\n\n if ($activeTab.length) {\n this._collapseTab($activeTab);\n\n /**\n * Fires when the plugin has successfully collapsed tabs.\n * @event Tabs#collapse\n */\n this.$element.trigger('collapse.zf.tabs', [$activeTab]);\n }\n }\n\n /**\n * Public method for selecting a content pane to display.\n * @param {jQuery | String} elem - jQuery object or string of the id of the pane to display.\n * @param {boolean} historyHandled - browser has already handled a history update\n * @function\n */\n selectTab(elem, historyHandled) {\n var idStr, hashIdStr;\n\n if (typeof elem === 'object') {\n idStr = elem[0].id;\n } else {\n idStr = elem;\n }\n\n if (idStr.indexOf('#') < 0) {\n hashIdStr = `#${idStr}`;\n } else {\n hashIdStr = idStr;\n idStr = idStr.slice(1);\n }\n\n var $target = this.$tabTitles.has(`[href$=\"${hashIdStr}\"],[data-tabs-target=\"${idStr}\"]`).first();\n\n this._handleTabChange($target, historyHandled);\n };\n\n /**\n * Sets the height of each panel to the height of the tallest panel.\n * If enabled in options, gets called on media query change.\n * If loading content via external source, can be called directly or with _reflow.\n * If enabled with `data-match-height=\"true\"`, tabs sets to equal height\n * @function\n * @private\n */\n _setHeight() {\n var max = 0,\n _this = this; // Lock down the `this` value for the root tabs object\n\n this.$tabContent\n .find(`.${this.options.panelClass}`)\n .css('height', '')\n .each(function() {\n\n var panel = $(this),\n isActive = panel.hasClass(`${_this.options.panelActiveClass}`); // get the options from the parent instead of trying to get them from the child\n\n if (!isActive) {\n panel.css({'visibility': 'hidden', 'display': 'block'});\n }\n\n var temp = this.getBoundingClientRect().height;\n\n if (!isActive) {\n panel.css({\n 'visibility': '',\n 'display': ''\n });\n }\n\n max = temp > max ? temp : max;\n })\n .css('height', `${max}px`);\n }\n\n /**\n * Destroys an instance of tabs.\n * @fires Tabs#destroyed\n */\n _destroy() {\n this.$element\n .find(`.${this.options.linkClass}`)\n .off('.zf.tabs').hide().end()\n .find(`.${this.options.panelClass}`)\n .hide();\n\n if (this.options.matchHeight) {\n if (this._setHeightMqHandler != null) {\n $(window).off('changed.zf.mediaquery', this._setHeightMqHandler);\n }\n }\n\n if (this.options.deepLink) {\n $(window).off('hashchange', this._checkDeepLink);\n }\n\n if (this.onLoadListener) {\n $(window).off(this.onLoadListener);\n }\n }\n}\n\nTabs.defaults = {\n /**\n * Link the location hash to the active pane.\n * Set the location hash when the active pane changes, and open the corresponding pane when the location changes.\n * @option\n * @type {boolean}\n * @default false\n */\n deepLink: false,\n\n /**\n * If `deepLink` is enabled, adjust the deep link scroll to make sure the top of the tab panel is visible\n * @option\n * @type {boolean}\n * @default false\n */\n deepLinkSmudge: false,\n\n /**\n * If `deepLinkSmudge` is enabled, animation time (ms) for the deep link adjustment\n * @option\n * @type {number}\n * @default 300\n */\n deepLinkSmudgeDelay: 300,\n\n /**\n * If `deepLink` is enabled, update the browser history with the open tab\n * @option\n * @type {boolean}\n * @default false\n */\n updateHistory: false,\n\n /**\n * Allows the window to scroll to content of active pane on load.\n * Not recommended if more than one tab panel per page.\n * @option\n * @type {boolean}\n * @default false\n */\n autoFocus: false,\n\n /**\n * Allows keyboard input to 'wrap' around the tab links.\n * @option\n * @type {boolean}\n * @default true\n */\n wrapOnKeys: true,\n\n /**\n * Allows the tab content panes to match heights if set to true.\n * @option\n * @type {boolean}\n * @default false\n */\n matchHeight: false,\n\n /**\n * Allows active tabs to collapse when clicked.\n * @option\n * @type {boolean}\n * @default false\n */\n activeCollapse: false,\n\n /**\n * Class applied to `li`'s in tab link list.\n * @option\n * @type {string}\n * @default 'tabs-title'\n */\n linkClass: 'tabs-title',\n\n /**\n * Class applied to the active `li` in tab link list.\n * @option\n * @type {string}\n * @default 'is-active'\n */\n linkActiveClass: 'is-active',\n\n /**\n * Class applied to the content containers.\n * @option\n * @type {string}\n * @default 'tabs-panel'\n */\n panelClass: 'tabs-panel',\n\n /**\n * Class applied to the active content container.\n * @option\n * @type {string}\n * @default 'is-active'\n */\n panelActiveClass: 'is-active'\n};\n\nexport {Tabs};\n","'use strict';\n\nimport $ from 'jquery';\nimport { Motion } from './foundation.util.motion';\nimport { Plugin } from './foundation.core.plugin';\nimport { RegExpEscape } from './foundation.core.utils';\nimport { Triggers } from './foundation.util.triggers';\n\n/**\n * Toggler module.\n * @module foundation.toggler\n * @requires foundation.util.motion\n * @requires foundation.util.triggers\n */\n\nclass Toggler extends Plugin {\n /**\n * Creates a new instance of Toggler.\n * @class\n * @name Toggler\n * @fires Toggler#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Toggler.defaults, element.data(), options);\n this.className = '';\n this.className = 'Toggler'; // ie9 back compat\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n\n this._init();\n this._events();\n }\n\n /**\n * Initializes the Toggler plugin by parsing the toggle class from data-toggler, or animation classes from data-animate.\n * @function\n * @private\n */\n _init() {\n // Collect triggers to set ARIA attributes to\n var id = this.$element[0].id,\n $triggers = $(`[data-open~=\"${id}\"], [data-close~=\"${id}\"], [data-toggle~=\"${id}\"]`);\n\n var input;\n // Parse animation classes if they were set\n if (this.options.animate) {\n input = this.options.animate.split(' ');\n\n this.animationIn = input[0];\n this.animationOut = input[1] || null;\n\n // - aria-expanded: according to the element visibility.\n $triggers.attr('aria-expanded', !this.$element.is(':hidden'));\n }\n // Otherwise, parse toggle class\n else {\n input = this.options.toggler;\n if (typeof input !== 'string' || !input.length) {\n throw new Error(`The 'toogler' option containing the target class is required, got \"${input}\"`);\n }\n // Allow for a . at the beginning of the string\n this.className = input[0] === '.' ? input.slice(1) : input;\n\n // - aria-expanded: according to the elements class set.\n $triggers.attr('aria-expanded', this.$element.hasClass(this.className));\n }\n\n // - aria-controls: adding the element id to it if not already in it.\n $triggers.each((index, trigger) => {\n const $trigger = $(trigger);\n const controls = $trigger.attr('aria-controls') || '';\n\n const containsId = new RegExp(`\\\\b${RegExpEscape(id)}\\\\b`).test(controls);\n if (!containsId) $trigger.attr('aria-controls', controls ? `${controls} ${id}` : id);\n });\n }\n\n /**\n * Initializes events for the toggle trigger.\n * @function\n * @private\n */\n _events() {\n this.$element.off('toggle.zf.trigger').on('toggle.zf.trigger', this.toggle.bind(this));\n }\n\n /**\n * Toggles the target class on the target element. An event is fired from the original trigger depending on if the resultant state was \"on\" or \"off\".\n * @function\n * @fires Toggler#on\n * @fires Toggler#off\n */\n toggle() {\n this[ this.options.animate ? '_toggleAnimate' : '_toggleClass']();\n }\n\n _toggleClass() {\n this.$element.toggleClass(this.className);\n\n var isOn = this.$element.hasClass(this.className);\n if (isOn) {\n /**\n * Fires if the target element has the class after a toggle.\n * @event Toggler#on\n */\n this.$element.trigger('on.zf.toggler');\n }\n else {\n /**\n * Fires if the target element does not have the class after a toggle.\n * @event Toggler#off\n */\n this.$element.trigger('off.zf.toggler');\n }\n\n this._updateARIA(isOn);\n this.$element.find('[data-mutate]').trigger('mutateme.zf.trigger');\n }\n\n _toggleAnimate() {\n var _this = this;\n\n if (this.$element.is(':hidden')) {\n Motion.animateIn(this.$element, this.animationIn, function() {\n _this._updateARIA(true);\n this.trigger('on.zf.toggler');\n this.find('[data-mutate]').trigger('mutateme.zf.trigger');\n });\n }\n else {\n Motion.animateOut(this.$element, this.animationOut, function() {\n _this._updateARIA(false);\n this.trigger('off.zf.toggler');\n this.find('[data-mutate]').trigger('mutateme.zf.trigger');\n });\n }\n }\n\n _updateARIA(isOn) {\n var id = this.$element[0].id;\n $(`[data-open=\"${id}\"], [data-close=\"${id}\"], [data-toggle=\"${id}\"]`)\n .attr({\n 'aria-expanded': isOn ? true : false\n });\n }\n\n /**\n * Destroys the instance of Toggler on the element.\n * @function\n */\n _destroy() {\n this.$element.off('.zf.toggler');\n }\n}\n\nToggler.defaults = {\n /**\n * Class of the element to toggle. It can be provided with or without \".\"\n * @option\n * @type {string}\n */\n toggler: undefined,\n /**\n * Tells the plugin if the element should animated when toggled.\n * @option\n * @type {boolean}\n * @default false\n */\n animate: false\n};\n\nexport {Toggler};\n","'use strict';\n\nimport $ from 'jquery';\n\nimport { GetYoDigits, ignoreMousedisappear } from './foundation.core.utils';\nimport { MediaQuery } from './foundation.util.mediaQuery';\nimport { Triggers } from './foundation.util.triggers';\nimport { Positionable } from './foundation.positionable';\n\n/**\n * Tooltip module.\n * @module foundation.tooltip\n * @requires foundation.util.box\n * @requires foundation.util.mediaQuery\n * @requires foundation.util.triggers\n */\n\nclass Tooltip extends Positionable {\n /**\n * Creates a new instance of a Tooltip.\n * @class\n * @name Tooltip\n * @fires Tooltip#init\n * @param {jQuery} element - jQuery object to attach a tooltip to.\n * @param {Object} options - object to extend the default configuration.\n */\n _setup(element, options) {\n this.$element = element;\n this.options = $.extend({}, Tooltip.defaults, this.$element.data(), options);\n this.className = 'Tooltip'; // ie9 back compat\n\n this.isActive = false;\n this.isClick = false;\n\n // Triggers init is idempotent, just need to make sure it is initialized\n Triggers.init($);\n\n this._init();\n }\n\n /**\n * Initializes the tooltip by setting the creating the tip element, adding it's text, setting private variables and setting attributes on the anchor.\n * @private\n */\n _init() {\n MediaQuery._init();\n var elemId = this.$element.attr('aria-describedby') || GetYoDigits(6, 'tooltip');\n\n this.options.tipText = this.options.tipText || this.$element.attr('title');\n this.template = this.options.template ? $(this.options.template) : this._buildTemplate(elemId);\n\n if (this.options.allowHtml) {\n this.template.appendTo(document.body)\n .html(this.options.tipText)\n .hide();\n } else {\n this.template.appendTo(document.body)\n .text(this.options.tipText)\n .hide();\n }\n\n this.$element.attr({\n 'title': '',\n 'aria-describedby': elemId,\n 'data-yeti-box': elemId,\n 'data-toggle': elemId,\n 'data-resize': elemId\n }).addClass(this.options.triggerClass);\n\n super._init();\n this._events();\n }\n\n _getDefaultPosition() {\n // handle legacy classnames\n var elementClassName = this.$element[0].className;\n if (this.$element[0] instanceof SVGElement) {\n elementClassName = elementClassName.baseVal;\n }\n var position = elementClassName.match(/\\b(top|left|right|bottom)\\b/g);\n return position ? position[0] : 'top';\n }\n\n _getDefaultAlignment() {\n return 'center';\n }\n\n _getHOffset() {\n if(this.position === 'left' || this.position === 'right') {\n return this.options.hOffset + this.options.tooltipWidth;\n } else {\n return this.options.hOffset\n }\n }\n\n _getVOffset() {\n if(this.position === 'top' || this.position === 'bottom') {\n return this.options.vOffset + this.options.tooltipHeight;\n } else {\n return this.options.vOffset\n }\n }\n\n /**\n * builds the tooltip element, adds attributes, and returns the template.\n * @private\n */\n _buildTemplate(id) {\n var templateClasses = (`${this.options.tooltipClass} ${this.options.templateClasses}`).trim();\n var $template = $('<div></div>').addClass(templateClasses).attr({\n 'role': 'tooltip',\n 'aria-hidden': true,\n 'data-is-active': false,\n 'data-is-focus': false,\n 'id': id\n });\n return $template;\n }\n\n /**\n * sets the position class of an element and recursively calls itself until there are no more possible positions to attempt, or the tooltip element is no longer colliding.\n * if the tooltip is larger than the screen width, default to full width - any user selected margin\n * @private\n */\n _setPosition() {\n super._setPosition(this.$element, this.template);\n }\n\n /**\n * reveals the tooltip, and fires an event to close any other open tooltips on the page\n * @fires Tooltip#closeme\n * @fires Tooltip#show\n * @function\n */\n show() {\n if (this.options.showOn !== 'all' && !MediaQuery.is(this.options.showOn)) {\n // console.error('The screen is too small to display this tooltip');\n return false;\n }\n\n var _this = this;\n this.template.css('visibility', 'hidden').show();\n this._setPosition();\n this.template.removeClass('top bottom left right').addClass(this.position)\n this.template.removeClass('align-top align-bottom align-left align-right align-center').addClass('align-' + this.alignment);\n\n /**\n * Fires to close all other open tooltips on the page\n * @event Closeme#tooltip\n */\n this.$element.trigger('closeme.zf.tooltip', this.template.attr('id'));\n\n\n this.template.attr({\n 'data-is-active': true,\n 'aria-hidden': false\n });\n _this.isActive = true;\n // console.log(this.template);\n this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function() {\n //maybe do stuff?\n });\n /**\n * Fires when the tooltip is shown\n * @event Tooltip#show\n */\n this.$element.trigger('show.zf.tooltip');\n }\n\n /**\n * Hides the current tooltip, and resets the positioning class if it was changed due to collision\n * @fires Tooltip#hide\n * @function\n */\n hide() {\n // console.log('hiding', this.$element.data('yeti-box'));\n var _this = this;\n this.template.stop().attr({\n 'aria-hidden': true,\n 'data-is-active': false\n }).fadeOut(this.options.fadeOutDuration, function() {\n _this.isActive = false;\n _this.isClick = false;\n });\n /**\n * fires when the tooltip is hidden\n * @event Tooltip#hide\n */\n this.$element.trigger('hide.zf.tooltip');\n }\n\n /**\n * adds event listeners for the tooltip and its anchor\n * TODO combine some of the listeners like focus and mouseenter, etc.\n * @private\n */\n _events() {\n const _this = this;\n const hasTouch = 'ontouchstart' in window || (typeof window.ontouchstart !== 'undefined');\n const $template = this.template;\n var isFocus = false;\n\n // `disableForTouch: Fully disable the tooltip on touch devices\n if (hasTouch && this.options.disableForTouch) return;\n\n if (!this.options.disableHover) {\n this.$element\n .on('mouseenter.zf.tooltip', function(e) {\n if (!_this.isActive) {\n _this.timeout = setTimeout(function() {\n _this.show();\n }, _this.options.hoverDelay);\n }\n })\n .on('mouseleave.zf.tooltip', ignoreMousedisappear(function(e) {\n clearTimeout(_this.timeout);\n if (!isFocus || (_this.isClick && !_this.options.clickOpen)) {\n _this.hide();\n }\n }));\n }\n\n if (hasTouch) {\n this.$element\n .on('tap.zf.tooltip touchend.zf.tooltip', function (e) {\n _this.isActive ? _this.hide() : _this.show();\n });\n }\n\n if (this.options.clickOpen) {\n this.$element.on('mousedown.zf.tooltip', function(e) {\n if (_this.isClick) {\n //_this.hide();\n // _this.isClick = false;\n } else {\n _this.isClick = true;\n if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) {\n _this.show();\n }\n }\n });\n } else {\n this.$element.on('mousedown.zf.tooltip', function(e) {\n _this.isClick = true;\n });\n }\n\n this.$element.on({\n // 'toggle.zf.trigger': this.toggle.bind(this),\n // 'close.zf.trigger': this.hide.bind(this)\n 'close.zf.trigger': this.hide.bind(this)\n });\n\n this.$element\n .on('focus.zf.tooltip', function(e) {\n isFocus = true;\n if (_this.isClick) {\n // If we're not showing open on clicks, we need to pretend a click-launched focus isn't\n // a real focus, otherwise on hover and come back we get bad behavior\n if(!_this.options.clickOpen) { isFocus = false; }\n return false;\n } else {\n _this.show();\n }\n })\n\n .on('focusout.zf.tooltip', function(e) {\n isFocus = false;\n _this.isClick = false;\n _this.hide();\n })\n\n .on('resizeme.zf.trigger', function() {\n if (_this.isActive) {\n _this._setPosition();\n }\n });\n }\n\n /**\n * adds a toggle method, in addition to the static show() & hide() functions\n * @function\n */\n toggle() {\n if (this.isActive) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n /**\n * Destroys an instance of tooltip, removes template element from the view.\n * @function\n */\n _destroy() {\n this.$element.attr('title', this.template.text())\n .off('.zf.trigger .zf.tooltip')\n .removeClass(this.options.triggerClass)\n .removeClass('top right left bottom')\n .removeAttr('aria-describedby data-disable-hover data-resize data-toggle data-tooltip data-yeti-box');\n\n this.template.remove();\n }\n}\n\nTooltip.defaults = {\n /**\n * Time, in ms, before a tooltip should open on hover.\n * @option\n * @type {number}\n * @default 200\n */\n hoverDelay: 200,\n /**\n * Time, in ms, a tooltip should take to fade into view.\n * @option\n * @type {number}\n * @default 150\n */\n fadeInDuration: 150,\n /**\n * Time, in ms, a tooltip should take to fade out of view.\n * @option\n * @type {number}\n * @default 150\n */\n fadeOutDuration: 150,\n /**\n * Disables hover events from opening the tooltip if set to true\n * @option\n * @type {boolean}\n * @default false\n */\n disableHover: false,\n /**\n * Disable the tooltip for touch devices.\n * This can be useful to make elements with a tooltip on it trigger their\n * action on the first tap instead of displaying the tooltip.\n * @option\n * @type {booelan}\n * @default false\n */\n disableForTouch: false,\n /**\n * Optional addtional classes to apply to the tooltip template on init.\n * @option\n * @type {string}\n * @default ''\n */\n templateClasses: '',\n /**\n * Non-optional class added to tooltip templates. Foundation default is 'tooltip'.\n * @option\n * @type {string}\n * @default 'tooltip'\n */\n tooltipClass: 'tooltip',\n /**\n * Class applied to the tooltip anchor element.\n * @option\n * @type {string}\n * @default 'has-tip'\n */\n triggerClass: 'has-tip',\n /**\n * Minimum breakpoint size at which to open the tooltip.\n * @option\n * @type {string}\n * @default 'small'\n */\n showOn: 'small',\n /**\n * Custom template to be used to generate markup for tooltip.\n * @option\n * @type {string}\n * @default ''\n */\n template: '',\n /**\n * Text displayed in the tooltip template on open.\n * @option\n * @type {string}\n * @default ''\n */\n tipText: '',\n touchCloseText: 'Tap to close.',\n /**\n * Allows the tooltip to remain open if triggered with a click or touch event.\n * @option\n * @type {boolean}\n * @default true\n */\n clickOpen: true,\n /**\n * Position of tooltip. Can be left, right, bottom, top, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n position: 'auto',\n /**\n * Alignment of tooltip relative to anchor. Can be left, right, bottom, top, center, or auto.\n * @option\n * @type {string}\n * @default 'auto'\n */\n alignment: 'auto',\n /**\n * Allow overlap of container/window. If false, tooltip will first try to\n * position as defined by data-position and data-alignment, but reposition if\n * it would cause an overflow. @option\n * @type {boolean}\n * @default false\n */\n allowOverlap: false,\n /**\n * Allow overlap of only the bottom of the container. This is the most common\n * behavior for dropdowns, allowing the dropdown to extend the bottom of the\n * screen but not otherwise influence or break out of the container.\n * Less common for tooltips.\n * @option\n * @type {boolean}\n * @default false\n */\n allowBottomOverlap: false,\n /**\n * Distance, in pixels, the template should push away from the anchor on the Y axis.\n * @option\n * @type {number}\n * @default 0\n */\n vOffset: 0,\n /**\n * Distance, in pixels, the template should push away from the anchor on the X axis\n * @option\n * @type {number}\n * @default 0\n */\n hOffset: 0,\n /**\n * Distance, in pixels, the template spacing auto-adjust for a vertical tooltip\n * @option\n * @type {number}\n * @default 14\n */\n tooltipHeight: 14,\n /**\n * Distance, in pixels, the template spacing auto-adjust for a horizontal tooltip\n * @option\n * @type {number}\n * @default 12\n */\n tooltipWidth: 12,\n /**\n * Allow HTML in tooltip. Warning: If you are loading user-generated content into tooltips,\n * allowing HTML may open yourself up to XSS attacks.\n * @option\n * @type {boolean}\n * @default false\n */\n allowHtml: false\n};\n\n/**\n * TODO utilize resize event trigger\n */\n\nexport {Tooltip};\n","'use strict';\n\nvar Box = {\n ImNotTouchingYou: ImNotTouchingYou,\n OverlapArea: OverlapArea,\n GetDimensions: GetDimensions,\n GetExplicitOffsets: GetExplicitOffsets\n}\n\n/**\n * Compares the dimensions of an element to a container and determines collision events with container.\n * @function\n * @param {jQuery} element - jQuery object to test for collisions.\n * @param {jQuery} parent - jQuery object to use as bounding container.\n * @param {Boolean} lrOnly - set to true to check left and right values only.\n * @param {Boolean} tbOnly - set to true to check top and bottom values only.\n * @default if no parent object passed, detects collisions with `window`.\n * @returns {Boolean} - true if collision free, false if a collision in any direction.\n */\nfunction ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) {\n return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0;\n}\n\nfunction OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) {\n var eleDims = GetDimensions(element),\n topOver, bottomOver, leftOver, rightOver;\n if (parent) {\n var parDims = GetDimensions(parent);\n\n bottomOver = (parDims.height + parDims.offset.top) - (eleDims.offset.top + eleDims.height);\n topOver = eleDims.offset.top - parDims.offset.top;\n leftOver = eleDims.offset.left - parDims.offset.left;\n rightOver = (parDims.width + parDims.offset.left) - (eleDims.offset.left + eleDims.width);\n }\n else {\n bottomOver = (eleDims.windowDims.height + eleDims.windowDims.offset.top) - (eleDims.offset.top + eleDims.height);\n topOver = eleDims.offset.top - eleDims.windowDims.offset.top;\n leftOver = eleDims.offset.left - eleDims.windowDims.offset.left;\n rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width);\n }\n\n bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0);\n topOver = Math.min(topOver, 0);\n leftOver = Math.min(leftOver, 0);\n rightOver = Math.min(rightOver, 0);\n\n if (lrOnly) {\n return leftOver + rightOver;\n }\n if (tbOnly) {\n return topOver + bottomOver;\n }\n\n // use sum of squares b/c we care about overlap area.\n return Math.sqrt((topOver * topOver) + (bottomOver * bottomOver) + (leftOver * leftOver) + (rightOver * rightOver));\n}\n\n/**\n * Uses native methods to return an object of dimension values.\n * @function\n * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window.\n * @returns {Object} - nested object of integer pixel values\n * TODO - if element is window, return only those values.\n */\nfunction GetDimensions(elem){\n elem = elem.length ? elem[0] : elem;\n\n if (elem === window || elem === document) {\n throw new Error(\"I'm sorry, Dave. I'm afraid I can't do that.\");\n }\n\n var rect = elem.getBoundingClientRect(),\n parRect = elem.parentNode.getBoundingClientRect(),\n winRect = document.body.getBoundingClientRect(),\n winY = window.pageYOffset,\n winX = window.pageXOffset;\n\n return {\n width: rect.width,\n height: rect.height,\n offset: {\n top: rect.top + winY,\n left: rect.left + winX\n },\n parentDims: {\n width: parRect.width,\n height: parRect.height,\n offset: {\n top: parRect.top + winY,\n left: parRect.left + winX\n }\n },\n windowDims: {\n width: winRect.width,\n height: winRect.height,\n offset: {\n top: winY,\n left: winX\n }\n }\n }\n}\n\n/**\n * Returns an object of top and left integer pixel values for dynamically rendered elements,\n * such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where\n * you don't know alignment, but generally from\n * 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment.\n * @function\n * @param {jQuery} element - jQuery object for the element being positioned.\n * @param {jQuery} anchor - jQuery object for the element's anchor point.\n * @param {String} position - a string relating to the desired position of the element, relative to it's anchor\n * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element.\n * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element.\n * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset.\n * TODO alter/rewrite to work with `em` values as well/instead of pixels\n */\nfunction GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) {\n var $eleDims = GetDimensions(element),\n $anchorDims = anchor ? GetDimensions(anchor) : null;\n\n var topVal, leftVal;\n\n if ($anchorDims !== null) {\n // set position related attribute\n switch (position) {\n case 'top':\n topVal = $anchorDims.offset.top - ($eleDims.height + vOffset);\n break;\n case 'bottom':\n topVal = $anchorDims.offset.top + $anchorDims.height + vOffset;\n break;\n case 'left':\n leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset);\n break;\n case 'right':\n leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset;\n break;\n }\n\n // set alignment related attribute\n switch (position) {\n case 'top':\n case 'bottom':\n switch (alignment) {\n case 'left':\n leftVal = $anchorDims.offset.left + hOffset;\n break;\n case 'right':\n leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset;\n break;\n case 'center':\n leftVal = isOverflow ? hOffset : (($anchorDims.offset.left + ($anchorDims.width / 2)) - ($eleDims.width / 2)) + hOffset;\n break;\n }\n break;\n case 'right':\n case 'left':\n switch (alignment) {\n case 'bottom':\n topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height;\n break;\n case 'top':\n topVal = $anchorDims.offset.top + vOffset\n break;\n case 'center':\n topVal = ($anchorDims.offset.top + vOffset + ($anchorDims.height / 2)) - ($eleDims.height / 2)\n break;\n }\n break;\n }\n }\n\n return {top: topVal, left: leftVal};\n}\n\nexport {Box};\n","'use strict';\n\nimport $ from 'jquery';\n\n/**\n * Runs a callback function when images are fully loaded.\n * @param {Object} images - Image(s) to check if loaded.\n * @param {Func} callback - Function to execute when image is fully loaded.\n */\nfunction onImagesLoaded(images, callback){\n var self = this,\n unloaded = images.length;\n\n if (unloaded === 0) {\n callback();\n }\n\n images.each(function(){\n // Check if image is loaded\n if (this.complete && typeof this.naturalWidth !== 'undefined') {\n singleImageLoaded();\n }\n else {\n // If the above check failed, simulate loading on detached element.\n var image = new Image();\n // Still count image as loaded if it finalizes with an error.\n var events = \"load.zf.images error.zf.images\";\n $(image).one(events, function me(event){\n // Unbind the event listeners. We're using 'one' but only one of the two events will have fired.\n $(this).off(events, me);\n singleImageLoaded();\n });\n image.src = $(this).attr('src');\n }\n });\n\n function singleImageLoaded() {\n unloaded--;\n if (unloaded === 0) {\n callback();\n }\n }\n}\n\nexport { onImagesLoaded };\n","/*******************************************\n * *\n * This util was created by Marius Olbertz *\n * Please thank Marius on GitHub /owlbertz *\n * or the web http://www.mariusolbertz.de/ *\n * *\n ******************************************/\n\n'use strict';\n\nimport $ from 'jquery';\nimport { rtl as Rtl } from './foundation.core.utils';\n\nconst keyCodes = {\n 9: 'TAB',\n 13: 'ENTER',\n 27: 'ESCAPE',\n 32: 'SPACE',\n 35: 'END',\n 36: 'HOME',\n 37: 'ARROW_LEFT',\n 38: 'ARROW_UP',\n 39: 'ARROW_RIGHT',\n 40: 'ARROW_DOWN'\n}\n\nvar commands = {}\n\n// Functions pulled out to be referenceable from internals\nfunction findFocusable($element) {\n if(!$element) {return false; }\n return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function() {\n if (!$(this).is(':visible') || $(this).attr('tabindex') < 0) { return false; } //only have visible elements and those that have a tabindex greater or equal 0\n return true;\n });\n}\n\nfunction parseKey(event) {\n var key = keyCodes[event.which || event.keyCode] || String.fromCharCode(event.which).toUpperCase();\n\n // Remove un-printable characters, e.g. for `fromCharCode` calls for CTRL only events\n key = key.replace(/\\W+/, '');\n\n if (event.shiftKey) key = `SHIFT_${key}`;\n if (event.ctrlKey) key = `CTRL_${key}`;\n if (event.altKey) key = `ALT_${key}`;\n\n // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`)\n key = key.replace(/_$/, '');\n\n return key;\n}\n\nvar Keyboard = {\n keys: getKeyCodes(keyCodes),\n\n /**\n * Parses the (keyboard) event and returns a String that represents its key\n * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE\n * @param {Event} event - the event generated by the event handler\n * @return String key - String that represents the key pressed\n */\n parseKey: parseKey,\n\n /**\n * Handles the given (keyboard) event\n * @param {Event} event - the event generated by the event handler\n * @param {String} component - Foundation component's name, e.g. Slider or Reveal\n * @param {Objects} functions - collection of functions that are to be executed\n */\n handleKey(event, component, functions) {\n var commandList = commands[component],\n keyCode = this.parseKey(event),\n cmds,\n command,\n fn;\n\n if (!commandList) return console.warn('Component not defined!');\n\n // Ignore the event if it was already handled\n if (event.zfIsKeyHandled === true) return;\n\n // This component does not differentiate between ltr and rtl\n if (typeof commandList.ltr === 'undefined') {\n cmds = commandList; // use plain list\n } else { // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa\n if (Rtl()) cmds = $.extend({}, commandList.ltr, commandList.rtl);\n\n else cmds = $.extend({}, commandList.rtl, commandList.ltr);\n }\n command = cmds[keyCode];\n\n fn = functions[command];\n // Execute the handler if found\n if (fn && typeof fn === 'function') {\n var returnValue = fn.apply();\n\n // Mark the event as \"handled\" to prevent future handlings\n event.zfIsKeyHandled = true;\n\n // Execute function when event was handled\n if (functions.handled || typeof functions.handled === 'function') {\n functions.handled(returnValue);\n }\n } else {\n // Execute function when event was not handled\n if (functions.unhandled || typeof functions.unhandled === 'function') {\n functions.unhandled();\n }\n }\n },\n\n /**\n * Finds all focusable elements within the given `$element`\n * @param {jQuery} $element - jQuery object to search within\n * @return {jQuery} $focusable - all focusable elements within `$element`\n */\n\n findFocusable: findFocusable,\n\n /**\n * Returns the component name name\n * @param {Object} component - Foundation component, e.g. Slider or Reveal\n * @return String componentName\n */\n\n register(componentName, cmds) {\n commands[componentName] = cmds;\n },\n\n\n // TODO9438: These references to Keyboard need to not require global. Will 'this' work in this context?\n //\n /**\n * Traps the focus in the given element.\n * @param {jQuery} $element jQuery object to trap the foucs into.\n */\n trapFocus($element) {\n var $focusable = findFocusable($element),\n $firstFocusable = $focusable.eq(0),\n $lastFocusable = $focusable.eq(-1);\n\n $element.on('keydown.zf.trapfocus', function(event) {\n if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') {\n event.preventDefault();\n $firstFocusable.focus();\n }\n else if (event.target === $firstFocusable[0] && parseKey(event) === 'SHIFT_TAB') {\n event.preventDefault();\n $lastFocusable.focus();\n }\n });\n },\n /**\n * Releases the trapped focus from the given element.\n * @param {jQuery} $element jQuery object to release the focus for.\n */\n releaseFocus($element) {\n $element.off('keydown.zf.trapfocus');\n }\n}\n\n/*\n * Constants for easier comparing.\n * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE\n */\nfunction getKeyCodes(kcs) {\n var k = {};\n for (var kc in kcs) k[kcs[kc]] = kcs[kc];\n return k;\n}\n\nexport {Keyboard};\n","'use strict';\n\nimport $ from 'jquery';\n\n// Default set of media queries\nconst defaultQueries = {\n 'default' : 'only screen',\n landscape : 'only screen and (orientation: landscape)',\n portrait : 'only screen and (orientation: portrait)',\n retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +\n 'only screen and (min--moz-device-pixel-ratio: 2),' +\n 'only screen and (-o-min-device-pixel-ratio: 2/1),' +\n 'only screen and (min-device-pixel-ratio: 2),' +\n 'only screen and (min-resolution: 192dpi),' +\n 'only screen and (min-resolution: 2dppx)'\n };\n\n\n// matchMedia() polyfill - Test a CSS media type/query in JS.\n// Authors & copyright © 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license\n/* eslint-disable */\nwindow.matchMedia || (window.matchMedia = (function () {\n \"use strict\";\n\n // For browsers that support matchMedium api such as IE 9 and webkit\n var styleMedia = (window.styleMedia || window.media);\n\n // For those that don't support matchMedium\n if (!styleMedia) {\n var style = document.createElement('style'),\n script = document.getElementsByTagName('script')[0],\n info = null;\n\n style.type = 'text/css';\n style.id = 'matchmediajs-test';\n\n if (!script) {\n document.head.appendChild(style);\n } else {\n script.parentNode.insertBefore(style, script);\n }\n\n // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers\n info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;\n\n styleMedia = {\n matchMedium: function (media) {\n var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';\n\n // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers\n if (style.styleSheet) {\n style.styleSheet.cssText = text;\n } else {\n style.textContent = text;\n }\n\n // Test if media query is true or false\n return info.width === '1px';\n }\n };\n }\n\n return function(media) {\n return {\n matches: styleMedia.matchMedium(media || 'all'),\n media: media || 'all'\n };\n };\n})());\n/* eslint-enable */\n\nvar MediaQuery = {\n queries: [],\n\n current: '',\n\n /**\n * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher.\n * @function\n * @private\n */\n _init() {\n\n // make sure the initialization is only done once when calling _init() several times\n if (this.isInitialized === true) {\n return;\n } else {\n this.isInitialized = true;\n }\n\n var self = this;\n var $meta = $('meta.foundation-mq');\n if(!$meta.length){\n $('<meta class=\"foundation-mq\">').appendTo(document.head);\n }\n\n var extractedStyles = $('.foundation-mq').css('font-family');\n var namedQueries;\n\n namedQueries = parseStyleToObject(extractedStyles);\n\n self.queries = []; // reset\n\n for (var key in namedQueries) {\n if(namedQueries.hasOwnProperty(key)) {\n self.queries.push({\n name: key,\n value: `only screen and (min-width: ${namedQueries[key]})`\n });\n }\n }\n\n this.current = this._getCurrentSize();\n\n this._watcher();\n },\n\n /**\n * Reinitializes the media query helper.\n * Useful if your CSS breakpoint configuration has just been loaded or has changed since the initialization.\n * @function\n * @private\n */\n _reInit() {\n this.isInitialized = false;\n this._init();\n },\n\n /**\n * Checks if the screen is at least as wide as a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller.\n */\n atLeast(size) {\n var query = this.get(size);\n\n if (query) {\n return window.matchMedia(query).matches;\n }\n\n return false;\n },\n\n /**\n * Checks if the screen is within the given breakpoint.\n * If smaller than the breakpoint of larger than its upper limit it returns false.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` otherwise.\n */\n only(size) {\n return size === this._getCurrentSize();\n },\n\n /**\n * Checks if the screen is within a breakpoint or smaller.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it's larger.\n */\n upTo(size) {\n const nextSize = this.next(size);\n\n // If the next breakpoint does not match, the screen is smaller than\n // the upper limit of this breakpoint.\n if (nextSize) {\n return !this.atLeast(nextSize);\n }\n\n // If there is no next breakpoint, the \"size\" breakpoint does not have\n // an upper limit and the screen will always be within it or smaller.\n return true;\n },\n\n /**\n * Checks if the screen matches to a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it does not.\n */\n is(size) {\n const parts = size.trim().split(' ').filter(p => !!p.length);\n const [bpSize, bpModifier = ''] = parts;\n\n // Only the breakpont\n if (bpModifier === 'only') {\n return this.only(bpSize);\n }\n // At least the breakpoint (included)\n if (!bpModifier || bpModifier === 'up') {\n return this.atLeast(bpSize);\n }\n // Up to the breakpoint (included)\n if (bpModifier === 'down') {\n return this.upTo(bpSize);\n }\n\n throw new Error(`\n Invalid breakpoint passed to MediaQuery.is().\n Expected a breakpoint name formatted like \"<size> <modifier>\", got \"${size}\".\n `);\n },\n\n /**\n * Gets the media query of a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to get.\n * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist.\n */\n get(size) {\n for (var i in this.queries) {\n if(this.queries.hasOwnProperty(i)) {\n var query = this.queries[i];\n if (size === query.name) return query.value;\n }\n }\n\n return null;\n },\n\n /**\n * Get the breakpoint following the given breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint.\n * @returns {String|null} - The name of the following breakpoint, or `null` if the passed breakpoint was the last one.\n */\n next(size) {\n const queryIndex = this.queries.findIndex((q) => this._getQueryName(q) === size);\n if (queryIndex === -1) {\n throw new Error(`\n Unknown breakpoint \"${size}\" passed to MediaQuery.next().\n Ensure it is present in your Sass \"$breakpoints\" setting.\n `);\n }\n\n const nextQuery = this.queries[queryIndex + 1];\n return nextQuery ? nextQuery.name : null;\n },\n\n /**\n * Returns the name of the breakpoint related to the given value.\n * @function\n * @private\n * @param {String|Object} value - Breakpoint name or query object.\n * @returns {String} Name of the breakpoint.\n */\n _getQueryName(value) {\n if (typeof value === 'string')\n return value;\n if (typeof value === 'object')\n return value.name;\n throw new TypeError(`\n Invalid value passed to MediaQuery._getQueryName().\n Expected a breakpoint name (String) or a breakpoint query (Object), got \"${value}\" (${typeof value})\n `);\n },\n\n /**\n * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one).\n * @function\n * @private\n * @returns {String} Name of the current breakpoint.\n */\n _getCurrentSize() {\n var matched;\n\n for (var i = 0; i < this.queries.length; i++) {\n var query = this.queries[i];\n\n if (window.matchMedia(query.value).matches) {\n matched = query;\n }\n }\n\n return matched && this._getQueryName(matched);\n },\n\n /**\n * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes.\n * @function\n * @private\n */\n _watcher() {\n $(window).off('resize.zf.mediaquery').on('resize.zf.mediaquery', () => {\n var newSize = this._getCurrentSize(), currentSize = this.current;\n\n if (newSize !== currentSize) {\n // Change the current media query\n this.current = newSize;\n\n // Broadcast the media query change on the window\n $(window).trigger('changed.zf.mediaquery', [newSize, currentSize]);\n }\n });\n }\n};\n\n\n\n// Thank you: https://github.com/sindresorhus/query-string\nfunction parseStyleToObject(str) {\n var styleObject = {};\n\n if (typeof str !== 'string') {\n return styleObject;\n }\n\n str = str.trim().slice(1, -1); // browsers re-quote string style values\n\n if (!str) {\n return styleObject;\n }\n\n styleObject = str.split('&').reduce(function(ret, param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = parts[0];\n var val = parts[1];\n key = decodeURIComponent(key);\n\n // missing `=` should be `null`:\n // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n val = typeof val === 'undefined' ? null : decodeURIComponent(val);\n\n if (!ret.hasOwnProperty(key)) {\n ret[key] = val;\n } else if (Array.isArray(ret[key])) {\n ret[key].push(val);\n } else {\n ret[key] = [ret[key], val];\n }\n return ret;\n }, {});\n\n return styleObject;\n}\n\nexport {MediaQuery};\n","'use strict';\n\nimport $ from 'jquery';\nimport { transitionend } from './foundation.core.utils';\n\n/**\n * Motion module.\n * @module foundation.motion\n */\n\nconst initClasses = ['mui-enter', 'mui-leave'];\nconst activeClasses = ['mui-enter-active', 'mui-leave-active'];\n\nconst Motion = {\n animateIn: function(element, animation, cb) {\n animate(true, element, animation, cb);\n },\n\n animateOut: function(element, animation, cb) {\n animate(false, element, animation, cb);\n }\n}\n\nfunction Move(duration, elem, fn){\n var anim, prog, start = null;\n // console.log('called');\n\n if (duration === 0) {\n fn.apply(elem);\n elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);\n return;\n }\n\n function move(ts){\n if(!start) start = ts;\n // console.log(start, ts);\n prog = ts - start;\n fn.apply(elem);\n\n if(prog < duration){ anim = window.requestAnimationFrame(move, elem); }\n else{\n window.cancelAnimationFrame(anim);\n elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);\n }\n }\n anim = window.requestAnimationFrame(move);\n}\n\n/**\n * Animates an element in or out using a CSS transition class.\n * @function\n * @private\n * @param {Boolean} isIn - Defines if the animation is in or out.\n * @param {Object} element - jQuery or HTML object to animate.\n * @param {String} animation - CSS class to use.\n * @param {Function} cb - Callback to run when animation is finished.\n */\nfunction animate(isIn, element, animation, cb) {\n element = $(element).eq(0);\n\n if (!element.length) return;\n\n var initClass = isIn ? initClasses[0] : initClasses[1];\n var activeClass = isIn ? activeClasses[0] : activeClasses[1];\n\n // Set up the animation\n reset();\n\n element\n .addClass(animation)\n .css('transition', 'none');\n\n requestAnimationFrame(() => {\n element.addClass(initClass);\n if (isIn) element.show();\n });\n\n // Start the animation\n requestAnimationFrame(() => {\n // will trigger the browser to synchronously calculate the style and layout\n // also called reflow or layout thrashing\n // see https://gist.github.com/paulirish/5d52fb081b3570c81e3a\n element[0].offsetWidth;\n element\n .css('transition', '')\n .addClass(activeClass);\n });\n\n // Clean up the animation when it finishes\n element.one(transitionend(element), finish);\n\n // Hides the element (for out animations), resets the element, and runs a callback\n function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }\n\n // Resets transitions and removes motion-specific classes\n function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(`${initClass} ${activeClass} ${animation}`);\n }\n}\n\nexport { Move, Motion };\n\n","'use strict';\n\nimport $ from 'jquery';\n\nconst Nest = {\n Feather(menu, type = 'zf') {\n menu.attr('role', 'menubar');\n menu.find('a').attr({'role': 'menuitem'});\n\n var items = menu.find('li').attr({'role': 'none'}),\n subMenuClass = `is-${type}-submenu`,\n subItemClass = `${subMenuClass}-item`,\n hasSubClass = `is-${type}-submenu-parent`,\n applyAria = (type !== 'accordion'); // Accordions handle their own ARIA attriutes.\n\n items.each(function() {\n var $item = $(this),\n $sub = $item.children('ul');\n\n if ($sub.length) {\n $item.addClass(hasSubClass);\n if(applyAria) {\n $item.attr({\n 'aria-haspopup': true,\n 'aria-label': $item.children('a:first').text()\n });\n // Note: Drilldowns behave differently in how they hide, and so need\n // additional attributes. We should look if this possibly over-generalized\n // utility (Nest) is appropriate when we rework menus in 6.4\n if(type === 'drilldown') {\n $item.attr({'aria-expanded': false});\n }\n }\n $sub\n .addClass(`submenu ${subMenuClass}`)\n .attr({\n 'data-submenu': '',\n 'role': 'menubar'\n });\n if(type === 'drilldown') {\n $sub.attr({'aria-hidden': true});\n }\n }\n\n if ($item.parent('[data-submenu]').length) {\n $item.addClass(`is-submenu-item ${subItemClass}`);\n }\n });\n\n return;\n },\n\n Burn(menu, type) {\n var //items = menu.find('li'),\n subMenuClass = `is-${type}-submenu`,\n subItemClass = `${subMenuClass}-item`,\n hasSubClass = `is-${type}-submenu-parent`;\n\n menu\n .find('>li, > li > ul, .menu, .menu > li, [data-submenu] > li')\n .removeClass(`${subMenuClass} ${subItemClass} ${hasSubClass} is-submenu-item submenu is-active`)\n .removeAttr('data-submenu').css('display', '');\n\n }\n}\n\nexport {Nest};\n","'use strict';\n\nimport $ from 'jquery';\n\nfunction Timer(elem, options, cb) {\n var _this = this,\n duration = options.duration,//options is an object for easily adding features later.\n nameSpace = Object.keys(elem.data())[0] || 'timer',\n remain = -1,\n start,\n timer;\n\n this.isPaused = false;\n\n this.restart = function() {\n remain = -1;\n clearTimeout(timer);\n this.start();\n }\n\n this.start = function() {\n this.isPaused = false;\n // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.\n clearTimeout(timer);\n remain = remain <= 0 ? duration : remain;\n elem.data('paused', false);\n start = Date.now();\n timer = setTimeout(function(){\n if(options.infinite){\n _this.restart();//rerun the timer.\n }\n if (cb && typeof cb === 'function') { cb(); }\n }, remain);\n elem.trigger(`timerstart.zf.${nameSpace}`);\n }\n\n this.pause = function() {\n this.isPaused = true;\n //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.\n clearTimeout(timer);\n elem.data('paused', true);\n var end = Date.now();\n remain = remain - (end - start);\n elem.trigger(`timerpaused.zf.${nameSpace}`);\n }\n}\n\nexport {Timer};\n","//**************************************************\n//**Work inspired by multiple jquery swipe plugins**\n//**Done by Yohai Ararat ***************************\n//**************************************************\n\nimport $ from 'jquery';\n\nvar Touch = {};\n\nvar startPosX,\n startPosY,\n startTime,\n elapsedTime,\n startEvent,\n isMoving = false,\n didMoved = false;\n\nfunction onTouchEnd(e) {\n this.removeEventListener('touchmove', onTouchMove);\n this.removeEventListener('touchend', onTouchEnd);\n\n // If the touch did not move, consider it as a \"tap\"\n if (!didMoved) {\n var tapEvent = $.Event('tap', startEvent || e);\n $(this).trigger(tapEvent);\n }\n\n startEvent = null;\n isMoving = false;\n didMoved = false;\n}\n\nfunction onTouchMove(e) {\n if ($.spotSwipe.preventDefault) { e.preventDefault(); }\n\n if(isMoving) {\n var x = e.touches[0].pageX;\n var y = e.touches[0].pageY;\n var dx = startPosX - x;\n var dy = startPosY - y;\n var dir;\n didMoved = true;\n elapsedTime = new Date().getTime() - startTime;\n if(Math.abs(dx) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {\n dir = dx > 0 ? 'left' : 'right';\n }\n // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {\n // dir = dy > 0 ? 'down' : 'up';\n // }\n if(dir) {\n e.preventDefault();\n onTouchEnd.apply(this, arguments);\n $(this)\n .trigger($.Event('swipe', Object.assign({}, e)), dir)\n .trigger($.Event(`swipe${dir}`, Object.assign({}, e)));\n }\n }\n\n}\n\nfunction onTouchStart(e) {\n\n if (e.touches.length == 1) {\n startPosX = e.touches[0].pageX;\n startPosY = e.touches[0].pageY;\n startEvent = e;\n isMoving = true;\n didMoved = false;\n startTime = new Date().getTime();\n this.addEventListener('touchmove', onTouchMove, false);\n this.addEventListener('touchend', onTouchEnd, false);\n }\n}\n\nfunction init() {\n this.addEventListener && this.addEventListener('touchstart', onTouchStart, false);\n}\n\nfunction teardown() {\n this.removeEventListener('touchstart', onTouchStart);\n}\n\nclass SpotSwipe {\n constructor($) {\n this.version = '1.0.0';\n this.enabled = 'ontouchstart' in document.documentElement;\n this.preventDefault = false;\n this.moveThreshold = 75;\n this.timeThreshold = 200;\n this.$ = $;\n this._init();\n }\n\n _init() {\n var $ = this.$;\n $.event.special.swipe = { setup: init };\n $.event.special.tap = { setup: init };\n\n $.each(['left', 'up', 'down', 'right'], function () {\n $.event.special[`swipe${this}`] = { setup: function(){\n $(this).on('swipe', $.noop);\n } };\n });\n }\n}\n\n/****************************************************\n * As far as I can tell, both setupSpotSwipe and *\n * setupTouchHandler should be idempotent, *\n * because they directly replace functions & *\n * values, and do not add event handlers directly. *\n ****************************************************/\n\nTouch.setupSpotSwipe = function($) {\n $.spotSwipe = new SpotSwipe($);\n};\n\n/****************************************************\n * Method for adding pseudo drag events to elements *\n ***************************************************/\nTouch.setupTouchHandler = function($) {\n $.fn.addTouch = function(){\n this.each(function(i,el){\n $(el).bind('touchstart touchmove touchend touchcancel', function(event) {\n //we pass the original event object because the jQuery event\n //object is normalized to w3c specs and does not provide the TouchList\n handleTouch(event);\n });\n });\n\n var handleTouch = function(event){\n var touches = event.changedTouches,\n first = touches[0],\n eventTypes = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup'\n },\n type = eventTypes[event.type],\n simulatedEvent\n ;\n\n if('MouseEvent' in window && typeof window.MouseEvent === 'function') {\n simulatedEvent = new window.MouseEvent(type, {\n 'bubbles': true,\n 'cancelable': true,\n 'screenX': first.screenX,\n 'screenY': first.screenY,\n 'clientX': first.clientX,\n 'clientY': first.clientY\n });\n } else {\n simulatedEvent = document.createEvent('MouseEvent');\n simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0/*left*/, null);\n }\n first.target.dispatchEvent(simulatedEvent);\n };\n };\n};\n\nTouch.init = function ($) {\n\n if(typeof($.spotSwipe) === 'undefined') {\n Touch.setupSpotSwipe($);\n Touch.setupTouchHandler($);\n }\n};\n\nexport {Touch};\n","'use strict';\n\nimport $ from 'jquery';\nimport { onLoad } from './foundation.core.utils';\nimport { Motion } from './foundation.util.motion';\n\nconst MutationObserver = (function () {\n var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];\n for (var i=0; i < prefixes.length; i++) {\n if (`${prefixes[i]}MutationObserver` in window) {\n return window[`${prefixes[i]}MutationObserver`];\n }\n }\n return false;\n}());\n\nconst triggers = (el, type) => {\n el.data(type).split(' ').forEach(id => {\n $(`#${id}`)[ type === 'close' ? 'trigger' : 'triggerHandler'](`${type}.zf.trigger`, [el]);\n });\n};\n\nvar Triggers = {\n Listeners: {\n Basic: {},\n Global: {}\n },\n Initializers: {}\n}\n\nTriggers.Listeners.Basic = {\n openListener: function() {\n triggers($(this), 'open');\n },\n closeListener: function() {\n let id = $(this).data('close');\n if (id) {\n triggers($(this), 'close');\n }\n else {\n $(this).trigger('close.zf.trigger');\n }\n },\n toggleListener: function() {\n let id = $(this).data('toggle');\n if (id) {\n triggers($(this), 'toggle');\n } else {\n $(this).trigger('toggle.zf.trigger');\n }\n },\n closeableListener: function(e) {\n let animation = $(this).data('closable');\n\n // Only close the first closable element. See https://git.io/zf-7833\n e.stopPropagation();\n\n if(animation !== ''){\n Motion.animateOut($(this), animation, function() {\n $(this).trigger('closed.zf');\n });\n }else{\n $(this).fadeOut().trigger('closed.zf');\n }\n },\n toggleFocusListener: function() {\n let id = $(this).data('toggle-focus');\n $(`#${id}`).triggerHandler('toggle.zf.trigger', [$(this)]);\n }\n};\n\n// Elements with [data-open] will reveal a plugin that supports it when clicked.\nTriggers.Initializers.addOpenListener = ($elem) => {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener);\n $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener);\n}\n\n// Elements with [data-close] will close a plugin that supports it when clicked.\n// If used without a value on [data-close], the event will bubble, allowing it to close a parent component.\nTriggers.Initializers.addCloseListener = ($elem) => {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener);\n $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener);\n}\n\n// Elements with [data-toggle] will toggle a plugin that supports it when clicked.\nTriggers.Initializers.addToggleListener = ($elem) => {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener);\n $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener);\n}\n\n// Elements with [data-closable] will respond to close.zf.trigger events.\nTriggers.Initializers.addCloseableListener = ($elem) => {\n $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener);\n $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener);\n}\n\n// Elements with [data-toggle-focus] will respond to coming in and out of focus\nTriggers.Initializers.addToggleFocusListener = ($elem) => {\n $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener);\n $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener);\n}\n\n\n\n// More Global/complex listeners and triggers\nTriggers.Listeners.Global = {\n resizeListener: function($nodes) {\n if(!MutationObserver){//fallback for IE 9\n $nodes.each(function(){\n $(this).triggerHandler('resizeme.zf.trigger');\n });\n }\n //trigger all listening elements and signal a resize event\n $nodes.attr('data-events', \"resize\");\n },\n scrollListener: function($nodes) {\n if(!MutationObserver){//fallback for IE 9\n $nodes.each(function(){\n $(this).triggerHandler('scrollme.zf.trigger');\n });\n }\n //trigger all listening elements and signal a scroll event\n $nodes.attr('data-events', \"scroll\");\n },\n closeMeListener: function(e, pluginId){\n let plugin = e.namespace.split('.')[0];\n let plugins = $(`[data-${plugin}]`).not(`[data-yeti-box=\"${pluginId}\"]`);\n\n plugins.each(function(){\n let _this = $(this);\n _this.triggerHandler('close.zf.trigger', [_this]);\n });\n }\n}\n\n// Global, parses whole document.\nTriggers.Initializers.addClosemeListener = function(pluginName) {\n var yetiBoxes = $('[data-yeti-box]'),\n plugNames = ['dropdown', 'tooltip', 'reveal'];\n\n if(pluginName){\n if(typeof pluginName === 'string'){\n plugNames.push(pluginName);\n }else if(typeof pluginName === 'object' && typeof pluginName[0] === 'string'){\n plugNames = plugNames.concat(pluginName);\n }else{\n console.error('Plugin names must be strings');\n }\n }\n if(yetiBoxes.length){\n let listeners = plugNames.map((name) => {\n return `closeme.zf.${name}`;\n }).join(' ');\n\n $(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener);\n }\n}\n\nfunction debounceGlobalListener(debounce, trigger, listener) {\n let timer, args = Array.prototype.slice.call(arguments, 3);\n $(window).off(trigger).on(trigger, function(e) {\n if (timer) { clearTimeout(timer); }\n timer = setTimeout(function(){\n listener.apply(null, args);\n }, debounce || 10);//default time to emit scroll event\n });\n}\n\nTriggers.Initializers.addResizeListener = function(debounce){\n let $nodes = $('[data-resize]');\n if($nodes.length){\n debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes);\n }\n}\n\nTriggers.Initializers.addScrollListener = function(debounce){\n let $nodes = $('[data-scroll]');\n if($nodes.length){\n debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes);\n }\n}\n\nTriggers.Initializers.addMutationEventsListener = function($elem) {\n if(!MutationObserver){ return false; }\n let $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]');\n\n //element callback\n var listeningElementsMutation = function (mutationRecordsList) {\n var $target = $(mutationRecordsList[0].target);\n\n //trigger the event handler for the element depending on type\n switch (mutationRecordsList[0].type) {\n case \"attributes\":\n if ($target.attr(\"data-events\") === \"scroll\" && mutationRecordsList[0].attributeName === \"data-events\") {\n $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]);\n }\n if ($target.attr(\"data-events\") === \"resize\" && mutationRecordsList[0].attributeName === \"data-events\") {\n $target.triggerHandler('resizeme.zf.trigger', [$target]);\n }\n if (mutationRecordsList[0].attributeName === \"style\") {\n $target.closest(\"[data-mutate]\").attr(\"data-events\",\"mutate\");\n $target.closest(\"[data-mutate]\").triggerHandler('mutateme.zf.trigger', [$target.closest(\"[data-mutate]\")]);\n }\n break;\n\n case \"childList\":\n $target.closest(\"[data-mutate]\").attr(\"data-events\",\"mutate\");\n $target.closest(\"[data-mutate]\").triggerHandler('mutateme.zf.trigger', [$target.closest(\"[data-mutate]\")]);\n break;\n\n default:\n return false;\n //nothing\n }\n };\n\n if ($nodes.length) {\n //for each element that needs to listen for resizing, scrolling, or mutation add a single observer\n for (var i = 0; i <= $nodes.length - 1; i++) {\n var elementObserver = new MutationObserver(listeningElementsMutation);\n elementObserver.observe($nodes[i], { attributes: true, childList: true, characterData: false, subtree: true, attributeFilter: [\"data-events\", \"style\"] });\n }\n }\n}\n\nTriggers.Initializers.addSimpleListeners = function() {\n let $document = $(document);\n\n Triggers.Initializers.addOpenListener($document);\n Triggers.Initializers.addCloseListener($document);\n Triggers.Initializers.addToggleListener($document);\n Triggers.Initializers.addCloseableListener($document);\n Triggers.Initializers.addToggleFocusListener($document);\n\n}\n\nTriggers.Initializers.addGlobalListeners = function() {\n let $document = $(document);\n Triggers.Initializers.addMutationEventsListener($document);\n Triggers.Initializers.addResizeListener();\n Triggers.Initializers.addScrollListener();\n Triggers.Initializers.addClosemeListener();\n}\n\n\nTriggers.init = function ($, Foundation) {\n onLoad($(window), function () {\n if ($.triggersInitialized !== true) {\n Triggers.Initializers.addSimpleListeners();\n Triggers.Initializers.addGlobalListeners();\n $.triggersInitialized = true;\n }\n });\n\n if(Foundation) {\n Foundation.Triggers = Triggers;\n // Legacy included to be backwards compatible for now.\n Foundation.IHearYou = Triggers.Initializers.addGlobalListeners\n }\n}\n\nexport {Triggers};\n","module.exports = __WEBPACK_EXTERNAL_MODULE_jquery__;"],"sourceRoot":""}
|