PageSourceSearch

https://joyfun.video/_next/static/chunks/e8b1166609f0f16f.js

js joyfun.video collected 2026-10-04 15:30:12 UTC 78,603 bytes, 12 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,244714,757819,850372,88161,201560,e=>{"use strict";function t(e){return!e||e.isFree?["png"]:"starter"===e.id||"basic"===e.id||"lite"===e.id?["png","jpg"]:["png","jpg","webp"]}async function a(e,t,a){try{try{let r=await fetch(e,{mode:"cors"});if(!r.ok)throw Error("Download failed");let i=await r.blob(),s=URL.createObjectURL(i),l=document.createElement("a");l.href=s,l.download=t,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(s),a?.onSuccess?.()}catch(o){console.warn("Direct download failed, falling back to proxy:",o);let r=`/api/download?url=${encodeURIComponent(e)}`,i=await fetch(r);if(!i.ok)throw Error("Download failed");let s=await i.blob(),l=URL.createObjectURL(s),n=document.createElement("a");n.href=l,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(l),a?.onSuccess?.()}}catch(t){let e=t instanceof Error?t:Error("Failed to download image");throw console.error("Failed to download image:",e),a?.onError?.(e),e}}async function r(e){let t=`/api/download?url=${encodeURIComponent(e)}`,a=await fetch(t);if(!a.ok)throw Error(`Failed to fetch image via proxy: ${e}`);return a.blob()}async function i(e){let t;if(e.startsWith("data:image/"))t=e;else{let a;try{let t=await fetch(e,{mode:"cors"});if(!t.ok)throw Error(`Failed to fetch image: ${e}`);a=await t.blob()}catch(t){console.warn("Direct download failed, falling back to proxy:",t),a=await r(e)}t=URL.createObjectURL(a)}return new Promise((a,r)=>{let i=new Image;i.onload=()=>{a({url:t,width:i.width,height:i.height})},i.onerror=()=>{e.startsWith("data:image/")||URL.revokeObjectURL(t),r(Error(`Failed to load image: ${e}`))},i.src=t})}async function s(e,t,a="png"){let r=[];try{let[s,n]=await Promise.all([Promise.all(e.map(i)),i(t)]);s.forEach(e=>{e.url.startsWith("blob:")&&r.push(e.url)}),n.url.startsWith("blob:")&&r.push(n.url);let o=function(e,t,a){let r=a.height/a.width;if(1===e){let e=t[0].height/t[0].width,a=Math.floor(1652),i=a*r/e,s=i+20+a,l=a,n=i;if(s>2360){let e=2360/s;l=a*e,n=i*e}let o=l*r,d=n*e;return{layout:"horizontal",canvasWidth:20+n+20+l+20,canvasHeight:20+Math.max(d,o)+20,referenceWidth:n,referenceHeights:[d],generatedWidth:l,generatedHeight:o,spacing:20,padding:20}}if(r<1){let a=2360*r;if(2===e){let e=t.map(e=>e.height/e.width),r=2340/(1/e[0]+1/e[1]),i=r/e[0],s=r/e[1];return{layout:"vertical",canvasWidth:2400,canvasHeight:20+r+20+a+20,referenceSize:void 0,referenceWidths:[i,s],referenceHeights:[r,r],referenceCols:2,referenceRows:1,generatedWidth:2360,generatedHeight:a,spacing:20,padding:20}}let i=Math.ceil(e/2),s=Math.floor(1170),l=t.map(e=>s*(e.height/e.width)),n=Math.max(...l)*i+20*(i+1),o=n;if(n>.4*a){let e=.4*a/n;o=n*e;for(let t=0;t<l.length;t++)l[t]*=e}return{layout:"vertical",canvasWidth:2400,canvasHeight:20+o+20+a+20,referenceSize:s,referenceHeights:l,referenceCols:2,referenceRows:i,generatedWidth:2360,generatedHeight:a,spacing:20,padding:20}}if(2===e){let e=t.map(e=>e.height/e.width),a=Math.floor(708),i=a*e[0],s=a*e[1],l=2360-a-20,n=l*r;if(i+s+20<=n)return{layout:"horizontal",canvasWidth:20+a+20+l+20,canvasHeight:20+n+20,referenceWidth:a,referenceHeights:[i,s],generatedWidth:l,generatedHeight:n,spacing:20,padding:20};let o=.4*n,d=o/e[0],c=o/e[1],u=d+c+20;if(u<=944){let e=2360-u-20,t=e*r;return{layout:"horizontal",canvasWidth:20+u+20+e+20,canvasHeight:20+Math.max(o,t)+20,referenceWidth:void 0,referenceWidths:[d,c],referenceHeights:[o,o],referenceCols:2,referenceRows:1,generatedWidth:e,generatedHeight:t,spacing:20,padding:20}}let h=708/u,m=o*h,g=d*h,f=c*h,p=g+f+20,x=2360-p-20,w=x*r;return{layout:"horizontal",canvasWidth:20+p+20+x+20,canvasHeight:20+Math.max(m,w)+20,referenceWidth:void 0,referenceWidths:[g,f],referenceHeights:[m,m],referenceCols:2,referenceRows:1,generatedWidth:x,generatedHeight:w,spacing:20,padding:20}}let i=Math.floor(708),s=t.map(e=>i*(e.height/e.width)),l=s.reduce((e,t)=>e+t,0)+20*(e-1),n=2360-i-20,o=n*r,d=l;if(l>o){let e=o/l;d=l*e;for(let t=0;t<s.length;t++)s[t]*=e}return{layout:"horizontal",canvasWidth:20+i+20+n+20,canvasHeight:20+Math.max(d,o)+20,referenceWidth:i,referenceHeights:s,generatedWidth:n,generatedHeight:o,spacing:20,padding:20}}(s.length,s,n),d=document.createElement("canvas");d.width=o.canvasWidth,d.height=o.canvasHeight;
1let c=d.getContext("2d");if(!c)throw Error("Failed to get canvas context");c.fillStyle="#ffffff",c.fillRect(0,0,d.width,d.height);let u=o.padding||20;if("horizontal"===o.layout)if(o.referenceWidths){let e=o.referenceWidths,t=o.referenceHeights,a=Math.max(...t),r=e.reduce((e,t)=>e+t,0)+o.spacing*(e.length-1),i=u,d=u+(a-Math.max(...t))/2;for(let r=0;r<s.length;r++){let n=await l(s[r].url),u=e[r],h=t[r],m=d+(a-h)/2;c.drawImage(n,i,m,u,h),i+=u+o.spacing}let h=await l(n.url),m=u+r+o.spacing;c.drawImage(h,m,u,o.generatedWidth,o.generatedHeight)}else{let e=u;for(let t=0;t<s.length;t++){let a=await l(s[t].url),r=o.referenceHeights[t],i=o.referenceWidth;c.drawImage(a,u,e,i,r),e+=r+o.spacing}let t=await l(n.url),a=u+o.referenceWidth+o.spacing;c.drawImage(t,a,u,o.generatedWidth,o.generatedHeight)}else{let e;if(o.referenceWidths){let e=o.referenceWidths,t=o.referenceHeights;if(2===o.referenceCols){let a=Math.max(...t),r=e.reduce((e,t)=>e+t,0)+o.spacing,i=(d.width-r)/2;for(let r=0;r<s.length;r++){let n=await l(s[r].url),d=e[r],h=t[r],m=u+(a-h)/2;c.drawImage(n,i,m,d,h),i+=d+o.spacing}}else if(1===o.referenceCols){let a=u,r=e[0];for(let e=0;e<s.length;e++){let i=await l(s[e].url),n=t[e],u=(d.width-r)/2;c.drawImage(i,u,a,r,n),a+=n+o.spacing}}}else for(let e=0;e<s.length;e++){let t=Math.floor(e/o.referenceCols),a=e%o.referenceCols,r=await l(s[e].url),i=u+o.spacing+a*(o.referenceSize+o.spacing),n=u+o.spacing+t*(Math.max(...o.referenceHeights)+o.spacing),d=o.referenceHeights[e],h=o.referenceSize;c.drawImage(r,i,n,h,d)}let t=await l(n.url);e=o.referenceWidths?2===o.referenceCols?Math.max(...o.referenceHeights):o.referenceHeights.reduce((e,t)=>e+t,0)+o.spacing*(o.referenceRows-1):o.referenceRows*Math.max(...o.referenceHeights)+o.spacing*(o.referenceRows+1);let a=(d.width-o.generatedWidth)/2,r=u+e+o.spacing;c.drawImage(t,a,r,o.generatedWidth,o.generatedHeight)}let h=await new Promise((e,t)=>{let r,i;switch(a){case"png":default:r="image/png",i=void 0;break;case"jpg":r="image/jpeg",i=.92;break;case"webp":r="image/webp",i=.85}d.toBlob(r=>{r?e(r):"png"!==a?d.toBlob(a=>{a?e(a):t(Error("Failed to create blob"))},"image/png"):t(Error("Failed to create blob"))},r,i)});return r.forEach(e=>{URL.revokeObjectURL(e)}),h}catch(e){throw r.forEach(e=>{URL.revokeObjectURL(e)}),console.error("Failed to create comparison image:",e),e}}function l(e){return new Promise((t,a)=>{let r=new Image;r.onload=()=>t(r),r.onerror=()=>a(Error(`Failed to load image: ${e}`)),r.src=e})}function n(e,t){let a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}async function o(e){let t=`/api/download?url=${encodeURIComponent(e)}`,a=await fetch(t);if(!a.ok)throw Error(`Failed to fetch image via proxy: ${e}`);return a.blob()}async function d(e){let t;if(e.startsWith("data:image/"))return e;try{let a=await fetch(e,{mode:"cors"});if(!a.ok)throw Error(`Failed to fetch image: ${e}`);t=await a.blob()}catch(a){console.warn("Direct download failed, falling back to proxy:",a),t=await o(e)}return URL.createObjectURL(t)}async function c(e,t){let a=null;try{var r;a=await d(e);let i=await (r=a,new Promise((e,t)=>{let a=new Image;a.onload=()=>e(a),a.onerror=()=>t(Error(`Failed to load image: ${r}`)),a.src=r})),s=document.createElement("canvas");s.width=i.width,s.height=i.height;let l=s.getContext("2d");if(!l)throw Error("Failed to get canvas context");return l.drawImage(i,0,0),await new Promise((e,a)=>{let r,i;switch(t){case"png":default:r="image/png",i=void 0;break;case"jpg":r="image/jpeg",i=.92;break;case"webp":r="image/webp",i=.85}s.toBlob(r=>{r?e(r):"png"!==t?s.toBlob(t=>{t?e(t):a(Error("Failed to create blob"))},"image/png"):a(Error("Failed to create blob"))},r,i)})}catch(e){throw console.error("Failed to convert image format:",e),e}finally{a&&!a.startsWith("data:image/")&&URL.revokeObjectURL(a)}}e.s(["getAvailableFormats",()=>t],244714),e.s(["downloadImage",()=>a],757819),e.s(["createComparisonImage",()=>s,"downloadBlob",()=>n],850372),e.s(["convertImageFormat",()=>c],88161);var u=e.i(119584),h=e.i(658637),m=e.i(868499),g=e.i(519455),f=e.i(975157),p=e.i(429110),x=e.i(561980),w=e.i(807889),v=e.i(622989),b=e.i(637667);function j({workId:e,workTitle:t,onDeleteSuccess:a,variant:r="destructive",size:i="lg",className:s}){let l=(0,x.useTranslations)("WorksPage.delete"),[n,o]=(0,v.useState)(!1),[d,c]=(0,v.useState)(!1),j=(0,w.useRouter)(),y=async()=>{o(!0);try{let t=await (0,h.deleteWork)(e);t.success?(b.toast.success(l("toast.success")),c(!1),a?a():(j.push("/my-works"),j.refresh())
1):b.toast.error(t.error||l("toast.error"))}catch(e){console.error("Failed to delete work:",e),b.toast.error(l("toast.errorGeneric"))}finally{o(!1)}};return(0,u.jsxs)(m.AlertDialog,{open:d,onOpenChange:c,children:[(0,u.jsx)(m.AlertDialogTrigger,{asChild:!0,children:(0,u.jsxs)(g.Button,{variant:r,size:i,className:s,children:[(0,u.jsx)(p.Trash2,{className:(0,f.cn)("mr-2","sm"===i?"h-3 w-3":"h-4 w-4")}),l("button")]})}),(0,u.jsxs)(m.AlertDialogContent,{children:[(0,u.jsxs)(m.AlertDialogHeader,{children:[(0,u.jsx)(m.AlertDialogTitle,{children:l("dialog.title")}),(0,u.jsx)(m.AlertDialogDescription,{children:t?l("dialog.description",{workTitle:t}):l("dialog.descriptionNoTitle")})]}),(0,u.jsxs)(m.AlertDialogFooter,{children:[(0,u.jsx)(m.AlertDialogCancel,{disabled:n,children:l("dialog.cancel")}),(0,u.jsx)(m.AlertDialogAction,{onClick:e=>{e.preventDefault(),y()},disabled:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:n?l("dialog.deleting"):l("dialog.confirm")})]})]})]})}e.s(["DeleteWorkButton",()=>j],201560)},908406,e=>{"use strict";var t=e.i(622989);let a=0,r=new Map,i=e=>{if(r.has(e))return;let t=setTimeout(()=>{r.delete(e),n({type:"REMOVE_TOAST",toastId:e})},1e6);r.set(e,t)},s=[],l={toasts:[]};function n(e){l=((e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?i(a):e.toasts.forEach(e=>{i(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===a||void 0===a?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}})(l,e),s.forEach(e=>{e(l)})}function o({...e}){let t=(a=(a+1)%Number.MAX_SAFE_INTEGER).toString(),r=()=>n({type:"DISMISS_TOAST",toastId:t});return n({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:e=>n({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function d(){let[e,a]=t.useState(l);return t.useEffect(()=>(s.push(a),()=>{let e=s.indexOf(a);e>-1&&s.splice(e,1)}),[e]),{...e,toast:o,dismiss:e=>n({type:"DISMISS_TOAST",toastId:e})}}e.s(["useToast",()=>d])},288314,e=>{"use strict";let t=(0,e.i(360229).default)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);e.s(["default",()=>t])},898760,e=>{"use strict";var t=e.i(288314);e.s(["Wand2",()=>t.default])},962777,695909,e=>{"use strict";let t=(0,e.i(360229).default)("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);e.s(["default",()=>t],695909),e.s(["Share2",()=>t],962777)},236772,791542,629298,e=>{"use strict";var t=e.i(119584),a=e.i(341093),r=e.i(360229);let i=(0,r.default)("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);e.s(["default",()=>i],791542);var s=e.i(962777);let l=(0,r.default)("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);e.s(["default",()=>l],629298);var n=e.i(622989);function o({pageTitle:e,pageUrl:r,shareLabel:o,linkCopiedText:d,compact:c=!1}){let[u,h]=(0,n.useState)(!1),[m,g]=(0,n.useState)(!1);(0,n.useEffect)(()=>{g(!0)},[]);let f=m?{twitter:`https://twitter.com/intent/tweet?text=${encodeURIComponent(e)}&url=${encodeURIComponent(r)}`,facebook:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(r)}
1`,whatsapp:`https://api.whatsapp.com/send?text=${encodeURIComponent(e+" "+r)}`,linkedin:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(r)}`,reddit:`https://www.reddit.com/submit?url=${encodeURIComponent(r)}&title=${encodeURIComponent(e)}`,pinterest:`https://pinterest.com/pin/create/button/?url=${encodeURIComponent(r)}&description=${encodeURIComponent(e)}`,telegram:`https://t.me/share/url?url=${encodeURIComponent(r)}&text=${encodeURIComponent(e)}`}:{twitter:"#",facebook:"#",whatsapp:"#",linkedin:"#",reddit:"#",pinterest:"#",telegram:"#"},p=()=>{navigator.clipboard.writeText(r).then(()=>{h(!0),setTimeout(()=>h(!1),2e3)})};return c?(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-1.5 py-2",children:[(0,t.jsx)("a",{href:f.twitter,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-6 w-6 items-center justify-center rounded-full bg-[#1DA1F2] text-white transition-colors","aria-label":"Share on Twitter",children:(0,t.jsx)(l,{className:"h-3 w-3"})}),(0,t.jsx)("a",{href:f.facebook,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-6 w-6 items-center justify-center rounded-full bg-[#1877F2] text-white transition-colors","aria-label":"Share on Facebook",children:(0,t.jsx)(i,{className:"h-3 w-3"})}),(0,t.jsx)("a",{href:f.whatsapp,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-6 w-6 items-center justify-center rounded-full bg-[#25D366] text-white transition-colors","aria-label":"Share on WhatsApp",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:(0,t.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})})}),(0,t.jsx)("a",{href:f.linkedin,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-6 w-6 items-center justify-center rounded-full bg-[#0A66C2] text-white transition-colors","aria-label":"Share on LinkedIn",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:(0,t.jsx)("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})}),(0,t.jsx)("a",{href:f.reddit,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-6 w-6 items-center justify-center rounded-full bg-[#FF4500] text-white transition-colors","aria-label":"Share on Reddit",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:(0,t.jsx)("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})})}),(0,t.jsx)("a",{href:f.pinterest,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-6 w-6 items-center justify-center rounded-full bg-[#BD081C] text-white transition-colors","aria-label":"Share on Pinterest",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,t.jsx)("path",{d:"M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.162-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.663.967-2.911 2.168-2.911 1.024 0 1.518.769 1.518 1.688 0 1.029-.653 2.567-.992 3.992-.285 1.193.6 2.165 1.775 2.165 2.128 0 3.768-2.245 3.768-5.487 0-2.861-2.063-4.869-5.008-4.869-3.41 0-5.409 2.562-5.409 5.199 0 1.033.394 2.143.889 2.741.099.12.112.225.085.345-.09.375-.293 1.199-.334 1.363-.053.225-.172.271-.401.165-1.495-.69-2.433-2.878-2.433-4.646 0-3.776 2.748-7.252 7.92-7.252 4.158 0 7.392 2.967 7.392 6.923 0 4.135-2.607 7.462-6.233 7.462-1.214 0-2.354-.629-2.758-1.379l-.749 2.848c-.269 1.045-1.004 2.352-1.498 3.146 1.123.345 2.306.535 3.55.535 6.607 0 11.985-5.365 11.985-11.987C23.97 5.39 18.592.026 11.985.026L12.017 0z"})})}),(0,t.jsx)("a",{href:f.telegram,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-6 w-6 items-center justify-center rounded-full bg-[#0088cc] text-white transition-colors","aria-label":"Share on Telegram",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:(0,t.jsx)("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.365.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.96 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})})}),(0,t.jsx)("button",{type:"button",className:"bg-primary/10 text-primary hover:bg-primary/20 inline-flex h-6 w-6 items-center justify-center rounded-full transition-colors","aria-label":"Copy link",onClick:p,children:(0,t.jsx)(a.Copy,{className:"h-3 w-3"})}),u&&(0,t.jsx)("span",{className:"text-primary ml-2 text-xs",children:d})]}):(0,t.jsxs)("div",{className:"panel glass-strong mb-8 p-4",children:[(0,t.jsx)("div",{className:"mb-2 flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(s.Share2,{className:"text-muted-foreground h-5 w-5"}),(0,t.jsx)("span",{className:"font-medium",children:o})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("a",{href:f.twitter,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-8 w-8 items-center justify-center rounded-full bg-[#1DA1F2] text-white transition-colors","aria-label":"Share on Twitter",children:(0,t.jsx)(l,{className:"h-4 w-4"})}),(0,t.jsx)("a",{href:f.facebook,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-8 w-8 items-center justify-center rounded-full bg-[#1877F2] text-white transition-colors","aria-label":"Share on Facebook",children:(0,t.jsx)(i,{className:"h-4 w-4"})}),(0,t.jsx)("a",{href:f.whatsapp,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-8 w-8 items-center justify-center rounded-full bg-[#25D366] text-white transition-colors","aria-label":"Share on WhatsApp",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:(0,t.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})})}),(0,t.jsx)("a",{href:f.linkedin,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-8 w-8 items-center justify-center rounded-full bg-[#0A66C2] text-white transition-colors","aria-label":"Share on LinkedIn",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,t.jsx)("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})}),(0,t.jsx)("a",{href:f.reddit,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-8 w-8 items-center justify-center rounded-full bg-[#FF4500] text-white transition-colors","aria-label":"Share on Reddit",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:(0,t.jsx)("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})})}),(0,t.jsx)("a",{href:f.pinterest,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-8 w-8 items-center justify-center rounded-full bg-[#BD081C] text-white transition-colors","aria-label":"Share on Pinterest",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:(0,t.jsx)("path",{d:"M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.162-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.663.967-2.911 2.168-2.911 1.024 0 1.518.769 1.518 1.688 0 1.029-.653 2.567-.992 3.992-.285 1.193.6 2.165 1.775 2.165 2.128 0 3.768-2.245 3.768-5.487 0-2.861-2.063-4.869-5.008-4.869-3.41 0-5.409 2.562-5.409 5.199 0 1.033.394 2.143.889 2.741.099.12.112.225.085.345-.09.375-.293 1.199-.334 1.363-.053.225-.172.271-.401.165-1.495-.69-2.433-2.878-2.433-4.646 0-3.776 2.748-7.252 7.92-7.252 4.158 0 7.392 2.967 7.392 6.923 0 4.135-2.607 7.462-6.233 7.462-1.214 0-2.354-.629-2.758-1.379l-.749 2.848c-.269 1.045-1.004 2.352-1.498 3.146 1.123.345 2.306.535 3.55.535 6.607 0 11.985-5.365 11.985-11.987C23.97 5.39 18.592.026 11.985.026L12.017 0z"})})}),(0,t.jsx)("a",{href:f.telegram,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-opacity-90 inline-flex h-8 w-8 items-center justify-center rounded-full bg-[#0088cc] text-white transition-colors","aria-label":"Share on Telegram",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:(0,t.jsx)("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.365.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.96 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})})}),(0,t.jsx)("button",{type:"button",className:"bg-primary/10 text-primary hover:bg-primary/20 inline-flex h-8 w-8 items-center justify-center rounded-full transition-colors","aria-label":"Copy link",onClick:p,children:(0,t.jsx)(a.Copy,{className:"h-4 w-4"})})]}),u&&(0,t.jsx)("div",{className:"text-primary mt-2 text-center text-xs",children:d})]})}e.s(["default",()=>o],236772)},168148,e=>{"use strict";var t=e.i(119584),a=e.i(622989),r=e.i(669122),i=e.i(609732),s="Progress",[l,n]=(0,r.createContextScope)(s),[o,d]=l(s),c=a.forwardRef((e,a)=>{var r,s;let{__scopeProgress:l,value:n=null,max:d,getValueLabel:c=m,...u}=e;(d||0===d)&&!p(d)&&console.error((r=`${d}`,`Invalid prop \`max\` of value \`${r}\` supplied to \`Progress\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`));let h=p(d)?d:100;null===n||x(n,h)||console.error((s=`${n}`,`Invalid prop \`value\` of value \`${s}\` supplied to \`Progress\`. The \`value\` prop must be:
2  - a positive number
3  - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
4  - \`null\` or \`undefined\` if the progress is indeterminate.
5
6Defaulting to \`null\`.`));let w=x(n,h)?n:null,v=f(w)?c(w,h):void 0;return(0,t.jsx)(o,{scope:l,value:w,max:h,children:(0,t.jsx)(i.Primitive.div,{"aria-valuemax":h,"aria-valuemin":0,"aria-valuenow":f(w)?w:void 0,"aria-valuetext":v,role:"progressbar","data-state":g(w,h),"data-value":w??void 0,"data-max":h,...u,ref:a})})});c.displayName=s;var u="ProgressIndicator",h=a.forwardRef((e,a)=>{let{__scopeProgress:r,...s}=e,l=d(u,r);return(0,t.jsx)(i.Primitive.div,{"data-state":g(l.value,l.max),"data-value":l.value??void 0,"data-max":l.max,...s,ref:a})});function m(e,t){return`${Math.round(e/t*100)}%`}function g(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function f(e){return"number"==typeof e}function p(e){return f(e)&&!isNaN(e)&&e>0}function x(e,t){return f(e)&&!isNaN(e)&&e<=t&&e>=0}h.displayName=u;var w=e.i(975157);function v({className:e,indicatorClassName:a,value:r,...i}){return(0,t.jsx)(c,{"data-slot":"progress",className:(0,w.cn)("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...i,children:(0,t.jsx)(h,{"data-slot":"progress-indicator",className:(0,w.cn)("bg-primary h-full w-full flex-1 transition-all",a),style:{transform:`translateX(-${100-(r||0)}%)`}})})}e.s(["Progress",()=>v],168148)},702803,e=>{"use strict";var t=e.i(712920);let a=(0,t.createServerReference)("406c3cbc92da87edd2347f7c6474a76deded317a23",t.callServer,void 0,t.findSourceMapURL,"deleteVideo");e.s(["deleteVideo",()=>a])},768517,e=>{"use strict";var t=e.i(712920);let a=(0,t.createServerReference)("60d1fa9840307ce1fbc59b752f1c50ee89f2b54053",t.callServer,void 0,t.findSourceMapURL,"updateVideoVisibility");e.s(["updateVideoVisibility",()=>a])},281020,e=>{"use strict";var t=e.i(119584),a=e.i(487486),r=e.i(975157),i=e.i(696191),s=e.i(979985),l=e.i(230245),n=e.i(525819);let o={pending:{label:"Pending",icon:(0,t.jsx)(s.Clock,{className:"h-3 w-3"}),variant:"secondary",className:"bg-gray-100 text-gray-700"}
6,processing:{label:"Processing",icon:(0,t.jsx)(l.Loader2,{className:"h-3 w-3 animate-spin"}),variant:"default",className:"bg-blue-100 text-blue-700"},completed:{label:"Completed",icon:(0,t.jsx)(i.CheckCircle2,{className:"h-3 w-3"}),variant:"outline",className:"bg-green-100 text-green-700"},failed:{label:"Failed",icon:(0,t.jsx)(n.XCircle,{className:"h-3 w-3"}),variant:"destructive",className:"bg-red-100 text-red-700"}};function d({status:e,className:i}){let s=o[e];return(0,t.jsxs)(a.Badge,{variant:s.variant,className:(0,r.cn)("flex items-center gap-1.5",s.className,i),children:[s.icon,(0,t.jsx)("span",{children:s.label})]})}e.s(["VideoStatusBadge",()=>d])},623020,e=>{"use strict";var t=e.i(119584),a=e.i(702803),r=e.i(868499),i=e.i(519455),s=e.i(624687),l=e.i(296410),n=e.i(281020),o=e.i(515288),d=e.i(168148),c=e.i(880749),u=e.i(975157),h=e.i(230245),m=e.i(561980);function g({model:e,progress:a,estimatedTimeLeft:r,className:i}){let s=(0,m.useTranslations)("VideoSubmission.statusPolling"),l=c.VIDEO_MODELS[e],n="seedance-2-0"===e||"seedance-2-0-fast"===e;return(0,t.jsx)(o.Card,{className:(0,u.cn)("w-full",i),children:(0,t.jsx)(o.CardContent,{className:"pt-6",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(h.Loader2,{className:"h-5 w-5 animate-spin text-primary"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-semibold",children:s(n?"queueTitle":"generatingTitle")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s("usingModel",{model:l?.name||e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:s("progress")}),(0,t.jsxs)("span",{className:"font-medium",children:[Math.round(a),"%"]})]}),(0,t.jsx)(d.Progress,{value:a,className:"h-2"})]}),null!==r&&r>0&&(0,t.jsxs)("div",{className:"text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:s(n?"estimatedQueueRemaining":"estimatedRemaining")}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:n?s("minutes",{count:Math.ceil(r/60)}):s("seconds",{count:Math.ceil(r)})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s(n?"queueHint":"autoRefreshHint")})]})})})}var f=e.i(768517),p=e.i(699375),x=e.i(908406),w=e.i(937729),v=e.i(736761),b=e.i(622989);function j({videoId:e,isPublic:a,onVisibilityChange:r}){let[i,s]=(0,b.useState)(!1),{toast:l}=(0,x.useToast)(),n=(0,m.useTranslations)("Scene"),o=async t=>{if(!i){s(!0);try{let a=await (0,f.updateVideoVisibility)(e,t);a.success?(r?.(t),l({title:t?n("visibility.publicSuccess"):n("visibility.privateSuccess"),description:t?n("visibility.publicDescription"):n("visibility.privateDescription"),variant:"default"})):l({title:n("visibility.updateFailed"),description:a.error||n("visibility.updateError"),variant:"destructive"})}catch(e){console.error("Failed to update video visibility:",e),l({title:n("visibility.updateFailed"),description:n("visibility.unknownError"),variant:"destructive"})}finally{s(!1)}}};return(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[a?(0,t.jsx)(w.Globe,{className:"h-4 w-4 text-green-600"}):(0,t.jsx)(v.Lock,{className:"h-4 w-4 text-orange-600"}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:a?n("visibility.public"):n("visibility.private")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:a?n("visibility.publicHint"):n("visibility.privateHint")})]})]}),i?(0,t.jsx)(h.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}):(0,t.jsx)(p.Switch,{checked:a,onCheckedChange:o,"aria-label":n("visibility.toggleVideoAria")})]})}var y=e.i(341093),k=e.i(861475),N=e.i(719735),C=e.i(429110),D=e.i(898760),S=e.i(637667),R=e.i(236772);function T({video:e,progress:o=0,estimatedTimeLeft:d=0,onRefresh:u,isOwner:h=!1,onVisibilityChange:f,onDeleteSuccess:p,onRemix:x}){let w=(0,m.useTranslations)("VideoDetail"),[v,T]=(0,b.useState)(!1),[E,A]=(0,b.useState)(!1),I=c.VIDEO_MODELS[e.model],M="completed"===e.status,U="pending"===e.status||"processing"===e.status,z="failed"===e.status,F=window.location.origin+`/video/${e.id}`,P=e.prompt||w("defaultTitle"),H=async()=>
6{if(!E){A(!0);try{let t=await (0,a.deleteVideo)(e.id);t.success?(S.toast.success(w("toast.deleteSuccess")),p&&p(e.id)):S.toast.error(t.error||w("toast.deleteFailed"))}catch(e){console.error("Failed to delete video:",e),S.toast.error(w("toast.deleteFailed"))}finally{A(!1)}}};return(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-3 lg:gap-8",children:[(0,t.jsx)("div",{className:"lg:col-span-2 space-y-4",children:(0,t.jsxs)("div",{className:"rounded-lg border bg-card p-6 shadow-sm",children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:w("sections.generatedResult")}),(0,t.jsx)(n.VideoStatusBadge,{status:e.status})]}),u&&(0,t.jsx)(i.Button,{onClick:u,variant:"ghost",size:"icon",title:w("actions.refreshStatus"),children:(0,t.jsx)(N.RefreshCw,{className:`h-4 w-4 ${U?"animate-spin":""}`})})]}),(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border bg-muted/50 min-h-[300px] flex items-center justify-center bg-black/5",children:U?(0,t.jsx)("div",{className:"w-full p-8",children:(0,t.jsx)(g,{model:e.model,progress:o,estimatedTimeLeft:d})}):M&&(e.videoUrl||e.apimartVideoUrl)?(0,t.jsx)(l.VideoPlayer,{videoUrl:e.videoUrl||e.apimartVideoUrl,thumbnailUrl:e.thumbnailUrl||void 0,autoPlay:!1,loop:!0,className:"w-full h-full object-contain max-h-[60vh]"}):z?(0,t.jsxs)("div",{className:"text-center p-8 space-y-4",children:[(0,t.jsx)("p",{className:"text-red-500 font-semibold",children:w("status.failed")}),e.errorMessage&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.errorMessage})]}):null})]})}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"rounded-lg border bg-card shadow-sm",children:[(0,t.jsx)("div",{className:"p-6 pb-3",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("h3",{className:"flex items-center gap-2 text-lg font-semibold",children:["💬 ",w("sections.prompt")]}),(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(e.prompt),T(!0),S.toast.success(w("toast.promptCopied")),setTimeout(()=>T(!1),2e3)},className:"h-8 px-2",children:[(0,t.jsx)(y.Copy,{className:"h-3 w-3"}),v?w("actions.copied"):w("actions.copy")]})]})}),(0,t.jsx)("div",{className:"px-6 pb-6",children:(0,t.jsx)(s.Textarea,{value:e.prompt,readOnly:!0,className:"max-h-[150px] resize-none cursor-text focus:ring-0 focus:ring-offset-0 bg-muted/30"})})]}),(0,t.jsxs)("div",{className:"rounded-lg border bg-card shadow-sm p-6 space-y-4",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold border-b pb-2",children:w("sections.details")}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground block mb-1",children:w("labels.model")}),(0,t.jsx)("span",{className:"font-medium",children:I?.name||e.model})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground block mb-1",children:w("labels.duration")}),(0,t.jsxs)("span",{className:"font-medium",children:[e.duration,"s"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground block mb-1",children:w("labels.aspectRatio")}),(0,t.jsx)("span",{className:"font-medium",children:e.aspectRatio})]}),e.resolution&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground block mb-1",children:w("labels.resolution")}),(0,t.jsx)("span",{className:"font-medium",children:e.resolution})]})]})]}),h&&M&&(0,t.jsx)(j,{videoId:e.id,isPublic:e.isPublic??!1,onVisibilityChange:f}),M&&(e.videoUrl||e.apimartVideoUrl)&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)(i.Button,{className:"w-full",size:"lg",onClick:()=>{let t=document.createElement("a");t.href=e.videoUrl||e.apimartVideoUrl,t.download=`video-${e.id}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:[(0,t.jsx)(k.Download,{className:"mr-2 h-4 w-4"}),w("actions.downloadVideo")]}),(0,t.jsxs)(i.Button,{className:"w-full",size:"lg",variant:"outline",onClick:()=>{x?x():window.location.href=`/video?remix_id=${e.id}`},children:[(0,t.jsx)(D.Wand2,{className:"mr-2 h-4 w-4"}),w("actions.remix")]}),(0,t.jsx)(R.default,{pageUrl:F,pageTitle:P,shareLabel:w("actions.share"),linkCopiedText:w("actions.linkCopied"),compact:!0}),h&&(0,t.jsxs)(r.AlertDialog,{children:[(0,t.jsx)(r.AlertDialogTrigger,{asChild:!0,children:(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"w-full text-destructive hover:text-destructive hover:bg-destructive/10",disabled:E,children:[(0,t.jsx)(C.Trash2,{className:"mr-2 h-4 w-4"}),E?w("actions.deleting"):w("actions.deleteVideo")]})}),(0,t.jsxs)(r.AlertDialogContent,{children:[(0,t.jsxs)(r.AlertDialogHeader,{children:[(0,t.jsx)(r.AlertDialogTitle,{children:w("dialog.deleteTitle")}),(0,t.jsx)(r.AlertDialogDescription,{children:w("dialog.deleteDescription")})]}),(0,t.jsxs)(r.AlertDialogFooter,{children:[(0,t.jsx)(r.AlertDialogCancel,{children:w("actions.cancel")}),(0,t.jsx)(r.AlertDialogAction,{onClick:e=>{e.preventDefault(),H()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:E?w("actions.deleting"):w("actions.delete")})]})]})]})]})]})]})}e.s(["VideoDetailContent",()=>T],623020)},426570,e=>{"use strict";let t=(0,e.i(360229).default)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["default",()=>t])},830798,e=>{"use strict";let t=(0,e.i(360229).default)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["default",()=>t])},736761,256747,e=>{"use strict";
6let t=(0,e.i(360229).default)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);e.s(["default",()=>t],256747),e.s(["Lock",()=>t],736761)},868499,e=>{"use strict";var t=e.i(119584),a=e.i(622989),r=e.i(669122),i=e.i(806148),s=e.i(579436),l=e.i(291967),n=e.i(969897),o="AlertDialog",[d,c]=(0,r.createContextScope)(o,[s.createDialogScope]),u=(0,s.createDialogScope)(),h=e=>{let{__scopeAlertDialog:a,...r}=e,i=u(a);return(0,t.jsx)(s.Root,{...i,...r,modal:!0})};h.displayName=o;var m=a.forwardRef((e,a)=>{let{__scopeAlertDialog:r,...i}=e,l=u(r);return(0,t.jsx)(s.Trigger,{...l,...i,ref:a})});m.displayName="AlertDialogTrigger";var g=e=>{let{__scopeAlertDialog:a,...r}=e,i=u(a);return(0,t.jsx)(s.Portal,{...i,...r})};g.displayName="AlertDialogPortal";var f=a.forwardRef((e,a)=>{let{__scopeAlertDialog:r,...i}=e,l=u(r);return(0,t.jsx)(s.Overlay,{...l,...i,ref:a})});f.displayName="AlertDialogOverlay";var p="AlertDialogContent",[x,w]=d(p),v=(0,n.createSlottable)("AlertDialogContent"),b=a.forwardRef((e,r)=>{let{__scopeAlertDialog:n,children:o,...d}=e,c=u(n),h=a.useRef(null),m=(0,i.useComposedRefs)(r,h),g=a.useRef(null);return(0,t.jsx)(s.WarningProvider,{contentName:p,titleName:j,docsSlug:"alert-dialog",children:(0,t.jsx)(x,{scope:n,cancelRef:g,children:(0,t.jsxs)(s.Content,{role:"alertdialog",...c,...d,ref:m,onOpenAutoFocus:(0,l.composeEventHandlers)(d.onOpenAutoFocus,e=>{e.preventDefault(),g.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,t.jsx)(v,{children:o}),(0,t.jsx)(R,{contentRef:h})]})})})});b.displayName=p;var j="AlertDialogTitle",y=a.forwardRef((e,a)=>{let{__scopeAlertDialog:r,...i}=e,l=u(r);return(0,t.jsx)(s.Title,{...l,...i,ref:a})});y.displayName=j;var k="AlertDialogDescription",N=a.forwardRef((e,a)=>{let{__scopeAlertDialog:r,...i}=e,l=u(r);return(0,t.jsx)(s.Description,{...l,...i,ref:a})});N.displayName=k;var C=a.forwardRef((e,a)=>{let{__scopeAlertDialog:r,...i}=e,l=u(r);return(0,t.jsx)(s.Close,{...l,...i,ref:a})});C.displayName="AlertDialogAction";var D="AlertDialogCancel",S=a.forwardRef((e,a)=>{let{__scopeAlertDialog:r,...l}=e,{cancelRef:n}=w(D,r),o=u(r),d=(0,i.useComposedRefs)(a,n);return(0,t.jsx)(s.Close,{...o,...l,ref:d})});S.displayName=D;var R=({contentRef:e})=>{let t=`\`${p}\` requires a description for the component to be accessible for screen reader users.
7
8You can add a description to the \`${p}\` by passing a \`${k}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
9
10Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${p}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
11
12For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},T=e.i(975157),E=e.i(519455);function A({...e}){return(0,t.jsx)(h,{"data-slot":"alert-dialog",...e})}function I({...e}){return(0,t.jsx)(m,{"data-slot":"alert-dialog-trigger",...e})}function M({...e}){return(0,t.jsx)(g,{"data-slot":"alert-dialog-portal",...e})}function U({className:e,...a}){return(0,t.jsx)(f,{"data-slot":"alert-dialog-overlay",className:(0,T.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...a})}function z({className:e,...a}){return(0,t.jsxs)(M,{children:[(0,t.jsx)(U,{}),(0,t.jsx)(b,{"data-slot":"alert-dialog-content",className:(0,T.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 roun
12ded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...a})]})}function F({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,T.cn)("flex flex-col gap-2 text-center sm:text-left",e),...a})}function P({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,T.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...a})}function H({className:e,...a}){return(0,t.jsx)(y,{"data-slot":"alert-dialog-title",className:(0,T.cn)("text-lg font-semibold",e),...a})}function L({className:e,...a}){return(0,t.jsx)(N,{"data-slot":"alert-dialog-description",className:(0,T.cn)("text-muted-foreground text-sm",e),...a})}function W({className:e,...a}){return(0,t.jsx)(C,{className:(0,T.cn)((0,E.buttonVariants)(),e),...a})}function $({className:e,...a}){return(0,t.jsx)(S,{className:(0,T.cn)((0,E.buttonVariants)({variant:"outline"}),e),...a})}e.s(["AlertDialog",()=>A,"AlertDialogAction",()=>W,"AlertDialogCancel",()=>$,"AlertDialogContent",()=>z,"AlertDialogDescription",()=>L,"AlertDialogFooter",()=>P,"AlertDialogHeader",()=>F,"AlertDialogTitle",()=>H,"AlertDialogTrigger",()=>I],868499)},699375,e=>{"use strict";var t=e.i(119584),a=e.i(622989),r=e.i(291967),i=e.i(806148),s=e.i(669122),l=e.i(892857),n=e.i(842728),o=e.i(729085),d=e.i(609732),c="Switch",[u,h]=(0,s.createContextScope)(c),[m,g]=u(c),f=a.forwardRef((e,s)=>{let{__scopeSwitch:n,name:o,checked:u,defaultChecked:h,required:g,disabled:f,value:p="on",onCheckedChange:x,form:b,...j}=e,[y,k]=a.useState(null),N=(0,i.useComposedRefs)(s,e=>k(e)),C=a.useRef(!1),D=!y||b||!!y.closest("form"),[S,R]=(0,l.useControllableState)({prop:u,defaultProp:h??!1,onChange:x,caller:c});return(0,t.jsxs)(m,{scope:n,checked:S,disabled:f,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":S,"aria-required":g,"data-state":v(S),"data-disabled":f?"":void 0,disabled:f,value:p,...j,ref:N,onClick:(0,r.composeEventHandlers)(e.onClick,e=>{R(e=>!e),D&&(C.current=e.isPropagationStopped(),C.current||e.stopPropagation())})}),D&&(0,t.jsx)(w,{control:y,bubbles:!C.current,name:o,value:p,checked:S,required:g,disabled:f,form:b,style:{transform:"translateX(-100%)"}})]})});f.displayName=c;var p="SwitchThumb",x=a.forwardRef((e,a)=>{let{__scopeSwitch:r,...i}=e,s=g(p,r);return(0,t.jsx)(d.Primitive.span,{"data-state":v(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:a})});x.displayName=p;var w=a.forwardRef(({__scopeSwitch:e,control:r,checked:s,bubbles:l=!0,...d},c)=>{let u=a.useRef(null),h=(0,i.useComposedRefs)(u,c),m=(0,n.usePrevious)(s),g=(0,o.useSize)(r);return a.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(m!==s&&t){let a=new Event("click",{bubbles:l});t.call(e,s),e.dispatchEvent(a)}},[m,s,l]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...d,tabIndex:-1,ref:h,style:{...d.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}w.displayName="SwitchBubbleInput";var b=e.i(975157);function j({className:e,...a}){return(0,t.jsx)(f,{"data-slot":"switch",className:(0,b.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...a,children:(0,t.jsx)(x,{"data-slot":"switch-thumb",className:(0,b.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>j],699375)},937729,e=>{"use strict";var t=e.i(830798);e.s(["Globe",()=>t.default])},950348,e=>{"use strict";var t=e.i(712920);let a=(0,t.createServerReference)("404d938960cda91d16a559a1ede7fbd8526846da75",t.callServer,void 0,t.findSourceMapURL,"getMyWorks");e.s(["getMyWorks",()=>a])},658637,e=>{"use strict";var t=e.i(712920);let a=(0,t.createServerReference)("4023ff1e434deca6e983d29b4fe18dfae50929f135",t.callServer,void 0,t.findSourceMapURL,"deleteWork");e.s(["deleteWork",()=>a])},860339,e=>{"use strict";var t=e.i(712920);let a=(0,t.createServerReference)("605f6326a97f7682b2ac005d11482bd2eff21e5827",t.callServer,void 0,t.findSourceMapURL,"updateWorkVisibility");e.s(["updateWorkVisibility",()=>a])},638179,e=>{"use strict";var t=e.i(718927);e.s(["Video",()=>t.default])},245639,e=>{"use strict";var t=e.i(622989),a=e.i(291967),r=e.i(669122),i=e.i(299531),s=e.i(212850),l=e.i(609732),n=e.i(887996),o=e.i(892857),d=e.i(535313),c=e.i(119584),u="Tabs",[h,m]=(0,r.createContextScope)(u,[i.createRovingFocusGroupScope]),g=(0,i.createRovingFocusGroupScope)(),[f,p]=h(u),x=t.forwardRef((e,t)=>
12{let{__scopeTabs:a,value:r,onValueChange:i,defaultValue:s,orientation:h="horizontal",dir:m,activationMode:g="automatic",...p}=e,x=(0,n.useDirection)(m),[w,v]=(0,o.useControllableState)({prop:r,onChange:i,defaultProp:s??"",caller:u});return(0,c.jsx)(f,{scope:a,baseId:(0,d.useId)(),value:w,onValueChange:v,orientation:h,dir:x,activationMode:g,children:(0,c.jsx)(l.Primitive.div,{dir:x,"data-orientation":h,...p,ref:t})})});x.displayName=u;var w="TabsList",v=t.forwardRef((e,t)=>{let{__scopeTabs:a,loop:r=!0,...s}=e,n=p(w,a),o=g(a);return(0,c.jsx)(i.Root,{asChild:!0,...o,orientation:n.orientation,dir:n.dir,loop:r,children:(0,c.jsx)(l.Primitive.div,{role:"tablist","aria-orientation":n.orientation,...s,ref:t})})});v.displayName=w;var b="TabsTrigger",j=t.forwardRef((e,t)=>{let{__scopeTabs:r,value:s,disabled:n=!1,...o}=e,d=p(b,r),u=g(r),h=N(d.baseId,s),m=C(d.baseId,s),f=s===d.value;return(0,c.jsx)(i.Item,{asChild:!0,...u,focusable:!n,active:f,children:(0,c.jsx)(l.Primitive.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":m,"data-state":f?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:h,...o,ref:t,onMouseDown:(0,a.composeEventHandlers)(e.onMouseDown,e=>{n||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(s)}),onKeyDown:(0,a.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(s)}),onFocus:(0,a.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==d.activationMode;f||n||!e||d.onValueChange(s)})})})});j.displayName=b;var y="TabsContent",k=t.forwardRef((e,a)=>{let{__scopeTabs:r,value:i,forceMount:n,children:o,...d}=e,u=p(y,r),h=N(u.baseId,i),m=C(u.baseId,i),g=i===u.value,f=t.useRef(g);return t.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,c.jsx)(s.Presence,{present:n||g,children:({present:t})=>(0,c.jsx)(l.Primitive.div,{"data-state":g?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":h,hidden:!t,id:m,tabIndex:0,...d,ref:a,style:{...e.style,animationDuration:f.current?"0s":void 0},children:t&&o})})});function N(e,t){return`${e}-trigger-${t}`}function C(e,t){return`${e}-content-${t}`}k.displayName=y,e.s(["Content",()=>k,"List",()=>v,"Root",()=>x,"Tabs",()=>x,"TabsContent",()=>k,"TabsList",()=>v,"TabsTrigger",()=>j,"Trigger",()=>j])},677572,e=>{"use strict";var t=e.i(119584),a=e.i(245639),r=e.i(975157);function i({className:e,...i}){return(0,t.jsx)(a.Root,{"data-slot":"tabs",className:(0,r.cn)("flex flex-col gap-2",e),...i})}function s({className:e,...i}){return(0,t.jsx)(a.List,{"data-slot":"tabs-list",className:(0,r.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...i})}function l({className:e,...i}){return(0,t.jsx)(a.Trigger,{"data-slot":"tabs-trigger",className:(0,r.cn)("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i})}function n({className:e,...i}){return(0,t.jsx)(a.Content,{"data-slot":"tabs-content",className:(0,r.cn)("flex-1 outline-none",e),...i})}e.s(["Tabs",()=>i,"TabsContent",()=>n,"TabsList",()=>s,"TabsTrigger",()=>l])},515288,e=>{"use strict";var t=e.i(119584),a=e.i(975157);function r({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})}function i({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...r})}function s({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("leading-none font-semibold",e),...r})}function l({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-muted-foreground text-sm",e),...r})}function n({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-action",className:(0,a.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...r})}function o({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",e),...r})}function d({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-footer",className:(0,a.cn)("flex items-center px-6 [.border-t]:pt-6",e),...r})}e.s(["Card",()=>r,"CardAction",()=>n,"CardContent",()=>o,"CardDescription",()=>l,"CardFooter",()=>d,"CardHeader",()=>i,"CardTitle",()=>s])},487486,e=>{"use strict";var t=e.i(119584),a=e.i(969897),r=e.i(294237),i=e.i(975157);let s=(0,r.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function l({className:e,variant:r,asChild:l=!1,...n}){let o=l?a.Slot:"span";return(0,t.jsx)(o,{"data-slot":"badge",className:(0,i.cn)(s({variant:r}),e),...n})}e.s(["Badge",()=>l])},556121,e=>{"use strict";let t=(0,e.i(360229).default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["default",()=>t])},52919,e=>{"use strict";var t=e.i(556121);e.s(["ChevronLeft",()=>t.default])},752886,e=>{"use strict";function t(e){let t=Math.floor(Math.floor((new Date().getTime()-e.getTime())/1e3)/60),a=Math.floor(t/60),r=Math.floor(a/24),i=Math.floor(r/7),s=Math.floor(r/30);return s>0?`${s}mo ago`:i>0?`${i}w ago`:r>0?`${r}d ago`:a>0?`${a}h ago`:t>0?`${t}m ago`:"Just now"}function a(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function r(e){return t(e)}function i(e,t){return e.length<=t?e:e.substring(0,t).trim()+"..."}e.s(["formatDate",()=>a,"formatDateShort",()=>t,"getRelativeTimeString",()=>r,"truncateText",()=>i])},648733,e=>{"use strict";var t=e.i(119584),a=e.i(519455),r=e.i(776639),i=e.i(52919),s=e.i(797916),l=e.i(561980),n=e.i(622989),o=e.i(623020);function d({open:e,onOpenChange:d,video:c,videos:u,currentIndex:h,onNavigate:m,onDeleteSuccess:g,onRemix:f}){let p=(0,l.useTranslations)("VideoDetail"),x=(0,n.useRef)(null);(0,n.useEffect)(()=>
12{if(e)return x.current=`${window.location.pathname}${window.location.search}${window.location.hash}`,()=>{x.current&&(window.history.replaceState(null,"",x.current),x.current=null)}},[e]),(0,n.useEffect)(()=>{e&&c&&window.history.replaceState(null,"",`/video/${c.id}`)},[e,c?.id]);let[w,v]=(0,n.useState)(c?.isPublic??!1);if((0,n.useEffect)(()=>{c&&v(c.isPublic??!1)},[c?.id,c?.isPublic]),(0,n.useEffect)(()=>{if(!e)return;let t=e=>{"ArrowLeft"===e.key?(e.preventDefault(),m("prev")):"ArrowRight"===e.key&&(e.preventDefault(),m("next"))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,m]),!c||!u||0===u.length)return null;let b=h>0&&h<u.length,j=h>=0&&h<u.length-1,y={id:c.id,status:c.status,model:c.model||"",videoUrl:c.videoUrl??null,apimartVideoUrl:c.apimartVideoUrl??null,thumbnailUrl:c.thumbnailUrl??null,errorMessage:c.errorMessage??null,prompt:c.prompt||"",duration:c.duration??0,aspectRatio:c.aspectRatio||"16:9",resolution:c.resolution??null,isPublic:w,userId:c.userId,createdAt:c.createdAt};return(0,t.jsx)(r.Dialog,{open:e,onOpenChange:d,children:(0,t.jsxs)(r.DialogContent,{className:"!max-w-[95vw] sm:!max-w-7xl w-full max-h-[90vh] overflow-hidden !grid-cols-none !flex !flex-col !p-0",children:[(0,t.jsx)(r.DialogTitle,{className:"sr-only",children:p("breadcrumb.videoDetails")}),(0,t.jsx)(r.DialogHeader,{className:"hidden sm:flex px-6 pt-6 pb-4 flex-shrink-0 border-b",children:(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[u.length>1&&(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[h+1," / ",u.length]}),u.length>1&&(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(a.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m("prev"),disabled:!b,children:(0,t.jsx)(i.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)(a.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m("next"),disabled:!j,children:(0,t.jsx)(s.ChevronRight,{className:"h-4 w-4"})})]})]})})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:(0,t.jsx)(o.VideoDetailContent,{video:y,isOwner:!0,onVisibilityChange:e=>{v(e)},onDeleteSuccess:e=>{g?g(e):d(!1)},onRemix:f})})]})})}e.s(["VideoDetailModal",()=>d])},370077,147156,e=>{"use strict";function t(e){if(!e)return;let t="string"==typeof e.videoUrl?e.videoUrl.trim():"";return t||("string"==typeof e.apimartVideoUrl?e.apimartVideoUrl.trim():"")||void 0}e.s(["getPlayableVideoUrl",()=>t],370077);var a=e.i(119584),r=e.i(519455),i=e.i(776639),s=e.i(236772),l=e.i(487486),n=e.i(899454),o=e.i(755146),d=e.i(772436),c=e.i(624687),u=e.i(133713),h=e.i(967927),m=e.i(121773),g=e.i(244714),f=e.i(757819),p=e.i(850372),x=e.i(88161),w=e.i(752886),v=e.i(426570),v=v,b=e.i(527641),j=e.i(341093),y=e.i(861475),k=e.i(916110),N=e.i(898760),C=e.i(561980),D=e.i(622989),S=e.i(637667),R=e.i(201560),T=e.i(860339),E=e.i(699375),A=e.i(908406),I=e.i(937729),M=e.i(230245),U=e.i(736761);function z({workId:e,isPublic:t,onVisibilityChange:r}){let[i,s]=(0,D.useState)(!1),{toast:l}=(0,A.useToast)(),n=(0,C.useTranslations)("Scene"),o=async t=>{if(!i){s(!0);try{let a=await (0,T.updateWorkVisibility)(e,t);if(!a.success)return void l({title:n("visibility.updateFailed"),description:a.error||n("visibility.updateError"),variant:"destructive"});r?.(t),l({title:t?n("visibility.publicSuccess"):n("visibility.privateSuccess"),description:t?n("visibility.publicDescription"):n("visibility.privateDescription"),variant:"default"})}catch(e){console.error("Failed to update visibility:",e),l({title:n("visibility.updateFailed"),description:n("visibility.unknownError"),variant:"destructive"})}finally{s(!1)}}};return(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[t?(0,a.jsx)(I.Globe,{className:"h-4 w-4 text-green-600"}):(0,a.jsx)(U.Lock,{className:"h-4 w-4 text-orange-600"}),(0,a.jsxs)("div",{className:"space-y-0.5",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:t?n("visibility.public"):n("visibility.private")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:t?n("visibility.publicHint"):n("visibility.privateHint")})]})]}
12),i?(0,a.jsx)(M.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}):(0,a.jsx)(E.Switch,{checked:t,onCheckedChange:o,"aria-label":n("visibility.toggleAria")})]})}function F({work:e,onDeleteSuccess:t,onRemix:T}){let E=(0,C.useTranslations)("Scene"),A=(0,u.useCurrentUser)(),{data:I}=(0,h.useCurrentPlan)(A?.id),[M,U]=(0,D.useState)(!1),[F,P]=(0,D.useState)(!1),[H,L]=(0,D.useState)(!1),[W,$]=(0,D.useState)("png"),[V,B]=(0,D.useState)("png"),[O,_]=(0,D.useState)(!1),[G,q]=(0,D.useState)(e.isPublic),K=(0,g.getAvailableFormats)(I?.currentPlan||null),X=(0,g.getAvailableFormats)(I?.currentPlan||null);(0,D.useEffect)(()=>{q(e.isPublic)},[e.isPublic]);let J=A?.id===e.userId,Q=e.config,Y=Q?.originalPrompt,Z=Q?.userImages,ee=Z&&Z.length>0,et=e.metadata,ea=async t=>{if(!F){P(!0);try{let a=t||W,r=et?.downloadUrl||e.imageUrl,i=e.scene?.slug||"work",s=`${i}-${e.id}.${a}`;if("png"===a)await (0,f.downloadImage)(r,s,{onError:t=>{console.error("Download failed:",t),(0,m.trackEvent)(m.UmamiEvent.ClientError,{errorType:"download",errorMessage:t.message||"Download failed",errorStack:t.stack,component:"WorkDetailContent",workId:e.id,format:a,downloadUrl:r,userId:A?.id}),S.toast.error(E("download.failed"))}});else try{let e=await (0,x.convertImageFormat)(r,a);await (0,p.downloadBlob)(e,s)}catch(s){console.error("Format conversion failed, falling back to PNG:",s);let t=s instanceof Error?s:Error(String(s));(0,m.trackEvent)(m.UmamiEvent.ClientError,{errorType:"format_conversion",errorMessage:t.message||"Format conversion failed",errorStack:t.stack,component:"WorkDetailContent",workId:e.id,targetFormat:a,originalFormat:"png",downloadUrl:r,userId:A?.id});try{await (0,f.downloadImage)(r,`${i}-${e.id}.png`,{onError:t=>{console.error("Fallback download failed:",t),(0,m.trackEvent)(m.UmamiEvent.ClientError,{errorType:"download_fallback",errorMessage:t.message||"Fallback download failed",errorStack:t.stack,component:"WorkDetailContent",workId:e.id,format:"png",downloadUrl:r,userId:A?.id}),S.toast.error(E("download.failed"))}})}catch(a){console.error("Fallback download failed:",a);let t=a instanceof Error?a:Error(String(a));(0,m.trackEvent)(m.UmamiEvent.ClientError,{errorType:"download_fallback",errorMessage:t.message||"Fallback download failed",errorStack:t.stack,component:"WorkDetailContent",workId:e.id,format:"png",downloadUrl:r,userId:A?.id})}S.toast.error(E("download.fallbackPng"))}}catch(r){console.error("Download failed:",r);let a=r instanceof Error?r:Error(String(r));(0,m.trackEvent)(m.UmamiEvent.ClientError,{errorType:"download",errorMessage:a.message||"Download failed",errorStack:a.stack,component:"WorkDetailContent",workId:e.id,format:t||W,userId:A?.id}),S.toast.error(E("download.failed"))}finally{P(!1)}}},er=async t=>{if(ee&&Z&&0!==Z.length&&!H){L(!0);try{let a=t||V,r=et?.downloadUrl||e.imageUrl,i=e.scene?.slug||"work",s=await (0,p.createComparisonImage)(Z,r,a);await (0,p.downloadBlob)(s,`${i}-${e.id}-comparison.${a}`),S.toast.success(E("download.comparisonSuccess"))}catch(r){console.error("Failed to create comparison image:",r);let a=r instanceof Error?r:Error(String(r));(0,m.trackEvent)(m.UmamiEvent.ClientError,{errorType:"comparison_download",errorMessage:a.message||"Failed to create comparison image",errorStack:a.stack,component:"WorkDetailContent",workId:e.id,format:t||V,referenceImageCount:Z?.length||0,userId:A?.id}),S.toast.error(E("download.comparisonFailed"))}finally{L(!1)}}},ei=e.title||E("work.defaultPageTitle");Y?Y.slice(0,100):E("work.defaultSharePrompt");let es=window.location.origin+`/works/${e.id}`;return(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-3",children:[(0,a.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,a.jsxs)("div",{className:"block lg:hidden",children:[(0,a.jsxs)("div",{className:"rounded-lg border bg-card p-6 shadow-sm",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-2",children:[(0,a.jsx)("div",{className:"flex flex-col gap-1",children:"string"==typeof Q?.size&&(0,a.jsxs)("span",{className:"text-xs font-medium text-muted-foreground",children:[E("labels.size")," ",Q.size]})}),ee&&Z&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,a.jsxs)(l.Badge,{variant:"outline",className:"px-1.5 text-[10px]",children:[Z.length," ",1===Z.length?E("work.imageCount"):E("work.imageCountPlural")]}),(0,a.jsx)("span",{children:E("work.referenceImages")})]})]}),(0,a.jsx)("div",{className:"overflow-hidden rounded-lg border bg-muted/50",children:(0,a.jsx)("div",{className:"max-h-[70vh] w-full",children:(0,a.jsx)(n.ClickableImage,{src:e.imageUrl,alt:e.title||E("work.generatedArtworkAlt"),title:e.title||E("work.generatedResult"),width:800,height:600,fitMode:"height",className:"h-full w-full",unoptimized:!0})})}),ee&&(0,a.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:E("work.referenceHint")}),(0,a.jsx)(r.Button,{variant:"outline",size:"sm",className:"w-full",onClick:()=>_(!0),children:E("work.viewComparison")})]})]}),ee&&Z&&Z.length>0&&(0,a.jsx)(i.Dialog,{open:O,onOpenChange:_,children:(0,a.jsxs)(i.DialogContent,{className:"max-w-5xl w-full max-h-[90vh] overflow-y-auto",children:[(0,a.jsxs)(i.DialogHeader,{children:[(0,a.jsx)(i.DialogTitle,{children:E("work.compareTitle")}),(0,a.jsx)(i.DialogDescription,{className:"text-xs leading-relaxed text-muted-foreground",children:E("work.compareDescription")})]}),(0,a.jsxs)("div",{className:`grid gap-4 ${1===Z.length?"grid-cols-1 sm:grid-cols-2":"grid-cols-1 md:grid-cols-2"}`,children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"mb-3 flex h-7 items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-base font-semibold",children:E("work.referenceImages")}),(0,a.jsxs)(l.Badge,{variant:"outline",className:"text-xs",children:[Z.length," ",1===Z.length?E("work.imageCount"):E("work.imageCountPlural")]})]}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden rounded-lg border bg-muted/50",children:1===Z.length?(0,a.jsx)("div",{className:"h-[60vh] w-full",children:(0,a.jsx)(n.ClickableImage,{src:Z[0],alt:E("work.referenceImageAlt",{index:1}),title:E("work.referenceImages"),width:800,height:600,fitMode:"height",className:"h-full w-full",expandHint:E("work.clickToEnlarge"),showExpandHint:!0,unoptimized:!0})}):(0,a.jsx)("div",{className:"flex h-[60vh] items-center justify-center p-4",children:(0,a.jsx)("div",{className:"grid h-full w-full grid-cols-2 gap-3",children:Z.map((e,t)=>(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(n.ClickableImage,{src:e,alt:E("work.referenceImageAlt",{index:t+1}),width:300,height:300,fitMode:"contain",className:"h-full w-full rounded-lg object-contain",expandHint:E("work.clickToEnlarge"),showExpandHint:!0,unoptimized:!0})},t))})})})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-col border-t pt-4 sm:mt-0 sm:border-t-0 sm:pt-0",children:[(0,a.jsxs)("div",{className:"mb-3 flex h-7 items-center justify-between gap-2",children:[(0,a.jsx)("h3",{className:"text-base font-semibold",children:E("work.generatedResult")}),"string"==typeof Q?.size&&(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:[E("labels.size")," ",Q.size]})]}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden rounded-lg border bg-muted/50",children:(0,a.jsx)("div",{className:"h-[60vh] w-full",children:(0,a.jsx)(n.ClickableImage,{src:e.imageUrl,alt:e.title||E("work.generatedArtworkAlt"),title:e.title||E("work.generatedResult"),width:800,height:600,fitMode:"height",className:"h-full w-full",unoptimized:!0})})})]})]}),(0,a.jsx)("div",{className:"sticky bottom-0 z-10 mt-4 border-t bg-background px-4 pb-3 pt-3",children:(0,a.jsx)(i.DialogClose,{asChild:!0,children:(0,a.jsx)(r.Button,{variant:"default",size:"lg",className:"w-full",children:E("work.closeComparison")})})})]})})]}),(0,a.jsx)("div",{className:"hidden lg:block",children:ee?(0,a.jsx)("div",{className:"rounded-lg border bg-card p-6 shadow-sm",children:(0,a.jsxs)("div",{className:`grid gap-4 ${Z&&1===Z.length?"grid-cols-2":"grid-cols-1 md:grid-cols-2"}`,children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"mb-3 flex h-7 items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:E("work.referenceImages")}),Z&&(0,a.jsxs)(l.Badge,{variant:"outline",className:"text-xs",children:[Z.length," ",1===Z.length?E("work.imageCount"):E("work.imageCountPlural")]})]}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden rounded-lg border bg-muted/50",children:Z&&1===Z.length?(0,a.jsx)("div",{className:"h-[60vh] w-full",children:(0,a.jsx)(n.ClickableImage,{src:Z[0],alt:E("work.referenceImageAlt",{index:1}),title:E("work.referenceImages"),width:800,height:600,fitMode:"height",className:"h-full w-full",expandHint:E("work.clickToEnlarge"),showExpandHint:!0,unoptimized:!0})}):(0,a.jsx)("div",{className:"flex h-[60vh] items-center justify-center p-4",children:(0,a.jsx)("div",{className:"grid h-full w-full grid-cols-2 gap-3",children:Z?.map((e,t)=>(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(n.ClickableImage,{src:e,alt:E("work.referenceImageAlt",{index:t+1}),width:300,height:300,fitMode:"contain",className:"h-full w-full rounded-lg object-contain",expandHint:E("work.clickToEnlarge"),showExpandHint:!0,unoptimized:!0})},t))})})})]}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"mb-3 flex h-7 items-center justify-between gap-2",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:E("work.generatedResult")}),"string"==typeof Q?.size&&(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:[E("labels.size")," ",Q.size]})]}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden rounded-lg border bg-muted/50",children:(0,a.jsx)("div",{className:"h-[60vh] w-full",children:(0,a.jsx)(n.ClickableImage,{src:e.imageUrl,alt:e.title||E("work.generatedArtworkAlt"),title:e.title||E("work.generatedResult"),width:800,height:600,fitMode:"height",className:"h-full w-full",unoptimized:!0})})})]})]})}):(0,a.jsx)("div",{className:"overflow-hidden rounded-lg border bg-card shadow-sm",children:(0,a.jsx)("div",{className:"h-[70vh] w-full",children:(0,a.jsx)(n.ClickableImage,{src:e.imageUrl,alt:e.title||E("work.generatedArtworkAlt"),title:e.title||E("work.generatedArtworkAlt"),width:800,height:600,fitMode:"height",className:"h-full w-full",unoptimized:!0})})})})]}),(0,a.jsxs)("div",{className:"space-y-6",children:[(Y||e.prompt)&&(0,a.jsxs)("div",{className:"rounded-lg border bg-card shadow-sm",children:[(0,a.jsx)("div",{className:"p-6 pb-3",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("h3",{className:"flex items-center gap-2 text-lg font-semibold",children:["💬 ",E("labels.promptTitle")]}),(0,a.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>{Y&&(navigator.clipboard.writeText(Y),U(!0),S.toast.success(E("work.promptCopiedToClipboard")),setTimeout(()=>U(!1),2e3))},className:"h-8 px-2",children:[(0,a.jsx)(j.Copy,{className:"h-3 w-3"}
12),M?E("work.copiedPrompt"):E("work.copyPrompt")]})]})}),(0,a.jsx)("div",{className:"px-6 pb-6",children:(0,a.jsx)(c.Textarea,{value:Y||e.prompt,readOnly:!0,className:"max-h-[120px] resize-none text-sm"})})]}),(0,a.jsx)("div",{className:"rounded-lg border bg-card shadow-sm",children:(0,a.jsxs)("div",{className:"p-6 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,a.jsx)(v.default,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:(0,w.formatDate)(new Date(e.createdAt))})]}),(e.scene||e.config?.sceneInfo)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,a.jsx)(k.Images,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:e.scene?.name||e.config?.sceneInfo?.name})]}),e.modelUsed&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,a.jsx)(N.Wand2,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:e.modelUsed})]}),J&&(0,a.jsx)(z,{workId:e.id,isPublic:G,onVisibilityChange:e=>{q(e)}})]})}),(0,a.jsx)("div",{className:"rounded-lg border bg-card shadow-sm",children:(0,a.jsxs)("div",{className:"p-6 space-y-3",children:[1===K.length?(0,a.jsxs)(r.Button,{onClick:()=>{ea(K[0])},disabled:F,className:"w-full",variant:"default",children:[(0,a.jsx)(y.Download,{className:"h-4 w-4 mr-2"}),F?E("download.downloading"):E("download.button")]}):(0,a.jsxs)(o.DropdownMenu,{children:[(0,a.jsx)(o.DropdownMenuTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:"default",className:"w-full",disabled:F,children:[(0,a.jsx)(y.Download,{className:"h-4 w-4 mr-2"}),F?E("download.downloading"):E("download.button"),(0,a.jsx)(b.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,a.jsx)(o.DropdownMenuContent,{align:"end",children:K.map(e=>(0,a.jsx)(o.DropdownMenuItem,{onClick:()=>{$(e),ea(e)},children:e.toUpperCase()},e))})]}),ee&&Z&&Z.length>0&&(0,a.jsxs)(o.DropdownMenu,{children:[(0,a.jsx)(o.DropdownMenuTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:"outline",className:"w-full",disabled:H,children:[(0,a.jsx)(y.Download,{className:"h-4 w-4 mr-2"}),H?E("download.creatingComparison"):E("download.comparisonButton"),(0,a.jsx)(b.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,a.jsx)(o.DropdownMenuContent,{align:"end",children:X.map(e=>(0,a.jsx)(o.DropdownMenuItem,{onClick:()=>{B(e),er(e)},children:e.toUpperCase()},e))})]}),(0,a.jsx)(d.Separator,{}),(0,a.jsx)(s.default,{pageUrl:es,pageTitle:ei,shareLabel:E("work.share"),linkCopiedText:E("work.linkCopied"),compact:!0}),T&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.Separator,{}),(0,a.jsxs)(r.Button,{onClick:T,className:"w-full",variant:"secondary",children:[(0,a.jsx)(N.Wand2,{className:"mr-2 h-4 w-4"}),E("work.createSimilar")]})]}),J&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.Separator,{}),(0,a.jsx)(R.DeleteWorkButton,{workId:e.id,onDeleteSuccess:t,variant:"destructive",size:"default",className:"w-full"})]})]})})]})]})}var P=e.i(52919),H=e.i(797916);function L({open:e,onOpenChange:t,work:s,works:l,currentIndex:n,onNavigate:o,onDeleteSuccess:d,onRemix:c}){let u=(0,C.useTranslations)("Scene.work"),h=(0,D.useRef)(null);if((0,D.useEffect)(()=>{if(!e)return;let t=e=>{"ArrowLeft"===e.key?(e.preventDefault(),o("prev")):"ArrowRight"===e.key&&(e.preventDefault(),o("next"))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,o]),(0,D.useEffect)(()=>{if(e)return h.current=`${window.location.pathname}${window.location.search}${window.location.hash}`,()=>{h.current&&(window.history.replaceState(null,"",h.current),h.current=null)}},[e]),(0,D.useEffect)(()=>{if(e&&s){var t;let e;window.history.replaceState(null,"",(t=s.id,(e=new URL(window.location.href)).searchParams.set("workId",t),`${e.pathname}${e.search}${e.hash}`))}},[e,s?.id]),!s||!l||0===l.length)return null;let m=n>0&&n<l.length,g=n>=0&&n<l.length-1;return(0,a.jsx)(i.Dialog,{open:e,onOpenChange:t,children:(0,a.jsxs)(i.DialogContent,{className:"!max-w-[95vw] sm:!max-w-7xl w-full max-h-[90vh] overflow-hidden !grid-cols-none !flex !flex-col !p-0",children:[(0,a.jsx)(i.DialogTitle,{className:"sr-only",children:s.title||u("defaultPageTitle")}),(0,a.jsx)(i.DialogHeader,{className:"hidden sm:flex px-6 pt-6 pb-4 flex-shrink-0 border-b",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:s.title||u("defaultPageTitle")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[l.length>1&&(0,a.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n+1," / ",l.length]}),l.length>1&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(r.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>o("prev"),disabled:!m,children:(0,a.jsx)(P.ChevronLeft,{className:"h-4 w-4"})}),(0,a.jsx)(r.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>o("next"),disabled:!g,children:(0,a.jsx)(H.ChevronRight,{className:"h-4 w-4"})})]})]})]})}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:(0,a.jsx)(F,{work:s,onDeleteSuccess:()=>{d&&s?d(s.id):t(!1)},onRemix:c})})]})})}e.s(["WorkDetailModal",()=>L],147156)}]);

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.