PageSourceSearch

https://systrastudios.de/assets/useProjects-6PBfpChR.js

js systrastudios.de collected 2026-10-02 00:10:36 UTC 2,879 bytes, 1 lines download raw bytes

1import{c as l,u as p,d as u}from"./react-Cyy6GMNm.js";import{s as n}from"./index-B64tgm8X.js";async function y(t,e=.85){return t.type==="image/webp"?t:new Promise((a,r)=>{const o=new Image,s=document.createElement("canvas"),c=s.getContext("2d");if(!c){r(new Error("Canvas context not available"));return}o.onload=()=>{s.width=o.width,s.height=o.height,c.drawImage(o,0,0),s.toBlob(i=>{if(!i){r(new Error("Failed to convert image to WebP"));return}const d=t.name.replace(/\.[^.]+$/,""),f=new File([i],`${d}.webp`,{type:"image/webp"});a(f)},"image/webp",e)},o.onerror=()=>{r(new Error("Failed to load image"))},o.src=URL.createObjectURL(t)})}function w(t,e){const a=[...t],r=[];let o=!1;for(;a.length;){let s=0;if(o&&e(a[0])){const i=a.findIndex(d=>!e(d));i>=0&&(s=i)}const[c]=a.splice(s,1);r.push(c),o=e(c)}return r}const m=new Set(["41d7b4de-564f-4b96-862e-1aa536fdc5aa"]),j=()=>l({queryKey:["projects"],queryFn:async()=>{const{data:t,error:e}=await n.from("projects").select("*").order("created_at",{ascending:!1});if(e)throw e;return t.filter(a=>!m.has(a.id))}}),g="id,title,category,description,tagline,image_url,industry,external_url,is_concept_study,is_featured,display_order,created_at,updated_at,gallery_images,results,duration,completed_at,before_image,after_image,video_url,video_poster_url",b=()=>l({queryKey:["projects","karten"],queryFn:async()=>{const{data:t,error:e}=await n.from("projects").select(g).order("created_at",{ascending:!1});if(e)throw e;return t.filter(r=>!m.has(r.id))}}),q=()=>l({queryKey:["projects","featured"],queryFn:async()=>{const{data:t,error:e}=await n.from("projects").select("id, title, image_url, description, is_featured, display_order, is_concept_study, video_url").eq("is_featured",!0).order("display_order",{ascending:!0}).order("created_at",{ascending:!1}).limit(16);if(e)throw e;return w(t.filter(r=>!m.has(r.id)),r=>!!r.is_concept_study).slice(0,6)}}),F=()=>{const t=p();return u({mutationFn:async e=>{const{data:a,error:r}=await n.from("projects").insert(e).select().single();if(r)throw r;return a},onSuccess:()=>{t.invalidateQueries({queryKey:["projects"]})}})},v=()=>{const t=p();return u({mutationFn:async({id:e,...a})=>{const{data:r,error:o}=await n.from("projects").update(a).eq("id",e).select().single();if(o)throw o;return r},onSuccess:()=>{t.invalidateQueries({queryKey:["projects"]})}})},P=()=>{const t=p();return u({mutationFn:async e=>{const{error:a}=await n.from("projects").delete().eq("id",e);if(a)throw a},onSuccess:()=>{t.invalidateQueries({queryKey:["projects"]})}})},E=()=>u({mutationFn:async t=>{const e=await y(t,.85),r=`projects/${`${crypto.randomUUID()}.webp`}`,{error:o}=await n.storage.from("cms-media").upload(r,e,{contentType:"image/webp"});if(o)throw o;const{data:s}=n.storage.from("cms-media").getPublicUrl(r);return s.publicUrl}});export{m as H,q as a,j as b,F as c,v as d,P as e,E as f,w as o,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.