1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6648],{31120:(e,t,r)=>{r.d(t,{T:()=>a});var n=r(95155);r(12115);var i=r(64269);function a(e){let{className:t,...r}=e;return(0,n.jsx)("textarea",{"data-slot":"textarea",className:(0,i.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...r})}},66648:(e,t,r)=>{r.r(t),r.d(t,{default:()=>$});var n=r(95155),i=r(12115),a=r(17054),o=r(4755),s=r(13636),l=r(26264),c=r(55027),d=r.n(c),m=r(70542),u=r(18720);r(35603);var h=r(74136),g=r(3998),f=r(65142),p=r(99708),x=r(70809),y=r(7658),v=r(5937),w=r(35022),j=r(20017),b=r(52056),A=r(6259),C=r(15239),k=r(52619),N=r.n(k),R=r(64269);function S(e){let{center:t,radius:r,color:n="#fe405c",isActive:o=!0}=e,s=(0,a.ko)(),l=(0,i.useRef)([]),c=(0,i.useRef)();return(0,i.useEffect)(()=>{if(!o)return;let e=[];for(let i=0;i<2;i++){let i=d().circle(t,{radius:r,color:n,fillColor:n,fillOpacity:0,weight:2,opacity:0}).addTo(s);e.push(i)}l.current=e;let i=Date.now(),a=()=>{let t=Date.now();e.forEach((e,n)=>{let a=t-(i+1e3*n);if(a>=0){let t=a%2e3/2e3;if(t<=1){let n=t<.8?.8-t:0;e.setRadius(r*(.3+.7*t)),e.setStyle({opacity:n,fillOpacity:.1*n})}}}),c.current=requestAnimationFrame(a)};return c.current=requestAnimationFrame(a),()=>{c.current&&cancelAnimationFrame(c.current),e.forEach(e=>{s.hasLayer(e)&&s.removeLayer(e)})}},[s,t,r,n,o]),(0,i.useEffect)(()=>{l.current.forEach(e=>{e.setLatLng(t)})},[t]),null}var E=r(71708),F=r(27631),M=r(89743);let z=e=>{let{text:t}=e,r=(0,i.useRef)(null),[a,o]=(0,i.useState)(24),[s,l]=(0,i.useState)(54);return(0,i.useEffect)(()=>{if(r.current){let e=r.current.scrollHeight;o(e),l(Math.max(54,24+e+10))}},[t]),(0,n.jsxs)("div",{className:"w-full max-w-[260px] mx-auto",children:[(0,n.jsx)("style",{children:"\n @keyframes overlayAnimation1 {\n 0% { transform: rotate(0deg); }\n 50% { transform: rotate(10deg); }\n 100% { transform: rotate(0deg); }\n }\n @keyframes overlayAnimation2 {\n 0% { transform: rotate(10deg); }\n 50% { transform: rotate(20deg); }\n 100% { transform: rotate(10deg); }\n }\n @keyframes overlayAnimation3 {\n 0% { transform: rotate(20deg); }\n 50% { transform: rotate(30deg); }\n 100% { transform: rotate(20deg); }\n }\n @keyframes overlayAnimation4 {\n 0% { transform: rotate(30deg); }\n 50% { transform: rotate(40deg); }\n 100% { transform: rotate(30deg); }\n }\n @keyframes overlayAnimation5 {\n 0% { transform: rotate(40deg); }\n 50% { transform: rotate(50deg); }\n 100% { transform: rotate(40deg); }\n }\n @keyframes overlayAnimation6 {\n 0% { transform: rotate(50deg); }\n 50% { transform: rotate(60deg); }\n 100% { transform: rotate(50deg); }\n }\n @keyframes overlayAnimation7 {\n 0% { transform: rotate(60deg); }\n 50% { transform: rotate(70deg); }\n 100% { transform: rotate(60deg); }\n }\n @keyframes overlayAnimation8 {\n 0% { transform: rotate(70deg); }\n 50% { transform: rotate(80deg); }\n 100% { transform: rotate(70deg); }\n }\n @keyframes overlayAnimation9 {\n 0% { transform: rotate(80deg); }\n 50% { transform: rotate(90deg); }\n 100% { transform: rotate(80deg); }\n }\n @keyframes overlayAnimation10 {\n 0% { transform: rotate(90deg); }\n 50% { transform: rotate(100deg); }\n 100% { transform: rotate(90deg); }\n }\n "}),(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 260 ".concat(s),className:"w-full h-auto",children:[(0,n.jsxs)("defs",{children:[(0,n.jsx)("filter",{id:"blur1",children:(0,n.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"3"})}),(0,n.jsx)("mask",{id:"badgeMask",children:(0,n.jsx)("rect",{width:"260",height:s,fill:"white",rx:"10"})})]}),(0,n.jsx)("rect",{width:"260",height:s,rx:"10",fill:"#f3e3ac"}),(0,n.jsx)("rect",{x:"4",y:"4",width:"252",height:s-8,rx:"8",fill:"transparent",stroke:"#bbb",strokeWidth:"1"}),(0,n.jsx)("text",{fontFamily:"Helvetica-Bold, Helvetica",fontSize:"9",fontWeight:"bold",fill:"#666",x:"53",y:"20",children:"AIRDROP REWARD"}),(0,n.jsx)("foreignObject",{x:"52",y:"24",width:"156",height:a,children:(0,n.jsx)("div",{ref:r,
1style:{fontFamily:"Helvetica-Bold, Helvetica",fontSize:"16px",fontWeight:"bold",color:"#666",lineHeight:"1.3",wordWrap:"break-word",overflowWrap:"break-word"},children:t})}),(0,n.jsx)("g",{transform:"translate(8, 9)",children:(0,n.jsx)("path",{fill:"#666",d:"M14.963 9.075c.787-3-.188-5.887-.188-5.887S12.488 5.175 11.7 8.175c-.787 3 .188 5.887.188 5.887s2.25-1.987 3.075-4.987m-4.5 1.987c.787 3-.188 5.888-.188 5.888S7.988 14.962 7.2 11.962c-.787-3 .188-5.887.188-5.887s2.287 1.987 3.075 4.987m.862 10.388s-.6-2.962-2.775-5.175C6.337 14.1 3.375 13.5 3.375 13.5s.6 2.962 2.775 5.175c2.213 2.175 5.175 2.775 5.175 2.775m3.3 3.413s-1.988-2.288-4.988-3.075-5.887.187-5.887.187 1.987 2.287 4.988 3.075c3 .787 5.887-.188 5.887-.188Zm6.75 0s1.988-2.288 4.988-3.075c3-.826 5.887.187 5.887.187s-1.988 2.287-4.988 3.075c-3 .787-5.887-.188-5.887-.188ZM32.625 13.5s-2.963.6-5.175 2.775c-2.213 2.213-2.775 5.175-2.775 5.175s2.962-.6 5.175-2.775c2.175-2.213 2.775-5.175 2.775-5.175M28.65 6.075s.975 2.887.188 5.887c-.826 3-3.076 4.988-3.076 4.988s-.974-2.888-.187-5.888c.788-3 3.075-4.987 3.075-4.987m-4.5 7.987s.975-2.887.188-5.887c-.788-3-3.076-4.988-3.076-4.988s-.974 2.888-.187 5.888c.788 3 3.075 4.988 3.075 4.988ZM18 26.1c.975-.225 3.113-.6 5.325 0 3 .788 5.063 3.038 5.063 3.038s-2.888.975-5.888.187a13 13 0 0 1-1.425-.525c.563.788 1.125 1.425 2.288 1.913l-.863 2.062c-2.063-.862-2.925-2.137-3.675-3.262-.262-.375-.525-.713-.787-1.05-.26.293-.465.586-.686.903l-.102.147-.048.068c-.775 1.108-1.643 2.35-3.627 3.194l-.862-2.062c1.162-.488 1.725-1.125 2.287-1.913-.45.225-.938.375-1.425.525-3 .788-5.887-.187-5.887-.187s1.987-2.288 4.987-3.075c2.212-.563 4.35-.188 5.325.037"})}),(0,n.jsxs)("g",{style:{mixBlendMode:"overlay"},mask:"url(#badgeMask)",children:[(0,n.jsx)("g",{style:{transformOrigin:"center center",animation:"overlayAnimation1 5s infinite",willChange:"transform"},children:(0,n.jsx)("polygon",{points:"0,0 260,".concat(s," 260,0 0,").concat(s),fill:"hsl(358, 100%, 62%)",filter:"url(#blur1)",opacity:"0.5"})}),(0,n.jsx)("g",{style:{transformOrigin:"center center",animation:"overlayAnimation2 5s infinite",willChange:"transform"},children:(0,n.jsx)("polygon",{points:"0,0 260,".concat(s," 260,0 0,").concat(s),fill:"hsl(30, 100%, 50%)",filter:"url(#blur1)",opacity:"0.5"})}),(0,n.jsx)("g",{style:{transformOrigin:"center center",animation:"overlayAnimation3 5s infinite",willChange:"transform"},children:(0,n.jsx)("polygon",{points:"0,0 260,".concat(s," 260,0 0,").concat(s),fill:"hsl(60, 100%, 50%)",filter:"url(#blur1)",opacity:"0.5"})}),(0,n.jsx)("g",{style:{transformOrigin:"center center",animation:"overlayAnimation4 5s infinite",willChange:"transform"},children:(0,n.jsx)("polygon",{points:"0,0 260,".concat(s," 260,0 0,").concat(s),fill:"hsl(96, 100%, 50%)",filter:"url(#blur1)",opacity:"0.5"})}),(0,n.jsx)("g",{style:{transformOrigin:"center center",animation:"overlayAnimation5 5s infinite",willChange:"transform"},children:(0,n.jsx)("polygon",{points:"0,0 260,".concat(s," 260,0 0,").concat(s),fill:"hsl(233, 85%, 47%)",filter:"url(#blur1)",opacity:"0.5"})}),(0,n.jsx)("g",{style:{transformOrigin:"center center",animation:"overlayAnimation6 5s infinite",willChange:"transform"},children:(0,n.jsx)("polygon",{points:"0,0 260,".concat(s," 260,0 0,").concat(s),fill:"hsl(271, 85%, 47%)",filter:"url(#blur1)",opacity:"0.5"})}),(0,n.jsx)("g",{style:{transformOrigin:"center center",animation:"overlayAnimation7 5s infinite",willChange:"transform"},children:(0,n.jsx)("polygon",{points:"0,0 260,".concat(s," 260,0 0,").concat(s),fill:"hsl(300, 20%, 35%)",filter:"url(#blur1)",opacity:"0.5"})}),(0,n.jsx)("g",{style:{transformOrigin:"center center",animation:"overlayAnimation8 5s infinite",willChange:"transform"},children:(0,n.jsx)("polygon",{points:"0,0 260,".concat(s," 260,0 0,").concat(s),fill:"transparent",filter:"url(#blur1)",opacity:"0.5"})}),(0,n.jsx)("g",{style:{transformOrigin:"center center",animation:"overlayAnimation9 5s infinite",willChange:"transform"},children:(0,n.jsx)("polygon",{points:"0,0 260,".concat(s," 260,0 0,").concat(s),fill:"transparent",filter:"url(#blur1)",o
1pacity:"0.5"})}),(0,n.jsx)("g",{style:{transformOrigin:"center center",animation:"overlayAnimation10 5s infinite",willChange:"transform"},children:(0,n.jsx)("polygon",{points:"0,0 260,".concat(s," 260,0 0,").concat(s),fill:"white",filter:"url(#blur1)",opacity:"0.5"})})]})]})]})};function T(e){let{position:t,countdown:r,claimed:i}=e,a=new c.DivIcon({html:'\n <div class="flex justify-center pointer-events-none">\n <div class="inline-flex items-center gap-1 px-3 py-1.5 text-xs font-semibold text-white rounded-full shadow-lg whitespace-nowrap" style="background-color: '.concat(i?"#2EBD8D":"#FE405C",'">\n <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <polyline points="12,6 12,12 16,14"/>\n </svg>\n ').concat(r,"\n </div>\n </div>\n "),className:"countdown-badge-marker",iconSize:[60,20],iconAnchor:[30,-35]});return(0,n.jsx)(l.p,{position:t,icon:a,interactive:!1,zIndexOffset:-1e3})}function I(e){let{position:t,remaining:r,claimed:i}=e,a=new c.DivIcon({html:'\n <div class="flex justify-center pointer-events-none">\n <div class="inline-flex items-center gap-1 px-2 py-1 text-xs font-semibold text-white rounded-full shadow-lg whitespace-nowrap" style="background-color: '.concat(i?"#2EBD8D":"#FE405C",'">\n <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/>\n <path d="m3.3 7 8.7 5 8.7-5"/>\n <path d="M12 22V12"/>\n </svg>\n ').concat(r," Left\n </div>\n </div>\n "),className:"supply-badge-marker",iconSize:[60,20],iconAnchor:[30,-35]});return(0,n.jsx)(l.p,{position:t,icon:a,interactive:!1,zIndexOffset:-999})}function O(e){var t;let{airdrop:r}=e,{userLocation:a,setSelectedAirdrop:o,isAuthenticated:s,setRegistrationModalOpen:d,userClaims:k,fetchUserClaims:O,fetchAirdrops:P,mapZoom:D}=(0,m.C)(),[_,L]=(0,i.useState)(!1),[B,q]=(0,i.useState)(""),[V,W]=(0,i.useState)(0),[H,U]=(0,i.useState)(""),[Z,$]=(0,i.useState)(""),[G,Y]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(!r.expires_at)return;let e=()=>{let e=new Date,t=new Date(r.expires_at).getTime()-e.getTime();if(t<=0)return void q("Expired");let n=Math.floor(t/6e4),i=Math.floor(t/36e5),a=Math.floor(t/864e5);if(a>=1)q("".concat(a,"d"));else if(i>=1){let e=n%60;0===e?q("".concat(i,"h")):q("".concat(i,"h").concat(e,"m"))}else q("".concat(n,"m"))};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[r.expires_at]),(0,i.useEffect)(()=>{!async function(){try{let t=await fetch("/api/airdrops/".concat(r.id,"/comments"));if(t.ok){var e;let r=await t.json();W((null==(e=r.comments)?void 0:e.length)||0)}}catch(e){console.error("Failed to fetch comments count:",e)}}()},[r.id]);let J=e=>{navigator.clipboard.writeText(e).then(()=>{u.oR.success("\uD83C\uDF89 Share text copied!",{description:"Your achievement has been copied to clipboard",duration:3e3})}).catch(()=>{u.oR.error("â Failed to copy",{description:"Please try again",duration:3e3})})},Q=async e=>{if(console.log("\uD83D\uDE80 [AirdropMarker] handleClaim called for airdrop:",r.id),_)return;let{user:t,userLocation:n}=m.C.getState();if(!t||!n)return void u.oR.error("â Cannot claim",{description:"User authentication or location not available",duration:3e3});L(!0);try{let o=await fetch("/api/claims",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({airdropId:r.id,latitude:n.lat,longitude:n.lng,userId:t.id,password:e||void 0})}),s=await o.json();if(console.log("\uD83C\uDF89 Claim response:",s),o.ok)U(""),$(""),await Promise.all([O(),P()]),setTimeout(()=>{let e={origin:{y:.7}};function t(t,r){(0,E.A)({...e,...r,particleCount:Math.floor(200*t)})}
1t(.25,{spread:26,startVelocity:55}),t(.2,{spread:60}),t(.35,{spread:100,decay:.91,scalar:.8}),t(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),t(.1,{spread:120,startVelocity:45})},100),setTimeout(()=>{u.oR.success("\uD83C\uDF89 Airdrop Claimed Successfully!",{duration:5e3})},2e3);else{var i,a;"You are too far from the airdrop location"===s.error?u.oR.error("\uD83D\uDCCD Too far from airdrop",{description:"Distance: ".concat(s.distance,"m ⢠Required: ").concat(s.required,"m"),duration:5e3,action:{label:"Try Again",onClick:()=>Q(e)}}):"You have already claimed this airdrop"===s.error?u.oR.success("â
Already claimed!",{description:"You have already claimed this airdrop",duration:3e3}):"This airdrop requires a password to claim"===s.error||(null==(i=s.error)?void 0:i.includes("Incorrect password"))?($(s.error),L(!1)):s.lockout||(null==(a=s.error)?void 0:a.includes("Too many failed attempts"))?(u.oR.error("\uD83D\uDD12 Too many attempts",{description:"Please wait 5 minutes before trying again",duration:8e3}),$(s.error),L(!1)):u.oR.error("â Claim failed",{description:s.error,duration:5e3,action:{label:"Try Again",onClick:()=>Q(e)}})}}catch(e){console.error("Error claiming airdrop:",e),L(!1),u.oR.error("â Claim error",{description:"Network error. Please check your connection and try again.",duration:5e3,action:{label:"Try Again",onClick:()=>Q()}})}},K=a&&(0,R.gd)(a.lat,a.lng,r.latitude,r.longitude)<=r.radius;a&&(0,R.gd)(a.lat,a.lng,r.latitude,r.longitude);let X=s&&k.some(e=>e.airdrop_id===r.id),ee=new c.Icon({iconUrl:s&&X?"/icons/airdrop-claimed.svg":"/icons/airdrop-unclaimed.svg",iconSize:[40,45],iconAnchor:[20,22.5],popupAnchor:[0,-22.5]});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.p,{position:[r.latitude,r.longitude],icon:ee,children:(0,n.jsx)(h.z,{minWidth:288,maxWidth:288,autoPan:!0,keepInView:!0,autoPanPadding:[20,20],children:(0,n.jsxs)("div",{className:"p-2 w-72",children:[(0,n.jsxs)("div",{className:"mb-3",children:[r.creator&&(0,n.jsxs)("div",{className:"text-xs text-gray-500 mb-3 flex items-center gap-1",children:[(0,n.jsx)("span",{children:"by"}),(0,n.jsx)(F.Y,{user:r.creator,compactBadge:!0})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h3",{className:"font-semibold text-lg leading-tight",children:r.title}),r.requires_password&&!X&&(0,n.jsx)(p.A,{className:"h-4 w-4 text-gray-600",title:"Password required"})]})]}),(0,n.jsx)("p",{className:"text-sm text-gray-600 mb-2 max-h-[100px] overflow-y-auto pr-2",children:r.description||"No description provided."}),X&&(0,n.jsx)("div",{className:"flex flex-col items-center mb-4",children:(0,n.jsx)("div",{className:"w-32 h-24 relative mb-2",children:(0,n.jsx)(C.default,{src:"/illustrations/gift-box.svg",alt:"Airdrop claimed",fill:!0,className:"object-contain"})})}),X&&(0,n.jsx)("div",{className:"space-y-2 mb-3",children:(0,n.jsx)(z,{text:(()=>{var e;if(!s||!X)return null;let t=k.find(e=>e.airdrop_id===r.id);return(null==t||null==(e=t.airdrop)?void 0:e.reward_content)||r.reward_preview})()||"Reward"})}),!X&&K&&r.claim_hint&&(0,n.jsx)("div",{className:"mb-3",children:(0,n.jsxs)("div",{className:"bg-blue-50 border border-blue-100 rounded-lg p-3",children:[(0,n.jsxs)("div",{className:"flex items-center text-sm",children:[(0,n.jsx)(x.A,{className:"h-4 w-4 mr-2 text-blue-600"}),(0,n.jsx)("div",{className:"flex-1",children:(0,n.jsx)("span",{className:"italic text-blue-800",children:r.claim_hint})})]}),r.requires_password&&s&&(0,n.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,n.jsx)(f.p,{type:"text",placeholder:"Enter Password",value:H,onChange:e=>{U(e.target.value.toUpperCase()),$("")},className:"bg-white uppercase ".concat(Z?"border-red-500":"")}),Z&&(0,n.jsx)("p",{className:"text-xs text-red-500",children:Z})]})]})}),"ACTIVE"===r.status&&!X&&(0,n.jsxs)(n.Fragment,{children:[!K&&(0,n.jsx)("div",{className:"flex flex-col items-center mb-4",children:(0,n.jsx)("div",{className:"w-32 h-20 relative",children:(0,n.jsx)(C.default,{src:"/illustrations/navigation.svg",alt:"Navigate to airdrop",fill:!0,className:"object-contain"})})}),(0,n.jsx)(g.$,{onClick:()=>
1{if(s){if(r.requires_password&&!H.trim())return void $("Password is required to claim this airdrop");Q(H||void 0)}else o(r),d(!0)},disabled:!K||_,className:"w-full min-h-[52px] py-3",variant:K?"default":"outline",children:_?(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),"Processing..."]}):K?s?"Claim Airdrop":"Login to Claim":"Get within ".concat(r.radius,"m to unlock")})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,n.jsxs)(g.$,{variant:"ghost",size:"sm",className:"flex items-center space-x-1 p-0",children:[(0,n.jsx)(y.A,{className:"h-4 w-4 text-sm text-gray-600"}),(0,n.jsx)("span",{className:"text-sm text-gray-600",children:(null==(t=r._count)?void 0:t.claims)||0})]}),(0,n.jsx)(g.$,{variant:"ghost",size:"sm",asChild:!0,className:"flex items-center space-x-1 p-0",children:(0,n.jsxs)(N(),{href:"/airdrops/".concat(r.id),children:[(0,n.jsx)(v.A,{className:"h-4 w-4 text-sm text-gray-600"}),(0,n.jsx)("span",{className:"text-sm text-gray-600",children:V})]})}),(0,n.jsx)(g.$,{variant:"ghost",size:"sm",onClick:()=>{let e="\uD83C\uDF81 Just scored an Airdrop nearby. Get yours now â ".concat(window.location.origin),t=window.location.origin;navigator.share?navigator.share({title:"Airdrop Found!",text:e,url:t}).catch(()=>{J(e)}):J(e)},className:"p-0",children:(0,n.jsx)(w.A,{className:"h-4 w-4 text-sm text-gray-600"})})]}),s&&(0,n.jsxs)(A.rI,{children:[(0,n.jsx)(A.ty,{asChild:!0,children:(0,n.jsx)(g.$,{variant:"ghost",size:"sm",className:"p-0 text-gray-600 hover:text-gray-800",children:(0,n.jsx)(j.A,{className:"h-4 w-4"})})}),(0,n.jsx)(A.SQ,{align:"end",children:(0,n.jsxs)(A._2,{onClick:()=>Y(!0),children:[(0,n.jsx)(b.A,{className:"h-4 w-4 mr-2"}),"Report"]})})]})]})]})})}),!X&&"ACTIVE"===r.status&&(0,n.jsx)(S,{center:[r.latitude,r.longitude],radius:r.radius,color:"#FE405C",isActive:!0}),r.max_claims&&null!==r.claimsRemaining&&void 0!==r.claimsRemaining&&r.claimsRemaining>0&&(0,n.jsx)(I,{position:[r.latitude,r.longitude],remaining:r.claimsRemaining,claimed:X}),r.expires_at&&B&&(0,n.jsx)(T,{position:[r.latitude,r.longitude],countdown:B,claimed:X}),(0,n.jsx)(M.Z,{open:G,onOpenChange:Y,reportType:"AIRDROP",reportedItemId:r.id})]})}function P(e){let{position:t,count:r,airdrops:a}=e,[o,s]=(0,i.useState)(!1),{mapZoom:d,userClaims:u,isAuthenticated:h}=(0,m.C)();(0,i.useEffect)(()=>{d>=18?s(!0):s(!1)},[d]);let g=h&&a.every(e=>u.some(t=>t.airdrop_id===e.id));if(o){let e=Math.min(8*r,80);return(0,n.jsx)(n.Fragment,{children:a.map((r,i)=>{let o=i/a.length*2*Math.PI,s=e*Math.cos(o)/111e3,l=e*Math.sin(o)/(111e3*Math.cos(t[0]*Math.PI/180));return(0,n.jsx)(O,{airdrop:{...r,latitude:t[0]+s,longitude:t[1]+l}},r.id)})})}return(0,n.jsx)(l.p,{position:t,icon:(e=>{let t="small",r={small:{width:40,height:40,fontSize:"12px"},medium:{width:50,height:50,fontSize:"14px"},large:{width:60,height:60,fontSize:"16px"}}[t=e<10?"small":e<100?"medium":"large"];return new c.DivIcon({html:'\n <div class="flex items-center justify-center text-xs font-semibold text-white cursor-pointer transition-all duration-200 ease-in-out rounded-full border-[3px] border-white shadow-md" style="\n width: '.concat(r.width,"px;\n height: ").concat(r.height,"px;\n background: linear-gradient(135deg, ").concat(g?"#2EBD8D":"#FE405C"," 0%, ").concat(g?"#27A366":"#d63447"," 100%);\n box-shadow: 0 2px 8px ").concat(g?"rgba(46, 189, 141, 0.3)":"rgba(254, 64, 92, 0.3)",';\n ">\n ').concat(e,"\n </div>\n "),className:"custom-cluster-icon",iconSize:[r.width,r.height],iconAnchor:[r.width/2,r.height/2]})})(r),eventHandlers:{click:()=>{s(!o)}}})}function D(e){let{airdrops:t}=e,{mapZoom:r}=(0,m.C)(),a=(0,i.useMemo)(()=>(function(e,t){if(t>=18)return e;let r=[],n=new Set,i=Math.max(.001,.01/Math.pow(2,t-10));return e.forEach(t=>{if(n.has(t.id))return;let a=e.filter(e=>!n.has(e.id)&&e.id!==t.id&&Math.sqrt(Math.pow(t.latitude-e.latitude,2)+Math.pow(t.longitude-e.longitude,2))<i);if(a.length>0){let e=[t,...a],i=e.reduce((e,t)=>
1e+t.latitude,0)/e.length,o=e.reduce((e,t)=>e+t.longitude,0)/e.length;r.push({position:[i,o],count:e.length,airdrops:e}),e.forEach(e=>n.add(e.id))}else r.push(t),n.add(t.id)}),r})(t,r||13),[t,r]);return(0,n.jsx)(n.Fragment,{children:a.map((e,t)=>"position"in e?(0,n.jsx)(P,{position:e.position,count:e.count,airdrops:e.airdrops},"cluster-".concat(t)):(0,n.jsx)(O,{airdrop:e},e.id))})}var _=r(21873);function L(){let{userLocation:e}=(0,m.C)(),t=(0,a.ko)();return e?(0,n.jsx)("div",{className:"absolute bottom-4 right-4 z-[1000]",children:(0,n.jsx)(g.$,{onClick:()=>{e&&t.setView(new c.LatLng(e.lat,e.lng),15,{animate:!0,duration:.5})},size:"sm",className:"bg-white hover:bg-gray-50 text-gray-700 shadow-lg border border-gray-200 h-10 w-10 p-0",variant:"outline",children:(0,n.jsx)(_.A,{className:"h-4 w-4"})})}):null}var B=r(58088),q=r(66945),V=r(59750);let W=new c.Icon({iconUrl:q.A.src,iconRetinaUrl:B.A.src,shadowUrl:V.A.src,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]});function H(){let e=(0,a.ko)(),{airdrops:t,userLocation:r}=(0,m.C)();return(0,i.useEffect)(()=>{if(e&&e.getPane&&t.length>0&&!r){let r=setTimeout(()=>{if(!m.C.getState().userLocation&&e.getPane){let r=new c.LatLngBounds([]);t.forEach(e=>{r.extend([e.latitude,e.longitude])}),r.isValid()&&(console.log("\uD83D\uDCCD No user location detected, fitting map to airdrops..."),e.fitBounds(r,{padding:[50,50]}))}},6e3);return()=>clearTimeout(r)}},[e,t,r]),null}function U(){let e=(0,a.ko)(),{userLocation:t,setUserLocation:r}=(0,m.C)(),[n,o]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let t,i=null,a=()=>{console.log("\uD83C\uDF0D Setting global view...");let t={lat:20,lng:0};r(t),n||(e.setView(new c.LatLng(t.lat,t.lng),2),o(!0))},s=setTimeout(()=>{if(console.log("\uD83C\uDF0D Starting location detection..."),!navigator.geolocation){console.log("â Geolocation not supported, using default location..."),u.oR.error("Location not supported on this device"),a();return}n||(t=u.oR.loading("Requesting location permission...",{description:"Please allow location access to see airdrops near you",duration:15e3})),i=navigator.geolocation.watchPosition(i=>{let a={lat:i.coords.latitude,lng:i.coords.longitude},s=m.C.getState().userLocation;(!s||Math.abs(s.lat-a.lat)>1e-5||Math.abs(s.lng-a.lng)>1e-5||!n)&&(n||(console.log("â
Initial user location received:",a),t&&u.oR.dismiss(t),u.oR.success("Location found!",{duration:2e3}),e.setView(new c.LatLng(a.lat,a.lng),15),o(!0)),r(a))},e=>{console.error("â Geolocation error:",e),n||(t&&u.oR.dismiss(t),u.oR.error("Location access denied",{description:"Enable location to find airdrops near you. Using default map view.",duration:5e3,action:{label:"Try Again",onClick:()=>window.location.reload()}}),a())},{enableHighAccuracy:!0,timeout:1e4,maximumAge:5e3})},1e3);return()=>{clearTimeout(s),t&&u.oR.dismiss(t),null!==i&&(console.log("\uD83D\uDED1 Cleaning up location watcher..."),navigator.geolocation.clearWatch(i))}},[e,r,n]),null}function Z(){let e=(0,a.ko)(),{setMapZoom:t}=(0,m.C)();return(0,i.useEffect)(()=>{if(!e||!e.getPane)return;let r=()=>{t(e.getZoom())};return r(),e.on("zoomend",r),()=>{e.off("zoomend",r)}},[e,t]),null}function $(){let{userLocation:e,airdrops:t}=(0,m.C)(),r=e?[e.lat,e.lng]:[20,0];return(0,n.jsx)("div",{className:"h-full w-full relative",children:(0,n.jsxs)(o.W,{center:r,zoom:e?13:2,className:"h-full w-full",zoomControl:!1,children:[(0,n.jsx)(s.e,{attribution:'\xa9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors \xa9 <a href="https://carto.com/attributions">CARTO</a>',url:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",subdomains:"abcd",maxZoom:20}),(0,n.jsx)(U,{}),(0,n.jsx)(H,{}),(0,n.jsx)(Z,{}),e&&(0,n.jsx)(l.p,{position:[e.lat,e.lng],icon:new c.Icon({iconUrl:"data:image/svg+xml;base64,"+btoa('\n <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <circle cx="10" cy="10" r="8" fill="#3B82F6" stroke="#FFFFFF" stroke-width="2"/>\n <circle cx="10" cy="10" r="3" fill="#FFFFFF"/>\n </svg>\n '),iconSize:[20,20],iconAnchor:[10,10]}),zIndexOffset:1e3}),(0,n.jsx)(D,{airdrops:t}),(0,n.jsx)(L,{})]})})}c.Icon.Default=W},89743:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(95155),i=r(12115),a=r(51834),o=r(3998),s=r(31120),l=r(76444),c=r(18720);function d(e){let{open:t,onOpenChange:r,reportType:d,reportedItemId:m,onSuccess:u}=e,[h,g]=(0,i.useState)(""),[f,p]=(0,i.useState)(!1),x=async()=>
1{if(h.trim().length<10)return void c.oR.error("Reason too short",{description:"Please provide at least 10 characters"});p(!0);try{let e=await fetch("/api/reports",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reportType:d,reportedItemId:m,reason:h.trim()})}),t=await e.json();e.ok?(c.oR.success("Report submitted",{description:"Thank you for helping keep our community safe"}),g(""),r(!1),null==u||u()):c.oR.error("Failed to submit report",{description:t.error||"Please try again"})}catch(e){c.oR.error("Network error",{description:"Please check your connection and try again"})}finally{p(!1)}};return(0,n.jsx)(a.lG,{open:t,onOpenChange:r,children:(0,n.jsxs)(a.Cf,{className:"sm:max-w-[425px]",children:[(0,n.jsx)(a.c7,{children:(0,n.jsxs)(a.L3,{children:["Report ","AIRDROP"===d?"Airdrop":"Comment"]})}),(0,n.jsx)("div",{className:"space-y-4 py-4",children:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)(l.J,{htmlFor:"reason",children:["Reason for reporting ",(0,n.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,n.jsx)(s.T,{id:"reason",placeholder:"AIRDROP"===d?"Be specific about the issue on this Airdrop":"Be specific about the issue on this Comment",value:h,onChange:e=>g(e.target.value),className:"min-h-[120px] resize-none",maxLength:500}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:[h.length,"/500 characters (minimum 10)"]})]})}),(0,n.jsxs)(a.Es,{children:[(0,n.jsx)(o.$,{variant:"outline",onClick:()=>r(!1),disabled:f,children:"Cancel"}),(0,n.jsx)(o.$,{onClick:x,disabled:f||h.trim().length<10,children:f?"Submitting...":"Submit Report"})]})]})})}}}]);
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.