PageSourceSearch

https://videoany.pl/_next/static/chunks/app/%5Blocale%5D/image-to-…?dpl=dpl_9jHWJNEaWxTzcTgjsnTYKuheaFtD

js videoany.pl collected 2026-09-30 16:16:36 UTC 162,150 bytes, 46 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[22697],{57683:function(e,t,a){Promise.resolve().then(a.bind(a,92754)),Promise.resolve().then(a.bind(a,18564)),Promise.resolve().then(a.bind(a,87195)),Promise.resolve().then(a.bind(a,50077)),Promise.resolve().then(a.bind(a,8518)),Promise.resolve().then(a.bind(a,39819)),Promise.resolve().then(a.bind(a,83105)),Promise.resolve().then(a.t.bind(a,38173,23))},87195:function(e,t,a){"use strict";a.d(t,{default:function(){return o}});var r=a(57437),i=a(22650),s=a(18087);let l=[{href:"/ai-video-generator",labelKey:"aiVideoGenerator"},{href:"/unrestricted-ai",labelKey:"unrestrictedAiTools"},{href:"/ai-image-editor-no-restrictions",labelKey:"aiImageEditorNoRestrictions"},{href:"/ai-image-generator-no-restrictions",labelKey:"aiImageGeneratorNoRestrictions"},{href:"/unfiltered-ai-image-generator",labelKey:"unfilteredAiImageGenerator"},{href:"/image-to-video",labelKey:"imageToVideo"},{href:"/image-to-image",labelKey:"imageToImage"},{href:"/undress-ai",labelKey:"undressAi"},{href:"/ai-clothes-remover",labelKey:"aiClothesRemover"},{href:"/text-to-image",labelKey:"textToImage"},{href:"/text-to-video",labelKey:"textToVideo"},{href:"/video-to-video",labelKey:"videoToVideo"},{href:"/ai-video-extender",labelKey:"aiVideoExtender"},{href:"/uncensored-ai-image-generator",labelKey:"uncensoredAiImageGenerator"},{href:"/uncensored-ai-video-generator",labelKey:"uncensoredAiVideoGenerator"},{href:"/uncensored-image-to-video-ai",labelKey:"uncensoredImageToVideoAi"}];function o(e){let{currentPath:t,className:a=""}=e,o=(0,s.useTranslations)("common.relatedPages"),n=l.filter(e=>e.href!==t);return 0===n.length?null:(0,r.jsx)("section",{"aria-label":o("ariaLabel"),className:a,children:(0,r.jsxs)("div",{className:"mx-auto max-w-4xl border-t border-white/5 pt-4",children:[(0,r.jsxs)("div",{className:"md:hidden text-center text-[10px] leading-5 text-gray-600",children:[(0,r.jsx)("span",{className:"mr-2 text-gray-700",children:o("title")}),n.map((e,t)=>(0,r.jsxs)("span",{children:[(0,r.jsx)(i.rU,{href:e.href,className:"text-gray-600 hover:text-gray-400 transition-colors",children:o("links.".concat(e.labelKey))}),t<n.length-1&&(0,r.jsx)("span",{"aria-hidden":"true",className:"mx-1 text-white/10",children:"/"})]},e.href))]}),(0,r.jsx)("div",{className:"hidden md:flex flex-wrap items-center justify-center gap-x-3 gap-y-1 text-xs",children:n.map((e,t)=>(0,r.jsxs)("div",{className:"inline-flex items-center gap-3",children:[(0,r.jsx)(i.rU,{href:e.href,className:"font-medium text-gray-500 hover:text-gray-300 transition-colors",children:o("links.".concat(e.labelKey))}),t<n.length-1&&(0,r.jsx)("span",{"aria-hidden":"true",className:"text-white/10",children:"/"})]},e.href))})]})})}},26369:function(e,t,a){"use strict";a.d(t,{Z:function(){return n}});var r=a(57437),i=a(18087),s=a(89317),l=a(5353),o=a(37164);function n(e){let{steps:t=null}=e,a=(0,i.useTranslations)("Home.howItWorks"),n=[{icon:s.Z,title:a("step1Title"),description:a("step1Desc")},{icon:l.Z,title:a("step2Title"),description:a("step2Desc")},{icon:o.Z,title:a("step3Title"),description:a("step3Desc")}],d=[s.Z,l.Z,o.Z],c=Array.isArray(t)&&t.length?t.map((e,t)=>({...e,icon:d[t]||o.Z})):n;return(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 my-12",children:c.map((e,t)=>(0,r.jsxs)("div",{className:"bg-[#121214]/50 border border-white/5 rounded-2xl p-6 relative overflow-hidden group hover:border-white/10 transition-all",children:[(0,r.jsx)("div",{className:"absolute -right-4 -top-4 w-16 h-16 bg-indigo-500/5 rounded-full blur-xl group-hover:bg-indigo-500/10 transition-colors"}),(0,r.jsx)("div",{className:"w-8 h-8 rounded-lg bg-white/5 flex items-center justify-center mb-4 text-indigo-400 border border-white/5 group-hover:scale-110 transition-transform",children:(0,r.jsx)(e.icon,{size:16})}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsxs)("span",{className:"text-xs font-bold text-indigo-500/50 tracking-wider",children:["0",t+1]}),(0,r.jsx)("h4",{className:"text-sm font-bold text-white tracking-tight",children:e.title})]}),(0,r.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed font-normal",children:e.description})]},t))})}},50077:function(e,t,a){"use strict";a.d(t,{default:function(){return c}});var r=a(57437),i=a(90849),s=a(33907),l=a(46997),o=a(18087),n=a(22650),d=a(67022);
1function c(e){let{compact:t=!1,className:a=""}=e,c=(0,o.useTranslations)("Rewards.banner"),u="+".concat(d.mf.DAILY_PUZZLE," daily / +").concat(d.mf.REFERRAL_INVITER," invite credits"),p=(e,t)=>c.has(e)?c(e):t;return(0,r.jsx)("section",{className:["overflow-hidden rounded-2xl border border-cyan-300/20 bg-[linear-gradient(135deg,rgba(8,47,73,0.72),rgba(15,23,42,0.88),rgba(74,4,78,0.58))] shadow-2xl shadow-cyan-950/15",t?"p-4":"p-5 sm:p-6",a].filter(Boolean).join(" "),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex min-w-0 gap-3",children:[(0,r.jsx)("div",{className:"flex h-11 w-11 flex-none items-center justify-center rounded-xl bg-cyan-200 text-slate-950",children:(0,r.jsx)(i.Z,{className:"h-5 w-5"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-white/15 bg-white/10 px-2 py-1 text-[11px] font-bold text-cyan-50",children:[(0,r.jsx)(s.Z,{className:"h-3 w-3"}),p("eyebrow","Zdobywaj punkty kredytowe")]}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-emerald-200/25 bg-emerald-200/10 px-2 py-1 text-[11px] font-bold text-emerald-50",children:[(0,r.jsx)(l.Z,{className:"h-3 w-3"}),p("reward",u)]})]}),(0,r.jsx)("h2",{className:t?"mt-2 text-lg font-black text-white":"mt-2 text-xl font-black text-white sm:text-2xl",children:p("title","Rozwiązuj zagadki z obrazkami, aby zdobyć kredyty nagrodowe")}),(0,r.jsx)("p",{className:"mt-1 text-sm leading-6 text-slate-200",children:p("description","Rozgrywaj codzienną VideoAny łamigł\xf3wkę, zapraszaj znajomych i przypisuj sobie zasługi za kolejne generowania.")})]})]}),(0,r.jsx)(n.rU,{href:"/earn-credits",className:"inline-flex flex-none cursor-pointer items-center justify-center rounded-xl bg-white px-5 py-3 text-sm font-black text-slate-950 transition hover:bg-cyan-100",children:p("cta","Zagraj teraz")})]})})}},8518:function(e,t,a){"use strict";a.d(t,{default:function(){return tf}});var r=a(57437),i=a(2265),s=a(16463),l=a(91773),o=a(42421),n=a(22468),d=a(87592),c=a(33907),u=a(3274),p=a(58184),m=a(18604),x=a(89317),g=a(27422),h=a(17573),b=a(10883),y=a(30338),f=a(35323),w=a(37164),v=a(37151),j=a(91802),N=a(26369),k=a(66883),z=a(72860),S=a(38472),C=a(69594),_=a(22650),R=a(11014),L=a(13594),P=a(59582),U=a(12758),A=a(62566),I=a(8780),M=a(26004);let O="imageToVideoPresetData",Z="imageToVideoPendingGeneration",F="videoany-v5",E="16:9",D="720p",T=[4,5,6,7,8,9,10,11,12],V=["21:9","16:9","4:3","1:1","3:4","9:16"],W=["480p","720p","1080p"],K="16:9",B="480p",G=Array.from({length:11},(e,t)=>t+5),H=["21:9","16:9","4:3","1:1","3:4","9:16","adaptive"],q=["480p","720p"],X={"seedance-2.0-fast":{"480p":10,"720p":20},"seedance-2.0-fast-face":{"480p":15,"720p":30},"seedance-2.0":{"480p":12,"720p":24},"seedance-2.0-face":{"480p":17,"720p":35,"1080p":80}},J={"480p":{"21:9":{width:1120,height:480},"16:9":{width:854,height:480},"4:3":{width:640,height:480},"1:1":{width:480,height:480},"3:4":{width:480,height:640},"9:16":{width:480,height:854}},"720p":{"21:9":{width:1680,height:720},"16:9":{width:1280,height:720},"4:3":{width:960,height:720},"1:1":{width:720,height:720},"3:4":{width:720,height:960},"9:16":{width:720,height:1280}},"1080p":{"21:9":{width:2520,height:1080},"16:9":{width:1920,height:1080},"4:3":{width:1440,height:1080},"1:1":{width:1080,height:1080},"3:4":{width:1080,height:1440},"9:16":{width:1080,height:1920}}},Q=(e,t)=>{let a=J[e]||J[D];return a[t]||a[E]},Y=(e,t,a)=>{let r=Number(e)||5,{width:i,height:s}=Q(t,a);return s*i*24*r/1024},$=function(e,t,a){let r=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return Y(e,t,a)/1e6*(r?2.4:1.2)},ee=function(e,t,a){let r=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return Math.max(1,Math.ceil(180*$(e,t,a,r)))},et=(e,t)=>{var a;let r="string"==typeof t?t:B;return(null===(a=X["string"==typeof e?e:"seedance-2.0-fast"])||void 0===a?void 0:a[r])||X["seedance-2.0-fast"][B]},ea=(e,t,a)=>Math.max(1,Math.ceil((Number(t)||5)*et(e,a))),er=e=>{let t="string"==typeof(null==e?void 0:e.id)?e.id.toLowerCase():"",a="str
1ing"==typeof(null==e?void 0:e.name)?e.name.toLowerCase():"";return t.startsWith("seedance")||a.includes("seedance")},ei=e=>{let t=String((null==e?void 0:e.id)||"").toLowerCase(),a=String((null==e?void 0:e.type)||"").toLowerCase();return"fal-happy-horse-video"===t||"wavespeed-happyhorse-1.1"===t||"happyhorse"===a},es=e=>String((null==e?void 0:e.id)||"").toLowerCase()===F,el=e=>{let t=String((null==e?void 0:e.id)||"").toLowerCase(),a=String((null==e?void 0:e.type)||"").toLowerCase();return"wavespeed-minimax-h3"===t||"minimaxh3"===a},eo=e=>{let t="string"==typeof(null==e?void 0:e.id)?e.id.toLowerCase():"",a="string"==typeof(null==e?void 0:e.requestModelId)?e.requestModelId.toLowerCase():"";return t.startsWith("veo3")||a.startsWith("veo3")};function en(e){let{model:t,size:a=20,fallbackClassName:i}=e;if(er(t)){let e=a>=22?"p-1":"p-0.5";return(0,r.jsx)("span",{className:["inline-flex items-center justify-center rounded-full overflow-hidden","bg-white/90 ".concat(e," ring-1 ring-black/10"),"drop-shadow-sm"].filter(Boolean).join(" "),children:(0,r.jsx)("img",{src:"/icon/seedance.svg",alt:(null==t?void 0:t.name)?"".concat(t.name," - ikona"):"Ikona Seedance",style:{width:a,height:a},className:"block object-contain rounded-full",loading:"lazy"})})}if(es(t))return(0,r.jsx)(P.Z,{model:{...t,type:"videoany"},size:a,fallbackClassName:i});if(el(t))return(0,r.jsx)("span",{className:"inline-flex items-center justify-center overflow-hidden rounded-full ring-1 ring-black/10 drop-shadow-sm",children:(0,r.jsx)("img",{src:"/icon/minimax.svg",alt:(null==t?void 0:t.name)?"".concat(t.name," - ikona"):"Ikona MiniMax",style:{width:a,height:a},className:"block rounded-full object-cover",loading:"lazy"})});if(ei(t)){let e=a+6,i=a>=22?"p-1.5":"p-1";return(0,r.jsx)("span",{className:["inline-flex items-center justify-center rounded-full overflow-hidden","bg-gradient-to-br from-slate-700 via-slate-900 to-black ".concat(i," ring-1 ring-white/20"),"drop-shadow-sm"].filter(Boolean).join(" "),children:(0,r.jsx)("img",{src:"/icon/HappyHorse.png",alt:(null==t?void 0:t.name)?"".concat(t.name," icon"):"Ikona Happy Horse",style:{width:e,height:e},className:"block object-contain",loading:"lazy"})})}return(0,r.jsx)(P.Z,{model:t,size:a,fallbackClassName:i})}let ed="Convert to a hand-drawn storyboard illustration style, with characters in full color (ensure the characters’ facial features remain consistent with the reference, and their clothing colors and styles stay unchanged), on a white background.",ec=Array.from({length:15},(e,t)=>t+1),eu="720p",ep={6:{model:"grok-video-3",credits:50},10:{model:"grok-video-3-10s",credits:100},15:{model:"grok-video-3-15s",credits:125}},em=Object.keys(ep).map(Number),ex=e=>ep[Number(e)]||ep[6],eg=e=>{let t=String(e||"").trim();return t?/(^|\s)--mode=custom\s*$/i.test(t)?t:"".concat(t," ").concat("--mode=custom"):""},eh=Array.from({length:16},(e,t)=>t+1),eb=e=>"360p"===e||"540p"===e?20:50,ey=["auto","16:9","9:16"],ef=["1080p","1440p","2160p"],ew={fast:{"1080p":15,"1440p":30,"2160p":60},pro:{"1080p":20,"1440p":40,"2160p":80}},ev=(e,t)=>{var a;return(null===(a=ew[String(e||"fast").toLowerCase()])||void 0===a?void 0:a[t])||ew.fast["1080p"]},ej=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6,r=Number(a)||6;return Math.ceil(ev(e,t)*r)},eN=e=>{if((null==e?void 0:e.taskId)&&(null==e?void 0:e.apiEndpoint)&&(null==e?void 0:e.userId))try{window.sessionStorage.setItem(Z,JSON.stringify({...e,timestamp:Date.now()}))}catch(e){}},ek=()=>{try{let e=window.sessionStorage.getItem(Z);if(!e)return null;let t=JSON.parse(e),a=Number(null==t?void 0:t.timestamp),r=!Number.isFinite(a)||Date.now()-a>432e5;if(!(null==t?void 0:t.taskId)||!(null==t?void 0:t.apiEndpoint)||!(null==t?void 0:t.userId)||r)return window.sessionStorage.removeItem(Z),null;return t}catch(e){return null}},ez=()=>{try{window.sessionStorage.removeItem(Z)}catch(e){}},eS=e=>"480P"===e?15:"720P"===e?30:"1080P"===e?45:15,eC="wavespeed-wan-3",e_={"480p":15,"720p":30,"1080p":60},eR=Array.from({length:29},(e,t)=>t+2),eL="720p",eP=e=>e_[String(e||"").toLowerCase()]||e_[eL],eU={"480p":10,"768p":15},eA=["480p","768p"],eI=Array.from({length:13},(e,t)=>t+3),eM="480p",eO=e=>eU[String(e||"").toLowerCase()]||eU[eM],eZ={"720p":25,"1080p":50},eF=["720p","1080p"],eE=Array.from({length:13},(e,t)=>t+3),eD="720p",eT=e=>eZ[e]||eZ[eD],eV={"720p":50,"1080p":75},eW=e=>eV[e]||eV[eD],eK={"720p":40,"1080p":60},eB=e=>eK[e]||eK[eD],eG=["720p","1080p"],eH=Array.from({length:14},(e,t)=>t+2),eq="image/jpeg,image/jpg,image/png,image/bmp,image/webp,.bmp",eX=new Set(["audio/mpeg","audio/mp3","audio/wav","audio/x-wav","audio/wave","audio/vnd.wave"]),eJ=e=>{if("string"!=typeof e||!e.trim())return!1;try{let t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch(e){return!1}},eQ=e=>{let t=Number.isFinite(e)?Math.max(0,e):0;return"".concat(Math.floor(t/60),":").concat(String(Math.floor(t%60)).padStart(2,"0"))},eY=e=>new Promise(t=>{let a=document.createElement("audio");a.preload="metadata",a.onloadedmetadata=()=>{let e=Number.isFinite(a.duration)?a.duration:0;URL.revokeObjectURL(a.src),t(e)},a.onerror=()=>{try{URL.revokeObjectURL(a.src)}catch(e){}t(0)},a.src=URL.createObjectURL(e)}),e$=e=>new Promise((t,a)=>{let r=document.createElement("audio");r.preload="metadata",r.crossOrigin="anonymous";let i=!1,s=null,l=()=>{s&&clearTimeout(s);try{r.src=""}catch(e){}},o=()=>{i||(i=!0,l(),a(Error("DURATION_UNAVAILABLE")))};s=setTimeout(o,15e3),r.onloadedmetadata=()=>
1{if(i)return;i=!0;let e=Number.isFinite(r.duration)?r.duration:0;l(),e>0?t(e):a(Error("DURATION_UNAVAILABLE"))},r.onerror=o,r.src=e}),e0=e=>"fal-wan-27-video"===String((null==e?void 0:e.id)||"")||"fal-wan-27-video"===String((null==e?void 0:e.requestModelId)||""),e1=e=>String((null==e?void 0:e.id)||"")===eC,e2=e=>"fal-happy-horse-video"===String((null==e?void 0:e.id)||""),e5="videoany-v4",e3=new Set(["wavespeed-happyhorse-1.1",e5]),e4=e=>e3.has(String((null==e?void 0:e.id)||"")),e8=e=>{var t;return e1(e)?eL:e2(e)||e4(e)?eD:(null==e?void 0:null===(t=e.supportedResolutions)||void 0===t?void 0:t[0])||"480P"},e6=e=>{var t;return e1(e)||e2(e)||e4(e)?5:(null==e?void 0:null===(t=e.supportedDurations)||void 0===t?void 0:t[0])||5},e7=e=>e1(e)?"auto":(e2(e)||e4(e),"16:9"),e9=e=>{if(!e)return!1;let t=String(e.type||"").toLowerCase();return!!eX.has(t)||/\.(mp3|wav)$/i.test(String(e.name||""))},te=Array.from({length:13},(e,t)=>t+3),tt=["16:9","9:16","1:1"],ta=(e,t)=>"pro"===String(e||"standard").toLowerCase()?t?110:70:t?80:50,tr=e=>new Promise((t,a)=>{try{let r=new FileReader;r.onload=()=>t("string"==typeof r.result?r.result:""),r.onerror=()=>a(Error("Nie udało się odczytać obrazu źr\xf3dłowego")),r.readAsDataURL(e)}catch(e){a(e)}}),ti=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=new URLSearchParams({model:"nanobanana-pro"});t.set("prompt",ed);let a=String(e||"").trim();return a&&(t.set("inputMode","url"),t.set("sourceImageUrl",a)),"/image-to-image?".concat(t.toString())};function ts(e){let{onClick:t,compact:a=!1}=e;return(0,r.jsxs)("button",{type:"button",onClick:t,className:["inline-flex items-center gap-1.5 rounded-full border border-cyan-400/30 bg-cyan-400/15 text-cyan-100 shadow-lg backdrop-blur-sm transition-colors hover:bg-cyan-400/25",a?"px-2.5 py-1 text-[10px] font-semibold":"px-3 py-1.5 text-xs font-semibold"].join(" "),children:[(0,r.jsx)(l.Z,{size:a?12:14}),(0,r.jsx)("span",{children:"Przer\xf3bka stylu"})]})}function tl(e){let{label:t,value:a,options:s,onChange:l,theme:d="indigo"}=e,[c,u]=(0,i.useState)(!1),p=s.find(e=>e.value===a)||null,m="purple"===d?{button:"hover:border-purple-500/30",menu:"scrollbar-thumb-purple-500/50",activeItem:"bg-purple-500/10",check:"text-purple-400"}:{button:"hover:border-indigo-500/30",menu:"scrollbar-thumb-indigo-500/50",activeItem:"bg-indigo-500/10",check:"text-indigo-400"};return(0,r.jsxs)("div",{className:"relative ".concat(c?"z-[9999]":"z-40"),children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-2",children:t}),(0,r.jsxs)("button",{type:"button",onClick:()=>u(!c),className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-3 text-left flex items-center justify-between transition-all group/select ".concat(m.button),children:[(0,r.jsx)("span",{className:"text-sm text-gray-200",children:(null==p?void 0:p.label)||String(a||"")}),(0,r.jsx)(o.Z,{size:16,className:"text-gray-400 transition-transform ".concat(c?"rotate-180":"")})]}),c&&(0,r.jsx)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-[#18181b] border border-white/10 rounded-xl shadow-2xl overflow-hidden z-[10000] animate-fade-in",children:(0,r.jsx)("div",{className:"max-h-[280px] overflow-y-auto scrollbar-thin scrollbar-track-white/5 ".concat(m.menu),children:s.map(e=>(0,r.jsxs)("button",{type:"button",onClick:()=>{l(e.value),u(!1)},className:"w-full p-3 flex items-center justify-between hover:bg-white/5 transition-colors border-b border-white/5 last:border-b-0 ".concat(e.value===a?m.activeItem:""),children:[(0,r.jsx)("span",{className:"text-sm text-white",children:e.label}),e.value===a&&(0,r.jsx)(n.Z,{size:16,className:m.check})]},String(e.value)))})})]})}let to=[{id:"canny",path:"Lightricks/LTX-2-19b-IC-LoRA-Canny-Control",name:"Kontrola krawędzi (Canny)",icon:"\uD83D\uDCD0",description:"Zachowaj precyzyjne kontury i strukturę kompozycji",usage:"Do rysunku liniowego, architektury, animacji logo i precyzyjnej kontroli kontur\xf3w",scale:1},{id:"depth",path:"Lightricks/LTX-2-19b-IC-LoRA-Depth-Control",name:"Kontrola głębi",icon:"\uD83C\uDFD4️",description:"Sterowanie strukturą przestrzenną i relacjami głębokości",usage:"Do wizualizacji architektury, wnętrz i stabilnych warstw przestrzennych",scale:1},{id:"pose",path:"Lightricks/LTX-2-19b-IC-LoRA-Pose-Control",name:"Kontrola pozy",icon:"\uD83D\uDD7A",description:"Precyzyjna kontrola ruchu postaci i postawy ciała",usage:"Do tańca, ruch\xf3w sportowych i przenoszenia ruchu postaci",scale:1},{id:"detailer",path:"Lightricks/LTX-2-19b-IC-LoRA-Detailer",name:"Ulepszanie detali",icon:"✨",description:"Poprawa szczeg\xf3ł\xf3w tekstur wideo i ostrości",usage:"Łącz z innymi kontrolerami, aby poprawić końcową jakość",scale:1}],tn=[{id:F,name:"VideoAny V4",description:"Szybki, wydajny i ekonomiczny model z dźwiękiem stereo.",badge:"BEST VALUE",credits:5*eO(eM),creditLabel:"10/15 kredyt\xf3w/s",type:"minimaxH3",supportedResolutions:eA,supportedDurations:eI,supportsAspectRatio:!1,enableSafetyChecker:!1,supportsAudioOutput:!0,getCreditsPerSecond:eO,calculateCredits:(e,t)=>Math.ceil(Number(e)*eO(t))},{id:"video-v3",requestModelId:"fal-wan-27-video",name:"VideoAny V3",description:"Obraz na wideo. Bez filtra bezpieczeństwa.",badge:"NEW",credits:125,type:"videoany",supp
1ortedResolutions:eG,supportedDurations:eH,enableSafetyChecker:!1,calculateCredits:e=>Math.ceil(25*Number(e))},{id:"videoany",requestModelId:"seedance-1-5",name:"VideoAny V2",description:"Obraz na wideo. Bez filtra bezpieczeństwa.",badge:"HOT",credits:ee(5,D,E,!0),type:"seedance15",supportedDurations:T,supportedAspectRatios:V,supportedResolutions:W,calculateCredits:(e,t,a)=>ee(e,t,a,!0),calculateUsdCost:(e,t,a)=>$(e,t,a,!0),calculateTokens:(e,t,a)=>Y(e,t,a)},{id:"seedance-2.0-fast-face",requestModelId:"doubao-seedance-2.0-fast-face",name:"Seedance 2.0 Fast Face",description:"Obraz na wideo (15 kredyt\xf3w/s @ 480p, 30 kredyt\xf3w/s @ 720p)",badge:null,credits:ea("seedance-2.0-fast-face",5,B),creditLabel:"15/30 kredyt\xf3w/s",type:"seedance20",supportedDurations:G,supportedAspectRatios:H,supportedResolutions:q,calculateCredits:(e,t)=>ea("seedance-2.0-fast-face",e,t)},{id:"seedance-2.0-fast",requestModelId:"doubao-seedance-2.0-fast",name:"Seedance 2.0 Fast",description:"Obraz na wideo (10 kredyt\xf3w/s @ 480p, 20 kredyt\xf3w/s @ 720p)",badge:null,credits:ea("seedance-2.0-fast",5,B),creditLabel:"10/20 kredyt\xf3w/s",type:"seedance20",supportedDurations:G,supportedAspectRatios:H,supportedResolutions:q,calculateCredits:(e,t)=>ea("seedance-2.0-fast",e,t)},{id:"seedance-2.0-face",requestModelId:"doubao-seedance-2.0-face",name:"Seedance 2.0 Face",description:"Obraz na wideo (17 kredyt\xf3w/s @ 480p, 35 kredyt\xf3w/s @ 720p, 80 kredyt\xf3w/s @ 1080p)",badge:"HOT",credits:ea("seedance-2.0-face",5,B),creditLabel:"17/35/80 kredyt\xf3w/s",type:"seedance20",supportedDurations:G,supportedAspectRatios:H,supportedResolutions:["480p","720p","1080p"],calculateCredits:(e,t)=>ea("seedance-2.0-face",e,t)},{id:"seedance-2.0",requestModelId:"doubao-seedance-2.0",name:"Seedance 2.0",description:"Obraz na wideo (12 kredyt\xf3w/s @ 480p, 24 kredyty/s @ 720p)",badge:null,credits:ea("seedance-2.0",5,B),creditLabel:"12/24 kredyt\xf3w/s",type:"seedance20",supportedDurations:G,supportedAspectRatios:H,supportedResolutions:q,calculateCredits:(e,t)=>ea("seedance-2.0",e,t)},{id:"seedance-1-5",name:"Seedance 1.5",description:"Obraz na wideo (obsługuje start i end frame). Bez filtra bezpieczeństwa.",badge:null,credits:ee(5,D,E,!0),type:"seedance15",supportedDurations:T,supportedAspectRatios:V,supportedResolutions:W,calculateCredits:(e,t,a)=>ee(e,t,a,!0),calculateUsdCost:(e,t,a)=>$(e,t,a,!0),calculateTokens:(e,t,a)=>Y(e,t,a)},{id:eC,name:"Wan 3.0",description:"Alibaba Wan 3.0 obraz na wideo (15/30/60 kredyt\xf3w/s @ 480p/720p/1080p).",badge:"NEW",credits:5*eP(eL),creditLabel:"15/30/60 kredyt\xf3w/s",type:"wan",supportedAspectRatios:["auto","16:9","9:16","1:1","4:3","3:4"],supportedResolutions:["480p","720p","1080p"],supportedDurations:eR,supportsAspectRatio:!0,enableSafetyChecker:!1,getCreditsPerSecond:eP,calculateCredits:(e,t)=>Math.ceil(Number(e)*eP(t))},{id:"wavespeed-minimax-h3",name:"MiniMax H3",description:"MiniMax H3 obraz na wideo z natywnym dźwiękiem (10/15 kredyt\xf3w/s @ 480p/768p).",badge:"NEW",credits:5*eO(eM),creditLabel:"10/15 kredyt\xf3w/s",type:"minimaxH3",supportedResolutions:eA,supportedDurations:eI,supportsAspectRatio:!1,getCreditsPerSecond:eO,calculateCredits:(e,t)=>Math.ceil(Number(e)*eO(t))},{id:"fal-wan-27-video",name:"Wan 2.7",description:"Alibaba z obrazem na wideo. Bez filtra bezpieczeństwa.",badge:null,credits:125,type:"wan",supportedResolutions:eG,supportedDurations:eH,enableSafetyChecker:!1,calculateCredits:e=>Math.ceil(25*Number(e))},{id:"wan2.5-i2v-preview",name:"Wan 2.5",description:"Alibaba z obrazem na wideo. Bez filtra bezpieczeństwa.",badge:null,credits:75,type:"wan",supportedResolutions:["480P","720P","1080P"],supportedDurations:[5,10],enableSafetyChecker:!1,creditsMatrix:{5:{"480P":75,"720P":150,"1080P":225},10:{"480P":150,"720P":300,"1080P":450}},calculateCredits:(e,t)=>Math.ceil(Number(e)*eS(t))},{id:"fal-happy-horse-video",name:"Happy Horse 1.0",description:"Alibaba z obrazem na wideo. (25 kredyt\xf3w/s @ 720p, 50 kredyt\xf3w/s @ 1080p)",badge:"NEW",credits:5*eT(eD),type:"wan",supportedAspectRatios:["16:9","9:16","1:1","4:3","3:4"],supportedResolutions:eF,supportedDurations:eE,enableSafetyChecker:!1,getCreditsPerSecond:eT,calculateCredits:(e,t)=>
1Math.ceil(Number(e)*eT(t))},{id:"wavespeed-happyhorse-1.1",name:"Happy Horse 1.1",description:"Alibaba obraz na wideo przez WaveSpeed (50 kredyt\xf3w/s @ 720p, 75 kredyt\xf3w/s @ 1080p)",badge:"NEW",credits:5*eW(eD),type:"wan",supportedResolutions:eF,supportedDurations:eE,supportsAspectRatio:!1,enableSafetyChecker:!1,getCreditsPerSecond:eW,calculateCredits:(e,t)=>Math.ceil(Number(e)*eW(t))},{id:e5,name:"VideoAny V5",description:"VideoAny V5 obraz na wideo. 80% stopa promocji. Bez filtra bezpieczeństwa.",badge:"80% PROMO",credits:5*eB(eD),creditLabel:"40/60/s",discountLabel:"80% stawka promocyjna",type:"wan",supportedResolutions:eF,supportedDurations:eE,supportsAspectRatio:!1,enableSafetyChecker:!1,getCreditsPerSecond:eB,getOriginalCreditsPerSecond:e=>eW(e),calculateCredits:(e,t)=>Math.ceil(Number(e)*eB(t))},{id:"fal-grok-imagine-video",name:"Grok Imagine Video",description:"Obraz-na-wideo (".concat(15," kredyt\xf3w/s)"),badge:"HOT",credits:90,type:"grok",supportedDurations:ec,supportedAspectRatios:["auto","16:9","4:3","3:2","1:1","2:3","3:4","9:16"],supportedResolutions:["480p","720p"],calculateCredits:e=>Math.ceil(15*Number(e))},{id:"grok-video-3",name:"Grok Video 3",description:"Obraz na wideo z stałą 720p",badge:null,credits:ex(6).credits,creditLabel:"50/100/125 kredyt\xf3w",type:"grokVideo3",supportedDurations:em,supportedAspectRatios:["2:3","3:2","1:1"],calculateCredits:e=>ex(e).credits},{id:"fal-ltx-2",name:"LTX-2",description:"Sterowalna sztuczna inteligencja przetwarzania obrazu na wideo",badge:null,credits:32,type:"ltx2",fps:25,supportedDurations:[6,8,10,12,14,16,18],supportedVideoSizes:[{value:"landscape_4_3",label:"Krajobraz 4:3 (1024x768)",width:1024,height:768},{value:"landscape_16_9",label:"Krajobraz 16:9 (1280x720)",width:1280,height:720},{value:"portrait_4_3",label:"Portrait 4:3 (768x1024)",width:768,height:1024},{value:"portrait_16_9",label:"Portrait 16:9 (720x1280)",width:720,height:1280},{value:"square_hd",label:"Kwadratowy HD (1024x1024)",width:1024,height:1024},{value:"square",label:"Kwadrat (768x768)",width:768,height:768}],calculateCredits:(e,t)=>Math.ceil(t.width*t.height*(25*e+1)/1e6*.001*350)},{id:"fal-ltx-2-3-fast",requestModelId:"fal-ai/ltx-2.3/image-to-video/fast",name:"LTX 2.3 Fast",description:"Obraz na wideo (15/30/60 kredyt\xf3w/s przy 1080p/1440p/2160p)",badge:null,credits:ej("fast","1080p",6),creditLabel:"15/30/60 kredyt\xf3w/s",type:"ltx23",variant:"fast",supportedDurations:[6,8,10,12,14,16,18,20],supportedAspectRatios:ey,supportedResolutions:ef,calculateCredits:(e,t)=>ej("fast",t,e)},{id:"fal-ltx-2-3-pro",requestModelId:"fal-ai/ltx-2.3/image-to-video",name:"LTX 2.3 Pro",description:"Obraz na wideo (20/40/80 kredyt\xf3w/s przy 1080p/1440p/2160p)",badge:null,credits:ej("pro","1080p",6),creditLabel:"20/40/80 kredyt\xf3w/s",type:"ltx23",variant:"pro",supportedDurations:[6,8,10],supportedAspectRatios:ey,supportedResolutions:ef,calculateCredits:(e,t)=>ej("pro",t,e)},{id:"fal-kling-video-v3-standard-i2v",name:"Kling 3",description:"Obraz-na-wideo (".concat(50," kredyt\xf3w/s bez dźwięku, ").concat(80," kredyt\xf3w/s z dźwiękiem)"),badge:"NEW",credits:400,type:"kling",variant:"standard",supportedDurations:te,supportedAspectRatios:tt,calculateCredits:(e,t)=>{let a=ta("standard",t);return Math.ceil(Number(e)*a)}},{id:"fal-kling-video-v3-pro-i2v",name:"Kling 3 Pro",description:"Obraz-na-wideo (".concat(70," kredyt\xf3w/s bez dźwięku, ").concat(110," kredyt\xf3w/s z dźwiękiem)"),badge:"PRO",credits:550,type:"kling",variant:"pro",supportedDurations:te,supportedAspectRatios:tt,calculateCredits:(e,t)=>{let a=ta("pro",t);return Math.ceil(Number(e)*a)}},{id:"fal-vidu-q3",name:"Vidu Q3",description:"Obraz na wideo (20 kredyt\xf3w/s @ 360/540p, 50 kredyt\xf3w/s @ 720/1080p)",badge:null,credits:5*eb("720p"),type:"vidu",supportedDurations:eh,supportedAspectRatios:["16:9","9:16","4:3","3:4","1:1"],supportedResolutions:["360p","540p","720p","1080p"],calculateCredits:(e,t)=>{let a=eb(t);return Math.ceil(Number(e)*a)}},{id:"veo3",name:"Veo 3",description:"Synteza wysokiej jakości",badge:null,credits:42,type:"veo",duration:8,supportedAspectRatios:["16:9","9:16"]},{id:"veo3.1-fast",name:"Veo 3.1 Fast",description:"Zoptymalizowane pod kątem szybkości",badge:null,credits:25,type:"veo",duration:8,supportedAspectRatios:["16:9","9:16"]},{id:"veo3.1",name:"Veo 3.1",description:"Zwiększona jakość",badge:null,credits:30,type:"veo",duration:8,supportedAspectRatios:["16:9","9:16"]}
1,{id:"veo3.1-pro",name:"Veo 3.1 Pro",description:"Maksymalna jakość",badge:null,credits:125,type:"veo",duration:8,supportedAspectRatios:["16:9","9:16"]},{id:"veo3.1-4k",name:"Veo 3.1 4K",description:"Zwiększona jakość 4K",badge:"4K",credits:35,type:"veo",duration:8,supportedAspectRatios:["16:9","9:16"]},{id:"veo3.1-pro-4k",name:"Veo 3.1 Pro 4K",description:"Maksymalna jakość 4K",badge:"4K",credits:150,type:"veo",duration:8,supportedAspectRatios:["16:9","9:16"]},{id:"sora-2-all",name:"Sora 2",description:"Szybkie generowanie wideo",badge:null,credits:10,type:"sora",duration:10,supportedOrientations:["portrait","landscape","square"],supportedSizes:["small","medium","large"]},{id:"sora-2-pro-all",name:"Sora 2 Pro",description:"Jakość zawodowa",badge:"PRO",credits:160,type:"sora",duration:10,supportedOrientations:["portrait","landscape","square"],supportedSizes:["small","medium","large"]}],td=[{key:"videoany",label:"VideoAny",modelIds:[e5,F,"video-v3","videoany"]},{key:"seedance-2.0-fast",label:"Seedance 2.0",modelIds:["seedance-2.0-fast-face","seedance-2.0-fast","seedance-2.0-face","seedance-2.0"]},{key:"veo3.1",label:"Veo 3.1",modelIds:["veo3.1","veo3.1-4k","veo3.1-fast","veo3.1-pro","veo3.1-pro-4k"]},{key:"sora-2-all",label:"Sora 2",modelIds:["sora-2-all","sora-2-pro-all"]},{key:"wan",label:"Wan AI",modelIds:[eC,"fal-wan-27-video","wan2.5-i2v-preview"]},{key:"kling3",label:"Kling 3",modelIds:["fal-kling-video-v3-standard-i2v","fal-kling-video-v3-pro-i2v"]},{key:"fal-ltx-2",label:"LTX",modelIds:["fal-ltx-2","fal-ltx-2-3-fast","fal-ltx-2-3-pro"]}],tc=Object.fromEntries(tn.map(e=>[e.id,e])),tu=Object.fromEntries(td.map(e=>[e.key,e])),tp=(()=>{let e=new Map;for(let t of td)for(let a of t.modelIds)e.set(a,t.key);return e})(),tm=Object.fromEntries(td.map(e=>[e.key,e.modelIds.map(e=>tc[e]).filter(Boolean)])),tx=e=>"string"==typeof e&&e.startsWith("grok-video-3")?tc["grok-video-3"]||tn[0]:tn.find(t=>t.id===e)||tc[e5]||tn[0],tg=e=>"grok-video-3-10s"===e?10:"grok-video-3-15s"===e?15:6,th=(()=>{let e=[],t=new Set;for(let a of tn){let r=tp.get(a.id)||null;if(r){if(!t.has(r)){let a=tu[r];e.push({kind:"group",key:a.key,label:a.label,models:tm[a.key]}),t.add(r)}continue}e.push({kind:"model",model:a})}return e})();function tb(e){let{model:t,isSelected:a,onSelect:i,compact:s=!1,indent:l=!1,onHover:o}=e,d=String(t.badge||"").toUpperCase().includes("COMING");return(0,r.jsxs)("button",{type:"button",onMouseEnter:o,onFocus:o,onClick:i,className:"w-full ".concat(s?"px-4 py-3":"p-4"," ").concat(l?"pl-14":""," flex items-center gap-3 hover:bg-white/5 transition-colors ").concat(a?"bg-indigo-500/10":""),children:[(0,r.jsx)("div",{className:"".concat(s?"w-9 h-9 border-indigo-500/35 from-indigo-500/25 to-purple-500/25":"w-11 h-11 border-indigo-500/40 from-indigo-500/30 to-purple-500/30"," rounded-full bg-gradient-to-br flex items-center justify-center border flex-shrink-0"),children:(0,r.jsx)(en,{model:t,size:s?18:22})}),(0,r.jsxs)("div",{className:"flex-1 text-left min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-medium text-white text-sm",children:t.name}),t.badge&&(0,r.jsx)("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded border ".concat(d?"bg-amber-500/20 text-amber-300 border-amber-500/30":"bg-emerald-500/20 text-emerald-400 border-emerald-500/30"),children:t.badge}),(0,r.jsx)("span",{className:"text-[10px] text-gray-500 ml-auto whitespace-nowrap ".concat(s?"leading-none":""),children:t.creditLabel?t.creditLabel:(0,r.jsxs)(r.Fragment,{children:[t.credits," Kredyty",R.X&&(0,r.jsxs)(r.Fragment,{children:[" ",(0,R.w)(t.credits)]})]})})]}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 ".concat(s?"truncate":""),children:t.description})]}),a&&(0,r.jsx)(n.Z,{size:s?16:18,className:"text-indigo-400 flex-shrink-0"})]})}function ty(e){let{label:t,description:a,variantsCount:i,isOpen:s,isSelected:l,onHover:o,onToggle:n,showDivider:c,iconModel:u}=e;return(0,r.jsxs)("button",{type:"button",onMouseEnter:o,onFocus:o,onClick:n,className:"w-full p-4 flex items-center gap-3 hover:bg-white/5 transition-colors ".concat(c?"border-b border-white/5":""," ").concat(l?"bg-indigo-500/10":""),"aria-haspopup":"menu","aria-expanded":s,children:[(0,r.jsx)("div",{className:"w-11 h-11 rounded-full bg-gradient-to-br from-indigo-500/30 to-purple-500/30 flex items-center justify-center border border-indigo-500/40 flex-shrink-0",children:(0,r.jsx)(en,{model:u,size:20})}),(0,r.jsxs)("div",{className:"flex-1 text-left min-w-0",children:[(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"font-medium text-white text-sm",children:t})}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 truncate",children:a})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,r.jsxs)("span",{className:"text-[10px] leading-none text-gray-500 whitespace-nowrap",children:[i," Warianty"]}),(0,r.jsx)(d.Z,{size:18,className:"text-gray-500 transition-colors ".concat(s?"text-gray-300":"")})]})]})}function tf(e){var t,a,d;let{translations:P,initialModel:Z,initialPrompt:T=""}=e,{refreshPointsBalance:V}
1=(0,A.P)(),W=(0,s.useSearchParams)(),G=(0,_.tv)(),H=(null==W?void 0:W.get("preset"))||null,q=((null==W?void 0:W.get("model"))||"").trim(),X=((null==W?void 0:W.get("prompt"))||"").trim(),J=((null==W?void 0:W.get("sourceImageUrl"))||(null==W?void 0:W.get("imageUrl"))||"").trim(),Q=((null==W?void 0:W.get("inputMode"))||"").trim().toLowerCase(),Y=q||Z||null,$=X||T||"",ee=tx(Y),ea=(0,i.useRef)(null),ei=(0,i.useRef)(null),es=(0,i.useRef)(null),el=(0,i.useRef)(null),ec=(0,i.useRef)(null),ep=(0,i.useRef)(null),em=(0,i.useRef)(null),eh=(0,i.useRef)(null),ey=(0,z.I)(),ef=(null==ey?void 0:ey.userData)||null,[ew,ej]=(0,i.useState)(ee);(0,i.useEffect)(()=>{let e=tx(Y);e&&ej(t=>(null==t?void 0:t.id)===e.id?t:e)},[Y]);let[eC,e_]=(0,i.useState)(!1),[eR,eL]=(0,i.useState)(null),[eP,eU]=(0,i.useState)(null),[eA,eI]=(0,i.useState)(""),[eZ,eF]=(0,i.useState)("idle"),[eE,eD]=(0,i.useState)("upload"),[eT,eV]=(0,i.useState)($),[eW,eK]=(0,i.useState)(!1),[eB,eG]=(0,i.useState)(""),eH=(null==ew?void 0:ew.type)==="grok"||(null==ew?void 0:ew.type)==="grokVideo3",eX=(null==ew?void 0:ew.type)==="kling",e3=e0(ew),te=e1(ew),tt=(null==ew?void 0:ew.type)==="minimaxH3",tn=(null==ew?void 0:ew.name)||"Wan 2.7",td=e2(ew),tf=e4(ew),tw=td||tf,tv=(null==ew?void 0:ew.type)!=="wan"&&(null==ew?void 0:ew.type)!=="seedance20"||e3||te,tj=er(ew)&&(null==ew?void 0:ew.type)!=="seedance15"&&(null==ew?void 0:ew.type)!=="seedance20"||eo(ew),tN=eT.length,tk=e=>{let t=e.target.value;if(eG(""),eX){eV(t.slice(0,2500));return}eV(t)},[tz,tS]=(0,i.useState)(!1),[tC,t_]=(0,i.useState)(null),[tR,tL]=(0,i.useState)(!1),[tP,tU]=(0,i.useState)(null),[tA,tI]=(0,i.useState)(null),[tM,tO]=(0,i.useState)(null),[tZ,tF]=(0,i.useState)(!1),[tE,tD]=(0,i.useState)(!1),[tT,tV]=(0,i.useState)([]),tW=!!(null==tP?void 0:tP.video_url),tK=(null==tP?void 0:tP.video_url)?tP.video_url:String((null==ew?void 0:ew.id)||"").startsWith("seedance-2.0")?"https://cdn.videoany.pl/seedence-example.mp4":(null==ew?void 0:ew.id)==="videoany"||(null==ew?void 0:ew.id)==="video-v3"||(null==ew?void 0:ew.id)===e5||(null==ew?void 0:ew.id)===F?"https://cdn.videoany.pl/usercase2.mp4":tw?"https://cdn.videoany.pl/happyhorse-1-1-example.mp4":(null==ew?void 0:ew.type)==="grok"||(null==ew?void 0:ew.type)==="grokVideo3"?"https://cdn.videoany.pl/grok-imagine-video-example.mp4":(null==ew?void 0:ew.type)==="kling"?"https://cdn.videoany.pl/kling3.mp4":"https://cdn.videoany.pl/image-to-video-example.mp4";(0,i.useEffect)(()=>{eX&&eV(e=>e.length>2500?e.slice(0,2500):e)},[eX]),(0,i.useEffect)(()=>{if(H&&!("string"==typeof $&&$.trim()))try{let e=sessionStorage.getItem(O);if(!e)return;let t=JSON.parse(e);if(!((null==t?void 0:t.timestamp)&&Date.now()-t.timestamp<3e5)){sessionStorage.removeItem(O);return}if((null==t?void 0:t.preset)!==H||"string"!=typeof(null==t?void 0:t.prompt)||!t.prompt.trim())return;eV(t.prompt)}catch(e){}},[H,$]),(0,i.useEffect)(()=>{J&&(Q&&"url"!==Q||(eD("url"),eU(null),t_(null),eI(J),eF("loading")))},[J,Q]),(0,i.useEffect)(()=>{fetch("/inspiration.json").then(e=>e.json()).then(e=>{let t=(0,L.TA)(e["image-to-video"]);t.length>0&&tV([...t].sort(()=>Math.random()-.5).slice(0,6).map((e,t)=>({image:e.url,poster:e.first_frame_url,title:"Video Creation ".concat(t+1),author:"Creator".concat(Math.floor(1e3*Math.random())),tag:"VIDEO",type:"video"})))}).catch(e=>console.error("Failed to load inspiration:",e))},[]);let[tB,tG]=(0,i.useState)("portrait"),[tH,tq]=(0,i.useState)("large"),[tX,tJ]=(0,i.useState)("16:9"),[tQ,tY]=(0,i.useState)(()=>(null==ee?void 0:ee.type)==="wan"?e8(ee):"480P"),[t$,t0]=(0,i.useState)(()=>(null==ee?void 0:ee.type)==="wan"?e6(ee):5),[t1,t2]=(0,i.useState)(()=>(null==ee?void 0:ee.type)==="wan"?e7(ee):"16:9"),[t5,t3]=(0,i.useState)(!1),[t4,t8]=(0,i.useState)(5),[t6,t7]=(0,i.useState)(eM),[t9,ae]=(0,i.useState)(!1),[at,aa]=(0,i.useState)("upload"),[ar,ai]=(0,i.useState)(null),[as,al]=(0,i.useState)(""),[ao,an]=(0,i.useState)("idle"),[ad,ac]=(0,i.useState)(null),[au,ap]=(0,i.useState)(!1),[am,ax]=(0,i.useState)(!1),[ag,ah]=(0,i.useState)("upload"),[ab,ay]=(0,i.useState)(null),[af,aw]=(0,i.useState)(""),[av,aj]=(0,i.useState)(null),[aN,ak]=(0,i.useState)(0),[az,aS]=(0,i.useState)(!1),[aC,a_]=(0,i.useState)(!1),[aR,aL]=(0,i.useState)(null),aP=(0,i.useRef)(0);(0,i.useEffect)(()=>
1{if(!ab){aL(null);return}let e=URL.createObjectURL(ab);return aL(e),()=>URL.revokeObjectURL(e)},[ab]);let[aU,aA]=(0,i.useState)(6),[aI,aM]=(0,i.useState)("auto"),[aO,aZ]=(0,i.useState)("720p"),[aF,aE]=(0,i.useState)(tg(Y)),[aD,aT]=(0,i.useState)("3:2"),[aV,aW]=(0,i.useState)(5),[aK,aB]=(0,i.useState)(E),[aG,aH]=(0,i.useState)(D),[aq,aX]=(0,i.useState)(5),[aJ,aQ]=(0,i.useState)(K),[aY,a$]=(0,i.useState)(B),[a0,a1]=(0,i.useState)(!1),[a2,a5]=(0,i.useState)("upload"),[a3,a4]=(0,i.useState)(null),[a8,a6]=(0,i.useState)(""),[a7,a9]=(0,i.useState)("idle"),[re,rt]=(0,i.useState)(null),[ra,rr]=(0,i.useState)(!1),[ri,rs]=(0,i.useState)(""),[rl,ro]=(0,i.useState)(""),[rn,rd]=(0,i.useState)([]),[rc,ru]=(0,i.useState)([]),[rp,rm]=(0,i.useState)(!0),[rx,rg]=(0,i.useState)(!1),[rh,rb]=(0,i.useState)(!1),[ry,rf]=(0,i.useState)(""),[rw,rv]=(0,i.useState)(!1),[rj,rN]=(0,i.useState)("zh"),[rk,rz]=(0,i.useState)(!1),[rS,rC]=(0,i.useState)(!1),[r_,rR]=(0,i.useState)(!1),[rL,rP]=(0,i.useState)(!1),[rU,rA]=(0,i.useState)(!1),[rI,rM]=(0,i.useState)(5),[rO,rZ]=(0,i.useState)("16:9"),[rF,rE]=(0,i.useState)("720p"),[rD,rT]=(0,i.useState)(5),[rV,rW]=(0,i.useState)("16:9"),[rK,rB]=(0,i.useState)(!0),[rG,rH]=(0,i.useState)(!1),[rq,rX]=(0,i.useState)("upload"),[rJ,rQ]=(0,i.useState)(null),[rY,r$]=(0,i.useState)(""),[r0,r1]=(0,i.useState)("idle"),[r2,r5]=(0,i.useState)(null),[r3,r4]=(0,i.useState)(!1),[r8,r6]=(0,i.useState)(6),[r7,r9]=(0,i.useState)("auto"),[ie,it]=(0,i.useState)("1080p"),[ia,ir]=(0,i.useState)(!1),[ii,is]=(0,i.useState)("upload"),[il,io]=(0,i.useState)(null),[id,ic]=(0,i.useState)(""),[iu,ip]=(0,i.useState)("idle"),[im,ix]=(0,i.useState)(null),[ig,ih]=(0,i.useState)(!1),[ib,iy]=(0,i.useState)(!1),[iw,iv]=(0,i.useState)("upload"),[ij,iN]=(0,i.useState)(null),[ik,iz]=(0,i.useState)(""),[iS,iC]=(0,i.useState)("idle"),[i_,iR]=(0,i.useState)(null),[iL,iP]=(0,i.useState)(!1),[iU,iA]=(0,i.useState)([]),[iI,iM]=(0,i.useState)({}),iO=iU.length<3,iZ=tz||iL||r3||ra||r_||rS||rL||rU||ig||au||az||aC,iF=tR?"Generowanie...":aC?"Sprawdzam dźwięk...":iZ?"Przesyłam...":"Generuj wideo",iE=tR||iZ||tE||tv&&!eT.trim()||!1,iD=(e,t,a)=>{iM(r=>({...r,[e]:{...r[e]||{},[t]:a}}))},iT=(e,t)=>{iA(a=>a.map(a=>a.id===e?{...a,...t}:a))},iV=e=>{iA(t=>t.filter(t=>t.id!==e)),iM(t=>{let a={...t};return delete a[e],a})},[iW,iK]=(0,i.useState)(6),[iB,iG]=(0,i.useState)("landscape_4_3"),[iH,iq]=(0,i.useState)(!1),[iX,iJ]=(0,i.useState)(!1),[iQ,iY]=(0,i.useState)(!1),[i$,i0]=(0,i.useState)(["detailer"]),i1=e=>{ej(e),e_(!1),eL(null),eG(""),ru([]),rR(!1),"sora"===e.type?(tG("portrait"),tq("large")):"veo"===e.type?tJ("16:9"):"minimaxH3"===e.type?(t8(5),t7(eM)):"wan"===e.type||e0(e)?(aP.current+=1,tY(e8(e)),t0(e6(e)),t2(e7(e)),e1(e)&&t3(!1),ru([]),rR(!1),ae(!1),aa("upload"),ai(null),al(""),an("idle"),ac(null),ax(!1),ah("upload"),ay(null),aw(""),aj(null),ak(0),aS(!1),a_(!1)):"ltx2"===e.type?(iK(6),iG("landscape_4_3"),i0(["detailer"])):"seedance15"===e.type?(aW(5),aB(E),aH(D),rH(!1),rX("upload"),rQ(null),r$(""),r1("idle"),r5(null)):"seedance20"===e.type?(aX(5),aQ(K),a$(B),a1(!1),a5("upload"),a4(null),a6(""),a9("idle"),rt(null),rs(""),ro(""),rd([]),rm(!0),rg(!1),rb(!1),rf(""),rv(!1),rN("zh"),rz(!1)):"ltx23"===e.type?(r6(e.supportedDurations[0]||6),r9("auto"),it("1080p"),ir(!1),is("upload"),io(null),ic(""),ip("idle"),ix(null)):"grok"===e.type?(aA(6),aM("auto"),aZ("720p")):"grokVideo3"===e.type?(aE(6),aT("3:2")):"vidu"===e.type?(rM(5),rZ("16:9"),rE("720p")):"kling"===e.type&&(rT(5),rW("16:9"),rB(!0),iy(!1),iv("upload"),iN(null),iz(""),iC("idle"),iR(null),iA([]),iM({}))};(0,i.useEffect)(()=>{if(!eC)return;eL(tp.get(ew.id)||null);let e=e=>{let t=eh.current;t&&!t.contains(e.target)&&(e_(!1),eL(null))},t=e=>{"Escape"===e.key&&(e_(!1),eL(null))};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[eC,ew.id]),(0,i.useEffect)(()=>{try{let e=sessionStorage.getItem("imageToVideoRemixPrompt");if(e){let t=JSON.parse(e);(null==t?void 0:t.prompt)&&eV(t.prompt),sessionStorage.removeItem("imageToVideoRemixPrompt")}}catch(e){console.warn("Failed to load remix prompt",e)}},[]),(0,i.useEffect)(()=>
1{if(!eH){eG("");return}eG("")},[eH,null==ew?void 0:ew.id]);let i2=async function(){let{imageUrl:e="",sourceFile:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=String(e||"").trim();if(a){G.push(ti(a));return}if(t)try{let e=await tr(t);if(!e)throw Error("Brakujące dane źr\xf3dłowe");sessionStorage.setItem("imageToImageSourceHandoff",JSON.stringify({timestamp:Date.now(),name:t.name||"source-image.png",type:t.type||"image/png",dataUrl:e}));let a=new URLSearchParams({model:"nanobanana-pro",sourceHandoff:"1",prompt:ed});G.push("/image-to-image?".concat(a.toString()))}catch(e){console.error("Failed to hand off source image for restyling:",e),tO("Nie mogę teraz przekazać tego lokalnego obrazu Nano Banana Pro. Proszę, najpierw go przesłaj lub użyj adresu URL obrazu.")}},i5=()=>{if("minimaxH3"===ew.type)return ew.calculateCredits(t4,t6);if("wan"===ew.type||e3)return ew.calculateCredits(t$,tQ);if("ltx2"===ew.type){let e=ew.supportedVideoSizes.find(e=>e.value===iB);if(e)return ew.calculateCredits(iW,e)}return"seedance15"===ew.type?ew.calculateCredits(aV,aG,aK):"seedance20"===ew.type?ew.calculateCredits(aq,aY):"ltx23"===ew.type?ew.calculateCredits(r8,ie):"grok"===ew.type?ew.calculateCredits(aU):"grokVideo3"===ew.type?ew.calculateCredits(aF):"vidu"===ew.type?ew.calculateCredits(rI,rF):"kling"===ew.type?ew.calculateCredits(rD,rK):ew.credits};"seedance15"===ew.type&&ew.calculateUsdCost(aV,aG,aK),"seedance15"===ew.type&&ew.calculateTokens(aV,aG,aK);let i3=e3?25:te||tw?ew.getCreditsPerSecond(tQ):eS(tQ),i4=null===(t=ew.getOriginalCreditsPerSecond)||void 0===t?void 0:t.call(ew,tQ),i8=!!(ew.discountLabel&&Number.isFinite(i4)&&Number.isFinite(i3)&&i4>i3),i6="grokVideo3"===ew.type?ex(aF):null,i7=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{if(!P)return t;let a=e.split("."),r=P;for(let e of a){if(null==r)return t;r=r[e]}return null==r?t:r}catch(e){return t}},i9=function(e){var t,a;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=null!==(a=null==e?void 0:null===(t=e.response)||void 0===t?void 0:t.data)&&void 0!==a?a:e;return[null==i?void 0:i.details,null==i?void 0:i.message,null==i?void 0:i.error,null==e?void 0:e.message].find(e=>"string"==typeof e&&e.trim())||r},se=()=>td?sa()[0]||"":"upload"===eE?tC:(null==ew?void 0:ew.type)==="seedance20"?si(eA):eA.trim(),st=e=>String(e||"").split("\n").map(e=>e.trim()).filter(Boolean),sa=()=>td?"upload"===eE?rc.length>0?rc.filter(Boolean).slice(0,9):tC?[tC]:[]:st(eA).slice(0,9):[],sr=(e,t)=>Array.from(new Set([...st(e),...t])).join("\n"),si=e=>st(e)[0]||"",ss=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"video",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12e3,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"anonymous";return new Promise((i,s)=>{let l=a=>{let i=Error(a);return i.code=a,i.url=e,i.mediaType=t,i.crossOrigin=r||"none",i};if("undefined"==typeof document){s(l("METADATA_UNAVAILABLE"));return}let o="video"===t,n=document.createElement(o?"video":"audio"),d=!1,c=()=>{n.onloadedmetadata=null,n.onerror=null,clearTimeout(p),n.removeAttribute("src");try{var e;null===(e=n.load)||void 0===e||e.call(n)}catch(e){}},u=e=>{d||(d=!0,c(),e())},p=setTimeout(()=>{u(()=>s(l("METADATA_TIMEOUT")))},a);n.preload="metadata",r&&(n.crossOrigin=r),n.onloadedmetadata=()=>{let t=Number(n.duration);if(!Number.isFinite(t)||t<=0){u(()=>s(l("INVALID_DURATION")));return}if(o){let a=Number(n.videoWidth),r=Number(n.videoHeight);if(!Number.isFinite(a)||!Number.isFinite(r)||a<=0||r<=0){u(()=>s(l("INVALID_VIDEO_RESOLUTION")));return}u(()=>i({url:e,duration:t,width:a,height:r}));return}u(()=>i({url:e,duration:t}))},n.onerror=()=>{u(()=>s(l("METADATA_LOAD_FAILED")))},n.src=e})},sl=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"video",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12e3;try{return await ss(e,t,a,"anonymous")}catch(r){if(!new Set(["METADATA_LOAD_FAILED","METADATA_TIMEOUT"]).has(null==r?void 0:r.code))throw r;return ss(e,t,a,null)}},so=async()=>{let e=eT.trim();if(!e){eG(i7("errors.enterPrompt","Proszę wpisać prompt"));return}eK(!0),eG("");try{var t,a;
1let r=se(),i=(null==ew?void 0:ew.type)==="grokVideo3"?"Grok Video 3":"Grok Imagine Video",s=(null==ew?void 0:ew.type)==="grokVideo3"?aF:aU,l=(null==ew?void 0:ew.type)==="grokVideo3"?aD:aI,o=(null==ew?void 0:ew.type)==="grokVideo3"?eu:aO,n=(null==ew?void 0:ew.type)==="grokVideo3"?"Zoptymalizuj ten prompt przekształcania obrazu w wideo dla Grok Video 3. Zachowaj gł\xf3wny temat i kompozycję z obrazu, jeśli są obecne. Skup się na ruchu filmowym, sp\xf3jności czasowej i silnym wizualnym opowiadaniu historii.":"Zoptymalizuj ten prompt przekształcania obrazu w wideo dla Grok Imagine Video. Zachowaj gł\xf3wny temat i kompozycję z obrazu, jeśli są obecne.",d=await S.Z.post("/api/edit-prompt",{prompt:e,imageUrl:r||void 0,context:n,targetModel:i,durationSeconds:s,aspectRatio:l,resolution:o,variations:4},{headers:{"X-App-Auth":"api-secret-videoany-2025"}}),c=Array.isArray(null==d?void 0:null===(t=d.data)||void 0===t?void 0:t.optimized_prompt_options)?d.data.optimized_prompt_options:Array.isArray(null==d?void 0:null===(a=d.data)||void 0===a?void 0:a.options)?d.data.options:[];if(!c.length)throw Error("Brak zoptymalizowanych opcji promptu");let u=c.map(e=>"string"==typeof e?e.trim():"string"==typeof(null==e?void 0:e.prompt)?e.prompt.trim():"").find(Boolean);if(!u)throw Error("Nie zwraca się żaden użyteczny zoptymalizowany prompt");eV(u),eG("")}catch(e){console.error("Prompt optimization failed:",e),eG(i9(e,"Nie udało się zoptymalizować promptu"))}finally{eK(!1)}}
1,sn=async function(e){let{setLoading:t=tS,onUploadedUrl:a=t_,maxFileSizeMb:r=10,errorLabel:i="Image"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t(!0),tO(null);try{let t=1048576*r;if((null==e?void 0:e.size)>t)throw tO("".concat(i," jest za duży. Prześlij plik mniejszy niż ").concat(r," MB.")),Error("FILE_TOO_LARGE");let{url:s}=await (0,I.C)({file:e,userId:ef.id,maxFileSizeMB:r});return"function"==typeof a&&a(s),s}catch(e){if(console.error("Upload error:",e),(null==e?void 0:e.code)==="FILE_TOO_LARGE"||/File size exceeds/i.test((null==e?void 0:e.message)||"")){let t=Number(null==e?void 0:e.maxFileSizeMB)||r;tO("".concat(i," jest za duży. Prześlij plik mniejszy niż ").concat(t," MB."))}else tO(i9(e,i7("errors.uploadFailed","Nie udało się przesłać obrazu")));throw e}finally{t(!1)}},sd=async function(e){let{setLoading:t,onUploadedUrl:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(null==ef?void 0:ef.id))throw Error("Użytkownik nie uwierzytelniony");"function"==typeof t&&t(!0),tO(null);try{let{url:t}=await (0,M.Vk)({file:e,userId:ef.id,maxFileSizeMB:50,uploadPurpose:"image-to-video-reference"});return"function"==typeof a&&a(t),t}catch(e){throw console.error("Video upload error:",e),tO("string"==typeof e&&e.trim()?e:i9(e,i7("errors.uploadFailed","Nie udało się przesłać wideo"))),e}finally{"function"==typeof t&&t(!1)}}
1,sc=async function(e,t){let{setLoading:a,onUploadedUrl:r,maxFileSizeMb:i,errorLabel:s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(null==ef?void 0:ef.id))throw Error("Użytkownik nie uwierzytelniony");"function"==typeof a&&a(!0),tO(null);try{let a=new FormData;a.append("file",e),a.append("userId",ef.id),a.append("fileCategory",t),Number.isFinite(i)&&i>0&&a.append("maxFileSizeMB",String(i));let s=(await S.Z.post("/api/upload-file",a,{headers:{"Content-Type":"multipart/form-data","X-App-Auth":"api-secret-videoany-2025"}})).data.url;return"function"==typeof r&&r(s),s}catch(e){var l,o;throw console.error("".concat(t," upload error:"),e),/File size exceeds/i.test((null==e?void 0:null===(o=e.response)||void 0===o?void 0:null===(l=o.data)||void 0===l?void 0:l.error)||(null==e?void 0:e.message)||"")&&Number.isFinite(i)&&i>0?tO("".concat(s||"Plik"," jest za duży. Prześlij plik mniejszy niż ").concat(i," MB.")):tO(i9(e,i7("errors.uploadFailed","Przesłanie nie powiodło się"))),e}finally{"function"==typeof a&&a(!1)}},su=()=>t9?"upload"===at?ad||"":as.trim():"",sp=()=>am?"upload"===ag?av||"":af.trim():"",sm=e=>{let t=Number(e);return!Number.isFinite(t)||t<=0?(tO("Nie można określić czasu trwania dźwięku. Prosimy o przesłanie pliku lub użycie bezpośredniego adresu URL MP3/WAV."),!1):!(t<2)&&!(t>30)||(tO("Dźwięk dla ".concat(tn," musi trwać od ").concat(2," do ").concat(30," s.")),!1)},sx=async function(e){let{reportInvalidUrl:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=String(e||"").trim(),r=++aP.current;if(!a)return a_(!1),ak(0),t||tO(null),0;if(!eJ(a))return a_(!1),ak(0),t&&tO("Proszę wpisać ważny adres URL audio."),0;a_(!0),tO(null);try{let e=await e$(a);if(aP.current!==r||(ak(e),a_(!1),!sm(e)))return 0;return e}catch(e){if(aP.current!==r)return 0;return console.error("Failed to detect ".concat(tn," audio duration:"),e),ak(0),a_(!1),tO("Nie można wykryć czasu trwania dźwięku z tego adresu URL. Prosimy o bezpośredni adres URL pliku MP3/WAV lub przesłanie nagrania audio."),0}},sg=async e=>{let t=Array.from(e.target.files||[]);if(!t.length)return;if((null==ew?void 0:ew.type)==="seedance20"){try{await sS(t)}finally{e.target.value=""}return}if(td){try{await sC(t)}finally{e.target.value=""}return}let a=t[0];if(t_(null),ru([]),eU(a),null==ef?void 0:ef.id)try{await sn(a,{maxFileSizeMb:e3?20:10})}catch(e){console.error("Failed to upload image:",e)}},sh=()=>{var e;null===(e=ea.current)||void 0===e||e.click()},sb=async e=>{e.preventDefault();let t=Array.from(e.dataTransfer.files||[]);if(!t.length)return;if((null==ew?void 0:ew.type)==="seedance20"){await sS(t);return}if(td){await sC(t);return}let a=t.find(e=>String((null==e?void 0:e.type)||"").startsWith("image/"));if(a&&(t_(null),ru([]),eU(a),null==ef?void 0:ef.id))try{await sn(a,{maxFileSizeMb:e3?20:10})}catch(e){console.error("Failed to upload image:",e)}},sy=()=>{var e;null===(e=ei.current)||void 0===e||e.click()},sf=()=>{var e;null===(e=el.current)||void 0===e||e.click()},sw=()=>{var e;null===(e=ec.current)||void 0===e||e.click()},sv=()=>{var e;null===(e=ep.current)||void 0===e||e.click()},sj=()=>{var e;null===(e=em.current)||void 0===e||e.click()},sN=async e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a&&(iR(null),iN(a),null==ef?void 0:ef.id))try{await sn(a,{setLoading:iP,onUploadedUrl:iR})}catch(e){console.error("Failed to upload end image:",e)}},sk=async e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a&&(r5(null),rQ(a),null==ef?void 0:ef.id))try{await sn(a,{setLoading:r4,onUploadedUrl:r5})}catch(e){console.error("Failed to upload seedance15 end image:",e)}},sz=async e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a&&(rt(null),a4(a),null==ef?void 0:ef.id))try{await sn(a,{setLoading:rr,onUploadedUrl:rt})}catch(e){console.error("Failed to upload seedance20 end image:",e)}},sS=async e=>{let t=Array.from(e||[]).filter(e=>String((null==e?void 0:e.type)||"").startsWith("image/"));if(!t.length)return;let a=a0?1:9,r=t.slice(0,a);if(t.length>
1a?tO(a0?"image_with_roles pozwala tylko na jeden obraz źr\xf3dłowy":"Source Images obsługuje do 9 plik\xf3w"):tO(null),t_(null),eU(r[0]||null),rd([]),null==ef?void 0:ef.id){rC(!0);try{let e=[];for(let t of r){let a=await sn(t,{setLoading:()=>{},onUploadedUrl:()=>{}});e.push(a)}t_(e[0]||null),rd(e)}catch(e){console.error("Failed to upload Seedance 2.0 source images:",e)}finally{rC(!1)}}},sC=async e=>{let t=Array.from(e||[]).filter(e=>String((null==e?void 0:e.type)||"").startsWith("image/"));if(!t.length)return;let a=t.slice(0,9);if(t.length>9?tO("Source Images obsługuje do 9 plik\xf3w"):tO(null),t_(null),eU(a[0]||null),ru([]),null==ef?void 0:ef.id){rR(!0);try{let e=[];for(let t of a){let a=await sn(t,{setLoading:()=>{},onUploadedUrl:()=>{},maxFileSizeMb:10});e.push(a)}t_(e[0]||null),ru(e)}catch(e){console.error("Failed to upload Happy Horse source images:",e)}finally{rR(!1)}}},s_=async e=>{let t=Array.from(e.target.files||[]);if(t.length&&(null==ef?void 0:ef.id)){if(a0){tO("Gdy image_with_roles jest włączone, nie można używać wideo referencyjnego"),e.target.value="";return}if(st(ri).length+t.length>3){tO("Reference Videos obsługuje do 3 adres\xf3w URL"),e.target.value="";return}rP(!0);try{let e=[];for(let a of t){let t=await sd(a,{setLoading:()=>{},onUploadedUrl:()=>{}});e.push(t)}rs(t=>sr(t,e))}catch(e){console.error("Failed to upload Seedance 2.0 reference videos:",e)}finally{rP(!1),e.target.value=""}}},sR=async e=>{let t=Array.from(e.target.files||[]);if(t.length&&(null==ef?void 0:ef.id)){if(a0){tO("Gdy image_with_roles jest włączone, nie można używać wideo referencyjnego"),e.target.value="";return}if(st(rl).length+t.length>3){tO("Reference Audios obsługuje do 3 adres\xf3w URL"),e.target.value="";return}rA(!0);try{let e=[];for(let a of t){let t=await sc(a,"audio",{setLoading:()=>{},onUploadedUrl:()=>{},maxFileSizeMb:20,errorLabel:"Audio"});e.push(t)}ro(t=>sr(t,e))}catch(e){console.error("Failed to upload Seedance 2.0 reference audios:",e)}finally{rA(!1),e.target.value=""}}},sL=async e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a&&(ix(null),io(a),null==ef?void 0:ef.id))try{await sn(a,{setLoading:ih,onUploadedUrl:ix})}catch(e){console.error("Failed to upload ltx23 end image:",e)}},sP=async e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(a&&(ac(null),ai(a),null==ef?void 0:ef.id))try{await sn(a,{setLoading:ap,onUploadedUrl:ac,maxFileSizeMb:20,errorLabel:"Obraz końcowy"})}catch(e){console.error("Failed to upload ".concat(tn," end image:"),e)}},sU=async e=>{var t,a;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];if(r){if(r.size>15728640){tO("Plik audio jest za duży. Prześlij plik mniejszy niż ".concat(15," MB."));return}if(!e9(r)){tO("".concat(tn," audio upload only supports MP3 or WAV files."));return}if(!(null==ef?void 0:ef.id)){null==ey||null===(a=ey.setShowLoginModal)||void 0===a||a.call(ey,!0);return}ay(r),aj(null),ak(0),tO(null);try{let e=await eY(r);if(!sm(e))return;ak(e),await sc(r,"audio",{setLoading:aS,onUploadedUrl:aj,maxFileSizeMb:15,errorLabel:"Audio"})}catch(e){console.error("Failed to upload ".concat(tn," audio:"),e)}}},sA=async function(e,t){let{strategy:a="attempts"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r="string"==typeof t&&t.startsWith("/api/fal-seedance-15"),i="string"==typeof t&&t.startsWith("/api/fal-wan-27-video"),s=r||i,l=s?36:60,o=e=>!s||e<=6?5e3:e<=18?8e3:12e3;eN({taskId:e,apiEndpoint:t,strategy:a,userId:(null==ef?void 0:ef.id)||null,modelId:(null==ew?void 0:ew.id)||(null==ew?void 0:ew.type)||null});let n=Date.now()+3e5,d=0,c=async()=>{let r=Date.now();if("time"===a&&r>=n){tF(!0),tO("To trwa dłużej niż się spodziewałem. Tw\xf3j film nadal generuje się w tle."),tL(!1);return}let i=new AbortController,s=setTimeout(()=>i.abort(),3e4);try{let r=await S.Z.get("".concat(t,"?id=").concat(e),{headers:{"X-App-Auth":"api-secret-videoany-2025"},timeout:3e4,signal:i.signal});if("completed"===r.data.status&&r.data.video_url)return ez(),tU(r.data),tI(null),tL(!1),tF(!1),V(),!0;if("failed"===r.data.status)return ez(),tO(i9(r.data,"Generowanie wideo nie udało się")),tI(null),tL(!1),tF(!1),V(),!0;if(d++,"time"!==a&&d>
1=l){tF(!0),tO("To trwa dłużej niż się spodziewałem. Tw\xf3j film nadal generuje się w tle."),tL(!1);return}setTimeout(c,o(d))}catch(s){var u;console.error("Polling error:",s);let e=null==s?void 0:null===(u=s.response)||void 0===u?void 0:u.status,t=i9(s,null),r=e>=400&&e<500&&408!==e&&429!==e,i=500===e&&/status code 422/i.test(String(t||""));if(r||i){r&&422!==e&&(ez(),tI(null)),tO(t||"Generowanie wideo nie udało się"),tL(!1),tF(!1);return}if(d++,"time"!==a&&d>=l){tF(!1),tO("Nie sprawdzono statusu generowania"),tL(!1);return}setTimeout(c,o(d))}finally{clearTimeout(s)}};c()};(0,i.useEffect)(()=>{if(!(null==ef?void 0:ef.id)||tR||tA||(null==tP?void 0:tP.video_url))return;let e=ek();if(e){if(e.userId!==ef.id){ez();return}tI(e.taskId),tO(null),tF(!1),tL(!0),sA(e.taskId,e.apiEndpoint,{strategy:e.strategy||"attempts"})}},[null==tP?void 0:tP.video_url,tR,tA,null==ef?void 0:ef.id]);let sI=async()=>{var e,t,a;if((0,U.Bo)(U.Ck.GENERATE_CLICK,2e3,{props:{tool:"ImageToVideoStudio",model:(null==ew?void 0:ew.id)||(null==ew?void 0:ew.type)||"unknown"}}),!(null==ef?void 0:ef.id)){null==ey||null===(e=ey.setShowLoginModal)||void 0===e||e.call(ey,!0);return}let r=eT.trim();if(tv&&!r){tO(i7("errors.enterPrompt","Proszę wpisać prompt"));return}if(e3&&r.length>5e3){tO("Prompt dla ".concat(tn," może mieć maksymalnie ").concat(5e3," znak\xf3w."));return}if("kling"===ew.type&&r.length>2500){tO("Prompt dla Kling 3 może mieć maksymalnie ".concat(2500," znak\xf3w."));return}let i=se();if(!i&&("veo"===ew.type||"wan"===ew.type||"minimaxH3"===ew.type||e3||"ltx2"===ew.type||"grok"===ew.type||"grokVideo3"===ew.type||"kling"===ew.type||"vidu"===ew.type||"seedance15"===ew.type||"seedance20"===ew.type||"ltx23"===ew.type)){tO("Proszę przesłać obraz lub wpisać adres URL obrazu");return}tO(null),tF(!1),tL(!0),tU(null),tI(null),ez();try{let e=i5(),t={userId:ef.id,prompt:r,model:ew.requestModelId||ew.id,creditCost:e};i&&(t.imageUrl=i);let a="/api/generate-yunwu-video";if("wan"===ew.type||e3){if("wan2.5-i2v-preview"===ew.id)a="/api/fal-wan-25",t.mode="image-to-video",t.image_url=i,t.resolution=tQ.toLowerCase(),t.duration=t$,t.enable_safety_checker=!1,t.user_id=ef.id,t.credits=e,delete t.userId,delete t.creditCost,delete t.model,delete t.imageUrl;else if(e3){let r=su(),s=sp();if("url"===eE&&!eJ(i)){tO("Proszę podać ważny adres URL zdjęcia źr\xf3dłowego."),tL(!1);return}if(t9){if(!r){tO("Proszę przesłać końcowy obraz lub podać adres URL końcowego obrazu"),tL(!1);return}if("url"===at&&!eJ(r)){tO("Proszę wpisać ważny adres URL końcowego obrazu."),tL(!1);return}}if(am){if(!s){tO("Proszę przesłać nagranie audio lub podać adres URL audio"),tL(!1);return}if("url"===ag&&!eJ(s)){tO("Proszę wpisać ważny adres URL audio."),tL(!1);return}let e=aN;if("url"!==ag||e||(e=await sx(s,{reportInvalidUrl:!0})),!sm(e)){tL(!1);return}}a="/api/fal-wan-27-video",t.mode="image-to-video",t.image_url=i,t.resolution=tQ,t.duration=t$,t.negative_prompt="low resolution, errors, worst quality, low quality, incomplete, extra fingers, bad proportions, blurry, distorted",t.enable_prompt_expansion=!0,t.enable_safety_checker=!1,t9&&r&&(t.end_image_url=r),am&&s&&(t.audio_url=s),t.user_id=ef.id,t.credits=e,delete t.userId,delete t.creditCost,delete t.model,delete t.imageUrl}else if(te)a="/api/wavespeed-wan-3",t.mode="image-to-video",t.image=i,t.prompt=r,t.resolution=tQ,t.duration=Number(t$),t.thinking_mode=t5,"auto"!==t1&&(t.aspect_ratio=t1),t.client_model_id=ew.id,t.display_model_name=ew.name,t.user_id=ef.id,t.credits=e,delete t.userId,delete t.creditCost,delete t.model,delete t.imageUrl;else if(tf)a="/api/wavespeed-happy-horse",t.mode="image-to-video",t.image=i,t.resolution=tQ,t.duration=Number(t$),t.enable_safety_checker=!1,t.client_model_id=ew.id,t.display_model_name=ew.name,r&&(t.prompt=r),t.user_id=ef.id,t.credits=e,delete t.userId,delete t.creditCost,delete t.model,delete t.imageUrl;else if(td){let i=sa();if(!i.length){tO("Proszę przesłać obraz lub wpisać adres URL obrazu"),tL(!1);return}let s=i.findIndex(e=>!eJ(e));if(s>=0){tO("Wpisz prawidłowy adres URL obrazu źr\xf3dłowego w wierszu ".concat(s+1,".")),tL(!1);return}let l=i.length>1;if(l&&!r){tO("Prompt jest wymagany przy użyciu wielu obraz\xf3w źr\xf3dłowych."),tL(!1);return}a="/api/fal-happy-horse",t.mode=l?"reference-to-video":"image-to-vi
1deo",t.resolution=tQ,t.duration=Number(t$),t.aspect_ratio=t1,t.enable_safety_checker=!1,l?(t.image_urls=i,t.prompt=r):(t.image_url=i[0],r&&(t.prompt=r)),t.user_id=ef.id,t.credits=e,delete t.userId,delete t.creditCost,delete t.model,delete t.imageUrl}else a="/api/generate-yunwu-video-alibailian",t.resolution=tQ,t.duration=t$,t.prompt_extend=!0,t.audio=!0,t.watermark=!1}else if("minimaxH3"===ew.type){if(!eJ(i)){tO("Proszę podać prawidłowy publiczny adres URL obrazu źr\xf3dłowego."),tL(!1);return}a="/api/wavespeed-minimax-h3",t.mode="image-to-video",t.image=i,t.prompt=r,t.resolution=t6,t.duration=t4,t.client_model_id=ew.id,t.user_id=ef.id,delete t.userId,delete t.creditCost,delete t.model,delete t.imageUrl}else if("sora"===ew.type)t.orientation=tB,t.size=tH,t.watermark=!1,t.private=!0;else if("veo"===ew.type)t.aspect_ratio=tX,t.enable_upsample=!0,t.enhance_prompt=!0;else if("seedance20"===ew.type){let s=a0?"upload"===a2?re:a8.trim():null,l=st(ri),o=st(rl),n="url"===eE?st(eA):(rn.length>0?rn:[i]).filter(Boolean);if(a0&&!i){tO("Prosimy o przesłanie zdjęcia referencyjnego przed włączeniem image_with_roles"),tL(!1);return}if(!a0&&n.length>9){tO("Source Images obsługuje do 9 adres\xf3w URL"),tL(!1);return}if(a0&&n.length>1){tO("image_urls i image_with_roles nie mogą być używane razem"),tL(!1);return}if(l.length>3){tO("Reference Videos obsługuje do 3 adres\xf3w URL"),tL(!1);return}if(o.length>3){tO("Reference Audios obsługuje do 3 adres\xf3w URL"),tL(!1);return}if(a0&&(l.length>0||o.length>0)){tO("Gdy image_with_roles jest włączone, nie można używać wideo referencyjnego"),tL(!1);return}let d=n.length>0||!!i;if(o.length>0&&!d&&0===l.length){tO("Dźwięk referencyjny wymaga co najmniej jednego obrazu referencyjnego lub wideo referencyjnego"),tL(!1);return}if(l.length>0){let e=[];try{e=await Promise.all(l.map(e=>sl(e,"video")))}catch(t){let e=(null==t?void 0:t.url)||"";tO(e?"Nie udało się zweryfikować metadanych wideo referencyjnego: ".concat(e,". Użyj bezpośrednich publicznych adres\xf3w URL wideo."):"Nie mogę zweryfikować metadanych wideo referencyjnego. Używaj bezpośrednich publicznych adres\xf3w wideo."),tL(!1);return}if(e.find(e=>{let t=Math.min(e.width,e.height);return t<480||t>720})){tO("Rozdzielczość wideo referencyjna musi wynosić od 480p do 720p"),tL(!1);return}if(e.reduce((e,t)=>e+t.duration,0)>15.01){tO("Całkowity czas trwania film\xf3w referencyjnych musi wynosić 15 sekund lub mniej"),tL(!1);return}}if(o.length>0){let e=[];try{e=await Promise.all(o.map(e=>sl(e,"audio")))}catch(t){let e=(null==t?void 0:t.url)||"";tO(e?"Nie udało się zweryfikować metadanych audio referencyjnego: ".concat(e,". Użyj bezpośrednich publicznych adres\xf3w URL audio."):"Nie mogę zweryfikować metadanych audio referencyjnych. Używaj bezpośrednich publicznych adres\xf3w audio URL."),tL(!1);return}if(e.reduce((e,t)=>e+t.duration,0)>15.01){tO("Całkowity czas trwania audio referencyjnych musi wynosić 15 sekund lub mniej"),tL(!1);return}}let c=String(ry||"").trim(),u=c?Number.parseInt(c,10):void 0;if(c&&!Number.isFinite(u)){tO("Seed musi być liczbą całkowitą"),tL(!1);return}a="/api/api-market-seedance-2",t.mode="image-to-video",t.duration=aq,t.aspect_ratio=aJ,t.resolution=aY,t.generate_audio=rp,t.return_last_frame=rx,t.camera_fixed=rh,t.language=rj,t.user_id=ef.id,t.credits=e,r||delete t.prompt,Number.isFinite(u)&&(t.seed=u),rw&&(t.tools=[{t
1ype:"web_search"}]),a0?t.image_with_roles=[{url:i,role:"first_frame"},...s?[{url:s,role:"last_frame"}]:[]]:t.image_urls=n,l.length>0&&(t.video_urls=l),o.length>0&&(t.audio_urls=o),delete t.userId,delete t.creditCost,delete t.imageUrl}else if("seedance15"===ew.type){let r=rG?"upload"===rq?r2:rY.trim():null;if(rG&&!r){tO("Proszę przesłać końcowy obraz lub podać adres URL końcowego obrazu"),tL(!1);return}a="/api/fal-seedance-15",t.mode="image-to-video",t.duration=aV,t.aspect_ratio=aK,t.resolution=aG,t.image_url=i,r&&(t.end_image_url=r),t.enable_safety_checker=!1,t.generate_audio=!0,t.user_id=ef.id,t.credits=e,delete t.userId,delete t.creditCost,delete t.model,delete t.imageUrl}else if("ltx23"===ew.type){let r=ia?"upload"===ii?im:id.trim():null;if(ia&&!r){tO("Proszę przesłać końcowy obraz lub podać adres URL końcowego obrazu"),tL(!1);return}a="/api/fal-ltx-2-3",t.mode="image-to-video",t.variant=ew.variant||"fast",t.duration=r8,t.resolution=ie,t.aspect_ratio=r7,t.fps=25,t.generate_audio=!0,t.image_url=i,r&&(t.end_image_url=r),t.user_id=ef.id,t.credits=e,delete t.userId,delete t.creditCost,delete t.model,delete t.imageUrl}else if("grokVideo3"===ew.type)a="/api/generate-yunwu-video-grok",t.model=ex(aF).model,t.prompt=eg(r),t.aspect_ratio=aD,t.size=eu;else if("grok"===ew.type)a="/api/fal-grok-imagine-video",t.mode="image-to-video",t.duration=aU,t.aspect_ratio=aI,t.resolution=aO,t.image_url=i,t.user_id=ef.id,t.credits=e,delete t.userId,delete t.creditCost,delete t.model,delete t.imageUrl;else if("kling"===ew.type){let r=ib?"upload"===iw?i_:ik.trim():null;if(iU.length>3){tO("Kling 3 supports up to ".concat(3," elements.")),tL(!1);return}let s=(iU||[]).map(e=>{if((null==e?void 0:e.kind)==="video"){let t="string"==typeof(null==e?void 0:e.video_url)?e.video_url.trim():"";return t?{video_url:t}:null}if((null==e?void 0:e.kind)==="image"){let t="string"==typeof(null==e?void 0:e.frontal_image_url)?e.frontal_image_url.trim():"",a=Array.isArray(null==e?void 0:e.reference_image_urls)?e.reference_image_urls.filter(e=>"string"==typeof e&&e.trim()).map(e=>e.trim()):[];return t&&0!==a.length?{frontal_image_url:t,reference_image_urls:a}:null}return null}).filter(Boolean);if((iU||[]).some(e=>{if(!e)return!1;if("video"===e.kind)return!("string"==typeof e.video_url&&e.video_url.trim());if("image"===e.kind){let t="string"==typeof e.frontal_image_url&&e.frontal_image_url.trim(),a=Array.isArray(e.reference_image_urls)&&e.reference_image_urls.some(e=>"string"==typeof e&&e.trim());return!(t&&a)}return!0})){tO("Prosimy o uzupełnienie wszystkich element\xf3w (frontal + zdjęcia referencyjne lub URL wideo) lub usunięcie niekompletnych."),tL(!1);return}a="/api/fal-kling3",t.mode="image-to-video",t.variant=ew.variant||"standard",t.duration=rD,t.aspect_ratio=rV,t.generate_audio=rK,t.start_image_url=i,r&&(t.end_image_url=r),s.length&&(t.elements=s),t.user_id=ef.id,t.credits=e,delete t.userId,delete t.creditCost,delete t.model,delete t.imageUrl}else"vidu"===ew.type?(a="/api/fal-vidu",t.mode="image-to-video",t.duration=rI,t.resolution=rF,t.image_url=i,t.audio=!0,t.user_id=ef.id,t.credits=e,delete t.userId,delete t.creditCost,delete t.model,delete t.imageUrl):"ltx2"===ew.type&&(a="/api/fal-ltx-2",ew.supportedVideoSizes.find(e=>e.value===iB),t.num_frames=25*iW+1,t.fps=25,t.video_size=iB,t.generate_audio=!0,t.enable_safety_checker=!1,t.video_output_type="X264 (.mp4)",t.video_quality="high",t.video_write_mode="balanced",i$.length>0&&(t.loras=i$.map(e=>{let t=to.find(t=>t.id===e);return{path:t.path,scale:t.scale}})),t.user_id=ef.id,t.credits=e,delete t.userId,delete t.creditCost);let s=await S.Z.post(a,t,{headers:{"Content-Type":"application/json","X-App-Auth":"api-secret-videoany-2025"}});if("ltx2"===ew.type||"ltx23"===ew.type)"success"===s.data.status&&s.data.processed_url?tU({video_url:s.data.processed_url,task:s.data.task,fal_result:s.data.fal_result}):tO(i9(s.data,"Nie udało się wygenerować wideo")),tL(!1);else if(s.data.success&&s.data.task_id){tI(s.data.task_id),V();let e="kling"===ew.type?"time":"attempts";sA(s.data.task_id,a,{strategy:e})}else tO(i9(s.data,"Nie udało się rozpocząć generowania wideo")),tL(!1)}catch(e){console.error("Generation error:",e),ez(),tI(null),(null===(t=e.response)||void 0===t?void 0:t.status)===402?(tO(i7("errors.insufficientPoints","Niewystarczające punkty")),tD(!0),null==ey||null===(a=ey.setShowPricingModal)||void 0===a||a.call(ey,!0)):tO(i9(e,"Generowanie wideo nie udało się")),tL(!1)}},sM="seedance20"===ew.type?"url"===eE?st(eA).slice(0,9):rn.length>0?rn:eP?[URL.createObjectURL(eP)]:[]:[],sO=td?"url"===eE?st(eA).slice(0,9):rc:[],sZ="seedance20"===ew.type?st(ri).slice(0,3):[],sF="seedance20"===ew.type?st(rl).slice(0,3):[],sE="seedance20"===ew.type&&(sM[0]||se())||"",sD="seedance20"===ew.type?"upload"===a2?re||(a3?URL.createObjectURL(a3):""):a8.trim():"",sT="seedance20"===ew.type&&a0;return(0,r.jsxs)("div",{className:"p-6 md:p-10 max-w-[1800px] mx-auto relative",children:[(0,r.jsx)("div",{className:"fixed top-0 right-0 w-[500px] h-[500px] bg-gradient-to-br from-indigo-600 to-purple-600 opacity-[0.03] blur-[150px] pointer-events-none rounded-full"}),(0,r.jsx)("div",{className:"mb-10 flex flex-col md:flex-row md:items-end justify-between gap-6 relative z-10",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,r.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-widest px-2 py-0.5 rounded border border-white/10 bg-white/5 text-indigo-400",children:"Tryb Studio"})}),(0,r.jsx)("h1",{className:"text-4xl font-bold text-white mb-2 tracking-tight",children:i7("title","Obraz na wideo")}),(0,r.jsx)("p",{className:"text-gray-400 max-w-xl text-lg",children:i7("description","Przekształcaj statyczne obrazy w dynamiczne filmy za pomocą AI")})]})}),(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8 relative z-10 mb-10",children:[(0,r.jsx)("div",{className:"lg:col-span-5 xl:col-span-5 space-y-6 relative z-[80]",children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"bg-[#09090b]/60 backdrop-blur-xl border border-white/[0.08] rounded-3xl p-6 shadow-2xl relative hover:border-white/10 transition-colors z-20",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider mb-3 block",children:"Model"}),(0,r.jsxs)("div",{ref:eh,className:"relative ".concat(eC?"z-[9999]":"z-20"),children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{e_(e=>{let t=!e;return t||eL(null),t})},className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-4 text-left flex items-center justify-between hover:border-indigo-500/30 transition-all group/btn",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 flex-1",children:[(0,r.jsx)("div",{className:"w-11 h-11 rounded-full bg-gradient-to-br from-indigo-500/30 to-purple-500/30 flex items-center justify-center border border-indigo-500/40",children:(0,r.jsx)(en,{model:ew,size:20})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-medium text-white text-sm",children:ew.name}),ew.badge&&(0,r.jsx)("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded border ".concat(String(ew.badge||"").toUpperCase().includes("COMING")?"bg-amber-500/20 text-amber-300 border-amber-500/30":"bg-emerald-500/20 text-emerald-400 border-emerald-500/30"),children:ew.badge})]}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:ew.description})]})]}),(0,r.jsx)(o.Z,{size:18,className:"text-gray-400 transition-transform ".concat(eC?"rotate-180":"")})]}),eC&&(0,r.jsx)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-[#18181b] border border-white/10 rounded-xl shadow-2xl overflow-visible z-[10000] animate-fade-in",children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"max-h-[400px] overflow-y-auto scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent",children:th.map((e,t)=>{let a=t<th.length-1;if("model"===e.kind){let t=e.model;return(0,r.jsx)("div",{className:a?"border-b border-white/5":"",children:(0,r.jsx)(tb,{model:t,isSelected:ew.id===t.id,onHover:()=>eL(null),onSelect:()=>i1(t)})},t.id)}
1let i=eR===e.key,s=e.models.some(e=>e.id===ew.id),l=tc[e.key]||e.models[0];return(0,r.jsxs)("div",{children:[(0,r.jsx)(ty,{label:e.label,description:(null==l?void 0:l.description)||"Wybierz wariant",variantsCount:e.models.length,isOpen:i,isSelected:s,showDivider:a,iconModel:l,onHover:()=>eL(e.key),onToggle:()=>eL(t=>t===e.key?null:e.key)}),i&&(0,r.jsxs)("div",{className:"sm:hidden bg-black/10 ".concat(a?"border-b border-white/5":""),children:[(0,r.jsx)("div",{className:"px-4 pt-3 pb-2",children:(0,r.jsx)("div",{className:"text-[11px] text-gray-500",children:"Wybierz wariant"})}),(0,r.jsx)("div",{children:e.models.map(e=>(0,r.jsx)("div",{className:"border-t border-white/5 first:border-t-0",children:(0,r.jsx)(tb,{model:e,isSelected:ew.id===e.id,onSelect:()=>i1(e),compact:!0,indent:!0})},"mobile:".concat(e.id)))})]})]},"group:".concat(e.key))})}),!!(eR&&tu[eR])&&(0,r.jsx)("div",{className:"hidden sm:block sm:absolute sm:top-0 sm:left-full sm:ml-2 sm:w-[360px] z-[10001]",children:(0,r.jsxs)("div",{className:"bg-[#18181b] border border-white/10 rounded-xl shadow-2xl overflow-hidden",children:[(0,r.jsxs)("div",{className:"px-4 py-3 border-b border-white/5",children:[(0,r.jsx)("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:null===(a=tu[eR])||void 0===a?void 0:a.label}),(0,r.jsx)("div",{className:"text-[11px] text-gray-500 mt-1",children:"Wybierz wariant"})]}),(0,r.jsx)("div",{className:"max-h-[400px] overflow-y-auto scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent",children:(tm[eR]||[]).map((e,t)=>(0,r.jsx)("div",{className:t<(tm[eR]||[]).length-1?"border-b border-white/5":"",children:(0,r.jsx)(tb,{model:e,isSelected:ew.id===e.id,onSelect:()=>i1(e)})},e.id))})]})})]})})]})]}),(0,r.jsxs)("div",{className:"bg-[#09090b]/60 backdrop-blur-xl border border-white/[0.08] rounded-3xl p-6 shadow-2xl relative overflow-visible group hover:border-white/10 transition-colors",children:[(0,r.jsxs)("div",{className:"seedance20"===ew.type?"mb-6 relative group/seedance-source":"mb-6",children:[(0,r.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"kling"===ew.type||"ltx23"===ew.type?"Obraz startowy":"Zdjęcie źr\xf3dłowe"}),(0,r.jsxs)("button",{onClick:()=>eD("upload"===eE?"url":"upload"),className:"text-xs flex items-center gap-1 text-indigo-400 hover:text-indigo-300 transition-colors",children:[(0,r.jsx)(c.Z,{size:12})," ","upload"===eE?"Użyj adresu URL":"Prześlij"]})]}),tj&&(0,r.jsx)("p",{className:"text-[11px] text-amber-300/90 mb-3",children:"Dla bezpieczeństwa dzieci zdjęcia nieletnich są zabronione."}),e3&&(0,r.jsxs)("p",{className:"text-[11px] text-gray-500 mb-3",children:[tn," obsługuje JPG, PNG, BMP lub WEBP obrazy źr\xf3dłowe do ",20,"MB."]}),td&&(0,r.jsx)("p",{className:"text-[11px] text-gray-500 mb-3",children:"Happy Horse 1.0 obsługuje 1-9 obraz\xf3w źr\xf3dłowych. Przesyłanie 2+ obraz\xf3w będzie używało trybu referencji do wideo."}),"seedance20"===ew.type&&(0,r.jsx)("p",{className:"text-[11px] text-gray-500 mb-3",children:a0?"Zdjęcie źr\xf3dłowe (image_with_roles: maksymalnie 1)":"Obrazy źr\xf3dłowe (maksymalnie 9)"}),"upload"===eE?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{ref:ea,type:"file",accept:e3||tw?eq:"image/*",multiple:"seedance20"===ew.type&&!a0||td,onChange:sg,className:"hidden"}),eP?(0,r.jsxs)("div",{onClick:tz||rS||r_?void 0:sh,className:"relative border border-white/10 rounded-2xl overflow-hidden ".concat(tz||rS||r_?"cursor-not-allowed":"cursor-pointer"," group/upload bg-[#18181b]/50 hover:border-indigo-500/30 transition-all"),children:[(0,r.jsx)("img",{src:"seedance20"===ew.type&&sM[0]||URL.createObjectURL(eP),alt:"Podgląd",className:"w-full h-48 object-contain bg-black/20"}),"seedance20"===ew.type&&!(tz||rS)&&(0,r.jsxs)("div",{className:"absolute top-2 right-2 z-20 flex items-center gap-2",children:[(0,r.jsx)(ts,{onClick:e=>{e.stopPropagation(),i2({imageUrl:tC||"",sourceFile:eP})}}),tC&&(0,r.jsxs)("div",{className:"bg-emerald-500/20 border border-emerald-500/50 rounded-full px-3 py-1 flex items-center gap-1.5",children:[(0,r.jsx)(n.Z,{size:14,className:"text-emerald-400"}),(0,r.jsx)("span",{className:"text-xs font-medium text-emerald-400",children:"Przesłane"})]})]}),(tz||rS||r_)&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/80 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:32,className:"text-indigo-400 animate-spin mb
1-3"}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Przesyłam..."})]}),"seedance20"!==ew.type&&!(tz||rS||r_)&&tC&&(0,r.jsxs)("div",{className:"absolute top-2 right-2 bg-emerald-500/20 border border-emerald-500/50 rounded-full px-3 py-1 flex items-center gap-1.5",children:[(0,r.jsx)(n.Z,{size:14,className:"text-emerald-400"}),(0,r.jsx)("span",{className:"text-xs font-medium text-emerald-400",children:"Przesłane"})]}),!(tz||rS||r_)&&(0,r.jsxs)("div",{className:"absolute inset-0 z-10 bg-black/60 opacity-0 group-hover/upload:opacity-100 transition-opacity flex flex-col items-center justify-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-indigo-500/20 flex items-center justify-center mb-3 border border-indigo-500/30",children:(0,r.jsx)(p.Z,{size:20,className:"text-indigo-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Kliknij, aby zastąpić"})]})]}):(0,r.jsxs)("div",{onClick:sh,onDrop:sb,onDragOver:e=>{e.preventDefault()},className:"border border-dashed border-white/10 rounded-2xl p-10 flex flex-col items-center justify-center text-center hover:bg-white/[0.02] hover:border-indigo-500/30 transition-all cursor-pointer group/upload bg-[#18181b]/50",children:[(0,r.jsx)("div",{className:"w-14 h-14 rounded-full bg-[#18181b] flex items-center justify-center mb-4 group-hover/upload:scale-110 transition-transform border border-white/5 shadow-lg",children:(0,r.jsx)(m.Z,{size:24,className:"text-gray-400 group-hover/upload:text-indigo-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-gray-200",children:"seedance20"===ew.type&&!a0||td?"Upuść pliki obraz\xf3w":"Upuść plik obrazu"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:e3?"or click to browse (".concat(20,"MB max)"):td?"lub kliknij, aby przeglądać (maksymalnie 10MB każda)":"lub kliknij, aby przeglądać"})]})]}):(0,r.jsxs)("div",{className:"space-y-3",children:["seedance20"===ew.type?(0,r.jsx)("textarea",{value:eA,onChange:e=>{let t=e.target.value;if(a0){let e=t.split("\n").map(e=>e.trim()).find(Boolean)||"";eI(e),eF(e?"loading":"idle");return}eI(t),eF(si(t)?"loading":"idle")},placeholder:a0?"Wpisz jeden adres URL zdjęcia źr\xf3dłowego...":"Wprowadź adresy URL obraz\xf3w źr\xf3dłowych (jeden na linię)...",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-4 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all h-24 resize-none text-sm scrollbar-primary"}):(0,r.jsx)("input",{type:"url",value:eA,onChange:e=>{let t=e.target.value;eI(t),eF(t.trim()?"loading":"idle")},placeholder:e3?"Wpisz adres URL zdjęcia źr\xf3dłowego...":"Wpisz adres URL obrazu...",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-4 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all text-sm"}),"seedance20"!==ew.type&&eA.trim()&&(0,r.jsxs)("div",{className:"relative border border-white/10 rounded-2xl overflow-hidden bg-[#18181b]/50",children:[(0,r.jsx)("img",{src:eA.trim(),alt:"Podgląd URL obrazu",className:"w-full h-48 object-contain bg-black/20",onLoad:()=>eF("loaded"),onError:()=>eF("error")}),"loading"===eZ&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:28,className:"text-indigo-400 animate-spin mb-2"}),(0,r.jsx)("p",{className:"text-xs text-gray-200",children:"Podgląd ładowania..."})]}),"error"===eZ&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center text-center px-6",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Podgląd niedostępny"}),(0,r.jsx)("p",{className:"text-xs text-gray-300 mt-1",children:"Proszę sprawdzić adres URL obrazu."})]}),(0,r.jsx)("div",{className:"absolute top-2 right-2 flex gap-2",children:(0,r.jsx)("button",{type:"button",onClick:()=>window.open(eA.trim(),"_blank"),className:"px-3 py-1 rounded-full bg-white/10 hover:bg-white/15 border border-white/15 text-xs text-gray-200 transition-colors",children:"Otwarte"})})]})]}),"seedance20"===ew.type&&!1,"seedance20"===ew.type&&sM.length>0&&(0,r.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,r.jsxs)("p",{className:"text-[11px] text-gray-500",children:["Zapowiedzi zdjęć źr\xf3dłowych (",sM.length,")"]}),(0,r.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:sM.map((e,t)=>(0,r.jsxs)("div",{className:"relative border border-white/10 rounded-xl overflow-hidden bg-[#18181b]/50",children:[(0,r.jsx)("div",{className:"absolute top-1.5 right-1.5 z-20",children:(0,r.jsx)(ts,{compact:!0,onClick:t=>{t.stopPropagation(),i2({imageUrl:e})}})}),(0,r.jsx)("img",{src:e,alt:"Source preview ".concat(t+1),className:"w-full h-28 object-cover bg-black/20"}),(0,r.jsxs)("div",{className:"absolute top-1.5 left-1.5 px-2 py-0.5 rounded-full bg-black/70 border border-white/10 text-[10px] text-gray-200",children:["#",t+1]})]},"seedance20-source-preview:".concat(t,":").concat(e)))})]}),td&&sO.length>1&&(0,r.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,r.jsxs)("p",{className:"text-[11px] text-gray-500",children:["Zapowiedzi zdjęć źr\xf3dłowych (",sO.length,") - będzie używać trybu odwołania do wideo"]}),(0,r.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:sO.map((e,t)=>(0,r.jsxs)("div",{className:"relative border border-white/10 rounded-xl overflow-hidden bg-[#18181b]/50",children:[(0,r.jsx)("img",{src:e,alt:"Source preview ".concat(t+1),className:"w-full h-28 object-cover bg-black/20"}),(0,r.jsxs)("div",{className:"absolute top-1.5 left-1.5 px-2 py-0.5 rounded-full bg-black/70 border border-white/10 text-[10px] text-gray-200",children:["#",t+1]})]},"happyhorse-source-preview:".concat(t,":").concat(e)))})]}),"seedance20"===ew.type&&!1]}),"seedance20"===ew.type&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-2",children:"Prompt"}),(0,r.jsx)("textarea",{value:eT,onChange:tk,placeholder:"Opisz ruch wideo, kt\xf3ry chcesz...",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-4 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all h-32 resize-none text-sm scrollbar-primary"}),(0,r.jsx)("p",{className:"mt-2 text-[11px] text-gray-500",children:"Seedance 2.0 może generować z obrazu, z lub bez promptu."})]}),"seedance20"===ew.type&&(0,r.jsxs)("div",{className:"mb-6 space-y-4",children:[(0,r.jsxs)("div",{className:"p-4 rounded-2xl bg-white/5 border border-white/10",children:[(0,r.jsxs)("div",{className:"mb-3 flex justify-between items-center",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"Obraz z rolami (opcjonalnie)"}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-gray-300",children:[(0,r.jsx)("span",{children:"Włącz"}),(0,r.jsx)("input",{type:"checkbox",checked:a0,onChange:e=>{let t=e.target.checked;if(a1(t),!t)return;rs(""),ro(""),rn.length>1&&rd(rn.slice(0,1));let a=String(eA||"").split("\n").map(e=>e.trim()).find(Boolean)||"";"url"===eE&&(eI(a),eF(a?"loading":"idle"))},className:"h-4 w-4 accent-indigo-500"})]})]}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Pierwsza klatka wykorzystuje Tw\xf3j gł\xf3wny obraz referencyjny powyżej. Możesz opcjonalnie dodać ramę końcową last_frame."}),a0&&(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsxs)("div",{className:"mb-3 flex justify-between items-center",children:[(0,r.jsx)("div",{className:"text-xs text-gray-500",children:"Opcjonalny obraz końcowej klatki (last_frame)"}),(0,r.jsxs)("button",{type:"button",onClick:()=>a5("upload"===a2?"url":"upload"),className:"text-xs flex items-center gap-1 text-indigo-400 hover:text-indigo-300 transition-colors",children:[(0,r.jsx)(c.Z,{size:12}
1)," ","upload"===a2?"Użyj adresu URL":"Prześlij"]})]}),"upload"===a2?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{ref:ep,type:"file",accept:"image/*",onChange:sz,className:"hidden"}),a3?(0,r.jsxs)("div",{onClick:ra?void 0:sv,className:"relative border border-white/10 rounded-2xl overflow-hidden ".concat(ra?"cursor-not-allowed":"cursor-pointer"," group/upload bg-[#18181b]/50 hover:border-indigo-500/30 transition-all"),children:[(0,r.jsx)("img",{src:URL.createObjectURL(a3),alt:"Seedance 2.0 podgląd końcowego obrazu",className:"w-full h-40 object-contain bg-black/20"}),ra&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/80 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:28,className:"text-indigo-400 animate-spin mb-3"}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Przesyłam..."})]}),!ra&&re&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover/upload:opacity-100 transition-opacity flex flex-col items-center justify-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-indigo-500/20 flex items-center justify-center mb-3",children:(0,r.jsx)(p.Z,{size:18,className:"text-indigo-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Kliknij, aby zastąpić"})]})]}):(0,r.jsxs)("div",{onClick:sv,className:"border border-dashed border-white/10 rounded-2xl p-8 flex flex-col items-center justify-center text-center hover:bg-white/[0.02] hover:border-indigo-500/30 transition-all cursor-pointer bg-[#18181b]/50",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-[#18181b] flex items-center justify-center mb-3 border border-white/5 shadow-lg",children:(0,r.jsx)(m.Z,{size:20,className:"text-gray-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-gray-200",children:"Prześlij końcowy obraz"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Opcjonalne"})]})]}):(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("input",{type:"url",value:a8,onChange:e=>{let t=e.target.value;a6(t),a9(t.trim()?"loading":"idle")},placeholder:"Wpisz końcowy adres URL obrazu...",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-4 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all text-sm"}),a8.trim()&&(0,r.jsxs)("div",{className:"relative border border-white/10 rounded-2xl overflow-hidden bg-[#18181b]/50",children:[(0,r.jsx)("img",{src:a8.trim(),alt:"Seedance 2.0 podgląd URL końcowego obrazu",className:"w-full h-40 object-contain bg-black/20",onLoad:()=>a9("loaded"),onError:()=>a9("error")}),"loading"===a7&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:24,className:"text-indigo-400 animate-spin mb-2"}),(0,r.jsx)("p",{className:"text-xs text-gray-200",children:"Podgląd ładowania..."})]}),"error"===a7&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center text-center px-6",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Podgląd niedostępny"}),(0,r.jsx)("p",{className:"text-xs text-gray-300 mt-1",children:"Proszę sprawdzić adres URL końcowego obrazu."})]}),(0,r.jsx)("div",{className:"absolute top-2 right-2 flex gap-2",children:(0,r.jsx)("button",{type:"button",onClick:()=>window.open(a8.trim(),"_blank"),className:"px-3 py-1 rounded-full bg-white/10 hover:bg-white/15 border border-white/15 text-xs text-gray-200 transition-colors",children:"Otwarte"})})]})]}),(0,r.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,r.jsx)("p",{className:"text-[11px] text-gray-500",children:"image_with_roles Podgląd"}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[sE&&(0,r.jsxs)("div",{className:"relative border border-white/10 rounded-xl overflow-hidden bg-[#18181b]/50",children:[(0,r.jsx)("img",{src:sE,alt:"image_with_roles first_frame podgląd",className:"w-full h-32 object-cover bg-black/20"}),(0,r.jsx)("div",{className:"absolute top-1.5 left-1.5 px-2 py-0.5 rounded-full bg-black/70 border border-white/10 text-[10px] text-gray-200",children:"first_frame"})]}),sD&&(0,r.jsxs)("div",{className:"relative border border-white/10 rounded-xl overflow-hidden bg-[#18181b]/50",children:[(0,r.jsx)("img",{src:sD,alt:"image_with_roles last_frame podgląd",className:"w-full h-32 object-cover bg-black/20"}),(0,r.jsx)("div",{className:"absolute top-1.5 left-1.5 px-2 py-0.5 rounded-full bg-black/70 border border-white/10 text-[10px] text-gray-200",children:"last_frame"})]})]})]})]})]}),(0,r.jsxs)("div",{className:"p-4 rounded-2xl bg-white/5 border border-white/10 space-y-3",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block",children:"Referencyjne adresy URL wideo (opcjonalne)"}),(0,r.jsx)("textarea",{value:ri,onChange:e=>rs(e.target.value),placeholder:"https://.../ref-video-1.mp4 https://.../ref-video-2.mp4",disabled:sT,className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-3 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all h-20 resize-none text-sm scrollbar-primary ".concat(sT?"opacity-60 cursor-not-allowed":"")}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("p",{className:"text-[11px] text-gray-500",children:"Filmy referencyjne (maksymalnie 3, łącznie 15s)"}),(0,r.jsxs)("label",{className:"px-3 py-2 rounded-xl text-xs font-bold border transition-colors ".concat(rL||sT?"bg-white/5 border-white/10 text-gray-500 cursor-not-allowed":"bg-white/5 border-white/10 text-gray-200 hover:bg-white/10 cursor-pointer"),children:[rL?"Przesyłam...":"Przesyłaj filmy",(0,r.jsx)("input",{type:"file",accept:"video/mp4,video/quicktime,video/x-msvideo,video/avi,video/webm,.mp4,.mov,.avi,.webm",multiple:!0,className:"hidden",disabled:!!(rL||sT),onChange:s_})]})]}),sZ.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-[11px] text-gray-500",children:["Referencyjne zapowiedzi wideo (",sZ.length,")"]}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:sZ.map((e,t)=>(0,r.jsxs)("div",{className:"border border-white/10 rounded-xl p-2 bg-[#18181b]/50",children:[(0,r.jsx)("video",{src:e,controls:!0,preload:"metadata",className:"w-full h-32 rounded-lg bg-black/30"}),(0,r.jsx)("button",{type:"button",onClick:()=>window.open(e,"_blank"),className:"mt-2 text-xs text-indigo-300 hover:text-indigo-200 transition-colors",children:"Otw\xf3rz URL wideo"})]},"seedance20-ref-video:".concat(t,":").concat(e)))})]}),(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block",children:"Odniesienie do Audio URL (opcjonalne)"}),(0,r.jsx)("textarea",{value:rl,onChange:e=>ro(e.target.value),placeholder:"https://.../ref-audio-1.wav https://.../ref-audio-2.mp3",disabled:sT,className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-3 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all h-20 resize-none text-sm scrollbar-primary ".concat(sT?"opacity-60 cursor-not-allowed":"")}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("p",{className:"text-[11px] text-gray-500",children:"Referencyjne Audio (maksymalnie 3, łącznie 15 sekund)"}),(0,r.jsxs)("label",{className:"px-3 py-2 rounded-xl text-xs font-bold border transition-colors ".concat(rU||sT?"bg-white/5 border-white/10 text-gray-500 cursor-not-allowed":"bg-white/5 border-white/10 text-gray-200 hover:bg-white/10 cursor-pointer"),children:[rU?"Przesyłam...":"Przesyłaj dźwięk",(0,r.jsx)("input",{type:"file",accept:"audio/mpeg,audio/mp3,audio/wav,audio/ogg,audio/webm,audio/mp4,audio/x-m4a,audio/m4a",multiple:!0,className:"hidden",disabled:!!(rU||sT),onChange:sR})]})]}),sF.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("p",{className:"text-[11px] text-gray-500",children:["Referencyjne zapowiedzi audio (",sF.length,")"]}),(0,r.jsx)("div",{className:"space-y-2",children:sF.map((e,t)=>(0,r.jsxs)("div",{className:"border border-white/10 rounded-xl p-2 bg-[#18181b]/50",children:[(0,r.jsx)("audio",{src:e,controls:!0,preload:"metadata",className:"w-full"}),(0,r.jsx)("button",{type:"button",onClick:()=>window.open(e,"_blank"),className:"mt-2 text-xs text-indigo-300 hover:text-indigo-200 transition-colors",children:"Otw\xf3rz Audio URL"})]},"seedance20-ref-audio:".concat(t,":").concat(e)))})]}),sT&&(0,r.jsx)("p",{className:"text-[11px] text-amber-300/90",children:"Wideo i dźwięk referencyjny są niedostępne, gdy image_with_roles włączone."}),(0,r.jsx)("p",{className:"text-[11px] text-gray-500",children:"Jeden adres URL na linię. Dostępne tylko publicznie dostępne adresy URL."})]})]}),e3&&(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"Obraz końcowy (opcjonalny)"}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-gray-300",children:[(0,r.jsx)("span",{children:"Włącz"}),(0,r.jsx)("input",{type:"checkbox",checked:t9,onChange:e=>ae(e.target.checked),className:"h-4 w-4 accent-indigo-500"})]})]}),t9&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 flex justify-between items-center",children:[(0,r.jsxs)("div",{className:"text-xs text-gray-500",children:["Opcjonalne zdjęcie ostatniej klatki. JPG, PNG, BMP lub WEBP do ",20,"MB."]}),(0,r.jsxs)("button",{type:"button",onClick:()=>aa("upload"===at?"url":"upload"),className:"text-xs flex items-center gap-1 text-indigo-400 hover:text-indigo-300 transition-colors",children:[(0,r.jsx)(c.Z,{size:12}
1)," ","upload"===at?"Użyj adresu URL":"Prześlij"]})]}),"upload"===at?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{ref:ei,type:"file",accept:eq,onChange:sP,className:"hidden"}),ar?(0,r.jsxs)("div",{onClick:au?void 0:sy,className:"relative border border-white/10 rounded-2xl overflow-hidden ".concat(au?"cursor-not-allowed":"cursor-pointer"," group/upload bg-[#18181b]/50 hover:border-indigo-500/30 transition-all"),children:[(0,r.jsx)("img",{src:URL.createObjectURL(ar),alt:"".concat(tn," end image preview"),className:"w-full h-40 object-contain bg-black/20"}),au&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/80 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:28,className:"text-indigo-400 animate-spin mb-3"}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Przesyłam..."})]}),!au&&ad&&(0,r.jsxs)("div",{className:"absolute top-2 right-2 bg-emerald-500/20 border border-emerald-500/50 rounded-full px-3 py-1 flex items-center gap-1.5",children:[(0,r.jsx)(n.Z,{size:14,className:"text-emerald-400"}),(0,r.jsx)("span",{className:"text-xs font-medium text-emerald-400",children:"Przesłane"})]}),!au&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover/upload:opacity-100 transition-opacity flex flex-col items-center justify-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-indigo-500/20 flex items-center justify-center mb-3",children:(0,r.jsx)(p.Z,{size:18,className:"text-indigo-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Kliknij, aby zastąpić"})]})]}):(0,r.jsxs)("div",{onClick:sy,className:"border border-dashed border-white/10 rounded-2xl p-8 flex flex-col items-center justify-center text-center hover:bg-white/[0.02] hover:border-indigo-500/30 transition-all cursor-pointer bg-[#18181b]/50",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-[#18181b] flex items-center justify-center mb-3 border border-white/5 shadow-lg",children:(0,r.jsx)(m.Z,{size:20,className:"text-gray-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-gray-200",children:"Prześlij końcowy obraz"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Opcjonalne"})]})]}):(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("input",{type:"url",value:as,onChange:e=>{let t=e.target.value;al(t),an(t.trim()?"loading":"idle")},placeholder:"Wpisz końcowy adres URL obrazu...",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-4 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all text-sm"}),as.trim()&&(0,r.jsxs)("div",{className:"relative border border-white/10 rounded-2xl overflow-hidden bg-[#18181b]/50",children:[(0,r.jsx)("img",{src:as.trim(),alt:"".concat(tn," end image URL preview"),className:"w-full h-40 object-contain bg-black/20",onLoad:()=>an("loaded"),onError:()=>an("error")}),"loading"===ao&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:24,className:"text-indigo-400 animate-spin mb-2"}),(0,r.jsx)("p",{className:"text-xs text-gray-200",children:"Podgląd ładowania..."})]}),"error"===ao&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center text-center px-6",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Podgląd niedostępny"}),(0,r.jsx)("p",{className:"text-xs text-gray-300 mt-1",children:"Proszę sprawdzić adres URL końcowego obrazu."})]}),(0,r.jsx)("div",{className:"absolute top-2 right-2 flex gap-2",children:(0,r.jsx)("button",{type:"button",onClick:()=>window.open(as.trim(),"_blank"),className:"px-3 py-1 rounded-full bg-white/10 hover:bg-white/15 border border-white/15 text-xs text-gray-200 transition-colors",children:"Otwarte"})})]})]})]})]}),e3&&(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"Audio (opcjonalnie)"}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-gray-300",children:[(0,r.jsx)("span",{children:"Włącz"}),(0,r.jsx)("input",{type:"checkbox",checked:am,onChange:e=>{let t=e.target.checked;ax(t),t||(aP.current+=1,a_(!1))},className:"h-4 w-4 accent-indigo-500"})]})]}),am&&(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"mb-3 flex justify-between items-center",children:[(0,r.jsxs)("div",{className:"text-xs text-gray-500",children:["Tylko MP3 lub WAV, ",2,"-",30," s, do ",15," MB."]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{aP.current+=1,ah("upload"),ak(0),a_(!1)},className:"rounded-xl px-3 py-2 text-xs font-semibold border transition-all ".concat("upload"===ag?"bg-indigo-500/15 border-indigo-500/30 text-white":"bg-[#18181b] border-white/10 text-gray-300 hover:border-indigo-500/30"),children:[(0,r.jsx)(p.Z,{size:14,className:"inline mr-2"}),"Prześlij"]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{aP.current+=1,ah("url"),ak(0),a_(!1)},className:"rounded-xl px-3 py-2 text-xs font-semibold border transition-all ".concat("url"===ag?"bg-indigo-500/15 border-indigo-500/30 text-white":"bg-[#18181b] border-white/10 text-gray-300 hover:border-indigo-500/30"),children:[(0,r.jsx)(g.Z,{size:14,className:"inline mr-2"}),"URL"]})]})]}),"upload"===ag?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("input",{ref:es,type:"file",accept:"audio/mpeg,audio/mp3,audio/wav,audio/x-wav,audio/wave,.mp3,.wav",onChange:sU,className:"hidden"}),(0,r.jsx)("div",{className:"border-2 border-dashed border-white/10 rounded-2xl p-6 bg-white/[0.02] hover:bg-white/[0.03] transition-colors",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-white/5 border border-white/10 flex items-center justify-center text-indigo-300",children:(0,r.jsx)(h.Z,{size:20})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-sm text-white font-medium truncate",children:(null==ab?void 0:ab.name)||"Wybierz MP3 lub WAV audio"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:az?"Przesyłam...":aN?"".concat(eQ(aN)," • MP3/WAV • ").concat(15,"MB max"):"MP3/WAV • ".concat(2,"-").concat(30,"s")})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{var e;null===(e=es.current)||void 0===e||e.click()},className:"px-3 py-2 rounded-xl bg-white/5 border border-white/10 text-xs text-gray-200 hover:bg-white/10 transition-colors",disabled:az,children:[(0,r.jsx)(p.Z,{size:14,className:"inline mr-2"}),"Wybierz plik"]}),(ab||av)&&(0,r.jsx)("button",{type:"button",onClick:()=>{ay(null),aj(null),ak(0)},className:"w-10 h-10 rounded-xl bg-white/5 border border-white/10 text-gray-300 hover:text-white hover:bg-white/10 transition-colors flex items-center justify-center","aria-label":"Usuń dźwięk",title:"Usuń dźwięk",disabled:az,children:(0,r.jsx)(b.Z,{size:16})})]})]})}),(aR||av)&&(0,r.jsx)("div",{className:"rounded-2xl border border-white/10 bg-gradient-to-b from-white/5 to-transparent p-4",children:(0,r.jsx)("audio",{controls:!0,className:"w-full",src:aR||av||void 0})})]}):(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("input",{value:af,onChange:e=>{aP.current+=1,aw(e.target.value),ak(0),a_(!1)},onBlur:()=>{af.trim()&&sx(af,{reportInvalidUrl:!0})},placeholder:"Wpisz MP3 lub WAV URL...",className:"w-full bg-[#18181b] border border-white/10 rounded-xl px-4 py-3 text-sm text-gray-100 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/40"}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("button",{type:"button",onClick:()=>sx(af,{reportInvalidUrl:!0}),className:"px-3 py-2 rounded-xl bg-white/5 border border-white/10 text-xs text-gray-200 hover:bg-white/10 transition-colors",disabled:!af.trim()||aC,children:"Czas oczekiwania"}),(0,r.jsxs)("span",{className:"text-xs text-gray-500 flex items-center gap-2",children:[aC&&(0,r.jsx)(u.Z,{size:14,className:"animate-spin"}),aN>0?"".concat(eQ(aN)," detected"):"Need ".concat(2,"-").concat(30,"s")]})]}),eJ(af.trim())&&(0,r.jsx)("div",{className:"rounded-2xl border border-white/10 bg-gradient-to-b from-white/5 to-transparent p-4",children:(0,r.jsx)("audio",{controls:!0,className:"w-full",src:af.trim()})})]})]})]}),"ltx23"===ew.type&&(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"Obraz końcowy (opcjonalny)"}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-gray-300",children:[(0,r.jsx)("span",{children:"Włącz"}),(0,r.jsx)("input",{type:"checkbox",checked:ia,onChange:e=>ir(e.target.checked),className:"h-4 w-4 accent-indigo-500"})]})]}),ia&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 flex justify-between items-center",children:[(0,r.jsx)("div",{className:"text-xs text-gray-500",children:"Dodaj opcjonalną klatkę końcową, aby przemienić ujęcie w przejście prowadzone."}),(0,r.jsxs)("button",{type:"button",onClick:()=>is("upload"===ii?"url":"upload"),className:"text-xs flex items-center gap-1 text-indigo-400 hover:text-indigo-300 transition-colors",children:[(0,r.jsx)(c.Z,{size:12})," ","upload"===ii?"Użyj adresu URL":"Prześlij"]})]}),"upload"===ii?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{ref:em,type:"file",accept:"image/*",onChange:sL,className:"hidden"}),il?(0,r.jsxs)("div",{onClick:ig?void 0:sj,className:"relative border border-white/10 rounded-2xl overflow-hidden ".concat(ig?"curs
1or-not-allowed":"cursor-pointer"," group/upload bg-[#18181b]/50 hover:border-indigo-500/30 transition-all"),children:[(0,r.jsx)("img",{src:URL.createObjectURL(il),alt:"LTX 2.3 podgląd końcowego obrazu",className:"w-full h-40 object-contain bg-black/20"}),ig&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/80 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:28,className:"text-indigo-400 animate-spin mb-3"}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Przesyłam..."})]}),!ig&&im&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover/upload:opacity-100 transition-opacity flex flex-col items-center justify-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-indigo-500/20 flex items-center justify-center mb-3",children:(0,r.jsx)(p.Z,{size:18,className:"text-indigo-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Kliknij, aby zastąpić"})]})]}):(0,r.jsxs)("div",{onClick:sj,className:"border border-dashed border-white/10 rounded-2xl p-8 flex flex-col items-center justify-center text-center hover:bg-white/[0.02] hover:border-indigo-500/30 transition-all cursor-pointer bg-[#18181b]/50",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-[#18181b] flex items-center justify-center mb-3 border border-white/5 shadow-lg",children:(0,r.jsx)(m.Z,{size:20,className:"text-gray-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-gray-200",children:"Prześlij końcowy obraz"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Opcjonalne"})]})]}):(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("input",{type:"url",value:id,onChange:e=>{let t=e.target.value;ic(t),ip(t.trim()?"loading":"idle")},placeholder:"Wpisz końcowy adres URL obrazu...",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-4 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all text-sm"}),id.trim()&&(0,r.jsxs)("div",{className:"relative border border-white/10 rounded-2xl overflow-hidden bg-[#18181b]/50",children:[(0,r.jsx)("img",{src:id.trim(),alt:"LTX 2.3 podgląd URL końcowego obrazu",className:"w-full h-40 object-contain bg-black/20",onLoad:()=>ip("loaded"),onError:()=>ip("error")}),"loading"===iu&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:24,className:"text-indigo-400 animate-spin mb-2"}),(0,r.jsx)("p",{className:"text-xs text-gray-200",children:"Podgląd ładowania..."})]}),"error"===iu&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center text-center px-6",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Podgląd niedostępny"}),(0,r.jsx)("p",{className:"text-xs text-gray-300 mt-1",children:"Proszę sprawdzić adres URL końcowego obrazu."})]}),(0,r.jsx)("div",{className:"absolute top-2 right-2 flex gap-2",children:(0,r.jsx)("button",{type:"button",onClick:()=>window.open(id.trim(),"_blank"),className:"px-3 py-1 rounded-full bg-white/10 hover:bg-white/15 border border-white/15 text-xs text-gray-200 transition-colors",children:"Otwarte"})})]})]})]})]}),"seedance15"===ew.type&&(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"Obraz końcowy (opcjonalny)"}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-gray-300",children:[(0,r.jsx)("span",{children:"Włącz"}
1),(0,r.jsx)("input",{type:"checkbox",checked:rG,onChange:e=>rH(e.target.checked),className:"h-4 w-4 accent-indigo-500"})]})]}),rG&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 flex justify-between items-center",children:[(0,r.jsx)("div",{className:"text-xs text-gray-500",children:"Udostępnij opcjonalny obraz końcowej klatki, kt\xf3ry będzie prowadził przejście."}),(0,r.jsxs)("button",{type:"button",onClick:()=>rX("upload"===rq?"url":"upload"),className:"text-xs flex items-center gap-1 text-indigo-400 hover:text-indigo-300 transition-colors",children:[(0,r.jsx)(c.Z,{size:12})," ","upload"===rq?"Użyj adresu URL":"Prześlij"]})]}),"upload"===rq?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{ref:ec,type:"file",accept:"image/*",onChange:sk,className:"hidden"}),rJ?(0,r.jsxs)("div",{onClick:r3?void 0:sw,className:"relative border border-white/10 rounded-2xl overflow-hidden ".concat(r3?"cursor-not-allowed":"cursor-pointer"," group/upload bg-[#18181b]/50 hover:border-indigo-500/30 transition-all"),children:[(0,r.jsx)("img",{src:URL.createObjectURL(rJ),alt:"Seedance podgląd końcowego obrazu",className:"w-full h-40 object-contain bg-black/20"}),r3&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/80 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:28,className:"text-indigo-400 animate-spin mb-3"}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Przesyłam..."})]}),!r3&&r2&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover/upload:opacity-100 transition-opacity flex flex-col items-center justify-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-indigo-500/20 flex items-center justify-center mb-3",children:(0,r.jsx)(p.Z,{size:18,className:"text-indigo-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Kliknij, aby zastąpić"})]})]}):(0,r.jsxs)("div",{onClick:sw,className:"border border-dashed border-white/10 rounded-2xl p-8 flex flex-col items-center justify-center text-center hover:bg-white/[0.02] hover:border-indigo-500/30 transition-all cursor-pointer bg-[#18181b]/50",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-[#18181b] flex items-center justify-center mb-3 border border-white/5 shadow-lg",children:(0,r.jsx)(m.Z,{size:20,className:"text-gray-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-gray-200",children:"Prześlij końcowy obraz"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Opcjonalne"})]})]}):(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("input",{type:"url",value:rY,onChange:e=>{let t=e.target.value;r$(t),r1(t.trim()?"loading":"idle")},placeholder:"Wpisz końcowy adres URL obrazu...",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-4 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all text-sm"}),rY.trim()&&(0,r.jsxs)("div",{className:"relative border border-white/10 rounded-2xl overflow-hidden bg-[#18181b]/50",children:[(0,r.jsx)("img",{src:rY.trim(),alt:"Seedance podgląd URL końcowego obrazu",className:"w-full h-40 object-contain bg-black/20",onLoad:()=>r1("loaded"),onError:()=>r1("error")}),"loading"===r0&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:24,className:"text-indigo-400 animate-spin mb-2"}),(0,r.jsx)("p",{className:"text-xs text-gray-200",children:"Podgląd ładowania..."})]}),"error"===r0&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center text-center px-6",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Podgląd niedostępny"}),(0,r.jsx)("p",{className:"text-xs text-gray-300 mt-1",children:"Proszę sprawdzić adres URL końcowego obrazu."})]}),(0,r.jsx)("div",{className:"absolute top-2 right-2 flex gap-2",children:(0,r.jsx)("button",{type:"button",onClick:()=>window.open(rY.trim(),"_blank"),className:"px-3 py-1 rounded-full bg-white/10 hover:bg-white/15 border border-white/15 text-xs text-gray-200 transition-colors",children:"Otwarte"})})]})]})]})]}),"kling"===ew.type&&(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"Obraz końcowy (opcjonalny)"}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-xs text-gray-300",children:[(0,r.jsx)("span",{children:"Włącz"}),(0,r.jsx)("input",{type:"checkbox",checked:ib,onChange:e=>iy(e.target.checked),className:"h-4 w-4 accent-indigo-500"})]})]}),ib&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 flex justify-between items-center",children:[(0,r.jsx)("div",{className:"text-xs text-gray-500",children:"Udostępnij opcjonalny obraz końcowej klatki, kt\xf3ry będzie prowadził przejście."}),(0,r.jsxs)("button",{type:"button",onClick:()=>iv("upload"===iw?"url":"upload"),className:"text-xs flex items-center gap-1 text-indigo-400 hover:text-indigo-300 transition-colors",children:[(0,r.jsx)(c.Z,{size:12})," ","upload"===iw?"Użyj adresu URL":"Prześlij"]})]}),"upload"===iw?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{ref:el,type:"file",accept:"image/*",onChange:sN,className:"hidden"}),ij?(0,r.jsxs)("div",{onClick:iL?void 0:sf,className:"relative border border-white/10 rounded-2xl overflow-hidden ".concat(iL?"cursor-not-allowed":"cursor-pointer"," group/upload bg-[#18181b]/50 hover:border-indigo-500/30 transition-all"),children:[(0,r.jsx)("img",{src:URL.createObjectURL(ij),alt:"Podgląd końcowego obrazu",className:"w-full h-40 object-contain bg-black/20"}),iL&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/80 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:28,className:"text-indigo-400 animate-spin mb
1-3"}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Przesyłam..."})]}),!iL&&i_&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover/upload:opacity-100 transition-opacity flex flex-col items-center justify-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-indigo-500/20 flex items-center justify-center mb-3",children:(0,r.jsx)(p.Z,{size:18,className:"text-indigo-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Kliknij, aby zastąpić"})]})]}):(0,r.jsxs)("div",{onClick:sf,className:"border border-dashed border-white/10 rounded-2xl p-8 flex flex-col items-center justify-center text-center hover:bg-white/[0.02] hover:border-indigo-500/30 transition-all cursor-pointer bg-[#18181b]/50",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-[#18181b] flex items-center justify-center mb-3 border border-white/5 shadow-lg",children:(0,r.jsx)(m.Z,{size:20,className:"text-gray-400"})}),(0,r.jsx)("p",{className:"text-sm font-medium text-gray-200",children:"Prześlij końcowy obraz"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Opcjonalne"})]})]}):(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("input",{type:"url",value:ik,onChange:e=>{let t=e.target.value;iz(t),iC(t.trim()?"loading":"idle")},placeholder:"Wpisz końcowy adres URL obrazu...",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-4 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all text-sm"}),ik.trim()&&(0,r.jsxs)("div",{className:"relative border border-white/10 rounded-2xl overflow-hidden bg-[#18181b]/50",children:[(0,r.jsx)("img",{src:ik.trim(),alt:"Podgląd końcowego URL obrazu",className:"w-full h-40 object-contain bg-black/20",onLoad:()=>iC("loaded"),onError:()=>iC("error")}),"loading"===iS&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center",children:[(0,r.jsx)(u.Z,{size:24,className:"text-indigo-400 animate-spin mb-2"}),(0,r.jsx)("p",{className:"text-xs text-gray-200",children:"Podgląd ładowania..."})]}),"error"===iS&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center text-center px-6",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:"Podgląd niedostępny"}),(0,r.jsx)("p",{className:"text-xs text-gray-300 mt-1",children:"Proszę sprawdzić adres URL końcowego obrazu."})]}),(0,r.jsx)("div",{className:"absolute top-2 right-2 flex gap-2",children:(0,r.jsx)("button",{type:"button",onClick:()=>window.open(ik.trim(),"_blank"),className:"px-3 py-1 rounded-full bg-white/10 hover:bg-white/15 border border-white/15 text-xs text-gray-200 transition-colors",children:"Otwarte"})})]})]})]})]}),"seedance20"!==ew.type&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-2",children:"Prompt"}),(0,r.jsx)("textarea",{value:eT,onChange:tk,placeholder:"Opisz ruch wideo, kt\xf3ry chcesz...",maxLength:eX?2500:void 0,className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-4 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all h-32 resize-none text-sm scrollbar-primary"}),eH&&(0,r.jsxs)("div",{className:"mt-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsx)("p",{className:"text-[11px] text-gray-500 leading-relaxed sm:max-w-[65%]",children:"Jeśli generowanie nie uda się z powodu kontroli treści, możesz spr\xf3bować użyć Prompt Optimizera."}),(0,r.jsxs)("button",{type:"button",onClick:so,disabled:eW||tR||!eT.trim(),className:"inline-flex min-h-11 items-center justify-center gap-2 rounded-xl border border-indigo-500/25 bg-indigo-500/10 px-4 py-2 text-sm font-medium text-indigo-100 transition-all hover:border-indigo-400/40 hover:bg-indigo-500/15 focu
1s:outline-none focus:ring-2 focus:ring-indigo-400/60 disabled:cursor-not-allowed disabled:opacity-50",children:[eW?(0,r.jsx)(u.Z,{size:16,className:"animate-spin"}):(0,r.jsx)(c.Z,{size:16}),eW?"Optymalizacja...":"Optymalizacja promptu"]})]}),eB&&eH&&(0,r.jsx)("div",{className:"mt-3 rounded-xl border border-rose-500/20 bg-rose-500/10 px-3 py-2 text-xs text-rose-200",children:eB}),eX&&(0,r.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3 text-xs",children:[(0,r.jsxs)("p",{className:"text-gray-500",children:["Dla Kling 3 prompt musi być ",2500," postaci lub mniej."]}),(0,r.jsxs)("span",{className:tN>=2500?"text-amber-300":"text-gray-500",children:[tN,"/",2500]})]})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[tt&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"rounded-xl border border-white/5 bg-[#18181b] p-3",children:[(0,r.jsx)("span",{className:"block text-xs font-bold uppercase tracking-wider text-gray-400",children:"Proporcje obrazu"}),(0,r.jsx)("span",{className:"mt-1 block text-sm text-gray-300",children:"Automatycznie — proporcje obrazu źr\xf3dłowego"})]}),(0,r.jsx)(tl,{label:"Rozdzielczość",value:t6,onChange:e=>t7(e),options:ew.supportedResolutions.map(e=>({value:e,label:e}))}),(0,r.jsx)(tl,{label:"Czas trwania",value:t4,onChange:e=>t8(Number(e)),options:ew.supportedDurations.map(e=>({value:e,label:"".concat(e," seconds")}))}),ew.supportsAudioOutput&&(0,r.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border border-indigo-500/20 bg-indigo-500/10 p-3",children:[(0,r.jsx)(h.Z,{size:16,className:"flex-shrink-0 text-indigo-300","aria-hidden":"true"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"block text-xs font-semibold text-indigo-200",children:"Natywne wyjście audio"}),(0,r.jsx)("span",{className:"mt-0.5 block text-[11px] text-gray-400",children:"Dźwięk stereo jest generowany automatycznie razem z wideo."})]})]}),(0,r.jsxs)("div",{className:"rounded-xl border border-indigo-500/20 bg-indigo-500/10 p-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("span",{className:"text-xs text-gray-400",children:["Kredyty za ",t6," @ ",t4,"s:"]}),(0,r.jsxs)("span",{className:"text-sm font-bold text-indigo-400",children:[i5()," Kredyty",R.X&&(0,r.jsx)("span",{className:"ml-1 text-xs font-normal text-gray-400",children:(0,R.w)(i5())})]})]}),(0,r.jsxs)("div",{className:"mt-1 text-[11px] text-gray-500",children:[eO(t6)," kredyt\xf3w / sekunda"]})]})]}),("wan"===ew.type||e3)&&(0,r.jsxs)(r.Fragment,{children:[(td||te)&&!1!==ew.supportsAspectRatio&&(0,r.jsx)(tl,{label:"Proporcje obrazu",value:t1,onChange:e=>t2(e),options:ew.supportedAspectRatios.map(e=>({value:e,label:"auto"===e?"Automatycznie (dopasuj do obrazu)":e}))}),(0,r.jsx)(tl,{label:"Rozwiązanie",value:tQ,onChange:e=>tY(e),options:ew.supportedResolutions.map(e=>({value:e,label:e}))}),(0,r.jsx)(tl,{label:"Czas trwania",value:t$,onChange:e=>t0(Number(e)),options:ew.supportedDurations.map(e=>({value:e,label:"".concat(e," seconds")}))}),te&&(0,r.jsxs)("label",{htmlFor:"wan3-image-thinking-mode",className:"flex min-h-11 cursor-pointer items-center justify-between gap-4 rounded-xl border border-white/5 bg-[#18181b] p-3 transition-colors hover:border-indigo-500/30",children:[(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"block text-xs font-bold uppercase tracking-wider text-gray-400",children:"Tryb rozumowania"}),(0,r.jsx)("span",{id:"wan3-image-thinking-mode-help",className:"mt-1 block text-[11px] text-gray-500",children:"Wykorzystuje dodatkowe rozumowanie przed generowaniem. Domyślnie wyłączony."})]}),(0,r.jsx)("input",{id:"wan3-image-thinking-mode",type:"checkbox",checked:t5,onChange:e=>t3(e.target.checked),"aria-describedby":"wan3-image-thinking-mode-help",className:"h-5 w-5 shrink-0 cursor-pointer accent-indigo-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400"})]}),(0,r.jsxs)("div",{className:"p-3 bg-indigo-500/10 border border-indigo-500/20 rounded-xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-xs text-gray-400",children:["Kredyty za ",tQ," @ ",t$,"s:"]}),(0,r.jsxs)("span",{className:"text-sm font-bold text-indigo-400",children:[i5()," Kredyty",R.X&&(0,r.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-1",children:(0,R.w)(i5())})]})]}),(0,r.jsxs)("div",{className:"mt-1 text-[11px] text-gray-500 flex flex-wrap items-center gap-1.5",children:[i8&&(0,r.jsx)("span",{className:"rounded border border-emerald-500/30 bg-emerald-500/10 px-1.5 py-0.5 font-medium text-emerald-300",children:ew.discountLabel}),i8?(0,r.jsxs)("span",{children:[(0,r.jsxs)("span",{className:"text-gray-600 line-through",children:[i4," Kredyty"]}),(0,r.jsxs)("span",{className:"ml-1 text-emerald-300",children:[i3," Kredyty"]})]}):(0,r.jsxs)("span",{children:[i3," kredyty / Druga"]})]})]})]}),"sora"===ew.type&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tl,{label:"Orientacja",value:tB,onChange:e=>tG(e),options:ew.supportedOrientations.map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1)}))}),(0,r.jsx)(tl,{label:"Rozmiar",value:tH,onChange:e=>tq(e),options:ew.supportedSizes.map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1)}))}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-2",children:"Czas trwania"}),(0,r.jsxs)("div",{className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-3 text-sm text-gray-400",children:[ew.duration," sekundy (naprawione)"]})]})]}),"veo"===ew.type&&(0,r.jsx)(tl,{label:"Proporcje obrazu",value:tX,onChange:e=>tJ(e),options:ew.supportedAspectRatios.map(e=>({value:e,label:e}))}),"seedance15"===ew.type&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tl,{label:"Czas trwania",value:aV,onChange:e=>aW(Number(e)),options:ew.supportedDurations.map(e=>({value:e,label:"".concat(e," seconds")}))}),(0,r.jsx)(tl,{label:"Proporcje obrazu",value:aK,onChange:e=>aB(e),options:ew.supportedAspectRatios.map(e=>({value:e,label:e}))}),(0,r.jsx)(tl,{label:"Rozwiązanie",value:aG,onChange:e=>aH(e),options:ew.supportedResolutions.map(e=>({value:e,label:e}))}),(0,r.jsxs)("div",{className:"p-3 bg-indigo-500/10 border border-indigo-500/20 rounded-xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs text-gray-400",children:"Wymagane punkty:"}),(0,r.jsxs)("span",{className:"text-sm font-bold text-indigo-400",children:[i5()," Kredyty",R.X&&(0,r.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-1",children:(0,R.w)(i5())})]})]}),(0,r.jsx)("div",{className:"mt-1 text-[11px] text-gray-500",children:"Filtr bezpieczeństwa: wyłączony (domyślnie) \xb7 Generowanie dźwięku: włączone (dom
1yślne)"})]})]}),"seedance20"===ew.type&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tl,{label:"Czas trwania",value:aq,onChange:e=>aX(Number(e)),options:ew.supportedDurations.map(e=>({value:e,label:"".concat(e," seconds")}))}),(0,r.jsx)(tl,{label:"Proporcje obrazu",value:aJ,onChange:e=>aQ(e),options:ew.supportedAspectRatios.map(e=>({value:e,label:e}))}),(0,r.jsx)(tl,{label:"Rozwiązanie",value:aY,onChange:e=>a$(e),options:ew.supportedResolutions.map(e=>({value:e,label:e}))}),(0,r.jsxs)("div",{className:"p-3 bg-indigo-500/10 border border-indigo-500/20 rounded-xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs text-gray-400",children:"Wymagane punkty:"}),(0,r.jsxs)("span",{className:"text-sm font-bold text-indigo-400",children:[i5()," Kredyty",R.X&&(0,r.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-1",children:(0,R.w)(i5())})]})]}),(0,r.jsxs)("div",{className:"mt-1 text-[11px] text-gray-500",children:["Aktualna stawka: ",et(ew.id,aY)," kredyt\xf3w/s w ",aY]})]}),(0,r.jsxs)("div",{className:"p-4 rounded-2xl bg-white/5 border border-white/10",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>rz(!rk),className:"w-full flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs font-bold text-gray-300 uppercase tracking-wider",children:"Zaawansowane"}),(0,r.jsx)(o.Z,{size:16,className:"text-gray-400 transition-transform ".concat(rk?"rotate-180":"")})]}),rk&&(0,r.jsxs)("div",{className:"mt-4 space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-3 p-3 rounded-xl bg-[#18181b]/70 border border-white/10",children:[(0,r.jsxs)("label",{className:"flex items-center justify-between gap-3 text-sm text-gray-200",children:[(0,r.jsx)("span",{children:"Generuj dźwięk"}),(0,r.jsx)("input",{type:"checkbox",checked:rp,onChange:e=>rm(e.target.checked),className:"h-4 w-4 accent-indigo-500"})]}),(0,r.jsxs)("label",{className:"flex items-center justify-between gap-3 text-sm text-gray-200",children:[(0,r.jsx)("span",{children:"Powr\xf3t w ostatniej kruncie"}),(0,r.jsx)("input",{type:"checkbox",checked:rx,onChange:e=>rg(e.target.checked),className:"h-4 w-4 accent-indigo-500"})]}),(0,r.jsxs)("label",{className:"flex items-center justify-between gap-3 text-sm text-gray-200",children:[(0,r.jsx)("span",{children:"Aparat stały"}),(0,r.jsx)("input",{type:"checkbox",checked:rh,onChange:e=>rb(e.target.checked),className:"h-4 w-4 accent-indigo-500"})]}),(0,r.jsxs)("label",{className:"flex items-center justify-between gap-3 text-sm text-gray-200",children:[(0,r.jsx)("span",{children:"Włącz narzędzie wyszukiwania w sieci"}),(0,r.jsx)("input",{type:"checkbox",checked:rw,onChange:e=>rv(e.target.checked),className:"h-4 w-4 accent-indigo-500"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-2",children:"Nasiono (opcjonalne)"}),(0,r.jsx)("input",{type:"number",value:ry,onChange:e=>rf(e.target.value),placeholder:"e.g. 42",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-3 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all text-sm"})]})]})]})]}),"ltx23"===ew.type&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tl,{label:"Czas trwania",value:r8,onChange:e=>r6(Number(e)),options:ew.supportedDurations.map(e=>({value:e,label:"".concat(e," seconds")}))}),(0,r.jsx)(tl,{label:"Rozwiązanie",value:ie,onChange:e=>it(e),options:ew.supportedResolutions.map(e=>({value:e,label:e}))}),(0,r.jsx)(tl,{label:"Proporcje obrazu",value:r7,onChange:e=>r9(e),options:ew.supportedAspectRatios.map(e=>({value:e,label:e}))}),(0,r.jsxs)("div",{className:"p-3 bg-indigo-500/10 border border-indigo-500/20 rounded-xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs text-gray-400",children:"Wymagane punkty:"}),(0,r.jsxs)("span",{className:"text-sm font-bold text-indigo-400",children:[i5()," Kredyty",R.X&&(0,r.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-1",children:(0,R.w)(i5())})]})]}),(0,r.jsxs)("div",{className:"mt-1 text-[11px] text-gray-500",children:["Aktualna stawka: ",ev(ew.variant,ie)," kredyt\xf3w/s w ",ie," dla ","pro"===ew.variant?"Pro":"Fast","."]})]})]}),"grok"===ew.type&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tl,{label:"Czas trwania",value:aU,onChange:e=>aA(e),options:ew.supportedDurations.map(e=>({value:e,label:"".concat(e," seconds")}))}),(0,r.jsx)(tl,{label:"Proporcje obrazu",value:aI,onChange:e=>aM(e),options:ew.supportedAspectRatios.map(e=>({value:e,label:e}))}),(0,r.jsx)(tl,{label:"Rozwiązanie",value:aO,onChange:e=>aZ(e),options:ew.supportedResolutions.map(e=>({value:e,label:e}))}),(0,r.jsxs)("div",{className:"p-3 bg-indigo-500/10 border border-indigo-500/20 rounded-xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs text-gray-400",children:"Wymagane punkty:"}),(0,r.jsxs)("span",{className:"text-sm font-bold text-indigo-400",children:[i5()," Kredyty",R.X&&(0,r.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-1",children:(0,R.w)(i5())})]})]}),(0,r.jsxs)("div",{className:"mt-1 text-[11px] text-gray-500",children:[15," kredyty / Druga"]})]})]}),"grokVideo3"===ew.type&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tl,{label:"Czas trwania",value:aF,onChange:e=>aE(Number(e)),options:ew.supportedDurations.map(e=>({value:e,label:"".concat(e," seconds")}))}),(0,r.jsx)(tl,{label:"Proporcje obrazu",value:aD,onChange:e=>aT(e),options:ew.supportedAspectRatios.map(e=>({value:e,label:e}))}),(0,r.jsxs)("div",{className:"p-3 bg-indigo-500/10 border border-indigo-500/20 rounded-xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs text-gray-400",children:"Wymagane punkty:"}),(0,r.jsxs)("span",{className:"text-sm font-bold text-indigo-400",children:[i5()," Kredyty",R.X&&(0,r.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-1",children:(0,R.w)(i5())})]})]}),(0,r.jsxs)("div",{className:"mt-1 text-[11px] text-gray-500",children:["Wzywam ",(0,r.jsx)("span",{className:"font-mono text-gray-300",children:null==i6?void 0:i6.model})," \xb7 Stały przy ",eu]})]})]}),"kling"===ew.type&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tl,{label:"Czas trwania",value:rD,onChange:e=>rT(e),options:ew.supportedDurations.map(e=>({value:e,label:"".concat(e," seconds")}))}),(0,r.jsx)(tl,{label:"Proporcje obrazu",value:rV,onChange:e=>rW(e),options:ew.supportedAspectRatios.map(e=>({value:e,label:e}))}),(0,r.jsx)("div",{className:"space-y-3 p-4 rounded-2xl bg-white/5 border border-white/10",children:(0,r.jsxs)("label",{className:"flex items-center justify-between gap-3 text-sm text-gray-200",children:[(0,r.jsx)("span",{children:"Generuj dźwięk"}),(0,r.jsx)("input",{type:"checkbox",checked:rK,onChange:e=>rB(e.target.checked),className:"h-4 w-4 accent-indigo-500"})]})}),(0,r.jsxs)("div",{className:"p-3 bg-indigo-500/10 border border-indigo-500/20 rounded-xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs text-gray-400",children:"Wymagane punkty:"}),(0,r.jsxs)("span",{className:"text-sm font-bold text-indigo-400",children:[i5()," Kredyty",R.X&&(0,r.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-1",children:(0,R.w)(i5())})]})]}),(0,r.jsxs)("div",{className:"mt-1 text-[11px] text-gray-500",children:[ta(ew.variant,rK)," kredyty / Druga"]})]}),(0,r.jsxs)("div",{className:"space-y-3 p-4 rounded-2xl bg-white/5 border border-white/10",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:"Elementy (opcjonalne)"}),(0,r.jsxs)("div",{className:"text-[11px] text-gray-500 mt-1",children:["Dodaj postacie/obiekty jako zestawy obraz\xf3w lub filmy. Odniesiej się do nich w poleceniu jako @Element1, @Element2... Do ",3," elementy."]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>{iA(e=>e.length>=3?e:[...e,{id:"kling-el-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),kind:"image",frontal_image_url:"",reference_image_urls:[]}])},disabled:!iO,className:"px-3 py-2 rounded-xl text-xs font-bold border transition-colors ".concat(iO?"bg-white/5 border-white/10 text-gray-200 hover:bg-white/10":"bg-white/5 border-white/10 text-gray-500 cursor-not-allowed"),children:"+ Obraz"}),(0,r.jsx)("button",{type:"button",onClick:()=>{iA(e=>e.length>=3?e:[...e,{id:"kling-el-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),kind:"video",video_url:""}])},disabled:!iO,className:"px-3 py-2 rounded-xl text-xs font-bold border transition-colors ".concat(iO?"bg-white/5 border-white/10 text-gray-200 hover:bg-white/10":"bg-white/5 border-white/10 text-gray-500 cursor-not-allowed"),children:"+ Wideo"})]})]}),0===iU.length?(0,r.jsx)("div",{className:"text-sm text-gray-500",children:"Nie dodano żadnych element\xf3w."}):(0,r.jsx)("div",{className:"space-y-3",children:iU.map((e,t)=>{let a=iI[e.id]||{};return(0,r.jsxs)("div",{className:"p-4 rounded-2xl bg-[#18181b]/50 border border-white/10",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"text-sm font-medium text-gray-200",children:["Element ",t+1," ",(0,r.jsxs)("span",{className:"text-xs text-gray-500",children:["(","video"===e.kind?"Wideo":"Zestaw obraz\xf3w",")"]})]}),(0,r.jsx)("button",{type:"button",onClick:()=>iV(e.id),className:"text-xs text-gray-400 hover:text-red-300 transition-colors",children:"Usuń"})]}),"video"===e.kind?(0,r.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-2",children:"URL wideo"}),(0,r.jsx)("input",{type:"url",value:e.video_url||"",onChange:t=>iT(e.id,{video_url:t.target.value}),placeholder:"https://.../element.mp4",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-3 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all text-sm"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("label",{className:"text-xs text-gray-500",children:"Albo przesyłaj wideo (MP4/AVI/MOV, ≤ 50MB)"}),(0,r.jsxs)("label",{className:"px-3 py-2 rounded-xl text-xs font-bold border transition-colors ".concat(a.video?"bg-white/5 border-white/10 text-gray-500 cursor-not-allowed":"bg-white/5 border-white/10 text-gray-200 hover:bg-white/10 cursor-pointer"),children:[a.video?"Przesyłam...":"Prześlij",(0,r.jsx)("input",{type:"file",accept:"video/mp4,video/avi,video/x-msvideo,video/quicktime",className:"hidden",disabled:!!a.video,onChange:async t=>{var a;let r=null===(a=t.target.files)||void 0===a?void 0:a[0];
1if(r)try{await sd(r,{setLoading:t=>iD(e.id,"video",t),onUploadedUrl:t=>iT(e.id,{video_url:t})})}catch(e){console.error("Failed to upload element video:",e)}}})]})]})]}):(0,r.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-2",children:"URL obrazu frontalnego"}),(0,r.jsx)("input",{type:"url",value:e.frontal_image_url||"",onChange:t=>iT(e.id,{frontal_image_url:t.target.value}),placeholder:"https://.../frontal.png",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-3 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all text-sm"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("label",{className:"text-xs text-gray-500",children:"Albo przesłać zdjęcie frontalne"}),(0,r.jsxs)("label",{className:"px-3 py-2 rounded-xl text-xs font-bold border transition-colors ".concat(a.frontal?"bg-white/5 border-white/10 text-gray-500 cursor-not-allowed":"bg-white/5 border-white/10 text-gray-200 hover:bg-white/10 cursor-pointer"),children:[a.frontal?"Przesyłam...":"Prześlij",(0,r.jsx)("input",{type:"file",accept:"image/*",className:"hidden",disabled:!!a.frontal,onChange:async t=>{var a;let r=null===(a=t.target.files)||void 0===a?void 0:a[0];if(r)try{await sn(r,{setLoading:t=>iD(e.id,"frontal",t),onUploadedUrl:t=>iT(e.id,{frontal_image_url:t})})}catch(e){console.error("Failed to upload frontal image:",e)}}})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-2",children:"Referencyjne adresy URL obraz\xf3w (jeden na linię)"}),(0,r.jsx)("textarea",{value:(e.reference_image_urls||[]).join("\n"),onChange:t=>{let a=t.target.value.split("\n").map(e=>e.trim()).filter(Boolean);iT(e.id,{reference_image_urls:a})},placeholder:"https://.../ref1.png\\nhttps://.../ref2.png",className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-3 text-gray-200 placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/50 transition-all h-24 resize-none text-sm scrollbar-primary"})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("label",{className:"text-xs text-gray-500",children:"Albo przesyłać zdjęcia referencyjne"}),(0,r.jsxs)("label",{className:"px-3 py-2 rounded-xl text-xs font-bold border transition-colors ".concat(a.refs?"bg-white/5 border-white/10 text-gray-500 cursor-not-allowed":"bg-white/5 border-white/10 text-gray-200 hover:bg-white/10 cursor-pointer"),children:[a.refs?"Przesyłam...":"Prześlij",(0,r.jsx)("input",{type:"file",accept:"image/*",multiple:!0,className:"hidden",disabled:!!a.refs,onChange:async t=>{let a=Array.from(t.target.files||[]);if(0!==a.length){iD(e.id,"refs",!0);try{let t=[];for(let e of a){let a=await sn(e,{setLoading:()=>{},onUploadedUrl:()=>{}});t.push(a)}let r=[...e.reference_image_urls||[],...t].map(e=>String(e||"").trim()).filter(Boolean);iT(e.id,{reference_image_urls:Array.from(new Set(r))})}catch(e){console.error("Failed to upload reference images:",e)}finally{iD(e.id,"refs",!1)}}}})]})]})]})]},e.id)})})]})]}),"vidu"===ew.type&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tl,{label:"Czas trwania",value:rI,onChange:e=>rM(e),options:ew.supportedDurations.map(e=>({value:e,label:"".concat(e," seconds")}))}),(0,r.jsx)(tl,{label:"Proporcje obrazu",value:rO,onChange:e=>rZ(e),options:ew.supportedAspectRatios.map(e=>({value:e,label:e}))}),(0,r.jsx)(tl,{label:"Rozwiązanie",value:rF,onChange:e=>rE(e),options:ew.supportedResolutions.map(e=>({value:e,label:e}))}),(0,r.jsxs)("div",{className:"p-3 bg-indigo-500/10 border border-indigo-500/20 rounded-xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs text-gray-400",children:"Wymagane punkty:"}),(0,r.jsxs)("span",{className:"text-sm font-bold text-indigo-400",children:[i5()," Kredyty",R.X&&(0,r.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-1",children:(0,R.w)(i5())})]})]}),(0,r.jsxs)("div",{className:"mt-1 text-[11px] text-gray-500",children:[eb(rF)," kredyty / Druga"]}),(0,r.jsx)("div",{className:"mt-1 text-[11px] text-gray-600",children:"Uwaga: Vidu Q3 obraz do wideo ignoruje proporcje obrazu."})]})]}),"ltx2"===ew.type&&(0,r.jsxs)(r.Fragment,{children:["ltx2"===ew.type&&(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"relative ".concat(iQ?"z-[9999]":"z-40"),children:[(0,r.jsxs)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-3",children:["Sterowniki (IC-LoRA)",(0,r.jsx)("span",{className:"text-gray-500 font-normal ml-2",children:"Wybierz przynajmniej jedną"})]}),(0,r.jsxs)("button",{onClick:()=>iY(!iQ),className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-3 text-left flex items-center justify-between hover:border-indigo-500/30 transition-all group/select",children:[(0,r.jsx)("div",{className:"min-w-0",children:(()=>{let e=to.filter(e=>i$.includes(e.id)),t=e.find(e=>"detailer"===e.id)||e[0],a=Math.max(0,e.length-(t?1:0));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-sm text-gray-200 truncate",children:[(null==t?void 0:t.name)||"Wzmacniacz szczeg\xf3ł\xf3w",a>0?" +".concat(a):""]}),(0,r.jsxs)("div",{className:"text-[11px] text-gray-500 mt-0.5 truncate",children:[e.length," Wybrany"]})]})})()}),(0,r.jsx)(o.Z,{size:16,className:"text-gray-400 transition-transform ".concat(iQ?"rotate-180":"")})]}),iQ&&(0,r.jsxs)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-[#18181b] border border-white/10 rounded-xl shadow-2xl overflow-hidden z-[10000] animate-fade-in",children:[(0,r.jsx)("div",{className:"max-h-[320px] overflow-y-auto scrollbar-thin scrollbar-thumb-indigo-500/50 scrollbar-track-white/5",children:to.map(e=>
1{let t=i$.includes(e.id),a=t&&1===i$.length;return(0,r.jsxs)("button",{onClick:()=>{t&&!a?i0(i$.filter(t=>t!==e.id)):t||i0([...i$,e.id])},disabled:a,className:"w-full p-3 flex items-start gap-3 hover:bg-white/5 transition-colors border-b border-white/5 last:border-b-0 ".concat(t?"bg-indigo-500/10":""," ").concat(a?"opacity-60 cursor-not-allowed":""),children:[(0,r.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-gradient-to-br from-indigo-500/20 to-purple-500/20 flex items-center justify-center text-lg border border-indigo-500/30",children:e.icon}),(0,r.jsxs)("div",{className:"flex-1 text-left min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-medium text-white text-sm truncate",children:e.name}),t&&(0,r.jsx)(n.Z,{size:16,className:"text-indigo-400 flex-shrink-0"})]}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 line-clamp-2",children:e.description})]})]},e.id)})}),(0,r.jsxs)("div",{className:"p-2 border-t border-white/5 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"text-[11px] text-gray-500",children:[i$.length," Wybrany"]}),(0,r.jsx)("button",{onClick:()=>iY(!1),className:"px-3 py-1.5 text-xs rounded-lg bg-white/5 hover:bg-white/10 border border-white/10 text-gray-200 transition-colors",children:"Gotowe"})]})]})]})}),(0,r.jsxs)("div",{className:"relative ".concat(iH?"z-[9999]":"z-40"),children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-2",children:"Rozmiar wideo"}),(0,r.jsxs)("button",{onClick:()=>iq(!iH),className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-3 text-left flex items-center justify-between hover:border-indigo-500/30 transition-all group/select",children:[(0,r.jsx)("div",{children:(0,r.jsx)("span",{className:"text-sm text-gray-200",children:null===(d=ew.supportedVideoSizes.find(e=>e.value===iB))||void 0===d?void 0:d.label})}),(0,r.jsx)(o.Z,{size:16,className:"text-gray-400 transition-transform ".concat(iH?"rotate-180":"")})]}),iH&&(0,r.jsx)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-[#18181b] border border-white/10 rounded-xl shadow-2xl overflow-hidden z-[10000] animate-fade-in",children:(0,r.jsx)("div",{className:"max-h-[240px] overflow-y-auto scrollbar-thin scrollbar-thumb-indigo-500/50 scrollbar-track-white/5",children:ew.supportedVideoSizes.map(e=>(0,r.jsxs)("button",{onClick:()=>{iG(e.value),iq(!1)},className:"w-full p-3 flex items-center justify-between hover:bg-white/5 transition-colors border-b border-white/5 last:border-b-0 ".concat(iB===e.value?"bg-indigo-500/10":""),children:[(0,r.jsx)("div",{className:"text-left",children:(0,r.jsx)("div",{className:"text-sm text-white",children:e.label})}),iB===e.value&&(0,r.jsx)(n.Z,{size:16,className:"text-indigo-400"})]},e.value))})})]}),(0,r.jsxs)("div",{className:"relative ".concat(iX?"z-[9999]":"z-40"),children:[(0,r.jsx)("label",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-2",children:"Czas trwania"}),(0,r.jsxs)("button",{onClick:()=>iJ(!iX),className:"w-full bg-[#18181b] border border-white/5 rounded-xl p-3 text-left flex items-center justify-between hover:border-indigo-500/30 transition-all group/select",children:[(0,r.jsxs)("span",{className:"text-sm text-gray-200",children:[iW," sekundy"]}),(0,r.jsx)(o.Z,{size:16,className:"text-gray-400 transition-transform ".concat(iX?"rotate-180":"")})]}),iX&&(0,r.jsx)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-[#18181b] border border-white/10 rounded-xl shadow-2xl overflow-hidden z-[10000] animate-fade-in",children:(0,r.jsx)("div",{className:"max-h-[280px] overflow-y-auto scrollbar-thin scrollbar-thumb-indigo-500/50 scrollbar-track-white/5",children:ew.supportedDurations.map(e=>(0,r.jsxs)("button",{onClick:()=>{iK(e),iJ(!1)},className:"w-full p-3 flex items-center justify-between hover:bg-white/5 transition-colors border-b border-white/5 last:border-b-0 ".concat(iW===e?"bg-indigo-500/10":""),children:[(0,r.jsxs)("span",{className:"text-sm text-white",children:[e," sekundy"]}),iW===e&&(0,r.jsx)(n.Z,{size:16,className:"text-indigo-400"})]},e))})})]}),(0,r.jsx)("div",{className:"p-3 bg-indigo-500/10 border border-indigo-500/20 rounded-xl",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-xs text-gray-400",children:"Wymagane punkty:"}),(0,r.jsxs)("span",{className:"text-sm font-bold text-indigo-400",children:[i5()," Kredyty",R.X&&(0,r.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-1",children:(0,R.w)(i5())})]})]})})]})]}),tM&&(0,r.jsxs)("div",{className:"mt-4 p-3 bg-red-500/10 border border-red-500/30 rounded-xl",children:[(0,r.jsx)("div",{className:"text-sm text-red-400",children:tM}),tZ&&(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:[(0,r.jsxs)(_.rU,{href:"/projects",className:"inline-flex items-center gap-1 rounded-lg bg-white/5 hover:bg-white/10 border border-white/10 px-2.5 py-1.5 text-red-300 hover:text-white transition-colors",children:["Przejdź do projekt\xf3w ",(0,r.jsx)(y.Z,{size:14})]}),(0,r.jsx)("span",{className:"text-red-300/80",children:"Wskaz\xf3wka: w Historii Projekt\xf3w → otw\xf3rz przedmiot i kliknij Odśwież."})]})]}),(0,r.jsxs)("div",{className:"pt-6 border-t border-white/5 mt-6",children:[(0,r.jsxs)("button",{onClick:sI,disabled:iE,title:void 0,className:"w-full py-4 rounded-xl font-bold text-sm shadow-[0_0_20px_rgba(0,0,0,0.5)] hover:scale-[1.02] transition-all flex items-center justify-center gap-2 group/btn bg-gradient-to-r from-indigo-600 to-purple-600 text-white disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,r.jsx)(l.Z,{size:18,className:"group-hover/btn:rotate-12 transition-transform"}),iF,(0,r.jsxs)("span",{className:"bg-black/20 px-2 py-0.5 rounded text-[10px] opacity-80 font-normal",children:[i5()," Kredyty",R.X&&(0,r.jsxs)(r.Fragment,{children:[" ",(0,R.w)(i5())]})]})]}),!1]})]})]})}),(0,r.jsx)("div",{className:"lg:col-span-7 xl:col-span-7 relative z-10 flex flex-col gap-6",children:(0,r.jsxs)("div",{className:"min-h-[400px] h-[600px] bg-[#09090b]/60 backdrop-blur-xl border border-white/[0.08] rounded-3xl p-1 relative flex items-center justify-center overflow-hidden group",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-[url('/noise.svg')] opacity-10 pointer-events-none"}),(0,r.jsx)("div",{className:"w-full h-full p-6 flex items-center justify-center",children:(0,r.jsxs)("div",{className:"w-full h-full max-w-4xl relative",children:[(0,r.jsx)("video",{controls:!0,className:"w-full h-full rounded-2xl shadow-2xl bg-black object-contain",src:tK,muted:!tW,loop:!tW,autoPlay:!tW,children:"Twoja przeglądarka nie obsługuje tagu wideo."}),tR&&(0,r.jsxs)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm flex flex-col items-center justify-center rounded-2xl",children:[(0,r.jsx)(f.Z,{size:64,className:"mb-4 animate-spin text-indigo-500"}),(0,r.jsx)("p",{className:"text-sm font-medium text-gray-200",children:"Generowanie twojego filmu..."}),(0,r.jsx)("p",{className:"text-xs text-gray-400 mt-2",children:"To może zająć kilka minut"})]})]})}),tP&&(0,r.jsx)("div",{className:"absolute top-6 right-6 flex gap-2",children:(0,r.jsx)("button",{onClick:()=>{let e=document.createElement("a");e.href=tP.video_url,e.target="_blank",e.rel="noopener noreferrer",e.click()},className:"w-10 h-10 rounded-full bg-[#18181b] border border-white/10 flex items-center justify-center text-gray-400 hover:text-white transition-colors",children:(0,r.jsx)(w.Z,{size:18})})})]})})]}),(0,r.jsxs)("div",{className:"border-t border-white/5 pt-16 mt-10 animate-fade-in-up",children:[(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,r.jsxs)("h3",{className:"text-xl font-bold text-white flex items-center gap-2",children:[(0,r.jsx)(v.Z,{size:20,className:"text-yellow-500"}),"Inspiracja"]}),(0,r.jsxs)(_.rU,{href:"/prompt",className:"text-xs text-gray-500 hover:text-white transition-colors flex items-center gap-1",children:["Zobacz wszystko ",(0,r.jsx)(y.Z,{size:12})]})]}),(0,r.jsx)(j.Z,{items:tT})]}),(0,r.jsxs)("div",{className:"mb-16",children:[(0,r.jsxs)("h3",{className:"text-xl font-bold text-white mb-6 flex items-center gap-2",children:[(0,r.jsx)(x.Z,{size:20,className:"text-indigo-500"}),"Jak to działa"]}),(0,r.jsx)(N.Z,{})]}),(0,r.jsx)(k.Z,{namespace:"ImageToVideo"})]}),(0,r.jsx)(C.Z,{open:(null==ey?void 0:ey.showLoginModal)||!1,setOpen:(null==ey?void 0:ey.setShowLoginModal)||(()=>{})})]})}},59582:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var r=a(57437);a(2265);var i=a(33907);let s={videoany:"/logo.png",magi:"/icon/magi.avif",veo:"/icon/Google.svg",sora:"/icon/OpenAI.svg",openai:"/icon/OpenAI.svg",wan:"/icon/Wan.svg",kling:"/icon/Kling.svg",ltx2:"/icon/LTX.png",ltx23:"/icon/LTX.png",grok:"/icon/xai.svg",grokVideo3:"/icon/xai.svg",xai:"/icon/xai.svg",vidu:"/icon/vidu.svg",qwen:"/icon/Wan.svg",happyhorse:"/icon/HappyHorse.png",glm:"/icon/glm.svg",nanobanana:"/icon/[email protected]",seedream:"/icon/seedance.svg"};function l(e){let{model:t,size:a=20,fallbackClassName:l="text-indigo-400"}=e,o=t?"videoany"===t.id||"videoany-v4"===t.id?"/logo.png":"seedance-2.0"===t.id?"/icon/seedance.svg":"fal-happy-horse-video"===t.id||"wavespeed-happyhorse-1.1"===t.id?
1"/icon/HappyHorse.png":(null==t?void 0:t.type)
1&&s[t.type]||null:null;if(!o)return(0,r.jsx)(i.Z,{size:a,className:l});let n=(null==t?void 0:t.type)||null,d=(null==t?void 0:t.id)==="videoany"||(null==t?void 0:t.id)==="videoany-v4"||"videoany"===n,c=a>=22?"p-1":"p-0.5";return(0,r.jsx)("span",{className:["inline-flex items-center justify-center rounded-full","veo"===n||"wan"===n||"qwen"===n||d||"magi"===n||"ltx2"===n||"ltx23"===n||"glm"===n||"nanobanana"===n||"grok"===n||"grokVideo3"===n||"xai"===n||"vidu"===n||"seedream"===n?"bg-white/90 ".concat(c," ring-1 ring-black/10"):"","drop-shadow-sm"].filter(Boolean).join(" "),children:(0,r.jsx)("img",{src:o,alt:(null==t?void 0:t.name)?"".concat(t.name," icon"):"Ikona modelu",style:{width:a,height:a},className:"block object-contain",loading:"lazy"})})}},35323:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */let r=(0,a(78030).Z)("Aperture",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m14.31 8 5.74 9.94",key:"1y6ab4"}],["path",{d:"M9.69 8h11.48",key:"1wxppr"}],["path",{d:"m7.38 12 5.74-9.94",key:"1grp0k"}],["path",{d:"M9.69 16 3.95 6.06",key:"libnyf"}],["path",{d:"M14.31 16H2.83",key:"x5fava"}],["path",{d:"m16.62 12-5.74 9.94",key:"1vwawt"}]])},30338:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});/**
7 * @license lucide-react v0.453.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */let r=(0,a(78030).Z)("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]])},17573:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});/**
12 * @license lucide-react v0.453.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */let r=(0,a(78030).Z)("AudioLines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]])},87592:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});/**
17 * @license lucide-react v0.453.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */let r=(0,a(78030).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},37151:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});/**
22 * @license lucide-react v0.453.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */let r=(0,a(78030).Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]])},27422:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});/**
27 * @license lucide-react v0.453.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */let r=(0,a(78030).Z)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]])},4086:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});/**
32 * @license lucide-react v0.453.0 - ISC
33 *
34 * This source code is licensed under the ISC license.
35 * See the LICENSE file in the root directory of this source tree.
36 */let r=(0,a(78030).Z)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},98094:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});/**
37 * @license lucide-react v0.453.0 - ISC
38 *
39 * This source code is licensed under the ISC license.
40 * See the LICENSE file in the root directory of this source tree.
41 */let r=(0,a(78030).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},58184:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});/**
42 * @license lucide-react v0.453.0 - ISC
43 *
44 * This source code is licensed under the ISC license.
45 * See the LICENSE file in the root directory of this source tree.
46 */let r=(0,a(78030).Z)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},11014:function(e,t,a){"use strict";a.d(t,{X:function(){return r},w:function(){return i}});let r=!1,i=e=>{let t=Number(e);return Number.isFinite(t)?"(~$".concat((.03*t).toFixed(2),")"):""}},13594:function(e,t,a){"use strict";function r(e){return"string"==typeof e?{url:e,first_frame_url:""}:e&&"object"==typeof e?{url:e.url||e.video_url||e.src||"",first_frame_url:e.first_frame_url||""}:{url:"",first_frame_url:""}}function i(e){return Array.isArray(e)?e.map(r).filter(e=>"string"==typeof e.url&&e.url):[]}a.d(t,{TA:function(){return i}})},67022:function(e,t,a){"use strict";a.d(t,{Hg:function(){return r},mf:function(){return i}});let r={DAILY:"daily"},i={DAILY_PUZZLE:5,REFERRAL_INVITER:15}},8780:function(e,t,a){"use strict";a.d(t,{C:function(){return i}});let r=new Set(["image/jpeg","image/jpg","image/png","image/webp","image/bmp"]);async function i(e){let{file:t,userId:a,maxFileSizeMB:i=10}=e;if(!t)throw Error("No image file provided");
46if(!a)throw Error("Authentication required");if(!r.has(t.type))throw Error("Unsupported image format. Only JPG, PNG, WEBP, and BMP formats are supported");let s=1048576*i;if(t.size>s){let e=Error("File size exceeds the ".concat(i,"MB limit."));throw e.code="FILE_TOO_LARGE",e.maxFileSizeMB=i,e}let l=await fetch("/api/get-upload-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileName:t.name,fileType:t.type,fileSize:t.size,maxFileSizeMB:i,userId:a})}),o=await l.json().catch(()=>({}));if(!l.ok||!o.uploadUrl){let e=Error(o.error||"Failed to get upload URL");throw e.code=o.code,e.maxFileSizeMB=o.maxFileSizeMB,e}let n=await fetch(o.uploadUrl,{method:"PUT",headers:{"Content-Type":t.type},body:t});if(!n.ok)throw Error("Failed to upload image to storage: ".concat(n.status));return o.imageId&&!(await fetch("/api/upload-image/metadata",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageId:o.imageId,publicUrl:o.publicUrl,status:"uploaded"})})).ok&&console.warn("Image reached storage but metadata finalization failed"),{success:!0,url:o.publicUrl,filename:o.objectName,imageId:o.imageId||null}}},26004:function(e,t,a){"use strict";a.d(t,{Vk:function(){return c},rq:function(){return n},sQ:function(){return d}});let r=new Set(["video/mp4","video/webm","video/avi","video/x-msvideo","video/quicktime","image/gif"]),i={avi:"video/x-msvideo",gif:"image/gif",mov:"video/quicktime",mp4:"video/mp4",webm:"video/webm"},s={"application/mp4":"video/mp4","application/quicktime":"video/quicktime","video/msvideo":"video/x-msvideo","video/x-avi":"video/x-msvideo","video/x-m4v":"video/mp4"},l=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return t.find(e=>"string"==typeof e&&e.trim())},o=(e,t)=>{var a,r;return l(null==e?void 0:e.details,null==e?void 0:e.message,null==e?void 0:e.error,null==e?void 0:null===(a=e.details)||void 0===a?void 0:a.message,null==e?void 0:null===(r=e.error)||void 0===r?void 0:r.message,t)};function n(e){let t="string"==typeof(null==e?void 0:e.type)?e.type.split(";")[0].trim().toLowerCase():"";if(r.has(t))return t;if(s[t])return s[t];if(!t||"application/octet-stream"===t){var a;return i[null===(a=String((null==e?void 0:e.name)||"").split(".").pop())||void 0===a?void 0:a.toLowerCase()]||t}return t}function d(e){return r.has(n(e))}async function c(e){let{file:t,userId:a,maxFileSizeMB:i=50,uploadPurpose:s="video-general"}=e;if(!t)throw Error("No video file provided");if(!a)throw Error("Authentication required");let l=n(t);if(!r.has(l))throw Error("Unsupported media format. Only MP4, WebM, AVI, MOV, and GIF formats are supported");let d=1048576*i;if(!Number.isFinite(t.size)||t.size<=0)throw Error("The selected media file is empty or unavailable");if(t.size>d){let e=Error("File size exceeds the ".concat(i,"MB limit."));throw e.code="FILE_TOO_LARGE",e.maxFileSizeMB=i,e}let c=await fetch("/api/get-upload-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileName:t.name,fileType:l,fileSize:t.size,maxFileSizeMB:i,uploadPurpose:s,userId:a})}),u=await c.json().catch(()=>({}));if(!c.ok||!u.uploadUrl||!u.publicUrl||!u.videoId){let e=Error(o(u,"Failed to prepare the video upload"));throw e.code=u.code,e.maxFileSizeMB=u.maxFileSizeMB,e}let p=await fetch(u.uploadUrl,{method:"PUT",headers:{"Content-Type":l},body:t});if(!p.ok)throw Error("Failed to upload video to storage (".concat(p.status,")"));let m=u.publicUrl,x=null;for(let e=0;e<2;e+=1){let t=await fetch("/api/upload-video/metadata",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:a,videoId:u.videoId})}),r=await t.json().catch(()=>({}));if(t.ok){m=r.publicUrl||m,x=null;break}x=Error(o(r,"Video reached storage but could not be finalized")),0===e&&await new Promise(e=>setTimeout(e,300))}if(x)throw x;return{success:!0,url:m,filename:u.objectName,videoId:u.videoId||null}}}},function(e){e.O(0,[95501,86281,47968,66760,87138,46819,25948,21315,60995,38472,62566,26866,69594,17998,92754,25341,92971,47023,1744],function(){return e(e.s=57683)}),_N_E=e.O()}]);

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.