PageSourceSearch

https://craibas.al.gov.br/build/assets/Form-BCZWfCUd.js

js craibas.al.gov.br collected 2026-10-02 23:55:04 UTC 6,836 bytes, 1 lines download raw bytes

1import{c as oe,a as ce,j as a}from"./app-CTaY8UJf.js";import{T as de}from"./tiptap-editor-Btoe9qvv.js";import{B as ae}from"./button-DXCKLHtj.js";import{C as se,a as ie,b as le,c as re}from"./card-UxP9oPxk.js";import{I as ne}from"./input-7aHhCeCr.js";import{L as K}from"./label-CxCrcTSv.js";import me from"./file-text-jraIksbC.js";import xe from"./x-DmP7A1Bz.js";import fe from"./upload-C5_Iw0PV.js";import"./app-CNmQMdEi.js";import"./index-CZjtIso7.js";import"./unlink-D7dkgNo-.js";import"./createLucideIcon-CmjF8lT1.js";import"./list-Dehc_B-t.js";import"./list-ordered-BA4QZELo.js";import"./link-D5YEb8HE.js";import"./index-fQ3brVpV.js";function $e(M){const e=oe.c(85),{item:s,abas:D,isEdit:te}=M;let F;e[0]!==D?(F=D===void 0?[]:D,e[0]=D,e[1]=F):F=e[1];const A=F,o=te===void 0?!1:te;let T;e[2]!==s?(T=s?.abas?s.abas.map(he):[],e[2]=s,e[3]=T):T=e[3];const O=T,P=s?.descricao??"";let c;e[4]!==s?(c=s?.data?String(s.data).slice(0,10):"",e[4]=s,e[5]=c):c=e[5];const Q=o?"put":"post";let $;e[6]!==O||e[7]!==P||e[8]!==c||e[9]!==Q?($={aba_ids:O,descricao:P,data:c,anexo:null,_method:Q},e[6]=O,e[7]=P,e[8]=c,e[9]=Q,e[10]=$):$=e[10];const{data:t,setData:i,post:W,processing:z,errors:l}=ce($);let B;e[11]!==t.aba_ids||e[12]!==i?(B=r=>{t.aba_ids.includes(r)?i("aba_ids",t.aba_ids.filter(k=>k!==r)):i("aba_ids",[...t.aba_ids,r])},e[11]=t.aba_ids,e[12]=i,e[13]=B):B=e[13];const Y=B;let L;e[14]!==o||e[15]!==s||e[16]!==W?(L=r=>{r.preventDefault();const k=o&&s?.id?`/portal/admin/educacao/${s.id}`:"/portal/admin/educacao";W(k,{forceFormData:!0})},e[14]=o,e[15]=s,e[16]=W,e[17]=L):L=e[17];const Z=L;let R;e[18]===Symbol.for("react.memo_cache_sentinel")?(R=a.jsx(se,{children:a.jsx(ie,{children:"Dados de Educação"})}),e[18]=R):R=e[18];let V;e[19]===Symbol.for("react.memo_cache_sentinel")?(V=a.jsx(K,{children:"Abas da Educação (pode marcar mais de uma)"}),e[19]=V):V=e[19];let d;e[20]!==A||e[21]!==t.aba_ids||e[22]!==Y?(d=A.length===0?a.jsx("p",{className:"text-xs text-gray-500 italic",children:"Nenhuma aba cadastrada ainda. Você pode cadastrar abas na tela principal de educação."}):a.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:A.map(r=>{const k=t.aba_ids.includes(r.id);return a.jsxs("button",{type:"button",onClick:()=>Y(r.id),className:`inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium transition-colors border ${k?"border-primary bg-primary text-white shadow-sm":"border-gray-300 bg-white text-gray-700 hover:bg-gray-50"}`,children:[a.jsx("span",{className:`h-2 w-2 rounded-full ${k?"bg-white":"bg-gray-300"}`}),r.name]},r.id)})}),e[20]=A,e[21]=t.aba_ids,e[22]=Y,e[23]=d):d=e[23];let n;e[24]!==l.aba_ids?(n=l.aba_ids&&a.jsx("p",{className:"text-sm text-red-600",children:l.aba_ids}),e[24]=l.aba_ids,e[25]=n):n=e[25];let m;e[26]!==d||e[27]!==n?(m=a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[V,d,n]}),e[26]=d,e[27]=n,e[28]=m):m=e[28];let q;e[29]===Symbol.for("react.memo_cache_sentinel")?(q=a.jsx(K,{htmlFor:"data",children:"Data *"}),e[29]=q):q=e[29];let x;e[30]!==i?(x=r=>i("data",r.target.value),e[30]=i,e[31]=x):x=e[31];let f;e[32]!==t.data||e[33]!==x?(f=a.jsx(ne,{id:"data",type:"date",value:t.data,onChange:x}),e[32]=t.data,e[33]=x,e[34]=f):f=e[34];let p;e[35]!==l.data?(p=l.data&&a.jsx("p",{className:"text-sm text-red-600",children:l.data}),e[35]=l.data,e[36]=p):p=e[36];let h;e[37]!==f||e[38]!==p?(h=a.jsxs("div",{className:"space-y-2",children:[q,f,p]}),e[37]=f,e[38]=p,e[39]=h):h=e[39];let H;e[40]===Symbol.for("react.memo_cache_sentinel")?(H=a.jsx(K,{htmlFor:"descricao",children:"Descrição *"}),e[40]=H):H=e[40];let u;e[41]!==i?(u=r=>i("descricao",r),e[41]=i,e[42]=u):u=e[42];let b;e[43]!==t.descricao||e[44]!==u?(b=a.jsx(de,{value:t.descricao,onChange:u,placeholder:"Digite a descrição..."}),e[43]=t.descricao,e[44]=u,e[45]=b):b=e[45];let j;e[46]!==l.descricao?(j=l.descricao&&a.jsx("p",{className:"text-sm text-red-600",children:l.descricao}),e[46]=l.descricao,e[47]=j):j=e[47];let g;e[48]!==b||e[49]!==j?(g=a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[H,b,j]}),e[48]=b,e[49]=j,e[50]=g):g=e[50];let _;e[51]!==m||e[52]!==h||e[53]!==g?(_=a.jsxs(le,{children:[R,a.jsxs(re,{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[m,h,g]})]}),e[51]=m,e[52]=h,e[53]=g,e[54]=_):_=e[54];let I;e[55]===Symbol.for("react.memo_cache_sentinel")?(I=a.jsx(se,{children:a.jsx(ie,{children:"Anexo"})}),e[55]=I):I=e[55];let U;e[56]===Symbol.for("react.memo_cache_sentinel")?(U=a.jsx(K,{htmlFor:"anexo",children:"Arquivo"}),e[56]=U):U=e[56];let X;e[57]===Symbol.for("react.memo_cache_sentinel")?(X=a.jsx(fe,{className:"h-4 w-4 text-gray-500 shrink-0"}),e[57]=X):X=e[57];let y;e[58]!==i?(y=a.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-md border border-dashed p-3",children:[X,a.jsx("input",{id:"anexo",type:"file",className:"block w-full text-sm file:mr-3 file:rounded-md file:border-0 file:bg-primary file:px-3 file:py-1.5 file:text-primary-foreground file:text-sm cursor-pointer",onChange:r=>i("anexo",r.target.files?.[0]??null)})]}),e[58]=i,e[59]=y):y=e[59];let N;
1e[60]!==l.anexo?(N=l.anexo&&a.jsx("p",{className:"text-sm text-red-600",children:l.anexo}),e[60]=l.anexo,e[61]=N):N=e[61];let v;e[62]!==t.anexo||e[63]!==o||e[64]!==s?(v=o&&s?.anexo_url&&!t.anexo&&a.jsxs("a",{href:s.anexo_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 hover:underline",children:[a.jsx(me,{className:"h-4 w-4"}),"Visualizar anexo atual"]}),e[62]=t.anexo,e[63]=o,e[64]=s,e[65]=v):v=e[65];let w;e[66]!==t.anexo||e[67]!==i?(w=t.anexo&&a.jsxs("div",{className:"flex items-center justify-between rounded-md bg-muted px-3 py-2 text-sm",children:[a.jsx("span",{className:"truncate",children:t.anexo.name}),a.jsx(ae,{type:"button",variant:"ghost",size:"icon",onClick:()=>i("anexo",null),children:a.jsx(xe,{className:"h-4 w-4"})})]}),e[66]=t.anexo,e[67]=i,e[68]=w):w=e[68];let C;e[69]!==y||e[70]!==N||e[71]!==v||e[72]!==w?(C=a.jsxs(le,{children:[I,a.jsx(re,{className:"space-y-4",children:a.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[U,y,N,v,w]})})]}),e[69]=y,e[70]=N,e[71]=v,e[72]=w,e[73]=C):C=e[73];const ee=z?"Salvando...":o?"Atualizar":"Cadastrar";let S;e[74]!==z||e[75]!==ee?(S=a.jsx(ae,{type:"submit",disabled:z,children:ee}),e[74]=z,e[75]=ee,e[76]=S):S=e[76];let G;e[77]===Symbol.for("react.memo_cache_sentinel")?(G=a.jsx(ae,{type:"button",variant:"outline",onClick:pe,children:"Cancelar"}),e[77]=G):G=e[77];let E;e[78]!==S?(E=a.jsxs("div",{className:"flex flex-wrap gap-3",children:[S,G]}),e[78]=S,e[79]=E):E=e[79];let J;return e[80]!==Z||e[81]!==_||e[82]!==C||e[83]!==E?(J=a.jsxs("form",{onSubmit:Z,className:"space-y-6",children:[_,C,E]}),e[80]=Z,e[81]=_,e[82]=C,e[83]=E,e[84]=J):J=e[84],J}function pe(){return window.history.back()}function he(M){return M.id}export{$e 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.