import{Kt as e,M as t,Q as n,R as r,Tn as i,Y as a,at as o,i as s,it as c,o as l,or as u,r as d,st as f}from"./dist-CoD0k1Bd.js";import{t as p}from"./Label-DKn3cyeE.js";import{t as m}from"./arrow-left-GfHRP_1N.js";import{t as h}from"./Input-C3DwKNOf.js";import{t as g}from"./button-mN_poAXs.js";import{t as _}from"./routes-BZ4t1sNs.js";import{t as v}from"./Heading-CCd5Tysh.js";import{t as y}from"./InputError-BY5lDrFd.js";var b={class:`flex flex-col space-y-6`},x={class:`grid gap-2`},S={class:`grid gap-2`},C={class:`grid gap-2`},w={class:`flex justify-end gap-2`},T=f({layout:{breadcrumbs:[{title:`Dashboard`,href:_()},{title:`Ads Placement`,href:`/placements`},{title:`Edit`,href:`/placements`}]},__name:`Edit`,props:{placement:{}},setup(f){let _=f,T=l({kode:_.placement.kode,keterangan:_.placement.keterangan??``,url:_.placement.url??``}),E=()=>T.put(`/placements/${_.placement.id}`);return(l,f)=>(e(),n(r,null,[o(u(d),{title:`Edit Placement`}),a(`div`,b,[a(`div`,null,[o(u(g),{"as-child":``,variant:`ghost`,size:`sm`,class:`mb-2`},{default:i(()=>[o(u(s),{href:`/placements`},{default:i(()=>[o(u(m),{class:`size-4`}),f[3]||=c(` Kembali`,-1)]),_:1})]),_:1}),o(v,{title:`Edit: ${_.placement.kode}`,description:`Ubah sumber lalu lintas`},null,8,[`title`])]),a(`form`,{onSubmit:t(E,[`prevent`]),class:`max-w-2xl space-y-6`},[a(`div`,x,[o(u(p),{for:`kode`},{default:i(()=>[...f[4]||=[c(`Kode `,-1),a(`span`,{class:`text-destructive`},`*`,-1)]]),_:1}),o(u(h),{id:`kode`,modelValue:u(T).kode,"onUpdate:modelValue":f[0]||=e=>u(T).kode=e,required:``},null,8,[`modelValue`]),o(y,{message:u(T).errors.kode},null,8,[`message`])]),a(`div`,S,[o(u(p),{for:`keterangan`},{default:i(()=>[...f[5]||=[c(`Keterangan`,-1)]]),_:1}),o(u(h),{id:`keterangan`,modelValue:u(T).keterangan,"onUpdate:modelValue":f[1]||=e=>u(T).keterangan=e},null,8,[`modelValue`]),o(y,{message:u(T).errors.keterangan},null,8,[`message`])]),a(`div`,C,[o(u(p),{for:`url`},{default:i(()=>[...f[6]||=[c(`URL`,-1)]]),_:1}),o(u(h),{id:`url`,modelValue:u(T).url,"onUpdate:modelValue":f[2]||=e=>u(T).url=e,placeholder:`https://`},null,8,[`modelValue`]),o(y,{message:u(T).errors.url},null,8,[`message`])]),a(`div`,w,[o(u(g),{"as-child":``,variant:`outline`,type:`button`},{default:i(()=>[o(u(s),{href:`/placements`},{default:i(()=>[...f[7]||=[c(`Batal`,-1)]]),_:1})]),_:1}),o(u(g),{type:`submit`,disabled:u(T).processing},{default:i(()=>[...f[8]||=[c(`Simpan`,-1)]]),_:1},8,[`disabled`])])],32)])],64))}});export{T as default};