1import{q as oe,r as j,v as ce,j as e,a as J,$ as _e,Y as Ce}from"./app-Dpdn6RkY.js";import{X as G,F as ie,M as we}from"./main-layout-DueMfrwV.js";import{L as f,I}from"./label-BLUGSRnM.js";import{B as C}from"./button-CdzymYL_.js";import{S as R,a as B,b as D,c as $,d as O,I as te}from"./image-crop-uploader-DP9TfJAv.js";import{L as Q}from"./loader-circle-FqlKruuY.js";import{C as de,a as ke}from"./card-DyWPJXiX.js";import{B as Fe}from"./badge-DIC5sZhc.js";import{T as le}from"./textarea-XCefJWrP.js";import{c as L,a as K}from"./primary-button-Cc1Q7518.js";import{U as Se}from"./upload-DXYswTsi.js";import{I as me}from"./info-wkikHFL7.js";import{C as Z}from"./checkbox-DkGha2cv.js";import{D as Pe,a as Me,c as Ee,b as Ie,d as Ae,e as qe}from"./dialog-BI5X5edU.js";import{C as H}from"./circle-alert-CZYoLW9F.js";import{G as Ve}from"./glowing-effect-BrIIxLTv.js";import{A as ze,a as Te}from"./alert-Ckpb_4QK.js";import{C as Re}from"./check-B7CsewCy.js";/* empty css */import"./index-H3WrPmOw.js";import"./index-Dr1PzIeU.js";import"./single-value-DUybrRiC.js";/** 2 * @license lucide-react v0.475.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Be=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],De=L("File",Be);/** 7 * @license lucide-react v0.475.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const $e=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],Oe=L("ImagePlus",$e);/** 12 * @license lucide-react v0.475.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const Le=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Ue=L("Pen",Le);/** 17 * @license lucide-react v0.475.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */const He=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xe=L("Plus",He);/** 22 * @license lucide-react v0.475.0 - ISC 23 * 24 * This source code is licensed under the ISC license. 25 * See the LICENSE file in the root directory of this source tree. 26 */const Ge=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],ue=L("Trash2",Ge);/** 27 * @license lucide-react v0.475.0 - ISC 28 * 29 * This source code is licensed under the ISC license. 30 * See the LICENSE file in the root directory of this source tree. 31 */const Je=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],Xe=L("Video",Je);function We({onNext:l,enums:s,initialData:t}){var S;const{auth:x}=oe().props,[d,a]=j.useState(!1),[u,v]=j.useState(!1),[_,w]=j.useState(!1),[o,M]=j.useState({}),{data:y,setData:c}=ce({id:(t==null?void 0:t.id)||null,responsible_name:(t==null?void 0:t.responsible_name)||"",responsible_email:(t==null?void 0:t.responsible_email)||((S=x.user)==null?void 0:S.email)||"",responsible_phone:(t==null?void 0:t.responsible_phone)||"",responsible_mobile:(t==null?void 0:t.responsible_mobile)||"",responsible_type:(t==null?void 0:t.responsible_type)||"",responsible_position:(t==null?void 0:t.responsible_position)||""}),n=async()=>{var m;const p=y.responsible_email||((m=x.user)==null?void 0:m.email);if(p){a(!0);try{const i=await J.post(route("candidaturas.check-user"),{email:p});if(x.user||v(i.data.exists),i.data.previous_application&&!(t!=null&&t.id)){const k=i.data.previous_application;c(A=>({...A,responsible_name:A.responsible_name||k.responsible_name||"",responsible_phone:A.responsible_phone||k.responsible_phone||"",responsible_mobile:A.responsible_mobile||k.responsible_mobile||"",responsible_type:A.responsible_type||k.responsible_type||"",responsible_position:A.responsible_position||k.responsible_position||""}))}}catch(i){console.error(i)}finally{a(!1)}}};j.useEffect(()=>{var p;!(t!=null&&t.id)&&(y.responsible_email||(p=x.user)!=null&&p.email)&&n()},[]);const E=async p=>{p.preventDefault(),w(!0),M({});try{const m=await J.post(route("candidaturas.step1"),y);l(m.data)}catch(m){m.response&&m.response.status===422?M(m.response.data.errors):alert("Ocorreu um erro. Tente novamente.")}finally{w(!1)}};return e.jsxs("form",{onSubmit:E,className:"space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-xl font-semibold",children:"1. Dados do Responsável"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Preencha os dad
31os do responsável pela candidatura."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"responsible_name",children:"Nome *"}),e.jsx(I,{id:"responsible_name",value:y.responsible_name,onChange:p=>c("responsible_name",p.target.value),required:!0}),o.responsible_name&&e.jsx("p",{className:"text-sm text-destructive",children:o.responsible_name})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"responsible_email",children:"Email *"}),e.jsx(I,{id:"responsible_email",type:"email",value:y.responsible_email,onChange:p=>c("responsible_email",p.target.value),onBlur:n,required:!0,disabled:!!x.user}),d&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"A verificar..."}),u&&!x.user&&e.jsx("p",{className:"text-sm text-yellow-600",children:"Este email já existe. Será pedido o login."}),o.responsible_email&&e.jsx("p",{className:"text-sm text-destructive",children:o.responsible_email})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"responsible_position",children:"Cargo (Opcional)"}),e.jsx(I,{id:"responsible_position",value:y.responsible_position,onChange:p=>c("responsible_position",p.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"responsible_phone",children:"Telefone"}),e.jsx(I,{id:"responsible_phone",value:y.responsible_phone,onChange:p=>c("responsible_phone",p.target.value)}),o.responsible_phone&&e.jsx("p",{className:"text-sm text-destructive",children:o.responsible_phone})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"responsible_mobile",children:"Telemóvel"}),e.jsx(I,{id:"responsible_mobile",value:y.responsible_mobile,onChange:p=>c("responsible_mobile",p.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"responsible_type",children:"Tipo de Entidade *"}),e.jsxs(R,{value:y.responsible_type,onValueChange:p=>c("responsible_type",p),children:[e.jsx(B,{children:e.jsx(D,{placeholder:"Selecione o tipo"})}),e.jsx($,{children:s.responsibleTypes.map(p=>e.jsx(O,{value:p.value,children:p.label},p.value))})]}),o.responsible_type&&e.jsx("p",{className:"text-sm text-destructive",children:o.responsible_type})]})]}),e.jsx("div",{className:"flex justify-end pt-6 border-t",children:e.jsxs(C,{type:"submit",disabled:_,className:"bg-[#D4AF37] text-white hover:bg-[#b5952f] h-12 px-8 text-base",children:[_&&e.jsx(Q,{className:"mr-2 h-4 w-4 animate-spin"}),"Seguinte"]})})]})}function Ye({checked:l,onCheckedChange:s,className:t,id:x,disabled:d,...a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":l,disabled:d,onClick:()=>!d&&(s==null?void 0:s(!l)),className:K("relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent","transition-colors duration-200 ease-in-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",l?"bg-[#D4AF37]":"bg-input",t),...x?{id:x}:{},children:e.jsx("span",{className:K("pointer-events-none inline-block h-5 w-5 rounded-full bg-background shadow-lg ring-0","transition-transform duration-200 ease-in-out",l?"translate-x-5":"translate-x-0")})})}function Ze({id:l,label:s,accept:t,onChange:x,error:d,value:a}){const u=j.useRef(null),[v,_]=j.useState(!1),w=c=>{c.preventDefault(),c.stopPropagation(),c.type==="dragenter"||c.type==="dragover"?_(!0):c.type==="dragleave"&&_(!1)},o=c=>{c.preventDefault(),c.stopPropagation(),_(!1),c.dataTransfer.files&&c.dataTransfer.files[0]&&x(c.dataTransfer.files[0])},M=c=>{c.target.files&&c.target.files[0]&&x(c.target.files[0])},y=()=>{x(null),u.current&&(u.current.value="")};return e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:l,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:s}),a?e.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg bg-background",children:[e.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[e.jsx("div",{className:"h-10 w-10 bg-muted rounded flex items-center justify-center flex-shrink-0",children:a.type.startsWith("image/")?e.jsx("img",{src:URL.createObjectURL(a),alt:"Preview",className:"h-full w-full object-cover rounded"}):e.jsx(De,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:a.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[(a.size/1024/1024).toFixed(2)," MB"]})]})]}),e.jsx(C,{type:"button",variant:"ghost",size:"icon",onClick:y,className:"text-muted-foreground hover:text-destructive",children:e.jsx(G,{className:"h-4 w-4"})})]}):e.jsxs("div",{className:K("relative flex flex-col items-center justify-center w-full h-32 rounded-lg border-2 border-dashed border-input transition-colors cursor-pointer hover:bg-accent/50",v&&"border-primary bg-accent",d&&"border-destructive/50 bg-destructive/5"),onDragEnter:w,onDragLeave:w,onDragOver:w,onDrop:o,onClick:()=>{var c;return(c=u.current)==null?void 0:c.click()},children:[e.jsx("input",{ref:u,id:l,type:"file",accept:t,className:"hidden",onChange:M}),e.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[e.jsx(Se,{className:"w-8 h-8 text-muted-foreground mb-2"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("span",{className:"font-semibold",children:"Clique para carregar"})," ou arraste"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t.includes("image")?"PNG, JPG (Máx. 5MB)":"MP4 (Máx. 500MB)"})]})]}),d&&e.jsx("p",{className:"text-sm text-destructive",children:d})]})}function Ke({applicationId:l,monument:s,onSave:t,onCancel:x,enums:d,lockedLocation:a,isEditingFirstMonument:u,canShowMultiCouncil
31:v}){var re;const[_,w]=j.useState(!1),[o,M]=j.useState(0),[y,c]=j.useState(null),[n,E]=j.useState(null),[S,p]=j.useState(null),[m,i]=j.useState({}),[k,A]=j.useState((s==null?void 0:s.is_multi_council)??!1),[g,q]=j.useState((s==null?void 0:s.council_data)??[{region:"",district:"",municipality:""}]),P=j.useMemo(()=>{if(!(s!=null&&s.media))return{image1:null,image2:null,video:null};const r=s.media.find(h=>h.collection_name==="image1"),b=s.media.find(h=>h.collection_name==="image2"),F=s.media.find(h=>h.collection_name==="video");return{image1:r||null,image2:b||null,video:F||null}},[s]),[z,ee]=j.useState(!1),[X,se]=j.useState(!1),[W,ae]=j.useState(!1),[N,T]=j.useState({name:(s==null?void 0:s.name)||"",category:(s==null?void 0:s.category)||"",region:(a==null?void 0:a.region)||(s==null?void 0:s.region)||"",district:(a==null?void 0:a.district)||(s==null?void 0:s.district)||"",municipality:(a==null?void 0:a.municipality)||(s==null?void 0:s.municipality)||"",description:(s==null?void 0:s.description)||"",historical_reference:(s==null?void 0:s.historical_reference)||""}),V=!!a,pe=j.useMemo(()=>!N.district||!d.municipalitiesByDistrict?[]:d.municipalitiesByDistrict[N.district]||[],[N.district,d.municipalitiesByDistrict]),he=r=>{V||T({...N,region:r})},ge=r=>{V||T({...N,district:r,municipality:""})},fe=r=>{V||T({...N,municipality:r})},be=()=>{q([...g,{region:"",district:"",municipality:""}])},je=r=>{q(g.filter((b,F)=>F!==r))},Y=(r,b,F)=>{const h=g.map((U,ye)=>ye!==r?U:b==="district"?{...U,district:F,municipality:""}:{...U,[b]:F});q(h)},ve=r=>!r||!d.municipalitiesByDistrict?[]:d.municipalitiesByDistrict[r]||[],Ne=async r=>{r.preventDefault(),w(!0),M(0),i({});const b=new FormData;b.append("application_id",l.toString()),s&&b.append("id",s.id.toString()),Object.entries(N).forEac
31h(([F,h])=>{b.append(F,h)}),b.append("is_multi_council",k?"1":"0"),k&&g.length>0&&b.append("council_data",JSON.stringify(g)),y&&b.append("image1",y),n&&b.append("image2",n),S&&b.append("video",S),z&&P.image1&&b.append("remove_image1","1"),X&&P.image2&&b.append("remove_image2","1"),W&&P.video&&b.append("remove_video","1");try{const F=await J.post(route("candidaturas.step2"),b,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:h=>{if(h.total){const U=Math.round(h.loaded*100/h.total);M(U)}}});t(F.data.application)}catch(F){F.response&&F.response.status===422?i(F.response.data.errors):(console.error(F),alert("Ocorreu um erro ao guardar."))}finally{w(!1),M(0)}};return y||P.image1,n||P.image2,S||P.video,e.jsxs("form",{onSubmit:Ne,className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"name",children:"Nome do Património *"}),e.jsx(I,{id:"name",value:N.name,onChange:r=>T({...N,name:r.target.value.slice(0,50)}),maxLength:50,required:!0,placeholder:"Nome do património (máx. 50 caracteres)"}),e.jsxs("div",{className:"flex justify-between items-center",children:[m.name&&e.jsx("p",{className:"text-sm text-destructive",children:m.name}),e.jsxs("p",{className:"text-xs text-muted-foreground ml-auto",children:[N.name.length,"/50"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"category",children:"Categoria *"}),e.jsxs(R,{value:N.category,onValueChange:r=>T({...N,category:r}),children:[e.jsx(B,{className:"h-12",children:e.jsx(D,{placeholder:"Selecione a categoria..."})}),e.jsx($,{children:d.categories.map(r=>e.jsx(O,{value:r.value,children:r.label},r.value))})]}),m.category&&e.jsx("p",{className:"text-sm text-destructive",children:m.category})]}),!k&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"region",children:"Região *"}),e.jsxs(R,{value:N.region,onValueChange:he,disabled:V,children:[e.jsx(B,{className:`h-12 ${V?"bg-muted cursor-not-allowed":""}`,children:e.jsx(D,{placeholder:"Selecione a região..."})}),e.jsx($,{children:d.regions.map(r=>e.jsx(O,{value:r.value,children:r.label},r.value))})]}),V&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Localização definida pelo primeiro património"}),u&&e.jsx("p",{className:"text-xs text-amber-600",children:"Alterar localização irá atualizar todos os patrimónios desta candidatura"}),m.region&&e.jsx("p",{className:"text-sm text-destructive",children:m.region})]})]}),!k&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"district",children:"Distrito *"}),e.jsxs(R,{value:N.district,onValueChange:ge,disabled:V,children:[e.jsx(B,{className:`h-12 ${V?"bg-muted cursor-not-allowed":""}`,children:e.jsx(D,{placeholder:"Selecione o distrito..."})}),e.jsx($,{children:(re=d.districts)==null?void 0:re.map(r=>e.jsx(O,{value:r.value,children:r.label},r.value))})]}),m.district&&e.jsx("p",{className:"text-sm text-destructive",children:m.district})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"municipality",children:"Concelho *"}),e.jsxs(R,{value:N.municipality,onValueChange:fe,disabled:V||!N.district,children:[e.jsx(B,{className:`h-12 ${V?"bg-muted cursor-not-allowed":""}`,children:e.jsx(D,{placeholder:N.district?"Selecione o concelho...":"Primeiro selecione o distrito"})}),e.jsx($,{children:pe.map(r=>e.jsx(O,{value:r,children:r},r))})]}),m.municipality&&e.jsx("p",{className:"text-sm text-destructive",children:m.municipality})]})]}),v&&e.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(f,{htmlFor:"is_multi_council",className:"text-base font-medium cursor-pointer",children:"à multi-concelhos?"}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(me,{className:"h-3 w-3 shrink-0"}),"Ative se este património pertencer a mais do que um concelho. Apenas é aceite um património por candidatura neste caso."]})]}),e.jsx(Ye,{id:"is_multi_council",checked:k,onCheckedChange:r=>{A(r),r?(g.length===0&&q([{region:N.region,district:N.district,municipality:N.municipality}]),T(b=>({...b,region:"",district:"",municipality:""}))):T(b=>({...b,region:"",district:"",municipality:""}))}})]}),k&&e.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Concelhos abrangidos"}),g.map((r,b)=>
31{var F;return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[1fr_1fr_1fr_auto] gap-3 items-end rounded-md border bg-background p-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(f,{className:"text-xs",children:"Região *"}),e.jsxs(R,{value:r.region,onValueChange:h=>Y(b,"region",h),children:[e.jsx(B,{className:"h-10",children:e.jsx(D,{placeholder:"Região..."})}),e.jsx($,{children:d.regions.map(h=>e.jsx(O,{value:h.value,children:h.label},h.value))})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(f,{className:"text-xs",children:"Distrito *"}),e.jsxs(R,{value:r.district,onValueChange:h=>Y(b,"district",h),children:[e.jsx(B,{className:"h-10",children:e.jsx(D,{placeholder:"Distrito..."})}),e.jsx($,{children:(F=d.districts)==null?void 0:F.map(h=>e.jsx(O,{value:h.value,children:h.label},h.value))})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(f,{className:"text-xs",children:"Concelho *"}),e.jsxs(R,{value:r.municipality,onValueChange:h=>Y(b,"municipality",h),disabled:!r.district,children:[e.jsx(B,{className:"h-10",children:e.jsx(D,{placeholder:r.district?"Concelho...":"Selecione o distrito"})}),e.jsx($,{children:ve(r.district).map(h=>e.jsx(O,{value:h,children:h},h))})]})]}),e.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"text-destructive hover:text-destructive h-10 w-10 self-end",onClick:()=>je(b),disabled:g.length===1,children:e.jsx(ue,{className:"h-4 w-4"})})]},b)}),e.jsxs(C,{type:"button",variant:"outline",size:"sm",onClick:be,className:"mt-1",children:[e.jsx(xe,{className:"mr-1 h-3 w-3"}),"Adicionar concelho"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"description",children:"Descrição *"}),e.jsx(le,{id:"description",value:N.description,onChange:r=>T({...N,description:r.target.value.slice(0,450)}),maxLength:450,required:!0,rows:4,placeholder:"Descreva o património de forma breve e concisa..."}),e.jsxs("div",{className:"flex justify-between items-center",children:[m.description&&e.jsx("p",{className:"text-sm text-destructive",children:m.description}),e.jsxs("p",{className:"text-xs text-muted-foreground ml-auto",children:[N.description.length,"/450"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"historical_reference",children:"Referência Histórica *"}),e.jsx(le,{id:"historical_reference",value:N.historical_reference,onChange:r=>T({...N,historical_reference:r.target.value.slice(0,450)}),maxLength:450,required:!0,rows:4,placeholder:"Descreva a história e relevância do património..."}),e.jsxs("div",{className:"flex justify-between items-center",children:[m.historical_reference&&e.jsx("p",{className:"text-sm text-destructive",children:m.historical_reference}),e.jsxs("p",{className:"text-xs text-muted-foreground ml-auto",children:[N.historical_reference.length,"/450"]})]})]}),e.jsx("div",{className:"space-y-4 pt-2",children:e.jsxs("div",{className:"border-t pt-4",children:[e.jsx("h3",{className:"text-lg font-medium mb-4",children:"Fotografias *"}),e.jsxs("div",{className:"text-sm text-muted-foreground mb-4 space-y-3",children:[e.jsx("p",{children:"As fotografias devem apresentar diferentes ângulos, cores naturais e elevada qualidade técnica, preferencialmente em formato vertical (4:5 ou 9:16), com dimensão mÃnima de 3000 px no lado maior, em formato JPG."}),e.jsx("p",{children:"A qualidade dos conteúdos submetidos é determinante para a valorização da candidatura e para a sua utilização nos diversos suportes de comunicação do projeto, nomeadamente redes sociais, plataformas digitais e meios audiovisuais."})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsx("div",{className:"space-y-2",children:P.image1&&!z&&!y?e.jsxs("div",{className:"relative",children:[e.jsx(f,{children:"Fotografia 1 *"}),e.jsxs("div",{className:"mt-2 relative rounded-lg overflow-hidden border",children:[e.jsx("img",{src:P.image1.original_url,alt:"Fotografia 1",className:"w-full h-40 object-cover"}),e.jsx(C,{type:"button",variant:"destructive",size:"sm",className:"absolute top-2 right-2",onClick:()=>ee(!0),children:e.jsx(G,{className:"h-4 w-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Imagem atual. Clique no X para substituir."})]}):e.jsx(te,{id:"image1",label:"Fotografia 1 *",onChange:r=>{c(r),ee(!1)},value:y,error:m.image1,presets:[{label:"4:5",aspect:4/5},{label:"9:16",aspect:9/16}],defaultPresetIndex:0})}),e.jsx("div",{className:"space-y-2",children:P.image2&&!X&&!n?e.jsxs("div",{className:"relative",children:[e.jsx(f,{children:"Fotografia 2 *"}),e.jsxs("div",{className:"mt-2 relative rounded-lg overflow-hidden border",children:[e.jsx("img",{src:P.image2.original_url,alt:"Fotografia 2",className:"w-full h-40 object-cover"}),e.jsx(C,{type:"button",variant:"destructive",size:"sm",className:"absolute top-2 right-2",onClick:()=>se(!0),children:e.jsx(G,{className:"h-4 w-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Imagem atual. Clique no X para substituir."})]}):e.jsx(te,{id:"image2",label:"Fotografia 2 *",onChange:r=>{E(r),se(!1)},value:n,error:m.image2,presets:[{label:"4:5",aspect:4/5},{label:"9:16",aspect:9/16}],defaultPresetIndex:0})})]}),e.jsx("div",{className:"text-sm text-muted-foreground mt-4 space-y-3",children:e.jsx("p",{children:"Ao submeter os conteúdos, o candidato declara deter os direitos de utilização das fotografias e vÃdeos enviados, autorizando a sua utilização pelo projeto Novas 7 Marav
31ilhas de Portugal®, sem limite temporal ou geográfico, para fins de divulgação institucional, editorial, promocional e digital, incluindo redes sociais e meios audiovisuais."})})]})}),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx("h3",{className:"text-lg font-medium mb-2",children:"VÃdeo (Opcional)"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"O vÃdeo deverá ter uma duração ideal entre 30 e 60 segundos, não ultrapassando os 90 segundos, em formato vertical (9:16), resolução mÃnima Full HD (1080p), formato MP4 e codificação H.264 ou H.265."}),P.video&&!W&&!S?e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 border rounded-lg bg-muted/50",children:[e.jsx(Xe,{className:"h-8 w-8 text-muted-foreground"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:P.video.file_name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["VÃdeo carregado ⢠",(P.video.size/1024/1024).toFixed(1)," MB"]})]}),e.jsx(C,{type:"button",variant:"destructive",size:"sm",onClick:()=>ae(!0),children:e.jsx(G,{className:"h-4 w-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"VÃdeo atual. Clique no X para substituir."})]}):e.jsx(Ze,{id:"video",label:"",accept:"video/mp4,video/quicktime",onChange:r=>{p(r),ae(!1)},value:S,error:m.video})]}),_&&o>0&&e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"A carregar ficheiros..."}),e.jsxs("span",{className:"font-medium",children:[o,"%"]})]}),e.jsx("div",{className:"h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary transition-all duration-300 ease-out",style:{width:`${o}%`}})})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t",children:[e.jsx(C,{type:"button",variant:"outline",onClick:x,disabled:_,children:"Cancelar"}),e.jsxs(C,{type:"submit",className:"bg-primary text-white hover:bg-[#b5952f]",disabled:_,children:[_&&e.jsx(Q,{className:"mr-2 h-4 w-4 animate-spin"}),_?o>0?"A enviar...":"A preparar...":"Guardar Património"]})]})]})}function Qe({application:l,onNext:s,onBack:t,enums:x,onUpdate:d}){var i,k,A;const[a,u]=j.useState(!1),[v,_]=j.useState(null),[w,o]=j.useState(null),M=g=>{_(g),u(!0)},y=async g=>{if(confirm("Tem a certeza que deseja eliminar este património?")){o(g);try{const q=await J.delete(route("candidaturas.delete-monument",g));d(q.data.application)}catch(q){console.error(q),alert("Erro ao eliminar.")}finally{o(null)}}},c=g=>{d(g),u(!1),_(null)},n=l.monuments||[],E=v&&n.length>0&&v.id===n[0].id,S=n.length>0&&!E?{region:n[0].region,district:n[0].district,municipality:n[0].municipality}:null,p=v===null?n.length===0:n.length===1,m=n.some(g=>g.is_multi_council);return e.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold",children:"2. Patrimónios a Candidatar"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Adicione os patrimónios que deseja candidatar (1 a 7)."})]}),!a&&(((i=l.monuments)==null?void 0:i.length)??0)<7&&!m&&e.jsxs(C,{onClick:()=>{_(null),u(!0)},className:"bg-[#D4AF37] text-white hover:bg-[#b5952f] h-12 px-6",children:[e.jsx(xe,{className:"mr-2 h-4 w-4"}),"Adicionar Património"]})]}),m&&!a&&e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-amber-200 bg-amber-50 dark:border-amber-800 dark:bg-amber-950/30 p-4 text-sm text-amber-800 dark:text-amber-300",children:[e.jsx(me,{className:"h-4 w-4 mt-0.5 shrink-0"}),e.jsxs("p",{children:["Este monumento foi marcado como ",e.jsx("strong",{children:"multi-concelhos"}),". Candidaturas com um monumento multi-concelhos apenas podem conter um único monumento."]})]}),a?e.jsxs("div",{className:"bg-muted/30 p-4 rounded-lg border",children:[e.jsx("h3",{className:"text-lg font-medium mb-4",children:v?"Editar Património":"Novo Património"}),e.jsx(Ke,{applicationId:l.id,monument:v,onSave:c,onCancel:()=>u(!1),enums:x,lockedLocation:S,isEditingFirstMonument:E,canShowMultiCouncil
31:p})]}):e.jsx("div",{className:"space-y-4",children:(((k=l.monuments)==null?void 0:k.length)??0)===0?e.jsx("div",{className:"text-center py-10 border-2 border-dashed rounded-xl text-muted-foreground",children:"Nenhum património adicionado ainda."}):e.jsx("div",{className:"grid gap-4",children:(l.monuments??[]).map(g=>{var q,P;return e.jsx(de,{className:"overflow-hidden",children:e.jsxs("div",{className:"p-4 flex items-center gap-4",children:[e.jsx("div",{className:"h-16 w-24 bg-muted rounded overflow-hidden flex-shrink-0 relative",children:(q=g.media)!=null&&q.find(z=>z.collection_name==="image1")?e.jsx("img",{src:g.media.find(z=>z.collection_name==="image1").original_url,alt:"",className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-100 text-gray-400",children:e.jsx(Oe,{className:"h-6 w-6"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h4",{className:"font-medium truncate",children:g.name}),g.is_multi_council&&e.jsx(Fe,{variant:"outline",className:"text-xs border-amber-400 text-amber-700 bg-amber-50 dark:bg-amber-950/30 dark:text-amber-300 shrink-0",children:"Multi-concelhos"})]}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:((P=x.categories.find(z=>z.value===g.category))==null?void 0:P.label)||g.category})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"ghost",size:"icon",onClick:()=>M(g),children:e.jsx(Ue,{className:"h-4 w-4"})}),e.jsx(C,{variant:"ghost",size:"icon",className:"text-destructive hover:text-destructive",onClick:()=>y(g.id),disabled:w===g.id,children:w===g.id?e.jsx(Q,{className:"h-4 w-4 animate-spin"}):e.jsx(ue,{className:"h-4 w-4"})})]})]})},g.id)})})}),!a&&e.jsxs("div",{className:"flex items-center justify-between border-t pt-6",children:[e.jsxs("div",{className:"text-right flex-1 pr-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Estimado"}),e.jsx("p",{className:"text-xl font-bold text-[#D4AF37]",children:new Intl.NumberFormat("pt-PT",{style:"currency",currency:"EUR"}).format(l.total_amount??0)})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(C,{variant:"outline",onClick:t,className:"h-12 px-6",children:"Anterior"}),e.jsx(C,{onClick:s,disabled:(((A=l.monuments)==null?void 0:A.length)??0)===0,className:"bg-[#D4AF37] text-white hover:bg-[#b5952f] h-12 px-8 text-base",children:"Seguinte"})]})]})]})}function ne(l){const s=l.replace(/\s/g,"");if(!/^[0-9]{9}$/.test(s)||!["1","2","3","5","6","7","8","9"].includes(s[0]))return!1;let x=0;for(let u=0;u<8;u++)x+=parseInt(s[u])*(9-u);const d=11-x%11,a=d>=10?0:d;return parseInt(s[8])===a}function es({application:l,onBack:s}){var m;const[t,x]=j.useState(null),[d,a]=j.useState(!1),{data:u,setData:v,post:_,processing:w,errors:o,transform:M}=ce({application_id:l.id,billing_name:l.billing_name||l.responsible_name||"",billing_nif:l.billing_nif||"",billing_address:l.billing_address||"",billing_postal_code:l.billing_postal_code||"",billing_city:l.billing_city||"",requisition_number:l.requisition_number||"",terms_accepted:l.terms_accepted||!1,regulation_accepted:l.regulation_accepted||!1,rights_accepted:l.rights_accepted||!1,payment_proof:null}),y=i=>{v("billing_nif",i),i.length===9&&!ne(i)?x("NIF inválido. Por favor verifique."):x(null)},c=()=>ne(u.billing_nif)?!0:(x("NIF inválido. Por favor verifique."),!1),n=()=>{c()&&(M(i=>({...i,submit_application:!1})),_(route("candidaturas.step3"),{forceFormData:!0,preserveScroll:!0}))},E=()=>{c()&&a(!0)},S=()=>{M(i=>({...i,submit_application:!0})),_(route("candidaturas.step3"),{forceFormData:!0}),a(!1)},p=()=>{v(i=>({...i,billing_name:l.responsible_name}))};return e.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-xl font-semibold",children:"3. Dados de Faturação e Pagamento"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Verifique os dados para a emissão da fatura (caso solicitado) e submeta o comprovativo se já efetuou o pagamento."}),(m=l.monuments)!=null&&m.some(i=>i.is_multi_council)?e.jsx("div",{className:"bg-amber-50 dark:bg-amber-950/30 p-4 rounded-lg border border-amber-200 dark:border-amber-900/50",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(H,{className:"h-5 w-5 text-amber-600 dar
31k:text-amber-500 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-amber-800 dark:text-amber-400 mb-1",children:"Candidatura Multi-Concelho"}),e.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-500/90",children:"Como se trata de uma candidatura multi-concelho, a faturação será dividida entre as entidades promotoras e processada manualmente."})]})]})}):e.jsxs("div",{className:"bg-primary/5 p-4 rounded-lg border border-primary/20",children:[e.jsx("p",{className:"font-semibold text-primary mb-2",children:"Dados para Pagamento (IBAN)"}),e.jsx("p",{className:"text-lg font-mono whitespace-nowrap",children:"PT50 0007 0000 0084 1945 9362 3"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"EIPWU LDA | NIPC: 508318939"}),e.jsxs("p",{className:"text-sm font-bold mt-2",children:["Valor Total a Pagar: ",new Intl.NumberFormat("pt-PT",{style:"currency",currency:"EUR"}).format(l.total_amount||0)]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-primary/20 space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Declarações de Não DÃvida:"}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[e.jsxs("a",{href:"/assets/documentos/AT-Eipwu.pdf",target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-sm text-primary hover:underline",children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),"Finanças (AT)"]}),e.jsxs("a",{href:"/assets/documentos/SS-Eipwu.pdf",target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-sm text-primary hover:underline",children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),"Segurança Social"]})]})]})]})]}),e.jsxs("form",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4 border-b pb-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h3",{className:"font-medium",children:"Dados de Faturação"}),e.jsx(C,{type:"button",variant:"ghost",size:"sm",onClick:p,children:"Copiar Nome do Responsável"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"billing_name",children:"Nome / Entidade *"}),e.jsx(I,{id:"billing_name",value:u.billing_name,onChange:i=>v("billing_name",i.target.value),required:!0}),o.billing_name&&e.jsx("p",{className:"text-sm text-destructive",children:o.billing_name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"billing_nif",children:"NIF *"}),e.jsx(I,{id:"billing_nif",value:u.billing_nif,onChange:i=>y(i.target.value.replace(/\D/g,"").slice(0,9)),maxLength:9,required:!0,placeholder:""}),(t||o.billing_nif)&&e.jsx("p",{className:"text-sm text-destructive",children:t||o.billing_nif})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"billing_address",children:"Morada *"}),e.jsx(I,{id:"billing_address",value:u.billing_address,onChange:i=>v("billing_address",i.target.value),required:!0}),o.billing_address&&e.jsx("p",{className:"text-sm text-destructive",children:o.billing_address})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"billing_postal_code",children:"Código Postal *"}),e.jsx(I,{id:"billing_postal_code",value:u.billing_postal_code,onChange:i=>v("billing_postal_code",i.target.value),required:!0,placeholder:"0000-000"}),o.billing_postal_code&&e.jsx("p",{className:"text-sm text-destructive",children:o.billing_postal_code})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"billing_city",children:"Localidade *"}),e.jsx(I,{id:"billing_city",value:u.billing_city,onChange:i=>v("billing_city",i.target.value),required:!0}),o.billing_city&&e.jsx("p",{className:"text-sm text-destructive",children:o.billing_city})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{htmlFor:"requisition_number",children:"Nº Requisição (Opcional)"}),e.jsx(I,{id:"requisition_number",value:u.requisition_number,onChange:i=>v("requisition_number",i.target.value)})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-4 border p-4 rounded-xl bg-background/50",children:[e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx(Z,{id:"terms_accepted",checked:u.terms_accepted,onCheckedChange:i=>v("terms_accepted",i)}),e.jsxs("div",{className:"grid gap-1.5 leading-none",children:[e.jsxs(f,{htmlFor:"terms_accepted",className:"text-sm font-medium leading-none cursor-pointer",children:["Aceito o armazenamento e tratamento dos seus dados pelo website 7Maravilhas.pt conforme descrito na",e.jsx("a",{href:route("privacy"),className:"underline text-primary hover:text-primary/80 ml-2",target:"_blank",rel:"noopener noreferrer",tabIndex:0,onClick:i=>i.stopPropagation(),onMouseDown:i=>i.stopPropagation(),children:"PolÃtica de Privacidade"})]}),o.terms_accepted&&e.jsxs("p",{className:"text-sm text-destructive flex items-center gap-1",children:[e.jsx(H,{className:"h-3 w-3"})," ",o.terms_accepted]})]})]}),e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx(Z,{id:"regulation_accepted",checked:u.regulation_accepted,onCheckedChange:i=>v("regulation_accepted",i)}),e.jsxs("div",{className:"grid gap-1.5 leading-none",children:[e.jsxs(f,{htmlFor:"regulation_accepted",className:"text-sm font-medium leading-none cursor-pointer",children:["Li e aceito o ",e.jsx("a",{href:route("regulamento"),target:"_blank",rel:"noopener noreferrer",className:"underline text-primary hover:text-primary/80",onClick:i=>i.stopPropagation(),children:"Regulamento"})," *"]}),o.regulation_accepted&&e.jsxs("p",{className:"text-sm text-destructive flex items-center gap-1",children:[e.jsx(H,{className:"h-3 w-3"})," ",o.regulation_accepted]})]})]}),e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx(Z,{id:"rights_accepted",checked:u.rights_accepted,onCheckedChange:i=>v("rights_accepted",i)}),e.jsxs("div",{className:"grid gap-1.5 leading-none",children:[e.jsx(f,{htmlFor:"rights_accepted",className:"text-sm font-medium leading-none cursor-pointer",children:"Autorizo a utilização de conteúdos e cedo os direitos de imagem *"}),o.rights_accepted&&e.jsxs("p",{className:"text-sm text-destructive flex items-center gap-1",children:[e.jsx(H,{className:"h-3 w-3"})," ",o.rights_accepted]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(f,{children:"Comprovativo de Pagamento (Opcional - pode enviar mais tarde)"}
31),e.jsx(I,{type:"file",accept:"application/pdf,image/*",onChange:i=>{var k;return v("payment_proof",((k=i.target.files)==null?void 0:k[0])||null)}})]})]}),e.jsxs("div",{className:"flex justify-between pt-6 border-t",children:[e.jsx(C,{variant:"outline",onClick:s,type:"button",className:"h-12 px-6",children:"Voltar"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(C,{type:"button",variant:"secondary",disabled:w||!!t,onClick:n,className:"h-12 px-6",children:"Gravar"}),e.jsx(C,{type:"button",disabled:w||!!t,onClick:E,className:"bg-primary text-primary-foreground hover:bg-primary/90 h-12 px-8 text-base",children:"Submeter"})]})]})]}),e.jsx(Pe,{open:d,onOpenChange:a,children:e.jsxs(Me,{children:[e.jsxs(Ee,{children:[e.jsx(Ie,{children:"Submeter Candidatura"}),e.jsxs(Ae,{className:"pt-2",children:["Tem a certeza que deseja submeter a sua candidatura?",e.jsx("br",{}),e.jsx("br",{}),e.jsx("strong",{children:"Nota:"})," Após a submissão, não poderá mais editar a candidatura."]})]}),e.jsxs(qe,{className:"mt-4",children:[e.jsx(C,{variant:"outline",onClick:()=>a(!1),children:"Cancelar"}),e.jsx(C,{className:"bg-primary text-primary-foreground hover:bg-primary/90",onClick:S,disabled:w,children:w?"A submeter...":"Confirmar e Submeter"})]})]})})]})}function _s({enums:l,application:s}){var c;const{auth:t}=oe().props,[x,d]=j.useState(s?s.status==="draft"?2:3:1),[a,u]=j.useState(s),v=!a||a.can_edit,_=[{id:1,title:"Responsável",completed:!!a},{id:2,title:"Patrimónios",completed:((c=a==null?void 0:a.monuments)==null?void 0:c.length)>0},{id:3,title:"Faturação",completed:(a==null?void 0:a.status)==="submitted"}],w=n=>{u(n.application),d(2)},o=()=>{d(3)},M=n=>{u(n)},y=n=>{var E;v&&(n===1&&a?d(1):n===2&&a?d(2):n===3&&((E=a==null?void 0:a.monuments)==null?void 0:E.length)>0&&d(3))};return e.jsxs(we,{title:"Candidatura",description:"Submeter candidatura às 7 Maravilhas",children:[e.jsx(_e,{title:"Candidatura"}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("section",{className:"py-16 bg-background border-b border-border",children:e.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("h1",{className:"text-4xl sm:text-5xl lg:text-6xl font-bold text-foreground",children:"Candidatura"}),e.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto leading-relaxed",children:"Preencha o formulário para submeter os seus patrimónios a concurso."}),e.jsxs("div",{className:"mt-4 text-muted-foreground",children:["Consulte o ",e.jsx("a",{href:route("regulamento"),className:"text-primary hover:underline font-medium",children:"regulamento das candidaturas às Novas 7 Maravilhas de Portugal®"})]}),!t.user&&e.jsx("div",{className:"pt-2 animate-in fade-in slide-in-from-bottom-2 duration-700 delay-200",children:e.jsx(Ce,{href:route("login"),className:"inline-flex items-center justify-center rounded-full text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none border border-primary text-primary hover:bg-primary hover:text-white h-10 px-6",children:"Já tem conta? Faça Login antes de submeter a candidatura."})})]})})}),e.jsx("section",{className:"py-12",children:e.jsxs("div",{className:"container mx-auto px-4 max-w-5xl",children:[!v&&e.jsxs(ze,{className:"mb-8 border-amber-200 bg-amber-50 text-amber-800",children:[e.jsx(H,{className:"h-4 w-4"}),e.jsx(Te,{children:"Esta candidatura está completa e já não pode ser editada. Contacte-nos se precisar de fazer alterações."})]}),e.jsxs("div",{className:"flex justify-between items-center mb-12 relative",children:[e.jsx("div",{className:"absolute top-5 left-[10%] w-[80%] h-0.5 bg-border -z-10"}),_.map(n=>{var m;const E=x===n.id,S=x>n.id;x<n.id;const p=v&&(n.id===1&&a||n.id===2&&a||n.id===3&&((m=a==null?void 0:a.monuments)==null?void 0:m.length)>0);return e.jsxs("div",{className:`flex flex-col items-center gap-2 bg-background px-4 ${p?"cursor-pointer":""}`,onClick:()=>p&&y(n.id),children:[e.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center border-2 transition-all duration-300 ${E?"border-primary bg-primary text-white shadow-lg shadow-primary/30":S?"border-primary bg-primary/10 text-primary":"border-muted-foreground
31/30 text-muted-foreground bg-background"}`,children:S?e.jsx(Re,{className:"w-6 h-6"}):e.jsx("span",{className:"text-lg font-semibold",children:n.id})}),e.jsx("span",{className:`text-sm font-medium transition-colors ${E||S?"text-foreground":"text-muted-foreground"}`,children:n.title})]},n.id)})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ve,{spread:130,glow:!0,disabled:!1,proximity:64,inactiveZone:.01,variant:"primary",className:"rounded-[2rem]"}),e.jsx(de,{className:"relative shadow-xl bg-white/50 dark:bg-card/50 backdrop-blur-md border border-primary/20 rounded-[2rem] overflow-hidden",children:e.jsxs(ke,{className:"p-8",children:[x===1&&e.jsx(We,{onNext:w,enums:l,initialData:a}),x===2&&a&&e.jsx(Qe,{application:a,onNext:o,onBack:()=>d(1),enums:l,onUpdate:M}),x===3&&a&&e.jsx(es,{application:a,onBack:()=>d(2)})]})})]}),e.jsx("div",{className:"mt-10 text-center",children:e.jsxs("div",{className:"inline-block bg-primary/5 border border-primary/20 rounded-2xl px-8 py-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-3",children:"Valores de Inscrição"}),e.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium text-foreground",children:"1 ou 2 Patrimónios:"})," 240⬠+ IVA cada"]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-medium text-foreground",children:"3 a 7 Patrimónios:"})," 700⬠+ IVA (total)"]})]})]})})]})})]})]})}export{_s 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.