(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9703],{2317:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("gamepad-2",[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]])},5917:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},5937:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]])},6191:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},6613:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("trophy",[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]])},30814:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},30940:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("layout-list",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]])},35795:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]])},38104:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("calendar-check",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]])},40134:(e,s,t)=>{"use strict";t.d(s,{Z:()=>n});var a=t(95155),r=t(12115),l=t(3998),i=t(83457),o=t(36489);function n(e){let{itemId:s,itemType:t,className:n,showText:c=!0,onRemove:d,onFavoriteChange:m}=e,{data:h}=(0,o.useSession)(),[x,u]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{h&&v()},[h,s]);let v=async()=>{try{let e=await fetch("/api/user/favorites"),t=await e.json();if(t.success){let e=t.data.cafes.some(e=>e.item.id===s||e.item.id===parseInt(s));u(e)}}catch(e){console.error("خطا در بررسی وضعیت علاقه‌مندی:",e)}},y=async()=>{if(console.log("FavoriteButton: toggleFavorite called",{session:!!h,itemId:s,itemType:t}),!h){window.location.href="/auth/customer/signin";return}g(!0);try{if(x){console.log("FavoriteButton: Removing from favorites");let e=await fetch("/api/user/favorites"),t=await e.json();if(t.success){let e=t.data.cafes.find(e=>e.item.id===s||e.item.id===parseInt(s));if(e){let s=await fetch("/api/user/favorites/".concat(e.favoriteId),{method:"DELETE"}),t=await s.json();t.success?(console.log("FavoriteButton: Successfully removed from favorites"),u(!1),null==m||m()):console.error("FavoriteButton: Failed to remove from favorites",t)}}}else{console.log("FavoriteButton: Adding to favorites");let e=await fetch("/api/user/favorites",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({itemId:s,itemType:t})}),a=await e.json();console.log("FavoriteButton: Add response",a),a.success?(console.log("FavoriteButton: Successfully added to favorites"),u(!0),null==m||m()):console.error("FavoriteButton: Failed to add to favorites",a)}}catch(e){console.error("FavoriteButton: خطا در تغییر وضعیت علاقه‌مندی:",e)}finally{g(!1)}};return(0,a.jsxs)(l.$,{variant:x?"default":"outline",size:"sm",onClick:y,disabled:p,className:n,children:[(0,a.jsx)(i.A,{className:"h-4 w-4 ".concat(c?"ml-2":""," ").concat(x?"fill-current":"")}),c&&(x?"در علاقه‌مندی‌ها":"افزودن به علاقه‌مندی‌ها")]})}},44328:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>W});var a=t(95155),r=t(3998),l=t(86948),i=t(65142),o=t(11647),n=t(10774),c=t(20508),d=t(6191),m=t(86651),h=t(2317),x=t(52619),u=t.n(x),p=t(15239),g=t(12115),v=t(36489),y=t(20063),f=t(86600),b=t(66091),j=t(96093),w=t(16536),N=t(40134),k=t(44503),A=t(21873),C=t(26983),M=t(5937),z=t(52987);let S=e=>{let{cafe:s}=e;return(0,a.jsxs)(l.Zp,{className:"group transition-[transform,box-shadow] duration-200 ease-out transform-gpu will-change-[transform,box-shadow] md:hover:-translate-y-1 md:hover:shadow-xl border-0 shadow-md overflow-hidden pt-0 rounded-3xl mx-2",children:[(0,a.jsxs)("div",{className:"relative",children:[s.images&&s.images.length>0&&!s.images[0].includes("placeholder")?(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(k.b,{images:s.images,logo:s.logo||void 0,cafeName:s.name,className:"aspect-video rounded-3xl",showGallery:!1,priority:!1}),(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/30 via-transparent to-transparent rounded-3xl"})]}):(0,a.jsx)("div",{className:"aspect-video rounded-3xl bg-gradient-to-br from-playmo-purple-400 via-playmo-blue-400 to-playmo-purple-600 flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-white text-center",children:[(0,a.jsx)(h.A,{className:"h-16 w-16 mx-auto mb-2 opacity-80"}),(0,a.jsx)("p",{className:"text-lg font-semibold",children:s.name})]})}),(0,a.jsx)("div",{className:"absolute bottom-3 left-3 z-10",children:(0,a.jsxs)("div",{className:"bg-white/90 backdrop-blur-sm px-2 py-1 rounded-full text-xs font-medium text-gray-700",children:[(0,a.jsx)(A.A,{className:"h-3 w-3 inline ml-1"}),s.district]})})]}),(0,a.jsxs)(l.Wu,{className:"p-6 space-y-4 text-right",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-bold text-gray-900 mb-2 group-hover:text-playmo-purple-600 transition-colors leading-tight",children:s.name}),(0,a.jsx)("p",{className:"text-sm text-gray-600 line-clamp-2 leading-relaxed",children:s.description})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 space-x-reverse",children:[(0,a.jsx)("div",{className:"p-1.5 bg-green-50 rounded-lg",children:(0,a.jsx)(A.A,{className:"h-4 w-4 text-green-600"})}),(0,a.jsx)("span",{className:"text-gray-700 font-medium line-clamp-1",children:s.address})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2 space-x-reverse",children:[(0,a.jsx)("div",{className:"p-1.5 bg-playmo-blue-50 rounded-lg",children:(0,a.jsx)(C.A,{className:"h-4 w-4 text-playmo-blue-600"})}),(0,a.jsx)("span",{className:"text-gray-700 font-medium",children:s.openHours})]})]}),(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2 space-x-reverse",children:[(0,a.jsx)("div",{className:"p-1.5 bg-orange-50 rounded-lg",children:(0,a.jsx)(M.A,{className:"h-4 w-4 text-orange-600"})}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"flex items-center space-x-1 space-x-reverse mt-0.5",children:(0,a.jsxs)("span",{className:"text-xs text-gray-600",children:[s.reviewCount," نظر"]})})})]})})]}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(u(),{href:"/cafes/".concat(s.id),className:"flex-1",children:(0,a.jsxs)(r.$,{className:"w-full group/btn relative overflow-hidden bg-gradient-to-r from-playmo-purple-600 to-playmo-blue-600 hover:from-playmo-purple-700 hover:to-playmo-blue-700 border-0 h-11 rounded-2xl px-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,a.jsx)("span",{className:"font-medium",children:"مشاهده جزئیات"}),(0,a.jsx)(z.A,{className:"h-4 w-4 group-hover/btn:translate-x-1 transition-transform"})]}),(0,a.jsx)("div",{className:"absolute inset-0 -top-0.5 -bottom-0.5 bg-gradient-to-r from-transparent via-white/20 to-transparent translate-x-[-100%] group-hover/btn:translate-x-[100%] transition-transform duration-700"})]})}),(0,a.jsx)(N.Z,{itemId:s.id.toString(),itemType:"CAFE",className:"px-3 h-11 rounded-2xl",showText:!1})]})})]})]})},E=e=>{let{cafe:s}=e,[t,r]=g.useState(!1),i=!!(s.images&&s.images.length>0&&!s.images[0].includes("placeholder")&&!t);return(0,a.jsx)(u(),{href:"/cafes/".concat(s.id),children:(0,a.jsxs)(l.Zp,{className:"relative aspect-[4/3] w-full overflow-hidden rounded-3xl border-0 shadow-md group cursor-pointer transition-[transform,box-shadow] duration-200 ease-out transform-gpu will-change-[transform,box-shadow] md:hover:-translate-y-1 md:hover:shadow-xl",children:[(0,a.jsx)("div",{className:"absolute inset-0 z-0 bg-gray-950",children:i?(0,a.jsx)(p.default,{src:s.images[0],alt:s.name,fill:!0,sizes:"(max-width: 768px) 50vw, (max-width: 1200px) 33vw, 25vw",className:"object-cover w-full h-full transition-transform duration-300 ease-out transform-gpu md:group-hover:scale-105",unoptimized:!(0,j.Vd)(s.images[0]),onError:()=>r(!0)}):(0,a.jsx)("div",{className:"w-full h-full bg-[#ffa515] flex items-center justify-center p-6",children:(0,a.jsx)("div",{className:"relative w-1/2",style:{aspectRatio:"169.26/53.85"},children:(0,a.jsx)(p.default,{src:"/logo-full.svg",alt:"Playmo",fill:!0,className:"object-contain transition-transform duration-300 ease-out transform-gpu md:group-hover:scale-105",priority:!0})})})}),(0,a.jsx)("div",{className:"absolute inset-0 z-10 bg-gradient-to-t from-black/90 via-black/35 to-black/10 group-hover:from-black/95 group-hover:via-black/45 transition-colors duration-300"}),s.activeEventsCount&&s.activeEventsCount>0?(0,a.jsx)("div",{className:"absolute top-2.5 left-2.5 z-20",children:(0,a.jsxs)(o.E,{className:"h-6 rounded-lg bg-playmo-purple-600/90 hover:bg-playmo-purple-600/90 border-0 backdrop-blur-md text-white text-[10px] sm:text-[11px] font-semibold flex items-center gap-1 px-2",children:[(0,a.jsx)("span",{children:"\uD83D\uDCC5"}),(0,a.jsxs)("span",{children:[s.activeEventsCount," رویداد"]})]})}):null,(0,a.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-3 sm:p-4 z-20 text-right flex flex-col gap-1",children:[(0,a.jsx)("h3",{className:"text-sm sm:text-base font-bold text-white leading-tight line-clamp-1 drop-shadow-sm",children:s.name}),(0,a.jsxs)("div",{className:"flex items-center justify-between text-[10px] sm:text-[11px] text-white/80",children:[(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)(A.A,{className:"h-3 w-3 text-white/60 ml-0.5 inline"}),(0,a.jsx)("span",{className:"line-clamp-1",children:s.district})]}),s.reviewCount>0&&(0,a.jsxs)("span",{className:"opacity-90",children:[s.reviewCount," نظر"]})]})]})]})})};var F=t(30940),T=t(94610);let D=e=>{let{viewMode:s,onViewModeChange:t,totalCount:l}=e;return(0,a.jsxs)("div",{className:"flex items-center justify-between mb-6 px-2 sm:px-0 select-none animate-fade-in",children:[(0,a.jsxs)("div",{className:"text-sm text-gray-500 font-medium text-right",children:["تعداد کافه‌گیم‌ها: ",(0,a.jsx)("span",{className:"font-bold text-gray-800",children:l})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 bg-gray-100/80 p-1 rounded-xl shadow-inner border border-gray-200/20",children:[(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>t("grid"),title:"نمای کارت بزرگ",className:"h-8 w-8 p-0 rounded-lg transition-all duration-200 flex items-center justify-center ".concat("grid"===s?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-900 hover:bg-white/40"),children:(0,a.jsx)(F.A,{className:"h-4 w-4"})}),(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>t("compact"),title:"نمای فشرده",className:"h-8 w-8 p-0 rounded-lg transition-all duration-200 flex items-center justify-center ".concat("compact"===s?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-900 hover:bg-white/40"),children:(0,a.jsx)(T.A,{className:"h-4 w-4"})})]})]})};var $=t(85898),O=t(51950),_=t(25913),B=t(27022),H=t(94897),R=t(73618),I=t(77733),L=t(41751);let V=["همه","مرکز","شمال","جنوب","شرق","غرب"];function W(){var e,s,t,x;let[N,k]=(0,g.useState)(""),[A,C]=(0,g.useState)("همه"),[M,z]=(0,g.useState)("compact"),[F,T]=(0,g.useState)(!1),[W,Z]=(0,g.useState)(!1),[q,P]=(0,g.useState)(!1),[U,G]=(0,g.useState)(!1),{data:J,update:K}=(0,v.useSession)(),Q=(0,y.useRouter)(),{data:X,mutate:Y}=(0,f.C)((null==J?void 0:J.user)?"/api/user/gamification-progress":null),ee=null==X?void 0:X.data,es=(null!=(x=null==ee?void 0:ee.level)?x:0)>=1,et=(0,L.x)(null==ee?void 0:ee.username,null==J||null==(e=J.user)?void 0:e.username),ea=()=>(null==J?void 0:J.user)?J.user.archetype?et?void T(!0):void G(!0):void Z(!0):void Q.push((0,b.kk)()+"?callbackUrl=/cafes"),er=()=>{if(!(null==J?void 0:J.user))return void Q.push((0,b.kk)()+"?callbackUrl=/cafes");es?ea():P(!0)},el=async e=>{K&&await K(e?{archetype:e}:void 0),Z(!1),setTimeout(()=>{et?T(!0):G(!0)},150)},ei=async e=>{try{K&&e&&await K({username:e}),Y&&await Y()}catch(e){console.error("Failed to sync session and cache after username registration",e)}setTimeout(()=>{T(!0)},150)},{data:eo,isLoading:en,error:ec}=(0,f.C)("/api/cafes"),ed=(null==eo?void 0:eo.data)||[],em=(0,g.useMemo)(()=>ed.map(e=>{var s,t;return{id:e.id,name:e.name,description:e.description||"کافه گیمینگ",address:e.address,city:(0,w.dM)(e.city||"Tehran"),district:e.district||"نامشخص",images:(0,j.Wb)(e.images),logo:(0,j.EY)(e.logo),openTime:e.openTime,closeTime:e.closeTime,hourlyRate:e.hourlyRate,openHours:e.openTime&&e.closeTime?"".concat(e.openTime," - ").concat(e.closeTime):"10:00 - 24:00",priceRange:"متوسط",reviewCount:(null==(s=e._count)?void 0:s.reviews)||0,activeEventsCount:(null==(t=e._count)?void 0:t.events)||0,_count:e._count}}),[ed]),eh=(0,g.useCallback)(e=>e.city,[]),{selectedCity:ex,setSelectedCity:eu,smartCities:ep,matchesCity:eg}=(0,_.W)(em,eh,null==J||null==(s=J.user)?void 0:s.city),ev=(0,g.useMemo)(()=>em.filter(e=>{let s=e.name.toLowerCase().includes(N.toLowerCase())||e.address.toLowerCase().includes(N.toLowerCase()),t="همه"===A||e.district===A;return s&&eg(e.city)&&t}),[em,N,eg,A]);return(0,a.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-playmo-blue-50 via-white to-playmo-purple-50",children:[(0,a.jsxs)("div",{className:"fixed top-0 left-0 right-0 z-50 bg-white/50 backdrop-blur-xl shadow-sm border-b border-gray-200/60",children:[(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,a.jsxs)("div",{className:"flex items-center justify-between h-16",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-4 space-x-reverse",children:[(0,a.jsx)(n.U,{}),(0,a.jsx)("div",{className:"h-6 w-px bg-gray-300 hidden sm:block"}),(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)("h1",{className:"text-xl sm:text-2xl font-bold text-gray-900",children:"کافه‌گیم‌ها"}),(0,a.jsxs)(o.E,{variant:"secondary",className:"hidden sm:inline-flex bg-playmo-purple-100 text-playmo-purple-700 text-xs font-semibold px-2 py-0.5 rounded-full",children:[(0,O.ub)(ev.length)," کافه"]})]})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2 sm:space-x-3 space-x-reverse",children:[(0,a.jsxs)("div",{className:"hidden md:flex items-center space-x-4 space-x-reverse",children:[(0,a.jsx)(u(),{href:"/",children:(0,a.jsxs)(r.$,{variant:"ghost",size:"sm",className:"flex items-center gap-2 text-gray-700 hover:text-amber-600 hover:bg-amber-50/60 transition-colors",children:[(0,a.jsx)(p.default,{src:"/icon-playmo.png",alt:"آرشین‌ها",width:20,height:20,className:"w-5 h-5 object-contain"}),(0,a.jsx)("span",{children:"آرشـین‌ها"})]})}),(0,a.jsx)(u(),{href:"/events",children:(0,a.jsx)(r.$,{variant:"ghost",size:"sm",children:"رویدادها"})}),(0,a.jsx)(r.$,{onClick:er,size:"sm",className:"bg-gradient-to-r from-playmo-purple-600 to-playmo-blue-600 hover:from-playmo-purple-700 hover:to-playmo-blue-700 text-white shadow-md active:scale-95 transition-transform rounded-xl text-xs font-bold flex items-center gap-1.5 border-0",children:es?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-sm",children:"⚡"}),"ارتقای پاداش (۳٪)"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-sm",children:"\uD83D\uDC51"}),"پلی‌مستر شو"]})}),(null==J?void 0:J.user)?(0,a.jsx)(u(),{href:(()=>{var e;if(!(null==J?void 0:J.user))return"/auth/customer/signin";switch(null==(e=J.user)?void 0:e.role){case"ADMIN":case"SUPER_ADMIN":return"/admin-dashboard";case"CAFE_OWNER":return"/business-dashboard";default:return"/dashboard"}})(),children:(0,a.jsxs)(r.$,{variant:"ghost",size:"sm",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 ml-1"}),"داشبورد"]})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u(),{href:(0,b.kk)(),children:(0,a.jsx)(r.$,{variant:"ghost",size:"sm",children:"ورود"})}),(0,a.jsx)(u(),{href:(0,b.Ku)(),children:(0,a.jsx)(r.$,{variant:"outline",size:"sm",children:"ثبت نام"})})]})]}),(null==J?void 0:J.user)&&(null==(t=J.user)?void 0:t.role)==="CAFE_OWNER"?(0,a.jsx)(u(),{href:"/business-dashboard/events/new",className:"block sm:hidden",children:(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(r.$,{size:"icon",className:"w-9 h-9 rounded-xl bg-green-600 hover:bg-green-700 text-white shadow-md active:scale-95 transition-transform flex items-center justify-center border-0",children:(0,a.jsx)(d.A,{className:"h-5 w-5"})})})}):(0,a.jsx)("div",{className:"block sm:hidden flex items-center",children:(0,a.jsx)(r.$,{onClick:er,className:"h-8 px-2.5 rounded-xl bg-gradient-to-r from-playmo-purple-600 to-playmo-blue-600 hover:from-playmo-purple-700 hover:to-playmo-blue-700 text-white shadow-md active:scale-95 transition-transform flex items-center gap-1 text-xs font-bold border-0",children:es?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-sm",children:"⚡"}),"ارتقای پاداش (۳٪)"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-sm",children:"\uD83D\uDC51"}),"پلی‌مستر شو"]})})}),(0,a.jsx)($.r,{})]})]})}),(0,a.jsx)("div",{className:"hidden sm:block border-t border-gray-100 bg-gray-50/50",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3",children:(0,a.jsx)("p",{className:"text-sm text-gray-600 text-center",children:"بهترین کافه‌گیم‌ها را کشف کنید"})})})]}),(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-4 pt-20 sm:pb-8 sm:pt-36",children:[(0,a.jsx)("div",{className:"bg-white/80 backdrop-blur-md rounded-3xl shadow-sm border border-gray-200/80 p-4 sm:p-6 mb-6",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(m.A,{className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),(0,a.jsx)(i.p,{placeholder:"جستجو در نام کافه، آدرس یا امکانات...",value:N,onChange:e=>k(e.target.value),className:"pr-10 text-right h-11 rounded-2xl border-gray-200 bg-white/60 focus:bg-white transition-colors"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-gray-500 whitespace-nowrap min-w-[44px] text-right",children:"شهر:"}),(0,a.jsx)("div",{className:"flex-1 flex overflow-x-auto gap-2 pb-1 scrollbar-none [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:ep.map(e=>{let s=ex===e.name;return(0,a.jsxs)(r.$,{variant:s?"default":"outline",size:"sm",onClick:()=>{var s;eu(s=e.name),s!==ex&&C("همه")},className:"h-7 rounded-lg px-2.5 text-xs font-medium transition-all duration-150 whitespace-nowrap flex items-center gap-1.5 ".concat(s?"bg-playmo-blue-600 text-white hover:bg-playmo-blue-700 shadow-sm":e.hasItems?"bg-white text-gray-800 hover:bg-playmo-blue-50 hover:text-playmo-blue-600 border-gray-300 font-semibold shadow-xs":"text-gray-400 hover:bg-gray-100 hover:text-gray-600 border-gray-200"),children:[(0,a.jsx)("span",{children:e.name}),e.count>0&&(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.2 rounded-full font-bold leading-tight ".concat(s?"bg-white/25 text-white":"bg-playmo-blue-100 text-playmo-blue-700"),children:(0,O.ub)(e.count)})]},e.name)})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-gray-500 whitespace-nowrap min-w-[44px] text-right",children:"منطقه:"}),(0,a.jsx)("div",{className:"flex-1 flex overflow-x-auto gap-2 pb-1 scrollbar-none [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:V.map(e=>(0,a.jsx)(r.$,{variant:A===e?"default":"outline",size:"sm",onClick:()=>C(e),className:"h-7 rounded-lg px-2.5 text-xs font-medium transition-all duration-150 whitespace-nowrap ".concat(A===e?"bg-playmo-purple-600 text-white hover:bg-playmo-purple-700 shadow-sm":"hover:bg-playmo-purple-50 hover:text-playmo-purple-600 border-gray-200"),children:e},e))})]})]})]})}),(0,a.jsx)(D,{viewMode:M,onViewModeChange:z,totalCount:ev.length}),en?"grid"===M?(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Array(6).fill(0).map((e,s)=>(0,a.jsxs)(l.Zp,{className:"animate-pulse border-0 shadow-md rounded-3xl mx-2",children:[(0,a.jsx)("div",{className:"aspect-video bg-gray-200 rounded-3xl"}),(0,a.jsxs)(l.Wu,{className:"p-6 space-y-4",children:[(0,a.jsx)("div",{className:"h-5 bg-gray-200 rounded w-1/3 mb-2"}),(0,a.jsx)("div",{className:"h-4 bg-gray-200 rounded w-full"}),(0,a.jsx)("div",{className:"h-4 bg-gray-200 rounded w-5/6"}),(0,a.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,a.jsx)("div",{className:"h-4 bg-gray-200 rounded w-3/4"}),(0,a.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]}),(0,a.jsx)("div",{className:"h-10 bg-gray-200 rounded-xl mt-4"})]})]},s))}):(0,a.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 px-2 sm:px-0",children:Array(8).fill(0).map((e,s)=>(0,a.jsx)(l.Zp,{className:"animate-pulse border-0 shadow-md rounded-3xl aspect-[4/3] bg-gray-200"},s))}):"grid"===M?(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:ev.map(e=>(0,a.jsx)(S,{cafe:e},e.id))}):(0,a.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 px-2 sm:px-0",children:ev.map(e=>(0,a.jsx)(E,{cafe:e},e.id))}),!en&&0===ev.length&&(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsxs)("div",{className:"text-gray-500 mb-4",children:[(0,a.jsx)(h.A,{className:"h-16 w-16 mx-auto mb-4 opacity-50"}),(0,a.jsx)("h3",{className:"text-xl font-semibold mb-2",children:"کافه‌ای یافت نشد"}),(0,a.jsx)("p",{children:"با تغییر فیلترها یا جستجوی جدید دوباره تلاش کنید"})]}),(0,a.jsx)(r.$,{variant:"outline",onClick:()=>{k(""),eu("همه"),C("همه")},children:"پاک کردن فیلترها"})]})]}),(0,a.jsx)("div",{className:"h-4 sm:h-8"}),(0,a.jsx)(B.k,{open:F,onOpenChange:T,userCity:ex}),(0,a.jsx)(H.A,{isOpen:W,onClose:()=>Z(!1),onSelectedSuccess:el,introTitle:"ابتدا آرکی‌تایپ خودتو کشف کن",resultButtonText:"ثبت و ورود به ساخت میز \uD83D\uDE80"}),(0,a.jsx)(I.V,{open:q,onOpenChange:P,onOpenCreateTable:ea,onOpenQuiz:()=>Z(!0),onOpenUsernamePrompt:()=>G(!0)}),(0,a.jsx)(R.s,{open:U,onOpenChange:G,onSuccess:ei})]})}},44503:(e,s,t)=>{"use strict";t.d(s,{b:()=>n});var a=t(95155),r=t(12115),l=t(15239),i=t(64269),o=t(96093);function n(e){let{images:s,logo:t,cafeName:n,className:c,showGallery:d=!0,imageCount:m=3,priority:h=!1}=e,[x,u]=(0,r.useState)({}),[p,g]=(0,r.useState)(null);console.log("CafeImageDisplay props:",{images:s,logo:t,cafeName:n});let v=e=>{console.log("Image error for:",e),u(s=>({...s,[e]:!0}))},y=(()=>{if(t&&!x[t])return t;if(Array.isArray(s)&&s.length>0){let e=s.find(e=>!x[e]);if(e)return e}return"/images/cafes/default.svg"})();return console.log("Main image selected:",y),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:(0,i.cn)("relative rounded-lg overflow-hidden",c),children:(0,a.jsx)("div",{className:"relative w-full h-full",children:(0,a.jsx)(l.default,{src:y,alt:"تصویر ".concat(n),fill:!0,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",className:"object-cover transition-transform hover:scale-105",priority:h,unoptimized:!(0,o.Vd)(y),onError:()=>v(y)})})}),p&&(0,a.jsx)("div",{className:"fixed inset-0 bg-black/90 z-50 flex items-center justify-center p-4",onClick:()=>g(null),children:(0,a.jsxs)("div",{className:"relative max-w-4xl max-h-full",children:[(0,a.jsx)(l.default,{src:p,alt:"تصویر ".concat(n),width:800,height:600,className:"object-contain max-w-full max-h-full rounded-lg",unoptimized:!(0,o.Vd)(p),onError:()=>{v(p),g(null)}}),(0,a.jsx)("button",{onClick:()=>g(null),className:"absolute top-4 right-4 bg-black/60 text-white p-2 rounded-full hover:bg-black/80 transition-colors",children:"✕"})]})})]})}n.defaultProps={images:[],showGallery:!0,imageCount:3,priority:!1}},48055:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]])},54690:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("qr-code",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]])},60709:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]])},76907:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},78108:(e,s,t)=>{"use strict";t.d(s,{Z:()=>r});var a=t(12115);function r(e){let s=a.useRef({value:e,previous:e});return a.useMemo(()=>(s.current.value!==e&&(s.current.previous=s.current.value,s.current.value=e),s.current.previous),[e])}},83117:(e,s,t)=>{Promise.resolve().then(t.bind(t,44328))},83457:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]])},84288:(e,s,t)=>{"use strict";t.d(s,{X:()=>l});var a=t(12115),r=t(4129);function l(e){let[s,t]=a.useState(void 0);return(0,r.N)(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});let s=new ResizeObserver(s=>{let a,r;if(!Array.isArray(s)||!s.length)return;let l=s[0];if("borderBoxSize"in l){let e=l.borderBoxSize,s=Array.isArray(e)?e[0]:e;a=s.inlineSize,r=s.blockSize}else a=e.offsetWidth,r=e.offsetHeight;t({width:a,height:r})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}t(void 0)},[e]),s}},94610:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(71847).A)("grid-2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]])}},e=>{e.O(0,[9268,586,9017,2619,6489,7173,3171,8720,1691,2387,2377,5239,6524,9829,1805,9597,1733,8079,1900,8907,9619,6645,6858,774,9368,8441,1255,7358],()=>e(e.s=83117)),_N_E=e.O()}]);