1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];if(null!=r)for(var a in r)r.hasOwnProperty(a)&&(e[a]=r[a])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:blabber-web":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0005fe7f-a965-4d10-a6ee-976065e353c6",e._sentryDebugIdIdentifier="sentry-dbid-0005fe7f-a965-4d10-a6ee-976065e353c6")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5325],{17415:(e,t,r)=>{r.d(t,{q:()=>s});var a=r(32960),n=r(52866),o=r(37940);function s(e){return(0,a.I)({queryKey:o.l.creatorRow(null!=e?e:""),queryFn:async()=>{let t=(0,n.createClient)(),{data:r,error:a}=await t.from("creators").select("profile_id, veriff_verification_status, can_monetize, can_img_gen, image_gen_source_path").eq("profile_id",e).maybeSingle();if(a)throw a;return r},enabled:!!e,staleTime:3e5,gcTime:18e5})}},22784:(e,t,r)=>{r.d(t,{aZ:()=>y,uJ:()=>j,uS:()=>w,z$:()=>v});var a=r(95155),n=r(12115),o=r(17580),s=r(32919),i=r(92657),l=r(55868),d=r
1(38564),c=r(50430),u=r(30285),p=r(62523),m=r(75902),h=r(78697),g=r(59434),f=r(18401);let x=[300,500,1e3,1500,2500];function b(e){return e%100==0?"$".concat(e/100):"$".concat((e/100).toFixed(2))}function v(e){let{open:t,onOpenChange:r,onConfirm:n}=e;return(0,a.jsx)(m.eM,{open:t,onOpenChange:r,icon:o.A,title:"Subscribers only",description:"Lock this post behind your subscription. Everyone else sees a preview.",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.$,{type:"button",variant:"outline",className:m.gT,onClick:()=>r(!1),children:"Cancel"}),(0,a.jsx)(u.$,{type:"button",className:m.So,onClick:n,children:"Enable for subscribers"})]}),children:(0,a.jsxs)("ul",{className:"space-y-3",role:"list",children:[(0,a.jsx)(m.oy,{icon:s.A,children:"Only active subscribers can view the full post."}),(0,a.jsx)(m.oy,{icon:i.A,children:"Non-subscribers still see a preview so they know what they are missing."}),(0,a.jsx)(m.oy,{icon:o.A,children:"Works alongside your subscription price â no extra setup per post."})]})})}function y(e){let{open:t,onOpenChange:r,initialPriceCents:o,onConfirm:s}=e,[i,d]=(0,n.useState)(""),[c,h]=(0,n.useState)(null);(0,n.useEffect)(()=>{t&&(o&&o>0?(d((o/100).toFixed(2)),h(x.some(e=>e===o)?o:null)):(d(""),h(null)))},[t,o]);let v=(()=>{let e=parseFloat(i);return Number.isNaN(e)||e<=0?null:Math.round(100*e)})(),y=null!==v&&v>=f.Si,w=e=>{h(e),d((e/100).toFixed(2*(e%100!=0)))},j=e=>{h(null),d(e)};return(0,a.jsxs)(m.eM,{open:t,onOpenChange:r,icon:l.A,title:"Pay-per-view",description:"Set a one-time price for fans who are not subscribed to unlock this post.",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.$,{type:"button",variant:"outline",className:m.gT,onClick:()=>r(!1),children:"Cancel"}),(0,a.jsx)(u.$,{type:"button",className:m.So,disabled:!y,onClick:()=>v&&s(v),children:"Set unlock price"})]}),children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Quick amounts"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:x.map(e=>{let t=c===e;return(0,a.jsx)("button",{type:"button",onClick:()=>w(e),className:(0,g.cn)("rounded-full border px-3.5 py-1.5 text-sm font-semibold transition-colors",t?"border-transparent text-[var(--brand-on-accent)] [background:var(--brand-grad)] [box-shadow:var(--brand-ring-money)]":"border-border bg-card text-foreground hover:border-[var(--brand-pink)]/40"),children:b(e)},e)})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"ppv-price-input",className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Custom price"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-xl border border-border bg-card px-4 py-3 focus-within:ring-2 focus-within:ring-[var(--brand-violet)]/30",style:{boxShadow:y?"var(--brand-ring-money)":void 0},children:[(0,a.jsx)("span",{className:"text-lg font-semibold text-muted-foreground",children:"$"}),(0,a.jsx)(p.p,{id:"ppv-price-input",type:"number",inputMode:"decimal",min:f.Si/100,step:"0.01",placeholder:"0.00",value:i,onChange:e=>j(e.target.value),className:"h-auto border-0 bg-transparent p-0 text-2xl font-semibold shadow-none focus-visible:ring-0"})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:y?"Fans pay ".concat(b(v)," once to unlock this post."):"Enter at least $".concat((0,f.xS)(f.Si)," to continue.")})]})]})}function w(e){let{open:t,onOpenChange:r,creatorName:n,priceLabel:o,intervalLabel:l,onContinue:c,isLoading:p=!1}=e;return(0,a.jsxs)(m.eM,{open:t,onOpenChange:r,icon:d.A,title:"Subscribers only",description:"Subscribe to ".concat(n," to unlock this post and their exclusive content."),footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.$,{type:"button",variant:"outline",className:m.gT,onClick:()=>r(!1),children:"Not now"}),(0,a.jsx)(u.$,{type:"button",className:m.So,onClick:c,disabled:p,children:p?"Loadingâ¦":"Continue"})]}),children:[(0,a.jsx)(h.T$,{icon:d.A,priceLabel:o,subtitle:"Billed ".concat(l," \xb7 Cancel anytime")}),(0,a.jsxs)("ul",{className:"space-y-3",role:"list",children:[(0,a.jsx)(m.oy,{icon:s.A,children:"Full posts, videos, and shorts from this creator."}),(0,a.jsx)(m.oy,{icon:i.A,children:"Your feed updates as soon as you subscribe."})]})]})}function j(e){let{open:t,onOpenChange:r,creatorName:n,priceLabel:o,onContinue:l,isLoading:d=!1}=e;return(0,a.jsxs)(m.eM,{open:t,onOpenChange:r,icon:c.A,title:"Unlock this post",description:"One-time purchase from ".concat(n,". Content unlocks instantly after payment."),footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.$,{type:"button",variant:"outline",className:m.gT,onClick:()=>r(!1),children:"Cancel"}),(0,a.jsx)(u.$,{type:"button",className:m.So,onClick:l,disabled:d,children:d?"Loadingâ¦":"Continue to payment"})]}),children:[(0,a.jsx)(h.T$,{icon:c.A,priceLabel:o,subtitle:"One-time unlock \xb7 Keep access forever"}),(0,a.jsxs)("ul",{className:"space-y-3",role:"list",children:[(0,a.jsx)(m.oy,{icon:s.A,children:"Pay once to view the full post."}),(0,a.jsx)(m.oy,{icon:i.A,children:"Secure checkout â no subscription required."})]})]})}},58099:(e,t,r)=>{r.d(t,{w:()=>n});var a=r(59434);async function n(e,t,r){let n={prompt:e};(null==r?void 0:r.skipSourceImage)&&(n.skipSourceImage=!0);let o=await fetch("/api/image-gen/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:t}),s=await o.json().catch(()=>({}));if(!o.ok){let e="string"==typeof s.error?s.error:"Generation failed";if(429===o.status){var i;let t=Number(null!=(i=o.headers.get("retry-after"))?i:s.retryAfterSeconds);if(Number.isFinite(t)&&t>0){let r=Math.max(1,Math.ceil(t/60));e="".concat(e," Try again in up to ").concat(r," minutes.")}}throw Error(e)}if(!s.imageBase64||"string"!=typeof s.imageBase64)throw Error("Invalid response from image service");let l="string"==typeof s.mimeType?s.mimeType:"image/png",d=atob(s.imageBase64),c=new Uint8Array(d.length);for(let e=0;e<d.length;
1e++)c[e]=d.charCodeAt(e);let u=new Blob([c],{type:l}),p=new File([u],"ai-generated-".concat(Date.now(),".png"),{type:l}),m=await (0,a.C2)(u);if(!m)throw Error("FileReader not available in this browser");let h=new window.Image,g=await new Promise((e,t)=>{h.onload=()=>e({width:h.width,height:h.height}),h.onerror=()=>t(Error("Could not read generated image")),h.src=m});return{file:p,previewUrl:m,...g}}},75168:(e,t,r)=>{r.d(t,{b:()=>i});var a=r(32960),n=r(2083),o=r(37940),s=r(96183);function i(e){let{data:t=10}=(0,a.I)({queryKey:o.l.platformSettings.all,queryFn:s.l0,enabled:e,staleTime:s.gr,gcTime:s.fc,select:n.HD});return t}},97217:(e,t,r)=>{r.r(t),r.d(t,{NewPost:()=>eC});var a=r(95155),n=r(12115),o=r(66766),s=r(30285),i=r(62523),l=r(88539),d=r(48021),c=r(54416),u=r(87325),p=r(27213),m=r(9803),h=r(14541),g=r(72713),f=r(41066),x=r(17580),b=r(38564),v=r(32919),y=r(42337),w=r(51154),j=r(53311),N=r(39022),k=r(55868),C=r(12486),S=r(34477);let A=(0,S.createServerReference)("0018a346597af708aa0c61ce29217a3474b746362b",S.callServer,void 0,S.findSourceMapURL,"createMuxDirectUploadUrl"),z=(0,S.createServerReference)("4014fffd91f9d67b6a01c9e1fb5835041516ecdb2c",S.callServer,void 0,S.findSourceMapURL,"createPost");var U=r(56671),_=r(35695),P=r(71167),I=r(7383),O=r(79185),E=r(17415),F=r(59434),L=r(52866),M=r(22784),R=r(18401),T=r(75143),D=r(50402),$=r(78266),V=r(54165),B=r(84109),q=r(5196),W=r(29869),H=r(91168);function J(e){let{isOpen:t,onClose:r,onComplete:o}
1=e,[i,l]=(0,n.useState)(!1),[d,u]=(0,n.useState)(null),[p,m]=(0,n.useState)(null),[h,g]=(0,n.useState)(null),[f,x]=(0,n.useState)(!1),b=(0,n.useRef)(null),v=(0,n.useRef)(null),y=(0,n.useRef)([]),j=(0,n.useRef)(null),N=(0,n.useRef)(null),k=(0,n.useRef)(null),[C,S]=(0,n.useState)(!1),[z,_]=(0,n.useState)("user"),P=(0,n.useCallback)(()=>{k.current&&(k.current.getTracks().forEach(e=>e.stop()),k.current=null),b.current&&(b.current.srcObject=null),v.current&&(v.current.ondataavailable=null,v.current.onstop=null),N.current&&clearInterval(N.current),m(null)},[]),I=(0,n.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z;try{let t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),r={video:{facingMode:e,...t?{aspectRatio:16/9}:{width:{ideal:1080,min:480},height:{ideal:1920,min:640},aspectRatio:9/16}},audio:!0},a=await navigator.mediaDevices.getUserMedia(r);k.current=a,m(a),b.current&&(b.current.srcObject=a)}catch(e){console.error("Error accessing camera:",e),U.toast.error("Could not access camera. Please check permissions."),r()}},[r,z]);(0,n.useEffect)(()=>{async function e(){var e;if(!(null==(e=navigator.mediaDevices)?void 0:e.enumerateDevices))return void S(!1);try{let e=(await navigator.mediaDevices.enumerateDevices()).some(e=>"videoinput"===e.kind&&e.label.toLowerCase().includes("back"));S(e)}catch(e){S(!1)}}t&&e()},[t]),(0,n.useEffect)(()=>(t?I(z):(P(),u(null)),()=>{P()}),[t,I,P,z]);let O=()=>{for(let e of["video/mp4","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"])if(MediaRecorder.isTypeSupported(e))return e;return"video/webm"},E=()=>{v.current&&i&&(v.current.stop(),l(!1),N.current&&clearInterval(N.current),g(null))},F=async()=>{if(d&&!f){x(!0),U.toast.info("Preparing your short...");try{let e=await A();if("error"in e)return void U.toast.error("Failed to prepare short: ".concat(e.error));let{data:t}=e;if(!t||!t.upload_url||!t.upload_id)return void U.toast.error("Failed to prepare short: Invalid data received.");let r=O(),a=r.includes("mp4")?"mp4":"webm",n=new File([d],"short.".concat(a),{type:r});o({file:n,muxUploadId:t.upload_id,muxUploadUrl:t.upload_url})}catch(e){U.toast.error("Error preparing short: ".concat(e.message))}finally{x(!1)}}},L=d?URL.createObjectURL(d):void 0;return(0,a.jsx)(V.lG,{open:t,onOpenChange:e=>!e&&r(),children:(0,a.jsxs)(V.Cf,{className:"bg-black border-none p-0 flex items-center justify-center overflow-hidden max-h-[85vh] [&>button:has(.sr-only)]:hidden",style:{aspectRatio:"9/16",height:"85vh",width:"auto"},children:[(0,a.jsxs)(V.c7,{className:"sr-only",children:[(0,a.jsx)(V.L3,{children:"Short Video Recorder"}),(0,a.jsx)(V.rr,{children:"Record or upload a short video of up to 45 seconds. You can also upload an existing video file."})]}),(0,a.jsxs)("div",{className:"relative w-full h-full flex items-center justify-center",children:[(0,a.jsx)("video",{ref:b,src:L,autoPlay:!0,playsInline:!0,muted:!d,controls:!!d,className:"absolute inset-0 w-full h-full object-cover bg-black",style:{transform:d||"user"!==z?void 0:"scaleX(-1)"}}),!d&&p&&(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 to-transparent pointer-events-none"}),(0,a.jsx)(s.$,{variant:"ghost",size:"icon",onClick:r,className:"absolute top-4 right-4 text-white bg-black/30 hover:bg-black/50 hover:text-white z-50 rounded-full",children:(0,a.jsx)(c.A,{size:24})}),(0,a.jsx)("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 flex items-center justify-center gap-8 z-50",children:d?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.$,{onClick:()=>{u(null),I()},disabled:f,className:"bg-white/90 hover:bg-white text-black font-semibold rounded-full px-8 py-6 text-base",children:[(0,a.jsx)(B.A,{size:18,className:"mr-2"}),"Retake"]}),(0,a.jsx)(s.$,{onClick:F,disabled:f,className:"bg-pink-500 hover:bg-pink-600 text-white font-semibold rounded-full px-8 py-6 text-base min-w-[160px]",children:f?(0,a.jsx)(w.A,{size:24,className:"animate-spin"}):(0,a.jsxs)(a.Fragment,{children:["Next",(0,a.jsx)(q.A,{size:20,className:"ml-2"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{className:"text-white hover:text-white/80 p-0 h-auto inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all shrink-0 cursor-pointer [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",children:[(0,a.jsx)(W.A,{size:28}),(0,a.jsx)("input",{type:"file",ref:j,accept:"video/*",onChange:e=>{var t;let r=null==(t=e.target.files)?void 0:t[0];if(r){if(r.size>0xc800000)return void U.toast.error("File is too large. Please select a file smaller than 200MB.");let e=document.createElement("video");e.preload="metadata",e.onloadedmetadata=()=>{window.URL.revokeObjectURL(e.src),e.duration>45?U.toast.error("Video is too long. Maximum duration is ".concat(45," seconds.")):(P(),u(r))},e.src=URL.createObjectURL(r)}},className:"hidden"})]}),(0,a.jsx)(s.$,{onClick:i?E:()=>
1{if(p){y.current=[];try{let e=O();v.current=new MediaRecorder(p,{mimeType:e}),v.current.ondataavailable=e=>{e.data.size>0&&y.current.push(e.data)},v.current.onstop=()=>{let e=O(),t=new Blob(y.current,{type:e});P(),u(t)},v.current.start(),l(!0),g(45),N.current=setInterval(()=>{g(e=>null!==e?e-1:null)},1e3),setTimeout(()=>{var e;(null==(e=v.current)?void 0:e.state)==="recording"&&E()},45e3)}catch(e){console.error("Error starting recording:",e),U.toast.error("Could not start recording.")}}},className:"w-20 h-20 rounded-full bg-transparent border-4 border-white flex items-center justify-center",children:(0,a.jsx)("div",{className:"\n ".concat(i?"w-8 h-8 rounded-md":"w-16 h-16 rounded-full","\n bg-pink-500 transition-all duration-200 flex-shrink-0\n ")})}),C?(0,a.jsx)(s.$,{variant:"ghost",size:"icon",onClick:()=>{_(e=>"user"===e?"environment":"user")},className:"text-white hover:text-white/80 p-0 h-auto",children:(0,a.jsx)(H.A,{size:28})}):(0,a.jsx)("div",{className:"w-7 h-7"}),i&&null!==h&&(0,a.jsxs)("div",{className:"absolute -top-8 text-white bg-black/50 px-2 py-1 rounded-sm text-sm font-mono",children:["0:",h.toString().padStart(2,"0")]})]})})]})]})})}var K=r(53582),Y=r(28338),G=r(83438);let Q=[{id:"public",label:"Public"},{id:"subscribers_only",label:"Subscribers",locked:!0},{id:"ppv",label:"Pay-per-view",locked:!0}];function X(e){let{value:t,onChange:r,disabled:n}=e;return(0,a.jsx)("div",{className:"flex gap-0.5 rounded-full border border-border p-0.5",style:{background:"var(--brand-surface)"},role:"group","aria-label":"Post access",children:Q.map(e=>{let o=t===e.id;return(0,a.jsxs)("button",{type:"button",disabled:n,onClick:()=>r(e.id),className:(0,F.cn)("inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-xs font-semibold transition-colors",o?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground",n&&"opacity-50 cursor-not-allowed"),children:[e.locked&&(0,a.jsx)(v.A,{className:"h-2.5 w-2.5 shrink-0","aria-hidden":!0}),e.label]},e.id)})})}var Z=r(52434),ee=r(51368);let et="post-images",er="public/post_media",ea=[750,2e3,5e3];function en(e){if(e instanceof Error&&e.message)return e.message;if(e&&"object"==typeof e){if("string"==typeof e.message&&e.message)return e.message;if("string"==typeof e.error&&e.error)return e.error}return String(null!=e?e:"Unknown upload error")}function eo(e){var t;if(!e||"object"!=typeof e)return null;let r=null!=(t=e.statusCode)?t:e.status,a="number"==typeof r?r:Number.parseInt(String(r),10);return Number.isFinite(a)?a:null}function es(e){let t=eo(e);if(401===t||403===t)return!0;let r=en(e).toLowerCase();return r.includes("row-level security")||r.includes("jwt")||r.includes("not authenticated")||r.includes("permission denied")||r.includes("unauthorized")}function ei(e){let t=eo(e);if(408===t||425===t||429===t||null!==t&&t>=500)return!0;let r=en(e).toLowerCase();return r.includes("failed to fetch")||r.includes("fetch failed")||r.includes("load failed")||r.includes("network")||r.includes("timeout")||r.includes("timed out")||r.includes("connection")||r.includes("temporarily unavailable")}function el(){return"undefined"==typeof navigator||"boolean"!=typeof navigator.onLine?null:navigator.onLine}async function ed(e){if("undefined"==typeof navigator||!1!==navigator.onLine)return void await new Promise(t=>globalThis.setTimeout(t,e));await new Promise(t=>{let r=!1,a=()=>{r||(r=!0,globalThis.clearTimeout(n),window.removeEventListener("online",a),t())},n=globalThis.setTimeout(a,e);window.addEventListener("online",a,{once:!0})})}function ec(e,t,r){let a=Error(e);return a.name="PostImageUploadError",a.cause=t,a.postImageUploadFailure=r,a}function eu(e,t,r){return ec('Could not read "'.concat(e.name,'" from this device. Remove it, select the image again, and retry the post.'),t,r)}async function ep(e,t){if(!(null==t?void 0:t.startsWith("data:")))return e;try{let r=await fetch(t);if(!r.ok)throw Error("cached image returned ".concat(r.status));let a=await r.arrayBuffer();if(a.byteLength!==e.size)throw Error("cached image size mismatch (".concat(a.byteLength," bytes, expected ").concat(e.size,")"));return new File([a],e.name,{type:e.type||r.headers.get("content-type")||"application/octet-stream",lastModified:e.lastModified})}catch(t){throw eu(e,t,{attempts:0,maxAttempts:4,retryable:!1,failureStage:"file_snapshot",storageStatus:null,storageMessage:en(t),bodySizeBytes:e.size,contentType:e.type||"application/octet-stream",browserOnline:el(),transportFallbackUsed:!1,finalTransport:"multipart"})}}function em(){return Error("Your session expired. Please sign in again, then retry the upload.")}function eh(){return Error("Could not verify your session. Check your connection and try again.")}async function eg(e,t){let r;for(let n=0;n<4;n+=1){try{var a;let{data:n,error:o}=await e.auth.refreshSession();if(!o&&(null==(a=n.session)?void 0:a.user)){if(t&&n.session.user.id!==t)throw em();return n.session.user.id}r=null!=o?o:em()}catch(e){r=e}if(!ei(r)||3===n)break;await ed(ea[Math.min(n,ea.length-1)])}if(ei(r))throw eh();throw em()}async function ef(e){let t;for(let r=0;r<4;r+=1){try{let{data:r,error:a}=await e.auth.getUser();if(!a&&r.user)return r.user.id;t=a}catch(e){t=e}if(!t||!ei(t))break;if(3===r)throw eh();await ed(ea[Math.min(r,ea.length-1)])}return eg(e)}async function ex(e,t){await eg(e,t)}async function eb(e){let t,{supabase:r,userId:a,file:n,storagePath:o,body:s,contentType:i}=e,l=!1,d=0,c=!1,u=!1,p=null,m="multipart",h="storage_upload";for(let e=0;e<4;e+=1){d=e+1;try{let e;if(u)m="array_buffer",h="body_read",null!=p||(p=await s.arrayBuffer()),e=p.slice(0);else e=s.slice(0,s.size,i||s.type),m="multipart";h="storage_upload";let{error:a}=await r.storage.from(et).upload(o,e,{contentType:i,cacheControl:"3600",upsert:!1});if(!a)return;t=a}catch(e){t=e}if(c&&function(e){if(409===eo(e))return!0;let t=en(e).toLowerCase();return t.includes("already exists")||t.includes("duplicate")}(t))return;if(es(t)&&!l){await ex(r,a),l=!0;continue}if(!ei(t)||3===e)break;c=!0,function(e){if(null!==eo(e))return!1;let t=en(e).toLowerCase();return t.includes("failed to fetch")||t.includes("fetch failed")||t.includes("load failed")||t.includes("network request failed")}(t)&&(u=!0),await ed(ea[Math.min(e,ea.length-1)])}if(es(t))throw em();let g=eo(t),f={attempts:d,maxAttempts:4,retryable:ei(t),failureStage:h,storageStatus:g,storageMessage:en(t),bodySizeBytes:s.size,contentType:i,browserOnline:el(),transportFallbackUsed:u,finalTransport:m};if(413===g||en(t).toLowerCase().includes("too large"))throw ec('"'.concat(n.name,'" exceeds the current storage upload limit.'),t,f);if(function(e){var t;let r=e&&"object"==typeof e&&"name"in e?String(null!=(t=e.name)?t:""):"",a=en(e).toLowerCase();return"NotReadableError"===r||a.includes("file could not be read")||a.includes("permission problems that have occurred after a reference to a file was acquired")}(t))throw eu(n,t,f);if(ei(t))throw ec('"'.concat(n.name,'" could not be uploaded after ').concat(4," attempts. Check your connection and try again."),t,f);throw ec('Could not upload "'.concat(n.name,'": ').concat(en(t)),t,f)}async function ev(e,t){let r=Array.from(new Set(t.flatMap(e=>[e.storagePath,e.blurredStoragePath].filter(e=>!!e))));if(0!==r.length)try{let{error:t}=await e.storage.from(et).remove(r);t&&console.warn("Failed to clean up incomplete post image upload:",t.message)}catch(e){console.warn("Failed to clean up incomplete post image upload:",en(e))}}async function ey(e){if("undefined"==typeof document)return null;let t=URL.createObjectURL(e);try{let e=await new Promise((e,r)=>{let a=new window.Image;a.onload=()=>e(a),a.onerror=()=>r(Error("image decode failed")),a.src=t}
1),r=e.naturalWidth||e.width,a=e.naturalHeight||e.height;if(!r||!a)return null;let n=Math.min(800/r,800/a,1),o=Math.max(1,Math.round(r*n)),s=Math.max(1,Math.round(a*n)),i=document.createElement("canvas");i.width=o,i.height=s;let l=i.getContext("2d");if(!l)return null;return l.filter="blur(50px)",l.drawImage(e,0,0,o,s),await new Promise(e=>{i.toBlob(t=>e(t),"image/jpeg",.5)})}catch(e){return console.warn("client blur failed:",e),null}finally{URL.revokeObjectURL(t)}}async function ew(e){let{supabase:t,userId:r,file:a,width:n,height:o,needsBlurredVersion:s,cachedDataUrl:i}=e,l=await ep(a,i),d="".concat(er,"/").concat(r,"/").concat((0,ee.A)(),".").concat(function(e){var t,r,a;let n=e.name.includes(".")?null==(t=e.name.split(".").pop())?void 0:t.toLowerCase():"";if(n&&/^[a-z0-9]{1,8}$/.test(n))return n;let o=null==(a=e.type.split("/")[1])||null==(r=a.split(";")[0])?void 0:r.trim().toLowerCase();return o&&/^[a-z0-9]{1,8}$/.test(o)?o:"bin"}(a));await eb({supabase:t,userId:r,file:a,storagePath:d,body:l,contentType:l.type||a.type||"application/octet-stream"});let c=null;if(s){let e=await ey(l);if(e){let n="".concat(er,"/").concat(r,"/").concat((0,ee.A)(),"_blurred.jpg");try{await eb({supabase:t,userId:r,file:a,storagePath:n,body:e,contentType:"image/jpeg"}),c=n}catch(e){console.warn('blurred upload failed for "'.concat(a.name,'":'),en(e))}}}return{storagePath:d,blurredStoragePath:c,fileName:a.name,width:n,height:o}}var ej=r(62105);function eN(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function ek(e){let{item:t,isPending:r,onRemove:n}=e,{attributes:i,listeners:l,setNodeRef:u,transform:p,transition:m,isDragging:h}=(0,D.gl)({id:t.id}),g={transform:$.Ks.Transform.toString(p),transition:m,opacity:h?.5:1,zIndex:h?10:void 0};return(0,a.jsxs)("div",{ref:u,style:g,...i,className:"relative group aspect-square touch-none",children:[!r&&(0,a.jsx)("button",{...l,className:"absolute top-1 left-1 z-20 p-1 cursor-grab active:cursor-grabbing touch-none",children:(0,a.jsx)(d.A,{size:16,className:"text-white/70 hover:text-white"})}),"image"===t.type?(0,a.jsx)(o.default,{src:t.previewUrl,alt:"Preview ".concat(t.file.name),fill:!0,sizes:"(max-width: 640px) 33vw, (max-width: 768px) 25vw, (max-width: 1024px) 20vw, 16vw",className:"rounded-lg object-cover border"}):(0,a.jsxs)("div",{className:"w-full h-full rounded-lg border bg-muted flex items-center justify-center p-2 relative",children:[(0,a.jsxs)("span",{className:"text-xs text-muted-foreground truncate",children:[t.file.name," (",t.type,")"]}),"short"===t.type&&(0,a.jsx)("div",{className:"absolute top-1.5 left-1.5 bg-pink-500 text-white text-[10px] px-1.5 py-0.5 rounded-sm font-bold leading-none",children:"SHORT"})]}),!r&&(0,a.jsx)(s.$,{variant:"ghost",size:"icon",className:"absolute top-1 right-1 h-8 w-8 bg-black/60 hover:bg-black/80 text-white rounded-full z-10",onClick:()=>n(t.id),children:(0,a.jsx)(c.A,{size:14})})]})}function eC(e){var t,r,o,d,S,$;let{onPostSuccess:V,initialGalleryImageId:B,onGalleryImageConsumed:q,variant:W="default"}=e,H=(0,I.k)(),{session:Q,profile:ee,isLoading:et}=(0,P.J)(),{pulseEnabled:er}=(0,O.x)(),[ea,en]=(0,n.useState)(""),[eo,es]=(0,n.useState)([]),[ei,el]=(0,n.useTransition)(),[ed,ec]=(0,n.useState)(!1),[eu,ep]=(0,n.useState)(!1),[em,eh]=(0,n.useState)(0),[eg,ex]=(0,n.useState)(null),[eb,ey]=(0,n.useState)(null),{data:eC,refetch:eS}=(0,E.q)(null==Q||null==(t=Q.user)?void 0:t.id),eA=(0,_.useRouter)(),ez=(0,L.createClient)(),[eU,e_]=(0,n.use
1State)("public"),[eP,eI]=(0,n.useState)(null),[eO,eE]=(0,n.useState)(!1),[eF,eL]=(0,n.useState)(!1),[eM,eR]=(0,n.useState)(!1),[eT,eD]=(0,n.useState)(!1),[e$,eV]=(0,n.useState)(!1),eB=(0,n.useRef)(null),[eq,eW]=(0,n.useState)("none"),[eH,eJ]=(0,n.useState)("image"),[eK,eY]=(0,n.useState)([]),[eG,eQ]=(0,n.useState)(""),[eX,eZ]=(0,n.useState)(""),[e0,e1]=(0,n.useState)([{id:eN(),value:""},{id:eN(),value:""}]),e2=(0,n.useRef)(null),e5=(0,n.useRef)(null),e3=(0,n.useRef)(!1),e4=(0,n.useMemo)(()=>[{id:"text",label:H("post.typeText"),icon:u.A},{id:"image",label:H("post.typePhoto"),icon:p.A},{id:"video",label:H("post.typeVideo"),icon:m.A},{id:"carousel",label:H("post.typeCarousel"),icon:h.A},{id:"poll",label:H("post.typePoll"),icon:g.A},{id:"short",label:H("post.typeShort"),icon:f.A}],[H]),e8=(0,n.useMemo)(()=>[{id:"public",label:H("post.accessPublic"),desc:H("post.accessPublicDesc"),icon:x.A},{id:"subscribers_only",label:H("post.accessSubscribers"),desc:H("post.accessSubscribersDesc"),icon:b.A},{id:"ppv",label:H("post.accessPpv"),desc:H("post.accessPpvDesc"),icon:v.A}],[H]),e6=(0,n.useMemo)(()=>({activationConstraint:{distance:10}}),[]),e9=(0,n.useMemo)(()=>({coordinateGetter:D.JR}),[]),e7=(0,T.FR)((0,T.MS)(T.AN,e6),(0,T.MS)(T.uN,e9)),[te,tt]=(0,n.useState)(!1);(0,n.useEffect)(()=>{ey(null!=eC?eC:null)},[eC]),(0,n.useEffect)(()=>{var e;if(!eT||!(null==Q||null==(e=Q.user)?void 0:e.id))return;let t=!1;return(async()=>{let{data:e}=await eS();t||ey(null!=e?e:null)})(),()=>{t=!0}},[eT,null==Q||null==(r=Q.user)?void 0:r.id,eS]),(0,n.useEffect)(()=>{if(!B){eB.current=null;return}},[B]),(0,n.useEffect)(()=>{var e;if(!B||!(null==Q||null==(e=Q.user)?void 0:e.id)||eB.current===B)return;let t=!1;return(async()=>{try{let{data:e,error:r}=await ez.from("creator_image_gen_gallery").select("id, storage_path").eq("id",B).eq("profile_id",Q.user.id).maybeSingle();if(t)return;if(r||!e){U.toast.error(H("post.studioImageFailed")),null==q||q();return}let{data:{publicUrl:a}}=ez.storage.from("creator-content").getPublicUrl(e.storage_path),n=await fetch(a);if(!n.ok)throw Error("fetch failed");let o=await n.blob(),s=new File([o],"studio-".concat(e.id,".png"),{type:o.type||"image/png"}),i=await (0,F.C2)(o);if(!i){U.toast.error(H("post.attachStudioFailed")),null==q||q();return}let l=await new Promise((e,t)=>{let r=new window.Image;r.onload=()=>e(r),r.onerror=()=>t(Error("decode")),r.src=i});if(t)return;if(eo.length>=10)return void U.toast.error(H("post.maxCarousel",{max:10}));if(eo.some(e=>"video"===e.type))return void U.toast.error(H("post.removeVideoFirst"));if("none"!==eq)return void U.toast.error(H("post.clearContentFirst",{type:eq}));eB.current=B,es(e=>[...e,{file:s,type:"image",previewUrl:i,id:crypto.randomUUID(),width:l.width,height:l.height}]),t||(U.toast.success(H("post.imageAddedStudio")),null==q||q())}catch(e){t||(console.error(e),U.toast.error(H("post.attachStudioFailed")),null==q||q())}})(),()=>{t=!0}},[B,null==Q||null==(o=Q.user)?void 0:o.id,ez,q,eq]);let tr=e=>{eR(!1),ts(),es([{file:e.file,type:"short",previewUrl:URL.createObjectURL(e.file),id:crypto.randomUUID(),muxUploadId:e.muxUploadId,muxUploadUrl:e.muxUploadUrl}]),eW("short"),e_("public")},ta=(0,n.useCallback)(async(e,t)=>{if("none"!==eq){U.toast.error(H("post.cannotAddMediaType",{type:eq})),e.target&&(e.target.value="");return}let r=e.target.files;if(r){if(eo.some(e=>"video"===e.type)){U.toast.error(H("post.oneVideoOnly")),e.target&&(e.target.value="");return}if("image"===t&&eo.some(e=>"video"===e.type)){U.toast.error(H("post.noImagesOnVideo")),e.target&&(e.target.value="");return}if("video"===t&&eo.some(e=>"image"===e.type)){U.toast.error(H("post.noVideoOnImages")),e.target&&(e.target.value="");return}if("video"===t&&r.length>1){U.toast.error(H("post.oneVideoFile")),e.target&&(e.target.value="");return}for(let e of Array.from(r)){let r=crypto.randomUUID();if("image"===t){if(eo.length>=10){U.toast.error(H("post.maxImages",{max:10}));break}if(e.size>0x3200000){U.toast.error(H("post.imageTooLarge",{name:e.name,max:50}));continue}if(!["image/jpeg","image/png","image/gif","image/webp"].includes(e.type)){U.toast.error(H("post.invali
1dImageType",{name:e.name}));continue}let t=await (0,F.C2)(e);if(!t){U.toast.error(H("post.unsupportedBrowser"));continue}let a=new window.Image;a.src=t,await new Promise((e,t)=>{a.onload=()=>e(),a.onerror=()=>t(Error("decode"))}),es(n=>[...n,{file:e,type:"image",previewUrl:t,id:r,width:a.width,height:a.height}])}else if("video"===t){if(e.size>2097152e3){U.toast.error(H("post.videoTooLarge",{name:e.name,max:2e3}));continue}if(!e.type.startsWith("video/")){U.toast.error(H("post.notAVideo",{name:e.name}));continue}ec(!0),U.toast.info(H("post.preparingVideo"));try{let t=await A();if("error"in t){U.toast.error(H("post.videoPrepareFailed",{error:t.error})),ec(!1);continue}let{data:a}=t;if(!a||!a.upload_url||!a.upload_id){U.toast.error(H("post.videoPrepareInvalid")),ec(!1);continue}let n=document.createElement("video");n.preload="metadata",n.onloadedmetadata=()=>{es(t=>[...t,{file:e,type:"video",previewUrl:e.name,id:r,muxUploadId:a.upload_id,muxUploadUrl:a.upload_url,width:n.videoWidth,height:n.videoHeight}]),URL.revokeObjectURL(n.src)},n.src=URL.createObjectURL(e)}catch(e){U.toast.error(H("post.videoPrepareError",{error:e.message}))}finally{ec(!1)}}}e.target&&(e.target.value="")}},[eo,eq]),tn=(0,n.useCallback)(async e=>{if("none"!==eq)return void U.toast.error(H("post.cannotAddMediaType",{type:eq}));if(eo.some(e=>"video"===e.type))return void U.toast.error(H("post.oneVideoOnly"));if("video"===e.media_type&&eo.some(e=>"image"===e.type))return void U.toast.error(H("post.noVideoOnImages"));if("image"===e.media_type&&eo.some(e=>"video"===e.type))return void U.toast.error(H("post.noImagesOnVideo"));try{let t=await (0,G.KD)(ez,e),r=crypto.randomUUID();if("image"===e.media_type){if(eo.length>=10)return void U.toast.error(H("post.maxImages",{max:10}));let e=await (0,F.C2)(t);if(!e)return void U.toast.error(H("post.unsupportedBrowser"));let a=new window.Image;await new Promise((t,r)=>{a.onload=()=>t(),a.onerror=()=>r(Error("decode")),a.src=e}),es(n=>[...n,{file:t,type:"image",previewUrl:e,id:r,width:a.width,height:a.height}]),U.toast.success(H("vault.imageAddedVault"))}else{if(eo.length>0)return void U.toast.error(H("post.oneVideoOnly"));ec(!0),U.toast.info(H("post.preparingVideo"));let e=await A();if("error"in e)return void U.toast.error(H("post.videoPrepareFailed",{error:e.error}));let{data:a}=e;if(!(null==a?void 0:a.upload_url)||!(null==a?void 0:a.upload_id))return void U.toast.error(H("post.videoPrepareInvalid"));await new Promise((e,n)=>{let o=document.createElement("video");o.preload="metadata",o.onloadedmetadata=()=>{es([{file:t,type:"video",previewUrl:t.name,id:r,muxUploadId:a.upload_id,muxUploadUrl:a.upload_url,width:o.videoWidth,height:o.videoHeight}]),URL.revokeObjectURL(o.src),e()},o.onerror=()=>n(Error("metadata")),o.src=URL.createObjectURL(t)}),U.toast.success(H("vault.imageAddedVault"))}}catch(e){console.error(e),U.toast.error(H("vault.attachVaultFailed"))}finally{ec(!1)}},[eq,eo,ez,H]),to=e=>{es(t=>t.filter(t=>t.id!==e))},ts=()=>{en(""),es([]),e2.current&&(e2.current.value=""),e5.current&&(e5.current.value=""),e1([{id:eN(),value:""},{id:eN(),value:""}]),eW("none")},ti=e=>{let{active:t,over:r}=e;r&&t.id!==r.id&&es(e=>{let a=e.findIndex(e=>e.id===t.id),n=e.findIndex(e=>e.id===r.id);return -1===a||-1===n?e:(0,D.be)(e,a,n)}),e3.current=!1},tl=()=>{e3.current=!0},td=()=>{e3.current=!1},tc=async()=>{let e=new FormData;ea.trim()&&e.append("textContent",ea.trim());let t="TEXT_ONLY",r=null;if("poll"===eq){if(!ea.trim())return void U.toast.error(H("post.pollQuestionRequired"));let e=e0.filter(e=>""!==e.value.trim());if(e.length<2)return void U.toast.error(H("post.pollMinOptions"));t="POLL",r=JSON.stringify({type:"POLL",options:e.map((e,t)=>({id:e.id,text:e.value.trim(),order:t}))})}else if(eo.length>0){let r,a=eo.find(e=>"video"===e.type||"short"===e.type);if(a&&!a.muxUploadUrl)return void U.toast.error(H("post.videoPreparing"));if(ed)return void U.toast.info(H("post.videoPreparingWait"));if(a&&a.muxUploadUrl&&a.file){ep(!0),eh(0),U.toast.info(H("post.uploadingNamed",{name:a.file.name}));try{let e=new XMLHttpRequest,t=new Promise((t,r)=>{e.upload.addEventListener("progress",e=>{if(e.lengthComputable){let t=Math.round(e.loaded/e.total*100);eh(t)}}),e.addEventListener("load",()=>{e.status>=200&&e.status<300?t():r(Error("Upload failed with status ".concat(e.status,": ").concat(e.responseText)))}),e.addEventListener("error",()=>{r(Error("Upload failed"))}),e.addEventListener("abort",()=>{r(Error("Upload was aborted"))})});e.open("PUT",a.muxUploadUrl),e.setRequestHeader("Content-Type",a.file.type),e.send(a.file),await t,U.toast.success(H("post.videoUploadedMux",{name:a.file.name})),r=a.muxUploadId}catch(e){console.error("Mux upload error:",e),U.toast.error(H("post.videoUploadError",{error:e.message}));return}finally{ep(!1),eh(0)}}if(r)e.append("muxUploadId",r),(null==a?void 0:a.width)&&(null==a?void 0:a.height)&&e.append("muxVideoDimensions",JSON.stringify({width:a.width,height:a.height}
1)),t=(null==a?void 0:a.type)==="short"?"SHORT":"VIDEO";else if(eo.some(e=>"image"===e.type)){let r=eo.filter(e=>"image"===e.type),a="public"!==eU;ex({current:0,total:r.length});let n=[];try{let e=await ef(ez),t=0;for(let o of r){let s=await ew({supabase:ez,userId:e,file:o.file,cachedDataUrl:o.previewUrl,width:o.width,height:o.height,needsBlurredVersion:a});n.push(s),t+=1,ex({current:t,total:r.length})}}catch(a){console.error("Image upload error:",a);let e=function(e){if(!e||"object"!=typeof e)return null;let t=e.postImageUploadFailure;return null!=t?t:null}(a);ej.Cp(a,{tags:{operation:"post_image_upload"},extra:{accessLevel:eU,completedImageCount:n.length,imageCount:r.length,...e?{uploadFailure:e}:{}}}),await ev(ez,n);let t=a instanceof Error?a.message:H("post.imageUploadFailed",{error:""});U.toast.error(H("post.imageUploadFailed",{error:t})),ex(null);return}finally{ex(null)}e.append("preparedImages",JSON.stringify(n)),t=r.length>1?"CAROUSEL":"IMAGE"}}else if(!ea.trim())return void U.toast.error(H("post.addContent"));if("TEXT_ONLY"===t&&!ea.trim())return void U.toast.error(H("post.emptyPost"));e.append("postContentType",t),r&&e.append("metadata",r),eK.length>0&&e.append("tags",JSON.stringify(eK)),e.append("accessLevel",eU),"ppv"===eU&&eP&&e.append("ppvPriceCents",eP.toString()),el(async()=>{try{let t=await z(e);t.error?U.toast.error(H("post.postFailed",{error:t.error})):(U.toast.success(H("post.postCreated")),ts(),e_("public"),eI(null),eA.refresh(),V&&V())}catch(e){console.error("Post creation error:",e),U.toast.error(H("post.postUnexpectedError",{error:e.message}))}})},tu=(e,t)=>{e1(r=>r.map(r=>r.id===e?{...r,value:t}:r))},tp=()=>{e0.length<5?e1(e=>[...e,{id:eN(),value:""}]):U.toast.error(H("post.pollMaxOptions",{max:5}))},tm=e=>{e0.length>2?e1(t=>t.filter(t=>t.id!==e)):U.toast.error("Polls must have at least 2 options.")},th=()=>{if(eo.length>0)return void U.toast.error(H("post.clearMediaBeforePoll"));eW("poll"),e1([{id:eN(),value:""},{id:eN(),value:""}])},tg=()=>{e_("subscribers_only"),eI(null),eE(!1)},tf=e=>{e_("ppv"),eI(e),eL(!1)},tx=e=>{eJ(e),es([]),"poll"===e?(eW("poll"),e1([{id:eN(),value:""},{id:eN(),value:""}])):eW("none")},tb=()=>{let e=eG.trim().replace(/\s+/g,"-");e&&!eK.includes(e)&&eY(t=>[...t,e]),eQ("")},tv=e=>eY(t=>t.filter(t=>t!==e)),ty=e=>{eU===e?(e_("public"),eI(null),eZ("")):(e_(e),"ppv"!==e&&(eI(null),eZ("")))},tw=e=>{let t=e.replace(/[^0-9.]/g,"");eZ(t);let r=parseFloat(t);!isNaN(r)&&r>0?eI(Math.round(100*r)):eI(null)},tj="none"!==eq||eo.length>=10||eo.length>0&&"none"===eq&&eo.some(e=>"video"===e.type),tN="none"!==eq||eo.length>0,tk=eo.length>0,tC="none"!==eq||eo.length>0,tS=ei||eu||eo.some(e=>"short"===e.type),tA=e=>{e.preventDefault(),tt(!0)},tz=e=>{e.preventDefault(),tt(!1)},tU=e=>{e.preventDefault(),tt(!1);let t=Array.from(e.dataTransfer.files||[]);if(0!==t.length)if(t.every(e=>e.type.startsWith("image/"))){let e=new DataTransfer;t.forEach(t=>e.items.add(t)),ta({target:{files:e.files}},"image")}else if(1===t.length&&t[0].type.startsWith("video/")){let e=new DataTransfer;e.items.add(t[0]),ta({target:{files:e.files}},"video")}else U.toast.error(H("post.dropImagesOrVideo"))};if("default"===W){let e=["image","video","carousel","short"].includes(eH),t="short"===eH?320:220,r="carousel"===eH?H("post.dropPhotos"):"video"===eH?H("post.dropVideo"):"short"===eH?H("post.dropShort"):H("post.dropPhoto"),n="video"===eH||"short"===eH?m.A:"carousel"===eH?h.A:p.A,o=!ei&&!ed&&!eu&&!("poll"!==eH&&0===eo.length&&!ea.trim())&&!("poll"===eH&&e0.filter(e=>e.value.trim()).length<2&&!ea.trim())&&!("ppv"===eU&&(!eP||eP<R.Si));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"relative",onDragOver:tA,onDragLeave:tz,onDrop:tU,children:[(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center transition-opacity duration-200 pointer-events-none z-10 ".concat(te?"opacity-100":"opacity-0"),style:{background:"rgba(236, 72, 153, 0.15)"},children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(y.A,{size:20,className:"text-pink-500"}),(0,a.jsx)("span",{className:"text-pink-500 font-medium text-sm",children:H("post.dropToUpload")})]})}),eu&&(0,a.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-sm flex items-center justify-center z-20",children:(0,a.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 shadow-lg max-w-sm w-full mx-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)(w.A,{size:20,className:"animate-spin text-pink-500"}),(0,a.jsx)("span",{className:"font-medium text-foreground",children:H("post.uploadingVideo")})]}),(0,a.jsx)("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2 mb-2",children:(0,a.jsx)("div",{className:"bg-pink-500 h-2 rounded-full transition-all duration-300 ease-out",style:{width:"".concat(em,"%")}})}),(0,a.jsx)("div",{className:"text-sm text-muted-foreground text-center",children:H("post.uploadProgress",{pct:em})})]})}),eg&&(0,a.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-sm flex items-center justify-center z-20",children:(0,a.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 shadow-lg max-w-sm w-full mx-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)(w.A,{size:20,className:"animate-spin text-pink-500"}),(0,a.jsx)("span",{className:"font-medium text-foreground",children:H("post.uploading")})]}),(0,a.jsx)("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2 mb-2",children:(0,a.jsx)("div",{className:"bg-pink-500 h-2 rounded-full transition-all duration-300 ease-out",style:{width:"".concat(eg.current/eg.total*100,"%")}})}),(0,a.jsx)("div",{className:"text-sm text-muted-foreground text-center",children:H("post.uploadProgress",{pct:Math.round(eg.current/eg.total*100)})})]})}),(0,a.jsxs)("div",{className:(0,F.cn)("max-w-2xl mx-auto px-5 pb-20 pt-5",(te||eu||null!==eg)&&"opacity-50 pointer-events-none"),children:[(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap mb-5",children:[e4.map(e=>{let t=e.icon;return(0,a.jsxs)("button",{onClick:()=>tx(e.id),className:(0,F.cn)("inline-flex h-[38px] items-center gap-1.5 px-3.5 rounded-full text-[13px] font-semibold transition-all border",eH===e.id?"border-transparent text-[var(--brand-on-accent)] [background:var(--brand-grad)]":"border-border bg-card text-muted-foreground hover:text-foreground hover:bg-muted/80"),children:[(0,a.jsx)(t,{size:15}),e.label]},e.id)}),(null==eb?void 0:eb.can_img_gen)&&(0,a.jsxs)("button",{onClick:()=>eD(!0),className:"inline-flex h-[38px] items-center gap-1.5 px-3.5 rounded-full text-[13px] font-semibold transition-all border border-border bg-card text-muted-foreground hover:text-foreground hover:bg-muted/80",children:[(0,a.jsx)(j.A,{size:15}),H("post.aiImage")]}),eb&&(0,a.jsxs)("button",{onClick:()=>eV(!0),className:"inline-flex h-[38px] items-center gap-1.5 px-3.5 rounded-full text-[13px] font-semibold transition-all border border-border bg-card text-muted-foreground hover:text-foreground hover:bg-muted/80",children:[(0,a.jsx)(N.A,{size:15}),H("vault.attachFromVault")]})]}),(0,a.jsx)("div",{className:"rounded-2xl border border-border bg-card p-4 mb-4",children:(0,a.jsx)(l.T,{value:ea,onChange:e=>en(e.target.value),rows:3,placeholder:H("post.writeCaption"),className:"w-full border-none resize-none bg-transparent focus-visible:ring-0 shadow-none text-base p-0",disabled:ei||eu})}),e&&(0,a.jsx)("div",{className:"relative rounded-2xl mb-4 border-[1.5px] border-dashed border-border/60 bg-card cursor-pointer overflow-hidden",style:{height:t},onClick:()=>{var e,t;"short"===eH?eR(!0):"video"===eH?null==(e=e5.current)||e.click():null==(t=e2.current)||t.click()},children:eo.length>0?(0,a.jsx)(T.Mp,{sensors:e7,collisionDetection:T.fp,onDragStart:tl,onDragEnd:ti,onDragCancel:td,children:(0,a.jsx)(D.gB,{items:eo.map(e=>e.id),strategy:D.kL,children:(0,a.jsx)("div",{className:"p-4 grid grid-cols-3 sm:grid-cols-4 gap-2",children:eo.map(e=>(0,a.jsx)(ek,{item:e,isPending:ei,onRemove:to},e.id))})})}):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-center text-muted-foreground select-none gap-2",children:[(0,a.jsx)(n,{size:32,className:"text-muted-foreground
1/30"}),(0,a.jsx)("div",{className:"font-[650] text-sm",children:r}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground/50",children:H("post.fileTypesHint")})]})}),"poll"===eH&&(0,a.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-4 mb-4",children:[(0,a.jsx)("div",{className:"font-bold text-sm mb-3",children:H("post.pollOptions")}),(0,a.jsx)("div",{className:"space-y-2",children:e0.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",placeholder:H("post.pollOptionN",{n:t+1}),value:e.value,onChange:t=>tu(e.id,t.target.value),className:"flex-1 h-11 px-3.5 rounded-xl border border-border/70 bg-muted/30 text-foreground outline-none text-sm focus:border-[var(--brand-pink)]",maxLength:80,disabled:ei||eu}),e0.length>2&&(0,a.jsx)("button",{onClick:()=>tm(e.id),className:"flex items-center justify-center p-2.5 text-muted-foreground/50 hover:text-muted-foreground",disabled:ei||eu,children:(0,a.jsx)(c.A,{size:16})})]},e.id))}),e0.length<5&&(0,a.jsx)("button",{onClick:tp,className:"mt-2.5 text-[var(--brand-pink)] font-semibold text-[13.5px] hover:opacity-80",disabled:ei||eu,children:H("post.addOption")})]}),(null==eb?void 0:eb.can_monetize)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"font-bold text-[13.5px] mb-2.5 text-muted-foreground",children:H("post.whoCanSee")}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2.5 mb-4",children:e8.map(e=>{let t=e.icon,r=eU===e.id;return(0,a.jsxs)("button",{onClick:()=>ty(e.id),disabled:tS,className:(0,F.cn)("w-full p-3.5 rounded-2xl text-left border transition-all disabled:opacity-40",r?"border-transparent":"border-border"),style:r?{background:"var(--brand-grad-soft)",boxShadow:"var(--brand-ring-money)"}:{background:"var(--card)"},children:[(0,a.jsx)(t,{size:18,className:r?"text-[var(--brand-pink)]":"text-muted-foreground"}),(0,a.jsx)("div",{className:"font-bold text-[13.5px] mt-2",children:e.label}),(0,a.jsx)("div",{className:"text-[11.5px] text-muted-foreground/70 mt-0.5",children:e.desc})]},e.id)})}),"ppv"===eU&&(0,a.jsxs)("div",{className:"flex items-center gap-2.5 mb-4 px-3.5 py-3 rounded-xl",style:{background:"var(--brand-grad-soft)"},children:[(0,a.jsx)(k.A,{size:16,className:"text-[var(--brand-pink)] shrink-0"}),(0,a.jsx)("span",{className:"font-semibold text-sm",children:H("post.unlockPrice")}),(0,a.jsx)("span",{className:"text-muted-foreground",children:"$"}),(0,a.jsx)("input",{type:"text",value:eX,onChange:e=>tw(e.target.value),placeholder:"8.99",className:"w-20 h-9 px-3 rounded-lg border border-border/60 bg-background text-foreground outline-none text-sm focus:border-[var(--brand-pink)]"}),eX&&!isNaN(parseFloat(eX))&&parseFloat(eX)>0&&(0,a.jsxs)("span",{className:"text-xs text-muted-foreground ml-1",children:["â ",Math.round(10*parseFloat(eX))," credits"]}),null!=eP&&eP<R.Si&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground ml-1",children:"Minimum $2.00"})]})]}),(0,a.jsx)("div",{className:"font-bold text-[13.5px] mb-2.5 text-muted-foreground",children:H("post.tags")}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 items-center mb-6",children:[eK.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 h-7 px-3 rounded-full bg-muted/60 border border-border text-sm font-medium",children:["#",e,(0,a.jsx)("button",{onClick:()=>tv(e),className:"text-muted-foreground/50 hover:text-muted-foreground flex items-center ml-0.5",children:(0,a.jsx)(c.A,{size:12})})]},e)),(0,a.jsx)("input",{type:"text",value:eG,onChange:e=>eQ(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),tb())},placeholder:H("post.addTag"),className:"h-8 px-3 rounded-full border border-dashed border-border/60 bg-transparent text-foreground outline-none text-[13px] w-28 placeholder:text-muted-foreground/50 focus:border-[var(--brand-pink)]"})]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)(s.$,{variant:"outline",className:"h-12 shrink-0 px-5 rounded-full text-sm font-semibold",onClick:()=>{ts(),eJ("image"),eY([]),eQ(""),U.toast.info(H("post.draftCleared"))},disabled:ei||eu,children:H("post.saveDraft")}),(0,a.jsx)(s.$,{onClick:tc,className:"flex-1 h-12 rounded-full text-[15.5px] font-semibold text-[var(--brand-on-accent)] [background:var(--brand-grad)] hover:brightness-110 [box-shadow:var(--brand-ring-money)] gap-2",disabled:!o,children:ei?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.A,{size:18,className:"animate-spin"}),H("post.posting")]}):eu?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.A,{size:18,className:"animate-spin"}),H("post.uploading")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.A,{size:17}),H("post.publishPost")]})})]})]})]}),(0,a.jsx)("input",{type:"file",ref:e2,accept:"image/jpeg,image/png,image/gif,image/webp",onChange:e=>ta(e,"image"),multiple:!0,className:"hidden",disabled:ei||ed||eu}),(0,a.jsx)("input",{type:"file",ref:e5,accept:"video/*",onChange:e=>ta(e,"video"),className:"hidden",disabled:ei||ed||eu}),eM&&(0,a.jsx)(J,{isOpen:eM,onClose:()=>eR(!1),onComplete:tr}),(null==Q||null==($=Q.user)?void 0:$.id)&&(null==eb?void 0:eb.can_img_gen)&&(0,a.jsx)(K.E,{open:eT,onOpenChange:eD,profileId:Q.user.id,hasReferencePhoto:!!(null==eb?void 0:eb.image_gen_source_path),onNavigateToNewPost:e=>{eD(!1),eA.push("/new-post?galleryImage=".concat(e))}}),(0,a.jsx)(M.z$,{open:eO,onOpenChange:eE,onConfirm:tg}),(0,a.jsx)(M.aZ,{open:eF,onOpenChange:eL,initialPriceCents:eP,onConfirm:tf})]})}let t_="inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[11px] text-muted-foreground transition-colors hover:bg-muted/80 hover:text-[var(--brand-pink)] disabled:opacity-40 sm:h-[38px] sm:w-[38px]";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"feed"===W?"relative mx-2 my-[10px] rounded-2xl border border-border/80 bg-card px-3 py-3 shadow-sm before:absolute before:inset-x-0 before:top-0 before:h-[3px] before:rounded-t-2xl before:[background:var(--brand-grad)] sm:mx-[14px] sm:my-[12px] sm:px-4 sm:py-[14px]":"mb-0 rounded-none border-b border-border/60 p-2 md:p-4 pt-8 relative",onDragOver:tA,onDragLeave:tz,onDrop:tU,children:[(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center transition-opacity duration-200 pointer-events-none ".concat(te?"opacity-100":"opacity-0"),style:{background:"rgba(236, 72, 153, 0.15)",zIndex:10},children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(y.A,{size:20,className:"text-pink-500"}),(0,a.jsx)("span",{className:"text-pink-500 font-medium text-sm",children:H("post.dropToUpload")})]})}),eu&&(0,a.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-sm flex items-center justify-center z-20",children:(0,a.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 shadow-lg max-w-sm w-full mx-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)(w.A,{size:20,className:"animate-spin text-pink-500"}),(0,a.jsx)("span",{className:"font-medium text-foreground",children:"Uploading video..."})]}),(0,a.jsx)("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2 mb-2",children:(0,a.jsx)("div",{className:"bg-pink-500 h-2 rounded-full transition-all duration-300 ease-out",style:{width:"".concat(em,"%")}})}),(0,a.jsxs)("div",{className:"text-sm text-muted-foreground text-center",children:[em,"% complete"]})]})}),eg&&(0,a.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-sm flex items-center justify-center z-20",children:(0,a.jsxs)("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 shadow-lg max-w-sm w-full mx-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)(w.A,{size:20,className:"animate-spin text-pink-500"}),(0,a.jsx)("span",{className:"font-medium text-foreground",children:"Uploading images..."})]}),(0,a.jsx)("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2 mb-2",children:(0,a.jsx)("div",{className:"bg-pink-500 h-2 rounded-full transition-all duration-300 ease-out",style:{width:"".concat(eg.current/eg.total*100,"%")}})}),(0,a.jsxs)("div",{className:"text-sm text-muted-foreground text-center",children:[eg.current," of ",eg.total," uploaded"]})]})}),(0,a.jsxs)("div",{className:(0,F.cn)("transition-opacity duration-200",te?"opacity-0":"opacity-100","feed"===W&&"flex gap-3"),children:["feed"===W&&ee&&(0,a.jsx)("div",{className:"relative hidden h-11 w-11 shrink-0 overflow-hidden rounded-full bg-muted sm:block",children:ee.avatar_url?(0,a.jsx)(Z.W,{src:ee.avatar_url,alt:"",width:44,height:44,className:"h-full w-full object-cover",priority:!0}):(0,a.jsx)("span",{className:"flex h-full w-full items-center justify-center text-sm font-bold text-muted-foreground",children:(ee.full_name||ee.username||"U").charAt(0).toUpperCase()})}),(0,a.jsxs)("div",{className:"feed"===W?"min-w-0 flex-1":"w-full",children:["feed"===W?(0,a.jsx)("textarea",{value:ea,onChange:e=>en(e.target.value),rows:1,placeholder:"poll"===eq?H("post.askQuestion"):H("post.shareWithFans"),className:"w-full resize-none border-0 bg-muted/20 rounded-xl px-3 py-2.5 text-[16.5px] leading-normal text-foreground outline-none placeholder:text-muted-foreground
1/60 transition-colors focus:bg-muted/30",disabled:ei||ed||eu}):(0,a.jsx)(l.T,{value:ea,onChange:e=>en(e.target.value),placeholder:"poll"===eq?H("post.askQuestion"):H("post.whatsOnMind"),className:"w-full min-h-[80px] p-3 pt-0 text-base resize-none border-none focus:ring-0 focus:border-none focus-visible:ring-0 focus-visible:shadow-none shadow-none text-neutral-900 dark:bg-transparent dark:text-neutral-50",disabled:ei||ed||eu}),eo.length>0&&("none"===eq||"short"===eq)&&(0,a.jsx)(T.Mp,{sensors:e7,collisionDetection:T.fp,onDragStart:tl,onDragEnd:ti,onDragCancel:td,children:(0,a.jsx)(D.gB,{items:eo.map(e=>e.id),strategy:D.kL,children:(0,a.jsx)("div",{className:"mt-2 mb-3 grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 gap-2",children:eo.map(e=>(0,a.jsx)(ek,{item:e,isPending:ei,onRemove:to},e.id))})})}),"poll"===eq&&(0,a.jsxs)("div",{className:"mt-3 p-4 border border-border rounded-lg bg-muted/30",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,a.jsxs)("h3",{className:"text-md font-semibold text-foreground flex items-center",children:[(0,a.jsx)(g.A,{size:18,className:"mr-2"})," Poll Options"]}),(0,a.jsx)(s.$,{variant:"ghost",size:"icon",onClick:()=>eW("none"),className:"h-7 w-7",children:(0,a.jsx)(c.A,{size:16})})]}),(0,a.jsx)("div",{className:"space-y-2",children:e0.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(i.p,{type:"text",placeholder:"Option ".concat(t+1),value:e.value,onChange:t=>tu(e.id,t.target.value),className:"w-full bg-background border-border/70 focus:border-primary flex-grow",maxLength:80,disabled:ei||eu}),e0.length>2&&(0,a.jsx)(s.$,{variant:"ghost",size:"icon",onClick:()=>tm(e.id),className:"h-9 w-9 flex-shrink-0",disabled:ei||eu,children:(0,a.jsx)(c.A,{size:16})})]},e.id))}),e0.length<5&&(0,a.jsx)(s.$,{variant:"link",onClick:tp,className:"mt-2 px-0 text-pink-500 hover:text-pink-600",disabled:ei||eu,children:"+ Add another option"})]}),(0,a.jsxs)("div",{className:(0,F.cn)("flex items-center","feed"===W?"mt-3 flex-wrap gap-2 border-t border-border/40 pt-3 sm:flex-nowrap":"justify-between pt-3"),children:[(0,a.jsx)("div",{className:(0,F.cn)("flex items-center text-muted-foreground","feed"===W?"min-w-0 flex-1 gap-1 overflow-x-auto rounded-full border border-border/60 bg-muted/20 p-1 sm:overflow-visible sm:rounded-none sm:border-0 sm:bg-transparent sm:p-0 sm:gap-1.5":"space-x-1"),children:"feed"===W?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",title:"Photo","aria-label":"Add photo",className:t_,disabled:ei||ed||eu||tj,onClick:()=>{var e;return null==(e=e2.current)?void 0:e.click()},children:(0,a.jsx)(p.A,{size:20})}),(0,a.jsx)("button",{type:"button",title:"Video","aria-label":"Add video",className:t_,disabled:ei||ed||eu||tN,onClick:()=>{var e;return null==(e=e5.current)?void 0:e.click()},children:(0,a.jsx)(m.A,{size:20})}),(0,a.jsx)("button",{type:"button",title:"Short","aria-label":"Create short",className:t_,disabled:ei||eu||tC,onClick:()=>eR(!0),children:(0,a.jsx)(f.A,{size:20})}),(null==eb?void 0:eb.can_img_gen)&&(0,a.jsx)("button",{type:"button",title:"AI","aria-label":"Open AI image studio",className:t_,disabled:ei||eu||tk,onClick:()=>eD(!0),children:(0,a.jsx)(j.A,{size:20})}),eb&&(0,a.jsx)("button",{type:"button",title:H("vault.attachFromVault"),"aria-label":H("vault.attachFromVault"),className:t_,disabled:ei||eu||tk,onClick:()=>eV(!0),children:(0,a.jsx)(N.A,{size:20})}),(0,a.jsx)("button",{type:"button",title:"Poll","aria-label":"Create poll",className:t_,disabled:ei||eu||tk,onClick:th,children:(0,a.jsx)(g.A,{size:20})}),(0,a.jsx)("input",{type:"file",ref:e2,accept:"image/jpeg,image/png,image/gif,image/webp",onChange:e=>ta(e,"image"),multiple:!0,className:"hidden",disabled:ei||ed||eu||eo.some(e=>"video"===e.type)}),(0,a.jsx)("input",{type:"file",ref:e5,accept:"video/*",onChange:e=>ta(e,"video"),className:"hidden",disabled:ei||ed||eu||eo.length>0})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.$,{variant:"ghost",size:"icon",onClick:()=>{var e;return!ei&&!ed&&!eu&&(null==(e=e2.current)?void 0:e.click())},className:"hover:text-pink-500 hover:bg-pink-500/10 rounded-full h-9 w-9",disabled:ei||ed||eu||tj,children:[(0,a.jsx)(p.A,{size:20}),(0,a.jsx)("span",{className:"sr-only",children:"Add Image"})]}),(0,a.jsx)("input",{type:"file",ref:e2,accept:"image/jpeg,image/png,image/gif,image/webp",onChange:e=>ta(e,"image"),multiple:!0,className:"hidden",disabled:ei||ed||eu||eo.some(e=>"video"===e.type)}),(0,a.jsxs)(s.$,{"data-creator-tour":"newpost-video",variant:"ghost",size:"icon",onClick:()=>{var e;return!ei&&!ed&&!eu&&(null==(e=e5.current)?void 0:e.click())},className:"hover:text-pink-500 hover:bg-pink-500/10 rounded-full h-9 w-9",disabled:ei||ed||eu||tN,children:[(0,a.jsx)(m.A,{size:20}),(0,a.jsx)("span",{className:"sr-only",children:"Add Video"})]}),(0,a.jsx)("input",{type:"file",ref:e5,accept:"video/*",onChange:e=>ta(e,"video"),className:"hidden",disabled:ei||ed||eu||eo.length>0}),(0,a.jsxs)(s.$,{"data-creator-tour":"newpost-short",variant:"ghost",size:"icon",onClick:()=>eR(!0),className:"hover:text-pink-500 hover:bg-pink-500/10 rounded-full h-9 w-9",disabled:ei||eu||tC,children:[(0,a.jsx)(f.A,{size:20}),(0,a.jsx)("span",{className:"sr-only",children:"Create a Short"})]}),(null==eb?void 0:eb.can_img_gen)&&(0,a.jsxs)(s.$,{"data-creator-tour":"newpost-aigen",variant:"ghost",size:"icon",onClick:()=>eD(!0),className:"hover:text-pink-500 hover:bg-pink-500/10 rounded-full h-9 w-9",disabled:ei||eu||tk,children:[(0,a.jsx)(j.A,{size:20}),(0,a.jsx)("span",{className:"sr-only",children:"AI image studio"})]}),eb&&(0,a.jsxs)(s.$,{variant:"ghost",size:"icon",onClick:()=>eV(!0),className:"hover:text-pink-500 hover:bg-pink-500/10 rounded-full h-9 w-9",disabled:ei||eu||tk,children:[(0,a.jsx)(N.A,{size:20}),(0,a.jsx)("span",{className:"sr-only",children:H("vault.attachFromVault")})]}),(0,a.jsxs)(s.$,{"data-creator-tour":"newpost-poll",variant:"ghost",size:"icon",onClick:th,className:"hover:text-pink-500 hover:bg-pink-500/10 rounded-full h-9 w-9",disabled:ei||eu||tk,children:[(0,a.jsx)(g.A,{size:20}),(0,a.jsx)("span",{className:"sr-only",children:"Create Poll"})]}),(null==eb?void 0:eb.can_monetize)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.$,{"data-creator-tour":"newpost-subscribers-only",variant:"ghost",size:"icon",onClick:()=>{"subscribers_only"===eU?(e_("public"),eI(null)):eE(!0)},className:(0,F.cn)("rounded-full h-9 w-9 hover:text-[var(--brand-pink)] hover:bg-[var(--brand-grad-soft)]","subscribers_only"===eU&&"text-[var(--brand-pink)] bg-[var(--brand-grad-soft)]"),disabled:ei||tS,children:[(0,a.jsx)(x.A,{size:20}),(0,a.jsx)("span",{className:"sr-only",children:"Subscribers Only"})]}),(0,a.jsxs)(s.$,{"data-creator-tour":"newpost-ppv",variant:"ghost",size:"icon",onClick:()=>{"ppv"===eU?(e_("public"),eI(null)):eL(!0)},className:(0,F.cn)("rounded-full h-9 w-9 hover:text-[var(--brand-pink)] hover:bg-[var(--brand-grad-soft)]","ppv"===eU&&"text-[var(--brand-pink)] bg-[var(--brand-grad-soft)]"),disabled:ei||tS,children:[(0,a.jsx)(k.A,{size:20}),(0,a.jsx)("span",{className:"sr-only",children:"Set PPV Price"})]})]})]})}),"feed"===W&&(null==eb?void 0:eb.can_monetize)&&(0,a.jsx)("div",{className:"order-3 w-full overflow-x-auto pt-1 sm:
1order-none sm:w-auto sm:overflow-visible sm:pt-0",children:(0,a.jsx)(X,{value:eU,onChange:e=>{if("public"===e){e_("public"),eI(null);return}if("subscribers_only"===e)return void("subscribers_only"===eU?(e_("public"),eI(null)):eE(!0));"ppv"===eU?(e_("public"),eI(null)):eL(!0)},disabled:tS})}),(0,a.jsx)(s.$,{"data-creator-tour":"newpost-submit",onClick:tc,className:(0,F.cn)("feed"===W?"h-10 min-w-[78px] shrink-0 rounded-full px-5 text-sm font-semibold text-[var(--brand-on-accent)] [background:var(--brand-grad)] [box-shadow:var(--brand-ring-money)] hover:brightness-110 sm:h-[42px] sm:min-w-0 sm:px-[22px]":"bg-pink-500 hover:bg-pink-600 text-white font-bold rounded-full px-6 py-2 text-sm",er&&"feed"!==W&&"pulse-money-btn"),disabled:ei||ed||eu||null!==eg||"none"===eq&&0===eo.length&&!ea.trim()||"poll"===eq&&e0.filter(e=>""!==e.value.trim()).length<2&&!ea.trim(),children:ei?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.A,{size:18,className:"animate-spin mr-2"}),H("post.posting")]}):eu?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.A,{size:18,className:"animate-spin mr-2"}),H("post.uploading")]}):"feed"===W?H("post.post"):H("post.postButton")})]})]})]})]}),eM&&(0,a.jsx)(J,{isOpen:eM,onClose:()=>eR(!1),onComplete:tr}),(null==Q||null==(d=Q.user)?void 0:d.id)&&(null==eb?void 0:eb.can_img_gen)&&(0,a.jsx)(K.E,{open:eT,onOpenChange:eD,profileId:Q.user.id,hasReferencePhoto:!!(null==eb?void 0:eb.image_gen_source_path),onNavigateToNewPost:e=>{eD(!1),eA.push("/new-post?galleryImage=".concat(e))}}),(null==Q||null==(S=Q.user)?void 0:S.id)&&eb&&(0,a.jsx)(Y.W,{open:e$,onOpenChange:eV,profileId:Q.user.id,onSelect:tn}),(0,a.jsx)(M.z$,{open:eO,onOpenChange:eE,onConfirm:tg}),(0,a.jsx)(M.aZ,{open:eF,onOpenChange:eL,initialPriceCents:eP,onConfirm:tf})]})}}}]);
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.