1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33142],{33142:(e,r,t)=>{t.r(r),t.d(r,{default:()=>B});var l=t(95155),s=t(11518),a=t.n(s),o=t(12115),n=t(13385),i=t(22170),c=t(912),d=t(33168),u=t(88058),m=t(73884),p=t(63759),b=t(68700),h=t(60614),x=t(98499),g=t(64380),f=t(59987),y=t(37235),v=t(13715),w=t(98156),j=t(48054),_=t(85915),N=t(67808),k=t(86836),A=t(34139),S=t(37128),T=t(54255),C=t(62420);function E(e){try{let r=new URL(e),t="/object/public/",l=r.pathname.indexOf(t);if(-1!==l){let[e,...s]=r.pathname.slice(l+t.length).split("/"),a=s.join("/");if(e&&a)return{bucket:e,path:a}}}catch(e){}for(let r of["memorial-videos","memorialvideos","memorialimages","memorial-albums"]){let t=e.split("/".concat(r,"/"));if(2===t.length)return{bucket:r,path:t[1]}}return null}let M=e=>({name:"",description:"",type:"video"===e?"video":"photo"===e?"photo":"mixed",privacy_type:"public",password:"",allow_download:!0,allow_comments:!0,allow_sharing:!0}),F=e=>({name:e.name||"",description:e.description||"",type:e.type||"mixed",privacy_type:e.is_public?"public":e.password?"password":"private",password:e.password||"",allow_download:!1!==e.allow_download,allow_comments:!1!==e.allow_comments,allow_sharing:!1!==e.allow_sharing}),B=e=>{let{memorialId:r,isOwner:t=!1,canEdit:s=!1,albumType:B="all"}=e,{userRole:z,userId:R,isBranch:L,branchId:q,bestatterId:D,sds_customer_id:P,hasPermission:V}=(0,n.usePermissionsContext)(),O=(0,d.cT)(),X="var(--dt-color-text, var(--theme-text, #111827))",G="var(--dt-color-text-muted, rgba(0,0,0,0.55))",U="var(--dt-color-border, rgba(0,0,0,0.10))",I="var(--dt-color-primary, var(--theme-primary, #1F5E59))",$="var(--dt-color-header-text, #ffffff)",H="var(--dt-color-surface, #ffffff)",J="var(--dt-radius-card, 12px)",K="var(--dt-radius-button, 10px)",W={outline:"none",borderColor:I,boxShadow:"0 0 0 3px color-mix(in srgb, ".concat(I," 25%, transparent)")},Q={width:"100%",padding:"10px 12px",borderRadius:K,border:"1px solid ".concat(U),background:"transparent",color:X},[Y,Z]=(0,o.useState)([]),[ee,er]=(0,o.useState)(null),[et,el]=(0,o.useState)([]),[es,ea]=(0,o.useState)(!0),[eo,en]=(0,o.useState)(!1),[ei,ec]=(0,o.useState)(null),[ed,eu]=(0,o.useState)(!1),[em,ep]=(0,o.useState)(!1),[eb,eh]=(0,o.useState)(!1),[ex,eg]=(0,o.useState)(null),[ef,ey]=(0,o.useState)(null),[ev,ew]=(0,o.useState)(!1),[ej,e_]=(0,o.useState)(!1),[eN,ek]=(0,o.useState)(null),[eA,eS]=(0,o.useState)(M(B)),[eT,eC]=(0,o.useState)(M(B)),eE=s||t||V(i.aX.GalleryCreateAlbum)||(0,i._m)(z,i.aX.GalleryCreateAlbum),eM=s||t||V(i.aX.GalleryDeleteAlbum)||(0,i._m)(z,i.aX.GalleryDeleteAlbum),eF=s||t||V(i.aX.GalleryUpload)||(0,i._m)(z,i.aX.GalleryUpload);V(i.aX.MemorialEditAll)||V(i.aX.MemorialEdit)||(0,i._m)(z,i.aX.MemorialEditAll)||(0,i._m)(z,i.aX.MemorialEdit),(0,o.useEffect)(()=>{eB(),ez(),eR()},[r]),(0,o.useEffect)(()=>{ee&&eL(ee.id)},[ee]),(0,o.useEffect)(()=>{eS(e=>({...e,type:"video"===B?"video":"photo"===B?"photo":e.type}))},[B]);let eB=async()=>{try{var e,t,l,s,a,o,n,i,c,d,u;let{data:m,error:p}=await O.from("memorial_pages").select("\n id,\n branch_id,\n user_id,\n bestatter_id,\n invoice_id,\n sds_customer_id,\n user:user_id (\n id,\n email,\n name,\n bestatter_id,\n branch_id,\n parent_bestatter_id,\n is_branch,\n sds_customer_id\n )\n ").eq("id",r).maybeSingle();if(p)throw p;if(!m){ek(null);return}let b=Array.isArray(m.user)?null!==(e=m.user[0])&&void 0!==e?e:null:null!==(t=m.user)&&void 0!==t?t:null;ek({id:m.id,branch_id:null!==(l=m.branch_id)&&void 0!==l?l:null,user_id:m.user_id,bestatter_id:null!==(s=m.bestatter_id)&&void 0!==s?s:null,invoice_id:null!==(a=m.invoice_id)&&void 0!==a?a:null,sds_customer_id:null!==(o=m.sds_customer_id)&&void 0!==o?o:null,user:b?{id:b.id,email:b.email,name:null!==(n=b.name)&&void 0!==n?n:null,bestatter_id:null!==(i=b.bestatter_id)&&void 0!==i?i:null,branch_id:null!==(c=b.branch_id)&&void 0!==c?c:null,parent_bestatter_id:null!==(d=b.parent_bestatter_id)&&void 0!==d?d:null,is_branch:!!b.is_branch,sds_customer_id:null!==(u=b.sds_customer_id)&&void 0!==u?u:null}:null})}catch(e){console.error("Error loading memorial context:",e)}},ez=async()=>{try{let e=await (0,c.hd)(r);ec(e)}catch(e){console.error("Error loading premium features:",e)}},eR=async()=>{try{ea(!0),ey(null);let e=O.from("memorial_page_albums").select("\n *,\n item_count:memorial_page_album_items(count)\n ").eq("memorial_page_id",r).order("sequence_number",{ascending:!0});"video"===B?e=e.eq("type","video"):"photo"===B&&(e=e.eq("type","photo"));let{data:t,error:l}=await e;if(l)throw l;let s=(t||[]).map(e=>{var r,t;return{...e,item_count:(null===(t=e.item_count)||void 0===t?void 0:null===(r=t[0])||void 0===r?void 0:r.count)||0,allow_download:!1!==e.allow_download,allow_comments:!1!==e.allow_comments,allow_sharing:!1!==e.allow_sharing}});Z(s)}catch(e){console.error("Error loading albums:",e),ey("Fehler beim Laden der Alben")}finally{ea(!1)}},eL=async e=>{try{en(!0);let{data:r,error:t}=await O.from("memorial_page_album_items").select("*").eq("album_id",e).order("sequence_number",{ascending:!0});if(t)throw t;el(r||[])}catch(e){console.error("Error loading album items:",e)}finally{en(!1)}},eq=()=>{if(!ei)return!1;if(!ei.advancedAlbums)return Y.length<1;let e=ei.maxAlbums||1;return"unlimited"===e||Y.length<e},eD=async e=>{var r;let t=null===(r=(await O.auth.getSession()).data.session)||void 0===r?void 0:r.access_token,l=await fetch("/api/dashboard/legacy-albums/save",{method:"POST",headers:{"Content-Type":"application/json",...t?{Authorization:"Bearer ".concat(t)}:{}},body:JSON.stringify(e)}),s=await l.json().catch(()=>({}));if(!l.ok||!(null==s?void 0:s.success))throw Error((null==s?void 0:s.error)||"Album konnte nicht gespeichert werden.");return s},eP=async()=>
1{if(!eE){ey("Sie haben keine Berechtigung, Alben zu erstellen");return}if(!eq()){eu(!0);return}if(!eA.name.trim()){ey("Bitte geben Sie einen Album-Namen ein");return}if("password"===eA.privacy_type&&!eA.password.trim()){ey("Bitte vergeben Sie ein Passwort f\xfcr dieses Album");return}try{ey(null);let e="all"!==B?B:eA.type,t=await eD({memorialId:r,name:eA.name.trim(),description:eA.description.trim(),type:e,privacyType:eA.privacy_type,password:eA.password,allowDownload:eA.allow_download,allowComments:eA.allow_comments,allowSharing:eA.allow_sharing,sequenceNumber:Y.length}),l=null==t?void 0:t.album;if(!l)throw Error("Album wurde erstellt, konnte aber nicht zur\xfcckgeladen werden.");Z([...Y,{...l,item_count:0,allow_download:!1!==l.allow_download,allow_comments:!1!==l.allow_comments,allow_sharing:!1!==l.allow_sharing}]),ep(!1),eS(M(B))}catch(e){console.error("Error creating album:",e),ey((null==e?void 0:e.message)||"Fehler beim Erstellen des Albums")}},eV=e=>{eg(e),eC(F(e)),eh(!0)},eO=async()=>{if(ex){if(!eT.name.trim()){ey("Bitte geben Sie einen Album-Namen ein");return}if("password"===eT.privacy_type&&!eT.password.trim()&&!ex.password){ey("Bitte vergeben Sie ein Passwort f\xfcr dieses Album");return}try{e_(!0),ey(null);let e=await eD({albumId:ex.id,memorialId:r,name:eT.name.trim(),description:eT.description.trim(),type:"all"!==B?B:eT.type,privacyType:eT.privacy_type,password:eT.password,allowDownload:eT.allow_download,allowComments:eT.allow_comments,allowSharing:eT.allow_sharing,sequenceNumber:ex.sequence_number||0}),t=null==e?void 0:e.album;if(!t)throw Error("Album wurde aktualisiert, konnte aber nicht zur\xfcckgeladen werden.");let l={...t,item_count:ex.item_count||0,allow_download:!1!==t.allow_download,allow_comments:!1!==t.allow_comments,allow_sharing:!1!==t.allow_sharing};Z(e=>e.map(e=>e.id===ex.id?l:e)),(null==ee?void 0:ee.id)===ex.id&&er(l),eh(!1),eg(null)}catch(e){console.error("Error updating album:",e),ey((null==e?void 0:e.message)||"Fehler beim Aktualisieren des Albums")}finally{e_(!1)}}},eX=async e=>{if(!eM){ey("Sie haben keine Berechtigung, Alben zu l\xf6schen");return}if(confirm("M\xf6chten Sie dieses Album und alle enthaltenen Medien wirklich l\xf6schen?"))try{let{data:r}=await O.from("memorial_page_album_items").select("file_url").eq("album_id",e);if(r&&r.length>0){let e={};for(let t of r){let r=E(t.file_url);r&&(e[r.bucket]=e[r.bucket]||[],e[r.bucket].push(r.path))}for(let[r,t]of Object.entries(e))t.length>0&&await O.storage.from(r).remove(t)}let{error:t}=await O.from("memorial_page_albums").delete().eq("id",e);if(t)throw t;Z(Y.filter(r=>r.id!==e)),(null==ee?void 0:ee.id)===e&&(er(null),el([])),(null==ex?void 0:ex.id)===e&&(eh(!1),eg(null))}catch(e){console.error("Error deleting album:",e),ey("Fehler beim L\xf6schen des Albums")}},eG=(e,r)=>{if(e.type)return e.type;let t=(e.name.split(".").pop()||"").toLowerCase();if(r)switch(t){case"mp4":default:return"video/mp4";case"mov":return"video/quicktime";case"webm":return"video/webm";case"avi":return"video/x-msvideo";case"mkv":return"video/x-matroska"}else switch(t){case"png":return"image/png";case"webp":return"image/webp";default:return"image/jpeg"}},eU=async(e,t,l)=>{let s=e.target.files;if(!s||0===s.length)return;if(!eF){ey("Sie haben keine Berechtigung, Dateien hochzuladen");return}let a=l.item_count||0,o=(null==ei?void 0:ei.maxItemsPerAlbum)||50;if("unlimited"!==o&&a+s.length>o){ey("Dieses Album kann maximal ".concat(o," Elemente enthalten"));return}try{ew(!0),ey(null);let a=[];for(let e of s){let s=e.type.startsWith("image/")||/\.(png|jpe?g|webp)$/i.test(e.name),o=e.type.startsWith("video/")||/\.(mp4|mov|webm|avi|mkv)$/i.test(e.name);if("photo"===l.type&&!s){ey("Dieses Album akzeptiert nur Bilder");continue}if("video"===l.type&&!o){ey("Dieses Album akzeptiert nur Videos");continue}let n=o?(null==ei?void 0:ei.maxVideoSize)||100:(null==ei?void 0:ei.maxImageSize)||10;if(e.size>1024*n*1024){ey("Die Datei ".concat(e.name," ist zu gro\xdf (max. ").concat(n,"MB)"));continue}let i=e.name.split(".").pop(),c="".concat(r,"/").concat(t,"/").concat(Date.now(),"_").concat(Math.random().toString(36).substring(7),".").concat(i),d=o?"memorialvideos":"memorialimages",u=await e.arrayBuffer(),m=eG(e,o),{error:p}=await O.storage.from(d).upload(c,u,{contentType:m,cacheControl:"3600",upsert:!1});if(p)throw p;let{data:{publicUrl:b}}=O.storage.from(d).getPublicUrl(c),{data:h,error:x}=await O.from("memorial_page_album_items").insert({album_id:t,type:o?"video":"photo",file_url:b,title:e.name.replace(/\.[^/.]+$/,""),sequence_number:et.length+a.length,uploaded_by:R}).select().single();if(x)throw x;a.push(h)}(null==ee?void 0:ee.id)===t&&el([...et,...a]),Z(Y.map(e=>e.id===t?{...e,item_count:(e.item_count||0)+a.length}:e)),e.target.value=""}catch(e){console.error("Error uploading files:",e),ey("Fehler beim Hochladen der Dateien")}finally{ew(!1)}},eI=async(e,r)=>{if(!eM){ey("Sie haben keine Berechtigung, Elemente zu l\xf6schen");return}try{let t=E(r);t&&await O.storage.from(t.bucket).remove([t.path]);let{error:l}=await O.from("memorial_page_album_items").delete().eq("id",e);if(l)throw l;el(et.filter(r=>r.id!==e)),ee&&Z(Y.map(e=>
1e.id===ee.id?{...e,item_count:Math.max(0,(e.item_count||1)-1)}:e))}catch(e){console.error("Error deleting item:",e),ey("Fehler beim L\xf6schen des Elements")}},e$=e=>{switch(e){case"video":return(0,l.jsx)(u.A,{className:"w-5 h-5"});case"photo":return(0,l.jsx)(m.A,{className:"w-5 h-5"});default:return(0,l.jsx)(p.A,{className:"w-5 h-5"})}},eH=(e,r,t)=>(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium mb-1",style:{color:X},children:"Name *"}),(0,l.jsx)("input",{type:"text",value:r.name,onChange:e=>t({...r,name:e.target.value}),style:Q,placeholder:"video"===B?"z.B. Familienvideos":"photo"===B?"z.B. Familienfotos":"z.B. Erinnerungen",onFocus:e=>Object.assign(e.currentTarget.style,W),onBlur:e=>{e.currentTarget.style.borderColor=String(U),e.currentTarget.style.boxShadow="none"}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium mb-1",style:{color:X},children:"Beschreibung"}),(0,l.jsx)("textarea",{value:r.description,onChange:e=>t({...r,description:e.target.value}),style:Q,rows:3,placeholder:"Optional: Beschreiben Sie das Album...",onFocus:e=>Object.assign(e.currentTarget.style,W),onBlur:e=>{e.currentTarget.style.borderColor=String(U),e.currentTarget.style.boxShadow="none"}})]}),"video"===B?(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium mb-1",style:{color:X},children:"Typ"}),(0,l.jsx)("input",{type:"text",value:"Nur Videos",disabled:!0,style:{...Q,background:"color-mix(in srgb, var(--dt-color-surface, #ffffff) 70%, var(--dt-color-border, rgba(0,0,0,0.10)))",color:G}})]}):"photo"===B?(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium mb-1",style:{color:X},children:"Typ"}),(0,l.jsx)("input",{type:"text",value:"Nur Fotos",disabled:!0,style:{...Q,background:"color-mix(in srgb, var(--dt-color-surface, #ffffff) 70%, var(--dt-color-border, rgba(0,0,0,0.10)))",color:G}})]}):(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium mb-1",style:{color:X},children:"Typ"}
1),(0,l.jsxs)("select",{value:r.type,onChange:e=>t({...r,type:e.target.value}),style:Q,onFocus:e=>Object.assign(e.currentTarget.style,W),onBlur:e=>{e.currentTarget.style.borderColor=String(U),e.currentTarget.style.boxShadow="none"},children:[(0,l.jsx)("option",{value:"photo",children:"Nur Fotos"}),(0,l.jsx)("option",{value:"video",children:"Nur Videos"}),(0,l.jsx)("option",{value:"mixed",children:"Fotos & Videos"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium mb-2",style:{color:X},children:"Sichtbarkeit"}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("label",{className:"flex items-center gap-2",style:{color:X},children:[(0,l.jsx)("input",{type:"radio",name:"".concat(e,"_privacy_type"),checked:"public"===r.privacy_type,onChange:()=>t({...r,privacy_type:"public",password:""})}),(0,l.jsx)(b.A,{className:"w-4 h-4"}),(0,l.jsx)("span",{className:"text-sm",children:"\xd6ffentlich"})]}),(0,l.jsxs)("label",{className:"flex items-center gap-2",style:{color:X},children:[(0,l.jsx)("input",{type:"radio",name:"".concat(e,"_privacy_type"),checked:"private"===r.privacy_type,onChange:()=>t({...r,privacy_type:"private",password:""})}),(0,l.jsx)(h.A,{className:"w-4 h-4"}),(0,l.jsx)("span",{className:"text-sm",children:"Privat"})]}),(0,l.jsxs)("label",{className:"flex items-center gap-2",style:{color:X},children:[(0,l.jsx)("input",{type:"radio",name:"".concat(e,"_privacy_type"),checked:"password"===r.privacy_type,onChange:()=>t({...r,privacy_type:"password"})}),(0,l.jsx)(h.A,{className:"w-4 h-4"}),(0,l.jsx)("span",{className:"text-sm",children:"Mit Passwort sch\xfctzen"})]})]})]}),"password"===r.privacy_type&&(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium mb-1",style:{color:X},children:"Passwort *"}),(0,l.jsx)("input",{type:"password",value:r.password,onChange:e=>t({...r,password:e.target.value}),style:Q,placeholder:"Passwort f\xfcr gesch\xfctztes Album",onFocus:e=>Object.assign(e.currentTarget.style,W),onBlur:e=>{e.currentTarget.style.borderColor=String(U),e.currentTarget.style.boxShadow="none"}})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("label",{className:"flex items-center gap-2",style:{color:X},children:[(0,l.jsx)("input",{type:"checkbox",checked:r.allow_download,onChange:e=>t({...r,allow_download:e.target.checked})}),(0,l.jsx)(x.A,{className:"w-4 h-4"}),(0,l.jsx)("span",{className:"text-sm",children:"Downloads erlauben"})]}),(0,l.jsxs)("label",{className:"flex items-center gap-2",style:{color:X},children:[(0,l.jsx)("input",{type:"checkbox",checked:r.allow_comments,onChange:e=>t({...r,allow_comments:e.target.checked})}),(0,l.jsx)(g.A,{className:"w-4 h-4"}),(0,l.jsx)("span",{className:"text-sm",children:"Kommentare erlauben"})]}),(0,l.jsxs)("label",{className:"flex items-center gap-2",style:{color:X},children:[(0,l.jsx)("input",{type:"checkbox",checked:r.allow_sharing,onChange:e=>t({...r,allow_sharing:e.target.checked})}),(0,l.jsx)(f.A,{className:"w-4 h-4"}),(0,l.jsx)("span",{className:"text-sm",children:"Teilen erlauben"})]})]})]});if(es)return(0,l.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,l.jsx)(y.A,{className:"w-8 h-8 animate-spin",style:{color:I}})});let eJ=(null==ei?void 0:ei.maxAlbums)||1,eK="unlimited"===eJ,eW=(null==ei?void 0:ei.advancedAlbums)||!1;return(0,l.jsxs)("div",{className:"space-y-6",style:{color:X},children:[(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-2xl font-bold",style:{color:X},children:"video"===B?"Video Alben":"photo"===B?"Foto Alben":"Foto & Video Alben"}),!eK&&(0,l.jsxs)("p",{className:"text-sm mt-1",style:{color:G},children:[Y.length," von ",eJ," ",eW?"Premium-":"","Alben verwendet"]})]}),eE&&eq()&&(0,l.jsxs)("button",{onClick:()=>ep(!0),className:"px-4 py-2 rounded-lg flex items-center gap-2 transition-opacity",style:{backgroundColor:I,color:$,borderRadius:K},onMouseEnter:e=>e.currentTarget.style.filter="brightness(0.94)",onMouseLeave:e=>e.currentTarget.style.filter="none",children:[(0,l.jsx)(v.A,{className:"w-4 h-4"}),"Neues ","video"===B?"Video-":"photo"===B?"Foto-":"","Album"]})]}),ef&&(0,l.jsxs)("div",{className:"rounded-lg p-4 flex items-start gap-3",style:{background:"color-mix(in srgb, #ef4444 10%, var(--dt-color-surface, #ffffff))",border:"1px solid color-mix(in srgb, #ef4444 35%, transparent)",borderRadius:J},children:[(0,l.jsx)(w.A,{className:"w-5 h-5 mt-0.5",style:{color:"#ef4444"}}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)("p",{style:{color:"color-mix(in srgb, #ef4444 75%, #000)"},children:ef})})]}),0===Y.length?(0,l.jsxs)("div",{className:"p-12 text-center",style:{background:"color-mix(in srgb, var(--dt-color-surface, #ffffff) 80%, var(--dt-color-border, rgba(0,0,0,0.10)))",border:"1px solid ".concat(U),borderRadius:J},children:[(0,l.jsx)(j.A,{className:"w-16 h-16 mx-auto mb-4",style:{color:G}}),(0,l.jsxs)("h3",{className:"text-lg font-semibold mb-2",style:{color:X},children:["Noch keine ","video"===B?"Video-":"photo"===B?"Foto-":"","Alben vorhanden"]}),(0,l.jsxs)("p",{className:"mb-4",style:{color:G},children:["Erstellen Sie Ihr erstes Album, um"," ","video"===B?"Videos":"photo"===B?"Fotos":"Fotos und Videos"," zu organisieren"]}),eE&&(0,l.jsx)("button",{onClick:()=>eq()?ep(!0):eu(!0),className:"px-6 py-2 rounded-lg transition-opacity",style:{backgroundColor:I,color:$,borderRadius:K},onMouseEnter:e=>e.currentTarget.style.filter="brightness(0.94)",onMouseLeave:e=>
1e.currentTarget.style.filter="none",children:eq()?"Erstes Album erstellen":"Premium f\xfcr mehr Alben"})]}):(0,l.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Y.map(e=>(0,l.jsxs)("div",{className:"overflow-hidden transition-shadow cursor-pointer group",style:{background:H,border:"1px solid ".concat(U),borderRadius:J,boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},onClick:()=>er(e),onMouseEnter:e=>e.currentTarget.style.boxShadow="0 10px 20px rgba(0,0,0,0.10)",onMouseLeave:e=>e.currentTarget.style.boxShadow="0 1px 3px rgba(0,0,0,0.06)",children:[(0,l.jsxs)("div",{className:"aspect-video relative",style:{background:"color-mix(in srgb, var(--dt-color-surface, #ffffff) 70%, var(--dt-color-border, rgba(0,0,0,0.10)))",borderBottom:"1px solid ".concat(U)},children:[e.cover_image_url?(0,l.jsx)("img",{src:e.cover_image_url,alt:e.name,className:"w-full h-full object-cover"}):(0,l.jsx)("div",{className:"w-full h-full flex items-center justify-center",style:{color:G},children:e$(e.type)}),!e.is_public&&(0,l.jsx)("div",{className:"absolute top-2 right-2 p-1",style:{background:"rgba(0,0,0,0.55)",color:"#fff",borderRadius:K},title:"Nicht \xf6ffentlich",children:(0,l.jsx)(h.A,{className:"w-4 h-4"})})]}),(0,l.jsxs)("div",{className:"p-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("h3",{className:"font-semibold truncate flex-1",style:{color:X},children:e.name}),(0,l.jsx)(_.A,{className:"w-5 h-5 group-hover:opacity-90",style:{color:G}})]}),e.description&&(0,l.jsx)("p",{className:"text-sm mt-1 line-clamp-2",style:{color:G},children:e.description}),(0,l.jsxs)("div",{className:"flex items-center justify-between mt-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm",style:{color:G},children:[e$(e.type),(0,l.jsxs)("span",{children:[e.item_count||0," ","video"===e.type?"Videos":"photo"===e.type?"Fotos":"Elemente"]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(s||t)&&(0,l.jsx)("button",{onClick:r=>{r.stopPropagation(),eV(e)},className:"p-1 transition-opacity",style:{color:I},title:"Album bearbeiten",onMouseEnter:e=>e.currentTarget.style.filter="brightness(0.9)",onMouseLeave:e=>e.currentTarget.style.filter="none","aria-label":"Album bearbeiten",children:(0,l.jsx)(N.A,{className:"w-4 h-4"})}),eM&&(0,l.jsx)("button",{onClick:r=>{r.stopPropagation(),eX(e.id)},className:"p-1 transition-opacity",style:{color:"#ef4444"},title:"Album l\xf6schen",onMouseEnter:e=>e.currentTarget.style.filter="brightness(0.9)",onMouseLeave:e=>e.currentTarget.style.filter="none","aria-label":"Album l\xf6schen",children:(0,l.jsx)(k.A,{className:"w-4 h-4"})})]})]}),(0,l.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px]",children:[e.allow_download&&(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full",style:{background:"color-mix(in srgb, var(--dt-color-primary, #1F5E59) 10%, transparent)",color:I},children:[(0,l.jsx)(x.A,{className:"w-3 h-3"}),"Downloads"]}),e.allow_comments&&(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full",style:{background:"color-mix(in srgb, var(--dt-color-primary, #1F5E59) 10%, transparent)",color:I},children:[(0,l.jsx)(g.A,{className:"w-3 h-3"}),"Kommentare"]}),e.allow_sharing&&(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full",style:{background:"color-mix(in srgb, var(--dt-color-primary, #1F5E59) 10%, transparent)",color:I},children:[(0,l.jsx)(f.A,{className:"w-3 h-3"}),"Teilen"]})]})]})]},e.id))}),eE&&!eq()&&Y.length>0&&(0,l.jsxs)("div",{className:"rounded-lg p-4 flex items-center justify-between",style:{background:"color-mix(in srgb, ".concat(I," 10%, var(--dt-color-surface, #ffffff))"),border:"1px solid color-mix(in srgb, ".concat(I," 30%, transparent)"),borderRadius:J},children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-semibold",style:{color:X},children:"Album-Limit erreicht"}),(0,l.jsx)("p",{className:"text-sm mt-1",style:{color:X},children:"Upgraden Sie auf Premium f\xfcr unbegrenzte Alben und erweiterte Funktionen"})]}),(0,l.jsx)("button",{onClick:()=>eu(!0),className:"px-4 py-2 rounded-lg transition-opacity",style:{backgroundColor:I,color:$,borderRadius:K},onMouseEnter:e=>e.currentTarget.style.filter="brightness(0.94)",onMouseLeave:e=>e.currentTarget.style.filter="none",children:"Jetzt upgraden"})]}),em&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.55)"},children:(0,l.jsxs)("div",{className:"max-w-md w-full p-6",style:{background:H,borderRadius:J,border:"1px solid ".concat(U)},children:[(0,l.jsxs)("h3",{className:"text-lg font-semibold mb-4",style:{color:X},children:["Neues ","video"===B?"Video-":"photo"===B?"Foto-":"","Album erstellen"]}),eH("create",eA,eS),(0,l.jsxs)("div",{className:"flex justify-end gap-3 mt-6",children:[(0,l.jsx)("button",{onClick:()=>ep(!1),className:"px-4 py-2 rounded-lg transition-opacity",style:{borderRadius:K,border:"1px solid ".concat(U),color:X,background:"transparent"},onMouseEnter:e=>e.currentTarget.style.background="color-mix(in srgb, var(--dt-color-surface, #ffffff) 70%, var(--dt-color-border, rgba(0,0,0,0.10)))",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:"Abbrechen"}),(0,l.jsx)("button",{onClick:eP,className:"px-4 py-2 rounded-lg transition-opacity",style:{backgroundColor:I,color:$,borderRadius:K},onMouseEnter:e=>e.currentTarget.style.filter="brightness(0.94)",onMouseLeave:e=>e.currentTarget.style.filter="none",children:"Album erstellen"})]})]})}),eb&&ex&&(0,l.jsx)("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.55)"},children:(0,l.jsxs)("div",{className:"max-w-md w-full p-6",style:{background:H,borderRadius:J,border:"1px solid ".concat(U)},children:[(0,l.jsx)("h3",{className:"text-lg font-semibold mb-4",style:{color:X},children:"Album bearbeiten"}),eH("edit",eT,eC),(0,l.jsxs)("div",{className:"flex justify-end gap-3 mt-6",children:[(0,l.jsx)("button",{onClick:()=>{eh(!1),eg(null)},className:"px-4 py-2 rounded-lg transition-opacity",style:{borderRadius:K,border:"1px solid ".concat(U),color:X,background:"transparent"},onMouseEnter:e=>e.currentTarget.style.background="color-mix(in srgb, var(--dt-color-surface, #ffffff) 70%, var(--dt-color-border, rgba(0,0,0,0.10)))",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:"Abbrechen"}),(0,l.jsx)("button",{onClick:eO,disabled:ej,className:"px-4 py-2 rounded-lg transition-opacity",style:{backgroundColor:I,color:$,borderRadius:K,opacity:ej?.7:1},onMouseEnter:e=>e.currentTarget.style.filter="brightness(0.94)",onMouseLeave:e=>e.currentTarget.style.filter="none",children:ej?"Speichere...":"\xc4nderungen speichern"})]})]})}),ee&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.55)"},children:(0,l.jsxs)("div",{className:"max-w-6xl w-full max-h-[90vh] overflow-hidden",style:{background:H,borderRadius:J,border:"1px solid ".concat(U)},children:[(0,l.jsxs)("div",{className:"flex justify-between items-center p-4",style:{borderBottom:"1px solid ".concat(U)},children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",style:{color:X},children:[e$(ee.type),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-lg font-semibold",children:ee.name}),ee.description&&(0,l.jsx)("p",{className:"text-sm",style:{color:G},children:ee.description})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(s||t)&&(0,l.jsxs)("button",{onClick:()=>eV(ee),className:"px-3 py-2 rounded-lg flex items-center gap-2",style:{borderRadius:K,border:"1px solid ".concat(U),color:X,background:"transparent"},onMouseEnter:e=>e.currentTarget.style.background="color-mix(in srgb, var(--dt-color-surface, #ffffff) 70%, var(--dt-color-border, rgba(0,0,0,0.10)))",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:[(0,l.jsx)(N.A,{className:"w-4 h-4"}),"Bearbeiten"]}),(0,l.jsx)("button",{onClick:()=>{er(null),el([])},className:"p-2",style:{borderRadius:"999px",color:G,border:"1px solid ".concat(U),background:"transparent"},onMouseEnter:e=>e.currentTarget.style.background="color-mix(in srgb, var(--dt-color-surface, #ffffff) 70%, var(--dt-color-border, rgba(0,0,0,0.10)))",onMouseLeave:e=>e.currentTarget.style.background="transparent","aria-label":"Schlie\xdfen",children:(0,l.jsx)(A.A,{className:"w-5 h-5"})})]})]}),eF&&(0,l.jsx)("div",{className:"p-4",style:{borderBottom:"1px solid ".concat(U)},children:(0,l.jsxs)("label",{className:"relative",children:[(0,l.jsx)("input",{type:"file",multiple:!0,accept:"video"===B||(null==ee?void 0:ee.type)==="video"?"video/*":"photo"===B||(null==ee?void 0:ee.type)==="photo"?"image/*":"image/*,video/*",onChange:e=>eU(e,ee.id,ee),className:"hidden",disabled:ev}),(0,l.jsx)("button",{className:"px-4 py-2 rounded-lg flex items-center gap-2 transition-opacity",style:{backgroundColor:I,color:$,borderRadius:K,cursor:ev?"not-allowed":"pointer",opacity:ev?.7:1},onClick:e=>{var r;return null===(r=e.currentTarget.previousElementSibling)||void 0===r?void 0:r.click()},disabled:ev,children:ev?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(y.A,{className:"w-4 h-4 animate-spin"}),"Hochladen..."]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(S.A,{className:"w-4 h-4"}),"video"===ee.type?"Videos":"photo"===ee.type?"Fotos":"Dateien"," ","hinzuf\xfcgen"]})})]})}),(0,l.jsx)("div",{className:"p-4 overflow-y-auto",style:{maxHeight:"calc(90vh - 200px)"},children:eo?(0,l.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,l.jsx)(y.A,{className:"w-8 h-8 animate-spin",style:{color:I}})}):0===et.length?(0,l.jsx)("div",{className:"text-center py-12",style:{color:G},children:(0,l.jsxs)("p",{children:["Dieses Album ist noch leer.",eF&&" F\xfcgen Sie ".concat("video"===ee.type?"Videos":"photo"===ee.type?"Fotos":"Medien"," hinzu.")]})}):(0,l.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:et.map(e=>(0,l.jsxs)("div",{className:"jsx-9e53803fc14964ea relative group",children:["photo"===e.type?(0,l.jsx)("img",{src:e.f
1ile_url,alt:e.title||"Album item",style:{borderRadius:K,border:"1px solid ".concat(U)},className:"jsx-9e53803fc14964ea w-full aspect-square object-cover"}):(0,l.jsx)("div",{style:{borderRadius:K,background:"#111",border:"1px solid ".concat(U)},className:"jsx-9e53803fc14964ea w-full aspect-square flex items-center justify-center",children:(0,l.jsx)(u.A,{className:"w-12 h-12 text-white"})}),eM&&(0,l.jsx)("button",{onClick:()=>eI(e.id,e.file_url),style:{background:"#ef4444",color:"#fff",borderRadius:"999px",opacity:0},onMouseEnter:e=>e.currentTarget.style.filter="brightness(0.92)",onMouseLeave:e=>e.currentTarget.style.filter="none",className:"jsx-9e53803fc14964ea absolute top-2 right-2 p-1.5 transition-opacity",children:(0,l.jsx)(A.A,{className:"w-4 h-4"})}),(0,l.jsx)(a(),{id:"9e53803fc14964ea",children:".group.jsx-9e53803fc14964ea:hover button.jsx-9e53803fc14964ea{opacity:1}"})]},e.id))})})]})}),(0,l.jsx)(T.$,{isOpen:ed,onClose:()=>eu(!1),currentBundle:(0,C.hi)(ei),targetBundle:"plus",onUpgrade:e=>{window.location.href="/checkout?bundle=".concat(e,"&memorial=").concat(r)}})]})}}}]); 2//# sourceMappingURL=33142.13b4adfe704899db.js.map
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.