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