import{d as v,u as _,o as d,a as u,b as l,e as r,h as y,w as n,f as e,l as N,i as m,t as a,s as h,v as b,A as w,j as c,x as S,F as D,D as k}from"./app-D9-EssCM.js";import{p,_ as $}from"./AppLayout.vue_vue_type_script_setup_true_lang-C-UlPCqH.js";import{A}from"./arrow-left-CdAVEsab.js";import{T as V}from"./trash-2-Dis-KatR.js";import"./index-CcjNLu6f.js";import"./index-CMWG4mbA.js";import"./useForwardExpose-MNmriUeS.js";import"./VisuallyHidden-DG35s1YI.js";import"./RovingFocusGroup-Diffidi3.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./x-DwmBYYXD.js";import"./_plugin-vue_export-helper-DmjF0He4.js";const B={class:"p-4"},C={class:"mb-6 flex items-center justify-between"},T={class:"mx-auto max-w-4xl"},U={class:"mb-6"},j={class:"text-2xl font-bold text-gray-900"},F={class:"text-gray-600"},L={class:"space-y-6"},M={class:"rounded-lg border bg-white p-6"},P={class:"grid gap-6 md:grid-cols-2"},E={class:"mt-1 text-lg text-gray-900"},I={key:0,class:"mt-1 text-sm text-red-600"},R={class:"mt-1 text-lg text-gray-900"},q={class:"mt-1 text-lg text-gray-900"},z={class:"mt-1 text-lg text-gray-900"},G={key:0,class:"mt-1 text-sm text-red-600"},H={class:"flex items-center justify-end gap-4"},J=["disabled"],le=v({__name:"Show",props:{product:{},serialNumber:{}},setup(f){const s=f,o=_({batch_id:s.serialNumber.batch_id,status:s.serialNumber.status,notes:s.serialNumber.notes||""});function x(){o.put(`/products/${s.product.id}/serial-numbers/${s.serialNumber.id}`)}function g(){confirm("Are you sure you want to delete this serial number?")&&k.delete(`/products/${s.product.id}/serial-numbers/${s.serialNumber.id}`)}return(K,t)=>(d(),u(D,null,[l(r(y),{title:`Serial Number ${s.serialNumber.serial_number} - ${s.product.name}`},null,8,["title"]),l($,{breadcrumbs:[{title:"Products",href:r(p).index().url},{title:s.product.name,href:r(p).show(s.product.id).url},{title:"Serial Numbers",href:`/products/${s.product.id}/serial-numbers`},{title:s.serialNumber.serial_number,href:"#"}]},{default:n(()=>[e("div",B,[e("div",C,[l(r(N),{href:`/products/${s.product.id}/serial-numbers`,class:"flex items-center gap-2 text-gray-600 hover:text-gray-900"},{default:n(()=>[l(r(A),{class:"h-4 w-4"}),t[2]||(t[2]=m(" Back to Serial Numbers ",-1))]),_:1},8,["href"]),e("button",{onClick:g,class:"flex items-center gap-2 rounded-md border border-red-300 px-4 py-2 text-red-700 hover:bg-red-50"},[l(r(V),{class:"h-4 w-4"}),t[3]||(t[3]=m(" Delete ",-1))])]),e("div",T,[e("div",U,[e("h1",j,"Serial Number: "+a(s.serialNumber.serial_number),1),e("p",F,"Product: "+a(s.product.name),1)]),e("div",L,[e("div",M,[t[11]||(t[11]=e("h2",{class:"mb-4 text-lg font-semibold text-gray-900"},"Serial Number Information",-1)),e("form",{onSubmit:h(x,["prevent"]),class:"space-y-6"},[e("div",P,[e("div",null,[t[4]||(t[4]=e("div",{class:"text-sm font-medium text-gray-500"},"Serial Number",-1)),e("div",E,a(s.serialNumber.serial_number),1)]),e("div",null,[t[6]||(t[6]=e("label",{class:"block text-sm font-medium text-gray-700"}," Status * ",-1)),b(e("select",{"onUpdate:modelValue":t[0]||(t[0]=i=>r(o).status=i),class:"mt-1 w-full rounded-md border border-gray-300 px-3 py-2 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500"},[...t[5]||(t[5]=[e("option",{value:"available"},"Available",-1),e("option",{value:"sold"},"Sold",-1),e("option",{value:"returned"},"Returned",-1),e("option",{value:"damaged"},"Damaged",-1),e("option",{value:"scrapped"},"Scrapped",-1)])],512),[[w,r(o).status]]),r(o).errors.status?(d(),u("div",I,a(r(o).errors.status),1)):c("",!0)]),e("div",null,[t[7]||(t[7]=e("div",{class:"text-sm font-medium text-gray-500"},"Batch",-1)),e("div",R,a(s.serialNumber.batch?s.serialNumber.batch.batch_number:"N/A"),1)]),e("div",null,[t[8]||(t[8]=e("div",{class:"text-sm font-medium text-gray-500"},"Purchase Date",-1)),e("div",q,a(s.serialNumber.purchase_date?new Date(s.serialNumber.purchase_date).toLocaleDateString():"N/A"),1)]),e("div",null,[t[9]||(t[9]=e("div",{class:"text-sm font-medium text-gray-500"},"Sale Date",-1)),e("div",z,a(s.serialNumber.sale_date?new Date(s.serialNumber.sale_date).toLocaleDateString():"N/A"),1)])]),e("div",null,[t[10]||(t[10]=e("label",{class:"block text-sm font-medium text-gray-700"}," Notes ",-1)),b(e("textarea",{"onUpdate:modelValue":t[1]||(t[1]=i=>r(o).notes=i),rows:"3",class:"mt-1 w-full rounded-md border border-gray-300 px-3 py-2 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500"},null,512),[[S,r(o).notes]]),r(o).errors.notes?(d(),u("div",G,a(r(o).errors.notes),1)):c("",!0)]),e("div",H,[e("button",{type:"submit",disabled:r(o).processing,class:"rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 disabled:opacity-50"},a(r(o).processing?"Updating...":"Update Serial Number"),9,J)])],32)])])])])]),_:1},8,["breadcrumbs"])],64))}});export{le as default};
