Loheide-eu-mitarbeiterplatt.../public/build/assets/Editor-Cy0mrCqv.js
Friederich Loheide 82bbeef31b
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m7s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m11s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m16s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m18s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m49s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m46s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m41s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m33s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m0s
Phase 5: Erscheinungsbild mit Entwurf, Vorschau und Veröffentlichen
- Theme in den Einstellungen (Entwurf/veröffentlicht), Übernahme der
  Einstellungen aus Phase 0; statische CSS-Datei mit Hash beim Veröffentlichen
- Logos hell/dunkel, Signet, App-Symbol → Favicon, Homescreen-Symbole,
  Web-App-Manifest; SVG-Bereinigung
- Markenfarbe exakt, zweite Akzentfarbe, Kopfleiste hell/Marke/dunkel,
  Kontrastprüfung (WCAG AA) mit automatisch lesbarer Linkfarbe
- Lokale Schriften (Latein), Überschriften-Schrift, eigene WOFF2-Schrift,
  Ecken, Dichte, Dunkelmodus-Regel
- Anmeldeseite (geteilt/zentriert, Bild, Texte), Fußzeile, E-Mails im Design
- Admin: Live-Vorschau (Startseite, Anmeldung, Beispielseite; hell/dunkel),
  Veröffentlichen, Verwerfen, Export/Import, Zurücksetzen, eigenes CSS
- Admin-Bereich übernimmt Logo, Farbe und Favicon; Whitelabel

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:46:05 +00:00

1 line
No EOL
56 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{$ as e,D as t,E as n,Ft as r,Ht as i,J as a,On as o,St as s,Yt as c,Zn as l,_ as u,b as d,bt as f,ct as p,g as m,gn as h,gt as g,it as _,mt as v,o as y,qt as b,tr as x,v as S,vn as C,wt as w,y as T}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as E,x as ee,y as D}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as O,n as te,t as k}from"./app-n5T3LWKz.js";import{A as ne,j as A}from"./dist-CleIz2GP.js";import{a as j,c as M,i as N,l as re,n as P,o as ie,r as F,s as ae,t as I}from"./vue-draggable-plus-BPJUawkl.js";import{t as oe}from"./arrow-left-nZZEveo4.js";import{a as L,i as R,n as z,r as se}from"./RichTextEditor-DP3LUVrE.js";import{t as ce}from"./icons-DL3m7OIP.js";import{t as le}from"./cake-DYVAYX9m.js";import{t as ue}from"./calendar-clock-CswFc-uh.js";import{t as de}from"./calendar-days-s3GhWVmT.js";import{_ as fe,a as pe,b as me,i as he,n as ge,o as B,r as _e,t as V,x as ve}from"./http-C4J46rTq.js";import{t as ye}from"./clipboard-list-BTFiddE0.js";import{t as be}from"./eye-off-DWbaLHNt.js";import{i as xe}from"./VisuallyHiddenInput-i0fsjz38.js";import{t as Se}from"./image-DWzRulZ0.js";import{t as Ce}from"./lock-4X8Kfof0.js";import{t as we}from"./message-square-warning-CUD7Iy66.js";import{A as H,M as Te,_ as Ee,a as De,c as Oe,d as ke,f as Ae,g as je,h as Me,j as U,k as Ne,l as Pe,m as Fe,p as Ie,s as Le,u as W}from"./format-2iB7L6ww.js";import{t as Re}from"./play-_hM1KTvn.js";import{t as G}from"./plus-cKZvz4wH.js";import{t as ze}from"./send-BevoJaJI.js";import{t as Be}from"./smartphone-2VTLQVgX.js";import{t as Ve}from"./trash-3XeUxfQJ.js";import{n as He,t as Ue}from"./DialogHeader-DZlBIGxi.js";import{t as K}from"./Switch-BbEb1iXG.js";import{t as q}from"./button-SRYY3-ko.js";import{t as J}from"./NativeSelect-OH2VlOdN.js";import{t as Y}from"./Input-CgjHXzkf.js";import{t as We}from"./Textarea-DWpyL-nk.js";import{i as Ge,n as Ke,r as X,t as qe}from"./dialog-Bnq2xLhE.js";import{n as Je,t as Ye}from"./PageContent-BpFmb8ak.js";import{t as Xe}from"./NewPageDialog-w4fF1GtO.js";var Ze=A({name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]}),Qe=A({name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]}),$e=A({name:`cloud-alert`,size:24,node:[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]}),et=A({name:`columns-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`panels-left-right`]}),tt=A({name:`contact`,size:24,node:[[`path`,{d:`M16 2v2`,key:`scm5qe`}],[`path`,{d:`M7 21v-2a2 2 0 012-2h6a2 2 0 012 2v2`,key:`k82dct`}],[`path`,{d:`M8 2v2`,key:`pbkmx`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]}),nt=A({name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]}),Z=A({name:`file-down`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]}),rt=A({name:`file-plus-corner`,size:24,node:[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]],aliases:[`file-plus-2`]}),it=A({name:`folder-tree`,size:24,node:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]}),at=A({name:`gallery-horizontal-end`,size:24,node:[[`path`,{d:`M2 7v10`,key:`a2pl2d`}],[`path`,{d:`M6 5v14`,key:`1kq3d7`}],[`rect`,{width:`12`,height:`18`,x:`10`,y:`3`,rx:`2`,key:`13i7bc`}]]}),ot=A({name:`images`,size:24,node:[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]}),st=A({name:`list-collapse`,size:24,node:[[`path`,{d:`M10 5h11`,key:`1hkqpe`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 19h11`,key:`14g2nv`}],[`path`,{d:`m3 10 3-3-3-3`,key:`i7pm08`}],[`path`,{d:`m3 20 3-3-3-3`,key:`20gx1n`}]]}),ct=A({name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]}),lt=A({name:`mouse-pointer-click`,size:24,node:[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]}),ut=A({name:`move-vertical`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m8 18 4 4 4-4`,key:`bh5tu3`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}]]}),dt=A({name:`panel-top`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]}),ft=A({name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]}),pt=A({name:`square-dashed`,size:24,node:[[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M21 14v1`,key:`169vum`}]],aliases:[`box-select`]}),mt=A({name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]}),ht=A({name:`tablet`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]}),gt=A({name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]}),_t={"square-dashed":pt,"columns-3":et,"panel-top":dt,"list-collapse":st,"message-square-warning":we,heading:j,text:P,quote:R,"mouse-pointer-click":lt,"list-checks":N,table:mt,minus:ct,"move-vertical":ut,image:Se,images:ot,play:Re,panorama:at,contact:tt,"file-down":Z,"folder-tree":it,newspaper:U,"calendar-days":de,"clipboard-list":ye,cake:le};function vt(e){return _t[e]??Ze}function Q(){return Math.random().toString(36).slice(2,8)+Date.now().toString(36).slice(-6)}function yt(e){return JSON.parse(JSON.stringify(e))}function bt(e,t){return e.container?e.key===`columns`?(t.layout??`1-1`).split(`-`).length:e.key===`tabs`?2:e.key===`accordion`?3:e.container.min:0}function xt(e){let t=yt(e.defaults??{}),n={id:Q(),type:e.key,data:t};return e.container&&(n.items=Array.from({length:bt(e,t)},(t,n)=>({id:Q(),title:e.container.titled?`${e.container.label} ${n+1}`:void 0,blocks:[]}))),n}function St(e){let t=yt(e),n=e=>{e.id=Q(),(e.items??[]).forEach(e=>{e.id=Q(),e.blocks.forEach(n)})};return n(t),t}function $(e,t,n=null){for(let r=0;r<e.length;r++){let i=e[r];if(i.id===t)return{block:i,list:e,index:r,parent:n};for(let e of i.items??[]){let n=$(e.blocks,t,i);if(n)return n}}return null}function Ct(e,t){for(let n of e)t(n),(n.items??[]).forEach(e=>Ct(e.blocks,t))}function wt(e){let t=(e.data.layout??`1-1`).split(`-`).length;for(;e.items.length<t;)e.items.push({id:Q(),blocks:[]});if(e.items.length>t){let n=e.items.splice(t).flatMap(e=>e.blocks);e.items[t-1].blocks.push(...n)}}var Tt={class:`grid gap-4`},Et={class:`mb-2 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},Dt=[`title`,`disabled`,`onClick`],Ot={class:`truncate`},kt={__name:`BlockPalette`,props:{compact:{type:Boolean,default:!1}},emits:[`pick`],setup(e,{emit:n}){let r=n,i=a(`pagebuilder:editor`),s=m(()=>Object.entries(i.groups).map(([e,t])=>({key:e,label:t,types:Object.values(i.types).filter(t=>t.group===e)})).filter(e=>e.types.length));return(n,a)=>(v(),d(`div`,Tt,[(v(!0),d(y,null,f(s.value,n=>(v(),d(`section`,{key:n.key},[u(`h3`,Et,x(n.label),1),t(o(I),{"model-value":n.types,group:{name:`pagebuilder`,pull:`clone`,put:!1},clone:e=>o(xt)(e),sort:!1,disabled:e.compact||o(i).readOnly.value,class:`grid grid-cols-2 gap-2`},{default:b(()=>[(v(!0),d(y,null,f(n.types,t=>(v(),d(`button`,{key:t.key,type:`button`,class:l([`flex items-center gap-2 rounded-md border bg-card px-2.5 py-2 text-left text-[13px] font-medium transition-colors hover:border-brand-300 hover:bg-brand-soft/60`,e.compact?``:`cursor-grab active:cursor-grabbing`]),title:t.description||t.label,disabled:o(i).readOnly.value,onClick:e=>r(`pick`,t)},[(v(),S(w(o(vt)(t.icon)),{class:`size-4 shrink-0 text-brand-text`})),u(`span`,Ot,x(t.label),1)],10,Dt))),128))]),_:2},1032,[`model-value`,`clone`,`disabled`])]))),128))]))}},At={class:`grid gap-1.5`},jt=[`for`],Mt=[`for`],Nt={key:8,class:`grid grid-cols-6 gap-1.5`},Pt=[`title`,`aria-pressed`,`onClick`],Ft={key:9,class:`grid gap-2`},It={key:0,class:`relative overflow-hidden rounded-md border bg-muted`},Lt=[`src`],Rt=[`disabled`],zt={key:10,class:`grid gap-2`},Bt={key:0,class:`grid gap-1`},Vt={class:`min-w-0 flex-1 truncate text-[13px]`},Ht=[`onClick`],Ut=[`onClick`],Wt={class:`relative`},Gt={key:0,class:`absolute inset-x-0 top-full z-30 mt-1 max-h-60 overflow-y-auto rounded-md border bg-popover p-1 shadow-md`},Kt=[`onClick`],qt={class:`min-w-0`},Jt={class:`block truncate font-medium`},Yt={class:`block truncate text-xs text-muted-foreground`},Xt={key:11,class:`grid gap-2`},Zt={class:`overflow-x-auto rounded-md border`},Qt={class:`w-full text-[13px]`},$t=[`value`,`aria-label`,`onInput`],en={class:`w-7 p-0 text-center`},tn=[`onClick`],nn=[`onClick`],rn={class:`flex gap-2`},an={key:12,class:`grid gap-2`},on=[`open`],sn={class:`flex cursor-pointer list-none items-center gap-2 px-3 py-2 text-[13px] font-medium`},cn={class:`min-w-0 flex-1 truncate`},ln=[`onClick`],un=[`onClick`],dn=[`onClick`],fn={class:`grid gap-3 border-t px-3 py-3`},pn={key:13,class:`grid gap-2`},mn={key:0,class:`grid gap-1`},hn={class:`min-w-0 flex-1 truncate`},gn={key:0,class:`shrink-0 text-xs text-muted-foreground`},_n=[`onClick`],vn=[`onClick`],yn=[`disabled`],bn={key:14,class:`text-xs text-muted-foreground`},xn={__name:`FieldInput`,props:e({field:{type:Object,required:!0},id:{type:String,required:!0}},{modelValue:{default:null},modelModifiers:{}}),emits:e([`image-uploaded`],[`update:modelValue`]),setup(e,{emit:c}){let p=e,h=r(e,`modelValue`),g=a(`pagebuilder:editor`),_=c,b=C(!1),ee=C(null);async function D(e){let t=e.target.files?.[0];if(e.target.value=``,t){b.value=!0;try{let e=await g.uploadImage(t);h.value=e.path,_(`image-uploaded`,e)}catch(e){B.error(e.fieldErrors?.image??e.message)}finally{b.value=!1}}}let O=C(``),te=C([]),k=g.peopleCache,A;if(i(O,e=>{if(clearTimeout(A),e.trim().length<2){te.value=[];return}A=setTimeout(async()=>{let t=await V.get(`/personen/suche?q=${encodeURIComponent(e.trim())}`);t.people.forEach(e=>k[e.id]=e),te.value=t.people.filter(e=>!(h.value??[]).includes(e.id))},250)}),p.field.type===`people`&&(h.value??[]).some(e=>!k[e])){let e=h.value.filter(e=>!k[e]);V.get(`/personen/suche?${e.map(e=>`ids[]=${e}`).join(`&`)}`).then(e=>e.people.forEach(e=>k[e.id]=e))}function j(e){h.value=[...h.value??[],e.id],O.value=``,te.value=[]}function N(e,t,n){let r=t+n;if(r<0||r>=e.length)return;let i=[...e];[i[t],i[r]]=[i[r],i[t]],h.value=i}function P(e){h.value=h.value.filter((t,n)=>n!==e)}function ie(){let e=Object.fromEntries(p.field.fields.map(e=>[e.name,structuredClone(e.default??(e.type===`toggle`?!1:e.type===`repeater`?[]:``))]));h.value=[...h.value??[],e]}let F=m(()=>h.value??[[``]]);function ae(e,t,n){let r=F.value.map(e=>[...e]);r[e][t]=n,h.value=r}function I(){h.value=[...F.value,Array(F.value[0]?.length??1).fill(``)]}function oe(){h.value=F.value.map(e=>[...e,``])}function R(e){F.value.length>1&&(h.value=F.value.filter((t,n)=>n!==e))}function se(e){(F.value[0]?.length??1)>1&&(h.value=F.value.map(t=>t.filter((t,n)=>n!==e)))}let le=C(null),ue=m(()=>Object.fromEntries(g.files.value.map(e=>[e.id,e])));async function de(e){let t=[...e.target.files??[]];e.target.value=``,b.value=!0;try{for(let e of t){let t=await g.uploadFile(e);h.value=[...h.value??[],t.id]}}catch(e){B.error(e.fieldErrors?.file??e.message)}finally{b.value=!1}}let pe=m(()=>g.files.value.filter(e=>!(h.value??[]).includes(e.id))),me=e=>e>1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`,he=m(()=>(p.field.choices??[]).map(e=>({...e,icon:ce[e.value]})));return(r,i)=>{let a=s(`FieldInput`,!0);return v(),d(`div`,At,[e.field.type===`toggle`?T(``,!0):(v(),d(`label`,{key:0,for:e.id,class:`text-[13px] font-medium`},x(e.field.label),9,jt)),e.field.type===`text`?(v(),S(o(Y),{key:1,id:e.id,modelValue:h.value,"onUpdate:modelValue":i[0]||=e=>h.value=e,maxlength:e.field.max,placeholder:e.field.placeholder??``},null,8,[`id`,`modelValue`,`maxlength`,`placeholder`])):e.field.type===`url`?(v(),S(o(Y),{key:2,id:e.id,modelValue:h.value,"onUpdate:modelValue":i[1]||=e=>h.value=e,type:`text`,inputmode:`url`,placeholder:`https://… oder /seiten/…`},null,8,[`id`,`modelValue`])):e.field.type===`textarea`?(v(),S(o(We),{key:3,id:e.id,modelValue:h.value,"onUpdate:modelValue":i[2]||=e=>h.value=e,maxlength:e.field.max,rows:`3`},null,8,[`id`,`modelValue`,`maxlength`])):e.field.type===`html`?(v(),S(z,{key:4,modelValue:h.value,"onUpdate:modelValue":i[3]||=e=>h.value=e,bordered:``,"min-height":`[&_.tiptap]:min-h-24`},null,8,[`modelValue`])):e.field.type===`number`?(v(),S(o(Y),{key:5,id:e.id,modelValue:h.value,"onUpdate:modelValue":i[4]||=e=>h.value=e,modelModifiers:{number:!0},type:`number`,min:e.field.min,max:e.field.max},null,8,[`id`,`modelValue`,`min`,`max`])):e.field.type===`select`?(v(),S(J,{key:6,id:e.id,modelValue:h.value,"onUpdate:modelValue":i[5]||=e=>h.value=e,options:e.field.choices},null,8,[`id`,`modelValue`,`options`])):e.field.type===`toggle`?(v(),d(`label`,{key:7,for:e.id,class:`flex items-center justify-between gap-3 py-0.5 text-[13px] font-medium`},[n(x(e.field.label)+` `,1),t(o(K),{id:e.id,modelValue:h.value,"onUpdate:modelValue":i[6]||=e=>h.value=e},null,8,[`id`,`modelValue`])],8,Mt)):e.field.type===`icon`?(v(),d(`div`,Nt,[(v(!0),d(y,null,f(he.value,e=>(v(),d(`button`,{key:e.value,type:`button`,class:l([`grid aspect-square place-items-center rounded-md border transition-colors`,h.value===e.value?`border-brand-400 bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),title:e.label,"aria-pressed":h.value===e.value,onClick:t=>h.value=e.value},[(v(),S(w(e.icon),{class:`size-4`}))],10,Pt))),128))])):e.field.type===`image`?(v(),d(`div`,Ft,[h.value?(v(),d(`div`,It,[u(`img`,{src:o(g).imageUrl(h.value),alt:``,class:`aspect-video w-full object-cover`},null,8,Lt),u(`button`,{type:`button`,class:`absolute top-1.5 right-1.5 grid size-7 place-items-center rounded-md bg-card/90 shadow-sm hover:bg-card`,title:`Bild entfernen`,onClick:i[7]||=e=>h.value=null},[t(o(fe),{class:`size-4`})])])):T(``,!0),u(`button`,{type:`button`,class:`flex h-9 items-center justify-center gap-2 rounded-md border border-dashed text-[13px] font-medium text-muted-foreground hover:border-brand-300 hover:text-foreground`,disabled:b.value,onClick:i[8]||=e=>ee.value?.click()},[b.value?(v(),S(o(ne),{key:0,class:`size-4 animate-spin`})):(v(),S(o(L),{key:1,class:`size-4`})),n(` `+x(h.value?`Anderes Bild wählen`:`Bild hochladen`),1)],8,Rt),u(`input`,{ref_key:`imageInput`,ref:ee,type:`file`,accept:`image/jpeg,image/png,image/webp,image/gif`,class:`hidden`,onChange:D},null,544)])):e.field.type===`people`?(v(),d(`div`,zt,[(h.value??[]).length?(v(),d(`ul`,Bt,[(v(!0),d(y,null,f(h.value,(e,n)=>(v(),d(`li`,{key:e,class:`flex items-center gap-2 rounded-md border bg-card px-2 py-1.5`},[o(k)[e]?(v(),S(Ee,{key:0,person:o(k)[e],class:`size-7 text-[10px]`},null,8,[`person`])):T(``,!0),u(`span`,Vt,x(o(k)[e]?.name??`…`),1),u(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:e=>N(h.value,n,-1)},[t(o(M),{class:`size-3.5`})],8,Ht),u(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Entfernen`,onClick:e=>P(n)},[t(o(fe),{class:`size-3.5`})],8,Ut)]))),128))])):T(``,!0),u(`div`,Wt,[t(o(H),{class:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),t(o(Y),{id:e.id,modelValue:O.value,"onUpdate:modelValue":i[9]||=e=>O.value=e,class:`pl-8`,placeholder:`Person suchen …`,autocomplete:`off`},null,8,[`id`,`modelValue`]),te.value.length?(v(),d(`ul`,Gt,[(v(!0),d(y,null,f(te.value,e=>(v(),d(`li`,{key:e.id},[u(`button`,{type:`button`,class:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[13px] hover:bg-accent`,onClick:t=>j(e)},[t(Ee,{person:e,class:`size-7 text-[10px]`},null,8,[`person`]),u(`span`,qt,[u(`span`,Jt,x(e.name),1),u(`span`,Yt,x(e.job_title),1)])],8,Kt)]))),128))])):T(``,!0)])])):e.field.type===`table`?(v(),d(`div`,Xt,[u(`div`,Zt,[u(`table`,Qt,[u(`tbody`,null,[(v(!0),d(y,null,f(F.value,(e,n)=>(v(),d(`tr`,{key:n,class:`border-b last:border-0`},[(v(!0),d(y,null,f(e,(e,t)=>(v(),d(`td`,{key:t,class:`border-r p-0 last:border-r-0`},[u(`input`,{value:e,class:`h-8 w-full min-w-20 bg-transparent px-2 focus:bg-brand-soft/50 focus:outline-none`,"aria-label":`Zeile ${n+1}, Spalte ${t+1}`,onInput:e=>ae(n,t,e.target.value)},null,40,$t)]))),128)),u(`td`,en,[u(`button`,{type:`button`,class:`grid size-7 place-items-center text-muted-foreground hover:text-destructive`,title:`Zeile entfernen`,onClick:e=>R(n)},[t(o(fe),{class:`size-3.5`})],8,tn)])]))),128)),u(`tr`,null,[(v(!0),d(y,null,f(F.value[0],(e,n)=>(v(),d(`td`,{key:n,class:`p-0 text-center`},[u(`button`,{type:`button`,class:`mx-auto grid size-7 place-items-center text-muted-foreground hover:text-destructive`,title:`Spalte entfernen`,onClick:e=>se(n)},[t(o(fe),{class:`size-3.5`})],8,nn)]))),128)),i[12]||=u(`td`,null,null,-1)])])])]),u(`div`,rn,[u(`button`,{type:`button`,class:`inline-flex items-center gap-1 text-[13px] font-medium text-brand-text hover:underline`,onClick:I},[t(o(G),{class:`size-3.5`}),i[13]||=n(` Zeile`,-1)]),u(`button`,{type:`button`,class:`inline-flex items-center gap-1 text-[13px] font-medium text-brand-text hover:underline`,onClick:oe},[t(o(G),{class:`size-3.5`}),i[14]||=n(` Spalte`,-1)])])])):e.field.type===`repeater`?(v(),d(`div`,an,[(v(!0),d(y,null,f(h.value??[],(n,r)=>(v(),d(`details`,{key:r,class:`group rounded-md border bg-card`,open:r===(h.value??[]).length-1},[u(`summary`,sn,[u(`span`,cn,x(n.label||n.title||n.alt||`${e.field.itemLabel} ${r+1}`),1),u(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:E(e=>N(h.value,r,-1),[`prevent`])},[t(o(M),{class:`size-3.5`})],8,ln),u(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach unten`,onClick:E(e=>N(h.value,r,1),[`prevent`])},[t(o(re),{class:`size-3.5`})],8,un),u(`button`,{type:`button`,class:`grid size-6 place-items-center rounded text-destructive hover:bg-destructive/10`,title:`Entfernen`,onClick:E(e=>P(r),[`prevent`])},[t(o(Ve),{class:`size-3.5`})],8,dn)]),u(`div`,fn,[(v(!0),d(y,null,f(e.field.fields,t=>(v(),S(a,{id:`${e.id}-${r}-${t.name}`,key:t.name,modelValue:n[t.name],"onUpdate:modelValue":e=>n[t.name]=e,field:t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`field`]))),128))])],8,on))),128)),(h.value??[]).length<e.field.max?(v(),d(`button`,{key:0,type:`button`,class:`flex h-8 items-center justify-center gap-1.5 rounded-md border border-dashed text-[13px] font-medium text-muted-foreground hover:border-brand-300 hover:text-foreground`,onClick:ie},[t(o(G),{class:`size-3.5`}),n(` `+x(e.field.itemLabel)+` hinzufügen `,1)])):T(``,!0)])):e.field.type===`ids`&&e.field.kind===`page-file`?(v(),d(`div`,pn,[(h.value??[]).length?(v(),d(`ul`,mn,[(v(!0),d(y,null,f(h.value,(e,n)=>(v(),d(`li`,{key:e,class:`flex items-center gap-2 rounded-md border bg-card px-2 py-1.5 text-[13px]`},[t(o(Z),{class:`size-4 shrink-0 text-muted-foreground`}),u(`span`,hn,x(ue.value[e]?.name??`Datei nicht mehr vorhanden`),1),ue.value[e]?(v(),d(`span`,gn,x(me(ue.value[e].size)),1)):T(``,!0),u(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:e=>N(h.value,n,-1)},[t(o(M),{class:`size-3.5`})],8,_n),u(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Entfernen`,onClick:e=>P(n)},[t(o(fe),{class:`size-3.5`})],8,vn)]))),128))])):T(``,!0),u(`button`,{type:`button`,class:`flex h-9 items-center justify-center gap-2 rounded-md border border-dashed text-[13px] font-medium text-muted-foreground hover:border-brand-300 hover:text-foreground`,disabled:b.value,onClick:i[10]||=e=>le.value?.click()},[b.value?(v(),S(o(ne),{key:0,class:`size-4 animate-spin`})):(v(),S(o(gt),{key:1,class:`size-4`})),i[15]||=n(` Dateien hochladen `,-1)],8,yn),u(`input`,{ref_key:`fileInput`,ref:le,type:`file`,multiple:``,class:`hidden`,onChange:de},null,544),pe.value.length?(v(),S(J,{key:1,"model-value":null,options:pe.value.map(e=>({value:e.id,label:e.name})),placeholder:`Bereits hochgeladene Datei wählen …`,"onUpdate:modelValue":i[11]||=e=>e&&(h.value=[...h.value??[],e])},null,8,[`options`])):T(``,!0)])):T(``,!0),e.field.help?(v(),d(`p`,bn,x(e.field.help),1)):T(``,!0)])}}},Sn={key:0,class:`grid gap-5`},Cn={class:`flex items-start gap-3`},wn={class:`grid size-9 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},Tn={class:`min-w-0`},En={class:`font-semibold`},Dn={key:0,class:`text-xs text-muted-foreground`},On={key:0,class:`rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground`},kn={key:1,class:`grid gap-2`},An={class:`text-[13px] font-medium`},jn={key:1,class:`flex-1 text-[13px]`},Mn=[`onClick`],Nn=[`onClick`],Pn=[`disabled`,`onClick`],Fn=[`open`],In={class:`flex cursor-pointer items-center gap-2 px-3 py-2 text-[13px] font-medium`},Ln={key:0,class:`ml-auto rounded bg-amber-100 px-1.5 py-0.5 text-[11px] text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`},Rn={class:`grid gap-3 border-t px-3 py-3`},zn={class:`mb-1 text-xs font-semibold text-muted-foreground`},Bn={class:`grid max-h-36 gap-0.5 overflow-y-auto`},Vn=[`checked`,`onChange`],Hn={__name:`BlockSettings`,props:{block:{type:Object,required:!0}},setup(e){let r=e,s=a(`pagebuilder:editor`),c=m(()=>s.types[r.block.type]),l=m(()=>(c.value?.fields??[]).filter(e=>e.type!==`html`));i(()=>r.block.data.layout,()=>{r.block.type===`columns`&&wt(r.block)});function p(){r.block.items.push({id:Q(),title:`${c.value.container.label} ${r.block.items.length+1}`,blocks:[]})}function h(e,t){let n=r.block.items,i=e+t;i>=0&&i<n.length&&([n[e],n[i]]=[n[i],n[e]])}function g(e){let t=r.block.items[e];(!t.blocks.length||window.confirm(`„${t.title||c.value.container.label}“ enthält Inhalte. Trotzdem entfernen?`))&&r.block.items.splice(e,1)}let _=m(()=>r.block.visibility??{}),b=m(()=>Object.values(_.value).some(e=>e?.length));function C(e,t){let n=new Set(_.value[e]??[]);n.has(t)?n.delete(t):n.add(t),r.block.visibility={..._.value,[e]:[...n]}}let E=m(()=>[{key:`role`,label:`Rollen`,options:s.audienceOptions.role},{key:`department`,label:`Abteilungen`,options:s.audienceOptions.department.map(e=>({value:e,label:e}))},{key:`location`,label:`Standorte`,options:s.audienceOptions.location.map(e=>({value:e,label:e}))}].filter(e=>e.options.length));return(r,i)=>c.value?(v(),d(`div`,Sn,[u(`header`,Cn,[u(`span`,wn,[(v(),S(w(o(vt)(c.value.icon)),{class:`size-4.5`}))]),u(`div`,Tn,[u(`h2`,En,x(c.value.label),1),c.value.description?(v(),d(`p`,Dn,x(c.value.description),1)):T(``,!0)])]),c.value.fields.some(e=>e.type===`html`)?(v(),d(`p`,On,` Den Text bearbeiten Sie direkt im Block. Markieren Sie Text für Fettdruck, Links und Listen. `)):T(``,!0),(v(!0),d(y,null,f(l.value,t=>(v(),S(xn,{id:`field-${e.block.id}-${t.name}`,key:`${e.block.id}-${t.name}`,modelValue:e.block.data[t.name],"onUpdate:modelValue":n=>e.block.data[t.name]=n,field:t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`field`]))),128)),c.value.container&&c.value.container.max>1&&c.value.key!==`columns`?(v(),d(`section`,kn,[u(`h3`,An,x(c.value.container.label)+`s`,1),(v(!0),d(y,null,f(e.block.items,(n,r)=>(v(),d(`div`,{key:n.id,class:`flex items-center gap-1`},[c.value.container.titled?(v(),S(o(Y),{key:0,modelValue:n.title,"onUpdate:modelValue":e=>n.title=e,class:`h-8`,"aria-label":`Titel ${r+1}`,maxlength:`120`},null,8,[`modelValue`,`onUpdate:modelValue`,`aria-label`])):(v(),d(`span`,jn,x(c.value.container.label)+` `+x(r+1),1)),u(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:e=>h(r,-1)},[t(o(M),{class:`size-3.5`})],8,Mn),u(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Nach unten`,onClick:e=>h(r,1)},[t(o(re),{class:`size-3.5`})],8,Nn),u(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded text-destructive hover:bg-destructive/10 disabled:opacity-30`,title:`Entfernen`,disabled:e.block.items.length<=c.value.container.min,onClick:e=>g(r)},[t(o(Ve),{class:`size-3.5`})],8,Pn)]))),128)),e.block.items.length<c.value.container.max?(v(),d(`button`,{key:0,type:`button`,class:`flex h-8 items-center justify-center gap-1.5 rounded-md border border-dashed text-[13px] font-medium text-muted-foreground hover:border-brand-300 hover:text-foreground`,onClick:p},[t(o(G),{class:`size-3.5`}),n(` `+x(c.value.container.label)+` hinzufügen `,1)])):T(``,!0)])):T(``,!0),E.value.length?(v(),d(`details`,{key:2,class:`rounded-md border`,open:b.value},[u(`summary`,In,[t(o(be),{class:`size-4 text-muted-foreground`}),i[0]||=n(` Sichtbarkeit `,-1),b.value?(v(),d(`span`,Ln,`eingeschränkt`)):T(``,!0)]),u(`div`,Rn,[i[1]||=u(`p`,{class:`text-xs text-muted-foreground`},`Leer = für alle, die die Seite sehen. Sonst nur für Personen, die mindestens eine Angabe erfüllen.`,-1),(v(!0),d(y,null,f(E.value,e=>(v(),d(`fieldset`,{key:e.key,class:`grid gap-1`},[u(`legend`,zn,x(e.label),1),u(`div`,Bn,[(v(!0),d(y,null,f(e.options,t=>(v(),d(`label`,{key:t.value,class:`flex items-center gap-2 rounded px-1 py-0.5 text-[13px] hover:bg-accent`},[u(`input`,{type:`checkbox`,class:`size-4 accent-[var(--brand)]`,checked:(_.value[e.key]??[]).includes(t.value),onChange:n=>C(e.key,t.value)},null,40,Vn),n(` `+x(t.label),1)]))),128))])]))),128))])],8,Fn)):T(``,!0)])):T(``,!0)}},Un=[`data-block-id`],Wn={class:`pb-handle flex cursor-grab items-center gap-1 rounded px-1 py-0.5 font-medium text-muted-foreground active:cursor-grabbing`,title:`Ziehen zum Verschieben`},Gn={key:2,class:`rounded-md border border-dashed p-4 text-sm text-muted-foreground`},Kn={__name:`EditorBlock`,props:{block:{type:Object,required:!0}},setup(e){let r=e,i=a(`pagebuilder:editor`),s=m(()=>i.types[r.block.type]),c=m(()=>i.selectedId.value===r.block.id),f=m(()=>i.hoveredId.value===r.block.id),p=m(()=>Object.values(r.block.visibility??{}).some(e=>e?.length)),h=m(()=>({...r.block,props:i.previews[r.block.id]??r.block.props}));return(r,a)=>(v(),d(`div`,{class:l([`relative rounded-md outline-offset-4 transition-[outline-color]`,[c.value?`outline-2 outline-brand-500`:f.value?`outline-1 outline-brand-300`:`outline-1 outline-transparent`,s.value?``:`opacity-60`]]),"data-block-id":e.block.id,onClick:a[5]||=E(t=>o(i).select(e.block.id),[`stop`]),onMouseover:a[6]||=E(t=>o(i).hoveredId.value=e.block.id,[`stop`]),onMouseleave:a[7]||=t=>o(i).hoveredId.value===e.block.id&&(o(i).hoveredId.value=null)},[(c.value||f.value)&&!o(i).readOnly.value?(v(),d(`div`,{key:0,class:`absolute -top-3.5 right-2 z-20 flex items-center gap-0.5 rounded-md border bg-card px-1 py-0.5 text-xs shadow-sm`,onClick:a[4]||=E(()=>{},[`stop`])},[u(`span`,Wn,[t(o(ie),{class:`size-3.5`}),(v(),S(w(o(vt)(s.value?.icon)),{class:`size-3.5`})),n(` `+x(s.value?.label??e.block.type),1)]),p.value?(v(),S(o(be),{key:0,class:`mx-1 size-3.5 text-amber-600`,title:`Nur für bestimmte Personen sichtbar`})):T(``,!0),a[8]||=u(`span`,{class:`mx-0.5 h-4 w-px bg-border`},null,-1),u(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:a[0]||=t=>o(i).move(e.block.id,-1)},[t(o(Qe),{class:`size-3.5`})]),u(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach unten`,onClick:a[1]||=t=>o(i).move(e.block.id,1)},[t(o(ve),{class:`size-3.5`})]),u(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Duplizieren`,onClick:a[2]||=t=>o(i).duplicate(e.block.id)},[t(o(ae),{class:`size-3.5`})]),u(`button`,{type:`button`,class:`grid size-6 place-items-center rounded text-destructive hover:bg-destructive/10`,title:`Entfernen`,onClick:a[3]||=t=>o(i).remove(e.block.id)},[t(o(Ve),{class:`size-3.5`})])])):T(``,!0),s.value&&o(Je)(s.value.component)?(v(),S(w(o(Je)(s.value.component)),{key:1,block:h.value},null,8,[`block`])):(v(),d(`div`,Gn,` Dieser Block (`+x(e.block.type)+`) ist nicht verfügbar – vermutlich ist das zugehörige Plugin deaktiviert. Er wird nicht angezeigt. `,1))],42,Un))}},qn={key:0,class:`pointer-events-none text-center text-xs text-muted-foreground`},Jn={__name:`EditorBlockList`,props:{item:{type:Object,required:!0},root:{type:Boolean,default:!1}},setup(e){let r=e,i=a(`pagebuilder:editor`),s=m(()=>r.root||i.containsActive(r.item));return(r,a)=>(v(),d(`div`,{class:l([`grid`,e.root?`gap-6`:`gap-4`])},[t(o(I),{modelValue:e.item.blocks,"onUpdate:modelValue":a[0]||=t=>e.item.blocks=t,group:{name:`pagebuilder`},handle:`.pb-handle`,animation:150,disabled:o(i).readOnly.value,"ghost-class":`pb-ghost`,class:l([`grid min-h-6`,[e.root?`gap-6`:`gap-4`,e.item.blocks.length?``:`rounded-md border border-dashed border-border bg-muted/40 p-3`]]),onAdd:a[1]||=t=>o(i).select(e.item.blocks[t.newIndex]?.id)},{default:b(()=>[(v(!0),d(y,null,f(e.item.blocks,e=>(v(),S(Kn,{key:e.id,block:e},null,8,[`block`]))),128)),e.item.blocks.length?T(``,!0):(v(),d(`p`,qn,x(e.root?`Noch keine Inhalte. Blöcke aus der rechten Spalte hierher ziehen oder hinzufügen.`:`Blöcke hierher ziehen`),1))]),_:1},8,[`modelValue`,`disabled`,`class`]),!o(i).readOnly.value&&(s.value||!e.item.blocks.length)?(v(),S(o(he),{key:0},{default:b(()=>[t(o(ge),{class:`flex h-8 items-center justify-center gap-1.5 rounded-md border border-dashed text-xs font-medium text-muted-foreground transition-colors hover:border-brand-300 hover:bg-brand-soft hover:text-brand-soft-foreground`,onClick:a[2]||=E(()=>{},[`stop`])},{default:b(()=>[t(o(G),{class:`size-3.5`}),a[5]||=n(` Block hinzufügen `,-1)]),_:1}),t(o(_e),{class:`max-h-[70vh] w-[22rem] overflow-y-auto p-3`,align:`center`,onClick:a[4]||=E(()=>{},[`stop`])},{default:b(()=>[t(kt,{compact:``,onPick:a[3]||=t=>o(i).insert(e.item.blocks,e.item.blocks.length,t)})]),_:1})]),_:1})):T(``,!0)],2))}},Yn={key:0,class:`rounded-md bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:bg-amber-950/50 dark:text-amber-100`},Xn={class:`grid gap-2`},Zn={class:`flex cursor-pointer items-start gap-3 rounded-md border p-3 has-checked:border-brand-400 has-checked:bg-brand-soft/60`},Qn={class:`flex cursor-pointer items-start gap-3 rounded-md border p-3 has-checked:border-brand-400 has-checked:bg-brand-soft/60`},$n={class:`grid flex-1 gap-2`},er={__name:`PublishDialog`,props:e({scheduledAt:{type:String,default:null}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`publish`],[`update:open`]),setup(e,{emit:a}){let s=e,l=r(e,`open`),f=a,p=C(`now`),m=C(``),h=C(!1);function g(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`}i(l,e=>{if(e){p.value=`now`;let e=new Date(Date.now()+864e5);e.setHours(7,0,0,0),m.value=g(e),h.value=!1}});async function _(){h.value=!0,f(`publish`,p.value===`later`?new Date(m.value).toISOString():null),setTimeout(()=>h.value=!1,800)}return(e,r)=>(v(),S(o(Ge),{open:l.value,"onUpdate:open":r[4]||=e=>l.value=e},{default:b(()=>[t(o(X),{class:`sm:max-w-md`},{default:b(()=>[t(o(Ue),null,{default:b(()=>[t(o(qe),null,{default:b(()=>[...r[5]||=[n(`Seite veröffentlichen`,-1)]]),_:1}),t(o(He),null,{default:b(()=>[...r[6]||=[n(`Der aktuelle Stand wird für alle sichtbar, die die Seite sehen dürfen. Frühere Stände bleiben unter „Versionen“ erhalten.`,-1)]]),_:1})]),_:1}),s.scheduledAt?(v(),d(`p`,Yn,` Es ist bereits eine Veröffentlichung geplant. Sie wird durch diese ersetzt. `)):T(``,!0),u(`fieldset`,Xn,[r[9]||=u(`legend`,{class:`sr-only`},`Zeitpunkt`,-1),u(`label`,Zn,[c(u(`input`,{"onUpdate:modelValue":r[0]||=e=>p.value=e,type:`radio`,value:`now`,class:`mt-1 accent-[var(--brand)]`},null,512),[[D,p.value]]),r[7]||=u(`span`,null,[u(`span`,{class:`block text-sm font-medium`},`Jetzt veröffentlichen`),u(`span`,{class:`block text-xs text-muted-foreground`},`Sofort sichtbar.`)],-1)]),u(`label`,Qn,[c(u(`input`,{"onUpdate:modelValue":r[1]||=e=>p.value=e,type:`radio`,value:`later`,class:`mt-1 accent-[var(--brand)]`},null,512),[[D,p.value]]),u(`span`,$n,[r[8]||=u(`span`,null,[u(`span`,{class:`block text-sm font-medium`},`Zeitgesteuert`),u(`span`,{class:`block text-xs text-muted-foreground`},`Der aktuelle Stand geht zum gewählten Zeitpunkt online.`)],-1),p.value===`later`?(v(),S(o(Y),{key:0,modelValue:m.value,"onUpdate:modelValue":r[2]||=e=>m.value=e,type:`datetime-local`,min:g(new Date),"aria-label":`Zeitpunkt der Veröffentlichung`},null,8,[`modelValue`,`min`])):T(``,!0)])])]),t(o(Ke),null,{default:b(()=>[t(o(q),{variant:`outline`,onClick:r[3]||=e=>l.value=!1},{default:b(()=>[...r[10]||=[n(`Abbrechen`,-1)]]),_:1}),t(o(q),{disabled:h.value||p.value===`later`&&!m.value,onClick:_},{default:b(()=>[p.value===`later`?(v(),S(o(ue),{key:0})):(v(),S(o(ze),{key:1})),n(` `+x(p.value===`later`?`Planen`:`Veröffentlichen`),1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}},tr={class:`flex min-h-0 flex-1`},nr={class:`w-64 shrink-0 overflow-y-auto border-r p-2`},rr={key:0,class:`grid place-items-center py-10`},ir={key:1,class:`px-3 py-6 text-center text-sm text-muted-foreground`},ar=[`onClick`],or={class:`block text-sm font-medium`},sr={class:`block truncate text-xs text-muted-foreground`},cr={class:`flex min-w-0 flex-1 flex-col`},lr={class:`min-h-0 flex-1 overflow-y-auto bg-background p-6`},ur={key:0,class:`grid place-items-center py-16`},dr={class:`mb-6 text-2xl font-semibold tracking-tight`},fr={key:0,class:`flex items-center justify-between gap-3 border-t px-5 py-3`},pr={class:`text-xs text-muted-foreground`},mr={__name:`RevisionsDialog`,props:e({base:{type:String,required:!0},readOnly:{type:Boolean,default:!1}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`restored`],[`update:open`]),setup(e,{emit:a}){let s=e,c=r(e,`open`),p=a,m=C(null),h=C(null),g=C(null),_=C(!1);i(c,async e=>{e&&(m.value=null,g.value=null,h.value=null,m.value=(await V.get(`${s.base}/versionen`)).revisions,m.value.length&&w(m.value[0]))});async function w(e){h.value=e,_.value=!0;try{g.value=await V.get(`${s.base}/versionen/${e.id}`)}finally{_.value=!1}}async function E(){try{p(`restored`,await V.post(`${s.base}/versionen/${h.value.id}/wiederherstellen`))}catch(e){B.error(e.message)}}return(r,i)=>(v(),S(o(Ge),{open:c.value,"onUpdate:open":i[0]||=e=>c.value=e},{default:b(()=>[t(o(X),{class:`flex h-[85vh] max-w-5xl flex-col gap-0 p-0 sm:max-w-5xl`},{default:b(()=>[t(o(Ue),{class:`border-b px-5 py-4`},{default:b(()=>[t(o(qe),null,{default:b(()=>[...i[1]||=[n(`Versionen`,-1)]]),_:1}),t(o(He),null,{default:b(()=>[...i[2]||=[n(`Jede Veröffentlichung wird gespeichert. Eine ältere Version lässt sich als Entwurf zurückholen.`,-1)]]),_:1})]),_:1}),u(`div`,tr,[u(`ul`,nr,[m.value===null?(v(),d(`li`,rr,[t(o(ne),{class:`size-5 animate-spin text-muted-foreground`})])):m.value.length?T(``,!0):(v(),d(`li`,ir,`Noch keine veröffentlichten Versionen.`)),(v(!0),d(y,null,f(m.value??[],e=>(v(),d(`li`,{key:e.id},[u(`button`,{type:`button`,class:l([`w-full rounded-md px-3 py-2 text-left`,h.value?.id===e.id?`bg-brand-soft text-brand-soft-foreground`:`hover:bg-accent`]),onClick:t=>w(e)},[u(`span`,or,x(o(De)(e.created_at)),1),u(`span`,sr,[n(x(e.action),1),e.user?(v(),d(y,{key:0},[n(` · `+x(e.user),1)],64)):T(``,!0)])],10,ar)]))),128))]),u(`div`,cr,[u(`div`,lr,[_.value?(v(),d(`div`,ur,[t(o(ne),{class:`size-6 animate-spin text-muted-foreground`})])):g.value?(v(),d(y,{key:1},[u(`h1`,dr,x(g.value.title),1),t(Ye,{content:g.value.content},null,8,[`content`])],64)):T(``,!0)]),h.value?(v(),d(`div`,fr,[u(`span`,pr,x(new Date(h.value.created_at).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`})),1),t(o(q),{disabled:e.readOnly,onClick:E},{default:b(()=>[t(o(ft)),i[3]||=n(` Als Entwurf wiederherstellen`,-1)]),_:1},8,[`disabled`])])):T(``,!0)])])]),_:1})]),_:1},8,[`open`]))}},hr={class:`grid gap-1.5`},gr={key:0,class:`text-[13px] text-destructive`},_r={key:1,class:`text-xs text-muted-foreground`},vr={key:0,class:`flex items-center justify-between gap-3 text-[13px] font-medium`},yr={__name:`PageSettingsDialog`,props:e({page:{type:Object,required:!0},base:{type:String,required:!0}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`saved`],[`update:open`]),setup(e,{emit:a}){let s=e,c=r(e,`open`),l=a,f=C({slug:``,in_navigation:!1}),p=C({}),m=C(!1);i(c,e=>{e&&(f.value={slug:s.page.slug,in_navigation:s.page.in_navigation},p.value={})});async function h(){m.value=!0;try{l(`saved`,await V.put(`${s.base}/einstellungen`,f.value)),c.value=!1}catch(e){p.value=e.fieldErrors??{}}finally{m.value=!1}}return(r,i)=>(v(),S(o(Ge),{open:c.value,"onUpdate:open":i[3]||=e=>c.value=e},{default:b(()=>[t(o(X),{class:`sm:max-w-md`},{default:b(()=>[t(o(Ue),null,{default:b(()=>[t(o(qe),null,{default:b(()=>[...i[4]||=[n(`Seiteneinstellungen`,-1)]]),_:1}),t(o(He),null,{default:b(()=>[...i[5]||=[n(`Sichtbarkeit und Rechte pflegen Sie in der Administration unter „Seiten“.`,-1)]]),_:1})]),_:1}),u(`form`,{class:`grid gap-4`,onSubmit:E(h,[`prevent`])},[u(`label`,hr,[i[6]||=u(`span`,{class:`text-[13px] font-medium`},`Kürzel in der Adresse`,-1),t(o(Y),{modelValue:f.value.slug,"onUpdate:modelValue":i[0]||=e=>f.value.slug=e,maxlength:`120`,"aria-invalid":!!p.value.slug},null,8,[`modelValue`,`aria-invalid`]),p.value.slug?(v(),d(`span`,gr,x(p.value.slug),1)):(v(),d(`span`,_r,`Ändert auch die Adressen aller Unterseiten. Alte Links funktionieren dann nicht mehr.`))]),e.page.can.navigation?(v(),d(`label`,vr,[i[7]||=n(` In der Hauptnavigation anzeigen `,-1),t(o(K),{modelValue:f.value.in_navigation,"onUpdate:modelValue":i[1]||=e=>f.value.in_navigation=e},null,8,[`modelValue`])])):T(``,!0),t(o(Ke),null,{default:b(()=>[t(o(q),{type:`button`,variant:`outline`,onClick:i[2]||=e=>c.value=!1},{default:b(()=>[...i[8]||=[n(`Abbrechen`,-1)]]),_:1}),t(o(q),{type:`submit`,disabled:m.value},{default:b(()=>[...i[9]||=[n(`Speichern`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]))}},br={class:`grid gap-1.5`},xr={__name:`ReviewDialog`,props:{open:{type:Boolean,default:!1},openModifiers:{}},emits:e([`submit`],[`update:open`]),setup(e,{emit:a}){let s=r(e,`open`),c=a,l=C(``),d=C(!1);i(s,e=>e&&(l.value=``,d.value=!1));function f(){d.value=!0,c(`submit`,l.value),setTimeout(()=>d.value=!1,1500)}return(e,r)=>(v(),S(o(Ge),{open:s.value,"onUpdate:open":r[2]||=e=>s.value=e},{default:b(()=>[t(o(X),{class:`sm:max-w-md`},{default:b(()=>[t(o(Ue),null,{default:b(()=>[t(o(qe),null,{default:b(()=>[...r[3]||=[n(`Freigabe anfordern`,-1)]]),_:1}),t(o(He),null,{default:b(()=>[...r[4]||=[n(`Ihre Änderungen sind als Entwurf gespeichert. Die Personen, die diese Seite veröffentlichen dürfen, werden benachrichtigt.`,-1)]]),_:1})]),_:1}),u(`label`,br,[r[5]||=u(`span`,{class:`text-[13px] font-medium`},`Nachricht (freiwillig)`,-1),t(o(We),{modelValue:l.value,"onUpdate:modelValue":r[0]||=e=>l.value=e,rows:`3`,maxlength:`1000`,placeholder:`z. B. Bitte bis Freitag veröffentlichen.`},null,8,[`modelValue`])]),t(o(Ke),null,{default:b(()=>[t(o(q),{variant:`outline`,onClick:r[1]||=e=>s.value=!1},{default:b(()=>[...r[6]||=[n(`Abbrechen`,-1)]]),_:1}),t(o(q),{disabled:d.value,onClick:f},{default:b(()=>[t(o(ze)),r[7]||=n(` Anfordern`,-1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}},Sr={class:`flex h-dvh flex-col bg-background`},Cr={class:`z-30 flex h-14 shrink-0 items-center gap-2 border-b bg-card px-2 sm:px-3`},wr={class:`min-w-0 flex-1`},Tr={class:`flex items-center gap-2`},Er={class:`truncate text-sm font-semibold`},Dr={class:`flex items-center gap-1 truncate text-xs text-muted-foreground`,"aria-live":`polite`},Or={class:`hidden items-center gap-0.5 md:flex`},kr=[`disabled`],Ar=[`disabled`],jr={class:`flex rounded-md border p-0.5`,role:`group`,"aria-label":`Vorschau`},Mr=[`title`,`aria-pressed`,`onClick`],Nr=[`href`],Pr={key:0,class:`flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-amber-200 bg-amber-50 px-4 py-2.5 text-sm text-amber-900 dark:border-amber-900 dark:bg-amber-950/50 dark:text-amber-100`},Fr={class:`flex-1`},Ir={class:`flex min-h-0 flex-1`},Lr={key:0,class:`mb-2 flex flex-wrap gap-1 text-xs text-muted-foreground`,"aria-label":`Brotkrumen`},Rr=[`readonly`],zr={class:`@container`},Br={class:`hidden w-[340px] shrink-0 flex-col border-l bg-card lg:flex`},Vr={class:`flex shrink-0 border-b px-2`,role:`tablist`},Hr=[`aria-selected`,`disabled`,`onClick`],Ur={key:0,class:`absolute inset-x-2 bottom-0 h-[3px] rounded-t-full bg-brand`},Wr={class:`min-h-0 flex-1 overflow-y-auto p-4`},Gr={class:`fixed right-4 bottom-4 z-30 flex gap-2 lg:hidden`},Kr={__name:`Editor`,props:{page:{type:Object,required:!0},working:{type:Object,required:!0},lockedBy:{type:Object,default:null},blockTypes:{type:Array,required:!0},blockGroups:{type:Object,required:!0},files:{type:Array,default:()=>[]},audienceOptions:{type:Object,required:!0},breadcrumbs:{type:Array,default:()=>[]},uploadsUrl:{type:String,required:!0}},setup(e){let r=e,a=`/redaktion/seiten/${r.page.id}`,s=Object.fromEntries(r.blockTypes.map(e=>[e.key,e])),D=C(r.page),A=h(yt(r.working)),j=C(null),M=C(null),N=h({}),re=C(r.files),P=C(!!r.lockedBy),ie=C(r.lockedBy),ae=C(`desktop`),I=C(!1),L=C(`blocks`),R=m(()=>j.value?$(A.content.blocks,j.value)?.block??null:null);i(j,e=>{L.value=e?`block`:`blocks`});function z(e){j.value=e??null}function ce(e,t,n){if(P.value)return;let r=xt(n);e.splice(t,0,r),z(r.id)}function le(e){let t=R.value?$(A.content.blocks,R.value.id):null;t?ce(t.list,t.index+1,e):ce(A.content.blocks,A.content.blocks.length,e),I.value=!1,requestAnimationFrame(()=>document.querySelector(`[data-block-id="${j.value}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}))}function de(e){let t=$(A.content.blocks,e);t&&(t.list.splice(t.index,1),j.value===e&&z(null))}function fe(e,t){let n=$(A.content.blocks,e),r=n?n.index+t:-1;n&&r>=0&&r<n.list.length&&n.list.splice(r,0,n.list.splice(n.index,1)[0])}function he(e){let t=$(A.content.blocks,e);if(!t)return;let n=St(t.block);t.list.splice(t.index+1,0,n),Object.assign(N,{[n.id]:N[e]}),z(n.id)}function ge(e){return[R.value,M.value?$(A.content.blocks,M.value)?.block:null].filter(Boolean).some(t=>t.items?.includes(e)||$(e.blocks,t.id))}async function _e(e){let t=new FormData;return t.append(`image`,e),V.post(`${a}/bilder`,t)}async function ve(e){let t=new FormData;t.append(`file`,e);let n=await V.post(`${a}/dateien`,t);return re.value=[n.file,...re.value],n.file}let ye=h({});g(`pagebuilder:editor`,{types:s,groups:r.blockGroups,selectedId:j,hoveredId:M,previews:N,readOnly:P,files:re,peopleCache:ye,audienceOptions:r.audienceOptions,select:z,insert:ce,remove:de,move:fe,duplicate:he,containsActive:ge,uploadImage:_e,uploadFile:ve,imageUrl:e=>`${r.uploadsUrl}/${e}`}),g(`pagebuilder:list`,Jn),g(`pagebuilder:types`,s),g(`pagebuilder:editing`,m(()=>!P.value));let be={},Se;function we(){let e=[];Ct(A.content.blocks,t=>{if(!s[t.type]?.dynamic)return;let n=JSON.stringify(t.data);be[t.id]!==n&&(be[t.id]=n,e.push({id:t.id,type:t.type,data:t.data}))}),e.length&&V.post(`${a}/vorschau`,{blocks:e.slice(0,100)}).then(e=>Object.assign(N,e.props)).catch(()=>{})}let H=C(`saved`),Ee=C(D.value.draft_updated_at),De,U=JSON.stringify(A);function Re(){return{title:A.title,content:A.content}}async function G(){if(clearTimeout(De),P.value)return;let e=JSON.stringify(A);if(e===U){H.value=`saved`;return}H.value=`saving`;try{let t=await V.put(`${a}/entwurf`,Re());U=e,D.value=t.page,Ee.value=new Date().toISOString(),H.value=JSON.stringify(A)===U?`saved`:`dirty`,H.value===`dirty`&&He()}catch(e){Ue(e),H.value=`error`}}function He(e=1200){clearTimeout(De),De=setTimeout(G,e)}function Ue(e){e.status===423?(P.value=!0,ie.value=e.data.lockedBy,B.error(e.message)):e.status===422&&e.data?.errors?.title?B.error(e.data.errors.title[0]):B.error(e.message||`Speichern fehlgeschlagen. Bitte die Verbindung prüfen.`)}let K=C([]),J=C([]),Y=JSON.stringify(A),We=!1,Ge;function Ke(){let e=JSON.stringify(A);e!==Y&&(K.value=[...K.value.slice(-49),Y],J.value=[],Y=e)}function X(e){We=!0;let t=JSON.parse(e);A.title=t.title,A.content=t.content,Y=e,j.value&&!$(A.content.blocks,j.value)&&z(null),setTimeout(()=>We=!1)}function qe(){Ke(),K.value.length&&(J.value=[...J.value,JSON.stringify(A)],X(K.value.at(-1)),K.value=K.value.slice(0,-1))}function Je(){J.value.length&&(K.value=[...K.value,JSON.stringify(A)],X(J.value.at(-1)),J.value=J.value.slice(0,-1))}i(A,()=>{P.value||(H.value=`dirty`,He(),clearTimeout(Se),Se=setTimeout(we,500),We||(clearTimeout(Ge),Ge=setTimeout(Ke,700)))},{deep:!0});function Ye(e){let t=e.target.closest?.(`input, textarea, select, [contenteditable="true"]`);(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`?(e.preventDefault(),G()):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`z`?(e.preventDefault(),e.shiftKey?Je():qe()):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`y`?(e.preventDefault(),Je()):e.key===`Escape`&&!t&&z(null)}let Ze;async function Qe(e=!1){try{await V.post(`${a}/sperre`,{takeover:e}),e&&(P.value=!1,ie.value=null,B.success(`Sie bearbeiten die Seite jetzt.`))}catch(e){e.status===423&&(P.value=!0,ie.value=e.data.lockedBy)}}async function et(){await Qe(!0),O.reload({only:[`working`,`page`],onSuccess:()=>Object.assign(A,yt(r.working))})}function tt(){P.value||(JSON.stringify(A)!==U&&fetch(`${a}/entwurf`,{method:`PUT`,keepalive:!0,credentials:`same-origin`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"X-XSRF-TOKEN":decodeURIComponent(document.cookie.match(/XSRF-TOKEN=([^;]*)/)?.[1]??``)},body:JSON.stringify(Re())}),V.post(`${a}/sperre/freigeben`,{},{keepalive:!0}).catch(()=>{}))}p(()=>{we(),window.addEventListener(`keydown`,Ye),window.addEventListener(`pagehide`,tt),Ze=setInterval(()=>!P.value&&Qe(),45e3)}),_(()=>{window.removeEventListener(`keydown`,Ye),window.removeEventListener(`pagehide`,tt),clearInterval(Ze),clearTimeout(De),tt()});let Z=h({publish:!1,review:!1,revisions:!1,settings:!1,newPage:!1});async function it(e){clearTimeout(De);try{let t=await V.post(`${a}/veroeffentlichen`,{...Re(),scheduled_at:e||null});D.value=t.page,U=JSON.stringify(A),H.value=`saved`,Z.publish=!1,B.success(e?`Veröffentlichung geplant für ${new Date(e).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`})}`:`Seite veröffentlicht`,{action:e?void 0:{label:`Ansehen`,onClick:()=>O.visit(D.value.url)}})}catch(e){Ue(e)}}async function at(e){await G();try{let t=await V.post(`${a}/freigabe`,{message:e});Z.review=!1,B.success(`Freigabe angefordert – ${t.recipients} ${t.recipients===1?`Person wurde`:`Personen wurden`} benachrichtigt.`)}catch(e){B.error(e.message)}}async function ot(e,t,n,r){if(!n||window.confirm(n))try{let n=await V[e](t);if(n.page&&(D.value=n.page),n.working&&(X(JSON.stringify(n.working)),U=JSON.stringify(A)),n.redirect){O.visit(n.redirect);return}B.success(r)}catch(e){B.error(e.message)}}function st(e){D.value=e.page,X(JSON.stringify(e.working)),U=JSON.stringify(A),Object.keys(be).forEach(e=>delete be[e]),we(),Z.revisions=!1,B.success(`Version als Entwurf wiederhergestellt`)}let ct=m(()=>D.value.scheduled_at?{label:`Geplant: ${new Date(D.value.scheduled_at).toLocaleString(`de-DE`,{dateStyle:`short`,timeStyle:`short`})}`,class:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`}:D.value.is_published?D.value.has_draft?{label:`Entwurf mit Änderungen`,class:`bg-brand-soft text-brand-soft-foreground`}:{label:`Veröffentlicht`,class:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`}:{label:`Nicht veröffentlicht`,class:`bg-muted text-muted-foreground`}),lt=[{key:`desktop`,label:`Desktop`,icon:Te,width:`max-w-[1100px]`},{key:`tablet`,label:`Tablet`,icon:ht,width:`max-w-[768px]`},{key:`mobile`,label:`Smartphone`,icon:Be,width:`max-w-[390px]`}],ut=m(()=>lt.find(e=>e.key===ae.value).width);return(r,i)=>(v(),d(y,null,[t(o(k),{title:`Bearbeiten: ${A.title}`},null,8,[`title`]),u(`div`,Sr,[u(`header`,Cr,[t(o(te),{href:D.value.is_published?D.value.url:`/redaktion`,class:`grid size-9 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:`Zurück`},{default:b(()=>[t(o(oe),{class:`size-5`})]),_:1},8,[`href`]),u(`div`,wr,[u(`div`,Tr,[u(`span`,Er,x(A.title||`Ohne Titel`),1),u(`span`,{class:l([`hidden shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium sm:inline`,ct.value.class])},x(ct.value.label),3)]),u(`p`,Dr,[P.value?(v(),d(y,{key:0},[t(o(Ce),{class:`size-3`}),i[21]||=n(` Nur lesen`,-1)],64)):H.value===`saving`?(v(),d(y,{key:1},[t(o(ne),{class:`size-3 animate-spin`}),i[22]||=n(` Speichert …`,-1)],64)):H.value===`error`?(v(),d(y,{key:2},[t(o($e),{class:`size-3 text-destructive`}),i[23]||=n(` Nicht gespeichert`,-1)],64)):H.value===`dirty`?(v(),d(y,{key:3},[n(`Ungespeicherte Änderungen`)],64)):Ee.value?(v(),d(y,{key:4},[t(o(me),{class:`size-3`}),n(` Entwurf gespeichert `+x(o(Le)(Ee.value)),1)],64)):(v(),d(y,{key:5},[n(x(D.value.url),1)],64))])]),u(`div`,Or,[u(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Rückgängig (Strg+Z)`,disabled:!K.value.length||P.value,onClick:qe},[t(o(Ne),{class:`size-4`})],8,kr),u(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Wiederholen (Strg+Y)`,disabled:!J.value.length||P.value,onClick:Je},[t(o(se),{class:`size-4`})],8,Ar),i[24]||=u(`span`,{class:`mx-1 h-6 w-px bg-border`},null,-1),u(`div`,jr,[(v(),d(y,null,f(lt,e=>u(`button`,{key:e.key,type:`button`,class:l([`grid size-8 place-items-center rounded`,ae.value===e.key?`bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),title:e.label,"aria-pressed":ae.value===e.key,onClick:t=>ae.value=e.key},[(v(),S(w(e.icon),{class:`size-4`}))],10,Mr)),64))])]),t(o(Ae),null,{default:b(()=>[t(o(Oe),{class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent`,"aria-label":`Weitere Aktionen`},{default:b(()=>[t(o(nt),{class:`size-5`})]),_:1}),t(o(ke),{align:`end`,class:`w-64`},{default:b(()=>[D.value.is_published?(v(),S(o(W),{key:0,"as-child":``},{default:b(()=>[u(`a`,{href:D.value.url,target:`_blank`},[t(o(xe)),i[25]||=n(` Veröffentlichte Seite ansehen`,-1)],8,Nr)]),_:1})):T(``,!0),t(o(W),{onSelect:i[0]||=e=>Z.revisions=!0},{default:b(()=>[t(o(ft)),i[26]||=n(` Versionen`,-1)]),_:1}),D.value.can.configure?(v(),S(o(W),{key:1,onSelect:i[1]||=e=>Z.settings=!0},{default:b(()=>[t(o(F)),i[27]||=n(` Seiteneinstellungen`,-1)]),_:1})):T(``,!0),D.value.can.create_child?(v(),S(o(W),{key:2,onSelect:i[2]||=e=>Z.newPage=!0},{default:b(()=>[t(o(rt)),i[28]||=n(` Unterseite anlegen`,-1)]),_:1})):T(``,!0),t(o(Pe)),D.value.has_draft&&D.value.is_published&&!P.value?(v(),S(o(W),{key:3,onSelect:i[3]||=e=>ot(`delete`,`${a}/entwurf`,`Alle Änderungen seit der letzten Veröffentlichung verwerfen?`,`Entwurf verworfen`)},{default:b(()=>[t(o(Ne)),i[29]||=n(` Entwurf verwerfen `,-1)]),_:1})):T(``,!0),D.value.scheduled_at&&D.value.can.publish?(v(),S(o(W),{key:4,onSelect:i[4]||=e=>ot(`delete`,`${a}/planung`,null,`Planung aufgehoben – der Stand ist wieder ein Entwurf`)},{default:b(()=>[t(o(ue)),i[30]||=n(` Geplante Veröffentlichung aufheben `,-1)]),_:1})):T(``,!0),D.value.is_published&&D.value.can.publish?(v(),S(o(W),{key:5,onSelect:i[5]||=e=>ot(`post`,`${a}/zurueckziehen`,`Seite offline nehmen? Der Inhalt bleibt als Entwurf erhalten.`,`Seite ist offline`)},{default:b(()=>[t(o(Ce)),i[31]||=n(` Veröffentlichung zurückziehen `,-1)]),_:1})):T(``,!0),D.value.can.delete?(v(),S(o(W),{key:6,class:`text-destructive`,onSelect:i[6]||=e=>ot(`delete`,a,`Seite endgültig löschen? Versionen und Dateien werden entfernt.`,`Seite gelöscht`)},{default:b(()=>[t(o(Ve)),i[32]||=n(` Seite löschen `,-1)]),_:1})):T(``,!0)]),_:1})]),_:1}),D.value.can.publish?(v(),S(o(q),{key:0,disabled:P.value,onClick:i[7]||=e=>Z.publish=!0},{default:b(()=>[t(o(ze)),i[33]||=n(),i[34]||=u(`span`,{class:`hidden sm:inline`},`Veröffentlichen`,-1)]),_:1},8,[`disabled`])):(v(),S(o(q),{key:1,disabled:P.value,onClick:i[8]||=e=>Z.review=!0},{default:b(()=>[t(o(ze)),i[35]||=n(),i[36]||=u(`span`,{class:`hidden sm:inline`},`Freigabe anfordern`,-1)]),_:1},8,[`disabled`]))]),P.value?(v(),d(`div`,Pr,[t(o(Ce),{class:`size-4 shrink-0`}),u(`span`,Fr,x(ie.value?.name??`Jemand anderes`)+` bearbeitet diese Seite gerade. Sie sehen den zuletzt gespeicherten Stand.`,1),t(o(q),{size:`sm`,variant:`outline`,class:`bg-card`,onClick:et},{default:b(()=>[...i[37]||=[n(`Bearbeitung übernehmen`,-1)]]),_:1})])):T(``,!0),u(`div`,Ir,[u(`main`,{class:`min-w-0 flex-1 overflow-y-auto`,onClick:i[11]||=e=>z(null)},[u(`div`,{class:l([`mx-auto px-4 py-8 transition-[max-width] duration-300 sm:px-8`,ut.value])},[e.breadcrumbs.length?(v(),d(`nav`,Lr,[(v(!0),d(y,null,f(e.breadcrumbs,e=>(v(),d(`span`,{key:e.url},x(e.title)+` /`,1))),128))])):T(``,!0),c(u(`input`,{"onUpdate:modelValue":i[9]||=e=>A.title=e,class:`mb-6 w-full bg-transparent text-3xl font-semibold tracking-tight outline-none placeholder:text-muted-foreground/60`,placeholder:`Titel der Seite`,maxlength:`200`,"aria-label":`Titel der Seite`,readonly:P.value,onClick:i[10]||=E(()=>{},[`stop`])},null,8,Rr),[[ee,A.title]]),u(`div`,zr,[t(Jn,{item:A.content,root:``},null,8,[`item`])])],2)]),u(`aside`,Br,[u(`div`,Vr,[(v(),d(y,null,f([{key:`blocks`,label:`Blöcke`},{key:`block`,label:`Ausgewählter Block`}],e=>u(`button`,{key:e.key,type:`button`,role:`tab`,class:l([`relative px-3 py-3 text-sm font-medium disabled:opacity-40`,L.value===e.key?`text-foreground`:`text-muted-foreground hover:text-foreground`]),"aria-selected":L.value===e.key,disabled:e.key===`block`&&!R.value,onClick:t=>L.value=e.key},[n(x(e.label)+` `,1),L.value===e.key?(v(),d(`span`,Ur)):T(``,!0)],10,Hr)),64))]),u(`div`,Wr,[L.value===`block`&&R.value?(v(),S(Hn,{key:R.value.id,block:R.value},null,8,[`block`])):(v(),d(y,{key:1},[i[38]||=u(`p`,{class:`mb-4 text-xs text-muted-foreground`},`Klicken fügt den Block unter dem ausgewählten ein. Blöcke lassen sich auch an jede Stelle ziehen.`,-1),t(kt,{onPick:le})],64))])])]),u(`div`,Gr,[t(o(q),{variant:`outline`,class:`bg-card shadow-md`,disabled:P.value,onClick:i[12]||=e=>{L.value=`blocks`,I.value=!0}},{default:b(()=>[...i[39]||=[n(`Block hinzufügen`,-1)]]),_:1},8,[`disabled`]),R.value?(v(),S(o(q),{key:0,class:`shadow-md`,onClick:i[13]||=e=>{L.value=`block`,I.value=!0}},{default:b(()=>[...i[40]||=[n(`Einstellungen`,-1)]]),_:1})):T(``,!0)]),t(o(je),{open:I.value,"onUpdate:open":i[14]||=e=>I.value=e},{default:b(()=>[t(o(Me),{side:`right`,class:`w-[340px] overflow-y-auto p-4 sm:max-w-[340px]`},{default:b(()=>[t(o(Fe),{class:`p-0`},{default:b(()=>[t(o(Ie),null,{default:b(()=>[n(x(L.value===`block`?`Block`:`Blöcke`),1)]),_:1})]),_:1}),L.value===`block`&&R.value?(v(),S(Hn,{key:R.value.id,block:R.value},null,8,[`block`])):(v(),S(kt,{key:1,onPick:le}))]),_:1})]),_:1},8,[`open`]),t(er,{open:Z.publish,"onUpdate:open":i[15]||=e=>Z.publish=e,"scheduled-at":D.value.scheduled_at,onPublish:it},null,8,[`open`,`scheduled-at`]),t(xr,{open:Z.review,"onUpdate:open":i[16]||=e=>Z.review=e,onSubmit:at},null,8,[`open`]),t(mr,{open:Z.revisions,"onUpdate:open":i[17]||=e=>Z.revisions=e,base:a,"read-only":P.value,onRestored:st},null,8,[`open`,`read-only`]),t(yr,{open:Z.settings,"onUpdate:open":i[18]||=e=>Z.settings=e,page:D.value,base:a,onSaved:i[19]||=e=>D.value=e.page},null,8,[`open`,`page`]),t(Xe,{open:Z.newPage,"onUpdate:open":i[20]||=e=>Z.newPage=e,"parent-id":D.value.id,"parent-title":D.value.title,onBeforeCreate:G},null,8,[`open`,`parent-id`,`parent-title`])]),t(o(pe),{position:`bottom-left`})],64))}};export{Kr as default};