1import{z as f,J as h,r as s,j as e,a as b,L as g}from"./index-D5v3HSjQ.js";import{A as y}from"./AdminOutfitForm-1ZzrQcoJ.js";import{b as j,u as v}from"./outfitsClient-CbTqGp-A.js";import{u as N}from"./Toast-CMNMxlmA.js";import{A as w}from"./arrow-left-BT_7L442.js";import{E as S}from"./external-link-D_Lt3OAM.js";import"./ChromaCanvas-CQDTCTnz.js";import"./AuthContext-C60EG9N9.js";import"./palette-Ds6NyIXN.js";import"./check-DPDxokSL.js";import"./x-DNs9DRNX.js";import"./upload-BHI-a3nK.js";import"./sparkles-BAxkkJGM.js";import"./circle-alert-CH3PcJoa.js";const P=()=>{const{id:a}=f();h();const o=N(),[t,m]=s.useState(null),[x,l]=s.useState(!1),[c,n]=s.useState(null),[p,d]=s.useState(!1);s.useEffect(()=>{j(a).then(m).catch(r=>{n(r.message),o(r.message,"error")})},[a]);const u=async r=>{l(!0),n(null);try{const i=await v(a,r);m(i),d(!0),setTimeout(()=>d(!1),2500),o("Saved.","success")}catch(i){n(i.message),o(i.message,"error")}finally{l(!1)}};return e.jsx("div",{className:"max-w-3xl mx-auto px-6 py-12",children:e.jsxs(b.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.5},children:[e.jsxs(g,{to:"/outfits/manage",className:"inline-flex items-center gap-2 text-xs text-sophey-cream/40 hover:text-sophey-cream/70 mb-6 transition-colors",children:[e.jsx(w,{className:"w-3.5 h-3.5"})," Back to dashboard"]}),e.jsxs("div",{className:"flex items-end justify-between flex-wrap gap-4 mb-10",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("span",{className:"w-8 h-px bg-sophey-cream/30"}),e.jsxs("span",{className:"text-[10px] tracking-[0.3em] uppercase text-sophey-cream/40 font-medium",children:["Edit · #",a]})]}),e.jsx("h1",{className:"font-display font-bold text-sophey-cream tracking-[-0.04em] text-4xl",children:t?.name||"Loadingâ¦"})]}),t&&e.jsxs("a",{href:`/outfits/${t.model_slug}/${t.slug}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-sophey-cream/40 hover:text-sophey-cream/80 transition-colors border-b border-white/20 pb-1",children:["View live ",e.jsx(S,{className:"w-3 h-3"})]})]}),c&&e.jsx("div",{className:"mb-6 text-xs text-red-300/90 border border-red-400/30 bg-red-400/5 px-3 py-2",style:{borderRadius:"2px"},children:c}),p&&e.jsx("div",{className:"mb-6 text-xs text-green-300/90 border border-green-400/30 bg-green-400/5 px-3 py-2",style:{borderRadius:"2px"},children:"Saved."}),t?e.jsx(y,{initial:t,onSubmit:u,submitting:x,submitLabel:"Save changes"}):e.jsx("div",{className:"py-20 flex justify-center",children:e.jsx("div",{className:"w-6 h-6 border border-white/30 border-t-white/80 rounded-full animate-spin"})})]})})};export{P 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.