import{jsx as e}from"react/jsx-runtime";import{useRef as i}from"react";import{createViewStore as r}from"./createViewStore.js";import{ViewStoreContext as t}from"./ViewStoreContext.js";import{useEffectiveViewSettings as n}from"./utils/useEffectiveViewSettings.js";import{useViewStoreSettingsSync as s}from"./utils/useViewStoreSettingsSync.js";import{useViewTypeLayoutSync as d}from"./utils/useViewTypeLayoutSync.js";import"../../viewport/ViewportProvider.js";import{useViewType as o}from"../../viewport/useViewType.js";import{useSyncProps as a}from"../utils/useSyncProps.js";var p=function(p){var l=p.children,f=p.isFilterExpanded,u=p.isMapHidden,m=p.userSettings,c=p.hasManuallyChanged,v=p.onSettingChange,M=i(null),y=o(),S=y.viewType,x=y.isMobile,E=i(x);E.current=x;var g=n({isMapHidden:u,isFilterExpanded:f,isMobile:x,userSettings:m,hasManuallyChanged:c}),w=g.effectiveIsMapHidden,H=g.effectiveIsFilterExpanded,j=g.getEffectiveIsMapHidden;return M.current||(M.current=r({isFilterExpanded:H,isMapHidden:w,isWellNameExpand:null==m?void 0:m.isWellNameExpand,mapStyle:null==m?void 0:m.mapStyle})),s({storeRef:M,isMobileRef:E,onSettingChange:v}),d({storeRef:M,viewType:S,isMobile:x,effectiveIsMapHidden:w,effectiveIsFilterExpanded:H,getEffectiveIsMapHidden:j}),a(M.current,{isFilterExpanded:f,isMapHidden:u},[{key:"isFilterExpanded",transform:function(e){if(null==c||!c("isFilterExpanded"))return e}},{key:"isMapHidden",transform:function(e){return!!x||(null!=c&&c("isMapHidden")?void 0:e)}}]),e(t.Provider,{value:M.current,children:l})};p.displayName="ViewStoreProvider";export{p as ViewStoreProvider};
//# sourceMappingURL=ViewStoreProvider.js.map
