// jQuery.documentSize, v1.2.3 // Copyright (c) 2015-2016 Michael Heim, Zeilenwechsel.de // Distributed under MIT license // http://github.com/hashchange/jquery.documentsize !function(a){"use strict";function b(a,b){var d,e,f,i,j,k,l=b.window,m=0!==h(),n=b.useLayoutViewport&&"Width"===a,p=m||!g()||n,r=p?l.document.documentElement["client"+a]:o(a,l);return b.useLayoutViewport&&!p&&(e=r,f=c(l,{asRange:!0}),r=Math.round(e*f.calculated),q()||(d=l.document.documentElement.clientHeight,j=(e-1)*f.min,k=(e+1)*f.max,i=d+3>=r&&r>=d-3||d>=j&&k>=d&&d+30>k,i&&(r=d))),r}function c(a,b){var c,d,e=b&&b.asRange,f={calculated:1,min:1,max:1},i=0!==h()||!g();return i||(a||(a=window),c=a.document.documentElement.clientWidth,d=n(a),f.calculated=c/d,e&&(q()?f.min=f.max=f.calculated:(f.min=c/(d+1),f.max=c/(d-1)))),e?f:f.calculated}function d(a){var b,c,d,g=window,h=!0;return a&&a.length&&(a=Array.prototype.slice.call(a),b=r(a[0]),b||(a[0]=f(a[0])),c=!b&&a[0],c||(a[1]=f(a[1])),d=!c&&a[1],b?(g=a[0],d&&a[1].viewport&&(h=e(a[1].viewport))):c?(a[0].viewport&&(h=e(a[0].viewport)),r(a[1])&&(g=a[1])):!a[0]&&a[1]&&(d&&a[1].viewport?h=e(a[1].viewport):r(a[1])&&(g=a[1]))),{window:g,useVisualViewport:h,useLayoutViewport:!h}}function e(a){var b=s(a)&&a.toLowerCase();if(a&&!b)throw new Error("Invalid viewport option: "+a);if(b&&"visual"!==b&&"layout"!==b)throw new Error("Invalid viewport name: "+a);return"visual"===b}function f(a){return s(a)&&""!==a?{viewport:a}:a}function g(){return void 0===y&&(y=n()>10),y}function h(){var a;return void 0===x&&(a=document.createElement("div"),a.style.cssText="width: 100px; height: 100px; overflow: scroll; position: absolute; top: -500px; left: -500px; margin: 0px; padding: 0px; border: none;",document.body.appendChild(a),x=a.offsetWidth-a.clientWidth,document.body.removeChild(a)),x}function i(){var a,b,c,d,e=j(),f=e&&e.contentDocument||document,g=f.body,h=f!==document;b=f.createElement("div"),b.style.cssText="width: 1px; height: 1px; position: relative; top: 0px; left: 32000px;",h||(a=k()),c=g.scrollWidth,g.appendChild(b),d=c!==g.scrollWidth,g.removeChild(b),h||l(a),A=d?"documentElement":"body",e&&document.body.removeChild(e)}function j(){var a=document.createElement("iframe"),b=document.body;return a.style.cssText="position: absolute; top: -600px; left: -600px; width: 500px; height: 500px; margin: 0px; padding: 0px; border: none; display: block;",a.frameborder="0",b.appendChild(a),a.src="about:blank",a.contentDocument?(a.contentDocument.write(''),a):void 0}function k(){var a,b,c=document.documentElement,d=document.body,e=C?window.getComputedStyle(c,null):c.currentStyle,f=C?window.getComputedStyle(d,null):d.currentStyle,g=(e.overflowX||e.overflow||"visible").toLowerCase(),h=(f.overflowX||f.overflow||"visible").toLowerCase(),i="hidden"!==h,j="visible"===g,k={documentElement:{modified:j},body:{modified:i}};return j&&(a=c.style,k.documentElement.styleOverflowX=a.overflowX,a.overflowX="auto"),i&&(b=d.style,k.body.styleOverflowX=b.overflowX,b.overflowX="hidden"),k}function l(a){a.documentElement.modified&&(document.documentElement.style.overflowX=a.documentElement.styleOverflowX),a.body.modified&&(document.body.style.overflowX=a.body.styleOverflowX)}function m(a,b){var c=b.documentElement;return Math.max(c.body["scroll"+a],b["scroll"+a],c.body["offset"+a],b["offset"+a],b["client"+a])}function n(a){return o("Width",a)}function o(a,b){var c=(b||window)["inner"+a];return c&&p(c),c}function p(a){!z&&t(a)&&(z=!0)}function q(){return!!z}function r(a){return null!=a&&a.window==a}function s(a){return"string"==typeof a||a&&"object"==typeof a&&"[object String]"===Object.prototype.toString.call(a)||!1}function t(a){return a===+a&&a!==(0|a)}function u(){var a,b;return void 0===B&&(B=!1,a=navigator&&navigator.userAgent,navigator&&"Microsoft Internet Explorer"===navigator.appName&&a&&(b=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"),null!=b.exec(a)&&(B=parseFloat(RegExp.$1)))),B}function v(){var a=u();return a&&8>a}function w(){return 9===u()}var x,y,z,A,B,C=!!window.getComputedStyle;if(a.documentWidth=function(a){var b;a||(a=document);try{void 0===A&&i(),b=a[A].scrollWidth}catch(c){b=m("Width",a)}return b},a.documentHeight=function(a){var b;a||(a=document);try{void 0===A&&i(),b=a[A].scrollHeight}catch(c){b=m("Height",a)}return b},a.windowWidth=function(a,c){var e=d(arguments);return b("Width",e)},a.windowHeight=function(a,c){var e=d(arguments);return b("Height",e)},a.pinchZoomFactor=function(a){return c(a)},a.scrollbarWidth=h,"function"==typeof a&&!v()&&!w())try{a(function(){void 0===A&&i(),h()})}catch(D){}}("undefined"!=typeof jQuery?jQuery:"undefined"!=typeof Zepto?Zepto:$); //# sourceMappingURL=jquery.documentsize.min.js.map