import{r,ai as l,aC as d,am as f,l as u,aD as i,aE as m,C as p,ak as x,aF as D,al as C,R as y,aG as R}from"./index.1551d878.js";const E=d;function g(t,s){const a=f(),e=r.exports.useContext(u);r.exports.useLayoutEffect(()=>{const{colorscale:o,config:n,state:c}=e.state;t&&(a(()=>({colorscale:o,config:n?i(n):void 0,dataset:m(t),state:c})),s(!0))},[t,e])}function N(t){const[s,a]=r.exports.useState(!1),{dataset:e}=l.exports.usePreloadedQuery(E,t);return g(e,a),[e,s]}const P=({prepared:t})=>{const s=r.exports.useContext(u),[a,e]=N(t),o=p(x);if(!e)return null;if(a===null)throw new D(`/datasets/${C(s)}`);return!o||o!==a.name?null:y.createElement(R,null)},F=P;export{F as default};
