1"use strict";(self.webpackChunkbubble_ads=self.webpackChunkbubble_ads||[]).push([[4921],{34921:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var l=a(9950),o=a(72772),n=a(80849),s=a(45530),r=a(44414);const i=5;function c(e){let{currentUser:t,onLogin:a,showNotification:c}=e;const d=(0,n.Zp)(),[p,u]=(0,l.useState)(!1),[h,f]=(0,l.useState)(""),[m,g]=(0,l.useState)("male"),[y,b]=(0,l.useState)(!1),[v,j]=(0,l.useState)(null),[x,w]=(0,l.useState)(!1),[k,N]=(0,l.useState)(!1),[T,P]=(0,l.useState)(i),[S,A]=(0,l.useState)([]),[C,F]=(0,l.useState)(!1),[L,D]=(0,l.useState)(null),[E,B]=(0,l.useState)(null),Y=S.length,H=(0,l.useCallback)((async()=>{if(null!==t&&void 0!==t&&t.token)try{const e=await fetch("".concat(s.H$,"/pfp-generator/status"),{headers:{Authorization:"Bearer ".concat(t.token)}}),a=await e.json().catch((()=>({})));e.ok&&(b(!1!==a.canGenerate),j(a.nextAvailableAt||null),w(!!a.cooldownActive),N(!!a.storageFull),"number"===typeof a.slotsLimit&&P(a.slotsLimit))}catch(e){}}),[null===t||void 0===t?void 0:t.token]),z=(0,l.useCallback)((async()=>{if(null!==t&&void 0!==t&&t.token){F(!0);try{const e=await fetch("".concat(s.H$,"/pfp-generator/list"),{headers:{Authorization:"Bearer ".concat(t.token)}}),a=await e.json().catch((()=>({})));e.ok&&Array.isArray(a.items)&&(A(a.items),"number"===typeof a.slotsLimit&&P(a.slotsLimit))}catch(e){}finally{F(!1)}}else A([])}),[null===t||void 0===t?void 0:t.token]);(0,l.useEffect)((()=>{H(),z()}),[H,z]);const G=(0,l.useMemo)((()=>v?new Date(v).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"}):null),[v]),q=p||!(null!==t&&void 0!==t&&t.token)||!y;let $="";return null!==t&&void 0!==t&&t.token&&(k&&x?$="Your collection is full (".concat(T,"/").concat(T,") and your weekly cooldown ends ").concat(G||"soon",". Delete one and wait until then."):k?$="Your collection is full (".concat(T,"/").concat(T,"). Delete one of your saved PFPs below to generate a new one."):x&&G&&($="Next generation available after ".concat(G,"."))),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.m,{children:[(0,r.jsx)("title",{children:"The Bored Turtles Yacht Club | PFP Generator | Aquads"}),(0,r.jsx)("meta",{name:"description",content:"Mint your weekly profile picture from The Bored Turtles Yacht Club \u2014 the official Aquads turtle mascot collection."})]}),(0,r.jsxs)("div",{className:"pfp-page",children:[(0,r.jsxs)("header",{className:"pfp-header",children:[(0,r.jsx)("div",{className:"pfp-header-left",children:(0,r.jsx)("img",{src:"/alogo.png",alt:"Aquads",className:"pfp-logo",onClick:()=>d("/home"),onKeyDown:e=>"Enter"===e.key&&d("/home"),role:"button",tabIndex:0,title:"Back to Home"})}),(0,r.jsx)("div",{className:"pfp-header-center",children:(0,r.jsxs)("div",{className:"pfp-title-wrap",children:[(0,r.jsx)("span",{className:"pfp-title-emoji","aria-hidden":!0,children:"\ud83d\udc22"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"pfp-title-heading",children:"The Bored Turtles Yacht Club"}),(0,r.jsx)("p",{className:"pfp-title-tagline",children:"Aquads PFP Generator \u2022 Brand mascot collection"})]})]})}),(0,r.jsx)("div",{className:"pfp-header-right",children:(0,r.jsx)("button",{type:"button",className:"pfp-back-btn",onClick:()=>d("/home"),children:"\u2190 Home"})})]}),(0,r.jsx)("main",{className:"pfp-main",children:(0,r.jsxs)("div",{className:"pfp-card",children:[(0,r.jsxs)("p",{className:"pfp-card-lead",children:["Welcome to ",(0,r.jsx)("strong",{children:"The Bored Turtles Yacht Club"})," \u2014 Aquads' official turtle mascot collection. Signed-in users get one free mint per rolling 7 days. Your last"," ",T," turtles are saved here so you can re-download them anytime."]}),(null===t||void 0===t?void 0:t.token)&&(0,r.jsxs)("div",{className:"pfp-slots-indicator",children:[(0,r.jsx)("span",{className:"pfp-slots-label",children:"Storage"}),(0,r.jsxs)("span",{className:"pfp-slots-count ".concat(k?"pfp-slots-count--full":""),children:[Y," / ",T]}),(0,r.jsx)("div",{className:"pfp-slots-bar",children:(0,r.jsx)("div",{className:"pfp-slots-bar-fill ".concat(k?"pfp-slots-bar-fill--full":""),style:{width:"".concat(Math.min(100,Y/T*100),"%")}})})]}),!(null!==t&&void 0!==t&&t.token)&&(0,r.jsxs)("p",{style:{color:"#fbbf24",fontSize:14,marginTop:12},children:["Log in to generate your PFP.",(0,r.jsx)("button",{type:"button",onClick:()=>null===a||void 0===a?void 0:a(),style:{marginLeft:8,background:"transparent",border:"none",color:"#a78bfa",textDecoration:"underline",cursor:"pointer",fontWeight:600},children:"Log in"})]}),$&&(0,r.jsx)("p",{className:"pfp-blocked-reason",children:$}),(0,r.jsxs)("select",{value:m,onChange:e=>g(e.target.value),disabled:q,style:{width:"100%",padding:10,marginTop:10,borderRadius:10,background:"#111",color:"#fff",border:"1px solid #7c3aed"},children:[(0,r.jsx)("option",{value:"male",children:"Male Turtle"}),(0,r.jsx)("option",{value:"female",children:"Female Turtle"})]}),(0,r.jsx)("button",{type:"button",onClick:async()=>
1{if(null!==t&&void 0!==t&&t.token){u(!0),f("");try{const e=await fetch("".concat(s.H$,"/pfp-generator/generate"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t.token)},body:JSON.stringify({gender:m})}),a=await e.json().catch((()=>({})));if(403===e.status&&"STORAGE_FULL"===a.code)throw N(!0),"number"===typeof a.slotsLimit&&P(a.slotsLimit),new Error(a.error||"Your collection is full. Delete one to make room.");if(429===e.status)throw b(!1),w(!0),j(a.nextAvailableAt||null),new Error(a.error||"Weekly limit reached");if(!e.ok)throw new Error(a.error||"Generation failed");if(!a.id)throw new Error("Invalid response from server");B(a.id),await Promise.all([H(),z()]),null===c||void 0===c||c('PFP generated and saved to your collection. Tap "Download" on any tile to save it.',"success")}catch(e){const t=e.message||"Error generating image";f(t),null===c||void 0===c||c(t,"error")}finally{u(!1)}}else null===a||void 0===a||a()},disabled:q,style:{width:"100%",padding:14,marginTop:10,borderRadius:12,border:"none",fontWeight:"bold",cursor:q?"not-allowed":"pointer",opacity:q?.6:1,background:"linear-gradient(90deg,#facc15,#7c3aed)",color:"#000"},children:p?"Generating...":"Generate PFP"}),h&&(0,r.jsx)("div",{style:{color:"#f87171",marginTop:10,fontSize:14},children:h}),(null===t||void 0===t?void 0:t.token)&&(0,r.jsxs)("div",{className:"pfp-gallery-section",children:[(0,r.jsxs)("div",{className:"pfp-gallery-heading",children:[(0,r.jsx)("h3",{className:"pfp-gallery-title",children:"Your Bored Turtles Yacht Club"}),S.length>0&&(0,r.jsx)("span",{className:"pfp-gallery-hint",children:"Tap Download to save \xb7 Tap Delete to free a slot"})]}),C&&0===S.length?(0,r.jsx)("p",{className:"pfp-gallery-empty",children:"Loading your collection..."}):0===S.length?(0,r.jsx)("p",{className:"pfp-gallery-empty",children:"No turtles in your club yet. Mint one above and it will appear here."}):(0,r.jsx)("div",{className:"pfp-gallery-grid",children:S.map((e=>{const a="".concat(s.H$,"/pfp-generator/image/").concat(e.id),l="".concat(s.H$,"/pfp-generator/download/").concat(e.id),o=e.id===E,n=L===e.id;return(0,r.jsxs)("div",{className:"pfp-gallery-item ".concat(o?"pfp-gallery-item--latest":""),children:[o&&(0,r.jsx)("span",{className:"pfp-gallery-badge",children:"New"}),(0,r.jsx)("div",{className:"pfp-gallery-image-wrap",children:(0,r.jsx)("img",{src:a,alt:"Aquads PFP ".concat(e.id),className:"pfp-gallery-image",loading:"lazy"})}),e.traits&&(0,r.jsxs)("div",{className:"pfp-gallery-traits",children:[(0,r.jsx)("span",{children:e.traits.gender||"turtle"}),e.traits.coloredTrait&&(0,r.jsxs)("span",{children:[" \xb7 color: ",e.traits.coloredTrait]}),e.traits.grills&&(0,r.jsxs)("span",{children:[" \xb7 ",e.traits.grills]})]}),(0,r.jsxs)("div",{className:"pfp-gallery-actions",children:[(0,r.jsx)("a",{href:l,download:!0,className:"pfp-gallery-btn pfp-gallery-btn--download",children:"Download"}),(0,r.jsx)("button",{type:"button",onClick:()=>(async e=>{if(null===t||void 0===t||!t.token||null===e||void 0===e||!e.id)return;if(window.confirm("Delete this PFP from your collection? This frees up a slot but the image cannot be recovered.")){D(e.id);try{const a=await fetch("".concat(s.H$,"/pfp-generator/pfp/").concat(e.id),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t.token)}}),l=await a.json().catch((()=>({})));if(!a.ok)throw new Error(l.error||"Failed to delete");E===e.id&&B(null),A((t=>t.filter((t=>t.id!==e.id)))),await Promise.all([H(),z()]),null===c||void 0===c||c("PFP deleted. Slot freed up.","success")}catch(a){null===c||void 0===c||c(a.message||"Failed to delete PFP","error")}finally{D(null)}}})(e),disabled:n,className:"pfp-gallery-btn pfp-gallery-btn--delete",children:n?"Deleting...":"Delete"})]})]},e.id)}))})]})]})})]})]})}}}]);
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.