PageSourceSearch

https://nefes21.com/assets/cards-COj9Lkr1.js

js nefes21.com collected 2026-09-27 08:34:18 UTC 31,831 bytes, 1 lines download raw bytes

1import{al as We,u as Ve,r as c,p as Me,j as e,B as h,ca as f,cb as Xe,an as ce,ai as Qe,c8 as ee,D as Ae,y as Ke,z as Pe,A as Le,E as Je,L as Ze,I as De,a7 as et}from"./index-fv-DcFj2.js";import{R as O}from"./refresh-cw-BVXqOcoU.js";import{D as te}from"./download-0hBx8loX.js";function it(){var Se,Ie;We();const{toast:ae}=Ve(),[a,me]=c.useState(null),[r,k]=c.useState(null),[le,E]=c.useState(!1),[Be,j]=c.useState(new Array(9).fill(!1)),[tt,T]=c.useState(null),[at,Ue]=c.useState(!1),[z,Ee]=c.useState(9),[P,N]=c.useState([]),[Re,V]=c.useState(!1),[se,L]=c.useState(null),[u,Ge]=c.useState([]),[X,he]=c.useState("single"),[Y,Q]=c.useState(!1),[M,re]=c.useState(()=>localStorage.getItem("cards_personal_message")||""),[xe,ne]=c.useState(()=>localStorage.getItem("cards_personal_message")||""),[R,ge]=c.useState(null),[G,ue]=c.useState(null),[J,pe]=c.useState(null),[fe,_]=c.useState(!1);c.useEffect(()=>{a!=null&&a.id&&(console.log("🎴 Seçilen deck için kartları getiriliyor, Deck ID:",a.id),fetch(`/api/cards/decks/${a.id}/cards`).then(t=>t.json()).then(t=>{console.log("🎯 API'den gelen kartlar:",t),t.success&&t.data&&(Ge(t.data),console.log("✅ Dinamik kartlar güncellendi:",t.data.length,"kart"))}).catch(t=>console.error("❌ Kart çekme hatası:",t)))},[a==null?void 0:a.id]);const q=new URLSearchParams(window.location.search).get("deck"),be=t=>{me(t),k(null),j(new Array(z).fill(!1)),T(null)},ye=(t,l,s,m,n)=>{const i=s.width,x=s.height,d=l.width/l.height,o=i/x;let F=0,H=0,ie=l.width,oe=l.height;d>o?(ie=l.height*o,F=(l.width-ie)/2):(oe=l.width/o,H=(l.height-oe)/2),t.drawImage(l,F,H,ie,oe,0,0,i,x),t.fillStyle="rgba(0, 0, 0, 0.35)",t.fillRect(0,0,i,x);const $e=24,C=i-80,S=130,y=(i-C)/2,g=(x-S)/2;t.fillStyle="rgba(0, 0, 0, 0.25)",t.strokeStyle="rgba(255,255,255,0.4)",t.lineWidth=2,t.beginPath();const I=16;t.moveTo(y+I,g),t.lineTo(y+C-I,g),t.quadraticCurveTo(y+C,g,y+C,g+I),t.lineTo(y+C,g+S-I),t.quadraticCurveTo(y+C,g+S,y+C-I,g+S),t.lineTo(y+I,g+S),t.quadraticCurveTo(y,g+S,y,g+S-I),t.lineTo(y,g+I),t.quadraticCurveTo(y,g,y+I,g),t.closePath(),t.fill(),t.stroke(),t.fillStyle="#99f6e4",t.textAlign="center",t.textBaseline="middle";const Te=m.title,_e=34,Fe=18;let W=_e;for(t.font=`bold ${W}px sans-serif`;t.measureText(Te).width>C-$e*2&&W>Fe;)W-=2,t.font=`bold ${W}px sans-serif`;const He=Te.split(" "),Z=[];let K="";for(const B of He){const w=K?`${K} ${B}`:B;t.measureText(w).width>C-$e*2&&K?(Z.push(K),K=B):K=w}K&&Z.push(K);const de=W*1.35,Oe=Z.length*de,Ye=g+S/2-Oe/2+de/2;if(Z.forEach((B,w)=>{t.fillText(B,i/2,Ye+w*de)}),n&&n.trim()){const B=n.trim().slice(0,60),w=i-80,U=52,v=(i-w)/2,p=g+S+18;t.fillStyle="rgba(255, 255, 255, 0.15)",t.strokeStyle="rgba(255,255,255,0.35)",t.lineWidth=1.5,t.beginPath();const $=12;t.moveTo(v+$,p),t.lineTo(v+w-$,p),t.quadraticCurveTo(v+w,p,v+w,p+$),t.lineTo(v+w,p+U-$),t.quadraticCurveTo(v+w,p+U,v+w-$,p+U),t.lineTo(v+$,p+U),t.quadraticCurveTo(v,p+U,v,p+U-$),t.lineTo(v,p+$),t.quadraticCurveTo(v,p,v+$,p),t.closePath(),t.fill(),t.stroke(),t.fillStyle="rgba(255,255,255,0.92)";let D=16;const ze=`"${B}"`,qe=w-24;for(t.font=`italic ${D}px sans-serif`;t.measureText(ze).width>qe&&D>10;)D-=1,t.font=`italic ${D}px sans-serif`;t.textAlign="center",t.textBaseline="middle",t.fillText(ze,i/2,p+U/2)}t.fillStyle="rgba(255,255,255,0.7)",t.font="bold 16px sans-serif",t.textAlign="center",t.textBaseline="middle",t.fillText("megaverse.market",i/2,x-24)},we=async(t,l)=>{var m;const s=((m=b==null?void 0:b.data)==null?void 0:m.frontImage)||(a==null?void 0:a.frontImage)||`/upload/cards/decks/${(a==null?void 0:a.deckId)||"501001"}/front.webp`;return new Promise(n=>{const i=document.createElement("canvas");i.width=480,i.height=640;const x=i.getContext("2d");if(!x){n(null);return}const d=new Image;d.crossOrigin="anonymous",d.onload=()=>{ye(x,d,i,t,l),i.toBlob(o=>n(o),"image/png")},d.onerror=()=>n(null),d.src=s})},ve=async(t,l)=>{const s=await we(t,l);if(!s){ae({title:"Hata",description:"Görsel oluşturulamadı. Lütfen tekrar deneyin.",variant:"destructive"});return}const m=URL.createObjectURL(s),n=document.createElement("a");n.href=m,n.download=`${t.title.replace(/\s+/g,"-")}.png`,n.click(),URL.revokeObjectURL(m)},je=async(t,l)=>{const s=await we(t,l);if(!s){ae({title:"Hata",description:"Görsel oluşturulamadı. Lütfen tekrar deneyin.",variant:"destructive"});return}const m=new File([s],`${t.title.replace(/\s+/g,"-")}.png`,{type:"image/png"});if(navigator.canShare&&navigator.canShare({files:[m]}))try{await navigator.share({files:[m],title:t.title,text:`Bugünkü kartım: ${t.title} 🎴`});return}catch{}const n=URL.createObjectURL(s),i=document.createElement("a");i.href=n,i.download=`${t.title.replace(/\s+/g,"-")}.png`,i.click(),URL.revokeObjectURL(n),ae({title:"Görsel indirildi",description:"Görseli kaydettikten sonra WhatsApp'tan manuel paylaşabilirsiniz."});const x=`${window.location.origin}/cards/${t.id}/detail`,d=`Bugünkü kartım: ${t.title} 🎴 ${x}`;window.open(`https://wa.me/?text=${encodeURIComponent(d)}`,"_blank")},ke=(t,l)=>{ue(t),ge(l),Q(!0)},Ne=async()=>{Q(!1),!(!G||!R)&&(M.trim()?localStorage.setItem("cards_personal_message",M):localStorage.removeItem("cards_personal_message"),R==="download"?await ve(G,M):await je(G,M))};c.useEffect(()=>{const t=()=>{const l=window.innerWidth<640;Ue(l),Ee(l?3:9),j(new Array(l?3:9).fill(!1))};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const{data:A,isLoading:Ce}=Me({queryKey:["/api/cards/decks"],enabled:!0}),{data:b}=Me({queryKey:["/api/cards/decks",a==null?void 0:a.id],enabled:!!a});return c.useEffect(()=>{if(q&&(A!=null&&A.data)&&!a){const t=A.data.find(l=>l.id.toString()===q);t&&be(t)}},[q,A,a]),c.useEffect(()=>{const t=setTimeout(()=>{ne(M)},300);return()=>clearTimeout(t)},[M]),c.useEffect(()=>{if(!Y)return;const t=localStorage.getItem("cards_personal_message")||"";re(t),ne(t);const l=s=>{if(s.key==="cards_personal_message"){const m=s.newValue||"";re(m),ne(m)}};return window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)},[Y]),c.useEffect(()=>{var d;if(!Y||!G){pe(null),_(!1);return}let t=!1;_(!0);const l=((d=b==null?void 0:b.data)==null?void 0:d.frontImage)||(a==null?void 0:a.frontImage)||`/upload/cards/decks/${(a==null?void 0:a.deckId)||"501001"}/front.webp`,s=G,m=xe,n=document.createElement("canvas");n.width=480,n.height=640;const i=n.getContext("2d");if(!i){_(!1);return}const x=new Image;return x.crossOrigin="anonymous",x.onload=()=>{t||(ye(i,x,n,s,m),pe(n.toDataURL("image/png")),_(!1))},x.onerror=()=>{t||_(!1)},x.src=l,()=>{t=!0,_(!1)}}
1,[Y,xe,G,b,a]),!a&&!q?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-pink-100 via-purple-50 to-teal-100 py-12",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx(h,{onClick:()=>window.location.href="/",className:"bg-purple-600 hover:bg-purple-700 text-white px-6 py-3 rounded-xl font-bold shadow-lg",children:"🏠 Ana Sayfa"})}),e.jsx("h1",{className:"text-4xl font-bold text-center text-gray-800 mb-12",children:"Günlük Olumlamalar"}),Ce?e.jsx("div",{className:"flex justify-center",children:e.jsx(O,{className:"w-8 h-8 animate-spin text-teal-600"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 max-w-6xl mx-auto",children:(Se=A==null?void 0:A.data)==null?void 0:Se.filter(t=>t.title!=="An'da Olmak").map(t=>e.jsx(h,{onClick:()=>be(t),className:"bg-white hover:bg-teal-50 border-2 border-teal-200 hover:border-teal-400 p-0 h-auto overflow-hidden group",children:e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"relative w-full h-48 mb-4",children:[e.jsx("img",{src:t.showcaseImage||"/upload/cards/decks/501001/showcase.webp",alt:`${t.title} Showcase`,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/30 to-transparent"})]}),e.jsxs("div",{className:"text-center px-6 pb-6",children:[e.jsx("h3",{className:"text-xl font-bold text-gray-800 mb-2",children:t.title}),t.description&&e.jsx("p",{className:"text-sm text-gray-600",children:t.description})]})]})},t.id))})]})}):q&&!a&&Ce?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-pink-100 via-purple-50 to-teal-100 py-12",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[e.jsx(O,{className:"w-8 h-8 animate-spin text-teal-600 mb-2"}),e.jsx("p",{className:"text-gray-600",children:"Kart çekme hazırlanıyor..."})]})})}):e.jsxs("div",{className:"min-h-screen py-12 relative",children:[e.jsx("div",{className:"absolute inset-0 opacity-80",style:{backgroundImage:`url(${(a==null?void 0:a.backgroundImage)||"/upload/cards/decks/501001/background.webp"})`,backgroundSize:"100% 100%",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundAttachment:"fixed"}}),e.jsxs("div",{className:"container mx-auto px-4 relative z-10",children:[e.jsxs(f.div,{initial:{opacity:0,y:-50},animate:{opacity:1,y:0},className:"text-center mb-12",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-6 mb-6 justify-center items-center flex-wrap",children:[e.jsx(h,{onClick:()=>me(null),className:"bg-gray-600 hover:bg-gray-700",children:"← Geri Dön"}),e.jsx(h,{onClick:()=>window.location.href="/cards",className:"bg-blue-600 hover:bg-blue-700",children:"🎴 Tüm Desteler"}),e.jsx(h,{onClick:()=>window.location.href="/",className:"bg-purple-600 hover:bg-purple-700",children:"🏠 Ana Sayfa"})]}),e.jsxs("h1",{className:"text-4xl font-bold text-gray-800 mb-4",children:["❤️ ",(a==null?void 0:a.title)||"Kartlar"," ❤️"]}),e.jsxs("div",{className:"flex flex-col items-center gap-3 mb-6",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{onClick:()=>{he("single"),k(null),N([]),j(new Array(z).fill(!1)),T(null)},size:"sm",className:`px-4 py-2 rounded-xl font-bold border-2 transition-all duration-200 ${X==="single"?"bg-teal-600 border-teal-400 text-white shadow-lg":"bg-white/70 border-teal-300 text-teal-800 hover:bg-white"}`,children:"🃏 Tek Kart"}),e.jsx(h,{onClick:()=>{he("triple"),k(null),N([]),j(new Array(z).fill(!1)),T(null)},size:"sm",className:`px-4 py-2 rounded-xl font-bold border-2 transition-all duration-200 ${X==="triple"?"bg-purple-600 border-purple-400 text-white shadow-lg":"bg-white/70 border-purple-300 text-purple-800 hover:bg-white"}`,children:"🃏🃏🃏 3 Kart (Geçmiş-Şuan-Gelecek)"})]}),e.jsx(h,{onClick:async()=>{E(!0),T(null),j(new Array(z).fill(!1)),k(null),N([]),await new Promise(t=>setTimeout(t,2e3)),E(!1)},disabled:le,size:"lg",className:"bg-gradient-to-r from-teal-600 to-emerald-600 hover:from-teal-700 hover:to-emerald-700 text-white px-8 py-3 text-lg font-bold rounded-2xl shadow-xl border-2 border-teal-500 transform hover:scale-105 transition-all duration-300",children:le?"🌪️ Karıştırılıyor... 🌪️":"🌟 Kartları Karıştır 🌟"})]})]}),e.jsxs("div",{className:"relative w-full max-w-[1400px] mx-auto mb-12 h-[320px] md:h-[400px] flex items-center justify-center",style:{background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)",borderRadius:"20px",padding:"32px 20px",overflow:"visible"},children:[e.jsx("div",{className:"absolute inset-0 opacity-20 pointer-events-none",children:Array.from({length:12}).map((t,l)=>e.jsx("div",{className:"absolute",style:{left:`${Math.random()*100}%`,top:`${Math.random()*100}
1%`,fontSize:"2rem",animation:`float ${3+Math.random()*2}s ease-in-out infinite ${Math.random()*2}s`},children:["🌸","🌺","🌼","🌻"][Math.floor(Math.random()*4)]},l))}),e.jsx(Xe,{mode:"wait",children:le?e.jsx(f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"flex justify-center",children:e.jsxs(f.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-64 h-80 md:w-80 md:h-96 relative",children:[e.jsx("div",{className:"absolute inset-0 bg-black/20 rounded-[25px] transform translate-y-4 translate-x-4 blur-lg"}),e.jsxs("div",{className:"relative w-full h-full rounded-[25px] overflow-hidden border-8 border-teal-600 bg-white shadow-2xl",children:[e.jsx("img",{src:(a==null?void 0:a.backImage)||`/upload/cards/decks/${(a==null?void 0:a.deckId)||"501001"}/back.webp`,alt:"Card Back",className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-black/20 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(O,{className:"w-16 h-16 text-white mb-4 mx-auto animate-spin"}),e.jsx("p",{className:"text-white font-bold text-lg",children:"Kartlar karıştırılıyor..."})]})})]})]})},"shuffling"):r?e.jsxs("div",{className:"relative flex flex-col items-center justify-center",children:[e.jsx(f.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1.2},className:"relative mb-8",style:{zIndex:50},children:e.jsxs("div",{className:"w-72 h-96 md:w-80 md:h-[480px] relative",children:[e.jsx("div",{className:"absolute inset-0 bg-black/20 rounded-[25px] transform translate-y-6 translate-x-6 blur-xl"}),e.jsxs("div",{className:"relative w-full h-full rounded-[25px] overflow-hidden border-8 border-teal-600 bg-white shadow-2xl",children:[e.jsx("img",{src:((Ie=b==null?void 0:b.data)==null?void 0:Ie.frontImage)||(a==null?void 0:a.frontImage)||`/upload/cards/decks/${(a==null?void 0:a.deckId)||"501001"}/front.webp`,alt:"Card Front",className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-black/20 p-8 flex flex-col items-center justify-center text-center",children:e.jsx(f.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},className:"bg-transparent p-6 rounded-2xl border-2 border-white/30",children:e.jsx("h3",{className:"text-xl md:text-2xl font-bold text-teal-800",children:r.title})})})]})]})},"drawn-card"),e.jsxs(f.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{delay:.8},className:"flex gap-6 mt-16 flex-wrap justify-center",children:[e.jsx(h,{onClick:()=>{k(null),N([]),j(new Array(z).fill(!1)),T(null)},className:"bg-gray-600 hover:bg-gray-700 text-white px-6 py-3 rounded-xl font-bold shadow-lg",children:"✕ Kapat"}),e.jsxs(h,{onClick:async()=>{var t;if(console.log("🎯 Modal açılıyor, drawnCard:",r),r!=null&&r.id){console.log("🔗 API çağrısı yapılıyor:",`/api/cards/card/${r.id}`);try{const s=await(await fetch(`/api/cards/card/${r.id}`)).json();console.log("✅ API response:",s),s.success?(console.log("📝 API Content length:",(t=s.data.content)==null?void 0:t.length),console.log("ðŸ
1·ï¸ Modal title:",r.title),L({title:r.title,description:s.data.content||"Kart açıklaması bulunamadı."})):(console.log("❌ API başarısız, fallback kullanılıyor"),L({title:r.title,description:r.content||"Kart açıklaması bulunamadı."}))}catch(l){console.error("❌ API hatası:",l),L({title:r.title,description:r.content||"Kart açıklaması bulunamadı."})}}else console.log("⚠️ drawnCard.id yok, direkt content kullanılıyor"),L({title:(r==null?void 0:r.title)||"Bilinmeyen Kart",description:(r==null?void 0:r.content)||"Kart detayı yüklenemedi"});V(!0)},className:"bg-yellow-600 hover:bg-yellow-700 text-white px-6 py-3 rounded-xl font-bold shadow-lg",children:[e.jsx(ce,{className:"w-4 h-4 mr-2"}),"Kartı Yorumla"]}),(r==null?void 0:r.contentSlug)&&(r==null?void 0:r.contentType)&&e.jsxs(h,{onClick:async()=>{const t=r.contentType||"blog",l=r.contentSlug||"",m={blog:`/blogs/${l}`,video:`/video-watch/${l}`,course:`/nefes21akademi/${l}`,event:`/events/${l}`}[t]||`/blogs/${l}`;window.location.href=m},className:"bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-700 hover:to-indigo-700 text-white px-6 py-3 rounded-xl font-bold shadow-lg",children:[e.jsx(Qe,{className:"w-4 h-4 mr-2"}),"📚 Tavsiye İçerik"]}),e.jsxs(h,{onClick:()=>{const t=`${window.location.origin}/cards/${r.id}/detail`,l=`Bugünkü kartım: ${r.title} 🎴 ${t}`;window.open(`https://wa.me/?text=${encodeURIComponent(l)}`,"_blank")},className:"bg-green-500 hover:bg-green-600 text-white px-6 py-3 rounded-xl font-bold shadow-lg",children:[e.jsxs("svg",{className:"w-4 h-4 mr-2 inline-block",viewBox:"0 0 24 24",fill:"currentColor",children:[e.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347z"}),e.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12c0 2.091.535 4.06 1.472 5.772L.072 23.927l6.29-1.644A11.956 11.956 0 0 0 12 24c6.627 0 12-5.373 12-12S18.627 0 12 0zm0 21.818a9.793 9.793 0 0 1-5.006-1.374l-.357-.213-3.734.977.997-3.64-.232-.374A9.78 9.78 0 0 1 2.182 12C2.182 6.57 6.57 2.182 12 2.182S21.818 6.57 21.818 12 17.43 21.818 12 21.818z"})]}),"WhatsApp'ta Paylaş"]}),e.jsxs(h,{onClick:()=>ke(r,"download"),className:"bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-xl font-bold shadow-lg",children:[e.jsx(te,{className:"w-4 h-4 mr-2"}),"Görseli İndir"]}),e.jsxs(h,{onClick:()=>ke(r,"share"),className:"bg-indigo-600 hover:bg-indigo-700 text-white px-6 py-3 rounded-xl font-bold shadow-lg",children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),"Görseli Paylaş"]}),e.jsx(h,{onClick:async()=>{E(!0),k(null),N([]),T(null),j(new Array(z).fill(!1)),await new Promise(t=>setTimeout(t,2e3)),E(!1)},className:"bg-gradient-to-r from-teal-600 to-emerald-600 hover:from-teal-700 hover:to-emerald-700 text-white px-6 py-3 rounded-xl font-bold shadow-lg",children:"🔄 Yeni Kart Çek"})]})]}):P.length>0?e.jsxs("div",{className:"relative flex flex-col items-center justify-center",children:[e.jsx(f.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},className:"relative mb-8",style:{zIndex:50},children:e.jsx("div",{className:"flex flex-col sm:flex-row gap-6 items-center justify-center",children:P.map((t,l)=>{var s;return e.jsxs(f.div,{initial:{opacity:0,scale:.3,y:100},animate:{opacity:1,scale:1,y:0},transition:{delay:l*.3},className:"relative flex flex-col items-center gap-3",children:[e.jsxs("div",{className:"w-48 h-64 md:w-56 md:h-72 relative",children:[e.jsx("div",{className:"absolute inset-0 bg-black/20 rounded-[20px] transform translate-y-4 translate-x-4 blur-lg"}),e.jsxs("div",{className:"relative w-full h-full rounded-[20px] overflow-hidden border-6 border-teal-600 bg-white shadow-xl",children:[e.jsx("img",{src:((s=b==null?void 0:b.data)==null?void 0:s.frontImage)||"/upload/cards/decks/501001/front.webp",alt:`Card ${l+1}`,className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-black/20 p-4 flex flex-col items-center justify-center text-center",children:e.jsxs(f.div,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},transition:{delay:.5+l*.3},className:"bg-transparent p-3 rounded-xl border-2 border-white/30",children:[e.jsx("h4",{className:"text-sm font-bold text-teal-800 mb-2",children:l===0?"Geçmiş":l===1?"Şuan":"Gelecek"}),e.jsx("p",{className:"text-gray-700 text-xs leading-relaxed",children:t.content})]})})]})]}),e.jsxs(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.8+l*.3},className:"flex gap-2",children:[e.jsxs(h,{onClick:()=>ve(t),className:"bg-blue-600 hover:bg-blue-700 text-white px-3 py-2 rounded-lg font-bold shadow text-xs",children:[e.jsx(te,{className:"w-3 h-3 mr-1"}),"Görseli İndir"]}),e.jsxs(h,{onClick:()=>je(t),className:"bg-indigo-600 hover:bg-indigo-700 text-white px-3 py-2 rounded-lg font-bold shadow text-xs",children:[e.jsx(ee,{className:"w-3 h-3 mr-1"}),"Görseli Paylaş"]}),e.jsxs(h,{onClick:()=>{const m=l===0?"Geçmiş":l===1?"Şuan":"Gelecek",n=`${window.location.origin}/cards/${t.id}/detail`,i=`${m} kartım: ${t.title} 🎴 ${n}`;window.open(`https://wa.me/?text=${encodeURIComponent(i)}`,"_blank")},className:"bg-green-500 hover:bg-green-600 text-white px-3 py-2 rounded-lg font-bold shadow text-xs",children:[e.jsxs("svg",{className:"w-3 h-3 mr-1 inline-block",viewBox:"0 0 24 24",fill:"currentColor",children:[e.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347z"}),e.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12c0 2.091.535 4.06 1.472 5.772L.072 23.927l6.29-1.644A11.956 11.956 0 0 0 12 24c6.627 0 12-5.373 12-12S18.627 0 12 0zm0 21.818a9.793 9.793 0 0 1-5.006-1.374l-.357-.213-3.734.977.997-3.64-.232-.374A9.78 9.78 0 0 1 2.182 12C2.182 6.57 6.57 2.182 12 2.182S21.818 6.57 21.818 12 17.43 21.818 12 21.818z"})]}),"WhatsApp'ta Paylaş"]})]})]},`${t.id}-${l}`)})})},"drawn-cards"),e.jsxs(f.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{delay:1.2},className:"flex gap-6 mt-4 flex-wrap justify-center",children:[e.jsx(h,{onClick:()=>{k(null),N([]),j(new Array(z).fill(!1)),T(null)},className:"bg-gray-600 hover:bg-gray-700 text-white px-6 py-3 rounded-xl font-bold shadow-lg",children:"✕ Kapat"}),e.jsxs(h,{onClick:async()=>{var t,l,s,m;if((t=P[0])!=null&&t.id)try{const i=await(await fetch(`/api/cards/card/${P[0].id}`)).json();i.success?L({title:((l=P[0])==null?void 0:l.title)||"Seçilen Kartlar",description:i.data.content||"Bu üç kart geçmiş, şu an ve gelecek dönemlerinizi temsil ediyor. Her birinin kendine özel mesajları var ve yaşamınızın farklı dönemlerine ışık tutuyor."}):L({title:((s=P[0])==null?void 0:s.title)||"Seçilen Kartlar",description:"Bu üç kart geçmiş, şu an ve gelecek dönemlerinizi temsil ediyor. Her birinin kendine özel mesajları var ve yaşamınızın farklı dönemlerine ışık tutuyor."})}catch(n){console.error("Error fetching card details:",n),L({title:((m=P[0])==null?void 0:m.title)||"Seçilen Kartlar",description:"Bu üç kart geçmiş, şu an ve gelecek dönemlerinizi temsil ediyor. Her birinin kendine özel mesajları var ve yaşamınızın farklı dönemlerine ışık tutuyor."})}V(!0)},className:"bg-yellow-600 hover:bg-yellow-700 text-white px-6 py-3 rounded-xl font-bold shadow-lg",children:[e.jsx(ce,{className:"w-4 h-4 mr-2"}),"Kartları Yorumla"]}),e.jsx(h,{onClick:async()=>{E(!0),k(null),N([]),T(null),j(new Array(z).fill(!1)),await new Promise(t=>setTimeout(t,2e3)),E(!1)},className:"bg-gradient-to-r from-teal-600 to-emerald-600 hover:from-teal-700 hover:to-emerald-700 text-white px-6 py-3 rounded-xl font-bold shadow-lg",children:"🔄 Yeni 3 Kart Çek"})]})]}):u.length===0?e.jsxs(f.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"flex flex-col items-center justify-center",children:[e.jsx(O,{className:"w-12 h-12 text-teal-600 mb-4 animate-spin"}),e.jsx("p",{className:"text-teal-800 font-bold text-lg",children:"Kartlar yükleniyor..."})]},"loading-cards"):e.jsx("div",{className:"relative w-full h-full flex items-center justify-center",style:{minHeight:"400px"},children:e.jsx("div",{className:"relative",style:{width:"1200px",height:"300px",perspective:"1500px"},children:[0,1,2,3,4,5,6,7,8].map(t=>{var i,x;const s=[{x:-400,y:60,rotate:-25,scale:.8},{x:-300,y:30,rotate:-20,scale:.85},{x:-200,y:10,rotate:-15,scale:.9},{x:-100,y:0,rotate:-10,scale:.95},{x:0,y:-10,rotate:0,scale:1},{x:100,y:0,rotate:10,scale:.95},{x:200,y:10,rotate:15,scale:.9},{x:300,y:30,rotate:20,scale:.85},{x:400,y:60,rotate:25,scale:.8}][t],m=Be[t],n=u[t]||null;return e.jsx(f.div,{initial:{opacity:0,y:100},animate:{opacity:1,y:0,x:s.x,translateY:s.y,rotateY:s.rotate,scale:s.scale},transition:{delay:t*.1,duration:.8,type:"spring",stiffness:100},className:"absolute cursor-pointer",style:{left:"50%",top:"50%",marginLeft:"-60px",marginTop:"-90px",width:"120px",height:"180px",zIndex:t===4?20:10-Math.abs(t-4),transformStyle:"preserve-3d"},whileHover:{scale:s.scale*1.1,translateY:s.y-20,transition:{duration:.2}},onClick:()=>{X==="single"?(j(d=>{const o=[...d];return o[t]=!o[t],o}),setTimeout(()=>{if(u&&u.length>0){const d=Math.floor(Math.random()*u.length),o=u[d];console.log(`✅ Rastgele kart çekiliyor: Index ${d}/${u.length}, DeckID: ${o.deckId}`,o),k({id:o.id,title:o.title,content:o.content||"Kart açıklaması yükleniyor...",contentId:o.contentId||null,contentSlug:o.contentSlug||null,contentType:o.contentType||null})}else console.log("❌ dynamicCards boş veya yüklenmedi"),k({id:0,title:"Kart Yükleniyor",content:"Lütfen bekleyin, kartlar yükleniyor...",contentId:null})},600)):X==="triple"&&(j(d=>{const o=[...d];return o[t]=!o[t],o}),setTimeout(()=>{if(u&&u.length>=3){const d=[...u].sort(()=>Math.random()-.5),[o,F,H]=d;N([{id:o.id,title:o.title,content:o.content||""},{id:F.id,title:F.title,content:F.content||""},{id:H.id,title:H.title,content:H.content||""}])}else if(u&&u.length>0){const d=()=>{const o=u[Math.floor(Math.random()*u.length)];return{id:o.id,title:o.title,content:o.content||""}};N([d(),d(),d()])}},600))},children:e.jsxs(f.div,{animate:{rotateY:m?180:0},transition:{duration:.6},style:{width:"100%",height:"100%",transformStyle:"preserve-3d",position:"relative"},children:[e.jsxs("div",{className:"absolute w-full h-full rounded-xl overflow-hidden shadow-2xl",style:{backfaceVisibility:"hidden",border:"3px solid #14b8a6"},children:[e.jsx("img",{src:(a==null?void 0:a.backImage)||`/upload/cards/decks/${(a==null?void 0:a.deckId)||"501001"}/back.webp`,alt:"Card Back",className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"bg-teal-700/90 text-white px-3 py-2 rounded-lg",children:[e.jsx("h3",{className:"text-xs font-bold",children:((i=a==null?void 0:a.title)==null?void 0:i.split(" ")[0])||"Kart"}),e.jsx("p",{className:"text-xs",children:((x=a==null?void 0:a.title)==null?void 0:x.split(" ")[1])||"LARI"})]})})]}),e.jsxs("div",{className:"absolute w-full h-full rounded-xl overflow-hidden shadow-2xl",style:{backfaceVisibility:"hidden",transform:"rotateY(180deg)",border:"3px solid #14b8a6"},children:[e.jsx("img",{src:(n==null?void 0:n.mediaUrl)||(a==null?void 0:a.frontImage)||`/upload/cards/decks/${(a==null?void 0:a.deckId)||"501001"}/front.webp`,alt:"Card Front",className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-black/20 p-2 flex items-center justify-center",children:e.jsx("div",{className:"bg-white/60 backdrop-blur-sm p-2 rounded-lg",children:e.jsx("p",{className:"text-xs text-gray-800 text-center font-semibold",children:(n==null?void 0:n.title)||`Kart ${t+1}`})})})]})]})},t)})})})})]})]}),e.jsx(Ae,{open:Y,onOpenChange:t=>{Q(t),t||(ge(null),ue(null))},children:e.jsxs(Ke,{className:"sm:max-w-[480px] bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700",children:[e.jsxs(Pe,{children:[e.jsxs(Le,{className:"text-lg font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[R==="download"?e.jsx(te,{className:"w-5 h-5 text-blue-500"}):e.jsx(ee,{className:"w-5 h-5 text-indigo-500"}),R==="download"?"Görseli İndir":"Görseli Paylaş"]}),e.jsx(Je,{className:"text-gray-600 dark:text-gray-400 text-sm",children:"Görsele kişisel bir not eklemek ister misiniz? (İsteğe bağlı, en fazla 60 karakter)"})]}),e.jsx("div",{className:"flex justify-center py-2",children:e.jsxs("div",{className:"relative w-[180px] h-[240px] rounded-xl overflow-hidden border-2 border-gray-200 dark:border-gray-600 shadow-lg bg-gray-100 dark:bg-gray-800 flex items-center justify-center",children:[fe&&!J&&e.jsx(O,{className:"w-6 h-6 animate-spin text-gray-400"}),J&&e.jsx("img",{src:J,alt:"Kart önizlemesi",className:"w-full h-full object-cover"}),fe&&J&&e.jsxs("div",{className:"absolute inset-0 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/30 animate-pulse"}),e.jsx(O,{className:"relative z-10 w-7 h-7 animate-spin text-white drop-shadow-lg"})]})]})}),e.jsxs("div",{className:"py-1",children:[e.jsx(Ze,{htmlFor:"personal-msg",className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2 block",children:"Kişisel Notunuz"}),e.jsx(De,{id:"personal-msg",placeholder:"Örn: Bugün kendime bunu hatırlatıyorum...",value:M,onChange:t=>re(t.target.value.slice(0,60)),className:"border-gray-300 dark:border-gray-600",maxLength:60,autoFocus:!0,onKeyDown:t=>{t.key==="Enter"&&Ne()}}),e.jsxs("p",{className:"text-xs text-gray-400 mt-1 text-right",children:[M.length,"/60"]})]}),e.jsxs(et,{className:"flex gap-2 sm:flex-row flex-col",children:[e.jsx(h,{variant:"outline",onClick:()=>Q(!1),className:"border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300",children:"İptal"}),e.jsx(h,{onClick:Ne,className:R==="download"?"bg-blue-600 hover:bg-blue-700 text-white":"bg-indigo-600 hover:bg-indigo-700 text-white",children:R==="download"?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-4 h-4 mr-2"}),"İndir"]}):e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),"Paylaş"]})})]})]})}),e.jsx(Ae,{open:Re,onOpenChange:V,children:e.jsxs(Ke,{className:"sm:max-w-[600px] max-h-[80vh] overflow-y-auto bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700",children:[e.jsx(Pe,{children:e.jsxs(Le,{className:"text-xl font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[e.jsx(ce,{className:"w-6 h-6 text-teal-500"}),"Kart Yorumu"]})}),se&&e.jsxs("div",{className:"space-y-4 pt-4",children:[e.jsxs("div",{className:"bg-gradient-to-r from-teal-50 to-emerald-50 dark:from-teal-900/30 dark:to-emerald-900/30 p-4 rounded-lg border border-teal-200 dark:border-teal-600",children:[e.jsx("h3",{className:"text-lg font-semibold text-teal-800 dark:text-teal-200 mb-2",children:"Çekilen Kart:"}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 font-medium",children:se.title})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800/50 p-6 rounded-lg border border-gray-200 dark:border-gray-600",children:[e.jsx("h4",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-3",children:"Kartın Anlamı ve Mesajı:"}),e.jsx("div",{className:"text-gray-700 dark:text-gray-300 leading-relaxed text-base whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:(se.description||"").replace(/(https?:\/\/[^\s]+)/g,'<a href="$1" target="_blank" rel="noopener noreferrer" class="text-blue-600 dar
1k:text-blue-400 underline hover:text-blue-800 dark:hover:text-blue-300 font-medium">$1</a>')}})]}),e.jsx("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg border border-yellow-200 dark:border-yellow-600",children:e.jsx("p",{className:"text-yellow-800 dark:text-yellow-200 text-sm",children:"💫 Bu kart size özel bir mesaj getiriyor. Kartın enerjisini hissedin ve size verdiği rehberliği kalbenizle dinleyin."})}),e.jsx("div",{className:"flex justify-center pt-4",children:e.jsx(h,{onClick:()=>V(!1),className:"bg-teal-600 hover:bg-teal-700 text-white px-6 py-2 rounded-lg",children:"Kapat"})})]})]})})]})}export{it 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.