1import{r as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t}from"./framework-D4A2xw-l.js";import{Tt as n}from"./vinext-B-jYuJLu.js";import{n as r}from"./NotificationContext-DWwkIgcf.js";import{n as i}from"./Context-BRbRpgBz.js";import{i as a,t as o}from"./Form-C0JTHOy4.js";import{t as s}from"./zodForm-BCP_i0UQ.js";import{h as c,u as l,y as u}from"./schemas-DyN1zccT.js";import{n as d,r as f}from"./actions-C3PVeJhC.js";var p=e({CustomerProjectForm:()=>h}),m=t();function h(e){let{lang:t,children:p,projects:h,label:g,nameForm:_,projectForm:v,innerMessages:y,variant:b,data:x,workpiece:S}=e,C=s({schema:c({name:u().optional(),projectId:u().optional(),newProject:l(`1`).or(l(`0`))}),defaultValues:{newProject:`1`}}),{watch:w}=C,T=w(`newProject`),E=n(),D=i(),{notify:O}=r();return(0,m.jsxs)(o,{className:`flex flex-col gap-4`,form:C,onSubmit:async e=>{D?.setForceOpen(!0);try{let n=!e.projectId||e.projectId===`newProject`?`/customer/projects`:`/customer/projects/${e.projectId}`;b===`item`?await f(t,x,S,e.name??``,e.projectId===`newProject`?void 0:e.projectId):e.projectId?await d({lang:t,projectId:e.projectId}):await d({lang:t,name:e.name});let r=!e.projectId||e.projectId===`newProject`?e.name:h.find(t=>t.id===e.projectId)?.name;O({variant:`success`,title:`${y.addedToProject}: ${r}`,subtitle:y.viewProject,action:{altText:y.viewProject,onClick:()=>void E.push(n)}}),D?.onOpenChange?D?.onOpenChange(!1):E.push(n)}catch(e){O({variant:`danger`,title:y.addToProjectError,subtitle:e instanceof Error?e.message:void 0})}D?.setForceOpen(!1)},children:[p,T===`1`?_:v,(0,m.jsx)(a,{className:`sm:self-start`,children:g})]})}export{h as n,p as t}; 2//# sourceMappingURL=CreateCustomerProjectForm-BXJff8kh.js.map
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.