import{En as e,Rn as t,Yn as n,cr as r,dn as i,fn as a,ln as o,on as s,pn as c,rr as l,sn as u,tt as d,un as f}from"./game-logic-BBFCPVtv.js";import{k as p}from"./vendor-icons-Ccm2_GPI.js";import{d as m,v as h}from"./game-config-DRP-gbpS.js";import{$ as g,A as _,F as v,I as y,J as b,M as x,N as S,X as C,j as w,k as T}from"./index-B4KMqZ_y.js";import{t as E}from"./useGameConfig-DLqfPHtW.js";var D={key:0,class:`absolute inset-0 z-10 bg-background/70 backdrop-blur-[2px] rounded-lg flex items-center justify-center`},O={class:`text-center p-4 space-y-2`},k={class:`flex justify-center`},A={class:`rounded-full bg-muted p-2`},j={class:`text-xs font-medium text-muted-foreground`},M=c({__name:`CardUnlockOverlay`,props:{requirements:{},currentLevel:{}},setup(c){let M=c,N=g(),{t:P}=C(),{BUILDINGS:F,TECHNOLOGIES:I}=E(),L=n(!1),R=n(``),z=n(``),B=s(()=>M.currentLevel!==void 0&&M.currentLevel>0||!M.requirements||!N.currentPlanet?!0:d(N.currentPlanet,N.player.technologies,M.requirements)),V=()=>{if(!M.requirements||!N.currentPlanet)return``;let e=[];for(let[t,n]of Object.entries(M.requirements))if(Object.values(m).includes(t)){let r=t,i=N.currentPlanet.buildings[r]||0,a=F.value[r]?.name||r,o=i>=n?`✓`:`✗`;e.push(`${o} ${a}: Lv ${n} (${P(`common.current`)}: Lv ${i})`)}else if(Object.values(h).includes(t)){let r=t,i=N.player.technologies[r]||0,a=I.value[r]?.name||r,o=i>=n?`✓`:`✗`;e.push(`${o} ${a}: Lv ${n} (${P(`common.current`)}: Lv ${i})`)}return e.join(`
`)},H=()=>{R.value=P(`common.requirementsNotMet`),z.value=V(),L.value=!0};return(n,s)=>B.value?o(``,!0):(e(),f(`div`,D,[u(`div`,O,[u(`div`,k,[u(`div`,A,[a(l(p),{size:20,class:`text-muted-foreground`})])]),u(`p`,j,r(l(P)(`common.locked`)),1),a(l(b),{variant:`outline`,size:`sm`,onClick:H,class:`text-xs`},{default:t(()=>[i(r(l(P)(`common.viewRequirements`)),1)]),_:1})]),a(l(y),{open:L.value,"onUpdate:open":s[0]||=e=>L.value=e},{default:t(()=>[a(l(S),null,{default:t(()=>[a(l(_),null,{default:t(()=>[a(l(T),null,{default:t(()=>[i(r(R.value),1)]),_:1}),a(l(x),{class:`whitespace-pre-line`},{default:t(()=>[i(r(z.value),1)]),_:1})]),_:1}),a(l(w),null,{default:t(()=>[a(l(v),null,{default:t(()=>[i(r(l(P)(`common.confirm`)),1)]),_:1})]),_:1})]),_:1})]),_:1},8,[`open`])]))}});export{M as t};