import{mapOptions as e,mapParseResult as t,mapResult as n,preprocessStyles as r}from"./shared.mjs";import{compileAstroSync as i,parseAstroSync as a}from"@astrojs/compiler-binding";function o(t,r){let a=n(i(t,e(r)),r?.preprocessedStyles);if(typeof r?.resolvePath==`function`){let e=r.resolvePath,t=[...a.hydratedComponents,...a.clientOnlyComponents,...a.serverComponents];for(let n of t)n.resolvedPath=e(n.specifier);let{code:n}=a;for(let e of t)e.resolvedPath&&e.resolvedPath!==e.specifier&&(n=n.split(`"client:component-path": "${e.specifier}"`).join(`"client:component-path": "${e.resolvedPath}"`));a.code=n}return a}function s(e){return t(a(e))}function c(e,t){throw Error(`convertToTSX() is not yet implemented`)}export{c as convertToTSX,s as parse,r as preprocessStyles,o as transform};