PageSourceSearch

https://pantheonxxx.com/_next/static/chunks/4811-ab6a61e5433ce59a.js

js pantheonxxx.com collected 2026-10-08 20:42:52 UTC 27,821 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4811],{4811:function(e,t,r){r.r(t);var i=r(11010),n=r(72253),o=r(14932),s=r(24043),l=r(88421),a=r(97582),c=r(85893),d=r(67294),u=r(7963),h=r(20967),p=r(27239),x=r(48783),g=r(81136),v=r(71293),b=r(14225),f=r(5674),j=r(57747),m=r(5460),y=r(36948),S=r(66712),w=r(91170),_=r(89993),C=r(4040),I=r(78230),k=r(34292),F=r(49289),z=r(35541),D=r(19778),O=r(14581),U=r(64859),R=r(66205),A=r(54346),L=r(85970),N=r(5418),E=r(33090),P=r(57169),Z=r(22797),T=r(14253),J=r(65040),V=r(3773),W=r(18845),H=r(12452),M=r(91883),$=r(31407),G=r(98842),q=r(70701),B=r(11505),Q=r(11163),K=r(87066),X=r(85068),Y=r(20595),ee=r(21214),et=r(16718),isScheduledForFuture=function(e){return!!e.scheduledAt&&new Date(e.scheduledAt)>new Date},formatScheduledDate=function(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})};t.default=function(){var e,t,r,er,ei=(0,Y.aC)().user,en=(0,Q.useRouter)(),eo=(0,ee.C)(function(e){return e.auth.token}),es=(0,ee.T)(),el=(0,u.p)(),ea=(0,s._)((0,d.useState)([]),2),ec=ea[0],ed=ea[1],eu=(0,s._)((0,d.useState)(!0),2),eh=eu[0],ep=eu[1],ex=(0,s._)((0,d.useState)([]),2),eg=ex[0],ev=ex[1],eb=(0,s._)((0,d.useState)(!0),2),ef=eb[0],ej=eb[1],em=(0,s._)((0,d.useState)(null),2),ey=em[0],eS=em[1],ew=(0,s._)((0,d.useState)(null),2),e_=ew[0],eC=ew[1],eI=(0,s._)((0,d.useState)(null),2),ek=eI[0],eF=eI[1],ez=(0,h.q)(),eD=ez.isOpen,eO=ez.onOpen,eU=ez.onClose,eR=(0,h.q)(),eA=eR.isOpen,eL=eR.onOpen,eN=eR.onClose,eE=(0,h.q)(),eP=eE.isOpen,eZ=eE.onOpen,eT=eE.onClose,eJ=(0,s._)((0,d.useState)(!1),2),eV=eJ[0],eW=eJ[1],eH=(0,s._)((0,d.useState)(!1),2),eM=eH[0],e$=eH[1],eG=(0,s._)((0,d.useState)(new Set),2),eq=eG[0],eB=eG[1],eQ=(0,s._)((0,d.useState)(null),2),eK=eQ[0],eX=eQ[1],eY=(0,s._)((0,d.useState)(null),2),e0=eY[0],e1=eY[1],e2=(0,s._)((0,d.useState)(null),2),e3=e2[0],e4=e2[1],e5=(0,s._)((0,d.useState)(null),2),e7=e5[0],e8=e5[1],e9=(0,s._)((0,d.useState)(null),2),e6=e9[0],te=e9[1],tt=(0,s._)((0,d.useState)(null),2),tr=tt[0],ti=tt[1],tn=(0,s._)((0,d.useState)(0),2),to=tn[0],ts=tn[1],tl=(0,d.useCallback)((0,i._)(function(){var e,t,r,i,s,c,d,u,h,p,x,g,v,b,f;return(0,a.Jh)(this,function(a){switch(a.label){case 0:if(!eo)return console.warn("⚠️ No token available, cannot fetch videos"),ep(!1),[2];a.label=1;case 1:return a.trys.push([1,5,6,7]),ep(!0),console.log("\uD83D\uDD04 Fetching videos..."),i=(null==ei?void 0:ei.performerId)||(null==ei?void 0:ei._id),[4,K.Z.get("/api/user/assets/videos/performer/search",{withCredentials:!0,params:(0,o._)((0,n._)({},i?{performerId:i}:{}),{limit:200,offset:0}),timeout:3e4})];case 2:if(console.log("✅ Videos response:",(s=a.sent()).data),!(Array.isArray(c=(null===(t=s.data)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.data)||(null===(r=s.data)||void 0===r?void 0:r.data)||[])&&0===c.length&&i))return[3,4];return console.warn("⚠️ performer/search returned empty, falling back to public search"),[4,K.Z.get("/api/user/assets/videos/search",{params:{performerId:i,limit:200,offset:0},timeout:3e4})];case 3:console.log("✅ Fallback videos response:",(p=a.sent()).data),c=(null===(u=p.data)||void 0===u?void 0:null===(d=u.data)||void 0===d?void 0:d.data)||(null===(h=p.data)||void 0===h?void 0:h.data)||[],a.label=4;case 4:if(!Array.isArray(c))return console.error("❌ Expected array but got:",void 0===c?"undefined":(0,l._)(c),c),ed([]),ep(!1),[2];return x=c.map(function(e){var t,r,i,s,l,a=null;"string"==typeof e.thumbnail&&e.thumbnail?a=e.thumbnail:(null===(t=e.thumbnail)||void 0===t?void 0:t.path)?a=e.thumbnail.path:(null===(r=e.thumbnail)||void 0===r?void 0:r.url)?a=e.thumbnail.url:(null===(s=e.video)||void 0===s?void 0:null===(i=s.thumbnails)||void 0===i?void 0:i[0])&&(a=e.video.thumbnails[0]);var c=(null===(l=e.video)||void 0===l?void 0:l.url)||e.teaser,d=a;a&&!a.startsWith("http")&&(d="http://134.199.205.41:3002".concat(a));var u=d?(0,X.$u)(d):void 0;if(u&&e.updatedAt){var h=new Date(e.updatedAt).getTime(),p=u.includes("?")?"&":"?";u="".concat(u).concat(p,"t=").concat(h)}var x=(0,o._)((0,n._)({},e),{thumbnail:u,teaser:c?(0,X.$u)(c):void 0});return console.log("Video:",e.title,"Final thumbnail:",x.thumbnail),x}),console.log("✅ Loaded ".concat(x.length," videos")),ed(x),[3,7];case 5:return console.error("❌ Failed to fetch videos:",g=a.sent()),f=(null==g?void 0:null===(b=g.response)||void 0===b?void 0:null===(v=b.data)||void 0===v?void 0:v.message)||(null==g?void 0:g.message)||((null==g?void 0:g.code)==="ECONNABORTED"?"Request timed out. Please try again.":"Failed to load videos"),el((0,X._j)(f,"error")),ed([]),[3,7];case 6:return ep(!1),[7];case 7:return[2]}})}),[eo,el]),ta=(0,d.useCallback)((0,i._)(function(){var e,t,r,i,s,l,c,d;return(0,a.Jh)(this,function(a){switch(a.label){case 0:if(!(!(e=ek||(null==ei?void 0:ei.performerId))&&eo))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,K.Z.get("/api/performers/me",{withCredentials:!0})];case 2:return(e=null===(r=a.sent().data)||void 0===r?void 0:null===(t=r.data)||void 0===t?void 0:t._id)&&eF(e),[3,4];case 3:return console.error("❌ Failed to load performer profile for photos:",a.sent()),[3,4];case 4:if(!e)return ej(!1),[2];a.label=5;case 5:return a.trys.push([5,7,8,9]),ej(!0),[4,K.Z.get("/api/user/assets/photos/performer/search/".concat(e),{withCredentials:!0,params:{limit:50,offset:0}})];case 6:return ev(Array.isArray(d=(null===(s=(c=a.sent()).data)||void 0===s?void 0:null===(i=s.data)||void 0===i?void 0:i.data)||(null===(l=c.data)||void 0===l?void 0:l.data)||[])?d.map(function(e){var t,r,i,s,l;return(0,o._)((0,n._)({},e),{filePath:(null===(t=e.file)||void 0===t?void 0:t.url)||e.url||(0,X.$u)(e.filePath||""),isFree:null===(r=e.isFree)||void 0===r||r,subscribersOnly:null!==(i=e.subscribersOnly)&&void 0!==i&&i,price:"number"==typeof e.price?e.price:parseFloat(e.price)||0,showInFeed:null!==(s=e.showInFeed)&&void 0!==s&&s,showInGallery:null===(l=e.showInGallery)||void 0===l||l})}):[]),[3,9];case 7:return console.error("❌ Failed to fetch photos:",a.sent()),ev([]),[3,9];case 8:return ej(!1),[7];case 9:return[2]}})}
1),[eo,ek,null==ei?void 0:ei.performerId]);(0,d.useEffect)(function(){if(!eo){var e=setTimeout(function(){eo||(ep(!1),el((0,X._j)("Please log in to view your content","error")))},2e3);return function(){return clearTimeout(e)}}tl(),ta()},[eo,tl,ta,el]);var handleEdit=function(e){eS(e),e7&&URL.revokeObjectURL(e7),e6&&URL.revokeObjectURL(e6),tr&&URL.revokeObjectURL(tr),eX(null),e1(null),e4(null),e8(null),te(null),ti(null),eO()},handlePhotoClick=function(e){eC(e),eL()},tc=(e=(0,i._)(function(){var e,t,r;return(0,a.Jh)(this,function(i){switch(i.label){case 0:if(!e_||!eo)return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),eW(!0),[4,K.Z.put("/api/user/assets/photos/".concat(e_._id),{title:e_.title,description:e_.description,showInFeed:e_.showInFeed,showInGallery:e_.showInGallery,isFree:e_.isFree,subscribersOnly:!!e_.isFree&&(e_.subscribersOnly||!1),price:e_.isFree?0:"number"==typeof e_.price?e_.price:parseFloat(e_.price)||0},{withCredentials:!0})];case 2:return i.sent(),el({title:"Photo updated successfully",status:"success",duration:3e3,isClosable:!0}),eN(),ta(),[3,5];case 3:return el({title:(null==(e=i.sent())?void 0:null===(r=e.response)||void 0===r?void 0:null===(t=r.data)||void 0===t?void 0:t.message)||"Failed to update photo",status:"error",duration:3e3,isClosable:!0}),[3,5];case 4:return eW(!1),[7];case 5:return[2]}})}),function(){return e.apply(this,arguments)});(0,d.useEffect)(function(){return function(){e7&&URL.revokeObjectURL(e7),e6&&URL.revokeObjectURL(e6),tr&&URL.revokeObjectURL(tr)}},[e7,e6,tr]);var handleDelete=function(e){eS(e),eZ()},td=(t=(0,i._)(function(e){var t,r,i,n;return(0,a.Jh)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),t="active"===e.status?"inactive":"active",[4,K.Z.put("/api/user/assets/videos/".concat(e._id),{status:t},{withCredentials:!0})];case 1:return o.sent(),el({title:"Video ".concat("active"===t?"activated":"deactivated"),status:"success",duration:3e3,isClosable:!0,position:"bottom-right"}),tl(),[3,3];case 2:return el({title:(null==(r=o.sent())?void 0:null===(n=r.response)||void 0===n?void 0:null===(i=n.data)||void 0===i?void 0:i.message)||"Failed to update status",status:"error",duration:3e3,isClosable:!0,position:"bottom-right"}),[3,3];case 3:return[2]}})}),function(e){return t.apply(this,arguments)}),toggleExpand=function(e){eB(function(t){var r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},tu=(r=(0,i._)(function(){var e,t,r,i,s,l,c,d,u,h,p,x,g,v,b,f,j,m,y,S,w,_;return(0,a.Jh)(this,function(a){switch(a.label){case 0:if(!ey)return[2];eW(!0),ts(0),a.label=1;case 1:return a.trys.push([1,3,4,5]),(u=new FormData).append("title",ey.title||""),u.append("description",ey.description||""),h=ey.price?parseFloat(String(ey.price)):0,u.append("price",String(h)),u.append("status",ey.status||"inactive"),ey.scheduledAt?(u.append("scheduledAt",ey.scheduledAt),u.append("isSchedule","true")):(u.append("isSchedule","false"),u.append("scheduledAt","")),eK&&u.append("video",eK),e0&&u.append("teaser",e0),e3&&u.append("thumbnail",e3),[4,K.Z.put("/api/user/assets/videos/".concat(ey._id),u,{withCredentials:!0,onUploadProgress:function(e){e.total&&ts(Math.round(100*e.loaded/e.total))}})];case 2:return p=a.sent(),ts(100),console.log("Video update response:",JSON.stringify(p.data,null,2)),console.log("New thumbnail info:",null===(t=p.data)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.thumbnail),console.log("Thumbnail file ID:",null===(i=p.data)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:r.thumbnailId),console.log("Full video object:",null===(s=p.data)||void 0===s?void 0:s.data),el({position:"bottom-right",render:function(){return(0,X._j)({status:"success",title:"Changes saved",description:"Video updated successfully"})},duration:3e3}),e7&&URL.revokeObjectURL(e7),e6&&URL.revokeObjectURL(e6),tr&&URL.revokeObjectURL(tr),eU(),eX(null),e1(null),e4(null),e8(null),te(null),ti(null),ts(0),(null==p?void 0:null===(l=p.data)||void 0===l?void 0:l.data)&&(console.log("Updating video with response data:",{id:(x=p.data.data)._id,thumbnail:x.thumbnail,thumbnailId:x.thumbnailId,updatedAt:x.updatedAt}),(g=x.thumbnail)?(g=(0,X.$u)(g),v=Date.now(),b=g.includes("?")?"&":"?",console.log("Transformed thumbnail with cache-bust:",g="".concat(g).concat(b,"t=").concat(v))):console.log("No thumbnail in response, keeping old thumbnail"),ed(function(e){return e.map(function(e){if(e._id===ey._id){var t=g||x.thumbnail||e.thumbnail,r=(0,o._)((0,n._)({},e,x),{thumbnail:t,updatedAt:x.updatedAt||new Date().toISOString()});return console.log("Updated video in state:",{id:r._id,newThumbnail:r.thumbnail,oldThumbnail:e.thumbnail,thumbnailsMatch:r.thumbnail===e.thumbnail}),r}return e})})),(null==p?void 0:null===(d=p.data)||void 0===d?void 0:null===(c=d.data)||void 0===c?void 0:c.thumbnail)?console.log("Got thumbnail in response, skipping refetch to preserve new thumbnail"):(console.log("No thumbnail in response, will refetch after delay"),setTimeout(function(){tl()},5e3)),[3,5];case 3:return f=a.sent(),ts(0),console.error("Video update error:",f),console.error("Error response:",null==f?void 0:f.response),console.error("Error data:",null==f?void 0:null===(j=f.response)||void 0===j?void 0:j.data),_=(null==f?void 0:null===(y=f.response)||void 0===y?void 0:null===(m=y.data)||void 0===m?void 0:m.message)||(null==f?void 0:null===(w=f.response)||void 0===w?void 0:null===(S=w.data)||void 0===S?void 0:S.error)||(null==f?void 0:f.message)||"Failed to update video",el({position:"bottom-right",render:function(){return(0,X._j)({status:"error",title:"Error",description:_})},duration:5e3}),[3,5];case 4:return eW(!1),[7];case 5:return[2]}})}),function(){return r.apply(this,arguments)}),th=(er=(0,i._)(function(){var e,t,r;return(0,a.Jh)(this,function(i){switch(i.label){case 0:if(!ey)return[2];e$(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,K.Z.delete("/api/user/assets/videos/".concat(ey._id),{withCredentials:!0})];case 2:return i.sent(),el((0,X._j)("Video deleted successfully","success")),eT(),tl(),es(et.sQ.util.invalidateTags(["ModelProfile"])),[3,5];case 3:return e=i.sent(),el((0,X._j)((null==e?void 0:null===(r=e.response)||void 0===r?void 0:null===(t=r.data)||void 0===t?void 0:t.message)||(null==e?void 0:e.message)||"Failed to delete video","error")),[3,5];case 4:return e$(!1),[7];case 5:return[2]}})}),function(){return er.apply(this,arguments)});return eh?(0,c.jsx)(p.M,{minH:"400px",children:(0,c.jsxs)(x.g,{spacing:4,children:[(0,c.jsx)(g.$,{size:"xl",color:"purple.500",thickness:"4px"}),(0,c.jsx)(v.x,{color:"gray.500",children:"Loading your content..."})]})}):0===ec.length?(0,c.jsx)(p.M,{minH:"400px",children:(0,c.jsxs)(x.g,{spacing:4,children:[(0,c.jsx)(v.x,{fontSize:"xl",color:"gray.500",children:"No content yet"}),(0,c.jsx)(v.x,{fontSize:"sm",color:"gray.600",children:"Upload your first video to get started!"}),(0,c.jsx)(b.z,{colorScheme:"purple",onClick:function(){return en.push("/add-content")},children:"Upload Video"})]})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(f.M,{columns:[1,2,3],spacing:6,w:"100%",children:ec.map(function(e){var t;return(0,c.jsxs)(j.xu,{bg:"gray.800",borderRadius:"md",overflow:"hidden",position:"relative",curs
1or:"pointer",onClick:function(){return handleEdit(e)},_hover:{transform:"scale(1.02)",transition:"transform 0.2s"},children:[(0,c.jsxs)(j.xu,{position:"relative",h:"200px",children:[(0,c.jsx)(m.E,{src:e.thumbnail?"".concat(e.thumbnail).concat(e.thumbnail.includes("?")?"&":"?","_=").concat(Date.now()):void 0,alt:e.title,w:"100%",h:"100%",objectFit:"cover",loading:"lazy",ignoreFallback:!0,fallbackSrc:e.thumbnail},"".concat(e._id,"-").concat(e.thumbnailId||e.thumbnail,"-").concat(e.updatedAt)),"inactive"===e.status&&(0,c.jsx)(j.xu,{position:"absolute",top:0,left:0,w:"100%",h:"100%",bg:"blackAlpha.700",display:"flex",alignItems:"center",justifyContent:"center",children:(0,c.jsx)(v.x,{color:"white",fontWeight:"bold",children:"INACTIVE"})}),isScheduledForFuture(e)&&(0,c.jsxs)(j.xu,{position:"absolute",top:2,left:2,bg:"orange.500",color:"white",px:2,py:1,borderRadius:"md",fontSize:"xs",fontWeight:"bold",display:"flex",alignItems:"center",gap:1,zIndex:5,children:[(0,c.jsx)(y.J,{as:V.Z,boxSize:3}),"SCHEDULED"]}),(0,c.jsx)(j.xu,{position:"absolute",top:2,right:2,onClick:function(e){return e.stopPropagation()},zIndex:10,children:(0,c.jsxs)(S.v,{children:[(0,c.jsx)(w.j,{as:_.h,icon:(0,c.jsx)(y.J,{as:W.Z}),variant:"solid",bg:"rgba(0, 0, 0, 0.8)",color:"white",size:"md",_hover:{bg:"rgba(0, 0, 0, 0.9)"},"aria-label":"Video options"}),(0,c.jsxs)(C.q,{bg:"gray.800",borderColor:"gray.700",minW:"180px",children:[(0,c.jsx)(I.s,{icon:(0,c.jsx)(y.J,{as:H.Z}),onClick:function(t){t.stopPropagation(),handleEdit(e)},bg:"gray.800",color:"white",_hover:{bg:"gray.700"},children:"Edit"}),(0,c.jsx)(I.s,{icon:(0,c.jsx)(y.J,{as:"active"===e.status?M.Z:$.Z}),onClick:function(t){t.stopPropagation(),td(e)},bg:"gray.800",color:"white",_hover:{bg:"gray.700"},children:"active"===e.status?"Deactivate":"Activate"}),(0,c.jsx)(I.s,{icon:(0,c.jsx)(y.J,{as:G.Z}),onClick:function(t){t.stopPropagation(),handleDelete(e)},bg:"gray.800",color:"red.400",_hover:{bg:"red.900",color:"red.300"},children:"Delete"})]})]})})]}),(0,c.jsxs)(x.g,{p:4,align:"flex-start",spacing:2,children:[(0,c.jsxs)(k.U,{justify:"space-between",w:"100%",children:[(0,c.jsx)(v.x,{fontWeight:"bold",color:"white",noOfLines:1,flex:1,children:e.title}
1),(0,c.jsx)(_.h,{icon:(0,c.jsx)(y.J,{as:eq.has(e._id)?q.Z:B.Z}),"aria-label":eq.has(e._id)?"Collapse":"Expand",onClick:function(t){t.stopPropagation(),toggleExpand(e._id)},variant:"ghost",size:"sm",color:"gray.400",_hover:{bg:"gray.700",color:"white"}})]}),(0,c.jsx)(k.U,{justify:"space-between",w:"100%",children:(0,c.jsxs)(v.x,{fontSize:"sm",color:"purple.300",fontWeight:"bold",children:["$",(null===(t=e.price)||void 0===t?void 0:t.toFixed(2))||"0.00"]})}),eq.has(e._id)&&(0,c.jsxs)(x.g,{w:"100%",align:"stretch",spacing:4,pt:4,borderTop:"1px solid",borderColor:"gray.700",children:[(0,c.jsxs)(j.xu,{children:[(0,c.jsx)(v.x,{fontSize:"xs",color:"gray.500",mb:1,children:"Description"}),(0,c.jsx)(v.x,{fontSize:"sm",color:"gray.300",whiteSpace:"pre-wrap",children:e.description||"No description"})]}),(0,c.jsxs)(k.U,{justify:"space-between",flexWrap:"wrap",gap:2,children:[(0,c.jsxs)(j.xu,{children:[(0,c.jsx)(v.x,{fontSize:"xs",color:"gray.500",mb:1,children:"Status"}),(0,c.jsx)(v.x,{fontSize:"sm",color:"active"===e.status?"green.400":"red.400",children:"active"===e.status?"Active":"Inactive"})]}),e.scheduledAt&&(0,c.jsxs)(j.xu,{children:[(0,c.jsx)(v.x,{fontSize:"xs",color:"gray.500",mb:1,children:isScheduledForFuture(e)?"\uD83D\uDCC5 Scheduled For":"\uD83D\uDCC5 Published At"}),(0,c.jsx)(v.x,{fontSize:"sm",color:isScheduledForFuture(e)?"orange.300":"gray.400",children:formatScheduledDate(e.scheduledAt)})]}),(0,c.jsxs)(j.xu,{children:[(0,c.jsx)(v.x,{fontSize:"xs",color:"gray.500",mb:1,children:"Tags"}),(0,c.jsx)(k.U,{spacing:1,flexWrap:"wrap",children:e.tags&&e.tags.length>0?e.tags.slice(0,3).map(function(e,t){return(0,c.jsx)(v.x,{fontSize:"xs",color:"purple.300",bg:"purple.900",px:2,py:1,borderRadius:"sm",children:e},t)}):(0,c.jsx)(v.x,{fontSize:"xs",color:"gray.500",children:"No tags"})})]})]}),(0,c.jsxs)(k.U,{spacing:2,w:"100%",children:[(0,c.jsx)(b.z,{leftIcon:(0,c.jsx)(y.J,{as:H.Z}),colorScheme:"purple",size:"sm",flex:1,onClick:function(t){t.stopPropagation(),handleEdit(e)},children:"Edit Video"}),(0,c.jsx)(b.z,{leftIcon:(0,c.jsx)(y.J,{as:"active"===e.status?M.Z:$.Z}),variant:"outline",colorScheme:"active"===e.status?"red":"green",size:"sm",onClick:function(t){t.stopPropagation(),td(e)},children:"active"===e.status?"Deactivate":"Activate"})]})]})]})]},e._id)})}),(0,c.jsx)(F.i,{my:8,borderColor:"gray.700"}),(0,c.jsxs)(k.U,{justify:"space-between",w:"100%",children:[(0,c.jsx)(v.x,{fontSize:"xl",fontWeight:"bold",color:"white",children:"Photos"}),(0,c.jsx)(b.z,{colorScheme:"purple",size:"sm",onClick:function(){return en.push("/manage-photos")},children:"Manage Photos"})]}),ef?(0,c.jsx)(p.M,{minH:"200px",children:(0,c.jsx)(g.$,{size:"lg",color:"purple.500"})}):0===eg.length?(0,c.jsx)(p.M,{minH:"200px",children:(0,c.jsx)(v.x,{color:"gray.400",children:"No photos yet."})}):(0,c.jsx)(f.M,{columns:[2,3,4],spacing:4,w:"100%",children:eg.map(function(e){return(0,c.jsxs)(j.xu,{position:"relative",bg:"gray.700",borderRadius:"md",overflow:"hidden",cursor:"pointer",_hover:{opacity:.85},onClick:function(){return handlePhotoClick(e)},children:[(0,c.jsx)(m.E,{src:e.filePath,alt:e.title||"Photo",w:"100%",h:"200px",objectFit:"cover"}),(0,c.jsxs)(x.g,{p:2,align:"flex-start",spacing:1,bg:"gray.800",children:[(0,c.jsx)(v.x,{fontSize:"sm",color:"white",noOfLines:1,fontWeight:"semibold",children:e.title||"Untitled"}),!e.isFree&&(0,c.jsxs)(v.x,{fontSize:"xs",color:"yellow.300",children:["$","number"==typeof e.price?e.price.toFixed(2):parseFloat(e.price||"0").toFixed(2)]}),e.isFree&&e.subscribersOnly&&(0,c.jsx)(v.x,{fontSize:"xs",color:"pink.300",children:"Subs Only"})]})]},e._id)})}),(0,c.jsxs)(z.u_,{isOpen:eA,onClose:eN,size:"xl",children:[(0,c.jsx)(D.Z,{}),(0,c.jsxs)(O.h,{bg:"gray.900",color:"white",children:[(0,c.jsx)(U.x,{children:"Edit Photo"}),(0,c.jsx)(R.o,{}),(0,c.jsx)(A.f,{children:e_&&(0,c.jsxs)(x.g,{spacing:4,children:[(0,c.jsx)(m.E,{src:e_.filePath,alt:e_.title||"Photo",maxH:"400px",objectFit:"contain",w:"100%"}),(0,c.jsxs)(L.NI,{children:[(0,c.jsx)(N.l,{children:"Title"}),(0,c.jsx)(E.I,{value:e_.title||"",onChange:function(e){return eC((0,o._)((0,n._)({},e_),{title:e.target.value}))},bg:"gray.800",borderColor:"gray.700"})]}),(0,c.jsxs)(L.NI,{children:[(0,c.jsx)(N.l,{children:"Description"}),(0,c.jsx)(P.g,{value:e_.description||"",onChange:function(e){return eC((0,o._)((0,n._)({},e_),{description:e.target.value}))},bg:"gray.800",borderColor:"gray.700"})]}),(0,c.jsxs)(L.NI,{display:"flex",alignItems:"center",children:[(0,c.jsx)(N.l,{mb:0,children:"Free Photo"}),(0,c.jsx)(Z.r,{isChecked:!!e_.isFree,onChange:function(e){return eC((0,o._)((0,n._)({},e_),{isFree:e.target.checked,price:e.target.checked?0:e_.price,subscribersOnly:!!e.target.checked&&e_.subscribersOnly}))},colorScheme:"green"})]}),e_.isFree&&(0,c.jsxs)(L.NI,{display:"flex",alignItems:"center",children:[(0,c.jsx)(N.l,{mb:0,children:"Subscribers Only"}),(0,c.jsx)(Z.r,{isChecked:!!e_.subscribersOnly,onChange:function(e){return eC((0,o._)((0,n._)({},e_),{subscribersOnly:e.target.checked}))},colorScheme:"pink"})]}),e_.isFree&&e_.subscribersOnly&&(0,c.jsx)(v.x,{fontSize:"xs",color:"pink.300",fontStyle:"italic",children:"Only your subscribers can view this photo for free"}),!e_.isFree&&(0,c.jsxs)(L.NI,{children:[(0,c.jsx)(N.l,{children:"Price (USD)"}),(0,c.jsx)(E.I,{type:"number",step:"0.01",min:"0",value:e_.price||0,onChange:function(e){return eC((0,o._)((0,n._)({},e_),{price:parseFloat(e.target.value)||0}))},placeholder:"0.00",bg:"gray.800",borderColor:"gray.700"})]}),(0,c.jsxs)(L.NI,{display:"flex",alignItems:"center",children:[(0,c.jsx)(N.l,{mb:0,children:"Show In Feed"}),(0,c.jsx)(Z.r,{isChecked:!!e_.showInFeed,onChange:function(e){return eC((0,o._)((0,n._)({},e_),{showInFeed:e.target.checked}))},colorScheme:"purple"})]}),(0,c.jsxs)(L.NI,{display:"flex",alignItems:"center",children:[(0,c.jsx)(N.l,{mb:0,children:"Show In Gallery"}),(0,c.jsx)(Z.r,{isChecked:!!e_.showInGallery,onChange:function(e){return eC((0,o._)((0,n._)({},e_),{showInGallery:e.target.checked}))},colorScheme:"purple"})]})]})}),(0,c.jsxs)(T.m,{children:[(0,c.jsx)(b.z,{variant:"ghost",mr:3,onClick:eN,children:"Cancel"}),(0,c.jsx)(b.z,{colorScheme:"purple",onClick:tc,isLoading:eV,children:"Save"})]})]})]}),(0,c.jsxs)(z.u_,{isOpen:eD,onClose:eU,size:"xl",children:[(0,c.jsx)(D.Z,{}),(0,c.jsxs)(O.h,{bg:"gray.900",color:"white",children:[(0,c.jsx)(U.x,{children:"Edit Video"}),(0,c.jsx)(R.o,{}),(0,c.jsx)(A.f,{children:(0,c.jsxs)(x.g,{spacing:4,children:[(0,c.jsxs)(L.NI,{children:[(0,c.jsx)(N.l,{children:"Title"}),(0,c.jsx)(E.I,{value:(null==ey?void 0:ey.title)||"",onChange:function(e){return eS((0,o._)((0,n._)({},ey),{title:e.target.value}))},bg:"gray.800",borderColor:"gray.700"})]}),(0,c.jsxs)(L.NI,{children:[(0,c.jsx)(N.l,{children:"Description"}),(0,c.jsx)(P.g,{value:(null==ey?void 0:ey.description)||"",onChange:function(e){return eS((0,o._)((0,n._)({},ey),{description:e.target.value}))},bg:"gray.800",borderColor:"gray.700",rows:4})]}),(0,c.jsxs)(L.NI,{children:[(0,c.jsx)(N.l,{children:"Price ($)"}),(0,c.jsx)(E.I,{type:"number",step:"0.01",value:(null==ey?void 0:ey.price)||"",onChange:function(e){return eS((0,o._)((0,n._)({},ey),{price:e.target.value}))},bg:"gray.800",borderColor:"gray.700"})]}),(0,c.jsxs)(L.NI,{display:"flex",alignItems:"center",children:[(0,c.jsx)(N.l,{mb:0,children:"Active"}),(0,c.jsx)(Z.r,{isChecked:(null==ey?void 0:ey.status)==="active",onChange:function(e){return eS((0,o._)((0,n._)({},ey),{status:e.target.checked?"active":"inactive"}))},colorScheme:"purple"})]}),(0,c.jsx)(F.i,{borderColor:"gray.700"}),(0,c.jsxs)(j.xu,{w:"100%",p:4,bg:"gray.800",borderRadius:"md",border:"1px solid",borderColor:"gray.700",children:[(0,c.jsxs)(k.U,{mb:3,children:[(0,c.jsx)(y.J,{as:V.Z,color:"orange.400"}),(0,c.jsx)(v.x,{fontWeight:"bold",color:"white",children:"Schedule Release"})]}),(0,c.jsxs)(L.NI,{display:"flex",alignItems:"center",mb:3,children:[(0,c.jsx)(N.l,{mb:0,children:"Enable Scheduling"}),(0,c.jsx)(Z.r,{isChecked:!!(null==ey?void 0:ey.scheduledAt),onChange:function(e){if(e.target.checked){var t=new Date;t.setDate(t.getDate()+1),t.setHours(12,0,0,0),eS((0,o._)((0,n._)({},ey),{scheduledAt:t.toISOString(),isSchedule:!0}))}else eS((0,o._)((0,n._)({},ey),{scheduledAt:null,isSchedule:!1}))},colorScheme:"orange"})]}),(null==ey?void 0:ey.scheduledAt)&&(0,c.jsxs)(L.NI,{children:[(0,c.jsx)(N.l,{fontSize:"sm",children:"Release Date & Time"}),(0,c.jsx)(E.I,{type:"datetime-local",value:ey.scheduledAt?new Date(ey.scheduledAt).toISOString().slice(0,16):"",min:new Date().toISOString().slice(0,16),onChange:function(e){var t=e.target.value?new Date(e.target.value).toISOString():null;eS((0,o._)((0,n._)({},ey),{scheduledAt:t,isSchedule:!!t}))},bg:"gray.700",borderColor:"gray.600",_hover:{borderColor:"orange.400"}}),isScheduledForFuture(ey)&&(0,c.jsxs)(v.x,{fontSize:"xs",color:"orange.300",mt:2,children:["⏰ This video will be hidden until ",formatScheduledDate(ey.scheduledAt)]}),ey.scheduledAt&&!isScheduledForFuture(ey)&&(0,c.jsx)(v.x,{fontSize:"xs",color:"green.300",mt:2,children:"✅ Scheduled time has passed - video is visible"})]})]}),(0,c.jsx)(F.i,{borderColor:"gray.700"}),(0,c.jsxs)(L.NI,{children:[(0,c.jsx)(N.l,{children:"Replace Video"}),(0,c.jsxs)(x.g,{spacing:2,align:"flex-start",children:[e7&&(0,c.jsxs)(j.xu,{children:[(0,c.jsx)(v.x,{fontSize:"xs",color:"gray.400",mb:1,children:"New video preview:"}),(0,c.jsx)("video",{src:e7,controls:!0,style:{maxWidth:"100%",maxHeight:"200px",borderRadius:"8px"}})]}),(0,c.jsx)(E.I,{type:"file",accept:"video/*",onChange:function(e){var t,r=null===(t=e.target.files)||void 0===t?void 0:t[0];r&&(eX(r),e8(URL.createObjectURL(r)))},bg:"gray.800",borderColor:"gray.700",p:1}),(0,c.jsx)(v.x,{fontSize:"xs",color:"gray.500",children:"Leave empty to keep current video"})]})]}),(0,c.jsxs)(L.NI,{children:[(0,c.jsx)(N.l,{children:"Replace preview clip (optional)"}),(0,c.jsxs)(x.g,{spacing:2,align:"flex-start",children:[e6&&(0,c.jsxs)(j.xu,{children:[(0,c.jsx)(v.x,{fontSize:"xs",color:"gray.400",mb:1,children:"New teaser preview:"}),(0,c.jsx)("video",{src:e6,controls:!0,style:{maxWidth:"100%",maxHeight:"200px",borderRadius:"8px"}})]}),(0,c.jsx)(E.I,{type:"file",accept:"video/*",onChange:function(e){var t,r=null===(t=e.target.files)||void 0===t?void 0:t[0];r&&(e1(r),te(URL.createObjectURL(r)))},bg:"gray.800",borderColor:"gray.700",p:1}),(0,c.jsx)(v.x,{fontSize:"xs",color:"gray.500",children:"Leave empty to keep current teaser"})]})]}),(0,c.jsxs)(L.NI,{children:[(0,c.jsx)(N.l,{children:"Replace Thumbn
1ail"}),(0,c.jsxs)(x.g,{spacing:2,align:"flex-start",children:[tr&&(0,c.jsxs)(j.xu,{children:[(0,c.jsx)(v.x,{fontSize:"xs",color:"gray.400",mb:1,children:"New thumbnail preview:"}),(0,c.jsx)(m.E,{src:tr,alt:"Thumbnail preview",maxH:"200px",borderRadius:"md"})]}),(0,c.jsx)(E.I,{type:"file",accept:"image/*",onChange:function(e){var t,r=null===(t=e.target.files)||void 0===t?void 0:t[0];r&&(e4(r),ti(URL.createObjectURL(r)))},bg:"gray.800",borderColor:"gray.700",p:1}),(0,c.jsx)(v.x,{fontSize:"xs",color:"gray.500",children:"Leave empty to keep current thumbnail"})]})]})]})}),(0,c.jsx)(T.m,{children:(0,c.jsxs)(x.g,{w:"100%",spacing:3,align:"stretch",children:[eV&&to>0&&(0,c.jsxs)(j.xu,{w:"100%",children:[(0,c.jsxs)(k.U,{justify:"space-between",mb:1,children:[(0,c.jsx)(v.x,{fontSize:"sm",color:"gray.400",children:"Uploading..."}),(0,c.jsxs)(v.x,{fontSize:"sm",color:"gray.400",fontWeight:"bold",children:[to,"%"]})]}),(0,c.jsx)(J.E,{value:to,colorScheme:"purple",size:"sm",borderRadius:"md"})]}),(0,c.jsxs)(k.U,{justify:"flex-end",w:"100%",children:[(0,c.jsx)(b.z,{variant:"ghost",onClick:eU,isDisabled:eV,children:"Cancel"}),(0,c.jsx)(b.z,{colorScheme:"purple",onClick:tu,isLoading:eV,children:"Save Changes"})]})]})})]})]}),(0,c.jsxs)(z.u_,{isOpen:eP,onClose:eT,children:[(0,c.jsx)(D.Z,{}),(0,c.jsxs)(O.h,{bg:"gray.900",color:"white",children:[(0,c.jsx)(U.x,{children:"Delete Video"}),(0,c.jsx)(R.o,{}),(0,c.jsx)(A.f,{children:(0,c.jsxs)(v.x,{children:['Are you sure you want to delete "',null==ey?void 0:ey.title,'"? This action cannot be undone.']})}),(0,c.jsxs)(T.m,{children:[(0,c.jsx)(b.z,{variant:"ghost",mr:3,onClick:eT,children:"Cancel"}),(0,c.jsx)(b.z,{colorScheme:"red",onClick:th,isLoading:eM,children:"Delete"})]})]})]})]})}}}]);

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.