import{bE as K,bF as N,bG as Q,g as q}from"./index-CRze-aDK.js";import{j as m,k as x,q as n,m as z,y as J}from"./vendor-BGtMsOoo.js";function O(r){return m(K,r,{fetchPolicy:"cache-and-network"})}function T(r){return m(N,r,{fetchPolicy:"cache-and-network"})}function V(r){return x(Q,r,{fetchPolicy:"cache-and-network"})}function M(r){const{storeId:s,userId:v,cultureName:i}=q,P=n(()=>({storeId:s,userId:v,cultureName:i,slug:z(r)})),{result:D,loading:I,error:p}=V(P),o=n(()=>{var e;return p.value?null:(e=D.value)==null?void 0:e.slugInfo}),c=n(()=>{var e,t;return(t=(e=o.value)==null?void 0:e.entityInfo)==null?void 0:t.objectType}),C=n(()=>{var e,t,u,f,d,y;return o.value?{metaKeywords:(t=(e=o.value)==null?void 0:e.entityInfo)==null?void 0:t.metaKeywords,metaDescription:(f=(u=o.value)==null?void 0:u.entityInfo)==null?void 0:f.metaDescription,pageTitle:(y=(d=o.value)==null?void 0:d.entityInfo)==null?void 0:y.pageTitle}:null}),h=n(()=>c.value==="ContentFile"),b=n(()=>c.value==="Pages"),g=n(()=>{var e,t;return{id:((t=(e=o==null?void 0:o.value)==null?void 0:e.entityInfo)==null?void 0:t.objectId)||"?",cultureName:i,storeId:s}}),{load:G,result:a,loading:j,error:w}=O(g),{load:k,result:l,loading:E,error:L}=T(g),S=n(()=>{var t,u;if(w.value)return null;let e;return typeof((u=(t=a==null?void 0:a.value)==null?void 0:t.page)==null?void 0:u.content)=="string"&&(e=JSON.parse(a.value.page.content)),F(e)?e:null}),A=n(()=>{var e;return L.value?null:((e=l==null?void 0:l.value)==null?void 0:e.pageDocument)||null});function F(e){const t=e;return Array.isArray(t==null?void 0:t.content)&&typeof(t==null?void 0:t.settings)=="object"}return{loading:n(()=>I.value||j.value||E.value),slugInfo:o,objectType:c,hasContent:h,pageContent:S,seoInfo:J(C),fetchContent:G,hasPageDocumentContent:b,pageDocumentContent:A,fetchPageDocumentContent:k}}export{M as u};
//# sourceMappingURL=useSlugInfo-CDk-jWkx.js.map
