PageSourceSearch

https://promptsclub.com/_next/static/chunks/pages/products/[productSlug]/generate-bcb0b3a072c9ecd7.js

js promptsclub.com collected 2026-10-02 00:58:13 UTC 26,381 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d4a2636b-8afe-4296-bcfa-ebffb57a2c4f",e._sentryDebugIdIdentifier="sentry-dbid-d4a2636b-8afe-4296-bcfa-ebffb57a2c4f")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6878],{27484:function(e){var t,r,n,a,s,i,l,o,d,u,c,h,m,g,p,x,f,b,v,y,j;e.exports=(t="millisecond",r="second",n="minute",a="hour",s="week",i="month",l="quarter",o="year",d="date",u="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},(p={})[g="en"]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||"th")+"]"}},x=function(e){return e instanceof y},f=function e(t,r,n){var a;if(!t)return g;if("string"==typeof t){var s=t.toLowerCase();p[s]&&(a=s),r&&(p[s]=r,a=s);var i=t.split("-");if(!a&&i.length>1)return e(i[0])}else{var l=t.name;p[l]=t,a=l}return!n&&a&&(g=a),a||!n&&g},b=function(e,t){if(x(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new y(r)},(v={s:m,z:function(e){var t=-e.utcOffset(),r=Math.abs(t);return(t<=0?"+":"-")+m(Math.floor(r/60),2,"0")+":"+m(r%60,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),a=t.clone().add(n,i),s=r-a<0,l=t.clone().add(n+(s?-1:1),i);return+(-(n+(r-a)/(s?a-l:l-a))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return({M:i,y:o,w:s,d:"day",D:d,h:a,m:n,s:r,ms:t,Q:l})[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}}).l=f,v.i=x,v.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})},j=(y=function(){function e(e){this.$L=f(e.locale,null,!0),this.parse(e)}var m=e.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(v.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(c);if(n){var a=n[2]-1||0,s=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],a,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],a,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return v},m.isValid=function(){return this.$d.toString()!==u},m.isSame=function(e,t){var r=b(e);return this.startOf(t)<=r&&r<=this.endOf(t)},m.isAfter=function(e,t){return b(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<b(e)},m.$g=function(e,t,r){return v.u(e)?this[t]:this.set(r,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var l=this,u=!!v.u(t)||t,c=v.p(e),h=function(e,t){var r=v.w(l.$u?Date.UTC(l.$y,t,e):new Date(l.$y,t,e),l);return u?r:r.endOf("day")},m=function(e,t){return v.w(l.toDate()[e].apply(l.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(t)),l)},g=this.$W,p=this.$M,x=this.$D,f="set"+(this.$u?"UTC":"");switch(c){case o:return u?h(1,0):h(31,11);case i:return u?h(1,p):h(0,p+1);case s:var b=this.$locale().weekStart||0,y=(g<b?g+7:g)-b;return h(u?x-y:x+(6-y),p);case"day":case d:return m(f+"Hours",0);case a:return m(f+"Minutes",1);case n:return m(f+"Seconds",2);case r:return m(f+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,s){var l,u=v.p(e),c="set"+(this.$u?"UTC":""),h=((l={}).day=c+"Date",l[d]=c+"Date",l[i]=c+"Month",l[o]=c+"FullYear",l[a]=c+"Hours",l[n]=c+"Minutes",l[r]=c+"Seconds",l[t]=c+"Milliseconds",l)[u],m="day"===u?this.$D+(s-this.$W):s;if(u===i||u===o){var g=this.clone().set(d,1);g.$d[h](m),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[v.p(e)]()},m.add=function(e,t){var l,d=this;e=Number(e);var u=v.p(t),c=function(t){var r=b(d);return v.w(r.date(r.date()+Math.round(t*e)),d)};if(u===i)return this.set(i,this.$M+e);if(u===o)return this.set(o,this.$y+e);if("day"===u)return c(1);if(u===s)return c(7);var h=((l={})[n]=6e4,l[a]=36e5,l[r]=1e3,l)[u]||1,m=this.$d.getTime()+e*h;return v.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||u;var n=e||"YYYY-MM-DDTHH:mm:ssZ",a=v.z(this),s=this.$H,i=this.$m,l=this.$M,o=r.weekdays,d=r.months,c=function(e,r,a,s){return e&&(e[r]||e(t,n))||a[r].slice(0,s)},m=function(e){return v.s(s%12||12,e,"0")},g=r.meridiem||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:l+1,MM:v.s(l+1,2,"0"),MMM:c(r.monthsShort,l,d,3),MMMM:c(d,l),D:this.$D,DD:v.s(this.$D,2,"0"),d:String(this.$W),dd:c(r.weekdaysMin,this.$W,o,2),ddd:c(r.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:v.s(s,2,"0"),h:m(1),hh:m(2),a:g(s,i,!0),A:g(s,i,!1),m:String(i),mm:v.s(i,2,"0"),s:String(this.$s),ss:v.s(this.$s,2,"0"),SSS:v.s(this.$ms,3,"0"),Z:a};return n.replace(h,function(e,t){return t||p[e]||a.replace(":","")})},m.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},m.diff=function(e,t,d){var u,c=v.p(t),h=b(e),m=(h.utcOffset()-this.utcOffset())*6e4,g=this-h,p=v.m(this,h);return p=((u={})[o]=p/12,u[i]=p,u[l]=p/3,u[s]=(g-m)/6048e5,u.day=(g-m)/864e5,u[a]=g/36e5,u[n]=g/6e4,u[r]=g/1e3,u)[c]||g,d?p:v.a(p)},m.daysInMonth=function(){return this.endOf(i).$D},m.$locale=function(){return p[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=f(e,t,!0);return n&&(r.$L=n),r},m.clone=function(){return v.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},e}()).prototype,b.prototype=j,[["$ms",t],["$s",r],["$m",n],["$H",a],["$W","day"],["$M",i],["$y",o],["$D",d]].forEac
1h(function(e){j[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),b.extend=function(e,t){return e.$i||(e(t,y,b),e.$i=!0),b},b.locale=f,b.isDayjs=x,b.unix=function(e){return b(1e3*e)},b.en=p[g],b.Ls=p,b.p={},b)},83397:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/products/[productSlug]/generate",function(){return r(56769)}])},8324:function(e,t,r){"use strict";r.d(t,{Z:function(){return y}});var n=r(85893),a=r(67294),s=r(32512),i=r(30474),l=r(38719),o=r(25675),d=r.n(o);let u=e=>{let{color:t="currentColor",width:r="41px",height:a="30px",...s}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:a,viewBox:"0 0 40.909 30",...s,children:(0,n.jsx)("g",{transform:"translate(0 -73.091)",children:(0,n.jsx)("path",{"data-name":"Path 2125",d:"M39.129,89.827A8.064,8.064,0,0,0,34.58,86.94,5.446,5.446,0,0,0,30,78.546a5.207,5.207,0,0,0-3.537,1.321,10.921,10.921,0,0,0-10.1-6.776,10.511,10.511,0,0,0-7.713,3.2A10.508,10.508,0,0,0,5.454,84q0,.277.043.916A9.528,9.528,0,0,0,0,93.546a9.193,9.193,0,0,0,2.8,6.743,9.191,9.191,0,0,0,6.744,2.8H32.728a8.172,8.172,0,0,0,6.4-13.264Zm-12.06-.575a.656.656,0,0,1-.479.2H21.818v7.5a.691.691,0,0,1-.681.681H17.045a.691.691,0,0,1-.682-.681v-7.5H11.59a.655.655,0,0,1-.681-.681.8.8,0,0,1,.213-.512L18.6,80.783a.722.722,0,0,1,.98,0l7.5,7.5a.663.663,0,0,1,.191.49A.656.656,0,0,1,27.07,89.252Z",transform:"translate(0)",fill:"currentColor"})})})};var c=r(26725),h=r(44009),m=r(53828),g=r(42676),p=r.n(g),x=r(94184),f=r.n(x);let b=e=>{let{className:t,showText:r=!0,text:a="Loading...",simple:s}=e;return(0,n.jsx)(n.Fragment,{children:s?(0,n.jsx)("div",{className:f()(t,p().simple_loading)}):(0,n.jsxs)("div",{className:f()("w-full flex flex-col items-center justify-center",t),style:{height:"calc(100vh - 200px)"},children:[(0,n.jsx)("div",{className:p().loading}),r&&(0,n.jsx)("h3",{className:"text-lg font-semibold text-body italic",children:a})]})})},v=e=>{let t=[];return e&&(t=Array.isArray(e)?e:[{...e}]),t};function y(e){let{onChange:t,value:r,multiple:o,acceptFile:g,helperText:p,accept:x,maxSize:f}=e,{t:y}=(0,l.$G)(),[j,w]=(0,a.useState)(v(r)),{mutate:k,isLoading:_}=(0,h.gw)(),[N,$]=(0,a.useState)(null),{getRootProps:M,getInputProps:S}=(0,s.uI)({accept:x||(g?{...c._0}:{"image/*":[".jpg",".jpeg",".png",".webp"]}),multiple:o,onDrop:async e=>{e.length&&k(e,{onSuccess:e=>{let r;e&&(null==e||e.map((t,r)=>{var n,a;let s=null==t?void 0:null===(n=t.original)||void 0===n?void 0:n.split("/"),i=null===(a=s[(null==s?void 0:s.length)-1])||void 0===a?void 0:a.split("."),l=null==i?void 0:i.pop(),o=null==i?void 0:i.join(".");e[r].file_name=o+"."+l})),o?(r=j.concat(e),w(j.concat(e))):(r=e[0],w(e)),t&&t(r)}})},maxSize:f,onDropRejected:e=>{e.forEach(e=>{var t;null==e||null===(t=e.errors)||void 0===t||t.forEach(e=>{(null==e?void 0:e.code)==="file-too-large"?$(y("error-file-too-large")):(null==e?void 0:e.code)==="file-invalid-type"&&$(y("error-invalid-file-type"))})})}}),I=e=>{let r=j.filter(t=>t.thumbnail!==e);w(r),t&&t(r)},C=null==j?void 0:j.map((e,t)=>{if(e&&e.id){var r;let a=(null==e?void 0:e.file_name)?null==e?void 0:e.file_name.split("."):null==e?void 0:null===(r=e.thumbnail)||void 0===r?void 0:r.split("."),s=null==a?void 0:a.pop(),l=null==a?void 0:a.join("."),o=(null==e?void 0:e.thumbnail)&&["tif","tiff","bmp","jpg","jpeg","webp","gif","png","eps","raw"].includes(s);return(0,n.jsxs)("div",{className:"relative mt-2 inline-flex flex-col overflow-hidden rounded me-2 ".concat(o?"border border-border-200 ":""),children:[o?(0,n.jsx)("figure",{className:"relative h-16 w-28",children:(0,n.jsx)(d(),{src:e.thumbnail,alt:l,fill:!0,sizes:"(max-width: 768px) 100vw",className:"object-contain"})}):(0,n.jsxs)("div",{className:"flex flex-col items-center",children:[(0,n.jsx)("div",{className:"flex items-center justify-center min-w-0 overflow-hidden h-14 w-14",children:(0,n.jsx)(d(),{src:m.GZ,width:56,height:56,alt:"upload placeholder"})}),(0,n.jsxs)("p",{className:"flex items-baseline p-1 text-xs cursor-default text-body",children:[(0,n.jsx)("span",{className:"inline-block max-w-[64px] overflow-hidden overflow-ellipsis whitespace-nowrap",title:"".concat(l,".").concat(s),children:l}),".",s]})]}),(0,n.jsx)("button",{className:"absolute flex items-center justify-center w-4 h-4 text-xs bg-red-600 rounded-full shadow-xl outline-none top-1 text-light end-1",onClick:()=>I(e.thumbnail),children:(0,n.jsx)(i.T,{width:10,height:10})})]},t)}});return(0,a.useEffect)(()=>()=>
1{$(null),j.forEach(e=>URL.revokeObjectURL(e.thumbnail))},[j]),(0,n.jsxs)("section",{className:"upload",children:[(0,n.jsxs)("div",{...M({className:"border-dashed border-2 border-border-base h-36 rounded flex flex-col justify-center items-center cursor-pointer focus:border-accent-400  focus:outline-none"}),children:[(0,n.jsx)("input",{...S()}),(0,n.jsx)(u,{className:"text-muted-light"}),(0,n.jsx)("p",{className:"mt-4 text-sm text-center text-body",children:p?(0,n.jsx)("span",{className:"font-semibold text-gray-500",children:p}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"font-semibold text-accent",children:"Upload your file"})," ","or drag and drop ",(0,n.jsx)("br",{}),(0,n.jsx)("span",{className:"text-xs text-body",children:"PNG, JPG, JPEG up to 10MB"})]})}),N&&(0,n.jsx)("p",{className:"mt-4 text-sm text-center text-red-600 text-body",children:N})]}),(!!C.length||_)&&(0,n.jsxs)("aside",{className:"flex flex-wrap mt-2",children:[!!C.length&&C,_&&(0,n.jsx)("div",{className:"flex items-center h-16 mt-2 ms-2",children:(0,n.jsx)(b,{simple:!0,className:"w-6 h-6"})})]})]})}},44009:function(e,t,r){"use strict";r.d(t,{gw:function(){return d},I8:function(){return u}});var n=r(88767),a=r(94293),s=r(36509);let i={upload:async e=>{let t=new FormData;return e.forEach(e=>{t.append("attachment[]",e)}),s.e.post(a.P.ATTACHMENTS,t,{headers:{"Content-Type":"multipart/form-data"}})}};var l=r(67294);let o="upload",d=()=>{let e=(0,n.useQueryClient)();return(0,n.useMutation)(o,e=>i.upload(e),{onSettled:()=>{e.invalidateQueries(a.P.SETTINGS)}})},u=()=>{var e;let t=(0,n.useQueryClient)(),[r,a]=(0,l.useState)(null===(e=t.getMutationCache().find({mutationKey:o}))||void 0===e?void 0:e.state);return(0,l.useEffect)(()=>{let e=t.getMutationCache().subscribe(()=>{var e;a(null===(e=t.getMutationCache().find({mutationKey:o}))||void 0===e?void 0:e.state)});return()=>{e()}},[t]),r}},56769:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return H},default:function(){return Z}});var n=r(85893),a=r(38719),s=r(1966),i=r(86650),l=r(86596),o=r(82821),d=r(64174),u=r(11163),c=r(80827),h=r(13927),m=r(20064),g=r(47560),p=r(33835),x=r(67294),f=r(95562),b=r(60119),v=r(93265),y=r(25675),j=r.n(y),w=r(52892),k=r(75283),_=r(11607),N=r(76259),$=r(41733),M=r(8324);let S=e=>{let{promptInputs:t,formValues:r,handleInputChange:s,handleGenerate:i,isGenerating:l,numImages:o,setNumImages:d,stealthMode:u,setStealthMode:c,buttonRef:h,uploadedImage:m,onImageUpload:g,pricePerGenerate:p}=e,{t:x}=(0,a.$G)("common");return(0,n.jsxs)("form",{className:"flex flex-col gap-4",children:[t.map((e,t)=>(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"mb-1 block font-semibold text-dark dark:text-light-400",children:e.label}),"prompt"===e.name.toLocaleLowerCase()?(0,n.jsx)("textarea",{autoFocus:0===t,className:"w-full min-h-[100px] rounded-md border border-gray-200 bg-default-400/20 px-3 py-2 text-sm text-dark duration-200 transition-colors hover:bg-default-200 focus:border-brand focus:ring-brand dark:border-dark-400 dark:bg-dark-300/20 dark:text-light-400 dark:hover:bg-dark-300/30",placeholder:"Enter ".concat(e.label.toLowerCase()),value:r[e.name]||"",onChange:t=>s(e.name,t.target.value)}):(0,n.jsx)("input",{type:"text",autoFocus:0===t,className:"w-full rounded-md border border-gray-200 bg-default-400/20 px-3 py-2 text-sm text-dark duration-200 transition-colors hover:bg-default-200 focus:border-brand focus:ring-brand dark:border-dark-400 dark:bg-dark-300/20 dark:text-light-400 dark:hover:bg-dark-300/30",placeholder:"Enter ".concat(e.label.toLowerCase()),value:r[e.name]||"",onChange:t=>s(e.name,t.target.value)})]},e.name)),g&&(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"mb-1 block text-sm font-semibold text-dark dark:text-light-400",children:"Upload Image (Optional)"}),(0,n.jsx)("div",{className:"max-w-xs rounded-md border border-gray-200 bg-default-400/20 p-1 dark:border-dark-400 dark:bg-dark-300/20",children:(0,n.jsx)(M.Z,{onChange:g,value:m,multiple:!1,accept:{"image/*":[".jpg",".jpeg",".png",".webp"]},helperText:"Upload an image to use as reference for generation",maxSize:10485760,height:100,thumbSize:"sm"})})]}),(0,n.jsxs)("div",{className:"flex flex-row items-stretch gap-2 sm:gap-4",children:[(0,n.jsx)("button",{type:"button",ref:h,className:(0,b.cn)("group relative flex h-12 flex-1 items-center gap-2 self
1-center rounded-lg px-3 py-2 text-white duration-300 transition-all sm:h-14 sm:px-4",l?"cursor-not-allowed bg-gray-400 dark:bg-dark-500":"bg-brand hover:bg-brand-dark dark:hover:bg-brand-dark/90"),onClick:()=>i(o),disabled:l,children:(0,n.jsxs)("div",{className:"relative z-10 flex w-full items-center justify-between px-2 sm:px-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,n.jsx)(w.j,{className:"h-4 w-4 sm:h-5 sm:w-5"}),(0,n.jsx)("span",{className:"text-sm font-medium sm:text-base",children:l?"Generating...":"Generate Now"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 rounded-full bg-white/10 px-2 py-1 sm:gap-2 sm:px-3 sm:py-1.5",children:[(0,n.jsx)(j(),{src:v.Z,width:16,height:16,alt:"P-Bucks",className:"h-3 w-3 sm:h-4 sm:w-4"}),(0,n.jsx)("span",{className:"text-xs sm:text-sm",children:o*p})]})]})}),(0,n.jsxs)("div",{className:"flex w-auto min-w-[60px] items-center gap-2 rounded-lg border border-light-400 bg-white/80 p-1.5 backdrop-blur-sm dark:border-dark-300 dark:bg-transparent sm:min-w-[80px]",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg bg-gray-50 px-2 py-1 dark:bg-dark-400",children:[(0,n.jsx)(k.Z,{className:"h-4 w-4 text-gray-600 dark:text-light-400"}),(0,n.jsx)("span",{className:"text-sm font-medium text-gray-900 dark:text-light-400",children:o})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)("button",{type:"button",onClick:()=>d(Math.min(4,o+1)),className:(0,b.cn)("flex h-6 w-6 items-center justify-center rounded-md border transition-colors",o>=4?"cursor-not-allowed border-light-400 bg-gray-100 text-gray-400 dark:border-dark-300 dark:bg-dark-400 dark:text-dark-600":"border-light-400 bg-white text-gray-600 hover:bg-gray-50 dark:border-dark-300 dark:bg-dark-300 dark:text-light-400 dark:hover:bg-dark-400"),disabled:o>=4,children:(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M6 2.5V9.5M2.5 6H9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,n.jsx)("button",{type:"button",onClick:()=>d(Math.max(1,o-1)),className:(0,b.cn)("flex h-6 w-6 items-center justify-center rounded-md border transition-colors",o<=1?"cursor-not-allowed border-light-400 bg-gray-100 text-gray-400 dark:border-dark-300 dark:bg-dark-400 dark:text-dark-600":"border-light-400 bg-white text-gray-600 hover:bg-gray-50 dark:border-dark-300 dark:bg-dark-300 dark:text-light-400 dark:hover:bg-dark-400"),disabled:o<=1,children:(0,n.jsx)("svg",{width:"12",height:"2",viewBox:"0 0 12 2",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M1 1H11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-gray-200 bg-default-400/20 p-3 dark:border-dark-400 dark:bg-dark-300/20",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(_.Z,{className:(0,b.cn)("h-3.5 w-3.5 duration-200 transition-colors",u?"text-brand":"text-gray-500 dark:text-dark-600")}),(0,n.jsx)("span",{className:(0,b.cn)("text-xs duration-200 transition-colors",u?"font-medium text-brand":"text-gray-600 dark:text-light-400"),children:"Stealth Mode"})]}),(0,n.jsx)(N.e,{content:u?"Images will be private by default":"Image will be public by default",children:(0,n.jsx)("div",{children:(0,n.jsx)($.i,{size:"sm",color:u?"primary":"default",checked:u,isSelected:u,onChange:e=>c(e.target.checked)})})})]})]})};var I=r(41043);let C=e=>{var t,r,s,i;let{product:l,promptInputs:o,formValues:d,handleInputChange:u,handleGenerate:c,isGenerating:h,numImages:m,setNumImages:g,stealthMode:x,setStealthMode:b,generatedImages:v,publicGeneratedImages:y,imagesProps:j,publicImagesProps:w,setFullscreenImage:k,status:_,buttonRef:N,uploadedImage:$,onImageUpload:M}=e,{t:C}=(0,a.$G)("common"),D=e=>{Object.entries(e).forEach(e=>{let[t,r]=e;u(t,r)})},P=(null===(t=l.ai_model_version)||void 0===t?void 0:t.user_credit_cost)||250;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex-1 rounded-xl border border-light-400 bg-white p-6 shadow-sm dark:border-dark-300 dark:bg-transparent",children:[(0,n.jsx)("h2",{className:"mb-6 text-xl font-bold text-dark dark:text-light-400",children:"Try prompt here"}),(0,n.jsx)(S,{promptInputs:o,formValues:d,handleInputChange:u,handleGenerate:c,isGenerating:h,numImages:m,setNumImages:g,stealthMode:x,setStealthMode:b,buttonRef:N,uploadedImage:$,onImageUpload:M,pricePerGenerate:P}),(0,n.jsx)("div",{className:"mt-6",children:(0,n.jsx)(f.p,{myImages:{images:v,isLoading:j.isLoading,hasNextPage:j.hasNextPage,isFetchingNextPage:j.isFetchingNextPage,onLoadMore:j.fetchNextPage,totalCount:j.totalCount},publicImages:{images:y,isLoading:w.isLoading,hasNextPage:w.hasNextPage,isFetchingNextPage:w.isFetchingNextPage,onLoadMore:w.fetchNextPage,totalCount:w.totalCount},setFullscreenImage:k,isGenerating:h,status:_||void 0,maxHeight:"calc(100vh - 300px)",isGalleryPage:!1,onFormInputChange:D,productInputs:o})})]}),(0,n.jsxs)("div",{className:"mt-6 flex flex-col gap-4 xl:hidden",children:[(0,n.jsx)(I.Z,{type:"buy",slug:l.slug,name:l.name,image:l.image,price:l.price,size:"compact",canGenerate:null===(r=l.ai_model_version)||void 0===r?void 0:r.can_generate,product:l,pbucks:null!==(i=null===(s=l.ai_model_version)||void 0===s?void 0:s.user_credit_cost)&&void 0!==i?i:250}),(0,n.jsx)(p.k,{product:l})]})]})};var D=r(96365),P=r(53243),L=r(67410),O=r(47601),T=r(86282),F=r(3531),G=r(90584);let E=e=>{var t,r,l,f,b;let{product:v}=e,{t:y}=(0,a.$G)("common");(0,u.useRouter)();let{id:j,name:w,slug:k,image:_}=v,{products:N,loadMore:$,hasNextPage:M,isLoadingMore:S,isLoading:E}=(0,i.rn)({sortedBy:s.As.Desc,orderBy:"orders_count",name:w,limit:4,exclude:parseInt(j,10)},{refetchOnMount:!1,refetchOnWindowFocus:!1}),[H,Z]=(0,G.Z)("stealth-mode","draft"===v.status),[A,W]=(0,G.Z)("num-images",1),Y=!!("draft"===v.status||H),[U,z]=(0,x.useState)({}),[B,J]=(0,x.useState)(null),R=(0,x.useRef)(null),V=x.useMemo(()=>
1{if(!v.prompt_example_input)return[];try{let e="string"==typeof v.prompt_example_input?JSON.parse(v.prompt_example_input):v.prompt_example_input;return e.inputs||[]}catch(e){return console.error("Error parsing prompt_example_input:",e),[]}},[v.prompt_example_input]),Q=(e,t)=>{z(r=>({...r,[e]:t}))},[K,X]=(0,x.useState)(null),{me:q,hasSubscription:ee}=(0,O.P)(),[et,er]=(0,x.useState)(!1),{generatedImages:en,isLoading:ea,refetch:es,fetchNextPage:ei,hasNextPage:el,isFetchingNextPage:eo,totalCount:ed}=(0,L.IS)({product_id:v.id,language:"en",enabled:!!q}),{generatedImages:eu,isLoading:ec,fetchNextPage:eh,hasNextPage:em,isFetchingNextPage:eg,totalCount:ep}=(0,L.IS)({product_id:v.id,language:"en",is_public:!0}),{generateImage:ex}=(0,D.I)(),{generateImage:ef,isGenerating:eb,status:ev}=(0,P.V)(v,es),ey=e=>{let t=(null==e?void 0:e.trim())||"";return t.length>0},ej=e=>{var t;let r=JSON.stringify({inputs:V.map(e=>({name:e.name,value:U[e.name]||""}))});ex({prompt:r,productId:v.id,currentRatio:{name:"1:1",value:1},selectedLoraModel:null,stealthMode:!1,numImages:e,validatePrompt:ey,missingTriggerWords:[],onInsufficientCredits:()=>er(!0),onGenerate:ef,imageUrl:(null==B?void 0:B.original)||null,pricePerGenerate:(null===(t=v.ai_model_version)||void 0===t?void 0:t.user_credit_cost)||250})};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{title:"Try ".concat(v.name," | ").concat(v.ai_model.name," Prompt"),description:v.description,url:"/products/".concat(v.slug,"/generate")}),(0,n.jsx)("div",{className:"relative",children:(0,n.jsxs)("div",{className:"h-full min-h-screen p-4 md:px-6 lg:px-8 lg:pt-6",children:[(0,n.jsx)(c.O,{product:v}),(0,n.jsxs)("div",{className:"mx-auto flex max-w-screen-xl flex-col gap-0 xl:flex-row xl:gap-8",children:[(0,n.jsxs)("div",{className:"w-full flex-shrink-0 space-y-6 xl:w-[400px]",children:[(0,n.jsx)(h.X,{name:v.name,productStatus:v.status,product:v}),(0,n.jsxs)("div",{className:"hidden w-full xl:block",children:[(0,n.jsx)(m.O,{setPrompt:()=>{},setSelectedLoraModel:()=>{},productPromptExamples:v.prompt_example,subject:v.training_subject_type,triggerWord:v.trigger_word,hidePromptStyles:!0,formInputs:v.prompt_example_input,onFormInputChange:e=>{z(e)}}),(0,n.jsx)("div",{className:"my-4",children:(0,n.jsx)(I.Z,{type:"buy",className:"promptsclub"===v.shop.slug?"hidden":"",slug:v.slug,name:v.name,image:v.image,price:v.price,size:"compact",canGenerate:null!==(f=null===(t=v.ai_model_version)||void 0===t?void 0:t.can_generate)&&void 0!==f&&f,product:v,pbucks:null!==(b=null===(r=v.ai_model_version)||void 0===r?void 0:r.user_credit_cost)&&void 0!==b?b:250})}),(0,n.jsx)(p.k,{product:v})]})]}),(0,n.jsx)("div",{className:"mb-6 block xl:hidden",children:(0,n.jsx)(g.f,{sliderRef:{current:null},textareaRef:R,setPrompt:()=>{},setSelectedLoraModel:()=>{},productPromptExamples:v.prompt_example,subject:v.subject,triggerWord:v.trigger_word,hidePromptStyles:!0,formInputs:v.prompt_example_input,onFormInputChange:e=>{z(e)}})}),(0,n.jsx)(C,{product:v,promptInputs:V,formValues:U,handleInputChange:Q,handleGenerate:ej,isGenerating:eb,numImages:null!=A?A:1,stealthMode:Y,setStealthMode:Z,setNumImages:W,buttonRef:R,generatedImages:en,publicGeneratedImages:eu,imagesProps:{isLoading:ea,hasNextPage:null!=el&&el,isFetchingNextPage:eo,fetchNextPage:ei,totalCount:ed},publicImagesProps:{isLoading:ec,hasNextPage:null!=em&&em,isFetchingNextPage:eg,fetchNextPage:eh,totalCount:ep},setFullscreenImage:X,status:ev,uploadedImage:B,onImageUpload:J})]}),(0,n.jsxs)("div",{className:"mx-auto mt-12 max-w-6xl",children:[(0,n.jsx)("h2",{className:"mb-8 w-full border-b border-light-500 pb-4 pt-10 text-xl tracking-tight text-dark dark:border-dark-400 dark:text-light",children:y("You may also like")}),(0,n.jsx)("div",{className:"search-results -mx-4 flex min-h-[84%] flex-col px-4 md:-mx-6 lg:-mx-7 lg:py-2 xl:px-20 3xl:-mx-8",children:(0,n.jsx)(d.Z,{products:N,onLoadMore:$,hasNextPage:M,isLoadingMore:S,isLoading:E,limit:4,disableAutoLoad:!0})})]})]})}),K&&(0,n.jsx)(T.O,{imageUrl:K,prompt:(null===(l=null==en?void 0:en.find(e=>{var t;return null===(t=e.image_urls)||void 0===t?void 0:t.some(e=>e.original===K)}))||void 0===l?void 0:l.prompt)||"",onClose:()=>X(null)}),(0,n.jsx)(F.S,{isOpen:et,onClose:()=>er(!1),variant:ee?"credits":"subscription"})]})};E.getLayout=function(e){return(0,n.jsx)(l.Z,{children:e})};var H=!0,Z=E},42676:function(e){e.exports={loading:"loader_loading__k1_ut",simple_loading:"loader_simple_loading__JrBP6",spin:"loader_spin__gimJS",pulse:"loader_pulse__YBKcO"}}},function(e){e.O(0,[6368,2329,4166,1349,3217,1116,4594,2512,1550,7823,8176,9393,5511,1372,476,7350,5521,9774,2888,179],function(){return e(e.s=83397)}),_N_E=e.O()}]);
2//# sourceMappingURL=generate-bcb0b3a072c9ecd7.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.