1/* ANPG DEVTEAM - 23/09/2026, 12:53:51 */ 2import{j as e,e as vs,u as Q,d as ke}from"./data-vendor-BRYI0K8G.js";import{r as N,L as ue,j as Ds,u as As,N as es}from"./react-vendor-Bj9LQV-u.js";import{P as Ts}from"./PageLayout-B43uM63E.js";import{C as j,a as f,b as z,c as $,d as De}from"./card--xtz4eBf.js";import{e as Ls,T as u,M as Fs,J as Bs,b as A,A as Be,bL as Ks,w as se,S as X,F as J,V as Es,h as Pe,Q as Ns,j as ys,q as Os,a0 as We,B as Ae,af as ss,ag as as,ah as ts,ai as rs,bf as ns,bM as Is,bh as O,bN as Ce,bO as qs,bP as Ne,bQ as Ge,R as Ue,l as Le,z as zs,c as Ke,U as bs,X as $s,bR as ie,t as is,bS as ls,I as ws,a7 as _s,Y as Rs}from"./index-cwV7SCbt.js";import{B as v}from"./badge-DH3OcwR0.js";import{S as Ss}from"./StaggerContainer-Ca5vuASL.js";import{I}from"./input-DXoiBR8B.js";import{S as le,a as ce,b as oe,c as de,d as K}from"./select-DB2ezOdP.js";import{u as Cs,m as Us}from"./usePetroleumBlocks-D-s-jTGN.js";import{u as Te}from"./i18n-vendor-BSIZ7LIS.js";import{S as Ye}from"./search-BiS5Q1yZ.js";import{F as Qs}from"./filter-c4kDiAN7.js";import{A as Qe,a as Ve,b as He,c as Xe}from"./accordion-UGGG4B-a.js";import{C as Ee}from"./circle-alert-Wb44nxWs.js";import{D as ks}from"./download-C_m8n9-p.js";import{B as Vs}from"./book-open-YlczfV9G.js";import{T as Fe}from"./textarea-DXuDKDDL.js";import{L as F}from"./label-ZRKjaR0k.js";import{C as Hs}from"./checkbox-B1nT23Iv.js";import{M as Oe,L as Xs,a as Js}from"./message-square-PMubaXRc.js";import{F as Zs}from"./file-up-BThi_M-M.js";import{P as cs}from"./paperclip-sjeKyvV1.js";import{T as Ws}from"./trash-2-DsWPE62z.js";import{S as os}from"./send-Do57BhJt.js";import{C as Gs}from"./clock-3-CldgqfuO.js";import{E as Ys}from"./eye-rTW77Giv.js";import{C as Je}from"./circle-check-DFc5yF46.js";import{C as ea}from"./circle-x-BMJCoLrN.js";import{C as sa}from"./calendar-BDe8UQOC.js";import{p as Ie,e as Ps,f as ae}from"./pt-C0cLzuL-.js";import{A as ds}from"./arrow-left-BeqZSyXi.js";import{U as Ze}from"./user-GGMDWiDQ.js";import{C as ms}from"./clock-BrMjUDom.js";import{S as aa}from"./star-DIWblV4s.js";import{A as ta}from"./activity-CJrS3Lgo.js";import{C as Ms}from"./circle-check-big-B8jnYIp7.js";import{S as ra}from"./switch-DHlsO-Hx.js";import{S as na}from"./settings-2-Bi0RsXgx.js";import{B as ve}from"./bell-CtCg7brE.js";import{C as Me}from"./calendar-days-COjXg8e9.js";import{L as xs}from"./lock-CAj2XD4O.js";import{T as ia}from"./triangle-alert-DvZUi8zm.js";import"./PageBreadcrumb-Dy1zu2ro.js";import"./motion-vendor-DMc3mo8t.js";import"./house-CbYFZtt0.js";import"./charts-vendor-Cs07Jtv5.js";import"./index-BdQq_4o_.js";import"./index-BatE7gkT.js";import"./index-D6PzSG9l.js";import"./chevron-up-BjRn6whD.js";import"./index-6dpOslGh.js";import"./subDays-C1VK3cRW.js";import"./isAfter-BHbK816n.js";import"./endOfMonth-BGewmovm.js";/** 3 * @license lucide-react v0.462.0 - ISC 4 * 5 * This source code is licensed under the ISC license. 6 * See the LICENSE file in the root directory of this source tree. 7 */const la=Ls("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]),ca=[{id:"KON-1",name:"Bloco KON-1",basin:"kwanza",type:"deep",area:"2,150 km²",depth:"500-2,000m",status:"tender-2025",tender:"Licitação 2025"},{id:"KON-2",name:"Bloco KON-2",basin:"kwanza",type:"deep",area:"1,920 km²",depth:"800-2,500m",status:"tender-2025",tender:"Licitação 2025"},{id:"KON-3",name:"Bloco KON-3",basin:"kwanza",type:"ultra-deep",area:"2,340 km²",depth:"1,200-3,000m",status:"tender-2025",tender:"Licitação 2025"},{id:"BEN-1",name:"Bloco BEN-1",basin:"benguela",type:"deep",area:"3,200 km²",depth:"400-1,200m",status:"tender-2025",tender:"Licitação 2025"},{id:"BEN-2",name:"Bloco BEN-2",basin:"benguela",type:"deep",area:"2,850 km²",depth:"600-1,600m",status:"tender-2025",tender:"Licitação 2025"},{id:"BEN-4",name:"Bloco BEN-4",basin:"benguela",type:"shallow",area:"3,100 km²",depth:"500-1,400m",status:"tender-2025",tender:"Licitação 2025"},{id:"CON-5",name:"Bloco CON-5",basin:"congo",type:"shallow",area:"1,800 km²",depth:"200-800m",status:"available"},{id:"CON-7",name:"Bloco CON-7",basin:"congo",type:"deep",area:"2,400 km²",depth:"1,000-2,200m",status:"available"},{id:"NAM-2",name:"Bloco NAM-2",basin:"namibe",type:"deep",area:"2,100 km²",depth:"600-1,800m",status:"available"},{id:"BEN-3",name:"Bloco BEN-3",basin:"benguela",type:"deep",area:"2,680 km²",depth:"800-2,000m",status:"under-evaluation"}];function oa(s){return s.filter(m=>m.statusKey==="available"||m.statusKey==="negotiating").map(m=>{var P;let o="available",r;m.statusKey==="negotiating"?o="under-evaluation":m.offer_type==="tender"&&(o="tender-2025",r="Licitação 2025");
7const _=m.area_km2?`${Number(m.area_km2).toLocaleString("pt-AO")} km²`:"",l=m.water_depth_m?`0-${Number(m.water_depth_m).toLocaleString("pt-AO")}m`:"";return{id:((P=m.name)==null?void 0:P.replace("Bloco ",""))||m.id,name:m.name||"",basin:(m.basinKey||m.basin||"").toLowerCase(),type:m.typeKey||m.depth_category||"deep",area:_,depth:l,status:o,tender:r}})}const da=[{key:"all",label:"Todas as Bacias"},{key:"kwanza",label:"Bacia do Kwanza"},{key:"benguela",label:"Bacia de Benguela"},{key:"congo",label:"Bacia do Congo"},{key:"namibe",label:"Bacia do Namibe"}],ma=[{key:"all",label:"Todos os Tipos"},{key:"shallow",label:"Ãguas Rasas"},{key:"deep",label:"Ãguas Profundas"},{key:"ultra-deep",label:"Ãguas Ultra-Profundas"},{key:"onshore",label:"Onshore"}],xa=[{key:"all",label:"Todos"},{key:"tender-2025",label:"Licitação 2025"},{key:"available",label:"Oferta Permanente"},{key:"under-evaluation",label:"Em Avaliação"}];function ua(){const{t:s}=Te(),{data:m}=Cs(),[o,r]=N.useState(""),[_,l]=N.useState("all"),[P,B]=N.useState("all"),[d,E]=N.useState("all"),M=m!=null&&m.length?oa(m):ca,p=M.filter(i=>{const T=i.name.toLowerCase().includes(o.toLowerCase())||i.id.toLowerCase().includes(o.toLowerCase()),g=_==="all"||i.basin===_,R=P==="all"||i.type===P,L=d==="all"||i.status===d;return T&&g&&R&&L}),k=(i,T)=>{switch(i){case"tender-2025":return e.jsx(v,{variant:"default",className:"bg-primary",children:T?e.jsx(u,{children:T}):e.jsx(u,{children:"Licitação 2025"})});case"available":return e.jsx(v,{variant:"secondary",children:e.jsx(u,{children:"Oferta Permanente"})});case"under-evaluation":return e.jsx(v,{variant:"outline",children:e.jsx(u,{children:"Em Avaliação"})});default:return null}},h=i=>{switch(i){case"shallow":return e.jsx(u,{children:"Ãguas Rasas"});case"deep":return e.jsx(u,{children:"Ãguas Profundas"});case"ultra-deep":return e.jsx(u,{children:"Ultra-Profundas"});case"onshore":return"Onshore";default:return i}},S=i=>{switch(i){case"kwanza":return"Kwanza";case"benguela":return"Benguela";case"congo":return"Congo";case"namibe":return"Namibe";default:return i}};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(j,{children:e.jsx(f,{className:"p-4",children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Ye,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(I,{placeholder:s("investorPortal.searchBlocks"),"aria-label":s("investorPortal.searchBlocks"),value:o,onChange:i=>r(i.target.value),className:"pl-10"})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs(le,{value:_,onValueChange:l,children:[e.jsx(ce,{className:"w-[180px]","aria-label":"Bacia",children:e.jsx(oe,{placeholder:"Bacia"})}),e.jsx(de,{children:da.map(i=>e.jsx(K,{value:i.key,children:e.jsx(u,{children:i.label})},i.key))})]}),e.jsxs(le,{value:P,onValueChange:B,children:[e.jsx(ce,{className:"w-[180px]","aria-label":"Tipo",children:e.jsx(oe,{placeholder:"Tipo"})}),e.jsx(de,{children:ma.map(i=>e.jsx(K,{value:i.key,children:e.jsx(u,{children:i.label})},i.key))})]}),e.jsxs(le,{value:d,onValueChange:E,children:[e.jsx(ce,{className:"w-[180px]","aria-label":"Status",children:e.jsx(oe,{placeholder:"Status"})}),e.jsx(de,{children:xa.map(i=>e.jsx(K,{value:i.key,children:e.jsx(u,{children:i.label})},i.key))})]})]})]})})}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsx(j,{className:"bg-primary/5 border-primary/20",children:e.jsxs(f,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-primary",children:M.filter(i=>i.status==="tender-2025").length}),e.jsx("div",{className:"text-xs text-muted-foreground",children:e.jsx(u,{children:"Licitação 2025"})})]})}),e.jsx(j,{className:"bg-secondary border-secondary/50",children:e.jsxs(f,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-foreground",children:M.filter(i=>i.status==="available").length}),e.jsx("div",{className:"text-xs text-muted-foreground",children:e.jsx(u,{children:"Oferta Permanente"})})]})}
7),e.jsx(j,{className:"bg-muted border-muted-foreground/10",children:e.jsxs(f,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-foreground",children:M.filter(i=>i.status==="under-evaluation").length}),e.jsx("div",{className:"text-xs text-muted-foreground",children:e.jsx(u,{children:"Em Avaliação"})})]})}),e.jsx(j,{className:"bg-gradient-to-br from-primary/10 to-accent/10 border-primary/20",children:e.jsxs(f,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-primary",children:p.length}),e.jsx("div",{className:"text-xs text-muted-foreground",children:e.jsx(u,{children:"Total Filtrado"})})]})})]}),e.jsx(Ss,{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:p.map(i=>e.jsxs(j,{className:"group hover:border-primary/30 transition-all",children:[e.jsx(z,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx($,{className:"text-lg group-hover:text-primary transition-colors",children:i.name}),e.jsxs(De,{className:"flex items-center gap-1 mt-1",children:[e.jsx(Fs,{className:"w-3 h-3"}),e.jsx(u,{children:"Bacia de"})," ",S(i.basin)]})]}),k(i.status,i.tender)]})}),e.jsx(f,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:e.jsx(u,{children:"Ãrea:"})}),e.jsx("span",{className:"ml-2 font-medium",children:i.area})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:e.jsx(u,{children:"Profundidade:"})}),e.jsx("span",{className:"ml-2 font-medium",children:i.depth})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(v,{variant:"outline",className:"text-xs",children:[e.jsx(Bs,{className:"w-3 h-3 mr-1"}),h(i.type)]})}),e.jsx(A,{variant:"ghost",size:"sm",className:"w-full mt-2 group-hover:bg-primary/10",asChild:!0,children:e.jsxs(ue,{to:`/dados-ep/blocos/${i.id.toLowerCase()}`,children:[s("investorPortal.viewDetails"),e.jsx(Be,{className:"w-4 h-4 ml-2"})]})})]})})]},i.id))}),p.length===0&&e.jsx(j,{className:"py-12",children:e.jsxs(f,{className:"text-center",children:[e.jsx(Qs,{className:"w-12 h-12 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-2",children:s("investorPortal.noResults")}),e.jsx("p",{className:"text-muted-foreground",children:s("investorPortal.adjustFilters")})]})})]})}const us=[{key:"conhecer_angola",icon:Es,titleKey:"investorPortal.sections.knowAngola",descKey:"investorPortal.sections.knowAngolaDesc",title:"Conhecer Angola",description:"Documentos de enquadramento que ajudam investidores a conhecer o mercado angolano",color:"bg-blue-50 border-blue-200",iconColor:"text-blue-600"},{key:"preparar_candidatura",icon:Pe,titleKey:"investorPortal.sections.prepareApplication",descKey:"investorPortal.sections.prepareApplicationDesc",title:"Preparar Candidatura",description:"Ferramentas e modelos para preparação de propostas e processos de candidatura",color:"bg-emerald-50 border-emerald-200",iconColor:"text-emerald-600"},{key:"contratual",icon:Ns,titleKey:"investorPortal.sections.contractual",descKey:"investorPortal.sections.contractualDesc",title:"Documentação Contratual",description:"Documentação jurÃdica e de negociação para suporte ao processo de contratação",color:"bg-purple-50 border-purple-200",iconColor:"text-purple-600"},{key:"tecnica",icon:ys,titleKey:"investorPortal.sections.technical",descKey:"investorPortal.sections.technicalDesc",title:"Documentação Técnica",description:"Dados técnicos, estudos e documentação preparada para o Data Room Virtual",color:"bg-amber-50 border-amber-200",iconColor:"text-amber-600"}],ha=[{key:"all",labelKey:"common.all",icon:J},{key:"legislation",labelKey:"common.categories.legislation",icon:Os},{key:"contracts",labelKey:"common.categories.contracts",icon:Ns},{key:"brochures",labelKey:"common.categories.brochures",icon:Vs},{key:"technical",labelKey:"common.categories.technical",icon:ys},{key:"general",labelKey:"common.categories.general",icon:We}];function pa(s){return s?s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`:"â"}function ja(s){var m;return((m=ha.find(o=>o.key===s))==null?void 0:m.icon)||J}function fa(s){var o;return((o=s.split(".").pop())==null?void 0:o.toUpperCase().split("?")[0])||"FILE"}function ga(s){switch(s){case"PDF":return"bg-destructive/10 text-destructive";case"DOC":case"DOCX":return"bg-status-info/10 text-status-info-foreground";case"XLS":case"XLSX":return"bg-status-success/10 text-status-success-foreground";default:return"bg-muted text-muted-foreground"}}function hs(){var p,k;const{t:s}=Te(),[m,o]=N.useState(""),{data:r=[],isLoading:_,isError:l,refetch:P}=Ks(),B=us.reduce((h,S)=>(h[S.key]=r.filter(i=>i.document_section===S.key||!i.document_section&&S.key==="conhecer_angola"),h),{}),d=us.map(h=>{const S=B[h.key]||[],i=m?S.filter(T=>T.document_name.toLowerCase().includes(m.toLowerCase())||(T.description||"").toLowerCase().includes(m.toLowerCase())):S;return{...h,docs:i}}).filter(h=>h.docs.length>0),E=((p=d.find(h=>h.key==="preparar_candidatura"))==null?void 0:p.key)||((k=d[0])==null?void 0:k.key),M=h=>{const S=ja(h.category||"general"),i=fa(h.file_url);return e.jsx(j,{className:"group hover:border-primary/30 transition-all",children:e.jsx(f,{className:"p-4",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(S,{className:"w-6 h-6 text-primary"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h4",{className:"font-medium text-foreground group-hover:text-primary transition-colors line-clamp-1",children:h.document_name}),e.jsx(v,{className:`${ga(i)} text-xs flex-shrink-0`,children:i})]}),h.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:h.description}),e.jsxs("div",{className:"flex items-center justify-between mt-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsx("span",{children:pa(h.file_size_bytes)}),e.jsx("span",{children:"â¢"}),e.jsx("span",{children:new Date(h.created_at).toLocaleDateString("pt-AO",{year:"numeric",month:"short",day:"numeric"})})]}),e.jsx(A,{variant:"ghost",size:"sm",className:"h-8 px-3",asChild:!0,children:e.jsxs("a",{href:h.file_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ks,{className:"w-4 h-4 mr-1"}),s("investorPortal.download")]})})]})]})]})})},h.id)};return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ye,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground","aria-hidden":"true"}),e.jsx(I,{placeholder:s("investorPortal.searchDocuments"),"aria-label":s("investorPortal.searchDocuments"),value:m,onChange:h=>o(h.target.value),className:"pl-12 h-11 text-base"})]}),_&&e.jsx("div",{className:"flex justify-center py-20",children:e.jsx(se,{className:"w-8 h-8 animate-spin text-primary"})}),!_&&l&&e.jsx(j,{className:"py-12 border-destructive/30",children:e.jsxs(f,{className:"text-center",children:[e.jsx(Ee,{className:"w-12 h-12 text-destructive mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-2",children:s("investorPortal.loadError")}),e.jsx("p",{className:"text-muted-foreground mb-4",children:s("investorPortal.loadErrorDescription")}),e.jsx(A,{variant:"outline",onClick:()=>P(),children:s("investorPortal.retry")})]})}),!_&&!l&&e.jsxs(e.Fragment,{children:[e.jsx(X,{delay:.05,children:e.jsx(Qe,{type:"multiple",defaultValue:E?[E]:[],className:"space-y-4",children:d.map(h=>{const S=h.icon;return e.jsxs(Ve,{value:h.key,className:"border-none",children:[e.jsx(He,{className:`rounded-lg border-2 ${h.color} px-5 py-4 text-left hover:no-underline`,children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("div",{className:`w-14 h-14 roun
7ded-lg ${h.color} flex items-center justify-center`,children:e.jsx(S,{className:`w-7 h-7 ${h.iconColor}`})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:h.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:h.description}),e.jsxs(v,{variant:"secondary",className:"mt-2",children:[h.docs.length," documento",h.docs.length!==1?"s":""]})]})]})}),e.jsx(Xe,{className:"pt-4",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 ml-2",children:h.docs.map(i=>M(i))})})]},h.key)})})}),d.length===0&&e.jsx(j,{className:"py-12",children:e.jsxs(f,{className:"text-center",children:[e.jsx(J,{className:"w-12 h-12 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-2",children:s("investorPortal.noDocuments")}),e.jsx("p",{className:"text-muted-foreground",children:s("investorPortal.adjustSearch")})]})})]})]})}const ps={submitted:{label:"Submetida",className:"bg-status-info/10 text-status-info-foreground border-status-info/20",icon:Gs},under_review:{label:"Em análise",className:"bg-status-warning/10 text-status-warning-foreground border-status-warning/20",icon:Ys},accepted:{label:"Aceite",className:"bg-status-success/10 text-status-success-foreground border-status-success/20",icon:Je},rejected:{label:"Rejeitada",className:"bg-destructive/10 text-destructive border-destructive/20",icon:ea},more_info_requested:{label:"Informação complementar",className:"bg-primary/10 text-primary border-primary/20",icon:Ee}};function va(s){try{return JSON.parse(s)}catch{return null}}function js(s){return ps[s]??ps.submitted}function Na(){const{t:s}=Te(),m=vs(),[o,r]=Ds(),[_,l]=N.useState(""),[P,B]=N.useState("all"),[d,E]=N.useState("all"),[M,p]=N.useState("all"),[k,h]=N.useState("name_asc"),[S,i]=N.useState(null),[T,g]=N.useState(null),[R,L]=N.useState([]),[Z,c]=N.useState(""),[b,y]=N.useState({opportunity_ref_id:"",representative_name:"",representative_role:"",representative_phone:"",representative_email:"",declared_interest:"",observations:"",declaration_accepted:!1}),{data:x,isLoading:U}=Q({queryKey:["investor-my-registration"],queryFn:()=>Ne.getMyRegistration()}),{data:te,isLoading:he}=Q({queryKey:["investor-manifestations"],queryFn:()=>Ce.listMine()}),{data:V}=Q({queryKey:["investor-manifestation-settings"],queryFn:()=>Ne.getManifestationSettings()}),{data:q,isLoading:me}=Q({queryKey:["investor-manifestation-detail",T],queryFn:()=>Ce.getMine(T),enabled:!!T}),{data:re=[],isLoading:ye}=Cs(),W=(te==null?void 0:te.data)??[];N.useEffect(()=>{x&&y(a=>({...a,representative_name:a.representative_name||x.full_name||"",representative_role:a.representative_role||x.position||"",representative_phone:a.representative_phone||x.phone||"",representative_email:a.representative_email||x.email||""}))},[x]);const be=N.useMemo(()=>new Set(W.map(a=>a.opportunity_ref_id)),[W]),pe=N.useMemo(()=>re.filter(a=>a.publication_status!=="archived"),[re]),Y=N.useMemo(()=>{const a=_.trim().toLowerCase();return[...pe.filter(w=>{const C=!a||[w.name,w.basin,w.operator].some(Re=>Re==null?void 0:Re.toLowerCase().includes(a)),G=P==="all"||w.basinKey===P,ne=d==="all"||w.typeKey===d,$e=M==="all"||(w.offer_type||"").toLowerCase()===M;return C&&G&&ne&&$e})].sort((w,C)=>k==="area_desc"?(C.area_km2||0)-(w.area_km2||0):k==="area_asc"?(w.area_km2||0)-(C.area_km2||0):k==="basin_asc"?(w.basin||"").localeCompare(C.basin||""):(w.name||"").localeCompare(C.name||""))},[pe,_,P,d,M,k]),je=N.useMemo(()=>{const a={available_now:[],submitted_by_company:[],blocked_by_governance:[],not_eligible_now:[]};return Y.forEach(n=>{const w=be.has(n.id),C=n.allows_manifestation!==!1,G=n.offer_type==="tender"||["available","negotiating"].includes(n.statusKey);if(w){a.submitted_by_company.push(n);return}if(!C){a.blocked_by_governance.push(n);return}if(G){a.available_now.push(n);return}a.not_eligible_now.push(n)}),a},[Y,be]),qe=N.useMemo(()=>{const a=new Map;return pe.forEach(n=>a.set(n.basinKey,n.basin)),Array.from(a.entries()).map(([n,w])=>({value:n,label:w}))},[pe]);N.useEffect(()=>{const a=o.get("opportunityId");if(!a||re.length===0||S)return;const n=re.find(w=>w.id===a);if(n){_e(n);const w=new URLSearchParams(o);w.delete("opportunityId"),r(w,{replace:!0})}},[o,re,S,r]);const xe=N.useMemo(()=>W.map(a=>({...a,opportunity:va(a.opportunity_snapshot)})),[W]),we=ke({mutationFn:a=>Ce.submit(a),onSuccess:a=>{O.success(`Manifestação submetida com sucesso (${a.submission_no}
7).`),m.invalidateQueries({queryKey:["investor-manifestations"]}),i(null),y(n=>({...n,opportunity_ref_id:"",declared_interest:"",observations:"",declaration_accepted:!1,attachments:[]})),L([])},onError:a=>{O.error(a.message||"Não foi possÃvel submeter a manifestação.")}}),fe=ke({mutationFn:a=>Ce.respond(a.id,a.message),onSuccess:()=>{O.success("Resposta enviada com sucesso."),m.invalidateQueries({queryKey:["investor-manifestations"]}),m.invalidateQueries({queryKey:["investor-manifestation-detail",T]}),m.invalidateQueries({queryKey:["investor-notifications"]}),c("")},onError:a=>{O.error(a.message||"Não foi possÃvel enviar a resposta.")}}),_e=a=>{i(a),y(n=>({...n,opportunity_ref_id:a.id,representative_name:(x==null?void 0:x.full_name)||n.representative_name,representative_role:(x==null?void 0:x.position)||n.representative_role,representative_phone:(x==null?void 0:x.phone)||n.representative_phone,representative_email:(x==null?void 0:x.email)||n.representative_email,declared_interest:"",observations:"",declaration_accepted:!1,attachments:[]})),L([])},t=(x==null?void 0:x.status)==="approved",D=N.useMemo(()=>x?[["company_name","Nome da empresa"],["country","PaÃs"],["full_name","Contacto principal"],["email","E-mail institucional"],["nif","NIF/Identificação Fiscal"],["primary_interest","Sector / interesse principal"]].filter(([n])=>!x[n]).map(([,n])=>n):[],[x]),H=()=>{if(S){if(!b.representative_name||!b.representative_email||!b.declared_interest.trim()){O.error("Preencha os campos obrigatórios.");return}(async()=>{var a;try{const n=[];for(const w of R){const C=await qs.upload("investor-manifestations",w.file);n.push({file_name:C.original||C.filename,file_url:C.url,mime_type:C.mime_type,size_bytes:C.size})}we.mutate({...b,opportunity_ref_id:S.id,declared_interest:b.declared_interest.trim(),observations:((a=b.observations)==null?void 0:a.trim())||"",attachments:n})}catch(n){O.error(n instanceof Error?n.message:"Falha no upload dos anexos.")}})()}},ge=(V==null?void 0:V.manifestation_allowed_mime_types)??[],ee=(V==null?void 0:V.manifestation_max_files)??5,Se=(V==null?void 0:V.manifestation_max_file_size_mb)??10,ze=a=>{if(!a||a.length===0)return;const n=Array.from(a),w=[...R];for(const C of n){if(w.length>=ee){O.error(`Máximo de ${ee} anexos permitido.`);break}if(C.size>Se*1024*1024){O.error(`${C.name}: excede o limite de ${Se} MB.`);continue}if(ge.length>0&&!ge.includes(C.type)){O.error(`${C.name}: tipo de ficheiro não permitido.`);continue}w.push({file:C,id:`${C.name}-${C.size}-${C.lastModified}`})}L(w)};return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsx(j,{className:"border-primary/15 bg-primary/5",children:e.jsxs(f,{className:"pt-6",children:[e.jsx("div",{className:"text-2xl font-bold text-primary",children:W.length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("investorPortal.manifestations.total","Total de manifestações")})]})}),e.jsx(j,{children:e.jsxs(f,{className:"pt-6",children:[e.jsx("div",{className:"text-2xl font-bold",children:W.filter(a=>a.current_status==="under_review").length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("investorPortal.manifestations.underReview","Em análise")})]})}),e.jsx(j,{children:e.jsxs(f,{className:"pt-6",children:[e.jsx("div",{className:"text-2xl font-bold",children:W.filter(a=>a.current_status==="accepted").length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("investorPortal.manifestations.accepted","Aceites")})]})})]}),U?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(se,{className:"w-8 h-8 animate-spin text-primary"})}):x?!t||D.length>0?e.jsx(j,{className:"border-status-warning/30 bg-status-warning/5",children:e.jsx(f,{className:"pt-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ee,{className:"w-5 h-5 text-status-warning mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("investorPortal.manifestations.completeProfileTitle","Complete o perfil da empresa para prosseguir")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:D.length>0?`Campos em falta: ${D.join(", ")}.`:"A conta deve estar aprovada para submeter uma manifestação de interesse."})]})]})})}):null:e.jsx(j,{className:"border-destructive/20",children:e.jsxs(f,{className:"pt-6 text-center",children:[e.jsx(Ee,{className:"w-10 h-10 text-destructive mx-auto mb-3"}),e.jsx("p",{className:"font-medium",children:"Não foi encontrado um registo de investidor associado à sua conta."})]})}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(v,{variant:"outline",className:"mb-3",children:s("investorPortal.manifestations.historyLabel","Histórico")}),e.jsx("h3",{className:"text-2xl font-bold text-foreground",children:s("investorPortal.manifestations.historyTitle","Minhas Manifestações")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("investorPortal.manifestations.historySubtitle","Acompanhe o estado e os dados registados em cada oportunidade.")})]}),he?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(se,{className:"w-8 h-8 animate-spin text-primary"})}):xe.length===0?e.jsx(j,{className:"py-10",children:e.jsxs(f,{className:"text-center",children:[e.jsx(la,{className:"w-10 h-10 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"font-medium",children:s("investorPortal.manifestations.emptyTitle","Ainda não submeteu nenhuma manifestação")})]})}):e.jsx(Qe,{type:"single",collapsible:!0,className:"space-y-3",children:xe.map(a=>{var C,G,ne;const n=js(a.current_status),w=n.icon;return e.jsxs(Ve,{value:a.id,className:"border rounded-xl px-4",children:[e.jsx(He,{className:"hover:no-underline",children:e.jsxs("div",{className:"text-left",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-2",children:[e.jsx("span",{className:"font-semibold text-foreground",children:((C=a.opportunity)==null?void 0:C.title)||a.opportunity_ref_id}),e.jsxs(v,{className:n.className,children:[e.jsx(w,{className:"w-3 h-3 mr-1"}),n.label]}),e.jsxs(A,{variant:"ghost",size:"sm",onClick:$e=>{$e.stopPropagation(),g(a.id)},children:[e.jsx(Oe,{className:"w-4 h-4 mr-1"}),"Detalhe"]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.submission_no," · ",new Date(a.submitted_at).toLocaleStr
7ing("pt-AO")]})]})}),e.jsxs(Xe,{children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Empresa:"})," ",a.company_name]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Representante:"})," ",a.representative_name]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Email:"})," ",a.representative_email]}),a.representative_role&&e.jsxs("p",{children:[e.jsx("strong",{children:"Cargo:"})," ",a.representative_role]})]}),e.jsxs("div",{className:"space-y-2 text-sm",children:[((G=a.opportunity)==null?void 0:G.basin)&&e.jsxs("p",{children:[e.jsx("strong",{children:"Bacia:"})," ",a.opportunity.basin]}),((ne=a.opportunity)==null?void 0:ne.offer_type)&&e.jsxs("p",{children:[e.jsx("strong",{children:"Tipo:"})," ",a.opportunity.offer_type]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Ãltima actualização:"})," ",new Date(a.last_status_at).toLocaleString("pt-AO")]})]})]}),e.jsxs("div",{className:"mt-4 space-y-2 text-sm",children:[e.jsx("p",{children:e.jsx("strong",{children:"Interesse declarado:"})}),e.jsx("p",{className:"text-muted-foreground",children:a.declared_interest}),a.observations&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-3",children:e.jsx("strong",{children:"Observações:"})}),e.jsx("p",{className:"text-muted-foreground",children:a.observations})]}),a.review_message&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-3",children:e.jsx("strong",{children:"Nota de revisão:"})}),e.jsx("p",{className:"text-muted-foreground",children:a.review_message})]})]})]})]},a.id)})})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(v,{variant:"outline",className:"mb-3",children:s("investorPortal.manifestations.opportunitiesLabel","Oportunidades elegÃveis")}),e.jsx("h3",{className:"text-2xl font-bold text-foreground",children:s("investorPortal.manifestations.opportunitiesTitle","Manifestar Interesse")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("investorPortal.manifestations.opportunitiesSubtitle","Seleccione uma oportunidade e submeta o interesse formal da sua organização.")})]}),e.jsxs("div",{className:"relative w-full md:w-80",children:[e.jsx(Ye,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(I,{value:_,onChange:a=>l(a.target.value),placeholder:"Pesquisar bloco, bacia ou operador",className:"pl-10"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-3",children:[e.jsxs(le,{value:P,onValueChange:B,children:[e.jsx(ce,{children:e.jsx(oe,{placeholder:"Bacia"})}),e.jsxs(de,{children:[e.jsx(K,{value:"all",children:"Todas as bacias"}),qe.map(a=>e.jsx(K,{value:a.value,children:a.label},a.value))]})]}),e.jsxs(le,{value:d,onValueChange:E,children:[e.jsx(ce,{children:e.jsx(oe,{placeholder:"Tipo"})}),e.jsxs(de,{children:[e.jsx(K,{value:"all",children:"Todos os tipos"}),e.jsx(K,{value:"onshore",children:"Onshore"}),e.jsx(K,{value:"shallow",children:"Ãguas Rasas"}),e.jsx(K,{value:"deep",children:"Ãguas Profundas"}),e.jsx(K,{value:"ultra-deep",children:"Ãguas Ultra-Profundas"})]})]}),e.jsxs(le,{value:M,onValueChange:p,children:[e.jsx(ce,{children:e.jsx(oe,{placeholder:"Regime"})}),e.jsxs(de,{children:[e.jsx(K,{value:"all",children:"Todos os regimes"}),e.jsx(K,{value:"tender",children:"Licitação"}),e.jsx(K,{value:"permanent_offer",children:"Oferta Permanente"})]})]}),e.jsxs(le,{value:k,onValueChange:h,children:[e.jsx(ce,{children:e.jsx(oe,{placeholder:"Ordenar"})}),e.jsxs(de,{children:[e.jsx(K,{value:"name_asc",children:"Nome (A-Z)"}),e.jsx(K,{value:"basin_asc",children:"Bacia (A-Z)"}),e.jsx(K,{value:"area_desc",children:"Ãrea (maior primeiro)"}),e.jsx(K,{value:"area_asc",children:"Ãrea (menor primeiro)"})]})]})]}),ye?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(se,{className:"w-8 h-8 animate-spin text-primary"})}):e.jsx(Qe,{type:"multiple",defaultValue:[],className:"space-y-3",children:[{key:"available_now",title:"DisponÃveis para Manifestação",items:je.available_now},{key:"submitted_by_company",title:"Já Manifestadas pela Minha Empresa",items:je.submitted_by_company},{key:"blocked_by_governance",title:"Consulta DisponÃvel, Manifestação Desactivada",items:je.blocked_by_governance},{key:"not_eligible_now",title:"Não ElegÃveis neste Momento",items:je.n
7ot_eligible_now}].map(a=>e.jsxs(Ve,{value:a.key,className:"border rounded-xl px-4",children:[e.jsx(He,{className:"hover:no-underline",children:e.jsxs("div",{className:"flex items-center gap-3 text-left",children:[e.jsx("span",{className:"font-semibold",children:a.title}),e.jsx(v,{variant:"outline",children:a.items.length})]})}),e.jsx(Xe,{children:a.items.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-2",children:"Sem oportunidades neste agrupamento."}):e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:a.items.map(n=>{const w=be.has(n.id),C=n.offer_type==="tender"||["available","negotiating"].includes(n.statusKey),G=n.allows_manifestation!==!1,ne=t&&D.length===0&&!w&&G&&C;return e.jsxs(j,{className:"border-primary/10",children:[e.jsxs(z,{children:[e.jsx($,{className:"text-lg",children:n.name}),e.jsxs(De,{children:[n.basin," · ",n.type]})]}),e.jsxs(f,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2 text-xs",children:[e.jsx(v,{variant:"secondary",children:n.status}),e.jsx(v,{variant:ne?"default":"outline",children:w?"Já manifestada":ne?"ElegÃvel para manifestação":"Não elegÃvel"}),!G&&e.jsx(v,{variant:"outline",children:"Manifestação desactivada"}),n.operator&&e.jsx(v,{variant:"outline",children:n.operator})]}),!G&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"A manifestação para esta oportunidade foi desactivada pela gestão de conteúdo."}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx(Ae,{className:"w-4 h-4"}),n.area_km2?`${n.area_km2.toLocaleString("pt-AO")} km²`:"Ãrea não indicada"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{variant:"outline",size:"sm",asChild:!0,children:e.jsx(ue,{to:`/portal-investidor/oportunidades/${Us(n.name,n.id)}`,children:"Ver detalhe"})}),e.jsx(A,{size:"sm",onClick:()=>_e(n),disabled:!ne,children:w?"Já submetida":"Manifestar Interesse"})]})]})]})]},n.id)})})})]},a.key))}),!ye&&Y.length>0&&e.jsxs("p",{className:"text-sm text-muted-foreground pt-2",children:[Y.length," oportunidade(s) encontradas no total"]})]}),e.jsx(ss,{open:!!S,onOpenChange:a=>!a&&i(null),children:e.jsxs(as,{className:"sm:max-w-2xl",children:[e.jsxs(ts,{children:[e.jsx(rs,{children:S?`Manifestar Interesse â ${S.name}`:"Manifestar Interesse"}),e.jsx(ns,{children:"Registo formal de interesse da sua organização para a oportunidade seleccionada."})]}),e.jsxs("div",{className:"space-y-5",children:[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,{children:"Empresa"}),e.jsx(I,{value:(x==null?void 0:x.company_name)||"",disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{children:"PaÃs"}),e.jsx(I,{value:(x==null?void 0:x.country)||"",disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{children:"NIF"}),e.jsx(I,{value:(x==null?void 0:x.nif)||"",disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{children:"Email institucional"}),e.jsx(I,{value:(x==null?void 0:x.email)||"",disabled:!0})]})]}),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:"mi-representative-name",children:"Nome completo *"}),e.jsx(I,{id:"mi-representative-name",value:b.representative_name,onChange:a=>y(n=>({...n,representative_name:a.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"mi-representative-role",children:"Cargo"}),e.jsx(I,{id:"mi-representative-role",value:b.representative_role||"",onChange:a=>y(n=>({...n,representative_role:a.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"mi-representative-phone",children:"Telefone"}),e.jsx(I,{id:"mi-representative-phone",value:b.representative_phone||"",onChange:a=>y(n=>({...n,representative_phone:a.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"mi-representative-email",children:"Email *"}),e.jsx(I,{id:"mi-representative-email",type:"email",value:b.representative_email,onChange:a=>y(n=>({...n,representative_email:a.target.value}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"mi-declared-interest",children:"Descreva resumidamente o interesse da sua organização nesta oportunidade. *"}),e.jsx(Fe,{id:"mi-declared-interest",rows:5,value:b.declared_interest,onChange:a=>y(n=>({...n,declared_interest:a.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"mi-observations",children:"Observações"}),e.jsx(Fe,{id:"mi-observations",rows:3,value:b.observations||"",onChange:a=>y(n=>({...n,observations:a.target.value}))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(F,{htmlFor:"mi-attachments",children:"Anexos"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Até ",ee," ficheiros, ",Se," MB por ficheiro. Tipos permitidos: PDF, DOCX, XLSX, ZIP."]})]}),e.jsx(A,{type:"button",variant:"outline",asChild:!0,children:e.jsxs("label",{htmlFor:"mi-attachments",className:"cursor-pointer",children:[e.jsx(Zs,{className:"w-4 h-4 mr-2"}),"Adicionar ficheiros"]})})]}),e.jsx(I,{id:"mi-attachments",type:"file",multiple:!0,className:"hidden",onChange:a=>{ze(a.target.files),a.currentTarget.value=""}}),R.length>0&&e.jsx("div",{className:"space-y-2 rounded-lg border p-3",children:R.map(a=>e.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(cs,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("span",{className:"truncate",children:a.file.name}),e.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[(a.file.size/1024/1024).toFixed(2)," MB"]})]}),e.jsx(A,{type:"button",variant:"ghost",size:"sm",onClick:()=>L(n=>n.filter(w=>w.id!==a.id)),children:e.jsx(Ws,{className:"w-4 h-4"})})]},a.id))})]}),e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border p-3",children:[e.jsx(Hs,{id:"mi-declaration",checked:b.declaration_accepted,onCheckedChange:a=>y(n=>({...n,declaration_accepted:a===!0}))}),e.jsx(F,{htmlFor:"mi-declaration",className:"leading-6",children:"Declaro que as informações submetidas são verdadeiras e que a organização tem interesse em acompanhar esta oportunidade."})]})]}),e.jsxs(Is,{children:[e.jsx(A,{variant:"outline",onClick:()=>i(null),children:"Cancelar"}),e.jsxs(A,{onClick:H,disabled:we.isPending,children:[we.isPending?e.jsx(se,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(os,{className:"w-4 h-4 mr-2"}),"Submeter Manifestação"]})]})]})}),e.jsx(ss,{open:!!T,onOpenChange:a=>!a&&g(null),children:e.jsxs(as,{className:"sm:max-w-3xl",children:[e.jsxs(ts,{children:[e.jsx(rs,{children:"Processo da Manifestação de Interesse"}),e.jsx(ns,{children:"Histórico, anexos e comunicação associados à submissão."})]}),me?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(se,{className:"w-8 h-8 animate-spin text-primary"})}):q?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Número:"})," ",q.data.submission_no]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Estado:"})," ",js(q.data.current_status).label]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{children:"Mensagens do processo"}),e.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto rounded-lg border p-3",children:q.messages.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sem mensagens registadas."}):q.messages.map(a=>e.jsxs("div",{className:"rounded-md border p-3 text-sm",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-1",children:[e.jsx("span",{className:"font-medium",children:a.sender_name||(a.sender_type==="admin"?"ANPG":"Investidor")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(a.created_at).toLocaleStr
7ing("pt-AO")})]}),e.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap",children:a.body})]},a.id))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{children:"Anexos"}),e.jsx("div",{className:"space-y-2 rounded-lg border p-3",children:q.attachments.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sem anexos associados."}):q.attachments.map(a=>e.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(cs,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("a",{href:a.file_url,target:"_blank",rel:"noopener noreferrer",className:"truncate text-primary hover:underline",children:a.file_name})]}),e.jsx(v,{variant:"outline",children:a.scan_status})]},a.id))})]}),q.data.current_status==="more_info_requested"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"mi-reply-message",children:"Responder ao pedido de informação complementar"}),e.jsx(Fe,{id:"mi-reply-message",rows:4,value:Z,onChange:a=>c(a.target.value)}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(A,{onClick:()=>{if(!Z.trim()){O.error("Introduza a resposta para continuar.");return}fe.mutate({id:q.data.id,message:Z.trim()})},disabled:fe.isPending,children:[fe.isPending?e.jsx(se,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(os,{className:"w-4 h-4 mr-2"}),"Enviar resposta"]})})]})]}):null]})})]})}const ya=["09:00","09:30","10:00","10:30","11:00","11:30","14:00","14:30","15:00","15:30","16:00","16:30"],fs=[{value:"block-interest",labelKey:"meetingScheduler.topics.blockInterest"},{value:"data-access",labelKey:"meetingScheduler.topics.dataAccess"},{value:"partnership",labelKey:"meetingScheduler.topics.partnership"},{value:"tender-info",labelKey:"meetingScheduler.topics.tenderInfo"},{value:"general",labelKey:"meetingScheduler.topics.general"}];function gs(){var Z;const{t:s,i18n:m}=Te(),{profile:o,user:r}=Ge(),[_,l]=N.useState("date"),[P,B]=N.useState(!1),[d,E]=N.useState({date:void 0,time:"",name:"",company:"",email:"",phone:"",topic:"",message:""});N.useEffect(()=>{const c=(o==null?void 0:o.full_name)||"",b=(o==null?void 0:o.email)||(r==null?void 0:r.email)||"";E(y=>({...y,name:y.name||c,email:y.email||b}))},[o==null?void 0:o.full_name,o==null?void 0:o.email,r==null?void 0:r.email]);const M=m.language==="pt"?Ie:Ps,p=(c,b)=>{E(y=>({...y,[c]:b}))},k=c=>{p("date",c),c&&l("time")},h=c=>{p("time",c),l("details")},S=async()=>{const c=d.name.trim(),b=d.company.trim(),y=d.email.trim();if(!c||!b||!y||!d.topic){O.error(s("meetingScheduler.validation.required"));return}if(c.length<3){O.error(s("meetingScheduler.validation.nameTooShort","Introduza o nome completo (mÃnimo 3 caracteres)."));return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(y)){O.error(s("meetingScheduler.validation.invalidEmail"));return}const U=d.phone.trim();if(U&&!/^[+0-9][0-9\s()-]{6,19}$/.test(U)){O.error(s("meetingScheduler.validation.invalidPhone","Número de telefone inválido."));return}if(!d.date||!d.time){O.error(s("meetingScheduler.validation.required"));return}B(!0);try{await Ne.bookMeeting({full_name:c,company:b,email:y,phone:U||void 0,topic:d.topic,message:d.message.trim()||void 0,meeting_date:ae(d.date,"yyyy-MM-dd"),meeting_time:d.time}),l("confirmation"),O.success(s("meetingScheduler.successToast"))}catch{O.error(s("meetingScheduler.errorToast"))}finally{B(!1)}},i=()=>{E({date:void 0,time:"",name:(o==null?void 0:o.full_name)||"",company:"",email:(o==null?void 0:o.email)||(r==null?void 0:r.email)||"",phone:"",topic:"",message:""}),l("date")},T=c=>{const b=c.getDay();return b===0||b===6},g=c=>{const b=new Date;return b.setHours(0,0,0,0),c<b},R=[{id:"date",labelKey:"meetingScheduler.steps.date",icon:Ue},{id:"time",labelKey:"meetingScheduler.steps.time",icon:ms},{id:"details",labelKey:"meetingScheduler.steps.details",icon:J},{id:"confirmation",labelKey:"meetingScheduler.steps.confirmation",icon:Je}],L=R.findIndex(c=>c.id===_);return e.jsxs(j,{className:"overflow-hidden",children:[e.jsxs(z,{className:"bg-gradient-to-r from-primary/5 to-transparent",children:[e.jsxs($,{className:"flex items-center gap-2",children:[e.jsx(Ue,{className:"w-5 h-5 text-primary"}),s("meetingScheduler.title")]}),e.jsx(De,{children:s("meetingScheduler.description")})]}),e.jsxs(f,{className:"p-6",children:[e.jsx("div",{className:"flex items-center justify-between mb-8",children:R.map((c,b)=>{const y=c.icon,x=b===L,U=b<L;return e.jsxs("div",{className:"flex items-center",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:Le("w-10 h-10 rounded-full flex items-center justify-center border-2 transition-all",x&&"border-primary bg-primary text-primary-foreground",U&&"border-primary bg-primary/10 text-primary",!x&&!U&&"border-muted-foreground
7/30 text-muted-foreground/50"),children:e.jsx(y,{className:"w-5 h-5"})}),e.jsx("span",{className:Le("text-xs mt-2 font-medium hidden sm:block",x&&"text-primary",U&&"text-primary",!x&&!U&&"text-muted-foreground/50"),children:s(c.labelKey)})]}),b<R.length-1&&e.jsx("div",{className:Le("w-12 md:w-24 h-0.5 mx-2",b<L?"bg-primary":"bg-muted-foreground/20")})]},c.id)})}),e.jsxs("div",{className:"min-h-[400px]",children:[_==="date"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-semibold text-lg",children:s("meetingScheduler.selectDate")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("meetingScheduler.selectDateDesc")}),e.jsx("div",{className:"flex justify-center",children:e.jsx(sa,{mode:"single",selected:d.date,onSelect:k,locale:M,disabled:c=>T(c)||g(c),className:"rounded-xl border shadow-sm pointer-events-auto"})})]}),_==="time"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg",children:s("meetingScheduler.selectTime")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.date&&ae(d.date,"EEEE, d MMMM yyyy",{locale:M})})]}),e.jsxs(A,{variant:"ghost",size:"sm",onClick:()=>l("date"),children:[e.jsx(ds,{className:"w-4 h-4 mr-2"}),s("meetingScheduler.changeDate")]})]}),e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 gap-3 mt-6",children:ya.map(c=>e.jsx(A,{variant:d.time===c?"default":"outline",className:"h-12",onClick:()=>h(c),children:c},c))}),e.jsx("p",{className:"text-xs text-muted-foreground text-center mt-4",children:s("meetingScheduler.timezone")})]}),_==="details"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg",children:s("meetingScheduler.yourDetails")}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[d.date&&ae(d.date,"d MMM yyyy",{locale:M})," ",s("meetingScheduler.at")," ",d.time]})]}),e.jsxs(A,{variant:"ghost",size:"sm",onClick:()=>l("time"),children:[e.jsx(ds,{className:"w-4 h-4 mr-2"}),s("meetingScheduler.changeTime")]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(F,{htmlFor:"name",className:"flex items-center gap-2",children:[e.jsx(Ze,{className:"w-4 h-4"}),s("meetingScheduler.form.name")," *"]}),e.jsx(I,{id:"name",value:d.name,onChange:c=>p("name",c.target.value),placeholder:s("meetingScheduler.form.namePlaceholder")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(F,{htmlFor:"company",className:"flex items-center gap-2",children:[e.jsx(Ae,{className:"w-4 h-4"}),s("meetingScheduler.form.company")," *"]}),e.jsx(I,{id:"company",value:d.company,onChange:c=>p("company",c.target.value),placeholder:s("meetingScheduler.form.companyPlaceholder")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(F,{htmlFor:"email",className:"flex items-center gap-2",children:[e.jsx(zs,{className:"w-4 h-4"}),s("meetingScheduler.form.email")," *"]}),e.jsx(I,{id:"email",type:"email",value:d.email,onChange:c=>p("email",c.target.value),placeholder:s("meetingScheduler.form.emailPlaceholder"),readOnly:!!(o!=null&&o.email||r!=null&&r.email),className:Le(((o==null?void 0:o.email)||(r==null?void 0:r.email))&&"bg-muted/50 cursor-not-allowed")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"phone",children:s("meetingScheduler.form.phone")}),e.jsx(I,{id:"phone",type:"tel",value:d.phone,onChange:c=>p("phone",c.target.value),placeholder:s("meetingScheduler.form.phonePlaceholder")})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(F,{htmlFor:"topic",className:"flex items-center gap-2",children:[e.jsx(J,{className:"w-4 h-4"}),s("meetingScheduler.form.topic")," *"]}),e.jsxs(le,{value:d.topic,onValueChange:c=>p("topic",c),children:[e.jsx(ce,{children:e.jsx(oe,{placeholder:s("meetingScheduler.form.topicPlaceholder")})}),e.jsx(de,{children:fs.map(c=>e.jsx(K,{value:c.value,children:s(c.labelKey)},c.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"message",children:s("meetingScheduler.form.message")}),e.jsx(Fe,{id:"message",value:d.message,onChange:c=>p("message",c.target.value),placeholder:s("meetingScheduler.form.messagePlaceholder"),rows:4})]}),e.jsx(A,{onClick:S,className:"w-full",size:"lg",disabled:P,children:P?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2 animate-spin"}),s("meetingScheduler.submitting")]}):e.jsxs(e.Fragment,{children:[s("meetingScheduler.submit"),e.jsx(Be,{className:"w-4 h-4 ml-2"})]})})]}),_==="confirmation"&&e.jsxs("div",{className:"text-center space-y-6 py-8",children:[e.jsx("div",{className:"w-20 h-20 rounded-full bg-status-success/10 flex items-center justify-center mx-auto",children:e.jsx(Je,{className:"w-10 h-10 text-status-success"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-2xl mb-2",children:s("meetingScheduler.confirmation.title")}),e.jsx("p",{className:"text-muted-foreground",children:s("meetingScheduler.confirmation.subtitle")})]}),e.jsx(j,{className:"bg-muted/50 text-left max-w-md mx-auto",children:e.jsxs(f,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ue,{className:"w-5 h-5 text-primary"}),e.jsx("span",{children:d.date&&ae(d.date,"EEEE, d MMMM yyyy",{locale:M})})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ms,{className:"w-5 h-5 text-primary"}
7),e.jsxs("span",{children:[d.time," (WAT)"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ze,{className:"w-5 h-5 text-primary"}),e.jsx("span",{children:d.name})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ae,{className:"w-5 h-5 text-primary"}),e.jsx("span",{children:d.company})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(J,{className:"w-5 h-5 text-primary"}),e.jsx(v,{variant:"secondary",children:s(((Z=fs.find(c=>c.value===d.topic))==null?void 0:Z.labelKey)||"")})]})]})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("meetingScheduler.confirmation.emailNote")}),e.jsx(A,{variant:"outline",onClick:i,children:s("meetingScheduler.confirmation.scheduleAnother")})]})]})]})]})}function ba(s){return s==="approved"?e.jsx(v,{className:"bg-status-success text-white",children:"Aprovado"}):s==="pending"?e.jsx(v,{variant:"outline",children:"Em análise"}):s==="awaiting_documents"?e.jsx(v,{variant:"outline",children:"Aguarda documentos"}):s==="rejected"?e.jsx(v,{variant:"destructive",children:"Rejeitado"}):s==="suspended"?e.jsx(v,{variant:"secondary",children:"Suspenso"}):e.jsx(v,{variant:"secondary",children:s})}function wa(){const[s]=N.useState(()=>{try{return JSON.parse(localStorage.getItem("investor_favorites")||"[]")}catch{return[]}});return{favs:s,count:s.length}}function _a(){var E,M,p,k,h,S,i,T;const{profile:s}=Ge(),{favs:m,count:o}=wa(),{data:r,isLoading:_}=Q({queryKey:["investor-corporate-profile"],queryFn:()=>Ne.getCorporateProfile()});if(_)return e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(se,{className:"w-6 h-6 animate-spin text-muted-foreground"})});const l=r==null?void 0:r.registration,P=(s==null?void 0:s.full_name)||(l==null?void 0:l.full_name)||"Investidor",B=(l==null?void 0:l.company_name)||"Empresa não definida",d=r!=null&&r.compliance?Math.round(r.compliance.completed_items/Math.max(1,r.compliance.total_items)*100):0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsx(j,{className:"lg:col-span-2 border-primary/10",children:e.jsxs(f,{className:"pt-5 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center text-2xl font-bold text-primary",children:P.charAt(0).toUpperCase()}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-lg font-semibold",children:P}),e.jsxs("div",{className:"text-sm text-muted-foreground flex flex-wrap gap-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ae,{className:"w-4 h-4"}),B]}),(l==null?void 0:l.country)&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(We,{className:"w-4 h-4"}),l.country]}),(l==null?void 0:l.entity_type)&&e.jsx("span",{children:l.entity_type})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[(l==null?void 0:l.status)&&ba(l.status),(l==null?void 0:l.trust_score)!=null&&e.jsxs(v,{variant:"outline",children:["Trust Score: ",l.trust_score]})]})]})]}),(l==null?void 0:l.created_at)&&e.jsxs("p",{className:"text-xs text-muted-foreground border-t pt-3",children:["Registo corporativo criado em ",ae(new Date(l.created_at),"dd 'de' MMMM 'de' yyyy",{locale:Ie})]})]})}),e.jsxs(j,{children:[e.jsx(z,{className:"pb-2",children:e.jsx($,{className:"text-sm",children:"Conformidade"})}),e.jsxs(f,{className:"space-y-3",children:[e.jsxs("div",{className:"text-3xl font-bold text-primary",children:[d,"%"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Perfil corporativo completo"}),e.jsx("div",{className:"h-2 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary",style:{width:`${d}%`}})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[((E=r==null?void 0:r.compliance)==null?void 0:E.completed_items)||0," de ",((M=r==null?void 0:r.compliance)==null?void 0:M.total_items)||0," itens obrigatórios"]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs(j,{children:[e.jsx(z,{className:"pb-2",children:e.jsxs($,{className:"text-sm flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4"}),"Checklist de Compliance"]})}),e.jsx(f,{className:"space-y-2",children:(k=(p=r==null?void 0:r.compliance)==null?void 0:p.required)==null?void 0:k.map(g=>e.jsxs("div",{className:"flex items-center justify-between text-sm border rounded-md px-3 py-2",children:[e.jsx("span",{children:g.label}),g.ok?e.jsx(v,{className:"bg-status-success text-white",children:"OK"}):e.jsx(v,{variant:"outline",children:"Pendente"})]},g.key))})]}),e.jsxs(j,{children:[e.jsx(z,{className:"pb-2",children:e.jsxs($,{className:"text-sm flex items-center gap-2",children:[e.jsx(bs,{className:"w-4 h-4"}),"Representantes e Utilizadores"]})}),e.jsx(f,{className:"space-y-2",children:(h=r==null?void 0:r.representatives)!=null&&h.length?r.representatives.map(g=>e.jsxs("div",{className:"border rounded-md px-3 py-2 text-sm",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-medium",children:g.full_name}),e.jsxs("div",{className:"flex items-center gap-1",children:[g.is_primary&&e.jsx(v,{variant:"outline",children:"Primário"}),e.jsx(v,{variant:g.status==="active"?"default":"outline",children:g.status==="active"?"Activo":"Inactivo"})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.email," · ",g.role]})]},g.id)):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sem representantes registados."})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs(j,{children:[e.jsx(z,{className:"pb-2",children:e.jsxs($,{className:"text-sm flex items-center gap-2",children:[e.jsx(aa,{className:"w-4 h-4"}),"Ãreas de Interesse"]})}),e.jsx(f,{children:(S=r==null?void 0:r.interests)!=null&&S.length?e.jsx("div",{className:"flex flex-wrap gap-2",children:r.interests.map(g=>e.jsx(v,{variant:"outline",children:g},g))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sem áreas de interesse definidas."})})]}),e.jsxs(j,{children:[e.jsx(z,{className:"pb-2",children:e.jsxs($,{className:"text-sm flex items-center gap-2",children:[e.jsx(J,{className:"w-4 h-4"}),"Documentação Corporativa"]})}),e.jsx(f,{className:"space-y-2",children:(i=r==null?void 0:r.documents)!=null&&i.length?r.documents.map(g=>e.jsxs("div",{className:"border rounded-md px-3 py-2 text-sm",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-medium",children:g.document_name}),e.jsx(v,{variant:g.status==="valid"?"default":"outline",children:g.status})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.document_type,g.valid_until?` · válido até ${g.valid_until}`:""]})]},g.id)):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sem documentos corporativos registados."})})]})]}),o>0&&e.jsxs(j,{children:[e.jsx(z,{className:"pb-2",children:e.jsx($,{className:"text-sm",children:"Favoritos"})}),e.jsx(f,{className:"flex flex-wrap gap-2",children:m.map(g=>e.jsx(v,{variant:"secondary",children:g},g))})]}),e.jsxs(j,{children:[e.jsx(z,{className:"pb-2",children:e.jsxs($,{className:"text-sm flex items-center gap-2",children:[e.jsx(ta,{className:"w-4 h-4"}),"Timeline Corporativa"]})}),e.jsx(f,{children:(T=r==null?void 0:r.timeline)!=null&&T.length?e.jsx("div",{className:"space-y-2",children:r.timeline.map(g=>e.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border/60 pb-2 last:border-b-0",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm",children:g.label}),e.jsx("p",{className:"text-xs text-muted-foreground uppercase",children:g.kind})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:ae(new Date(g.ts),"dd/MM/yyyy HH:mm")}
7)]},g.id))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sem actividade corporativa recente."})})]}),(l==null?void 0:l.status)==="approved"&&e.jsxs("div",{className:"rounded-lg border border-status-success/30 bg-status-success/5 p-3 text-sm text-status-success-foreground inline-flex items-center gap-2",children:[e.jsx(Ms,{className:"w-4 h-4"}),"Conta corporativa activa e autorizada para operações no Portal do Investidor."]})]})}const Sa={status:Ms,meeting:Me,document:J,system:ve,manifestation:Oe},Ca={status:"text-green-600",meeting:"text-primary",document:"text-blue-600",system:"text-muted-foreground",manifestation:"text-primary"};function ka({userEmail:s}){const m=vs(),{data:o}=Q({queryKey:["investor-notifications",s],queryFn:()=>ie.list(),enabled:!!s}),{data:r}=Q({queryKey:["investor-notification-preferences",s],queryFn:()=>ie.getPreferences(),enabled:!!s}),_=(o==null?void 0:o.data)??[],l=r??{status:!0,meeting:!0,document:!0,system:!0,manifestation:!0,email_enabled:!0},P=N.useMemo(()=>_.filter(p=>l[p.type]),[_,l]),B=N.useMemo(()=>P.filter(p=>!p.is_read).length,[P]),d=ke({mutationFn:p=>ie.updatePreferences(p),onSuccess:()=>{m.invalidateQueries({queryKey:["investor-notification-preferences",s]}),m.invalidateQueries({queryKey:["investor-notifications",s]}),m.invalidateQueries({queryKey:["investor-notifications-bell"]})}}),E=ke({mutationFn:p=>ie.markRead(p),onSuccess:()=>m.invalidateQueries({queryKey:["investor-notifications",s]})}),M=ke({mutationFn:()=>ie.markAllRead(),onSuccess:()=>m.invalidateQueries({queryKey:["investor-notifications",s]})});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(j,{children:e.jsxs(f,{className:"pt-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(na,{className:"w-4 h-4 text-primary"}),e.jsx("p",{className:"text-sm font-medium",children:"Preferências de Notificação"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-sm",children:[{key:"status",label:"Alterações de estado"},{key:"meeting",label:"Reuniões"},{key:"document",label:"Documentos"},{key:"manifestation",label:"Manifestações"},{key:"system",label:"Sistema"},{key:"email_enabled",label:"Resumo por email"}].map(p=>e.jsxs("div",{className:"flex items-center justify-between rounded-md border p-2.5",children:[e.jsx("span",{children:p.label}),e.jsx(ra,{checked:!!l[p.key],onCheckedChange:k=>d.mutate({[p.key]:k}),disabled:d.isPending})]},p.key))})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"w-5 h-5 text-primary"}),e.jsx("h3",{className:"font-semibold",children:"Notificações"}),B>0&&e.jsx(v,{variant:"destructive",className:"text-[10px] px-1.5",children:B})]}),B>0&&e.jsx(A,{variant:"ghost",size:"sm",onClick:()=>M.mutate(),className:"text-xs",children:"Marcar todas como lidas"})]}),P.length===0?e.jsx(j,{children:e.jsxs(f,{className:"py-12 text-center text-muted-foreground",children:[e.jsx(ve,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),e.jsx("p",{className:"text-sm",children:"Sem notificações para os tipos seleccionados"})]})}):e.jsx("div",{className:"space-y-2",children:P.map(p=>{const k=Sa[p.type]??ve,h=Ca[p.type]??"text-muted-foreground";return e.jsxs("div",{className:`flex items-start gap-3 p-4 rounded-lg border cursor-pointer transition-colors 8 ${p.is_read?"bg-background border-border":"bg-primary/5 border-primary/20"}`,onClick:()=>!p.is_read&&E.mutate(p.id),children:[e.jsx(k,{className:`w-4 h-4 mt-0.5 flex-shrink-0 ${h}`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("p",{className:`text-sm font-medium ${p.is_read?"text-foreground":"text-foreground font-semibold"}`,children:[p.title,!p.is_read&&e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-primary ml-2 mb-0.5"})]}),e.jsx("button",{className:"text-muted-foreground hover:text-foreground flex-shrink-0",type:"button",children:e.jsx($s,{className:"w-3.5 h-3.5"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:p.body}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:ae(new Date(p.created_at),"dd MMM yyyy, HH:mm",{locale:Ie})})]})]}
8,p.id)})})]})}function Pa({onClick:s}){const{data:m}=Q({queryKey:["investor-notifications-bell"],queryFn:()=>ie.list()}),{data:o}=Q({queryKey:["investor-notification-preferences-bell"],queryFn:()=>ie.getPreferences()}),r=o??{status:!0,meeting:!0,document:!0,system:!0,manifestation:!0,email_enabled:!0},_=((m==null?void 0:m.data)??[]).filter(l=>!l.is_read&&r[l.type]).length;return e.jsxs("button",{onClick:s,className:"relative p-2 rounded-md hover:bg-accent transition-colors",children:[e.jsx(ve,{className:"w-5 h-5 text-muted-foreground"}),_>0&&e.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-4 h-4 rounded-full bg-destructive text-white text-[9px] font-bold flex items-center justify-center",children:_})]})}const Ma={database:ws,"bar-chart":_s,"file-text":J,briefcase:Pe,"calendar-days":Me,shield:Ke};function At(){var fe,_e;const{t:s,i18n:m}=Te(),o=As(),{user:r,roles:_,loading:l,signOut:P,mustChangePassword:B,profile:d,canManageInvestors:E}=Ge(),[M,p]=N.useState(()=>new Date),[k,h]=N.useState("dashboard");N.useEffect(()=>{const t=setInterval(()=>p(new Date),3e4);return()=>clearInterval(t)},[]),N.useEffect(()=>{const D=new URLSearchParams(o.search).get("tab");D&&["dashboard","meu-espaco","reunioes","documentos","manifestacoes","notificacoes"].includes(D)&&h(D)},[o.search]);const S=E||_.some(t=>t.role==="investor"),{data:i}=is("investor-portal","highlights"),{data:T}=is("investor-portal","features"),g=N.useRef(!1);N.useEffect(()=>{!l&&r&&S&&!B&&!g.current&&(g.current=!0,ls.track("page_view"))},[l,r,S,B]);const R=N.useRef({}),L=N.useCallback(t=>{const D=Date.now();D-(R.current[t]??0)<3e3||(R.current[t]=D,ls.track("section_click",t))},[]),{data:Z}=Q({queryKey:["investor-manifestations"],queryFn:()=>Ce.listMine(),enabled:!!r}),{data:c}=Q({queryKey:["investor-notifications",r==null?void 0:r.email],queryFn:()=>ie.list(),enabled:!!r}),{data:b}=Q({queryKey:["investor-my-meetings"],queryFn:()=>Ne.getMyMeetings(),enabled:!!r}),{data:y}=Q({queryKey:["investor-dashboard-summary",r==null?void 0:r.email],queryFn:()=>Ne.getSummary(),enabled:!!r}),x=(Z==null?void 0:Z.data)??[],U=(c==null?void 0:c.data)??[],te=(b==null?void 0:b.data)??[],he={submitted:x.filter(t=>t.current_status==="submitted").length,under_review:x.filter(t=>t.current_status==="under_review").length,accepted:x.filter(t=>t.current_status==="accepted").length,rejected:x.filter(t=>t.current_status==="rejected").length,more_info_requested:x.filter(t=>t.current_status==="more_info_requested").length},V=[...x.slice(0,6).map(t=>({id:`mi-${t.id}`,ts:t.last_status_at||t.submitted_at,label:`Manifestação ${t.submission_no} · ${t.current_status}`})),...U.slice(0,6).map(t=>({id:`ntf-${t.id}`,ts:t.created_at,label:`Notificação · ${t.title}`})),...te.slice(0,6).map(t=>({id:`mtg-${t.id}`,ts:t.created_at,label:`Reunião · ${t.topic}`}))].sort((t,D)=>new Date(D.ts).getTime()-new Date(t.ts).getTime()).slice(0,8),q=(y==null?void 0:y.totals)??{manifestations:x.length,accepted:he.accepted,under_review:he.under_review,more_info_requested:he.more_info_requested,meetings_total:te.length,meetings_upcoming:te.filter(t=>t.status!=="cancelled"&&t.status!=="rejected").length,unread_notifications:U.filter(t=>!t.is_read).length},me=(y==null?void 0:y.status_distribution)??he,re=(y==null?void 0:y.recent_activity)??V,ye=(y==null?void 0:y.alerts)??[],W=(y==null?void 0:y.recommended)??[];if(l)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})});if(!r||!S)return e.jsx(es,{to:"/portal-investidor/login",replace:!0});if(B)return e.jsx(es,{to:"/portal-investidor/alterar-senha",replace:!0});const be=[{labelKey:"nav.investorPortal"}],pe=[{icon:ws,title:s("investorPortal.features.dataRoom.title"),description:s("investorPortal.features.dataRoom.description"),available:!1},{icon:_s,title:s("investorPortal.features.dashboard.title"),description:s("investorPortal.features.dashboard.description"),available:!0},{icon:J,title:s("investorPortal.features.interest.title"),description:s("investorPortal.features.interest.description"),available:!0},{icon:Pe,title:s("investorPortal.features.documents.title"),description:s("investorPortal.features.documents.description"),available:!0},{icon:Me,title:s("investorPortal.features.meetings.title"),description:s("investorPortal.features.meetings.description"),available:!0},{icon:Ke,title:s("investorPortal.features.secure.title"),description:s("investorPortal.features.secure.description"),available:!1}],Y=(fe=T==null?void 0:T.content)==null?void 0:fe.items,je=Y!=null&&Y.length?Y.map(t=>
8({icon:Ma[t.icon]||Pe,title:t.title,description:t.description,available:!!t.available,linkUrl:t.linkUrl||"",fileUrl:t.fileUrl||"",linkLabel:t.linkLabel||"",openInNewTab:!!t.openInNewTab})):pe.map(t=>({...t,linkUrl:"",fileUrl:"",linkLabel:"",openInNewTab:!1})),qe=[{value:"47",label:s("investorPortal.highlights.blocks")},{value:"8B+",label:s("investorPortal.highlights.reserves")},{value:"15%",label:s("investorPortal.highlights.fiscal")},{value:"12",label:s("investorPortal.highlights.operators")}],xe=(_e=i==null?void 0:i.content)==null?void 0:_e.items,we=xe!=null&&xe.length?xe:qe;return e.jsxs(Ts,{pageKey:"investor-portal",titleKey:"pages.investorPortal.title",subtitleKey:"pages.investorPortal.subtitle",descriptionKey:"pages.investorPortal.description",icon:e.jsx(Pe,{className:"w-6 h-6"}),breadcrumbs:be,children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-8 p-5 bg-gradient-to-r from-primary/10 to-primary/5 rounded-xl border border-primary/15",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-11 h-11 rounded-full bg-primary/15 flex items-center justify-center shrink-0",children:e.jsx(Ke,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-base font-semibold leading-tight",children:(()=>{const t=M.getHours(),D=t<12?s("investorPortal.greetingMorning","Bom dia"):t<19?s("investorPortal.greetingAfternoon","Boa tarde"):s("investorPortal.greetingEvening","Boa noite"),H=((d==null?void 0:d.full_name)||"").trim().split(" ")[0];return H?`${D}, ${H}`:D})()}),e.jsxs("p",{className:"text-xs text-muted-foreground capitalize flex items-center gap-1.5 mt-0.5",children:[e.jsx(Me,{className:"w-3.5 h-3.5 shrink-0"}),ae(M,"EEEE, d 'de' MMMM 'de' yyyy · HH:mm",{locale:m.language==="pt"?Ie:Ps})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 self-end sm:self-auto",children:[e.jsxs(v,{variant:"outline",className:"gap-1.5 hidden sm:inline-flex text-muted-foreground",children:[e.jsx(xs,{className:"w-3 h-3"}),s("investorPortal.secureSession","Sessão segura")]}),e.jsx(Pa,{onClick:()=>h("notificacoes")}),e.jsxs(A,{variant:"outline",size:"sm",onClick:P,className:"gap-2",children:[e.jsx(Xs,{className:"w-4 h-4"}),s("common.logout")]})]})]}),e.jsx("div",{className:"flex items-center gap-1 border-b border-border mb-8 overflow-x-auto pb-0 scrollbar-none",children:[{key:"dashboard",label:e.jsx(u,{children:"Dashboard"}),icon:Js},{key:"meu-espaco",label:e.jsx(u,{children:"Meu Espaço"}),icon:Ze},{key:"reunioes",label:e.jsx(u,{children:"Reuniões"}),icon:Me},{key:"documentos",label:e.jsx(u,{children:"Documentos"}),icon:J},{key:"manifestacoes",label:e.jsx(u,{children:"Manifestações de Interesse"}),icon:Oe},{key:"notificacoes",label:e.jsx(u,{children:"Notificações"}),icon:ve}].map(({key:t,label:D,icon:H})=>e.jsxs("button",{onClick:()=>{h(t),L(t)},className:`flex items-center gap-2 px-4 py-2.5 text-sm font-medium border-b-2 whitespace-nowrap transition-colors 9 ${k===t?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-border"}`,children:[e.jsx(H,{className:"w-4 h-4"}),D]},t))}),k==="meu-espaco"&&e.jsx("div",{className:"mb-16",children:e.jsx(_a,{})}),k==="reunioes"&&e.jsx(X,{className:"mb-16",onClick:()=>L("meetings"),children:e.jsx(gs,{})}),k==="documentos"&&e.jsx(X,{className:"mb-16",onClick:()=>L("documents"),children:e.jsx(hs,{})}),k==="manifestacoes"&&e.jsx(X,{className:"mb-16",onClick:()=>L("manifestations"),children:e.jsx(Na,{})}),k==="notificacoes"&&e.jsx("div",{className:"mb-16 max-w-2xl mx-auto",children:e.jsx(ka,{userEmail:r==null?void 0:r.email})}),k==="dashboard"&&e.jsxs(e.Fragment,{children:[e.jsx(X,{className:"mb-12",onClick:()=>L("dashboard-metrics"),children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx(v,{variant:"outline",className:"mb-3",children:e.jsx(u,{children:"Painel Operacional"})}),e.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground",children:e.jsx(u,{children:"Resumo de Actividade"})}),e.jsx("p",{className:"text-muted-foreground mt-2",children:e.jsx(u,{children:"Métricas da sua operação no Portal do Investidor."})})]}),ye.length>0&&e.jsx(j,{className:"border-status-warning/30 bg-status-warning/5",children:e.jsxs(f,{className:"pt-4 space-y-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(ia,{className:"w-4 h-4 text-status-warning"}),e.jsx(u,{children:"Alertas Inteligentes"})]}),ye.map(t=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-status-warning/20 bg-background px-3 py-2 text-sm",children:[e.jsx("span",{children:t.message}),t.action_url&&e.jsx(A,{variant:"outline",size:"sm",asChild:!0,children:e.jsx(ue,{to:t.action_url,children:e.jsx(u,{children:"Ver"})})})]},t.code))]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsx(j,{children:e.jsxs(f,{className:"pt-5 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-primary",children:q.manifestations}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.jsx(u,{children:"Manifestações"})})]})}),e.jsx(j,{children:e.jsxs(f,{className:"pt-5 text-center",children:[e.jsx("div",{className:"text-2xl font-bold",children:q.accepted}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.jsx(u,{children:"Aceites"})})]})}),e.jsx(j,{children:e.jsxs(f,{className:"pt-5 text-center",children:[e.jsx("div",{className:"text-2xl font-bold",children:q.meetings_total}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.jsx(u,{children:"Reuniões"})})]})}),e.jsx(j,{children:e.jsxs(f,{className:"pt-5 text-center",children:[e.jsx("div",{className:"text-2xl font-bold",children:q.unread_notifications}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.jsx(u,{children:"Notificações não lidas"})})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs(j,{children:[e.jsx(z,{className:"pb-3",children:e.jsx($,{className:"text-base",children:e.jsx(u,{children:"Estados das Manifestações"})})}),e.jsx(f,{className:"space-y-3",children:[{key:"submitted",label:e.jsx(u,{children:"Submetidas"}),value:me.submitted},{key:"under_review",label:e.jsx(u,{children:"Em análise"}),value:me.under_review},{key:"more_info_requested",label:e.jsx(u,{children:"Info. complementar"}),value:me.more_info_requested},{key:"accepted",label:e.jsx(u,{children:"Aceites"}),value:me.accepted},{key:"rejected",label:e.jsx(u,{children:"Rejeitadas"}),value:me.rejected}].map(t=>{const D=Math.max(1,q.manifestations),H=Math.round(t.value/D*100);return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:t.label}),e.jsxs("span",{className:"text-muted-foreground",children:[t.value," (",H,"%)"]})]}),e.jsx("div",{className:"h-2 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${H}%`}})})]},t.key)})})]}),e.jsxs(j,{children:[e.jsx(z,{className:"pb-3",children:e.jsx($,{className:"text-base",children:e.jsx(u,{children:"Actividade Recente"})})}),e.jsx(f,{children:re.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:e.jsx(u,{children:"Sem actividade registada."})}):e.jsx("div",{className:"space-y-2.5",children:re.map(t=>e.jsxs("div",{className:"flex items-start justify-between gap-3 text-sm border-b border-border/60 pb-2 last:border-b-0",children:[e.jsx("span",{className:"text-foreground",children:t.label}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:ae(new Date(t.ts),"dd/MM HH:mm")}
9)]},t.id))})})]})]}),e.jsxs(j,{children:[e.jsxs(z,{className:"pb-3",children:[e.jsx($,{className:"text-base",children:e.jsx(u,{children:"Recomendado para a Sua Empresa"})}),e.jsx(De,{children:e.jsx(u,{children:"Oportunidades sugeridas com base no perfil e histórico da organização."})})]}),e.jsx(f,{children:W.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:e.jsx(u,{children:"Sem recomendações neste momento. Continue a actualizar o perfil e a actividade da empresa."})}):e.jsx("div",{className:"space-y-3",children:W.map(t=>e.jsxs("div",{className:"rounded-md border p-3 flex flex-col md:flex-row md:items-center md:justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:t.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.basin," · ",t.offer_type||t.status]}),t.reason&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t.reason})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(v,{variant:"outline",children:["Score ",t.score]}),e.jsx(A,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(ue,{to:`/portal-investidor?tab=manifestacoes&opportunityId=${t.id}`,children:"Ver oportunidade"})})]})]},t.id))})})]})]})}),e.jsx(X,{className:"mb-16",onClick:()=>L("highlights"),children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:we.map((t,D)=>e.jsx(j,{className:"text-center bg-gradient-to-br from-primary/5 to-transparent border-primary/10",children:e.jsxs(f,{className:"pt-6",children:[e.jsx("div",{className:"text-3xl md:text-4xl font-bold text-primary mb-2",children:t.value}),e.jsx("p",{className:"text-sm text-muted-foreground",children:e.jsx(u,{children:t.label})})]})},D))})}),e.jsxs(X,{className:"mb-16",onClick:()=>L("features"),children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx(v,{variant:"outline",className:"mb-4",children:s("investorPortal.featuresLabel")}),e.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground mb-4",children:s("investorPortal.featuresTitle")}),e.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:s("investorPortal.featuresSubtitle")})]}),e.jsx(Ss,{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:je.map((t,D)=>{const H=t.icon;return e.jsxs(j,{className:`relative overflow-hidden ${t.available?"":"opacity-75"}`,children:[!t.available&&e.jsx("div",{className:"absolute top-4 right-4",children:e.jsxs(v,{variant:"secondary",className:"flex items-center gap-1",children:[e.jsx(xs,{className:"w-3 h-3"}),s("investorPortal.comingSoon")]})}),e.jsxs(z,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center mb-4",children:e.jsx(H,{className:"w-6 h-6 text-primary"})}),e.jsx($,{className:"text-lg",children:e.jsx(u,{children:t.title})}),e.jsx(De,{children:e.jsx(u,{children:t.description})})]}),(t.linkUrl||t.fileUrl)&&e.jsx(f,{className:"pt-0",children:(()=>{const ge=t.fileUrl||t.linkUrl,ee=!!t.fileUrl,Se=/^https?:\/\//i.test(ge)||ee,ze=t.linkLabel?t.linkLabel:ee?s("investorPortal.download","Descarregar"):s("investorPortal.viewDetails","Ver Detalhes"),a=e.jsxs(e.Fragment,{children:[e.jsx(u,{children:ze}),ee?e.jsx(ks,{className:"w-4 h-4 ml-2"}):e.jsx(Be,{className:"w-4 h-4 ml-2"})]});return Se?e.jsx(A,{variant:"outline",size:"sm",asChild:!0,children:e.jsx("a",{href:ge,target:t.openInNewTab||ee?"_blank":void 0,rel:"noopener noreferrer",...ee?{download:!0}:{},children:a})}):e.jsx(A,{variant:"outline",size:"sm",asChild:!0,children:e.jsx(ue,{to:ge,children:a})})})()})]},D)})})]}),e.jsxs(X,{className:"mb-16",onClick:()=>L("opportunities"),children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx(v,{variant:"outline",className:"mb-4",children:s("investorPortal.opportunitiesLabel")}),e.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground mb-2",children:s("investorPortal.opportunitiesTitle")}),e.jsx("p",{className:"text-muted-foreground",children:s("investorPortal.opportunitiesSubtitle")})]}),e.jsx(A,{variant:"outline",asChild:!0,className:"mt-4 md:mt-0",children:e.jsxs(ue,{to:"/dados-ep/mapas",children:[s("investorPortal.viewAllBlocks"),e.jsx(Be,{className:"w-4 h-4 ml-2"})]})})]}),e.jsx(ua,{})]}),e.jsxs(X,{className:"mb-16",onClick:()=>L("documents"),children:[e.jsx("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between mb-8",children:e.jsxs("div",{children:[e.jsx(v,{variant:"outline",className:"mb-4",children:s("investorPortal.documentsLabel")}),e.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground mb-2",children:s("investorPortal.documentsTitle")}),e.jsx("p",{className:"text-muted-foreground",children:s("investorPortal.documentsSubtitle")})]})}),e.jsx(hs,{})]}),e.jsxs(X,{className:"mb-16",onClick:()=>L("meetings"),children:[e.jsx("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between mb-8",children:e.jsxs("div",{children:[e.jsx(v,{variant:"outline",className:"mb-4",children:s("investorPortal.meetingsLabel")}),e.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground mb-2",children:s("investorPortal.meetingsTitle")}),e.jsx("p",{className:"text-muted-foreground",children:s("investorPortal.meetingsSubtitle")})]})}),e.jsx(gs,{})]}),e.jsx(X,{onClick:()=>L("support"),children:e.jsx(j,{className:"bg-gradient-to-br from-foreground to-foreground
9/90 text-primary-foreground overflow-hidden",children:e.jsx(f,{className:"p-8 md:p-12",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 items-center",children:[e.jsxs("div",{children:[e.jsx(v,{variant:"secondary",className:"mb-4",children:s("investorPortal.supportBadge","Apoio ao Investidor")}),e.jsx("h3",{className:"text-2xl md:text-3xl font-bold mb-4",children:s("investorPortal.supportTitle","Precisa de apoio dedicado?")}),e.jsx("p",{className:"text-primary-foreground/80 mb-6",children:s("investorPortal.supportDescription","A nossa equipa de relações com investidores está disponÃvel para esclarecer dúvidas sobre concessões, dados técnicos e oportunidades de investimento. Agende uma reunião ou fale connosco diretamente.")}),e.jsx("div",{className:"flex flex-wrap gap-4",children:e.jsx(A,{variant:"outline",size:"lg",className:"bg-transparent border-primary-foreground/30 text-primary-foreground hover:bg-primary-foreground/10",asChild:!0,children:e.jsxs(ue,{to:"/contactos",children:[e.jsx(Oe,{className:"w-4 h-4 mr-2"}),s("investorPortal.ctaContact")]})})})]}),e.jsx("div",{className:"hidden lg:block",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(j,{className:"bg-primary-foreground/10 border-primary-foreground/20",children:e.jsxs(f,{className:"p-4 flex items-center gap-3",children:[e.jsx(We,{className:"w-8 h-8 text-primary-foreground/80"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-primary-foreground",children:"10+"}),e.jsx("div",{className:"text-xs text-primary-foreground/60",children:e.jsx(u,{children:s("investorPortal.stats.basins")})})]})]})}),e.jsx(j,{className:"bg-primary-foreground/10 border-primary-foreground/20",children:e.jsxs(f,{className:"p-4 flex items-center gap-3",children:[e.jsx(bs,{className:"w-8 h-8 text-primary-foreground/80"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-primary-foreground",children:"20+"}),e.jsx("div",{className:"text-xs text-primary-foreground/60",children:e.jsx(u,{children:s("investorPortal.stats.partners")})})]})]})})]}),e.jsxs("div",{className:"space-y-4 mt-8",children:[e.jsx(j,{className:"bg-primary-foreground/10 border-primary-foreground/20",children:e.jsxs(f,{className:"p-4 flex items-center gap-3",children:[e.jsx(Rs,{className:"w-8 h-8 text-primary-foreground/80"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-primary-foreground",children:"1.1M"}),e.jsx("div",{className:"text-xs text-primary-foreground/60",children:e.jsx(u,{children:s("investorPortal.stats.production")})})]})]})}),e.jsx(j,{className:"bg-primary-foreground/10 border-primary-foreground/20",children:e.jsxs(f,{className:"p-4 flex items-center gap-3",children:[e.jsx(Ae,{className:"w-8 h-8 text-primary-foreground/80"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-primary-foreground",children:"$50B+"}),e.jsx("div",{className:"text-xs text-primary-foreground/60",children:e.jsx(u,{children:s("investorPortal.stats.investment")})})]})]})})]})]})})]})})})})]})]})}export{At 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.