/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/canvas-fit@1.5.0/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var size=require("element-size");module.exports=fit;var scratch=new Float32Array(2);function fit(e,t,i){var r="SVG"===e.nodeName.toUpperCase();return e.style.position=e.style.position||"absolute",e.style.top=0,e.style.left=0,s.scale=parseFloat(i||1),s.parent=t,s();function s(){var t=s.parent||e.parentNode;if("function"==typeof t)var i=t(scratch)||scratch,a=i[0],n=i[1];else if(t&&t!==document.body){var o=size(t);a=0|o[0],n=0|o[1]}else a=window.innerWidth,n=window.innerHeight;return r?(e.setAttribute("width",a*s.scale+"px"),e.setAttribute("height",n*s.scale+"px")):(e.width=a*s.scale,e.height=n*s.scale),e.style.width=a+"px",e.style.height=n+"px",s}}
//# sourceMappingURL=/sm/9e2ec5bea8d517ad1cf064f13700a574d3aa7b0d6fe1eb1fb7a39be433482117.map