Files
miriamgemeinde/public/assets/WorshipManagement-1GLJeLnc.js

3 lines
26 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{t as e}from"./axios-DHQprbt3.js";import{E as t,M as n,O as r,c as i,ct as a,d as o,h as s,i as c,m as l,ot as u,t as d,u as f,w as p}from"./_plugin-vue_export-helper-Conii5fq.js";import{a as m,c as h,i as g,r as _}from"./runtime-dom.esm-bundler-CI28bPhn.js";import{n as v,t as y}from"./strings-CNeI630x.js";import{t as b}from"./vue-multiselect.esm-bMCye0Qz.js";var x={name:`WorshipManagement`,components:{Multiselect:b},data(){let e=new Date().getFullYear();return{worships:[],eventPlaces:[],organizerOptions:[],sacristanOptions:[],selectedOrganizers:[],selectedSacristans:[],dayNameOptions:[],liturgicalDays:[],selectedDayName:null,selectedYear:e,availableYears:[e,e+1,e+2],isLoading:!1,isUpdatingFromDate:!1,worshipData:{eventPlaceId:null,date:``,time:``,title:``,organizer:``,collection:``,address:``,selfInformation:!1,highlightTime:!1,neighborInvitation:!1,introLine:``,sacristanService:``,website:``,dayName:``,approved:!1},selectedEventPlace:null,editMode:!1,editId:null,searchDate:``,showPastWorships:!1,showImportSection:!1,selectedFile:null,isImporting:!1,showExportSection:!1,exportDateFrom:``,exportDateTo:``,exportFormat:`editing`,isExporting:!1,showImportDialog:!1,importedWorships:[],importErrors:[],hasNewsletterPreview:!1}},computed:{filteredWorships(){let e=this.worships;if(!this.showPastWorships){let t=new Date;t.setHours(0,0,0,0),e=e.filter(e=>{if(e.date){let n=new Date(e.date);return n.setHours(0,0,0,0),n>=t}return!0})}if(this.searchDate){let t=new Date(this.searchDate);t.setHours(0,0,0,0),e=e.filter(e=>{if(e.date){let n=new Date(e.date);return n.setHours(0,0,0,0),n.getTime()===t.getTime()}return!1})}return e}},watch:{selectedDayName(e,t){e&&e!==t&&!this.isUpdatingFromDate&&this.updateDateFromDayName()}},async created(){await this.fetchEventPlaces(),await this.fetchWorships(),await this.fetchWorshipOptions(),await this.fetchLiturgicalDays(),this.hasNewsletterPreview=!!localStorage.getItem(`newsletter_import_last_result`),this.applyNewsletterDraft()},methods:{goBackToNewsletterImport(){this.$router.push(`/admin/newsletter-import`)},applyNewsletterDraft(){let e=localStorage.getItem(`newsletter_import_worship_bulk_draft`);if(e){localStorage.removeItem(`newsletter_import_worship_bulk_draft`);try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length>0){this.importedWorships=t.map(e=>{let t=this.eventPlaces.find(t=>t.id===e.eventPlaceId);return{date:e.date||``,dayName:e.dayName||``,time:e.time||``,title:e.title||``,organizer:e.organizer||``,collection:e.collection||``,sacristanService:e.sacristanService||``,organPlaying:e.organPlaying||``,approved:!!e.approved,eventPlace:t||null,eventPlaceId:e.eventPlaceId||null,_changedFields:[],_oldValues:{},_isUpdate:!1,_isNew:!0}}),this.importErrors=[],this.showImportDialog=!0;return}}catch(e){console.error(`Fehler beim Übernehmen des Gemeindebrief-Bulk-Entwurfs (Gottesdienst):`,e)}}let t=localStorage.getItem(`newsletter_import_worship_draft`);if(t){localStorage.removeItem(`newsletter_import_worship_draft`);try{let e=JSON.parse(t);e?.title&&(this.worshipData.title=e.title),e?.date&&(this.worshipData.date=e.date),e?.time&&(this.worshipData.time=e.time),e?.organizer&&(this.selectedOrganizers=e.organizer.split(`,`).map(e=>({name:e.trim()})).filter(e=>e.name)),e?.collection&&(this.worshipData.collection=e.collection),e?.eventPlaceId&&(this.selectedEventPlace=this.eventPlaces.find(t=>t.id===e.eventPlaceId)||null),e?.sourceText&&!this.worshipData.introLine&&(this.worshipData.introLine=e.sourceText),this.worshipData.date&&this.updateDayNameFromDate()}catch(e){console.error(`Fehler beim Übernehmen des Gemeindebrief-Entwurfs (Gottesdienst):`,e)}}},isFieldChanged(e,t){return e._changedFields&&e._changedFields.includes(t)},getOldValue(e,t){return e._oldValues&&e._oldValues[t]?e._oldValues[t]:``},formatTime:v,formatDate:y,async fetchWorships(){try{this.worships=(await e.get(`/worships`)).data}catch(e){console.error(`Fehler beim Abrufen der Gottesdienste:`,e)}},async fetchEventPlaces(){try{this.eventPlaces=(await e.get(`/event-places`)).data}catch(e){console.error(`Fehler beim Abrufen der Veranstaltungsorte:`,e)}},async fetchWorshipOptions(){try{let t=await e.get(`/worships/options`);this.organizerOptions=t.data.organizers.map(e=>({name:e})),this.sacristanOptions=t.data.sacristanServices.map(e=>({name:e}))}catch(e){console.error(`Fehler beim Abrufen der Worship-Optionen:`,e)}},async fetchLiturgicalDays(){try{let t=await e.get(`/liturgical-days`);this.liturgicalDays=t.data;let n=new Date;n.setHours(0,0,0,0);let r=t.data.filter(e=>{let t=new Date(e.date);return t.setHours(0,0,0,0),t>=n});r.sort((e,t)=>new Date(e.date)-new Date(t.date)),this.dayNameOptions=r.map(e=>({name:`${new Date(e.date).toLocaleDateString(`de-DE`,{day:`2-digit`,month:`2-digit`,year:`numeric`})} - ${e.dayName}`,dayName:e.dayName,date:e.date}))}catch(e){console.error(`Fehler beim Abrufen der liturgischen Tage:`,e)}},async loadLiturgicalYear(){if(!this.selectedYear){alert(`Bitte wählen Sie ein Jahr aus`);return}this.isLoading=!0;try{let t=await e.post(`/liturgical-days/load-year`,{year:this.selectedYear});alert(t.data.message),await this.fetchLiturgicalDays()}catch(e){console.error(`Fehler beim Laden des Kirchenjahres:`,e),e.response&&e.response.data&&e.response.data.message?alert(`Fehler: `+e.response.data.message):alert(`Fehler beim Laden des Kirchenjahres`)}finally{this.isLoading=!1}},updateDayNameFromDate(){if(!this.worshipData.date)return;this.isUpdatingFromDate=!0;let e=this.worshipData.date,t=this.liturgicalDays.find(t=>(typeof t.date==`string`?t.date:t.date.split(`T`)[0])===e);if(t){let n=this.dayNameOptions.find(t=>t.date===e);n&&(this.selectedDayName=n),this.worshipData.dayName=t.dayName,console.log(`Liturgischer Tag gefunden:`,t.dayName)}else console.log(`Kein liturgischer Tag gefunden für:`,e);this.$nextTick(()=>{this.isUpdatingFromDate=!1})},updateDateFromDayName(){!this.selectedDayName||!this.selectedDayName.date||(this.worshipData.date=this.selectedDayName.date,this.worshipData.dayName=this.selectedDayName.dayName,console.log(`Datum gesetzt auf:`,this.selectedDayName.date,`für`,this.selectedDayName.dayName))},async saveWorship(){try{let t={...this.worshipData,eventPlaceId:this.selectedEventPlace?this.selectedEventPlace.id:null,organizer:this.selectedOrganizers.map(e=>e.name).join(`, `),sacristanService:this.selectedSacristans.map(e=>e.name).join(`, `),dayName:this.selectedDayName?this.selectedDayName.dayName:``,approved:!!this.worshipData.approved};this.editMode?await e.put(`/worships/${this.editId}`,t):await e.post(`/worships`,t),this.resetForm(),await this.fetchWorships(),await this.fetchWorshipOptions()}catch(e){console.error(`Fehler beim Speichern des Gottesdienstes:`,e)}},async toggleApproved(t){try{let n=!t.approved;await e.put(`/worships/${t.id}`,{approved:n}),t.approved=n}catch(e){console.error(`Fehler beim Aktualisieren des Freigabe-Status:`,e),alert(`Fehler beim Aktualisieren des Freigabe-Status.`)}},editWorship(e){this.worshipData={...e},this.worshipData.date=y(e.date).split(`.`).reverse().join(`-`),this.worshipData.time=v(e.time),console.log(this.worshipData),this.selectedEventPlace=this.eventPlaces.find(t=>t.id===e.eventPlaceId),this.selectedOrganizers=e.organizer?e.organizer.split(`,`).map(e=>({name:e.trim()})):[],this.selectedSacristans=e.sacristanService?e.sacristanService.split(`,`).map(e=>({name:e.trim()})):[],e.dayName?this.selectedDayName=this.dayNameOptions.find(t=>t.dayName===e.dayName&&t.date===this.worshipData.date)||null:this.selectedDayName=null,this.editMode=!0,this.editId=e.id},async deleteWorship(t){try{await e.delete(`/worships/${t}`),await this.fetchWorships()}catch(e){console.error(`Fehler beim Löschen des Gottesdienstes:`,e)}},resetForm(){this.worshipData={eventPlaceId:null,date:``,time:``,title:``,organizer:``,collection:``,address:``,selfInformation:!1,highlightTime:!1,neighborInvitation:!1,introLine:``,dayName:``,approved:!1},this.selectedEventPlace=null,this.selectedOrganizers=[],this.selectedSacristans=[],this.selectedDayName=null,this.editMode=!1,this.editId=null},getEventPlaceName(e){let t=this.eventPlaces.find(t=>t.id===e);return t?t.name:`Unbekannter Ort`},dateIsLowerCurrentDate(e){let t=new Date;return new Date(e)<t},clearSearch(){this.searchDate=``},addOrganizerTag(e){let t={name:e};this.organizerOptions.push(t),this.selectedOrganizers.push(t)},addSacristanTag(e){let t={name:e};this.sacristanOptions.push(t),this.selectedSacristans.push(t)},addDayNameTag(e){let t={name:e,dayName:e,date:this.worshipData.date||null};this.dayNameOptions.push(t),this.selectedDayName=t,this.worshipData.dayName=e},toggleImportSection(){this.showImportSection=!this.showImportSection,this.showImportSection||(this.selectedFile=null,this.$refs.fileInput&&(this.$refs.fileInput.value=``))},handleFileSelect(e){let t=e.target.files[0];if(t){let n=[`.doc`,`.docx`],r=t.name.toLowerCase();if(!n.some(e=>r.endsWith(e))){alert(`Bitte wählen Sie nur .doc oder .docx Dateien aus.`),e.target.value=``,this.selectedFile=null;return}this.selectedFile=t}else this.selectedFile=null},async importWorships(){if(!this.selectedFile){alert(`Bitte wählen Sie eine Datei aus.`);return}this.isImporting=!0;let t=new FormData;t.append(`file`,this.selectedFile);try{let n=await e.post(`/worships/import`,t,{headers:{"Content-Type":`multipart/form-data`}});n.data.worships&&n.data.worships.length>0?(this.importedWorships=n.data.worships.map(e=>{let t=this.eventPlaces.find(t=>t.id===e.eventPlaceId),n=e.time;return n&&typeof n==`string`&&n.length>5&&(n=n.substring(0,5)),{...e,date:typeof e.date==`string`?e.date.split(`T`)[0]:e.date,time:n,eventPlace:t||null,approved:!1,_changedFields:e._changedFields||[],_oldValues:e._oldValues||{},_isUpdate:e._isUpdate||!1,_isNew:e._isNew||!1,_existingId:e._existingId||null}}),this.importErrors=n.data.errors||[],this.showImportDialog=!0):alert(`Keine Gottesdienste in der Datei gefunden.`)}catch(e){console.error(`Fehler beim Importieren der Gottesdienste:`,e);let t=e.response?.data?.message||`Fehler beim Importieren der Datei.`;alert(`Fehler: `+t)}finally{this.isImporting=!1}},closeImportDialog(){this.showImportDialog=!1,this.importedWorships=[],this.importErrors=[],this.selectedFile=null,this.$refs.fileInput&&(this.$refs.fileInput.value=``)},removeWorship(e){this.importedWorships.splice(e,1)},async saveImportedWorships(){if(this.importedWorships.length===0){alert(`Keine Gottesdienste zum Speichern vorhanden.`);return}this.isImporting=!0;let t=this.importedWorships.map(e=>{let t=e.date;e.date instanceof Date?t=`${e.date.getFullYear()}-${String(e.date.getMonth()+1).padStart(2,`0`)}-${String(e.date.getDate()).padStart(2,`0`)}`:typeof e.date==`string`&&(t=e.date.split(`T`)[0]);let n=e.time;return n&&typeof n==`string`&&n.length===5&&(n+=`:00`),{date:t,dayName:e.dayName,time:n,title:e.title,organizer:e.organizer,collection:e.collection,sacristanService:e.sacristanService,organPlaying:e.organPlaying,approved:e.approved||!1,eventPlaceId:e.eventPlace?e.eventPlace.id:e.eventPlaceId||null}});try{let n=await e.post(`/worships/import/save`,{worships:t}),r=n.data.message||`Import erfolgreich abgeschlossen!`;(n.data.imported!==void 0||n.data.updated!==void 0)&&(r=`Import abgeschlossen!
`,n.data.imported!==void 0&&(r+=`- ${n.data.imported} neue Gottesdienste erstellt\n`),n.data.updated!==void 0&&(r+=`- ${n.data.updated} Gottesdienste aktualisiert\n`),n.data.skipped!==void 0&&n.data.skipped>0&&(r+=`- ${n.data.skipped} übersprungen (vergangene Daten)\n`)),n.data.errors&&n.data.errors.length>0&&(r+=`\nFehler: ${n.data.errors.length}`),alert(r),this.closeImportDialog(),await this.fetchWorships(),await this.fetchWorshipOptions(),await this.fetchLiturgicalDays()}catch(e){console.error(`Fehler beim Speichern der Gottesdienste:`,e);let t=e.response?.data?.message||`Fehler beim Speichern der Gottesdienste.`;alert(`Fehler: `+t)}finally{this.isImporting=!1}},toggleExportSection(){this.showExportSection=!this.showExportSection,this.showExportSection||(this.exportDateFrom=``,this.exportDateTo=``,this.exportFormat=`editing`)},async exportWorships(){if(!this.exportDateFrom||!this.exportDateTo){alert(`Bitte wählen Sie einen Datumsbereich aus.`);return}if(new Date(this.exportDateFrom)>new Date(this.exportDateTo)){alert(`Das "Von Datum" muss vor dem "Bis Datum" liegen.`);return}this.isExporting=!0;try{let t=await e.get(`/worships/export`,{params:{from:this.exportDateFrom,to:this.exportDateTo,format:this.exportFormat},responseType:`blob`}),n=new Blob([t.data],{type:t.headers[`content-type`]||`application/vnd.openxmlformats-officedocument.wordprocessingml.document`}),r=window.URL.createObjectURL(n),i=document.createElement(`a`);i.href=r;let a=t.headers[`content-disposition`],o=`gottesdienste_${this.exportDateFrom}_${this.exportDateTo}.docx`;if(a){let e=a.match(/filename="?(.+)"?/i);e&&(o=e[1])}i.download=o,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(r)}catch(e){console.error(`Fehler beim Exportieren der Gottesdienste:`,e);let t=e.response?.data?.message||`Fehler beim Exportieren der Datei.`;alert(`Fehler: `+t)}finally{this.isExporting=!1}}}},ee={class:`worship-management`},te={class:`action-buttons`},S={key:1,class:`import-section`},C={class:`import-content`},w={key:0,class:`selected-file`},T=[`disabled`],E={key:2,class:`export-section`},D={class:`export-content`},O=[`disabled`],k={class:`import-dialog-content`},A={class:`import-dialog-header`},j={class:`import-dialog-body`},M={key:0,class:`import-errors`},N={class:`imported-worships-list`},P={key:0,class:`new-badge`},F={key:1,class:`update-badge`},I={class:`worship-edit-fields`},L={key:0,class:`old-value`},R=[`onUpdate:modelValue`],z={class:`field-group`},B=[`onUpdate:modelValue`],V={key:0,class:`old-value`},H=[`onUpdate:modelValue`],U={key:0,class:`old-value`},W={key:0,class:`old-value`},G=[`onUpdate:modelValue`],ne={key:0,class:`old-value`},K=[`onUpdate:modelValue`],q={key:0,class:`old-value`},J=[`onUpdate:modelValue`],Y={key:0,class:`old-value`},X=[`onUpdate:modelValue`],Z={key:0,class:`old-value`},re=[`onUpdate:modelValue`],ie={class:`field-group`},ae=[`onUpdate:modelValue`],oe=[`onClick`],se={class:`import-dialog-footer`},ce=[`disabled`],le={class:`liturgical-loader`},ue=[`value`],de=[`disabled`],fe={class:`liturgical-day-section`},pe={class:`filter-section`},me={class:`checkbox-label`},Q=[`onClick`],he=[`onClick`],ge=[`onClick`],_e={class:`tooltip`};function $(e,d,v,y,b,x){let $=r(`multiselect`);return p(),o(`div`,ee,[d[70]||=i(`h2`,null,`Gottesdienst Verwaltung`,-1),b.hasNewsletterPreview?(p(),o(`button`,{key:0,type:`button`,onClick:d[0]||=(...e)=>x.goBackToNewsletterImport&&x.goBackToNewsletterImport(...e)},` Zurück zum Gemeindebrief-Import `)):f(``,!0),i(`div`,te,[i(`button`,{type:`button`,onClick:d[1]||=(...e)=>x.toggleImportSection&&x.toggleImportSection(...e),class:`import-button`},a(b.showImportSection?`Import ausblenden`:`Import`),1),i(`button`,{type:`button`,onClick:d[2]||=(...e)=>x.toggleExportSection&&x.toggleExportSection(...e),class:`export-button`},a(b.showExportSection?`Export ausblenden`:`Export`),1)]),b.showImportSection?(p(),o(`div`,S,[d[36]||=i(`h3`,null,`Gottesdienste importieren`,-1),i(`div`,C,[d[35]||=i(`label`,{for:`import-file`},`Datei auswählen (.doc, .docx):`,-1),i(`input`,{type:`file`,id:`import-file`,ref:`fileInput`,onChange:d[3]||=(...e)=>x.handleFileSelect&&x.handleFileSelect(...e),accept:`.doc,.docx`},null,544),b.selectedFile?(p(),o(`div`,w,` Ausgewählte Datei: `+a(b.selectedFile.name),1)):f(``,!0),i(`button`,{type:`button`,onClick:d[4]||=(...e)=>x.importWorships&&x.importWorships(...e),disabled:!b.selectedFile||b.isImporting,class:`submit-import-button`},a(b.isImporting?`Importiere...`:`Importieren`),9,T)])])):f(``,!0),b.showExportSection?(p(),o(`div`,E,[d[41]||=i(`h3`,null,`Gottesdienste exportieren`,-1),i(`div`,D,[d[38]||=i(`label`,{for:`export-date-from`},`Von Datum:`,-1),n(i(`input`,{type:`date`,id:`export-date-from`,"onUpdate:modelValue":d[5]||=e=>b.exportDateFrom=e},null,512),[[m,b.exportDateFrom]]),d[39]||=i(`label`,{for:`export-date-to`},`Bis Datum:`,-1),n(i(`input`,{type:`date`,id:`export-date-to`,"onUpdate:modelValue":d[6]||=e=>b.exportDateTo=e},null,512),[[m,b.exportDateTo]]),d[40]||=i(`label`,{for:`export-format`},`Export-Format:`,-1),n(i(`select`,{id:`export-format`,"onUpdate:modelValue":d[7]||=e=>b.exportFormat=e},[...d[37]||=[i(`option`,{value:`editing`},`Für Bearbeitung`,-1),i(`option`,{value:`newsletter`},`Für Gemeindebrief`,-1)]],512),[[g,b.exportFormat]]),i(`button`,{type:`button`,onClick:d[8]||=(...e)=>x.exportWorships&&x.exportWorships(...e),disabled:!b.exportDateFrom||!b.exportDateTo||b.isExporting,class:`submit-export-button`},a(b.isExporting?`Exportiere...`:`Exportieren`),9,O)])])):f(``,!0),b.showImportDialog?(p(),o(`div`,{key:3,class:`import-dialog-overlay`,onClick:d[12]||=h((...e)=>x.closeImportDialog&&x.closeImportDialog(...e),[`self`])},[i(`div`,k,[i(`div`,A,[d[42]||=i(`h3`,null,`Importierte Gottesdienste bearbeiten`,-1),i(`button`,{class:`close-button`,onClick:d[9]||=(...e)=>x.closeImportDialog&&x.closeImportDialog(...e)},`×`)]),i(`div`,j,[b.importErrors&&b.importErrors.length>0?(p(),o(`div`,M,[d[43]||=i(`h4`,null,`Fehler beim Parsen:`,-1),i(`ul`,null,[(p(!0),o(c,null,t(b.importErrors,(e,t)=>(p(),o(`li`,{key:t},a(e),1))),128))])])):f(``,!0),i(`div`,N,[(p(!0),o(c,null,t(b.importedWorships,(e,t)=>(p(),o(`div`,{key:t,class:`imported-worship-item`},[i(`h4`,null,[l(` Gottesdienst `+a(t+1)+` `,1),e._isNew?(p(),o(`span`,P,`NEU`)):e._isUpdate?(p(),o(`span`,F,`ÄNDERUNG`)):f(``,!0)]),i(`div`,I,[i(`div`,{class:u([`field-group`,{"field-changed":x.isFieldChanged(e,`date`)}])},[i(`label`,null,[d[44]||=l(` Datum: `,-1),x.isFieldChanged(e,`date`)?(p(),o(`span`,L,`(alt: `+a(x.getOldValue(e,`date`))+`)`,1)):f(``,!0)]),n(i(`input`,{type:`date`,"onUpdate:modelValue":t=>e.date=t},null,8,R),[[m,e.date]])],2),i(`div`,z,[d[45]||=i(`label`,null,`Tag-Name:`,-1),n(i(`input`,{type:`text`,"onUpdate:modelValue":t=>e.dayName=t},null,8,B),[[m,e.dayName]])]),i(`div`,{class:u([`field-group`,{"field-changed":x.isFieldChanged(e,`time`)}])},[i(`label`,null,[d[46]||=l(` Uhrzeit: `,-1),x.isFieldChanged(e,`time`)?(p(),o(`span`,V,`(alt: `+a(x.getOldValue(e,`time`))+`)`,1)):f(``,!0)]),n(i(`input`,{type:`time`,"onUpdate:modelValue":t=>e.time=t,step:`60`},null,8,H),[[m,e.time]])],2),i(`div`,{class:u([`field-group`,{"field-changed":x.isFieldChanged(e,`eventPlaceId`)}])},[i(`label`,null,[d[47]||=l(` Ort: `,-1),x.isFieldChanged(e,`eventPlaceId`)?(p(),o(`span`,U,`(alt: `+a(x.getOldValue(e,`eventPlaceName`)||x.getOldValue(e,`eventPlaceId`))+`)`,1)):f(``,!0)]),s($,{modelValue:e.eventPlace,"onUpdate:modelValue":[t=>e.eventPlace=t,t=>{t&&(e.eventPlaceId=t.id)}],options:b.eventPlaces,label:`name`,"track-by":`id`,placeholder:`Veranstaltungsort wählen`},null,8,[`modelValue`,`onUpdate:modelValue`,`options`])],2),i(`div`,{class:u([`field-group`,{"field-changed":x.isFieldChanged(e,`title`)}])},[i(`label`,null,[d[48]||=l(` Titel: `,-1),x.isFieldChanged(e,`title`)?(p(),o(`span`,W,`(alt: `+a(x.getOldValue(e,`title`))+`)`,1)):f(``,!0)]),n(i(`input`,{type:`text`,"onUpdate:modelValue":t=>e.title=t},null,8,G),[[m,e.title]])],2),i(`div`,{class:u([`field-group`,{"field-changed":x.isFieldChanged(e,`organizer`)}])},[i(`label`,null,[d[49]||=l(` Gestalter: `,-1),x.isFieldChanged(e,`organizer`)?(p(),o(`span`,ne,`(alt: `+a(x.getOldValue(e,`organizer`))+`)`,1)):f(``,!0)]),n(i(`input`,{type:`text`,"onUpdate:modelValue":t=>e.organizer=t},null,8,K),[[m,e.organizer]])],2),i(`div`,{class:u([`field-group`,{"field-changed":x.isFieldChanged(e,`collection`)}])},[i(`label`,null,[d[50]||=l(` Kollekte: `,-1),x.isFieldChanged(e,`collection`)?(p(),o(`span`,q,`(alt: `+a(x.getOldValue(e,`collection`))+`)`,1)):f(``,!0)]),n(i(`input`,{type:`text`,"onUpdate:modelValue":t=>e.collection=t},null,8,J),[[m,e.collection]])],2),i(`div`,{class:u([`field-group`,{"field-changed":x.isFieldChanged(e,`sacristanService`)}])},[i(`label`,null,[d[51]||=l(` Dienst: `,-1),x.isFieldChanged(e,`sacristanService`)?(p(),o(`span`,Y,`(alt: `+a(x.getOldValue(e,`sacristanService`))+`)`,1)):f(``,!0)]),n(i(`input`,{type:`text`,"onUpdate:modelValue":t=>e.sacristanService=t},null,8,X),[[m,e.sacristanService]])],2),i(`div`,{class:u([`field-group`,{"field-changed":x.isFieldChanged(e,`organPlaying`)}])},[i(`label`,null,[d[52]||=l(` Orgelspiel: `,-1),x.isFieldChanged(e,`organPlaying`)?(p(),o(`span`,Z,`(alt: `+a(x.getOldValue(e,`organPlaying`))+`)`,1)):f(``,!0)]),n(i(`input`,{type:`text`,"onUpdate:modelValue":t=>e.organPlaying=t},null,8,re),[[m,e.organPlaying]])],2),i(`div`,ie,[i(`label`,null,[n(i(`input`,{type:`checkbox`,"onUpdate:modelValue":t=>e.approved=t},null,8,ae),[[_,e.approved]]),d[53]||=l(` Freigegeben `,-1)])]),i(`button`,{type:`button`,onClick:e=>x.removeWorship(t),class:`remove-button`},`Entfernen`,8,oe)])]))),128))])]),i(`div`,se,[i(`button`,{type:`button`,onClick:d[10]||=(...e)=>x.closeImportDialog&&x.closeImportDialog(...e),class:`cancel-button`},`Abbrechen`),i(`button`,{type:`button`,onClick:d[11]||=(...e)=>x.saveImportedWorships&&x.saveImportedWorships(...e),disabled:b.importedWorships.length===0||b.isImporting,class:`save-button`},a(b.isImporting?`Speichere...`:`Speichern`),9,ce)])])])):f(``,!0),i(`div`,le,[n(i(`select`,{"onUpdate:modelValue":d[13]||=e=>b.selectedYear=e,class:`year-select`},[(p(!0),o(c,null,t(b.availableYears,e=>(p(),o(`option`,{key:e,value:e},a(e),9,ue))),128))],512),[[g,b.selectedYear]]),i(`button`,{type:`button`,onClick:d[14]||=(...e)=>x.loadLiturgicalYear&&x.loadLiturgicalYear(...e),class:`load-year-button`,disabled:b.isLoading},a(b.isLoading?`Lade...`:`Kirchenjahr laden`),9,de)]),i(`form`,{onSubmit:d[31]||=h((...e)=>x.saveWorship&&x.saveWorship(...e),[`prevent`])},[d[54]||=i(`label`,{for:`eventPlaceId`},`Veranstaltungsort:`,-1),s($,{modelValue:b.selectedEventPlace,"onUpdate:modelValue":d[15]||=e=>b.selectedEventPlace=e,options:b.eventPlaces,label:`name`,"track-by":`id`,placeholder:`Veranstaltungsort wählen`},null,8,[`modelValue`,`options`]),d[55]||=i(`label`,{for:`dayName`},`Name des Tags:`,-1),i(`div`,fe,[s($,{modelValue:b.selectedDayName,"onUpdate:modelValue":d[16]||=e=>b.selectedDayName=e,options:b.dayNameOptions,multiple:!1,taggable:!0,onTag:x.addDayNameTag,placeholder:`Tag-Name wählen oder eingeben`,label:`name`,"track-by":`name`},null,8,[`modelValue`,`options`,`onTag`])]),d[56]||=i(`label`,{for:`date`},`Datum:`,-1),n(i(`input`,{type:`date`,id:`date`,"onUpdate:modelValue":d[17]||=e=>b.worshipData.date=e,required:``,onChange:d[18]||=(...e)=>x.updateDayNameFromDate&&x.updateDayNameFromDate(...e)},null,544),[[m,b.worshipData.date]]),d[57]||=i(`label`,{for:`time`},`Uhrzeit:`,-1),n(i(`input`,{type:`time`,id:`time`,"onUpdate:modelValue":d[19]||=e=>b.worshipData.time=e,required:``},null,512),[[m,b.worshipData.time]]),d[58]||=i(`label`,{for:`title`},`Titel:`,-1),n(i(`input`,{type:`text`,id:`title`,"onUpdate:modelValue":d[20]||=e=>b.worshipData.title=e,required:``},null,512),[[m,b.worshipData.title]]),d[59]||=i(`label`,{for:`organizer`},`Gestalter:`,-1),s($,{modelValue:b.selectedOrganizers,"onUpdate:modelValue":d[21]||=e=>b.selectedOrganizers=e,options:b.organizerOptions,multiple:!0,taggable:!0,onTag:x.addOrganizerTag,placeholder:`Gestalter wählen oder neu eingeben`,label:`name`,"track-by":`name`},null,8,[`modelValue`,`options`,`onTag`]),d[60]||=i(`label`,{for:`sacristanService`},`Küsterdienst:`,-1),s($,{modelValue:b.selectedSacristans,"onUpdate:modelValue":d[22]||=e=>b.selectedSacristans=e,options:b.sacristanOptions,multiple:!0,taggable:!0,onTag:x.addSacristanTag,placeholder:`Küsterdienst wählen oder neu eingeben`,label:`name`,"track-by":`name`},null,8,[`modelValue`,`options`,`onTag`]),d[61]||=i(`label`,{for:`collection`},`Kollekte:`,-1),n(i(`input`,{type:`text`,id:`collection`,"onUpdate:modelValue":d[23]||=e=>b.worshipData.collection=e},null,512),[[m,b.worshipData.collection]]),d[62]||=i(`label`,{for:`address`},`Adresse:`,-1),n(i(`input`,{type:`text`,id:`address`,"onUpdate:modelValue":d[24]||=e=>b.worshipData.address=e},null,512),[[m,b.worshipData.address]]),d[63]||=i(`label`,{for:`selfInformation`},`Selbstinformation:`,-1),n(i(`input`,{type:`checkbox`,id:`selfInformation`,"onUpdate:modelValue":d[25]||=e=>b.worshipData.selfInformation=e},null,512),[[_,b.worshipData.selfInformation]]),d[64]||=i(`label`,{for:`highlightTime`},`Uhrzeit hervorheben:`,-1),n(i(`input`,{type:`checkbox`,id:`highlightTime`,"onUpdate:modelValue":d[26]||=e=>b.worshipData.highlightTime=e},null,512),[[_,b.worshipData.highlightTime]]),d[65]||=i(`label`,{for:`neighborInvitation`},`Einladung zum Nachbarschaftsraum:`,-1),n(i(`input`,{type:`checkbox`,id:`neighborInvitation`,"onUpdate:modelValue":d[27]||=e=>b.worshipData.neighborInvitation=e},null,512),[[_,b.worshipData.neighborInvitation]]),d[66]||=i(`label`,{for:`approved`},`Freigegeben:`,-1),n(i(`input`,{type:`checkbox`,id:`approved`,"onUpdate:modelValue":d[28]||=e=>b.worshipData.approved=e},null,512),[[_,b.worshipData.approved]]),d[67]||=i(`label`,{for:`introLine`},`Einleitungszeile:`,-1),n(i(`input`,{type:`text`,id:`introLine`,"onUpdate:modelValue":d[29]||=e=>b.worshipData.introLine=e},null,512),[[m,b.worshipData.introLine]]),d[68]||=i(`button`,{type:`submit`},`Speichern`,-1),i(`button`,{type:`button`,onClick:d[30]||=(...e)=>x.resetForm&&x.resetForm(...e)},`Neuer Gottesdienst`)],32),i(`div`,pe,[n(i(`input`,{"onUpdate:modelValue":d[32]||=e=>b.searchDate=e,type:`date`,class:`search-input`,placeholder:`Nach Datum suchen...`},null,512),[[m,b.searchDate]]),i(`label`,me,[n(i(`input`,{"onUpdate:modelValue":d[33]||=e=>b.showPastWorships=e,type:`checkbox`},null,512),[[_,b.showPastWorships]]),d[69]||=l(` Vergangene Gottesdienste anzeigen `,-1)]),b.searchDate?(p(),o(`button`,{key:0,onClick:d[34]||=(...e)=>x.clearSearch&&x.clearSearch(...e),type:`button`,class:`clear-button`},` Suche zurücksetzen `)):f(``,!0)]),i(`ul`,null,[(p(!0),o(c,null,t(x.filteredWorships,e=>(p(),o(`li`,{key:e.id,class:u([`worship-list-item`,{"old-items":x.dateIsLowerCurrentDate(e.date)},{"not-approved":!e.approved}])},[i(`span`,null,a(e.title)+` - `+a(x.formatDate(e.date))+`, `+a(x.formatTime(e.time)),1),i(`button`,{type:`button`,class:`approve-toggle-button`,onClick:t=>x.toggleApproved(e)},a(e.approved?`Freigabe zurücknehmen`:`Freigeben`),9,Q),i(`button`,{type:`button`,onClick:t=>x.editWorship(e)},`Bearbeiten`,8,he),i(`button`,{type:`button`,onClick:t=>x.deleteWorship(e.id)},`Löschen`,8,ge),i(`div`,_e,a(x.getEventPlaceName(e.eventPlaceId)),1)],2))),128))])])}var ve=d(x,[[`render`,$],[`__scopeId`,`data-v-f257335c`]]);export{ve as default};
//# sourceMappingURL=WorshipManagement-1GLJeLnc.js.map