1import{s as e}from"./VALu4SJC.js";import{g as t,vn as n}from"./CJOrt7RF.js";import{q as r}from"./B-8rjqvJ.js";import{i,t as a}from"./Bm62HHlj.js";import{t as o}from"./DAIwsz81.js";var s=i(`blog`,()=>{let i=e().public,{language:s}=o(),c=n([]),l=n(null),u=t(()=>`${i.companyName.toLowerCase()}-${s.value===`fr`?`fr-be`:`blog`}`),d=e=>!!e?.is_visible&&(!e.published_from||new Date(e.published_from).getTime()<Date.now()),f=e=>{c.value=e||[]},p=e=>c.value.find(t=>t.slug===e),m=(e,{includeHidden:t=!1,withCategory:n=!1}={})=>{let r=null,i=null;for(let t of c.value){let n=(t.children||[]).find(t=>t.slug===e);if(n){r=n,i=t.title;break}}return r&&!t&&!d(r)&&(r=null,i=null),n?{blog:r,categoryTitle:i}:r},h=e=>{if(!e)return[];let t=new RegExp(e,`gi`),n=[];for(let e of c.value)for(let r of e.children||[])r.is_visible&&r.title?.match(t)&&n.push(r);return a(n)},g=(e=`all`)=>{let t=[];for(let n of c.value)if(e===`all`||n.slug===e)for(let e of n.children||[])d(e)&&t.push(e);return t.sort((e,t)=>new Date(t.published_from)-new Date(e.published_from))};async function _(){let e=s.value;if(c.value.length&&l.value===e)return;let t=null;try{t=await r(`${i.baseUrl}/data/${e}/blog.json`)}catch{}let n=t?.menu;if(!n)try{let t=`?store=${i.storeCode}&country=${i.countryCode}&lang=${e.toUpperCase()}`;n=await r(`${i.apiUrl}/menus/${u.value}${t}`)}catch(e){console.error(`[BlogStore] Failed to fetch blog menu`,e)}f(n?.data?.resource?.children||[]),l.value=e}return{categories:c,loadedLanguage:l,menuSlug:u,isVisible:d,setCategories:f,getCategory:p,getBlog:m,getBlogsByTitle:h,visibleBlogs:g,getData:_,reset:()=>{c.value=[],l.value=null}}});export{s as t};
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.