1import{h as p,q as g,u as d}from"#entry";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="3f76042a-9e86-4569-9811-a584180c354e",e._sentryDebugIdIdentifier="sentry-dbid-3f76042a-9e86-4569-9811-a584180c354e")}catch{}})();const h={},B=()=>{const{locale:e}=p(),s=()=>{try{const t=d();if(t?.public?.apiBase)return t.public.apiBase;if(t?.public?.baseURL)return t.public.baseURL}catch{}if(!(typeof import.meta<"u"&&h?.VITE_API_BASE))return window.location.hostname==="www.aceiteherencia.com"||window.location.hostname!=="localhost"?"https://api.aceiteherencia.com":"http://localhost:8000"},f=async(t={})=>{const n={status:"published",language:e.value,...t},l=20;let o=[],i=`${s()}/api/blog/posts/`,a=n;for(let c=0;c<l&&i;c++){const u=await $fetch(i,a?{params:a}:{}),r=u?.results||u||[];if(!Array.isArray(r))break;o=o.concat(r),i=u?.next||null,a=void 0}return o.length?o.map(c=>{const u=c.translations||{},r=u[e.value]||u.es||{};return{...c,title:r.title||"",slug:r.slug||"",excerpt:r.excerpt||"",content:r.content||"",meta_title:r.meta_title||"",meta_description:r.meta_description||"",meta_keywords:r.meta_keywords||""}}):[]};return{fetchPosts:f,fetchPostBySlug:async t=>{try{const n=await $fetch(`${s()}/api/blog/posts/`,{params:{status:"published",language:e.value,slug:t},retry:3,retryDelay:300,timeout:8e3});let l=n?.results||n||[];if(!Array.isArray(l))return null;const o=l.find(i=>{const a=i.translations||{};return Object.values(a).some(c=>c&&c.slug===t)});if(o){const i=o.translations||{},a=i[e.value]||i.es||{};return{...o,title:a.title||"",slug:a.slug||t,excerpt:a.excerpt||"",content:a.content||"",meta_title:a.meta_title||"",meta_description:a.meta_description||"",meta_keywords:a.meta_keywords||""}}return null}catch(n){return g.error("Error fetching post:",n),null}},fetchPostById:async t=>await $fetch(`${s()}/api/blog/posts/${t}/`,{params:{language:e.value}}),fetchCategories:async()=>await $fetch(`${s()}/api/blog/categories/`,{params:{language:e.value}}),fetchTags:async()=>await $fetch(`${s()}/api/blog/tags/`,{params:{language:e.value}}),fetchFeaturedPosts:async(t=3)=>await f({is_featured:!0,limit:t}),fetchRecentPosts:async(t=5)=>await f({ordering:"-published_at",limit:t}),fetchRelatedPosts:async(t,n=3)=>{try{return await $fetch(`${s()}/api/blog/posts/${t}/related/`,{params:{language:e.value,limit:n}})}catch(l){return g.debug("Related posts endpoint not available:",l),[]}},incrementViews:async t=>{try{await $fetch(`${s()}/api/blog/posts/${t}/increment_views/`,{method:"POST",params:{language:e.value}})}catch{}},getCurrentTranslation:t=>{if(!t)return null;if(t.title&&t.content)return t;if(t.translations){const n=t.translations[e.value]||t.translations.es;return{...t,...n}}return t},locale:e}};export{B as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.