1import{f as j,r as a,j as e,X as N,c as y,bG as C,b as S}from"./index-CtR2Cm7C.js";import{U as k}from"./upload-Dy_G_Nx3.js";function E({open:x,onClose:i,user:s}){const m=j(),[l,p]=a.useState(null),[n,b]=a.useState(""),[r,f]=a.useState(""),[c,g]=a.useState(""),[u,d]=a.useState(!1),[h,o]=a.useState("");if(!x)return null;const w=async()=>{if(!l||!s){o("Selecciona un video e inicia sesión.");return}d(!0),o("");try{const t=await C(l,{silent:!0});if(!t)throw new Error("No se pudo subir el video.");await S.entities.ProfilePost.create({author_email:s.email,author_name:s.full_name||s.nickname||"Usuario",author_avatar:s.avatar_url||"",type:"post",content:n||"Reel",video_url:t,privacy:"public",publish_status:"published",hashtags:c.split(/\s+/).map(v=>v.replace(/^#/,"")).filter(Boolean),poll:r?{music:r}:{}}),await m.invalidateQueries({queryKey:["exclusive-reels"]}),i()}catch(t){o(t.message||"No se pudo publicar.")}finally{d(!1)}};return e.jsx("div",{className:"fixed inset-0 z-[9995] bg-black/75 p-4",onClick:i,children:e.jsxs("div",{className:"mx-auto mt-[8vh] max-w-lg rounded-2xl border border-white/10 bg-[#111519] p-5",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-bold text-white",children:"Nuevo Reel"}),e.jsx("button",{"aria-label":"Cerrar",onClick:i,className:"text-white",children:e.jsx(N,{})})]}),e.jsxs("label",{className:"flex min-h-28 cursor-pointer flex-col items-center justify-center rounded-xl border border-dashed border-white/20 text-sm text-white/60",children:[e.jsx(k,{className:"mb-2"}),l?.name||"Seleccionar video",e.jsx("input",{type:"file",accept:"video/*",className:"hidden",onChange:t=>p(t.target.files?.[0]||null)})]}),e.jsx("textarea",{value:n,onChange:t=>b(t.target.value),placeholder:"Descripción",className:"mt-3 min-h-20 w-full rounded-xl border border-white/10 bg-white/[0.06] p-3 text-white"}),e.jsx("input",{value:r,onChange:t=>f(t.target.value),placeholder:"Música (opcional)",className:"mt-3 h-11 w-full rounded-xl border border-white/10 bg-white/[0.06] px-3 text-white"}),e.jsx("input",{value:c,onChange:t=>g(t.target.value),placeholder:"#gaming #highlight",className:"mt-3 h-11 w-full rounded-xl border border-white/10 bg-white/[0.06] px-3 text-white"}),h&&e.jsx("p",{className:"mt-2 text-xs text-red-400",children:h}),e.jsx("button",{disabled:u,onClick:w,className:"mt-4 flex h-11 w-full items-center justify-center rounded-xl bg-white font-bold text-black disabled:opacity-50",children:u?e.jsx(y,{className:"animate-spin"}):"Publicar Reel"})]})})}export{E as default};
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.