!function(){var e=this.ElementQueries=function(){function t(e){e||(e=document.documentElement);var t=getComputedStyle(e,"fontSize");return parseFloat(t)||16}function n(e,n){var i=n.replace(/[0-9]*/,"");switch(n=parseFloat(n),i){case"px":return n;case"em":return n*t(e);case"rem":return n*t();case"vw":return n*document.documentElement.clientWidth/100;case"vh":return n*document.documentElement.clientHeight/100;case"vmin":case"vmax":var o=document.documentElement.clientWidth/100,r=document.documentElement.clientHeight/100,s=Math["vmin"===i?"min":"max"];return n*s(o,r);default:return n}}function i(e){this.element=e,this.options={};var t,i,o,r,s,a,u,d=0,c=0;this.addOption=function(e){var t=[e.mode,e.property,e.value].join(",");this.options[t]=e};var l=["min-width","min-height","max-width","max-height"];this.call=function(){d=this.element.offsetWidth,c=this.element.offsetHeight,s={};for(t in this.options)this.options.hasOwnProperty(t)&&(i=this.options[t],o=n(this.element,i.value),r="width"==i.property?d:c,u=i.mode+"-"+i.property,a="","min"==i.mode&&r>=o&&(a+=i.value),"max"==i.mode&&o>=r&&(a+=i.value),s[u]||(s[u]=""),a&&-1===(" "+s[u]+" ").indexOf(" "+a+" ")&&(s[u]+=" "+a));for(var e in l)s[l[e]]?this.element.setAttribute(l[e],s[l[e]].substr(1)):this.element.removeAttribute(l[e])}}function o(e,t){e.elementQueriesSetupInformation?e.elementQueriesSetupInformation.addOption(t):(e.elementQueriesSetupInformation=new i(e),e.elementQueriesSetupInformation.addOption(t),e.elementQueriesSensor=new ResizeSensor(e,function(){e.elementQueriesSetupInformation.call()})),e.elementQueriesSetupInformation.call(),this.withTracking&&u.push(e)}function r(e,t,n,i){var r;if(document.querySelectorAll&&(r=document.querySelectorAll.bind(document)),r||"undefined"==typeof $$||(r=$$),r||"undefined"==typeof jQuery||(r=jQuery),!r)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";for(var s=r(e),a=0,u=s.length;u>a;a++)o(s[a],{mode:t,property:n,value:i})}function s(e){var t;for(e=e.replace(/'/g,'"');null!==(t=d.exec(e));)5<t.length&&r(t[1]||t[5],t[2],t[3],t[4])}function a(e){if(e){if("string"==typeof e)return e=e.toLowerCase(),void((-1!==e.indexOf("min-width")||-1!==e.indexOf("max-width"))&&s(e));for(var t="",n=0,i=e.length;i>n;n++)1===e[n].type?(t=e[n].selectorText||e[n].cssText,-1!==t.indexOf("min-height")||-1!==t.indexOf("max-height")?s(t):(-1!==t.indexOf("min-width")||-1!==t.indexOf("max-width"))&&s(t)):4===e[n].type&&a(e[n].cssRules||e[n].rules)}}this.sheetList={},this.withTracking=!1;var u=[],d=/,?([^,\n]*)\[[\s\t]*(min|max)-(width|height)[\s\t]*[~$\^]?=[\s\t]*"([^"]*)"[\s\t]*]([^\n\s\{]*)/gim;this.init=function(e){var t,n,i;for(this.withTracking=e,t=0,n=document.styleSheets.length;n>t;t++)try{if(i=document.styleSheets[t],"string"==typeof i.href&&"undefined"!=typeof this.sheetList[i.href])continue;a(i.cssText||i.cssRules||i.rules),this.sheetList[i.href]=!0}catch(o){}},this.update=function(e){this.withTracking=e,this.init()},this.detach=function(){if(!this.withTracking)throw"withTracking is not enabled. We can not detach elements since we don not store it.Use ElementQueries.withTracking = true; before domready.";for(var t;t=u.pop();)e.detach(t);u=[]}};e.update=function(t){e.instance.update(t)},e.detach=function(e){e.elementQueriesSetupInformation?(e.elementQueriesSensor.detach(),delete e.elementQueriesSetupInformation,delete e.elementQueriesSensor,console.log("detached")):console.log("detached already",e)},e.withTracking=!1,e.init=function(){e.instance||(e.instance=new e),e.instance.init(e.withTracking)};var t=function(e){if(document.addEventListener&&document.addEventListener("DOMContentLoaded",e,!1),/KHTML|WebKit|iCab/i.test(navigator.userAgent))var t=setInterval(function(){/loaded|complete/i.test(document.readyState)&&(e(),clearInterval(t))},10);window.onload=e};window.addEventListener?window.addEventListener("load",e.init,!1):window.attachEvent("onload",e.init),t(e.init)}(),define("qui/lib/element-query/ElementQuery",function(){});
//# sourceMappingURL=ElementQuery.js.map