import{by as z,bz as K,bA as N,g as Q}from"./index-Dqv5IkpS.js";import{w as m,x as B,B as n,y as F,E as J}from"./vendor-bSWkQivH.js";function O(r){return m(z,r,{fetchPolicy:"cache-and-network"})}function T(r){return m(K,r,{fetchPolicy:"cache-and-network"})}function V(r){return B(N,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:F(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:w,result:a,loading:G,error:j}=O(g),{load:E,result:l,loading:L,error:S}=T(g),k=n(()=>{var t,u;if(j.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)),x(e)?e:null}),A=n(()=>{var e;return S.value?null:((e=l==null?void 0:l.value)==null?void 0:e.pageDocument)||null});function x(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||G.value||L.value),slugInfo:o,objectType:c,hasContent:h,pageContent:k,seoInfo:J(C),fetchContent:w,hasPageDocumentContent:b,pageDocumentContent:A,fetchPageDocumentContent:E}}export{M as u};
//# sourceMappingURL=useSlugInfo-cU0FszRY.js.map
