PageSourceSearch

https://www.fablaquila.org/_nuxt/BygsaywT.js

js fablaquila.org collected 2026-10-08 05:49:41 UTC 3,207 bytes, 1 lines download raw bytes

1import{ot as e}from"./BLNNwZYM.js";import{a as t,c as n,g as r,h as i,i as a,o,p as s,r as c,s as l,u,v as d}from"#entry";import{t as f}from"./BXtqRVvK.js";function p(e){return e.dataInizio??e.dataEvento}function m(e){return e.dataFine??p(e)}function h(e,t){return m(e)<t}function g(){let e=new Date,t=String(e.getMonth()+1).padStart(2,`0`),n=String(e.getDate()).padStart(2,`0`);return`${e.getFullYear()}-${t}-${n}`}var _=class extends Error{storagePath;constructor(e,t){let n=t instanceof Error?t.message:String(t);super(`Il record dell'evento è stato rimosso, ma l'eliminazione della copertina su Storage è fallita (${e}): ${n}`,{cause:t}),this.storagePath=e,this.name=`EventoStorageDeleteFailedError`}};function v(){let m=c(),h=a(),g=e([]);function v(e){return e.sort((e,t)=>p(t).localeCompare(p(e)))}async function y(){let e=(await u(i(m,`eventi`))).val()??{};g.value=v(Object.values(e))}async function b(){let[e,t]=await Promise.all([u(i(m,`eventi`)),u(i(m,`eventi_bozze`))]),n=e.val()??{},r=t.val()??{};g.value=v([...Object.values(n),...Object.values(r)])}async function x(e){let t=await u(i(m,`eventi/${e}`));return t.exists()?t.val():null}async function S(e){let t=await x(e);if(t)return t;let n=await u(i(m,`eventi_bozze/${e}`));return n.exists()?n.val():null}async function C(e){let[t,n]=await Promise.all([u(i(m,`eventi/${e}`)),u(i(m,`eventi_bozze/${e}`))]);return t.exists()||n.exists()}async function w(e){let[t,n]=await Promise.all([u(i(m,`eventi/${e.slug}`)),u(i(m,`eventi_bozze/${e.slug}`))]),r=t.exists()?t.val():n.exists()?n.val():null,a=r?r.createdAt:e.createdAt??Date.now(),o={...e,dataEvento:null,dataFine:e.dataFine??null,coverUrl:e.coverUrl??null,coverStoragePath:e.coverStoragePath??null,link:e.link??null,immagini:e.immagini??r?.immagini??null,createdAt:a,updatedAt:Date.now()},s=e.pubblicato?`eventi/${e.slug}`:`eventi_bozze/${e.slug}`,c=e.pubblicato?`eventi_bozze/${e.slug}`:`eventi/${e.slug}`;await d(i(m),{[s]:o,[c]:null})}async function T(e){let n=await u(i(m,`eventi/${e}`)),a=n.exists(),o=a?n:await u(i(m,`eventi_bozze/${e}`)),s=o.exists()?o.val():null,c=a?`eventi/${e}`:`eventi_bozze/${e}`;await r(i(m,c));let d=s?.coverStoragePath;if(d)try{await t(l(h,d))}catch(e){throw new _(d,e)}}async function E(e){return(await u(i(m,`eventi/${e}`))).exists()?`eventi/${e}`:`eventi_bozze/${e}`}async function D(e,t){let[r,a]=await Promise.all([f(t,{maxSizeMB:1.5,maxWidthOrHeight:2e3}),f(t,{maxSizeMB:.15,maxWidthOrHeight:400})]),c=s(i(m,`${await E(e)}/immagini`)),u=c.key,p=`eventi/${e}/gallery/${u}.jpg`,g=`eventi/${e}/gallery/${u}_thumb.jpg`,_=l(h,p),v=l(h,g);await Promise.all([n(_,r),n(v,a)]);let[y,b]=await Promise.all([o(_),o(v)]);return await d(c,{url:y,thumbUrl:b,storagePath:p,thumbStoragePath:g,ordine:Date.now(),createdAt:Date.now()}),u}async function O(e,n){let a=await E(e),o=i(m,`${a}/immagini/${n}`),s=(await u(o)).val();if(await r(o),s)try{await Promise.all([t(l(h,s.storagePath)),t(l(h,s.thumbStoragePath))])}catch(e){throw new _(s.storagePath,e)}}return y(),{eventi:g,fetchAll:y,fetchAllAdmin:b,getBySlug:x,getBySlugAdmin:S,slugExists:C,upsertEvento:w,deleteEvento:T,uploadEventoImmagine:D,deleteEventoImmagine:O}}export{g as a,h as i,m as n,v as o,p as r,_ 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.