1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,27579,42590,55196,e=>{"use strict";var t=e.i(35020);e.s(["signInAnonymously",()=>t.ac],27579);var a=e.i(99917);e.s(["collection",()=>a.aL],42590),e.i(36180);var r=e.i(63802),n=e.i(32);async function s(e){try{let t=(0,a.v)(n.db,"memes",e);await (0,r.setDoc)(t,{downloadCount:(0,a.aW)(1)},{merge:!0})}catch(e){console.error("Error incrementing download count:",e)}}e.s(["incrementDownloadCount",0,s],55196)},22016,(e,t,a)=>{"use strict";e.i(47167),Object.defineProperty(a,"__esModule",{value:!0});var r={default:function(){return x},useLinkStatus:function(){return j}};for(var n in r)Object.defineProperty(a,n,{enumerable:!0,get:r[n]});let s=e.r(90809),l=e.r(43476),i=s._(e.r(71645)),o=e.r(95057),c=e.r(8372),d=e.r(18581),u=e.r(18967),m=e.r(5550),h=e.r(88540),f=e.r(91949),p=e.r(73668),b=e.r(9396);function x(t){var a;let r,n,s,[x,j]=(0,i.useOptimistic)(f.IDLE_LINK_STATUS),y=(0,i.useRef)(null),{href:v,as:N,children:w,prefetch:k=null,passHref:S,replace:E,shallow:C,scroll:P,onClick:M,onMouseEnter:T,onTouchStart:A,legacyBehavior:_=!1,onNavigate:R,transitionTypes:O,ref:U,unstable_dynamicOnHover:L,...I}=t;r=w,_&&("string"==typeof r||"number"==typeof r)&&(r=(0,l.jsx)("a",{children:r}));let $=i.default.useContext(c.AppRouterContext),F=!1!==k,D=!1===k?"none":!0===k?"full":"auto",B="none"!==D?"auto"===D?b.FetchStrategy.PPR:b.FetchStrategy.Full:b.FetchStrategy.PPR,H="string"==typeof(a=N||v)?a:(0,o.formatUrl)(a);if(_){if(r?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});n=i.default.Children.only(r)}let W=_?n&&"object"==typeof n&&n.ref:U,K,z=i.default.useCallback(e=>(null!==$&&(y.current=(0,f.mountLinkInstance)(e,H,$,B,F,j,K)),()=>{y.current&&((0,f.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,f.unmountPrefetchableInstance)(e)}),[F,H,$,B,j,K]),Y={ref:(0,d.useMergedRef)(z,W),onClick(t){_||"function"!=typeof M||M(t),_&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(t),!$||t.defaultPrevented||function(t,a,r,n,s,l,o,c="none"){if("u">typeof window){let d,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(a)){n&&(t.preventDefault(),location.replace(a));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:m}=e.r(99781);i.default.startTransition(()=>{m(a,n?"replace":"push",!1===s?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,r.current,o,c)})}}(t,H,y,E,P,R,O,D)},onMouseEnter(e){_||"function"!=typeof T||T(e),_&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),$&&F&&(0,f.onNavigationIntent)(e.currentTarget,!0===L)},onTouchStart:function(e){_||"function"!=typeof A||A(e),_&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),$&&F&&(0,f.onNavigationIntent)(e.currentTarget,!0===L)}};return(0,u.isAbsoluteUrl)(H)?Y.href=H:_&&!S&&("a"!==n.type||"href"in n.props)||(Y.href=(0,m.addBasePath)(H)),s=_?i.default.cloneElement(n,Y):(0,l.jsx)("a",{...I,...Y,children:r}),(0,l.jsx)(g.Provider,{value:x,children:s})}let g=(0,i.createContext)(f.IDLE_LINK_STATUS),j=()=>(0,i.useContext)(g);("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},18581,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"useMergedRef",{enumerable:!0,get:function(){return n}});let r=e.r(71645);function n(e,t){let a=(0,r.useRef)(null),n=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=a.current;e&&(a.current=null,e());let t=n.current;t&&(n.current=null,t())}
1else e&&(a.current=s(e,r)),t&&(n.current=s(t,r))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let a=e(t);return"function"==typeof a?a:()=>e(null)}}("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},18967,(e,t,a)=>{"use strict";e.i(47167),Object.defineProperty(a,"__esModule",{value:!0});var r={DecodeError:function(){return x},MiddlewareNotFoundError:function(){return v},MissingStaticPage:function(){return y},NormalizeError:function(){return g},PageNotFoundError:function(){return j},SP:function(){return p},ST:function(){return b},WEB_VITALS:function(){return s},execOnce:function(){return l},getDisplayName:function(){return u},getLocationOrigin:function(){return c},getURL:function(){return d},isAbsoluteUrl:function(){return o},isResSent:function(){return m},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return N}};for(var n in r)Object.defineProperty(a,n,{enumerable:!0,get:r[n]});let s=["CLS","FCP","FID","INP","LCP","TTFB"];function l(e){let t,a=!1;return(...r)=>(a||(a=!0,t=e(...r)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,o=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&i.test(e)};function c(){let{protocol:e,hostname:t,port:a}=window.location;return`${e}//${t}${a?":"+a:""}`}function d(){let{href:e}=window.location,t=c();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function m(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function f(e,t){let a=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(a&&m(a))return r;if(!r)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return r}let p="u">typeof performance,b=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class x extends Error{}class g extends Error{}class j extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class y extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class v extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function N(e){return JSON.stringify({message:e.message,stack:e.stack})}},73668,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"isLocalURL",{enumerable:!0,get:function(){return s}});let r=e.r(18967),n=e.r(52817);function s(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),a=new URL(e,t);return a.origin===t&&(0,n.hasBasePath)(a.pathname)}catch(e){return!1}}},98183,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r={assign:function(){return o},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return i}};for(var n in r)Object.defineProperty(a,n,{enumerable:!0,get:r[n]});function s(e){let t={};for(let[a,r]of e.entries()){let e=t[a];void 0===e?t[a]=r:Array.isArray(e)?e.push(r):t[a]=[e,r]}return t}function l(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;for(let[a,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(a,l(e));else t.set(a,l(r));return t}function o(e,...t){for(let a of t){for(let t of a.keys())e.delete(t);for(let[t,r]of a.entries())e.append(t,r)}return e}},95057,(e,t,a)=>{"use strict";e.i(47167),Object.defineProperty(a,"__esModule",{value:!0});var r={formatUrl:function(){return i},formatWithValidation:function(){return c},urlObjectKeys:function(){return o}};for(var n in r)Object.defineProperty(a,n,{enumerable:!0,get:r[n]});let s=e.r(90809)._(e.r(98183)),l=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:a}=e,r=e.protocol||"",n=e.pathname||"",i=e.hash||"",o=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:a&&(c=t+(~a.indexOf(":")?`[${a}]`:a),e.port&&(c+=":"+e.port)),o&&"object"==typeof o&&(o=String(s.urlQueryToSearchParams(o)));let d=e.search||o&&`?${o}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||l.test(r))&&!1!==c?(c="//"+(c||""),n&&"/"!==n[0]&&(n="/"+n)):c||(c=""),i&&"#"!==i[0]&&(i="#"+i),d&&"?"!==d[0]&&(d="?"+d),n=n.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${r}${c}${n}${d}${i}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return i(e)}},74647,e=>{"use strict";var t=e.i(43476),a=e.i(22016),r=e.i(70345),n=e.i(71645);e.i(36180);var s=e.i(63802),l=e.i(42590),i=e.i(99917),i=i,o=e.i(32);let c="mr_humble_feedback_submitted",d=["New meme templates","Something else"];function u({onFeedbackSubmitted:e}
1){let[a,r]=(0,n.useState)(!1),[d,m]=(0,n.useState)(""),[h,f]=(0,n.useState)(""),[p,b]=(0,n.useState)("idle"),[x,g]=(0,n.useState)("");async function j(t){if(t.preventDefault(),d&&"submitting"!==p){if("Something else"===d&&!h.trim())return void g("Please tell us what else you want to see.");b("submitting"),g("");try{await (0,s.addDoc)((0,l.collection)(o.db,"feedback"),{selected_option:d,custom_text:"Something else"===d?h.trim().slice(0,200):"",created_at:(0,i.b0)(),updated_at:(0,i.b0)()}),b("success"),localStorage.setItem(c,"true"),window.dispatchEvent(new Event("feedback-submitted")),e&&e(),setTimeout(()=>{r(!1)},5e3)}catch(e){console.error("Feedback submission error:",e),b("error"),g("Failed to send feedback. Please try again.")}}}return((0,n.useEffect)(()=>{if(!localStorage.getItem(c)){let e=setTimeout(()=>{r(!0)},0);return()=>clearTimeout(e)}},[]),a)?(0,t.jsx)("aside",{className:"feedback-bar","aria-label":"Feature feedback bar",children:(0,t.jsx)("div",{className:"feedback-bar-inner",children:"success"===p?(0,t.jsxs)("div",{className:"feedback-success-msg",role:"status",children:[(0,t.jsx)("span",{className:"feedback-success-icon",children:"â"}),(0,t.jsx)("p",{className:"feedback-success-text",children:"Thanks for letting us know! We hear you."})]}):(0,t.jsxs)("form",{className:"feedback-form",onSubmit:j,children:[(0,t.jsxs)("div",{className:"feedback-title-group",children:[(0,t.jsx)("span",{className:"feedback-badge",children:"FEEDBACK"}),(0,t.jsx)("h2",{className:"feedback-title",children:"What do you wanna see next?"})]}),(0,t.jsxs)("div",{className:"feedback-options-row",role:"radiogroup","aria-label":"Feedback options",children:[(0,t.jsxs)("label",{className:`feedback-option-label ${"New meme templates"===d?"active":""}`,children:[(0,t.jsx)("input",{type:"radio",name:"feedback_choice",value:"New meme templates",checked:"New meme templates"===d,onChange:()=>{m("New meme templates"),g("")},disabled:"submitting"===p}),(0,t.jsx)("span",{className:"custom-radio"}),(0,t.jsx)("span",{className:"feedback-option-text",children:"New meme templates"})]}),(0,t.jsxs)("div",{className:`feedback-option-label something-else-wrap ${"Something else"===d?"active":""}`,children:[(0,t.jsxs)("label",{className:"something-else-radio-label",children:[(0,t.jsx)("input",{type:"radio",name:"feedback_choice",value:"Something else",checked:"Something else"===d,onChange:()=>{m("Something else"),g("")},disabled:"submitting"===p}),(0,t.jsx)("span",{className:"custom-radio"}),(0,t.jsx)("span",{className:"feedback-option-text",children:"Something else:"})]}),(0,t.jsx)("input",{type:"text",className:"feedback-text-input",placeholder:"Tell us what...",maxLength:200,value:h,onChange:e=>{f(e.target.value),"Something else"!==d&&m("Something else"),g("")},onFocus:()=>m("Something else"),disabled:"submitting"===p,"aria-label":"Free-form feedback text up to 200 characters"}),"Something else"===d&&(0,t.jsxs)("span",{className:"feedback-char-count",children:[h.length,"/200"]})]})]}),(0,t.jsxs)("div",{className:"feedback-actions",children:[x&&(0,t.jsx)("span",{className:"feedback-error-text",children:x}),(0,t.jsx)("button",{type:"submit",className:"feedback-send-btn",disabled:!d||"submitting"===p,children:"submitting"===p?"Sending...":"Send"})]})]})})}):null}function m({refreshTrigger:e}){let[a,r]=(0,n.useState)({total:0,counts:{"New meme templates":0,"Something else":0},percentages:{"New meme templates":0,"Something else":0}}),[i,c]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{let e=!1;async function t(){try{let t=await (0,s.getDocs)((0,l.collection)(o.db,"feedback")),a=0,n={"New meme templates":0,"Something else":0};t.forEach(e=>{let t=e.data().selected_option;void 0!==n[t]&&(n[t]+=1,a+=1)});let i={"New meme templates":a>0?Math.round(n["New meme templates"]/a*100):0,"Something else":a>0?Math.round(n["Something else"]/a*100):0};e||r({total:a,counts:n,percentages:i})}catch(e){console.error("Failed to load feedback stats:",e)}finally{e||c(!1)}}t();let a=()=>{t()};return window.addEventListener("feedback-submitted",a),()=>{e=!0,window.removeEventListener("feedback-submitted",a)}},[e]),(0,t.jsxs)("section",{className:"feedback-results-section","aria-labelledby":"feedback-results-title",children:[(0,t.jsxs)("div",{className:"panel-label",children:[(0,t.jsx)("span",{id:"feedback-results-title",children:"WHAT PEOPLE WANNA SEE NEXT"}),(0,t.jsx)("span",{className:"feedback-results-meta",children:1===a.total?"1 answer":`${a.total} answers`})]}),(0,t.jsxs)("div",{className:"feedback-results-content",children:[(0,t.jsx)("h3",{className:"feedback-results-heading",children:"Community wishlist"}),(0,t.jsx)("p",{className:"feedback-results-subheading",children:"Percentage of answers among the current options."}),(0,t.jsx)("div",{className:"feedback-results-grid",children:d.map(e=>{let r=a.percentages[e]||0,n=a.counts[e]||0;return(0,t.jsxs)("div",{className:"feedback-result-card",children:[(0,t.jsxs)("div",{className:"feedback-result-card-header",children:[(0,t.jsx)("span",{className:"feedback-result-option-name",children:e}),(0,t.jsxs)("span",{className:"feedback-result-percent",children:[r,"%"]})]}),(0,t.jsx)("div",{className:"feedback-result-bar-bg",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`${e} percentage`,children:(0,t.jsx)("div",{className:"feedback-result-bar-fill",style:{width:`${r}%`}})}),(0,t.jsxs)("div",{className:"feedback-result-count",children:[n," ",1===n?"vote":"votes"]})]},e)})})]})]})}var h=e.i(51468);e.s(["default",0,function(){return(0,t.jsxs)("main",{className:"meme-studio",children:[(0,t.jsxs)("header",{className:"meme-nav",children:[(0,t.jsxs)(a.default,{className:"brand",href:"/",children:[(0,t.jsx)("span",{className:"brand-mark",children:"mh"}),(0,t.jsx)("span",{children:"mr humble"})]}),(0,t.jsxs)("nav",{className:"meme-nav-links","aria-label":"Mr Humble destinations",children:[!1,!1,
1!1]})]}),(0,t.jsxs)("section",{className:"studio-heading",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"eyebrow",children:"MR HUMBLE MEME FACTORY"}),(0,t.jsxs)("h1",{children:["Make the point.",(0,t.jsx)("br",{}),"Then leave."]})]}),(0,t.jsxs)("p",{className:"studio-intro",children:["Mr Humble Meme Factory is a free browser-based meme generator. Pick a template, add text, and download a PNG without an account. ",(0,t.jsx)(a.default,{className:"legal-inline-link",href:"/faq",children:"Read the FAQ"})]})]}),(0,t.jsx)(h.default,{limitCount:100,showSeeAll:!0,seeAllHref:"/all",showFilters:!1}),(0,t.jsx)(r.default,{limitCount:10}),(0,t.jsx)(m,{}),(0,t.jsxs)("section",{className:"about-section","aria-labelledby":"about-heading",children:[(0,t.jsxs)("div",{className:"about-grid",children:[(0,t.jsxs)("div",{className:"about-card",children:[(0,t.jsx)("p",{className:"eyebrow",children:"WHO IS MR HUMBLE"}),(0,t.jsx)("h2",{id:"about-heading",children:"Meet the character."}),(0,t.jsx)("p",{className:"about-body",children:"Mr Humble is an internet persona built on one simple idea: say what you mean, then stop talking. No thread. No follow-up. No clarification. The image makes the point â and then it walks away. Thatâs the energy."}),(0,t.jsx)("p",{className:"about-body",children:"Born from social media comment sections where too many people explain themselves to death, Mr Humble exists as the antidote. Direct. Confident. A little chaotic."})]}),(0,t.jsxs)("div",{className:"about-card",children:[(0,t.jsx)("p",{className:"eyebrow",children:"THE MEME FACTORY"}),(0,t.jsx)("h2",{children:"What you can make."}),(0,t.jsx)("p",{className:"about-body",children:"The Mr Humble Meme Factory is a free browser-based meme generator. Pick a template, type your take, and download a ready-to-share image in seconds â no account needed."}),(0,t.jsx)("p",{className:"about-body",children:"Templates are hand-curated from Mr Humbleâs facial expression library: deadpan, skeptical, unbothered, and everything in between. Each one is designed to carry a strong point of view without adding a word."})]})]}),(0,t.jsxs)("div",{className:"about-legal",children:[(0,t.jsx)("a",{className:"about-legal-link",href:"/privacy",children:"Privacy Policy"}),(0,t.jsx)("span",{className:"about-legal-sep","aria-hidden":"true",children:"·"}),(0,t.jsx)("a",{className:"about-legal-link",href:"/terms",children:"Terms of Use"})]})]}),!1,(0,t.jsx)(u,{})]})}],74647)},70345,e=>{"use strict";var t=e.i(43476),a=e.i(22016),r=e.i(71645);e.i(51718);var n=e.i(27579);e.i(36180);var s=e.i(42590),l=e.i(63802),i=e.i(32),o=e.i(55196);e.s(["default",0,function({limitCount:e}){let[c,d]=(0,r.useState)([]),[u,m]=(0,r.useState)(!0),[h,f]=(0,r.useState)(null);function p(){f(null)}async function b(){if(!h)return;let e=new URL("/api/download",window.location.origin);e.searchParams.set("url",h.imageUrl),e.searchParams.set("filename",`mr-humble-featured-${h.id}.png`);let t=document.createElement("a");t.href=e,document.body.appendChild(t),t.click(),t.remove(),(0,o.incrementDownloadCount)(h.id)}if((0,r.useEffect)(()=>{let t=!1;return async function(){try{i.auth.currentUser||await (0,n.signInAnonymously)(i.auth);let a=(await (0,l.getDocs)((0,l.query)((0,s.collection)(i.db,"memes"),(0,l.where)("template","==",!1),(0,l.where)("status","==","approved")))).docs.sort((e,t)=>{let a=e.data().createdAt?.toMillis?.()||0;return(t.data().createdAt?.toMillis?.()||0)-a}),r=(e?a.slice(0,e):a).map(e=>{let t=e.data();return{id:e.id,caption:t.caption,imageUrl:t.downloadUrl,thumbnailUrl:t.thumbnailUrl||t.downloadUrl,tagPermission:!!t.tagPermission,socialHandle:t.socialHandle||null,socialPlatform:t.socialPlatform||null}});t||d(r)}catch(e){console.error("Featured memes error",e)}finally{t||m(!1)}}(),()=>{t=!0}},[e]),u){let a=e||8;return(0,t.jsxs)("section",{className:"featured-section","aria-labelledby":"featured-title",children:[(0,t.jsxs)("div",{className:"panel-label",children:[(0,t.jsx)("span",{className:"skeleton skeleton-text",style:{width:"160px"}}),(0,t.jsxs)("span",{className:"featured-section-meta",children:[e&&(0,t.jsx)("span",{className:"skeleton
1skeleton-text",style:{width:"50px"}}),(0,t.jsx)("span",{className:"skeleton skeleton-text",style:{width:"60px"}})]})]}),(0,t.jsx)("div",{className:"featured-grid",children:Array.from({length:a}).map((e,a)=>(0,t.jsxs)("div",{className:"skeleton-featured-meme",children:[(0,t.jsx)("div",{className:"skeleton skeleton-featured-img"}),(0,t.jsx)("div",{className:"skeleton skeleton-featured-caption"})]},a))})]})}return(0,t.jsxs)(t.Fragment,{children:[c.length>0&&(0,t.jsxs)("section",{className:"featured-section","aria-labelledby":"featured-title",children:[(0,t.jsxs)("div",{className:"panel-label",children:[(0,t.jsx)("span",{id:"featured-title",children:"FEATURED BY MR HUMBLE"}),(0,t.jsxs)("span",{className:"featured-section-meta",children:[e&&(0,t.jsx)(a.default,{className:"featured-view-all",href:"/featured",children:"View all"}),(0,t.jsx)("span",{children:e?`${c.length} newest`:`${c.length} selected`})]})]}),(0,t.jsx)("div",{className:"featured-grid",children:c.map(e=>(0,t.jsxs)("button",{className:"featured-meme",type:"button",onClick:()=>f(e),children:[(0,t.jsx)("img",{src:e.thumbnailUrl,alt:e.caption}),(0,t.jsx)("span",{title:e.caption,children:e.caption})]},e.id))})]}),h&&(0,t.jsx)("div",{className:"feature-modal-backdrop",role:"presentation",onClick:p,children:(0,t.jsxs)("section",{className:"featured-preview-modal",role:"dialog","aria-modal":"true","aria-labelledby":"featured-preview-title",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{className:"featured-preview-close",type:"button",onClick:p,"aria-label":"Close featured meme",children:"Ã"}),(0,t.jsx)("img",{src:h.imageUrl,alt:h.caption}),(0,t.jsx)("p",{id:"featured-preview-title",children:h.caption}),(0,t.jsx)("div",{className:"featured-meta-tag-info",children:h.tagPermission&&h.socialHandle?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"tag-label",children:"Tag:"})," ",(0,t.jsx)("span",{className:"tag-value",children:h.socialHandle})]}),h.socialPlatform&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"tag-label",children:"Platform:"})," ",(0,t.jsx)("span",{className:"tag-value",children:h.socialPlatform.charAt(0).toUpperCase()+h.socialPlatform.slice(1)})]})]}):(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"tag-label",children:"Tag:"})," ",(0,t.jsx)("span",{className:"tag-value",children:"No permission"})]})}),(0,t.jsx)("button",{className:"featured-download",type:"button",onClick:b,children:"Download meme"})]})})]})}])},51468,e=>{"use strict";var t=e.i(43476),a=e.i(71645);e.i(51718);var r=e.i(27579);e.i(36180);var n=e.i(42590),s=e.i(63802);e.i(61978);var l=e.i(52831),i=e.i(32),o=e.i(55196);function c(){return(0,t.jsxs)("section",{className:"factory-layout",children:[(0,t.jsxs)("div",{className:"preview-panel",children:[(0,t.jsxs)("div",{className:"panel-label",children:[(0,t.jsx)("span",{className:"skeleton skeleton-text",style:{width:"90px"}}),(0,t.jsx)("span",{className:"skeleton skeleton-text",style:{width:"50px"}})]}),(0,t.jsx)("div",{className:"canvas-wrap",children:(0,t.jsx)("div",{className:"skeleton skeleton-canvas"})}),(0,t.jsxs)("div",{className:"caption-field",children:[(0,t.jsx)("div",{className:"skeleton skeleton-text",style:{width:"120px",marginBottom:"12px"}}),(0,t.jsx)("div",{className:"skeleton skeleton-textarea"}),(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"10px"},children:[(0,t.jsx)("div",{className:"skeleton skeleton-text",style:{width:"80px"}}),(0,t.jsx)("div",{className:"skeleton skeleton-text",style:{width:"40px"}})]})]}),(0,t.jsx)("div",{className:"skeleton skeleton-download-btn"})]}),(0,t.jsxs)("div",{className:"template-panel",children:[(0,t.jsxs)("div",{className:"panel-label",children:[(0,t.jsx)("span",{className:"skeleton skeleton-text",style:{width:"140px"}}),(0,t.jsx)("span",{className:"skeleton skeleton-text",style:{width:"55px"}})]}),(0,t.jsx)("div",{className:"template-grid",children:Array.from({length:100}).map((e,a)=>(0,t.jsx)("div",{className:"skeleton skeleton-tile"},a))})]})]})}let d="cloudflare-turnstile-script",u="0x4AAAAAAFMFwRG84aFAUHTK",m=(0,a.forwardRef)(function({onTokenChange:e},r){let n=(0,a.useRef)(null),s=(0,a.useRef)(null),l=(0,a.useRef)(e);return(0,a.useEffect)(()=>{l.current=e},[e]),(0,a.useImperativeHandle)(r,()=>({reset(){null!==s.current&&window.turnstile&&(window.turnstile.reset(s.current),l.current(""))}}),[]),(0,a.useEffect)(()=>
1{if(!u||!n.current)return;let e=!1;return new Promise((e,t)=>{if(window.turnstile)return e(window.turnstile);let a=document.getElementById(d);if(a){a.addEventListener("load",()=>e(window.turnstile),{once:!0}),a.addEventListener("error",t,{once:!0});return}let r=document.createElement("script");r.id=d,r.src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",r.async=!0,r.defer=!0,r.onload=()=>e(window.turnstile),r.onerror=t,document.head.appendChild(r)}).then(t=>{!e&&t&&null===s.current&&(s.current=t.render(n.current,{sitekey:u,action:"meme_submit",callback:e=>l.current(e),"expired-callback":()=>l.current(""),"error-callback":()=>l.current("")}))}).catch(()=>l.current("")),()=>{e=!0,null!==s.current&&window.turnstile&&(window.turnstile.remove(s.current),s.current=null)}},[]),(0,t.jsx)("div",{ref:n,className:"turnstile-container"})}),h=[].map((e,t)=>({id:`local-${t+1}`,templateId:t+1,order:t+1,file:e,src:`/memes/${e}`,thumbnailSrc:`/memes/${e}`,downloadCount:0,createdAt:0})).filter(e=>e.file.includes("-need-to-be-fixed")),f={x:.075,y:.075},p={x:.925,y:.1},b={left:.075,center:.5,right:.925};function x(e,t,a,r,n,s,l=!1){let i=e.getContext("2d"),o=Math.min(1,1400/t.naturalWidth);if(e.width=t.naturalWidth*o,e.height=t.naturalHeight*o,i.drawImage(t,0,0,e.width,e.height),!a.trim())return;let c=Math.max(28,Math.round(.095*e.width*s)),d=1.06*c,u=.88*e.width;i.font=`800 ${c}px Arial, sans-serif`,i.textAlign=n,i.textBaseline="top",i.lineJoin="round",i.strokeStyle="#080808",i.fillStyle="#fff",i.lineWidth=Math.max(5,.1*c);let m=[];a.trim().split(/\r?\n/).forEach(e=>{let t=e.trim().split(/\s+/).filter(Boolean),a="";t.forEach(e=>{let t=a?`${a} ${e}`:e;i.measureText(t).width>u&&a?(m.push(a),a=e):a=t}),m.push(a)});let h=e.width*r.x,f=e.height*r.y;m.forEach((e,t)=>{let a=f+t*d;i.strokeText(e,h,a),i.fillText(e,h,a)}),l&&(i.font="800 30px Arial, sans-serif",i.globalAlpha=.2,i.lineWidth=3,i.strokeText("@misterhumblee",h,f+m.length*d+4),i.fillText("@misterhumblee",h,f+m.length*d+4),i.globalAlpha=1)}e.s(["default",0,function({limitCount:e=null,showSeeAll:d=!1,showFilters:u=!1,onSeeAll:g=null,seeAllHref:j=null}){let[y,v]=(0,a.useState)(h),[N,w]=(0,a.useState)(null),[k,S]=(0,a.useState)("yo\nfuck\nface"),[E,C]=(0,a.useState)(f),[P,M]=(0,a.useState)("left"),[T,A]=(0,a.useState)(1),[_,R]=(0,a.useState)(!0),[O,U]=(0,a.useState)(!1),[L,I]=(0,a.useState)(!1),[$,F]=(0,a.useState)("instagram"),[D,B]=(0,a.useState)(""),[H,W]=(0,a.useState)(""),[K,z]=(0,a.useState)(!1),[Y,X]=(0,a.useState)("idle"),[q,J]=(0,a.useState)(""),[G,Q]=(0,a.useState)(""),[V,Z]=(0,a.useState)(!1),[ee,et]=(0,a.useState)("recent"),[ea,er]=(0,a.useState)({}),[en,es]=(0,a.useState)({}),[el,ei]=(0,a.useState)(null),eo=(0,a.useRef)(null),ec=(0,a.useRef)(null),ed=(0,a.useRef)({x:0,y:0}),eu=(0,a.useRef)(new Map),em=(0,a.useRef)(null),eh=(0,a.useRef)(null);(0,a.useEffect)(()=>{try{let e=localStorage.getItem("mh_template_downloads");e&&er(JSON.parse(e))}catch{}},[]),(0,a.useEffect)(()=>{let t=!1;return async function(){try{let a=[...(e?await (0,s.getDocs)((0,s.query)((0,n.collection)(i.db,"memes"),(0,s.where)("template","==",!0),(0,s.orderBy)("template_id","desc"),(0,s.limit)(e))):await (0,s.getDocs)((0,s.query)((0,n.collection)(i.db,"memes"),(0,s.where)("template","==",!0),(0,s.orderBy)("template_id","desc")))).docs.map(e=>{let t=e.data(),a=t.createdAt?.toMillis?.()||("number"==typeof t.template_id?t.template_id:0),r=t.downloadCount||t.downloads||0;return{doc_id:e.id,id:`${t.template_id}`,templateId:t.template_id,order:t.template_id,file:t.file,src:t.downloadUrl,thumbnailSrc:t.thumbnailUrl||t.downloadUrl,downloadCount:r,createdAt:a}}),...h].sort((e,t)=>e.order-t.order);t||(v(a),N?w(e=>a.find(t=>t.id===e?.id)||null):w(a[a.length-1]||null))}catch(e){console.error("Template loading error",e),t||w(h[0]||null)}}(),()=>{t=!0}},[]);let ef=(0,a.useMemo)(()=>[...y].sort((e,t)=>{if("downloaded"===ee){let a=(ea[e.id]||0)+(e.downloadCount||0),r=(ea[t.id]||0)+(t.downloadCount||0);return r!==a?r-a:(t.createdAt||0)-(e.createdAt||0)}let a=e.createdAt||("number"==typeof e.order?e.order:0);return(t.createdAt||("number"==typeof t.order?t.order:0))-a}),[y,ee,ea]);function ep(e){let t=eo.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}}function eb(e){eu.current.delete(e.pointerId),em.current=null,Z(!1),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}function ex(e){A(t=>Math.max(.5,Math.min(2.5,t+e)))}async function eg(){if(N?.id){let e={...ea,[N.id]:(ea[N.id]||0)+1};er(e);try{localStorage.setItem("mh_template_downloads",JSON.stringify(e))}catch{}}
1let e=document.createElement("canvas");x(e,ec.current,k,E,P,T,_);let t=await new Promise((t,a)=>{e.toBlob(e=>e?t(e):a(Error("Could not prepare the PNG download.")),"image/png")}),a=`mr-humble-meme-${N.id}.png`,r=new File([t],a,{type:"image/png"});if(/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)&&navigator.canShare?.({files:[r]})&&navigator.share)return void await navigator.share({files:[r],title:"Mr Humble meme"});let n=document.createElement("a");n.download=a,n.href=URL.createObjectURL(t),document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(n.href),(0,o.incrementDownloadCount)(N.doc_id)}async function ej(){if(O&&!G)return void J("Complete the security check before submitting.");if(O&&L&&!D.trim())return void W("Please enter your @username.");if(W(""),O){await eg(),await ev();return}ey(),await eg()}function ey(){z(!1),Q("")}async function ev(){if(!O||!G||!k.trim()||!ec.current||"submitting"===Y)return;X("submitting"),J("");let e=D.trim(),t=!!(L&&e),a=t?e.startsWith("@")?e:`@${e}`:null;try{await (0,r.signInAnonymously)(i.auth);let e=await new Promise((e,t)=>{let a;(a=document.createElement("canvas"),x(a,ec.current,k,E,P,T,_),a).toBlob(a=>{a?e(a):t(Error("Could not prepare the meme image."))},"image/webp",.85)}),n=(0,l.httpsCallable)(i.functions,"submitMeme");await n({turnstileToken:G,imageBase64:await new Promise((t,a)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(",",2)[1]||""),r.onerror=()=>a(Error("Could not prepare the meme image.")),r.readAsDataURL(e)}),caption:k.trim(),templateId:N.templateId,tagPermission:t,socialHandle:a,socialPlatform:t?$||"instagram":null}),Q(""),eh.current?.reset(),X("submitted"),J("Submitted for review."),ey()}catch(e){console.error("Meme submission error",e),Q(""),eh.current?.reset(),X("error"),J("Could not submit this meme. Try again.")}}if((0,a.useEffect)(()=>{let e=!1;return ef.forEach(t=>{var a;(a=t.thumbnailSrc,new Promise(e=>{if(!a)return void e("error");let t=new Image;t.onload=()=>{"function"==typeof t.decode?t.decode().catch(()=>{}).finally(()=>e("loaded")):e("loaded")},t.onerror=()=>e("error"),t.src=a})).then(a=>{e||es(e=>e[t.thumbnailSrc]===a?e:{...e,[t.thumbnailSrc]:a})})}),()=>{e=!0}},[ef]),(0,a.useEffect)(()=>{!N&&ef.length>0&&w(ef[0])},[ef,N]),(0,a.useEffect)(()=>{if(!N?.src)return;let e=!1,t=new Image;return t.crossOrigin="anonymous",ec.current=null,t.onload=()=>{e||(ec.current=t,ei({src:N.src,state:"loaded"}))},t.onerror=()=>{e||ei({src:N.src,state:"error"})},t.src=N.src,()=>{e=!0}},[N?.src]),(0,a.useLayoutEffect)(()=>{N?.src&&el?.src===N.src&&el?.state==="loaded"&&ec.current&&x(eo.current,ec.current,k,E,P,T)},[N?.src,el,k,E,P,T]),!N)return(0,t.jsx)(c,{});let eN=el?.src===N.src&&el?.state==="loaded",ew=el?.src===N.src&&el?.state==="error";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{className:"factory-layout",children:[(0,t.jsxs)("div",{className:"preview-panel",children:[(0,t.jsxs)("div",{className:"panel-label",children:[(0,t.jsx)("span",{children:"THE TAKE"}),(0,t.jsxs)("span",{children:[N.id," / ",ef.length]})]}),(0,t.jsxs)("div",{className:`canvas-wrap ${V?"dragging-text":""}`,children:[(0,t.jsx)("canvas",{className:eN?"":"preview-canvas-hidden",ref:eo,"aria-label":"Meme preview. Drag your caption to reposition it.",onPointerDown:function(e){if(!k.trim())return;if(eu.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),e.currentTarget.setPointerCapture(e.pointerId),2===eu.current.size){let e=[...eu.current.values()];em.current={distance:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y),scale:T},Z(!1);return}let t=ep(e);ed.current={x:t.x-E.x,y:t.y-E.y},Z(!0)},onPointerMove:function(e){let t=eu.current.get(e.pointerId);if(!t)return;if(t.x=e.clientX,t.y=e.clientY,em.current&&2===eu.current.size){let e=[...eu.current.values()],t=Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y);A(Math.max(.5,Math.min(2.5,em.current.scale*t/em.current.distance)));return}if(!V)return;let a=ep(e);C({x:Math.max(0,Math.min(1,a.x-ed.current.x)),y:Math.max(0,Math.min(1,a.y-ed.current.y))})},onPointerUp:eb,onPointerCancel:eb}),!eN&&(ew?(0,t.jsx)("span",{className:"preview-load-error",children:"Could not load this meme preview."}
1):(0,t.jsx)("div",{className:"skeleton skeleton-preview","aria-hidden":"true"}))]}),(0,t.jsxs)("div",{className:"caption-field",children:[(0,t.jsx)("label",{htmlFor:"meme-text",children:"Write the caption"}),(0,t.jsx)("textarea",{id:"meme-text",value:k,maxLength:200,onChange:e=>S(e.target.value),placeholder:"Type the take. Keep it short."}),(0,t.jsx)("div",{className:"text-alignment","aria-label":"Text alignment",children:Object.keys(b).map(e=>(0,t.jsx)("button",{className:P===e?"selected":"",type:"button",onClick:()=>{M(e),C(t=>({...t,x:b[e]}))},children:e},e))}),(0,t.jsxs)("div",{className:"text-size","aria-label":"Caption size",children:[(0,t.jsx)("button",{type:"button",onClick:()=>ex(-.1),"aria-label":"Make caption smaller",children:"â"}),(0,t.jsxs)("span",{children:[Math.round(100*T),"%"]}),(0,t.jsx)("button",{type:"button",onClick:()=>ex(.1),"aria-label":"Make caption larger",children:"+"})]}),(0,t.jsxs)("label",{className:"watermark-toggle",children:[(0,t.jsx)("input",{type:"checkbox",checked:_,onChange:e=>R(e.target.checked)}),"Include watermark"]}),(0,t.jsxs)("div",{className:"field-footer",children:[(0,t.jsx)("span",{children:"White type, black outline"}),(0,t.jsxs)("span",{className:200===k.length?"at-limit":"",children:[k.length," / ",200]})]})]}),(0,t.jsx)("div",{className:"meme-actions",children:(0,t.jsx)("button",{className:"download-button",type:"button",onClick:()=>{Q(""),z(!0)},disabled:!eN,children:"Download meme"})}),q&&(0,t.jsx)("p",{className:`submission-message ${Y}`,children:q})]}),(0,t.jsxs)("div",{className:"template-panel",children:[(0,t.jsxs)("div",{className:"panel-label",children:[(0,t.jsx)("span",{children:"SELECT YOUR WEAPON"}),(0,t.jsxs)("span",{children:[ef.length," ",e&&y.length>e?`of ${y.length}`:""," memes"]})]}),u&&(0,t.jsxs)("div",{className:"meme-filter-bar","aria-label":"Sort memes",children:[(0,t.jsx)("span",{className:"filter-label",children:"Sort by:"}),(0,t.jsx)("button",{type:"button",className:`filter-btn ${"recent"===ee?"active":""}`,onClick:()=>et("recent"),children:"most recent"}),(0,t.jsx)("button",{type:"button",className:`filter-btn ${"downloaded"===ee?"active":""}`,onClick:()=>et("downloaded"),children:"most downloaded"})]}),(0,t.jsx)("div",{className:"template-grid",children:ef.map(e=>{let a=!!en[e.thumbnailSrc],r="error"===en[e.thumbnailSrc];return(0,t.jsx)("button",{className:`template-tile ${N?.id===e.id?"selected":""} ${a?"template-tile-ready":"template-tile-loading"}`,type:"button",onClick:()=>{let t;return t=e.id===h[0]?.id,void(w(e),M(t?"right":"left"),C(t?p:f),A(t?1.6:1))},"aria-label":`Choose template ${e.id}`,disabled:!a||r,children:a?r?(0,t.jsx)("span",{className:"template-load-error",children:"Image unavailable"}):(0,t.jsx)("img",{src:e.thumbnailSrc,alt:`Meme template ${e.id}`}):(0,t.jsx)("span",{className:"skeleton skeleton-tile template-tile-skeleton","aria-hidden":"true"})},e.id)})}),d&&(0,t.jsx)("div",{className:"see-all-wrap",children:j?(0,t.jsxs)("a",{href:j,className:"see-all-button",children:["SEE ALL MEMES ",(0,t.jsx)("span",{children:"â"})]}):(0,t.jsxs)("button",{type:"button",className:"see-all-button",onClick:g,children:["SEE ALL MEMES ",(0,t.jsx)("span",{children:"â"})]})})]})]}),K&&(0,t.jsx)("div",{className:"feature-modal-backdrop",role:"presentation",onClick:ey,children:(0,t.jsxs)("section",{className:"feature-modal",role:"dialog","aria-modal":"true","aria-labelledby":"feature-modal-title",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("p",{className:"eyebrow",children:"BEFORE YOU DOWNLOAD"}),(0,t.jsx)("h2",{id:"feature-modal-title",children:"Want us to feature this meme?"}),(0,t.jsx)("p",{children:"We review selected submissions before featuring them publicly."}),!k.trim()&&(0,t.jsx)("p",{className:"feature-modal-note",children:"Add a caption to enable featuring this meme."}),(0,t.jsxs)("label",{className:"feature-opt-in",children:[(0,t.jsx)("input",{type:"checkbox",checked:O,disabled:!k.trim(),onChange:e=>{let t=e.target.checked;U(t),Q(""),X("idle"),J(""),t||(I(!1),B(""),W("")),J("")}}),"Allow Mr Humble to feature this meme"]}),O&&(0,t.jsxs)("div",{className:"feature-tagging-block",children:[(0,t.jsx)(m,{ref:eh,onTokenChange:Q}),(0,t.jsxs)("label",{className:"feature-opt-in feature-tagging-opt-in",children:[(0,t.jsx)("input",{type:"checkbox",checked:L,onChange:e=>{let t=e.target.checked;I(t),t||(B(""),W(""))}}),"Mr Humble can tag me if he shares my meme"]}),L&&(0,t.jsxs)("div",{className:"feature-tag-fields",children:[(0,t.jsxs)("div",{className:"feature-field-group",children:[(0,t.jsx)("label",{className:"feature-field-label",htmlFor:"feature-platform",children:"Platform"}),(0,t.jsxs)("select",{id:"feature-platform",className:"feature-platform-select",value:$,onChange:e=>F(e.target.value),children:[(0,t.jsx)("option",{value:"instagram",children:"Instagram"}),(0,t.jsx)("option",{value:"tiktok",children:"TikTok"}),(0,t.jsx)("option",{value:"snapchat",children:"Snapchat"}),(0,t.jsx)("option",{value:"x",children:"X"}),(0,t.jsx)("option",{value:"youtube",children:"YouTube"}),(0,t.jsx)("option",{value:"other",children:"Other"})]})]}),(0,t.jsxs)("div",{className:"feature-field-group",children:[(0,t.jsx)("label",{className:"feature-field-label",htmlFor:"feature-handle",children:"Your @username"}),(0,t.jsx)("input",{id:"feature-handle",className:"feature-handle-input",type:"text",placeholder:"@username",maxLength:60,value:D,onChange:e=>{B(e.target.value),H&&W("")}}),(0,t.jsx)("p",{className:"feature-field-help",children:"So we know
1who to tag."}),(0,t.jsx)("p",{className:"feature-field-help no-promises",children:"If Mr Humble shares your meme, he may tag you. No promises bro."}),H&&(0,t.jsx)("p",{className:"feature-field-error",children:H})]})]}),"submitting"===Y&&(0,t.jsxs)("div",{className:"submission-progress",role:"status","aria-live":"polite",children:[(0,t.jsx)("p",{children:"Uploading your meme for reviewâ¦"}),(0,t.jsx)("div",{className:"submission-progress-track",role:"progressbar","aria-label":"Uploading meme","aria-valuetext":"Submission in progress",children:(0,t.jsx)("span",{})})]}),"error"===Y&&(0,t.jsx)("p",{className:"feature-field-error",role:"alert",children:q})]}),(0,t.jsxs)("div",{className:"feature-modal-actions",children:[(0,t.jsx)("button",{className:"feature-modal-cancel",type:"button",onClick:ey,disabled:"submitting"===Y,children:"Cancel"}),(0,t.jsx)("button",{className:"feature-modal-confirm",type:"button",onClick:ej,disabled:"submitting"===Y||O&&!G,children:"submitting"===Y?"Submittingâ¦":O?"Download and submit for review":"Download meme"})]})]})})]})}],51468)}]);
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.