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