!function(root,ns,factory){"use strict";"undefined"!=typeof module&&module.exports?module.exports=factory():"function"==typeof define&&define.amd?define("detect-zoom",factory):root[ns]=factory()}(window,"detectZoom",function(){function devicePixelRatio(){return window.devicePixelRatio||1}function ie8(){var zoom=Math.round(screen.deviceXDPI/screen.logicalXDPI*100)/100;return{zoom:zoom,devicePxPerCssPx:zoom*devicePixelRatio()}}function ie10(){var zoom=Math.round(document.documentElement.offsetHeight/window.innerHeight*100)/100;return{zoom:zoom,devicePxPerCssPx:zoom*devicePixelRatio()}}function chrome(){var zoom=Math.round(window.outerWidth/window.innerWidth*100)/100;return{zoom:zoom,devicePxPerCssPx:zoom*devicePixelRatio()}}function safari(){var zoom=Math.round(document.documentElement.clientWidth/window.innerWidth*100)/100;return{zoom:zoom,devicePxPerCssPx:zoom*devicePixelRatio()}}function webkitMobile(){var zoom=(90==Math.abs(window.orientation)?screen.height:screen.width)/window.innerWidth;return{zoom:zoom,devicePxPerCssPx:zoom*devicePixelRatio()}}function webkit(){function important(str){return str.replace(/;/g," !important;")}var zoom=document.createElement("div");zoom.innerHTML="1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>0",zoom.setAttribute("style",important("font: 100px/1em sans-serif; -webkit-text-size-adjust: none; text-size-adjust: none; height: auto; width: 1em; padding: 0; overflow: visible;"));var container=document.createElement("div");return container.setAttribute("style",important("width:0; height:0; overflow:hidden; visibility:hidden; position: absolute;")),container.appendChild(zoom),document.body.appendChild(container),zoom=1e3/zoom.clientHeight,zoom=Math.round(100*zoom)/100,document.body.removeChild(container),{zoom:zoom,devicePxPerCssPx:zoom*devicePixelRatio()}}function firefox4(){var zoom=mediaQueryBinarySearch("min--moz-device-pixel-ratio","",0,10,20,1e-4);return{zoom:zoom=Math.round(100*zoom)/100,devicePxPerCssPx:zoom}}function firefox18(){return{zoom:firefox4().zoom,devicePxPerCssPx:devicePixelRatio()}}function opera11(){var zoom=window.top.outerWidth/window.top.innerWidth;return{zoom:zoom=Math.round(100*zoom)/100,devicePxPerCssPx:zoom*devicePixelRatio()}}var func,mediaQueryBinarySearch=function(property,unit,a,b,ratio,epsilon){var head,style,div,matchMedia=window.matchMedia||(head=document.getElementsByTagName("head")[0],style=document.createElement("style"),head.appendChild(style),(div=document.createElement("div")).className="mediaQueryBinarySearch",div.style.display="none",document.body.appendChild(div),function(matched){style.sheet.insertRule("@media "+matched+"{.mediaQueryBinarySearch {text-decoration: underline} }",0);matched="underline"==getComputedStyle(div,null).textDecoration;return style.sheet.deleteRule(0),{matches:matched}}),ratio=function binarySearch(a,b,maxIter){var mid=(a+b)/2;if(maxIter<=0||b-a<epsilon)return mid;var query="("+property+":"+mid+unit+")";return matchMedia(query).matches?binarySearch(mid,b,maxIter-1):binarySearch(a,mid,maxIter-1)}(a,b,ratio);return div&&(head.removeChild(style),document.body.removeChild(div)),ratio},detectFunction=(func=function(){return{zoom:1,devicePxPerCssPx:1}},isNaN(screen.logicalXDPI)||isNaN(screen.systemXDPI)?window.navigator.msMaxTouchPoints?func=ie10:window.chrome&&!(window.opera||0<=navigator.userAgent.indexOf(" Opera"))?func=chrome:0<Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")?func=safari:"orientation"in window&&"webkitRequestAnimationFrame"in window?func=webkitMobile:"webkitRequestAnimationFrame"in window?func=webkit:0<=navigator.userAgent.indexOf("Opera")?func=opera11:window.devicePixelRatio?func=firefox18:.001<firefox4().zoom&&(func=firefox4):func=ie8,func);return{zoom:function(){return detectFunction().zoom},device:function(){return detectFunction().devicePxPerCssPx}}});