import r from"@babel/runtime/helpers/slicedToArray";import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as i}from"react";import{debounce as t}from"lodash";import{ViewportContext as n}from"./ViewportContext.js";import{computeViewType as m}from"./computeViewType.js";var a=function(a){var c=a.children,p=o(m),u=r(p,2),d=u[0],f=u[1];return i((function(){var r=t((function(){f((function(r){var e=m();return e===r?r:e}))}),150);return window.addEventListener("resize",r),function(){window.removeEventListener("resize",r),r.cancel()}}),[]),e(n.Provider,{value:d,children:c})};a.displayName="ViewportProvider";export{a as ViewportProvider};
//# sourceMappingURL=ViewportProvider.js.map
