import{ref as a}from"vue";import{defineStore as g}from"pinia";import{k as m}from"../server.mjs";import"klona";import"defu";import"#internal/nuxt/paths";const L=g("news",()=>{const{$axios:o}=m(),i=a({}),r=a(),u=a(!0),e=a(!0),n=a([]);async function c(t){const s=await o.get(`news/show/${t}`);s.status>=200&&(r.value=s.data.data,e.value=!1),setTimeout(()=>{e.value=!0},500)}async function l(t){const s=await o.get(`news/show/${t}`);s.status>=200&&(r.value=s.data.data,e.value=!1),setTimeout(()=>{e.value=!0},500)}function f(t){return t?t.toString().toLowerCase().trim().replace(/\s+/g,"-").replace(/[؟,،!%&]/g,"").replace(/-+/g,"-"):""}async function w(){const t=await o.get("news");t.status>=200&&(n.value=t.data.data,u.value=!1),setTimeout(()=>{u.value=!0},500)}return{errors:i,isLoading:u,isLoading2:e,getNews:w,getNew:c,getNewBySlug:l,news:n,newItem:r,slugify:f}});export{L as u};
