PageSourceSearch

https://merchshoot.ai/_next/static/chunks/6679.bbe85279a3a7b648.js

js merchshoot.ai collected 2026-10-05 14:27:48 UTC 11,173 bytes, 11 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6679],{11978:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var s=r(24255);/**
2 * @license lucide-react v0.294.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */let n=(0,s.Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},43598:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var s=r(24255);/**
7 * @license lucide-react v0.294.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */let n=(0,s.Z)("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]])},36679:function(e,t,r){"use strict";r.r(t),r.d(t,{SelectFromRecentOutputs:function(){return SelectFromRecentOutputs}});var s=r(98365),n=r(19359),o=r(90804),i=r(51645),a=r(11978),l=r(43598),c=r(51514),d=r(38243),u=r.n(d),p=r(2161),m=r(77455),h=r(55017),g=r.n(h),x=r(45158),y=r(44416);let f=(0,m.memo)(e=>{var t,r,n,o;let{expression:l}=e,{getImageUrl:c}=(0,i.w)(l.id),[d,p]=(0,m.useState)(null),[h,g]=(0,m.useState)(!0),x=(null===(t=l.input)||void 0===t?void 0:t.type)==="Animate"||(null===(r=l.input)||void 0===r?void 0:r.type)==="Motion Effects"||(null===(n=l.input)||void 0===n?void 0:n.type)==="Extend Video"||(null===(o=l.input)||void 0===o?void 0:o.type)==="Upscale Video";return((0,m.useEffect)(()=>{let e=!0;return g(!0),c(!0).then(t=>{e&&t&&p(t)}),()=>{e=!1}},[c]),d)?(0,s.jsxs)(s.Fragment,{children:[h&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/80",children:(0,s.jsx)(a.Z,{className:"h-4 w-4 animate-spin"})}),x?(0,s.jsx)("video",{src:d,className:"absolute inset-0 w-full h-full object-cover",onLoadedData:()=>g(!1),muted:!0,loop:!0,playsInline:!0}):(0,s.jsx)(u(),{src:d,alt:"Expression from ".concat(new Date(l.created_at).toLocaleDateString()),fill:!0,className:"object-cover",sizes:"(max-width: 768px) 8vw, 6vw",loading:"lazy",onLoad:()=>g(!1),unoptimized:!0})]}):null});f.displayName="ExpressionImage";let v=(0,m.memo)(e=>{let{expression:t,index:r,onClick:n}=e,o=(0,m.useCallback)(()=>{n(t.id)},[t.id,n]);return(0,s.jsx)(y.E.button,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0,transition:{type:"easeInOut",duration:.5,delay:.1*r,ease:[.21,.47,.32,.98]}},viewport:{once:!0,margin:"-50px"},onClick:o,className:"col-span-1 group relative aspect-square overflow-hidden rounded-lg border border-border hover:border-primary transition-colors",children:(0,s.jsx)(f,{expression:t})},t.id)});function SelectFromRecentOutputs(e){let{setSelectedExpressionId:t,maxVisibleSelectImages:r=7,filterTypes:i,filterMode:a}=e,{expressionList:d,isLoading:u,totalCount:h}=(0,o.O)(1,15,"created_at","desc",i,a,["succeeded"]),[b,j]=(0,m.useState)(!1),w=(0,m.useMemo)(()=>Array.isArray(d)?d:[],[d]),N=(0,m.useMemo)(()=>w.slice(0,r),[w,r]),S=(0,m.useMemo)(()=>h>N.length,[h,N.length]),_=(0,m.useCallback)(e=>{t(e),j(!1)},[t]);return u?(0,s.jsx)("div",{className:"p-4 text-center border rounded-lg border-dashed border-border flex items-center justify-center h-full",children:(0,s.jsx)("p",{className:"text-muted-foreground mb-1 text-sm font-extrabold",children:"Loading..."})}):0===N.length?(0,s.jsx)("div",{className:"p-4 text-center border rounded-lg border-dashed border-border flex items-center justify-center h-full",children:(0,s.jsx)("p",{className:"text-muted-foreground mb-1 text-sm font-extrabold",children:"No recent expressions found"})}):(0,s.jsxs)("div",{className:(0,p.cn)("grid gap-1.5",r>=11?"grid-cols-4 sm:grid-cols-8 md:grid-cols-12":"grid-cols-4 sm:grid-cols-6 md:grid-cols-8"),children:[N.map((e,t)=>(0,s.jsx)(v,{expression:e,index:t,onClick:_},e.id)),S&&(0,s.jsxs)(n.Vq,{open:b,onOpenChange:j,children:[(0,s.jsx)(n.hg,{asChild:!0,children:(0,s.jsx)(y.E.button,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0,transition:{type:"easeInOut",duration:.5,delay:.1*N.length,ease:[.21,.47,.32,.98]}},viewport:{once:!0,margin:"-50px"},className:"col-span-1 aspect-square rounded-lg border border-dashed border-border hover:border-primary transition-colors flex items-center justify-center bg-black",children:(0,s.jsx)("div",{className:"text-center align-middle",children:(0,s.jsx)(l.Z,{className:"mx-auto",size:30})})})}),(0,s.jsxs)(n.cZ,{className:"max-w-5xl",children:[(0,s.jsxs)(n.fK,{children:[(0,s.jsx)(n.$N,{className:"text-2xl",children:"Select from recent outputs"}),(0,s.jsxs)(n.Be,{className:"flex gap-5 align-middle items-center",children:["Select from your last 15 successful expressions. For more, please go to History page.",(0,s.jsx)(x.z,{asChild:!0,size:"sm",children:(0,s.jsxs)(g(),{href:"/dashboard/history",children:["History ",(0,s.jsx)(c.Z,{className:"ml-2"})]})})]})]}),(0,s.jsx)("div",{className:"overflow-y-auto max-h-[60vh]",children:(0,s.jsx)("div",{className:"grid grid-cols-3 md:grid-cols-5 ga
11p-4",children:w.map(e=>(0,s.jsxs)("button",{onClick:()=>_(e.id),className:"group relative aspect-square overflow-hidden rounded-lg border border-border hover:border-primary transition-colors",children:[(0,s.jsx)(f,{expression:e}),(0,s.jsx)("div",{className:"absolute bottom-0 left-0 right-0 bg-black/60 p-2 text-xs text-white opacity-0 group-hover:opacity-100 transition-opacity",children:(0,s.jsx)("p",{children:new Date(e.created_at).toLocaleDateString()})})]},e.id))})})]})]})]})}v.displayName="ExpressionPreviewButton"},51645:function(e,t,r){"use strict";r.d(t,{w:function(){return useExpressionItem}});var s=r(56089),n=r(98214),o=r(76142),i=r(77455);function useExpressionItem(e){let{supabase:t}=(0,o.useSupabase)();(0,s.NL)();let[r,a]=(0,i.useState)(null),[l,c]=(0,i.useState)(!1),{data:d,isLoading:u,refetch:p}=(0,n.a)({queryKey:["expression",e],queryFn:()=>fetch("/api/expressions/".concat(e)).then(e=>e.json()),enabled:!!e}),m=(0,i.useCallback)(async function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];if(!d||!d.data)return console.error("No expression data available"),null;let{user_id:r,output:s}=d.data;if(!r||!s)return console.error("Missing user_id or output in expressionItem:",d.data),null;let n="".concat(r,"/").concat(s);try{if(e){let{data:e,error:r}=await t.storage.from("output").createSignedUrl(n,604800);if(r)throw r;return a(e.signedUrl),e.signedUrl}{let{data:e,error:r}=await t.storage.from("output").download(n);if(r)throw r;let s=URL.createObjectURL(e);return a(s),s}}catch(e){return console.error("Error fetching image URL:",e),e instanceof Error&&(console.error("Error message:",e.message),console.error("Error stack:",e.stack)),null}},[d,t]),h=(0,i.useCallback)(async()=>{c(!0);try{await p()}catch(e){console.error("Error refreshing expression item:",e)}finally{c(!1)}},[p]);return{expressionItem:null==d?void 0:d.data,isLoading:u,isRefreshing:l,imageUrl:r,getImageUrl:m,refreshExpressionItem:h}}},90804:function(e,t,r){"use strict";r.d(t,{O:function(){return useExpressionList}});var s=r(56089),n=r(98214),o=r(10423);function useExpressionList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"created_at",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"desc",a=arguments.length>4?arguments[4]:void 0,l=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,d=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=arguments.length>8&&void 0!==arguments[8]&&arguments[8],p=arguments.length>9?arguments[9]:void 0,m=arguments.length>10?arguments[10]:void 0,h=(0,s.NL)(),{data:g,isLoading:x}=(0,n.a)({queryKey:["expressions","list",e,t,r,i,a,l,c,d,u,p,m],queryFn:()=>
11{let s="".concat("https://merchshoot.ai","/api/expressions?page=").concat(e,"&pageSize=").concat(t,"&sortBy=").concat(r,"&sortOrder=").concat(i,"&includeArchived=").concat(d,"&archivedOnly=").concat(u);return a&&a.length>0&&(s+="&filterTypes=".concat(encodeURIComponent(a.join(","))),l&&(s+="&filterMode=".concat(l))),c&&c.length>0&&(s+="&statusFilter=".concat(encodeURIComponent(c.join(",")))),p&&(s+="&titleSearch=".concat(encodeURIComponent(p))),m&&m.length>0&&(s+="&isFavoritedFilter=".concat(encodeURIComponent(m.join(",")))),fetch(s).then(e=>e.json())}}),y=(0,o.D)({mutationFn:e=>{let{id:t,updates:r}=e;return fetch("".concat("https://merchshoot.ai","/api/expressions/").concat(t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(e=>e.json())},onSuccess:(e,t)=>{h.invalidateQueries({queryKey:["expressions","list"]}),h.invalidateQueries({queryKey:["expressions","item",t.id]})}}),f=(0,o.D)({mutationFn:e=>fetch("".concat("https://merchshoot.ai","/api/expressions/").concat(e),{method:"GET"}).then(e=>e.json()),onSuccess:(e,t)=>{h.invalidateQueries({queryKey:["expressions","list"]}),h.invalidateQueries({queryKey:["expressions","item",t]})}}),v=(0,o.D)({mutationFn:e=>
11fetch("".concat("https://merchshoot.ai","/api/expressions/42"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(async e=>{let t=await e.json();if(!e.ok)throw t.error;return t}),onMutate:async e=>{await h.cancelQueries({queryKey:["expressions","list"]});let r=h.getQueryData(["expressions","list"]);return h.setQueryData(["expressions","list"],r=>{let s={id:"temp-id",title:e.title,status:"processing",created_at:new Date().toISOString(),input:{},is_favorited:!1,is_archived:!1,output:"",prediction:{},prediction_id:"",transaction_id:"",user_id:""};return{...r,data:[s,...(null==r?void 0:r.data)||[]].slice(0,t),totalCount:((null==r?void 0:r.totalCount)||0)+1}}),{previousExpressions:r}},onError:(e,t,r)=>{h.setQueryData(["expressions","list"],null==r?void 0:r.previousExpressions)},onSettled:()=>{h.invalidateQueries({queryKey:["expressions","list"]})}});return{expressionList:(null==g?void 0:g.data)||[],totalCount:(null==g?void 0:g.totalCount)||0,isLoading:x,updateItem:(e,t)=>y.mutateAsync({id:e,updates:t}),toggleFavorite:(e,t)=>y.mutateAsync({id:e,updates:{is_favorited:t}}),toggleArchived:(e,t)=>y.mutateAsync({id:e,updates:{is_archived:t}}),refreshItem:e=>f.mutateAsync(e),isRefreshing:f.isPending,createExpression:e=>v.mutateAsync(e),isCreating:v.isPending}}},17892:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{unstable_getImgProps:function(){return unstable_getImgProps},default:function(){return l}});let s=r(56311),n=r(2471),o=r(41582),i=r(47944),a=s._(r(77778)),unstable_getImgProps=e=>{(0,o.warnOnce)("Warning: unstable_getImgProps() is experimental and may change or be removed at any time. Use at your own risk.");let{props:t}=(0,n.getImgProps)(e,{defaultLoader:a.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}},l=i.Image},38243:function(e,t,r){e.exports=r(17892)}}]);

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.