import{u as p,a as l,b as o,d as s,h as y,e as i,f as t,g as f,t as d,q as g,s as h,o as n,p as x,F as k}from"./app-DtilF0jd.js";import{A as v}from"./AdminLayout-cPq_IGY4.js";import{_}from"./TiptapEditor-CffFrO6S.js";import"./MobileNavigationDrawer-BV2kxNFx.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./DarkModeToggle-wIsj_tj1.js";import"./ImpersonationBanner-BXRKEhdr.js";const w={class:"flex justify-between items-center"},S={class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},V={class:"py-6"},C={class:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8"},E={class:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 p-6"},j={class:"flex items-center justify-between mb-4"},B={class:"text-lg font-semibold text-gray-900 dark:text-white"},N={class:"text-sm font-mono text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 px-3 py-1 rounded-lg"},F={class:"text-sm text-gray-500 dark:text-gray-400"},L=["href"],M={class:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 p-6"},U={key:0,class:"mt-2 text-sm text-red-600"},$={class:"flex justify-end gap-4"},A=["disabled"],G={key:0},P={key:1},J={__name:"EditStatic",props:{slug:String,title:String,content:String},setup(a){const m=a,r=p({content:m.content}),b=()=>{r.put(route("admin.static-pages.update",m.slug))};return(u,e)=>(n(),l(k,null,[o(s(y),{title:`Editar: ${a.title}`},null,8,["title"]),o(v,null,{header:i(()=>[t("div",w,[t("div",null,[e[1]||(e[1]=t("h2",{class:"text-xl font-bold text-gray-900 dark:text-white"}," Editar Página del Sistema ",-1)),t("p",S,d(a.title),1)]),o(s(x),{href:u.route("admin.pages.index"),class:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"},{default:i(()=>[...e[2]||(e[2]=[g(" ← Volver ",-1)])]),_:1},8,["href"])])]),default:i(()=>[t("div",V,[t("div",C,[t("form",{onSubmit:f(b,["prevent"]),class:"space-y-6"},[e[6]||(e[6]=t("div",{class:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-xl p-4"},[t("div",{class:"flex items-start gap-3"},[t("svg",{class:"w-5 h-5 text-blue-600 dark:text-blue-400 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),t("div",null,[t("p",{class:"text-sm text-blue-800 dark:text-blue-200 font-medium"},"Página del Sistema"),t("p",{class:"text-sm text-blue-700 dark:text-blue-300"},"Esta es una página esencial del sistema. Solo puedes modificar su contenido, no eliminarla ni cambiar su URL.")])])],-1)),t("div",E,[t("div",j,[t("h3",B,d(a.title),1),t("span",N," /"+d(a.slug),1)]),t("p",F,[e[3]||(e[3]=g(" URL pública: ",-1)),t("a",{href:`/${a.slug}`,target:"_blank",class:"text-blue-600 hover:underline"},"/"+d(a.slug),9,L)])]),t("div",M,[e[4]||(e[4]=t("h3",{class:"text-lg font-semibold text-gray-900 dark:text-white mb-4"},"Contenido",-1)),o(_,{modelValue:s(r).content,"onUpdate:modelValue":e[0]||(e[0]=c=>s(r).content=c),placeholder:"Escribe el contenido de la página...","upload-url":u.route("admin.posts.upload-image")},null,8,["modelValue","upload-url"]),s(r).errors.content?(n(),l("p",U,d(s(r).errors.content),1)):h("",!0)]),t("div",$,[o(s(x),{href:u.route("admin.pages.index"),class:"px-6 py-3 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg font-medium hover:bg-gray-200 dark:hover:bg-gray-600 transition"},{default:i(()=>[...e[5]||(e[5]=[g(" Cancelar ",-1)])]),_:1},8,["href"]),t("button",{type:"submit",disabled:s(r).processing,class:"px-6 py-3 bg-blue-600 text-white rounded-lg font-medium hover:bg-blue-700 transition disabled:opacity-50"},[s(r).processing?(n(),l("span",G,"Guardando...")):(n(),l("span",P,"Guardar Cambios"))],8,A)])],32)])])]),_:1})],64))}};export{J as default};
