import{x as f,y as O,C as z,E as e,z as g,ax as J,J as K,L as Q}from"./vendor-CsGITfgk.js";import{bw as R,bx as V,by as F,bj as _,bz as q,g as B,bA as H}from"./index-CsCqMgta.js";function M(t){return f(R,t,{fetchPolicy:"cache-and-network"})}function U(t){return f(V,t,{fetchPolicy:"cache-and-network"})}function W(t){return O(F,t,{fetchPolicy:"cache-and-network"})}function Z(t){const{previousCultureSlug:a}=_(),m=z(q,""),{storeId:r,userId:v,cultureName:l}=B,d=e(()=>H(a.value?.slug)),p=e(()=>d.value===g(t)?a.value?.cultureName:l),y=e(()=>({storeId:r,userId:v,cultureName:p.value,permalink:g(t)})),{result:I,loading:C,error:D}=W(y),n=e(()=>D.value?null:I.value?.slugInfo),P=e(()=>n.value?.entityInfo?.outline),u=e(()=>n.value?.entityInfo?.objectType),b=e(()=>n.value?{metaKeywords:n.value?.entityInfo?.metaKeywords,metaDescription:n.value?.entityInfo?.metaDescription,pageTitle:n.value?.entityInfo?.pageTitle}:null),h=e(()=>u.value==="ContentFile"),N=e(()=>u.value==="Pages"),s=e(()=>({id:n?.value?.entityInfo?.objectId||"?",cultureName:l,storeId:r})),{load:w,result:c,loading:L,error:S}=M(s),{load:T,result:G,loading:j,error:k}=U(s),x=e(()=>{if(S.value)return null;let o;return typeof c?.value?.page?.content=="string"&&(o=JSON.parse(c.value.page.content)),E(o)?o:null}),A=e(()=>k.value?null:G?.value?.pageDocument||null);function E(o){const i=o;return Array.isArray(i?.content)&&typeof i?.settings=="object"}return J(P,async o=>{await Q(),m.value=o??""},{immediate:!0}),{loading:e(()=>C.value||L.value||j.value),slugInfo:n,objectType:u,hasContent:h,pageContent:x,seoInfo:K(b),fetchContent:w,hasPageDocumentContent:N,pageDocumentContent:A,fetchPageDocumentContent:T}}export{Z as u};
//# sourceMappingURL=useSlugInfo-BKFu_7wx.js.map
