PageSourceSearch

https://grokimagineapp.com/assets/history-CImd6fMZ.js

js grokimagineapp.com collected 2026-10-08 06:17:12 UTC 34,744 bytes, 2 lines download raw bytes

1import{h as x,c as Oe,ap as Te,aq as Ae,r as j,j as t,aj as se,H as m,ar as Re,as as L,at as J,L as Fe,e as Ue,au as re,av as ne,aw as oe,ax as Ve,ay as ie,ab as qe,I as D,M as k,P as Ge,J as Me,G as He,ak as $e,az as ae,a3 as v,n as le,aA as ce,aB as de,aC as M,aD as q,aE as Be,N as z,V as X,ae as Ye}from"./main-Bel9aniX.js";import{I as P}from"./image-placeholder-Ddhr4aEX.js";import{c as H,I as ue,a as G,b as I,d as Qe}from"./infinite-scroll-sentinel-DPVYjsif.js";import{g as me}from"./view-transitions-BgnTfd7K.js";import{E as Ke,S as W}from"./prompt-gallery-state-BZAZQHbM.js";import{D as Je,P as Xe,a as We,b as Ze}from"./dashboard-header-BFCfmOTO.js";import{R as $}from"./result-download-button-DqyZBZeO.js";import{D as et,a as tt,b as st,c as rt,d as nt,e as ot,f as it}from"./drawer-IR-96NJp.js";import{u as at}from"./use-creation-CPos0X52.js";import{u as lt}from"./use-video-generation-history-r8EjZjX5.js";import{s as ct}from"./landing-reference-images-Btt731d2.js";import{g as xe,a as he}from"./image-workbench-routes-BYXm0J1J.js";import{I as dt}from"./IconChevronUp-Mk4QAhyU.js";import{I as B}from"./IconEdit-BslONNTM.js";import{I as Y}from"./IconDownload-BLA0aU7B.js";import{I as fe}from"./IconPlayerPlay-_uKd0zDV.js";import{a as ut,b as mt,c as xt,d as ht}from"./admin_tasks_status_processing-B2ZJCSpU.js";import{h as ft}from"./history_status_uploading-CDNIyXPP.js";import{h as E,c as ge}from"./history_type_video-CtTj-i6c.js";import{a as gt}from"./admin_tasks_columns_model-CSCkY5jP.js";import{a as pt,b as _t}from"./admin_tasks_columns_resolution-CmKoEkPU.js";import{a as bt}from"./admin_tasks_columns_quality-Bues5lpL.js";import{a as vt}from"./admin_tasks_columns_status-DY--q36P.js";import{c as pe,a as yt}from"./common_version_count-BuWNdQ3v.js";import{c as jt}from"./common_download_image-D3AZ--8s.js";import{c as Nt}from"./common_use_this_prompt-CuZffzW_.js";import"./skeleton-CATTQG4R.js";import"./locale-switcher-Db4vHSOr.js";import"./useControlled-BP4BbzZL.js";import"./IconArrowLeft-x2_8TPyE.js";import"./single-download-BARA71tu.js";import"./download-DEdK4HuD.js";import"./index-DT-8JlwJ.js";import"./useInfiniteQuery-DtRTL6i6.js";import"./creation-CXM3aVRQ.js";import"./video-generate-Cteu9GTP.js";const wt=()=>"Continue",kt=()=>"계속하기",It=()=>"Continuar",Ct=()=>"Continuer",Lt=()=>"Fortfahren",St=()=>"متابعة",zt=((e={},r={})=>{const s=r.locale??x();return s==="en"?wt():s==="ko"?kt():s==="es"?It():s==="fr"?Ct():s==="de"?Lt():St()}),Dt=()=>"Display",Pt=()=>"표시 방식",Et=()=>"Visualizacion",Ot=()=>"Display",Tt=()=>"Display",At=()=>"Display",Rt=((e={},r={})=>{const s=r.locale??x();return s==="en"?Dt():s==="ko"?Pt():s==="es"?Et():s==="fr"?Ot():s==="de"?Tt():At()}),Ft=()=>"Your creations will show up here.",Ut=()=>"생성한 이미지와 비디오가 여기에 표시됩니다.",Vt=()=>"Tus creaciones apareceran aqui.",qt=()=>"Your creations will show up here.",Gt=()=>"Your creations will show up here.",Mt=()=>"Your creations will show up here.",Ht=((e={},r={})=>{const s=r.locale??x();return s==="en"?Ft():s==="ko"?Ut():s==="es"?Vt():s==="fr"?qt():s==="de"?Gt():Mt()}),$t=()=>"No history yet",Bt=()=>"아직 히스토리가 없습니다",Yt=()=>"Aun no hay historial",Qt=()=>"No history yet",Kt=()=>"No history yet",Jt=()=>"No history yet",Xt=((e={},r={})=>{const s=r.locale??x();return s==="en"?$t():s==="ko"?Bt():s==="es"?Yt():s==="fr"?Qt():s==="de"?Kt():Jt()}),Wt=()=>"Grid",Zt=()=>"그리드",es=()=>"Cuadricula",ts=()=>"Grid",ss=()=>"Grid",rs=()=>"Grid",ns=((e={},r={})=>{const s=r.locale??x();return s==="en"?Wt():s==="ko"?Zt():s==="es"?es():s==="fr"?ts():s==="de"?ss():rs()}),os=()=>"Grid view",is=()=>"그리드 보기",as=()=>"Vista de cuadricula",ls=()=>"Grid view",cs=()=>"Grid view",ds=()=>"Grid view",us=((e={},r={})=>{const s=r.locale??x();return s==="en"?os():s==="ko"?is():s==="es"?as():s==="fr"?ls():s==="de"?cs():ds()}),ms=()=>"List",xs=()=>"목록",hs=()=>"Lista",fs=()=>"List",gs=()=>"List",ps=()=>"List",_s=((e={},r={})=>{const s=r.locale??x();return s==="en"?ms():s==="ko"?xs():s==="es"?hs():s==="fr"?fs():s==="de"?gs():ps()}),bs=()=>"List view",vs=()=>"목록 보기",ys=()=>"Vista de lista",js=()=>"List view",Ns=()=>"List view",ws=()=>"List view",ks=((e={},r={})=>{const s=r.locale??x();return s==="en"?bs():s==="ko"?vs():s==="es"?ys():s==="fr"?js():s==="de"?Ns():ws()}),Is=()=>"Something went wrong while loading your creations.",Cs=()=>"생성 히스토리를 불러오는 중 문제가 발생했습니다.",Ls=()=>"Algo salio mal al cargar tus creaciones.",Ss=()=>"Something went wrong while loading your creations.",zs=()=>"Something went wrong while loading your creations.",Ds=()=>"Something went wrong while loading your creations.",Ps=((e={},r={})=>{const s=r.locale??x();return s==="en"?Is():s==="ko"?Cs():s==="es"?Ls():s==="fr"?Ss():s==="de"?zs():Ds()}),Es=()=>"Failed to load history",Os=()=>"히스토리를 불러오지 못했습니다",Ts=()=>"No se pudo cargar el historial",As=()=>"Failed to load history",Rs=()=>"Failed to load history",Fs=()=>"Failed to load history",Us=((e={},r={})=>{const s=r.locale??x();return s==="en"?Es():s==="ko"?Os():s==="es"?Ts():s==="fr"?As():s==="de"?Rs():Fs()}),Vs=()=>"Fetching your recent creations.",qs=()=>"최근 생성 히스토리를 불러오는 중입니다.",Gs=()=>"Cargando tus creaciones recientes.",Ms=()=>"Fetching your recent creations.",Hs=()=>"Fetching your recent creations.",$s=()=>"Fetching your recent creations.",Bs=((e={},r={})=>{const s=r.locale??x();return s==="en"?Vs():s==="ko"?qs():s==="es"?Gs():s==="fr"?Ms():s==="de"?Hs():$s()}),Ys=()=>"Loading history",Qs=()=>"히스토리 불러오는 중",Ks=()=>"Cargando historial",Js=()=>"Loading history",Xs=()=>"Loading history",Ws=()=>"Loading history",Zs=((e={},r={})=>{const s=r.locale??x();return s==="en"?Ys():s==="ko"?Qs():s==="es"?Ks():s==="fr"?Js():s==="de"?Xs():Ws()}),er=()=>"Image",tr=()=>"이미지",sr=()=>"Imagen",rr=()=>"Image",nr=()=>"Image",or=()=>"Image",_e=((e={},r={})=>{const s=r.locale??x();return s==="en"?er():s==="ko"?tr():s==="es"?sr():s==="fr"?rr():s==="de"?nr():or()});const ir=[["path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -2",key:"svg-0"}],["path",{d:"M4 16a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -2",key:"svg-1"}]],be=Oe("outline","layout-list","LayoutList",ir),Q=[{value:"all",label:I()},{value:"completed",label:ut()},{value:"pending",label:mt()},{value:"processing",label:xt()},{value:"uploading",label:ft()},{value:"failed",label:ht()}],ar=[{value:"image",label:_e()},{value:"video",label:E()}],ve=[{value:"all",label:I()},...re.map(e=>({value:e.id,label:e.displayName}))],ye=[{value:"all",label:I()},...ne.map(e=>({value:e.id,label:e.displayName}))],V=5,je=[{value:"all",label:I()},...Object.entries(oe).map(([e,{label:r}])=>({value:e,label:r})),{value:"480p",label:"480p"},{value:"720p",label:"720p"},{value:"1080p",label:"1080p"}],Ne=[{value:"all",label:I()},...Object.entries(Ve).map(([e,{label:r}])=>({value:e,label:r}))],we=[{value:"all",label:I()},...Object.entries(ie).map(([e,{label:r}])=>({value:e,label:r}))],lr=new Set(re.map(e=>e.id)),cr=new Set(ne.map(e=>e.id)),dr=new Set(Object.keys(oe)),ur=new Set(Object.values(Me)),mr=new Set(Object.keys(ie)),xr=new Set(Object.values(He)),O={pending:"bg-amber-100 text-amber-900 dark:bg-amber-500/15 dark:text-amber-200",processing:"bg-sky-100 text-sky-900 dark:bg-sky-500/15 dark:text-sky-200",uploading:"bg-violet-100 text-violet-900 dark:bg-violet-500/15 dark:text-violet-200",completed:"bg-emerald-100 text-emerald-900 dark:bg-emerald-500/15 dark:text-emerald-200",failed:"bg-rose-100 text-rose-900 dark:bg-rose-500/15 dark:text-rose-200"};function T(e){return Q.find(r=>r.value===e)?.label??e}const hr={view:J(["grid","list"]).withDefault("grid"),type:J(["image","video"]).withDefault("image"),model:L.withDefault("all"),resolution:L.withDefault("all"),quality:L.withDefault("all"),ratio:L.withDefault("all"),status:L.withDefault("all")};function fr(e){return{model:ke(e.model)?e.model:void 0,resolution:Ie(e.resolution)?e.resolution:void 0,quality:e.quality!=="all"?e.quality:void 0,aspectRatio:Ce(e.ratio)?e.ratio:void 0,status:e.status!=="all"&&e.status!=="uploading"?e.status:void 0}}function gr(e){return!(e.type!=="image"||e.model!=="all"&&!ke(e.model)||e.resolution!=="all"&&!Ie(e.resolution)||e.ratio!=="all"&&!Ce(e.ratio)||e.status==="uploading")}function pr(e){return e.type!=="video"||e.model!=="all"&&!Z(e.model)||e.resolution!=="all"&&!ee(e.resolution)||e.ratio!=="all"&&!te(e.ratio)?null:{model:Z(e.model)?e.model:void 0,resolution:ee(e.resolution)?e.resolution:void 0,aspectRatio:te(e.ratio)?e.ratio:void 0,status:e.status!=="all"?e.status:void 0}}function ke(e){return e!=="all"&&lr.has(e)}function Z(e){return e!=="all"&&cr.has(e)}function Ie(e){return e!=="all"&&dr.has(e)}function ee(e){return e!=="all"&&ur.has(e)}function Ce(e){return e!=="all"&&mr.has(e)}function te(e){return e!=="all"&&xr.has(e)}function _r(){const[e,r]=Te(hr,{history:"replace"}
1),s=Ae({select:i=>i.status==="pending"&&i.location.pathname!==(i.resolvedLocation?.pathname??"/history")}),c=j.useRef(e);s||(c.current=e);const d=s?c.current:e,{view:n,type:a,model:l,resolution:o,quality:p,ratio:h,status:f}=d,u=fr({model:l,resolution:o,quality:p,ratio:h,status:f}),N=pr({type:a,model:l,resolution:o,ratio:h,status:f}),A=gr({type:a,model:l,resolution:o,ratio:h,status:f}),_=at(u,A),b=lt(N??{},N!==null),De=j.useMemo(()=>{const i=a==="image"?{enabled:A,kind:"image",query:_}:{enabled:N!==null,kind:"video",query:b};if(!i.enabled)return{items:[],isLoading:!1,isError:!1,error:null,hasNextPage:!1,isFetchingNextPage:!1,fetchNextPage:()=>{}};const{kind:C,query:g}=i;return{items:g.items.map(K=>({kind:C,item:K,createdAt:K.createdAt})),isLoading:g.isLoading,isError:g.isError,error:g.error,hasNextPage:g.hasNextPage,isFetchingNextPage:g.isFetchingNextPage,fetchNextPage:()=>{g.hasNextPage&&g.fetchNextPage()}}},[_.error,_.fetchNextPage,_.hasNextPage,_.isError,_.isFetchingNextPage,_.isLoading,_.items,A,a,b.error,b.fetchNextPage,b.hasNextPage,b.isError,b.isFetchingNextPage,b.isLoading,b.items,N]),R=+(l!=="all")+ +(o!=="all")+ +(a==="image"&&p!=="all")+ +(h!=="all")+ +(f!=="all"),Pe=a==="image"?ve:ye,y=j.useCallback((i,C)=>{if(i==="type"){const g=C;r({type:g==="image"?null:g,model:null,resolution:null,quality:null,ratio:null});return}r({[i]:C==="all"?null:C})},[r]),F=j.useCallback(()=>{r({type:null,model:null,resolution:null,quality:null,ratio:null,status:null})},[r]),Ee=j.useCallback(i=>{r({type:i==="image"?null:i,model:null,resolution:null,quality:null,ratio:null})},[r]),U=j.useCallback(i=>{r({view:i==="grid"?null:i})},[r]);return t.jsxs("div",{className:"flex min-h-svh flex-col",children:[t.jsx(Je,{showBack:!0,center:t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[t.jsx("h1",{className:"shrink-0 font-sans font-semibold text-base",children:Re()}),R>0&&t.jsxs("div",{className:"hidden items-center gap-1.5 lg:flex",children:[l!=="all"&&t.jsx(S,{label:Pe.find(i=>i.value===l)?.label??l,onRemove:()=>y("model","all")}),o!=="all"&&t.jsx(S,{label:je.find(i=>i.value===o)?.label??o,onRemove:()=>y("resolution","all")}),p!=="all"&&t.jsx(S,{label:Ne.find(i=>i.value===p)?.label??p,onRemove:()=>y("quality","all")}),h!=="all"&&t.jsx(S,{label:we.find(i=>i.value===h)?.label??h,onRemove:()=>y("ratio","all")}),f!=="all"&&t.jsx(S,{label:Q.find(i=>i.value===f)?.label??f,onRemove:()=>y("status","all")}),t.jsx("button",{type:"button",onClick:F,className:"ml-0.5 inline-flex h-6 items-center gap-1 rounded-full px-2 text-muted-foreground text-xs transition-colors hover:bg-accent hover:text-foreground",children:H()})]})]}),actions:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"hidden lg:block",children:t.jsx(Cr,{type:a,model:l,resolution:o,quality:p,ratio:h,status:f,onChange:y,onReset:F,activeCount:R})}),t.jsx("div",{className:"lg:hidden",children:t.jsx(Lr,{type:a,model:l,resolution:o,quality:p,ratio:h,status:f,onChange:y,onReset:F,activeCount:R,view:n,onViewChange:U})}),t.jsxs("div",{className:"hidden rounded-full bg-muted p-0.5 lg:flex",children:[t.jsx("button",{type:"button",onClick:()=>U("grid"),"aria-label":us(),className:m("inline-flex size-7 items-center justify-center rounded-full transition-colors",n==="grid"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:t.jsx(se,{className:"size-4"})}),t.jsx("button",{type:"button",onClick:()=>U("list"),"aria-label":ks(),className:m("inline-flex size-7 items-center justify-center rounded-full transition-colors",n==="list"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:t.jsx(be,{className:"size-4"})})]})]})}),t.jsx("div",{className:"border-b bg-background px-4 pt-4 pb-3 lg:px-6",children:t.jsx(br,{type:a,onTypeChange:Ee})}),t.jsx("div",{className:"flex-1 px-4 py-6 lg:px-6 lg:py-8",children:t.jsx(vr,{history:De,viewM
1ode:n})})]})}function br({type:e,onTypeChange:r}){const s=[{value:"image",label:_e(),icon:qe},{value:"video",label:E(),icon:D}];return t.jsx("div",{className:"grid w-full grid-cols-2 gap-1 rounded-2xl bg-muted p-1",children:s.map(c=>{const d=e===c.value,n=c.icon;return t.jsxs("button",{type:"button",onClick:()=>r(c.value),className:m("inline-flex h-12 min-w-0 items-center justify-center gap-2 rounded-xl px-3 font-semibold text-sm transition-colors",d?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-background/50 hover:text-foreground"),children:[t.jsx(n,{className:"size-4 shrink-0"}),t.jsx("span",{className:"truncate",children:c.label})]},c.value)})})}function vr({history:e,viewMode:r}){return e.isError?t.jsx(Ke,{title:Us(),description:e.error instanceof Error?e.error.message:Ps()}):e.isLoading?t.jsx(W,{icon:t.jsx(k,{className:"size-5 animate-spin"}),title:Zs(),description:Bs()}):e.items.length===0?t.jsx(W,{icon:t.jsx(Ge,{className:"size-5"}),title:Xt(),description:Ht()}):t.jsxs("div",{className:"space-y-4",children:[r==="grid"?t.jsx(yr,{items:e.items}):t.jsx(wr,{items:e.items}),t.jsx(Qe,{hasNextPage:!!e.hasNextPage,isFetchingNextPage:e.isFetchingNextPage,onLoadMore:()=>{e.fetchNextPage()},totalLoaded:e.items.length,totalDocs:e.items.length})]})}function yr({items:e}){return t.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",children:e.map(r=>r.kind==="image"?t.jsx(jr,{item:r.item},`image-${r.item.id}`):t.jsx(Nr,{item:r.item},`video-${r.item.id}`))})}function Le(e){if(!(!e.outputFileId||!e.outputUrl))return ct([{id:e.outputFileId,originalName:`creation-${e.id}.png`,url:e.outputUrl}])}function jr({item:e}){const r=e.prompt.trim().length>=5&&(e.status==="completed"||e.status==="failed"),s=ae();function c(n){n.preventDefault(),n.stopPropagation(),Be(e.status==="failed"?"retry_failed_generation":"history_continue",{kind:"image",parentGenerationId:e.id});const a={creationId:e.id,parentGenerationId:e.id,continuationType:e.status==="failed"?"retry":"continue"};s({to:xe(e),search:a})}function d(n,a){n.preventDefault(),n.stopPropagation();const l=Le(e);if(l){if(a==="edit"){s({to:he(e.model),search:{model:e.model,prompt:e.prompt,referenceToken:l}});return}s({to:z.ImageToVideo,search:{referenceMode:"single",referenceToken:l}})}}return t.jsx(v,{to:"/creation/$id",params:{id:e.id},className:"group relative block w-full overflow-hidden rounded-2xl bg-card shadow-sm outline-none animate-in fade-in [transition:box-shadow_300ms_ease-out] hover:shadow-2xl hover:shadow-black/15 focu
1s-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 dark:hover:shadow-black/50",children:t.jsxs("div",{className:"relative overflow-hidden bg-muted",children:[e.outputUrl?t.jsx("img",{src:e.outputUrl,alt:e.prompt.slice(0,60),loading:"lazy",decoding:"async",style:{viewTransitionName:me(e.id)},className:"aspect-square w-full object-cover transition-transform duration-700 ease-out group-hover:scale-[1.05]"}):t.jsx("div",{className:"relative flex aspect-square w-full items-center justify-center text-muted-foreground",children:t.jsx(P,{variant:e.status==="failed"?"failed":"loading",className:"absolute inset-0"})}),t.jsx("span",{className:m("absolute top-2 left-2 inline-flex items-center rounded-full px-2 py-0.5 font-medium text-[10px] capitalize",O[e.status]),children:T(e.status)}),e.versionCount>1?t.jsx("span",{className:"absolute top-2 right-2 rounded-full bg-black/65 px-2 py-0.5 font-medium text-[10px] text-white ring-1 ring-white/10",children:pe({count:e.versionCount})}):null,t.jsx("div",{className:"pointer-events-none absolute inset-0 flex translate-y-2 flex-col justify-end opacity-0 transition-[opacity,transform] duration-300 ease-out group-hover:translate-y-0 group-hover:opacity-100",children:t.jsx("div",{className:"bg-linear-to-t from-black/85 via-black/55 to-transparent px-3 pt-12 pb-3 text-white",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[r&&t.jsxs("button",{type:"button",onClick:c,className:"pointer-events-auto inline-flex h-8 items-center gap-1.5 rounded-full bg-white px-3 font-medium text-neutral-900 text-xs shadow-md ring-1 ring-black/5 transition-colors hover:bg-white/90",children:[t.jsx(le,{className:"size-3.5"}),e.status==="failed"?yt():zt()]}),e.status==="completed"&&e.outputFileId&&e.outputUrl?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button","aria-label":"Edit image",className:"pointer-events-auto inline-flex size-8 items-center justify-center rounded-full bg-black/65 text-white/85 ring-1 ring-white/12 transition hover:bg-white hover:text-black",onClick:n=>d(n,"edit"),title:"Edit image",children:t.jsx(B,{className:"size-3.5"})}),t.jsx("button",{type:"button","aria-label":"Turn into video",className:"pointer-events-auto inline-flex size-8 items-center justify-center rounded-full bg-black/65 text-white/85 ring-1 ring-white/12 transition hover:bg-white hover:text-black",onClick:n=>d(n,"video"),title:"Turn into video",children:t.jsx(D,{className:"size-3.5"})})]}):null]}),e.outputUrl&&t.jsx($,{ariaLabel:jt(),assetType:"image",checkingContent:t.jsx(k,{className:"size-3.5 animate-spin"}),className:"pointer-events-auto rounded-full bg-black/55 p-1.5 text-white/80 ring-1 ring-white/10 transition-[background-color,color,transform] duration-200 ease-out hover:bg-emerald-500 hover:text-white hover:ring-emerald-400/60 active:scale-[0.92]",cost:e.creditsUsed,filename:`creation-${e.id}.png`,isAuthenticated:!0,model:e.model,onBeforeCheckout:()=>{},onClick:n=>{n.preventDefault(),n.stopPropagation()},onRequireLogin:()=>{},resultId:e.id,url:e.outputUrl,workflow:"history-image",children:t.jsx(Y,{className:"size-3.5"})})]})})})]})})}function Nr({item:e}){return t.jsxs("div",{className:"group relative w-full overflow-hidden rounded-2xl bg-card shadow-sm animate-in fade-in [transition:box-shadow_300ms_ease-out] hover:shadow-2xl hover:shadow-black/15 dark:hover:shadow-black/50",children:[t.jsx(v,{to:"/video/$id",params:{id:e.id},"aria-label":`Open video: ${e.prompt.slice(0,80)}`,className:"block outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:t.jsxs("div",{className:"relative aspect-square overflow-hidden bg-muted",children:[e.outputUrl?t.jsx("video",{src:e.outputUrl,"aria-label":e.prompt.slice(0,60),muted:!0,playsInline:!0,preload:"metadata",className:"size-full bg-black object-cover transition-transform duration-700 ease-out group-hover:scale-[1.05]",children:t.jsx("track",{kind:"captions"})}):t.jsxs("div",{className:"relative flex size-full items-center justify-center text-muted-foreground",children:[t.jsx(P,{variant:e.status==="failed"?"failed":"loading",className:"absolute inset-0"}),e.status!=="failed"?t.jsx(k,{className:"relative size-5 animate-spin"}):null]}),t.jsx("span",{className:m("absolute top-2 left-2 inline-flex items-center rounded-full px-2 py-0.5 font-medium text-[10px] capitalize",O[e.status]),children:T(e.status)}),t.jsxs("span",{className:"absolute top-2 right-2 inline-flex items-center gap-1 rounded-full bg-black/65 px-2 py-0.5 font-medium text-white text-[10px] ring-1 ring-white/10",children:[t.jsx(D,{className:"size-3"}),E()]}),e.versionCount>
11?t.jsx("span",{className:"absolute top-8 right-2 rounded-full bg-black/65 px-2 py-0.5 font-medium text-[10px] text-white ring-1 ring-white/10",children:pe({count:e.versionCount})}):null,t.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-black/0 transition group-hover:bg-black/16",children:t.jsx("span",{className:"inline-flex size-10 translate-y-2 items-center justify-center rounded-full bg-black/60 text-white opacity-0 ring-1 ring-white/12 backdrop-blur-sm transition group-hover:translate-y-0 group-hover:opacity-100",children:t.jsx(fe,{className:"size-5"})})})]})}),e.outputUrl?t.jsxs("div",{className:"absolute inset-x-2 bottom-2 flex items-center justify-between gap-2",children:[t.jsx(Se,{dark:!0,item:e}),t.jsx($,{ariaLabel:ge(),assetType:"video",checkingContent:t.jsx(k,{className:"size-3.5 animate-spin"}),className:"rounded-full bg-black/65 p-1.5 text-white/80 ring-1 ring-white/10 transition-[background-color,color,transform] duration-200 ease-out hover:bg-emerald-500 hover:text-white hover:ring-emerald-400/60 active:scale-[0.92]",cost:e.creditsUsed,filename:`video-${e.id}.mp4`,isAuthenticated:!0,model:e.model,onBeforeCheckout:()=>{},onClick:r=>r.stopPropagation(),onRequireLogin:()=>{},resultId:e.id,url:e.outputUrl,workflow:"history-video",children:t.jsx(Y,{className:"size-3.5"})})]}):null]})}function Se({dark:e=!1,item:r}){const s=!!r.taskId&&(r.model===X.GROK_IMAGINE||r.model===X.GROK_IMAGINE_1_5),c=m("inline-flex size-8 items-center justify-center rounded-full border text-muted-foreground shadow-sm transition hover:text-foreground",e?"border-white/12 bg-black/65 text-white/80 hover:bg-white hover:text-black":"bg-background hover:bg-accent");return t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(v,{"aria-label":"Edit video",className:c,onClick:d=>d.stopPropagation(),search:{sourceVideoId:r.id},title:"Edit video",to:z.GrokVideoEditor,children:t.jsx(B,{className:"size-3.5"})}),s?t.jsx(v,{"aria-label":"Extend",className:c,onClick:d=>d.stopPropagation(),search:{sourceVideoId:r.id},title:"Extend",to:z.VideoExtend,children:t.jsx(M,{className:"size-3.5"})}):null,t.jsx(v,{"aria-label":"Upscale",className:c,onClick:d=>d.stopPropagation(),search:{sourceVideoId:r.id},title:"Upscale",to:z.VideoUpscale,children:t.jsx(Ye,{className:"size-3.5"})})]})}function wr({items:e}){return t.jsx("div",{className:"space-y-2",children:e.map(r=>r.kind==="image"?t.jsx(kr,{item:r.item},`image-${r.item.id}`):t.jsx(Ir,{item:r.item},`video-${r.item.id}`))})}function kr({item:e}){const r=e.prompt.trim().length>=5,s=ae(),c=e.startedAt&&e.completedAt?ce(e.completedAt-e.startedAt):void 0;function d(n,a){n.preventDefault(),n.stopPropagation();const l=Le(e);if(l){if(a==="edit"){s({to:he(e.model),search:{model:e.model,prompt:e.prompt,referenceToken:l}});return}s({to:z.ImageToVideo,search:{referenceMode:"single",referenceToken:l}})}}return t.jsxs(v,{to:"/creation/$id",params:{id:e.id}
1,className:"group flex items-center gap-4 rounded-xl border bg-card p-3 transition-colors hover:bg-accent/50 sm:p-4",children:[t.jsx("div",{className:"size-[72px] shrink-0 overflow-hidden rounded-lg bg-muted sm:size-20",children:e.outputUrl?t.jsx("img",{src:e.outputUrl,alt:"",loading:"lazy",decoding:"async",style:{viewTransitionName:me(e.id)},className:"size-full object-cover"}):t.jsx("div",{className:"relative flex size-full items-center justify-center text-muted-foreground",children:t.jsx(P,{variant:e.status==="failed"?"failed":"loading",className:"absolute inset-0"})})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:m("inline-flex items-center rounded-full px-2 py-0.5 font-medium text-[10px] capitalize",O[e.status]),children:T(e.status)}),t.jsx("p",{className:"mt-1.5 line-clamp-3 text-sm leading-snug",children:e.prompt}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-y-1 text-muted-foreground text-xs",children:[t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(de,{className:"size-3 text-amber-500"}),e.creditsUsed]}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:e.modelLabel}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:e.aspectRatio}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:e.resolutionLabel}),c&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(M,{className:"size-3"}),c]})]}),e.startedAt&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:q(new Date(e.startedAt))})]}),e.completedAt&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1.5 hidden text-border sm:inline",children:"~"}),t.jsx("span",{className:"hidden sm:inline",children:q(new Date(e.completedAt))})]})]})]}),t.jsxs("div",{className:"hidden shrink-0 items-center gap-1.5 sm:flex",children:[e.status==="completed"&&e.outputFileId&&e.outputUrl?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button","aria-label":"Edit image",className:"inline-flex size-8 items-center justify-center rounded-full border bg-background text-muted-foreground shadow-sm transition hover:bg-accent hover:text-foreground",onClick:n=>d(n,"edit"),title:"Edit image",children:t.jsx(B,{className:"size-3.5"})}),t.jsx("button",{type:"button","aria-label":"Turn into video",className:"inline-flex size-8 items-center justify-center rounded-full border bg-background text-muted-foreground shadow-sm transition hover:bg-accent hover:text-foreground",onClick:n=>d(n,"video"),title:"Turn into video",children:t.jsx(D,{className:"size-3.5"})})]}):null,r?t.jsxs(v,{to:xe(e),search:{creationId:e.id},onClick:n=>n.stopPropagation(),className:"inline-flex h-8 items-center gap-1.5 rounded-full border bg-background px-3 font-medium text-xs shadow-sm hover:bg-accent",children:[t.jsx(le,{className:"size-3.5"}),Nt()]}):null]})]})}function Ir({item:e}){const r=e.startedAt&&e.completedAt?ce(e.completedAt-e.startedAt):void 0;return t.jsxs("div",{className:"group relative rounded-xl border bg-card transition-colors hover:bg-accent/50",children:[t.jsxs(v,{to:"/video/$id",params:{id:e.id},"aria-label":`Open video: ${e.prompt.slice(0,80)}
1`,className:m("flex items-center gap-4 rounded-xl p-3 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 sm:p-4",e.outputUrl&&"sm:pr-48"),children:[t.jsx("div",{className:"relative size-[72px] shrink-0 overflow-hidden rounded-lg bg-muted sm:size-20",children:e.outputUrl?t.jsx("video",{src:e.outputUrl,"aria-label":e.prompt.slice(0,60),muted:!0,playsInline:!0,preload:"metadata",className:"size-full bg-black object-cover",children:t.jsx("track",{kind:"captions"})}):t.jsxs("div",{className:"relative flex size-full items-center justify-center text-muted-foreground",children:[t.jsx(P,{variant:e.status==="failed"?"failed":"loading",className:"absolute inset-0"}),e.status!=="failed"?t.jsx(k,{className:"relative size-5 animate-spin"}):null]})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:m("inline-flex items-center rounded-full px-2 py-0.5 font-medium text-[10px] capitalize",O[e.status]),children:T(e.status)}),t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 font-medium text-[10px] text-muted-foreground",children:[t.jsx(D,{className:"size-3"}),E()]})]}),t.jsx("p",{className:"mt-1.5 line-clamp-3 text-sm leading-snug",children:e.prompt}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-y-1 text-muted-foreground text-xs",children:[t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(de,{className:"size-3 text-amber-500"}),e.creditsUsed]}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:e.modelLabel}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:e.aspectRatio}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:e.resolution}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(fe,{className:"size-3"}),e.duration,"s"]}),r?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(M,{className:"size-3"}),r]})]}):null,t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:q(new Date(e.createdAt))})]})]})]}),e.outputUrl?t.jsxs("div",{className:"-translate-y-1/2 absolute top-1/2 right-4 hidden items-center gap-1.5 sm:flex",children:[t.jsx(Se,{item:e}),t.jsxs($,{ariaLabel:ge(),assetType:"video",checkingContent:t.jsx(k,{className:"size-3.5 animate-spin"}),className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full border bg-background px-3 font-medium text-xs shadow-sm hover:bg-accent",cost:e.creditsUsed,filename:`video-${e.id}.mp4`,isAuthenticated:!0,model:e.model,onBeforeCheckout:()=>{},onClick:s=>s.stopPropagation(),onRequireLogin:()=>{},resultId:e.id,url:e.outputUrl,workflow:"history-video",children:[t.jsx(Y,{className:"size-3.5"}),"Download"]})]}):null]})}function S({label:e,onRemove:r}){return t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-accent px-2.5 py-1 text-xs ring-1 ring-border",children:[e,t.jsx("button",{type:"button",onClick:r,className:"ml-0.5 inline-flex size-4 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-foreground
1/10 hover:text-foreground",children:t.jsx(Ue,{className:"size-3"})})]})}function ze({type:e,model:r,resolution:s,quality:c,ratio:d,status:n,onChange:a}){const l=e==="image"?ve:ye;return t.jsxs("div",{className:"space-y-4",children:[t.jsx(w,{title:"Type",options:ar,value:e,onChange:o=>a("type",o)}),t.jsx(w,{title:gt(),options:l,value:r,onChange:o=>a("model",o),collapsible:!0}),t.jsx(w,{title:pt(),options:je,value:s,onChange:o=>a("resolution",o)}),e==="image"?t.jsx(w,{title:bt(),options:Ne,value:c,onChange:o=>a("quality",o)}):null,t.jsx(w,{title:_t(),options:we,value:d,onChange:o=>a("ratio",o)}),t.jsx(w,{title:vt(),options:Q,value:n,onChange:o=>a("status",o)})]})}function w({title:e,options:r,value:s,onChange:c,collapsible:d=!1}){const[n,a]=j.useState(!1),l=r.find(u=>u.value==="all"),o=l?r.filter(u=>u.value!=="all"):r,p=Math.max(o.length-V,0),h=d&&!n?o.slice(V).find(u=>u.value===s):void 0,f=d&&!n?[...l?[l]:[],...o.slice(0,V),...h?[h]:[]]:r;return t.jsxs("section",{className:"space-y-2",children:[t.jsx("p",{className:"font-medium text-xs text-muted-foreground",children:e}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.map(u=>{const N=s===u.value;return t.jsx("button",{type:"button",onClick:()=>c(u.value),className:m("inline-flex h-7 items-center rounded-full px-3 text-xs transition-colors",N?"bg-foreground text-background shadow-sm":"bg-muted text-muted-foreground hover:bg-accent hover:text-foreground"),children:u.label},u.value)})}),d&&p>0?t.jsxs("button",{type:"button","aria-expanded":n,onClick:()=>a(u=>!u),className:"inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-muted-foreground text-xs transition-colors hover:bg-accent hover:text-foreground",children:[n?t.jsx(dt,{className:"size-3.5"}):t.jsx($e,{className:"size-3.5"}),n?"Show less":`Show ${p} more`]}):null]})}function Cr(e){return t.jsxs(Xe,{children:[t.jsxs(We,{className:m("inline-flex h-8 items-center gap-2 rounded-full border px-3 text-xs transition-colors",e.activeCount>0?"border-border bg-accent text-foreground":"border-border/60 text-foreground hover:bg-accent/60"),children:[t.jsx(ue,{className:"size-3.5"}),G(),e.activeCount>0&&t.jsx("span",{className:"inline-flex min-w-5 items-center justify-center rounded-full bg-foreground px-1.5 py-0.5 text-[10px] text-background",children:e.activeCount})]}),t.jsxs(Ze,{align:"end",sideOffset:8,className:"w-80 p-4",children:[t.jsx(ze,{type:e.type,model:e.model,resolution:e.resolution,quality:e.quality,ratio:e.ratio,status:e.status,onChange:e.onChange}),t.jsx("button",{type:"button",onClick:e.onReset,className:"mt-3 inline-flex h-8 w-full items-center justify-center rounded-lg border text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:H()})]})]})}function Lr(e){return t.jsxs(et,{children:[t.jsxs(tt,{className:m("inline-flex h-8 items-center gap-2 rounded-full border px-3 text-xs transition-colors",e.activeCount>0?"border-border bg-accent text-foreground":"border-border/60 text-foreground hover:bg-accent/60"),children:[t.jsx(ue,{className:"size-3.5"}),G(),e.activeCount>0&&t.jsx("span",{className:"inline-flex min-w-5 items-center justify-center rounded-full bg-foreground px-1.5 py-0.5 text-[10px] text-background",children:e.activeCount})]}),t.jsxs(st,{className:"rounded-t-[20px] border-t px-4 pb-6",children:[t.jsx(rt,{className:"px-0 pb-3 text-left",children:t.jsx(nt,{children:G()})}),t.jsxs("div",{className:"overflow-y-auto pb-2",children:[t.jsx(ze,{type:e.type,model:e.model,resolution:e.resolution,quality:e.quality,ratio:e.ratio,status:e.status,onChange:e.onChange}),t.jsxs("section",{className:"mt-4 space-y-2 border-t pt-4",children:[t.jsx("p",{className:"font-medium text-xs text-muted-foreground",children:Rt()}),t.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.jsxs("button",{type:"button",onClick:()=>e.onViewChange("grid"),className:m("inline-flex h-7 items-center gap-1.5 rounded-full px-3 text-xs transition-colors",e.view==="grid"?"bg-foreground text-background shadow-sm":"bg-muted text-muted-foreground hover:bg-accent hover:text-foreground"),children:[t.jsx(se,{className:"size-3.5"}),ns()]}),t.jsxs("button",{type:"button",onClick:()=>e.onViewChange("list"),className:m("inline-flex h-7 items-center gap-1.5 rounded-full px-3 text-xs transition-colors",e.view==="list"?"bg-foreground text-background shadow-sm":"bg-muted text-muted-foreground hover:bg-accent hover:text-foreground"),children:[t.jsx(be,{className:"size-3.5"}),_s()]})]})]})]}),t.jsx(ot,{className:"px-0",children:t.jsx(it,{asChild:!0,children:t.jsx(Fe,{type:"button",variant:"outline",className:"w-full",onClick:e.onReset,children:H()})})})]})]})}const xn=_r;export{xn as component};
2//# sourceMappingURL=history-CImd6fMZ.js.map

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.