1import{c as y,G as O,C as g,q as v,r as h,H as j,j as r,E as q,J as S,t as d}from"./index-CaB-1DxL.js";import{u as E,a as C}from"./opta-BcPFIXvR.js";import{u as D}from"./useSuspenseQuery-DnK3Q64E.js";import"./button-Bj7ZlM7T.js";import"./dialog-Dd-wgPsE.js";import"./index-CMkR5q5E.js";import"./clientType-BFFO5hr5.js";import"./InputField-F2uiwEdU.js";import"./input-C3fLVWIe.js";import"./Selector-D7m033Bh.js";import"./index-Cjj9pcYp.js";import"./checkbox-C8BtsovL.js";import"./check-DAniezIU.js";import"./dateTime-56aPNTNI.js";import"./chevron-right-oZ7D00Kj.js";import"./label-tG50GmXZ.js";import"./textarea-QUcKRX2M.js";const F=v({queryKey:["optas","new"],queryFn:()=>j(void 0),staleTime:3e5});function z(){const t=y.c(10),i=O.useNavigate(),p=g(),{data:n}=D(F),[x,f]=h.useState(!1),[m,c]=E();if(x){let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(q,{}),t[0]=e):e=t[0],e}let o;t[1]!==i||t[2]!==p?(o=async e=>{f(!0);const u=await S(e);u.ok?(p.removeQueries({queryKey:["optas"]}),d.success("Opta creada satisfactoriamente"),i({to:"/optas/$optaId",params:{optaId:u.data}})):d.error(u.msg||"ha ocurrido un error desconocido al crear la opta"),f(!1)},t[1]=i,t[2]=p,t[3]=o):o=t[3];const l=o;let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("h1",{className:"text-xl font-bold",children:"Nueva OPTA"}),t[4]=a):a=t[4];let s;return t[5]!==n||t[6]!==m||t[7]!==l||t[8]!==c?(s=r.jsxs("div",{className:"flex flex-col gap-4 ps-4",children:[a,r.jsx(C,{isEdit:!1,optaDto:m,setOptaDto:c,saveOpta:l,formData:n})]}),t[5]=n,t[6]=m,t[7]=l,t[8]=c,t[9]=s):s=t[9],s}export{z as component};
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.