PageSourceSearch

https://seeda.app/_next/static/chunks/b6452f20-caa3914b0d058ae6.js

js seeda.app collected 2026-10-04 13:29:39 UTC 62,709 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[72132],{38543:(e,t,n)=>{n.d(t,{_:()=>V});var r=n(76471),a=n(82258),i=n(87639),o=n(32812),l=n(20857),s=n(57505),u=n(17727),d=n(49835),c=n(3395),m=n(69140),f=n(20792),p=n(78372),h=n(76539),g=n(25244),v=n(28891),x=n(18066),b=n(41936),w=n(88669),y=n(4586),j=n(90094),k=n(50815),N=n(86892),C=n(86482),S=n(90455),_=n(90745),I=n(45968),M=n(94820),R=n(51150),T=n(93747),q=n(16319),P=n(51668),E=n(50944),A=n(37126);function U(e,t){var n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return!e.requiresPaid||t?"available":r?n?"locked":"pending":"locked"}function L(e){var t=e.supportsVideoUpload,n=e.className;return t?(0,m.jsxs)("span",{className:ee("relative flex h-5 w-5 items-center justify-center",n),children:[(0,m.jsx)(g.A,{className:"h-4.5 w-4.5 -translate-x-0.5"}),(0,m.jsx)("span",{className:"bg-background border-border absolute -right-1 -bottom-1 flex h-3.5 w-3.5 items-center justify-center rounded-full border shadow-sm",children:(0,m.jsx)(v.A,{className:"h-2.5 w-2.5"})})]}):(0,m.jsx)(g.A,{className:ee("h-5 w-5",n)})}var z={settings:"Settings",generate:"Generate",checking:"Checking",generatingImage:"Generating your image",generatingVideo:"Generating your video",warmingUp:"Warming up the model...",rendering:"Rendering frames...",painting:"Painting details...",finalizing:"Finalizing details...",promptRequired:"Please enter a prompt first.",uploadRequired:"Please wait for images to finish uploading.",uploadImage:"Upload image",edit:"Edit",createVideo:"Make video",createVideoShort:"Animate",download:"Download",downloading:"Downloading",stop:"Stop generation",stopped:"Generation stopped.",ready:"Ready to create"},D={prompt:void 0,model:void 0,previewImages:[],previewVideos:[],inputImages:[],inputVideos:[]};function V(e){var t,n,d,g,N,C,S,_,V,B,K,H,G,W,et,en,er,ea,ei,eo,el,es,eu,ed,ec,em,ef,ep,eh,eg,ev,ex,eb,ew,ey,ej,ek,eN,eC,eS,e_,eI,eM=e.config,eR=e.adapter,eT=e.app,eq=e.labels,eP=e.demoMedia,eE=e.settingsKey,eA=e.fixedBar,eU=void 0===eA||eA,eL=e.barShellClassName,ez=e.className,eD=e.share,eV=e.estimateCredits,eO=e.parseResultUrls,eF=void 0===eO?M.C:eO,eB=e.onRequest,eK=e.onResult,eH=e.onError,eG=(0,o._)({},z,eq),eW=(0,f.useMemo)(function(){return(0,T.uv)(eM)},[eM]),eY=(0,s._)((0,f.useState)(eW.outputType),2),eZ=eY[0],eX=eY[1],eJ=(0,f.useMemo)(function(){var e,t;return(0,T.uv)((0,l._)((0,o._)({},eW),{outputType:eZ,defaultModel:null!=(t=null==(e=eW.defaultModelByOutputType)?void 0:e[eZ])?t:eW.defaultModel}))},[eZ,eW]),e$="".concat(null!=eE?eE:"shipany","_").concat(eZ),eQ=(0,s._)((0,f.useState)(!1),2),e0=eQ[0],e1=eQ[1],e2=(0,s._)((0,f.useState)(D),2),e3=e2[0],e5=e2[1],e4=(0,f.useMemo)(function(){var e,t,n,r,a,i;return t=(e={urlState:e3,demoMedia:eP,demoVideos:eW.demoVideos,demoImages:eW.demoImages}).urlState,n=e.demoMedia,r=e.demoVideos,a=e.demoImages,(i=(0,u._)(t.previewVideos.map(function(e){return{src:e,type:"video"}})).concat((0,u._)(t.previewImages.map(function(e){return{src:e,type:"image"}})))).length?i:(null==n?void 0:n.length)?n:(0,u._)((null!=r?r:[]).map(function(e){return{src:e,type:"video"}})).concat((0,u._)((null!=a?a:[]).map(function(e){return{src:e,type:"image"}})))},[eP,eW.demoImages,eW.demoVideos,e3]),e6=(0,f.useMemo)(function(){var e,t,n=new Set(eW.models.map(function(e){return e.outputType}
1)),r=(null!=(t=null==(e=eW.outputSwitch)?void 0:e.outputTypes)?t:["image","video"]).filter(function(e){return n.has(e)});return r.length>0?r:[eW.outputType]},[eW.models,null==(S=eW.outputSwitch)?void 0:S.outputTypes,eW.outputType]),e8=(null==(_=eW.outputSwitch)?void 0:_.enabled)!==!1&&e6.length>1,e7=(0,s._)((0,f.useState)(null!=(en=eJ.defaultPrompt)?en:""),2),e9=e7[0],te=e7[1],tt=(0,s._)((0,f.useState)(String(eJ.defaultModel)),2),tn=tt[0],tr=tt[1],ta=(0,s._)((0,f.useState)(eJ.defaultAspectRatio),2),ti=ta[0],to=ta[1],tl=(0,s._)((0,f.useState)(Number(eJ.defaultDuration)),2),ts=tl[0],tu=tl[1],td=(0,s._)((0,f.useState)(String(eJ.defaultResolution)),2),tc=td[0],tm=td[1],tf=(0,s._)((0,f.useState)(String(eJ.defaultFormat)),2),tp=tf[0],th=tf[1],tg=(0,s._)((0,f.useState)(String(eJ.defaultMode)),2),tv=tg[0],tx=tg[1],tb=(0,s._)((0,f.useState)(String(eJ.defaultGenerationType)),2),tw=tb[0],ty=tb[1],tj=(0,s._)((0,f.useState)(Number(eJ.defaultOutputCount)),2),tk=tj[0],tN=tj[1],tC=(0,s._)((0,f.useState)([]),2),tS=tC[0],t_=tC[1],tI=(0,s._)((0,f.useState)(null),2),tM=tI[0],tR=tI[1],tT=(0,s._)((0,f.useState)(!1),2),tq=tT[0],tP=tT[1],tE=(0,s._)((0,f.useState)(!1),2),tA=tE[0],tU=tE[1],tL=(0,s._)((0,f.useState)(!1),2),tz=tL[0],tD=tL[1],tV=(0,s._)((0,f.useState)(!1),2),tO=tV[0],tF=tV[1],tB=(0,s._)((0,f.useState)(!1),2),tK=tB[0],tH=tB[1],tG=(0,s._)((0,f.useState)(!1),2),tW=tG[0],tY=tG[1],tZ=(0,s._)((0,f.useState)(null),2),tX=tZ[0],tJ=tZ[1],t$=(0,s._)((0,f.useState)(0),2),tQ=t$[0],t0=t$[1],t1=(0,s._)((0,f.useState)(40),2),t2=t1[0],t3=t1[1],t5=(0,s._)((0,f.useState)({image:[],video:[]}),2),t4=t5[0],t6=t5[1],t8=(0,s._)((0,f.useState)(),2),t7=t8[0],t9=t8[1],ne=(0,s._)((0,f.useState)(0),2),nt=ne[0],nn=ne[1],nr=(0,s._)((0,f.useState)(null),2),na=nr[0],ni=nr[1],no=(0,f.useRef)(null),nl=(0,f.useRef)(null),ns=(0,f.useRef)(0),nu=(0,f.useRef)(null),nd=(0,f.useRef)(0),nc=(0,f.useRef)(null),nm=(0,f.useRef)(null),nf=(0,f.useRef)(null),np=(0,f.useRef)(null),nh=(0,f.useRef)(!1),ng=null!=(er=t4[eZ])?er:[],nv=(0,f.useMemo)(function(){return tS.filter(function(e){return"image"===e.type}).map(function(e){return e.url}).filter(function(e){return!!e})},[tS]),nx=(0,f.useMemo)(function(){return tS.filter(function(e){return"video"===e.type}).map(function(e){return e.url}).filter(function(e){return!!e})},[tS]),nb=(0,q.y)({outputType:eZ,hasInputImages:nv.length>0,hasInputVideos:nx.length>0}),nw=(0,T.WD)({config:eJ,outputType:eZ,scene:nb}),ny=null!=(ea=nw.find(function(e){return e.id===tn}))?ea:nw[0],nj=(0,R.ew)(eJ,null!=(ei=null==ny?void 0:ny.id)?ei:tn,{generationType:tw}),nk=(0,R.M)(eJ,null!=(eo=null==ny?void 0:ny.id)?eo:tn,{generationType:tw}),nN=(0,R.ST)(eJ,null!=(el=null==ny?void 0:ny.id)?el:tn),nC=(0,R.gK)(eJ,null!=(es=null==ny?void 0:ny.id)?es:tn),nS="video"===eZ&&nk>0,n_=nS?"".concat(eG.uploadImage," or video"):eG.uploadImage,nI=tS.reduce(function(e,t){return e+("video"===t.type?nN:1)},0),nM=nv.length+nx.length,nR=nw.map(function(e){return{value:e.id,label:e.label,requiresPaid:e.requiresPaid,paywallFeature:e.paywallFeature}}),nT=Z((0,T.sk)(eJ,null==ny?void 0:ny.id,"aspectRatio",(0,T.Bz)(eJ,null==ny?void 0:ny.id,tc,tw))),nq=Z((0,T.sk)(eJ,null==ny?void 0:ny.id,"mode",(0,T.tH)(eJ,null==ny?void 0:ny.id,tw))),nP=Z((0,T.sk)(eJ,null==ny?void 0:ny.id,"duration",null!=(ed=null!=(eu=null==ny?void 0:ny.durationOptions)?eu:eJ.durationOptions)?ed:[5,8,10])),nE=Z((0,T.sk)(eJ,null==ny?void 0:ny.id,"resolution",null!=(em=null!=(ec=null==ny?void 0:ny.resolutionOptions)?ec:eJ.resolutionOptions)?em:"image"===eZ?["2K","4K"]:[])),nA=Z((0,T.sk)(eJ,null==ny?void 0:ny.id,"format",null!=(ep=null!=(ef=null==ny?void 0:ny.formatOptions)?ef:eJ.formatOptions)?ep:["jpg","png"])),nU=Z((0,T.sk)(eJ,null==ny?void 0:ny.id,"outputCount",null!=(eg=null!=(eh=null==ny?void 0:ny.outputCountOptions)?eh:eJ.outputCountOptions)?eg:[])),nL=Z((0,T.sk)(eJ,null==ny?void 0:ny.id,"generationType",null!=(ex=null!=(ev=null==ny?void 0:ny.generationTypeOptions)?ev:eJ.generationTypeOptions)?ex:[])),nz=Math.max(1,Math.floor(tk||1)),nD=(0,f.useMemo)(function(){return(0,R.RG)({config:eJ,prompt:e9,inputImages:nv,inputVideos:nx,options:{model:tn,aspectRatio:ti,duration:ts,resolution:tc,format:tp,mode:tv,generationType:tw,outputCount:tk}})},[eJ,e9,nv,nx,tn,ti,ts,tc,tp,tv,tw,tk]),nV=("image"===eZ?(0,I.K)({scene:nb,resolution:tc}):(0,I.S)({model:nD.model,mode:tv,duration:ts,resolution:tc,hasInputVideo:nD.inputVideos.length>0}))*nz,nO=null==eV?void 0:eV(nD),nF=(n=(t={request:nD,legacyCredits:nV,estimateCredits:eV,estimatedCredits:nO}).request,d=t.legacyCredits,g=t.estimateCredits,"number"==typeof(C=null!=(N=t.estimatedCredits)?N:g?g(n):void 0)&&Number.isFinite(C)&&C>=0?C:d),nB=ng.length?ng.map(function(e){return{src:e,type:eZ}}):e4,nK=null!=(eb=nB[nt])?eb:nB[0],nH=null!=(ew=null==ny?void 0:ny.label)?ew:tn,nG=(0,f.useMemo)(function(){return tX&&(null==eD?void 0:eD.enabled)?(0,E.i_)({currentUrl:tX,media:nK,outputType:eZ,prompt:e9,model:tn,modelLabel:nH,title:eD.title||("undefined"!=typeof document?document.title:void 0),description:eD.description}):null},[nK,tX,tn,e9,eZ,null==eD?void 0:eD.description,null==eD?void 0:eD.enabled,null==eD?void 0:eD.title,nH]),nW=(0,f.useMemo)(function(){return(0,E.Fo)(null==eD?void 0:eD.platforms)},[null==eD?void 0:eD.platforms]),nY=ng.length>0?"result":null!=(ey=null==eD?void 0:eD.shareKind)?ey:"default",nZ="default"===nY?null==eD?void 0:eD.shortUrl:void 0,nX=null!=nZ?nZ:t7,nJ=(0,f.useMemo)(function(){return nG?(0,l._)((0,o._)({},nG),{shortUrl:nX}):null},[nG,nX]),n$=(0,f.useMemo)(function(){return(0,E.YR)(null==eD?void 0:eD.align)},[null==eD?void 0:eD.align]),nQ=eU&&!tA,n0=null!=(ej=null==eT||null==(V=eT.credits)?void 0:V.cost)?ej:nF,n1=null==(ek=null==eT?void 0:eT.isPaidReady)||ek,n2=(null==eT?void 0:eT.isPaid)===!0,n3=!!(null==eT?void 0:eT.user),n5=(null==eT||null==(B=eT.credits)?void 0:B.unlimited)===!0||"number"==typeof(null==eT||null==(K=eT.credits)?void 0:K.remaining),n4=(null==eT||null==(H=eT.credits)?void 0:H.unlimited)?"Unlimited":String(null==eT||null==(G=eT.credits)?void 0:G.remaining),n6=null!=(eN=null==eq?void 0:eq.generate)?eN:"image"===eZ?"Generate Image":"Generate Video",n8="image"===eZ&&/\bvideo\b/i.test(null!=(eC=eJ.promptPlaceholder)?eC:"")?"Upload images or describe what to create.":null!=(eS=eJ.promptPlaceholder)?eS:"Enter a prompt to generate";function n7(){return(0,r._)(function(){var e;return(0,c.YH)(this,function(t){switch(t.label){case 0:if((null==eT?void 0:eT.user)||!(null==eT?void 0:eT.requestSignIn))return[2,!1];return null==eT||null==(e=eT.track)||e.call(eT,"signin_required",{signin_reason:"upload_image",outputType:eZ}),[4,eT.requestSignIn()];case 1:return t.sent(),[2,!0]}})})()}function n9(e){return(0,r._)(function(){return(0,c.YH)(this,function(t){switch(t.label){case 0:if(0===e.length)return[2];return[4,n7()];case 1:if(t.sent())return[2];return[4,(0,r._)(function(){var t,n,a,s,d,m,f,p,h,g,v,x,b,w,y,j,k,N,C,S,_,I,M,R,T,q,P,E,A;return(0,c.YH)(this,function(U){switch(U.label){case 0:if(0===e.length||0===(t=e.map(function(e){return e.type.startsWith("image/")?{file:e,type:"image",slotCost:1}:nS&&e.type.startsWith("video/")?{file:e,type:"video",slotCost:nN}:null}).filter(function(e){return!!e})).length)return[2];return(n=t.filter(function(e){var t=e.file,n="video"===e.type?100:eJ.maxSizeMB;return t.size<=1024*n*1024})).length!==t.length&&(ni(d=nS?"Images must be ".concat(eJ.maxSizeMB,"MB or smaller. Videos must be 100MB or smaller."):"Images must be ".concat(eJ.maxSizeMB,"MB or smaller.")),null==eT||null==(s=eT.notify)||null==(a=s.error)||a.call(s,d)),[4,Promise.all(n.map(function(e){return(0,r._)(function(){var t,n;return(0,c.YH)(this,function(a){switch(a.label){case 0:var i;if("video"!==e.type)return[2,e];return t=[(0,o._)({},e)],n={},[4,(i=e.file,(0,r._)(function(){return(0,c.YH)(this,function(e){return[2,new Promise(function(e,t){var n=URL.createObjectURL(i),r=document.createElement("video"),a=function(){URL.revokeObjectURL(n),r.removeAttribute("src"),r.load()};r.preload="metadata",r.onloadedmetadata=function(){var t=r.duration;a(),e(Number.isFinite(t)?t:0)},r.onerror=function(){a(),t(Error("Could not read video duration."))},r.src=n})]})})())];case 1:return[2,l._.apply(void 0,t.concat([(n.durationSeconds=a.sent(),n)]))]}})})()})).catch(function(e){var t,n,r=(0,i._)(e,Error)?e.message:"Could not read video duration.";return ni(r),null==eT||null==(n=eT.notify)||null==(t=n.error)||t.call(n,r),null})];case 1:if(!(m=U.sent()))return[2];if(void 0!==nC&&tS.reduce(function(e,t){var n;return e+(null!=(n=t.durationSeconds)?n:0)},0)+m.reduce(function(e,t){var n;return e+(null!=(n=t.durationSeconds)?n:0)},0)>nC)return ni(h="Current video settings support up to ".concat(nC,"s of uploaded video.")),null==eT||null==(p=eT.notify)||null==(f=p.error)||f.call(p,h),[2];if(g=function(e){var t=e.outputType,n=e.maxImages;if(!(e.attachedImages<n))return"Current ".concat(t," settings support ").concat(X(n),". Remove extra images before adding more.")}({outputType:eZ,maxImages:nj,attachedImages:nI}))return ni(g),null==eT||null==(x=eT.notify)||null==(v=x.error)||v.call(x,g),[2];if(b=Math.max(nj-nI,0),w=nx.length,0===(y=m.filter(function(e){return("video"!==e.type||!(w>=nk))&&!(e.slotCost>b)&&(b-=e.slotCost,"video"===e.type&&(w+=1),!0)})).length)return[2];y.length<m.length&&(N=m.length-y.length,ni(C="Current ".concat(eZ," settings support ").concat(X(nj),". Added ").concat(y.length," file").concat(y.length>
11?"s":""," and skipped ").concat(N," file").concat(N>1?"s":"",".")),null==eT||null==(k=eT.notify)||null==(j=k.error)||j.call(k,C)),S=y.map(function(e){var t=e.file,n=e.type,r=e.durationSeconds,a=URL.createObjectURL(t);return{id:"".concat(t.name,"-").concat(t.size,"-").concat(Date.now(),"-").concat(Math.random()),type:n,preview:a,url:"image"!==n||eR.uploadImages?void 0:a,durationSeconds:"video"===n?r:void 0,status:"image"!==n||eR.uploadImages?"uploading":"ready"}}),t_(function(e){return(0,u._)(e).concat((0,u._)(S))}),U.label=2;case 2:if(U.trys.push([2,7,,8]),_=new Map,I=y.map(function(e,t){return(0,l._)((0,o._)({},e),{attachment:S[t]})}).filter(function(e){return"image"===e.type}),M=y.map(function(e,t){return(0,l._)((0,o._)({},e),{attachment:S[t]})}).filter(function(e){return"video"===e.type}),!(I.length>0&&eR.uploadImages))return[3,4];return[4,eR.uploadImages(I.map(function(e){return e.file}))];case 3:R=U.sent(),I.forEach(function(e,t){_.set(e.attachment.id,R[t])}),U.label=4;case 4:if(!(M.length>0))return[3,6];if(!eR.uploadVideos)throw Error("Video upload is not configured.");return[4,eR.uploadVideos(M.map(function(e){return e.file}))];case 5:T=U.sent(),M.forEach(function(e,t){_.set(e.attachment.id,T[t])}),U.label=6;case 6:return t_(function(e){return e.map(function(e){if(!S.some(function(t){return t.id===e.id}))return e;var t,n=null!=(t=_.get(e.id))?t:e.url;return(0,l._)((0,o._)({},e),{url:n,status:n?"ready":"error"})})}),[3,8];case 7:return q=U.sent(),ni((A=(0,i._)(q,Error)?q:Error("Failed to upload image")).message),null==eT||null==(E=eT.notify)||null==(P=E.error)||P.call(E,A.message),t_(function(e){return e.map(function(e){return S.some(function(t){return t.id===e.id})?(0,l._)((0,o._)({},e),{status:"error"}):e})}),[3,8];case 8:return[2]}})})()];case 2:return t.sent(),[2]}})})()}function re(e){if(!e)return!1;var t,n,r=Array.from(null!=(t=e.items)?t:[]);if(r.length>0)return r.some(function(e){return"file"===e.kind&&(e.type.startsWith("image/")||nS&&e.type.startsWith("video/"))});var a=Array.from(null!=(n=e.files)?n:[]);return a.filter(function(e){return e.type.startsWith("image/")}).length>0||nS&&a.filter(function(e){return e.type.startsWith("video/")}).length>0}function rt(e,t){return(0,r._)(function(){var n,r,a,i,o,l,s;return(0,c.YH)(this,function(u){switch(u.label){case 0:var d,c,m,f,p,h;if(!e||(c=(d={option:e,paid:n2,paidReady:n1,authenticated:!!(null==eT?void 0:eT.user)}).option,m=d.paid,"wait"==(n="available"===(h=U(c,m,void 0===(f=d.paidReady)||f,p=d.authenticated))?"none":"pending"===h?"wait":p?"paywall":"sign_in")))return[2];if("sign_in"!==n)return[3,2];return null==eT||null==(r=eT.track)||r.call(eT,"signin_required",{signin_reason:null!=(i=e.paywallFeature)?i:"premium_option",option:e.value}),[4,null==eT||null==(a=eT.requestSignIn)?void 0:a.call(eT)];case 1:return u.sent(),[2];case 2:if("paywall"===n)return null==eT||null==(o=eT.openPaywall)||o.call(eT,e.paywallFeature),null==eT||null==(l=eT.track)||l.call(eT,"paywall_shown",{paywall_reason:null!=(s=e.paywallFeature)?s:"premium_option",option:e.value}),[2];return t(e.value),[2]}})})()}function rn(){var e;null==(e=nl.current)||e.scrollIntoView({behavior:"smooth",block:"center"})}function rr(e){return(0,r._)(function(){return(0,c.YH)(this,function(t){switch(t.label){case 0:if(!e||!eR.cancel)return[2];return[4,eR.cancel(e).catch(function(){})];case 1:return t.sent(),[2]}})})()}function ra(e){var t;return(null==(t=nc.current)?void 0:t.id)===e.id}function ri(e){return(0,r._)(function(){var t,n,r,a,o,l,s,u,d,m,f,p,h,g,v,x,b,w,y,j;return(0,c.YH)(this,function(c){switch(c.label){case 0:if(null==e||e.preventDefault(),tK)return[2];if(ni(null),!e9.trim())return tD(!1),window.requestAnimationFrame(function(){return tD(!0)}),setTimeout(function(){return tD(!1)},900),ni(eG.promptRequired),[2];if(tS.some(function(e){return"uploading"===e.status}))return ni(eG.uploadRequired),[2];if(a=function(e){var t=e.outputType,n=e.maxImages,r=e.attachedImages;if(!(r<=n))return"Current ".concat(t," settings support ").concat(X(n),", but ").concat(X(r)," are attached. Remove ").concat(X(r-n)," or switch settings.")}({outputType:eZ,maxImages:nj,attachedImages:nI}))return ni(a),null==eT||null==(l=eT.notify)||null==(o=l.error)||o.call(l,a),[2];if(!(!(null==eT?void 0:eT.user)&&(null==eT?void 0:eT.requestSignIn)))return[3,2];return nu.current={prompt:e9,createdAt:Date.now()},[4,eT.requestSignIn()];case 1:return c.sent(),[2];case 2:s=(0,R.RG)({config:eJ,prompt:e9,inputImages:nv,inputVideos:nx,options:{model:tn,aspectRatio:ti,duration:ts,resolution:tc,format:tp,mode:tv,generationType:tw,outputCount:tk}}),u={id:nd.current+1,canceled:!1},nd.current=u.id,nc.current=u,nm.current=null,ro([]),nn(0),tH(!0),window.setTimeout(rn,50),null==eT||null==(n=eT.notify)||null==(t=n.info)||t.call(n,"image"===eZ?"Image generation started.":"Video generation started."),null==eT||null==(r=eT.track)||r.call(eT,"generation_started",{scene:s.scene,model:s.model,outputType:s.outputType}),null==eB||eB(s),c.label=3;case 3:return c.trys.push([3,9,10,11]),[4,eR.generate(s)];case 4:if(m=function(e){var t,n,r=J(e);if(!r)return null;var a=null!=(n=null!=(t=r.id)?t:r.taskId)?n:r.task_id;return"string"==typeof a?a:null}(d=c.sent()),u.canceled)return rr(m),[2];if(!ra(u))return[2];if(nm.current=m,f=eF(d),u.canceled)return rr(m),[2];p=Date.now(),c.label=5;case 5:if(!(!u.canceled&&ra(u)&&0===f.length&&m&&eR.query))return[3,8];if(Date.now()-p>18e5)throw Error("Generation timed out.");return[4,new Promise(function(e){return window.setTimeout(e,5e3)})];case 6:if(c.sent(),u.canceled)return rr(m),[2];if(!ra(u))return[2];return[4,eR.query(m)];case 7:var k;if("failed"===(k=h=function(e){var t,n=J(e);if(!n)return null;var r=null!=(t=n.status)?t:n.taskStatus;return"string"==typeof r?r.toLowerCase():null}(d=c.sent()))||"canceled"===k||"cancelled"===k)throw Error(null!=(g=function e(t){var n,r,a=J(t);if(!a)return null;var i=null!=(r=null!=(n=a.message)?n:a.error)?r:a.errorMessage;if("string"==typeof i&&i)return i;var o=a.taskInfo;if("string"==typeof o)try{return e(JSON.parse(o))}catch(e){return null}return e(o)}(d))?g:"Generation failed.");
1if(f=eF(d),"success"===h&&0===f.length)throw Error("image"===eZ?"No image returned. Please retry.":"No video returned. Please retry.");return[3,5];case 8:if(u.canceled)return rr(nm.current),[2];if(!ra(u))return[2];return ro(f),t0(100),f.length>0&&(window.setTimeout(rn,50),null==eT||null==(x=eT.notify)||null==(v=x.success)||v.call(x,"image"===eZ?"Image ready!":"Video ready!")),null==eK||eK(d,f),[3,11];case 9:if(b=c.sent(),u.canceled||!ra(u))return[2];return ni((j=(0,i._)(b,Error)?b:Error("Failed to generate")).message),null==eT||null==(y=eT.notify)||null==(w=y.error)||w.call(y,j.message),null==eH||eH(j),[3,11];case 10:return ra(u)&&(nc.current=null,nm.current=null,tH(!1)),[7];case 11:return[2]}})})()}function ro(e){t6(function(t){return(0,l._)((0,o._)({},t),(0,a._)({},eZ,e))})}function rl(e){e===eZ||tK||(e1(!1),eX(e),t9(void 0),ni(null))}function rs(){var e,t=null!=(e=ng[nt])?e:ng[0];if(t&&"image"===eZ)return t_(function(e){var n=!0,r=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){var l=i.value;l.preview.startsWith("blob:")&&URL.revokeObjectURL(l.preview)}}catch(e){r=!0,a=e}finally{try{n||null==o.return||o.return()}finally{if(r)throw a}}return[{id:"result-".concat(Date.now(),"-").concat(t),type:"image",preview:t,url:t,status:"ready"}]}),t}function ru(){window.requestAnimationFrame(function(){var e;null==(e=no.current)||e.focus()})}return(0,f.useEffect)(function(){tJ(window.location.href)},[]),(0,f.useEffect)(function(){if(eU){var e=document.body.style.paddingBottom;return document.body.style.paddingBottom="calc(160px + env(safe-area-inset-bottom))",function(){document.body.style.paddingBottom=e}}},[eU]),(0,f.useEffect)(function(){var e;e6.includes(eZ)||(e1(!1),eX(null!=(e=e6[0])?e:eW.outputType))},[eZ,e6,eW.outputType]),(0,f.useEffect)(function(){return function(){np.current&&clearTimeout(np.current)}},[]),(0,f.useEffect)(function(){var e,t,n,r,a,i,o,l=(0,A.p)(new URLSearchParams(window.location.search)),s=(0,P.bU)(e$),d=void 0!==s.model?String(s.model):eJ.defaultModel,c=void 0!==s.generationType?String(s.generationType):eJ.defaultGenerationType,m=null!=(e=l.model)?e:d,f=(0,R.M)(eJ,m,{generationType:c}),p=!nh.current;e5(l),p&&void 0!==l.prompt&&te(l.prompt),p&&(nh.current=!0,l.inputImages.length>0&&t_(l.inputImages.map(function(e,t){return{id:"url-".concat(t,"-").concat(e),type:"image",preview:e,url:e,status:"ready"}})),f>0&&l.inputVideos.length>0&&t_(function(e){return(0,u._)(e).concat((0,u._)(l.inputVideos.slice(0,f).map(function(e,t){return{id:"url-video-".concat(t,"-").concat(e),type:"video",preview:e,url:e,status:"ready"}})))}),(void 0!==l.prompt||l.previewImages.length>0||l.previewVideos.length>0||l.inputImages.length>0||l.inputVideos.length>0)&&(np.current&&clearTimeout(np.current),np.current=window.setTimeout(function(){np.current=null,window.requestAnimationFrame(function(){var e;null==(e=no.current)||e.focus({preventScroll:!0}),window.requestAnimationFrame(rn)})},80))),l.model&&eJ.models.some(function(e){return e.id===l.model&&e.outputType===eZ})?tr(l.model):void 0!==s.model?tr(d):tr(eJ.defaultModel),to(null!=(t=s.aspectRatio)?t:eJ.defaultAspectRatio),tu(Number(null!=(n=s.duration)?n:eJ.defaultDuration)),tm(String(null!=(r=s.resolution)?r:eJ.defaultResolution)),th(String(null!=(a=s.format)?a:eJ.defaultFormat)),tx(String(null!=(i=s.mode)?i:eJ.defaultMode)),ty(c),tN(Number(null!=(o=s.outputCount)?o:eJ.defaultOutputCount)),e1(!0)},[eZ,eJ,e$]),(0,f.useEffect)(function(){t9(void 0)},[null==nG?void 0:nG.shareUrl,nY]),(0,f.useEffect)(function(){if((null==eD?void 0:eD.createShortLink)&&nG&&(t=(e={shareKind:nY,configuredShareShortUrl:nZ,runtimeShareShortUrl:t7}).shareKind,n=e.configuredShareShortUrl,r=e.runtimeShareShortUrl,"result"===t&&!n&&!r)){var e,t,n,r,a=!1;return Promise.resolve(eD.createShortLink({share:nG,shareKind:nY,pageKeyword:eD.pageKeyword,campaign:eD.campaign})).then(function(e){!a&&e&&t9(e)}).catch(function(){}),function(){a=!0}}},[nZ,t7,null==eD?void 0:eD.campaign,null==eD?void 0:eD.createShortLink,null==eD?void 0:eD.pageKeyword,nG,nY]),(0,f.useEffect)(function(){tM&&(tS.some(function(e){return e.preview===tM.src})||tR(null))},[tM,tS]),(0,f.useEffect)(function(){e0&&(0,P.Gg)(e$,{model:tn,aspectRatio:ti,duration:ts,resolution:tc,format:tp,mode:tv,generationType:tw,outputCount:tk})},[e0,e$,tn,ti,ts,tc,tp,tv,tw,tk]),(0,f.useEffect)(function(){0!==nw.length&&(nw.some(function(e){return e.id===tn})||tr(nw[0].id))},[nw,tn]),(0,f.useEffect)(function(){t_(function(e){var t=0,n=!1,r=e.filter(function(e){if("video"!==e.type)return!0;t+=1;var r=nS&&t<=Math.max(nk,0);return!r&&(n=!0,e.preview.startsWith("blob:")&&URL.revokeObjectURL(e.preview)),r});return n?r:e})},[nS,nk]),(0,f.useEffect)(function(){var e,t,n,r,a;ny&&(nT.length>0&&!nT.some(function(e){return e.value===ti})&&to((0,T.Rz)({config:eJ,modelId:ny.id,resolution:tc,generationType:tw,aspectRatio:ti})),nq.length>0&&!nq.some(function(e){return e.value===tv})&&tx((0,T.d1)({config:eJ,modelId:ny.id,generationType:tw,mode:tv})),nL.length>0&&!nL.some(function(e){return e.value===tw})&&ty(null!=(e=ny.defaultGenerationType)?e:nL[0].value),nP.length>0&&!nP.some(function(e){return e.value===String(ts)})&&tu(Number(null!=(t=ny.defaultDuration)?t:nP[0].value)),nE.length>0&&!nE.some(function(e){return e.value===tc})&&tm(null!=(n=ny.defaultResolution)?n:nE[0].value),nA.length>0&&!nA.some(function(e){return e.value===tp})&&th(null!=(r=ny.defaultFormat)?r:nA[0].value),nU.length>0&&!nU.some(function(e){return e.value===String(tk)})&&tN(Number(null!=(a=ny.defaultOutputCount)?a:nU[0].value)))},[ny,eJ,nT,ti,nq,tv,nL,tw,nP,ts,nE,tc,nA,tp,nU,tk]),(0,f.useLayoutEffect)(function(){var e=no.current;if(e){if(nQ){t3(40),e.scrollLeft=0;return}var t=e.style.height;e.style.height="auto";var n="undefined"!=typeof window&&window.matchMedia("(min-width: 768px)").matches?132:116,r=Math.min(Math.max(e.scrollHeight,40),n);e.style.height=t,t3(r)}},[e9,nQ]),(0,f.useEffect)(function(){if(tK){t0(5);var e=Date.now();return nf.current=setInterval(function(){t0(Math.round(5+90*(1-Math.pow(1-Math.min((Date.now()-e)/24e4,1),2.5))))},700),function(){nf.current&&(clearInterval(nf.current),nf.current=null)}}},[tK]),(0,f.useEffect)(function(){nt>=nB.length&&nn(0)},[nt,nB.length]),(0,f.useEffect)(function(){var e=nu.current;if(e&&(null==eT?void 0:eT.user)&&!tK){if(!(Date.now()-e.createdAt<=9e5)||e.prompt!==e9){nu.current=null;return}nu.current=null,window.setTimeout(function(){ri()},0)}},[null==eT?void 0:eT.user,tK,e9]),(0,m.jsxs)("section",{className:ee("relative z-10 px-4 py-8",ez),children:[(0,m.jsx)(F,{ref:nl,outputType:eZ,media:nB,isGenerating:tK,progress:tQ,prompt:e9,labels:eG,activeIndex:nt,onActiveIndexChange:nn,downloading:tW,onDownload:ng.length>0?function(){return(0,r._)(function(){var e,t,n,a,o,l,s,u;return(0,c.YH)(this,function(d){switch(d.label){case 0:if(!(t=null!=(e=ng[nt])?e:ng[0])||tW)return[2];tY(!0),d.label=1;case 1:if(d.trys.push([1,6,7,8]),!eR.download)return[3,3];return[4,eR.download(t)];case 2:return a=d.sent(),[3,5];case 3:var m;return[4,(m=t,(0,r._)(function(){var e;return(0,c.YH)(this,function(t){switch(t.label){case 0:return[4,fetch(m)];case 1:if(!(e=t.sent()).ok)throw Error("Download failed");return[2,e.blob()]}})})())];case 4:a=d.sent(),d.label=5;case 5:return function(e,t){var n=URL.createObjectURL(e);try{$(n,t)}finally{window.setTimeout(function(){return URL.revokeObjectURL(n)},1e3)}}(a,Q(t,eZ)),null==eT||null==(n=eT.track)||n.call(eT,"generation_downloaded",{outputType:eZ,model:nD.model}),[3,8];case 6:o=d.sent();try{$(t,Q(t,eZ))}catch(e){u=(0,i._)(o,Error)?o:Error("Download failed"),null==eT||null==(s=eT.notify)||null==(l=s.error)||l.call(s,u.message)}return[3,8];case 7:return tY(!1),[7];case 8:return[2]}})})()}:void 0,onEdit:"image"===eZ&&ng.length>0?function(){var e;rs()&&(ru(),null==eT||null==(e=eT.track)||e.call(eT,"generation_edit_clicked",{outputType:eZ,model:nD.model,source:"result"}))}:void 0,onCreateVideo:"image"===eZ&&ng.length>0&&e6.includes("video")?function(){var e;"image"===eZ&&!tK&&e6.includes("video")&&rs()&&(rl("video"),ru(),null==eT||null==(e=eT.track)||e.call(eT,"generation_video_from_image_clicked",{outputType:"video",model:nD.model,source:"result"}))}:void 0,share:nJ,sharePlatforms:nW,shareShowCount:null==eD?void 0:eD.showCount,shareShowLabels:null==eD?void 0:eD.showLabels,shareAlign:n$,shareSource:null!=(e_=null==eD?void 0:eD.source)?e_:"shipany-generator",shareTaskId:null!=(eI=nm.current)?eI:void 0,shareKind:nY,sharePageKeyword:null==eD?void 0:eD.pageKeyword,shareCampaign:null==eD?void 0:eD.campaign,getShareCount:null==eD?void 0:eD.getShareCount,onShare:null==eD?void 0:eD.onShare}
1),(0,m.jsxs)("form",{onSubmit:ri,className:ee(eU?"fixed inset-x-0 bottom-0 z-[90] px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]":"mx-auto max-w-3xl"),children:[eU&&(0,m.jsx)("div",{className:"from-background via-background/80 pointer-events-none absolute inset-x-0 bottom-0 h-40 bg-gradient-to-t to-transparent"}),(0,m.jsxs)(p.P.div,{initial:!!eU&&{opacity:0,y:18,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.28,ease:[.2,.8,.2,1]},onDragEnter:function(e){re(e.dataTransfer)&&(e.preventDefault(),ns.current+=1,tF(!0))},onDragOver:function(e){re(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer.dropEffect="copy")},onDragLeave:function(e){tO&&(e.preventDefault(),ns.current-=1,ns.current<=0&&(ns.current=0,tF(!1)))},onDrop:function(e){if(re(e.dataTransfer)){e.preventDefault(),ns.current=0,tF(!1);var t,n=Array.from(null!=(t=e.dataTransfer.files)?t:[]);0!==n.length&&n9(n)}},onPaste:function(e){var t,n=Array.from(null!=(t=e.clipboardData.items)?t:[]).filter(function(e){return"file"===e.kind&&(e.type.startsWith("image/")||nS&&e.type.startsWith("video/"))}).map(function(e){return e.getAsFile()}).filter(function(e){return!!e});0!==n.length&&(e.preventDefault(),n9(n))},className:ee("border-border/60 bg-background/95 relative mx-auto max-w-4xl rounded-2xl border shadow-xl backdrop-blur",eL),children:[(0,m.jsxs)("div",{className:"border-border/20 border-b px-4 py-2.5",children:[(0,m.jsx)(h.N,{children:tS.length>0&&(0,m.jsx)(p.P.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mb-2 flex gap-2 overflow-x-auto",children:tS.map(function(e){return(0,m.jsxs)("div",{className:"group relative h-16 w-16 shrink-0",children:[(0,m.jsxs)("button",{type:"button",onClick:function(){return tR({src:e.preview,type:e.type})},disabled:"ready"!==e.status,className:"border-border/50 bg-muted/30 h-full w-full overflow-hidden rounded-xl border transition-opacity disabled:cursor-default","aria-label":"Preview uploaded ".concat(e.type),title:"Preview uploaded ".concat(e.type),children:["image"===e.type?(0,m.jsx)("img",{src:e.preview,alt:"",className:ee("h-full w-full object-cover","ready"===e.status&&"cursor-zoom-in")}):(0,m.jsxs)("div",{className:"relative h-full w-full",children:[(0,m.jsx)("video",{src:e.preview,muted:!0,playsInline:!0,preload:"metadata",className:ee("h-full w-full object-cover","ready"===e.status&&"cursor-zoom-in")}),(0,m.jsx)("span",{className:"absolute inset-0 flex items-center justify-center bg-black/20 text-white",children:(0,m.jsx)(v.A,{className:"h-5 w-5 drop-shadow"})})]}),"uploading"===e.status&&(0,m.jsx)("div",{className:"absolute inset-0 flex items-center justify-center rounded-xl bg-black/40",children:(0,m.jsx)(x.A,{className:"h-3.5 w-3.5 animate-spin text-white"})})]}),(0,m.jsx)("button",{type:"button",onClick:function(t){var n;t.stopPropagation(),n=e.id,t_(function(e){var t=e.find(function(e){return e.id===n});return(null==t?void 0:t.preview.startsWith("blob:"))&&URL.revokeObjectURL(t.preview),e.filter(function(e){return e.id!==n})})},className:"absolute -top-1 -right-1 flex h-7 w-7 items-center justify-center rounded-full p-1 text-white","aria-label":"Remove",children:(0,m.jsx)("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-black/60 backdrop-blur-sm",children:(0,m.jsx)(b.A,{className:"h-3 w-3"})})})]},e.id)})})}),(0,m.jsxs)(p.P.div,{layout:!0,transition:{duration:.28,ease:[.22,1,.36,1]},className:"flex items-center gap-2",children:[(0,m.jsxs)("label",{className:"border-border/50 bg-muted/35 text-muted-foreground hover:border-primary/35 hover:bg-primary/10 hover:text-primary relative flex h-10 w-10 shrink-0 items-center justify-center rounded-full border shadow-sm transition-all",title:n_,"aria-label":n_,onClick:function(e){(null==eT||!eT.user)&&(null==eT?void 0:eT.requestSignIn)&&(e.preventDefault(),n7())},children:[(0,m.jsx)("input",{type:"file",accept:nS?"image/*,video/*":"image/*",multiple:!0,hidden:!0,onChange:function(e){var t;n9(Array.from(null!=(t=e.target.files)?t:[])),e.target.value=""}}),(0,m.jsx)(L,{supportsVideoUpload:nS}
1),nM>0&&(0,m.jsx)("span",{className:"bg-primary text-primary-foreground absolute -top-0.5 -right-0.5 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9px] font-bold",children:nM})]}),(0,m.jsx)("textarea",{ref:no,value:e9,onChange:function(e){te(e.target.value),tz&&tD(!1)},placeholder:n8,rows:1,wrap:nQ?"off":"soft",style:{height:t2},className:ee("text-foreground placeholder:text-muted-foreground min-h-10 flex-1 resize-none rounded-lg border-0 bg-transparent px-1 py-2.5 text-sm leading-5 transition-[height,background-color,color] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] focus:ring-0 focus:outline-none md:max-h-[8.25rem] md:text-base md:leading-5",nQ?"max-h-10 overflow-x-hidden overflow-y-hidden whitespace-pre [scrollbar-width:none] [&::-webkit-scrollbar]:hidden":"max-h-[7.25rem] overflow-y-auto",tz&&"animate-[generator-prompt-shake_0.28s_ease-in-out_0s_2] bg-red-500/5 text-red-600 placeholder:text-red-500 dark:text-red-400 dark:placeholder:text-red-400"),onFocus:function(){tU(!0),tD(!1)},onBlur:function(){return tU(!1)},onKeyDown:function(e){(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),ri())}})]})]}),(0,m.jsx)(h.N,{initial:!1,children:tq&&(0,m.jsx)(p.P.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"border-border/20 overflow-visible border-b",children:(0,m.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2.5",children:[(0,m.jsx)(Y,{value:tn,options:nR,paid:n2,paidReady:n1,authenticated:n3,onChange:function(e){return rt(e,tr)}}),(0,m.jsx)(Y,{value:ti,options:nT,paid:n2,paidReady:n1,authenticated:n3,onChange:function(e){return rt(e,function(e){return to(e)})}}),"video"===eZ?(0,m.jsxs)(m.Fragment,{children:[nq.length>0&&(0,m.jsx)(Y,{value:tv,options:nq,paid:n2,paidReady:n1,authenticated:n3,onChange:function(e){return rt(e,tx)}}),nL.length>0&&(0,m.jsx)(Y,{value:tw,options:nL,paid:n2,paidReady:n1,authenticated:n3,onChange:function(e){return rt(e,ty)}}),nP.length>0&&(0,m.jsx)(Y,{value:String(ts),options:nP,paid:n2,paidReady:n1,authenticated:n3,onChange:function(e){return rt(e,function(e){return tu(Number(e))})}}),nE.length>0&&(0,m.jsx)(Y,{value:tc,options:nE,paid:n2,paidReady:n1,authenticated:n3,onChange:function(e){return rt(e,tm)}})]}):(0,m.jsxs)(m.Fragment,{children:[nU.length>0&&(0,m.jsx)(Y,{value:String(tk),options:nU,paid:n2,paidReady:n1,authenticated:n3,onChange:function(e){return rt(e,function(e){return tN(Number(e))})}}),(0,m.jsx)(Y,{value:tc,options:nE,paid:n2,paidReady:n1,authenticated:n3,onChange:function(e){return rt(e,tm)}}),(0,m.jsx)(Y,{value:tp,options:nA,paid:n2,paidReady:n1,authenticated:n3,onChange:function(e){return rt(e,th)}})]})]})},"settings")}),(0,m.jsxs)("div",{className:"flex items-center gap-1.5 overflow-hidden px-3 py-2.5 md:gap-2 md:px-4",children:[e8&&(0,m.jsx)("div",{className:"border-border/40 bg-muted/30 flex shrink-0 items-center rounded-full border p-1",children:e6.map(function(e){var t,n,r,a=e===eZ,i=null!=(r=null==(n=eW.outputSwitch)||null==(t=n.labels)?void 0:t[e])?r:"image"===e?"Image":"Video";return(0,m.jsx)("button",{type:"button",onClick:function(){return rl(e)},disabled:tK,className:ee("h-7 rounded-full px-2.5 text-xs font-semibold transition-all disabled:cursor-not-allowed disabled:opacity-60 sm:px-3",a?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),"aria-pressed":a,children:i},e)})}),(0,m.jsxs)("button",{type:"button",onClick:function(){return tP(function(e){return!e})},disabled:tK,"aria-label":eG.settings,title:eG.settings,className:"border-border/40 bg-muted/30 hover:bg-muted/50 flex h-7 shrink-0 items-center gap-1 rounded-full border px-2 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50 sm:px-2.5",children:[(0,m.jsx)(w.A,{className:"h-3 w-3"}),(0,m.jsx)("span",{className:"hidden sm:inline",children:eG.settings}),(0,m.jsx)(y.A,{className:ee("h-3 w-3 opacity-50 transition-transform",tq&&"rotate-180")})]}),(0,m.jsx)("div",{className:"flex-1"}),!!(null==eT?void 0:eT.user)&&void 0!==n0&&n5&&(0,m.jsxs)("div",{className:"border-border/40 bg-muted/30 text-muted-foreground flex shrink-0 items-center gap-1 rounded-full border px-2.5 py-1 text-xs tabular-nums",title:"".concat(n0," credits required for this generation"),"aria-label":"".concat(n4," credits available, ").concat(n0," credits required"),
1children:[(0,m.jsx)(j.A,{className:"h-3 w-3"}),(0,m.jsx)("span",{children:(null==eT||null==(W=eT.credits)?void 0:W.unlimited)?"∞":null==eT||null==(et=eT.credits)?void 0:et.remaining}),(0,m.jsx)("span",{className:"hidden opacity-70 sm:inline",children:"cr"}),(0,m.jsx)("span",{className:"opacity-40",children:"\xb7"}),(0,m.jsxs)("span",{className:"opacity-70 sm:hidden",children:["-",n0]}),(0,m.jsxs)("span",{className:"hidden opacity-70 sm:inline",children:[n0," cr cost"]})]}),tK?(0,m.jsx)(p.P.button,{type:"button",onClick:function(e){var t,n,r,a;e.preventDefault(),e.stopPropagation(),r=nc.current,a=nm.current,r&&(r.canceled=!0),nc.current=null,nm.current=null,ni(null),t0(0),tH(!1),null==eT||null==(n=eT.notify)||null==(t=n.info)||t.call(n,eG.stopped),rr(a)},"aria-label":eG.stop,title:tQ<95?"".concat(eG.stop," (").concat(tQ,"%)"):eG.stop,whileHover:{y:-2,scale:1.03},whileTap:{scale:.96},className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-white shadow-lg transition-all hover:brightness-110",style:{background:"linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%)",boxShadow:"0 4px 14px rgba(139, 92, 246, 0.35)"},children:(0,m.jsx)("span",{className:"h-3.5 w-3.5 rounded-[4px] bg-white"})}):(0,m.jsxs)(p.P.button,{type:"submit",className:"flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-full px-3 text-sm font-medium text-white transition-all hover:-translate-y-0.5 hover:brightness-110 active:translate-y-0 sm:px-4",whileHover:{y:-2,scale:1.01},whileTap:{scale:.98},style:{background:"linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%)",boxShadow:"0 4px 14px rgba(139, 92, 246, 0.35)"},children:[(0,m.jsx)("span",{className:"hidden sm:inline",children:n6}),(0,m.jsx)(k.A,{className:"h-3.5 w-3.5"})]})]}),na&&(0,m.jsx)("p",{className:"px-4 pb-2 text-xs text-red-600",children:na}),tK&&(0,m.jsx)("div",{className:"px-4 pb-2.5",children:(0,m.jsx)("div",{className:"bg-muted/30 h-1 w-full overflow-hidden rounded-full",children:(0,m.jsx)(p.P.div,{className:"h-full rounded-full bg-gradient-to-r from-purple-500 via-pink-500 to-orange-500",initial:{width:"0%"},animate:{width:"".concat(tQ,"%")},transition:{duration:.5,ease:"easeOut"}})})}),(0,m.jsx)(h.N,{children:tO&&(0,m.jsx)(p.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"bg-background/80 pointer-events-none absolute inset-0 z-30 flex items-center justify-center rounded-2xl backdrop-blur-sm",children:(0,m.jsxs)("div",{className:"border-primary/40 bg-primary text-primary-foreground shadow-primary/20 flex items-center gap-2.5 rounded-full border px-5 py-3 text-sm leading-none font-semibold shadow-lg",children:[(0,m.jsx)(L,{supportsVideoUpload:nS}),(0,m.jsx)("span",{children:"Drop to upload"})]})})})]}),(0,m.jsx)(O,{image:tM,onClose:function(){return tR(null)}})]})]})}function O(e){var t=e.image,n=e.onClose;return((0,f.useEffect)(function(){var e=function(e){"Escape"===e.key&&n()};if(t)return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}},[t,n]),"undefined"!=typeof document&&t)?(0,_.createPortal)((0,m.jsx)(p.P.div,{role:"dialog","aria-modal":"true","aria-label":"video"===t.type?"Video preview":"Image preview",className:"fixed inset-0 z-[1000] flex cursor-zoom-out items-center justify-center bg-black/85 p-4 backdrop-blur-sm md:p-8",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},onClick:n,children:"video"===t.type?(0,m.jsx)(p.P.video,{src:t.src,controls:!0,autoPlay:!0,playsInline:!0,className:"max-h-full max-w-full cursor-default object-contain shadow-2xl",initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.18,ease:"easeOut"},onClick:function(e){return e.stopPropagation()}}):(0,m.jsx)(p.P.img,{src:t.src,alt:t.alt||"",className:"max-h-full max-w-full cursor-default object-contain shadow-2xl",initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.18,ease:"easeOut"},onClick:function(e){return e.stopPropagation()}})}),document.body):null}var F=(0,f.forwardRef)(function(e,t){var n,r=e.outputType,a=e.media,i=e.isGenerating,o=e.progress,l=e.prompt,u=e.labels,d=e.activeIndex,c=e.onActiveIndexChange,g=e.downloading,b=e.onDownload,w=e.onEdit,y=e.onCreateVideo,j=e.share,S=e.sharePlatforms,_=e.shareShowCount,I=e.shareShowLabels,M=e.shareAlign,R=e.shareSource,T=e.shareTaskId,q=e.shareKind,P=e.sharePageKeyword,E=e.shareCampaign,A=e.getShareCount,U=e.onShare,L=null!=(n=a[d])?n:a[0],z=(0,s._)((0,f.useState)(null),2),D=z[0],V=z[1],F=2*Math.PI*42,K=F-Math.max(5,Math.min(o,100))/100*F,H="image"===r&&(null==L?void 0:L.type)==="image"&&!i,G=H&&!!w,W=H&&!!y;return(0,f.useEffect)(function(){D&&(a.some(function(e){return e.src===D.src})||V(null))},[a,D]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("div",{ref:t,id:"image"===r?"generated-image":"generated-video",className:ee("border-border/50 bg-muted/20 relative mx-auto w-full max-w-md overflow-hidden rounded-3xl border shadow-xl md:max-w-2xl lg:max-w-3xl","aspect-video"),children:[(0,m.jsx)(h.N,{mode:"wait",children:i?(0,m.jsxs)(p.P.div,{initial:{opacity:0,scale:.94},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.96},className:"absolute inset-0 flex flex-col items-center justify-center bg-gradient-to-br from-purple-100 via-pink-50 to-orange-100 p-5 text-center dark:from-purple-950/50 dark:via-zinc-950 dark:to-orange-950/40",children:[(0,m.jsxs)("div",{className:"relative mb-4 flex h-28 w-28 items-center justify-center",children:[(0,m.jsx)(p.P.div,{className:"absolute inset-2 rounded-full bg-gradient-to-br from-violet-500/25 via-fuchsia-500/20 to-orange-400/25 blur-xl",animate:{scale:[.92,1.1,.92],opacity:[.45,.8,.45]},transition:{duration:2.2,ease:"easeInOut",repeat:1/0}}),(0,m.jsxs)(p.P.svg,{viewBox:"0 0 104 104",className:"absolute inset-0 h-full w-full -rotate-90 drop-shadow-[0_0_14px_rgba(236,72,153,0.34)]","aria-hidden":"true",animate:{rotate:[-90,270]},transition:{duration:8,ease:"linear",repeat:1/0},children:[(0,m.jsx)("circle",{cx:"52",cy:"52",r:42,className:"stroke-black/10 dark:stroke-white/10",strokeWidth:"6",fill:"none"}),(0,m.jsx)(p.P.circle,{cx:"52",cy:"52",r:42,stroke:"url(#shipany-progress-gradient)",strokeWidth:"6",strokeLinecap:"round",fill:"none",strokeDasharray:F,initial:{strokeDashoffset:F},animate:{strokeDashoffset:K},transition:{duration:.8,ease:[.22,1,.36,1]}}),(0,m.jsx)(p.P.circle,{cx:"52",cy:"52",r:"34",stroke:"url(#shipany-progress-soft-gradient)",strokeWidth:"2",strokeLinecap:"round",fill:"none",strokeDasharray:"18 16",animate:{opacity:[.25,.65,.25]},transition:{duration:1.8,ease:"easeInOut",repeat:1/0}}),(0,m.jsxs)("defs",{children:[(0,m.jsxs)("linearGradient",{id:"shipany-progress-gradient",x1:"0",y1:"0",x2:"1",y2:"1",children:[(0,m.jsx)("stop",{offset:"0%",stopColor:"#8b5cf6"}),(0,m.jsx)("stop",{offset:"52%",stopColor:"#ec4899"}),(0,m.jsx)("stop",{offset:"100%",stopColor:"#fb923c"})]}),(0,m.jsxs)("linearGradient",{id:"shipany-progress-soft-gradient",x1:"1",y1:"0",x2:"0",y2:"1",children:[(0,m.jsx)("stop",{offset:"0%",stopColor:"#c084fc"}),(0,m.jsx)("stop",{offset:"100%",stopColor:"#fb923c"})]})]})]}),(0,m.jsx)(p.P.div,{className:"bg-background/70 relative flex h-16 w-16 items-center justify-center rounded-full border border-white/60 shadow-xl backdrop-blur",animate:{rotate:[0,5,-4,0],scale:[1,1.04,1]},transition:{duration:2,ease:"easeInOut",repeat:1/0},children:(0,m.jsx)(p.P.div,{animate:{rotate:360},transition:{duration:4,ease:"linear",repeat:1/0},children:(0,m.jsx)(k.A,{className:"text-foreground h-7 w-7"})})})]}),(0,m.jsx)("p",{className:"text-foreground text-sm font-medium",children:"image"===r?u.generatingImage:u.generatingVideo}),(0,m.jsx)("p",{className:"text-muted-foreground mt-1 text-xs",children:o<30?u.warmingUp:o<70?"image"===r?u.painting:u.rendering:u.finalizing}),l.trim()&&(0,m.jsxs)("div",{className:"border-border/50 bg-background/75 mt-4 w-full max-w-sm rounded-2xl border px-4 py-3 text-left shadow-sm backdrop-blur md:max-w-md",children:[(0,m.jsxs)("div",{className:"text-muted-foreground
1/70 mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-[0.16em] uppercase",children:[(0,m.jsx)(k.A,{className:"h-3 w-3"}),"Prompt"]}),(0,m.jsx)("p",{className:"text-muted-foreground line-clamp-4 text-xs leading-5 md:text-sm",children:l})]})]},"generating"):L?(0,m.jsxs)(p.P.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0",children:["image"===L.type?(0,m.jsx)("img",{src:L.src,alt:L.alt||"",onClick:function(){H&&V(L)},className:ee("h-full w-full object-contain",H&&"cursor-zoom-in")}):(0,m.jsx)("video",{src:L.src,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"h-full w-full object-contain"}),b&&(0,m.jsxs)(p.P.button,{type:"button",onClick:b,disabled:g,"aria-label":g?u.downloading:u.download,title:g?u.downloading:u.download,initial:{opacity:0,y:6},animate:{opacity:1,y:0},whileHover:{y:-2,scale:1.02},whileTap:{scale:.96},className:ee("bg-background/90 text-foreground hover:bg-background absolute right-3 z-20 flex h-9 items-center gap-2 rounded-full border border-white/50 px-3 text-xs font-medium shadow-lg backdrop-blur transition-colors disabled:pointer-events-none disabled:opacity-70",a.length>1?"bottom-16 sm:bottom-[4.25rem]":"bottom-3"),children:[g?(0,m.jsx)(x.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,m.jsx)(N.A,{className:"h-3.5 w-3.5"}),(0,m.jsx)("span",{className:"hidden sm:inline",children:g?u.downloading:u.download})]}),(G||W)&&(0,m.jsxs)("div",{className:"absolute bottom-3 left-3 z-20 flex items-center gap-2",children:[G&&(0,m.jsxs)(p.P.button,{type:"button",onClick:w,"aria-label":u.edit,title:u.edit,initial:{opacity:0,y:6},animate:{opacity:1,y:0},whileHover:{y:-2,scale:1.02},whileTap:{scale:.96},className:"flex h-9 items-center gap-1.5 rounded-full bg-black/45 px-3 text-xs font-semibold text-white shadow-lg backdrop-blur-md transition-colors hover:bg-black/60",children:[(0,m.jsx)(C.A,{className:"h-3.5 w-3.5 shrink-0"}),(0,m.jsx)("span",{children:u.edit})]}),W&&(0,m.jsxs)(p.P.button,{type:"button",onClick:y,"aria-label":u.createVideo,title:u.createVideo,initial:{opacity:0,y:6},animate:{opacity:1,y:0},whileHover:{y:-2,scale:1.02},whileTap:{scale:.96},className:"flex h-9 items-center gap-1.5 rounded-full bg-black/45 px-3 text-xs font-semibold text-white shadow-lg backdrop-blur-md transition-colors hover:bg-black/60",children:[(0,m.jsx)(v.A,{className:"h-3.5 w-3.5 shrink-0"}),(0,m.jsx)("span",{className:"sm:hidden",children:u.createVideoShort}),(0,m.jsx)("span",{className:"hidden sm:inline",children:u.createVideo})]})]}),a.length>1&&(0,m.jsx)("div",{className:"absolute bottom-3 left-1/2 z-10 flex max-w-[calc(100%-1.5rem)] -translate-x-1/2 gap-1.5 overflow-x-auto rounded-2xl bg-black/30 p-1.5 shadow-lg backdrop-blur-md [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:a.map(function(e,t){return(0,m.jsx)("button",{type:"button",onClick:function(){return c(t)},"aria-label":"Preview ".concat(t+1),className:ee("relative h-8 w-12 shrink-0 overflow-hidden rounded-lg border transition-all sm:h-10 sm:w-16",t===d?"border-white shadow-[0_0_0_2px_rgba(255,255,255,0.35)]":"border-white/30 opacity-70 hover:opacity-100"),children:"image"===e.type?(0,m.jsx)("img",{src:e.src,alt:"",className:"h-full w-full object-cover"}):(0,m.jsx)("video",{src:e.src,muted:!0,playsInline:!0,preload:"metadata",className:"h-full w-full object-cover"})},"".concat(e.src,"-").concat(t))})})]},L.src):(0,m.jsx)("div",{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-sm",children:u.ready})}),(0,m.jsx)(O,{image:D,onClose:function(){return V(null)}})]}),j&&!i&&(0,m.jsx)("div",{className:"mx-auto mt-3 flex w-full max-w-md justify-center md:max-w-2xl lg:max-w-3xl",children:(0,m.jsx)(B,{share:j,platforms:S,showCount:_,showLabels:I,align:M,source:R,taskId:T,shareKind:q,pageKeyword:P,campaign:E,getShareCount:A,onShare:U})})]})});function B(e){var t=e.share,n=e.platforms,a=e.showCount,i=void 0===a||a,o=e.showLabels,l=void 0===o||o,u=e.align,d=e.source,p=e.taskId,h=e.shareKind,g=e.pageKeyword,v=e.campaign,x=e.getShareCount,b=e.onShare,w=(0,s._)((0,f.useState)(null),2),y=w[0],j=w[1];return(0,f.useEffect)(function(){if(!i||!x)return void j(null);var e=!1;return Promise.resolve(x(t.rootUrl)).then(function(t){!e&&Number.isFinite(t)&&j(Math.max(0,Math.floor(Number(t))))}).catch(function(){e||j(null)}),function(){e=!0}},[x,t.rootUrl,i]),(0,m.jsxs)("div",{className:ee("flex w-full max-w-full flex-wrap items-center gap-2",K[void 0===u?"stretch":u]),"aria-label":"Share generated media",children:[(0,m.jsx)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:n.map(function(e){return(0,m.jsxs)("button",{type:"button",onClick:function(){return function(e){var n,a,o,l,s,u,m=(0,E.BN)({share:t,shareKind:h,pageKeyword:g,campaign:v}),f=(0,E.zy)({targetUrl:m,platform:e}),x=(0,E.RN)(t.shortUrl,e),w={platform:e,rootUrl:t.rootUrl,shareUrl:t.shareUrl,targetUrl:f,shortUrl:x,mediaType:t.mediaType,mediaUrl:t.mediaUrl,title:t.title,de
1scription:t.description,prompt:t.prompt,model:t.model,modelLabel:t.modelLabel,source:d,taskId:p},y=(0,E.Tz)(e,w);"email"===e?window.location.href=y:("instagram"===e&&x&&(n=x,(0,r._)(function(){var e;return(0,c.YH)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,null==(e=navigator.clipboard)?void 0:e.writeText(n)];case 1:case 2:return t.sent(),[3,3];case 3:return[2]}})})()),a=y,o=H[e],l=Math.max(0,Math.round(window.screenX+(window.outerWidth-640)/2)),s=Math.max(0,Math.round(window.screenY+(window.outerHeight-720)/2)),u=["noopener","noreferrer","scrollbars=yes","resizable=yes","width=".concat(640),"height=".concat(720),"left=".concat(l),"top=".concat(s)].join(","),window.open(a,"share-".concat(o.toLowerCase()),u)),i&&j(function(e){return"number"==typeof e?e+1:1});try{Promise.resolve(null==b?void 0:b(w)).then(function(e){var t=null==e?void 0:e.rootShareCount;"number"==typeof t&&Number.isFinite(t)&&j(Math.max(0,Math.floor(t)))}).catch(function(){})}catch(e){}}(e)},title:"Share to ".concat(H[e]),"aria-label":"Share to ".concat(H[e]),className:ee("flex shrink-0 items-center justify-center rounded-full text-xs font-semibold text-white shadow-[0_2px_8px_rgba(15,23,42,0.18)] ring-1 ring-white/15 transition-all hover:-translate-y-0.5 hover:brightness-110 focus-visible:ring-2 focus-visible:ring-white/70 focus-visible:ring-offset-2 focus-visible:outline-none active:translate-y-0 active:scale-95",l?"h-9 min-w-[7.5rem] gap-2 px-3":"h-9 w-9 p-0"),style:{background:G[e]},children:[(0,m.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center text-white [&>svg]:h-5 [&>svg]:w-5","aria-hidden":"true",dangerouslySetInnerHTML:{__html:W[e]}}),l&&(0,m.jsx)("span",{className:"hidden sm:inline",children:H[e]})]},e)})}),i&&"number"==typeof y&&(0,m.jsxs)("div",{className:"text-muted-foreground flex h-8 shrink-0 items-center gap-1.5 rounded-full bg-black/5 px-3 text-xs font-medium dark:bg-white/10",children:[(0,m.jsx)("span",{className:"text-foreground tabular-nums",children:y.toLocaleString()}),(0,m.jsx)("span",{className:"hidden sm:inline",children:"shares"})]})]})}var K={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",stretch:"justify-start"},H={facebook:"Facebook",threads:"Threads",x:"X",reddit:"Reddit",linkedin:"LinkedIn",instagram:"Instagram",email:"Email",whatsapp:"WhatsApp",telegram:"Telegram",line:"LINE"},G={facebook:"#1877f2",threads:"#000000",x:"#1da1f2",reddit:"#ff4500",linkedin:"#0a66c2",instagram:"linear-gradient(135deg, #833ab4 0%, #e1306c 52%, #f77737 100%)",email:"#64748b",whatsapp:"#25d366",telegram:"#229ed9",line:"#06c755"},W={facebook:"<svg xmlns='http://www.w3.org/2000/svg' fill='#fff' preserveAspectRatio='xMidYMid meet' height='1em' width='1em' viewBox='0 0 40 40'><g><path d='m21.7 16.7h5v5h-5v11.6h-5v-11.6h-5v-5h5v-2.1c0-2 0.6-4.5 1.8-5.9 1.3-1.3 2.8-2 4.7-2h3.5v5h-3.5c-0.9 0-1.5 0.6-1.5 1.5v3.5z'></path></g></svg>",threads:"<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M10.7373 2.15566C13.1446 1.8369 15.4081 2.25853 17.5278 3.42056C19.3546 4.66397 20.4641 6.35051 20.8565 8.48017C20.3829 8.55974 19.9169 8.6707 19.4584 8.81304C18.0881 5.18499 15.4472 3.56503 11.5362 3.95315C8.47313 4.35283 6.58688 6.06156 5.87738 9.07933C5.35174 11.5122 5.48489 13.9089 6.27682 16.2693C7.37977 18.9232 9.37698 20.2547 12.2685 20.2637C14.7037 20.4435 16.6121 19.5558 17.9938 17.6008C18.546 16.2271 18.4128 14.9401 17.5944 13.7395C17.3724 13.562 17.1506 13.3844 16.9286 13.2069C16.1179 16.7967 13.9653 18.0173 10.471 16.8685C8.86101 15.8872 8.3506 14.4891 8.93978 12.6743C9.62967 11.4736 10.6727 10.7856 12.0687 10.6105C13.1061 10.5593 14.1269 10.5372 15.1311 10.544C14.397 8.6267 13.0655 8.07192 11.1367 8.87961C10.807 9.05387 10.5408 9.29797 10.3378 9.61192C10.0272 9.4122 9.71646 9.21248 9.40579 9.01276C9.16222 8.86452 9.05127 8.6648 9.07292 8.41359C10.3266 6.97504 11.9022 6.46465 13.7997 6.8824C15.8315 7.59058 16.8744 9.03302 16.9286 11.2097C19.8117 12.6706 20.7437 14.9341 19.7247 18.0002C18.7434 20.0021 17.1678 21.267 14.998 21.7949C8.42938 22.8132 4.72344 20.0392 3.8801
17 13.4732C3.53915 10.5621 4.11612 7.85469 5.61109 5.3512C6.91174 3.62493 8.62046 2.55975 10.7373 2.15566Z' fill='white'/></svg>",x:"<svg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'><path fill='white' d='M459.4 151.7c.3 4.5.3 9.1.3 13.6 0 138.7-105.6 298.7-298.7 298.7-59.5 0-114.7-17.2-161-47.1 8.4 1 16.6 1.3 25.3 1.3 49.1 0 94.2-16.6 130.3-44.8-46.1-1-84.8-31.2-98.1-72.8 6.5 1 13 1.6 19.8 1.6 9.4 0 18.8-1.3 27.6-3.6-48.1-9.7-84.2-52-84.2-103v-1.3c14 7.8 30.2 12.7 47.4 13.3-28.3-18.8-46.8-51-46.8-87.4 0-19.5 5.2-37.4 14.3-53 51.7 63.7 129.3 105.3 216.4 109.8-1.6-7.8-2.6-15.9-2.6-24 0-57.8 46.8-104.9 104.9-104.9 30.2 0 57.5 12.7 76.7 33.1 23.7-4.5 46.5-13.3 66.6-25.3-7.8 24.4-24.4 44.8-46.1 57.8 21.1-2.3 41.6-8.1 60.5-16.2-14.3 20.8-32.2 39.3-52.6 54.2z'/></svg>",reddit:"<svg xmlns='http://www.w3.org/2000/svg' fill='#fff' preserveAspectRatio='xMidYMid meet' height='1em' width='1em' viewBox='0 0 40 40'><g><path d='m40 18.9q0 1.3-0.7 2.3t-1.7 1.7q0.2 1 0.2 2.1 0 3.5-2.3 6.4t-6.5 4.7-9 1.7-8.9-1.7-6.4-4.7-2.4-6.4q0-1.1 0.2-2.1-1.1-0.6-1.8-1.6t-0.7-2.4q0-1.8 1.3-3.2t3.1-1.3q1.9 0 3.3 1.4 4.8-3.3 11.5-3.6l2.6-11.6q0-0.3 0.3-0.5t0.6-0.1l8.2 1.8q0.4-0.8 1.2-1.3t1.8-0.5q1.4 0 2.4 1t0.9 2.3-0.9 2.4-2.4 1-2.4-1-0.9-2.4l-7.5-1.6-2.3 10.5q6.7 0.2 11.6 3.6 1.3-1.4 3.2-1.4 1.8 0 3.1 1.3t1.3 3.2z m-30.7 4.4q0 1.4 1 2.4t2.4 1 2.3-1 1-2.4-1-2.3-2.3-1q-1.4 0-2.4 1t-1 2.3z m18.1 8q0.3-0.3 0.3-0.6t-0.3-0.6q-0.2-0.2-0.5-0.2t-0.6 0.2q-0.9 0.9-2.7 1.4t-3.6 0.4-3.6-0.4-2.7-1.4q-0.2-0.2-0.5-0.2t-0.6 0.2q-0.3 0.2-0.3 0.6t0.3 0.6q1 0.9 2.6 1.5t2.8 0.6 2 0.1 2-0.1 2.8-0.6 2.6-1.6z m-0.1-4.6q1.4 0 2.4-1t1-2.4q0-1.3-1-2.3t-2.4-1q-1.3 0-2.3 1t-1 2.3 1 2.4 2.3 1z'></path></g></svg>",linkedin:"<svg xmlns='http://www.w3.org/2000/svg' fill='#fff' preserveAspectRatio='xMidYMid meet' height='1em' width='1em' viewBox='0 0 40 40'><g><path d='m13.3 31.7h-5v-16.7h5v16.7z m18.4 0h-5v-8.9c0-2.4-0.9-3.5-2.5-3.5-1.3 0-2.1 0.6-2.5 1.9v10.5h-5s0-15 0-16.7h3.9l0.3 3.3h0.1c1-1.6 2.7-2.8 4.9-2.8 1.7 0 3.1 0.5 4.2 1.7 1 1.2 1.6 2.8 1.6 5.1v9.4z m-18.3-20.9c0 1.4-1.1 2.5-2.6 2.5s-2.5-1.1-2.5-2.5 1.1-2.5 2.5-2.5 2.6 1.2 2.6 2.5z'></path></g></svg>",instagram:"<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><path fill='white' d='M7.8 2h8.4C19.4 2 22 4.6 22 7.8v8.4c0 3.2-2.6 5.8-5.8 5.8H7.8C4.6 22 2 19.4 2 16.2V7.8C2 4.6 4.6 2 7.8 2Zm0 2A3.8 3.8 0 0 0 4 7.8v8.4A3.8 3.8 0 0 0 7.8 20h8.4a3.8 3.8 0 0 0 3.8-3.8
1V7.8A3.8 3.8 0 0 0 16.2 4H7.8Zm8.7 2.5a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4ZM12 7a5 5 0 1 1 0 10 5 5 0 0 1 0-10Zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/></svg>",email:"<svg xmlns='http://www.w3.org/2000/svg' fill='#fff' preserveAspectRatio='xMidYMid meet' height='1em' width='1em' viewBox='0 0 40 40'><g><path d='m33.4 13.4v-3.4l-13.4 8.4-13.4-8.4v3.4l13.4 8.2z m0-6.8q1.3 0 2.3 1.1t0.9 2.3v20q0 1.3-0.9 2.3t-2.3 1.1h-26.8q-1.3 0-2.3-1.1t-0.9-2.3v-20q0-1.3 0.9-2.3t2.3-1.1h26.8z'></path></g></svg>",whatsapp:"<svg xmlns='http://www.w3.org/2000/svg' fill='#fff' preserveAspectRatio='xMidYMid meet' height='1em' width='1em' viewBox='0 0 40 40'><g><path d='m25 21.7q0.3 0 2.2 1t2 1.2q0 0.1 0 0.3 0 0.8-0.4 1.7-0.3 0.9-1.6 1.5t-2.2 0.6q-1.3 0-4.3-1.4-2.2-1-3.8-2.6t-3.3-4.2q-1.6-2.3-1.6-4.3v-0.2q0.1-2 1.7-3.5 0.5-0.5 1.2-0.5 0.1 0 0.4 0t0.4 0.1q0.4 0 0.6 0.1t0.3 0.6q0.2 0.5 0.8 2t0.5 1.7q0 0.5-0.8 1.3t-0.7 1q0 0.2 0.1 0.3 0.7 1.7 2.3 3.1 1.2 1.2 3.3 2.2 0.3 0.2 0.5 0.2 0.4 0 1.2-1.1t1.2-1.1z m-4.5 11.9q2.8 0 5.4-1.1t4.5-3 3-4.5 1.1-5.4-1.1-5.5-3-4.5-4.5-2.9-5.4-1.2-5.5 1.2-4.5 2.9-2.9 4.5-1.2 5.5q0 4.5 2.7 8.2l-1.7 5.2 5.4-1.8q3.5 2.4 7.7 2.4z m0-30.9q3.4 0 6.5 1.4t5.4 3.6 3.5 5.3 1.4 6.6-1.4 6.5-3.5 5.3-5.4 3.6-6.5 1.4q-4.4 0-8.2-2.1l-9.3 3 3-9.1q-2.4-3.9-2.4-8.6 0-3.5 1.4-6.6t3.6-5.3 5.3-3.6 6.6-1.4z'></path></g></svg>",telegram:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' viewBox='0 0 47 47' xml:space='preserve'><path fill='#fff' d='M23.5,0.6C10.8,0.6,0.6,10.8,0.6,23.5s10.3,22.9,22.9,22.9s22.9-10.3,22.9-22.9S36.2,0.6,23.5,0.6z M34.9,13.2 l-4.3,21.9c0,0-0.2,1-1.4,1c-0.7,0-1-0.3-1-0.3L22.4,31l-3.9,3.9c0,0-0.2,0.1-0.4,0.1c-0.1,0-0.2,0-0.3,0l1.1-6.8l0,0l11.3-10.4 c0.3-0.2,0.3-0.5,0.1-0.8h0c-0.2-0.3-0.6-0.3-0.8-0.1l-15.1,9l0,0l-5.8-1.6c0,0-1-0.3-1-1.2c0-0.7,1.1-1.1,1.1-1.1L33,12.3 c0,0,0.7-0.3,1.3-0.3c0.3,0,0.7,0.1,0.7,0.6C35,12.9,34.9,13.2,34.9,13.2z'/></svg>",line:"<svg viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'><path fill='white' d='M24 7.5C14.6 7.5 7 13.7 7 21.4c0 6.9 6.1 12.6 14.3 13.7.6.1 1.3.4 1.5.8.2.4.1 1.1.1 1.5l-.2 1.4c-.1.4-.4 1.7 1.5.9 1.9-.8 10.3-6.1 14.1-10.4 2.6-2.8 3.7-5.4 3.7-8C42 13.7 33.4 7.5 24 7.5z'/><text x='24' y='25.8' text-anchor='middle' font-family='Arial, Helvetica, sans-serif' font-size='7.4' font-weight='700' fill='#06c755'>LINE</text></svg>"};function Y(e){var t,n=e.value,r=e.options,a=e.paid,o=e.paidReady,l=e.authenticated,u=e.onChange,d=(0,s._)((0,f.useState)(!1),2),c=d[0],g=d[1],v=Math.max(r.findIndex(function(e){return e.value===n}),0),b=(0,s._)((0,f.useState)(v),2),w=b[0],j=b[1],k=(0,f.useRef)(null),N=r.find(function(e){return e.value===n});function C(e){"pending"!==U(e,a,o,l)&&(u(e),g(!1))}return(0,f.useEffect)(function(){var e=function(e){var t,n=e.target;(0,i._)(n,Node)&&((null==(t=k.current)?void 0:t.contains(n))||g(!1))},t=function(e){"Escape"===e.key&&g(!1)};if(c)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),function(){document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[c]),(0,f.useEffect)(function(){c&&j(v)},[c,v]),(0,m.jsxs)("div",{ref:k,className:"relative inline-flex shrink-0 items-center",children:[(0,m.jsxs)("button",{type:"button",onClick:function(){return g(function(e){return!e})},onKeyDown:function(e){if("ArrowDown"===e.key||"ArrowUp"===e.key){if(e.preventDefault(),c){var t;t="ArrowDown"===e.key?1:-1,j(function(e){return 0===r.length?0:(e+t+r.length)%r.length})}else g(!0),j(v);return}if("Enter"===e.key||" "===e.key){if(!c)return;e.preventDefault();var n=r[w];n&&C(n);return}"Escape"===e.key&&c&&(e.preventDefault(),g(!1))},"aria-haspopup":"listbox","aria-expanded":c,className:ee("border-border/40 bg-muted/30 hover:bg-muted/50 flex h-7 items-center gap-1 rounded-full border px-2.5 text-xs transition-colors focus:outline-none",c&&"border-primary/40 bg-primary/10"),children:[(0,m.jsx)("span",{children:null!=(t=null==N?void 0:N.label)?t:n}),(0,m.jsx)(y.A,{className:ee("h-3 w-3 opacity-50 transition-transform",c&&"rotate-180")})]}),(0,m.jsx)(h.N,{children:c&&(0,m.jsx)(p.P.div,{initial:{opacity:0,y:-4,scale:.98}
1,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:{duration:.14,ease:"easeOut"},role:"listbox",className:"border-border/50 bg-popover text-popover-foreground absolute bottom-full left-0 z-[80] mb-1.5 min-w-full overflow-hidden rounded-xl border p-1 shadow-xl backdrop-blur",children:r.map(function(e,t){var r=e.value===n,i=U(e,a,o,l),s="locked"===i,u="pending"===i;return(0,m.jsxs)("button",{type:"button",role:"option","aria-selected":r,onClick:function(){return C(e)},onMouseEnter:function(){return j(t)},disabled:u,className:ee("hover:bg-muted flex h-8 w-full items-center gap-2 rounded-lg border border-transparent px-2.5 text-left text-xs whitespace-nowrap transition-colors",t===w&&"bg-muted/80",r&&"bg-muted font-medium",s&&"border-violet-400/50 bg-violet-500/12 font-semibold text-violet-700 hover:bg-violet-500/18 dark:border-violet-400/40 dark:bg-violet-400/18 dark:text-violet-100",u&&"cursor-wait opacity-70 hover:bg-transparent disabled:pointer-events-none"),children:[s?(0,m.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-violet-600 text-white shadow-sm ring-2 shadow-violet-500/30 ring-violet-500/15 dark:bg-violet-300 dark:text-violet-950",children:(0,m.jsx)(S.A,{className:"h-3 w-3"})}):u?(0,m.jsx)("span",{className:"bg-muted text-muted-foreground flex h-5 w-5 shrink-0 items-center justify-center rounded-full",children:(0,m.jsx)(x.A,{className:"h-3 w-3 animate-spin"})}):null,(0,m.jsx)("span",{className:"min-w-0 flex-1",children:e.label}),s?(0,m.jsx)("span",{className:"rounded-full bg-violet-600/12 px-1.5 py-0.5 text-[10px] font-bold text-violet-700 dark:bg-violet-300/18 dark:text-violet-100",children:"Upgrade"}):u?(0,m.jsx)("span",{className:"bg-muted text-muted-foreground rounded-full px-1.5 py-0.5 text-[10px] font-semibold",children:"Checking"}):null]},e.value)})},"chip-select-menu")})]})}function Z(e){return e.map(function(e){var t;return(void 0===e?"undefined":(0,d._)(e))==="object"?{value:String(e.value),label:null!=(t=e.label)?t:String(e.value),requiresPaid:e.requiresPaid,paywallFeature:e.paywallFeature}:{value:String(e),label:String(e)}})}function X(e){var t=Math.max(0,Math.floor(e));return"".concat(t," ").concat(1===t?"image":"images")}function J(e){return e&&(void 0===e?"undefined":(0,d._)(e))==="object"?e:null}function $(e,t){var n=document.createElement("a");n.href=e,n.download=t,n.rel="noopener",n.target="_blank",document.body.append(n),n.click(),n.remove()}function Q(e,t){try{var n=new URL(e,window.location.href).pathname.split("/").filter(Boolean).pop();if(n&&/\.[a-z0-9]{2,5}$/i.test(n))return n}catch(e){}return"pvid-generated-".concat(t,".").concat("image"===t?"png":"mp4")}function ee(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}}}]);

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.