"use strict";!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.ResizeSensor=t()}("undefined"!=typeof window?window:this,(function(){function e(e,t){var n=Object.prototype.toString.call(e),i="[object Array]"===n||"[object NodeList]"===n||"[object HTMLCollection]"===n||"[object Object]"===n||"undefined"!=typeof jQuery&&e instanceof jQuery||"undefined"!=typeof Elements&&e instanceof Elements,o=0,r=e.length;if(i)for(;o<r;o++)t(e[o]);else t(e)}function t(e){if(!e.getBoundingClientRect)return{width:e.offsetWidth,height:e.offsetHeight};var t=e.getBoundingClientRect();return{width:Math.round(t.width),height:Math.round(t.height)}}function n(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}if("undefined"==typeof window)return null;var i="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),o=i.requestAnimationFrame||i.mozRequestAnimationFrame||i.webkitRequestAnimationFrame||function(e){return i.setTimeout(e,20)},r=i.cancelAnimationFrame||i.mozCancelAnimationFrame||i.webkitCancelAnimationFrame||function(e){i.clearTimeout(e)},s=function(i,d){function a(){var e=[],t,n;this.add=function(t){e.push(t)},this.call=function(i){for(t=0,n=e.length;t<n;t++)e[t].call(this,i)},this.remove=function(i){var o=[];for(t=0,n=e.length;t<n;t++)e[t]!==i&&o.push(e[t]);e=o},this.length=function(){return e.length}}function c(e,i){if(e)if(e.resizedAttached)e.resizedAttached.add(i);else{e.resizedAttached=new a,e.resizedAttached.add(i),e.resizeSensor=document.createElement("div"),e.resizeSensor.dir="ltr",e.resizeSensor.className="resize-sensor";var r={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},s={position:"absolute",left:"0px",top:"0px",transition:"0s"};n(e.resizeSensor,r);var d=document.createElement("div");d.className="resize-sensor-expand",n(d,r);var c=document.createElement("div");n(c,s),d.appendChild(c);var u=document.createElement("div");u.className="resize-sensor-shrink",n(u,r);var h=document.createElement("div");n(h,s),n(h,{width:"200%",height:"200%"}),u.appendChild(h),e.resizeSensor.appendChild(d),e.resizeSensor.appendChild(u),e.appendChild(e.resizeSensor);var l=window.getComputedStyle(e),p=l?l.getPropertyValue("position"):null;"absolute"!==p&&"relative"!==p&&"fixed"!==p&&"sticky"!==p&&(e.style.position="relative");var m=!1,v=0,z=t(e),w=0,g=0,y=!0;f=0;var S=function(){var t=e.offsetWidth,n=e.offsetHeight;c.style.width=t+10+"px",c.style.height=n+10+"px",d.scrollLeft=t+10,d.scrollTop=n+10,u.scrollLeft=t+10,u.scrollTop=n+10},b=function(){if(y){var t;if(0===e.offsetWidth&&0===e.offsetHeight)return void(f||(f=o((function(){f=0,b()}))));y=!1}S()};e.resizeSensor.resetSensor=b;var A=function(){v=0,m&&(w=z.width,g=z.height,e.resizedAttached&&e.resizedAttached.call(z))},x=function(){z=t(e),(m=z.width!==w||z.height!==g)&&!v&&(v=o(A)),b()},C=function(e,t,n){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n)};C(d,"scroll",x),C(u,"scroll",x),f=o((function(){f=0,b()}))}}var f=0;e(i,(function(e){c(e,d)})),this.detach=function(e){f&&(r(f),f=0),s.detach(i,e)},this.reset=function(){i.resizeSensor.resetSensor&&i.resizeSensor.resetSensor()}};if(s.reset=function(t){e(t,(function(e){t.resizeSensor.resetSensor&&e.resizeSensor.resetSensor()}))},s.detach=function(t,n){e(t,(function(e){e&&(e.resizedAttached&&"function"==typeof n&&(e.resizedAttached.remove(n),e.resizedAttached.length())||e.resizeSensor&&(e.contains(e.resizeSensor)&&e.removeChild(e.resizeSensor),delete e.resizeSensor,delete e.resizedAttached))}))},"undefined"!=typeof MutationObserver){var d=new MutationObserver((function(e){for(var t in e)if(e.hasOwnProperty(t))for(var n=e[t].addedNodes,i=0;i<n.length;i++)n[i].resizeSensor&&s.reset(n[i])}));document.addEventListener("DOMContentLoaded",(function(e){d.observe(document.body,{childList:!0,subtree:!0})}))}return s}));