// jQuery.isInView, v1.0.6 // Copyright (c) 2014-2017 Michael Heim, Zeilenwechsel.de // Distributed under MIT license // http://github.com/hashchange/jquery.isinview !function(a,b){"use strict";"object"==typeof exports?module.exports=b(require("jquery"),require("jquery.documentsize")):"function"==typeof define&&define.amd&&define(["jquery","jquery.documentsize"],b)}(0,function(jQuery){"use strict";!function(a){function b(b,c){var d,e,f,g,h,i,j,k={target:{}},o={},p={},q=b[0];if(b=b.eq(0),c||(c="both"),k.getBoth="both"===c,k.getHorizontal="horizontal"===c||k.getBoth,k.getVertical="vertical"===c||k.getBoth,"horizontal"!==c&&"vertical"!==c&&"both"!==c)throw new Error("Invalid parameter value: axis = "+c);if(b.length)return k.target.isWindow=a.isWindow(q),k.target.isWindow?p.document=q.document:9===q.nodeType?(p.document=q,k.target.isWindow=!0):q===q.ownerDocument.documentElement?(p.document=q.ownerDocument,k.target.isWindow=!0):1===q.nodeType&&"iframe"===q.tagName.toLowerCase()?(p.document=q.contentDocument||q.contentWindow.document,k.target.isWindow=!0):q===q.ownerDocument.body&&(p.document=q.ownerDocument,k.target.isBody=!0),(k.target.isWindow||k.target.isBody)&&(p.window=p.document.defaultView||p.document.parentWindow,p.$document=a(p.document),p.documentElement=p.document.documentElement,p.body=p.document.body,q=b=void 0),k.target.isWindow?o=l(k,p):k.target.isBody?(f=m(k,p).body,d=a(p.body),k.getHorizontal&&(o.horizontal=f.overflowScrollX||f.overflowAutoX&&p.body.clientHeight0&&(e.overflowScrollX||e.overflowAutoX&&(g=b.innerWidth())0&&(e.overflowScrollY||e.overflowAutoY&&(h=b.innerHeight())0&&a.offsetHeight>0)&&(b.useHorizontal&&(c=s(k,b.containerIsWindow,l)),b.useVertical&&(d=t(k,b.containerIsWindow,l)),e=void 0!==l.hTolerance?l.hTolerance:l.hTolerance="add"===b.toleranceType?b.tolerance:c*b.tolerance,f=void 0!==l.vTolerance?l.vTolerance:l.vTolerance="add"===b.toleranceType?b.tolerance:d*b.tolerance,g=b.borderBox?a.getBoundingClientRect():j(a),b.containerIsWindow||(g=i(g,k,l)),b.partially?(b.useVertical&&(m=g.top-f),b.useHorizontal&&(m=m&&g.left-e)):(b.useVertical&&(m=g.top>=-f&&g.top-f&&g.bottom<=d+f),b.useHorizontal&&(m=m&&g.left>=-e&&g.left-e&&g.right<=c+e)),m)}function i(a,b,c){var d;return c&&c.containerPaddingRectRoot?d=c.containerPaddingRectRoot:(d=k(b[0]),c&&(c.containerPaddingRectRoot=d)),{top:a.top-d.top,bottom:a.bottom-d.top,left:a.left-d.left,right:a.right-d.left}}function j(a){var b=a.getBoundingClientRect(),c=w(a,["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft"],{toFloat:!0});return{top:b.top+c.paddingTop+c.borderTopWidth,right:b.right-(c.paddingRight+c.borderRightWidth),bottom:b.bottom-(c.paddingBottom+c.borderBottomWidth),left:b.left+c.paddingLeft+c.borderLeftWidth}}function k(a){var b=a.getBoundingClientRect(),c=w(a,["borderTopWidth","borderLeftWidth"],{toFloat:!0});return{top:b.top+c.borderTopWidth,left:b.left+c.borderLeftWidth}}function l(b,c){var d,e,f,g=a.scrollbarWidth(),h={},i=!b.getHorizontal,j=!b.getVertical;return b.getHorizontal&&g>0&&(d=c.window.innerHeight)>10&&(h.horizontal=d>c.documentElement.clientHeight,i=!0),b.getVertical&&g>0&&(e=c.window.innerWidth)>10&&(h.vertical=e>c.documentElement.clientWidth,j=!0),i&&j||(f=m(b,c).window,!i&&f.overflowScrollX&&(h.horizontal=i=!0),!j&&f.overflowScrollY&&(h.vertical=j=!0),!i&&f.overflowHiddenX&&(h.horizontal=!1,i=!0),!j&&f.overflowHiddenY&&(h.vertical=!1,j=!0),i||(h.horizontal=c.documentElement.clientWidth