import{getPathParams as v,importServerProps as g}from"../utils.js";import{prepareContextVariables as S}from"./prepare-context-variables.js";import{getServerPropsFromUserHandler as c}from"./get-server-props-from-user-handler.js";import{getDefaultStaticProps as d}from"./get-default-static-props.js";import{getServerPropsFromSystemHandlers as b}from"./get-server-props-from-system-handlers.js";async function y(r,s,t,e){const l=e.getGlobalData()?.l10n,{variables:n,serverPropsUser:i}=S(r,s,l),P=v(r,s),{serverProps:a}=await g(e.serverOutDir),m=d({staticData:t,variables:n});if(!a)return m;const o=await c({route:r,ctx:s,staticData:t,serverPropsGetters:a,serverPropsUser:i,actions:e}),p=await b(r,t,n,o,a,e,P);if(!o&&!p.length)return m;const f=o?[o,...p]:p;return Object.assign({},...f)}export{y as getServerProps};
