PageSourceSearch

https://www.mage.space/_next/static/chunks/7567-99442760b00d48c0.js?dpl=dpl_5X7ShCSKzbbFJjqwsApJzaQ5mHdE

js mage.space collected 2026-09-24 19:36:48 UTC 481,969 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6bf8b6b2-f687-4998-98c8-caeb79267e18",e._sentryDebugIdIdentifier="sentry-dbid-6bf8b6b2-f687-4998-98c8-caeb79267e18")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7567],{106:(e,t,r)=>{"use strict";r.d(t,{j:()=>i});var i=function(e){return e.RES_1K="1k",e.RES_2K="2k",e}({})},412:(e,t,r)=>{"use strict";r.d(t,{$N:()=>u,Up:()=>d,Xn:()=>s,Z1:()=>o,aD:()=>p,eU:()=>l,gb:()=>c,yV:()=>m});var i=r(4717),a=r(56800),n=r(54887);let o="guava",s="guava-pro",l="guava-pro-v1-5",c="guava-2",d="guava-2-pro",u=[c,d],p={architecture:a.qH.GUAVA,model_id:o,prompt:"",resolution:n.X.RES_1K,aspect_ratio:i.vW.PORTRAIT,prompt_extend:!1},m={architecture:a.qH.GUAVA,name:"Guava",short_name:"Guava",popularity:6,tags:[a.fZ,a.R$,a.Mn,a.KT],models:[{id:o,name:"Guava"},{id:s,name:"Guava Pro"},{id:l,name:"Guava Pro 1.5"},{id:c,name:"Guava 2"},{id:d,name:"Guava 2 Pro"}],api_path:"/api/v1/guava",agent:{description:"General image model with reference-image support.",defaultConfig:p,options:{resolution:Object.values(n.X)},imageInputs:{references:{field:"image",additionalField:"additional_images"}}}}},501:(e,t,r)=>{"use strict";r.d(t,{d:()=>s,x:()=>o});var i=r(73904);let a=Object.fromEntries(i.S.map(e=>[e.architecture,e.name])),n=Object.fromEntries(i.S.map(e=>[e.architecture,e.short_name]));function o(e){var t;return null!==(t=n[e])&&void 0!==t?t:"".concat(e)}function s(e){var t;return null!==(t=a[e])&&void 0!==t?t:"Unknown: ".concat(e)}},2586:(e,t,r)=>{"use strict";r.d(t,{Ce:()=>m,Dp:()=>g,OV:()=>p,Xf:()=>u});var i=r(21078),a=r(17157),n=r(9057),o=r(57411),s=r(86819),l=r(58649),c=r(56800);let d={[c.qH.MANGO]:{maxImages:10},[c.qH.GUAVA]:{maxImages:3},[c.qH.QWEN_IMAGE_EDIT_PLUS]:{maxImages:4},[c.qH.FLUX2]:{maxImages:3},[c.qH.WAN]:{maxImages:2,supportsLastFrame:!0}
1,[c.qH.FRAMEPACK]:{maxImages:2,supportsLastFrame:!0},[c.qH.PEACH_MAX]:{maxImages:2,supportsLastFrame:!0},[c.qH.VEO3_1]:{maxImages:2,supportsLastFrame:!0},[c.qH.BLUEBERRY]:{maxImages:2,supportsLastFrame:!0},[c.qH.PEAR]:{maxImages:1},[c.qH.SEED_AUDIO]:{maxImages:1},[c.qH.NANO_BANANA_V2]:{maxImages:14},[c.qH.CHERRY]:{maxImages:a.cR,modelMaxImages:a.YM,firstFrameKey:"first_image"},[c.qH.MELON]:{maxImages:7,firstFrameKey:"first_image"},[c.qH.RASPBERRY]:{maxImages:5,firstFrameKey:"first_image"},[c.qH.GROK_IMAGE]:{maxImages:n.Oo},[c.qH.GROK_VIDEO]:{maxImages:o.oE},[c.qH.BERRY]:{maxImages:9,firstFrameKey:"first_image"},[c.qH.PLUM]:{maxImages:9,firstFrameKey:"first_image"},[c.qH.LEMON]:{maxImages:s.M0,firstFrameKey:"first_image"},[c.qH.MINIMAX_H3]:{maxImages:l.Is,firstFrameKey:"first_image"},[c.qH.GPT_IMAGE_2]:{maxImages:15},[c.qH.CHROMA]:{maxImages:0},[c.qH.VEO3]:{maxImages:0},[c.qH.HIDREAM]:{maxImages:0},[c.qH.ANIMA]:{maxImages:0},[c.qH.KREA_2]:{maxImages:0}};function u(e,t){var r,i;let a=d[e];if(t){let e=null==a?void 0:null===(r=a.modelMaxImages)||void 0===r?void 0:r[t];if(void 0!==e)return e}return null!==(i=null==a?void 0:a.maxImages)&&void 0!==i?i:1}function p(e){var t,r;return null!==(r=null===(t=d[e])||void 0===t?void 0:t.supportsLastFrame)&&void 0!==r&&r}function m(e){var t,r;return null!==(r=null===(t=d[e])||void 0===t?void 0:t.firstFrameKey)&&void 0!==r?r:"image"}function g(e,t){return!!p(e)&&(e!==c.qH.BLUEBERRY||t===i.el)}},2595:(e,t,r)=>{"use strict";r.d(t,{B:()=>n,J:()=>a});var i=r(8347);let a=["INPUT","TEXTAREA","SELECT"];function n(){let e=(0,i.useOs)();return"ios"===e||"android"===e||"macos"===e&&navigator.maxTouchPoints>1}},2736:(e,t,r)=>{"use strict";r.d(t,{Gm:()=>i,kP:()=>a,oS:()=>n,pU:()=>o});var i=function(e){return e.BASIC="grok-imagine-image",e.QUALITY="grok-imagine-image-quality",e.V2="grok-imagine-image-2.0",e}({}),a=function(e){return e.LOW="low",e.MEDIUM="medium",e}({}),n=function(e){return e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_9_16="9:16",e.ASPECT_RATIO_4_3="4:3",e.ASPECT_RATIO_3_4="3:4",e.ASPECT_RATIO_3_2="3:2",e.ASPECT_RATIO_2_3="2:3",e.ASPECT_RATIO_2_1="2:1",e.ASPECT_RATIO_1_2="1:2",e.ASPECT_RATIO_19_5_9="19.5:9",e.ASPECT_RATIO_9_19_5="9:19.5",e.ASPECT_RATIO_20_9="20:9",e.ASPECT_RATIO_9_20="9:20",e}({}),o=function(e){return e.RES_1K="1k",e.RES_2K="2k",e}({})},3267:(e,t,r)=>{"use strict";r.d(t,{Fk:()=>l,JB:()=>s});var i=r(4717),a=r(56800),n=r(106);let o="qwen-image-edit-plus",s={architecture:a.qH.QWEN_IMAGE_EDIT_PLUS,model_id:o,prompt:"",resolution:n.j.RES_1K,num_inference_steps:40,guidance_scale:4,aspect_ratio:i.vW.PORTRAIT},l={architecture:a.qH.QWEN_IMAGE_EDIT_PLUS,name:"Qwen Image Edit Plus",short_name:"Qwen Image Edit Plus",popularity:0,tags:[a.R$,a.fZ,a.Mn],models:[{id:o}],api_path:"/api/v1/qwen-image-edit-plus",agent:{description:"Image editor. Requires at least one input image; never pick it without one.",defaultConfig:s,options:{resolution:Object.values(n.j)},imageInputs:{references:{field:"image",additionalField:"additional_images"}},editCapable:!0}}},3359:(e,t,r)=>{"use strict";r.d(t,{Rd:()=>o,rY:()=>s});var i=r(39191),a=r(91788);let n=a.vw.REALISTIC,o={[a.vw.REALISTIC]:a.Vo.LOW,[a.vw.SOFT]:a.Vo.HIGH,[a.vw.IMPERFECT]:a.Vo.LOW,[a.vw.IMPERFECT_FRECKLES]:a.Vo.LOW},s={image:null,width:0,height:0,resolution:i.C.RES_2K,mode:n,strength:o[n]}},3395:(e,t,r)=>{"use strict";r.d(t,{C:()=>c});var i=r(95155),a=r(23288),n=r(26029),o=r(70112),s=r(58887),l=r(68183);function c(e){let{gems:t,...r}=e;return(0,i.jsx)(n.Badge,{px:10,miw:48,color:"orange",variant:"light",h:36,radius:"sm",style:{cursor:"default",flexShrink:0},...r,children:(0,i.jsxs)(o.Group,{gap:2,justify:"center",wrap:"nowrap",children:[(0,i.jsx)(l.A,{size:10}),(0,i.jsx)(s.Text,{size:"xs",fw:"bold",style:{fontSize:"10px"},children:(0,a.Z)(t,1)})]})})}},3904:(e,t,r)=>{"use strict";r.d(t,{D:()=>i});var i=function(e){return e.RES_1K="1k",e.RES_2K="2k",e}({})},4334:(e,t,r)=>{"use strict";r.d(t,{qo:()=>s,uO:()=>l});var i=r(4717),a=r(56800),n=r(61169);let o="z-image-turbo",s={architecture:a.qH.Z_IMAGE,model_id:o,prompt:"",resolution:n.m.RES_1K,num_inference_steps:9,guidance_scale:0,aspect_ratio:i.vW.PORTRAIT},l={architecture:a.qH.Z_IMAGE,name:"Z-Image",short_name:"Z-Image",popularity:0,tags:[a.fZ,a.R$],models:[{id:o,name:"Z-Image"}],api_path:"/api/v1/z-image",agent:{description:"Fast, lightweight image model.",defaultConfig:s,options:{resolution:Object.values(n.m)}}}},4389:(e,t,r)=>{"use strict";r.d(t,{U:()=>a});var i=r(34477);let a=(0,i.createServerReference)("40c1a3020a245c676f3432bb438af16dea4485bc67",i.callServer,void 0,i.findSourceMapURL,"getPortalUrlWithStripeDirect")},4524:(e,t,r)=>{"use strict";r.d(t,{W:()=>i});let i={backgroundColor:"rgba(30, 30, 30, 0.85)",backdropFilter:"blur(20px) saturate(1.5)",WebkitBackdropFilter:"blur(20px) saturate(1.5)",border:"1px solid rgba(255, 255, 255, 0.1)",boxShadow:"0 12px 48px rgba(0, 0, 0, 0.30)",borderRadius:16}},4714:(e,t,r)=>{"use strict";r.d(t,{d:()=>i});var i=function(e){return e.SIZE_240P="240p",e.SIZE_360P="360p",e.SIZE_480P="480p",e.SIZE_720P="720p",e}({})},4717:(e,t,r)=>{"use strict";r.d(t,{Uc:()=>n,Xb:()=>o,vW:()=>a,yS:()=>i});var i=function(e){return e.R_ESRGAN_X2="real-esrgan-x2",e.R_ESRGAN_X4="real-esrgan-x4",e.R_ESRGAN_X4_ANIME="real-esrgan-x4-anime",e.R_ESRGAN_X2_V2="real-esrgan-x2-v2",e.R_ESRGAN_X4_V2="real-esrgan-x4-v2",e.R_ESRGAN_X2_ANIME_V2="real-esrgan-x2-anime-v2",e.R_ESRGAN_X4_ANIME_V2="real-esrgan-x4-anime-v2",e.R_ESRGAN_X2_GFPGAN="real-esrgan-x2-gfpgan",e.R_ESRGAN_X4_GFPGAN="real-esrgan-x4-gfpgan",e.R_ESRGAN_X4_ANIME_GFPGAN="real-esrgan-x4-anime-gfpgan",e.R_ESRGAN_X2_GFPGAN_V2="real-esrgan-x2-gfpgan-v2",e.R_ESRGAN_X4_GFPGAN_V2="real-esrgan-x4-gfpgan-v2",e.R_ESRGAN_X2_ANIME_GFPGAN_V2="real-esrgan-x2-anime-gfpgan-v2",e.R_ESRGAN_X4_ANIME_GFPGAN_V2="real-esrgan-x4-anime-gfpgan-v2",e.R_ESRGAN_X2_RFORMER="real-esrgan-x2-rformer",e.R_ESRGAN_X4_RFORMER="real-esrgan-x4-rformer",e.R_ESRGAN_X4_ANIME_RFORMER="real-esrgan-x4-anime-rformer",e.R_ESRGAN_X2_CFORMER="real-esrgan-x2-cformer",e.R_ESRGAN_X4_CFORMER="real-esrgan-x4-cformer",e.R_ESRGAN_X4_ANIME_CFORMER="real-esrgan-x4-anime-cformer",e.LANCZOS="lanczos",e}({}),a=function(e){return e.ULTRAWIDE="ultrawide",e.CINEMA="cinema",e.LANDSCAPE="landscape",e.COMPUTER="c
1omputer",e.SQUARE="square",e.PORTRAIT="portrait",e.TABLET="tablet",e.PHONE="phone",e.ULTRATALL="ultratall",e}({}),n=function(e){return e.G="G",e.G_PLUS="G+",e.M="M",e.M_PLUS="M+",e}({}),o=function(e){return e.CUSTOM="Custom",e.BASIC="Basic",e.CUSTOM_1="Pack 1",e.CUSTOM_2="Pack 2",e.CUSTOM_3="Pack 3",e.CUSTOM_4="Pack 4",e.CUSTOM_5="Pack 5",e}({})},4769:(e,t,r)=>{"use strict";r.d(t,{q:()=>A,dg:()=>x,C5:()=>S,cF:()=>I});var i=r(95155),a=r(51977),n=r(87049),o=r(34477);let s=(0,o.createServerReference)("001c47051260aa356cad90e90965e68ef138ee3932",o.callServer,void 0,o.findSourceMapURL,"cancelAllRunningArchitectureJobs");var l=r(25352),c=r(77567),d=r(16791),u=r(36996),p=r(21220),m=r(58887),g=r(18229),h=r(26903),f=r(91423),v=r(31951),_=r(6874),y=r.n(_),b=r(12115);function A(){let{isDesktop:e}=(0,c.VT)("isDesktop"),[t,r]=(0,b.useState)(!1),a=async()=>{try{r(!0),await s();let e=c.xV.getState();e.setRunningJobs(e.runningJobs.filter(e=>e.generationMode===l.o.GEMS)),e.setIsAppPlaying(!1),e.setIsGenQueuePaused(!1),(0,f.s7)(),(0,d.wB)({title:"Generation Cancelled",message:"Your generation has been cancelled."})}catch(e){console.error("Error canceling running job",e),(0,d.p6)({title:"Error Cancelling Job",message:"Ah, we had an issue. Try again?"})}finally{r(!1)}};return(0,i.jsx)(n.G,{title:"Concurrency Limit Reached",children:(0,i.jsxs)(p.Stack,{gap:"sm",mt:-10,children:[(0,i.jsx)(m.Text,{size:"sm",c:"dimmed",children:"Unlimited concurrency reached. Use Gems for unlimited concurrency!"}),(0,i.jsx)(m.Text,{size:"xs",c:"dimmed",children:"Canceling stops your running Unlimited generations. Gem generations keep running and are not affected."}),(0,i.jsxs)(g.SimpleGrid,{cols:e?2:1,spacing:"sm",mt:"xs",children:[(0,i.jsx)(h.Button,{size:"md",variant:"light",color:"gray",onClick:a,loading:t,children:"Cancel Generation"}),(0,i.jsx)(h.Button,{size:"md",variant:"light",color:"orange",onClick:()=>{(0,u._)(l.o.GEMS),c.xV.getState().setIsGenQueuePaused(!1),(0,f.s7)()},children:"Use Gems"})]})]})})}function S(e){let{prompt:t}=e,r=(0,c.xV)(e=>e.setPlayIsActive);return(0,i.jsx)(n.G,{title:"Forbidden",children:(0,i.jsxs)(p.Stack,{gap:"sm",mt:-10,children:[(0,i.jsx)(m.Text,{size:"sm",c:"dimmed",children:"This content appears to contain material that may be abusive. Repeated offenses may result in a timeout or ban."}),(0,i.jsxs)(m.Text,{size:"sm",lineClamp:2,fw:"bold",c:"white",fs:"italic",children:['"',t,'"']}),(0,i.jsx)(h.Button,{size:"md",variant:"light",color:"orange",fullWidth:!0,onClick:()=>{(0,f.s7)(),r(!1)},component:y(),href:"/terms-and-conditions",children:"Terms & Conditions"})]})})}function x(e){let{prompt:t}=e;return(0,i.jsx)(n.G,{title:"External Block",children:(0,i.jsxs)(p.Stack,{gap:"sm",mt:-10,children:[(0,i.jsx)(m.Text,{size:"sm",c:"dimmed",children:"This content was flagged by an external service. Please update your prompt or configuration to continue creating."}),(0,i.jsxs)(m.Text,{size:"sm",lineClamp:2,fw:"bold",c:"white",fs:"italic",children:['"',t,'"']}),(0,i.jsx)(h.Button,{size:"md",variant:"light",color:"gray",fullWidth:!0,onClick:()=>{(0,f.s7)()},children:"Got It"})]})})}function R(){let{setPlayIsActive:e}=(0,c.VT)("setPlayIsActive");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.Button,{size:"lg",color:"orange",c:"white",fullWidth:!0,onClick:()=>{(0,f.s7)(),e(!1)},component:y(),href:"/membership?v=gems",children:"Get Gems"}),(0,i.jsxs)(m.Text,{size:"xs",c:"dimmed",ta:"center",mt:-10,children:["⚡ Discover the power of"," ",(0,i.jsx)(m.Text,{component:"span",c:"white",fw:700,inherit:!0,children:"Fast Generation"})," ","with Gems"]})]})}function I(e){let{prompt:t,gemsRequired:r,item:n}=e;return(0,i.jsx)(a.O,{gemsRequired:r,subtitle:"Your creation is waiting — top up to keep going.",pausedIcon:(0,i.jsx)(v.A,{size:20}),pausedLabel:t,fallback:(0,i.jsx)(R,{}),onPurchased:e=>{var t;let{gems:r,stillNeeded:i}=e,a=c.xV.getState();if((null===(t=n.appRequest)||void 0===t?void 0:t.app)&&a.setAppSession(n.appRequest.app,{activeHistoryId:null,pendingRequestId:n.appRequest.requestId,isGenerating:!0}),a.unshiftToGenQueue(n),a.setIsGenQueuePaused(!1),i>
10){(0,d.bA)({title:"Gems Added",message:"".concat(r.toLocaleString()," Gems added — this creation still needs ").concat(i.toLocaleString()," more.")});return}(0,d.wB)({title:"Gems Added",message:"".concat(r.toLocaleString()," Gems added — your creation is back in motion.")})}})}},5023:(e,t,r)=>{"use strict";r.d(t,{q:()=>o});var i=r(40201),a=r(23446),n=r(7559);function o(e){var t;let r=e.resolution===i.Vm.RES_1080P;if(e.video){(0,n.O)(e);let t=e.video_duration_s,i=Math.min(t,a.$3);return Math.ceil((r?252:147)*(t+i))}return(e.model_id===a.Y9?e.resolution===i.Vm.RES_480P?63:r?162:126:r?252:147)*Number(null!==(t=e.duration)&&void 0!==t?t:a.im.duration)}},6060:(e,t,r)=>{"use strict";function i(e,t){if("string"!=typeof e)return!1;try{let r=new URL(e);return"".concat(r.protocol,"//").concat(r.host)===t}catch(e){return!1}}r.d(t,{u:()=>i})},6063:(e,t,r)=>{"use strict";r.d(t,{LP:()=>c});var i=r(23915),a=r(93004),n=r(35317),o=r(89473);let s="firebase-client-app",l=(0,i.Dk)().find(e=>e.name===s)||(0,i.Wp)({apiKey:"AIzaSyAzUV2NNUOlLTL04jwmUw9oLhjteuv6Qr4",authDomain:"www.mage.space",projectId:"magedotspace",storageBucket:"magedotspace.appspot.com",messagingSenderId:"816167389238",appId:"1:816167389238:web:a5e9b7798fccb4ca517097",measurementId:"G-DVMP7EP5GH"},s),c=(0,a.xI)(l);(0,n.aU)(l),(0,o.Uz)(l)},6379:(e,t,r)=>{"use strict";r.d(t,{Ne:()=>s,zG:()=>o});var i=r(4717),a=r(56800);let n="flux-kontext-dev",o={architecture:a.qH.FLUX_KONTEXT_DEV,model_id:n,prompt:"",num_inference_steps:28,guidance_scale:3.5,aspect_ratio:i.vW.PORTRAIT},s={architecture:a.qH.FLUX_KONTEXT_DEV,name:"Flux Kontext Dev",short_name:"Kontext Dev",popularity:0,tags:[a.fZ,a.R$,a.Mn],models:[{id:n}],api_path:"/api/v1/flux_kontext_dev",agent:{description:"Image editor. Requires an input image; never pick it without one.",defaultConfig:o,options:{},imageInputs:{references:{field:"image"}},editCapable:!0}}},7019:(e,t,r)=>{"use strict";r.d(t,{BL:()=>l,Rj:()=>o,TP:()=>d,cC:()=>c,iw:()=>s});var i=r(23326),a=r.n(i),n=r(86819);function o(e){var t,r;let i=null!==(t=e.videos)&&void 0!==t?t:[];if(0===i.length)return[];let a=null!==(r=e.video_durations_s)&&void 0!==r?r:[];return a.length!==i.length||a.some(e=>!Number.isFinite(e)||e<=0)?null:a}function s(e){var t;return Number(null!==(t=e.duration)&&void 0!==t?t:n.Rc.duration)}function l(e){let t=o(e);if(null===t)throw Error("Lemon reference videos require a measured duration for every video");return s(e)+a()(t)}function c(e){return e>=n.fA&&e<=n.Ng}function d(e,t){if(e.some(e=>!c(e)))return"Each reference video must be between ".concat(n.fA," and ").concat(n.Ng," seconds long.");let r=a()(e);return r>n.nf?"Reference videos can be at most ".concat(n.nf," seconds combined."):r+t>n.oo?"Reference videos plus the output duration can be at most ".concat(n.oo," seconds. Shorten the videos or choose a shorter duration to continue."):null}},7538:(e,t,r)=>{"use strict";r.d(t,{C$:()=>g,DK:()=>E,GK:()=>p,HW:()=>h,Ii:()=>x,P2:()=>w,QA:()=>v,Qy:()=>R,YX:()=>I,fI:()=>P,jB:()=>y,qj:()=>C,u:()=>T,yQ:()=>m});var i=r(23446),a=r(10140),n=r(9057),o=r(57411),s=r(29728),l=r(59791),c=r(61629),d=r(30458),u=r(56800);let p=["characters","references","audio_references","moodboard"],m=new Set([u.qH.MANGO,u.qH.GUAVA,u.qH.NANO_BANANA_V2,u.qH.CHERRY,u.qH.RASPBERRY,u.qH.GROK_IMAGE,u.qH.GROK_VIDEO,u.qH.BERRY,u.qH.GPT_IMAGE_2,u.qH.MELON,u.qH.PLUM,u.qH.LEMON,u.qH.MINIMAX_H3]),g=new Set([u.qH.MANGO,u.qH.NANO_BANANA_V2]),h=new Set([u.qH.CHERRY,u.qH.BLUEBERRY,u.qH.SEED_AUDIO,u.qH.PLUM,u.qH.LEMON,u.qH.MINIMAX_H3]),f=new Set([u.qH.CHERRY,u.qH.RASPBERRY,u.qH.PLUM,u.qH.LEMON,u.qH.MINIMAX_H3]);function v(e){return f.has(e)}let _={[u.qH.CHERRY]:3,[u.qH.BLUEBERRY]:1,[u.qH.SEED_AUDIO]:c.L0,[u.qH.PLUM]:3,[u.qH.LEMON]:5,[u.qH.MINIMAX_H3]:3};function y(e){var t;return null!==(t=_[e])&&void 0!==t?t:0}let b=new Set([s.yf,s.V,s.ZI,"guava","guava-pro","guava-pro-v1-5","guava-2","guava-2-pro","nano-banana-v2","cherry-mini","cherry","cherry-pro","cherry-2-pro","raspberry",n.Ht,n.Ge,n.Zg,o.MF,"berry",i.Y9,a.z5,a.g$,a.c9,"melon","melon-pro","plum","plum-max","lemon","minimax-h3","minimax-h3-turbo"]),A=new Set([s.yf,l.kQ]),S=new Set(["cherry-mini","cherry","cherry-pro","cherry-2-pro","blueberry","blueberry-v2",d.tC,"plum","plum-max","lemon","minimax-h3","minimax-h3-turbo"]);function x(e){return m.has(e)}function R(e,t){return!!(t&&x(e))&&b.has(t)}let I=R;function C(e,t){return!!t&&!!h.has(e)&&S.has(t)}function w(e){return g.has(e)}function E(e,t){return!!(t&&w(e))&&A.has(t)}function P(e){return 8*(e===s.yf||e===l.kQ)}function T(e,t,r){switch(e){case"characters":return R(t,r);case"references":return I(t,r);case"audio_references":return C(t,r);case"moodboard":return E(t,r)}}},7559:(e,t,r)=>{"use strict";r.d(t,{O:()=>n,Q:()=>a});var i=r(23446);function a(e){return void 0!==e&&Number.isFinite(e)&&e>=i.d6&&e<=i.Tc}function n(e){if(e.model_id!==i.Do)throw Error("Berry video editing only supports the Berry model");if(!a(e.video_duration_s))throw Error("Berry video editing requires a duration between ".concat(i.d6," and ").concat(i.Tc," seconds"))}},7963:(e,t,r)=>{"use strict";r.d(t,{T:()=>u,q:()=>p});var i=r(95155),a=r(37370),n=r(45765),o=r(77567),s=r(58887),l=r(70714),c=r(91423);function d(e){let t=1366-a.jK,r=(e/t*100).toFixed(4),i=(e*a.jK/t).toFixed(4);return"clamp(0px, calc(".concat(r,"vw - ").concat(i,"px), ").concat(e,"px)")}function u(e){c.jQ.open({title:null,children:(0,i.jsx)(s.Text,{children:"Fullscreen modal"}),p:0,fullScreen:!0,zIndex:1100,withCloseButton:!0,styles:{root:{backgroundColor:"#00000000"},inner:{backgroundColor:"#00000000"},content:{backgroundColor:"#00000000"},header:{backgroundColor:"#00000000"},body:{backgroundColor:"#00000000"},close:{color:"white"}},overlayProps:{backgroundOpacity:1},padding:0,...e})}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.02,{styles:r,...u}=e,p=function(){let{isNavbarCollapsed:e,playModeActiveDesktop:t}=o.xV.getState(),r=e?a.s4:a.ID;(0,n.L_)(window.location.pathname)&&(r=0);let i=a.wj;return(t||(0,n.f$)(window.location.pathname))&&(i=0),{paddingLeft:"calc(5vw + ".concat(d(r),")"),paddingRight:"calc(5vw + ".concat(d(i),")")}}();return c.jQ.open({title:null,children:(0,i.jsx)(s.Text,{children:"Modal"}),zIndex:1200,withCloseButton:!1,centered:!0,styles:{root:{backgroundColor:(0,l.B)("black",t),...null==r?void 0:r.root},inner:{backgroundColor:(0,l.B)("black",t),...p,...null==r?void 0:r.inner},content:{backgroundColor:(0,l.B)("black",t),...null==r?void 0:r.content},header:{backgroundColor:(0,l.B)("black",t),...null==r?void 0:r.header},body:{backgroundColor:(0,l.B)("black",t),...null==r?void 0:r.body},close:null==r?void 0:r.close,overlay:null==r?void 0:r.overlay,title:null==r?void 0:r.title},overlayProps:{},...u})}},8399:(e,t,r)=>{"use strict";r.d(t,{U:()=>_,W:()=>f.Wv});var i=r(95155),a=r(94055),n=r(77567),o=r(12115);let s=null,l=new WeakMap;function c(){(null==s?void 0:s.state)==="suspended"&&s.resume()}var d=r(8141),u=r(81001),p=r(70112),m=r(58887),g=r(66623),h=r(51013),f=r(84989);let v="#ffa94d";function _(e){let t,f="fullscreen"===e.variant,_="thumbnail"===e.variant,y=48;f?y=72:_&&(y=12);let b=f?48:30,A=16;f?A=32:_&&(A=2);let S=3,x=2,R=2;_&&(S=1,x=.75,R=.5);let I=(0,o.useId)(),C=(0,o.useRef)(null),w=(0,o.useRef)(null),E=(0,o.useRef)(null),P=(0,o.useRef)(null),T=(0,o.useRef)(null),M=(0,o.useRef)(0),{ensureAnalyser:k,resumeSharedAudioContext:O}=function(){let e=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>{var t;null===(t=e.current)||void 0===t||t.disconnect(),e.current=null},[]),{ensureAnalyser:function(t){return e.current||(e.current=function(e){try{s||(s=new AudioContext);let t=l.get(e);t||(t=s.createMediaElementSource(e),l.set(e,t));let r=s.createAnalyser();return r.fftSize=128,r.smoothingTimeConstant=.82,t.connect(r),r.connect(s.destination),r}catch(e){return null}}(t)),e.current},resumeSharedAudioContext:c}}(),[D,U]=(0,o.useState)(f),[N,H]=(0,o.useState)(!1),[j,L]=(0,o.useState)(!1),[G,q]=(0,o.useState)(e.duration),{playingAudioId:B,setPlayingAudioId:F}=(0,n.VT)("playingAudioId","setPlayingAudioId");(0,o.useEffect)(()=>
1{if(f){U(!0);return}let e=C.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(U(!0),t.disconnect())},{rootMargin:"120px"});return t.observe(e),()=>t.disconnect()},[f]),(0,o.useEffect)(()=>{if(!D||!w.current||!P.current)return;let t=!1,i=null;return r.e(4926).then(r.bind(r,22545)).then(r=>{let{default:a}=r;!t&&w.current&&P.current&&((i=a.create({container:w.current,media:P.current,url:e.src,waveColor:"rgba(255, 255, 255, 0.5)",progressColor:v,barWidth:S,barGap:x,barRadius:R,height:y,cursorWidth:0,normalize:!0,interact:!1})).on("ready",()=>{t||(H(!0),q(e=>(null==i?void 0:i.getDuration())||e))}),T.current=i)}),()=>{t=!0,T.current=null,null==i||i.destroy()}},[x,R,S,D,e.src,y]),(0,o.useEffect)(()=>{let e=E.current,t=P.current;if(!j||!e||!t)return;let r=k(t);if(!r)return;let i=e.getContext("2d");if(!i)return;let a=window.devicePixelRatio||1,n=e.getBoundingClientRect();e.width=n.width*a,e.height=n.height*a,i.scale(a,a);let o=new Uint8Array(r.frequencyBinCount),s=Math.floor(n.width/5),l=()=>{r.getByteFrequencyData(o),i.clearRect(0,0,n.width,n.height);let e=n.height/2;for(let t=0;t<s;t++){let r=Math.abs(t-s/2)/(s/2),a=Math.min(o.length-1,Math.floor(r*(.72*o.length))),l=Math.max(3,o[a]/255*n.height*.92);i.fillStyle=v,i.beginPath(),i.roundRect(5*t,e-l/2,3,l,2),i.fill()}M.current=requestAnimationFrame(l)};return M.current=requestAnimationFrame(l),()=>cancelAnimationFrame(M.current)},[j]),(0,o.useEffect)(()=>{if(j&&B!==I){let t=P.current;if(t){var e;t.pause(),t.currentTime=0,null===(e=T.current)||void 0===e||e.seekTo(0)}}},[B,j,I]),(0,o.useEffect)(()=>()=>{var e;null===(e=P.current)||void 0===e||e.pause()},[]);let V=e.prompt||e.alt;return t=f?{position:"relative",width:"min(720px, calc(100dvw - 32px))",aspectRatio:"1 / 1",borderRadius:"12px",background:a.bT,padding:A,display:"flex",flexDirection:"column",justifyContent:"center",overflow:"hidden",...e.wrapperStyle}:{position:"relative",aspectRatio:"1 / 1",borderRadius:_?"4px":"8px",background:a.bT,padding:A,display:"flex",flexDirection:"column",justifyContent:"center",overflow:"hidden",...e.wrapperStyle},(0,i.jsxs)("div",{className:"CreationAudio",ref:C,style:t,children:[(0,i.jsx)("audio",{ref:P,src:D?e.src:void 0,preload:"metadata",crossOrigin:"anonymous",onLoadedMetadata:e=>q(e.currentTarget.duration),onPlay:()=>L(!0),onPause:()=>L(!1),onEnded:e=>{var t;L(!1),F(null),e.currentTarget.currentTime=0,null===(t=T.current)||void 0===t||t.seekTo(0)},style:{display:"none"}}),(0,i.jsxs)("div",{style:{position:"relative",width:"100%",height:y,pointerEvents:"none"},children:[(0,i.jsx)(d.Center,{style:{position:"absolute",inset:0,opacity:+!N,transition:"opacity 0.25s ease"},children:(0,i.jsx)(g.A,{size:Math.round(.75*y),color:"white",style:{opacity:.5}})}),(0,i.jsx)("div",{ref:w,style:{position:"absolute",inset:0,opacity:N?j?.25:1:0,transition:"opacity 0.25s ease"}}),(0,i.jsx)("canvas",{ref:E,style:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:+!!j,transition:"opacity 0.25s ease",pointerEvents:"none"}})]}),_?null:(0,i.jsx)(u.ActionIcon,{onClick:e=>{e.stopPropagation();let t=P.current;t&&(j?t.pause():(O(),t.play(),F(I)))},"aria-label":j?"Pause audio":"Play audio",radius:"xl",size:b,variant:"transparent",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2},children:j?(0,i.jsx)(h.BXp,{size:b,color:"white",style:{opacity:.8}}):(0,i.jsx)(h.puv,{size:b,color:"white",style:{opacity:.8}})}),_?null:(0,i.jsxs)(p.Group,{justify:"space-between",wrap:"nowrap",gap:"xs",style:{position:"absolute",bottom:f?24:12,left:A,right:A},children:[V?(0,i.jsx)(m.Text,{size:f?"md":"sm",c:"gray.2",lineClamp:f?2:1,style:{minWidth:0},children:V}):(0,i.jsx)("span",{}),(0,i.jsx)(m.Text,{size:f?"md":"sm",c:"gray.4",style:{flexShrink:0},children:function(e){if(void 0===e||!isFinite(e)||e<=0)return"--:--";let t=Math.floor(e/60),r=Math.round(e%60);return"".concat(t,":").concat(r.toString().padStart(2,"0"))}(G)})]})]})}},9057:(e,t,r)=>{"use strict";r.d(t,{Ge:()=>o,Hc:()=>u,Ht:()=>n,Oo:()=>l,YH:()=>c,Zg:()=>s,dO:()=>d});var i=r(56800),a=r(2736);let n="grok-imagine-image",o="grok-imagine-image-quality",s="grok-imagine-image-2.0",l=3,c=200,d={architecture:i.qH.GROK_IMAGE,model_id:a.Gm.QUALITY,prompt:"",grok_image_aspect_ratio:a.oS.ASPECT_RATIO_1_1,resolution:a.pU.RES_1K,qual
1ity:a.kP.MEDIUM},u={architecture:i.qH.GROK_IMAGE,name:"Grok Image",short_name:"Grok Image",popularity:0,tags:[i.R$,i.fZ,i.ij],models:[{id:n,name:"Grok Image"},{id:o,name:"Grok Image Quality"},{id:s,name:"Grok Image 2.0"}],api_path:"/api/v1/grok_image",agent:{description:"General image model.",defaultConfig:d,options:{resolution:Object.values(a.pU)},imageInputs:{references:{field:"image",additionalField:"additional_images"}}}}},9663:(e,t,r)=>{"use strict";r.d(t,{D0:()=>g,IP:()=>m,db:()=>p});var i=r(21078),a=r(56800),n=r(56650),o=r(86819),s=r(58649),l=r(13421),c=r(40350),d=r(20835),u=r(44164);let p=[{id:"minimax-h3-turbo",label:"MiniMax-H3 Turbo",architecture:a.qH.MINIMAX_H3,backendModelId:s.dd},{id:"wan-22-lightning",label:"Wan 2.2 Lightning",architecture:a.qH.WAN_22,backendModelId:d.M},{id:"peach",label:"Peach",architecture:a.qH.PEACH,backendModelId:l.If},{id:"peach-max",label:"Peach Max",architecture:a.qH.PEACH_MAX,backendModelId:c.jI},{id:"kiwi",label:"Kiwi",architecture:a.qH.KIWI,backendModelId:n.XH},{id:"blueberry-v2",label:"Blueberry 2",architecture:a.qH.BLUEBERRY,backendModelId:i.el},{id:"lemon",label:"Lemon",architecture:a.qH.LEMON,backendModelId:o.ib}],m="minimax-h3-turbo";function g(e){return(0,u.ug)(p,e,m)}},9746:(e,t,r)=>{"use strict";r.d(t,{P:()=>a});var i=r(34477);let a=(0,i.createServerReference)("400a751eda767457329e6267dc773990a134da3d21",i.callServer,void 0,i.findSourceMapURL,"getConcept")},10140:(e,t,r)=>{"use strict";r.d(t,{HH:()=>f,Hg:()=>o,JA:()=>h,LS:()=>m,Rq:()=>v,Uo:()=>A,bk:()=>_,c9:()=>c,g$:()=>l,gt:()=>u,iy:()=>y,lS:()=>p,s0:()=>b,z5:()=>s});var i=r(4717),a=r(56800),n=r(27431);let o=15,s="gpt-image-2",l="gpt-image-2.5-flare",c="gpt-image-2.5-sunburst",d=[s,l,c],u={[s]:"GPT Image 2",[l]:"GPT Image 2.5 Flare",[c]:"GPT Image 2.5 Sunburst"};function p(e){return d.includes(e)}let m={[n.K.LOW]:"Low",[n.K.MEDIUM]:"Medium",[n.K.HIGH]:"High",[n.K.XHIGH]:"Extra High",[n.K.MAX]:"Max"},g=[n.K.LOW,n.K.MEDIUM,n.K.HIGH,n.K.XHIGH,n.K.MAX],h={[s]:[n.K.LOW,n.K.MEDIUM,n.K.HIGH],[l]:g,[c]:g};function f(e,t){return h[e].some(e=>e===t)}function v(e,t){if(f(e,t))return t;let r=h[e];return r[r.length-1]}function _(e){if(!p(e.model_id))throw Error("Unknown GPT Image 2 model: ".concat(e.model_id));return e.model_id}function y(e){var t;return{model:_(e),quality:null!==(t=e.quality)&&void 0!==t?t:b.quality}}let b={architecture:a.qH.GPT_IMAGE_2,model_id:s,prompt:"",resolution:n.h.RES_1K,aspect_ratio:i.vW.PORTRAIT,quality:n.K.LOW},A={architecture:a.qH.GPT_IMAGE_2,name:"GPT Image 2",short_name:"GPT Image 2",popularity:0,tags:[a.R$,a.Gm,a.fZ,a.Mn,a.ij],models:d.map(e=>({id:e,name:u[e]})),api_path:"/api/v1/gpt_image_2",agent:{description:"Image model for general generation and input-image edits, offered as GPT Image 2, the faster GPT Image 2.5 Flare, and the premium GPT Image 2.5 Sunburst (best for precise edits).",defaultConfig:b,options:{resolution:Object.values(n.h)},imageInputs:{references:{field:"image",additionalField:"additional_images"}},editCapable:!0}}},10212:(e,t,r)=>{"use strict";r.d(t,{J:()=>a});var i=r(34477);let a=(0,i.createServerReference)("60770cf863351d024004048c0fafc85a8747619bc7",i.callServer,void 0,i.findSourceMapURL,"getActiveUserBan")},10863:(e,t,r)=>{"use strict";r.d(t,{y:()=>c});var i=r(95155),a=r(70112),n=r(58887),o=r(35998),s=r(801),l=r.n(s);function c(e){let{paymentMethod:t}=e;return(0,i.jsxs)(a.Group,{gap:"xs",wrap:"nowrap",children:[(0,i.jsx)(o.A,{size:16,color:"var(--mantine-color-dimmed)"}),(0,i.jsxs)(n.Text,{size:"sm",c:"dimmed",children:[(0,i.jsx)(n.Text,{component:"span",inherit:!0,c:"white",fw:700,children:l()(t.brand)})," ","•••• ",t.last4]})]})}},11552:(e,t,r)=>{"use strict";r.d(t,{L:()=>s});var i=r(95155),a=r(12115),n=r(53934),o=r.n(n);function s(e){let{eventId:t}=e,[r,n]=(0,a.useState)(!1);return(0,i.jsx)("p",{className:o().root,onClick:()=>{var e;
1null===(e=navigator.clipboard)||void 0===e||e.writeText(t).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})},children:r?"Error ID copied":"Error ID: ".concat(t," (tap to copy)")})}},11875:(e,t,r)=>{"use strict";r.d(t,{Gn:()=>d,X9:()=>c,eu:()=>s,mc:()=>l,rA:()=>o,wI:()=>u});var i=r(45151),a=r(68541),n=r(4717);let o=[a.ZL.NSFW,a.ZL.NUDITY,a.ZL.VIOLENCE,a.ZL.SUGGESTIVE,a.ZL.TABOO,a.ZL.SEXUAL,a.ZL.MINORS];function s(e){let t=Object.keys(e.data.moderation.concepts).filter(e=>o.includes(e)),r=n.Uc.G;return e.data.moderation.is_nsfw&&(r=t.includes(a.ZL.SEXUAL)?n.Uc.M_PLUS:n.Uc.M),{rating:r,concepts:t,is_nsfw:e.data.moderation.is_nsfw,is_forbidden:e.data.moderation.is_forbidden}}function l(e){let t=e.filter(e=>o.includes(e)&&e!==a.ZL.MINORS),r=n.Uc.G;return t.length>0&&(r=t.includes(a.ZL.SEXUAL)?n.Uc.M_PLUS:n.Uc.M),{rating:r,concepts:e.map(e=>e),is_nsfw:r===n.Uc.M_PLUS||r===n.Uc.M,is_forbidden:!1}}function c(e){return l(e.moderation)}function d(e,t){if(e.is_forbidden)return!0;if(e.is_nsfw){if((0,i.Ld)(t.rating)||t.rating===n.Uc.M&&e.concepts.includes(a.ZL.NUDITY))return!0;let r=[...t.moderation,...t.moderation.includes(a.ZL.NUDITY)?[a.ZL.SEXUAL]:[]];return e.concepts.filter(e=>!r.includes(e)).length>0}return!1}function u(e,t){return!((0,i.Ld)(t.rating)||t.rating===n.Uc.M&&e.concepts.includes(a.ZL.NUDITY))}},12306:(e,t,r)=>{"use strict";r.d(t,{Mv:()=>u,Tm:()=>l,Zy:()=>d});var i=r(22091),a=r(43050),n=r(86819),o=r(62664),s=r(44164);let l=[o.yS,...o.s1,{...o.PN,label:"Grok Imagine Video"},o.yQ,o.JY,o.zK],c=n.ib;function d(e,t,r,i){return(0,s.EB)(l,e,t,r,i,c)}let u={modelId:c,video:i.gJ,references:[i.a1,i.a1],prompt:"",resolution:a.so.RES_480P,duration:a.yS.DURATION_4S,aspectRatio:a.P4.ASPECT_RATIO_16_9,originalAudio:{berry:!0,cherry:!1}}},12630:(e,t,r)=>{"use strict";r.d(t,{i:()=>o});var i=r(95155),a=r(30804),n=r(58887);function o(e){let{checked:t,onChange:r,disabled:o}=e;return(0,i.jsx)(a.Checkbox,{checked:t,onChange:e=>r(e.currentTarget.checked),disabled:o,color:"orange",size:"sm",label:(0,i.jsx)(n.Text,{size:"xs",c:"dimmed",children:"I verify that I have explicit permission to use this content, including any likeness or voice it contains."})})}},12920:(e,t,r)=>{"use strict";r.d(t,{IH:()=>o,Wk:()=>n});var i=r(4717),a=r(56800);let n={architecture:a.qH.CHROMA,model_id:"chroma-v1-hd",prompt:"",num_inference_steps:40,guidance_scale:3,aspect_ratio:i.vW.PORTRAIT},o={architecture:a.qH.CHROMA,name:"Chroma",short_name:"Chroma",popularity:0,tags:[a.fZ,a.R$],api_path:"/api/v1/chroma",agent:{description:"General image model.",defaultConfig:n,options:{}}}},13286:(e,t,r)=>{"use strict";r.d(t,{Z:()=>b});var i=r(95155),a=r(34477);let n=(0,a.createServerReference)("40c55cf6c270477ed0237c81293234e318290885d1",a.callServer,void 0,a.findSourceMapURL,"getPowerPackStatsById");var o=r(7963),s=r(77567),l=r(18403),c=r(21220),d=r(70112),u=r(93751),p=r(81001),m=r(58887),g=r(18229),h=r(26903),f=r(91423),v=r(54395),_=r(23552);function y(e){let{powerPackStats:t}=e,{isDesktop:r}=(0,s.xV)((0,_.k)(e=>({isDesktop:e.isDesktop}))),a=[{name:"Total Creations",value:t.stats.totalCreations.toString()},{name:"GPU Hours Used",value:"".concat(t.stats.totalUnlimitedHours.toFixed(2),"hr")},{name:"Average Duration",value:"".concat(t.stats.averageDuration.toFixed(1),"s")},{name:"Status",value:t.stats.status.charAt(0).toUpperCase()+t.stats.status.slice(1)}];return(0,i.jsx)(l.Card,{bg:"dark.9",radius:"lg",style:{border:"2px solid var(--mantine-color-gray-6)"},maw:r?600:"94vw",children:(0,i.jsxs)(c.Stack,{gap:"lg",children:[(0,i.jsxs)(d.Group,{justify:"space-between",align:"center",children:[(0,i.jsx)(u.Title,{c:"white",order:2,children:r?"⚡ Power Pack Stats":"⚡ Stats"}),(0,i.jsx)(p.ActionIcon,{variant:"light",color:"gray",size:"lg",onClick:()=>(0,f.s7)(),radius:"xl",children:(0,i.jsx)(v.A,{size:20})})]}),(0,i.jsx)(m.Text,{size:"md",c:"white",children:"The Power Pack was a great success! ⚡ Here's your overview:"}),(0,i.jsx)(g.SimpleGrid,{cols:2,spacing:"xs",children:a.map((e,t)=>(0,i.jsx)(l.Card,{bg:"black",radius:"md",p:"md",children:(0,i.jsxs)(c.Stack,{gap:"xs",align:"center",children:[(0,i.jsx)(m.Text,{size:"sm",c:"dimmed",ta:"center",children:e.name}),(0,i.jsx)(u.Title,{c:"white",order:2,ta:"center",children:e.value})]})},t))}),(0,i.jsxs)(m.Text,{size:"sm",c:"dimmed",children:["ID: ",(0,i.jsx)("b",{children:t.powerPack.id})]}),(0,i.jsx)(h.Button,{size:"xl",onClick:()=>(0,f.s7)(),fullWidth:!0,color:"gray",variant:"light",children:"Close"})]})})}async function b(e){let t=await n(e);t&&(0,o.q)({children:(0,i.jsx)(y,{powerPackStats:t}),closeOnClickOutside:!1})}},13421:(e,t,r)=>{"use strict";r.d(t,{If:()=>n,Xe:()=>o,xw:()=>s});var i=r(56800),a=r(96700);let n="peach",o={architecture:i.qH.PEACH,model_id:n,prompt:"",resolution:a.qQ.RES_480P,peach_aspect_ratio:a.Xn.ASPECT_RATIO_4_3,duration:a.OP.DURATION_5S},s={architecture:i.qH.PEACH,name:"Peach",short_name:"Peach",popularity:7,tags:[i.fZ,i.tM,i.KT],models:[{id:n}],api_path:"/api/v1/peach",agent:{description:"General video model.",defaultConfig:o,options:{resolution:Object.values(a.qQ),duration:Object.values(a.OP)},imageInputs:{firstFrame:"image"}}}},14276:(e,t,r)=>{"use strict";r.d(t,{L:()=>a,c:()=>n});var i=r(61282);function a(e){return e===i.c.BASIC?"Basic":e===i.c.PRO?"Pro":e===i.c.PRO_PLUS?"Pro Plus":e===i.c.MAX?"Max":"Free"}function n(e,t){switch(e){case i.c.FREE:return t===i.c.FREE;case i.c.BASIC:return[i.c.FREE,i.c.BASIC].includes(t);case i.c.PRO:return[i.c.FREE,i.c.BASIC,i.c.PRO].includes(t);case i.c.PRO_PLUS:return[i.c.FREE,i.c.BASIC,i.c.PRO,i.c.PRO_PLUS].includes(t);case i.c.MAX:return[i.c.FREE,i.c.BASIC,i.c.PRO,i.c.PRO_PLUS,i.c.MAX].includes(t);default:return!1}}}
1,14994:(e,t,r)=>{"use strict";r.d(t,{Wn:()=>n,sc:()=>a});var i=r(56800);let a={architecture:i.qH.SELFIE,model_id:"6A35A7855770AE9820A3C931D4964C3817B6D9E3C6F9C4DABB5B3A94E5643B80",prompt:"",negative_prompt:"",num_inference_steps:30,guidance_scale:7,controlnet_conditioning_scale:.8,ip_adapter_scale:.8},n={architecture:i.qH.SELFIE,name:"Selfie",short_name:"Selfie",popularity:0,tags:[i.fZ,i.R$],api_path:"/api/v1/selfie",agent:{description:"Image-to-image portrait model. Requires an input image; never pick it without one.",defaultConfig:a,options:{},imageInputs:{references:{field:"image"}}}}},15483:(e,t,r)=>{"use strict";function i(e){return{id:e.id,name:e.name,username:e.username,image_url:e.image_url,variant:e.variant,modality:"image"}}function a(e){return{id:e.id,name:e.name,username:e.username,image_url:e.image_url,audio_url:e.audio_url,variant:"audio",modality:"audio"}}function n(e){let{id:t,name:r,audioUrl:i}=e;return{id:t,name:r,username:t,image_url:"https://cdn3.mage.space/random/audio-placeholder.jpg",audio_url:i,variant:"audio",modality:"audio"}}r.d(t,{ZO:()=>i,_E:()=>a,rK:()=>n})},16162:(e,t,r)=>{"use strict";r.d(t,{y1:()=>h,Fy:()=>g,em:()=>p});var i,a=r(4717),n=r(27610);let o=JSON.parse('[{"name":"Enhance","prompt":"{prompt}","negative_prompt":"(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)"},{"name":"Semi Realistic","prompt":"{prompt}","negative_prompt":"(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)"},{"name":"Sharp","prompt":"cinematic still {prompt} . emotional, harmonious, vignette, 4k epic detailed, shot on kodak, 35mm photo, sharp focus, high budget, cinemascope, moody, epic, gorgeous, film grain, grainy","negative_prompt":"anime, cartoon, graphic, (blur, blurry, bokeh), text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured"},{"name":"Masterpiece Human","prompt":"(masterpiece), (best quality), (ultra-detailed), {prompt}, illustration, disheveled hair, detailed eyes, perfect composition, moist skin, intricate details, earrings, by wlop","negative_prompt":"longbody, lowres, bad anatomy, bad hands, missing fingers, pubic hair,extra digit, fewer digits, cropped, worst quality, low quality"},{"name":"Photograph","prompt":"photograph {prompt}, 50mm . cinematic 4k epic detailed 4k epic detailed photograph shot on kodak detailed cinematic hbo dark moody, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage","negative_prompt":"Brad Pitt, bokeh, depth of field, blurry, cropped, regular face, saturated, contrast, deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, text, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck"},{"name":"Negative Prompt","prompt":"{prompt}","negative_prompt":"deformed, bad anatomy, disfigured, poorly drawn face, mutated, extra limb, ugly, poorly drawn hands, missing limb, floating limbs, disconnected limbs, disconnected head, malformed hands, long neck, mutated hands and fingers, bad hands, missing fingers, cropped, worst quality, low quality, mutation, poorly drawn, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, missing fingers, fused fingers, abnormal eye proportion, Abnormal hands, abnormal legs, abnormal feet, abnormal fingers, drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly, anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch"},{"name":"Cinematic","prompt":"cinematic still {prompt} . emotional, harmonious, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy","negative_prompt":"anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured"}]'),s=JSON.parse('[{"name":"Cinematic Diva","prompt":"UHD, 8K, ultra detailed, a cinematic photograph of {prompt}, beautiful lighting, great composition","negative_prompt":"ugly, deformed, noisy, blurry, NSFW"},{"name":"Abstract Expressionism","prompt":"Abstract Expressionism Art, {prompt}, High contrast, minimalistic, colorful, stark, dramatic, expressionism","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"},{"name":"Academia","prompt":"Academia, {prompt}, preppy Ivy League style, stark, dramatic, chic boarding school, academia","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, grunge, sloppy, unkempt"},{"name":"Action Figure","prompt":"Action Figure, {prompt}, plastic collectable action figure, collectable toy action figure","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Adorable 3D Character","prompt":"Adorable 3D Character, {prompt}, 3D render, adorable character, 3D art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, grunge, sloppy, unkempt, photograph, photo, realistic"},{"name":"Adorable Kawaii","prompt":"Adorable Kawaii, {prompt}, pretty, cute, adorable, kawaii","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, gothic, dark, moody, monochromatic"},{"name":"Art Deco","prompt":"Art Deco, {prompt}, sleek, geometric forms, art deco style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Art Nouveau","prompt":"Art Nouveau, beautiful art, {prompt}, sleek, organic forms, long, sinuous, art nouveau style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, industrial, mechanical"},{"name":"Astral Aura","prompt":"Astral Aura, {prompt}, astral, colorful aura, vibrant energy","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Avant-garde","prompt":"Avant-garde, {prompt}, unusual, experimental, avant-garde art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Baroque","prompt":"Baroque, {prompt}, dramatic, exuberant, grandeur, baroque art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Bauhaus-Style Poster","prompt":"Bauhaus-Style Poster, {prompt}, simple geometric shapes, clean lines, primary colors, Bauhaus-Style Poster","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Blueprint Schematic Drawing","prompt":"Blueprint Schematic Drawing, {prompt}, technical drawing, blueprint, schematic","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Caricature","prompt":"Caricature, {prompt}, exaggerated, comical, caricature","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realistic"},{"name":"Cel Shaded Art","prompt":"Cel Shaded Art, {prompt}, 2D, flat color, toon shading, cel shaded style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Character Design Sheet","prompt":"Character Design Sheet, {prompt}, character reference sheet, character turn around","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Classicism Art","prompt":"Classicism Art, {prompt}, inspired by Roman and Greek culture, clarity, harmonious, classicism art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Color Field Painting","prompt":"Color Field Painting, {prompt}, abstract, simple, geometic, color field painting style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Colored Pencil Art","prompt":"Colored Pencil Art, {prompt}, colored pencil strokes, light color, visible paper texture, colored pencil art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Conceptual Art","prompt":"Conceptual Art, {prompt}, concept art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Constructivism","prompt":"Constructivism Art, {prompt}, minimalistic, geometric forms, constructivism art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Cubism","prompt":"Cubism Art, {prompt}, flat geometric forms, cubism art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Dadaism","prompt":"Dadaism Art, {prompt}, satirical, nonsensical, dadaism art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Dark Fantasy","prompt":"Dark Fantasy Art, {prompt}, dark, moody, dark fantasy style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, bright, sunny"},{"name":"Dark Moody Atmosphere","prompt":"Dark Moody Atmosphere, {prompt}, dramatic, mysterious, dark moody atmosphere","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, vibrant, colorful, bright"},{"name":"DMT Art Style","prompt":"DMT Art Style, {prompt}
1, bright colors, surreal visuals, swirling patterns, DMT art style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Doodle Art","prompt":"Doodle Art Style, {prompt}, drawing, freeform, swirling patterns, doodle art style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Double Exposure","prompt":"Double Exposure Style, {prompt}, double image ghost effect, image combination, double exposure style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Dripping Paint Splatter Art","prompt":"Dripping Paint Splatter Art, {prompt}, dramatic, paint drips, splatters, dripping paint","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Expressionism","prompt":"Expressionism Art Style, {prompt}, movement, contrast, emotional, exaggerated forms, expressionism art style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Faded Polaroid Photo","prompt":"Faded Polaroid Photo, {prompt}, analog, old faded photo, old polaroid","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, vibrant, colorful"},{"name":"Fauvism","prompt":"Fauvism Art, {prompt}, painterly, bold colors, textured brushwork, fauvism art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Flat 2D Art","prompt":"Flat 2D Art, {prompt}, simple flat color, 2-dimensional, Flat 2D Art Style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, 3D, photo, realistic"},{"name":"Fortnite Art Style","prompt":"Fortnite Art Style, {prompt}, 3D cartoon, colorful, Fortnite Art Style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, photo, realistic"},{"name":"Futurism","prompt":"Futurism Art Style, {prompt}, dynamic, dramatic, Futurism Art Style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Glitchcore","prompt":"Glitchcore Art Style, {prompt}, dynamic, dramatic, distorted, vibrant colors, glitchcore art style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Glo-fi","prompt":"Glo-fi Art Style, {prompt}, dynamic, dramatic, vibrant colors, glo-fi art style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Googie Art Style","prompt":"Googie Art Style, {prompt}, dynamic, dramatic, 1950\'s futurism, bold boomerang angles, Googie art style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Graffiti Art","prompt":"Graffiti Art Style, {prompt}, dynamic, dramatic, vibrant colors, graffiti art style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Harlem Renaissance Art","prompt":"Harlem Renaissance Art Style, {prompt}, dynamic, dramatic, 1920s African American culture, Harlem Renaissance art style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"High Fashion","prompt":"High Fashion, {prompt}, dynamic, dramatic, haute couture, elegant, ornate clothing, High Fashion","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Idyllic","prompt":"Idyllic, {prompt}, peaceful, happy, pleasant, happy, harmonious, picturesque, charming","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Impressionism","prompt":"Impressionism, {prompt}, painterly, small brushstrokes, visible brushstrokes, impressionistic style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Infographic Drawing","prompt":"Infographic Drawing, {prompt}, diagram, infographic","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Ink Dripping Drawing","prompt":"Ink Dripping Drawing, {prompt}, ink drawing, dripping ink","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, colorful, vibrant"},{"name":"Japanese Ink Drawing","prompt":"Japanese Ink Drawing, {prompt}, ink drawing, inkwash, Japanese Ink Drawing","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, colorful, vibrant"},{"name":"Knolling Photography","prompt":"Knolling Photography, {prompt}, flat lay photography, object arrangment, knolling photography","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Light Cheery Atmosphere","prompt":"Light Cheery Atmosphere, {prompt}, happy, joyful, cheerful, carefree, gleeful, lighthearted, pleasant atmosphere","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, monochromatic, dark, moody"},{"name":"Logo Design","prompt":"Logo Design, {prompt}, dynamic graphic art, vector art, minimalist, professional logo design","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Luxurious Elegance","prompt":"Luxurious Elegance, {prompt}, extravagant, ornate, designer, opulent, picturesque, lavish","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Macro Photography","prompt":"Macro Photography, {prompt}, close-up, macro 100mm, macro photography","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Mandola Art","prompt":"Mandola art style, {prompt}, complex, circular design, mandola","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Marker Drawing","prompt":"Marker Drawing, {prompt}, bold marker lines, visibile paper texture, marker drawing","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, photograph, realistic"},{"name":"Medievalism","prompt":"Medievalism, {prompt}, inspired by The Middle Ages, medieval art, elaborate patterns and decoration, Medievalism","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Minimalism","prompt":"Minimalism, {prompt}, abstract, simple geometic shapes, hard edges, sleek contours, Minimalism","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Neo-Baroque","prompt":"Neo-Baroque, {prompt}, ornate and elaborate, dynaimc, Neo-Baroque","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Neo-Byzantine","prompt":"Neo-Byzantine, {prompt}, grand decorative religious style, Orthodox Christian inspired, Neo-Byzantine","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Neo-Futurism","prompt":"Neo-Futurism, {prompt}, high-tech, curves, spirals, flowing lines, idealistic future, Neo-Futurism","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Neo-Impressionism","prompt":"Neo-Impressionism, {prompt}, tiny dabs of color, Pointillism, painterly, Neo-Impressionism","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, photograph, realistic"},{"name":"Neo-Rococo","prompt":"Neo-Rococo, {prompt}, curved forms, naturalistic ornamentation, elaborate, decorative, gaudy, Neo-Rococo","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Neoclassicism","prompt":"Neoclassicism, {prompt}, ancient Rome and Greece inspired, idealic, sober colors, Neoclassicism","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Op Art","prompt":"Op Art, {prompt}, optical illusion, abstract, geometric pattern, impression of movement, Op Art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Ornate and Intricate","prompt":"Ornate and Intricate, {prompt}, decorative, highly detailed, elaborate, ornate, intricate","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Pencil Sketch Drawing","prompt":"Pencil Sketch Drawing, {prompt}, black and white drawing, graphite drawing","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Pop Art 2","prompt":"Pop Art, {prompt}, vivid colors, flat color, 2D, strong lines, Pop Art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, photo, realistic"},{"name":"Rococo","prompt":"Rococo, {prompt}, flamboyant, pastel colors, curved lines, elaborate detail, Rococo","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Silhouette Art","prompt":"Silhouette Art, {prompt}, high contrast, well defined, Silhouette Art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Simple Vector Art","prompt":"Simple Vector Art, {prompt}, 2D flat, simple shapes, minimalistic, professional graphic, flat color, high contrast, Simple Vector Art","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, 3D, photo, realistic"},{"name":"Sketchup","prompt":"Sketchup, {prompt}, CAD, professional design, Sketchup","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, photo, photograph"},{"name":"Steampunk 2","prompt":"Steampunk, {prompt}
1, retrofuturistic science fantasy, steam-powered tech, vintage industry, gears, neo-victorian, steampunk","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Surrealism","prompt":"Surrealism, {prompt}, expressive, dramatic, organic lines and forms, dreamlike and mysterious, Surrealism","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realistic"},{"name":"Suprematism","prompt":"Suprematism, {prompt}, abstract, limited color palette, geometric forms, Suprematism","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realistic"},{"name":"Terragen","prompt":"Terragen, {prompt}, beautiful massive landscape, epic scenery, Terragen","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Tranquil Relaxing Atmosphere","prompt":"Tranquil Relaxing Atmosphere, {prompt}, calming style, soothing colors, peaceful, idealic, Tranquil Relaxing Atmosphere","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, oversaturated"},{"name":"Sticker Designs","prompt":"Vector Art Stickers, {prompt}, professional vector design, sticker designs, Sticker Sheet","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Vibrant Rim Light","prompt":"Vibrant Rim Light, {prompt}, bright rim light, high contrast, bold edge light","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Volumetric Lighting","prompt":"Volumetric Lighting, {prompt}, light depth, dramatic atmospheric lighting, Volumetric Lighting","negative_prompt":"ugly, deformed, noisy, blurry, low contrast"},{"name":"Watercolor 2","prompt":"Watercolor style painting, {prompt}, visible paper texture, colorwash, watercolor","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, photo, realistic"},{"name":"Whimsical and Playful","prompt":"Whimsical and Playful, {prompt}, imaginative, fantastical, bight colors, stylized, happy, Whimsical and Playful","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, drab, boring, moody"}]'),l=JSON.parse('[{"name":"Chromolithography","prompt":"Chromolithograph {prompt}. Vibrant colors, intricate details, rich color saturation, meticulous registration, multi-layered printing, decorative elements, historical charm, artistic reproductions, commercial posters, nostalgic, ornate compositions.","negative_prompt":"monochromatic, simple designs, limited color palette, imprecise registration, minimalistic, modern aesthetic, digital appearance."},{"name":"Cross Processing Print","prompt":"Cross processing print {prompt}. Experimental color shifts, unconventional tonalities, vibrant and surreal hues, heightened contrasts, unpredictable results, artistic unpredictability, retro and vintage feel, dynamic color interplay, abstract and dreamlike.","negative_prompt":"predictable color tones, traditional processing, realistic color representation, subdued contrasts, standard photographic aesthetics."},{"name":"Dufaycolor Photograph","prompt":"Dufaycolor photograph {prompt}. Vintage color palette, distinctive color rendering, soft and dreamy atmosphere, historical charm, unique color process, grainy texture, evocative mood, nostalgic aesthetic, hand-tinted appearance, artistic patina.","negative_prompt":"modern color reproduction, hyperrealistic tones, sharp and clear details, digital precision, contemporary aesthetic."},{"name":"Herbarium","prompt":"Herbarium drawing{prompt}. Botanical accuracy, old botanical book illustration, detailed illustrations, pressed plants, delicate and precise linework, scientific documentation, meticulous presentation, educational purpose, organic compositions, timeless aesthetic, naturalistic beauty.","negative_prompt":"abstract representation, vibrant colors, artistic interpretation, chaotic compositions, fantastical elements, digital appearance."},{"name":"Punk Collage","prompt":"punk collage style {prompt} . mixed media, papercut,textured paper, overlapping, ripped posters, safety pins, chaotic layers, graffiti-style elements, anarchy symbols, vintage photos, cut-and-paste aesthetic, bold typography, distorted images, political messages, urban decay, distressed textures, newspaper clippings, spray paint, rebellious icons, DIY spirit, vivid colors, punk band logos, edgy and raw compositions, ","negative_prompt":"conventional,blurry, noisy, low contrast"},{"name":"Mosaic","prompt":"mosaic style {prompt} . fragmented, assembled, colorful, highly detailed","negative_prompt":"whole, unbroken, monochrome"},{"name":"Van Gogh","prompt":"Oil painting by Van Gogh {prompt} . Expressive, impasto, swirling brushwork, vibrant, brush strokes, Brushstroke-heavy, Textured, Impasto, Colorful, Dynamic, Bold, Distinctive, Vibrant, Whirling, Expressive, Dramatic, Swirling, Layered, Intense, Contrastive, Atmospheric, Luminous, Textural, Evocative, SpiraledVan Gogh style","negative_prompt":"realistic, photorealistic, calm, straight lines, signature, frame, text, watermark"},{"name":"Coloring Book","prompt":"centered black and white high contrast line drawing, coloring book style,{prompt} . monochrome, blank white background","negative_prompt":"greyscale, gradients,shadows,shadow, colored, Red, Blue, Yellow, Green, Orange, Purple, Pink, Brown, Gray, Beige, Turquoise, Lavender, Cyan, Magenta, Olive, Indigo, black background"},{"name":"Singer Sargent","prompt":"Oil painting by John Singer Sargent {prompt}. Elegant, refined, masterful technique,realistic portrayal, subtle play of light, captivating expression, rich details, harmonious colors, skillful composition, brush strokes, chiaroscuro.","negative_prompt":"realistic, photorealistic, abstract, overly stylized, excessive contrasts, distorted,bright colors,disorder."},{"name":"Pollock","prompt":"Oil painting by Jackson Pollock {prompt}. Abstract expressionism, drip painting, chaotic composition, energetic, spontaneous, unconventional technique, dynamic, bold, distinctive, vibrant, intense, expressive, energetic, layered, non-representational, gestural.","negative_prompt":"(realistic:1.5), (photorealistic:1.5), representational, calm, ordered composition, precise lines, detailed forms, subdued colors, quiet, static, traditional, figurative."},{"name":"Basquiat","prompt":"Artwork by Jean-Michel Basquiat {prompt}. Neo-expressionism, street art influence, graffiti-inspired, raw, energetic, bold colors, dynamic composition, chaotic, layered, textural, expressive, spontaneous, distinctive, symbolic,energetic brushstrokes.","negative_prompt":"(realistic:1.5), (photorealistic:1.5), c
1alm, precise lines, conventional composition, subdued"},{"name":"Andy Warhol","prompt":"Artwork in the style of Andy Warhol {prompt}. Pop art, vibrant colors, bold compositions, repetition of iconic imagery, celebrity culture, commercial aesthetics, mass production influence, stylized simplicity, cultural commentary, graphical elements, distinctive portraits.","negative_prompt":"subdued colors, realistic, lack of repetition, minimalistic."},{"name":"Halftone Print","prompt":"Halftone print of {prompt}. Dot matrix pattern, grayscale tones, vintage aesthetic, newspaper print vibe, stylized dots, visual texture, black and white contrasts, retro appearance, artistic pointillism,pop culture, (Roy Lichtenstein style:1.5).","negative_prompt":"smooth gradients, continuous tones, vibrant colors."},{"name":"Gond Painting","prompt":"Gond painting {prompt}. Intricate patterns, vibrant colors, detailed motifs, nature-inspired themes, tribal folklore, fine lines, intricate detailing, storytelling compositions, mystical and folkloric, cultural richness.","negative_prompt":"monochromatic, abstract shapes, minimalistic."},{"name":"Albumen Print","prompt":"Albumen print {prompt}. Sepia tones, fine details, subtle tonal gradations, delicate highlights, vintage aesthetic, soft and muted atmosphere, historical charm, rich textures, meticulous craftsmanship, classic photographic technique, vignetting.","negative_prompt":"vibrant colors, high contrast, modern, digital appearance, sharp details, contemporary style."},{"name":"Aquatint Print","prompt":"Aquatint print {prompt}. Soft tonal gradations, atmospheric effects, velvety textures, rich contrasts, fine details, etching process, delicate lines, nuanced shading, expressive and moody atmosphere, artistic depth.","negative_prompt":"sharp contrasts, bold lines, minimalistic."},{"name":"Anthotype Print","prompt":"Anthotype print {prompt}. Monochrome dye, soft and muted colors, organic textures, ephemeral and delicate appearance, low details, watercolor canvas, low contrast, overexposed, silhouette, textured paper.","negative_prompt":"vibrant synthetic dyes, bold and saturated colors."},{"name":"Inuit Carving","prompt":"A sculpture made of ivory, {prompt} made of . Sculptures, Inuit art style, intricate carvings, natural materials, storytelling motifs, arctic wildlife themes, symbolic representations, cultural traditions, earthy tones, harmonious compositions, spiritual and mythological elements.","negative_prompt":"abstract, vibrant colors."},{"name":"Bromoil Print","prompt":"Bromoil print {prompt}. Painterly effects, sepia tones, textured surfaces, rich contrasts, expressive brushwork, tonal variations, vintage aesthetic, atmospheric mood, handmade quality, artistic experimentation, darkroom craftsmanship, vignetting.","negative_prompt":"smooth surfaces, minimal brushwork, contemporary digital appearance."},{"name":"Calotype Print","prompt":"Calotype print {prompt}. Soft focus, subtle tonal range, paper negative process, fine details, vintage aesthetic, artistic experimentation, atmospheric mood, early photographic charm, handmade quality, vignetting.","negative_prompt":"sharp focus, bold contrasts, modern aesthetic, digital photography."},{"name":"Color Sketchnote","prompt":"Color sketchnote {prompt}. Hand-drawn elements, vibrant colors, visual hierarchy, playful illustrations, varied typography, graphic icons, organic and dynamic layout, personalized touches, creative expression, engaging storytelling.","negative_prompt":"monochromatic, geometric layout."},{"name":"Cibulak Porcelain","prompt":"A sculpture made of blue pattern porcelain of {prompt}. Classic design, blue and white color scheme, intricate detailing, floral motifs, onion-shaped elements, historical charm, rococo, white ware, cobalt blue, underglaze pattern, fine craftsmanship, traditional elegance, delicate patterns, vintage aesthetic, Meissen, Blue Onion pattern, Cibulak.","negative_prompt":"tea, teapot, cup, teacup,bright colors, bold and modern design, absence of intricate detailing, lack of floral motifs, non-traditional shapes."},{"name":"Alcohol Ink Art","prompt":"Alcohol ink art {prompt}. Fluid and vibrant colors, unpredictable patterns, organic textures, translucent layers, abstract compositions, ethereal and dreamy effects, free-flowing movement, expressive brushstrokes, contemporary aesthetic, wet textured paper.","negative_prompt":"monochromatic, controlled patterns."},{"name":"One Line Art","prompt":"One line art {prompt}. Continuous and unbroken black line, minimalistic, simplicity, economical use of space, flowing and dynamic, symbolic representations, contemporary aesthetic, evocative and abstract, white background.","negative_prompt":"disjointed lines, complexity, complex detailing."},{"name":"Blacklight Paint","prompt":"Blacklight paint {prompt}. Fluorescent pigments, vibrant and surreal colors, ethereal glow, otherw
1orldly effects, dynamic and psychedelic compositions, neon aesthetics, transformative in ultraviolet light, contemporary and experimental.","negative_prompt":"muted colors, traditional and realistic compositions."},{"name":"Carnival Glass","prompt":"A sculpture made of Carnival glass, {prompt}. Iridescent surfaces, vibrant colors, intricate patterns, opalescent hues, reflective and prismatic effects, Art Nouveau and Art Deco influences, vintage charm, intricate detailing, lustrous and luminous appearance, Carnival Glass style.","negative_prompt":"non-iridescent surfaces, muted colors, absence of intricate patterns, lack of opalescent hues, modern and minimalist aesthetic."},{"name":"Cyanotype Print","prompt":"Cyanotype print {prompt}. Prussian blue tones, distinctive coloration, high contrast, blueprint aesthetics, atmospheric mood, sun-exposed paper, silhouette effects, delicate details, historical charm, handmade and experimental quality.","negative_prompt":"vibrant colors, low contrast, modern and polished appearance."},{"name":"Cross-Stitching","prompt":"Cross-stitching {prompt}. Intricate patterns, embroidery thread, sewing, fine details, precise stitches, textile artistry, symmetrical designs, varied color palette, traditional and contemporary motifs, handmade and crafted,canvas, nostalgic charm.","negative_prompt":"paper, paint, ink, photography."},{"name":"Encaustic Paint","prompt":"Encaustic paint {prompt}. Textured surfaces, translucent layers, luminous quality, wax medium, rich color saturation, fluid and organic shapes, contemporary and historical influences, mixed media elements, atmospheric depth.","negative_prompt":"flat surfaces, opaque layers, lack of wax medium, muted color palette, absence of textured surfaces, non-mixed media."},{"name":"Embroidery","prompt":"Embroidery {prompt}. Intricate stitching, embroidery thread, fine details, varied thread textures, textile artistry, embellished surfaces, diverse color palette, traditional and contemporary motifs, handmade and crafted, tactile and ornate.","negative_prompt":"minimalist, monochromatic."},{"name":"Gyotaku","prompt":"Gyotaku {prompt}. Fish impressions, realistic details, ink rubbings, textured surfaces, traditional Japanese art form, nature-inspired compositions, artistic representation of marine life, black and white contrasts, cultural significance.","negative_prompt":"photography."},{"name":"Luminogram","prompt":"Luminogram {prompt}. Photogram technique, ethereal and abstract effects, light and shadow interplay, luminous quality, experimental process, direct light exposure, unique and unpredictable results, artistic experimentation.","negative_prompt":""},{"name":"Lite Brite Art","prompt":"Lite Brite art {prompt}. Luminous and colorful designs, pixelated compositions, retro aesthetic, glowing effects, creative patterns, interactive and playful, nostalgic charm, vibrant and dynamic arrangements.","negative_prompt":"monochromatic."},{"name":"Mokume-gane","prompt":"Mokume-gane {prompt}. Wood-grain patterns, mixed metal layers, intricate and organic designs, traditional Japanese metalwork, harmonious color combinations, artisanal craftsmanship, unique and layered textures, cultural and historical significance.","negative_prompt":"uniform metal surfaces."},{"name":"Pebble Art","prompt":"a sculpture made of peebles, {prompt}. Pebble art style,natural materials, textured surfaces, balanced compositions, organic forms, harmonious arrangements, tactile and 3D effects, beach-inspired aesthetic, creative storytelling, artisanal craftsmanship.","negative_prompt":"non-natural materials, lack of textured surfaces, imbalanced compositions, absence of organic forms, non-tactile appearance."},{"name":"Palekh","prompt":"Palekh art {prompt}. Miniature paintings, intricate details, vivid colors, folkloric themes, lacquer finish, storytelling compositions, symbolic elements, Russian folklore influence, cultural and historical significance.","negative_prompt":"large-scale paintings."},{"name":"Suminagashi","prompt":"Suminagashi {prompt}. Floating ink patterns, marbled effects, delicate and ethereal designs, water-based ink, fluid and unpredictable compositions, meditative process, monochromatic or subtle color palette, Japanese artistic tradition.","negative_prompt":"vibrant and bold color palette."},{"name":"Scrimshaw","prompt":"A Scrimshaw engraving of {prompt}. Intricate engravings on a spermwhale\'s teeth, marine motifs, detailed scenes, nautical themes, black and white contrasts, historical craftsmanship, artisanal carving, storytelling compositions, maritime heritage.","negative_prompt":"colorful, modern."},{"name":"Shibori","prompt":"Shibori {prompt}. Textured fabric, intricate patterns, resist-dyeing technique, indigo or vibrant colors, organic and flowing designs, Japanese textile art, cultural tradition, tactile and visual interest.","negative_prompt":"monochromatic."},{"name":"Vitreous Enamel","prompt":"A sculpture made of Vitreous enamel {prompt}. Smooth and glossy surfaces, vibrant colors, glass-like finish, durable and resilient, intricate detailing, traditional and contemporary applications, artistic craftsmanship, jewelry and decorative objects, , Vitreous enamel, colored glass.","negative_prompt":"rough surfaces, muted colors."},{"name":"Ukiyo-e","prompt":"Ukiyo-e {prompt}. Woodblock prints, vibrant colors, intricate details, depictions of landscapes, kabuki actors, beautiful women, cultural scenes, traditional Japanese art, artistic craftsmanship, historical significance.","negative_prompt":"absence of woodblock prints, muted colors, lack of intricate details, non-traditional Japanese themes, absence of cultural scenes."},{"name":"Vintage Airline Poster","prompt":"vintage airline poster {prompt} . classic aviation fonts, pastel colors, elegant aircraft illustrations, scenic destinations, distressed textures, retro travel allure","negative_prompt":"modern fonts, bold colors, hyper-realistic, sleek design"},{"name":"Vintage Travel Poster","prompt":"vintage travel poster {prompt} . retro fonts, muted colors, scenic illustrations, iconic landmarks, distressed textures, nostalgic vibes","negative_prompt":"modern fonts, vibrant colors, hyper-realistic, sleek design"},{"name":"Bauhaus Style","prompt":"Bauhaus-inspired {prompt} . minimalism, geometric precision, primary colors, sans-serif typography, asymmetry, functional design","negative_prompt":"ornate, intricate, excessive detail, complex patterns, serif typography"},{"name":"Afrofuturism","prompt":"Afrofuturism illustration {prompt} . vibrant colors, futuristic elements, cultural symbolism, cosmic imagery, dynamic patterns, empowering narratives","negative_prompt":"monochromatic"},{"name":"Atompunk","prompt":"Atompunk illustation, {prompt} . retro-futuristic, atomic age aesthetics, sleek lines, metallic textures, futuristic technology, optimism, energy","negative_prompt":"organic, natural textures, rustic, dystopian"},{"name":"Constructivism","prompt":"Constructivism {prompt} . geometric abstraction, bold colors, industrial aesthetics, dynamic compositions, utilitarian design, revolutionary spirit","negative_prompt":"organic shapes, muted colors, ornate elements, traditional"},{"name":"Chicano Art","prompt":"Chicano art {prompt} . bold colors, cultural symbolism, muralism, lowrider aesthetics, barrio life, political messages, social activism, Mexico","negative_prompt":"monochromatic, minimalist, mainstream aesthetics"},{"name":"De Stijl","prompt":"De Stijl Art {prompt} . neoplasticism, primary colors, geometric abstraction, horizontal and vertical lines, simplicity, harmony, utopian ideals","negative_prompt":"complex patterns, muted colors, ornate elements, asymmetry"},{"name":"Dayak Art","prompt":"Dayak art sculpture of {prompt} . intricate patterns, nature-inspired motifs, vibrant colors, traditional craftsmanship, cultural symbolism, storytelling","negative_prompt":"minimalist, monochromatic, modern"},{"name":"Fayum Portrait","prompt":"Fayum portrait {prompt} . encaustic painting, realistic facial features, warm earth tones, serene expressions, ancient Egyptian influences","negative_prompt":"abstract, vibrant colors, exaggerated features, modern"},{"name":"Illuminated Manuscript","prompt":"Illuminated manuscript {prompt} . intricate calligraphy, rich colors, detailed illustrations, gold leaf accents, ornate borders, religious, historical, medieval","negative_prompt":"modern typography, minimalist design, monochromatic, abstract themes"},{"name":"Kalighat Painting","prompt":"Kalighat painting {prompt} . bold lines, vibrant colors, narrative storytelling, cultural motifs, flat compositions, expressive characters","negative_prompt":"subdued colors, intricate details, realistic portrayal, modern aesthetics"},{"name":"Madhubani Painting","prompt":"Madhubani painting {prompt} . intricate patterns, vibrant colors, nature-inspired motifs, cultural storytelling, symmetry, folk art aesthetics","negative_prompt":"abstract, muted colors, minimalistic design, modern aesthetics"},{"name":"Pictorialism","prompt":"Pictorialism illustration{prompt} . soft focus, atmospheric effects, artistic interpretation, tonality, muted colors, evocative storytelling","negative_prompt":"sharp focus, high contrast, realistic depiction, vivid colors"},{"name":"Pichwai Painting","prompt":"Pichwai painting {prompt} . intricate detailing, vibrant colors, religious themes, nature motifs, devotional storytelling, gold leaf accents","negative_prompt":"minimalist, subdued colors, abstract design"},{"name":"Patachitra Painting","prompt":"Patachitra painting {prompt} . bold outlines, vibrant colors, intricate detailing, mythological themes, storytelling, traditional craftsmanship","negative_prompt":"subdued colors, minimalistic, abstract, modern aesthetics"},{"name":"Samoan Art Inspired","prompt":"Samoan art-inspired wooden sculpture {prompt} . traditional motifs, natural elements, bold colors, cultural symbolism, storytelling, craftsmanship","negative_prompt":"modern aesthetics, minimalist, abstract"},{"name":"Tlingit Art","prompt":"Tlingit art {prompt} . formline design, natural elements, animal motifs, bold colors, cultural storytelling, traditional craftsmanship, Alaska traditional art, (totem:1.5)","negative_prompt":""},{"name":"Adnate Style","prompt":"Painting by Adnate {prompt}
1 . realistic portraits, street art, large-scale murals, subdued color palette, social narratives","negative_prompt":"abstract, vibrant colors, small-scale art"},{"name":"Ron English Style","prompt":"Painting by Ron English {prompt} . pop-surrealism, cultural subversion, iconic mash-ups, vibrant and bold colors, satirical commentary","negative_prompt":"traditional, monochromatic"},{"name":"Shepard Fairey Style","prompt":"Painting by Shepard Fairey {prompt} . street art, political activism, iconic stencils, bold typography, high contrast, red, black, and white color palette","negative_prompt":"traditional, muted colors"}]'),c=JSON.parse('[{"name":"Cinematic Dynamic","prompt":"epic cinematic shot of dynamic {prompt} in motion. main subject of high budget action movie. raw photo, motion blur. best quality, high resolution","negative_prompt":"static, still, motionless, sluggish. drawing, painting, illustration, rendered. low budget. low quality, low resolution"},{"name":"Spontaneous Picture","prompt":"spontaneous picture of {prompt}, taken by talented amateur. best quality, high resolution. magical moment, natural look. simple but good looking","negative_prompt":"overthinked. low quality, low resolution"},{"name":"Artistic Vision","prompt":"powerful artistic vision of {prompt}. breathtaking masterpiece made by great artist. best quality, high resolution","negative_prompt":"insignificant, flawed, made by bad artist. low quality, low resolution"},{"name":"Dark Dream","prompt":"dark and unsettling dream showing {prompt}. best quality, high resolution. created by genius but depressed mad artist. grim beauty","negative_prompt":"naive, cheerful. comfortable, casual, boring, cliche. low quality, low resolution"},{"name":"Gloomy Art","prompt":"astonishing gloomy art made mainly of shadows and lighting, forming {prompt}. masterful usage of lighting, shadows and chiaroscuro. made by black hearted artist, drawing from darkness. best quality, high resolution","negative_prompt":"low quality, low resolution"},{"name":"Bad Dream","prompt":"picture from really bad dream about terrifying {prompt}, true horror. bone chilling vision. mad world that shouldn\'t exist. best quality, high resolution","negative_prompt":"nice dream, pleasant experience. low quality, low resolution"},{"name":"Underground","prompt":"uncanny caliginous vision of {prompt}, created by remarkable underground artist. best quality, high resolution. raw and brutal art, careless but impressive style. inspired by darkness and chaos","negative_prompt":"photography, mainstream, civilized. low quality, low resolution"},{"name":"Surreal Painting","prompt":"surreal painting representing strange vision of {prompt}. harmonious madness, synergy with chance. unique artstyle, mindbending art, magical surrealism. best quality, high resolution","negative_prompt":"photography, illustration, drawing. realistic, possible. logical, sane. low quality, low resolution"},{"name":"Dynamic Illustration","prompt":"insanely dynamic illustration of {prompt}. best quality, high resolution. crazy artstyle, careless brushstrokes, emotional and fun","negative_prompt":"photography, realistic. static, still, slow, boring. low quality, low resolution"},{"name":"Undead Art","prompt":"long forgotten art created by undead artist illustrating {prompt}, tribute to the death and decay. miserable art of the damned. wretched and decaying world. best quality, high resolution","negative_prompt":"alive, playful, living. low quality, low resolution"},{"name":"Elemental Art","prompt":"art illustrating insane amounts of raging elemental energy turning into {prompt}, avatar of elements. magical surrealism, wizardry. best quality, high resolution","negative_prompt":"photography, realistic, real. low quality, low resolution"},{"name":"Space Art","prompt":"winner of inter galactic art contest illustrating {prompt}, symbol of the interstellar singularity. best quality, high resolution. artstyle previously unseen in the whole galaxy","negative_prompt":"created by human race, low quality, low resolution"},{"name":"Ancient Illustration","prompt":"sublime ancient illustration of {prompt}, predating human civilization. crude and simple, but also surprisingly beautiful artwork, made by genius primeval artist. best quality, high resolution","negative_prompt":"low quality, low resolution"},{"name":"Brave Art","prompt":"brave, shocking, and brutally true art showing {prompt}. inspired by courage and unlimited creativity. truth found in chaos. best quality, high resolution","negative_prompt":"low quality, low resolution"},{"name":"Heroic Fantasy","prompt":"heroic fantasy painting of {prompt}, in the dangerous fantasy world. airbrush over oil on canvas. best quality, high resolution","negative_prompt":"low quality, low resolution"},{"name":"Dark Cyberpunk","prompt":"dark cyberpunk illustration of brutal {prompt} in a world without hope, ruled by ruthless criminal corporations. best quality, high resolution","negative_prompt":"low quality, low resolution"},{"name":"Lyrical Geometry","prompt":"geometric and lyrical abstraction painting presenting {prompt}. oil on metal. best quality, high resolution","negative_prompt":"photography, realistic, drawing, rendered. low quality, low resolution"},{"name":"Sumi-e Symbolic","prompt":"big long brushstrokes of deep black sumi e turning into symbolic painting of {prompt}. master level raw art. best quality, high resolution","negative_prompt":"photography, rendered. low quality, low resolution"},{"name":"Sumi-e Detailed","prompt":"highly detailed black sumi e painting of {prompt}. in depth study of perfection, created by a master. best quality, high resolution","negative_prompt":"low quality, low resolution"},{"name":"Manga","prompt":"manga artwork presenting {prompt}
1. created by japanese manga artist. highly emotional. best quality, high resolution","negative_prompt":"low quality, low resolution"},{"name":"Anime","prompt":"anime artwork illustrating {prompt}. created by japanese anime studio. highly emotional. best quality, high resolution","negative_prompt":"low quality, low resolution"},{"name":"Comic","prompt":"breathtaking illustration from adult comic book presenting {prompt}. fabulous artwork. best quality, high resolution","negative_prompt":"deformed, ugly, low quality, low resolution"}]'),d=JSON.parse('[{"name":"3D Model","prompt":"professional 3d model {prompt} . octane render, highly detailed, volumetric, dramatic lighting","negative_prompt":"ugly, deformed, noisy, low poly, blurry, painting"},{"name":"Analog Film","prompt":"analog film photo {prompt} . faded film, desaturated, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage","negative_prompt":"painting, drawing, illustration, glitch, deformed, mutated, cross eyed, ugly, disfigured"},{"name":"Anime","prompt":"anime artwork {prompt} . anime style, key visual, vibrant, studio anime, highly detailed","negative_prompt":"photo, deformed, black and white, realism, disfigured, low contrast"},{"name":"Cinematic","prompt":"cinematic film still {prompt} . shallow depth of field, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy","negative_prompt":"anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured"},{"name":"Comic Book","prompt":"comic {prompt} . graphic illustration, comic art, graphic novel art, vibrant, highly detailed","negative_prompt":"photograph, deformed, glitch, noisy, realistic, stock photo"},{"name":"Craft Clay","prompt":"play doh style {prompt} . sculpture, clay art, centered composition, Claymation","negative_prompt":"sloppy, messy, grainy, highly detailed, ultra textured, photo"},{"name":"Digital Art","prompt":"concept art {prompt} . digital artwork, illustrative, painterly, matte painting, highly detailed","negative_prompt":"photo, photorealistic, realism, ugly"},{"name":"Enhance","prompt":"breathtaking {prompt} . award winning, professional, highly detailed","negative_prompt":"ugly, deformed, noisy, blurry, distorted, grainy"},{"name":"Fantasy Art","prompt":"ethereal fantasy concept art of  {prompt} . magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy","negative_prompt":"photographic, realistic, realism, 35mm film, dslr, cropped, frame, text, deformed, glitch, noise, noisy, off center, deformed, cross eyed, closed eyes, bad anatomy, ugly, disfigured, sloppy, duplicate, mutated, black and white"},{"name":"Isometric","prompt":"isometric style {prompt} . vibrant, beautiful, crisp, detailed, ultra detailed, intricate","negative_prompt":"deformed, mutated, ugly, disfigured, blur, blurry, noise, noisy, realistic, photographic"},{"name":"Line Art","prompt":"line art drawing {prompt} . professional, sleek, modern, minimalist, graphic, line art, vector graphics","negative_prompt":"anime, photorealistic, 35mm film, deformed, glitch, blurry, noisy, off center, deformed, cross eyed, closed eyes, bad anatomy, ugly, disfigured, mutated, realism, realistic, impressionism, expressionism, oil, acrylic"},{"name":"Lowpoly","prompt":"low poly style {prompt} . low poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition","negative_prompt":"noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo"},{"name":"Neonpunk","prompt":"neonpunk style {prompt} . cyberpunk, vaporwave, neon, vibes, vibrant, stunningly beautiful, crisp, detailed, sleek, ultramodern, magenta highlights, dark purple shadows, high contrast, cinematic, ultra detailed, intricate, professional","negative_prompt":"painting, drawing, illustration, glitch, deformed, mutated, cross eyed, ugly, disfigured"},{"name":"Origami","prompt":"origami style {prompt} . paper art, pleated paper, folded, origami art, pleats, cut and fold, centered composition","negative_prompt":"noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo"},{"name":"Photographic","prompt":"cinematic photo {prompt} . 35mm photograph, film, bokeh, professional, 4k, highly detailed","negative_prompt":"drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly"},{"name":"Pixel Art","prompt":"pixel art {prompt} . low res, blocky, pixel art style, 8 bit graphics","negative_prompt":"sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic"},{"name":"Texture","prompt":"texture {prompt} top down close up","negative_prompt":"ugly, deformed, noisy, blurry"}]'),u=JSON.parse('[{"name":"Advertising","prompt":"advertising poster style {prompt} . Professional, modern, product focused, commercial, eye catching, highly detailed","negative_prompt":"noisy, blurry, amateurish, sloppy, unattractive"},{"name":"Automotive","prompt":"automotive advertisement style {prompt} . sleek, dynamic, professional, commercial, vehicle focused, high resolution, highly detailed","negative_prompt":"noisy, blurry, unattractive, sloppy, unprofessional"},{"name":"Corporate","prompt":"corporate branding style {prompt} . professional, clean, modern, sleek, minimalist, business oriented, highly detailed","negative_prompt":"noisy, blurry, grungy, sloppy, cluttered, disorganized"},{"name":"Fashion Editorial","prompt":"fashion editorial style {prompt}
1 . high fashion, trendy, stylish, editorial, magazine style, professional, highly detailed","negative_prompt":"outdated, blurry, noisy, unattractive, sloppy"},{"name":"Food Photography","prompt":"food photography style {prompt} . appetizing, professional, culinary, high resolution, commercial, highly detailed","negative_prompt":"unappetizing, sloppy, unprofessional, noisy, blurry"},{"name":"Gourmet Food Photography","prompt":"gourmet food photo of {prompt} . soft natural lighting, macro details, vibrant colors, fresh ingredients, glistening textures, bokeh background, styled plating, wooden tabletop, garnished, tantalizing, editorial quality","negative_prompt":"cartoon, anime, sketch, grayscale, dull, overexposed, cluttered, messy plate, deformed"},{"name":"Luxury","prompt":"luxury product style {prompt} . elegant, sophisticated, high end, luxurious, professional, highly detailed","negative_prompt":"cheap, noisy, blurry, unattractive, amateurish"},{"name":"Real Estate","prompt":"real estate photography style {prompt} . professional, inviting, well lit, high resolution, property focused, commercial, highly detailed","negative_prompt":"dark, blurry, unappealing, noisy, unprofessional"},{"name":"Retail","prompt":"retail packaging style {prompt} . vibrant, enticing, commercial, product focused, eye catching, professional, highly detailed","negative_prompt":"noisy, blurry, amateurish, sloppy, unattractive"},{"name":"Abstract","prompt":"abstract style {prompt} . non representational, colors and shapes, expression of feelings, imaginative, highly detailed","negative_prompt":"realistic, photographic, figurative, concrete"},{"name":"Abstract Expressionism","prompt":"abstract expressionist painting {prompt} . energetic brushwork, bold colors, abstract forms, expressive, emotional","negative_prompt":"realistic, photorealistic, low contrast, plain, simple, monochrome"},{"name":"Art Deco","prompt":"art deco style {prompt} . geometric shapes, bold colors, luxurious, elegant, decorative, symmetrical, ornate, detailed","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, modernist, minimalist"},{"name":"Art Nouveau","prompt":"art nouveau style {prompt} . elegant, decorative, curvilinear forms, nature inspired, ornate, detailed","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, modernist, minimalist"},{"name":"Constructivist","prompt":"constructivist style {prompt} . geometric shapes, bold colors, dynamic composition, propaganda art style","negative_prompt":"realistic, photorealistic, low contrast, plain, simple, abstract expressionism"},{"name":"Cubist","prompt":"cubist artwork {prompt} . geometric shapes, abstract, innovative, revolutionary","negative_prompt":"anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"},{"name":"Expressionist","prompt":"expressionist {prompt} . raw, emotional, dynamic, distortion for emotional effect, vibrant, use of unusual colors, detailed","negative_prompt":"realism, symmetry, quiet, calm, photo"},{"name":"Graffiti","prompt":"graffiti style {prompt} . street art, vibrant, urban, detailed, tag, mural","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"},{"name":"Hyperrealism","prompt":"hyperrealistic art {prompt} . extremely high resolution details, photographic, realism pushed to extreme, fine texture, incredibly lifelike","negative_prompt":"simplified, abstract, unrealistic, impressionistic, low resolution"},{"name":"Impressionist","prompt":"impressionist painting {prompt} . loose brushwork, vibrant color, light and shadow play, captures feeling over form","negative_prompt":"anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"},{"name":"Pointillism","prompt":"pointillism style {prompt} . composed entirely of small, distinct dots of color, vibrant, highly detailed","negative_prompt":"line drawing, smooth shading, large color fields, simplistic"},{"name":"Pop Art","prompt":"pop Art style {prompt} . bright colors, bold outlines, popular culture themes, ironic or kitsch","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, minimalist"},{"name":"Psychedelic","prompt":"psychedelic style {prompt} . vibrant colors, swirling patterns, abstract forms, surreal, trippy","negative_prompt":"monochrome, black and white, low contrast, realistic, photorealistic, plain, simple"},{"name":"Renaissance","prompt":"renaissance style {prompt} . realistic, perspective, light and shadow, religious or mythological themes, highly detailed","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, modernist, minimalist, abstract"},{"name":"Steampunk","prompt":"steampunk style {prompt} . antique, mechanical, brass and copper tones, gears, intricate, detailed","negative_prompt":"deformed, glitch, noisy, low contrast, anime, photorealistic"},{"name":"Surrealist","prompt":"surrealist art {prompt} . dreamlike, mysterious, provocative, symbolic, intricate, detailed","negative_prompt":"anime, photorealistic, realistic, deformed, glitch, noisy, low contrast"},{"name":"Typography","prompt":"typographic art {prompt} . stylized, intricate, detailed, artistic, text based","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"},{"name":"Watercolor","prompt":"watercolor painting {prompt} . vibrant, beautiful, painterly, detailed, textural, artistic","negative_prompt":"anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"}
1,{"name":"Biomechanical","prompt":"biomechanical style {prompt} . blend of organic and mechanical elements, futuristic, cybernetic, detailed, intricate","negative_prompt":"natural, rustic, primitive, organic, simplistic"},{"name":"Biomechanical cyberpunk","prompt":"biomechanical cyberpunk {prompt} . cybernetics, human machine fusion, dystopian, organic meets artificial, dark, intricate, highly detailed","negative_prompt":"natural, colorful, deformed, sketch, low contrast, watercolor"},{"name":"Cybernetic","prompt":"cybernetic style {prompt} . futuristic, technological, cybernetic enhancements, robotics, artificial intelligence themes","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, historical, medieval"},{"name":"Cybernetic robot","prompt":"cybernetic robot {prompt} . android, AI, machine, metal, wires, tech, futuristic, highly detailed","negative_prompt":"organic, natural, human, sketch, watercolor, low contrast"},{"name":"Cyberpunk cityscape","prompt":"cyberpunk cityscape {prompt} . neon lights, dark alleys, skyscrapers, futuristic, vibrant colors, high contrast, highly detailed","negative_prompt":"natural, rural, deformed, low contrast, black and white, sketch, watercolor"},{"name":"Futuristic","prompt":"futuristic style {prompt} . sleek, modern, ultramodern, high tech, detailed","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, vintage, antique"},{"name":"Futuristic Retro Cyberpunk","prompt":"retro cyberpunk {prompt} . 80\'s inspired, synthwave, neon, vibrant, detailed, retro futurism","negative_prompt":"modern, desaturated, black and white, realism, low contrast"},{"name":"Futuristic Retro Futurism","prompt":"retro futuristic {prompt} . vintage sci fi, 50s and 60s style, atomic age, vibrant, highly detailed","negative_prompt":"contemporary, realistic, rustic, primitive"},{"name":"Futuristic Sci-fi","prompt":"sci fi style {prompt} . futuristic, technological, alien worlds, space themes, advanced civilizations","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, historical, medieval"},{"name":"Futuristic Vaporwave","prompt":"vaporwave style {prompt} . retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed","negative_prompt":"monochrome, muted colors, realism, rustic, minimalist, dark"},{"name":"Bubble Bobble","prompt":"Bubble Bobble style {prompt} . 8 bit, cute, pixelated, fantasy, vibrant, reminiscent of Bubble Bobble game","negative_prompt":"realistic, modern, photorealistic, violent, horror"},{"name":"Cyberpunk Game","prompt":"cyberpunk game style {prompt} . neon, dystopian, futuristic, digital, vibrant, detailed, high contrast, reminiscent of cyberpunk genre video games","negative_prompt":"historical, natural, rustic, low detailed"},{"name":"Fighting game","prompt":"fighting game style {prompt} . dynamic, vibrant, action packed, detailed character design, reminiscent of fighting video games","negative_prompt":"peaceful, calm, minimalist, photorealistic"},{"name":"GTA","prompt":"GTA style artwork {prompt} . satirical, exaggerated, pop art style, vibrant colors, iconic characters, action packed","negative_prompt":"realistic, black and white, low contrast, impressionist, cubist, noisy, blurry, deformed"},{"name":"Mario","prompt":"Super Mario style {prompt} . vibrant, cute, cartoony, fantasy, playful, reminiscent of Super Mario series","negative_prompt":"realistic, modern, horror, dystopian, violent"},{"name":"Minecraft","prompt":"Minecraft style {prompt} . blocky, pixelated, vibrant colors, recognizable characters and objects, game assets","negative_prompt":"smooth, realistic, detailed, photorealistic, noise, blurry, deformed"},{"name":"Pokemon","prompt":"Pok\xe9mon style {prompt} . vibrant, cute, anime, fantasy, reminiscent of Pok\xe9mon series","negative_prompt":"realistic, modern, horror, dystopian, violent"},{"name":"Retro Arcade","prompt":"retro arcade style {prompt} . 8 bit, pixelated, vibrant, classic video game, old school gaming, reminiscent of 80s and 90s arcade games","negative_prompt":"modern, ultra high resolution, photorealistic, 3D"},{"name":"Retro Game","prompt":"retro game art {prompt} . 16 bit, vibrant colors, pixelated, nostalgic, charming, fun","negative_prompt":"realistic, photorealistic, 35mm film, deformed, glitch, low contrast, noisy"},{"name":"RPG Fantasy Game","prompt":"role playing game (RPG) style fantasy {prompt} . detailed, vibrant, immersive, reminiscent of high fantasy RPG games","negative_prompt":"sci fi, modern, urban, futuristic, low detailed"},{"name":"Strategy Game","prompt":"strategy game style {prompt} . overhead view, detailed map, units, reminiscent of real time strategy video games","negative_prompt":"first person view, modern, photorealistic"},{"name":"Streetfighter","prompt":"Street Fighter style {prompt} . vibrant, dynamic, arcade, 2D fighting game, highly detailed, reminiscent of Street Fighter series","negative_prompt":"3D, realistic, modern, photorealistic, turn based strategy"},{"name":"Zelda","prompt":"Legend of Zelda style {prompt} . vibrant, fantasy, detailed, epic, heroic, reminiscent of The Legend of Zelda series","negative_prompt":"sci fi, modern, realistic, horror"},{"name":"Architectural","prompt":"architectural style {prompt} . clean lines, geometric shapes, minimalist, modern, architectural drawing, highly detailed","negative_prompt":"curved lines, ornate, baroque, abstract, grunge"},{"name":"Disco","prompt":"disco themed {prompt} . vibrant, groovy, retro 70s style, shiny disco balls, neon lights, dance floor, highly detailed","negative_prompt":"minimalist, rustic, monochrome, contemporary, simplistic"},{"name":"Dreamscape","prompt":"dreamscape {prompt} . surreal, ethereal, dreamy, mysterious, fantasy, highly detailed","negative_prompt":"realistic, concrete, ordinary, mundane"},{"name":"Dystopian","prompt":"dystopian style {prompt} . bleak, post apocalyptic, somber, dramatic, highly detailed","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, cheerful, optimistic, vibrant, colorful"},{"name":"Fairy Tale","prompt":"fairy tale {prompt} . magical, fantastical, enchanting, storybook style, highly detailed","negative_prompt":"realistic, modern, ordinary, mundane"},{"name":"Gothic","prompt":"gothic style {prompt} . dark, mysterious, haunting, dramatic, ornate, detailed","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, cheerful, optimistic"},{"name":"Grunge","prompt":"grunge style {prompt} . textured, distressed, vintage, edgy, punk rock vibe, dirty, noisy","negative_prompt":"smooth, clean, minimalist, sleek, modern, photorealistic"},{"name":"Horror","prompt":"horror themed {prompt} . eerie, unsettling, dark, spooky, suspenseful, grim, highly detailed","negative_prompt":"cheerful, bright, vibrant, light hearted, cute"},{"name":"Kawaii","prompt":"kawaii style {prompt} . cute, adorable, brightly colored, cheerful, anime influence, highly detailed","negative_prompt":"dark, scary, realistic, monochrome, abstract"}
1,{"name":"Lovecraftian","prompt":"lovecraftian horror {prompt} . eldritch, cosmic horror, unknown, mysterious, surreal, highly detailed","negative_prompt":"light hearted, mundane, familiar, simplistic, realistic"},{"name":"Macabre","prompt":"macabre style {prompt} . dark, gothic, grim, haunting, highly detailed","negative_prompt":"bright, cheerful, light hearted, cartoonish, cute"},{"name":"Manga","prompt":"manga style {prompt} . vibrant, high energy, detailed, iconic, Japanese comic style","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, Western comic style"},{"name":"Metropolis","prompt":"metropolis themed {prompt} . urban, cityscape, skyscrapers, modern, futuristic, highly detailed","negative_prompt":"rural, natural, rustic, historical, simple"},{"name":"Minimalist","prompt":"minimalist style {prompt} . simple, clean, uncluttered, modern, elegant","negative_prompt":"ornate, complicated, highly detailed, cluttered, disordered, messy, noisy"},{"name":"Monochrome","prompt":"monochrome {prompt} . black and white, contrast, tone, texture, detailed","negative_prompt":"colorful, vibrant, noisy, blurry, deformed"},{"name":"Nautical","prompt":"nautical themed {prompt} . sea, ocean, ships, maritime, beach, marine life, highly detailed","negative_prompt":"landlocked, desert, mountains, urban, rustic"},{"name":"Space","prompt":"space themed {prompt} . cosmic, celestial, stars, galaxies, nebulas, planets, science fiction, highly detailed","negative_prompt":"earthly, mundane, ground based, realism"},{"name":"Stained glass","prompt":"stained glass style {prompt} . vibrant, beautiful, translucent, intricate, detailed","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"},{"name":"Techwear fashion","prompt":"techwear fashion {prompt} . futuristic, cyberpunk, urban, tactical, sleek, dark, highly detailed","negative_prompt":"vintage, rural, colorful, low contrast, realism, sketch, watercolor"},{"name":"Tribal","prompt":"tribal style {prompt} . indigenous, ethnic, traditional patterns, bold, natural colors, highly detailed","negative_prompt":"modern, futuristic, minimalist, pastel"},{"name":"Zentangle","prompt":"zentangle {prompt} . intricate, abstract, monochrome, patterns, meditative, highly detailed","negative_prompt":"colorful, representative, simplistic, large fields of color"},{"name":"Collage","prompt":"collage style {prompt} . mixed media, layered, textural, detailed, artistic","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic"},{"name":"Flat Papercut","prompt":"flat papercut style {prompt} . silhouette, clean cuts, paper, sharp edges, minimalist, color block","negative_prompt":"3D, high detail, noise, grainy, blurry, painting, drawing, photo, disfigured"},{"name":"Kirigami","prompt":"kirigami representation of {prompt} . 3D, paper folding, paper cutting, Japanese, intricate, symmetrical, precision, clean lines","negative_prompt":"painting, drawing, 2D, noisy, blurry, deformed"},{"name":"Paper Mache","prompt":"paper mache representation of {prompt} . 3D, sculptural, textured, handmade, vibrant, fun","negative_prompt":"2D, flat, photo, sketch, digital art, deformed, noisy, blurry"},{"name":"Paper Guilling","prompt":"paper quilling art of {prompt} . intricate, delicate, curling, rolling, shaping, coiling, loops, 3D, dimensional, ornamental","negative_prompt":"photo, painting, drawing, 2D, flat, deformed, noisy, blurry"},{"name":"Papercut Collage","prompt":"papercut collage of {prompt} . mixed media, textured paper, overlapping, asymmetrical, abstract, vibrant","negative_prompt":"photo, 3D, realistic, drawing, painting, high detail, disfigured"},{"name":"Papercut Shadow Box","prompt":"3D papercut shadow box of {prompt} . layered, dimensional, depth, silhouette, shadow, papercut, handmade, high contrast","negative_prompt":"painting, drawing, photo, 2D, flat, high detail, blurry, noisy, disfigured"},{"name":"Stacked Papercut","prompt":"stacked papercut art of {prompt} . 3D, layered, dimensional, depth, precision cut, stacked layers, papercut, high contrast","negative_prompt":"2D, flat, noisy, blurry, painting, drawing, photo, deformed"},{"name":"Thick Layered Papercut","prompt":"thick layered papercut art of {prompt} . deep 3D, volumetric, dimensional, depth, thick paper, high stack, heavy texture, tangible layers","negative_prompt":"2D, flat, thin paper, low stack, smooth texture, painting, drawing, photo, deformed"},{"name":"Alien","prompt":"alien themed {prompt}
1 . extraterrestrial, cosmic, otherworldly, mysterious, sci fi, highly detailed","negative_prompt":"earthly, mundane, common, realistic, simple"},{"name":"Film Noir","prompt":"film noir style {prompt} . monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, vibrant, colorful"},{"name":"Glamour","prompt":"glamorous photo {prompt} . high fashion, luxurious, extravagant, stylish, sensual, opulent, elegance, stunning beauty, professional, high contrast, detailed","negative_prompt":"ugly, deformed, noisy, blurry, distorted, grainy, sketch, low contrast, dull, plain, modest"},{"name":"HDR","prompt":"HDR photo of {prompt} . High dynamic range, vivid, rich details, clear shadows and highlights, realistic, intense, enhanced contrast, highly detailed","negative_prompt":"flat, low contrast, oversaturated, underexposed, overexposed, blurred, noisy"},{"name":"iPhone Photographic","prompt":"iphone photo {prompt} . large depth of field, deep depth of field, highly detailed","negative_prompt":"drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly, shallow depth of field, bokeh"},{"name":"Long Exposure","prompt":"long exposure photo of {prompt} . Blurred motion, streaks of light, surreal, dreamy, ghosting effect, highly detailed","negative_prompt":"static, noisy, deformed, shaky, abrupt, flat, low contrast"},{"name":"Neon Noir","prompt":"neon noir {prompt} . cyberpunk, dark, rainy streets, neon signs, high contrast, low light, vibrant, highly detailed","negative_prompt":"bright, sunny, daytime, low contrast, black and white, sketch, watercolor"},{"name":"Silhouette","prompt":"silhouette style {prompt} . high contrast, minimalistic, black and white, stark, dramatic","negative_prompt":"ugly, deformed, noisy, blurry, low contrast, color, realism, photorealistic"},{"name":"Tilt Shift","prompt":"tilt shift photo of {prompt} . selective focus, miniature effect, blurred background, highly detailed, vibrant, perspective control","negative_prompt":"blurry, noisy, deformed, flat, low contrast, unrealistic, oversaturated, underexposed"}]');function p(e,t){return{...e,id:(0,n.F)({prompt:e.prompt,negative_prompt:e.negative_prompt}),pack:t}}function m(e,t){return e.map(e=>p(e,t)).sort((e,t)=>e.name.localeCompare(t.name))}let g=new Map([[a.Xb.CUSTOM,m([{name:"Empty",prompt:"{prompt}",negative_prompt:""}],a.Xb.CUSTOM)],[a.Xb.BASIC,m(o,a.Xb.BASIC)],[a.Xb.CUSTOM_1,m(s,a.Xb.CUSTOM_1)],[a.Xb.CUSTOM_2,m(l,a.Xb.CUSTOM_2)],[a.Xb.CUSTOM_3,m(c,a.Xb.CUSTOM_3)],[a.Xb.CUSTOM_4,m(d,a.Xb.CUSTOM_4)],[a.Xb.CUSTOM_5,m(u,a.Xb.CUSTOM_5)]]),h=null===(i=g.get(a.Xb.CUSTOM))||void 0===i?void 0:i.find(e=>"Empty"===e.name)},16603:(e,t,r)=>{"use strict";function i(e,t){if(t)return e.members.find(e=>e.uid===t)}function a(e,t){var r;return(null===(r=i(e,t))||void 0===r?void 0:r.pending)===!0}function n(e,t){var r;return(null===(r=i(e,t))||void 0===r?void 0:r.muted)===!0}function o(e,t){var r;let a=null===(r=i(e,t))||void 0===r?void 0:r.deleted_at;return!!a&&new Date(e.last_message_at).getTime()<=new Date(a).getTime()}function s(e,t){var r;let a=null===(r=i(e,t))||void 0===r?void 0:r.cleared_at;return!!a&&!!e.last_message&&new Date(e.last_message.created_at).getTime()<=new Date(a).getTime()}function l(e,t){return function(e,t){let r=0;for(let i of e)a(i,t)||n(i,t)||o(i,t)||(r+=i.unread_count);return r}(e,t)+e.filter(e=>a(e,t)&&!o(e,t)).length}r.d(t,{L_:()=>i,Rf:()=>n,eO:()=>s,hq:()=>l,kt:()=>o,lw:()=>a})},16791:(e,t,r)=>{"use strict";r.d(t,{bA:()=>p,p6:()=>u,wB:()=>d});var i=r(95155),a=r(11552),n=r(83315),o=r(32389),s=r(30699),l=r(69359);function c(e){return t=>{var r;t.target instanceof Element&&t.target.closest("button")||null===(r=e.onClick)||void 0===r||r.call(e)}}function d(e){var t,r,a,n;(0,o.Ds)({title:null!==(t=e.title)&&void 0!==t?t:"Great Success",message:null!==(r=e.message)&&void 0!==r?r:"",color:null!==(a=e.color)&&void 0!==a?a:"orange",autoClose:e.autoClose,icon:null!==(n=e.icon)&&void 0!==n?n:(0,i.jsx)(s.A,{}),onClick:c(e),styles:e.styles,id:e.id})}function u(e){var t,r,s,c,d;let u=null!==(t=e.message)&&void 0!==t?t:"",p=e.autoClose;if(void 0!==e.error){let t=(0,n.iZ)(e.error);null!==t&&(u=(0,i.jsxs)(i.Fragment,{children:[u,(0,i.jsx)(a.L,{eventId:t})]}),p=null!==(r=e.autoClose)&&void 0!==r&&r)}(0,o.Ds)({title:null!==(s=e.title)&&void 0!==s?s:"Hmm, something's not right",message:u,color:null!==(c=e.color)&&void 0!==c?c:"red",autoClose:p,icon:null!==(d=e.icon)&&void 0!==d?d:(0,i.jsx)(l.A,{}),id:e.id})}function p(e){var t,r,a,n;(0,o.Ds)({title:null!==(t=e.title)&&void 0!==t?t:"Info Alert",message:null!==(r=e.message)&&void 0!==r?r:"",color:null!==(a=e.color)&&void 0!==a?a:"black",autoClose:e.autoClose,icon:null!==(n=e.icon)&&void 0!==n?n:(0,i.jsx)(l.A,{}),onClick:c(e),id:e.id})}},17157:(e,t,r)=>{"use strict";r.d(t,{$f:()=>o,J_:()=>h,L9:()=>f,LP:()=>b,NB:()=>c,O:()=>v,OH:()=>s,PE:()=>y,TF:()=>I,WC:()=>p,XK:()=>S,YM:()=>x,cR:()=>A,m7:()=>_,pl:()=>m,rw:()=>w,tp:()=>l,wu:()=>R,zo:()=>g});var i=r(56800),a=r(7538),n=r(20036);let o="cherry-2-pro",s={[n.$x.CHERRY_MINI]:[n.AU.RESOLUTION_480P,n.AU.RESOLUTION_720P],[n.$x.CHERRY]:[n.AU.RESOLUTION_480P,n.AU.RESOLUTION_720P],[n.$x.CHERRY_PRO]:[n.AU.RESOLUTION_480P,n.AU.RESOLUTION_720P,n.AU.RESOLUTION_1080P,n.AU.RESOLUTION_4K],[n.$x.CHERRY_2_PRO]:[n.AU.RESOLUTION_480P,n.AU.RESOLUTION_720P,n.AU.RESOLUTION_1080P]};function l(e,t){return s[e].some(e=>e===t)}function c(e,t){if(l(e,t))return t;let r=s[e];return r[r.length-1]}let d=[n.sr.DURATION_4S,n.sr.DURATION_5S,n.sr.DURATION_8S,n.sr.DURATION_10S,n.sr.DURATION_15S],u=[...d,n.sr.DURATION_20S,n.sr.DURATION_25S,n.sr.DURATION_30S],p={[n.$x.CHERRY_MINI]:d,[n.$x.CHERRY]:d,[n.$x.CHERRY_PRO]:d,[n.$x.CHERRY_2_PRO]:u},m=u,g=[n.lr.ASPECT_RATIO_16_9,n.lr.ASPECT_RATIO_9_16,n.lr.ASPECT_RATIO_1_1];function h(e,t){return p[e].some(e=>e===t)}function f(e,t){if(h(e,t))return t;let r=p[e];return r[r.length-1]}let v=2,_=15,y=4,b=30,A=8,S=50,x={[n.$x.CHERRY_MINI]:A,[n.$x.CHERRY]:A,[n.$x.CHERRY_PRO]:A,[n.$x.CHERRY_2_PRO]:S},R=(0,a.jB)(i.qH.CHERRY),I={architecture:i.qH.CHERRY,model_id:n.$x.CHERRY,prompt:"",cherry_aspect_ratio:n.lr.ASPECT_RATIO_16_9,duration:n.sr.DURATION_4S,resolution:n.AU.RESOLUTION_480P},C={...I,model_id:n.$x.CHERRY_PRO,use_character_voices:!0},w={architecture:i.qH.CHERRY,name:"Cherry",short_name:"Cherry",popularity:0,tags:[i.fZ,i.tM],models:[{id:"cherry-mini",name:"Cherry Mini"},{id:"cherry",name:"Cherry"}
1,{id:"cherry-pro",name:"Cherry Pro"},{id:o,name:"Cherry 2 Pro"}],api_path:"/api/v1/cherry",agent:{description:"General video model. The default for videos unless the user asks for another model.",defaultConfig:C,options:{byModel:Object.fromEntries(Object.values(n.$x).map(e=>[e,{resolution:[...s[e]],duration:[...p[e]]}]))},imageInputs:{references:{field:"image",additionalField:"additional_images"}},videoSource:{field:"videos",durationClaim:"video_duration_s"}}}},17221:(e,t,r)=>{"use strict";r.d(t,{$Q:()=>p,nQ:()=>d,vV:()=>u});var i=r(21078),a=r(20036),n=r(17157),o=r(43050),s=r(86819),l=r(84563),c=r(83880);let d={imageUrl:null,character:void 0},u={url:null,durationSeconds:0},p={modelId:c.dF,subject:d,audio:u,prompt:"",plumResolution:c.ZW[c.dF][0],plumDuration:c.vO[c.dF][0],plumAspectRatio:l.cU.ASPECT_RATIO_9_16,lemonResolution:s.Rc.resolution,lemonDuration:s.Rc.duration,lemonAspectRatio:o.P4.ASPECT_RATIO_9_16,cherryResolution:n.TF.resolution,cherryDuration:n.TF.duration,cherryAspectRatio:a.lr.ASPECT_RATIO_9_16,blueberryResolution:i.Wc.resolution,blueberryDuration:i.Wc.duration}},18110:(e,t,r)=>{"use strict";r.d(t,{h:()=>m});var i=r(95155),a=r(67457),n=r(61282),o=r(77567),s=r(41441),l=r(16791),c=r(96089),d=r(12115),u=r(23552),p=r(42840);function m(e){let{style:t,buttonText:r}=e,[m,g]=(0,d.useState)(!1),{userMembership:h,user:f}=(0,o.xV)((0,u.k)(e=>({userMembership:e.userMembership,user:e.user}))),v=h===n.c.PRO_PLUS,_=(0,a.Ou)(n.c.PRO_PLUS);return(0,i.jsx)(p.M,{title:_.title,price:_.monthlyPriceUsd,features:_.features,isCurrentPlan:v,onSelect:()=>{(0,c.M3)()&&f&&(h===n.c.FREE?(g(!0),(0,s.m)(n.c.PRO_PLUS).then(e=>{window.location.assign(e)}).catch(e=>{g(!1),console.error("Error checking out",e),(0,l.p6)({title:"Checkout Issue",message:"We had an issue redirecting you. Try again?"})})):h===n.c.PRO_PLUS?(0,l.bA)({title:"Already Subscribed!",message:"You are already a Pro Plus member. Congrats!"}):(g(!0),(0,s.e)().then(e=>{window.location.assign(e)}).catch(e=>{g(!1),console.error("Error redirection to portal",e),(0,l.p6)({title:"Checkout Issue",message:"We had an issue redirecting you. Try again?"})})))},backgroundImage:_.backgroundImage,loading:m,style:t,buttonText:r})}},18683:(e,t,r)=>{"use strict";r.d(t,{d:()=>i,z:()=>a});var i=function(e){return e.RES_1K="1K",e.RES_2K="2K",e.RES_3K="3K",e.RES_4K="4K",e}({}),a=function(e){return e.STANDARD="standard",e.FAST="fast",e.OFF="off",e}({})},19063:(e,t,r)=>{"use strict";r.d(t,{n0:()=>j,Ue:()=>N,T8:()=>U});var i=r(95155),a=r(33508),n=r(34477);let o=(0,n.createServerReference)("4041a2d37eafcb2fafba54ef5ddffede7a84946879",n.callServer,void 0,n.findSourceMapURL,"updateCreations");var s=r(95279),l=r(39686),c=r(77567),d=r(7963),u=r(16791),p=r(18403),m=r(70112),g=r(69604),h=r(58887),f=r(95642),v=r(21220),_=r(93751),y=r(8593),b=r(83347),A=r(26903),S=r(91423),x=r(30699),R=r(755),I=r(22439),C=r(24108),w=r.n(C),E=r(23746),P=r.n(E),T=r(12115);let M=e=>{let{name:t,count:r,isSelected:a,onToggle:n,action:o="add"}=e;return(0,i.jsx)(p.Card,{padding:0,radius:"md",bg:"transparent",style:{cursor:"delete"===o?"default":"pointer",borderColor:"rgba(255, 255, 255, 0.1)"},onClick:"delete"===o?void 0:n,children:(0,i.jsxs)(m.Group,{justify:"space-between",align:"center",children:[(0,i.jsxs)(g.Box,{children:[(0,i.jsx)(h.Text,{size:"sm",c:"white",fw:500,children:t}),(0,i.jsxs)(h.Text,{size:"xs",c:"dimmed",children:[r," saved \xb7 private"]})]}),(0,i.jsx)(g.Box,{bg:"add"===o?a?"orange.7":"white":"red.7",w:"add"===o?24:"auto",h:"add"===o?24:"auto",style:{backgroundColor:"add"===o?a?"orange.7":"white":"red.7",width:"add"===o?"24px":"auto",height:"add"===o?"24px":"auto",borderRadius:"6px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onClick:"delete"===o?n:void 0,children:a?(0,i.jsx)(x.A,{size:"16px",stroke:2.5,color:"white"}):"add"===o?(0,i.jsx)(R.A,{size:"16px",stroke:2.5,color:"black"}):(0,i.jsx)(h.Text,{size:"sm",fw:500,c:"white",px:"xs",py:4,children:"Delete"})})]})})},k=()=>(0,i.jsx)(g.Box,{bg:"black",w:34,h:34,display:"flex",align:"center",justify:"center",style:{borderRadius:"50%"},children:(0,i.jsx)(f.CloseButton,{onClick:()=>(0,S.s7)(),"aria-label":"Close modal",color:"white",style:{height:"100%",width:"100%",fontSize:"16px",fontWeight:"bold"}})});function O(e){let{creationIds:t,onComplete:r}=e,{settings:{profile_collections:n},tagCounts:s,user:l,refreshTagCounts:d}=(0,c.VT)("settings","tagCounts","user","refreshTagCounts"),[h,f]=(0,T.useState)([]),[x,R]=(0,T.useState)(""),[C,E]=(0,T.useState)(!1),[O,D]=(0,T.useState)([]),[U,N]=(0,T.useState)(!0);(0,T.useEffect)(()=>{!async function(){try{if(!l||0===t.length)return;let{creations:e}=await (0,a.g)(l.uid,1e3,0,{ids:t});D(e);let r=n.filter(t=>e.every(e=>{var r;return null===(r=e.tags)||void 0===r?void 0:r.includes(t)}));f(r)}catch(e){console.error("Error fetching post data:",e),(0,u.p6)({title:"Error fetching post data",message:"There was an error retrieving post information. Please try again."})}finally{N(!1)}}()},[t,n,l]);let H=n.filter(e=>e.toLowerCase().includes(x.toLowerCase())),j=e=>{f(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},L=async()=>{E(!0);try{let e=n.filter(e=>O.every(t=>{var r;return null===(r=t.tags)||void 0===r?void 0:r.includes(e)})),t=w()(e,h);await o(O.map(e=>{let r=P()(w()(e.tags||[],t),h);return{...e,tags:r}})),d(),(0,u.wB)({title:"Saved to collections",message:"Your post has been saved to the selected collections"}),(0,S.s7)(),null==r||r()}catch(e){console.error("Error saving to collections:",e),(0,u.p6)({title:"Error saving to collections",message:"There was an error saving to collections. Please try again."})}finally{E(!1)}};
1return(0,i.jsx)(p.Card,{bg:"dark.9",p:"lg",radius:"lg",children:(0,i.jsxs)(v.Stack,{gap:"lg",children:[(0,i.jsxs)(m.Group,{justify:"space-between",gap:"sm",children:[(0,i.jsx)(_.Title,{order:3,c:"white",children:"Save To Collections"}),(0,i.jsx)(k,{})]}),(0,i.jsx)(y.TextInput,{placeholder:"Search collections...",value:x,onChange:e=>R(e.currentTarget.value),size:"lg",leftSection:(0,i.jsx)(I.A,{size:16}),variant:"unstyled",mx:"-md",my:"-xs"}),U?(0,i.jsx)(g.Box,{style:{display:"flex",justifyContent:"center",padding:"2rem",height:"300px"},children:(0,i.jsx)(b.Loader,{color:"white"})}):(0,i.jsx)(g.Box,{style:{height:"300px",overflowY:"auto"},children:(0,i.jsx)(v.Stack,{gap:"md",children:H.map(e=>(0,i.jsx)(M,{name:e,count:s[e]||0,isSelected:h.includes(e),onToggle:()=>j(e)},e))})}),(0,i.jsx)(A.Button,{onClick:L,fullWidth:!0,loading:C,disabled:U,color:"orange",variant:"light",size:"lg",children:"Done"})]})})}function D(){let{settings:{profile_collections:e},setSettings:t}=(0,c.VT)("settings","setSettings"),[r,a]=(0,T.useState)(""),[n,o]=(0,T.useState)(!1),d=r.trim().toLowerCase(),g=l.FU.some(e=>e.toLowerCase()===d),h=""!==d&&e.some(e=>e.toLowerCase()===d),f=async()=>{if(r&&!h&&!g){o(!0);try{let i=await (0,s.O)([...e,r.trim()]);t(i),(0,u.wB)({title:"Collection created",message:'Your collection "'.concat(r.trim(),'" has been created')}),(0,S.s7)()}catch(e){(0,u.p6)({title:"Error creating collection",message:"There was an error creating your collection. Please try again."})}finally{o(!1)}}},b=!r||h||g;return(0,i.jsx)(p.Card,{bg:"dark.9",p:"lg",radius:"lg",children:(0,i.jsxs)(v.Stack,{gap:"sm",children:[(0,i.jsxs)(m.Group,{justify:"space-between",gap:"sm",children:[(0,i.jsx)(_.Title,{order:3,c:"white",children:"New Collection"}),(0,i.jsx)(k,{})]}),(0,i.jsx)(y.TextInput,{placeholder:"Collection Name ✨",value:r,onChange:e=>a(e.currentTarget.value),error:g?"Collection name is reserved":h?"Collection already exists":null,size:"lg"}),(0,i.jsx)(A.Button,{onClick:f,disabled:b,loading:n,fullWidth:!0,variant:"light",color:"orange",size:"lg",children:"Create"})]})})}function U(e){let{creationIds:t,onComplete:r}=e;(0,d.q)({centered:!0,children:(0,i.jsx)(O,{creationIds:t,onComplete:r})})}function N(){(0,d.q)({centered:!0,children:(0,i.jsx)(D,{})})}function H(){let{settings:{profile_collections:e},tagCounts:t,user:r,setSettings:n,refreshTagCounts:l}=(0,c.VT)("settings","tagCounts","user","setSettings","refreshTagCounts"),[f,b]=(0,T.useState)(""),x=e.filter(e=>e.toLowerCase().includes(f.toLowerCase())),R=async t=>{try{if(!r)return;let{creations:i}=await (0,a.g)(r.uid,1e3,0,{tag:t});if(i.length>0){let e=i.map(e=>({...e,tags:e.tags.filter(e=>e!==t)}));await o(e),l()}let c=e.filter(e=>e!==t),d=await (0,s.O)(c);n(d),(0,u.wB)({title:"Collection deleted",message:'Collection "'.concat(t,'" has been deleted')}),(0,S.s7)()}catch(e){console.error("Error deleting collection:",e),(0,u.p6)({title:"Error deleting collection",message:"There was an error deleting your collection. Try again?"})}},C=e=>{(0,d.q)({children:(0,i.jsxs)(v.Stack,{bg:"dark.9",p:"lg",style:{borderRadius:"16px"},children:[(0,i.jsx)(_.Title,{order:3,children:"Confirm Deletion"}),(0,i.jsxs)(h.Text,{children:['Your collection "',e,'" will be permanently deleted. This action is not reversible. Please confirm.']}),(0,i.jsxs)(m.Group,{grow:!0,mt:"md",children:[(0,i.jsx)(A.Button,{variant:"default",onClick:()=>(0,S.s7)(),children:"Cancel"}),(0,i.jsx)(A.Button,{color:"red",onClick:()=>{(0,S.s7)(),R(e)},children:"Confirm"})]})]})})};return(0,i.jsx)(p.Card,{bg:"dark.9",p:"lg",radius:"lg",children:(0,i.jsxs)(v.Stack,{gap:"lg",children:[(0,i.jsxs)(m.Group,{justify:"space-between",gap:"sm",children:[(0,i.jsx)(_.Title,{order:3,c:"white",children:"Delete Collections"}),(0,i.jsx)(k,{})]}),(0,i.jsx)(y.TextInput,{placeholder:"Search collections...",value:f,onChange:e=>b(e.currentTarget.value),size:"lg",leftSection:(0,i.jsx)(I.A,{size:16}),variant:"unstyled",mx:"-md",my:"-xs"}),(0,i.jsx)(g.Box,{h:300,style:{overflowY:"auto"},children:(0,i.jsx)(v.Stack,{gap:"md",children:x.map(e=>(0,i.jsx)(M,{name:e,count:t[e]||0,onToggle:()=>C(e),action:"delete"},e))})})]})})}function j(){(0,d.q)({centered:!0,children:(0,i.jsx)(H,{})})}},19630:(e,t,r)=>{"use strict";r.d(t,{M2:()=>o,Q:()=>n,Z6:()=>a});var i=r(39427);let a=[...i.uc,...i.uO,i.Y5,...i.yQ],n=i.sN.id,o={image:null,width:0,height:0,prompt:"",brushSize:50,modelId:n,resolution:i.sN.resolutions[0]}},20036:(e,t,r)=>{"use strict";r.d(t,{$x:()=>i,AU:()=>n,lr:()=>o,sr:()=>a});var i=function(e){return e.CHERRY_MINI="cherry-mini",e.CHERRY="cherry",e.CHERRY_PRO="cherry-pro",e.CHERRY_2_PRO="cherry-2-pro",e}({}),a=function(e){return e.DURATION_4S="4",e.DURATION_5S="5",e.DURATION_8S="8",e.DURATION_10S="10",e.DURATION_15S="15",e.DURATION_20S="20",e.DURATION_25S="25",e.DURATION_30S="30",e.DURATION_AUTO="-1",e}({}),n=function(e){return e.RESOLUTION_480P="480p",e.RESOLUTION_720P="720p",e.RESOLUTION_1080P="1080p",e.RESOLUTION_4K="4k",e}({}),o=function(e){return e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_9_16="9:16",e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_ADAPTIVE="adaptive",e}({})},20038:(e,t,r)=>{"use strict";r.d(t,{Fl:()=>p,Q3:()=>u,_2:()=>m});var i=r(56800),a=r(37463),n=r(2736),o=r(39427),s=r(44164);let l={id:a.yp,label:"Flux 2",architecture:i.qH.FLUX2,backendModelId:a.yp},c={id:"grok-image-quality",label:"Grok Image Quality",architecture:i.qH.GROK_IMAGE,backendModelId:n.Gm.QUALITY},d={id:"grok-image",label:"Grok Image",architecture:i.qH.GROK_IMAGE,backendModelId:n.Gm.BASIC},u=[...o.uc,...o.mS,{...o.m2,label:"GPT Image 2 (Low)"},{...o.qr,label:"GPT Image 2 (High)"},{...o.Zm,label:"GPT Image 2.5 Flare (Low)"},{...o.Zw,label:"GPT Image 2.5 Flare (High)"},{...o.bP,label:"GPT Image 2.5 Sunburst (High)"},{...o.F_,label:"GPT Image 2.5 Sunburst (Max)"},o.Y5,l,c,d],p=l.id;function m(e){return(0,s.ug)(u,e,o.sN.id)}},20630:(e,t,r)=>{"use strict";r.d(t,{D:()=>a,o:()=>i});var i=function(e){return e.DURATION_8S="8s",e}({}),a=function(e){return e.RATIO_16_9="16:9",e.RATIO_1_1="1:1",e.RATIO_9_16="9:16",e}({})},20666:(e,t,r)=>{"use strict";r.d(t,{iG:()=>s,ye:()=>o});var i=r(4717),a=r(56800),n=r(27133);let o={architecture:a.qH.SDXL_PLUS,model_id:"6A35A7855770AE9820A3C931D4964C3817B6D9E3C6F9C4DABB5B3A94E5643B80",prompt:"",negative_prompt:"",num_inference_steps:50,guidance_scale:5,scheduler:n.v.EULER,prompt_embed_version:n.j.V1,aspect_ratio:i.vW.PORTRAIT,hires:!0,hires_strength:.5,adetailer_face:!0,adetailer_face_strength:.4,adetailer_face_blur:4,adetailer_face_dilation:4,adetailer_hands:!0,adetailer_hands_strength:.4,adetailer_hands_blur:4,adetailer_hands_dilation:4},s={architecture:a.qH.SDXL_PLUS,name:"SDXL Plus",short_name:"SDXL Plus",popularity:5,tags:[a.fZ,a.R$,a.KT],api_path:"/api/v1/stable_diffusion_xl_plus",agent:{description:"High-detail SDXL pipeline with face and hand cleanup. Slower and pricier than SDXL.",defaultConfig:o,options:{},imageInputs:{references:{field:"image"}}}}},20668:(e,t,r)=>{"use strict";r.d(t,{W2:()=>s,cR:()=>o});var i=r(55235),a=r(6060);let n="application/x-mage-creation";function o(e){let t=e.getData(n);if(!t)return null;try{let e=JSON.parse(t);if("string"==typeof e.url&&(0,a.u)(e.url,i._$)&&"image"===e.mediaType)return{url:e.url,mediaType:e.mediaType}}catch(e){}return null}function s(e){return e?{draggable:!0,onDragStart:t=>{var r;(r=t.dataTransfer).setData(n,JSON.stringify(e)),r.setData("text/uri-l
1ist",e.url),r.effectAllowed="copy";let i=t.currentTarget.getBoundingClientRect();t.dataTransfer.setDragImage(t.currentTarget,t.clientX-i.left,t.clientY-i.top)}}:{}}},20696:(e,t,r)=>{"use strict";r.d(t,{B:()=>n});var i=r(16791),a=r(12115);function n(e){let{children:t,maxFileSizeBytes:r=0xa00000,onFileTooLarge:n,onFilesDropped:o}=e,[s,l]=(0,a.useState)(!1),c=(0,a.useRef)(0),d=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),u=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),c.current+=1,1===c.current&&l(!0)},[]),p=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),c.current=Math.max(0,c.current-1),0===c.current&&l(!1)},[]),m=(0,a.useCallback)(()=>{c.current=0,l(!1)},[]);return t({isDragging:s,dragProps:{onDragOver:d,onDragEnter:u,onDragLeave:p,onDrop:(0,a.useCallback)(async e=>{e.preventDefault(),e.stopPropagation(),m();let t=Array.from(e.dataTransfer.files);if(0===t.length)return;let a=t.find(e=>e.size>r);if(a){n?n(a,r):(0,i.p6)({title:"File Too Large",message:"Maximum file size is ".concat(function(e){let t=e/1048576;return Number.isInteger(t)?"".concat(t,"MB"):"".concat(t.toFixed(1),"MB")}(r),".")});return}await o(t)},[r,n,o,m])}})}},20711:(e,t,r)=>{"use strict";r.d(t,{v:()=>u,t:()=>p});let i="600px";function a(e,t,r){return new Promise((i,a)=>{if(r.aborted)return a(r.reason);let n=()=>{r.removeEventListener("abort",o),i()},o=()=>{e.removeEventListener(t,n),a(r.reason)};e.addEventListener(t,n,{once:!0}),r.addEventListener("abort",o,{once:!0})})}class n{register(e,t){var r;return this.urls.set(e,t),e.dataset.loadState="idle",null===(r=this.observer)||void 0===r||r.observe(e),this.scheduleViewportCheck(e),()=>{var t;null===(t=this.observer)||void 0===t||t.unobserve(e),this.pendingViewportChecks.delete(e),this.abort(e),this.urls.delete(e)}}scheduleViewportCheck(e){let t=0===this.pendingViewportChecks.size;this.pendingViewportChecks.add(e),t&&requestAnimationFrame(()=>{let e=parseInt(i,10)||0,t=window.innerHeight,r=window.innerWidth;for(let i of this.pendingViewportChecks)if("idle"===i.dataset.loadState){let a=i.getBoundingClientRect();a.top<=t+e&&a.bottom>=-e&&a.left<=r+e&&a.right>=-e&&this.load(i)}this.pendingViewportChecks.clear()})}async load(e){var t;let r=this.urls.get(e);if(!r||"loaded"===e.dataset.loadState)return;null===(t=this.abortControllers.get(e))||void 0===t||t.abort();let i=new AbortController;this.abortControllers.set(e,i),e.dataset.loadState="loading";try{await this.doLoad(e,r,i.signal),e.dataset.loadState="loaded"}catch(e){e instanceof Error&&"AbortError"!==e.name&&console.error("Failed to load media:",e)}finally{this.abortControllers.delete(e)}}abort(e){var t;"loading"===e.dataset.loadState&&(null===(t=this.abortControllers.get(e))||void 0===t||t.abort(),this.abortControllers.delete(e),this.doAbort(e),e.dataset.loadState="idle")}constructor(){this.urls=new Map,this.abortControllers=new Map,this.observer=null,this.pendingViewportChecks=new Set,this.observer=new IntersectionObserver(e=>e.forEach(e=>e.isIntersecting?this.load(e.target):this.abort(e.target)),{rootMargin:i})}}class o extends n{async doLoad(e,t,r){e.src=t,await a(e,"load",r)}doAbort(e){e.src=""}}class s extends n{async doLoad(e,t,r){e.src=t,await a(e,"canplay",r)}doAbort(e){e.pause(),e.removeAttribute("src"),e.load()}}let l=new o,c=new s;var d=r(12115);function u(e){let t=(0,d.useRef)(null);return(0,d.useEffect)(()=>{let r=t.current;if(r&&e)return l.register(r,e)},[e]),t}function p(e){let t=(0,d.useRef)(null);return(0,d.useEffect)(()=>{let r=t.current;if(r&&e)return c.register(r,e)},[e]),t}},20731:(e,t,r)=>{"use strict";r.d(t,{P:()=>a});var i=r(34477);let a=(0,i.createServerReference)("403ffc12a7ad033916d6f3268e82fd49f16374fc62",i.callServer,void 0,i.findSourceMapURL,"saveManyCreations")},20835:(e,t,r)=>{"use strict";r.d(t,{M:()=>c,al:()=>u,iH:()=>d});var i=r(4717),a=r(16162),n=r(74532),o=r(56800),s=r(4714);let l="wan22-video",c="wan22-video-lightning",d={architecture:o.qH.WAN_22,model_id:l,prompt:"",negative_prompt:"",num_inference_steps:15,guidance_scale:4,flow_shift:12,num_frames:81,aspect_ratio:i.vW.CINEMA,base_size:s.d.SIZE_240P,prompt_filter:(0,n.jM)(a.y1,e=>{e&&(e.prompt="{prompt}",e.negative_prompt="default-negative-do-not-remove, {negative_prompt}")})},u={architecture:o.qH.WAN_22,name:"Wan Video v2.2",short_name:"Wan 2.2",popularity:0,tags:[o.fZ,o.tM],models:[l,c].map(e=>({id:e})),api_path:"/api/v1/wan_22",agent:{description:"General video model.",defaultConfig:d,options:{resolution:Object.values(s.d),resolutionField:"base_size"},imageInputs:{firstFrame:"image"}}}},21078:(e,t,r)=>{"use strict";r.d(t,{S_:()=>l,Wc:()=>s,el:()=>o,xZ:()=>n});var i=r(56800),a=r(71849);let n="blueberry",o="blueberry-v2",s={architecture:i.qH.BLUEBERRY,model_id:o,prompt:"",resolution:a.tY.RES_720P,blueberry_aspect_ratio:a.Y4.ASPECT_RATIO_16_9,duration:a.Nt.DURATION_4S,shot_type:a.Nz.SINGLE,prompt_extend:!1,audio:!0},l={architecture:i.qH.BLUEBERRY,name:"Blueberry",short_name:"Blueberry",popularity:7,tags:[i.fZ,i.tM,i.KT],models:[{id:n},{id:o}],api_path:"/api/v1/blueberry",agent:{description:"General video model.",defaultConfig:s,options:{resolution:Object.values(a.tY),duration:Object.values(a.Nt)},imageInputs:{firstFrame:"image",lastFrame:"last_image"}}}},22005:(e,t,r)=>{"use strict";r.d(t,{v:()=>l});var i=r(34477);let a=(0,i.createServerReference)("008a8f72ff7fc9a927876bf7444a45a6d53f4a682e",i.callServer,void 0,i.findSourceMapURL,"getCreditBalanceBreakdown");var n=r(77567),o=r(92726);let s=null;async function l(){s||(s=c());try{await s}finally{s=null}}async function c(){let e=await (0,o.Yh)(a),t=n.xV.getState();t.setAvailableGems(e.total),t.setGemBreakdown(e)}},22091:(e,t,r)=>{"use strict";r.d(t,{_Q:()=>n,a1:()=>o,gJ:()=>a});var i=r(40201);let a={url:null,durationSeconds:0,width:0,height:0};function n(e,t){let r={...e,...null==t?void 0:t.originalAudio};return!(null==t?void 0:t.originalAudio)&&(null==t?void 0:t.audioSetting)&&(r.berry=t.audioSetting===i.t4.ORIGIN),r}let o={imageUrl:null,character:void 0}},22310:(e,t,r)=>{"use strict";r.d(t,{P:()=>n});var i=r(20036),a=r(17157);function n(e){var t,r,n,o;let s=null!==(r=e.model_id)&&void 0!==r?r:a.TF.model_id,l=null!==(n=e.duration)&&void 0!==n?n:a.TF.duration,c=null!==(o=e.resolution)&&void 0!==o?o:a.TF.resolution;if((0,a.tp)(s,c)||(c=i.AU.RESOLUTION_720P),null===(t=e.videos)||void 0===t?void 0:t.length){let t=e.video_duration_s;if(void 0===t||!Number.isFinite(t))throw Error("Cherry video input billing requires video_duration_s on the config");let r=l===i.sr.DURATION_AUTO?t:Number(l);return Math.ceil(function(e,t){if(e===i.$x.CHERRY_MINI){if(t===i.AU.RESOLUTION_480P)return 30;if(t===i.AU.RESOLUTION_720P)return 67.5}if(e===i.$x.CHERRY){if(t===i.AU.RESOLUTION_480P)return 48;if(t===i.AU.RESOLUTION_720P)return 106.5}if(e===i.$x.CHERRY_PRO){if(t===i.AU.RESOLUTION_480P)return 61.5;if(t===i.AU.RESOLUTION_720P)return 139.5;if(t===i.AU.RESOLUTION_1080P)return 342;if(t===i.AU.RESOLUTION_4K)return 714}if(e===i.$x.CHERRY_2_PRO){if(t===i.AU.RESOLUTION_480P)return 91.5;if(t===i.AU.RESOLUTION_720P)return 207;if(t===i.AU.RESOLUTION_1080P)return 510}throw Error("Unknown video input configuration for Cherry (model: ".concat(e,", resolution: ").concat(t,")"))}(s,c)*(r+t))}if(l===i.sr.DURATION_AUTO)throw Error("Cherry auto duration billing requires a video input");return Math.ceil(function(e,t){if(e===i.$x.CHERRY_MINI){if(t===i.AU.RESOLUTION_480P)return 60;if(t===i.AU.RESOLUTION_720P)return 120}if(e===i.$x.CHERRY){if(t===i.AU.RESOLUTION_480P)return 90;if(t===i.AU.RESOLUTION_720P)return 180}if(e===i.$x.CHERRY_PRO){if(t===i.AU.RESOLUTION_480P)return 105;if(t===i.AU.RESOLUTION_720P)return 225;if(t===i.AU.RESOLUTION_1080P)return 555;if(t===i.AU.RESOLUTION_4K)return 1170}if(e===i.$x.CHERRY_2_PRO){if(t===i.AU.RESOLUTION_480P)return 154.5;if(t===i.AU.RESOLUTION_720P)return 346.5;
1if(t===i.AU.RESOLUTION_1080P)return 853.5}throw Error("Unknown configuration for Cherry (model: ".concat(e,", resolution: ").concat(t,")"))}(s,c)*Number(l))}},23258:(e,t,r)=>{"use strict";r.d(t,{$s:()=>n,BA:()=>s,ND:()=>o});var i=r(25352);r(61282);var a=r(59613);function n(e,t){return e===i.o.GEMS?t:1}function o(e,t){return e===i.o.GEMS?99:t}function s(e,t){return t===i.o.GEMS?(0,a.YM)(e):0}r(14276)},23288:(e,t,r)=>{"use strict";function i(e){return"".concat(Math.round(100*e),"%")}function a(e,t){return e>=1e9?(e/1e9).toFixed(null!=t?t:0)+"B":e>=1e6?(e/1e6).toFixed(null!=t?t:0)+"M":e>=1e3?(e/1e3).toFixed(null!=t?t:0)+"K":"".concat(e)}r.d(t,{Z:()=>a,l:()=>i})},23446:(e,t,r)=>{"use strict";r.d(t,{$3:()=>c,Do:()=>n,Tc:()=>l,W3:()=>p,Y9:()=>o,ZM:()=>u,d6:()=>s,im:()=>m,kn:()=>g,zX:()=>d});var i=r(56800),a=r(40201);let n="berry",o="berry-2",s=3,l=60,c=15,d={[n]:[a.Vm.RES_720P,a.Vm.RES_1080P],[o]:[a.Vm.RES_480P,a.Vm.RES_720P,a.Vm.RES_1080P]},u=200,p=450,m={architecture:i.qH.BERRY,model_id:o,prompt:"",berry_aspect_ratio:a.mv.ASPECT_RATIO_16_9,duration:a.PK.DURATION_3S,resolution:a.Vm.RES_480P},g={architecture:i.qH.BERRY,name:"Berry",short_name:"Berry",popularity:0,tags:[i.fZ,i.tM],models:[{id:n,name:"Berry"},{id:o,name:"Berry 2"}],api_path:"/api/v1/berry",agent:{description:"General video model. A start frame and reference images are mutually exclusive; set one or the other.",defaultConfig:m,options:{byModel:Object.fromEntries(Object.entries(d).map(e=>{let[t,r]=e;return[t,{resolution:[...r]}]})),duration:Object.values(a.PK)},imageInputs:{firstFrame:"first_image",references:{field:"image",additionalField:"additional_images"}},videoSource:{field:"video",durationClaim:"video_duration_s"}}}},24104:(e,t,r)=>{"use strict";r.d(t,{KE:()=>l,Lz:()=>s,fl:()=>d,np:()=>c,q$:()=>o,yb:()=>n});var i=r(82646),a=r(16791);let n="Remix is not supported for creations made with Apps.";class o extends Error{constructor(){super(i.qX),this.name="DeprecatedArchitectureRemixError"}}class s extends Error{constructor(){super("This creation is too old to be remixed."),this.name="LegacyConfigRemixError"}}function l(e){return e instanceof o?i.$I:e instanceof s?"Remix Unavailable":"Remix Failed"}function c(e,t){return e instanceof Error&&e.message?e.message:t}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"An error occurred while preparing this remix. Try again?";(0,a.p6)({title:l(e),message:c(e,t)})}},24155:(e,t,r)=>{"use strict";r.d(t,{V6:()=>l,XK:()=>s,hP:()=>c,v1:()=>d});var i=r(55235),a=r(16791),n=r(94485);let o=r.n(n)()();function s(e,t){let{invert:r=!1,fileType:a="image/jpeg",quality:n=1,maxSize:s=904,fixedSize:l=512}=t;return new Promise((t,c)=>{let d=new Image;d.setAttribute("crossOrigin","anonymous"),d.onload=function(){let{width:e,height:i}=d;"number"==typeof s&&(e>i?e>s&&(i*=s/e,e=s):i>s&&(e*=s/i,i=s)),"number"==typeof l&&e>l&&i>l&&(e>i?(e*=l/i,i=l):(i*=l/e,e=l));let c=e!==d.width||i!==d.height;e-=e%8,i-=i%8;let u=document.createElement("canvas");if(u.width=e,u.height=i,c)o.resize(d,u).then(o=>{let s=o.getContext("2d");if(r){let e=s.getImageData(0,0,u.width,u.height);for(let t=0;t<e.data.length;t+=4)e.data[t]=255-e.data[t],e.data[t+1]=255-e.data[t+1],e.data[t+2]=255-e.data[t+2];s.putImageData(e,0,0)}t({image:o.toDataURL(a,n),width:e,height:i})}).catch(()=>{let o=u.getContext("2d");if(o.drawImage(d,0,0,e,i),r){let e=o.getImageData(0,0,u.width,u.height);for(let t=0;t<e.data.length;t+=4)e.data[t]=255-e.data[t],e.data[t+1]=255-e.data[t+1],e.data[t+2]=255-e.data[t+2];o.putImageData(e,0,0)}t({image:u.toDataURL(a,n),width:e,height:i})});else{let o=u.getContext("2d");if(o.drawImage(d,0,0,e,i),r){let e=o.getImageData(0,0,u.width,u.height);for(let t=0;t<e.data.length;t+=4)e.data[t]=255-e.data[t],e.data[t+1]=255-e.data[t+1],e.data[t+2]=255-e.data[t+2];o.putImageData(e,0,0)}t({image:u.toDataURL(a,n),width:e,height:i})}},d.onerror=function(e){c(e)},e.includes(window.location.host)||e.includes("cdn.mage.space")||e.includes("cdn2.mage.space")||e.includes("cdn3.mage.space")||e.startsWith("data:")?d.src=e:d.src="".concat(i.C3,"/").concat(e)})}async function l(e,t){try{let r=await fetch(e);if(!r.ok)throw Error("Failed to fetch ".concat(e,": ").concat(r.statusText));let i=await r.blob(),a=window.URL.createObjectURL(i),n=document.createElement("a");n.href=a,n.download=e.split("/").pop()||"image",document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(a),n.remove(),t(1)}catch(e){console.error("Error downloading image:",e),t(0)}}async function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{batchSize:r=5,batchDelayMs:i=500}=t,a=0,n=0;for(let t=0;t<e.length;t+=r){let o=e.slice(t,t+r);for(let e of(await Promise.allSettled(o.map(e=>new Promise(t=>{l(e,e=>{t(1===e)})})))))"fulfilled"===e.status&&!0===e.value?a++:n++;t+r<e.length&&await new Promise(e=>
1setTimeout(e,i))}return{successCount:a,failCount:n}}async function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{successTitle:r="Downloaded",partialTitle:i="Partially Downloaded",failureTitle:n="Download Failed",errorTitle:o="Error Downloading",successMessage:s=e=>"".concat(e," item").concat(1!==e?"s":""," downloaded!"),partialMessage:l=(e,t)=>"".concat(e," item").concat(1!==e?"s":""," downloaded, ").concat(t," failed."),failureMessage:d=e=>"Failed to download ".concat(e," item").concat(1!==e?"s":"",". Please try again."),errorMessage:u="There was an issue downloading some items. Try again?",...p}=t;try{let t=await c(e,p);return 0===t.failCount?(0,a.wB)({title:r,message:s(t.successCount)}):0===t.successCount?(0,a.p6)({title:n,message:d(t.failCount)}):(0,a.bA)({title:i,message:l(t.successCount,t.failCount)}),t}catch(e){throw(0,a.p6)({title:o,message:u}),e}}},24524:(e,t,r)=>{"use strict";r.d(t,{e:()=>a});var i=r(34477);let a=(0,i.createServerReference)("60a40590f153f4ea3fd10d1d3a28dd43acfa34971f",i.callServer,void 0,i.findSourceMapURL,"uploadUserImage")},25102:(e,t,r)=>{"use strict";r.d(t,{AR:()=>a,Nf:()=>n,VI:()=>i,gk:()=>o});var i=function(e){return e.MELON="melon",e.MELON_PRO="melon-pro",e}({}),a=function(e){return e.DURATION_3S="3",e.DURATION_4S="4",e.DURATION_5S="5",e.DURATION_6S="6",e.DURATION_8S="8",e.DURATION_10S="10",e.DURATION_16S="16",e}({}),n=function(e){return e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_9_16="9:16",e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_3_4="3:4",e.ASPECT_RATIO_4_3="4:3",e}({}),o=function(e){return e.RESOLUTION_540P="540p",e.RESOLUTION_720P="720p",e.RESOLUTION_1080P="1080p",e}({})},25352:(e,t,r)=>{"use strict";r.d(t,{i:()=>a,o:()=>i});var i=function(e){return e.UNLIMITED="unlimited",e.GEMS="gems",e}({});let a=["fast_mode","use_gems","wait_time_s"]},25618:(e,t,r)=>{"use strict";r.d(t,{eC:()=>l,oH:()=>s});var i=r(4717),a=r(56800),n=r(64325);let o="ltx-video-096-distilled",s={architecture:a.qH.LTX_VIDEO,model_id:o,prompt:"",negative_prompt:"worst quality, inconsistent motion, blurry, jittery, distorted",num_inference_steps:8,guidance_scale:3,decode_timestep:.05,decode_noise_scale:.025,aspect_ratio:i.vW.LANDSCAPE,base_size:n.I.SIZE_480P,prompt_enhance:!0},l={architecture:a.qH.LTX_VIDEO,name:"LTX Video",short_name:"LTXV",popularity:0,tags:[a.fZ,a.tM],models:[o,"ltx-video-096-dev"].map(e=>({id:e})),api_path:"/api/v1/ltx_video",agent:{description:"Fast video model.",defaultConfig:s,options:{resolution:Object.values(n.I),resolutionField:"base_size"},imageInputs:{firstFrame:"image"}}}},25892:(e,t,r)=>{"use strict";r.d(t,{ps:()=>I,YH:()=>P,zt:()=>T});var i=r(95155),a=r(82646),n=r(9746),o=r(34477);let s=(0,o.createServerReference)("60314e1c60795445e1e73eefdcf964df0e46d0dc7f",o.callServer,void 0,o.findSourceMapURL,"uploadTempCreationImage");var l=r(64930),c=r(61282),d=r(77567),u=r(7963),p=r(16791),m=r(39852),g=r(61871),h=r(32191),f=r(24104),v=r(18403),_=r(21220),y=r(93751),b=r(58887),A=r(70112),S=r(26903),x=r(91423),R=r(39599);function I(e){return void 0!==e&&"video"===e.type}async function C(e){return new Promise((t,r)=>{try{let i=document.createElement("video");i.crossOrigin="anonymous",i.muted=!0,i.playsInline=!0,i.preload="auto",i.src=e;let a=()=>{i.pause(),i.removeAttribute("src"),i.load(),i.onloadedmetadata=null,i.onseeked=null,i.onerror=null},n=window.setTimeout(()=>{a(),r(Error("Timed out capturing video frame"))},1e4);i.onloadedmetadata=()=>{let e=Number.isFinite(i.duration)&&i.duration>0?Math.max(0,i.duration-.01):0;i.currentTime=e},i.onseeked=()=>{let e=document.createElement("canvas");e.width=i.videoWidth,e.height=i.videoHeight;let o=e.getContext("2d");if(!o){clearTimeout(n),a(),r(Error("Could not get canvas context"));return}o.drawImage(i,0,0,e.width,e.height);let s=e.toDataURL("image/jpeg");clearTimeout(n),a(),t(s)},i.onerror=()=>{clearTimeout(n),a(),r(Error("Failed to load video for frame capture"))}}catch(e){r(e)}})}async function w(e){let{prompt:t,uploadedImageUrl:r,baseConfig:i,conceptIdToLoad:a,referenceConcept:o,successMessage:s}=e;try{let e,l=o;if(a){if(!(l=await (0,n.P)(a))){(0,p.p6)({title:"Error",message:"Could not load the concept. Please try again."});return}if(!l.architecture_config){(0,p.p6)({title:"Error",message:"Concept is missing configuration. Please try again."});return}e=(0,R.An)({...l.architecture_config,prompt:t},r)}else if(i)e=(0,R.An)({...i,prompt:t},r);else{(0,p.p6)({title:"Error",message:"No configuration provided for extension."});return}if(!await (0,m.o6)({architectureConfig:e,concept:null!=l?l:void 0}))return;(0,p.wB)({title:"Extend Queued",message:s||"Your video has been queued for extension using the last frame!"})}catch(e){console.error("Extend failed",e),(0,p.p6)({title:"Extend Failed",message:"We could not extend this video. Please try again."})}}async function E(e){let t,{appResult:r,promptOverride:o,mode:m}=e;if(!I(r)){(0,p.p6)({title:"Cannot Extend",message:"Extend is only available for videos."});return}let E=d.xV.getState();if(null===E.user){(0,p.p6)({title:"User not found",message:"You are not logged in. Please log in to extend this video."});return}if(!(0,h.gp)(c.c.PRO))return;let P=r.architecture_config;if(!P){(0,f.fl)(new f.Lz);return}if((0,a.R3)(P.architecture)){(0,g.n)();return}let T=(0,R.VQ)(r,o);if("auto"===m&&!T){(0,p.bA)({title:"Prompt Required",message:"Add a prompt to extend this video."});return}let M=r.data.video;
1if(!M){(0,p.p6)({title:"No Video Found",message:"We could not find the video file to extend."});return}try{let e=await C(M);t=await s(e,E.user.uid)}catch(e){console.error("Frame capture failed",e),(0,p.p6)({title:"Extend Failed",message:"We could not capture the last frame. Please try again."});return}if(!(0,R.JZ)(P)){!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r=async()=>{(0,x.s7)(),await w({prompt:e,conceptIdToLoad:l.In,uploadedImageUrl:t,successMessage:"Your video has been queued for extension with MiniMax-H3!"})};(0,u.q)({children:(0,i.jsx)(v.Card,{bg:"dark.9",radius:"lg",p:"md",children:(0,i.jsxs)(_.Stack,{gap:"md",children:[(0,i.jsx)(y.Title,{order:5,c:"white",children:"Model does not support image-to-video"}),(0,i.jsx)(b.Text,{c:"dimmed",size:"sm",children:"This video was generated with a model that cannot take an image input, so it cannot be extended from a frame."}),(0,i.jsx)(b.Text,{c:"white",size:"sm",fw:500,children:"Would you like to continue extending with MiniMax-H3 Turbo instead?"}),(0,i.jsxs)(A.Group,{gap:"sm",grow:!0,children:[(0,i.jsx)(S.Button,{variant:"light",color:"gray",radius:"xl",onClick:()=>(0,x.s7)(),children:"Cancel"}),(0,i.jsx)(S.Button,{variant:"light",color:"orange",radius:"xl",onClick:r,children:"Continue"})]})]})})})}(null!=T?T:"",t);return}let k=r.concept_id?await (0,n.P)(r.concept_id):void 0;"manual"===m?function(e){let{prompt:t,uploadedImageUrl:r,baseConfig:i,concept:a}=e,n=d.xV.getState(),o=(0,R.An)({...i,prompt:t},r);if(n.setActiveArchitectureConfig(o)){if(a){if(!n.setConcept(a,!1))return}else n.setConcept(void 0,!1);(0,p.bA)({title:"Extend Setup Ready",message:"Customize your settings and click Generate when ready."})}}({prompt:null!=T?T:"",baseConfig:P,concept:k,uploadedImageUrl:t}):await w({prompt:null!=T?T:"",baseConfig:P,referenceConcept:k,uploadedImageUrl:t,successMessage:"We queued a new video using the last frame as the starting image."})}function P(e,t){return E({appResult:e,promptOverride:t,mode:"auto"})}function T(e,t){return E({appResult:e,promptOverride:t,mode:"manual"})}},26839:(e,t,r)=>{"use strict";r.d(t,{Bq:()=>u,Xl:()=>p,ZT:()=>m,ZX:()=>g,Zx:()=>y,hu:()=>f,kp:()=>d,ky:()=>h,lq:()=>v});var i=r(95155),a=r(77567),n=r(16791),o=r(41698),s=r(12115);let l="mage-skew-reloaded-at",c=[/ChunkLoadError/i,/Loading chunk \S+ failed/i,/Loading CSS chunk/i,/Failed to find Server Action/i,/Failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/Importing a module script failed/i,/DEPLOYMENT_NOT_FOUND/,/Cannot read properties of undefined \(reading 'call'\)/,/undefined is not an object \(evaluating '[^']*\.call'\)/,/can't access property "call", .+ is undefined/,/Server Action \S+ returned no result/];function d(e,t){if(void 0===e)throw Error("Server Action ".concat(t," returned no result"));return e}function u(e){return c.some(t=>t.test(e))}function p(){try{let e=sessionStorage.getItem(l);if(null===e)return!1;return Date.now()-Number(e)<6e4}catch(e){return null}}function m(){try{return sessionStorage.setItem(l,String(Date.now())),!0}catch(e){return!1}}function g(e){return e.genQueue.length>0||e.isGenQueueProcessing?"queued":e.runningJobs.length>0?"running":"idle"}function h(e){let{online:t,queueActivity:r,canWaitForGeneration:i,recentReload:a}=e;return t?!1!==a?"manual":"idle"===r?"reloading":i?"waiting-for-generation":"queued"===r?"queued-work":"reloading":"reconnecting"}function f(e){return!!u(e)&&!!navigator.onLine&&("idle"===g(a.xV.getState())&&!1===p()&&m()?window.location.reload():(0,n.bA)({id:"mage-new-version",title:"New version available",message:"Mage has been updated. Tap here to reload when you are ready.",icon:(0,i.jsx)(o.A,{size:18}),autoClose:!1,onClick:()=>window.location.reload()}),!0)}function v(e){return e instanceof Error?"".concat(e.name,": ").concat(e.message):String(e)}function _(e,t){return e instanceof Error?v(e):null!=t?t:""}function y(){return(0,s.useEffect)(()=>{let e=e=>{f(_(e.error,e.message))},t=e=>{f(_(e.reason,String(e.reason)))};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t)}},[]),null}},26905:(e,t,r)=>{"use strict";r.d(t,{w:()=>o});var i=r(27431),a=r(10140);let n={[i.K.LOW]:9,[i.K.MEDIUM]:80,[i.K.HIGH]:317,[i.K.XHIGH]:562,[i.K.MAX]:1265};function o(e){var t,r,o,s,l,c;let{model:d,quality:u}=(0,a.iy)(e),p=n[u];if(void 0===p||!(0,a.HH)(d,u))throw Error("Unknown configuration for GPT Image 2 (model: ".concat(a.gt[d],", qual
1ity: ").concat(u,")"));return p*(e.resolution===i.h.RES_2K?2:1)+15*Math.min(+!!e.image+(null!==(s=null===(t=e.additional_images)||void 0===t?void 0:t.length)&&void 0!==s?s:0)+(null!==(l=null===(r=e.characters)||void 0===r?void 0:r.length)&&void 0!==l?l:0)+(null!==(c=null===(o=e.references)||void 0===o?void 0:o.length)&&void 0!==c?c:0),a.Hg)}},27104:(e,t,r)=>{"use strict";function i(e,t,r){let i="@".concat(t),a=(null==r?void 0:r.trailingSpace)?" ":"";return e&&0!==e.length?e.endsWith(" ")||e.endsWith("\n")||e.endsWith("	")?e+i+a:e+" "+i+a:i+a}function a(e,t){if(!e)return"";let r=RegExp("\\s*".concat("@".concat(t).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"\\s*"),"g"),i=e.replaceAll(r," ");return i.replace(/\s+/g," ").trim()}r.d(t,{B9:()=>a,go:()=>i})},27122:(e,t,r)=>{"use strict";r.d(t,{v:()=>i});let i="on-demand-only"},27133:(e,t,r)=>{"use strict";r.d(t,{j:()=>i,v:()=>a});var i=function(e){return e.V1="v1",e.V2="v2",e}({}),a=function(e){return e.LCM="lcm",e.DDIM="ddim",e.DDIM_VPRED="ddim_vpred",e.DDPM="ddpm",e.DDPM_VPRED="ddpm_vpred",e.DEIS="deis",e.DPMM="dpmm",e.DPMM_SDE="dpmm_sde",e.DPMM_SDE_KARRAS="dpmm_sde_karras",e.DPMM_KARRAS="dpmm_karras",e.DPMS="dpms",e.DPMS_KARRAS="dpms_karras",e.DPM_SDE="dpm_sde",e.EULER="euler",e.EULER_VPRED="euler_vpred",e.EULERA="eulera",e.EULERA_VPRED="eulera_vpred",e.HEUN="heun",e.KDPM2="kdpm2",e.KDPM2_KARRAS="kdpm2_karras",e.KDPM2A="kdpm2a",e.KDPM2A_KARRAS="kdpm2a_karras",e.LMS="lms",e.LMS_KARRAS="lms_karras",e.PNDM="pndm",e.TCD="tcd",e.UNIPC="unipc",e}({})},27431:(e,t,r)=>{"use strict";r.d(t,{K:()=>a,h:()=>i});var i=function(e){return e.RES_1K="1K",e.RES_2K="2K",e}({}),a=function(e){return e.LOW="low",e.MEDIUM="medium",e.HIGH="high",e.XHIGH="xhigh",e.MAX="max",e}({})},27610:(e,t,r)=>{"use strict";r.d(t,{F:()=>n});var i=r(52491),a=r.n(i);function n(e){try{return a().MD5(e)}catch(t){return a().MD5({data:e})}}},27981:(e,t,r)=>{"use strict";function i(e){return null==e?null:e}r.d(t,{g:()=>i})},28076:(e,t,r)=>{"use strict";r.d(t,{V:()=>f});var i=r(95155),a=r(29917),n=r(85080),o=r(43608),s=r(8141),l=r(70112),c=r(83347),d=r(58887),u=r(26903),p=r(78977),m=r(12115),g=r(25883),h=r(33082);function f(e){let t=(0,m.useRef)(!1),{creations:r,loading:f,hasMore:v,loadMore:_,error:y}=(0,n.C)(e.uid,e.creations,e.limit,{orderBy:e.orderBy,prompt:e.prompt,type:e.type}),[b]=(0,g.A)({loading:f,hasNextPage:v,onLoadMore:_,rootMargin:"0px 0px 0px 0px",disabled:!!y,delayInMs:0});return(0,m.useEffect)(()=>{0===r.length&&v&&!t.current&&(t.current=!0,_())},[r,v]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.u,{columns:e.columns,style:{"--grid-gap":"var(--mantine-spacing-xs)"},children:r.map((t,a)=>{let n=(0,i.jsx)(h.i,{creations:r,idx:a});return(0,i.jsx)("div",{ref:a===r.length-50?b:void 0,children:e.renderItem?e.renderItem(t,n):(0,i.jsx)(o.UnstyledButton,{onClick:()=>{e.onSelect&&e.onSelect(t)},component:"div",style:{fontSize:0},children:n})},a)})}),(0,i.jsx)(s.Center,{h:50,children:f?(0,i.jsxs)(l.Group,{gap:"xs",my:"sm",children:[(0,i.jsx)(c.Loader,{size:18}),(0,i.jsx)(d.Text,{c:"dimmed",size:"sm",children:"Loading..."})]}):y?(0,i.jsx)(u.Button,{c:"white",leftSection:(0,i.jsx)(p.A,{size:18}),variant:"transparent",my:"sm",onClick:()=>_(),children:"Could not fetch. Retry?"}):(0,i.jsxs)(l.Group,{gap:"xs",my:"sm",children:[(0,i.jsx)(d.Text,{c:"dimmed",size:"sm",children:"You've reached the end!"}),(0,i.jsx)(d.Text,{children:"\uD83E\uDDD9"})]})})]})}},29513:(e,t,r)=>{"use strict";r.d(t,{l5:()=>i,p4:()=>a});let i=10,a=15},29728:(e,t,r)=>{"use strict";r.d(t,{$X:()=>u,U0:()=>g,V:()=>l,ZI:()=>c,dK:()=>d,vn:()=>o,wW:()=>m,yB:()=>p,yf:()=>s});var i=r(4717),a=r(56800),n=r(18683);let o="mango",s="mango-v2",l="mango-v3",c="mango-v3-pro",d=[n.d.RES_1K,n.d.RES_2K],u=[n.d.RES_2K,n.d.RES_3K],p=[n.d.RES_2K,n.d.RES_3K,n.d.RES_4K],m={architecture:a.qH.MANGO,model_id:s,prompt:"",resolution:n.d.RES_2K,aspect_ratio:i.vW.PORTRAIT},g={architecture:a.qH.MANGO,name:"Mango",short_name:"Mango",popularity:6,tags:[a.fZ,a.R$,a.Mn,a.KT],models:[{id:o,name:"Mango"},{id:s,name:"Mango 2"},{id:l,name:"Mango 3S"},{id:c,name:"Mango 3"}],api_path:"/api/v1/mango",agent:{description:"General-purpose image model. The default for stills unless the user asks for another model.",defaultConfig:m,options:{byModel:{[c]:{resolution:[...d]},[l]:{resolution:[...u]},[s]:{resolution:[...p]}}},imageInputs:{references:{field:"image",additionalField:"additional_images"}}}}},29848:(e,t,r)=>{"use strict";r.d(t,{Ny:()=>c,gA:()=>p,nw:()=>u});var i=r(22091),a=r(43050),n=r(86819),o=r(62664),s=r(44164),l=r(67934);l.KL.VIDEO_FACE_SWAP,l.KL.VIDEO_CHARACTER_SWAP;let c=[o.yS,...o.s1,o.yQ,o.JY,o.zK],d=n.ib;
1function u(e,t,r,i){return(0,s.EB)(c,e,t,r,i,d)}let p={modelId:d,video:i.gJ,reference:i.a1,resolution:a.so.RES_480P,duration:a.yS.DURATION_4S,aspectRatio:a.P4.ASPECT_RATIO_16_9,originalAudio:{berry:!0,cherry:!0}}},29917:(e,t,r)=>{"use strict";r.d(t,{u:()=>d});var i=r(95155),a=r(77567),n=r(81507),o=r(67065),s=r.n(o);function l(e){return(0,i.jsx)(n.A,{breakpointCols:e.columns,className:s().grid,columnClassName:s().griditem,style:e.style,children:e.children})}function c(e){let{appFeedColumns:t}=(0,a.xV)(e=>({appFeedColumns:e.appFeedColumns}));return(0,i.jsx)(n.A,{breakpointCols:t,className:s().grid,columnClassName:s().griditem,style:e.style,children:e.children})}function d(e){return e.columns?(0,i.jsx)(l,{columns:e.columns,style:e.style,children:e.children}):(0,i.jsx)(c,{style:e.style,children:e.children})}},30458:(e,t,r)=>{"use strict";r.d(t,{_p:()=>s,tC:()=>n,wM:()=>o});var i=r(56800),a=r(61629);let n=a.xl.SEED_AUDIO_1_0,o={architecture:i.qH.SEED_AUDIO,model_id:a.xl.SEED_AUDIO_1_0,prompt:"",duration:5,format:a.x0.MP3,sample_rate:48e3,speech_rate:0,loudness_rate:0,pitch_rate:0},s={architecture:i.qH.SEED_AUDIO,name:"Seed Audio",short_name:"Seed Audio",popularity:0,tags:[i.fZ,i.sx],models:[{id:a.xl.SEED_AUDIO_1_0,name:"Seed Audio"}],api_path:"/api/v1/seed_audio",agent:null}},31304:(e,t,r)=>{"use strict";r.d(t,{C:()=>o,m:()=>n});var i=r(53521),a=r(77567);function n(){return{activeReferences:(0,a.xV)(e=>(0,i.W)(e).references)}}function o(){return{activeAudioReferences:(0,a.xV)(e=>(0,i.W)(e).audioReferences)}}},31760:(e,t,r)=>{"use strict";r.d(t,{E$:()=>n,s1:()=>o});var i=r(4717),a=r(56800);let n={architecture:a.qH.STABLE_DIFFUSION_V35_LARGE,model_id:"sd-3-5-large",prompt:"",negative_prompt:"",num_inference_steps:28,guidance_scale:7.5,aspect_ratio:i.vW.PORTRAIT},o={architecture:a.qH.STABLE_DIFFUSION_V35_LARGE,name:"Stable Diffusion v3.5 Large",short_name:"SD3.5L",popularity:0,tags:[a.fZ,a.R$],api_path:"/api/v1/stable_diffusion_v35_large",agent:{description:"Stable Diffusion 3.5 Large.",defaultConfig:n,options:{},imageInputs:{references:{field:"image"}}}}},31896:(e,t,r)=>{"use strict";r.d(t,{N8:()=>a,p2:()=>i});var i=function(e){return e.SIZE_480P="480p",e.SIZE_544P="544p",e.SIZE_720P="720p",e.SIZE_768P="768p",e}({}),a=function(e){return e.DURATION_5S="5",e.DURATION_6S="6",e.DURATION_7S="7",e.DURATION_8S="8",e.DURATION_9S="9",e.DURATION_10S="10",e.DURATION_11S="11",e.DURATION_12S="12",e.DURATION_13S="13",e.DURATION_14S="14",e.DURATION_15S="15",e}({})},32120:(e,t,r)=>{"use strict";r.d(t,{x:()=>p});var i=r(95155),a=r(59664),n=r(15763),o=r(70112),s=r(58887),l=r(27361),c=r(69604),d=r(17187);let u="no-limit";function p(e){let t,{packageUsd:r,value:p,onChange:m,size:g,comboboxProps:h,showDetails:f=!0}=e,v=(0,a.Wu)(r),_=v.includes(p),y=v.map(e=>null===e?{value:u,label:"No Limit"}:{value:String(e),label:"$".concat(e.toLocaleString()," / month")});_||null===p||(t="Your current $".concat(p.toLocaleString()," limit is no longer available. Choose a new monthly limit."));let b=null;return _&&(b=null===p?u:String(p)),(0,i.jsx)(n.Select,{label:f?(0,i.jsxs)(o.Group,{gap:4,wrap:"nowrap",children:[(0,i.jsx)(s.Text,{size:"sm",fw:500,children:"Monthly limit"}),(0,i.jsx)(l.Tooltip,{label:"Automatically top up Gems before you run out, up to your selected monthly limit. After you hit the limit, automatic charges stop until the next month.",multiline:!0,maw:300,withArrow:!0,children:(0,i.jsx)(c.Box,{component:"span",display:"inline-flex",tabIndex:0,"aria-label":"About the monthly auto top-up limit",onClick:e=>e.preventDefault(),children:(0,i.jsx)(d.A,{size:14,color:"var(--mantine-color-dimmed)"})})})]}):void 0,"aria-label":f?void 0:"Monthly limit",size:g,placeholder:"Choose a monthly limit",description:f?"Limit is based on pre-tax package prices.":void 0,inputWrapperOrder:["label","input","description","error"],value:b,onChange:e=>{if(e===u){m(null);return}e&&m(Number(e))},data:y,error:t,allowDeselect:!1,comboboxProps:h})}},32191:(e,t,r)=>{"use strict";r.d(t,{IY:()=>x,gp:()=>S,Hl:()=>A,kx:()=>b,jo:()=>I,eo:()=>y});var i=r(95155),a=r(34827),n=r(78507),o=r(82646),s=r(61282),l=r(77567);r(41441),r(16791),r(6874),r(35695),r(12115);var c=r(34477);let d=(0,c.createServerReference)("0090fa7d3dd4c904fc64730020f6cb83525fc4a0b9",c.callServer,void 0,c.findSourceMapURL,"getLastGemPurchaseType");var u=r(25352),p=r(7963),m=r(61871),g=r(14276),h=r(58887),f=r(91423),v=r(59613);let _="upgrade-premium-modal";function y(e,t){(0,p.q)({id:_,size:"xl",children:(0,i.jsx)(n.$,{userMembership:e,membershipRequired:t})})}function b(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=(0,g.c)(e,t);return!i&&r&&y(e,t),i}function A(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{userMembership:r}=l.xV.getState();return b(r,e,t)}function S(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{generationMode:r,userMembership:i}=l.xV.getState();return r===u.o.GEMS||b(i,e,t)}function x(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{generationMode:r,userMembership:i}=l.xV.getState();if((0,o.R3)(e.architecture))return t&&(0,m.n)(),!1;if(r===u.o.GEMS)return!0;let a=(0,v.pB)(e);if(!a)return!0;let n=(0,g.c)(i,a);return!n&&t&&y(i,a),n}let R={backgroundImage:null,buttonText:"Continue with Gems",buttonBg:"dark.6",onSelectOverride:()=>(0,f.s7)()};async function I(e){let t=(0,v.pB)(e);if(!t)return;let r=function(e){switch(e){case s.t.GEMS_20K:return(0,i.jsx)(a.kg,{...R});case s.t.GEMS_40K:return(0,i.jsx)(a.Ww,{...R});case s.t.GEMS_100K:return(0,i.jsx)(a.LG,{...R});default:return(0,i.jsx)(a.$u,{...R})}}(await d());(0,p.q)({id:_,size:"xl",children:(0,i.jsx)(n.$,{title:"Stop Paying Per Generation",description:(0,i.jsxs)(i.Fragment,{children:["You're paying per generation with Gems. Switch to"," ",(0,i.jsx)("b",{children:"unlimited generation"})," with a membership — and use Gems only when you need speed.",(0,i.jsx)(h.Text,{size:"sm",c:"dimmed",ta:"center",fw:600,mt:"sm",children:"Most active creators use both!"})]}),leftCard:r,userMembership:s.c.FREE,membershipRequired:t,rightCardButtonText:"Go Unlimited"})})}},32297:(e,t,r)=>{"use strict";r.d(t,{J:()=>e3,D:()=>e5});
1var i=r(95155),a=r(39599),n=r(71849),o=r(21078),s=r(56800),l=r(99785),c=r(84461),d=r(56650),u=r(43050),p=r(86819),m=r(58649),g=r(96700),h=r(13421),f=r(73857),v=r(40350),_=r(4714),y=r(20835),b=r(4717),A=r(68758);let S={aspect_ratio:b.vW.PORTRAIT,base_size:_.d.SIZE_480P,flow_shift:8,guidance_scale:1,num_inference_steps:4};function x(e,t){if(!(t.width<=0)&&!(t.height<=0))return(0,l.Mq)(e,t.width/t.height)}var R=r(9663),I=r(77567),C=r(2595),w=r(88920),E=r(39852),P=r(23258),T=r(21220),M=r(70112),k=r(69604),O=r(70714),D=r(41954),U=r(93677),N=r(26903),H=r(83347),j=r(90557),L=r(58887),G=r(39246),q=r(92378),B=r(12115),F=r(25352),V=r(36996);function K(e){let{config:t}=e,{generationMode:r}=(0,I.VT)("generationMode"),a=r===F.o.GEMS;return(0,i.jsx)(N.Button,{size:"compact-xs",radius:"xl",variant:"subtle",color:"gray",c:a?"white":"dimmed",onClick:()=>(0,V._)(a?F.o.UNLIMITED:F.o.GEMS,t),leftSection:(0,i.jsx)(k.Box,{w:6,h:6,style:{borderRadius:"50%",backgroundColor:a?"var(--mantine-color-orange-4)":"var(--mantine-color-dark-4)",transition:"background-color 0.15s ease"}}),styles:{label:{fontSize:"11px",fontWeight:500}},children:"Fast Mode"})}var z=r(95592);function W(){var e;let t=(0,C.B)(),{isAppPlaying:r,playAppCreations:l,playAppViewIndex:_,animateModelId:b,setAnimateModelId:F,generationMode:V,isDesktop:W}=(0,I.VT)("isAppPlaying","playAppCreations","playAppViewIndex","animateModelId","setAnimateModelId","generationMode","isDesktop"),[X,Y]=(0,B.useState)(""),Z=(0,R.D0)(b),Q=l.at(_),$=Q&&"image"===Q.type?Q.data:void 0,J=(0,B.useMemo)(()=>{var e;if(Q&&$)return function(e,t,r,i){var a,l,_,b,R;switch(e.architecture){case s.qH.WAN_22:return{...y.iH,...S,architecture:s.qH.WAN_22,model_id:e.backendModelId,image:t,prompt:r,aspect_ratio:null!==(a=function(e){if(!(e.width<=0)&&!(e.height<=0))return(0,A.Qd)(e.width,e.height)}(i))&&void 0!==a?a:S.aspect_ratio};case s.qH.PEACH:return{...h.Xe,architecture:s.qH.PEACH,model_id:e.backendModelId,image:t,prompt:r,peach_aspect_ratio:null!==(l=x(Object.values(g.Xn),i))&&void 0!==l?l:h.Xe.peach_aspect_ratio};case s.qH.PEACH_MAX:return{...v.SI,architecture:s.qH.PEACH_MAX,model_id:e.backendModelId,image:t,prompt:r,peach_max_aspect_ratio:null!==(_=x(Object.values(f.j0),i))&&void 0!==_?_:v.SI.peach_max_aspect_ratio};case s.qH.KIWI:return{...d.q$,architecture:s.qH.KIWI,model_id:e.backendModelId,image:t,prompt:r,kiwi_aspect_ratio:null!==(b=x(Object.values(c.Un),i))&&void 0!==b?b:d.q$.kiwi_aspect_ratio};case s.qH.BLUEBERRY:return{...o.Wc,architecture:s.qH.BLUEBERRY,model_id:e.backendModelId,image:t,prompt:r,duration:n.Nt.DURATION_5S,blueberry_aspect_ratio:null!==(R=x(Object.values(n.Y4),i))&&void 0!==R?R:o.Wc.blueberry_aspect_ratio};case s.qH.LEMON:return{...p.Rc,architecture:s.qH.LEMON,model_id:e.backendModelId,first_image:t,prompt:r,duration:u.yS.DURATION_5S,lemon_aspect_ratio:u.P4.ASPECT_RATIO_ADAPTIVE};case s.qH.MINIMAX_H3:return{...m.NW,architecture:s.qH.MINIMAX_H3,model_id:e.backendModelId,first_image:t,prompt:r}}}(Z,$.image,null!==(e=(0,a.VQ)(Q,X))&&void 0!==e?e:w.Be,{width:$.width,height:$.height})},[X,Z,Q,$]),ee=J?(0,P.BA)(J,V):0,et=ee>0,er=()=>{let e=I.xV.getState();Q&&(0,w.Pr)(Q)&&J&&!e.isAppPlaying&&e.playActionOverlay===e5.ANIMATE&&(0,E.o6)({architectureConfig:J,concept:void 0})},ei=(e=l.at(_),(0,w.Pr)(e));return(0,i.jsxs)(T.Stack,{gap:"sm",m:"xs",children:[(0,i.jsx)(M.Group,{justify:"flex-end",pr:"xs",style:{marginBottom:-8},children:(0,i.jsx)(K,{config:J})}),(0,i.jsxs)(k.Box,{bg:(0,O.X)("black",.8),bdrs:"xl",display:"flex",pr:"xs",style:{alignItems:"center",border:"1px solid var(--mantine-color-dark-4)",gap:"4px",borderRadius:"var(--mantine-radius-xl)"},children:[(0,i.jsx)(D.Textarea,{size:W?"xl":"lg",flex:1,minRows:1,maxRows:5,autosize:!0,placeholder:"Animate...",value:X,onChange:e=>{Y(e.currentTarget.value)},onKeyDown:e=>{t||"Enter"!==e.key||e.shiftKey||(e.preventDefault(),er())},styles:{input:{background:"transparent",border:"none",lineHeight:2}}}),(0,i.jsxs)(U.Menu,{position:"top-end",shadow:"md",withinPortal:!0,children:[(0,i.jsx)(U.Menu.Target,{children:(0,i.jsx)(N.Button,{size:W?"md":"xs",radius:"xl",variant:"light",color:"gray",c:"white",rightSection:(0,i.jsx)(G.A,{size:14}),children:Z.label})}),(0,i.jsx)(U.Menu.Dropdown,{children:R.db.map(e=>(0,i.jsx)(U.Menu.Item,{onClick:()=>F(e.id),c:e.id===Z.id?"orange":void 0,children:e.label},e.id))})]})]}),(0,i.jsx)(N.Button,{color:"gray",variant:"light",size:"xl",leftSection:r?(0,i.jsx)(H.Loader,{c:"white",size:20}):(0,i.jsx)(q.A,{color:ei?"white":"grey",size:25}),c:ei?"white":"grey",onClick:er,children:(0,i.jsxs)(M.Group,{gap:"xs",wrap:"nowrap",children:[et&&(0,i.jsx)(j.Space,{w:5}),(0,i.jsx)(L.Text,{size:"lg",fw:600,children:"Animate"}),et&&(0,i.jsx)(z.C,{gems:ee})]})})]})}var X=r(43608),Y=r(18403),Z=r(8141),Q=r(26029),$=r(91265);function J(e){let{aspectRatio:t,setAspectRatio:r}=(0,I.VT)("aspectRatio","setAspectRatio");return(0,i.jsx)(X.UnstyledButton,{onClick:()=>{r(e.aspectRatio)},children:(0,i.jsx)(Y.Card,{bg:e.aspectRatio===t?"dark.5":"dark.9",p:"xs",children:(0,i.jsxs)(T.Stack,{gap:"xs",children:[(0,i.jsx)(L.Text,{size:"xs",c:e.aspectRatio===t?"white":"dimmed",ta:"center",mb:-5,children:(0,A.Hv)(e.aspectRatio)}),(0,i.jsx)(Z.Center,{w:50,h:50,children:(0,i.jsx)("div",{style:{borderRadius:4,border:e.aspectRatio===t?"1px solid white":"1px solid grey",backgroundColor:"black",height:"min(50px, calc(50px / ".concat((0,A.c3)(e.aspectRatio),"))"),width:"min(50px, calc(50px * ".concat((0,A.c3)(e.aspectRatio),"))")}})}),(0,i.jsx)(L.Text,{size:"xs",c:e.aspectRatio===t?"white":"dimmed",ta:"center",children:e.aspectRatio})]})})})}function ee(){return(0,i.jsxs)(T.Stack,{gap:"sm",m:"xs",children:[(0,i.jsx)(Q.Badge,{variant:"light",color:"gray",size:"lg",children:"Aspect Ratio"}),(0,i.jsx)(Z.Center,{children:(0,i.jsx)($.ScrollArea,{type:"never",children:(0,i.jsx)(k.Box,{w:600,children:(0,i.jsx)(Z.Center,{children:(0,i.jsx)(M.Group,{children:Object.values(b.vW).map((e,t)=>(0,i.jsx)(J,{aspectRatio:e},"card-".concat(e,"-").concat(t)))})})})})})]})}var et=r(69267),er=r(37463),ei=r(10140),ea=r(2736),en=r(9057),eo=r(412),es=r(29728),el=r(65638),ec=r(59791);function ed(e){if(!(e.width<=0)&&!(e.height<=0))return(0,A.Qd)(e.width,e.height)}var eu=r(20038),ep=r(16791),em=r(33981),eg=r(9061),eh=r(91226);let ef=e=>void 0!==e&&"image"===e.type;function ev(){let e=(0,C.B)(),{isAppPlaying:t,playAppCreations:r,playAppViewIndex:a,editPrompt:n,setEditPrompt:o,editModelId:c,setEditModelId:d,generationMode:u,playActionOverlay:p,isDesktop:m}=(0,I.VT)("isAppPlaying","playAppCreations","playAppViewIndex","editPrompt","setEditPrompt","editModelId","setEditModelId","generationMode","playActionOverlay","isDesktop"),[g,h]=(0,B.useState)(n),[f]=(0,em.useDebouncedValue)(g,200);(0,B.useEffect)(()=>{f!==n&&o(f)},[f]);let v=(0,eu._2)(c),_=r.at(a),y=_&&"image"===_.type?_.data:void 0,b=(0,B.useMemo)(()=>
1{if(y)return function(e,t,r,i){var a,n,o,c,d,u;switch(e.architecture){case s.qH.MANGO:return{...es.wW,architecture:s.qH.MANGO,model_id:e.backendModelId,image:t,prompt:r,aspect_ratio:null!==(a=ed(i))&&void 0!==a?a:es.wW.aspect_ratio};case s.qH.GUAVA:return{...eo.aD,architecture:s.qH.GUAVA,model_id:e.backendModelId,image:t,prompt:r,aspect_ratio:null!==(n=ed(i))&&void 0!==n?n:eo.aD.aspect_ratio};case s.qH.GPT_IMAGE_2:return{...ei.s0,architecture:s.qH.GPT_IMAGE_2,model_id:e.backendModelId,image:t,prompt:r,quality:e.quality,aspect_ratio:null!==(o=ed(i))&&void 0!==o?o:ei.s0.aspect_ratio};case s.qH.NANO_BANANA_V2:return{...ec.Zd,architecture:s.qH.NANO_BANANA_V2,model_id:e.backendModelId,image:t,prompt:r,resolution:el.IV.RES_1K,nano_banana_v2_aspect_ratio:null!==(c=function(e){if(e.width<=0||e.height<=0)return;let t=Object.values(el.t6),r=e.width/e.height;return(0,l.Mq)(t,r)}(i))&&void 0!==c?c:ec.Zd.nano_banana_v2_aspect_ratio};case s.qH.FLUX2:return{...er.dk,architecture:s.qH.FLUX2,model_id:e.backendModelId,image:t,prompt:r,aspect_ratio:null!==(d=ed(i))&&void 0!==d?d:er.dk.aspect_ratio};case s.qH.GROK_IMAGE:return{...en.dO,architecture:s.qH.GROK_IMAGE,model_id:e.backendModelId,image:t,prompt:r,grok_image_aspect_ratio:null!==(u=function(e){if(e.width<=0||e.height<=0)return;let t=Object.values(ea.oS),r=e.width/e.height;return(0,l.Mq)(t,r)}(i))&&void 0!==u?u:en.dO.grok_image_aspect_ratio}}}(v,y.image,g,{width:y.width,height:y.height})},[g,v,y]),A=b?(0,P.BA)(b,u):0,S=A>0,x=async()=>{if((0,et.k)())return;let e=I.xV.getState();if(0===g.length){(0,ep.p6)({title:"Edit Prompt Required",message:"Please enter an edit prompt to edit the image"});return}_&&g&&e.playActionOverlay===e5.EDIT&&!e.isAppPlaying&&ef(_)&&b&&await (0,E.o6)({architectureConfig:b,concept:void 0})},R=p===e5.EDIT,w=ef(r.at(a));return(0,eg.useHotkeys)([["mod+enter",()=>{R&&x()}],["Enter",()=>{R&&x()}]],e?C.J:[]),(0,i.jsxs)(T.Stack,{gap:"sm",m:"xs",children:[(0,i.jsx)(M.Group,{justify:"flex-end",pr:"xs",style:{marginBottom:-8},children:(0,i.jsx)(K,{config:b})}),(0,i.jsxs)(k.Box,{bg:(0,O.X)("black",.8),bdrs:"xl",display:"flex",pr:"xs",style:{alignItems:"center",border:"1px solid var(--mantine-color-dark-4)",gap:"4px",borderRadius:"var(--mantine-radius-xl)"},children:[(0,i.jsx)(D.Textarea,{size:m?"xl":"lg",flex:1,minRows:1,maxRows:5,autosize:!0,placeholder:m?"Editing instructions.. (e.g. 'make the dress red')":"Edit...",value:g,onChange:e=>{h(e.currentTarget.value)},styles:{input:{background:"transparent",border:"none",lineHeight:2}}}),(0,i.jsxs)(U.Menu,{position:"top-end",shadow:"md",withinPortal:!0,children:[(0,i.jsx)(U.Menu.Target,{children:(0,i.jsx)(N.Button,{size:m?"md":"xs",radius:"xl",variant:"light",color:"gray",c:"white",rightSection:(0,i.jsx)(G.A,{size:14}),children:v.label})}),(0,i.jsx)(U.Menu.Dropdown,{children:eu.Q3.map(e=>(0,i.jsx)(U.Menu.Item,{onClick:()=>d(e.id),c:e.id===v.id?"orange":void 0,children:e.label},e.id))})]})]}),(0,i.jsx)(N.Button,{color:"gray",variant:"light",size:"xl",leftSection:t?(0,i.jsx)(H.Loader,{c:"white",size:20}):(0,i.jsx)(eh.A,{fill:w?"white":"grey",size:20}),onClick:x,c:w?"white":"grey",children:(0,i.jsxs)(M.Group,{gap:"xs",wrap:"nowrap",children:[S&&(0,i.jsx)(j.Space,{w:5}),(0,i.jsx)(L.Text,{size:"lg",fw:600,children:"Edit"}),S&&(0,i.jsx)(z.C,{gems:A})]})})]})}var e_=function(e){return e.ANIME="anime",e.PHOTOREALISM="photorealism",e}({}),ey=r(60681),eb=function(e){return e.LOW="low",e.MEDIUM="medium",e.HIGH="high",e}({});function eA(e,t,r,i){var a;return{architecture:s.qH.ENHANCE,image:e,prompt:null!==(a=t.prompt)&&void 0!==a?a:"best quality",strength:function(e){if("number"==typeof e)return e;switch(e){case"low":return .1;case"high":return .5;default:return .3}}(i),negative_prompt:t.negative_prompt,enhance_type:r,num_inference_steps:40,upscaler:r===e_.ANIME?ey.y.R_ESRGAN_X2_ANIME_V2:ey.y.LANCZOS,prompt_filter:t.prompt_filter,dynamic_prompt:t.dynamic_prompt,prompt_enhance:t.prompt_enhance}}var eS=r(61282),ex=r(32191),eR=r(24104),eI=r(74634),eC=r(93751),ew=r(9385),eE=r(18229),eP=r(23552);let eT=(e,t,r)=>void 0!==e&&"image"===e.type&&!(e.data.width>=4e3)&&!(e.data.height>=4e3)&&(r===F.o.GEMS||t!==eS.c.FREE&&(!(e.data.width>=2e3)&&!(e.data.height>=2e3)||t===eS.c.PRO_PLUS||t===eS.c.MAX));function eM(){let{generationMode:e,userMembership:t,playAppCreations:r,playAppViewIndex:a}=(0,I.xV)((0,eP.k)(e=>({generationMode:e.generationMode,userMembership:e.userMembership,playAppCreations:e.playAppCreations,playAppViewIndex:e.playAppViewIndex}))),n=r.at(a);if(n){if(n.data.width>=4e3||n.data.height>=4e3)return(0,i.jsx)(eI.Alert,{title:(0,i.jsx)(eC.Title,{order:5,c:"white",children:"Maximum Size Reached"}),color:"black",children:(0,i.jsx)(L.Text,{size:"md",children:"Need more power? Let us know on Discord! We'd love to hear your feedback."})});if(e===F.o.GEMS)return null;if(t===eS.c.FREE||t!==eS.c.PRO_PLUS&&t!==eS.c.MAX&&(n.data.width>=2e3||n.data.height>=2e3)){let e=t===eS.c.FREE?"Become a Mage member to unlock this feature, and much more!":"Upgrade your membership to Pro Plus for more power!";return(0,i.jsx)(eI.Alert,{title:(0,i.jsx)(eC.Title,{order:5,children:"Upgrade Required"}),color:"orange",children:(0,i.jsxs)(T.Stack,{children:[(0,i.jsx)(L.Text,{size:"md",children:e}),(0,i.jsx)(N.Button,{color:"orange",size:"lg",fullWidth:!0,onClick:()=>{t===eS.c.FREE?(0,ex.eo)(t,eS.c.BASIC):(0,ex.eo)(t,eS.c.PRO_PLUS)},children:"View Memberships"})]})})}}return null}function ek(){let e=(0,C.B)(),{isAppPlaying:t,userMembership:r,playAppCreations:a,playAppViewIndex:n,generationMode:o}=(0,I.xV)((0,eP.k)(e=>({isAppPlaying:e.isAppPlaying,userMembership:e.userMembership,playAppCreations:e.playAppCreations,playAppViewIndex:e.playAppViewIndex,generationMode:e.generationMode}))),[s,l]=(0,B.useState)(e_.PHOTOREALISM),[c,d]=(0,B.useState)(eb.LOW),[u,p]=(0,B.useState)(!1),m=a.at(n),g=eT(m,r,o),h=0;eT(m,r,o)&&m.architecture_config&&(h=(0,P.BA)(eA(m.data.image,m.architecture_config,s,c),o));let f=h>0,v=async()=>
1{if((0,et.k)())return;let e=I.xV.getState(),t=e.playAppCreations.at(e.playAppViewIndex);if(t&&e.playActionOverlay===e5.ENHANCE&&!e.isAppPlaying&&eT(t,e.userMembership,e.generationMode)){let e=t.architecture_config;if(!e){(0,eR.fl)(new eR.Lz);return}let r=eA(t.data.image,e,s,c);await (0,E.T)({architectureConfig:r,architectureConfigToSave:e})}};return(0,eg.useHotkeys)([["Enter",()=>v()]],e?C.J:[]),(0,i.jsxs)(T.Stack,{gap:"sm",m:"xs",children:[(0,i.jsx)(N.Button,{ml:"auto",size:"compact-xs",variant:"transparent",c:u?"orange":"white",onClick:()=>p(e=>!e),children:"Advanced"}),(0,i.jsx)(eM,{}),(0,i.jsx)(ew.Collapse,{in:u,children:(0,i.jsx)(T.Stack,{gap:"sm",children:(0,i.jsxs)(eE.SimpleGrid,{cols:3,spacing:"xs",children:[(0,i.jsx)(N.Button,{variant:"light",color:c===eb.LOW?"orange":"gray",size:"compact-md",onClick:()=>d(eb.LOW),children:"Low"}),(0,i.jsx)(N.Button,{variant:"light",color:c===eb.MEDIUM?"orange":"gray",size:"compact-md",onClick:()=>d(eb.MEDIUM),children:"Medium"}),(0,i.jsx)(N.Button,{variant:"light",color:c===eb.HIGH?"orange":"gray",size:"compact-md",onClick:()=>d(eb.HIGH),children:"High"})]})})}),(0,i.jsxs)(eE.SimpleGrid,{cols:2,spacing:"xs",children:[(0,i.jsx)(N.Button,{variant:"light",color:s===e_.PHOTOREALISM?"orange":"gray",size:"md",onClick:()=>l(e_.PHOTOREALISM),children:"Photorealism"}),(0,i.jsx)(N.Button,{variant:"light",color:s===e_.ANIME?"orange":"gray",size:"md",onClick:()=>l(e_.ANIME),children:"Anime"})]}),(0,i.jsx)(N.Button,{color:"gray",variant:"light",size:"xl",leftSection:t?(0,i.jsx)(H.Loader,{c:"white",size:20}):(0,i.jsx)(eh.A,{fill:g?"white":"grey",size:20}),c:g?"white":"grey",onClick:v,children:(0,i.jsxs)(M.Group,{gap:"xs",wrap:"nowrap",children:[f&&(0,i.jsx)(j.Space,{w:5}),(0,i.jsx)(L.Text,{size:"lg",fw:600,children:"Enhance"}),f&&(0,i.jsx)(z.C,{gems:h})]})})]})}var eO=r(25892);function eD(e,t,r){return!!(0,eO.ps)(e)&&(r===F.o.GEMS||(0,ex.kx)(t,eS.c.PRO,!1))}function eU(){let{generationMode:e,userMembership:t}=(0,I.xV)((0,eP.k)(e=>({generationMode:e.generationMode,userMembership:e.userMembership})));return e===F.o.GEMS||t===eS.c.PRO||t===eS.c.PRO_PLUS||t===eS.c.MAX?null:(0,i.jsx)(eI.Alert,{title:(0,i.jsx)(eC.Title,{order:5,children:"Upgrade Required"}),color:"orange",mb:-15,children:(0,i.jsxs)(T.Stack,{children:[(0,i.jsx)(L.Text,{size:"md",children:"Become a Mage Pro member to unlock this feature, and much more!"}),(0,i.jsx)(N.Button,{color:"orange",size:"lg",fullWidth:!0,onClick:()=>{(0,ex.eo)(t,eS.c.PRO)},children:"View Memberships"})]})})}function eN(){let e=(0,C.B)(),{isAppPlaying:t,userMembership:r,playAppCreations:a,playAppViewIndex:n,playActionOverlay:o,generationMode:s}=(0,I.xV)((0,eP.k)(e=>({isAppPlaying:e.isAppPlaying,userMembership:e.userMembership,playAppCreations:e.playAppCreations,playAppViewIndex:e.playAppViewIndex,playActionOverlay:e.playActionOverlay,generationMode:e.generationMode}))),[l,c]=(0,B.useState)(""),[d]=(0,em.useDebouncedValue)(l,200),[u,p]=(0,B.useState)(!1),m=a.at(n),g=eD(m,r,s),h=0;(null==m?void 0:m.architecture_config)&&(h=(0,P.BA)(m.architecture_config,s));let f=h>0,v=async()=>{let e=a.at(n);if(!t&&e&&o===e5.EXTEND&&eD(e,r,s)&&!u){p(!0);try{await (0,eO.YH)(e,d)}catch(e){console.error("Extend failed",e)}finally{p(!1)}}};return(0,i.jsxs)(T.Stack,{gap:"sm",m:"xs",children:[(0,i.jsx)(eU,{}),(0,i.jsx)(D.Textarea,{size:"xl",w:"100%",minRows:1,maxRows:5,radius:"xl",autosize:!0,placeholder:"Extension prompt (optional)...",value:l,onChange:e=>{c(e.currentTarget.value)},onKeyDown:t=>{e||"Enter"!==t.key||t.shiftKey||(t.preventDefault(),v())},styles:{input:{background:(0,O.X)("black",.8)}}}),(0,i.jsx)(N.Button,{color:"gray",variant:"light",size:"xl",leftSection:t||u?(0,i.jsx)(H.Loader,{c:"white",size:20}):(0,i.jsx)(q.A,{color:g?"white":"grey",size:25}),c:g?"white":"grey",onClick:v,children:(0,i.jsxs)(M.Group,{gap:"xs",wrap:"nowrap",children:[f&&(0,i.jsx)(j.Space,{w:5}),(0,i.jsx)(L.Text,{size:"lg",fw:600,children:u?"Loading...":"Extend"}),f&&(0,i.jsx)(z.C,{gems:h})]})})]})}var eH=r(41792),ej=r(24524),eL=r(56645),eG=r(96089),eq=r(60266),eB=r(80975),eF=r(49077),eV=r(51423),eK=r(31951);function ez(){let{image:e,setImage:t,user:r}=(0,I.VT)("image","setImage","user"),[a,n]=(0,B.useState)(!1),[o,s]=(0,B.useState)(!1);return(0,i.jsxs)(eq.Popover,{position:"top-start",keepMounted:!0,withinPortal:!0,onClose:()=>n(!1),opened:a,children:[(0,i.jsx)(eB.PopoverTarget,{children:(0,i.jsx)(N.Button,{color:"gray",variant:"light",size:"compact-sm",h:"calc(100% - 12px)",mr:5,w:"100%",style:{borderTopRightRadius:25,borderBottomRightRadius:25},onClick:()=>n(e=>!e),children:(0,i.jsx)(k.Box,{mr:5,children:e?(0,i.jsx)(eF.Image,{maw:35,mah:35,src:e}):(0,i.jsx)(eK.A,{})})})}),(0,i.jsx)(eV.PopoverDropdown,{bg:(0,O.X)("black",.8),children:(0,i.jsxs)(T.Stack,{gap:5,children:[(0,i.jsx)(N.Button,{variant:"light",color:"gray",disabled:!e,onClick:async()=>{let e=I.xV.getState(),t=e.image;if(t){var r;
1let i=await (0,eL.vX)(t);e.addPlayAppCreation({type:"image",data:{image:t,moderation:{is_nsfw:!1,is_forbidden:!1,concepts:{}},embedding:[],seed:42,width:i.width,height:i.height},duration:0,app_id:"",concept_id:null===(r=e.concept)||void 0===r?void 0:r.id,architecture_config:e.getActiveArchitectureConfig(),is_saveable:!1})}},children:"Edit"}),(0,i.jsx)(N.Button,{variant:"light",color:"gray",onClick:()=>{t(null),n(!1)},disabled:!e,children:"Clear"}),(0,i.jsx)(k.Box,{onClick:()=>(0,eG.M3)(),children:(0,i.jsx)(eH.Kc,{resolve:async e=>{let r=I.xV.getState();if(r.user){s(!0);try{let i=await (0,ej.e)(e,r.user.uid);t(i)}catch(e){console.error("Error adding image:",e),(0,ep.p6)({title:"Adding Image Failed",message:"We had an issue adding the image. Please try again?"})}finally{s(!1),n(!1)}}},p:0,withoutBackground:!0,withoutBorder:!0,disabled:null===r||r.isAnonymous,children:(0,i.jsx)(N.Button,{variant:"light",color:"gray",loading:o,children:"Select"})})})]})})]})}function eW(){let{prompt:e,setPrompt:t}=(0,I.VT)("prompt","setPrompt"),[r,a]=(0,B.useState)(e),[n]=(0,em.useDebouncedValue)(r,200);return(0,B.useEffect)(()=>{n!==e&&t(n)},[n]),(0,i.jsx)(T.Stack,{gap:"sm",mx:"xs",children:(0,i.jsx)(D.Textarea,{size:"xl",w:"100%",mb:"xs",minRows:1,maxRows:5,radius:"xl",autosize:!0,placeholder:"Describe to generate...",rightSectionWidth:60,value:r,onChange:e=>{a(e.currentTarget.value)},styles:{input:{background:(0,O.X)("black",.8)}},rightSection:(0,i.jsx)(ez,{})})})}var eX=r(52560),eY=function(e){return e.LOW="low",e.MEDIUM="medium",e.HIGH="high",e}({}),eZ=function(e){return e.FAST="fast",e.SLOW="slow",e}({});function eQ(e,t,r,i){var a;let n="slow"===i;return{architecture:s.qH.REFINE,image:e,prompt:null!==(a=t.prompt)&&void 0!==a?a:"best quality",strength:function(e){if("number"==typeof e)return e;switch(e){case"low":return .1;case"high":return .5;default:return .3}}(r),model_id:n?eX.ye:eX.KC,num_inference_steps:n?30:8,guidance_scale:3.5*!!n,negative_prompt:t.negative_prompt,prompt_filter:t.prompt_filter,dynamic_prompt:t.dynamic_prompt,prompt_enhance:t.prompt_enhance}}function e$(e,t,r){return void 0!==e&&"image"===e.type&&(r===F.o.GEMS||t!==eS.c.FREE)}function eJ(){let{generationMode:e,userMembership:t,playAppCreations:r,playAppViewIndex:a}=(0,I.xV)((0,eP.k)(e=>({generationMode:e.generationMode,userMembership:e.userMembership,playAppCreations:e.playAppCreations,playAppViewIndex:e.playAppViewIndex})));return(r.at(a),e===F.o.GEMS)?null:t===eS.c.FREE?(0,i.jsx)(eI.Alert,{title:(0,i.jsx)(eC.Title,{order:5,children:"Upgrade Required"}),color:"orange",children:(0,i.jsxs)(T.Stack,{children:[(0,i.jsx)(L.Text,{size:"md",children:"Become a Mage member to unlock this feature, and much more!"}),(0,i.jsx)(N.Button,{color:"orange",size:"lg",fullWidth:!0,onClick:()=>{(0,ex.eo)(t,eS.c.BASIC)},children:"View Memberships"})]})}):null}function e0(){let e=(0,C.B)(),{isAppPlaying:t,userMembership:r,playAppCreations:a,playAppViewIndex:n,generationMode:o}=(0,I.xV)((0,eP.k)(e=>({isAppPlaying:e.isAppPlaying,userMembership:e.userMembership,playAppCreations:e.playAppCreations,playAppViewIndex:e.playAppViewIndex,generationMode:e.generationMode}))),[s,l]=(0,B.useState)(!1),[c,d]=(0,B.useState)(eY.MEDIUM),[u,p]=(0,B.useState)(eZ.SLOW),m=a.at(n),g=e$(m,r,o),h=0;e$(m,r,o)&&m.architecture_config&&(h=(0,P.BA)(eQ(m.data.image,m.architecture_config,c,u),o));let f=h>0,v=async()=>{if((0,et.k)())return;let e=I.xV.getState(),t=e.playAppCreations.at(e.playAppViewIndex);if(t&&e.playActionOverlay===e5.REFINE&&!e.isAppPlaying&&e$(t,e.userMembership,e.generationMode)){let e=t.architecture_config;if(!e){(0,eR.fl)(new eR.Lz);return}let r=eQ(t.data.image,e,c,u);await (0,E.T)({architectureConfig:r,architectureConfigToSave:e})}};return(0,eg.useHotkeys)([["Enter",()=>v()]],e?C.J:[]),(0,i.jsxs)(T.Stack,{gap:"sm",m:"xs",children:[(0,i.jsx)(N.Button,{ml:"auto",size:"compact-xs",variant:"transparent",c:s?"orange":"white",onClick:()=>l(e=>!e),children:"Advanced"}),(0,i.jsx)(eJ,{}),(0,i.jsx)(ew.Collapse,{in:s,children:(0,i.jsxs)(T.Stack,{gap:"sm",children:[(0,i.jsxs)(eE.SimpleGrid,{cols:3,spacing:"xs",children:[(0,i.jsx)(N.Button,{variant:"light",color:c===eY.LOW?"orange":"gray",size:"compact-md",onClick:()=>d(eY.LOW),children:"Low"}),(0,i.jsx)(N.Button,{variant:"light",color:c===eY.MEDIUM?"orange":"gray",size:"compact-md",onClick:()=>d(eY.MEDIUM),children:"Medium"}),(0,i.jsx)(N.Button,{variant:"light",color:c===eY.HIGH?"orange":"gray",size:"compact-md",onClick:()=>d(eY.HIGH),children:"High"})]}),(0,i.jsxs)(eE.SimpleGrid,{cols:2,spacing:"xs",children:[(0,i.jsx)(N.Button,{variant:"light",color:u===eZ.FAST?"orange":"gray",size:"compact-md",onClick:()=>p(eZ.FAST),children:"Fast"}),(0,i.jsx)(N.Button,{variant:"light",color:u===eZ.SLOW?"orange":"gray",size:"compact-md",onClick:()=>p(eZ.SLOW),children:"Slow"})]})]})}),(0,i.jsx)(N.Button,{color:"gray",variant:"light",size:"xl",leftSection:t?(0,i.jsx)(H.Loader,{c:"white",size:20}):(0,i.jsx)(eh.A,{fill:g?"white":"grey",size:20}),c:g?"white":"grey",onClick:v,children:(0,i.jsxs)(M.Group,{gap:"xs",wrap:"nowrap",children:[f&&(0,i.jsx)(j.Space,{w:5}),(0,i.jsx)(L.Text,{size:"lg",fw:600,children:"Refine"}),f&&(0,i.jsx)(z.C,{gems:h})]})})]})}var e1=r(46647),e2=r(45510),e5=function(e){return e.ENHANCE="enhance",e.INPAINT="inpaint",e.PROMPT="prompt",e.ASPECT_RATIO="aspect-ratio",e.ANIMATE="animate",e.EXTEND="extend",e.REFINE="refine",e.EDIT="edit",e}({});function e3(){let{playActionOverlay:e}=(0,I.xV)((0,eP.k)(e=>({playActionOverlay:e.playActionOverlay})));return(0,i.jsx)(k.Box,{children:(0,i.jsxs)(e1.Tabs,{value:e,children:[(0,i.jsx)(e2.TabsPanel,{value:"refine",children:(0,i.jsx)(e0,{})}),(0,i.jsx)(e2.TabsPanel,{value:"enhance",children:(0,i.jsx)(ek,{})}),(0,i.jsx)(e2.TabsPanel,{value:"inpaint",children:(0,i.jsx)(i.Fragment,{})}),(0,i.jsx)(e2.TabsPanel,{value:"animate",children:(0,i.jsx)(W,{})}),(0,i.jsx)(e2.TabsPanel,{value:"extend",children:(0,i.jsx)(eN,{})}),(0,i.jsx)(e2.TabsPanel,{value:"prompt",children:(0,i.jsx)(eW,{})}),(0,i.jsx)(e2.TabsPanel,{value:"aspect-ratio",children:(0,i.jsx)(ee,{})}),(0,i.jsx)(e2.TabsPanel,{value:"edit",children:(0,i.jsx)(ev,{})})]})})}},32780:(e,t,r)=>{"use strict";r.d(t,{w:()=>a});var i=r(34477);let a=(0,i.createServerReference)("709d418b280d06c624f01a39c3138a2c0eb2b83681",i.callServer,void 0,i.findSourceMapURL,"getReferencesPaginated")},32826:(e,t,r)=>{"use strict";r.d(t,{jg:()=>i,n:()=>a}),r(77567),r(24155);let i=1024,a=1816},33082:(e,t,r)=>{"use strict";r.d(t,{i:()=>l});var i=r(95155),a=r(94055),n=r(12115),o=r(44323);let s=n.memo(function(e){let{creation:t}=e;return(0,i.jsx)(o.t,{src:t.url,alt:"Creation preview ".concat(t.id),maxWidth:a.oW,architectureConfig:t.architecture_config})},(e,t)=>e.creation.id===t.creation.id);function l(e){return(0,i.jsx)(s,{creation:e.creations[e.idx]})}},33508:(e,t,r)=>{"use strict";r.d(t,{g:()=>a});var i=r(34477);let a=(0,i.createServerReference)("78a913af3c70cb7a6cc0357a3ece38785074cc1c58",i.callServer,void 0,i.findSourceMapURL,"getCreationsPaginated")},33749:(e,t,r)=>{"use strict";r.d(t,{$A:()=>s,Dl:()=>l,ED:()=>n,KT:()=>o,kI:()=>c});var i=r(41770),a=r(58649);let n=21,o=2;function s(e){var t;return Number(null!==(t=e.duration)&&void 0!==t?t:a.NW.duration)}function l(e){let t=function(e){var t,r,a;let n=s(e),l=(0,i.S)(e).allImages.length,c=null!==(r=e.video_durations_s)&&void 0!==r?r:[],d=n+l*o;for(let r=0;r<(null!==(a=null===(t=e.videos)||void 0===t?void 0:t.length)&&void 0!==a?a:0);r++){let e=c[r],t=n;Number.isFinite(e)&&e>0&&(t=Math.min(e,n)),d+=1.15*t}return d}(e);return t<=n+1e-9?null:"Reference budget exceeded: a ".concat(s(e),"s video with these references needs ").concat(Math.ceil(t),"s of the ").concat(n,"s MiniMax-H3 can carry. Shorten the video or remove a reference — each image counts as ").concat(o,"s and each reference video as its own length (up to the video’s).")}function c(e){return a.QI.filter(t=>{var r,i;return!(!(0,a.VK)(e.model_id)&&Number(t)>a.OG||(null!==(i=null===(r=e.lora)||void 0===r?void 0:r.length)&&void 0!==i?i:0)>=a.zK&&Number(t)>a.sM)&&null===l({...e,duration:t})})}},33948:(e,t,r)=>{"use strict";r.d(t,{n:()=>E});var i=r(95155),a=r(28076),n=r(77567),o=r(16791),s=r(18403),l=r(21220),c=r(70112),d=r(93751),u=r(95642),p=r(8141),m=r(58887),g=r(8593),h=r(912
165),f=r(43608),v=r(69604),_=r(81001),y=r(70714),b=r(26903),A=r(33981),S=r(91423),x=r(22439),R=r(37218),I=r(37712),C=r(31951),w=r(12115);function E(e){let{onSelect:t,onSelectCreation:r,filterType:E,multiSelect:P,onMultiSelect:T,title:M,onClose:k}=e,{user:O,isDesktop:D}=(0,n.VT)("user","isDesktop"),[U,N]=(0,w.useState)(""),[H]=(0,A.useDebouncedValue)(U,300),[j,L]=(0,w.useState)(new Map),G="creations-".concat(E,"-").concat(H),q=null!=M?M:"Choose from Creations",B=null!=k?k:S.s7,F=async e=>{if(P){L(t=>{let r=new Map(t);return r.has(e.id)?r.delete(e.id):r.set(e.id,e),r});return}if(t||r)try{(r?await r(e):await t(e.url))&&B()}catch(e){console.error("Error selecting creation:",e),(0,o.p6)({title:"Failed to select image",message:"Please try again."})}};return O?(0,i.jsx)(s.Card,{bg:"dark.9",p:"lg",radius:"lg",maw:600,w:"100%",mx:"auto",children:(0,i.jsxs)(l.Stack,{gap:"md",children:[(0,i.jsxs)(c.Group,{justify:"space-between",children:[D?(0,i.jsx)(d.Title,{order:3,c:"white",children:q}):(0,i.jsx)(m.Text,{fw:600,size:"md",c:"white",children:q}),(0,i.jsx)(u.CloseButton,{onClick:B})]}),(0,i.jsx)(g.TextInput,{placeholder:"Search creations...",leftSection:(0,i.jsx)(x.A,{size:16}),value:U,onChange:e=>N(e.currentTarget.value),size:"sm",styles:{input:{fontSize:16}}}),(0,i.jsx)(h.ScrollArea,{h:400,offsetScrollbars:!0,children:(0,i.jsx)(a.V,{uid:O.uid,orderBy:"desc",type:E,prompt:H.length>0?H:void 0,columns:D?3:2,onSelect:P?void 0:F,renderItem:P?(e,t)=>{let r=j.has(e.id);return(0,i.jsxs)(f.UnstyledButton,{onClick:()=>F(e),component:"div",style:{width:"100%",position:"relative",borderRadius:8,overflow:"hidden",fontSize:0},children:[(0,i.jsx)(v.Box,{pos:"absolute",top:0,right:0,style:{zIndex:2},children:(0,i.jsx)(_.ActionIcon,{variant:"transparent",m:"xs",opacity:.8,onClick:t=>{t.stopPropagation(),F(e)},children:r?(0,i.jsx)(R.A,{color:"white"}):(0,i.jsx)(I.A,{color:"white"})})}),r&&(0,i.jsx)(v.Box,{pos:"absolute",top:0,left:0,style:{zIndex:1,width:"100%",height:"100%",backgroundColor:(0,y.X)("black",.5)}}),t]})}:void 0},G)}),P&&(0,i.jsxs)(b.Button,{onClick:()=>{B(),T&&T(Array.from(j.values()))},disabled:0===j.size,fullWidth:!0,variant:"light",color:"orange",leftSection:(0,i.jsx)(C.A,{size:16}),children:["Add Selected (",j.size,")"]})]})}):(0,i.jsx)(s.Card,{bg:"dark.9",p:"lg",radius:"lg",maw:600,w:"100%",mx:"auto",children:(0,i.jsxs)(l.Stack,{gap:"md",children:[(0,i.jsxs)(c.Group,{justify:"space-between",children:[(0,i.jsx)(d.Title,{order:3,c:"white",children:q}),(0,i.jsx)(u.CloseButton,{onClick:B})]}),(0,i.jsx)(p.Center,{h:300,children:(0,i.jsx)(m.Text,{c:"dimmed",children:"Please log in to view your saved creations."})})]})})}},34442:(e,t,r)=>{"use strict";r.d(t,{WQ:()=>c,qI:()=>d});var i=r(4717),a=r(16162),n=r(74532),o=r(56800),s=r(94669);let l="anima-v1",c={architecture:o.qH.ANIMA,model_id:l,prompt:"",resolution:s.d.RES_1K,scheduler:s.U.EULER,shift:3,prompt_weighting:!0,num_inference_steps:30,guidance_scale:5,aspect_ratio:i.vW.PORTRAIT,prompt_filter:(0,n.jM)(a.y1,e=>{e&&(e.prompt="masterpiece, best quality, score_9, score_8, score_7, year 2025, newest, highres, absurdres, very aesthetic, {prompt}",e.negative_prompt="extra digits, conjoined fingers, wrong hand, extra legs, worst quality, low quality, early, old, score_1, score_2, score_3, cartoon, graphic, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured, long body, bad anatomy, bad hands, missing fingers, extra fingers, extra digits, fewer digits, cropped, very displeasing, artist name, blurry, jpeg artifacts, lowres, censor,  text bubble, speech bubble, child, kid, young")})},d={architecture:o.qH.ANIMA,name:"Anima",short_name:"Anima",popularity:0,tags:[o.fZ,o.R$],models:[{id:l,name:"Anima v1"}],api_path:"/api/v1/anima",agent:{description:"Anime-style image model. Escape literal parentheses in the prompt as \\( and \\).",defaultConfig:c,options:{resolution:Object.values(s.d)}}}},34795:(e,t,r)=>{"use strict";r.d(t,{q:()=>u,w:()=>d});var i=r(34477);let a=(0,i.createServerReference)("0060d1fb72073d13bafe505158eb9f2fae5422b2ca",i.callServer,void 0,i.findSourceMapURL,"getCreditBalance");var n=r(62878),o=r(77567),s=r(41441),l=r(16791),c=r(96089);function d(){(0,l.bA)({title:"Maximum Gems Balance Reached",message:"Please use your available Gems to create content. This limit is temporary."})}
1async function u(e){try{let t=o.xV.getState();if(!(0,c.M3)()||!t.user)return!1;if(await a()>=n.YH)return d(),!1;let r=await (0,s.m)(e);return window.location.assign(r),!0}catch(e){return console.error("Error checking out for credits: ".concat(JSON.stringify(e))),(0,l.p6)({title:"Checkout Issue",message:"We had an issue redirecting you. Try again?"}),!1}}},34827:(e,t,r)=>{"use strict";r.d(t,{LG:()=>R,$u:()=>A,kg:()=>S,Ww:()=>x});var i=r(95155),a=r(61282),n=r(34795),o=r(70112),s=r(58887),l=r(12115),c=r(21220),d=r(69604),u=r(53776),p=r(26903),m=r(47639),g=r(73883),h=r(97753),f=r.n(h);function v(e){let{title:t,price:r,features:a,onSelect:n,backgroundImage:l,loading:h,style:v,buttonText:_,buttonBg:y,onSelectOverride:b,recommendation:A}=e;return(0,i.jsx)(g.RL,{backgroundImage:l,recommendation:A,style:v,children:(0,i.jsxs)(c.Stack,{gap:24,p:24,h:"100%",justify:"space-between",children:[(0,i.jsxs)(c.Stack,{gap:24,children:[(0,i.jsxs)(c.Stack,{gap:8,children:[(0,i.jsx)(g.fc,{recommendation:A}),(0,i.jsxs)(c.Stack,{gap:4,children:[(0,i.jsx)(s.Text,{fz:36,fw:700,component:"div",children:t}),(0,i.jsxs)(o.Group,{align:"flex-start",gap:4,children:[(0,i.jsxs)(s.Text,{fz:30,fw:500,c:"white",lh:1,children:["$",r]}),(0,i.jsx)(s.Text,{fz:14,c:"dimmed",mt:-2,children:"one-time"})]})]}),(0,i.jsx)(g.eF,{recommendation:A})]}),(0,i.jsx)(c.Stack,{gap:0,children:a.map((e,t)=>(0,i.jsxs)(d.Box,{children:[(0,i.jsxs)(o.Group,{gap:12,wrap:"nowrap",py:8,children:[(0,i.jsx)(m.A,{size:16,color:"white",opacity:.85}),(0,i.jsx)(s.Text,{fz:14,c:"white",opacity:.85,flex:1,children:e.text})]}),(0,i.jsx)(u.Divider,{color:"white",opacity:.25})]},t))})]}),(0,i.jsx)(p.Button,{onClick:null!=b?b:n,loading:h,size:"lg",variant:"white",className:y?void 0:f().button,bg:y,c:y?"white":"black",children:null!=_?_:"Purchase"})]})})}let _="Fast Mode for all models",y="Unlock all models and settings";function b(e){let{amount:t}=e;return(0,i.jsxs)(o.Group,{align:"flex-start",gap:4,wrap:"nowrap",children:[(0,i.jsx)("span",{children:t.toLocaleString()}),(0,i.jsx)(s.Text,{component:"span",fz:14,fw:400,c:"dimmed",pt:10,children:"Gems"})]})}function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,r]=(0,l.useState)(!1),o=async()=>{r(!0),await (0,n.q)(a.t.GEMS)||r(!1)};return(0,i.jsx)(v,{title:(0,i.jsx)(b,{amount:1e4}),price:10,features:[{text:"10,000 Mage Gems"},{text:y},{text:_},{text:"Higher Resolution & Longer Duration for Videos"},{text:"Motion Control"}],onSelect:o,loading:t,backgroundImage:null===e.backgroundImage?void 0:e.backgroundImage,buttonText:e.buttonText,buttonBg:e.buttonBg,onSelectOverride:e.onSelectOverride,recommendation:e.recommendation})}function S(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[r,o]=(0,l.useState)(!1),s=async()=>{o(!0),await (0,n.q)(a.t.GEMS_20K)||o(!1)};return(0,i.jsx)(v,{title:(0,i.jsx)(b,{amount:20500}),price:20,features:[{text:"20,000 Mage Gems + 500 Bonus Gems"},{text:y},{text:_},{text:"Higher Resolution & Longer Duration for Videos"},{text:"Motion Control"}],onSelect:s,loading:r,backgroundImage:null===t.backgroundImage?void 0:null!==(e=t.backgroundImage)&&void 0!==e?e:"/membership/gradient-1-orange.jpg",buttonText:t.buttonText,buttonBg:t.buttonBg,onSelectOverride:t.onSelectOverride,recommendation:t.recommendation})}function x(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[r,o]=(0,l.useState)(!1),s=async()=>{o(!0),await (0,n.q)(a.t.GEMS_40K)||o(!1)};return(0,i.jsx)(v,{title:(0,i.jsx)(b,{amount:42e3}),price:40,features:[{text:"40,000 Mage Gems + 2,000 Bonus Gems"},{text:y},{text:_},{text:"Higher Resolution & Longer Duration for Videos"},{text:"Motion Control"}],onSelect:s,loading:r,backgroundImage:null===t.backgroundImage?void 0:null!==(e=t.backgroundImage)&&void 0!==e?e:"/membership/gradient-1-orange.jpg",buttonText:t.buttonText,buttonBg:t.buttonBg,onSelectOverride:t.onSelectOverride,recommendation:t.recommendation})}function R(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[r,o]=(0,l.useState)(!1),s=async()=>{o(!0),await (0,n.q)(a.t.GEMS_100K)||o(!1)};return(0,i.jsx)(v,{title:(0,i.jsx)(b,{amount:11e4}),price:100,features:[{text:"100,000 Mage Gems + 10,000 Bonus Gems"},{text:y},{text:_},{text:"Higher Resolution & Longer Duration for Videos"},{text:"Motion Control"}],onSelect:s,loading:r,backgroundImage:null===t.backgroundImage?void 0:null!==(e=t.backgroundImage)&&void 0!==e?e:"/membership/gradient-2-blue.jpg",buttonText:t.buttonText,buttonBg:t.buttonBg,onSelectOverride:t.onSelectOverride,recommendation:t.recommendation})}},36052:(e,t,r)=>{"use strict";r.d(t,{I:()=>n});var i=r(9541),a=r(12115);function n(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{rootMargin:r="0px"}=t,{ref:n,entry:o}=(0,i.useIntersection)({rootMargin:r}),[s,l]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(null==o?void 0:o.isIntersecting)&&!s&&l(!0)},[null==o?void 0:o.isIntersecting,s]);let c=null!==(e=null==o?void 0:o.isIntersecting)&&void 0!==e&&e;return{ref:n,hasEnteredViewport:s||c}}},36391:(e,t,r)=>{"use strict";r.d(t,{Aq:()=>f,gU:()=>y,kc:()=>_,qD:()=>v});var i=r(20036),a=r(17157),n=r(56800),o=r(7538),s=r(501),l=r(29728),c=r(64930),d=r(15483),u=r(77567),p=r(16791),m=r(27104),g=r(88179);function h(){let e=u.xV.getState(),t=e.getActiveArchitectureConfig();return(0,o.qj)(e.activeArchitecture,t.model_id)}function f(e){var t,r,i,a,o,s,p,m,h,f;let v,{reference:_,nextPrompt:y,switchToMango:b=!1,focusPromptbarOnSuccess:A=!0}=e,S=u.xV.getState(),x=S.getActiveArchitectureConfig(),R=b?n.qH.MANGO:S.activeArchitecture,I=b?l.wW.model_id:x.model_id;if(!I)return!1;
1let C="uid"in _?(0,d.ZO)(_):{id:_.id,name:_.name,username:_.username,image_url:_.image_url,variant:_.variant,modality:"image"},w=[...null!==(t=x.references)&&void 0!==t?t:[],C],E={model_id:I,image:null!==(r=S.image)&&void 0!==r?r:void 0,additional_images:null!==(i=S.additionalImages)&&void 0!==i?i:void 0,characters:null!==(a=x.characters)&&void 0!==a?a:[],references:w,moodboard:x.moodboard};return(0,g.UH)(R,E)>(0,g.iQ)(R,E)?((0,g.Ys)((0,g.Zv)(R,{modelId:I,moodboard:E.moodboard,characterCount:null!==(p=null===(o=E.characters)||void 0===o?void 0:o.length)&&void 0!==p?p:0,referenceCount:null!==(m=null===(s=E.references)||void 0===s?void 0:s.length)&&void 0!==m?m:0}),"attachment"),!1):(b?(v=S.setActiveArchitectureConfig({...l.wW,prompt:null!=y?y:S.prompt,aspect_ratio:S.aspectRatio,image:null!==(h=S.image)&&void 0!==h?h:void 0,additional_images:null!==(f=S.additionalImages)&&void 0!==f?f:void 0,characters:x.characters&&x.characters.length>0?x.characters:void 0,references:w,moodboard:x.moodboard}))&&S.setConcept(c.$p,!1):v=S.setActiveArchitectureConfig({...x,prompt:null!=y?y:S.prompt,references:w}),!!v&&("uid"in _&&S.addRecentReference(_),A&&(0,g.cZ)(),!0))}function v(e){var t,r,l,m;let f,{reference:v,nextPrompt:_,switchToCherryPro:y=!1,focusPromptbarOnSuccess:b=!0}=e;if(!y&&!h())return(0,p.p6)({title:"Audio reference not supported",message:"This model does not support audio references."}),!1;let A=u.xV.getState(),S=A.getActiveArchitectureConfig(),x="uid"in v?(0,d._E)(v):{id:v.id,name:v.name,username:v.username,image_url:v.image_url,audio_url:v.audio_url,variant:"audio",modality:"audio"},R=y?n.qH.CHERRY:A.activeArchitecture,I=[...y?[]:null!==(t=S.audio_references)&&void 0!==t?t:[],x],C=y||!1!==S.use_character_voices?(null!==(r=S.characters)&&void 0!==r?r:[]).filter(e=>!!e.audio_url).length:0,w=(0,o.jB)(R);return I.length+C>w?(!function(e,t){if((0,o.QA)(e)){(0,p.bA)({title:"Audio reference limit reached",message:"Remove audio references or turn off Character Voices to continue."});return}let r=(0,s.x)(e);(0,p.bA)({title:"Audio reference limit reached",message:"".concat(r," supports a maximum of ").concat(t," ").concat(1===t?"audio reference":"audio references",". Remove one to add another.")})}(R,w),!1):(y?(f=A.setActiveArchitectureConfig({...a.TF,model_id:i.$x.CHERRY_PRO,prompt:null!=_?_:A.prompt,image:null!==(l=A.image)&&void 0!==l?l:void 0,additional_images:null!==(m=A.additionalImages)&&void 0!==m?m:void 0,characters:S.characters&&S.characters.length>0?S.characters:void 0,references:S.references&&S.references.length>0?S.references:void 0,audio_references:I}))&&A.setConcept(c.$p,!1):f=A.setActiveArchitectureConfig({...S,prompt:null!=_?_:A.prompt,audio_references:I}),!!f&&("uid"in v&&A.addRecentReference(v),b&&(0,g.cZ)(),!0))}function _(e){var t;let{activeArchitecture:r,prompt:i}=u.xV.getState();if((null!==(t=u.xV.getState().getActiveArchitectureConfig().references)&&void 0!==t?t:[]).some(t=>t.id===e.id)){!function(e,t){var r;let i=u.xV.getState(),a=i.getActiveArchitectureConfig(),n=(0,m.B9)(t,e.username),o=(null!==(r=a.references)&&void 0!==r?r:[]).filter(t=>t.id!==e.id);i.setActiveArchitectureConfig({...a,prompt:n,references:o.length>0?o:void 0})}(e,i);return}let a=(0,m.go)(i,e.username);if(!(0,o.Ii)(r)){(0,g.NF)("reference",()=>{f({reference:e,nextPrompt:a,switchToMango:!0})});return}f({reference:e,nextPrompt:a})}function y(e){var t;let{prompt:r}=u.xV.getState();if((null!==(t=u.xV.getState().getActiveArchitectureConfig().audio_references)&&void 0!==t?t:[]).some(t=>t.id===e.id)){!function(e,t){var r;let i=u.xV.getState(),a=i.getActiveArchitectureConfig(),n=(0,m.B9)(t,e.username),o=(null!==(r=a.audio_references)&&void 0!==r?r:[]).filter(t=>t.id!==e.id);i.setActiveArchitectureConfig({...a,prompt:n,audio_references:o.length>0?o:void 0})}(e,r);return}let i=(0,m.go)(r,e.username);if(!h()){(0,g.NF)("audio_reference",()=>{v({reference:e,nextPrompt:i,switchToCherryPro:!0})});return}v({reference:e,nextPrompt:i})}},36848:(e,t,r)=>{"use strict";function i(e){var t,r;return!!e&&((null!==(r=null===(t=e.audioTracks)||void 0===t?void 0:t.length)&&void 0!==r?r:0)>0||("boolean"==typeof e.mozHasAudio?e.mozHasAudio:"number"==typeof e.webkitAudioDecodedByteCount&&e.webkitAudioDecodedByteCount>0))}r.d(t,{F:()=>i})},36996:(e,t,r)=>{"use strict";r.d(t,{_:()=>d,r:()=>u});var i=r(25352),a=r(67603),n=r(77567),o=r(59613),s=r(61871),l=r(48568),c=r(94035);function d(e,t){let r=n.xV.getState();if((0,c.Bt)(e,r.userMembership))return(0,l.s)(),!1;if(e===i.o.GEMS)return r.setGenerationMode(i.o.GEMS),!0;let d=null!=t?t:r.getActiveArchitectureConfig();if(!t){let e=(0,a.l)((0,c.AU)(d),i.o.UNLIMITED,r.userMembership);if("snap"===e.action)return(0,l.Cf)({config:d,membershipRequired:e.storedMembershipRequired,setGenerationMode:r.setGenerationMode,applyConfig:r.setActiveArchitectureConfig,resetToUnlimited:{settingsSummary:e.settingsSummary,onReset:()=>{let t=n.xV.getState();t.applyArchitectureFloorSnap(e),t.setGenerationMode(i.o.UNLIMITED),t.setMaxGemActiveJobs(1)}}}),!1;if("gate-at-floor"===e.action)return(0,l.Cf)({config:d,membershipRequired:e.membershipRequired,setGenerationMode:r.setGenerationMode,applyConfig:r.setActiveArchitectureConfig}),!1}let u=(0,o.zd)(d,r.userMembership);return u.allowed?(r.setGenerationMode(i.o.UNLIMITED),r.setMaxGemActiveJobs(1),!0):("deprecated"===u.reason?(0,s.n)():(0,l.Cf)({config:d,membershipRequired:u.membershipRequired,setGenerationMode:r.setGenerationMode,applyConfig:t?()=>{}:r.setActiveArchitectureConfig}),!1)}function u(e){let t=n.xV.getState();return e<=1||t.generationMode===i.o.GEMS?(t.setMaxGemActiveJobs(e),!0):((0,l.ol)({description:"Running more than one generation at a time uses Gems. Switch to Gems mode to raise your concurrency.",onUseGems:()=>
1{d(i.o.GEMS),n.xV.getState().setMaxGemActiveJobs(e)}}),!1)}},37370:(e,t,r)=>{"use strict";r.d(t,{ID:()=>i,Ry:()=>a,TY:()=>l,UF:()=>d,Yr:()=>p,jK:()=>s,rc:()=>u,s4:()=>n,uF:()=>c,wj:()=>o});let i=220,a=250,n=70,o=300,s=820,l="(min-width: ".concat(s,"px)"),c=60,d=50,u=50,p=200},37463:(e,t,r)=>{"use strict";r.d(t,{dk:()=>s,fK:()=>l,yp:()=>o});var i=r(4717),a=r(56800),n=r(84574);let o="flux2-dev",s={architecture:a.qH.FLUX2,model_id:o,prompt:"",resolution:n.Y.RES_1K,num_inference_steps:28,guidance_scale:4,aspect_ratio:i.vW.PORTRAIT},l={architecture:a.qH.FLUX2,name:"Flux 2",short_name:"Flux.2",popularity:5,tags:[a.fZ,a.R$,a.Mn],models:[{id:o}],api_path:"/api/v1/flux2",agent:{description:"Image model for general generation and input-image edits.",defaultConfig:s,options:{resolution:Object.values(n.Y)},imageInputs:{references:{field:"image",additionalField:"additional_images"}},editCapable:!0}}},37780:(e,t,r)=>{"use strict";r.d(t,{v:()=>c});var i=r(34477);let a=(0,i.createServerReference)("600ad1b62d238c9bc0ca48482ef7bbea573dce5ab2",i.callServer,void 0,i.findSourceMapURL,"checkSharedUsernameAvailable");var n=r(43789),o=r(64428),s=r(33981),l=r(12115);function c(e){let{name:t,isEditMode:r,initialUsername:i="",debounceMs:c=200,entityType:d="reference"}=e,[u,p]=(0,l.useState)(i),[m,g]=(0,l.useState)(!1),[h,f]=(0,l.useState)(null),[v,_]=(0,l.useState)(null),y=(0,l.useRef)((0,n.c1)()),b=(0,l.useRef)(!1),[A]=(0,s.useDebouncedValue)(u,c);(0,l.useEffect)(()=>{if(!r&&!b.current)if(t.trim()){let e=(0,n.N8)(t,y.current);e&&p(e)}else p(""),f(null),_(null)},[t,r]),(0,l.useEffect)(()=>{if(r)return;let e=async e=>{if(!e){f(null),_(null),g(!1);return}let t=(0,o.TU)(e);if(!t.valid){var r;_(null!==(r=t.error)&&void 0!==r?r:null),f(!1),g(!1);return}g(!0);try{let t=await a(e,d);f(t),_(t?null:"Username is already taken")}catch(e){_("Failed to check availability"),f(null)}finally{g(!1)}};A?(g(!0),e(A)):(g(!1),f(null),_(null))},[A,r]);let S=(0,l.useMemo)(()=>u?(0,o.TU)(u):{valid:!1,error:void 0},[u]);return{username:u,setUsername:e=>{p(e)},handleUsernameChange:e=>{b.current=!0,p((0,n.Ao)(e).slice(0,o.d0))},isCheckingUsername:m,isUsernameAvailable:h,usernameError:v,usernameValidation:S}}},38975:(e,t,r)=>{"use strict";r.d(t,{BW:()=>s,rI:()=>o});var i=r(56800),a=r(20630);let n="veo3",o={architecture:i.qH.VEO3,model_id:n,prompt:"",custom_aspect_ratio:a.D.RATIO_16_9,duration:a.o.DURATION_8S,enhance_prompt:!0,generate_audio:!0},s={architecture:i.qH.VEO3,name:"Veo3 Video",short_name:"Veo3",popularity:0,tags:[i.Gm,i.tM,i.ij],models:[{id:n,name:"Veo 3"}],api_path:"/api/v1/veo3",agent:{description:"Video model with generated audio. Text-to-video only.",defaultConfig:o,options:{}}}},39191:(e,t,r)=>{"use strict";r.d(t,{C:()=>i});var i=function(e){return e.RES_2K="2K",e.RES_4K="4K",e}({})},39358:(e,t,r)=>{"use strict";r.d(t,{AW:()=>o,BA:()=>a,ew:()=>i,fK:()=>n});var i=function(e){return e.RATIO_16_9="16:9",e.RATIO_9_16="9:16",e}({}),a=function(e){return e.DURATION_4S="4",e.DURATION_6S="6",e.DURATION_8S="8",e}({}),n=function(e){return e.RES_720P="720p",e.RES_1080P="1080p",e}({}),o=function(e){return e.PAD="pad",e.CROP="crop",e}({})},39427:(e,t,r)=>{"use strict";r.d(t,{F_:()=>T,N9:()=>A,Y5:()=>R,Zm:()=>w,Zw:()=>E,bP:()=>P,m2:()=>I,mS:()=>x,qr:()=>C,sN:()=>h,uO:()=>S,uc:()=>f,yQ:()=>M});var i=r(56800),a=r(27431),n=r(10140),o=r(54887),s=r(412),l=r(29728),c=r(65638),d=r(59791);let u=[o.X.RES_1K,o.X.RES_2K],p=[c.IV.RES_512,c.IV.RES_1K,c.IV.RES_2K,c.IV.RES_4K],m=[a.h.RES_1K,a.h.RES_2K],g={id:l.ZI,label:"Mango 3",architecture:i.qH.MANGO,backendModelId:l.ZI,resolutions:l.dK},h={id:l.V,label:"Mango 3S",architecture:i.qH.MANGO,backendModelId:l.V,resolutions:l.$X},f=[g,h,{id:l.yf,label:"Mango 2",architecture:i.qH.MANGO,backendModelId:l.yf,resolutions:l.yB}],v={id:s.Up,label:"Guava 2 Pro",architecture:i.qH.GUAVA,backendModelId:s.Up,resolutions:u},_={id:s.gb,label:"Guava 2",architecture:i.qH.GUAVA,backendModelId:s.gb,resolutions:u},y={id:s.eU,label:"Guava Pro 1.5",architecture:i.qH.GUAVA,backendModelId:s.eU,resolutions:u},b={id:s.Xn,label:"Guava Pro",architecture:i.qH.GUAVA,backendModelId:s.Xn,resolutions:u},A={id:s.Z1,label:"Guava",architecture:i.qH.GUAVA,backendModelId:s.Z1,resolutions:u},S=[v,_,y,b],x=[...S,A],R={id:d.kQ,label:"Nano Banana 2",architecture:i.qH.NANO_BANANA_V2,backendModelId:d.kQ,resolutions:p,strictFilterBadge:!0},I={id:"gpt-image-2-low",label:"GPT Image 2 Low",architecture:i.qH.GPT_IMAGE_2,backendModelId:n.z5,resolutions:m,quality:a.K.LOW,strictFilterBadge:!0},C={id:"gpt-image-2-high",label:"GPT Image 2 High",architecture:i.qH.GPT_IMAGE_2,backendModelId:n.z5,resolutions:m,quality:a.K.HIGH,strictFilterBadge:!0},w={id:"gpt-image-2.5-flare-low",label:"GPT Image 2.5 Flare Low",architecture:i.qH.GPT_IMAGE_2,backendModelId:n.g$,resolutions:m,quality:a.K.LOW,strictFilterBadge:!0},E={id:"gpt-image-2.5-flare-high",label:"GPT Image 2.5 Flare High",architecture:i.qH.GPT_IMAGE_2,backendModelId:n.g$,resolutions:m,quality:a.K.HIGH,strictFilterBadge:!0},P={id:"gpt-image-2.5-sunburst-high",label:"GPT Image 2.5 Sunburst High",architecture:i.qH.GPT_IMAGE_2,backendModelId:n.c9,resolutions:m,quality:a.K.HIGH,strictFilterBadge:!0},T={id:"gpt-image-2.5-sunburst-max",label:"GPT Image 2.5 Sunburst Max",architecture:i.qH.GPT_IMAGE_2,backendModelId:n.c9,resolutions:m,quality:a.K.MAX,strictFilterBadge:!0},M=[I,C,w,E,P,T];[...f,...x,...M]},39599:(e,t,r)=>{"use strict";r.d(t,{An:()=>o,JZ:()=>s,VQ:()=>n});var i=r(56800),a=r(2586);function n(e,t){var r,i;let a=null==t?void 0:t.trim();if(a)return a;let n=null===(i=e.architecture_config)||void 0===i?void 0:null===(r=i.prompt)||void 0===r?void 0:r.trim();return n||null}function o(e,t){return"first_image"===(0,a.Ce)(e.architecture)?{...e,first_image:t,image:void 0,additional_images:void 0,characters:void 0,references:void 0,moodboard_sampled_images:void 0,audio_references:void 0,videos:void 0,last_image:void 0}:{...e,image:t,additional_images:void 0,characters:void 0,references:void 0,moodboard_sampled_images:void 0,audio_references:void 0,videos:void 0,last_image:void 0}}function s(e){return!!e&&e.architecture!==i.qH.VEO3}},39686:(e,t,r)=>{"use strict";r.d(t,{Dt:()=>i,FU:()=>n,y5:()=>a});
1let i="All",a="Unorganized",n=[i,a]},39852:(e,t,r)=>{"use strict";r.d(t,{rt:()=>ef,o6:()=>eh,T:()=>eg});var i=r(20036),a=r(56800),n=r(7538),o=r(16791),s=r(61871),l=r(82646),c=r(56645);async function d(e,t){try{let{width:r,height:i}=await (0,c.vX)(e),a=r/i,n=Math.min(r,i),o=Math.max(r,i);if(a<.4||a>2.5)return"".concat(t," aspect ratio (").concat(a.toFixed(2),") must be between ").concat(.4," and ").concat(2.5,". Current: ").concat(r,"x").concat(i,".");if(n<=300)return"".concat(t," shorter side (").concat(n,"px) must be greater than ").concat(300," pixels.");if(o>=6e3)return"".concat(t," longer side (").concat(o,"px) must be less than ").concat(6e3," pixels.");return null}catch(e){return null}}var u=r(41438);async function p(e){if(e.image){let t=await d(e.image,"First frame");if(t)return(0,o.bA)({title:"Invalid First Frame",message:t}),!0}if(e.last_image){let t=await d(e.last_image,"Last frame");if(t)return(0,o.bA)({title:"Invalid Last Frame",message:t}),!0}return!1}async function m(e){if((0,l.R3)(e.architecture))return(0,s.n)(),!0;let t=(0,u.Q)(e);return t?((0,o.bA)(t),!0):e.architecture===a.qH.PEACH_MAX&&p(e)}var g=r(2586),h=r(34477);let f=(0,h.createServerReference)("402d331c242c5ac32b230ea30a3b937cd0db997ac9",h.callServer,void 0,h.findSourceMapURL,"resolveMoodboardRuntimeSelection");var v=r(27104),_=r(88179);let y="Identify the common visual styles, colors, textures, and aesthetics shared across all provided reference images. Apply those styles to produce";async function b(e){var t,r,i,a,s,l,c,d,u;let p;if(!(0,n.P2)(e.architecture))return e;let m=e.moodboard;if(!m)return e;if(!(0,n.DK)(e.architecture,e.model_id))return(0,o.p6)({title:"Moodboard not supported",message:"Moodboards are supported with Mango 2 and Nano Banana 2 models."}),null;try{p=(await f({moodboardId:m.id,modelId:e.model_id})).sampledImageUrls}catch(e){return console.error("Error resolving moodboard for runtime config:",e),(0,o.p6)({title:"Moodboard unavailable",message:"We could not load this moodboard right now. Please try again."}),null}let h=[e.image,...null!==(i=e.additional_images)&&void 0!==i?i:[]].filter(e=>!!e);if(h.length+p.length+(null!==(a=null===(t=e.characters)||void 0===t?void 0:t.length)&&void 0!==a?a:0)+(null!==(s=null===(r=e.references)||void 0===r?void 0:r.length)&&void 0!==s?s:0)>(0,g.Xf)(e.architecture))return(0,_.Ys)((0,_.Zv)(e.architecture,{modelId:e.model_id,moodboard:e.moodboard,characterCount:null!==(d=null===(l=e.characters)||void 0===l?void 0:l.length)&&void 0!==d?d:0,referenceCount:null!==(u=null===(c=e.references)||void 0===c?void 0:c.length)&&void 0!==u?u:0}),"generation"),null;let b=[...h,...p],{moodboard:A,...S}=e;return{...S,prompt:function(e,t){let r=(0,v.B9)(e,t).trim().replace(/[.!?]\s*$/,"");return r?"".concat(y,": ").concat(r):"".concat(y," an output image that embodies those shared styles.")}(e.prompt,m.username),moodboard_sampled_images:p,image:b[0],additional_images:b.length>1?b.slice(1):void 0}}var A=r(10140),S=r(412),x=r(29728),R=r(26839),I=r(95155),C=r(25352),w=r(77567),E=r(7963),P=r(36996),T=r(18403),M=r(21220),k=r(70112),O=r(93751),D=r(95642),U=r(58887),N=r(26903),H=r(91423),j=r(23552);function L(e){let{modelName:t,description:r}=e,{isDesktop:i}=(0,w.xV)((0,j.k)(e=>({isDesktop:e.isDesktop})));return(0,I.jsx)(T.Card,{bg:"dark.9",p:"lg",radius:"lg",children:(0,I.jsxs)(M.Stack,{gap:"lg",children:[(0,I.jsxs)(k.Group,{justify:"space-between",align:"flex-start",gap:"sm",children:[(0,I.jsxs)(O.Title,{order:i?3:4,c:"white",style:{width:i?"auto":"75%"},children:["Faster Generations with ",t]}),(0,I.jsx)(D.CloseButton,{onClick:()=>(0,H.s7)(),"aria-label":"Close modal",size:"lg",c:"white"})]}),(0,I.jsx)(U.Text,{c:"white",size:i?"md":"sm",children:r}),(0,I.jsxs)(M.Stack,{gap:"sm",children:[(0,I.jsx)(N.Button,{onClick:()=>{(0,P._)(C.o.GEMS),(0,H.s7)()},fullWidth:!0,color:"orange",variant:"light",size:i?"lg":"sm",children:"Switch to Gems Mode"}),(0,I.jsx)(N.Button,{onClick:()=>{(0,H.s7)()},fullWidth:!0,variant:"subtle",color:"gray",size:i?"lg":"sm",children:"Continue with Slow Generations"})]})]})})}var G=r(57635),q=r(71570),B=r(69604),F=r(18229),V=r(66766);let K=[{label:"Location",src:"/references/suggestion/eiffel-tower.png",left:"4%",top:"18%",rotate:-5,zIndex:1},{label:"Outfit",src:"/references/suggestion/sunflower-dress.png",left:"29%",top:"0%",rotate:2,zIndex:2},{label:"Pose",src:"/references/suggestion/pose.jpeg",left:"54%",top:"16%",rotate:6,zIndex:3}];function z(){let{isDesktop:e}=(0,w.VT)("isDesktop");return(0,I.jsx)(T.Card,{bg:"dark.9",withBorder:!0,p:e?"xl":"lg",radiu
1s:"lg",children:(0,I.jsxs)(M.Stack,{gap:e?"xl":"lg",children:[(0,I.jsxs)(k.Group,{justify:"space-between",align:"flex-start",gap:"sm",children:[(0,I.jsx)(O.Title,{order:e?1:2,c:"white",style:{flex:1},children:"Keep More Than Characters Consistent"}),(0,I.jsx)(D.CloseButton,{onClick:()=>(0,H.s7)(),"aria-label":"Close modal",size:"lg",c:"white"})]}),(0,I.jsx)(B.Box,{pos:"relative",w:"100%",maw:440,h:e?260:220,mx:"auto",my:e?"md":"sm",children:K.map(t=>(0,I.jsx)(B.Box,{pos:"absolute",left:t.left,top:t.top,w:e?190:155,h:e?210:170,children:(0,I.jsxs)(B.Box,{pos:"absolute",w:"100%",h:"100%",style:{zIndex:t.zIndex,borderRadius:"var(--mantine-radius-md)",overflow:"hidden",transform:"rotate(".concat(t.rotate,"deg)"),boxShadow:"0 10px 28px rgba(0, 0, 0, 0.5)"},children:[(0,I.jsx)(V.default,{src:t.src,alt:"",fill:!0,sizes:e?"190px":"155px",style:{objectFit:"cover"}}),(0,I.jsx)(U.Text,{pos:"absolute",c:"white",fw:700,size:"sm",px:"sm",py:4,style:{zIndex:1,left:"var(--mantine-spacing-xs)",bottom:"var(--mantine-spacing-xs)",borderRadius:"var(--mantine-radius-xl)",backgroundColor:"rgba(20, 20, 20, 0.86)",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.35)"},children:t.label})]})},t.label))}),(0,I.jsx)(U.Text,{c:"dimmed",size:e?"lg":"sm",ta:"center",children:"References keep objects, locations, poses, and outfits consistent across your generations — just like Characters do for people."}),(0,I.jsxs)(F.SimpleGrid,{cols:{base:1,sm:2},spacing:"sm",children:[(0,I.jsx)(N.Button,{onClick:()=>{(0,H.s7)(),(0,q.Nf)()},fullWidth:!0,size:e?"lg":"md",style:{background:G._8,color:"var(--mantine-color-dark-9)"},children:"Create Reference"}),(0,I.jsx)(N.Button,{onClick:()=>(0,H.s7)(),fullWidth:!0,variant:"light",color:"gray",size:e?"lg":"md",children:"Continue Generating"})]})]})})}var W=r(48473);let X=(0,h.createServerReference)("008710e97f169626012886e8e1cd68cf3b68e3b9b8",h.callServer,void 0,h.findSourceMapURL,"hasCreatedImageReference");var Y=r(65025),Z=r(61282),Q=r(80642),$=r(6063),J=r(52220),ee=r(59613),et=r(48568),er=r(23258),ei=r(32191),ea=r(27122),en=r(4769),eo=r(51977),es=r(87049),el=r(13286),ec=r(10212),ed=r(92726),eu=r(60506);let ep={openPlayOnEnqueue:!1},em=[{key:"mango",architecture:a.qH.MANGO,modelIds:[x.vn],modelName:"Mango",description:"Do you want faster generations with Mango? Grab Gems and switch to Gems mode. Generate images with Mango in 10 seconds!"},{key:"mango-v2",architecture:a.qH.MANGO,modelIds:[x.yf],modelName:"Mango 2",description:"Do you want faster generations with Mango 2? Grab Gems and switch to Gems mode. Generate images with Mango 2 in 10 seconds!"},{key:"mango-v3",architecture:a.qH.MANGO,modelIds:[x.V],modelName:"Mango 3S",description:"Do you want faster generations with Mango 3S? Grab Gems and switch to Gems mode. Generate images with Mango 3S in 10 seconds!"},{key:"mango-v3-pro",architecture:a.qH.MANGO,modelIds:[x.ZI],modelName:"Mango 3",description:"Do you want faster generations with Mango 3? Grab Gems and switch to Gems mode. Generate images with Mango 3 in 45 seconds!"},{key:"peach",architecture:a.qH.PEACH,modelName:"Peach",description:"Do you want faster & higher resolution generations with Peach? Grab Gems and switch to Gems mode. Generate 1080p videos with Peach in 20 seconds!"},{key:"kiwi",architecture:a.qH.KIWI,modelName:"Kiwi",description:"Do you want faster & higher resolution generations with Kiwi? Grab Gems and switch to Gems mode. Generate 1080p videos with Kiwi in 60 seconds!"},{key:"blueberry",architecture:a.qH.BLUEBERRY,modelName:"Blueberry",description:"Do you want faster & higher resolution generations with Blueberry? Grab Gems and switch to Gems mode. Generate 1080p videos with Blueberry in 60 seconds!"},{key:"peach-max",architecture:a.qH.PEACH_MAX,modelName:"Peach Max",description:"Do you want faster & higher resolution generations with Peach Max? Grab Gems and switch to Gems mode. Generate 720p videos with Peach Max in 30 seconds!"},{key:"guava",architecture:a.qH.GUAVA,modelIds:[S.Z1],modelName:"Guava",description:"Do you want faster generations with Guava? Grab Gems and switch to Gems mode. Generate high-quality images with Guava in seconds!"},{key:"guava-pro",architecture:a.qH.GUAVA,modelIds:[S.Xn,S.eU],modelName:"Guava Pro",de
1scription:"Do you want faster generations with Guava Pro? Grab Gems and switch to Gems mode. Generate high-quality images with Guava Pro in seconds!"},{key:"guava-2",architecture:a.qH.GUAVA,modelIds:[S.gb],modelName:"Guava 2",description:"Do you want faster generations with Guava 2? Grab Gems and switch to Gems mode. Generate high-quality images with Guava 2 in seconds!"},{key:"guava-2-pro",architecture:a.qH.GUAVA,modelIds:[S.Up],modelName:"Guava 2 Pro",description:"Do you want faster generations with Guava 2 Pro? Grab Gems and switch to Gems mode. Generate high-quality images with Guava 2 Pro in seconds!"},{key:"nano-banana-v2",architecture:a.qH.NANO_BANANA_V2,modelName:"Nano Banana 2",description:"Do you want faster generations with Nano Banana 2? Grab Gems and switch to Gems mode. Generate high-quality images with Nano Banana 2 in seconds!"},{key:"gpt-image-2",architecture:a.qH.GPT_IMAGE_2,modelIds:[A.z5],modelName:"GPT Image 2",description:"Do you want faster generations with GPT Image 2? Grab Gems and switch to Gems mode. Generate precise, high-quality images with GPT Image 2 in seconds!"},{key:"gpt-image-2.5-flare",architecture:a.qH.GPT_IMAGE_2,modelIds:[A.g$],modelName:"GPT Image 2.5 Flare",description:"Do you want faster generations with GPT Image 2.5 Flare? Grab Gems and switch to Gems mode. Generate precise, high-quality images with GPT Image 2.5 Flare in seconds!"},{key:"gpt-image-2.5-sunburst",architecture:a.qH.GPT_IMAGE_2,modelIds:[A.c9],modelName:"GPT Image 2.5 Sunburst",description:"Do you want faster generations with GPT Image 2.5 Sunburst? Grab Gems and switch to Gems mode. Generate precise, high-quality images with GPT Image 2.5 Sunburst in seconds!"},{key:"cherry-mini",architecture:a.qH.CHERRY,modelIds:[i.$x.CHERRY_MINI],modelName:"Cherry Mini",description:"Do you want faster generations with Cherry Mini? Grab Gems and switch to Gems mode for quicker video generation."}],eg=async e=>{let{architectureConfig:t,architectureConfigToSave:r,generationMode:i,concept:a,appRequest:l,ui:c}=e,d=w.xV.getState();if(d.ban){d.setIsAppPlaying(!1);return}let u=null!=r?r:t,p=await b(t);if(!p||await m(p)){d.setIsAppPlaying(!1);return}d.setIsAppPlaying(!0);try{var g,h,f,v,_,y,A,S,x;let e=await (null===(g=$.LP.currentUser)||void 0===g?void 0:g.getIdToken());if(!e)throw new Q.rG;let r=void 0===a?d.concept:a,o=null!=i?i:d.generationMode;if(p.characters&&p.characters.length>0){let e=d.incrementCharacterReferenceSuggestionGenCount();3===e&&setTimeout(()=>{X().then(e=>{e||(0,E.q)({centered:!0,children:(0,I.jsx)(z,{}),size:"min(94vw, 640px)"})}).catch(e=>{console.error("Failed to check whether the user has created a reference:",e)})},1e3)}if(o===C.o.UNLIMITED){let e=p.model_id,t=em.find(t=>t.architecture===p.architecture&&(void 0===t.modelIds||void 0!==e&&t.modelIds.includes(e)));if(t){let e=d.incrementUnlimitedGenCount(t.key);(5===e||100===e)&&setTimeout(()=>{var e;e={modelName:t.modelName,description:t.description},(0,E.q)({centered:!0,children:(0,I.jsx)(L,{...e}),size:"min(94vw, 500px)"})},1e3)}}if(o===C.o.GEMS){let e=t.architecture,r=d.incrementGemGenCount(e);d.userMembership===Z.c.FREE&&(0,ee.pB)(p)&&(10===r||100===r)&&setTimeout(()=>{(0,ei.jo)(p)},1e3)}let s={architecture:p.architecture,model_id:p.model_id},m=(0,n.QA)(p.architecture);null===(h=p.characters)||void 0===h||h.forEach(e=>{(0,J.r)("character_used",{...s,character_id:e.id,voice_used:m&&!!e.audio_url&&!1!==p.use_character_voices})}),null===(f=p.references)||void 0===f||f.forEach(e=>{(0,J.r)("reference_used",{...s,reference_id:e.id,variant:e.variant})}),null===(v=p.audio_references)||void 0===v||v.forEach(e=>{(0,J.r)("reference_used",{...s,reference_id:e.id,variant:"audio"})});let b=null===(_=u.moodboard)||void 0===_?void 0:_.id;b&&(0,J.r)("moodboard_used",{...s,moodboard_id:b});let w=(0,R.kp)(await (0,W.l)({architectureConfig:p,architectureConfigToSave:u,authToken:e,conceptId:null==r?void 0:r.id,activePowerPack:d.activePowerPack,generationMode:o}),"runArchitecture");if("error_code"in w)switch(w.error_code){case 401:throw new Q.rG;case 403:throw new Q.sd("Active ban detected for user ".concat(null===(y=$.LP.currentUser)||void 0===y?void 0:y.uid));case 4031:throw new Q.sb(null!==(A=p.prompt)&&void 0!==A?A:"Unknown prompt");case Y.aZ:throw new Q.Hx("Upgrade to Basic to run this configuration.",Z.c.BASIC);case Y.rG:throw new Q.Hx("Upgrade to Pro to run this configuration.",Z.c.PRO);case Y.Wd:throw new Q.Hx("Upgrade to Pro Plus to run this configuration.",Z.c.PRO_PLUS);case Y.IA:throw new Q.Hx("Upgrade to Max to run this configuration.",Z.c.MAX);case Y.WW:throw new Q.FO(u);case Y.DR:throw new Q.N3;case Y.vu:throw new Q._K;case 4269:throw new Q.Gt(null!==(S=p.prompt)&&void 0!==S?S:"Untitled creation",(0,er.BA)(p,o),{architectureConfig:t,architectureConfigToSave:u,generationMode:o,concept:r,appRequest:l,ui:c});case 429:throw new Q.af;case 4299:throw new Q.EI;case 451:throw new Q.XG(null!==(x=p.prompt)&&void 0!==x?x:"Unknown prompt");case 500:throw Error("Internal server error");default:throw Error("Unknown error: ".concat(w.error_code))}
1return d.addRunningJob({...w,architecture_config:u,generationMode:o,appRequest:l,ui:c}),w}catch(e){return!function(e){if(e instanceof Q.af){let t=w.xV.getState();if(t.activePowerPack)throw e;(0,E.q)({children:(0,I.jsx)(en.q,{}),size:es.A}),t.setIsGenQueuePaused(!0)}else if(e instanceof Q.Gt)(0,eo.L)((0,I.jsx)(en.cF,{prompt:e.prompt,gemsRequired:e.gemsRequired,item:e.item})),w.xV.getState().setIsGenQueuePaused(!0);else if(e instanceof Q.EI){let e=w.xV.getState();e.activePowerPack&&(0,el.Z)(e.activePowerPack.id).catch(()=>{}),(0,o.bA)({title:"⚡ Power Pack Complete",message:"Your power pack session has completed!",autoClose:!1}),(0,eu.A)().catch(()=>{}),e.clearGenQueue()}else if(e instanceof Q.rG){var t;let e=w.xV.getState();(null===(t=e.user)||void 0===t?void 0:t.isAnonymous)===!1?(0,o.bA)({title:"Initializing...",message:"We are still firing up the engines. \uD83D\uDE80 Please refresh if this persists."}):e.setViewLogin(!0)}else if(e instanceof Q.XG)(0,E.q)({children:(0,I.jsx)(en.dg,{prompt:e.prompt}),size:es.A});else if(e instanceof Q.Hx){let t=w.xV.getState();(0,et.Cf)({membershipRequired:e.requiredMembership,setGenerationMode:t.setGenerationMode})}else if(e instanceof Q.FO){let t=w.xV.getState();e.config.architecture===t.activeArchitecture?t.setActiveArchitectureConfig(e.config):(0,et.Cf)({membershipRequired:ea.v,setGenerationMode:t.setGenerationMode})}else if(e instanceof Q.sd){let e=w.xV.getState();e.user&&e.isUserSessionAvailable&&(0,ec.J)(e.user.uid).then(t=>{t&&e.setBan(t)})}else if(e instanceof Q.N3)(0,s.n)();else if(e instanceof Q._K)(0,o.p6)({title:"Couldn't verify your video",message:"We couldn't verify that your video is within the supported length and resolution. Try a shorter video or re-add it. No Gems were charged.",autoClose:1e4});else if(e instanceof Q.sb)(0,E.q)({children:(0,I.jsx)(en.C5,{prompt:e.prompt}),size:es.A});else{if(console.error("[Mage] Unknown error generating!",e),(0,R.hu)("".concat(e.name,": ").concat(e.message)))return;if((0,ed.mO)(e)){(0,o.p6)({title:"Connection problem",message:"We couldn't reach the server. Check your connection and try again.",error:e});return}(0,o.p6)({title:"Ah, something went wrong!",message:"We had an issue. Try again?",error:e})}}(e),d.setIsAppPlaying(!1),null}},eh=async e=>{var t,r,i,a;let n=w.xV.getState(),l=(null==e?void 0:null===(t=e.ui)||void 0===t?void 0:t.openPlayOnEnqueue)!==!1;if(null===(r=n.user)||void 0===r?void 0:r.isAnonymous)return n.setViewLogin(!0),!1;if(null===n.user)if(n.isUserSessionAvailable)return n.setViewLogin(!0),!1;else return(0,o.bA)({title:"Initializing...",message:"We are still firing up the engines. \uD83D\uDE80 Please refresh if this persists."}),!1;l&&n.isDesktop&&n.playModeActiveDesktop&&!n.playIsActive&&n.setPlayIsActive(!0);let c=null!==(i=null==e?void 0:e.generationMode)&&void 0!==i?i:n.generationMode,d=null!==(a=null==e?void 0:e.architectureConfig)&&void 0!==a?a:n.getActiveArchitectureConfig();if(c===C.o.UNLIMITED){let t=(0,ee.zd)(d,n.userMembership);if(!t.allowed&&"deprecated"===t.reason)return(0,s.n)(),!1;if(!t.allowed)return(0,et.Cf)({config:d,membershipRequired:t.membershipRequired,setGenerationMode:n.setGenerationMode,applyConfig:t=>{e||n.setActiveArchitectureConfig(t)}
1,onResolved:t=>{null!=e&&e.appRequest||(e?eh({...e,generationMode:t}):eh())}}),!1}let u=c===C.o.GEMS||n.userMembership===Z.c.PRO_PLUS||n.userMembership===Z.c.MAX,p=n.runningJobs.length+n.genQueue.length+ +!!n.isGenQueueProcessing<(0,er.$s)(c,n.maxGemActiveJobs);if(n.isAppPlaying&&!u&&!p)return n.setIsQueueDropdownOpen(!0),!1;n.setIsAppPlaying(!0),!e&&n.promptRequiresDebounce&&await new Promise(e=>setTimeout(e,200));let m={...null!=e?e:{architectureConfig:n.getActiveArchitectureConfig(),concept:n.concept},generationMode:c};return n.pushToGenQueue(m)?(n.isGenQueuePaused&&n.setIsGenQueuePaused(!1),!0):((0,o.bA)({title:"Queue Full",message:"Your queue is full. Please wait for a generation to complete before adding another."}),!1)},ef=async e=>eh({...e,ui:ep})},40201:(e,t,r)=>{"use strict";r.d(t,{PK:()=>o,Vm:()=>i,mv:()=>a,t4:()=>n});var i=function(e){return e.RES_480P="480p",e.RES_720P="720p",e.RES_1080P="1080p",e}({}),a=function(e){return e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_9_16="9:16",e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_4_3="4:3",e.ASPECT_RATIO_3_4="3:4",e.ASPECT_RATIO_4_5="4:5",e.ASPECT_RATIO_5_4="5:4",e}({}),n=function(e){return e.AUTO="auto",e.ORIGIN="origin",e}({}),o=function(e){return e.DURATION_3S="3",e.DURATION_4S="4",e.DURATION_5S="5",e.DURATION_6S="6",e.DURATION_7S="7",e.DURATION_8S="8",e.DURATION_9S="9",e.DURATION_10S="10",e.DURATION_11S="11",e.DURATION_12S="12",e.DURATION_13S="13",e.DURATION_14S="14",e.DURATION_15S="15",e}({})},40350:(e,t,r)=>{"use strict";r.d(t,{SI:()=>o,jI:()=>n,qQ:()=>s});var i=r(56800),a=r(73857);let n="peach_max",o={architecture:i.qH.PEACH_MAX,model_id:n,prompt:"",resolution:a.cc.RES_480P,peach_max_aspect_ratio:a.j0.ASPECT_RATIO_4_3,duration:a.WK.DURATION_5S,audio:!0},s={architecture:i.qH.PEACH_MAX,name:"Peach Max",short_name:"Peach Max",popularity:7,tags:[i.fZ,i.tM,i.KT],models:[{id:n}],api_path:"/api/v1/peach_max",agent:{description:"Higher-tier video model. Prefer it when the user asks for the highest-quality video.",defaultConfig:o,options:{resolution:Object.values(a.cc),duration:Object.values(a.WK)},imageInputs:{firstFrame:"image",lastFrame:"last_image"}}}},40845:(e,t,r)=>{"use strict";r.d(t,{CH:()=>d,Hd:()=>l,JZ:()=>s,L4:()=>c,NO:()=>a,Pn:()=>n,ZP:()=>o,au:()=>u});var i=r(64610);let a="source::storyboard";function n(e){return"url"in e&&"string"==typeof e.url}function o(e){return n(e)?e.url:(0,i.h)(e)}function s(e){return e.architecture_config}function l(){return"sb-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function c(e){if(e.storyboardId)return"storyboard-".concat(e.storyboardId);if(n(e))return"creation-".concat(e.id);if(e.history_id)return"app-".concat(e.history_id);let t="image"===e.type?e.data.image:e.data.video;return"app-".concat(t)}function d(e){return e.duration}function u(e){let t=e.architecture_config;if(t&&"object"==typeof t&&"prompt"in t){var r;return(null===(r=t.prompt)||void 0===r?void 0:r.trim())||"No prompt"}return"No prompt"}},41152:(e,t,r)=>{"use strict";r.d(t,{E8:()=>c,OH:()=>d,_T:()=>u});var i=r(4717),a=r(16162),n=r(74532),o=r(56800),s=r(82395);let l="wan-video",c="wan-video-lightning",d={architecture:o.qH.WAN,model_id:l,prompt:"",negative_prompt:"",num_inference_steps:15,guidance_scale:6,flow_shift:12,num_frames:81,aspect_ratio:i.vW.LANDSCAPE,base_size:s.l.SIZE_240P,prompt_filter:(0,n.jM)(a.y1,e=>{e&&(e.prompt="{prompt}",e.negative_prompt="default-negative-do-not-remove, {negative_prompt}")})},u={architecture:o.qH.WAN,name:"Wan Video v2.1",short_name:"Wan 2.1",popularity:0,tags:[o.fZ,o.tM],models:[l,c].map(e=>({id:e})),api_path:"/api/v1/wan",agent:{description:"General video model.",defaultConfig:d,options:{resolution:Object.values(s.l),resolutionField:"base_size"},imageInputs:{firstFrame:"image",lastFrame:"last_image"}}}},41438:(e,t,r)=>{"use strict";r.d(t,{Q:()=>w});var i=r(40201),a=r(23446),n=r(7559),o=r(71849),s=r(21078),l=r(20036),c=r(17157),d=r(56544),u=r(10140),p=r(9057),m=r(57411),g=r(52738),h=r(86819),f=r(7019),v=r(18683),_=r(29728),y=r(33749),b=r(58649),A=r(83880),S=r(66685),x=r(61629),R=r(41152),I=r(56800),C=r(41770);function w(e){var t,r,w,E,P;switch(e.architecture){case I.qH.WAN:return e.model_id===R.E8&&e.last_image?{title:"Last Frame Unsupported",message:"Wan 
1Lightning does not support a last frame. Remove the last image or switch models."}:null;case I.qH.FRAMEPACK:return e.image?null:{title:"Image Required",message:"Framepack is image-to-video. Please add an image to continue!"};case I.qH.SELFIE:return e.image?null:{title:"Image Required",message:"Selfie is image-to-image. Please add an image to continue!"};case I.qH.VEO3:return e.prompt?null:{title:"Prompt Required",message:"Veo3 requires a prompt to continue!"};case I.qH.VEO3_1:return e.prompt?null:{title:"Prompt Required",message:"Veo 3.1 requires a prompt to continue!"};case I.qH.MANGO:return e.prompt?e.model_id===_.yf&&e.resolution===v.d.RES_1K?{title:"Resolution Not Supported",message:"Mango 2 does not support 1K resolution. Please switch to 2K or 4K."}:e.model_id===_.V&&e.resolution!==v.d.RES_2K&&e.resolution!==v.d.RES_3K?{title:"Resolution Not Supported",message:"Mango 3S only supports 2K and 3K resolution."}:e.model_id===_.ZI&&e.resolution!==v.d.RES_1K&&e.resolution!==v.d.RES_2K?{title:"Resolution Not Supported",message:"Mango 3 only supports 1K and 2K resolution."}:null:{title:"Prompt Required",message:"Mango requires a prompt to continue!"};case I.qH.KIWI:return e.prompt?null:{title:"Prompt Required",message:"Kiwi requires a prompt to continue!"};case I.qH.BLUEBERRY:return e.prompt?e.image&&e.reference_video_urls&&e.reference_video_urls.length>0?{title:"Combination Not Available",message:"First frame and character reference videos cannot be used together. Please remove one to continue."}:e.reference_video_urls&&e.reference_video_urls.length>0&&e.duration===o.Nt.DURATION_15S?{title:"Duration Not Supported",message:"Character reference videos do not support 15 second duration. Please select 5 or 10 seconds."}:e.last_image&&e.model_id!==s.el?{title:"Last Frame Unsupported",message:"Last Frame is only supported on Blueberry v2. Remove the last image or switch to Blueberry v2."}:null:{title:"Prompt Required",message:"Blueberry requires a prompt to continue!"};case I.qH.PEACH:return e.prompt?null:{title:"Prompt Required",message:"Peach requires a prompt to continue!"};case I.qH.PEACH_MAX:return e.prompt?null:{title:"Prompt Required",message:"Peach Max requires a prompt to continue!"};case I.qH.PEAR:return e.video&&!(e.video_duration_s&&e.video_duration_s>0)?{title:"Motion Video Needs a Refresh",message:"Please re-add your motion video to continue."}:null;case I.qH.QWEN_IMAGE_EDIT_PLUS:return e.image?null:{title:"Image Required",message:"Qwen Image Edit Plus is image-to-image. Please add an image to continue!"};case I.qH.GUAVA:if(!e.prompt)return{title:"Prompt Required",message:"Guava requires a prompt to continue!"};return(0,C.S)(e).allImages.length>3?{title:"Too Many Images",message:"A maximum of ".concat(3," images, characters, or references are allowed. Please remove some to continue.")}:null;case I.qH.CHERRY:return function(e){var t,r,i,a,n,o,s,u,p,m,g,h;if(!(null===(t=e.prompt)||void 0===t?void 0:t.trim()))return{title:"Prompt Required",message:"Cherry requires a prompt to continue!"};if(e.last_image&&!e.first_image)return{title:"First Frame Required",message:"Cherry requires a first frame when a last frame is provided. Add a first frame or remove the last frame."};let f=(0,C.S)(e),v=!!(e.first_image||e.last_image),_=!!(f.allImages.length||(null===(r=e.videos)||void 0===r?void 0:r.length)||(null===(i=e.audio_references)||void 0===i?void 0:i.length)||e.audio||(null===(a=e.additional_audio)||void 0===a?void 0:a.length));if(v&&_)return{title:"Unsupported Combination",message:"Cherry first/last frames cannot be combined with image, video, or audio references. Remove the frames or the other references to continue."};let y=null!==(u=e.model_id)&&void 0!==u?u:c.TF.model_id,b=null!==(p=e.resolution)&&void 0!==p?p:c.TF.resolution;if(!(0,c.tp)(y,b))return y===l.$x.CHERRY_2_PRO?{title:"Resolution Not Supported",message:"Cherry 2 Pro does not support this resolution yet. Choose 480p, 720p, or 1080p to continue."}:{title:"Resolution Not Supported",message:"1080p requires Cherry Pro or Cherry 2 Pro, and 4k requires Cherry Pro. Switch models, or choose 480p or 720p."};let A=null!==(m=e.duration)&&void 0!==m?m:c.TF.duration;if(!(A===l.sr.DURATION_AUTO&&y===l.$x.CHERRY_2_PRO&&(null===(n=e.videos)||void 0===n?void 0:n.length))&&!(0,c.J_)(y,A))return{title:"Duration Not Supported",message:"Durations over 15 seconds are only available on Cherry 2 Pro. Switch to Cherry 2 Pro, or choose a shorter duration."};if(null===(o=e.videos)||void 0===o?void 0:o.length){if(1!==e.videos.length)return{title:"Invalid Video Input",message:"Cherry currently supports one source video in Advanced."};if(!(0,d.h)(y,e.video_duration_s)){let e=(0,d.I)(y);return{title:"Invalid Video Duration",message:"Video references for this model must be between ".concat(e.minSeconds," and ").concat(e.maxSeconds," seconds.")}}}let S=null!==(g=null===(s=e.audio_references)||void 0===s?void 0:s.length)&&void 0!==g?g:0;if(S>0&&0===f.allImages.length)return{title:"Reference Image Required",message:"Cherry audio requires at least one reference image (character, reference, etc.)"};if(S>c.wu)return{title:"Too Many Audio References",message:"Cherry supports a maximum of ".concat(c.wu," audio references. Please remove some to continue.")};if(S+(!1===e.use_character_voices?0:(null!==(h=e.characters)&&void 0!==h?h:[]).filter(e=>!!e.audio_url).length)>c.wu)return{title:"Audio reference limit reached",message:"Remove audio references or turn off Character Voices to continue."};let x=c.YM[y],R=f.allImages.length;return R>x?y!==l.$x.CHERRY_2_PRO&&R<=c.XK?{title:"Too Many Images",message:"This model supports up to ".concat(x," images, characters, or references. Switch to Cherry 2 Pro to use up to ").concat(c.XK,".")}:{title:"Too Many Images",message:"A maximum of ".concat(x," images, characters, or references are allowed. Please remove some to continue.")}:null}(e);case I.qH.RASPBERRY:if(!e.prompt)return{title:"Prompt Required",message:"Raspberry requires a prompt to continue!"};return(0,C.S)(e).allImages.length+(null!==(r=null===(t=e.videos)||void 0===t?void 0:t.length)&&void 0!==r?r:0)>5?{title:"Too Many References",message:"A maximum of ".concat(5," reference images/videos are allowed. Please remove some to continue.")}:null;case I.qH.GPT_IMAGE_2:if(!(0,u.lS)(e.model_id))return{title:"Unknown Model",message:'GPT Image 2 does not offer a "'.concat(e.model_id,'" model.')};let{model:T,quality:M}=(0,u.iy)(e);if(!(0,u.HH)(T,M)){let e=u.JA[T].map(e=>u.LS[e]).join(", ");return{title:"Unsupported Quality",message:"".concat(u.gt[T]," does not support ").concat(u.LS[M]," qual
1ity. Choose ").concat(e,", or switch to GPT Image 2.5 Flare or Sunburst to continue.")}}return null;case I.qH.GROK_IMAGE:return e.prompt?(0,C.S)(e).allImages.length>p.Oo?{title:"Too Many Images",message:"A maximum of ".concat(p.Oo," images are allowed for this model. Please remove some to continue.")}:null:{title:"Prompt Required",message:"Grok Image requires a prompt to continue!"};case I.qH.GROK_VIDEO:if(!e.prompt)return{title:"Prompt Required",message:"Grok Video requires a prompt to continue!"};let k=(0,C.S)(e);if(e.video)return(0,g.l)(e.video_duration_s)?k.allImages.length>0||(null===(w=e.characters)||void 0===w?void 0:w.length)?{title:"Unsupported Combination",message:"Grok Video editing does not support reference images. Remove the references to continue."}:null:{title:"Invalid Video Duration",message:"Video edits require a video of at most ".concat(m.Yv," seconds. Please re-add a supported video.")};return k.allImages.length>m.oE?{title:"Too Many References",message:"A maximum of ".concat(m.oE," reference images are allowed. Please remove some to continue.")}:k.allImages.length>0&&Number(e.duration)>m.m_?{title:"Duration Not Supported",message:"Grok Video supports a maximum of ".concat(m.m_," seconds when using reference images. Please shorten the duration or remove references to continue.")}:null;case I.qH.BERRY:if(!(null===(E=e.prompt)||void 0===E?void 0:E.trim()))return{title:"Prompt Required",message:"Berry requires a prompt to continue!"};if(e.resolution===i.Vm.RES_480P&&e.model_id!==a.Y9)return{title:"Resolution Not Supported",message:"480p is only available on Berry 2. Switch to Berry 2, or choose 720p or 1080p."};if(e.video){if(!(0,n.Q)(e.video_duration_s))return{title:"Invalid Video Duration",message:"Video edits require a video between ".concat(a.d6," and ").concat(a.Tc," seconds. Please re-add a supp
1orted video.")};return(0,C.S)(e).allImages.length>5?{title:"Too Many References",message:"A maximum of ".concat(5," reference images are allowed. Please remove some to continue.")}:null}let O=(0,C.S)(e);return e.first_image&&O.allImages.length>0?{title:"Unsupported Combination",message:"First frame cannot be combined with reference images. Remove the first frame or the references to continue."}:O.allImages.length>9?{title:"Too Many References",message:"A maximum of ".concat(9," reference images are allowed. Please remove some to continue.")}:null;case I.qH.MELON:if(!(null===(P=e.prompt)||void 0===P?void 0:P.trim()))return{title:"Prompt Required",message:"Melon requires a prompt to continue!"};let D=(0,C.S)(e);return(e.first_image||e.last_image)&&D.allImages.length>0?{title:"Unsupported Combination",message:"First/last frames cannot be combined with reference images. Remove the frames or the references to continue."}:D.allImages.length>7?{title:"Too Many References",message:"A maximum of ".concat(7," reference images are allowed. Please remove some to continue.")}:null;case I.qH.PLUM:return function(e){var t,r,i,a,n,o,s,l;if(!(null===(t=e.prompt)||void 0===t?void 0:t.trim()))return{title:"Prompt Required",message:"Plum requires a prompt to continue!"};if(!(0,A.x0)(e.model_id))return{title:"Unknown Model",message:'Plum does not offer a "'.concat(e.model_id,'" model.')};let c=e.model_id,d=A.sm[c],u=(0,A.wn)(e);if(!(0,A.s6)(c,u.resolution))return{title:"Unsupported Resolution",message:"".concat(d," does not support ").concat(u.resolution,". Choose ").concat(A.ZW[c].join(" or ")," to continue.")};if(!(0,A.YH)(c,u.duration)){let e=A.vO[c];return{title:"Unsupported Duration",message:"".concat(d," videos must be between ").concat(e[0]," and ").concat(e[e.length-1]," seconds.")}}let p=(0,C.S)(e),m=!!e.first_image||!!e.last_image;if(null===(r=e.videos)||void 0===r?void 0:r.length){if(1!==e.videos.length)return{title:"Invalid Video Input",message:"Plum video editing requires exactly one source video."};if(!(0,S.k9)(e.video_duration_s))return{title:"Invalid Video Duration",message:"Plum videos must be between ".concat(A.zh," and ").concat(A.x9," seconds.")};if(void 0===e.duration)return{title:"Invalid Output Duration",message:"Plum video editing requires an output duration."};if(p.allImages.length>A.aH)return{title:"Too Many References",message:"Plum video editing supports up to ".concat(A.aH," reference images. Please remove some to continue.")};let t=!!e.audio||!!(null===(a=e.additional_audio)||void 0===a?void 0:a.length)||!!(null===(n=e.audio_references)||void 0===n?void 0:n.length)||!1!==e.use_character_voices&&(null!==(o=e.characters)&&void 0!==o?o:[]).some(e=>!!e.audio_url);if(m||t)return{title:"Unsupported Video Editor Input",message:"Plum video editing accepts a source video and up to 2 reference images, without frame or audio references."}}if(m&&p.allImages.length>0)return{title:"Unsupported Combination",message:"First/last frames cannot be combined with reference images. Remove the frames or the references to continue."};if(c===A.fR&&e.last_image&&!e.first_image)return{title:"First Frame Required",message:"Plum Max requires a first frame alongside the last frame. Add a first frame, or switch to Plum to use a last frame on its own."};if(p.allImages.length>9)return{title:"Too Many References",message:"A maximum of ".concat(9," reference images are allowed. Please remove some to continue.")};let g=null!==(s=null===(i=e.audio_references)||void 0===i?void 0:i.length)&&void 0!==s?s:0;return g>0&&0===p.allImages.length?{title:"Reference Image Required",message:"Plum audio requires at least one reference image (character, reference, etc.)"}:g>A.BW?{title:"Too Many Audio References",message:"Plum supports a maximum of ".concat(A.BW," audio references. Please remove some to continue.")}:g+(!1===e.use_character_voices?0:(null!==(l=e.characters)&&void 0!==l?l:[]).filter(e=>!!e.audio_url).length)>A.BW?{title:"Audio reference limit reached",message:"Remove audio references or turn off Character Voices to continue."}:null}(e);case I.qH.LEMON:return function(e){var t,r,i,a,n,o;
1if(!(null===(t=e.prompt)||void 0===t?void 0:t.trim()))return{title:"Prompt Required",message:"Lemon requires a prompt to continue!"};let s=(0,C.S)(e),l=!!e.first_image||!!e.last_image,c=null!==(a=null===(r=e.videos)||void 0===r?void 0:r.length)&&void 0!==a?a:0,d=null!==(n=null===(i=e.audio_references)||void 0===i?void 0:i.length)&&void 0!==n?n:0;if(l&&(s.allImages.length>0||c>0||d>0))return{title:"Unsupported Combination",message:"First/last frames cannot be combined with reference images, videos, or audio. Remove the frames or the references to continue."};if(s.allImages.length>h.M0)return{title:"Too Many References",message:"A maximum of ".concat(h.M0," reference images are allowed. Please remove some to continue.")};if(c>h.ot)return{title:"Too Many Reference Videos",message:"A maximum of ".concat(h.ot," reference videos are allowed. Please remove some to continue.")};let u=(0,f.Rj)(e);if(null===u)return{title:"Reference Videos Need Re-adding",message:"Some reference videos are missing their measured length. Please remove and re-add them to continue."};let p=(0,f.TP)(u,(0,f.iw)(e));return p?{title:"Reference Video Limit",message:p}:d>h.YE?{title:"Too Many Audio References",message:"Lemon supports a maximum of ".concat(h.YE," audio references. Please remove some to continue.")}:d+(!1===e.use_character_voices?0:(null!==(o=e.characters)&&void 0!==o?o:[]).filter(e=>!!e.audio_url).length)>h.YE?{title:"Audio reference limit reached",message:"Remove audio references or turn off Character Voices to continue."}:null}(e);case I.qH.MINIMAX_H3:return function(e){var t,r,i,a,n,o,s,l;if(!(null===(t=e.prompt)||void 0===t?void 0:t.trim()))return{title:"Prompt Required",message:"MiniMax-H3 requires a prompt to continue!"};let c=(0,C.S)(e),d=!!e.first_image||!!e.last_image,u=null!==(n=null===(r=e.videos)||void 0===r?void 0:r.length)&&void 0!==n?n:0,p=null!==(o=null===(i=e.audio_references)||void 0===i?void 0:i.length)&&void 0!==o?o:0,m=p+(!1===e.use_character_voices?0:(null!==(s=e.characters)&&void 0!==s?s:[]).filter(e=>!!e.audio_url).length);if(d&&(c.allImages.length>0||u>0||m>0))return{title:"Unsupported Combination",message:"First/last frames cannot be combined with reference images, videos, or audio. Remove the frames or the references to continue."};if(c.allImages.length>b.Is)return{title:"Too Many References",message:"A maximum of ".concat(b.Is," reference images are allowed. Please remove some to continue.")};if(u>b.gN)return{title:"Too Many Reference Videos",message:"A maximum of ".concat(b.gN," reference videos are allowed. Please remove some to continue.")};let g=function(e){var t,r;let i=null!==(t=e.videos)&&void 0!==t?t:[];if(0===i.length)return[];let a=null!==(r=e.video_durations_s)&&void 0!==r?r:[];return a.length!==i.length||a.some(e=>!Number.isFinite(e)||e<=0)?null:a}(e);if(null===g)return{title:"Reference Videos Need Re-adding",message:"Some reference videos are missing their measured length. Please remove and re-add them to continue."};let h=g.some(e=>!(e>=b.lj&&e<=b.$z))?"Each reference video must be between ".concat(b.lj," and ").concat(b.$z," seconds long."):null;if(h)return{title:"Reference Video Limit",message:h};if(p>b.Gb)return{title:"Too Many Audio References",message:"MiniMax-H3 supports a maximum of ".concat(b.Gb," audio references. Please remove some to continue.")};if(m>b.Gb)return{title:"Audio reference limit reached",message:"Remove audio references or turn off Character Voices to continue."};if(m>0&&0===c.allImages.length&&0===u)return{title:"Reference Image Required",message:"MiniMax-H3 audio requires at least one reference image or video (character, reference, etc.)"};if(c.allImages.length+u+m>b.Ws)return{title:"Too Many References",message:"MiniMax-H3 accepts at most ".concat(b.Ws," references in total across images, videos, and audio. Please remove some to continue.")};let f=(0,y.$A)(e);if(!(0,b.VK)(e.model_id)&&f>b.OG)return{title:"Duration Too Long",message:"The MiniMax-H3 base model runs up to ".concat(b.OG," seconds. Choose a shorter duration or the Turbo model to continue.")};let v=b.zK;if(f>b.sM&&(v=1),(null!==(l=null===(a=e.lora)||void 0===a?void 0:a.length)&&void 0!==l?l:0)>v)return{title:"Too Many LoRAs",message:"MiniMax-H3 supports a maximum of ".concat(b.zK," LoRAs, and only 1 on videos longer than ").concat(b.sM," seconds. Please remove some to continue.")};let _=(0,y.Dl)(e);return _?{title:"Reference Budget Exceeded",message:_}:null}(e);case I.qH.SEED_AUDIO:return function(e){var t,r,i;if(!(null===(t=e.prompt)||void 0===t?void 0:t.trim()))return{title:"Prompt Required",message:"Seed Audio requires text to synthesize. Add a prompt to continue!"};if(e.prompt.length>x.Ut)return{title:"Prompt Too Long",message:"Seed Audio prompts are limited to ".concat(x.Ut," characters. Please shorten your prompt.")};let a=e.image,n=(null===(r=e.audio_references)||void 0===r?void 0:r.length)||e.audio||(null===(i=e.additional_audio)||void 0===i?void 0:i.length)||e.speaker;if(a&&n)return{title:"Image or Audio Reference",message:"Seed Audio accepts an image reference or audio references, not both. Remove one to continue."};let o=void 0!==e.duration?Number(e.duration):void 0;return void 0!==o&&(!Number.isInteger(o)||o<x.nZ||o>x.Le)?{title:"Invalid Duration",message:"Duration must be a whole number between ".concat(x.nZ," and ").concat(x.Le," seconds.")}:null}(e);default:return null}}},41441:(e,t,r)=>{"use strict";r.d(t,{m:()=>d,e:()=>p});var i=r(34477);let a=(0,i.createServerReference)("00ff69e8448cc5b1f4a70b146e04728d9ea7db673e",i.callServer,void 0,i.findSourceMapURL,"removeInactiveSubscriptions");var n=r(62878),o=r(46222),s=r(61282);let l=(0,i.createServerReference)("789075c0647dadd4197c52f35fc60df162956a185c",i.c
1allServer,void 0,i.findSourceMapURL,"getCheckoutUrlWithStripeDirect");var c=r(4389);async function d(e){let t=n.C0[e];return t?l(t.priceId,u("gems",t.usd,t.sku),window.location.origin,"payment"):(await a(),e===s.c.MAX)?l(o.hK,u("max",200),window.location.origin,"subscription"):e===s.c.PRO_PLUS?l(o.DD,u("pro_plus",60),window.location.origin,"subscription"):e===s.c.PRO?l(o.Y0,u("pro",30),window.location.origin,"subscription"):e===s.c.BASIC?l(o.zJ,u("basic",10),window.location.origin,"subscription"):Promise.reject(Error("Unknown role"))}function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return"?upgrade=".concat(e,"&sku=").concat(r,"&amount=").concat(t,"&checkout_session_id={CHECKOUT_SESSION_ID}")}function p(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=e?"".concat(window.location.origin,"/membership"):window.location.origin;return(0,c.U)(t)}},41770:(e,t,r)=>{"use strict";function i(e){var t,r,i,a;let n=null!==(t=e.moodboard_sampled_images)&&void 0!==t?t:[],o=[e.image,...null!==(r=e.additional_images)&&void 0!==r?r:[]].filter(e=>!!e),s=n.length>0?o.slice(0,o.length-n.length):o,l=(null!==(i=e.characters)&&void 0!==i?i:[]).map(e=>e.image_url),c=(null!==(a=e.references)&&void 0!==a?a:[]).map(e=>e.image_url);return{userImages:s,characterImages:l,referenceImages:c,moodboardImages:n,allImages:[...s,...l,...c,...n]}}r.d(t,{S:()=>i})},41792:(e,t,r)=>{"use strict";r.d(t,{Kc:()=>R,fq:()=>I,sM:()=>C});var i=r(95155),a=r(24155),n=r(16791),o=r(8141),s=r(70112),l=r(21220),c=r(93751),d=r(58887),u=r(8593),p=r(83347),m=r(46759),g=r(65273),h=r(94098),f=r(8347),v=r(33981),_=r(38280),y=r(54395),b=r(31951),A=r(78977),S=r(12115);function x(e){var t,r;return{fixedSize:null!==(t=e.fixedSize)&&void 0!==t?t:1024,maxSize:null!==(r=e.maxSize)&&void 0!==r?r:1816}}function R(e){let[t,r]=(0,S.useState)(!1),u=(0,f.useOs)(),p="ios"===u||"android"===u;return(0,i.jsx)(m.mR,{p:e.p,h:e.h,loading:!e.hideLoadingOverlay&&t,disabled:e.disabled||t,activateOnClick:e.activateOnClick,activateOnKeyboard:e.activateOnKeyboard,maxSize:0xa00000,accept:g.Oq,style:{border:e.withoutBorder?"none":void 0},bg:e.withoutBackground?"transparent":void 0,enablePointerEvents:!0,styles:{inner:{height:e.h}},onDrop:t=>{let i=URL.createObjectURL(t[0]);r(!0),(0,a.XK)(i,x(e)).then(t=>{e.resolve(t.image),r(!1)}).catch(()=>{r(!1),(0,n.p6)({title:"Unable to Load Image",message:"The image could not be loaded. Please try again."})})},onReject:e=>{if("file-too-large"===e[0].errors[0].code)(0,n.p6)({title:"File Too Large",message:"The file is too large. Maximum file size is 10MB."});else{let t=e[0].errors[0].code;(0,n.p6)({title:"File Not Accepted",message:"Are you certain this is an image file? (Code: ".concat(t,")")})}},children:e.children?e.children:(0,i.jsx)(o.Center,{h:e.dropZoneHeight,children:(0,i.jsxs)(s.Group,{children:[(0,i.jsx)(h.qT,{children:(0,i.jsx)(_.A,{size:50,stroke:1.5,style:{marginRight:10},color:"white"})}),(0,i.jsx)(h.Zy,{children:(0,i.jsx)(y.A,{size:50,stroke:1.5,style:{marginRight:10},color:"red"})}),(0,i.jsx)(h.SC,{children:(0,i.jsx)(b.A,{size:50,stroke:1.5,style:{marginRight:10},color:"white"})}),(0,i.jsxs)(l.Stack,{gap:3,children:[(0,i.jsx)(c.Title,{c:"white",order:4,children:p?"Select an image!":"Drop an image!"}),(0,i.jsx)(d.Text,{size:"sm",children:p?"Click to select or take a photo.":"Or click to open file explorer."})]})]})})})}function I(e){let[t,r]=(0,S.useState)(""),[n,o]=(0,S.useState)("idle"),[s,l]=(0,S.useState)(""),[c]=(0,v.useDebouncedValue)(t,200);return(0,S.useEffect)(()=>{c?(l(""),o("loading"),(0,a.XK)(c,x(e)).then(t=>{e.resolve(t.image),o("idle")}).catch(()=>{o("error"),l("Unable to load image.")})):(o("idle"),l(""))},[c]),(0,i.jsx)(u.TextInput,{description:"Image Url",placeholder:"https://images.com/image.jpg",disabled:e.disabled||"loading"===n,value:t,error:s,size:"md",onChange:e=>r(e.currentTarget.value),rightSection:"idle"===n?null:"loading"===n?(0,i.jsx)(p.Loader,{size:18}):(0,i.jsx)(A.A,{color:"white"})})}function C(e){return(0,i.jsxs)(l.Stack,{gap:"xs",children:[!1===e.showDropZone?null:(0,i.jsx)(R,{...e}),!1===e.showUrlInput?null:(0,i.jsx)(I,{...e})]})}},42831:(e,t,r)=>{"use strict";r.d(t,{A:()=>i,p:()=>a});var i=function(e){return e.RES_1K="1k",e.RES_2K="2k",e}({}),a=function(e){return e.EULER="euler",e.EULER_A="euler_a",e.EULER_KARRAS="euler_karras",e.EULER_EXP="euler_exp",e.EULER_BETA="euler_beta",e.UNIPC="unipc",e}({})},42840:(e,t,r)=>{"use strict";r.d(t,{M:()=>f});var i=r(95155),a=r(21220),n=r(58887),o=r(70112),s=r(69604),l=r(27361),c=r(53776),d=r(26903),u=r(47639),p=r(17187),m=r(73883),g=r(97753),h=r.n(g);function f(e){let{title:t,price:r,features:g,isCurrentPlan:f,onSelect:v,backgroundImage:_,loading:y,style:b,buttonText:A,recommendation:S}=e;return(0,i.jsx)(m.RL,{backgroundImage:_,recommendation:S,style:b,children:(0,i.jsxs)(a.Stack,{gap:24,p:24,h:"100%",justify:"space-between",children:[(0,i.jsxs)(a.Stack,{gap:24,children:[(0,i.jsxs)(a.Stack,{gap:8,children:[(0,i.jsx)(m.fc,{recommendation:S}),(0,i.jsxs)(a.Stack,{gap:4,children:[(0,i.jsx)(n.Text,{fz:36,fw:700,children:t}
1),(0,i.jsxs)(o.Group,{align:"flex-start",gap:4,children:[(0,i.jsxs)(n.Text,{fz:30,fw:500,c:"white",lh:1,children:["$",r]}),(0,i.jsx)(n.Text,{fz:14,c:"dimmed",mt:-2,children:"/month"})]})]}),(0,i.jsx)(m.eF,{recommendation:S})]}),(0,i.jsx)(a.Stack,{gap:0,children:g.map((e,t)=>(0,i.jsxs)(s.Box,{children:[(0,i.jsxs)(o.Group,{gap:12,wrap:"nowrap",py:8,children:[(0,i.jsx)(u.A,{size:16,color:"white",opacity:.85}),(0,i.jsx)(n.Text,{fz:14,c:"white",opacity:.85,flex:1,children:e.text}),e.tooltip&&(0,i.jsx)(l.Tooltip,{label:e.tooltip,multiline:!0,w:260,withArrow:!0,zIndex:1300,events:{hover:!0,focus:!0,touch:!0},children:(0,i.jsx)(p.A,{size:16,color:"white",opacity:.5,style:{flexShrink:0,cursor:"pointer"}})})]}),(0,i.jsx)(c.Divider,{color:"white",opacity:.25})]},t))})]}),(0,i.jsx)(d.Button,{onClick:v,disabled:f,loading:y,size:"lg",variant:"white",className:h().button,c:f?"white":"black",style:{cursor:f?"not-allowed":"pointer"},children:null!=A?A:f?"Current":"Select Plan"})]})})}},43050:(e,t,r)=>{"use strict";r.d(t,{P4:()=>a,so:()=>i,yS:()=>n});var i=function(e){return e.RES_480P="480p",e.RES_720P="720p",e.RES_1080P="1080p",e}({}),a=function(e){return e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_4_3="4:3",e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_3_4="3:4",e.ASPECT_RATIO_9_16="9:16",e.ASPECT_RATIO_ADAPTIVE="adaptive",e}({}),n=function(e){return e.DURATION_2S="2",e.DURATION_3S="3",e.DURATION_4S="4",e.DURATION_5S="5",e.DURATION_6S="6",e.DURATION_7S="7",e.DURATION_8S="8",e.DURATION_9S="9",e.DURATION_10S="10",e.DURATION_11S="11",e.DURATION_12S="12",e.DURATION_13S="13",e.DURATION_14S="14",e.DURATION_15S="15",e.DURATION_16S="16",e.DURATION_17S="17",e.DURATION_18S="18",e.DURATION_19S="19",e.DURATION_20S="20",e.DURATION_21S="21",e.DURATION_22S="22",e.DURATION_23S="23",e.DURATION_24S="24",e.DURATION_25S="25",e.DURATION_26S="26",e.DURATION_27S="27",e.DURATION_28S="28",e.DURATION_29S="29",e.DURATION_30S="30",e}({})},43258:(e,t,r)=>{"use strict";r.d(t,{UR:()=>o,_W:()=>n});var i=r(4717),a=r(56800);let n={architecture:a.qH.STABLE_DIFFUSION_V35_MEDIUM,model_id:"sd-3-5-medium",prompt:"",negative_prompt:"",num_inference_steps:20,guidance_scale:7.5,aspect_ratio:i.vW.PORTRAIT},o={architecture:a.qH.STABLE_DIFFUSION_V35_MEDIUM,name:"Stable Diffusion v3.5 Medium",short_name:"SD3.5M",popularity:0,tags:[a.fZ,a.R$],api_path:"/api/v1/stable_diffusion_v35_medium",agent:{description:"Stable Diffusion 3.5 Medium.",defaultConfig:n,options:{},imageInputs:{references:{field:"image"}}}}},43359:(e,t,r)=>{"use strict";r.d(t,{i:()=>n});var i=r(71849),a=r(21078);function n(e){var t,r;let n=null!==(t=e.resolution)&&void 0!==t?t:a.Wc.resolution,o=null!==(r=e.duration)&&void 0!==r?r:a.Wc.duration,s=e.reference_video_urls&&e.reference_video_urls.length>0,l=n===i.tY.RES_1080P,c=e.model_id===a.el?l?135:90:l?159:105,d=c*Number(o);return s&&(d+=5*c),d}},43789:(e,t,r)=>{"use strict";r.d(t,{Ao:()=>n,N8:()=>o,c1:()=>a});var i=r(64428);function a(){return Math.random().toString(36).substring(2,6)}function n(e){return e.toLowerCase().replace(/[^a-z0-9_-]/g,"")}function o(e,t){if(!e.trim())return"";let r=(e.toLowerCase().trim().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").replace(/^[^a-z]+/,"")||"character").slice(0,i.d0-t.length-1).replace(/[-_]+$/,"");return"".concat(r,"-").concat(t)}},44164:(e,t,r)=>{"use strict";function i(e,t){let r=e.find(e=>e.id===t);if(!r)throw Error("Unknown model: ".concat(t));return r}function a(e,t,r){var a;return null!==(a=e.find(e=>e.id===t))&&void 0!==a?a:i(e,r)}function n(e){return e.map(e=>{let{id:t,label:r}=e;return{label:r,value:t}})}function o(e){return e.filter(e=>!0===e.strictFilterBadge).map(e=>e.id)}function s(e){return e.resolutions.map(e=>({label:e,value:e}))}function l(e){return e.durations.map(e=>({label:"".concat(e,"s"),value:e}))}function c(e){return e.aspectRatios.map(e=>({label:e,value:e}))}function d(e,t,r){var i;let a=e.find(e=>e===t);return a||(null!==(i=e.find(e=>e===r))&&void 0!==i?i:e[0])}
1function u(e,t,r,i){var n,o;return n=a(e,t,i),o=r,{...n,resolution:d(n.resolutions,o)}}function p(e,t){let r=i(e,t);return{modelId:r.id,resolution:r.resolutions[0]}}function m(e,t,r,i,n,o,s){var l;return{...l=a(e,t,o),resolution:d(l.resolutions,r,null==s?void 0:s.resolution),duration:d(l.durations,i,null==s?void 0:s.duration),aspectRatio:d(l.aspectRatios,n,null==s?void 0:s.aspectRatio)}}r.d(t,{AG:()=>o,EB:()=>m,Oj:()=>n,RU:()=>s,S6:()=>c,bc:()=>p,fc:()=>u,pr:()=>l,ug:()=>a})},44323:(e,t,r)=>{"use strict";r.d(t,{F:()=>_,t:()=>y});var i=r(95155),a=r(99785),n=r(85541),o=r(68664),s=r(8399),l=r(77567),c=r(20711),d=r(84989),u=r(36848),p=r(20668),m=r(8141),g=r(66610),h=r(88551),f=r(12115),v=r(51013);function _(e){var t,r;let s=(0,f.useId)(),d=(0,o.eN)(e.src,"number"==typeof(null===(t=e.style)||void 0===t?void 0:t.width)?e.style.width:e.maxWidth,"number"==typeof(null===(r=e.style)||void 0===r?void 0:r.height)?e.style.height:void 0),[p,_]=(0,f.useState)(!1),[y,b]=(0,f.useState)(null),{ref:A,hovered:S}=(0,g.useHover)(),x=(0,f.useRef)(null),R=(0,c.t)(d||""),I=(0,h.useMergedRef)(x,R),C=(0,a.ut)({architecture_config:e.architectureConfig,metadata:e.metadata}),{unmutedAudioId:w,setUnmutedAudioId:E}=(0,l.VT)("unmutedAudioId","setUnmutedAudioId"),P=w!==s;(0,f.useEffect)(()=>{b(null)},[d]),(0,f.useEffect)(()=>{S&&(null==x?void 0:x.current)?x.current.play().catch(e=>console.error("Error playing video:",e)):!S&&x.current&&(x.current.pause(),x.current.currentTime=0,w===s&&E(null))},[S]),(0,f.useEffect)(()=>{(null==x?void 0:x.current)&&(x.current.muted=P)},[P]),(0,f.useEffect)(()=>{!1===y&&w===s&&E(null)},[s,y,E,w]);let T={width:"100%",height:"auto",opacity:0,WebkitTransition:"opacity 0.5s ease",MozTransition:"opacity 0.5s ease",OTransition:"opacity 0.5s ease",transition:"opacity 0.5s ease",willChange:"opacity",borderRadius:"8px",backgroundColor:"var(--mantine-color-dark-9)",...e.style},M={position:"relative",aspectRatio:p?void 0:C,backgroundColor:p?void 0:"var(--mantine-color-dark-9)",borderRadius:"8px",...e.wrapperStyle};return(0,i.jsxs)("div",{className:"CreationVideo",ref:A,style:M,children:[(0,i.jsx)("video",{ref:I,style:T,onCanPlay:t=>{var r;b((0,u.F)(t.currentTarget)),t.target.style.opacity="1",_(!0),null===(r=e.onLoad)||void 0===r||r.call(e,t)},onLoadedMetadata:e=>{let t=e.target;b((0,u.F)(t)),t.currentTime=.001},onTimeUpdate:e=>{!0!==y&&e.currentTarget.currentTime>.05&&b((0,u.F)(e.currentTarget))},loop:!0,muted:P,preload:"metadata",playsInline:!0,disablePictureInPicture:!0,children:"Your browser does not support video"}),!S&&(0,i.jsx)(m.Center,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:"8px",transition:"opacity 0.3s ease"},children:(0,i.jsx)(v.puv,{size:30,color:"white",style:{opacity:.8}})}),(0,i.jsx)(n.Z,{audioId:s,hasAudio:y,isHovered:S,position:e.audioPosition})]})}function y(e){var t,r;let n=(0,o.eN)(e.src,"number"==typeof(null===(t=e.style)||void 0===t?void 0:t.width)?e.style.width:e.maxWidth,"number"==typeof(null===(r=e.style)||void 0===r?void 0:r.height)?e.style.height:void 0),[l,u]=(0,f.useState)(!1),m=(0,c.v)(n||e.src),g=(0,a.ut)({architecture_config:e.architectureConfig,metadata:e.metadata}),h={width:"100%",height:"auto",opacity:0,WebkitTransition:"opacity 0.5s ease",MozTransition:"opacity 0.5s ease",OTransition:"opacity 0.5s ease",transition:"opacity 0.5s ease",willChange:"opacity",borderRadius:"8px",...e.style},v={position:"relative",aspectRatio:l?void 0:g,backgroundColor:l?void 0:"var(--mantine-color-dark-9)",borderRadius:"8px",...e.wrapperStyle};if((0,s.W)(e.src)){let{prompt:t,duration:r}=(0,d.o4)(e.architectureConfig,e.metadata);return(0,i.jsx)(s.U,{src:e.src,alt:e.alt,prompt:t,duration:r,style:e.style,wrapperStyle:e.wrapperStyle})}return(null==n?void 0:n.endsWith(".mp4"))?(0,i.jsx)(_,{...e}):(0,i.jsx)("div",{className:"CreationImage",style:v,children:(0,i.jsx)("img",{ref:m,alt:e.alt,width:e.maxWidth,height:e.maxWidth,style:h,loading:"lazy",...(0,p.W2)(e.src?{url:e.src,mediaType:"image"}:null),onLoad:t=>{var r;t.target.style.opacity="1",u(!0),null===(r=e.onLoad)||void 0===r||r.call(e,t)}})})}},44442:(e,t,r)=>{"use strict";r.d(t,{Y:()=>n,u:()=>a});var i=r(56800);let a={architecture:i.qH.PEAR},n={architecture:i.qH.PEAR,name:"Pear",short_name:"Pear",popularity:3,tags:[i.fZ,i.tM,i.yu],api_path:"/api/v1/pear",agent:null}},45151:(e,t,r)=>{"use strict";r.d(t,{Ld:()=>d,ri:()=>u});var i=r(95155),a=r(4717),n=r(77567),o=r(43608),s=r(18403),l=r(93751),c=r(58887);function d(e){return[a.Uc.G,a.Uc.G_PLUS,null].includes(e)}function u(e){var t;let r=(0,n.xV)(e=>e.isDesktop);return(0,i.jsx)(o.UnstyledButton,{onClick:e.select,disabled:e.disabled,style:{maxHeight:150},children:(0,i.jsxs)(s.Card,{bg:e.isSelected?"dark.9":void 0,opacity:e.disabled?.3:1,h:"100%",style:{border:e.isSelected?"1px white solid":"
11px transparent solid"},children:[(0,i.jsx)(l.Title,{order:r?1:2,c:"white",ta:r?void 0:"center",children:null!==(t=e.displayRating)&&void 0!==t?t:e.rating}),r?(0,i.jsx)(c.Text,{c:"dimmed",children:function(e){switch(e){case a.Uc.G:return"All Ages";case a.Uc.G_PLUS:return"Generally Acceptable";case a.Uc.M:return"Mild Mature Themes";case a.Uc.M_PLUS:return"Mature Themes"}return"Please Add Rating"}(e.rating)}):null]})})}},45335:(e,t,r)=>{"use strict";r.d(t,{L1:()=>n,nA:()=>i,qw:()=>a});var i=function(e){return e.RES_720P="720p",e.RES_1080P="1080p",e}({}),a=function(e){return e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_4_3="4:3",e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_3_4="3:4",e.ASPECT_RATIO_9_16="9:16",e}({}),n=function(e){return e.DURATION_2S="2",e.DURATION_3S="3",e.DURATION_4S="4",e.DURATION_5S="5",e.DURATION_6S="6",e.DURATION_7S="7",e.DURATION_8S="8",e.DURATION_9S="9",e.DURATION_10S="10",e.DURATION_11S="11",e.DURATION_12S="12",e.DURATION_13S="13",e.DURATION_14S="14",e.DURATION_15S="15",e}({})},45765:(e,t,r)=>{"use strict";r.d(t,{L_:()=>l,f$:()=>o,m6:()=>d});let i=["/agent","/api","/apps","/story-studio/new","/settings","/admin","/membership","/messages","/notifications","/import","/updates","/article","/jobs","/refer","/privacy-policy","/terms-and-conditions"],a=["/apps/recreate"];function n(e,t){return e===t||e.startsWith(t+"/")}function o(e){return!a.some(t=>n(e,t))&&i.some(t=>n(e,t))}let s=["/agent"];function l(e){return s.some(t=>n(e,t))}let c=["/messages/"];function d(e){return c.some(t=>e.startsWith(t))}},46222:(e,t,r)=>{"use strict";r.d(t,{DD:()=>n,KG:()=>m,QU:()=>s,Xm:()=>u,Y0:()=>a,b6:()=>d,cU:()=>g,ee:()=>l,hK:()=>o,lU:()=>p,xs:()=>c,zJ:()=>i});let i="price_1TrfwwKTLqGacKLkL8UVD6Og",a="price_1TrfwLKTLqGacKLkfeiWF92S",n="price_1TrfvmKTLqGacKLkfeX00rj1",o="price_1TrfswKTLqGacKLkJxfzCds4",s="price_1TrPfIKTLqGacKLkI9s4nJge",l="prod_STveEIa9JHzxAZ",c="price_1Trfu9KTLqGacKLkC1e0aANb",d="prod_SZSRqsR2DfbmQP",u="price_1TrftcKTLqGacKLkv1CSQjN3",p="prod_SZSTfcbU9c8AkZ",m="price_1TrfrvKTLqGacKLkHZ9IScWM",g="prod_UBUuZsWVUSLog1"},47370:(e,t,r)=>{"use strict";r.d(t,{RR:()=>i,X5:()=>n,mA:()=>a});var i=function(e){return e.RES_480P="480p",e.RES_720P="720p",e}({}),a=function(e){return e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_9_16="9:16",e.ASPECT_RATIO_4_3="4:3",e.ASPECT_RATIO_3_4="3:4",e.ASPECT_RATIO_3_2="3:2",e.ASPECT_RATIO_2_3="2:3",e}({}),n=function(e){return e.DURATION_1S="1",e.DURATION_2S="2",e.DURATION_3S="3",e.DURATION_4S="4",e.DURATION_5S="5",e.DURATION_6S="6",e.DURATION_7S="7",e.DURATION_8S="8",e.DURATION_9S="9",e.DURATION_10S="10",e.DURATION_11S="11",e.DURATION_12S="12",e.DURATION_13S="13",e.DURATION_14S="14",e.DURATION_15S="15",e}({})},47558:(e,t,r)=>{"use strict";r.d(t,{GX:()=>n,XP:()=>o,jr:()=>a,mR:()=>i});let i=700,a="promptbar-textarea",n=!1;function o(e){return e.length<=10?e:"".concat(e.slice(0,10),"...")}},48473:(e,t,r)=>{"use strict";r.d(t,{l:()=>a});var i=r(34477);let a=(0,i.createServerReference)("4070558df11ef840e6bf0c8084adbb797a178ef368",i.callServer,void 0,i.findSourceMapURL,"runArchitecture")},48568:(e,t,r)=>{"use strict";r.d(t,{ol:()=>U,s:()=>D,Cf:()=>O});var i=r(95155),a=r(25352),n=r(77567),o=r(23258),s=r(18403),l=r(21220),c=r(70112),d=r(93751),u=r(95642),p=r(58887),m=r(91423),g=r(23288),h=r(26903),f=r(35049),v=r(26029),_=r(68183);function y(e){let{onUseGems:t,gems:r}=e;return(0,i.jsx)(h.Button,{variant:"light",color:"orange",size:"lg",radius:10,fullWidth:!0,h:"auto",py:"sm",px:"md",styles:{label:{width:"100%"}},onClick:()=>{(0,m.s7)(),t()},children:(0,i.jsxs)(c.Group,{justify:"space-between",wrap:"nowrap",gap:"md",w:"100%",children:[(0,i.jsxs)(c.Group,{wrap:"nowrap",gap:"sm",children:[(0,i.jsx)(f.ThemeIcon,{variant:"light",color:"orange",size:"lg",radius:"md",children:(0,i.jsx)(_.A,{size:20})}),(0,i.jsxs)(l.Stack,{gap:0,align:"flex-start",children:[(0,i.jsx)(p.Text,{c:"white",size:"sm",fw:700,lh:1.3,children:"Pay per generation"}),(0,i.jsx)(p.Text,{c:"dimmed",size:"xs",fw:400,lh:1.3,children:"Use gems from your wallet"})]})]}),(0,i.jsx)(v.Badge,{variant:"outline",color:"orange",size:"lg",radiu
1s:"md",fz:"xs",tt:"none",children:r&&r>0?(0,i.jsxs)(c.Group,{gap:4,wrap:"nowrap",children:[(0,i.jsx)(_.A,{size:12}),(0,g.Z)(r,1)]}):"Use Gems"})]})})}function b(e){let{description:t,onUseGems:r}=e,{isDesktop:g}=(0,n.VT)("isDesktop"),h=(0,n.xV)(e=>e.getActiveArchitectureConfig()),f=(0,o.BA)(h,a.o.GEMS);return(0,i.jsx)(s.Card,{bg:"dark.9",withBorder:!0,p:"lg",radius:"lg",children:(0,i.jsxs)(l.Stack,{gap:"lg",children:[(0,i.jsxs)(c.Group,{justify:"space-between",wrap:"nowrap",children:[(0,i.jsx)(d.Title,{size:g?"h3":"h4",order:3,c:"white",children:"Gems Required for Concurrency"}),(0,i.jsx)(u.CloseButton,{onClick:()=>(0,m.s7)(),"aria-label":"Close modal",size:"lg",c:"white"})]}),(0,i.jsx)(p.Text,{size:"sm",c:"dimmed",mt:-10,children:t}),(0,i.jsx)(y,{onUseGems:r,gems:f})]})})}var A=r(49781),S=r(6874),x=r.n(S);function R(){let{isDesktop:e}=(0,n.VT)("isDesktop");return(0,i.jsxs)(s.Card,{bg:"dark.9",withBorder:!0,p:"lg",radius:"lg",children:[(0,i.jsx)(A.FocusTrap.InitialFocus,{}),(0,i.jsxs)(l.Stack,{gap:"lg",children:[(0,i.jsxs)(c.Group,{justify:"space-between",wrap:"nowrap",children:[(0,i.jsx)(d.Title,{size:e?"h3":"h4",order:3,c:"white",children:"Mage Members Only"}),(0,i.jsx)(u.CloseButton,{onClick:()=>(0,m.s7)(),"aria-label":"Close modal",size:"lg",c:"white"})]}),(0,i.jsx)(p.Text,{size:"sm",c:"dimmed",mt:-10,children:"Unlimited mode is only available to Mage members. Free accounts generate with Gems."}),(0,i.jsx)(h.Button,{variant:"white",c:"black",size:"lg",fullWidth:!0,component:x(),href:"/membership",onClick:()=>(0,m.s7)(),children:"Get Membership"}),(0,i.jsxs)(p.Text,{size:"xs",c:"dimmed",ta:"center",mt:-10,children:["⚡ Discover the power of"," ",(0,i.jsx)(p.Text,{component:"span",c:"white",fw:700,inherit:!0,children:"Unlimited Generations"})," ","with a membership"]})]})]})}var I=r(78507),C=r(27122),w=r(14276),E=r(41698);function P(e){let t,r,{membershipRequired:a,onSwitchToGems:o,gems:g,resetToUnlimited:v}=e,{isDesktop:_,userMembership:b}=(0,n.VT)("isDesktop","userMembership"),A=a!==C.v;return A?(t="Upgrade For Unlimited",r="Your ".concat((0,w.L)(b)," membership doesn't include this configuration for Unlimited generation.")):(t="Unlimited Unavailable",r="This configuration doesn't have an Unlimited option — it runs on Gems."),(0,i.jsx)(s.Card,{bg:"dark.9",withBorder:!0,p:"lg",radius:"lg",children:(0,i.jsxs)(l.Stack,{gap:"lg",children:[(0,i.jsxs)(c.Group,{justify:"space-between",wrap:"nowrap",children:[(0,i.jsx)(d.Title,{size:_?"h3":"h4",order:3,c:"white",children:t}),(0,i.jsx)(u.CloseButton,{onClick:()=>(0,m.s7)(),"aria-label":"Close modal",size:"lg",c:"white"})]}),(0,i.jsx)(p.Text,{size:"sm",c:"dimmed",mt:-10,children:r}),A&&(0,I.b)(a,"Upgrade"),(0,i.jsx)(y,{onUseGems:o,gems:g}),v&&(0,i.jsx)(h.Button,{variant:"light",color:"teal",size:"lg",radius:10,fullWidth:!0,h:"auto",py:"sm",px:"md",styles:{label:{width:"100%"}},onClick:()=>{(0,m.s7)(),v.onReset()},children:(0,i.jsxs)(c.Group,{wrap:"nowrap",gap:"sm",w:"100%",children:[(0,i.jsx)(f.ThemeIcon,{variant:"light",color:"teal",size:"lg",radius:"md",children:(0,i.jsx)(E.A,{size:20})}),(0,i.jsxs)(l.Stack,{gap:0,align:"flex-start",children:[(0,i.jsxs)(p.Text,{c:"white",size:"sm",fw:700,lh:1.3,children:["Reset To Unlimited For ",(0,w.L)(b)]}),(0,i.jsxs)(p.Text,{c:"dimmed",size:"xs",fw:400,lh:1.3,children:["Switches your settings to ",v.settingsSummary]})]})]})})]})})}var T=r(7963);let M=new Set;function k(e){M.has(e.id)||(M.add(e.id),(0,T.q)({...e,onClose:()=>{var t;M.delete(e.id),null===(t=e.onClose)||void 0===t||t.call(e)}}))}function O(e){let{config:t,membershipRequired:r,setGenerationMode:n,applyConfig:s,onResolved:l,resetToUnlimited:c}=e,d=t?(0,o.BA)(t,a.o.GEMS):void 0;k({id:"unlimited-config-modal",size:"min(94vw, 420px)",children:(0,i.jsx)(P,{membershipRequired:r,gems:d,resetToUnlimited:c,onSwitchToGems:()=>{n(a.o.GEMS),t&&s&&s(t),null==l||l(a.o.GEMS)}})})}function D(){k({id:"members-only-mode-modal",size:"min(94dvw, 540px)",children:(0,i.jsx)(R,{})})}function U(e){let{description:t,onUseGems:r}=e;k({id:"gem-concurrency-modal",size:"min(94vw, 420px)",children:(0,i.jsx)(b,{description:t,onUseGems:r})})}},50801:(e,t,r)=>{"use strict";r.d(t,{t:()=>eo});
1var i=r(86438),a=r(34442),n=r(5023),o=r(43359),s=r(22310),l=r(12920),c=r(60535),d=r(37463),u=r(6379),p=r(88061),m=r(72922);let g={[p.k.SIZE_240P]:.444,[p.k.SIZE_360P]:1,[p.k.SIZE_480P]:1.778,[p.k.SIZE_720P]:4};var h=r(26905),f=r(54754),v=r(81152),_=r(41770),y=r(54887),b=r(412);function A(e){return 5*(0,_.S)(e).allImages.length}var S=r(60608),x=r(84461),R=r(56650),I=r(42831),C=r(80596),w=r(52256),E=r(64325),P=r(25618),T=r(18683),M=r(29728),k=r(80564),O=r(94028),D=r(65638),U=r(59791),N=r(96700),H=r(13421),j=r(73857),L=r(40350),G=r(55317),q=r(76017),B=r(3267),F=r(67881),V=r(20666),K=r(93331),z=r(61320),W=r(14994),X=r(39191),Y=r(88970),Z=r(31760),Q=r(43258),$=r(88266),J=r(39358),ee=r(82395),et=r(41152),er=r(4714),ei=r(20835),ea=r(4334),en=r(56800);function eo(e){var t,r,p,eo,es,el,ec,ed,eu,ep,em,eg,eh,ef,ev,e_,ey,eb,eA,eS,ex,eR,eI,eC,ew,eE,eP,eT,eM,ek,eO,eD,eU,eN,eH,ej,eL,eG,eq,eB,eF,eV,eK,ez,eW,eX;switch(e.architecture){case en.qH.FLUX:return function(e){var t,r,a,n,o;let s=null!==(a=e.num_inference_steps)&&void 0!==a?a:c.b0.num_inference_steps,l=null!==(n=null===(t=e.lora)||void 0===t?void 0:t.length)&&void 0!==n?n:0;return l+=null!==(o=null===(r=e.controlnet)||void 0===r?void 0:r.length)&&void 0!==o?o:0,e.image&&(l+=1),e.hires&&(l+=1),(0,i.Kt)(.71+.534*s,i.p7,l)}(e);case en.qH.STABLE_DIFFUSION_V15:let eY;return eY=(null!==(ec=null===(r=(t=e).lora)||void 0===r?void 0:r.length)&&void 0!==ec?ec:0)+(null!==(ed=null===(p=t.ti)||void 0===p?void 0:p.length)&&void 0!==ed?ed:0)+(null!==(eu=null===(eo=t.controlnet)||void 0===eo?void 0:eo.length)&&void 0!==eu?eu:0)+(null!==(ep=null===(es=t.face_references)||void 0===es?void 0:es.images.length)&&void 0!==ep?ep:0)+(null!==(em=null===(el=t.style_references)||void 0===el?void 0:el.images.length)&&void 0!==em?em:0),t.image&&(eY+=1),t.hires&&(eY+=1),(0,i.Kt)(.37+.052*(null!==(eg=t.num_inference_steps)&&void 0!==eg?eg:Y.Wt.num_inference_steps),i.p7,eY);case en.qH.STABLE_DIFFUSION_V35_LARGE:return function(e){var t,r,a;let n=null!==(r=e.num_inference_steps)&&void 0!==r?r:Z.E$.num_inference_steps,o=null!==(a=null===(t=e.style_references)||void 0===t?void 0:t.images.length)&&void 0!==a?a:0;return e.image&&(o+=1),(0,i.Kt)(.43+.265*n,i.p7,o)}(e);case en.qH.STABLE_DIFFUSION_V35_MEDIUM:let eZ=0;return e.image&&(eZ+=1),(0,i.Kt)(.61+.208*(null!==(eh=e.num_inference_steps)&&void 0!==eh?eh:Q._W.num_inference_steps),i.p7,eZ);case en.qH.STABLE_DIFFUSION_XL:let eQ;return eQ=(null!==(eS=null===(ev=(ef=e).lora)||void 0===ev?void 0:ev.length)&&void 0!==eS?eS:0)+(null!==(ex=null===(e_=ef.ti)||void 0===e_?void 0:e_.length)&&void 0!==ex?ex:0)+(null!==(eR=null===(ey=ef.controlnet)||void 0===ey?void 0:ey.length)&&void 0!==eR?eR:0)+(null!==(eI=null===(eb=ef.face_references)||void 0===eb?void 0:eb.images.length)&&void 0!==eI?eI:0)+(null!==(eC=null===(eA=ef.style_references)||void 0===eA?void 0:eA.images.length)&&void 0!==eC?eC:0),ef.image&&(eQ+=1),ef.hires&&(eQ+=1),(0,i.Kt)(.94+.107*(null!==(ew=ef.num_inference_steps)&&void 0!==ew?ew:$._e.num_inference_steps),i.p7,eQ);case en.qH.LTX_VIDEO:return function(e){var t,r;let a=null!==(t=e.num_inference_steps)&&void 0!==t?t:P.oH.num_inference_steps,n=4.83+function(e){if(e===E.I.SIZE_240P)return 3.18;if(e===E.I.SIZE_360P)return 7.15;if(e===E.I.SIZE_480P)return 12.72;if(e===E.I.SIZE_720P)return 28.62;throw Error("Unknown base size for LTX Video: ".concat(e))}(null!==(r=e.base_size)&&void 0!==r?r:P.oH.base_size)*(a/8),o=0;return e.image&&(o+=1),(0,i.Kt)(n,i.p7,o)}(e);case en.qH.WAN:let e$;return e$=null!==(eP=null===(eE=e.lora)||void 0===eE?void 0:eE.length)&&void 0!==eP?eP:0,e.image&&(e$+=1),e.last_image&&(e$+=1),(0,i.Kt)(function(e){var t,r,i;let a,n=null!==(t=e.num_inference_steps)&&void 0!==t?t:et.OH.num_inference_steps,o=null!==(r=e.num_frames)&&void 0!==r?r:et.OH.num_frames,s=null!==(i=e.base_size)&&void 0!==i?i:et.OH.base_size;return(a=e.model_id===et.E8?.099*n*o:n/15*(o<=41?1.6*o:2.1961*o+-24.44))*function(e){if(e===ee.l.SIZE_240P)return .197;if(e===ee.l.SIZE_360P)return .51;if(e===ee.l.SIZE_480P)return 1;if(e===ee.l.SIZE_720P)return 3.312;throw Error("Unknown base size for Wan: ".concat(e))}(s)}(e),i._m,e$);case en.qH.WAN_22:let eJ;return eJ=null!==(eM=null===(eT=e.lora)||void 0===eT?void 0:eT.length)&&void 0!==eM?eM:0,e.image&&(eJ+=1),(0,i.Kt)(function(e){var t,r,i;let a,n=null!==(t=e.num_inference_steps)&&void 0!==t?t:ei.iH.num_inference_steps,o=null!==(r=e.num_frames)&&void 0!==r?r:ei.iH.num_frames,s=null!==(i=e.base_size)&&void 0!==i?i:ei.iH.base_size;return(a=e.model_id===ei.M?.10454629629629629*n*o:n/30*(o<=41?3.1903*o:4.3254*o+-46.54))*function(e){if(e===er.d.SIZE_240P)return .208;if(e===er.d.SIZE_360P)return .52;if(e===er.d.SIZE_480P)return 1;if(e===er.d.SIZE_720P)return 3.082;throw Error("Unknown base size for Wan 2.2: ".concat(e))}(s)}(e),i._m,eJ);case en.qH.VEO3:return!1===e.generate_audio?5200:7800;case en.qH.VEO3_1:let e0=e.resolution===J.fK.RES_1080P?120:75;return e.duration===J.BA.DURATION_8S?8*e0:e.duration===J.BA.DURATION_6S?6*e0:4*e0;case en.qH.ENHANCE:return(0,i.Kt)(3.41+.279*(null!==(ek=e.num_inference_steps)&&void 0!==ek?ek:20),i.p7);case en.qH.REFINE:return(0,i.Kt)(.83+.26*(null!==(eO=e.num_inference_steps)&&void 0!==eO?eO:8),i.p7);case en.qH.HIDREAM:let e1=null!==(eD=e.num_inference_steps)&&void 0!==eD?eD:S.Iw.num_inference_steps;return(0,i.Kt)(1.115*e1,i.p7);case en.qH.FRAMEPACK:return function(e){var t,r,a;let n=null!==(r=e.num_inference_steps)&&void 0!==r?r:m.IJ.num_inference_steps,o=(0,m.$H)(e.video_length),s=(4.62+1.519*n+.16*o+.0323*n*o)*g[e.base_size],l=null!==(a=null===(t=e.lora)||void 0===t?void 0:t.length)&&void 0!==a?a:0;return e.last_image&&(l+=1),(0,i.Kt)(s,i.p7,l)}(e);case en.qH.SELFIE:let e2;return e2=(null!==(ej=null===(eN=(eU=e).lora)||void 0===eN?void 0:eN.length)&&void 0!==ej?ej:0)+(null!==(eL=null===(eH=eU.ti)||void 0===eH?void 0:eH.length)&&void 0!==eL?eL:0),(0,i.Kt)(1.28+.174*(null!==(eG=eU.num_inference_steps)&&void 0!==eG?eG:W.sc.num_inference_steps),i.p7,e2);case en.qH.CHROMA:return function(e){var t,r,a;let n=null!==(r=e.num_inference_steps)&&void 0!==r?r:l.Wk.num_inference_steps,o=null!==(a=null===(t=e.lora)||void 0===t?void 0:t.length)&&void 0!==a?a:0;return(0,i.Kt)(4.59+.999*n,i.p7,o)}(e);case en.qH.FLUX_KONTEXT_DEV:return function(e){var t,r,a;let n=null!==(r=e.num_inference_steps)&&void 0!==r?r:u.zG.num_inference_steps,o=1.23+.453*n;e.image&&(o=3.94+.916*n);let s=null!==(a=null===(t=e.lora)||void 0===t?void 0:t.length)&&void 0!==a?a:0;return(0,i.Kt)(o,i.p7,s)}(e);case en.qH.MANGO:if(e.model_id===M.vn)return 45;if(e.model_id===M.V)return 55;if(e.model_id===M.ZI)return Math.ceil((e.resolution===T.d.RES_1K?68:135)+4.5*Math.max(0,(0,_.S)(e).allImages.length-1));return 60;case en.qH.QWEN_IMAGE:return function(e){var t,r,a;let n=null!==(r=e.num_inference_steps)&&void 0!==r?r:q.H3.num_inference_steps,o=null!==(a=null===(t=e.lora)||void 0===t?void 0:t.length)&&void 0!==a?a:0;return e.image&&(o+=1),(0,i.Kt)(.64+.888*n,i.p7,o)}(e);case en.qH.QWEN_IMAGE_EDIT_PLUS:return function(e){var t,r,a,n,o;let s=null!==(a=e.num_inference_steps)&&void 0!==a?a:B.JB.num_inference_steps,l=null!==(n=null===(t=e.lora)||void 0===t?void 0:t.length)&&void 0!==n?n:0;return l+=null!==(o=null===(r=e.additional_images)||void 0===r?void 0:r.length)&&void 0!==o?o:0,(0,i.Kt)(1.43+1.957*s,i.p7,l)}(e);case en.qH.Z_IMAGE:return function(e){var t,r,a;let n=null!==(r=e.num_inference_steps)&&void 0!==r?r:ea.qo.num_inference_steps,o=null!==(a=null===(t=e.lora)||void 0===t?void 0:t.length)&&void 0!==a?a:0;return e.image&&(o+=1),(0,i.Kt)(.38+.301*n,i.p7,o)}(e);case en.qH.KREA_2:return function(e){var t,r,a;let n,o,s=null!==(r=e.num_inference_steps)&&void 0!==r?r:C.Mp.num_inference_steps,l=e.resolution===I.A.RES_2K;e.model_id===C.HR?(n=l?23.22:13.132,o=28):(n=l?4.726:2.418,o=8);let c=n*s/o,d=null!==(a=null===(t=e.lora)||void 0===t?void 0:t.length)&&void 0!==a?a:0;return(0,i.Kt)(c,i._m,d)+10}
1(e);case en.qH.FLUX2:return function(e){var t,r,a;let n=null!==(r=e.num_inference_steps)&&void 0!==r?r:d.dk.num_inference_steps,o=null!==(a=null===(t=e.additional_images)||void 0===t?void 0:t.length)&&void 0!==a?a:0;return e.image&&(o+=1),(0,i.Kt)(.64+1.653*n,i.p7,o)+i.Ak}(e);case en.qH.KIWI:let e5=null!==(eq=e.resolution)&&void 0!==eq?eq:R.q$.resolution,e3=null!==(eB=e.duration)&&void 0!==eB?eB:R.q$.duration;if(e5===x.tv.RES_480P){if(e3===x.vr.DURATION_5S)return 270;if(e3===x.vr.DURATION_10S)return 540}if(e5===x.tv.RES_720P){if(e3===x.vr.DURATION_5S)return 525;if(e3===x.vr.DURATION_10S)return 1050}if(e5===x.tv.RES_1080P){if(e3===x.vr.DURATION_5S)return 795;if(e3===x.vr.DURATION_10S)return 1590}throw Error("Unknown configuration for Kiwi (resolution: ".concat(e5,", duration: ").concat(e3,")"));case en.qH.PEACH:return function(e){var t,r,i;let a=null!==(t=e.resolution)&&void 0!==t?t:H.Xe.resolution,n=null!==(r=e.peach_aspect_ratio)&&void 0!==r?r:H.Xe.peach_aspect_ratio,o=null!==(i=e.duration)&&void 0!==i?i:H.Xe.duration;if(a===N.qQ.RES_480P){if(o===N.OP.DURATION_5S)return 75;if(o===N.OP.DURATION_10S){if(n===N.Xn.ASPECT_RATIO_16_9)return 150;if(n===N.Xn.ASPECT_RATIO_4_3)return 135;if(n===N.Xn.ASPECT_RATIO_1_1)return 150;if(n===N.Xn.ASPECT_RATIO_21_9||n===N.Xn.ASPECT_RATIO_3_4)return 135}}if(a===N.qQ.RES_720P){if(o===N.OP.DURATION_5S){if(n===N.Xn.ASPECT_RATIO_16_9)return 150;if(n===N.Xn.ASPECT_RATIO_4_3||n===N.Xn.ASPECT_RATIO_1_1||n===N.Xn.ASPECT_RATIO_21_9||n===N.Xn.ASPECT_RATIO_3_4)return 165}if(o===N.OP.DURATION_10S){if(n===N.Xn.ASPECT_RATIO_16_9)return 315;if(n===N.Xn.ASPECT_RATIO_4_3||n===N.Xn.ASPECT_RATIO_1_1)return 330;if(n===N.Xn.ASPECT_RATIO_21_9)return 345;if(n===N.Xn.ASPECT_RATIO_3_4)return 330}}if(a===N.qQ.RES_1080P){if(o===N.OP.DURATION_5S)return 360;if(o===N.OP.DURATION_10S)return n===N.Xn.ASPECT_RATIO_21_9?705:735}throw Error("Unknown configuration for Peach (resolution: ".concat(a,", aspect ratio: ").concat(n,", duration: ").concat(o,")"))}(e);case en.qH.PEACH_MAX:return function(e){var t,r;let i=null!==(t=e.resolution)&&void 0!==t?t:L.SI.resolution,a=null!==(r=e.duration)&&void 0!==r?r:L.SI.duration,n=!1!==e.audio;if(i===j.cc.RES_480P){if(a===j.WK.DURATION_5S)return n?192:96;if(a===j.WK.DURATION_10S)return n?384:192}if(i===j.cc.RES_720P){if(a===j.WK.DURATION_5S)return n?416:208;if(a===j.WK.DURATION_10S)return n?832:416}throw Error("Unknown configuration for Peach Max (resolution: ".concat(i,", duration: ").concat(a,")"))}(e);case en.qH.BLUEBERRY:return(0,o.i)(e);case en.qH.SEEDVR2:if(e.image)return e.image_output_preset===z.z3.RES_6K?41:e.image_output_preset===z.z3.RES_4K?30:18;if(e.video){let t=Math.ceil(null!==(eF=e.duration_seconds)&&void 0!==eF?eF:0),r=10;return e.video_output_preset===z.Bt.RES_1080P&&(r=20),e.video_output_preset===z.Bt.RES_1440P&&(r=30),t*r}return 0;case en.qH.PEAR:let e4=null!==(eV=e.video_duration_s)&&void 0!==eV?eV:0;return e4<=0?0:75*Math.ceil(e4);case en.qH.GUAVA:if(e.model_id===b.Z1)return 37;if(e.model_id===b.gb)return 36+A(e);if(e.model_id===b.Up){let t;return(e.resolution===y.X.RES_2K?90:48)+A(e)}return 79;case en.qH.NANO_BANANA_V2:let e6=null!==(eK=e.resolution)&&void 0!==eK?eK:U.Zd.resolution,e8=0;if(e6===D.IV.RES_512)e8=68;else if(e6===D.IV.RES_1K)e8=101;else if(e6===D.IV.RES_2K)e8=152;else if(e6===D.IV.RES_4K)e8=227;else throw Error("Unknown configuration for Nano Banana 2 (resolution: ".concat(e6,")"));return!0===e.web_search&&(e8+=20),!0===e.image_search&&(e8+=20),e8;case en.qH.SKIN_ENHANCER:return e.resolution===X.C.RES_4K?109:97;case en.qH.SDXL_PLUS:let e7=null!==(eW=null===(ez=e.lora)||void 0===ez?void 0:ez.length)&&void 0!==eW?eW:0;return e.image&&(e7+=1),e.hires&&(e7+=1),e.adetailer_face&&(e7+=1),e.adetailer_hands&&(e7+=1),e.final_upscaler&&(e7+=1),(0,i.Kt)(1.33+.096*(null!==(eX=e.num_inference_steps)&&void 0!==eX?eX:V.ye.num_inference_steps),i.p7,e7);case en.qH.CHERRY:return(0,s.P)(e);case en.qH.RASPBERRY:return(0,F.a)(e);case en.qH.GROK_IMAGE:return(0,f.W)(e);case en.qH.GROK_VIDEO:return(0,v.Y)(e);case en.qH.BERRY:return(0,n.q)(e);case en.qH.GPT_IMAGE_2:return(0,h.w)(e);case en.qH.ANIMA:return function(e){var t,r,n;let o=null!==(r=e.num_inference_steps)&&void 0!==r?r:a.WQ.num_inference_steps,s=null!==(n=null===(t=e.lora)||void 0===t?void 0:t.length)&&void 0!==n?n:0;return(0,i.Kt)(.21+.335*o,i.p7,s)+i.Ak}(e);case en.qH.MELON:return(0,k.T)(e);case en.qH.SEED_AUDIO:return(0,K.f)(e);case en.qH.PLUM:return(0,G.e)(e);case en.qH.LEMON:return(0,w.Z)(e);case en.qH.MINIMAX_H3:return(0,O.I)(e)}throw Error("Unsupported architecture pricing: ".concat(e.architecture))}},50894:(e,t,r)=>{"use strict";r.d(t,{Y:()=>F});
1var i=r(95155),a=r(65023),n=r(33948),o=r(20696),s=r(61581),l=r(63983),c=r(77567),d=r(18403),u=r(21220),p=r(70112),m=r(58887),g=r(95642),h=r(8593),f=r(91265),v=r(33981),_=r(91423),y=r(8293),b=r(22439),A=r(12115);function S(e){let{onSelect:t,onClose:r,selectedAudioReferenceIds:a}=e,{user:n}=(0,c.VT)("user"),[o,S]=(0,A.useState)(""),[x]=(0,v.useDebouncedValue)(o,300),R=null!=r?r:_.s7,I=(0,A.useMemo)(()=>({uid:null==n?void 0:n.uid,orderBy:l.s.NEWEST,modality:"audio",search:x.trim()||void 0}),[n,x]);return(0,i.jsx)(d.Card,{bg:"dark.9",p:"lg",radius:"lg",maw:600,w:"100%",children:(0,i.jsxs)(u.Stack,{gap:"md",children:[(0,i.jsxs)(p.Group,{justify:"space-between",children:[(0,i.jsxs)(p.Group,{gap:"xs",children:[(0,i.jsx)(y.A,{size:20}),(0,i.jsx)(m.Text,{fw:600,size:"lg",c:"white",children:"Choose a Sound"})]}),(0,i.jsx)(g.CloseButton,{onClick:R,"aria-label":"Close modal",size:"lg",c:"white"})]}),(0,i.jsx)(h.TextInput,{placeholder:"Search sounds...",leftSection:(0,i.jsx)(b.A,{size:16}),value:o,onChange:e=>S(e.currentTarget.value),size:"sm"}),(0,i.jsx)(f.ScrollArea,{h:400,offsetScrollbars:!0,children:(null==n?void 0:n.uid)?(0,i.jsx)(s.m,{options:I,selection:{selectedReferenceIds:[],selectedAudioReferenceIds:null!=a?a:[],onSelect:e=>{t(e),R()}},hideCreateCard:!0},x):(0,i.jsx)(m.Text,{c:"dimmed",ta:"center",py:"xl",children:"Sign in to choose one of your sounds."})})]})})}var x=r(29513),R=r(34477);let I=(0,R.createServerReference)("60554f10c428120ad39049f56359c0de0ee47751e8",R.callServer,void 0,R.findSourceMapURL,"processAudio"),C=(0,R.createServerReference)("70c3f2f6080b3296abe1e3499e2bdba3b3fdffcc74",R.callServer,void 0,R.findSourceMapURL,"getUserAudioUploadUrl");var w=r(6063),E=r(56756);let P=["audio/mpeg","audio/mp3","audio/wav","audio/wave","audio/x-wav"];async function T(e){let{data:t,startTimeSeconds:r,maxLengthSeconds:i}=e,a=w.LP.currentUser;if(!a)throw Error("Not authenticated");let n=await I({data:t,start_time_s:r,max_length_s:i},await a.getIdToken());return{url:n.data,durationSeconds:n.length_s}}async function M(e,t,r){let i=w.LP.currentUser;if(!i)throw Error("Not authenticated");return T({data:await (0,E.G)({file:e,contentType:e.type,getUploadUrl:(e,t)=>C(i.uid,e,t)}),startTimeSeconds:t,maxLengthSeconds:r})}var k=r(16791),O=r(63617),D=r(8141),U=r(26903),N=r(44644),H=r(38280),j=r(31951),L=r(78426),G=r(59811),q=r(23552);let B={content:{backgroundColor:"transparent"},header:{backgroundColor:"transparent"},body:{backgroundColor:"transparent"}};function F(e){let{audioUrl:t,onAudioUrlChange:r,onAudioProcessed:s,audioReferencePicker:l=!1,allowStartTime:g=!0,disabled:f,onUploadingChange:v,label:_="Audio Reference",hint:b="Drop an mp3 or wav file",readyLabel:R="Audio reference ready",allowReplace:I=!0,maxLengthSeconds:C=x.p4}=e,{user:w,isDesktop:E}=(0,c.xV)((0,q.k)(e=>({user:e.user,isDesktop:e.isDesktop}))),[F,V]=(0,A.useState)(""),[K,z]=(0,A.useState)(0),[W,X]=(0,A.useState)(null),[Y,Z]=(0,A.useState)(!1),[Q,$]=(0,A.useState)(!1),[J,ee]=(0,A.useState)(!1),et=(0,A.useRef)(null),er=e=>{r(e.url),X(e.durationSeconds),null==s||s(e)},ei=e=>{Z(e),null==v||v(e)},ea=()=>{if("number"==typeof K)return K},en=async e=>{if(w){if(!P.includes(e.type)){(0,k.p6)({title:"File Not Accepted",message:"Please upload an mp3 or wav file."});return}ei(!0);try{let t=await M(e,ea(),C);er(t)}catch(t){let e=t instanceof Error?t.message:"Failed to process audio";(0,k.p6)({title:"Audio Processing Failed",message:e})}finally{ei(!1)}}},eo=async()=>{let e=F.trim();if(e){ei(!0);try{let t=await T({data:e,startTimeSeconds:ea(),maxLengthSeconds:C});er(t)}catch(t){let e=t instanceof Error?t.message:"Failed to process audio";(0,k.p6)({title:"Audio Processing Failed",message:e})}finally{ei(!1)}}},es=async e=>{ei(!0);try{let t=await T({data:e,startTimeSeconds:ea(),maxLengthSeconds:C});er(t)}catch(t){let e=t instanceof Error?t.message:"Failed to process audio";(0,k.p6)({title:"Audio Processing Failed",message:e})}finally{ei(!1)}},el=f||Y;return(0,i.jsxs)(u.Stack,{gap:"sm",children:[(0,i.jsx)(O.Modal,{opened:Q,onClose:()=>$(!1),size:"xl",centered:!0,withCloseButton:!1,zIndex:1300,styles:B,children:(0,i.jsx)(n.n,{filterType:"audio",onSelect:e=>($(!1),es(e),!0),onClose:()=>$(!1)})}),l&&(0,i.jsx)(O.Modal,{opened:J,onClose:()=>ee(!1),size:"xl",centered:!0,withCloseButton:!1,zIndex:1300,styles:B,children:(0,i.jsx)(S,{onSelect:e=>{e.audio_url&&es(e.audio_url)},onClose:()=>ee(!1)})}),(0,i.jsx)("input",{ref:et,type:"file",accept:"audio/mpeg,audio/mp3,audio/wav",style:{display:"none"},onChange:e=>{var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];r&&en(r),e.target.value=""}}),t?(0,i.jsx)(d.Card,{bg:"dark.8",radius:"md",p:"md",children:(0,i.jsxs)(u.Stack,{gap:"sm",children:[(0,i.jsxs)(p.Group,{gap:"sm",children:[(0,i.jsx)(D.Center,{w:44,h:44,bg:"dark.6",style:{borderRadius:"50%"},children:(0,i.jsx)(y.A,{size:22,color:"var(--mantine-color-orange-4)"})}),(0,i.jsxs)(u.Stack,{gap:0,children:[(0,i.jsx)(m.Text,{c:"white",fw:500,size:"sm",children:R}),null!==W&&(0,i.jsxs)(m.Text,{c:"dimmed",size:"xs",children:[W.toFixed(1)," seconds"]})]})]}),(0,i.jsx)("audio",{controls:!0,src:t,style:{width:"100%"}}),I&&(0,i.jsx)(U.Button,{size:"xs",variant:"light",color:"gray",disabled:el,onClick:()=>{r(null),X(null),V("")},children:"Replace"})]})}):(0,i.jsxs)(i.Fragment,{children:[g&&(0,i.jsx)(N.NumberInput,{label:"Start time",value:K,onChange:e=>z("number"==typeof e?e:""),min:0,decimalScale:2,suffix:"s",disabled:el,styles:{input:{backgroundColor:"var(--mantine-color-dark-7)",border:"none"}}
1,size:E?"md":"sm",radius:"md"}),(0,i.jsx)(o.B,{onFilesDropped:e=>{e[0]&&en(e[0])},children:e=>{let{isDragging:t,dragProps:r}=e;return(0,i.jsx)(a.e,{aspectRatio:"3 / 1",label:_,hint:b,isDragging:t,dragProps:r,isUploading:Y,disabled:el,actions:[{key:"upload",label:"Upload",icon:(0,i.jsx)(H.A,{size:16}),onClick:()=>{var e;return null===(e=et.current)||void 0===e?void 0:e.click()},disabled:el},{key:"select-creation",label:"Select creation",icon:(0,i.jsx)(j.A,{size:16}),onClick:()=>$(!0),disabled:el},...l?[{key:"select-sound",label:"Select sound",icon:(0,i.jsx)(L.A,{size:16}),onClick:()=>ee(!0),disabled:el}]:[]]})}}),(0,i.jsxs)(m.Text,{c:"dimmed",size:"xs",ta:"center",children:["Max length: ",C," seconds"]}),(0,i.jsxs)(p.Group,{gap:"xs",wrap:"nowrap",children:[(0,i.jsx)(h.TextInput,{placeholder:"Paste an audio or social link",value:F,onChange:e=>V(e.currentTarget.value),disabled:el,leftSection:(0,i.jsx)(G.A,{size:16}),styles:{input:{backgroundColor:"var(--mantine-color-dark-7)",border:"none"}},size:E?"md":"sm",radius:"md",style:{flex:1}}),(0,i.jsx)(U.Button,{loading:Y,disabled:el||!F.trim(),onClick:eo,variant:"light",color:"orange",children:"Process"})]})]})]})}},51977:(e,t,r)=>{"use strict";r.d(t,{O:()=>G,L:()=>L});var i=r(95155),a=r(32120),n=r(3395),o=r(10863),s=r(87049),l=r(34477);let c=(0,l.createServerReference)("00d904c4033770c2103b2b7ce2ade2a3e3fb263e92",l.callServer,void 0,l.findSourceMapURL,"getInAppPurchaseContext"),d=(0,l.createServerReference)("408c5077565629e4ce688ec6834d759717b909e162",l.callServer,void 0,l.findSourceMapURL,"purchaseGemsInApp");var u=r(62878),p=r(59664),m=r(61282),g=r(77567),h=r(52220),f=r(34795),v=r(22005),_=r(7963),y=r(16791),b=r(18403),A=r(70112),S=r(35049),x=r(21220),R=r(58887),I=r(70714),C=r(69604),w=r(26029),E=r(56185),P=r(18229),T=r(30804),M=r(26903),k=r(66610),O
1=r(91423),D=r(6874),U=r.n(D),N=r(12115);function H(e){let{icon:t,label:r,gemsRequired:a}=e;return(0,i.jsx)(b.Card,{bg:"dark.9",withBorder:!0,p:"md",radius:"lg",children:(0,i.jsxs)(A.Group,{gap:"md",justify:"space-between",wrap:"nowrap",children:[(0,i.jsxs)(A.Group,{gap:"md",wrap:"nowrap",style:{minWidth:0},children:[(0,i.jsx)(S.ThemeIcon,{variant:"light",color:"orange",size:56,radius:"lg",children:t}),(0,i.jsxs)(x.Stack,{gap:2,style:{minWidth:0},children:[(0,i.jsxs)(R.Text,{size:"md",fw:700,c:"white",fs:"italic",truncate:!0,children:["“",r,"”"]}),(0,i.jsx)(R.Text,{size:"sm",c:"dimmed",children:"Paused — not enough Gems"})]})]}),(0,i.jsx)(n.C,{gems:a})]})})}function j(e){let t,{gemPackage:r,selected:a,disabled:n,onSelect:o}=e,{hovered:s,ref:l}=(0,k.useHover)(),c="var(--mantine-color-dark-9)",d="white",u="dimmed";return a?(c=(0,I.X)("var(--mantine-color-orange-8)",.1),t="var(--mantine-color-orange-7)",d="orange.4",u="orange.5"):s&&(t="var(--mantine-color-dark-1)"),(0,i.jsxs)(C.Box,{pos:"relative",miw:0,children:[r.purchase===m.t.GEMS_100K&&(0,i.jsx)(w.Badge,{color:"orange",c:"black",pos:"absolute",top:-6,left:"50%",style:{pointerEvents:"none",zIndex:1,transform:"translateX(-50%)",whiteSpace:"nowrap"},children:"Best value"}),(0,i.jsx)(b.Card,{ref:l,component:"button",type:"button",withBorder:!0,p:"md",radius:"lg",w:"100%",mih:94,className:"mantine-focus-auto","aria-pressed":a,disabled:n,onClick:o,style:{justifyContent:"center",color:"inherit",cursor:"pointer",background:c,borderColor:t,transition:"border-color 150ms ease, box-shadow 150ms ease"},children:(0,i.jsxs)(x.Stack,{gap:2,align:"center",children:[(0,i.jsxs)(R.Text,{size:"md",fw:700,c:d,children:[r.gems.toLocaleString()," Gems"]}),(0,i.jsxs)(R.Text,{size:"sm",c:u,children:["$",r.usd]})]})})]})}function L(e){(0,_.q)({children:e,size:"min(94dvw, 600px)",closeOnEscape:!1,closeOnClickOutside:!1})}function G(e){var t;let r,{gemsRequired:n,subtitle:l,pausedIcon:_,pausedLabel:S,fallback:w,onPurchased:k}=e,[D,L]=(0,N.useState)(null),[G,q]=(0,N.useState)(!1),[B,F]=(0,N.useState)(m.t.GEMS),[V,K]=(0,N.useState)(()=>crypto.randomUUID()),[z,W]=(0,N.useState)(!1),[X,Y]=(0,N.useState)(!1),[Z,Q]=(0,N.useState)(!1),[$,J]=(0,N.useState)(p.vu),{availableGems:ee}=(0,g.VT)("availableGems"),et=(0,N.useRef)(!1);(0,N.useEffect)(()=>(et.current=!1,()=>{et.current=!0}),[]),(0,N.useEffect)(()=>{c().then(e=>{L(e);let t=g.xV.getState().availableGems,r=e=>t+u.C0[e].gems>=n,i=e.defaultPackage;if(!r(i)){let e=u.Kc.find(e=>r(e.purchase));e&&(i=e.purchase)}F(i)}).catch(e=>{console.error("Error loading in-app purchase context:",e),q(!0)})},[n]);let er=e=>{F(e),J(t=>(0,p.qg)(t,u.C0[e].usd)),K(crypto.randomUUID())},ei=async()=>{await (0,f.q)(B)||Y(!1)},ea=async()=>{W(!0);let e=g.xV.getState().availableGems;try{var t;let r=(null==D?void 0:null===(t=D.autoTopUp)||void 0===t?void 0:t.enabled)===!0,i=await d({purchase:B,purchaseKey:V,...Z&&!r?{autoTopUp:{monthlyBudgetUsd:$}}:{}});if("succeeded"===i.status){let t=u.C0[i.purchase];(0,h.r)("purchase_completed",{$revenue:t.usd,currency:"USD",sku:t.sku,source:"in_app",stripe_invoice_id:i.invoiceId});try{await (0,v.v)()}catch(e){console.error("Error refreshing gems after purchase:",e)}if(et.current){(0,y.wB)({title:"Gems Added",message:"".concat(i.gems.toLocaleString()," Gems added.")});return}(0,O.s7)(),k({gems:i.gems,stillNeeded:Math.max(0,n-(e+i.gems))});return}if("cap_reached"===i.status){(0,f.w)();return}if(K(crypto.randomUUID()),"declined"===i.status){(0,y.p6)({title:"Card Declined",message:"Your card was declined. Try another payment method below."});return}if(et.current)return;(0,y.bA)({title:"Continuing in Checkout",message:"Let's finish this purchase in secure checkout."}),Y(!0),await ei()}catch(e){console.error("Error purchasing gems in-app:",e),(0,y.p6)({title:"Purchase Issue",message:"We had an issue completing your purchase. Try again?"})}finally{W(!1)}},en=null===D&&!G,eo=null!==D&&D.inAppPurchaseEnabled&&null!==D.paymentMethod,es=(null==D?void 0:null===(t=D.autoTopUp)||void 0===t?void 0:t.enabled)===!0,el=Math.max(0,n-(ee+u.C0[B].gems)),ec="dark.9";return Z&&(ec=(0,I.X)("var(--mantine-color-orange-8)",.07),r="var(--mantine-color-orange-8)"),(0,i.jsx)(s.G,{title:"You're out of Gems",closeDisabled:z,purchaseLayout:!0,children:(0,i.jsxs)(x.Stack,{gap:"lg",children:[(0,i.jsx)(R.Text,{size:"md",c:"dimmed",mt:-12,children:l}),(0,i.jsx)(H,{icon:_,label:S,gemsRequired:n}),en&&(0,i.jsxs)(x.Stack,{gap:"sm",children:[(0,i.jsx)(E.Skeleton,{height:92,radiu
1s:"md"}),(0,i.jsx)(E.Skeleton,{height:50,radius:"md"})]}),!en&&!eo&&w,!en&&eo&&D.paymentMethod&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P.SimpleGrid,{cols:2,spacing:"xs",children:u.Kc.map(e=>(0,i.jsx)(j,{gemPackage:e,selected:e.purchase===B,disabled:z||X,onSelect:()=>er(e.purchase)},e.purchase))}),(0,i.jsx)(A.Group,{justify:"center",children:(0,i.jsx)(o.y,{paymentMethod:D.paymentMethod})}),es&&(0,i.jsxs)(R.Text,{size:"xs",c:"dimmed",ta:"center",children:["Auto top-up is on, but it didn't cover this — top up below, or review your budget and card in"," ",(0,i.jsx)(R.Text,{component:U(),href:"/settings?tab=gems",c:"white",fw:700,inherit:!0,onClick:()=>(0,O.s7)(),children:"Settings"}),"."]}),!es&&(0,i.jsxs)(b.Card,{withBorder:!0,p:"md",radius:"lg",bg:ec,style:{borderColor:r},children:[(0,i.jsx)(T.Checkbox,{label:"Enable auto top-up",description:"Automatically buy this package when your balance drops below ".concat(p.LF.toLocaleString()," Gems — adjustable in Settings"),checked:Z,size:"lg",styles:{label:{color:"white",fontWeight:700},description:{color:"var(--mantine-color-dimmed)",fontSize:"var(--mantine-font-size-sm)"}},onChange:e=>Q(e.currentTarget.checked)}),Z&&(0,i.jsx)(C.Box,{mt:"lg",children:(0,i.jsx)(a.x,{packageUsd:u.C0[B].usd,value:$,onChange:J,comboboxProps:{zIndex:1300}})})]}),el>0&&(0,i.jsxs)(R.Text,{size:"xs",c:"orange",ta:"center",mt:-10,children:["This package won't cover it — you'll still need"," ",el.toLocaleString()," more Gems."]}),(0,i.jsxs)(M.Button,{size:"lg",color:"orange",c:"white",fullWidth:!0,loading:z,disabled:X,onClick:ea,children:["Confirm — $",u.C0[B].usd]}),(0,i.jsxs)(x.Stack,{gap:4,mt:-10,children:[(0,i.jsx)(M.Button,{variant:"subtle",color:"gray",size:"sm",fullWidth:!0,disabled:z,loading:X,onClick:async()=>{Y(!0),await ei()},children:"Other payment methods"}),(0,i.jsx)(R.Text,{size:"xs",c:"dimmed",ta:"center",children:"Taxes may apply. Charged to your saved card."})]})]})]})})}},52141:(e,t,r)=>{"use strict";r.d(t,{R:()=>a,q:()=>i});var i=function(e){return e.CANNY="canny",e.DEPTH="depth",e.HED="hed",e.POSE="pose",e}({}),a=function(e){return e.LCM="lcm",e.DDIM="ddim",e.DDPM="ddpm",e.DEIS="deis",e.DPMM="dpmm",e.DPMM_SDE="dpmm_sde",e.DPMM_SDE_KARRAS="dpmm_sde_karras",e.DPMM_KARRAS="dpmm_karras",e.DPMS="dpms",e.DPMS_KARRAS="dpms_karras",e.DPM_SDE="dpm_sde",e.EULER="euler",e.EULERA="eulera",e.HEUN="heun",e.KDPM2="kdpm2",e.KDPM2_KARRAS="kdpm2_karras",e.KDPM2A="kdpm2a",e.KDPM2A_KARRAS="kdpm2a_karras",e.LMS="lms",e.LMS_KARRAS="lms_karras",e.PNDM="pndm",e.TCD="tcd",e.UNIPC="unipc",e}({})},52220:(e,t,r)=>{"use strict";r.d(t,{r:()=>n});var i=r(72341),a=r(87358);function n(e,t){try{if("true"===a.env.NEXT_PUBLIC_POSTHOG_DEBUG&&console.log("[posthog]",e,null!=t?t:{}),!i.Ay.__loaded)return;i.Ay.capture(e,t)}catch(e){}}},52256:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l,a:()=>c});var i=r(43050),a=r(86819),n=r(7019);let o={[i.so.RES_480P]:81.6,[i.so.RES_720P]:168,[i.so.RES_1080P]:336},s={[i.so.RES_480P]:52.5,[i.so.RES_720P]:105,[i.so.RES_1080P]:210};function l(e){var t;return Math.ceil(o[null!==(t=e.resolution)&&void 0!==t?t:a.Rc.resolution]*(0,n.BL)(e))}function c(e){var t;return Math.ceil(s[null!==(t=e.resolution)&&void 0!==t?t:a.Rc.resolution]*(0,n.BL)(e))}},52560:(e,t,r)=>{"use strict";r.d(t,{Fr:()=>o,KC:()=>i,ZM:()=>n,gS:()=>s,t3:()=>l,ye:()=>a});let i="flux-schnell",a="flux-dev",n="0F1B80CFE81B9C3BDE7FDCBF6898897B2811B27BE1DF684583C3D85CBC9B1FA4",o="sd-3-5-large",s="sd-3-5-large-turbo",l="sd-3-5-medium"},52738:(e,t,r)=>{"use strict";r.d(t,{l:()=>a,v:()=>n});var i=r(57411);function a(e){return void 0!==e&&Number.isFinite(e)&&e>0&&e<=i.Yv}function n(e){if(e.model_id!==i.MF)throw Error("Grok Video editing only supports the Grok Imagine Video model");if(!a(e.video_duration_s))throw Error("Grok Video editing requires a video of at most ".concat(i.Yv," seconds"));if(!e.video_width||e.video_width<=0||!e.video_height||e.video_height<=0)throw Error("Grok Video editing requires the source video dimensions")}},53021:(e,t,r)=>{"use strict";r.d(t,{Y7:()=>a,bo:()=>n,fS:()=>o});var i=r(64610);function a(e){var t;return null!==(t=e.history_id)&&void 0!==t?t:(0,i.h)(e)}function n(e,t){return t.includes(a(e))}function o(e,t,r){var i,a,o;let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nearest",l=e.map((e,r)=>({index:r,hidden:n(e,t)})).filter(e=>{let{hidden:t}=e;return!t}).map(e=>{let{index:t}=e;return t});return 0===l.length?0:"next"===s?null!==(i=l.find(e=>e>r))&&void 0!==i?i:r:"previous"===s?null!==(a=l.filter(e=>e<r).at(-1))&&void 0!==a?a:r:l.includes(r)?r:null!==(o=l.find(e=>e>r))&&void 0!==o?o:l[l.length-1]}},53088:(e,t,r)=>{"use strict";function i(e){return e.charAt(0).toUpperCase()+e.slice(1)}function a(e){return e.replace(/_([a-z0-9])/g,(e,t)=>t.toUpperCase())}r.d(t,{Z:()=>i,i:()=>a})},53521:(e,t,r)=>{"use strict";r.d(t,{zh:()=>p,W:()=>m,aR:()=>f,bA:()=>u,WG:()=>h,y1:()=>g});var i=r(56800),a=r(7538);let n=[],o=[],s=[];function l(e,t){var r,i,l;return t?{characters:(0,a.Qy)(e,t.model_id)&&null!==(r=t.characters)&&void 0!==r?r:n,references:(0,a.YX)(e,t.model_id)&&null!==(i=t.references)&&void 0!==i?i:o,audioReferences:(0,a.qj)(e,t.model_id)&&null!==(l=t.audio_references)&&void 0!==l?l:s,moodboard:(0,a.DK)(e,t.model_id)?t.moodboard:void 0}:{characters:n,references:o,audioReferences:s,moodboard:void 0}}var c=r(77567);let d={[i.qH.MANGO]:"mangoConfig",[i.qH.GUAVA]:"guavaConfig",[i.qH.NANO_BANANA_V2]:"nanoBananaV2Config",[i.qH.CHERRY]:"cherryConfig",[i.qH.BLUEBERRY]:"blueberryConfig",[i.qH.RASPBERRY]:"raspberryConfig",[i.qH.GROK_IMAGE]:"grokImageConfig",[i.qH.GROK_VIDEO]:"grokVideoConfig",[i.qH.BERRY]:"berryConfig",[i.qH.GPT_IMAGE_2]:"gptImage2Config",[i.qH.MELON]:"melonConfig",[i.qH.PLUM]:"plumConfig",[i.qH.LEMON]:"lemonConfig",[i.qH.MINIMAX_H3]:"minimaxH3Config",[i.qH.SEED_AUDIO]:"seedAudioConfig"};function u(e,t){let r=d[t];return r?e[r]:void 0}function p(e){return u(e,e.activeArchitecture)}function m(e){var t;return l(t=e.activeArchitecture,u(e,t))}function g(e,t){let r=d[e];r&&c.xV.setState(e=>{let i=e[r];i&&(e[r]=t(i))})}function h(e){c.xV.setState(t=>{for(let r of Object.values(d)){let i=t[r];
1if(!(null==i?void 0:i.characters)||0===i.characters.length)continue;let a=[];for(let t of i.characters){let r=e(t);r&&a.push(r)}i.characters=a.length>0?a:void 0}})}function f(e){let{sourceConfig:t,targetArchitecture:r,targetConfig:i}=e;if(!d[r]||i.characters&&i.characters.length>0||i.references&&i.references.length>0||i.audio_references&&i.audio_references.length>0||i.moodboard||!t)return{};let a=l(r,{model_id:i.model_id,characters:t.characters,references:t.references,audio_references:t.audio_references,moodboard:t.moodboard}),n={};return a.characters.length&&(n.characters=a.characters),a.references.length&&(n.references=a.references),a.audioReferences.length&&(n.audio_references=a.audioReferences),a.moodboard&&(n.moodboard=a.moodboard),n}},53624:(e,t,r)=>{"use strict";r.d(t,{cw:()=>n,eA:()=>a,rs:()=>s,yi:()=>o});let i=[{id:"minimax-m3",label:"Low",turnGemCap:null,typicalGems:null},{id:"grok-4.6",label:"High",turnGemCap:50,typicalGems:30}],a={agent:i,"prompt-help":i},n={agent:"minimax-m3","prompt-help":"minimax-m3"};function o(e){return e in a}function s(e,t){let r=a[e].find(e=>e.id===t);if(!r)throw Error("Unknown ".concat(e," model: ").concat(t));return r}},53934:e=>{e.exports={root:"event_id_root__9pkHd"}},54297:(e,t,r)=>{"use strict";r.d(t,{K:()=>c});var i=r(34477);let a=(0,i.createServerReference)("6001e10253c87dd3feaccb743ad2fe315c624d8901",i.callServer,void 0,i.findSourceMapURL,"uploadCharacterImage"),n=(0,i.createServerReference)("60168873cfc2ca999e985bc77e57365c3768faa9b0",i.callServer,void 0,i.findSourceMapURL,"uploadReferenceImage"),o="https://cdn3.mage.space";var s=r(24155),l=r(32826);async function c(e,t,r){if(function(e,t,r){return!!e.startsWith("".concat(o,"/"))&&(function(e){if(!e.startsWith("".concat(o,"/")))throw Error("Invalid URL for Storage replacement: ".concat(e));return e.replace("".concat(o,"/"),"")})(e).startsWith("character"===r?"characters/".concat(t,"/image/"):"references/".concat(t,"/image/"))}(e,t,r))return e;let i=await (0,s.XK)(e,{fixedSize:l.jg,maxSize:l.n});return"character"===r?a(i.image,t):n(i.image,t)}},54754:(e,t,r)=>{"use strict";r.d(t,{W:()=>o});var i=r(41770),a=r(2736),n=r(9057);function o(e){let t,r,o=e.resolution===a.pU.RES_2K;if(e.model_id===a.Gm.V2)t=e.quality===a.kP.LOW?o?90:60:o?120:90,r=15;else if(e.model_id===a.Gm.QUALITY)t=o?105:75,r=15;else if(e.model_id===a.Gm.BASIC)t=30,r=3;else throw Error("Unknown configuration for Grok Image (model: ".concat(e.model_id,")"));return t+Math.min((0,i.S)(e).allImages.length,n.Oo)*r}},54887:(e,t,r)=>{"use strict";r.d(t,{X:()=>i,w:()=>a});var i=function(e){return e.RES_1K="1K",e.RES_2K="2K",e}({}),a=function(e){return e.DIRECT="direct",e.AGENT="agent",e}({})},54908:(e,t,r)=>{"use strict";function i(e){return new Promise(t=>{let r=document.createElement("video");r.preload="metadata";let i=()=>{r.onloadedmetadata=null,r.onerror=null,r.src="",r.load()};r.onloadedmetadata=()=>{let e=r.duration;i(),t(isFinite(e)?e:void 0)},r.onerror=()=>{i(),t(void 0)},r.src=e})}function a(e){let t=Number.isFinite(e)&&e>0?e:0,r=Math.floor(t/60),i=Math.floor(t%60);return"".concat(r,":").concat(i.toString().padStart(2,"0"))}r.d(t,{H:()=>a,q:()=>i})},55235:(e,t,r)=>{"use strict";r.d(t,{C1:()=>a,C3:()=>o,EV:()=>u,Ny:()=>d,Zt:()=>l,_$:()=>s,iO:()=>n});var i=r(6060);let a=r(56170).XK;new URL(a).host;let n="https://docs.mage.space",o="https://cors-anywhere-816167389238.us-central1.run.app",s="https://cdn3.mage.space";function l(e){return(0,i.u)(e,s)}let c=["api.mage.space","api.beta.mage.space"],d="https://".concat("api.mage.space");function u(e){let t=new URL(e).host;return"beta.mage.space"===t?"https://".concat("api.beta.mage.space"):"www.mage.space"===t||"mage.space"===t?d:"".concat(e,"/api/external")}},55317:(e,t,r)=>{"use strict";r.d(t,{e:()=>d});var i=r(84563),a=r(83880),n=r(66685);let o={[a.dF]:{[i.f9.RESOLUTION_768P]:108,[i.f9.RESOLUTION_2K]:156},[a.fR]:{[i.f9.RESOLUTION_480P]:67.5,[i.f9.RESOLUTION_768P]:108}},s={[i.f9.RESOLUTION_480P]:74.655,[i.f9.RESOLUTION_768P]:193.05},l={[a.dF]:{freeImages:5,gemsPerExtraImage:60},[a.fR]:{freeImages:2,gemsPerExtraImage:99.9}};function c(e,t){let r=o[e][t];if(void 0===r)throw Error("Unknown configuration for Plum (model: ".concat(e,", resolution: ").concat(t,")"));return r}function d(e){var t,r,i,o,d,u,p;let m=(0,a.nQ)(e),{duration:g,resolution:h}=(0,a.wn)(e),f=c(m,h)*Number(g);(null===(t=e.videos)||void 0===t?void 0:t.length)&&((0,n.ey)(e),f+=function(e,t,r){if(e===a.fR){let i=s[t];if(void 0===i)throw Error("Unknown video input configuration for Plum (model: ".concat(e,", resolution: ").concat(t,")"));return i*Math.round(r)}return c(e,t)*r}(m,h,e.video_duration_s));let v=l[m];return Math.ceil(f+Math.max(0,[e.image,e.first_image,e.last_image].filter(
1Boolean).length+(null!==(d=null===(r=e.additional_images)||void 0===r?void 0:r.length)&&void 0!==d?d:0)+(null!==(u=null===(i=e.characters)||void 0===i?void 0:i.length)&&void 0!==u?u:0)+(null!==(p=null===(o=e.references)||void 0===o?void 0:o.length)&&void 0!==p?p:0)-v.freeImages)*v.gemsPerExtraImage)}},55625:(e,t,r)=>{"use strict";r.d(t,{BY:()=>s,DI:()=>o,es:()=>n});var i=r(56800),a=r(61320);let n="seedvr2-7b",o={architecture:i.qH.SEEDVR2,model_id:n,image_output_preset:a.z3.RES_2K,video_output_preset:a.Bt.RES_720P},s={architecture:i.qH.SEEDVR2,name:"Mage Enhancer",short_name:"Mage Enhancer",popularity:0,tags:[i.R$,i.tM,i.Mn,i.yu],api_path:"/api/v1/seedvr2",agent:null}},56170:(e,t,r)=>{"use strict";function i(e){return e.toLowerCase().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function a(e,t){let r=null==e?void 0:e.trim();return r?i(r)||"untitled":i(t)||"untitled"}r.d(t,{BF:()=>i,Er:()=>a,Gv:()=>c,Hg:()=>o,XK:()=>n,al:()=>l});let n="https://www.mage.space";function o(e){var t;if("hardBreak"===e.type)return" ";if(void 0!==e.text)return e.text;let r="paragraph"===e.type||"heading"===e.type?"":"\n";return(null!==(t=e.content)&&void 0!==t?t:[]).map(o).join(r)}function s(e){let t=e.content.findIndex(e=>"heading"===e.type&&o(e).trim().length>0);return -1!==t?t:e.content.findIndex(e=>"paragraph"===e.type&&o(e).trim().length>0)}function l(e){let t=s(e);return -1===t?"Untitled":o(e.content[t]).trim()}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,r=function e(t){var r;if("paragraph"===t.type&&o(t).trim())return t;for(let i of null!==(r=t.content)&&void 0!==r?r:[]){let t=e(i);if(t)return t}}(function(e){let t=s(e);return{...e,content:e.content.filter((e,r)=>r!==t)}}(e));if(!r)return"";let i=o(r).trim();return i.length>t?i.slice(0,t)+"…":i}},56544:(e,t,r)=>{"use strict";r.d(t,{I:()=>n,h:()=>o});var i=r(20036),a=r(17157);function n(e){return e===i.$x.CHERRY_2_PRO?{minSeconds:a.PE,maxSeconds:a.LP}:{minSeconds:a.O,maxSeconds:a.m7}}function o(e,t){let r=n(e);return void 0!==t&&Number.isFinite(t)&&t>=r.minSeconds&&t<=r.maxSeconds}},56645:(e,t,r)=>{"use strict";r.d(t,{I3:()=>o,NZ:()=>n,ZS:()=>s,vX:()=>a});var i=r(84989);function a(e){if(e instanceof File){let t=URL.createObjectURL(e);return a(t).finally(()=>URL.revokeObjectURL(t))}return new Promise((t,r)=>{let i=new Image;i.onload=()=>{t({width:i.width,height:i.height})},i.onerror=()=>{r(Error("Error loading image"))},i.src=e})}async function n(e){if(e instanceof File){let t=URL.createObjectURL(e);return n(t).finally(()=>URL.revokeObjectURL(t))}return new Promise((t,r)=>{let i=document.createElement("video");i.preload="metadata",i.playsInline=!0,i.muted=!0,i.style.display="none",i.onloadedmetadata=()=>{t({width:i.videoWidth,height:i.videoHeight,duration:i.duration}),i.remove()},i.onerror=()=>{i.remove(),r(Error("Error loading video"))},i.src=e})}function o(e,t){let r=t||s(e);return"audio"===r?Promise.resolve({width:0,height:0}):"video"===r?n(e):a(e)}function s(e){return(0,i.s_)(e)}},56650:(e,t,r)=>{"use strict";r.d(t,{OR:()=>s,XH:()=>n,q$:()=>o});var i=r(56800),a=r(84461);let n="kiwi",o={architecture:i.qH.KIWI,model_id:n,prompt:"",resolution:a.tv.RES_480P,kiwi_aspect_ratio:a.Un.ASPECT_RATIO_16_9,duration:a.vr.DURATION_5S},s={architecture:i.qH.KIWI,name:"Kiwi",short_name:"Kiwi",popularity:7,tags:[i.fZ,i.tM],models:[{id:n}],api_path:"/api/v1/kiwi",agent:{description:"General video model.",defaultConfig:o,options:{resolution:Object.values(a.tv),duration:Object.values(a.vr)},imageInputs:{firstFrame:"image"}}}},56756:(e,t,r)=>{"use strict";async function i(e){let t=await e.arrayBuffer();return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t)),e=>e.toString(16).padStart(2,"0")).join("")}async function a(e,t,r){let i=await fetch(t,{method:"PUT",headers:{"Content-Type":r},body:e});if(!i.ok)throw Error("Failed to upload file (".concat(i.status,"): ").concat(i.statusText))}async function n(e){let t=await i(e.file),r=await e.getUploadUrl(t,e.contentType);return await a(e.file,r.signedUrl,e.contentType),r.publicUrl}r.d(t,{G:()=>n})},56800:(e,t,r)=>{"use strict";r.d(t,{BN:()=>a,Gm:()=>c,KT:()=>m,Mn:()=>d,R$:()=>n,fZ:()=>l,h0:()=>p,ij:()=>u,qH:()=>i,sx:()=>s,tM:()=>o,yu:()=>g});var i=function(e){return e.FLUX="flux",e.STABLE_DIFFUSION_V15="stable_diffusion_v15",e.STABLE_DIFFUSION_V35_LARGE="stable_diffusion_v35_large",e.STABLE_DIFFUSION_V35_MEDIUM="stable_diffusion_v35_medium",e.STABLE_DIFFUSION_XL="stable_diffusion_xl",e.LTX_VIDEO="ltx_video",e.WAN="wan",e.VEO3="veo3",e.ENHANCE="enhance",e.REFINE="refine",e.HIDREAM="hidream",e.FRAMEPACK="framepack",e.SELFIE="selfie",e.CHROMA="chroma",e.FLUX_KONTEXT_DEV="flux_kontext_dev",e.WAN_22="wan_22",e.MANGO="mango",e.QWEN_IMAGE="qwen_image",e.QWEN_IMAGE_EDIT_PLUS="qwen_image_edit_plus",e.Z_IMAGE="z_image",e.FLUX2="flux2",e.KIWI="kiwi",e.PEACH="peach",e.PEACH_MAX="peach_max",e.BLUEBERRY="blueberry",e.SEEDVR2="seedvr2",e.PEAR="pear",e.GUAVA="guava",e.NANO_BANANA_V2="nano_banana_v2",e.SKIN_ENHANCER="skin_enhancer",e.SDXL_PLUS="sdxl_plus",e.VEO3_1="veo3_1",e.CHERRY="cherry",e.RASPBERRY="raspberry",e.GROK_IMAGE="grok_image",e.GROK_VIDEO="grok_video",e.BERRY="berry",e.GPT_IMAGE_2="gpt_image_2",e.ANIMA="anima",e.MELON="melon",e.SEED_AUDIO="seed_audio",e.KREA_2="krea_2",e.PLUM="plum",e.LEMON="lemon",e.MINIMAX_H3="minimax_h3",e}({});function a(e){return e.model_id}let n="image",o="video",s="audio",l="unlimited",c="gems",d="edit",u="strict_filter",p="saved",m="exclusive",g="hidden"},57377:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n,d:()=>a});let i={badgeColor:"gray",textColor:"gray.4"},a={object:{badgeColor:"blue",textColor:"blue.4"},location:{badgeColor:"green",textColor:"green.4"},pose:{badgeColor:"grape",textColor:"grape.4"},outfit:{badgeColor:"pink",textColor:"pink.4"},audio:{badgeColor:"orange",textColor:"orange.4"}};function n(e){var t;return null!==(t=a[e])&&void 0!==t?t:i}},57389:(e,t,r)=>{"use strict";r.d(t,{d5:()=>n,jK:()=>a,mn:()=>i});var i=function(e){return e.CANNY="canny",e.DEPTH="depth",e.HED="hed",e.POSE="pose",e}({}),a=function(e){return e.V1="v1",e.V2="v2",e}({}),n=function(e){return e.LCM="lcm",e.DDIM="ddim",e.DDIM_VPRED="ddim_vpred",e.DDPM="ddpm",e.DDPM_VPRED="ddpm_vpred",e.DEIS="deis",e.DPMM="dpmm",e.DPMM_SDE="dpmm_sde",e.DPMM_SDE_KARRAS="dpmm_sde_karras",e.DPMM_KARRAS="dpmm_karras",e.DPMS="dpms",e.DPMS_KARRAS="dpms_karras",e.DPM_SDE="dpm_sde",e.EULER="euler",e.EULER_VPRED="euler_vpred",e.EULERA="eulera",e.EULERA_VPRED="eulera_vpred",e.HEUN="heun",e.KDPM2="kdpm2",e.KDPM2_KARRAS="kdpm2_karras",e.KDPM2A="kdpm2a",e.KDPM2A_KARRAS="kdpm2a_karras",e.LMS="lms",e.LMS_KARRAS="lms_karras",e.PNDM="pndm",e.TCD="tcd",e.UNIPC="unipc",e}({})},57411:(e,t,r)=>{"use strict";r.d(t,{BW:()=>p,MF:()=>n,UC:()=>d,Yv:()=>l,m_:()=>s,oE:()=>o,xv:()=>u,yV:()=>c});var i=r(56800),a=r(47370);let n="grok-imagine-video",o=5,s=10,l=8.7,c=480,d=[a.X5.DURATION_1S,a.X5.DURATION_2S,a.X5.DURATION_3S,a.X5.DURATION_4S,a.X5.DURATION_5S,a.X5.DURATION_6S,a.X5.DURATION_7S,a.X5.DURATION_8S,a.X5.DURATION_9S,a.X5.DURATION_10S],u={architecture:i.qH.GROK_VIDEO,model_id:n,prompt:"",grok_video_aspect_ratio:a.mA.ASPECT_RATIO_16_9,duration:a.X5.DURATION_5S,resolution:a.RR.RES_480P},p={architecture:i.qH.GROK_VIDEO,name:"Grok Video",short_name:"Grok Video",popularity:0,tags:[i.fZ,i.tM,i.ij],models:[{id:n,name:"Grok Video"}],api_path:"/api/v1/grok_video",agent:{description:"General video model.",defaultConfig:u,options:{resolution:Object.values(a.RR),duration:Object.values(a.X5)},imageInputs:{references:{field:"image",additionalField:"additional_images"}},videoSource:{field:"video",durationClaim:"video_duration_s",dimensionClaims:!0}}}},57413:(e,t,r)=>{"use strict";r.d(t,{_:()=>a});var i=r(34477);
1let a=(0,i.createServerReference)("40f03a499f3e9ce9c4114b63cc189b6448465f40e4",i.callServer,void 0,i.findSourceMapURL,"moderateMedia")},57483:(e,t,r)=>{"use strict";r.d(t,{R:()=>i});var i=function(e){return e.APPS="apps",e.CREATIONS="creations",e.MODELS="models",e.FOLLOWERS="followers",e.FOLLOWING="following",e.ADMIN="admin",e.EDIT="edit",e.HISTORY="history",e.POSTS="posts",e.POST_LIKES="post_likes",e.POST_REPLIES="post_replies",e.BOOKMARKS="bookmarks",e.CONCEPTS="concepts",e.CHARACTERS="characters",e}({})},57635:(e,t,r)=>{"use strict";r.d(t,{_8:()=>a,he:()=>i.W});var i=r(4524);let a="linear-gradient(135deg, #FFA94D 0%, #FFD5A9 100%)"},58649:(e,t,r)=>{"use strict";r.d(t,{$z:()=>I,F1:()=>T,Gb:()=>x,Is:()=>f,Mj:()=>p,NW:()=>E,OG:()=>A,QI:()=>h,UJ:()=>g,VK:()=>C,Ws:()=>_,X6:()=>w,cS:()=>m,dd:()=>d,gN:()=>v,lj:()=>R,nS:()=>u,sM:()=>b,zK:()=>y});var i=r(4717),a=r(70954),n=r.n(a),o=r(56800),s=r(7538),l=r(31896);let c="minimax-h3",d="minimax-h3-turbo",u=50,p=8,m=50,g=24,h=Object.values(l.N8),f=9,v=3,_=12,y=2,b=8,A=8,S=h.filter(e=>Number(e)<=A),x=(0,s.jB)(o.qH.MINIMAX_H3),R=2,I=15;function C(e){return e===d}function w(e){var t;let r=u;return C(e.model_id)&&(r=p),null!==(t=e.num_inference_steps)&&void 0!==t?t:r}let E={architecture:o.qH.MINIMAX_H3,model_id:d,prompt:"",num_inference_steps:p,aspect_ratio:i.vW.CINEMA,base_size:l.p2.SIZE_480P,duration:l.N8.DURATION_5S},P={...n()(E,"num_inference_steps"),use_character_voices:!0},T={architecture:o.qH.MINIMAX_H3,name:"MiniMax-H3",short_name:"MiniMax H3",popularity:0,tags:[o.fZ,o.tM],models:[{id:d,name:"MiniMax-H3 Turbo"},{id:c,name:"MiniMax-H3"}],api_path:"/api/v1/minimax-h3",agent:{description:"Open video model that generates video and stereo audio together. Start/end frames and reference images are mutually exclusive; set one kind or the other. Clips run 5-15 seconds (the base model up to 8). References share a 21-second budget with the clip: each reference image counts as 2 seconds and each reference video as its own length.",defaultConfig:P,options:{resolution:Object.values(l.p2),resolutionField:"base_size",duration:h,byModel:{[c]:{duration:S}}},imageInputs:{firstFrame:"first_image",lastFrame:"last_image",references:{field:"image",additionalField:"additional_images"}},videoSource:{field:"videos",durationClaim:"video_durations_s"}}}},58779:(e,t,r)=>{"use strict";r.d(t,{AM:()=>s,OG:()=>n,S4:()=>l,YR:()=>o,zk:()=>c});var i=r(68541),a=r(4717);let n=[[i.ZL.SUGGESTIVE,i.ZL.NUDITY],[i.ZL.VIOLENCE,i.ZL.NSFW]],o={rating:a.Uc.G_PLUS,moderation:[]},s=[];function l(e){let t=e.rating;t===a.Uc.G?t=a.Uc.G_PLUS:t===a.Uc.M&&(t=a.Uc.M_PLUS);let r=[...e.moderation];for(let e of n)e.every(e=>r.includes(e))||(r=r.filter(t=>!e.includes(t)));return{...e,rating:t,moderation:r}}function c(e){return e.rating===a.Uc.M||e.rating===a.Uc.M_PLUS}},59613:(e,t,r)=>{"use strict";r.d(t,{YM:()=>$,pB:()=>ee,zd:()=>J});var i=r(50801),a=r(56800),n=r(82646),o=r(61282);function s(e){let t="lora"in e&&Array.isArray(e.lora)?e.lora:null,r="ti"in e&&Array.isArray(e.ti)?e.ti:null,i="controlnets"in e&&Array.isArray(e.controlnets)?e.controlnets:null;return t&&t.length>2||r&&r.length>2||i&&i.length>1?o.c.PRO_PLUS:t&&t.length>1||r&&r.length>1||i&&i.length>0||"hires"in e&&e.hires?o.c.PRO:null}var l=r(23446),c=r(5023),d=r(43359),u=r(20036),p=r(22310),m=r(84574),g=r(88061),h=r(27122),f=r(27431),v=r(10140),_=r(26905),y=r(9057),b=r(54754),A=r(81152),S=r(84461),x=r(56650),R=r(42831),I=r(52256),C=r(64325),w=r(18683),E=r(80564),P=r(94028),T=r(65638),M=r(59791),k=r(96700),O=r(13421),D=r(73857),U=r(40350),N=r(55317),H=r(67881),j=r(93331),L=r(61320),G=r(55625),q=r(39191),B=r(39358),F=r(82395),V=r(4714),K=r(61169);function z(e){var t;let r=function(e){var t,r,i,n,z,W,X,Y,Z,Q,$,J;switch(e.architecture){case a.qH.FLUX:let ee=s(e);return null!==ee?ee:o.c.BASIC;case a.qH.STABLE_DIFFUSION_V15:let et=s(e);return null!==et?et:e.style_references&&e.style_references.images.length>0||e.face_references&&e.face_references.images.length>0?o.c.PRO:o.c.BASIC;case a.qH.STABLE_DIFFUSION_V35_LARGE:case a.qH.STABLE_DIFFUSION_V35_MEDIUM:return o.c.BASIC;case a.qH.STABLE_DIFFUSION_XL:let er=s(e);return null!==er?er:e.style_references&&e.style_references.images.length>0||e.face_references&&e.face_references.images.length>0?o.c.PRO:o.c.BASIC;case a.qH.LTX_VIDEO:return e.base_size===C.I.SIZE_720P?o.c.PRO_PLUS:o.c.PRO;case a.qH.WAN:if(e.lora&&e.lora.length>1)return o.c.MAX;let ei=(null===(t=e.num_frames)||void 0===t?void 0:t.toString())==="1";return e.base_size===F.l.SIZE_720P&&!ei||e.lora&&e.lora.length>0?o.c.PRO_PLUS:o.c.PRO;case a.qH.WAN_22:if(e.lora&&e.lora.length>1)return o.c.MAX;let ea=(null===(r=e.num_frames)||void 0===r?void 0:r.toString())==="1";return e.base_size===V.d.SIZE_720P&&!ea||e.lora&&e.lora.length>0?o.c.PRO_PLUS:o.c.PRO;case a.qH.VEO3_1:return e.duration===B.BA.DURATION_6S&&e.resolution!==B.fK.RES_1080P||e.duration===B.BA.DURATION_4S&&e.resolution===B.fK.RES_1080P?o.c.MAX:e.duration===B.BA.DURATION_4S&&e.resolution!==B.fK.RES_1080P?o.c.PRO_PLUS:null;case a.qH.ENHANCE:case a.qH.REFINE:return o.c.BASIC;case a.qH.HIDREAM:return o.c.PRO;case a.qH.FRAMEPACK:if(e.base_size===g.k.SIZE_720P)return o.c.PRO_PLUS;switch(e.video_length){case g.Y.LENGTH_10S:case g.Y.LENGTH_9S:case g.Y.LENGTH_8S:case g.Y.LENGTH_7S:case g.Y.LENGTH_6S:return o.c.PRO_PLUS}return e.lora&&e.lora.length>0?o.c.PRO_PLUS:o.c.PRO;case a.qH.SELFIE:return s(e)===o.c.PRO_PLUS?o.c.PRO_PLUS:o.c.PRO;case a.qH.CHROMA:let en=s(e);return null!==en?en:o.c.BASIC;case a.qH.FLUX_KONTEXT_DEV:let eo=s(e);return null!==eo?eo:o.c.BASIC;case a.qH.MANGO:return e.resolution===w.d.RES_4K||e.resolution===w.d.RES_3K?o.c.PRO_PLUS:o.c.PRO;case a.qH.QWEN_IMAGE:case a.qH.QWEN_IMAGE_EDIT_PLUS:return s(e)===o.c.PRO_PLUS?o.c.PRO_PLUS:o.c.PRO;case a.qH.Z_IMAGE:let es=s(e);return null!==es?es:e.resolution===K.m.RES_2K?o.c.PRO:o.c.BASIC;case a.qH.KREA_2:let el=s(e);return null!==el?el:e.resolution===R.A.RES_2K?o.c.PRO:o.c.BASIC;case a.qH.FLUX2:return e.resolution===m.Y.RES_2K?o.c.PRO:o.c.BASIC;case a.qH.KIWI:let ec=null!==(i=e.resolution)&&void 0!==i?i:x.q$.resolution,ed=null!==(n=e.duration)&&void 0!==n?n:x.q$.duration;return ec===S.tv.RES_480P&&ed===S.vr.DURATION_10S||ec===S.tv.RES_720P&&ed===S.vr.DURATION_5S?o.c.MAX:ec===S.tv.RES_480P&&ed===S.vr.DURATION_5S?o.c.PRO_PLUS:null;case a.qH.PEACH:let eu=null!==(z=e.resolution)&&void 0!==z?z:O.Xe.resolution,ep=null!==(W=e.duration)&&void 0!==W?W:O.Xe.duration;return eu===k.qQ.RES_720P||ep===k.OP.DURATION_10S&&eu!==k.qQ.RES_1080P||eu===k.qQ.RES_1080P&&ep===k.OP.DURATION_5S?o.c.MAX:eu===k.qQ.RES_480P&&ep===k.OP.DURATION_5S?o.c.PRO:null;case a.qH.PEACH_MAX:return function(e){var t,r;let i=null!==(t=e.resolution)&&void 0!==t?t:U.SI.resolution,a=null!==(r=e.duration)&&void 0!==r?r:U.SI.duration,n=!1!==e.audio;return a===D.WK.DURATION_5S&&i===D.cc.RES_480P?o.c.PRO:a===D.WK.DURATION_10S&&i===D.cc.RES_720P&&n?null:o.c.MAX}(e);case a.qH.BLUEBERRY:let em=(0,d.i)(e);return em>=400&&em<600?o.c.MAX:em<400?o.c.PRO_PLUS:null;case a.qH.SEEDVR2:let eg=null!==(X=e.image_output_preset)&&void 0!==X?X:G.DI.image_output_preset,eh=null!==(Y=e.video_output_preset)&&void 0!==Y?Y:G.DI.video_output_preset;if(e.image)return eg===L.z3.RES_6K?o.c.MAX:eg===L.z3.RES_4K?o.c.PRO_PLUS:eg===L.z3.RES_2K?o.c.PRO:null;if(e.video){if(eh===L.Bt.RES_1080P||eh===L.Bt.RES_1440P)return o.c.MAX;if(eh===L.Bt.RES_720P)return o.c.PRO_PLUS}return null;case a.qH.PEAR:return e.video_duration_s&&e.video_duration_s<=8?o.c.MAX:h.v;case a.qH.PLUM:let ef=(0,N.e)(e);return ef>=400&&ef<625?o.c.MAX:ef<400?o.c.PRO_PLUS:h.v;case a.qH.GUAVA:return o.c.PRO;case a.qH.NANO_BANANA_V2:let ev=null!==(Z=e.resolution)&&void 0!==Z?Z:M.Zd.resolution;return ev===T.IV.RES_1K?o.c.MAX:ev===T.IV.RES_512?o.c.PRO_PLUS:ev===T.IV.RES_2K||ev===T.IV.RES_4K?h.v:null;case a.qH.SKIN_ENHANCER:return e.resolution===q.C.RES_4K?o.c.PRO_PLUS:e.resolution===q.C.RES_2K?o.c.PRO:null;case a.qH.SDXL_PLUS:return o.c.PRO_PLUS;case a.qH.CHERRY:if(!(null===(Q=e.videos)||void 0===Q?void 0:Q.length)&&e.model_id===u.$x.CHERRY_2_PRO&&e.duration===u.sr.DURATION_4S&&e.resolution===u.AU.RESOLUTION_480P)return o.c.MAX;let e_=(0,p.P)(e);return e_>=400&&e_<600?o.c.MAX:e_<400?o.c.PRO_PLUS:null;case a.qH.RASPBERRY:let ey=(0,H.a)(e);return ey>=400&&ey<600?o.c.MAX:ey<400?o.c.PRO_PLUS:null;case a.qH.GROK_IMAGE:return(0,b.W)(e)<y.YH?o.c.PRO:null;case a.qH.GROK_VIDEO:let eb=(0,A.Y)(e);return eb>=400&&eb<600?o.c.MAX:eb<400?o.c.PRO_PLUS:null;case a.qH.BERRY:let eA=(0,c.q)(e);return eA>
1=l.W3&&eA<600?o.c.MAX:eA<l.ZM?o.c.PRO:eA<l.W3?o.c.PRO_PLUS:null;case a.qH.GPT_IMAGE_2:let{quality:eS}=(0,v.iy)(e);if(eS!==f.K.LOW)return h.v;let ex=(0,_.w)(e);return ex>=400&&ex<600?o.c.MAX:ex>=100&&ex<400?o.c.PRO_PLUS:ex>=25&&ex<100?o.c.PRO:null;case a.qH.ANIMA:return s(e)===o.c.PRO_PLUS?o.c.PRO_PLUS:o.c.PRO;case a.qH.MELON:let eR=(0,E.T)(e);return eR>=400&&eR<600?o.c.MAX:eR>=200&&eR<400?o.c.PRO_PLUS:eR<200?o.c.PRO:null;case a.qH.SEED_AUDIO:let eI=(0,j.f)(e);return eI>=400&&eI<600?o.c.MAX:eI>=200&&eI<400?o.c.PRO_PLUS:eI>=100&&eI<200?o.c.PRO:eI<100?o.c.BASIC:null;case a.qH.LEMON:let eC=(0,I.a)(e);return eC>=400&&eC<600?o.c.MAX:eC>=200&&eC<400?o.c.PRO_PLUS:eC<200?o.c.PRO:h.v;case a.qH.MINIMAX_H3:let ew=(0,P.I)(e),eE=null!==(J=null===($=e.lora)||void 0===$?void 0:$.length)&&void 0!==J?J:0;return ew>=600?h.v:ew>=400||eE>=2?o.c.MAX:ew>=200||eE>=1?o.c.PRO_PLUS:o.c.PRO;case a.qH.VEO3:return null}throw Error("Unsupported architecture membership: ".concat(e.architecture))}(e);return null!==r?r:(t=(0,i.t)(e))>=600?h.v:t<=50?o.c.BASIC:t<=200?o.c.PRO:t<=400?o.c.PRO_PLUS:o.c.MAX}var W=r(90099),X=r(12999),Y=r(14276);async function Z(e){if(e.architecture===a.qH.STABLE_DIFFUSION_V15){let t=await (0,W.E)(e.model_id);if((null==t?void 0:t.status)!=="active")return!0;for(let t of e.lora||[]){let e=await (0,W.E)(t.id);if((null==e?void 0:e.status)!=="active")return!0}}if(e.architecture===a.qH.STABLE_DIFFUSION_XL){let t=await (0,W.E)(e.model_id);if((null==t?void 0:t.status)!=="active")return!0;for(let t of e.lora||[]){let e=await (0,W.E)(t.id);if((null==e?void 0:e.status)!=="active")return!0}}if(e.architecture===a.qH.FLUX)for(let t of e.lora||[]){let e=await (0,W.E)(t.id);if((null==e?void 0:e.status)!=="active")return!0}return!1}async function Q(e){let t=z(e);return t===o.c.MAX||t===o.c.PRO_PLUS||t===h.v?t:await Z(e)?o.c.PRO_PLUS:t}function $(e){if((0,n.R3)(e.architecture))return 0;let t=(0,i.t)(e);return t>0?t:100}function J(e,t){if((0,n.R3)(e.architecture))return{allowed:!1,reason:"deprecated"};let r=z(e);return r!==h.v&&(0,Y.c)(t,r)?{allowed:!0,membershipRequired:r}:{allowed:!1,reason:"membership",membershipRequired:r}}function ee(e){let t=z(e);return t===h.v||t===o.c.FREE?null:t}(0,X.unstable_cache)(Q,["architecture-config-unlimited-v2"],{revalidate:3600})},59628:(e,t,r)=>{"use strict";r.d(t,{GA:()=>o,LT:()=>s,Qz:()=>i,Sy:()=>c,Ti:()=>u,ZD:()=>p,b5:()=>n,oI:()=>l,q6:()=>d,uW:()=>a});let i=32,a=4e3,n=4,o=["image/jpeg","image/png","image/webp"],s=0xa00000,l=3e3,c=5e3,d=64,u=["❤️","\uD83D\uDE02","\uD83D\uDD25","\uD83D\uDC4D","\uD83D\uDE2E"],p=32},59664:(e,t,r)=>{"use strict";r.d(t,{LF:()=>a,Ml:()=>i,Wu:()=>s,qg:()=>l,vu:()=>n});let i=[0,100,500,1e3,5e3,1e4],a=1e3,n=100,o=[10,20,30,50,100,200,500,1e3,1e4];function s(e){return[...o.filter(t=>t>=e),null]}function l(e,t){let r=s(t);return r.includes(e)?e:r[0]}},59791:(e,t,r)=>{"use strict";r.d(t,{JM:()=>s,Zd:()=>o,kQ:()=>n});var i=r(56800),a=r(65638);let n="nano-banana-v2",o={architecture:i.qH.NANO_BANANA_V2,model_id:n,prompt:"",nano_banana_v2_aspect_ratio:a.t6.RATIO_1_1,resolution:a.IV.RES_512,thinking_level:a.w5.MINIMAL,web_search:!1,image_search:!1},s={architecture:i.qH.NANO_BANANA_V2,name:"Nano Banana 2",short_name:"Nano Banana 2",popularity:0,tags:[i.R$,i.Gm,i.fZ,i.Mn,i.ij],models:[{id:n}],api_path:"/api/v1/nano_banana_v2",agent:{description:"Image model for general generation and input-image edits.",defaultConfig:o,options:{resolution:Object.values(a.IV)},imageInputs:{references:{field:"image",additionalField:"additional_images"}},editCapable:!0}}},60169:(e,t,r)=>{"use strict";r.d(t,{K:()=>a,t:()=>n});var i=r(61282);let a={[i.c.BASIC]:500,[i.c.PRO]:1500,[i.c.PRO_PLUS]:3500,[i.c.MAX]:15e3},n={[i.c.BASIC]:"Basic",[i.c.PRO]:"Pro",[i.c.PRO_PLUS]:"Pro Plus",[i.c.MAX]:"Max"}},60506:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var i=r(34477);let a=(0,i.createServerReference)("001706589ebf230746d9cf45dec98b41dcdf3dded8",i.callServer,void 0,i.findSourceMapURL,"getMyUserMembership"),n=(0,i.createServerReference)("0082bf0e8efd1da777ac96b88f5727670875c644c4",i.callServer,void 0,i.findSourceMapURL,"getActivePowerPack"),o=(0,i.createServerReference)("0056c34b6132ccf904289af306798abdf56047b240",i.callServer,void 0,i.findSourceMapURL,"getUnusedPowerPacks");var s=r(61282),l=r(77567);async function c(){let{user:e,setActivePowerPack:t,setAvailablePowerPacks:r,setUserMembership:i}=l.xV.getState(),[c,d,u]=await Promise.all([e?n():Promise.resolve(null),e?o():Promise.resolve([]),e?a():Promise.resolve(s.c.FREE)]);t(c),r(d),i(c?s.c.MAX:u)}},60535:(e,t,r)=>{"use strict";r.d(t,{b0:()=>o,jL:()=>s});var i=r(4717),a=r(56800);let n="flux-schnell",o={architecture:a.qH.FLUX,model_id:n,prompt:"",num_inference_steps:4,guidance_scale:0,aspect_ratio:i.vW.PORTRAIT},s={architecture:a.qH.FLUX,name:"Flux",short_name:"Flux",popularity:5,tags:[a.fZ,a.R$],models:[n,"flux-dev","flux-dev-krea"].map(e=>({id:e})),api_path:"/api/v1/flux",agent:{description:"Fast general image model.",defaultConfig:o,options:{},imageInputs:{references:{field:"image"}}}}},60585:(e,t,r)=>{"use strict";function i(e){var t;return{id:e.id,name:e.name,username:e.username,image_url:e.image_url,audio_url:null!==(t=e.audio_url)&&void 0!==t?t:void 0}}r.d(t,{F:()=>i})},60608:(e,t,r)=>{"use strict";r.d(t,{Iw:()=>n,oG:()=>o});var i=r(4717),a=r(56800);let n={architecture:a.qH.HIDREAM,model_id:"hidream-fast",prompt:"",negative_prompt:"",num_inference_steps:16,guidance_scale:0,aspect_ratio:i.vW.PORTRAIT},o={architecture:a.qH.HIDREAM,name:"HiDream",short_name:"HiDream",popularity:0,tags:[a.fZ,a.R$],api_path:"/api/v1/hidream",agent:{description:"Fast general image model.",defaultConfig:n,options:{}}}},60681:(e,t,r)=>{"use strict";r.d(t,{y:()=>i});var i=function(e){return e.R_ESRGAN_X2="real-esrgan-x2",e.R_ESRGAN_X4="real-esrgan-x4",e.R_ESRGAN_X4_ANIME="real-esrgan-x4-anime",e.R_ESRGAN_X2_V2="real-esrgan-x2-v2",e.R_ESRGAN_X4_V2="real-esrgan-x4-v2",e.R_ESRGAN_X2_ANIME_V2="real-esrgan-x2-anime-v2",e.R_ESRGAN_X4_ANIME_V2="real-esrgan-x4-anime-v2",e.R_ESRGAN_X2_GFPGAN="real-esrgan-x2-gfpgan",e.R_ESRGAN_X4_GFPGAN="real-esrgan-x4-gfpgan",e.R_ESRGAN_X4_ANIME_GFPGAN="real-esrgan-x4-anime-gfpgan",e.R_ESRGAN_X2_V2_GFPGAN="real-esrgan-x2-gfpgan-v2",e.R_ESRGAN_X4_V2_GFPGAN="real-esrgan-x4-gfpgan-v2",e.R_ESRGAN_X2_ANIME_V2_GFPGAN="real-esrgan-x2-anime-gfpgan-v2",e.R_ESRGAN_X4_ANIME_V2_GFPGAN="real-esrgan-x4-anime-gfpgan-v2",e.R_ESRGAN_X2_RFORMER="real-esrgan-x2-rformer",e.R_ESRGAN_X4_RFORMER="real-esrgan-x4-rformer",e.R_ESRGAN_X4_ANIME_RFORMER="real-esrgan-x4-anime-rformer",e.R_ESRGAN_X2_CFORMER="real-esrgan-x2-cformer",e.R_ESRGAN_X4_CFORMER="real-esrgan-x4-cformer",e.R_ESRGAN_X4_ANIME_CFORMER="real-esrgan-x4-anime-cformer",e.LANCZOS="lanczos",e}({})},61169:(e,t,r)=>{"use strict";r.d(t,{m:()=>i});var i=function(e){return e.RES_1K="1k",e.RES_2K="2k",e}({})},61282:(e,t,r)=>{"use strict";r.d(t,{c:()=>i,t:()=>a});var i=function(e){return e.FREE="free",e.BASIC="basic",e.PRO="pro",e.PRO_PLUS="pro_plus",e.MAX="max",e}({}),a=function(e){return e.GEMS="gems",e.GEMS_20K="gems_20k",e.GEMS_40K="gems_40k",e.GEMS_100K="gems_100k",e}({})},61320:(e,t,r)=>{"use strict";r.d(t,{Bt:()=>n,bV:()=>i,z3:()=>a});var i=function(e){return e.IMAGE="image",e.VIDEO="video",e}({}),a=function(e){return e.RES_2K="2k",e.RES_4K="4k",e.RES_6K="6k",e}({}),n=function(e){return e.RES_720P="720p",e.RES_1080P="1080p",e.RES_1440P="1440p",e}({})},61581:(e,t,r)=>{"use strict";r.d(t,{m:()=>Y});var i=r(95155),a=r(77567),n=r(18403),o=r(69604),s=r(70714),l=r(70112),c=r(39926),d=r(21220),u=r(58887),p=r(26029),m=r(93677),g=r(81001),h=r(42445),f=r(8141),v=r(66610),_=r(43905),y=r(73396),b=r(53884),A=r(31503),S=r(16701),x=r(755),R=r(35695),I=r(12115),C=r(34477);let w=(0,C.createServerReference)("40cebf2e7dc2943a9a4ab9141a684e06ee347c3e5f",C.callServer,void 0,C.findSourceMapURL,"deleteReference");var E=r(7963),P=r(16791),T=r(93751),M=r(95642),k=r(18229),O=r(26903),D=r(91423);function U(e){let{reference:t,onDeleted:r}=e,[o,s]=(0,I.useState)(!1),p=async()=>{let e=a.xV.getState();try{s(!0),await w(t.id),e.addDeletedReferenceId(t.id),e.removeRecentReferenceById(t.id),(0,P.wB)({title:"Reference Deleted",message:"Your reference has been deleted."}),(0,D.s7)(),null==r||r()}catch(e){(0,P.p6)({title:"Delete Failed",message:e instanceof Error?e.message:"Could not delete reference. Please try again."})}finally{s(!1)}};return(0,i.jsx)(n.Card,{bg:"dark.9",radius:"lg",children:(0,i.jsxs)(d.Stack,{gap:"md",children:[(0,i.jsxs)(l.Group,{justify:"space-between",align:"center",children:[(0,i.jsx)(T.Title,{c:"white",order:2,children:"Delete Reference"}),(0,i.jsx)(M.CloseButton,{size:"lg",c:"dimmed",onClick:()=>(0,D.s7)(),radius:"xl"})]}),(0,i.jsxs)(l.Group,{gap:"sm",children:[(0,i.jsx)(c.Avatar,{src:t.image_url,size:48,radius:"xl"}),(0,i.jsx)(u.Text,{c:"white",fw:500,children:t.name})]}),(0,i.jsx)(u.Text,{c:"dimmed",size:"sm",children:"This reference will be permanently deleted. This action cannot be undone. Are you sure you want to continue?"}),(0,i.jsxs)(k.SimpleGrid,{cols:2,spacing:"xs",children:[(0,i.jsx)(O.Button,{variant:"light",color:"gray",onClick:()=>(0,D.s7)(),disabled:o,size:"lg",children:"Cancel"}),(0,i.jsx)(O.Button,{color:"red",onClick:p,loading:o,size:"lg",children:"Delete"})]})]})})}var N=r(71570),H=r(57377);function j(e){let{reference:t,onClick:r,onDeleted:f,onUpdated:x,selected:C,isOwner:w}=e,P=(0,a.xV)(e=>e.isDesktop),{hovered:T,ref:M}=(0,v.useHover)(),k=(0,R.useRouter)(),[O,D]=(0,I.useState)(!1),j="/references/@".concat(encodeURIComponent(t.username)),L=(0,H.Z)(t.variant);return(0,i.jsxs)(n.Card,{ref:P?M:void 0,style:{transition:"background 0.2s ease",cursor:"pointer",position:"relative",overflow:"hidden",border:C?"2px solid white":"2px s
1olid transparent"},p:"xs",radius:"md",onClick:r,children:[(0,i.jsx)(o.Box,{pos:"absolute",top:0,left:0,right:0,bottom:0,style:{backgroundImage:t.image_url?"url(".concat(t.image_url,")"):void 0,backgroundSize:"cover",backgroundPosition:"center",filter:"blur(20px)",transform:"scale(1.1)",opacity:.5}}),(0,i.jsx)(o.Box,{pos:"absolute",top:0,left:0,right:0,bottom:0,bg:T?(0,s.X)("#000",.3):(0,s.X)("#000",.5),style:{transition:"background 0.2s ease"}}),(0,i.jsxs)(l.Group,{gap:"sm",wrap:"nowrap",pos:"relative",style:{zIndex:1},children:[(0,i.jsx)(c.Avatar,{src:t.image_url,size:48,radius:"xl"}),(0,i.jsxs)(d.Stack,{gap:0,children:[(0,i.jsxs)(l.Group,{gap:4,children:[(0,i.jsx)(u.Text,{c:"white",fw:500,size:"sm",lineClamp:1,children:t.name}),(0,i.jsx)(p.Badge,{color:L.badgeColor,variant:"light",size:"xs",children:t.variant})]}),(0,i.jsxs)(u.Text,{c:"dimmed",size:"xs",lineClamp:1,children:["@",t.username]})]})]}),(0,i.jsxs)(m.Menu,{shadow:"md",position:"bottom-end",withinPortal:!0,opened:O,onChange:D,children:[(0,i.jsx)(m.Menu.Target,{children:(0,i.jsx)(g.ActionIcon,{variant:"subtle",color:"gray",size:"md",style:{position:"absolute",top:"50%",right:3,transform:"translateY(-50%)",zIndex:1e3},onClick:e=>e.stopPropagation(),c:"white",radius:"xl",opacity:T||!P?1:0,children:(0,i.jsx)(_.A,{size:14})})}),(0,i.jsxs)(m.Menu.Dropdown,{p:0,children:[(0,i.jsx)(m.Menu.Item,{leftSection:(0,i.jsx)(y.A,{size:14}),onClick:e=>{e.stopPropagation(),k.push(j)},children:"Detail"}),(0,i.jsx)(h.CopyButton,{value:"@".concat(t.username),children:e=>{let{copied:t,copy:r}=e;return(0,i.jsx)(m.Menu.Item,{leftSection:(0,i.jsx)(b.A,{size:14}),onClick:e=>{e.stopPropagation(),r()},children:t?"Copied!":"Copy Username"})}}),w&&(0,i.jsx)(m.Menu.Item,{leftSection:(0,i.jsx)(A.A,{size:14}),onClick:e=>{e.stopPropagation(),(0,N.tT)(t,x)},children:"Edit"}),w&&(0,i.jsx)(m.Menu.Item,{color:"red",leftSection:(0,i.jsx)(S.A,{size:14}),onClick:e=>{e.stopPropagation(),(0,E.q)({children:(0,i.jsx)(U,{reference:t,onDeleted:f})})},children:"Delete"})]})]})]})}function L(e){let{onClick:t}=e,r=(0,a.xV)(e=>e.isDesktop),{hovered:o,ref:c}=(0,v.useHover)();return(0,i.jsx)(n.Card,{ref:r?c:void 0,bg:o?(0,s.X)("FFF",.1):"transparent",style:{transition:"background 0.2s ease, outline 0.2s ease",cursor:"pointer",outline:o?"2px solid gray":"2px solid transparent",outlineOffset:0},p:"xs",radius:"md",onClick:t,children:(0,i.jsxs)(l.Group,{gap:"sm",wrap:"nowrap",children:[(0,i.jsx)(f.Center,{w:48,h:48,style:{borderRadius:"50%"},bg:"dark.9",children:(0,i.jsx)(x.A,{size:24,color:"gray"})}),(0,i.jsx)(u.Text,{c:"white",fw:500,size:"sm",children:"Create New"})]})})}var G=r(36391),q=r(32780),B=r(31304),F=r(56185),V=r(83347),K=r(78977),z=r(25883),W=r(23552);function X(){return(0,i.jsx)(o.Box,{bg:"dark.9",p:"xs",style:{borderRadius:"var(--mantine-radius-md)"},children:(0,i.jsxs)(l.Group,{gap:"sm",wrap:"nowrap",children:[(0,i.jsx)(F.Skeleton,{circle:!0,height:48,width:48}),(0,i.jsxs)(d.Stack,{gap:4,style:{flex:1},children:[(0,i.jsx)(F.Skeleton,{height:12,width:"70%",radius:"xl"}),(0,i.jsx)(F.Skeleton,{height:10,width:"50%",radius:"xl"})]})]})})}function Y(e){let{selection:t,...r}=e;return t?(0,i.jsx)(Q,{...r,selection:t}):(0,i.jsx)(Z,{...r})}function Z(e){let{activeReferences:t}=(0,B.m)(),{activeAudioReferences:r}=(0,B.C)(),a={selectedReferenceIds:t.map(e=>e.id),selectedAudioReferenceIds:r.map(e=>e.id),onSelect:e=>{if("audio"===e.modality){(0,G.gU)(e);return}(0,G.kc)(e)}};return(0,i.jsx)(Q,{...e,selection:a})}function Q(e){let{options:t,initialReferences:r,selection:n,hideCreateCard:s,defaultCreateType:c,createAudio:p}=e,{isDesktop:m,deletedReferenceIds:g,user:h}=(0,a.xV)((0,W.k)(e=>({isDesktop:e.isDesktop,deletedReferenceIds:e.deletedReferenceIds,user:e.user}))),v=function(e,t,r){let[i,a]=(0,I.useState)(null),[n,o]=(0,I.useState)(!1),[s,l]=(0,I.useState)(t||[]),[c,d]=(0,I.useState)(!0);async function u(){o(!0),a(null);try{let r=await (0,q.w)(100,Math.max(s.length-(t||[]).length,0),e);l(e=>{let t=e.map(e=>e.id);return[...e,...r.references.filter(e=>!t.includes(e.id))]}),d(r.hasMore),a(null)}catch(e){a(e)}finally{o(!1)}}return{references:s,loadMore:u,updateReference:function(e){l(t=>t.map(t=>
1t.id===e.id?e:t))},loading:n,hasMore:c,error:i}}(t,r),_=(0,I.useMemo)(()=>v.references.filter(e=>!g.includes(e.id)),[v.references,g]),y=(0,I.useMemo)(()=>new Set(n.selectedReferenceIds),[n.selectedReferenceIds]),b=(0,I.useMemo)(()=>new Set(n.selectedAudioReferenceIds),[n.selectedAudioReferenceIds]),[A]=(0,z.A)({loading:v.loading,hasNextPage:v.hasMore,onLoadMore:v.loadMore,rootMargin:"0px 0px 0px 0px",disabled:!!v.error,delayInMs:200});(0,I.useEffect)(()=>{0===(r||[]).length&&v.loadMore()},[]);let S=e=>{n.onSelect(e)},x=e=>"audio"===e.modality?b.has(e.id):y.has(e.id);return(0,i.jsxs)(d.Stack,{w:"100%",children:[(0,i.jsxs)(o.Box,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(m?220:180,"px, 1fr))"),gap:"var(--mantine-spacing-xs)",width:"100%"},children:[!s&&(0,i.jsx)(o.Box,{children:(0,i.jsx)(L,{onClick:()=>{if(p){(0,N.K9)();return}(0,N.Nf)(void 0,c)}})}),_.map((e,t)=>(0,i.jsx)(o.Box,{ref:t===_.length-50?A:void 0,children:(0,i.jsx)(j,{reference:e,onClick:()=>S(e),onUpdated:e=>v.updateReference(e),selected:x(e),isOwner:(null==h?void 0:h.uid)===e.uid})},"reference-feed-".concat(e.id))),v.loading&&0===_.length&&Array.from({length:m?12:6}).map((e,t)=>(0,i.jsx)(o.Box,{children:(0,i.jsx)(X,{})},"skeleton-".concat(t)))]}),(0,i.jsx)(f.Center,{h:50,children:v.loading&&_.length>0?(0,i.jsxs)(l.Group,{gap:"xs",my:"sm",children:[(0,i.jsx)(V.Loader,{size:18}),(0,i.jsx)(u.Text,{c:"dimmed",size:"sm",children:"Loading..."})]}):v.error?(0,i.jsx)(O.Button,{c:"white",leftSection:(0,i.jsx)(K.A,{size:18}),variant:"transparent",my:"sm",onClick:()=>v.loadMore(),children:"Could not fetch. Retry?"}):!v.hasMore&&_.length>0?(0,i.jsx)(l.Group,{gap:"xs",my:"sm",children:(0,i.jsx)(u.Text,{c:"dimmed",size:"sm",children:"You've reached the end!"})}):null})]})}},61629:(e,t,r)=>{"use strict";r.d(t,{BI:()=>o,L0:()=>n,Le:()=>l,Ut:()=>c,nZ:()=>s,x0:()=>a,xl:()=>i});var i=function(e){return e.SEED_AUDIO_1_0="seed-audio-1.0",e}({}),a=function(e){return e.MP3="mp3",e}({});let n=3,o=[5,10,30,60,120],s=1,l=120,c=2986},61770:(e,t,r)=>{"use strict";r.d(t,{z:()=>a});var i=r(34477);let a=(0,i.createServerReference)("40962391d335b94c2c02a03ae479fe8a25b46b3ffd",i.callServer,void 0,i.findSourceMapURL,"deleteManyCreations")},61871:(e,t,r)=>{"use strict";r.d(t,{n:()=>n});var i=r(82646),a=r(16791);function n(){(0,a.bA)({title:i.$I,message:i.qX})}},62664:(e,t,r)=>{"use strict";r.d(t,{JY:()=>N,PN:()=>j,_1:()=>O,dz:()=>M,eR:()=>H,nH:()=>G,rK:()=>k,s1:()=>D,yQ:()=>U,yS:()=>L,zK:()=>q});var i=r(40201),a=r(23446),n=r(20036),o=r(17157),s=r(56800),l=r(47370),c=r(57411),d=r(43050),u=r(86819),p=r(84563),m=r(83880),g=r(45335),h=r(93772);function f(e){return Object.values(e)}let v=o.zo,_=f(p.cU),y=f(g.nA),b=f(g.L1),A=f(g.qw),S=f(l.RR),x=f(l.X5),R=f(l.mA),I=f(d.so),C=f(d.yS),w=u.fi,E=f(i.PK),P=f(i.mv),T={id:n.$x.CHERRY_MINI,label:"Cherry Mini",architecture:s.qH.CHERRY,backendModelId:n.$x.CHERRY_MINI,resolutions:o.OH[n.$x.CHERRY_MINI],durations:o.WC[n.$x.CHERRY_MINI],aspectRatios:v},M={id:n.$x.CHERRY,label:"Cherry",architecture:s.qH.CHERRY,backendModelId:n.$x.CHERRY,resolutions:o.OH[n.$x.CHERRY],durations:o.WC[n.$x.CHERRY],aspectRatios:v},k={id:n.$x.CHERRY_PRO,label:"Cherry Pro",architecture:s.qH.CHERRY,backendModelId:n.$x.CHERRY_PRO,resolutions:o.OH[n.$x.CHERRY_PRO],durations:o.WC[n.$x.CHERRY_PRO],aspectRatios:v},O={id:n.$x.CHERRY_2_PRO,label:"Cherry 2 Pro",architecture:s.qH.CHERRY,backendModelId:n.$x.CHERRY_2_PRO,resolutions:o.OH[n.$x.CHERRY_2_PRO],durations:o.WC[n.$x.CHERRY_2_PRO],aspectRatios:v},D=[M,T,k,O],U={id:m.dF,label:"Plum",architecture:s.qH.PLUM,backendModelId:m.dF,resolutions:m.ZW[m.dF],durations:m.vO[m.dF],aspectRatios:_},N={id:m.fR,label:"Plum Max",architecture:s.qH.PLUM,backendModelId:m.fR,resolutions:m.ZW[m.fR],durations:m.vO[m.fR],aspectRatios:_},H={id:h.t6,label:"Raspberry",architecture:s.qH.RASPBERRY,backendModelId:h.t6,resolutions:y,durations:b,aspectRatios:A},j={id:c.MF,label:"Grok Video",architecture:s.qH.GROK_VIDEO,backendModelId:c.MF,resolutions:S,durations:x,aspectRatios:R},L={id:a.Do,label:"Berry",architecture:s.qH.BERRY,backendModelId:a.Do,resolutions:a.zX[a.Do],durations:E,aspectRatios:P},G={id:a.Y9,label:"Berry 2",architecture:s.qH.BERRY,backendModelId:a.Y9,resolutions:a.zX[a.Y9],durations:E,aspectRatios:P},q={id:u.ib,label:"Lemon",architecture:s.qH.LEMON,backendModelId:u.ib,resolutions:I,durations:C,aspectRatios:w};[...D]},62878:(e,t,r)=>{"use strict";r.d(t,{C0:()=>n,Kc:()=>o,YH:()=>s});var i=r(61282),a=r(46222);let n={[i.t.GEMS]:{purchase:i.t.GEMS,priceId:a.QU,productId:a.ee,usd:10,gems:1e4,label:"10,000 Gems",sku:"gems_10k"},[i.t.GEMS_20K]:{purchase:i.t.GEMS_20K,priceId:a.xs,productId:a.b6,usd:20,gems:20500,label:"20,000 Gems + 500 Bonus Gems",sku:"gems_20k"},[i.t.GEMS_40K]:{purchase:i.t.GEMS_40K,priceId:a.Xm,productId:a.lU,usd:40,gems:42e3,label:"40,000 Gems + 2,000 Bonus Gems",sku:"gems_40k"},[i.t.GEMS_100K]:{purchase:i.t.GEMS_100K,priceId:a.KG,productId:a.cU,usd:100,gems:11e4,label:"100,000 Gems + 10,000 Bonus Gems",sku:"gems_100k"}},o=Object.values(n),s=3e5},63015:(e,t,r)=>{"use strict";r.d(t,{L_:()=>o,pU:()=>n});var i=r(56800),a=r(25102);let n={architecture:i.qH.MELON,model_id:a.VI.MELON,prompt:"",melon_aspect_ratio:a.Nf.ASPECT_RATIO_16_9,duration:a.AR.DURATION_4S,resolution:a.gk.RESOLUTION_540P,generate_audio:!1},o={architecture:i.qH.MELON,name:"Melon",short_name:"Melon",popularity:0,tags:[i.fZ,i.tM],models:[{id:"melon",name:"Melon"},{id:"melon-pro",name:"Melon Pro"}],api_path:"/api/v1/melon",agent:{description:"General video model. Start/end frames and reference images are mutually exclusive; set one kind or the other.",defaultConfig:n,options:{resolution:Object.values(a.gk),duration:Object.values(a.AR)},imageInputs:{firstFrame:"first_image",lastFrame:"last_image",references:{field:"image",additionalField:"additional_images"}}}}},63983:(e,t,r)=>{"use strict";r.d(t,{s:()=>i});var i=function(e){return e.TRENDING="trending",e.TOP="top",e.NEWEST="newest",e.OLDEST="oldest",e}({})},64325:(e,t,r)=>{"use strict";r.d(t,{I:()=>i});var i=function(e){return e.SIZE_240P="240p",e.SIZE_360P="360p",e.SIZE_480P="480p",e.SIZE_720P="720p",e}({})},64428:(e,t,r)=>{"use strict";r.d(t,{D6:()=>i,GO:()=>o,TU:()=>l,d0:()=>a,dq:()=>s});let i=1,a=15,n=/^[a-z][a-z0-9_-]*$/,o=50,s=500;function l(e){return e?e.length<i?{valid:!1,error:"Username must be at least ".concat(i," character").concat(i>1?"s":"")}:e.length>a?{valid:!1,error:"Username must be at most ".concat(a," characters")}:n.test(e)?/^[-_]?\d+$/.test(e)?{valid:!1,error:"Username cannot be only numbers"}:{valid:!0}:{valid:!1,error:"Username can only contain lowercase letters, numbers, underscores, and dashes, and must start with a letter"}:{valid:!1,error:"Username is required"}}},64610:(e,t,r)=>{"use strict";function i(e){if("image"===e.type)return e.data.image;if("video"===e.type)return e.data.video;
1if("audio"===e.type)return e.data.audio;throw Error("Invalid app result type")}function a(e,t){if("image"===e.type)return{...e,data:{...e.data,image:t}};if("video"===e.type)return{...e,data:{...e.data,video:t}};if("audio"===e.type)return{...e,data:{...e.data,audio:t}};throw Error("Invalid app result type")}r.d(t,{Y:()=>a,h:()=>i})},64930:(e,t,r)=>{"use strict";r.d(t,{H3:()=>o,fR:()=>n,$p:()=>i,In:()=>s,f5:()=>l,Yb:()=>a});let i={id:"3e5cc48b5bca47df87d42b59a105aae2",uid:null,name:"Empty Concept",description:"Empty concept used for legacy remixes.",config:null,architecture_config:{model_id:"3C5D7960A76DBC715AD1C4F2C4F948CD1F12CCD09D44CEF243A7DD2CF82371BF",architecture:r(56800).qH.STABLE_DIFFUSION_V15},image_url:"https://cdn3.mage.space/concepts/preview/29900c9990e0395b34224dedbc2a0b97/1916568661246935daad6b351af4a9e0.jpg",tags:[],status:"unlisted",popularity:0,created_at:new Date("2024-11-09 18:13:59.176873"),updated_at:new Date("2024-11-09 18:13:59.176873"),model_id:"3C5D7960A76DBC715AD1C4F2C4F948CD1F12CCD09D44CEF243A7DD2CF82371BF",duration:0,num_plays_all_time:0,num_plays_monthly:0,num_plays_daily:0,num_plays_hourly:0,num_plays_quarter_hourly:0,num_favorites:0,num_users_online:0},a="video-beta",n="68c623fc56a94518af4889349a15a871",o="2249daef55c245aca6b780b5f823362a",s="10fc8b4d151f4bda8a6e9e8c07ba3464",l={name:"Model",contains_one_of_tags:["model"]};["model","AI Girl","ai-girl","ai-guy","fan-art"].filter(e=>"fan-art"!==e)},65023:(e,t,r)=>{"use strict";r.d(t,{e:()=>h});var i=r(95155),a=r(57635),n=r(69604),o=r(60266),s=r(80975),l=r(83347),c=r(58887),d=r(51423),u=r(21220),p=r(26903),m=r(755),g=r(12115);function h(e){let{aspectRatio:t,label:r,hint:h,actions:f,isDragging:v,dragProps:_,isUploading:y,disabled:b,size:A="lg"}=e,[S,x]=(0,g.useState)(!1),[R,I]=(0,g.useState)(!1),{padding:C,iconWrap:w,iconSize:E,innerGap:P,labelTextSize:T,labelStyle:M,hintStyle:k}={xs:{padding:"8px 10px",iconWrap:24,iconSize:12,innerGap:3,labelTextSize:"xs",labelStyle:{fontSize:11},hintStyle:{fontSize:10,lineHeight:1.25}},sm:{padding:"10px 12px",iconWrap:28,iconSize:14,innerGap:4,labelTextSize:"xs",labelStyle:void 0,hintStyle:void 0},lg:{padding:"16px 20px",iconWrap:36,iconSize:18,innerGap:6,labelTextSize:"sm",labelStyle:void 0,hintStyle:void 0}}[A];return(0,i.jsx)(n.Box,{..._,role:b?void 0:"button",tabIndex:b?-1:0,onClick:()=>{b||x(e=>!e)},onKeyDown:e=>{!b&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),x(e=>!e))},onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),style:{aspectRatio:t,borderRadius:12,border:v?"2px solid var(--mantine-color-orange-5)":R?"2px dashed rgba(255, 255, 255, 0.25)":"2px dashed rgba(255, 255, 255, 0.15)",backgroundColor:v?"rgba(216, 131, 41, 0.35)":R?"rgba(255, 255, 255, 0.06)":"rgba(255, 255, 255, 0.03)",display:"flex",alignItems:"center",justifyContent:"center",padding:C,position:"relative",overflow:"visible",cursor:b?"default":"pointer",outline:"none",transition:"background-color 150ms ease, border-color 150ms ease"},children:(0,i.jsxs)(o.Popover,{opened:S,onClose:()=>x(!1),position:"bottom",middlewares:{flip:!1,shift:!1,inline:!1},withinPortal:!1,shadow:"none",withArrow:!0,children:[(0,i.jsx)(s.PopoverTarget,{children:(0,i.jsxs)(n.Box,{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:P,maxWidth:"100%",textAlign:"center",cursor:"inherit"},children:[(0,i.jsx)(n.Box,{style:{width:w,height:w,borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.08)",display:"flex",alignItems:"center",justifyContent:"center"},children:y?(0,i.jsx)(l.Loader,{size:E}):(0,i.jsx)(m.A,{size:E,color:"var(--mantine-color-gray-5)"})}),(0,i.jsx)(c.Text,{size:T,c:"white",fw:500,style:M,children:r}),(0,i.jsx)(c.Text,{size:"xs",c:"dimmed",style:k,children:null!=h?h:(0,i.jsxs)(i.Fragment,{children:["Click to add",(0,i.jsx)("br",{}),"JPEG or PNG"]})})]})}),(0,i.jsx)(d.PopoverDropdown,{p:"xs",style:{...a.he,marginTop:8,width:"min(200px, calc(100vw - 48px))"},children:(0,i.jsx)(u.Stack,{gap:4,children:f.map(e=>(0,i.jsx)(p.Button,{variant:"subtle",color:"gray",c:"white",size:"sm",leftSection:e.icon,disabled:e.disabled,fullWidth:!0,onClick:()=>{x(!1),e.onClick()},children:e.label},e.key))})})]})})}},65025:(e,t,r)=>{"use strict";r.d(t,{DR:()=>s,Dw:()=>i,IA:()=>u,Nx:()=>a,WW:()=>n,Wd:()=>d,aZ:()=>l,rG:()=>c,vu:()=>
1o});let i=4090,a=4091,n=4267,o=412,s=410,l=4261,c=4262,d=4263,u=4266},65638:(e,t,r)=>{"use strict";r.d(t,{IV:()=>a,t6:()=>i,w5:()=>n});var i=function(e){return e.RATIO_1_1="1:1",e.RATIO_3_2="3:2",e.RATIO_2_3="2:3",e.RATIO_3_4="3:4",e.RATIO_4_1="4:1",e.RATIO_4_3="4:3",e.RATIO_4_5="4:5",e.RATIO_5_4="5:4",e.RATIO_8_1="8:1",e.RATIO_9_16="9:16",e.RATIO_16_9="16:9",e.RATIO_21_9="21:9",e}({}),a=function(e){return e.RES_512="512",e.RES_1K="1K",e.RES_2K="2K",e.RES_4K="4K",e}({}),n=function(e){return e.MINIMAL="minimal",e.HIGH="high",e}({})},66685:(e,t,r)=>{"use strict";r.d(t,{ey:()=>n,k9:()=>a});var i=r(83880);function a(e){return void 0!==e&&Number.isFinite(e)&&e>=i.zh&&e<=i.x9}function n(e){if(!a(e.video_duration_s))throw Error("Plum video editing requires a duration between ".concat(i.zh," and ").concat(i.x9," seconds"))}},67065:e=>{e.exports={grid:"infinite_grid__czC84",griditem:"infinite_griditem__6UHMD"}},67457:(e,t,r)=>{"use strict";r.d(t,{Ou:()=>o,Fb:()=>l,OA:()=>s});var i=r(60169),a=r(61282);let n={[a.c.FREE]:{title:"Free",monthlyPriceUsd:0,features:[{text:"Limited access to features",tooltip:"Limited to generation options that cost Gems."},{text:"".concat(300," Gems Sign-up Bonus"),tooltip:"Gems expire 90 days after being credited."}]},[a.c.BASIC]:{title:"Basic",monthlyPriceUsd:10,features:[{text:"Unlimited Generations"},{text:"Base Models",tooltip:"Unlimited Image Generation includes: SD1.5, SDXL, SD3.5, Flux, Flux 2, Chroma, Kontext Dev, Z-Image Turbo, Krea 2, GPT Image 2 & 2.5 (Low)"},{text:"LoRAs and Textual Inversions"},{text:"Inpainting, Refine"},{text:"".concat(i.K[a.c.BASIC].toLocaleString()," Monthly Gems"),tooltip:"Monthly Gems expire 30 days after being deposited and are renewed monthly."}]},[a.c.PRO]:{title:"Pro",monthlyPriceUsd:30,backgroundImage:"/membership/gradient-1-orange.jpg",features:[{text:"Everything in Basic"},{text:"Premium Base Models",tooltip:"Unlimited Image Generation includes: SD1.5, SDXL, SD3.5, Flux, Flux 2, Chroma, Kontext Dev, Z-Image Turbo, Krea 2, HiDream, Qwen, Mango, Guava, GPT Image 2 & 2.5 (Low), Anima, Grok Image"},{text:"Unlimited Video Generation",tooltip:"Unlimited Video Generation includes: FramePack, Wan, LTX, Peach, Peach Max, Melon, Lemon (3s @ 480p), MiniMax-H3 Turbo (10s @ 768p, 15s @ 544p)"},{text:"Unlimited Character Creation"},{text:"Enhance (2K)"},{text:"Multiple LoRAs and Textual Inversions (2x)"},{text:"ControlNet, Animate"},{text:"".concat(i.K[a.c.PRO].toLocaleString()," Monthly Gems"),tooltip:"Monthly Gems expire 30 days after being deposited and are renewed monthly."}]},[a.c.PRO_PLUS]:{title:"Pro Plus",monthlyPriceUsd:60,backgroundImage:"/membership/gradient-2-orange.jpg",features:[{text:"Everything in Pro"},{text:"Premium Video Models",tooltip:"Unlimited Video Generation includes: FramePack, Wan, LTX, Peach, Peach Max, Cherry, Melon, Plum Max (5s @ 480p), Kiwi, Blueberry 2 (4s @ 720p, 2s @ 1080p), Raspberry (4s @ 720p, 2s @ 1080p), Berry (3s @ 720p), Lemon (7s @ 480p, 3s @ 720p), MiniMax-H3 Turbo (15s @ 768p) and base model (5s @ 768p), Grok Video (5s @ 480p, 3s @ 720p), Veo 3.1 Lite"},{text:"Enhance (4K)"},{text:"Multiple LoRAs and Textual Inversions (5x)"},{text:"Import Custom Models (Checkpoints, LoRAs, Textual Inversions, Lycoris)"},{text:"Queue up to 10 generations at once"},{text:"".concat(i.K[a.c.PRO_PLUS].toLocaleString()," Monthly Gems"),tooltip:"Monthly Gems expire 30 days after being deposited and are renewed monthly."}]},[a.c.MAX]:{title:"Max",monthlyPriceUsd:200,backgroundImage:"/membership/gradient-2-blue.jpg",features:[{text:"Everything in Pro Plus"},{text:"Unlimited Motion Control Video Generation",tooltip:"Unlimited Motion Control Video Generation includes: Pear (5s)"},{text:"More Premium Video Models",tooltip:"Unlimited Video Generation includes: FramePack, Wan, LTX, Peach, Peach Max, Cherry, Cherry 2 Pro (4s @ 480p), Melon, Plum (5s @ 768p, 4s @ 2K), Plum Max (9s @ 480p, 5s @ 768p), Kiwi, Blueberry, Raspberry, Berry (4s @ 720p), Lemon (11s @ 480p, 5s @ 720p, 2s @ 1080p), MiniMax-H3 base model (7s @ 768p), Grok Video (7s @ 480p, 5s @ 720p), Veo 3.1 Lite"},{text:"HD Premium Video Models",tooltip:"Unlimited Video Generation at 480p resolution with: Cherry, Cherry 2 Pro, Grok Video, Lemon, Plum Max; 720p resolution with: Peach Max, Kiwi, Blueberry, Raspberry, Berry, Grok Video, Veo 3.1 Lite, Melon, Lemon; 768p with: Plum, Plum Max, MiniMax-H3; 1080p with: Peach, Blueberry 2, Raspberry, Veo 3.1 Lite, Melon, Lemon; 2K with: Plum"},{text:"Longer Duration for Premium Video Models",tooltip:"Unlimited Video Generation at 15s duration with: MiniMax-H3 Turbo (768p); 11s with: Lemon (480p); 10s with: Peach, Peach Max, Kiwi; 9s at 480p with: Plum Max; 7s at 480p with: Grok Video; 6s with: Veo 3.1 Lite; 6s at 720p with: Blueberry 2, Raspberry, Melon; 5s with: Cherry, Grok Video (720p), Lemon (720p); 5s at 768p with: Plum, Plum Max;
1 4s at 2K with: Plum; 4s at 1080p with: Blueberry 2, Raspberry; 4s with: Berry; 4s at 480p with: Cherry 2 Pro"},{text:"Multiple Video LoRAs (2x)"},{text:"".concat(i.K[a.c.MAX].toLocaleString()," Monthly Gems"),tooltip:"Monthly Gems expire 30 days after being deposited and are renewed monthly."}]}};function o(e){return n[e]}function s(e){return e?"url(".concat(e,")"):"linear-gradient(to bottom, #000000, #171717)"}function l(e){return s(n[e].backgroundImage)}},67603:(e,t,r)=>{"use strict";r.d(t,{E:()=>y,l:()=>_});var i=r(23446),a=r(21078),n=r(56800),o=r(27122),s=r(86819),l=r(58649),c=r(59791),d=r(83880),u=r(93772),p=r(25352),m=r(94035),g=r(14276),h=r(41998),f=r.n(h);let v={[n.qH.BERRY]:{configKey:"berryConfig",defaultConfig:i.im,tierFields:["model_id","resolution","duration"],describeConfig:e=>{let t="Berry";return e.model_id===i.Y9&&(t="Berry 2"),"".concat(t," \xb7 ").concat(e.resolution," \xb7 ").concat(e.duration,"s")}},[n.qH.RASPBERRY]:{configKey:"raspberryConfig",defaultConfig:u.q7,tierFields:["resolution","duration"],describeConfig:e=>"".concat(e.resolution," \xb7 ").concat(e.duration,"s")},[n.qH.BLUEBERRY]:{configKey:"blueberryConfig",defaultConfig:a.Wc,tierFields:["model_id","resolution","duration"],describeConfig:e=>{let t="Blueberry";return e.model_id===a.el&&(t="Blueberry 2"),"".concat(t," \xb7 ").concat(e.resolution," \xb7 ").concat(e.duration,"s")}},[n.qH.NANO_BANANA_V2]:{configKey:"nanoBananaV2Config",defaultConfig:c.Zd,tierFields:["resolution"],describeConfig:e=>"".concat(e.resolution," resolution")},[n.qH.PLUM]:{configKey:"plumConfig",defaultConfig:d.yc,tierFields:["model_id","resolution","duration"],describeConfig:e=>"".concat(d.sm[(0,d.nQ)(e)]," \xb7 ").concat(e.resolution," \xb7 ").concat(e.duration,"s")},[n.qH.LEMON]:{configKey:"lemonConfig",defaultConfig:s.Rc,tierFields:["resolution","duration"],describeConfig:e=>"".concat(e.resolution," \xb7 ").concat(e.duration,"s")},[n.qH.MINIMAX_H3]:{configKey:"minimaxH3Config",defaultConfig:l.NW,tierFields:["model_id","base_size","duration","num_inference_steps"],describeConfig:e=>{let t="MiniMax-H3";return e.model_id===l.dd&&(t="MiniMax-H3 Turbo"),"".concat(t," \xb7 ").concat(e.base_size," \xb7 ").concat(e.duration,"s \xb7 ").concat((0,l.X6)(e)," steps")}}};function _(e,t,r){let i=v[e.architecture];if(!i)return{action:"proceed"};let a=(0,m.WT)(e,t,r);if("block"!==a.action||a.membershipRequired===o.v)return{action:"proceed"};let n={...e,...f()(i.defaultConfig,i.tierFields)},s=(0,m.WT)(n,t,r);return"allow"===s.action?{action:"snap",configKey:i.configKey,config:n,storedMembershipRequired:a.membershipRequired,settingsSummary:i.describeConfig(n)}:"block"===s.action&&s.membershipRequired!==o.v&&s.membershipRequired!==a.membershipRequired&&(0,g.c)(a.membershipRequired,s.membershipRequired)?{action:"gate-at-floor",membershipRequired:s.membershipRequired}:{action:"proceed"}}function y(e){if(e.generationMode!==p.o.UNLIMITED)return;let t=v[e.activeArchitecture];if(!t)return;let r=e[t.configKey];if(!r)return;let i=_((0,m.AU)(r),p.o.UNLIMITED,e.userMembership);"snap"===i.action&&(e[t.configKey]=i.config)}},67881:(e,t,r)=>{"use strict";r.d(t,{a:()=>n});var i=r(45335),a=r(93772);function n(e){var t;return(e.resolution===i.nA.RES_1080P?135:90)*Number(null!==(t=e.duration)&&void 0!==t?t:a.q7.duration)}},67934:(e,t,r)=>{"use strict";r.d(t,{Cv:()=>T,F:()=>c,GI:()=>C,Gp:()=>x,JC:()=>A,KL:()=>i,LY:()=>f,Nf:()=>b,QV:()=>y,Qr:()=>_,T1:()=>d,Ut:()=>h,Wv:()=>u,Yj:()=>g,c6:()=>R,eE:()=>P,hB:()=>a,hH:()=>s,hs:()=>I,jk:()=>l,mn:()=>m,nj:()=>M,qU:()=>w,wO:()=>o,wy:()=>p,xz:()=>v,yy:()=>S});var i=function(e){return e.IMAGE_ENHANCER="image_enhancer",e.VIDEO_ENHANCER="video_enhancer",e.SKIN_ENHANCER="skin_enhancer",e.FACE_SWAP="face_swap",e.INPAINT="inpaint",e.CHARACTER_SWAP="character_swap",e.OUTFIT_SWAP="outfit_swap",e.RELIGHT="relight",e.CHARACTER_CREATOR="character_creator",e.MUSE="muse",e.RECREATE="recreate",e.REFINE="refine",e.SCENE_BUILDER="scene_builder",e.ANGLES="angles",e.VIDEO_EDITOR="video_editor",e.VIDEO_FACE_SWAP="video_face_swap",e.VIDEO_CHARACTER_SWAP="video_character_swap",e.LIPSYNC="lipsync",e.MUSIC_VIDEO="music_video",e}({});let a={IMAGE_ENHANCER:"image-enhancer",VIDEO_ENHANCER:"video-enhancer",SKIN_ENHANCER:"skin-enhancer",FACE_SWAP:"face-swap",INPAINT:"inpaint",CHARACTER_SWAP:"character-swap",OUTFIT_SWAP:"outfit-swap",RELIGHT:"relight",CHARACTER_CREATOR:"character-builder
1-attributes",MUSE:"character-builder-muse",RECREATE:"recreate",REFINE:"refine",SCENE_BUILDER:"scene-builder",ANGLES:"angles",VIDEO_EDITOR:"video-editor",VIDEO_FACE_SWAP:"video-face-swap",VIDEO_CHARACTER_SWAP:"video-character-swap",LIPSYNC:"lipsync",MUSIC_VIDEO:"music-video"};var n=function(e){return e.ENHANCE="enhance",e.EDIT="edit",e.SWAP="swap",e.CREATE="create",e.VIDEO="video",e}({});let o={enhance:"Enhance",edit:"Edit",swap:"Swap",create:"Create",video:"Video"},s=Object.values(n),l={app:"image_enhancer",category:"enhance",slug:a.IMAGE_ENHANCER,title:"Image Enhancer",description:"Upscale and refine any image to higher quality",seoDescription:"Upscale and refine any image with AI. Supports up to 6K resolution with enhanced detail and quality.",image:"/enhancer/enhancer-1.jpeg",href:"/apps/".concat(a.IMAGE_ENHANCER),acceptsMediaTypes:["image"]},c={app:"video_enhancer",category:"enhance",slug:a.VIDEO_ENHANCER,title:"Video Enhancer",description:"Upscale and refine any video to higher quality",seoDescription:"Upscale and refine any video with AI. Supports up to 1080p resolution with enhanced detail.",image:"/enhancer/enhancer-2.jpeg",href:"/apps/".concat(a.VIDEO_ENHANCER),acceptsMediaTypes:["video"]},d={app:"skin_enhancer",category:"enhance",slug:a.SKIN_ENHANCER,title:"Skin Enhancer",description:"Enhance skin texture and detail in any portrait",seoDescription:"Enhance skin texture and detail in portraits with AI for natural, high-quality results.",image:"/enhancer/skin-enhancer.jpeg",href:"/apps/".concat(a.SKIN_ENHANCER),acceptsMediaTypes:["image"]},u={app:"face_swap",category:"swap",slug:a.FACE_SWAP,title:"Face Swap",description:"Swap faces between two images seamlessly",seoDescription:"Swap faces between two images seamlessly with AI-powered face detection and blending.",image:"/enhancer/face-swap.jpeg",href:"/apps/".concat(a.FACE_SWAP),acceptsMediaTypes:["image"]},p={app:"inpaint",category:"edit",slug:a.INPAINT,title:"Inpaint",description:"Edit specific areas of any image with a mask and prompt",seoDescription:"Edit specific areas of any image with a mask and prompt. Paint over the region you want to change and describe what should replace it.",image:"/enhancer/inpaint.jpeg",href:"/apps/".concat(a.INPAINT),acceptsMediaTypes:["image"]},m={app:"character_swap",category:"swap",slug:a.CHARACTER_SWAP,title:"Character Swap",description:"Replace an entire character while preserving the original scene",seoDescription:"Replace an entire character in an image while preserving the scene, powered by AI.",image:"/enhancer/char-swap.jpeg",href:"/apps/".concat(a.CHARACTER_SWAP),acceptsMediaTypes:["image"]},g={app:"outfit_swap",category:"swap",slug:a.OUTFIT_SWAP,title:"Outfit Swap",description:"Swap an outfit onto a subject while preserving the person",seoDescription:"Swap clothing, footwear, and accessories onto a subject while preserving the person and scene.",image:"/enhancer/outfit-swap.jpeg",href:"/apps/".concat(a.OUTFIT_SWAP),acceptsMediaTypes:["image"]},h={app:"relight",category:"edit",slug:a.RELIGHT,title:"Relight",description:"Change the lighting direction and mood of any image",seoDescription:"Change the lighting direction, intensity, and mood of any photo with AI. Cinematic lighting in one click.",image:"/enhancer/relight.jpeg",href:"/apps/".concat(a.RELIGHT),acceptsMediaTypes:["image"]},f={app:"character_creator",category:"create",slug:a.CHARACTER_CREATOR,title:"Character Builder: Attributes",description:"Create unique AI characters from preset attributes",seoDescription:"Create unique AI characters from preset attributes — appearance, style, mood, and setting — and reuse them across image and video generations.",image:"/character-creator/thumb.jpeg",href:"/apps/".concat(a.CHARACTER_CREATOR),acceptsMediaTypes:[]},v={app:"muse",category:"create",slug:a.MUSE,title:"Character Builder: Muse",description:"Explore and refine unique AI characters from starter images",seoDescription:"Build one-of-a-kind AI characters by exploring references and starter images.",image:"/enhancer/muse.jpeg",href:"/apps/".concat(a.MUSE),acceptsMediaTypes:[]},_={app:"recreate",category:"create",slug:a.RECREATE,title:"Recreate",description:"Browse and recreate from a wide range of references",seoDescription:"Browse and recreate from a wide range of references.",image:"/enhancer/recreate.jpeg",href:"/apps/".concat(a.RECREATE),acceptsMediaTypes:[]},y={app:"refine",category:"edit",slug:a.REFINE,title:"Refine",description:"Make focused improvements to any image with a prompt",seoDescription:"Make focused improvements to any image with preset prompts or your own refinement instructions.",image:"/enhancer/refine.jpeg",href:"/apps/".concat(a.REFINE),acceptsMediaTypes:["image"]},b={app:"scene_builder",category:"video",slug:a.SCENE_BUILDER,title:"Scene Builder",description:"Easily build video scenes with two characters",seoDescription:"Build a two-character video scene from character images, presets, and custom prompts.",image:"/enhancer/scene-builder.jpeg",href:"/apps/".concat(a.SCENE_BUILDER),acceptsMediaTypes:["image"]},A={app:"angles",category:"edit",slug:a.ANGLES,title:"Angles",description:"View any image from a new camera angle",seoDescription:"View any image from a new camera angle. Pick an elevation and orientation to regenerate the same scene from a different viewpoint in one click.",image:"/enhancer/angles.jpeg",href:"/apps/".concat(a.ANGLES),acceptsMediaTypes:["image"]},S={app:"video_editor",category:"video",slug:a.VIDEO_EDITOR,title:"Video Editor",description:"Edit any video with a prompt and reference images",seoDescription:"Edit any video with a prompt and reference images. Describe the change and it is applied across every frame while preserving the original motion and composition.",image:"/enhancer/video-editor.jpeg",href:"/apps/".concat(a.VIDEO_EDITOR),acceptsMediaTypes:["video"]},x={app:"video_face_swap",category:"swap",slug:a.VIDEO_FACE_SWAP,title:"Video Face Swap",description:"Swap a face into any video seamlessly",seoDescription:"Swap a face into any video seamlessly. The new identity is applied to every frame while preserving the original pose, motion, expressions, and lip movements.",image:"/enhancer/video-face-swap.jpeg",href:"/apps/".concat(a.VIDEO_FACE_SWAP),acceptsMediaTypes:["video"]},R={app:"video_character_swap",category:"swap",slug:a.VIDEO_CHARACTER_SWAP,title:"Video Character Swap",description:"Swap an entire character into any video seamlessly",seoDescription:"Swap an entire character — face, outfit, and body — into any video while preserving the original motion, camera, and background.",image:"/enhancer/video-character-swap.jpeg",href:"/apps/".concat(a.VIDEO_CHARACTER_SWAP),acceptsMediaTypes:["video"]},I={app:"lipsync",category:"video",slug:a.LIPSYNC,title:"Lipsync",description:"Make any subject speak an audio clip from a single image",seoDescription:"Make any subject speak an audio clip from a single image. Lip movements sync to the audio with natural expressions, powered by Plum, Cherry, or Blueberry.",image:"/enhancer/lipsync.jpeg",href:"/apps/".concat(a.LIPSYNC),acceptsMediaTypes:["image"]},C={app:"music_video",category:"video",slug:a.MUSIC_VIDEO,title:"Music Video",description:"Make your characters perform a music video to any track",seoDescription:"Make your characters perform a music video to any audio track. Performers sing and dance in sync with the music with cinematic camera work, powered by Plum or Cherry.",image:"/enhancer/music-video.jpeg",href:"/apps/".concat(a.MUSIC_VIDEO),acceptsMediaTypes:["image"]},w=[l,c,S,x,R,I,C,d,u,p,m,g,h,f,v,_,y,b,A],E=new Set([u,x,R,p].map(e=>e.app));function P(e){return E.has(e)}let T=[u,x,R,p,v,y,l,c,S,I,C,g,m,b,d,f,h,A];function M(e){return w.find(t=>t.app===e)}},68541:(e,t,r)=>{"use strict";r.d(t,{Qg:()=>n,ZL:()=>i,dh:()=>l,hc:()=>a,hz:()=>o,vp:()=>s});var i=function(e){return e.NUDITY="nudity",e.SEXUAL="sexual",e.VIOLENCE="violence",e.SUGGESTIVE="suggestive",e.MINORS="minors",e.NSFW="nsfw",e.TABOO="taboo",e.CELEB="celeb",e}({});let a=[["nudity"],["sexual"],["violence"],["suggestive"],["nsfw"],["taboo"]],n=[["minors","nudity"],["minors","suggestive"],["minors","sexual"],["celeb","nudity"],["celeb","sexual"]];a.flat().filter(e=>"suggestive"!==e);let o=.8,s={yes_female_nudity:{concept:"nudity",threshold:.5},yes_male_nudity:{concept:"nudity",threshold:.5},yes_breast:{concept:"nudity",threshold:.5},yes_genitals:{concept:"nudity",threshold:.5},yes_sexual_activity:{concept:"sexual",threshold:.5},yes_sex_toy:{concept:"sexual",threshold:.8},yes_sexual_intent:{concept:"sexual",threshold:.5},very_bloody:{concept:"violence",threshold:.8},hanging:{concept:"violence",threshold:.8}
1,animated_corpse:{concept:"violence",threshold:.8},human_corpse:{concept:"violence",threshold:.8},yes_self_harm:{concept:"violence",threshold:.8},general_suggestive:{concept:"suggestive",threshold:.5},yes_male_shirtless:{concept:"suggestive",threshold:.8},yes_female_swimwear:{concept:"suggestive",threshold:.8},yes_male_underwear:{concept:"suggestive",threshold:.5},yes_female_underwear:{concept:"suggestive",threshold:.5},yes_bulge:{concept:"suggestive",threshold:.8},yes_bodysuit:{concept:"suggestive",threshold:.8},yes_undressed:{concept:"suggestive",threshold:.5},yes_bra:{concept:"suggestive",threshold:.8},yes_sports_bra:{concept:"suggestive",threshold:.8},yes_panties:{concept:"suggestive",threshold:.5},licking:{concept:"suggestive",threshold:.5},yes_butt:{concept:"suggestive",threshold:.5},yes_child_present:{concept:"minors",threshold:.8},general_nsfw:{concept:"nsfw",threshold:.5},yes_pills:{concept:"nsfw",threshold:.8},illicit_injectables:{concept:"nsfw",threshold:.8},yes_middle_finger:{concept:"nsfw",threshold:.8},yes_marijuana:{concept:"nsfw",threshold:.8},noose:{concept:"nsfw",threshold:.8},yes_emaciated_body:{concept:"nsfw",threshold:.8},yes_nazi:{concept:"nsfw",threshold:.8},yes_kkk:{concept:"nsfw",threshold:.8},yes_terrorist:{concept:"nsfw",threshold:.8},yes_animal_abuse:{concept:"nsfw",threshold:.8},animal_genitalia_and_human:{concept:"taboo",threshold:.8},animal_genitalia_only:{concept:"taboo",threshold:.8},animated_animal_genitalia:{concept:"taboo",threshold:.8},other_blood:{concept:"violence",threshold:.9}},l={yes_female_nudity:{concept:"nudity",threshold:.8},yes_male_nudity:{concept:"nudity",threshold:.8},yes_breast:{concept:"nudity",threshold:.8},yes_genitals:{concept:"nudity",threshold:.8},yes_sexual_activity:{concept:"sexual",threshold:.8},yes_sex_toy:{concept:"sexual",threshold:.8},yes_sexual_intent:{concept:"sexual",threshold:.8},general_suggestive:{concept:"suggestive",threshold:.8},yes_male_shirtless:{concept:"suggestive",threshold:.8},yes_female_swimwear:{concept:"suggestive",threshold:.8},yes_male_underwear:{concept:"suggestive",threshold:.8},yes_female_underwear:{concept:"suggestive",threshold:.8},yes_bulge:{concept:"suggestive",threshold:.8},yes_bodysuit:{concept:"suggestive",threshold:.8},yes_undressed:{concept:"suggestive",threshold:.8},yes_bra:{concept:"suggestive",threshold:.8},yes_sports_bra:{concept:"suggestive",threshold:.8},yes_panties:{concept:"suggestive",threshold:.8},licking:{concept:"suggestive",threshold:.8},yes_butt:{concept:"suggestive",threshold:.8},yes_child_present:{concept:"minors",threshold:.8}}},68664:(e,t,r)=>{"use strict";r.d(t,{uo:()=>I,Bw:()=>E,eN:()=>C});var i=r(95155),a=r(8399),n=r(94055),o=r(77567),s=r(36052),l=r(20711),c=r(84989),d=r(36848);let u=(e,t)=>Object.fromEntries(Object.entries(e).filter(e=>{let[r]=e;return!t.includes(r)}));var p=r(20668),m=r(66610),g=r(88551),h=r(66766),f=r(12115),v=r(85541),_=r(44134).hp;let y=e=>e.startsWith("/")?e.slice(1):e,b=[50,100,150,200,300,400,500,700,1e3],A=e=>{for(let t of b)if(t>=e)return t;return null},S=[50,100,150,200,300,400,500,700,1e3],x=e=>{for(let t of S)if(t>=e)return t;return null},R=e=>_.from(e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");function I(e){let[t,r]=(0,f.useState)(!1),{ref:a,hasEnteredViewport:o}=(0,s.I)({rootMargin:n.sd});return"".concat(e.src).endsWith(".mp4")?(0,i.jsx)("video",{ref:a,src:o?"".concat(e.src):void 0,onCanPlay:e=>{e.target.style.opacity=1},style:{opacity:0,transition:"opacity 0.2s ease",WebkitTransition:"opacity 0.2s ease",OTransition:"opacity 0.2s ease",MozTransition:"opacity 0.2s ease",willChange:"opacity"},autoPlay:!0,loop:!0,muted:!0,playsInline:!0,disablePictureInPicture:!0,...Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return!t.includes("src")})),children:"Your browser does not support video"}):(0,i.jsx)(h.default,{ref:a,className:"MageImage",style:{opacity:0,transition:"opacity 0.5s ease",WebkitTransition:"opacity 0.5s ease",OTransition:"opacity 0.5s ease",MozTransition:"opacity 0.5s ease",willChange:"opacity",height:"auto",...e.style},loading:"eager",src:o?e.src:n.ww,alt:"Base media image",loader:e=>{let{src:t,width:r}=e,i="dpr:".concat(n.u8,"/width:").concat(A(r));return"https://resize.mage.space/plain/".concat(i,"/").concat(R(y(t)),".webp")},unoptimized:t,onError:()=>r(!0),onLoad:e=>{0>e.target.src.indexOf("data:image/gif;base64")&&(e.target.style.opacity="1")},...u(e,["src","style"])})}function C(e,t,r){if(void 0===e)return;if(void 0===t&&void 0===r||e.endsWith(".mp4"))return e;let i=["dpr:".concat(n.u8)];void 0!==t&&i.push("width:".concat(A(t))),void 0!==r&&i.push("height:".concat(x(r)));let a=i.join("/");return"https://resize.mage.space/plain/".concat(a,"/").concat(R(y(e)),".webp")}let w=(0,f.forwardRef)((e,t)=>{let r=(0,f.useId)(),a=(()=>{var t,r,i;let a;if(!e.optimize)return e.src;let n="number"==typeof(null===(t=e.style)||void 0===t?void 0:t.width)?e.style.width:e.src_max_width;return"number"==typeof(null===(r=e.style)||void 0===r?void 0:r.height)?a=e.style.height:"number"==typeof(null===(i=e.style)||void 0===i?void 0:i.maxHeight)&&(a=e.style.maxHeight),C(e.src,n,a)})(),n=function(){let[e,t]=(0,f.useState)(!1),r=(0,f.useRef)(null);return{ref:(0,f.useCallback)(e=>{var i;if(null===(i=r.current)||void 0===i||i.disconnect(),r.current=null,!e||"undefined"==typeof IntersectionObserver){t(!1);return}let a=new IntersectionObserver(e=>{t(e[e.length-1].isIntersecting)});a.observe(e),r.current=a},[]),inViewport:e}}(),s=(0,l.t)(a||""),{ref:c,hovered:u}=(0,m.useHover)(),[p,h]=(0,f.useState)(null),{unmutedAudioId:_,setUnmutedAudioId:y}=(0,o.VT)("unmutedAudioId","setUnmutedAudioId"),b=_!==r,A=(0,f.useRef)(null),S=null!=t?t:A,x=(0,g.useMergedRef)(n.ref,s,S);(0,f.useEffect)(()=>{h(null)},[a]),(0,f.useEffect)(()=>
1{if(null==S?void 0:S.current){if(e.paused){S.current.pause();return}e.isFullscreen||n.inViewport?S.current.play().catch(()=>void 0):(S.current.pause(),S.current.currentTime=0,_===r&&y(null))}},[n.inViewport,e.isFullscreen,e.paused]),(0,f.useEffect)(()=>{(null==S?void 0:S.current)&&(S.current.muted=b)},[b]),(0,f.useEffect)(()=>{!1===p&&_===r&&y(null)},[r,p,y,_]);let{position:R,top:I,left:w,right:E,bottom:P,...T}=e.style||{},M={position:R||"relative",...void 0!==I&&{top:I},...void 0!==w&&{left:w},...void 0!==E&&{right:E},...void 0!==P&&{bottom:P}};return(0,i.jsxs)("div",{className:"MageMediaVideo",style:M,ref:c,children:[(0,i.jsx)("video",{ref:x,onLoadedMetadata:e=>{h((0,d.F)(e.currentTarget))},onCanPlay:t=>{var r;h((0,d.F)(t.currentTarget)),e.paused?t.currentTarget.pause():(e.isFullscreen||n.inViewport)&&t.currentTarget.play().catch(()=>void 0),null===(r=e.onLoad)||void 0===r||r.call(e,t)},onTimeUpdate:e=>{!0!==p&&e.currentTarget.currentTime>.05&&h((0,d.F)(e.currentTarget))},style:T,autoPlay:e.isFullscreen&&!e.paused,loop:!1!==e.loop,muted:b,preload:"metadata",playsInline:!0,disablePictureInPicture:!0,children:"Your browser does not support video"}),(0,i.jsx)(v.Z,{audioId:r,hasAudio:p,isFullscreen:e.isFullscreen,isHovered:u})]})}),E=(0,f.forwardRef)((e,t)=>{var r,n;let o=(()=>{var t,r,i;let a;if(!e.optimize)return e.src;let n="number"==typeof(null===(t=e.style)||void 0===t?void 0:t.width)?e.style.width:e.src_max_width;return"number"==typeof(null===(r=e.style)||void 0===r?void 0:r.height)?a=e.style.height:"number"==typeof(null===(i=e.style)||void 0===i?void 0:i.maxHeight)&&(a=e.style.maxHeight),C(e.src,n,a)})(),s=(0,l.v)(o||""),d=(0,g.useMergedRef)(t,s);if("video"===e.mediaType||(null===(r=e.src)||void 0===r?void 0:r.endsWith(".mp4")))return(0,i.jsx)(w,{...e,ref:t});if("audio"===e.mediaType||(0,a.W)(e.src)){let{prompt:t}=(0,c.o4)(e.architectureConfig);return(0,i.jsx)(a.U,{src:null!==(n=e.src)&&void 0!==n?n:"",variant:e.isFullscreen?"fullscreen":"card",prompt:t})}return(0,i.jsx)("img",{className:"MageMedia-image",ref:d,alt:"Mage media",style:{...e.style},...(0,p.W2)(e.src?{url:e.src,mediaType:"image"}:null),onLoad:t=>{var r;null===(r=e.onLoad)||void 0===r||r.call(e,t)}})});E.displayName="MageMedia"},68758:(e,t,r)=>{"use strict";r.d(t,{Hv:()=>n,Qd:()=>o,c3:()=>a});var i=r(4717);function a(e){switch(e){case i.vW.SQUARE:return 1;case i.vW.ULTRAWIDE:return 21/9;case i.vW.ULTRATALL:return 9/21;case i.vW.CINEMA:return 16/9;case i.vW.PHONE:return 9/16;case i.vW.LANDSCAPE:return 1.5;case i.vW.TABLET:return 2/3;case i.vW.COMPUTER:return 5/4;case i.vW.PORTRAIT:return .8;default:return 1}}function n(e){switch(e){case i.vW.SQUARE:return"1:1";case i.vW.ULTRAWIDE:return"21:9";case i.vW.ULTRATALL:return"9:21";case i.vW.CINEMA:return"16:9";case i.vW.PHONE:return"9:16";case i.vW.LANDSCAPE:return"3:2";case i.vW.TABLET:return"2:3";case i.vW.COMPUTER:return"5:4";case i.vW.PORTRAIT:return"4:5";default:return"Unknown"}}function o(e,t){let r=e/t,n=Math.abs(r-1),o=i.vW.SQUARE;return[i.vW.ULTRAWIDE,i.vW.CINEMA,i.vW.LANDSCAPE,i.vW.COMPUTER,i.vW.SQUARE,i.vW.PORTRAIT,i.vW.TABLET,i.vW.PHONE,i.vW.ULTRATALL].forEach(e=>{let t=Math.abs(r-a(e));t<n&&(n=t,o=e)}),o}},68844:(e,t,r)=>{"use strict";r.d(t,{K:()=>m});var i=r(95155),a=r(67457),n=r(61282),o=r(77567),s=r(41441),l=r(16791),c=r(96089),d=r(12115),u=r(23552),p=r(42840);function m(e){let{style:t,buttonText:r}=e,[m,g]=(0,d.useState)(!1),{userMembership:h,user:f}=(0,o.xV)((0,u.k)(e=>({userMembership:e.userMembership,user:e.user}))),v=h===n.c.BASIC,_=(0,a.Ou)(n.c.BASIC);return(0,i.jsx)(p.M,{title:_.title,price:_.monthlyPriceUsd,features:_.features,isCurrentPlan:v,onSelect:()=>{(0,c.M3)()&&f&&(h===n.c.FREE?(g(!0),(0,s.m)(n.c.BASIC).then(e=>{window.location.assign(e)}).catch(e=>{g(!1),console.error("Error checking out",e),(0,l.p6)({title:"Checkout Issue",message:"We had an issue redirecting you. Try again?"})})):h===n.c.BASIC?(0,l.bA)({title:"Already Subscribed!",message:"You are already a Basic member. Congrats!"}):(g(!0),(0,s.e)().then(e=>{window.location.assign(e)}).catch(e=>{g(!1),console.error("Error redirection to portal",e),(0,l.p6)({title:"Checkout Issue",message:"We had an issue redirecting you. Try again?"})})))},loading:m,style:t,buttonText:r})}},69267:(e,t,r)=>{"use strict";r.d(t,{P:()=>o,k:()=>s});var i=r(58779),a=r(77567),n=r(11875);function o(e,t){if(!e)return!1;let r=(0,n.eu)(e);return!!r.is_forbidden||!(0,i.zk)(t)&&(0,n.Gn)(r,t)}function s(){let e=a.xV.getState();return o(e.playAppCreations.at(e.playAppViewIndex),e.settings.content_settings)}},71570:(e,t,r)=>{"use strict";r.d(t,{gj:()=>X,K9:()=>Q,Nf:()=>Z,tT:()=>$});var i=r(95155),a=r(65023),n=r(57635),o=r(12630),s=r(37780),l=r(50894),c=r(33948),d=r(20696),u=r(57413),p=r(34477);let m=(0,p.createServerReference)("40ca6359bbc6308498c361aff0156ccdccdd00f6d0",p.callServer,void 0,p.findSourceMapURL,"createReference"),g=(0,p.createServerReference)("602113a7d2b2516ae187b17baa21a92938498a1d92",p.callServer,void 0,p.findSourceMapURL,"updateReference");var h=r(77567),f=r(52220),v=r(64428),_=r(54297),y=r(89720),b=r(7963),A=r(16791),S=r(18403),x=r(21220),R=r(70112),I=r(93751),C=r(95642),w=r(11352),E=r(69604),P=r(49077),T=r(56231),M=r(8141),k=r(83347),O
1=r(26903),D=r(8593),U=r(58887),N=r(41954),H=r(840),j=r(15763),L=r(91423),G=r(38280),q=r(31951),B=r(62372),F=r(30699),V=r(54395),K=r(35695),z=r(12115),W=r(23552);let X=["realistic","fantasy","sci-fi","cartoon","anime","nature","urban","interior","product"];function Y(e){var t,r,p,b,Y,Z,Q,$,J;let{mode:ee,reference:et,defaultType:er,audioOnly:ei,onSuccess:ea,onUpdated:en}=e,eo=(0,K.useRouter)(),{user:es,isDesktop:el,addRecentReference:ec,updateRecentReference:ed}=(0,h.xV)((0,W.k)(e=>({user:e.user,isDesktop:e.isDesktop,addRecentReference:e.addRecentReference,updateRecentReference:e.updateRecentReference}))),eu="edit"===ee,ep=null!==(t=null==et?void 0:et.modality)&&void 0!==t?t:ei?"audio":"image",em=(null==et?void 0:et.modality)==="image"?et.variant:null!=er?er:"object",[eg,eh]=(0,z.useState)(null!==(r=null==et?void 0:et.image_url)&&void 0!==r?r:null),[ef,ev]=(0,z.useState)(null!==(p=null==et?void 0:et.audio_url)&&void 0!==p?p:null),[e_,ey]=(0,z.useState)(null!==(b=null==et?void 0:et.name)&&void 0!==b?b:""),[eb,eA]=(0,z.useState)(null!==(Y=null==et?void 0:et.description)&&void 0!==Y?Y:""),[eS,ex]=(0,z.useState)(null!==(Z=null==et?void 0:et.tags)&&void 0!==Z?Z:[]),[eR,eI]=(0,z.useState)(ep),[eC,ew]=(0,z.useState)(em),[eE,eP]=(0,z.useState)("audio"===ep?"private":null!==(Q=null==et?void 0:et.visibility)&&void 0!==Q?Q:"private"),[eT,eM]=(0,z.useState)(!0),[ek,eO]=(0,z.useState)(!1),[eD,eU]=(0,z.useState)(!1),[eN,eH]=(0,z.useState)(!1),[ej,eL]=(0,z.useState)(!1),{username:eG,usernameValidation:eq,usernameError:eB,isCheckingUsername:eF,isUsernameAvailable:eV,handleUsernameChange:eK}=(0,s.v)({name:e_,isEditMode:eu,initialUsername:null!==($=null==et?void 0:et.username)&&void 0!==$?$:""}),ez=(0,z.useRef)(null),eW=async e=>{if(!es)return;eO(!0);let t=URL.createObjectURL(e);try{let e=await (0,_.K)(t,es.uid,"reference");eh(e)}catch(e){(0,A.p6)({title:"Upload Failed",message:"Failed to upload image. Please try again."})}finally{URL.revokeObjectURL(t),eO(!1)}},eX=()=>eL(!0),eY=async()=>{eu?await eQ():await eZ()},eZ=async()=>{let e="audio"===eR,t=e?"private":eE,r=e?ef:eg;if(es&&r&&e_.trim()&&eG.trim()){if(!eq.valid){var i;(0,A.p6)({title:"Invalid Username",message:null!==(i=eq.error)&&void 0!==i?i:"Please enter a valid username"});return}if(!1===eV){(0,A.p6)({title:"Username Taken",message:"This username is already taken. Please choose another."});return}eH(!0);try{let r=eg;if(!e&&eg&&(r=await (0,_.K)(eg,es.uid,"reference"),eh(r)),"public"===t&&r){let e=await (0,u._)(r);if((0,y.u)(e.payload).is_forbidden_for_social){(0,A.p6)({title:"Moderation Failed",message:"Your reference image includes explicit NSFW content. Set visibility to private or use a different image."}),eH(!1);return}}let i=await m({name:e_.trim(),username:eG.trim(),image_url:e?null:r,audio_url:e?ef:null,modality:eR,variant:e?"audio":eC,description:eb.trim()||null,tags:eS,visibility:t,moderation:[]});if(i){(0,f.r)("reference_created",{reference_id:i.id,modality:eR,variant:e?"audio":eC,visibility:t}),ec(i),(0,A.wB)({title:"Reference Created",message:"".concat(e_.trim()," has been created successfully.")}),(0,L.s7)();let r=Math.random().toString(36).substring(2,10);"audio"===eR?eo.push("/audio?refreshKey=".concat(r)):eo.push("/references/".concat(eC,"s?refreshKey=").concat(r)),null==ea||ea()}else(0,A.p6)({title:"Creation Failed",message:"Failed to create reference. Please try again."})}catch(t){let e=t instanceof Error?t.message:"Failed to create reference";(0,A.p6)({title:"Creation Failed",message:e})}finally{eH(!1)}}},eQ=async()=>{if(!et||!e_.trim())return;let e="audio"===et.modality?"private":eE;eH(!0);try{if("public"===e&&"public"!==et.visibility&&et.image_url){let e=await (0,u._)(et.image_url);if((0,y.u)(e.payload).is_forbidden_for_social){(0,A.p6)({title:"Moderation Failed",message:"Your reference image includes explicit NSFW content. Keep visibility private or use a different image."}),eH(!1);return}}let t=await g(et.id,{name:e_.trim(),description:eb.trim()||null,tags:eS,visibility:e});ed(t),(0,A.wB)({title:"Reference Updated",message:"".concat(e_.trim()," has been updated successfully.")}),null==en||en(t),(0,L.s7)()}catch(t){let e=t instanceof Error?t.message:"Failed to update reference";(0,A.p6)({title:"Update Failed",message:e})}finally{eH(!1)}},e$=ek||eD||eN,eJ="audio"===eR,e0="New Reference";eu?e0="Edit Reference":ei&&(e0="New Audio");let e1=eJ?ef:eg,e2=eu?e_.trim()&&!e$:e1&&e_.trim()&&eG.trim()&&eq.valid&&!0===eV&&(eu||eT)&&!e$;return ej?(0,i.jsx)(c.n,{onSelect:async e=>{if(!es)return!1;eL(!1),eO(!0);
1try{let t=await (0,_.K)(e,es.uid,"reference");eh(t)}catch(e){(0,A.p6)({title:"Upload Failed",message:"Failed to process image. Please try again."})}finally{eO(!1)}return!0},onClose:()=>eL(!1),filterType:"image"}):(0,i.jsx)(S.Card,{bg:"dark.9",radius:"lg",p:"lg",children:(0,i.jsxs)(x.Stack,{gap:"md",children:[(0,i.jsxs)(R.Group,{justify:"space-between",children:[(0,i.jsx)(I.Title,{order:4,c:"white",children:e0}),(0,i.jsx)(C.CloseButton,{onClick:()=>(0,L.s7)(),c:"white"})]}),!eu&&!ei&&(0,i.jsx)(w.SegmentedControl,{value:eC,onChange:e=>{eI("image"),ew(e)},data:[{label:"Object",value:"object"},{label:"Location",value:"location"},{label:"Pose",value:"pose"},{label:"Outfit",value:"outfit"}],disabled:e$,fullWidth:!0}),(0,i.jsx)("input",{ref:ez,type:"file",accept:"image/*",style:{display:"none"},onChange:e=>{var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];r&&eW(r),e.target.value=""}}),eJ?(0,i.jsx)(l.Y,{audioUrl:ef,onAudioUrlChange:ev,disabled:eN,onUploadingChange:eU,label:"Audio Reference",hint:"Drop an mp3 or wav file",allowReplace:!eu}):eu?(0,i.jsx)(E.Box,{pos:"relative",w:300,h:300,mx:"auto",children:(0,i.jsx)(P.Image,{src:eg,w:300,h:300,radius:"md",fit:"cover"})}):eg?(0,i.jsxs)(E.Box,{pos:"relative",w:300,h:300,mx:"auto",children:[(0,i.jsx)(P.Image,{src:eg,w:300,h:300,radius:"md",fit:"cover"}),ek&&(0,i.jsx)(T.Overlay,{color:"dark.9",backgroundOpacity:.7,blur:4,radius:"md",children:(0,i.jsx)(M.Center,{h:"100%",children:(0,i.jsx)(k.Loader,{size:"md",color:"blue"})})}),(0,i.jsx)(R.Group,{pos:"absolute",bottom:8,w:"100%",justify:"center",children:(0,i.jsx)(O.Button,{size:"xs",variant:"light",color:"gray",radius:"xl",disabled:ek,onClick:()=>eh(null),style:{backdropFilter:"blur(8px)",backgroundColor:"rgba(0, 0, 0, 0.5)"},children:"Replace"})})]}):(0,i.jsx)(d.B,{onFilesDropped:e=>{e[0]&&eW(e[0])},children:e=>{let{isDragging:t,dragProps:r}=e;return(0,i.jsx)(a.e,{aspectRatio:"1 / 1",label:"Reference Image",hint:"Upload a clear reference image",isDragging:t,dragProps:r,isUploading:ek,disabled:e$,actions:[{key:"upload",label:"Upload",icon:(0,i.jsx)(G.A,{size:16}),onClick:()=>{var e;return null===(e=ez.current)||void 0===e?void 0:e.click()},disabled:e$},{key:"select-creation",label:"Select creation",icon:(0,i.jsx)(q.A,{size:16}),onClick:eX,disabled:e$}]})}}),eu?(0,i.jsx)(D.TextInput,{value:null!==(J=null==et?void 0:et.username)&&void 0!==J?J:"",disabled:!0,leftSection:(0,i.jsx)(B.A,{size:16}),styles:{input:{backgroundColor:"var(--mantine-color-dark-8)",border:"none",color:"var(--mantine-color-dimmed)"}},size:el?"lg":"md",radius:"md"}):e_.trim()?(0,i.jsxs)(x.Stack,{gap:"xs",children:[(0,i.jsx)(D.TextInput,{placeholder:"username",value:eG,onChange:e=>eK(e.currentTarget.value),maxLength:v.d0,disabled:e$,leftSection:(0,i.jsx)(B.A,{size:16}),rightSection:0===eG.length?null:eF?(0,i.jsx)(k.Loader,{size:"xs"}):!0===eV?(0,i.jsx)(F.A,{size:16,color:"var(--mantine-color-green-6)"}):!1===eV?(0,i.jsx)(V.A,{size:16,color:"var(--mantine-color-red-6)"}):null,styles:{input:{backgroundColor:"var(--mantine-color-dark-7)",border:eB?"1px solid var(--mantine-color-red-6)":"none"}},size:el?"lg":"md",radius:"md"}),(0,i.jsx)(U.Text,{c:"dimmed",size:"xs",ta:"center",children:eB||"".concat(v.D6,"-").concat(v.d0," characters, letters, numbers, dashes, and underscores only")})]}):(0,i.jsx)(D.TextInput,{placeholder:"Start typing a name first",value:"",disabled:!0,leftSection:(0,i.jsx)(B.A,{size:16}),styles:{input:{backgroundColor:"var(--mantine-color-dark-8)",border:"none",color:"var(--mantine-color-dimmed)"}},size:el?"lg":"md",radius:"md"}),(0,i.jsx)(D.TextInput,{placeholder:"Reference Name",value:e_,onChange:e=>ey(e.currentTarget.value),maxLength:50,disabled:e$,styles:{input:{backgroundColor:"var(--mantine-color-dark-7)",border:"none"}},size:el?"lg":"md",radius:"md"}),(0,i.jsx)(N.Textarea,{placeholder:"Add a description (optional)",value:eb,onChange:e=>eA(e.currentTarget.value),maxLength:500,disabled:e$,minRows:3,maxRows:5,styles:{input:{backgroundColor:"var(--mantine-color-dark-7)",border:"none"}},size:el?"md":"sm",radius:"md"}),eb.length>0&&(0,i.jsxs)(U.Text,{c:"dimmed",size:"xs",ta:"right",mt:-8,children:[eb.length,"/",500]}),(0,i.jsx)(H.TagsInput,{placeholder:"Add tags (optional)",value:e
1S,onChange:ex,data:X,disabled:e$,styles:{input:{backgroundColor:"var(--mantine-color-dark-7)",border:"none"},pill:{backgroundColor:"var(--mantine-color-dark-9)"},dropdown:{zIndex:12001}},size:el?"md":"sm",radius:"md"}),!eJ&&(0,i.jsx)(j.Select,{value:eE,onChange:e=>eP(null!=e?e:"private"),data:[{value:"private",label:"Private - Only you can see"},{value:"public",label:"Public - Anyone can see"}],disabled:e$,allowDeselect:!1,styles:{input:{backgroundColor:"var(--mantine-color-dark-7)",border:"none"},dropdown:{zIndex:12001}},size:el?"md":"sm",radius:"md"}),!eu&&(0,i.jsx)(o.i,{checked:eT,onChange:eM,disabled:e$}),eu?(0,i.jsxs)(R.Group,{grow:!0,children:[(0,i.jsx)(O.Button,{variant:"subtle",color:"gray",onClick:()=>(0,L.s7)(),disabled:e$,size:el?"lg":"md",children:"Cancel"}),(0,i.jsx)(O.Button,{disabled:!e2,loading:eN,onClick:eY,size:el?"lg":"md",style:{background:e2?n._8:void 0},c:"black",children:"Save"})]}):(0,i.jsx)(O.Button,{fullWidth:!0,disabled:!e2,loading:eN,onClick:eY,size:el?"lg":"md",style:{background:e2?n._8:void 0},c:"black",children:"Create Now"})]})})}function Z(e,t){(0,b.q)({children:(0,i.jsx)(Y,{mode:"create",defaultType:t,onSuccess:e})})}function Q(e){(0,b.q)({children:(0,i.jsx)(Y,{mode:"create",audioOnly:!0,onSuccess:e})})}function $(e,t){(0,b.q)({children:(0,i.jsx)(Y,{mode:"edit",reference:e,onUpdated:t})})}},71671:(e,t,r)=>{"use strict";r.d(t,{X7:()=>s,dX:()=>o});var i=r(56800),a=r(39358);let n="veo-3-1-lite",o={architecture:i.qH.VEO3_1,model_id:n,prompt:"",custom_aspect_ratio:a.ew.RATIO_16_9,duration:a.BA.DURATION_4S,resolution:a.fK.RES_720P},s={architecture:i.qH.VEO3_1,name:"Veo 3.1 Video",short_name:"Veo 3.1",popularity:0,tags:[i.fZ,i.tM,i.ij],models:[{id:n,name:"Veo 3.1"}],api_path:"/api/v1/veo3_1",agent:{description:"High-quality video model.",defaultConfig:o,options:{resolution:Object.values(a.fK),duration:Object.values(a.BA)},imageInputs:{firstFrame:"image",lastFrame:"last_image"}}}},71849:(e,t,r)=>{"use strict";r.d(t,{Nt:()=>n,Nz:()=>o,Y4:()=>a,tY:()=>i});var i=function(e){return e.RES_720P="720p",e.RES_1080P="1080p",e}({}),a=function(e){return e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_4_3="4:3",e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_3_4="3:4",e.ASPECT_RATIO_9_16="9:16",e}({}),n=function(e){return e.DURATION_2S="2",e.DURATION_3S="3",e.DURATION_4S="4",e.DURATION_5S="5",e.DURATION_6S="6",e.DURATION_7S="7",e.DURATION_8S="8",e.DURATION_9S="9",e.DURATION_10S="10",e.DURATION_11S="11",e.DURATION_12S="12",e.DURATION_13S="13",e.DURATION_14S="14",e.DURATION_15S="15",e}({}),o=function(e){return e.SINGLE="single",e.MULTI="multi",e}({})},71924:(e,t,r)=>{"use strict";r.d(t,{RA:()=>a,Xc:()=>i,eh:()=>n});var i=function(e){return e.RECENT="recent",e.RECOMMENDED="recommended",e.LIKED="liked",e.REMIXED="remixed",e.SHARED="shared",e.REPLIED="replied",e.REPORTED="reported",e}({});let a=()=>({numDays:30,orderBy:"recommended",postedBeforeDate:new Date}),n=4e3},72922:(e,t,r)=>{"use strict";r.d(t,{$H:()=>s,An:()=>l,IJ:()=>o});var i=r(56800),a=r(88061);let n="framepack-f1",o={architecture:i.qH.FRAMEPACK,model_id:n,prompt:"",negative_prompt:"Aerial view, aerial view, overexposed, low quality, deformation, a poor composition, bad hands, bad teeth, bad eyes, bad limbs, distortion",guidance_scale:9,num_inference_steps:15,num_frames:90,base_size:a.k.SIZE_240P,video_length:a.Y.LENGTH_3S};function s(e){switch(e){case a.Y.LENGTH_1S:return 30;case a.Y.LENGTH_2S:return 60;case a.Y.LENGTH_3S:return 90;case a.Y.LENGTH_4S:return 120;case a.Y.LENGTH_5S:return 150;case a.Y.LENGTH_6S:return 180;case a.Y.LENGTH_7S:return 210;case a.Y.LENGTH_8S:return 240;case a.Y.LENGTH_9S:return 270;case a.Y.LENGTH_10S:return 300;default:return 90}}let l={architecture:i.qH.FRAMEPACK,name:"Framepack Image-To-Video",short_name:"Framepack",popularity:3,tags:[i.fZ,i.tM],models:[{id:n,name:"Framepack"}],api_path:"/api/v1/framepack",agent:{description:"Image-to-video model. Requires a start frame image; never pick it without one.",defaultConfig:o,options:{resolution:Object.values(a.k),resolutionField:"base_size",duration:Object.values(a.Y),durationField:"video_length"},imageInputs:{firstFrame:"image",lastFrame:"last_image"}}}},73857:(e,t,r)=>{"use strict";r.d(t,{WK:()=>a,cc:()=>i,j0:()=>n});var i=function(e){return e.RES_480P="480p",e.RES_720P="720p",e}({}),a=function(e){return e.DURATION_5S="5",e.DURATION_10S="10",e}({}),n=function(e){return e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_4_3="4:3",e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_3_4="3:4",e.ASPECT_RATIO_9_16="9:16",e.ASPECT_RATIO_21_9="21:9",e}({})},73883:(e,t,r)=>{"use strict";r.d(t,{RL:()=>d,eF:()=>p,fc:()=>u});var i=r(95155),a=r(67457),n=r(69604),o=r(26029),s=r(58887),l=r(97753),c=r.n(l);
1function d(e){let{children:t,backgroundImage:r,recommendation:o,style:s}=e,l={...s,"--recommendation-accent":null==o?void 0:o.accentColor};return(0,i.jsx)(n.Box,{className:c().cardShell,"data-recommended":!!o||void 0,style:l,children:(0,i.jsx)(n.Box,{className:c().card,style:{backgroundImage:(0,a.OA)(r)},children:t})})}function u(e){let{recommendation:t}=e;return(0,i.jsx)(n.Box,{className:c().recommendationBadgeSlot,children:t?(0,i.jsx)(o.Badge,{variant:"light",color:t.accentColor,size:"lg",radius:"xl",leftSection:t.icon,children:t.label}):null})}function p(e){let{recommendation:t}=e;return(0,i.jsx)(n.Box,{className:c().recommendationDescriptionSlot,children:t?(0,i.jsx)(s.Text,{fz:14,fw:500,lh:1.2,c:"dimmed",children:t.description}):null})}},73904:(e,t,r)=>{"use strict";r.d(t,{S:()=>Y});var i=r(34442),a=r(23446),n=r(21078),o=r(17157),s=r(12920),l=r(56800);let c={architecture:l.qH.ENHANCE,name:"Enhance",short_name:"Enhance",popularity:0,tags:[l.R$,l.Mn,l.yu],api_path:"/api/v1/enhance",agent:null};var d=r(60535),u=r(37463),p=r(6379),m=r(72922),g=r(10140),h=r(9057),f=r(57411),v=r(412),_=r(60608),y=r(56650),b=r(80596),A=r(86819),S=r(25618),x=r(29728),R=r(63015),I=r(58649),C=r(59791),w=r(13421),E=r(40350),P=r(44442),T=r(83880),M=r(76017),k=r(3267),O=r(93772);let D={architecture:l.qH.REFINE,name:"Refine",short_name:"Refine",popularity:0,tags:[l.R$,l.Mn,l.yu],api_path:"/api/v1/refine",agent:null};var U=r(20666),N=r(30458),H=r(55625),j=r(14994),L=r(91788),G=r(88970),q=r(31760),B=r(43258),F=r(88266),V=r(38975),K=r(71671),z=r(41152),W=r(20835),X=r(4334);let Y=[x.U0,b.OW,I.F1,X.uO,F.ey,y.OR,E.qQ,n.S_,W.al,z._T,u.fK,d.jL,s.IH,w.xw,M.TO,k.Fk,_.oG,m.An,S.eC,j.Wn,G._D,q.s1,B.UR,V.BW,K.X7,p.Ne,c,D,H.BY,L.S5,P.Y,v.yV,C.JM,U.iG,o.rw,O.OV,h.Hc,f.BW,a.kn,g.Uo,i.qI,R.L_,N._p,T._W,A.bQ]},74400:(e,t,r)=>{"use strict";r.d(t,{Y:()=>i});var i=function(e){return e.BASIC="basic",e.ADVANCED="advanced",e}({})},75704:(e,t,r)=>{"use strict";r.d(t,{EB:()=>n,I7:()=>l,Jx:()=>a,WW:()=>s,ZA:()=>o});var i=r(39427);let a=[...i.uc,...i.uO,i.Y5,...i.yQ],n=i.sN.id;var o=function(e){return e.TOP="top",e.RIGHT="right",e.FRONT="front",e.LEFT="left",e.BACK="back",e.BOTTOM="bottom",e}({}),s=function(e){return e.SOFT="soft",e.HARD="hard",e}({});let l={image:null,width:0,height:0,direction:"front",lightElevation:0,lightAzimuth:0,lightType:"soft",brightness:75,color:"#FFFFFF",modelId:n,resolution:i.sN.resolutions[0]}},76017:(e,t,r)=>{"use strict";r.d(t,{H3:()=>s,TO:()=>l});var i=r(4717),a=r(56800),n=r(3904);let o="qwen-image",s={architecture:a.qH.QWEN_IMAGE,model_id:o,prompt:"",resolution:n.D.RES_1K,num_inference_steps:25,guidance_scale:3.5,aspect_ratio:i.vW.PORTRAIT},l={architecture:a.qH.QWEN_IMAGE,name:"Qwen Image",short_name:"Qwen",popularity:0,tags:[a.fZ,a.R$],models:[{id:o}],api_path:"/api/v1/qwen-image",agent:{description:"General image model.",defaultConfig:s,options:{resolution:Object.values(n.D)},imageInputs:{references:{field:"image"}}}}},77567:(e,t,r)=>{"use strict";r.d(t,{xV:()=>tC,VT:()=>tw});var i=r(57483),a=r(19063),n=r(32297),o=r(9663),s=r(20038),l=r(59628),c=r(16603),d=r(61282),u=r(58779);let p={content_settings:u.YR,profile_collections:u.AM};function m(e){return{...e,content_settings:(0,u.S4)(e.content_settings)}}var g=r(67603),h=r(63144),f=r.n(h),v=r(74925),_=r.n(v),y=r(11260),b=r.n(y),A=r(75096),S=r.n(A),x=r(85363),R=r.n(x),I=r(64610),C=r(24155),w=r(16791),E=r(30832),P=r.n(E),T=r(61260),M=r(57644),k=r.n(M);async function O(e){for(let t=0;t<2;t++)try{let t=await fetch(e);if(!t.ok)throw Error("Failed to fetch ".concat(e,": ").concat(t.statusText));return new Uint8Array(await t.arrayBuffer())}catch(e){}return null}async function D(e,t){let r={},i=new Set,a=0,n=0;for(let o of k()(e,5)){let s=await Promise.all(o.map(async r=>{let i=await O(r);return a++,null==t||t(a,e.length),i}));for(let e=0;e<o.length;e++){let t=s[e];t?r[function(e,t){if(!t.has(e))return t.add(e),e;let r=e.lastIndexOf("."),i=r>0?e.slice(0,r):e,a=r>0?e.slice(r):"",n=1,o="".concat(i," (").concat(n,")").concat(a);for(;t.has(o);)n++,o="".concat(i," (").concat(n,")").concat(a);return t.add(o),o}(decodeURIComponent(new URL(o[e]).pathname.split("/").pop()||"file"),i)]=t:n++}}return{files:r,skippedCount:n}}async function U(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{files:r,skippedCount:i}=await D(e,t.onProgress),a=e.length-i;if(a>0){let e=new Blob([(0,T.L)(r,{level:0}
1)],{type:"application/zip"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download="mage-creations-".concat(P()().format("YYYY-MM-DD"),".zip"),document.body.appendChild(i),i.click(),URL.revokeObjectURL(t),i.remove()}return{zippedCount:a,skippedCount:i}}async function N(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let r=await U(e,t),{zippedCount:i,skippedCount:a}=r;return 0===i?(0,w.p6)({title:"ZIP Failed",message:"None of the selected files could be downloaded. Try again?"}):a>0?(0,w.bA)({title:"ZIP Downloaded",message:"".concat(i," zipped \xb7 ").concat(a," skipped")}):(0,w.wB)({title:"ZIP Downloaded",message:"".concat(i," zipped")}),r}catch(e){throw(0,w.p6)({title:"Error Zipping",message:"There was an issue creating the ZIP. Try again?"}),e}}var H=r(40845),j=r(54908),L=r(62105),G=r(74532),q=r(60245),B=r.n(q),F=r(23266),V=r.n(F),K=r(41998),z=r.n(K),W=r(88693),X=r(46786),Y=r(59245),Z=r(23552),Q=r(71924),$=r(96117),J=r(74400),ee=r(55625),et=r(67934),er=r(87373),ei=r(90313),ea=r(19630),en=r(17221),eo=r(84471),es=r(85442),el=r(92092),ec=r(75704),ed=r(79041),eu=r(3359),ep=r(85818),em=r(12306),eg=r(29848);let eh={[et.KL.FACE_SWAP]:ep.Wt,[et.KL.CHARACTER_SWAP]:ep.Wt,[et.KL.OUTFIT_SWAP]:ep.Wt,[et.KL.SKIN_ENHANCER]:eu.rY,[et.KL.INPAINT]:ea.M2,[et.KL.RELIGHT]:ec.I7,[et.KL.CHARACTER_CREATOR]:ei.xi,[et.KL.MUSE]:eo.UP,[et.KL.REFINE]:el.qu,[et.KL.SCENE_BUILDER]:ed.xm,[et.KL.IMAGE_ENHANCER]:ee.DI,[et.KL.VIDEO_ENHANCER]:ee.DI,[et.KL.ANGLES]:er.Te,[et.KL.VIDEO_EDITOR]:em.Mv,[et.KL.VIDEO_FACE_SWAP]:eg.gA,[et.KL.VIDEO_CHARACTER_SWAP]:eg.gA,[et.KL.LIPSYNC]:en.$Q,[et.KL.MUSIC_VIDEO]:es._S};function ef(){let e={};for(let[t,r]of Object.entries(eh))e[t]={..."function"==typeof r?r():r};return e}var ev=r(34442),e_=r(23446),ey=r(21078),eb=r(17157),eA=r(12920),eS=r(56800),ex=r(99785),eR=r(60535),eI=r(37463),eC=r(6379),ew=r(72922),eE=r(10140),eP=r(9057),eT=r(57411),eM=r(412),ek=r(60608),eO=r(56650),eD=r(80596),eU=r(86819),eN=r(25618),eH=r(29728),ej=r(63015),eL=r(58649),eG=r(65638),eq=r(59791),eB=r(13421),eF=r(40350),eV=r(44442),eK=r(83880),ez=r(76017),eW=r(3267),eX=r(93772),eY=r(20666),eZ=r(30458),eQ=r(14994),e$=r(88970),eJ=r(31760),e0=r(43258),e1=r(88266),e2=r(38975),e5=r(71671),e3=r(41152),e4=r(20835),e6=r(4334),e8=r(53624),e7=r(60585),e9=r(25352),te=r(78915),tt=r(53021),tr=r(59613),ti=r(61871),ta=r(48568),tn=r(23258),to=r(94035),ts=r(68758),tl=r(53088),tc=r(27610),td=r(27981),tu=r(24104),tp=r(59703),tm=r(61770),tg=r(34477);let th=(0,tg.createServerReference)("7fd3d397219e08f575967e860e32e350cb89253ba5",tg.callServer,void 0,tg.findSourceMapURL,"getCreationTagCountsParallel");var tf=r(20731);let tv={membership:0,purchased:0,referral:0,total:0},t_=(0,tg.createServerReference)("4083ed95896f594a026216c5cd63c7664d03d89769",tg.callServer,void 0,tg.findSourceMapURL,"deleteManyHistories");var ty=r(64930),tb=r(4717),tA=r(53521);function tS(){return{activeHistoryId:null,pendingRequestId:null,isGenerating:!1}}function tx(){return{session:tS(),creations:[]}}function tR(e,t){let r=(0,to.AU)(e);if(r!==e)return t(r),!1;let{generationMode:i,userMembership:a,setGenerationMode:n}=tC.getState(),o=(0,to.WT)(e,i,a);return"allow"===o.action||("block-deprecated"===o.action?(0,ti.n)():(0,ta.Cf)({config:e,membershipRequired:o.membershipRequired,setGenerationMode:n,applyConfig:e=>t(e)}),!1)}let tI=V()((e,t)=>{console.warn("Persisting state to localStorage failed; state changes will not survive a reload until a write succeeds.",e),(0,L.Cp)(e,{extra:function(e){let t;try{t=JSON.parse(e)}catch(t){return{totalBytes:e.length}}let r=_()(t.state,e=>JSON.stringify(e).length),i=S()(b()(R()(r),e=>{let[,t]=e;return t},"desc"),10);return{totalBytes:e.length,bytesByKey:f()(i)}}(t)})}),tC=(0,W.vt)()((0,X.lt)((0,Y.D)((0,X.Zr)((e,t)=>({user:null,pendingReferralUid:null,setPendingReferralUid:t=>e(e=>{e.pendingReferralUid=t}),setUser:t=>e(e=>{var r,i;let a=JSON.stringify(t);if(a===JSON.stringify(e.user))return;let n=null===(r=e.user)||void 0===r?void 0:r.uid;e.user=JSON.parse(a),(null===(i=e.user)||void 0===i?void 0:i.uid)!==n&&(e.userHasPaid=!1),null===t||t.isAnonymous?(e.userIsAdmin=!1,e.userMageRole=null,e.userProfile=void 0,e.followingIds=[],e.userMembership=d.c.FREE,e.settings=p,e.notifications=[],e.chats=[],e.chatMessagesByChatId={}
1,e.chatMessagesHasMoreByChatId={},e.chatUsersByUid={},e.chatTypingByChatId={},null===t&&(e.galleryCreations=[],e.galleryIdx=0,e.isGalleryVisible=!1,e.isAdminModeActive=!1,e.optionsVisible=!1,e.advancedMode=!1,e.playImage=null,e.playAppCreations=[],e.recentHistoryCreations=[],e.hiddenPlayAppCreationKeys=[],e.appStateByApp={},e.concept=void 0,e.genQueue=[],e.isGenQueuePaused=!1,e.ban=null,e.addedPosts=[],e.architectureLikes=[],e.fluxConfig=eR.b0,e.stableDiffusionV15Config=e$.Wt,e.stableDiffusionV35LargeConfig=eJ.E$,e.stableDiffusionV35MediumConfig=e0._W,e.stableDiffusionXLConfig=e1._e,e.sdxlPlusConfig=eY.ye,e.wanConfig=e3.OH,e.wan22Config=e4.iH,e.ltxVideoConfig=eN.oH,e.prompt="",e.image=null,e.maskImage=null,e.seed=null,e.generationMode=e9.o.GEMS,e.generationModeForced=!0,e.userMembershipHydrated=!1,e.activeArchitecture=eS.qH.MANGO,e.activePowerPack=null,e.availablePowerPacks=[],e.availableGems=0,e.gemBreakdown=tv,e.mangoConfig=eH.wW,e.selfieConfig=eQ.sc,e.veo3Config=e2.rI,e.veo31Config=e5.dX,e.seedvr2Config=ee.DI,e.appInputConfigs=ef(),e.fluxKontextDevConfig=eC.zG)):e.viewLogin=!1}),hydrateUser:r=>{var i,a;if(r.uid!==(null!==(a=null===(i=t().user)||void 0===i?void 0:i.uid)&&void 0!==a?a:null))return;e(e=>{e.userProfile=r.userProfile,e.followingIds=r.followingIds,e.importedModels=r.importedModels,e.settings=m(r.settings),e.notifications=r.notifications,e.conceptLikes=r.conceptLikes,e.architectureLikes=r.architectureLikes,e.favoritedModelIDs=r.favoritedModelIDs,e.availableGems=r.availableGems,e.gemBreakdown=r.gemBreakdown,e.tagCounts=r.tagCounts,e.userHasPaid=e.userHasPaid||r.userHasPaid});let n=t();n.setActivePowerPack(r.activePowerPack),n.setAvailablePowerPacks(r.availablePowerPacks),n.setUserMembership(r.userMembership),n.refreshRecentCharacters(r.recentCharacters),n.hydrateChats(r.chats)},chats:[],chatMessagesByChatId:{},chatMessagesHasMoreByChatId:{},chatUsersByUid:{},chatTypingByChatId:{},activeChatId:null,setActiveChatId:t=>e(e=>{e.activeChatId=t}),hydrateChats:t=>e(e=>{for(let r of(e.chats=(0,G.h4)(t.chats),t.users))e.chatUsersByUid[r.uid]=r}),mergeChatUsers:t=>e(e=>{for(let r of t)e.chatUsersByUid[r.uid]=r}),upsertChat:(t,r)=>e(e=>{var i;if((0,c.kt)(t,null===(i=e.user)||void 0===i?void 0:i.uid)){e.chats=e.chats.filter(e=>e.id!==t.id);return}let a=e.chats.findIndex(e=>e.id===t.id),n=0;a>=0&&(n=e.chats[a].unread_count),(null==r?void 0:r.incrementUnread)&&(n+=1);let o=(0,G.h4)({...t,unread_count:n});a>=0?e.chats[a]=o:e.chats.push(o),e.chats.sort((e,t)=>new Date(t.last_message_at).getTime()-new Date(e.last_message_at).getTime())}),removeChat:t=>e(e=>{e.chats=e.chats.filter(e=>e.id!==t),delete e.chatMessagesByChatId[t],delete e.chatMessagesHasMoreByChatId[t],delete e.chatTypingByChatId[t]}),setChatMessages:(t,r,i)=>e(e=>{var a;let n=(null!==(a=e.chatMessagesByChatId[t])&&void 0!==a?a:[]).filter(e=>("sending"===e.send_status||"failed"===e.send_status)&&!r.some(t=>t.id===e.id));e.chatMessagesByChatId[t]=(0,G.h4)([...r,...n]),e.chatMessagesHasMoreByChatId[t]=i}),prependOlderChatMessages:(t,r,i)=>e(e=>{var a;let n=null!==(a=e.chatMessagesByChatId[t])&&void 0!==a?a:[],o=new Set(n.map(e=>e.id)),s=r.filter(e=>!o.has(e.id));e.chatMessagesByChatId[t]=(0,G.h4)([...s,...n]),e.chatMessagesHasMoreByChatId[t]=i}),appendOptimisticChatMessage:t=>e(e=>{let r=e.chatMessagesByChatId[t.chat_id];if(!r){e.chatMessagesByChatId[t.chat_id]=(0,G.h4)([t]);return}r.some(e=>e.id===t.id)||r.push((0,G.h4)(t))}),upsertChatMessage:t=>e(e=>{let r=e.chatMessagesByChatId[t.chat_id];if(!r)return;let i=r.findIndex(e=>e.id===t.id);if(i>=0){r[i]=(0,G.h4)({...t});return}r.push((0,G.h4)({...t})),r.sort((e,t)=>new Date(e.created_at).getTime()-new Date(t.created_at).getTime()||e.id.localeCompare(t.id))}),setChatMessageSendStatus:(t,r,i)=>e(e=>{var a;let n=null===(a=e.chatMessagesByChatId[t])||void 0===a?void 0:a.find(e=>e.id===r);n&&(n.send_status=i)}),applyChatRead:(t,r,i)=>e(e=>{var a;let n=e.chats.find(e=>e.id===t);if(!n)return;let o=n.members.find(e=>e.uid===r);o&&(o.last_read_at=i),r===(null===(a=e.user)||void 0===a?void 0:a.uid)&&(n.unread_count=0)}),applyChatReaction:(t,r,i,a)=>e(e=>{var n;let o=null===(n=e.chatMessagesByChatId[t])||void 0===n?void 0:n.find(e=>e.id===r);o&&(null===a?delete o.reactions[i]:o.reactions[i]=a)}),applyChatMessageDelete:(t,r,i)=>e(e=>{var a;let n=null===(a=e.chatMessagesByChatId[t])||void 0===a?void 0:a.find(e=>e.id===r);n&&(n.deleted_at=new Date,n.text=null,n.attachments=null);let o=e.chats.find(e=>e.id===t);o&&(o.last_message=(0,G.h4)(i))}),setChatTyping:(t,r,i)=>e(e=>
1{e.chatTypingByChatId[t]||(e.chatTypingByChatId[t]={}),e.chatTypingByChatId[t][r]={name:i,expiresAt:Date.now()+l.Sy}}),clearChatTyping:(t,r)=>e(e=>{let i=e.chatTypingByChatId[t];i&&(delete i[r],0===Object.keys(i).length&&delete e.chatTypingByChatId[t])}),expireChatTyping:()=>e(e=>{let t=Date.now();for(let r of Object.keys(e.chatTypingByChatId)){let i=e.chatTypingByChatId[r];for(let e of Object.keys(i))i[e].expiresAt<=t&&delete i[e];0===Object.keys(i).length&&delete e.chatTypingByChatId[r]}}),userIsAdmin:!1,userMageRole:null,setUserMageRole:t=>e(e=>{e.userMageRole=t,e.userIsAdmin=null!==t,null===t&&(e.isAdminModeActive=!1)}),userMembership:d.c.FREE,userMembershipHydrated:!1,userHasPaid:!1,setUserHasPaid:(t,r)=>e(e=>{var i;(null===(i=e.user)||void 0===i?void 0:i.uid)===t&&(e.userHasPaid=e.userHasPaid||r)}),setUserMembership:r=>{if(!Object.values(d.c).includes(r))return;let i=t(),a=!1,n=null;if(i.generationModeForced&&r!==d.c.FREE&&!(i.activePowerPack&&r!==d.c.MAX)){let e=(0,to.AU)(i.getActiveArchitectureConfig()),t=(0,g.l)(e,e9.o.UNLIMITED,r);"snap"===t.action?(n=t,a=!0):a=(0,tr.zd)(e,r).allowed}n&&i.applyArchitectureFloorSnap(n),e(e=>{e.userMembershipHydrated=!0,(!e.activePowerPack||r===d.c.MAX)&&(e.userMembership=r,e.generationModeForced&&r!==d.c.FREE&&(e.generationModeForced=!1,a&&(e.generationMode=e9.o.UNLIMITED,e.maxGemActiveJobs=1)))})},isAdminModeActive:!1,setIsAdminModeActive:t=>e(e=>{e.userIsAdmin&&(e.isAdminModeActive=t)}),isUserSessionAvailable:!1,setIsUserSessionAvailable:t=>e(e=>{e.isUserSessionAvailable=t}),toggleIsAdminModeActive:()=>e(e=>{e.userIsAdmin?e.isAdminModeActive=!e.isAdminModeActive:e.isAdminModeActive=!1}),setUserProfile:t=>e(e=>{e.userProfile=t}),color:"var(--mantine-color-dark-4)",setColor:t=>e(e=>{e.color=t}),setOverrideColor:t=>e(e=>{e.overrideColor=t}),title:"",setTitle:t=>e(e=>{e.title=t}),isDesktop:!0,setIsDesktop:t=>e(e=>{e.isDesktop=t}),isMobileNavbarOpen:!1,setIsMobileNavbarOpen:t=>e(e=>{e.isMobileNavbarOpen=t}),isNavbarCollapsed:!1,setIsNavbarCollapsed:t=>e(e=>{e.isNavbarCollapsed=t}),advancedMode:!1,setAdvancedMode:t=>e(e=>{e.advancedMode=t}),optionsVisible:!1,setOptionsVisible:t=>e(e=>{e.optionsVisible=t}),search:"",setSearch:t=>e(e=>{e.search=t}),setConcept:(r,i)=>{let a;if(r&&!r.architecture_config)return(0,tu.fl)(new tu.Lz),!1;if((null==r?void 0:r.architecture_config)&&!1!==i){let e=(0,to.AU)(r.architecture_config);e!==r.architecture_config&&(r={...r,architecture_config:e});let n=t(),o=(0,tA.aR)({sourceConfig:(0,tA.zh)(n),targetArchitecture:e.architecture,targetConfig:e});a={...e,prompt:n.prompt,image:n.image,additional_images:n.additionalImages,aspect_ratio:n.aspectRatio,seed:n.seed,...o};let s=r;if(!tR(a,()=>t().setConcept(s,i)))return!1}return e(e=>{var t;if((null===(t=e.concept)||void 0===t?void 0:t.id)!==(null==r?void 0:r.id)){let t=e.playAppCreations.findIndex(e=>e.concept_id===(null==r?void 0:r.id));-1!==t&&(e.playAppViewIndex=t)}e.concept=r,e.remixedPost=null}),!a||t().setActiveArchitectureConfig(a)},deletedCharacterIds:[],addDeletedCharacterId:t=>e(e=>{e.deletedCharacterIds.includes(t)||e.deletedCharacterIds.push(t)}),recentCharacters:[],addRecentCharacter:t=>e(e=>{let r=e.recentCharacters.filter(e=>e.id!==t.id);e.recentCharacters=[t,...r].slice(0,30)}),updateRecentCharacter:t=>{e(e=>{e.recentCharacters=e.recentCharacters.map(e=>e.id===t.id?t:e)});let r=(0,e7.F)(t);(0,tA.WG)(e=>e.id===t.id?r:e)},removeRecentCharacterById:t=>{e(e=>{e.recentCharacters=e.recentCharacters.filter(e=>e.id!==t)}),(0,tA.WG)(e=>e.id===t?null:e)},clearRecentCharacters:()=>e(e=>{e.recentCharacters=[]}),refreshRecentCharacters:t=>{let r=new Map(t.map(e=>[e.id,e]));e(e=>{e.recentCharacters=e.recentCharacters.map(e=>r.get(e.id)).filter(e=>void 0!==e)}),(0,tA.WG)(e=>{let t=r.get(e.id);return t?(0,e7.F)(t):null})},deletedReferenceIds:[],addDeletedReferenceId:t=>e(e=>{e.deletedReferenceIds.includes(t)||e.deletedReferenceIds.push(t)}),recentReferences:[],addRecentReference:t=>e(e=>{let r=e.recentReferences.filter(e=>e.id!==t.id);e.recentReferences=[t,...r].slice(0,30)}),updateRecentReference:t=>e(e=>{e.recentReferences=e.recentReferences.map(e=>e.id===t.id?t:e)}),removeRecentReferenceById:t=>e(e=>{e.recentReferences=e.recentReferences.filter(e=>e.id!==t)}),clearRecentReferences:()=>e(e=>{e.recentReferences=[]}),pendingMoodboardItems:[],setPendingMoodboardItems:t=>e(e=>{e.pendingMoodboardItems=t}),playIsActive:!1,setPlayIsActive:t=>e(e=>{e.playIsActive=t,t||e.playActionOverlay===n.D.INPAINT&&(e.playActionOverlay=null),e.playAppDistractionFree=!1}),playActionOverlay:null,setPlayActionOverlay:t=>e(e=>{e.playActionOverlay=t}),playModeActiveDesktop:!1,setPlayModeActiveDesktop:t=>e(e=>{e.playModeActiveDesktop=t}),isAppPlaying:!1,setIsAppPlaying:t=>e(e=>{e.isAppPlaying=t}),playAppCreations:[],recentHistoryCreations:[],hiddenPlayAppCreationKeys:[],addPlayAppCreation:r=>{let i=(0,tc.F)(r),{playAppCreations:a}=t();return!a.some(e=>(0,tc.F)(e)===i)&&(e(e=>{e.playAppCreations.unshift(r),e.playAppCreations=e.playAppCreations.slice(0,100),e.playAppViewIndex=0}),!0)},addRecentHistoryCreation:r=>{let i=(0,tc.F)(r),{recentHistoryCreations:a}=t();return!a.some(e=>r.history_id&&e.history_id===r.history_id||(0,tc.F)(e)===i)&&(e(e=>{e.recentHistoryCreations.unshift(r),e.recentHistoryCreations=e.recentHistoryCreations.slice(0,100)}),!0)},hidePlayAppCreation:t=>e(e=>{let r=(0,tt.Y7)(t);e.hiddenPlayAppCreationKeys.includes(r)||e.hiddenPlayAppCreationKeys.push(r),e.playAppViewIndex=(0,tt.fS)(e.playAppCreations,e.hiddenPlayAppCreationKeys,e.playAppViewIndex)}),setPlayAppCreations:t=>e(e=>{e.playAppCreations=t.slice(0,100),e.playAppViewIndex=(0,tt.fS)(e.playAppCreations,e.hiddenPlayAppCreationKeys,0)}),appStateByApp:{},getAppState:e=>{var r;return null!==(r=t().appStateByApp[e])&&void 0!==r?r:tx()},setAppSession:(t,r)=>e(e=>{var i;let a=null!==(i=e.appStateByApp[t])&&void 0!==i?i:tx();e.appStateByApp[t]={...a,session:{...a.session,...r}}}
1),clearAppSession:t=>e(e=>{let r=e.appStateByApp[t];if(!r){e.appStateByApp[t]=tx();return}e.appStateByApp[t]={...r,session:tS()}}),addAppCreation:(r,i)=>{var a;let n=t().appStateByApp[r];return!(null!==(a=null==n?void 0:n.creations)&&void 0!==a?a:[]).some(e=>e.history_id===i.history_id||(0,tc.F)(e)===(0,tc.F)(i))&&(e(e=>{var t;let a=null!==(t=e.appStateByApp[r])&&void 0!==t?t:tx();e.appStateByApp[r]={...a,creations:[i,...a.creations].slice(0,100)}}),!0)},clearAppCreations:t=>e(e=>{let r=e.appStateByApp[t];e.appStateByApp[t]=r?{...r,creations:[]}:tx()}),playAppViewScale:1,setPlayAppViewScale:t=>e(e=>{e.playAppViewScale=Math.max(.25,Math.min(4,t))}),incrementPlayAppViewScale:()=>e(e=>{e.playAppViewScale=Math.min(1.2*e.playAppViewScale,4)}),decrementPlayAppViewScale:()=>e(e=>{e.playAppViewScale=Math.max(e.playAppViewScale/1.2,.25)}),playAppViewIndex:0,setPlayAppViewIndex:t=>e(e=>{e.playAppViewIndex=(0,tt.fS)(e.playAppCreations,e.hiddenPlayAppCreationKeys,t)}),incrementPlayAppViewIndex:()=>e(e=>{e.playAppViewIndex=(0,tt.fS)(e.playAppCreations,e.hiddenPlayAppCreationKeys,e.playAppViewIndex,"next")}),decrementPlayAppViewIndex:()=>e(e=>{e.playAppViewIndex=(0,tt.fS)(e.playAppCreations,e.hiddenPlayAppCreationKeys,e.playAppViewIndex,"previous")}),playAppDistractionFree:!1,togglePlayAppDistractionFree:()=>e(e=>{e.playAppDistractionFree=!e.playAppDistractionFree}),setPlayAppDistractionFree:t=>e(e=>{e.playAppDistractionFree=t}),playAppAspectRatio:1,setPlayAppAspectRatio:t=>e(e=>{e.playAppAspectRatio=t}),playImage:null,setPlayImage:t=>e(e=>{e.playImage=t}),playVariantOverrides:[],setPlayVariantOverrides:t=>e(e=>{e.playVariantOverrides=t}),playDynamicOptionsOpen:!1,setPlayDynamicOptionsOpen:t=>e(e=>{e.playDynamicOptionsOpen=t}),togglePlayDynamicOptionsOpen:()=>e(e=>{e.playDynamicOptionsOpen=!e.playDynamicOptionsOpen}),profileActiveTab:i.R.APPS,setProfileActiveTab:t=>e(e=>{e.profileActiveTab=t}),followingIds:[],setFollowingIds:t=>e(e=>{e.followingIds=t}),addFollowingId:t=>e(e=>{e.followingIds=[...e.followingIds,t]}),removeFollowingId:t=>e(e=>{e.followingIds=e.followingIds.filter(e=>e!==t)}),settings:p,setSettings:t=>e(e=>{e.settings=m(t)}),tagCounts:{},refreshTagCounts:async()=>{let t=await (0,te.T)(th());e(e=>{e.tagCounts=t})},notifications:[],setNotifications:t=>e(e=>{e.notifications=t}),viewLogin:!1,setViewLogin:t=>e(e=>{e.viewLogin=t}),showOnboarding:!1,setShowOnboarding:t=>e(e=>{e.showOnboarding=t}),setAnnouncementKey:t=>e(e=>{e.announcementKey=t}),setAnnouncementPopupKey:t=>e(e=>{e.announcementPopupKey=t}),unlimitedGenCounts:{},incrementUnlimitedGenCount:t=>{let r;return e(e=>{e.unlimitedGenCounts[t]=(e.unlimitedGenCounts[t]||0)+1,r=e.unlimitedGenCounts[t]}),r},characterReferenceSuggestionGenCount:0,incrementCharacterReferenceSuggestionGenCount:()=>{let t;return e(e=>{e.characterReferenceSuggestionGenCount+=1,t=e.characterReferenceSuggestionGenCount}),t},gemGenCounts:{},incrementGemGenCount:t=>{let r;return e(e=>{e.gemGenCounts[t]=(e.gemGenCounts[t]||0)+1,r=e.gemGenCounts[t]}),r},appFeedColumns:6,setAppFeedColumns:t=>e(e=>{e.appFeedColumns=t}),galleryCreations:[],setGalleryCreations:t=>e(e=>{e.galleryCreations=t}),galleryIdx:0,setGalleryIdx:t=>e(e=>{e.galleryIdx=t}),incrementGalleryIdx:()=>e(e=>{e.galleryIdx=Math.min(e.galleryCreations.length-1,e.galleryIdx+1)}),decrementGalleryIdx:()=>e(e=>{e.galleryIdx=Math.max(e.galleryIdx-1,0)}),isGalleryVisible:!1,setIsGalleryVisible:t=>e(e=>{e.isGalleryVisible=t}),isGalleryDistractionFree:!1,setIsGalleryDistractionFree:t=>e(e=>{e.isGalleryDistractionFree=t}),toggleGalleryDistractionFree:()=>e(e=>{e.isGalleryDistractionFree=!e.isGalleryDistractionFree}),galleryViewScale:1,setGalleryViewScale:t=>e(e=>{e.galleryViewScale=Math.max(.25,Math.min(4,t))}),incrementGalleryViewScale:()=>e(e=>{e.galleryViewScale=Math.min(1.2*e.galleryViewScale,4)}),decrementGalleryViewScale:()=>e(e=>{e.galleryViewScale=Math.max(e.galleryViewScale/1.2,.25)}),conceptLikes:[],setConceptLikes:t=>e(e=>{e.conceptLikes=t}),addConceptLike:t=>e(e=>{e.conceptLikes=[...e.conceptLikes,t]}),removeConceptLike:t=>e(e=>{e.conceptLikes=e.conceptLikes.filter(e=>e!==t)}),architectureLikes:[],setArchitectureLikes:t=>e(e=>{e.architectureLikes=t}),setGetFJSID:t=>e(e=>{e.getFJSID=t}),setFjsData:t=>e(e=>{e.fjsData=t}),favoritedModelIDs:[],setFavoritedModelIDs:t=>e(e=>{e.favoritedModelIDs=t}),addFavoritedModelID:t=>e(e=>{e.favoritedModelIDs=[...e.favoritedModelIDs,t]}),removeFavoritedModelID:t=>e(e=>{e.favoritedModelIDs=e.favoritedModelIDs.filter(e=>e!==t)}),homePageMode:J.Y.BASIC,setHomePageMode:t=>e(e=>{e.homePageMode=t}),promptBarMode:"image",setPromptBarMode:t=>e(e=>{e.promptBarMode=t}),selectedHistories:new Map,historyBulkLoading:{download:!1,zip:!1,save:!1,delete:!1},toggleHistorySelection:r=>{let{selectedHistories:i}=t(),a=new Map(i);if(a.has(r.id))a.delete(r.id);else{if(a.size>=500){(0,w.p6)({title:"Selection limit reached",message:"You can select up to ".concat(500," items at once.")});return}a.set(r.id,r)}e(e=>{e.selectedHistories=a})},selectHistoryGroup:(r,i)=>{let{selectedHistories:a}=t(),n=new Map(a);if(i)for(let e of r){if(n.size>=500){(0,w.p6)({title:"Selection limit reached",message:"You can select up to ".concat(500," items at once.")});break}n.set(e.id,e)}else for(let e of r)n.delete(e.id);e(e=>{e.selectedHistories=n})},clearHistorySelection:()=>e(e=>{e.selectedHistories=new Map}),historyBulkDownload:async()=>{let{selectedHistories:r}=t(),i=Array.from(r.values()).filter(e=>"success"===e.status&&e.result);e(e=>{e.historyBulkLoading.download=!0});try{let e=i.map(e=>(0,I.h)(e.result));await (0,C.v1)(e)}catch(e){}finally{e(e=>{e.historyBulkLoading.download=!1})}},historyBulkZipDownload:async()=>{let{selectedHistories:r}=t(),i=Array.from(r.values()).filter(e=>"success"===e.status&&e.result).map(e=>(0,I.h)(e.result));e(e=>{e.historyBulkLoading.zip=!0,e.bulkZipProgress={done:0,total:i.length}});try{await N(i,{onProgress:(t,r)=>e(e=>{e.bulkZipProgress={done:t,total:r}})})}catch(e){}finally{e(e=>{e.historyBulkLoading.zip=!1,e.bulkZipProgress=null})}},historyBulkSave:async()=>{let{selectedHistories:r,clearHistorySelection:i}=t(),a=Array.from(r.values()).filter(e=>"success"===e.status&&e.result).map(e=>e.result);e(e=>{e.historyBulkLoading.save=!0});try{let{successCount:e,failCount:t}=await (0,tf.P)(a);0===t?(0,w.wB)({title:"Saved",message:"".concat(e," item").concat(1!==e?"s":""," saved to your creations!")}):e>0?(0,w.bA)({title:"Partially Saved",message:"".concat(e," item").concat(1!==e?"s":""," saved, ").concat(t," failed.")}):(0,w.p6)({title:"Error Saving",message:"There was an issue saving the items. Try again?"}),i()}catch(e){(0,w.p6)({title:"Error Saving",message:"There was an issue saving some items. Try again?"})}finally{e(e=>{e.historyBulkLoading.save=!1})}},historyBulkDelete:async()=>{let{selectedHistories:r,deletedHistoryIds:i,setDeletedHistoryIds:a,clearHistorySelection:n}=t(),o=Array.from(r.keys());e(e=>{e.historyBulkLoading.delete=!0});try{await t_(o);let e=new Set(i);o.forEach(t=>e.add(t)),a(e),(0,w.wB)({title:"Deleted",message:"".concat(o.length," item").concat(1!==o.length?"s":""," removed from history.")}),n()}catch(e){(0,w.p6)({title:"Error Deleting",message:"There was an issue deleting some items. Try again?"})}finally{e(e=>{e.historyBulkLoading.delete=!1})}},savedBulkSelecting:!1,selectedSavedCreations:new Map,savedBulkLoading:{download:!1,zip:!1,delete:!1},startSavedSelection:()=>e(e=>{e.savedBulkSelecting=!0,e.selectedSavedCreations=new Map}),toggleSavedSelection:r=>{let{selectedSavedCreations:i}=t(),a=new Map(i);a.has(r.id)?a.delete(r.id):a.set(r.id,r),e(e=>{e.savedBulkSelecting=!0,e.selectedSavedCreations=a})},shiftSelectSavedCreations:r=>{let{selectedSavedCreations:i}=t(),a=new Map(i);for(let e of r)a.set(e.id,e);e(e=>{e.savedBulkSelecting=!0,e.selectedSavedCreations=a})},clearSavedSelection:()=>e(e=>{e.savedBulkSelecting=!1,e.selectedSavedCreations=new Map}),savedBulkDownload:async()=>{let{selectedSavedCreations:r}=t(),i=Array.from(r.values()).map(e=>e.url);e(e=>{e.savedBulkLoading.download=!0});try{await (0,C.v1)(i,{successTitle:"Creations Downloaded",successMessage:e=>"".concat(e," creation").concat(1!==e?"s":""," downloaded!"),failureMessage:e=>"Failed to download ".concat(e," creation").concat(1!==e?"s":"",". Please try again."),partialMessage:(e,t)=>
1"".concat(e," creation").concat(1!==e?"s":""," downloaded, ").concat(t," failed."),errorTitle:"Error Downloading Creations",errorMessage:"There was an issue downloading your creations. Try again?"}),e(e=>{e.selectedSavedCreations=new Map})}catch(e){}finally{e(e=>{e.savedBulkLoading.download=!1})}},savedBulkZipDownload:async()=>{let{selectedSavedCreations:r}=t(),i=Array.from(r.values()).map(e=>e.url);e(e=>{e.savedBulkLoading.zip=!0,e.bulkZipProgress={done:0,total:i.length}});try{await N(i,{onProgress:(t,r)=>e(e=>{e.bulkZipProgress={done:t,total:r}})})}catch(e){}finally{e(e=>{e.savedBulkLoading.zip=!1,e.bulkZipProgress=null})}},savedBulkDelete:async()=>{let{selectedSavedCreations:r,deletedCreationIds:i,setDeletedCreationIds:a}=t(),n=Array.from(r.keys());e(e=>{e.savedBulkLoading.delete=!0});try{await (0,tm.z)(n);let t=new Set(i);n.forEach(e=>t.add(e)),a(t),(0,w.wB)({title:"Creations Deleted",message:"Your creations have been deleted!"}),e(e=>{e.selectedSavedCreations=new Map})}catch(e){(0,w.p6)({title:"Error Deleting Creations",message:"There was an issue deleting your creations. Try again later."})}finally{e(e=>{e.savedBulkLoading.delete=!1})}},savedBulkOrganize:()=>{let{selectedSavedCreations:r}=t();(0,a.T8)({creationIds:Array.from(r.keys()),onComplete:()=>e(e=>{e.selectedSavedCreations=new Map})})},bulkZipProgress:null,promptBarMinimized:!1,setPromptBarMinimized:t=>e(e=>{e.promptBarMinimized=t}),assistantModelIds:{...e8.cw},setAssistantModelId:(t,r)=>e(e=>{e.assistantModelIds[t]=r}),isAiAssistantOpen:!1,setIsAiAssistantOpen:t=>e(e=>{e.isAiAssistantOpen=t}),aiAssistantMode:"prompt-help",setAiAssistantMode:t=>e(e=>{e.aiAssistantMode=t}),aiAssistantSessions:{guide:{messages:[],sessionId:crypto.randomUUID()},"prompt-help":{messages:[],sessionId:crypto.randomUUID()},agent:{messages:[],sessionId:crypto.randomUUID()},"admin-agent":{messages:[],sessionId:crypto.randomUUID()}},setAiAssistantMessages:(t,r)=>e(e=>{e.aiAssistantSessions[t].messages=(0,G.h4)(r)}),resetAiAssistantSessionId:t=>e(e=>{e.aiAssistantSessions[t].sessionId=crypto.randomUUID()}),loadAiAssistantSession:(t,r,i)=>e(e=>{e.aiAssistantSessions[t].sessionId=r,e.aiAssistantSessions[t].messages=(0,G.h4)(i)}),genQueue:[],isGenQueuePaused:!1,maxGenQueueSize:9,pushToGenQueue:r=>{let{genQueue:i,generationMode:a,maxGenQueueSize:n}=t();return!(i.length>
1=(0,tn.ND)(a,n))&&(e(e=>{e.genQueue.push(r)}),!0)},unshiftToGenQueue:t=>e(e=>{e.genQueue.unshift(t)}),popFromGenQueue:()=>e(e=>{e.genQueue.shift()}),clearGenQueue:()=>e(e=>{e.genQueue=[]}),setIsGenQueuePaused:t=>e(e=>{e.isGenQueuePaused=t}),toggleGenQueuePaused:()=>e(e=>{e.isGenQueuePaused=!e.isGenQueuePaused}),isQueueDropdownOpen:!1,setIsQueueDropdownOpen:t=>e(e=>{e.isQueueDropdownOpen=t}),toggleIsQueueDropdownOpen:()=>e(e=>{e.isQueueDropdownOpen=!e.isQueueDropdownOpen}),importedModels:[],setImportedModels:t=>e(e=>{e.importedModels=t}),runningJobs:[],setRunningJobs:t=>e(e=>{e.runningJobs=t}),addRunningJob:t=>e(e=>{e.runningJobs.push(t)}),removeRunningJob:t=>e(e=>{e.runningJobs=e.runningJobs.filter(e=>e.history_id!==t.history_id)}),setBan:t=>e(e=>{e.ban=t}),postDraftDescription:"",setPostDraftDescription:t=>e(e=>{e.postDraftDescription=t}),postDraftCreations:[],setPostDraftCreations:t=>e(e=>{e.postDraftCreations=t}),addPostDraftCreation:t=>e(e=>{e.postDraftCreations||(e.postDraftCreations=[]),e.postDraftCreations.push(t)}),removePostDraftCreation:t=>e(e=>{e.postDraftCreations&&e.postDraftCreations.splice(t,1)}),postFeedRefreshSignal:0,triggerPostFeedRefresh:()=>e(e=>{e.postFeedRefreshSignal++}),postHideIDs:[],addPostHideID:t=>e(e=>{e.postHideIDs.push(t)}),addedPosts:[],addAddedPost:t=>e(e=>{e.addedPosts.unshift(t)}),setAddedPosts:t=>e(e=>{e.addedPosts=t}),deletedCreationIds:new Set,setDeletedCreationIds:t=>e(e=>{e.deletedCreationIds=t}),deletedHistoryIds:new Set,setDeletedHistoryIds:t=>e(e=>{e.deletedHistoryIds=t}),inpaintBrushSize:50,setInpaintBrushSize:t=>e(e=>{e.inpaintBrushSize=t}),inpaintPromptStrength:1,setInpaintPromptStrength:t=>e(e=>{e.inpaintPromptStrength=t}),socialFeedProps:(0,Q.RA)(),setSocialFeedProps:t=>e(e=>{e.socialFeedProps={...t,postedBeforeDate:new Date},e.addedPosts=[]}),socialReplyPost:null,setSocialReplyPost:t=>e(e=>{e.socialReplyPost=t}),exploreFeedProps:(0,$.p)(),setExploreFeedProps:t=>e(e=>{B()(t.embedding,e.exploreFeedProps.embedding)||(e.exploreFeedMedia=null),e.exploreFeedProps=t}),exploreFeedMedia:null,setExploreFeedMedia:t=>e(e=>{e.exploreFeedMedia=t,t?e.exploreFeedProps={...e.exploreFeedProps,embedding:t.embedding}:e.exploreFeedProps={...e.exploreFeedProps,embedding:null}}),postModal:null,setPostModal:t=>e(e=>{e.postModal=t}),characterStoryModal:null,setCharacterStoryModal:t=>e(e=>{e.characterStoryModal=t}),incrementCharacterStoryIndex:()=>e(e=>{if(!e.characterStoryModal)return;let t=e.characterStoryModal.storySlots.length-1;e.characterStoryModal.storyIndex=Math.min(e.characterStoryModal.storyIndex+1,t)}),decrementCharacterStoryIndex:()=>e(e=>{e.characterStoryModal&&(e.characterStoryModal.storyIndex=Math.max(e.characterStoryModal.storyIndex-1,0))}),storySeenAt:{},markCharacterStorySeen:(t,r)=>e(e=>{var i;r>(null!==(i=e.storySeenAt[t])&&void 0!==i?i:0)&&(e.storySeenAt[t]=r)}),unmutedAudioId:null,setUnmutedAudioId:t=>e(e=>{e.unmutedAudioId=t}),playingAudioId:null,setPlayingAudioId:t=>e(e=>{e.playingAudioId=t}),postModalViewScale:1,setPostModalViewScale:t=>e(e=>{e.postModalViewScale=Math.max(.25,Math.min(4,t))}),incrementPostModalViewScale:()=>e(e=>{e.postModalViewScale=Math.min(1.2*e.postModalViewScale,4)}),decrementPostModalViewScale:()=>e(e=>{e.postModalViewScale=Math.max(e.postModalViewScale/1.2,.25)}),postModalShowSidebar:!0,setPostModalShowSidebar:t=>e(e=>{e.postModalShowSidebar=t}),addedPostLikes:[],removedPostLikes:[],addPostLike:t=>e(e=>{e.addedPostLikes.includes(t)||(e.addedPostLikes.push(t),e.removedPostLikes=e.removedPostLikes.filter(e=>e!==t))}),removePostLike:t=>e(e=>{e.removedPostLikes.push(t),e.addedPostLikes=e.addedPostLikes.filter(e=>e!==t)}),addedPostBookmarks:[],removedPostBookmarks:[],addPostBookmark:t=>e(e=>{e.addedPostBookmarks.includes(t)||(e.addedPostBookmarks.push(t),e.removedPostBookmarks=e.removedPostBookmarks.filter(e=>e!==t))}),removePostBookmark:t=>e(e=>{e.removedPostBookmarks.push(t),e.addedPostBookmarks=e.addedPostBookmarks.filter(e=>e!==t)}),isGenQueueProcessing:!1,setIsGenQueueProcessing:t=>e({isGenQueueProcessing:t}),remixedPost:null,setRemixedPost:t=>e(e=>{e.remixedPost=t}),setRemixState:t=>e(e=>{t.concept&&(e.concept=t.concept),e.recentHistoryCreations.unshift(t.creation),e.recentHistoryCreations=e.recentHistoryCreations.slice(0,100),e.playAppCreations.unshift(t.creation),e.playAppCreations=e.playAppCreations.slice(0,100),e.playAppViewIndex=0,e.remixedPost=t.post}),prompt:"",setPrompt:t=>e(e=>{e.prompt=t,e.fluxConfig.prompt=t,e.stableDiffusionV15Config.prompt=t,e.stableDiffusionV35LargeConfig.prompt=t,e.stableDiffusionV35MediumConfig.prompt=t,e.stableDiffusionXLConfig.prompt=t,e.sdxlPlusConfig.prompt=t,e.ltxVideoConfig.prompt=t,e.wanConfig.prompt=t,e.wan22Config.prompt=t,e.hidreamConfig.prompt=t,e.framepackConfig.prompt=t,e.selfieConfig.prompt=t,e.chromaConfig.prompt=t,e.veo3Config.prompt=t,e.veo31Config.prompt=t,e.fluxKontextDevConfig.prompt=t,e.mangoConfig.prompt=t,e.guavaConfig.prompt=t,e.nanoBananaV2Config.prompt=t,e.kiwiConfig.prompt=t,e.cherryConfig.prompt=t,e.melonConfig.prompt=t,e.plumConfig.prompt=t,e.lemonConfig.prompt=t,e.minimaxH3Config.prompt=t,e.seedAudioConfig.prompt=t,e.raspberryConfig.prompt=t,e.grokImageConfig.prompt=t,e.grokVideoConfig.prompt=t,e.berryConfig.prompt=t,e.gptImage2Config.prompt=t,e.pearC
1onfig.prompt=t,e.blueberryConfig.prompt=t,e.peachConfig.prompt=t,e.peachMaxConfig.prompt=t,e.qwenImageConfig.prompt=t,e.qwenImageEditPlusConfig.prompt=t,e.zImageConfig.prompt=t,e.krea2Config.prompt=t,e.animaConfig.prompt=t,e.flux2Config.prompt=t}),aspectRatio:tb.vW.PORTRAIT,setAspectRatio:t=>e(e=>{e.aspectRatio=t,e.fluxConfig.aspect_ratio=t,e.stableDiffusionV15Config.aspect_ratio=t,e.stableDiffusionV35LargeConfig.aspect_ratio=t,e.stableDiffusionV35MediumConfig.aspect_ratio=t,e.stableDiffusionXLConfig.aspect_ratio=t,e.sdxlPlusConfig.aspect_ratio=t,e.ltxVideoConfig.aspect_ratio=t,e.wanConfig.aspect_ratio=t,e.wan22Config.aspect_ratio=t,e.hidreamConfig.aspect_ratio=t,e.chromaConfig.aspect_ratio=t,e.fluxKontextDevConfig.aspect_ratio=t,e.mangoConfig.aspect_ratio=t,e.guavaConfig.aspect_ratio=t,e.gptImage2Config.aspect_ratio=t;let r=(0,ts.Hv)(t);Object.values(eG.t6).includes(r)&&(e.nanoBananaV2Config.nano_banana_v2_aspect_ratio=r),e.qwenImageConfig.aspect_ratio=t,e.qwenImageEditPlusConfig.aspect_ratio=t,e.zImageConfig.aspect_ratio=t,e.krea2Config.aspect_ratio=t,e.minimaxH3Config.aspect_ratio=t,e.animaConfig.aspect_ratio=t,e.flux2Config.aspect_ratio=t}),image:null,setImage:t=>e(e=>{e.image=null!=t?t:null,e.fluxConfig.image=null!=t?t:void 0,e.stableDiffusionV15Config.image=null!=t?t:void 0,e.stableDiffusionV35LargeConfig.image=null!=t?t:void 0,e.stableDiffusionV35MediumConfig.image=null!=t?t:void 0,e.stableDiffusionXLConfig.image=null!=t?t:void 0,e.sdxlPlusConfig.image=null!=t?t:void 0,e.ltxVideoConfig.image=null!=t?t:void 0,e.wanConfig.image=null!=t?t:void 0,e.wan22Config.image=null!=t?t:void 0,e.framepackConfig.image=null!=t?t:void 0,e.selfieConfig.image=null!=t?t:void 0,e.fluxKontextDevConfig.image=null!=t?t:void 0,e.mangoConfig.image=null!=t?t:void 0,e.guavaConfig.image=null!=t?t:void 0,e.nanoBananaV2Config.image=null!=t?t:void 0,e.kiwiConfig.image=null!=t?t:void 0,e.cherryConfig.image=null!=t?t:void 0,e.melonConfig.image=null!=t?t:void 0,e.plumConfig.image=null!=t?t:void 0,e.lemonConfig.image=null!=t?t:void 0,e.minimaxH3Config.image=null!=t?t:void 0,e.seedAudioConfig.image=null!=t?t:void 0,e.raspberryConfig.image=null!=t?t:void 0,e.grokImageConfig.image=null!=t?t:void 0,e.grokVideoConfig.image=null!=t?t:void 0,e.berryConfig.image=null!=t?t:void 0,e.gptImage2Config.image=null!=t?t:void 0,e.pearConfig.image=null!=t?t:void 0,e.blueberryConfig.image=null!=t?t:void 0,e.peachConfig.image=null!=t?t:void 0,e.peachMaxConfig.image=null!=t?t:void 0,e.veo31Config.image=null!=t?t:void 0,e.qwenImageConfig.image=null!=t?t:void 0,e.qwenImageEditPlusConfig.image=null!=t?t:void 0,e.zImageConfig.image=null!=t?t:void 0,e.flux2Config.image=null!=t?t:void 0}),lastImage:null,setLastImage:t=>e(e=>{e.lastImage=t;let r=null!=t?t:void 0;e.wanConfig.last_image=r,e.framepackConfig.last_image=r,e.peachMaxConfig.last_image=r,e.veo31Config.last_image=r,e.blueberryConfig.last_image=r}),additionalImages:[],setAdditionalImages:t=>e(e=>{e.additionalImages=null!=t?t:null;let r=null!=t?t:void 0;e.mangoConfig.additional_images=r,e.guavaConfig.additional_images=r,e.nanoBananaV2Config.additional_images=r,e.flux2Config.additional_images=r,e.qwenImageEditPlusConfig.additional_images=r,e.cherryConfig.additional_images=r,e.melonConfig.additional_images=r,e.plumConfig.additional_images=r,e.lemonConfig.additional_images=r,e.minimaxH3Config.additional_images=r,e.raspberryConfig.additional_images=r,e.grokImageConfig.additional_images=r,e.grokVideoConfig.additional_images=r,e.berryConfig.additional_images=r,e.gptImage2Config.additional_images=r}),addImage:e=>{let{image:r,additionalImages:i}=t();r?t().setAdditionalImages([...null!=i?i:[],e]):t().setImage(e)},removeImage:e=>{let{image:r,additionalImages:i}=t(),a=null!=i?i:[];if(r===e)if(a.length>0){let[e,...r]=a;t().setImage(e),t().setAdditionalImages(r)}else t().setImage(null);else t().setAdditionalImages(a.filter(t=>t!==e))},maskImage:null,setMaskImage:t=>e(e=>{e.maskImage=null!=t?t:null,e.fluxConfig.mask_image=null!=t?t:void 0,e.stableDiffusionV15Config.mask_image=null!=t?t:void 0,e.stableDiffusionV35LargeConfig.mask_image=null!=t?t:void 0,e.stableDiffusionV35MediumConfig.mask_image=null!=t?t:void 0,e.stableDiffusionXLConfig.mask_image=null!=t?t:void 0,e.sdxlPlusConfig.mask_image=null!=t?t:void 0,e.ltxVideoConfig.mask_image=null!=t?t:void 0,e.wanConfig.mask_image=null!=t?t:void 0}),seed:null,setSeed:t=>e(e=>{e.seed=null!=t?t:null,e.fluxConfig.seed=null!=t?t:void 0,e.stableDiffusionV15Config.seed=null!=t?t:void 0,e.stableDiffusionV35LargeConfig.seed=null!=t?t:void 0,e.stableDiffusionV35MediumConfig.seed=null!=t?t:void 0,e.stableDiffusionXLConfig.seed=null!=t?t:void 0,e.sdxlPlusConfig.seed=null!=t?t:void 0,e.ltxVideoConfig.seed=null!=t?t:void 0,e.wanConfig.seed=null!=t?t:void 0,e.wan22Config.seed=null!=t?t:void 0,e.hidreamConfig.seed=null!=t?t:void 0,e.framepackConfig.seed=null!=t?t:void 0,e.selfieConfig.seed=null!=t?t:void 0,e.chromaConfig.seed=null!=t?t:void 0,e.veo3Config.seed=null!=t?t:void 0,e.veo31Config.seed=null!=t?t:void 0,e.fluxKontextDevConfig.seed=null!=t?t:void 0,e.qwenImageConfig.seed=null!=t?t:void 0,e.qwenImageEditPlusConfig.seed=null!=t?t:void 0,e.zImageConfig.seed=null!=t?t:void 0,e.krea2Config.seed=null!=t?t:void 0,e.animaConfig.seed=null!=t?t:void 0,e.flux2Config.seed=null!=t?t:void 0,e.cherryConfig.seed=null!=t?t:void 0,e.melonConfig.seed=null!=t?t:void 0,e.lemonConfig.seed=null!=t?t:void 0,e.minimaxH3Config.seed=null!=t?t:void 0,e.seedAudioConfig.seed=null!=t?t:void 0}),generationMode:e9.o.UNLIMITED,setGenerationMode:t=>e(e=>{e.generationMode=t,e.generationModeForced=!1}),generationModeForced:!1,setGenerationModeForced:t=>e(e=>{e.generationModeForced=t}),activeArchitecture:eS.qH.MANGO,setActiveArchitecture:r=>{let i=t().getArchitectureConfig(r);if(!i)return!1;let a=()=>e(e=>{let t=(0,tA.bA)(e,r);if(t){let i=(0,tA.aR)({sourceConfig:(0,tA.zh)(e),targetArchitecture:r,targetConfig:t});Object.assign(t,i)}e.activeArchitecture=r,e.concept=ty.$p}),n=(0,to.AU)(i),o=(0,g.l)(n,t().generationMode,t().userMembership);return"snap"===o.action?(t().applyArchitectureFloorSnap(o),a(),!0):"gate-at-floor"===o.action?((0,ta.Cf)({config:n,membershipRequired:o.membershipRequired,setGenerationMode:t().setGenerationMode,applyConfig:a}),!1):!!tR(n,a)&&(a(),!0)},applyArchitectureFloorSnap:t=>e(e=>{e[t.configKey]=t.config}),setActiveArchitectureConfig:r=>{let i=(0,to.AU)(r);if(!tR(i,t().setActiveArchitectureConfig))return!1;r=i,e(e=>{switch(r.architecture){case eS.qH.FLUX:e.fluxConfig=r,e.activeArchitecture=eS.qH.FLUX;break;case eS.qH.STABLE_DIFFUSION_V15:e.stableDiffusionV15Config=r,e.activeArchitecture=eS.qH.STABLE_DIFFUSION_V15;break;case eS.qH.STABLE_DIFFUSION_V35_LARGE:e.stableDiffusionV35LargeConfig=r,e.activeArchitecture=eS.qH.STABLE_DIFFUSION_V35_LARGE;break;case eS.qH.STABLE_DIFFUSION_V35_MEDIUM:e.stableDiffusionV35MediumConfig=r,e.activeArchitecture=eS.qH.STABLE_DIFFUSION_V35_MEDIUM;break;case eS.qH.STABLE_DIFFUSION_XL:e.stableDiffusionXLConfig=r,e.activeArchitecture=eS.qH.STABLE_DIFFUSION_XL;break;case eS.qH.SDXL_PLUS:e.sdxlPlusConfig=r,e.activeArchitecture=eS.qH.SDXL_PLUS;break;case eS.qH.LTX_VIDEO:e.ltxVideoConfig=r,e.activeArchitecture=eS.qH.LTX_VIDEO;break;case eS.qH.WAN:e.wanConfig=r,e.activeArchitecture=eS.qH.WAN;break;case eS.qH.WAN_22:e.wan22Config=r,e.activeArchitecture=eS.qH.WAN_22;break;case eS.qH.HIDREAM:e.hidreamConfig=r,e.activeArchitecture=eS.qH.HIDREAM;break;case eS.qH.FRAMEPACK:e.framepackConfig=r,e.activeArchitecture=eS.qH.FRAMEPACK;break;case eS.qH.SELFIE:e.selfieConfig=r,e.activeArchitecture=eS.qH.SELFIE;break;case eS.qH.CHROMA:e.chromaConfig=r,e.activeArchitecture=eS.qH.CHROMA;break;case eS.qH.VEO3:e.veo3Config=r,e.activeArchitecture=eS.qH.VEO3;break;case eS.qH.VEO3_1:e.veo31Config=r,e.activeArchitecture=eS.qH.VEO3_1;break;case eS.qH.SEEDVR2:e.seedvr2Config=r,e.activeArchitecture=eS.qH.SEEDVR2;break;case eS.qH.FLUX_KONTEXT_DEV:e.fluxKontextDevConfig=r,e.activeArchitecture=eS.qH.FLUX_KONTEXT_DEV;break;case eS.qH.MANGO:e.mangoConfig=r,e.activeArchitecture=eS.qH.MANGO;break;case eS.qH.GUAVA:e.guavaConfig=r,e.activeArchitecture=eS.qH.GUAVA;break;case eS.qH.NANO_BANANA_V2:e.nanoBananaV2Config=r,e.activeArchitecture=eS.qH.NANO_BANANA_V2;break;case eS.qH.KIWI:e.kiwiConfig=r,e.activeArchitecture=eS.qH.KIWI;break;case eS.qH.CHERRY:e.cherryConfig=r,e.activeArchitecture=eS.qH.CHERRY;break;case eS.qH.MELON:e.melonConfig=r,e.activeArchitecture=eS.qH.MELON;break;case eS.qH.PLUM:e.plumConfig=r,e.activeArchitecture=eS.qH.PLUM;break;case eS.qH.LEMON:e.lemonConfig=r,e.activeArchitecture=eS.qH.LEMON;break;case eS.qH.MINIMAX_H3:e.minimaxH3Config=r,e.activeArchitecture=eS.qH.MINIMAX_H3;break;case eS.qH.SEED_AUDIO:e.seedAudioConfig=r,e.activeArchitecture=eS.qH.SEED_AUDIO;break;case eS.qH.RASPBERRY:e.raspberryConfig=r,e.activeArchitecture=eS.qH.RASPBERRY;break;case eS.qH.GROK_IMAGE:e.grokImageConfig=r,e.activeArchitecture=eS.qH.GROK_IMAGE;break;case eS.qH.GROK_VIDEO:e.grokVideoConfig=r,e.activeArchitecture=eS.qH.GROK_VIDEO;break;case eS.qH.BERRY:e.berryConfig=r,e.activeArchitecture=eS.qH.BERRY;break;case eS.qH.GPT_IMAGE_2:e.gptImage2Config=r,e.activeArchitecture=eS.qH.GPT_IMAGE_2;break;case eS.qH.PEAR:e.pearConfig=r,e.activeArchitecture=eS.qH.PEAR;break;case eS.qH.BLUEBERRY:e.blueberryConfig=r,e.activeArchitecture=eS.qH.BLUEBERRY;break;case eS.qH.PEACH:e.peachConfig=r,e.activeArchitecture=eS.qH.PEACH;break;case eS.qH.PEACH_MAX:e.peachMaxConfig=r,e.activeArchitecture=eS.qH.PEACH_MAX;break;case eS.qH.QWEN_IMAGE:e.qwenImageConfig=r,e.activeArchitecture=eS.qH.QWEN_IMAGE;break;case eS.qH.QWEN_IMAGE_EDIT_PLUS:e.qwenImageEditPlusConfig=r,e.activeArchitecture=eS.qH.QWEN_IMAGE_EDIT_PLUS;break;case eS.qH.Z_IMAGE:e.zImageConfig=r,e.activeArchitecture=eS.qH.Z_IMAGE;break;case eS.qH.KREA_2:e.krea2Config=r,e.activeArchitecture=eS.qH.KREA_2;break;case eS.qH.ANIMA:e.animaConfig=r,e.activeArchitecture=eS.qH.ANIMA;break;case eS.qH.FLUX2:e.flux2Config=r,e.activeArchitecture=eS.qH.FLUX2;break;default:throw Error("Unsupported architecture: ".concat(r.architecture))}});let a=t();return void 0!==r.prompt&&a.setPrompt(r.prompt),r.aspect_ratio&&a.setAspectRatio(r.aspect_ratio),a.setSeed((0,td.g)(r.seed)),a.setImage((0,td.g)(r.image)),a.setLastImage((0,td.g)(r.last_image)),a.setAdditionalImages((0,td.g)(r.additional_images)),a.setMaskImage((0,td.g)(r.mask_image)),a.setSeed((0,td.g)(r.seed)),!0},fluxConfig:eR.b0,setFluxConfig:r=>{tR(r,t().setFluxConfig)&&e(e=>{e.fluxConfig=r})},stableDiffusionV15Config:e$.Wt,setStableDiffusionV15Config:r=>{tR(r,t().setStableDiffusionV15Config)&&e(e=>{e.stableDiffusionV15Config=r})},stableDiffusionV35LargeConfig:eJ.E$,setStableDiffusionV35LargeConfig:r=>{tR(r,t().setStableDiffusionV35LargeConfig)&&e(e=>{e.stableDiffusionV35LargeConfig=r})},stableDiffusionV35MediumConfig:e0._W,setStableDiffusionV35MediumConfig:r=>{tR(r,t().setStableDiffusionV35MediumConfig)&&e(e=>{e.stableDiffusionV35MediumConfig=r})},stableDiffusionXLConfig:e1._e,setStableDiffusionXLConfig:r=>{tR(r,t().setStableDiffusionXLConfig)&&e(e=>{e.stableDiffusionXLConfig=r})},sdxlPlusConfig:eY.ye,setSdxlPlusConfig:r=>{tR(r,t().setSdxlPlusConfig)&&e(e=>{e.sdxlPlusConfig=r})},ltxVideoConfig:eN.oH,setLtxVideoConfig:r=>{tR(r,t().setLtxVideoConfig)&&e(e=>{e.ltxVideoConfig=r})},wanConfig:e3.OH,setWanConfig:r=>{tR(r,t().setWanConfig)&&e(e=>{e.wanConfig=r})},wan22Config:e4.iH,setWan22Config:r=>{tR(r,t().setWan22Config)&&e(e=>{e.wan22Config=r})},framepackConfig:ew.IJ,setFramepackConfig:r=>{tR(r,t().setFramepackConfig)&&e(e=>{e.framepackConfig=r})},getArchitectureConfig:e=>{let r=t();switch(e){case eS.qH.FLUX:return r.fluxConfig;case eS.qH.STABLE_DIFFUSION_V15:return r.stableDiffusionV15Config;case eS.qH.STABLE_DIFFUSION_V35_LARGE:return r.stableDiffusionV35LargeConfig;case eS.qH.STABLE_DIFFUSION_V35_MEDIUM:return r.stableDiffusionV35MediumConfig;case eS.qH.STABLE_DIFFUSION_XL:return r.stableDiffusionXLConfig;case eS.qH.SDXL_PLUS:return r.sdxlPlusConfig;case eS.qH.LTX_VIDEO:return r.ltxVideoConfig;case eS.qH.WAN:return r.wanConfig;case eS.qH.WAN_22:return r.wan22Config;case eS.qH.HIDREAM:return r.hidreamConfig;case eS.qH.FRAMEPACK:return r.framepackConfig;case eS.qH.SELFIE:return r.selfieConfig;case eS.qH.CHROMA:return r.chromaConfig;case eS.qH.VEO3:return r.veo3Config;case eS.qH.VEO3_1:return r.veo31Config;case eS.qH.SEEDVR2:return r.seedvr2Config;case eS.qH.FLUX_KONTEXT_DEV:return r.fluxKontextDevConfig;case eS.qH.MANGO:return r.mangoConfig;case eS.qH.GUAVA:return r.guavaConfig;case eS.qH.NANO_BANANA_V2:return r.nanoBananaV2Config;case eS.qH.KIWI:return r.kiwiConfig;case eS.qH.CHERRY:return r.cherryConfig;case eS.qH.MELON:return r.melonConfig;case eS.qH.PLUM:return r.plumConfig;case eS.qH.LEMON:return r.lemonConfig;case eS.qH.MINIMAX_H3:return r.minimaxH3Config;case eS.qH.SEED_AUDIO:return r.seedAudioConfig;case eS.qH.RASPBERRY:return r.raspberryConfig;case eS.qH.GROK_IMAGE:return r.grokImageConfig;case eS.qH.GROK_VIDEO:return r.grokVideoConfig;case eS.qH.BERRY:return r.berryConfig;case eS.qH.GPT_IMAGE_2:return r.gptImage2Config;case eS.qH.PEAR:return r.pearConfig;case eS.qH.BLUEBERRY:return r.blueberryConfig;case eS.qH.PEACH:return r.peachConfig;case eS.qH.PEACH_MAX:return r.peachMaxConfig;case eS.qH.QWEN_IMAGE:return r.qwenImageConfig;case eS.qH.QWEN_IMAGE_EDIT_PLUS:return r.qwenImageEditPlusConfig;case eS.qH.Z_IMAGE:return r.zImageConfig;case eS.qH.KREA_2:return r.krea2Config;case eS.qH.ANIMA:return r.animaConfig;case eS.qH.FLUX2:return r.flux2Config;default:return}},getActiveArchitectureConfig:()=>{let r=t(),i=t().getArchitectureConfig(r.activeArchitecture);
1return i||(console.warn('Unknown architecture "'.concat(r.activeArchitecture,'" in persisted state — resetting to Mango.')),queueMicrotask(()=>{e(e=>{e.activeArchitecture=eS.qH.MANGO})}),r.mangoConfig)},getAspectRatioForArchitecture:e=>{var r;let i=t(),a=(0,ex.dK)(e);if(!a)return null;if("aspect_ratio"===a)return(0,ex.xp)(i.aspectRatio);let n=i[(0,tl.i)(e)+"Config"];return n&&null!==(r=n[a])&&void 0!==r?r:(0,ex.ZX)(e)},setAspectRatioForArchitecture:(r,i)=>{let a=(0,ex.dK)(r);if(a){if("aspect_ratio"===a){let e=(0,ex.jW)(i);e&&t().setAspectRatio(e);return}(0,ex.tg)(r)&&e(e=>{let t=(0,tl.i)(r)+"Config",n=e[t];n&&(e[t]={...n,[a]:i})})}},hidreamConfig:ek.Iw,setHidreamConfig:r=>{tR(r,t().setHidreamConfig)&&e(e=>{e.hidreamConfig=r})},selfieConfig:eQ.sc,setSelfieConfig:r=>{tR(r,t().setSelfieConfig)&&e(e=>{e.selfieConfig=r})},activePowerPack:null,setActivePowerPack:t=>e(e=>{e.activePowerPack=t,t?e.maxGenQueueSize=99:e.maxGenQueueSize=9}),availablePowerPacks:[],setAvailablePowerPacks:t=>e(e=>{e.availablePowerPacks=t}),maxPowerPackActiveJobs:4,setMaxPowerPackActiveJobs:t=>e(e=>{e.maxPowerPackActiveJobs=t}),maxGemActiveJobs:1,setMaxGemActiveJobs:t=>e(e=>{e.maxGemActiveJobs=t}),availableGems:0,setAvailableGems:t=>e(e=>{e.availableGems=t}),gemBreakdown:tv,setGemBreakdown:t=>e(e=>{e.gemBreakdown=t}),chromaConfig:eA.Wk,setChromaConfig:r=>{tR(r,t().setChromaConfig)&&e(e=>{e.chromaConfig=r})},veo3Config:e2.rI,setVeo3Config:r=>{tR(r,t().setVeo3Config)&&e(e=>{e.veo3Config=r})},veo31Config:e5.dX,setVeo31Config:r=>{tR(r,t().setVeo31Config)&&e(e=>{e.veo31Config=r})},seedvr2Config:ee.DI,setSeedvr2Config:r=>{tR(r,t().setSeedvr2Config)&&e(e=>{e.seedvr2Config=r})},appInputConfigs:ef(),setAppInputConfig:(t,r)=>e(e=>{e.appInputConfigs[t]={...e.appInputConfigs[t],...r}}
1),clearAppInputConfig:t=>e(e=>{e.appInputConfigs[t]=function(e){let t=eh[e];return t?{..."function"==typeof t?t():t}:{}}(t)}),pendingAppMedia:null,setPendingAppMedia:t=>e(e=>{e.pendingAppMedia=t}),fluxKontextDevConfig:eC.zG,setFluxKontextDevConfig:r=>{tR(r,t().setFluxKontextDevConfig)&&e(e=>{e.fluxKontextDevConfig=r})},mangoConfig:eH.wW,setMangoConfig:r=>{tR(r,t().setMangoConfig)&&e(e=>{e.mangoConfig=r})},guavaConfig:eM.aD,setGuavaConfig:r=>{tR(r,t().setGuavaConfig)&&e(e=>{e.guavaConfig=r})},nanoBananaV2Config:eq.Zd,setNanoBananaV2Config:r=>{tR(r,t().setNanoBananaV2Config)&&e(e=>{e.nanoBananaV2Config=r})},kiwiConfig:eO.q$,setKiwiConfig:r=>{tR(r,t().setKiwiConfig)&&e(e=>{e.kiwiConfig=r})},cherryConfig:eb.TF,setCherryConfig:r=>{tR(r,t().setCherryConfig)&&e(e=>{e.cherryConfig=r})},melonConfig:ej.pU,setMelonConfig:r=>{tR(r,t().setMelonConfig)&&e(e=>{e.melonConfig=r})},plumConfig:eK.yc,setPlumConfig:r=>{tR(r,t().setPlumConfig)&&e(e=>{e.plumConfig=r})},lemonConfig:eU.Rc,setLemonConfig:r=>{tR(r,t().setLemonConfig)&&e(e=>{e.lemonConfig=r})},minimaxH3Config:eL.NW,setMinimaxH3Config:r=>{tR(r,t().setMinimaxH3Config)&&e(e=>{e.minimaxH3Config=r})},seedAudioConfig:eZ.wM,setSeedAudioConfig:r=>{tR(r,t().setSeedAudioConfig)&&e(e=>{e.seedAudioConfig=r})},raspberryConfig:eX.q7,setRaspberryConfig:r=>{tR(r,t().setRaspberryConfig)&&e(e=>{e.raspberryConfig=r})},grokImageConfig:eP.dO,setGrokImageConfig:r=>{tR(r,t().setGrokImageConfig)&&e(e=>{e.grokImageConfig=r})},grokVideoConfig:eT.xv,setGrokVideoConfig:r=>{tR(r,t().setGrokVideoConfig)&&e(e=>{e.grokVideoConfig=r})},berryConfig:e_.im,setBerryConfig:r=>{tR(r,t().setBerryConfig)&&e(e=>{e.berryConfig=r})},gptImage2Config:eE.s0,setGptImage2Config:r=>{tR(r,t().setGptImage2Config)&&e(e=>{e.gptImage2Config=r})},pearConfig:eV.u,setPearConfig:r=>{let i=(0,to.AU)(r);return!!tR(i,t().setPearConfig)&&(e(e=>{e.pearConfig=i}),!0)},blueberryConfig:ey.Wc,setBlueberryConfig:r=>{tR(r,t().setBlueberryConfig)&&e(e=>{e.blueberryConfig=r})},peachConfig:eB.Xe,setPeachConfig:r=>{tR(r,t().setPeachConfig)&&e(e=>{e.peachConfig=r})},peachMaxConfig:eF.SI,setPeachMaxConfig:r=>{tR(r,t().setPeachMaxConfig)&&e(e=>{e.peachMaxConfig=r})},qwenImageConfig:ez.H3,setQwenImageConfig:r=>{tR(r,t().setQwenImageConfig)&&e(e=>{e.qwenImageConfig=r})},qwenImageEditPlusConfig:eW.JB,setQwenImageEditPlusConfig:r=>{tR(r,t().setQwenImageEditPlusConfig)&&e(e=>{e.qwenImageEditPlusConfig=r})},zImageConfig:e6.qo,setZImageConfig:r=>{tR(r,t().setZImageConfig)&&e(e=>{e.zImageConfig=r})},krea2Config:eD.Mp,setKrea2Config:r=>{tR(r,t().setKrea2Config)&&e(e=>{e.krea2Config=r})},animaConfig:ev.WQ,setAnimaConfig:r=>{tR(r,t().setAnimaConfig)&&e(e=>{e.animaConfig=r})},flux2Config:eI.dk,setFlux2Config:r=>{tR(r,t().setFlux2Config)&&e(e=>{e.flux2Config=r})},editPrompt:"",setEditPrompt:t=>e(e=>{e.editPrompt=t}),editModelId:s.Fl,setEditModelId:t=>e(e=>{e.editModelId=t}),animateModelId:o.IP,setAnimateModelId:t=>e(e=>{e.animateModelId=t}),promptRequiresDebounce:!1,setPromptRequiresDebounce:t=>e(e=>{e.promptRequiresDebounce=t}),setLatestViewedAnnouncementId:t=>e(e=>{e.latestViewedAnnouncementId=t}),storyboardClips:[],storyboardAspectRatio:"9:16",setStoryboardClips:t=>e(e=>{e.storyboardClips=t.slice(0,6).map(e=>{var t;return{...e,storyboardId:null!==(t=e.storyboardId)&&void 0!==t?t:(0,H.Hd)()}})}),addStoryboardClip:async r=>{var i;let{storyboardClips:a}=t();if(a.length>=6)return(0,w.bA)({title:"Storyboard Full",message:"Remove a clip to add more (max 6)"}),!1;if("tags"in r&&Array.isArray(r.tags)&&r.tags.includes(H.NO))return(0,w.bA)({title:"Storyboard Clip Not Allowed",message:"Storyboard creations cannot be added back into a storyboard."}),!1;let n=(0,H.ZP)(r),o=await (0,j.q)(n),s={...r,duration:null!=o?o:r.duration,storyboardId:null!==(i=r.storyboardId)&&void 0!==i?i:(0,H.Hd)()};return e(e=>{e.storyboardClips.push(s)}),(0,w.wB)({title:"Added to Storyboard",message:"Clip added to your storyboard"}),!0},removeStoryboardClip:t=>e(e=>{e.storyboardClips=e.storyboardClips.filter((e,r)=>r!==t)}),moveStoryboardClip:(t,r)=>e(e=>{let i=[...e.storyboardClips],[a]=i.splice(t,1);i.splice(r,0,a),e.storyboardClips=i}),setStoryboardAspectRatio:t=>e(e=>{e.storyboardAspectRatio=t}),clearStoryboard:()=>e(e=>{e.storyboardClips=[]})}),{name:"new-mage",version:1,skipHydration:!0,storage:(0,tp.f)({getItem:e=>window.localStorage.getItem(e),setItem:(e,t)=>
1{try{window.localStorage.setItem(e,t)}catch(e){tI(e,t)}},removeItem:e=>window.localStorage.removeItem(e)},{debounceTime:200}),merge:(e,t)=>{let r={...t,...e};return r.appInputConfigs={...ef(),...r.appInputConfigs},r.settings=m(r.settings),r.recentCharacters=r.recentCharacters.slice(0,30),r.recentReferences=r.recentReferences.slice(0,30),r.userIsAdmin=null!==r.userMageRole,(0,g.E)(r),r},partialize:e=>({concept:e.concept,user:e.user,userMembership:e.userMembership,userMageRole:e.userMageRole,pendingReferralUid:e.pendingReferralUid,homePageMode:e.homePageMode,storySeenAt:e.storySeenAt,promptBarMode:e.promptBarMode,promptBarMinimized:e.promptBarMinimized,assistantModelIds:e.assistantModelIds,settings:e.settings,announcementKey:e.announcementKey,announcementPopupKey:e.announcementPopupKey,unlimitedGenCounts:e.unlimitedGenCounts,characterReferenceSuggestionGenCount:e.characterReferenceSuggestionGenCount,gemGenCounts:e.gemGenCounts,prompt:e.prompt,aspectRatio:e.aspectRatio,image:e.image,additionalImages:e.additionalImages,maskImage:e.maskImage,generationMode:e.generationMode,generationModeForced:e.generationModeForced,activeArchitecture:e.activeArchitecture,fluxConfig:e.fluxConfig,stableDiffusionV15Config:e.stableDiffusionV15Config,stableDiffusionV35LargeConfig:e.stableDiffusionV35LargeConfig,stableDiffusionV35MediumConfig:e.stableDiffusionV35MediumConfig,stableDiffusionXLConfig:e.stableDiffusionXLConfig,sdxlPlusConfig:e.sdxlPlusConfig,ltxVideoConfig:e.ltxVideoConfig,wanConfig:e.wanConfig,wan22Config:e.wan22Config,hidreamConfig:e.hidreamConfig,framepackConfig:e.framepackConfig,selfieConfig:e.selfieConfig,chromaConfig:e.chromaConfig,veo3Config:e.veo3Config,veo31Config:e.veo31Config,seedvr2Config:e.seedvr2Config,fluxKontextDevConfig:e.fluxKontextDevConfig,qwenImageConfig:e.qwenImageConfig,qwenImageEditPlusConfig:e.qwenImageEditPlusConfig,flux2Config:e.flux2Config,mangoConfig:e.mangoConfig,guavaConfig:e.guavaConfig,nanoBananaV2Config:e.nanoBananaV2Config,peachConfig:e.peachConfig,peachMaxConfig:e.peachMaxConfig,kiwiConfig:e.kiwiConfig,cherryConfig:e.cherryConfig,melonConfig:e.melonConfig,plumConfig:e.plumConfig,lemonConfig:e.lemonConfig,minimaxH3Config:e.minimaxH3Config,seedAudioConfig:e.seedAudioConfig,raspberryConfig:e.raspberryConfig,grokImageConfig:e.grokImageConfig,grokVideoConfig:e.grokVideoConfig,berryConfig:e.berryConfig,gptImage2Config:e.gptImage2Config,pearConfig:e.pearConfig,blueberryConfig:e.blueberryConfig,zImageConfig:e.zImageConfig,krea2Config:e.krea2Config,animaConfig:e.animaConfig,architectureLikes:e.architectureLikes,postModalViewScale:e.postModalViewScale,latestViewedAnnouncementId:e.latestViewedAnnouncementId,storyboardClips:e.storyboardClips,storyboardAspectRatio:e.storyboardAspectRatio,recentCharacters:e.recentCharacters,recentReferences:e.recentReferences,appInputConfigs:e.appInputConfigs,editModelId:e.editModelId,animateModelId:e.animateModelId})})))),tw=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return tC((0,Z.k)(e=>z()(e,t)))}},78507:(e,t,r)=>{"use strict";r.d(t,{$:()=>C,b:()=>w});var i=r(95155),a=r(68844),n=r(67457),o=r(61282),s=r(77567),l=r(23552),c=r(42840);function d(e){let{style:t}=e,{userMembership:r}=(0,s.xV)((0,l.k)(e=>({userMembership:e.userMembership}))),a=r===o.c.FREE,d=(0,n.Ou)(o.c.FREE);return(0,i.jsx)(c.M,{title:d.title,price:d.monthlyPriceUsd,features:d.features,isCurrentPlan:a,onSelect:()=>{},style:t})}var u=r(95052),p=r(79119),m=r(18110),g=r(18403),h=r(21220),f=r(70112),v=r(93751),_=r(95642),y=r(58887),b=r(89047),A=r(26903),S=r(91423),x=r(40024),R=r(6874),I=r.n(R);function C(e){let{userMembership:t,membershipRequired:r,title:a,description:n,leftCard:o,rightCardButtonText:l}=e,c=(0,s.xV)(e=>e.isDesktop);return(0,i.jsx)(g.Card,{bg:"dark.9",withBorder:!0,p:"lg",radius:"lg",children:(0,i.jsxs)(h.Stack,{gap:"lg",children:[(0,i.jsxs)(f.Group,{justify:"space-between",children:[(0,i.jsx)(v.Title,{size:c?"h3":"h4",order:3,c:"white",children:null!=a?a:"Upgrade Membership"}),(0,i.jsx)(_.CloseButton,{onClick:()=>(0,S.s7)(),"aria-label":"Close modal",size:"lg",c:"white"})]}),n&&(0,i.jsx)(y.Text,{component:"div",size:"sm",c:"white",mt:-10,children:n}),(0,i.jsxs)(b.Grid,{align:"stretch",children:[c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(b.Grid.Col,{span:"auto",children:null!=o?o:w(t)}),(0,i.jsx)(b.Grid.Col,{span:"content",style:{display:"flex",alignItems:"center"},children:(0,i.jsx)(x.A,{size:24,color:"white"})})]}),(0,i.jsx)(b.Grid.Col,{span:"auto",children:w(r,l)})]}),(0,i.jsx)(A.Button,{mx:"auto",variant:"subtle",component:I(),href:"/membership",onClick:()=>(0,S.s7)(),children:"View all membership plans"})]})})}function w(e,t){return e===o.c.BASIC?(0,i.jsx)(a.K,{style:{height:"100%"},buttonText:t}):e===o.c.PRO?(0,i.jsx)(p.D,{style:{height:"100%"},buttonText:t}):e===o.c.PRO_PLUS?(0,i.jsx)(m.h,{style:{height:"100%"},buttonText:t}):e===o.c.MAX?(0,i.jsx)(u.k,{style:{height:"100%"},buttonText:t}):(0,i.jsx)(d,{style:{height:"100%"}})}},78915:(e,t,r)=>{"use strict";async function i(e){return(await e)[0]}r.d(t,{T:()=>i})},79041:(e,t,r)=>{"use strict";r.d(t,{KT:()=>d,LD:()=>l,eO:()=>c,og:()=>s,xm:()=>u});var i=r(20036),a=r(62664),n=r(44164);let o=[i.AU.RESOLUTION_480P,i.AU.RESOLUTION_720P],s=[{...a.dz,resolutions:o},{...a.rK,resolutions:o},{...a._1,resolutions:o},a.eR,a.zK],l=a.dz.id;function c(e,t,r,i){return(0,n.EB)(s,e,t,r,i,l)}let d={image:null,width:0,height:0,character:void 0},u={characterOne:d,characterTwo:d,prompt:"",modelId:l,resolution:o[0],duration:i.sr.DURATION_4S,aspectRatio:i.lr.ASPECT_RATIO_16_9}},79119:(e,t,r)=>{"use strict";r.d(t,{D:()=>m});var i=r(95155),a=r(67457),n=r(61282),o=r(77567),s=r(41441),l=r(16791),c=r(96089),d=r(12115),u=r(23552),p=r(42840);
1function m(e){let{style:t,buttonText:r,recommendation:m}=e,[g,h]=(0,d.useState)(!1),{userMembership:f,user:v}=(0,o.xV)((0,u.k)(e=>({userMembership:e.userMembership,user:e.user}))),_=f===n.c.PRO,y=(0,a.Ou)(n.c.PRO);return(0,i.jsx)(p.M,{title:y.title,price:y.monthlyPriceUsd,features:y.features,isCurrentPlan:_,onSelect:()=>{(0,c.M3)()&&v&&(f===n.c.FREE?(h(!0),(0,s.m)(n.c.PRO).then(e=>{window.location.assign(e)}).catch(e=>{h(!1),console.error("Error checking out",e),(0,l.p6)({title:"Checkout Issue",message:"We had an issue redirecting you. Try again?"})})):f===n.c.PRO?(0,l.bA)({title:"Already Subscribed!",message:"You are already a Pro member. Congrats!"}):(h(!0),(0,s.e)().then(e=>{window.location.assign(e)}).catch(e=>{h(!1),console.error("Error redirection to portal",e),(0,l.p6)({title:"Checkout Issue",message:"We had an issue redirecting you. Try again?"})})))},backgroundImage:y.backgroundImage,loading:g,style:t,buttonText:r,recommendation:m})}},80564:(e,t,r)=>{"use strict";r.d(t,{T:()=>n});var i=r(25102),a=r(63015);function n(e){var t,r,n;let o=null!==(t=e.model_id)&&void 0!==t?t:a.pU.model_id,s=null!==(r=e.resolution)&&void 0!==r?r:a.pU.resolution,l=null!==(n=e.duration)&&void 0!==n?n:a.pU.duration,c=78.75*(!1!==e.generate_audio);return Math.ceil(function(e,t){if(e===i.VI.MELON){if(t===i.gk.RESOLUTION_540P)return 36.75;if(t===i.gk.RESOLUTION_720P)return 57.75;if(t===i.gk.RESOLUTION_1080P)return 68.25}if(e===i.VI.MELON_PRO){if(t===i.gk.RESOLUTION_540P)return 47.25;if(t===i.gk.RESOLUTION_720P)return 105;if(t===i.gk.RESOLUTION_1080P)return 126}throw Error("Unknown configuration for Melon (model: ".concat(e,", resolution: ").concat(t,")"))}(o,s)*Number(l)+c)}},80596:(e,t,r)=>{"use strict";r.d(t,{HR:()=>s,Mp:()=>l,OW:()=>c});var i=r(4717),a=r(56800),n=r(42831);let o="krea-2-turbo",s="krea-2",l={architecture:a.qH.KREA_2,model_id:o,prompt:"",resolution:n.A.RES_1K,scheduler:n.p.EULER,num_inference_steps:8,guidance_scale:0,aspect_ratio:i.vW.PORTRAIT},c={architecture:a.qH.KREA_2,name:"Krea 2",short_name:"Krea 2",popularity:0,tags:[a.fZ,a.R$],models:[{id:o,name:"Krea 2 Turbo"}],api_path:"/api/v1/krea-2",agent:{description:"Fast general image model.",defaultConfig:l,options:{resolution:Object.values(n.A)}}}},80642:(e,t,r)=>{"use strict";r.d(t,{EI:()=>a,FO:()=>m,Gt:()=>s,Hx:()=>c,N3:()=>p,XG:()=>o,_K:()=>u,af:()=>i,rG:()=>n,sb:()=>l,sd:()=>d});class i extends Error{}class a extends Error{}class n extends Error{}class o extends Error{constructor(e){super("Blocked: ".concat(e)),this.prompt=e}}class s extends Error{constructor(e,t,r){super("Insufficient Gems: ".concat(e)),this.prompt=e,this.gemsRequired=t,this.item=r}}class l extends Error{constructor(e){super("Forbidden: ".concat(e)),this.prompt=e}}class c extends Error{constructor(e,t){super(e),this.requiredMembership=t}}class d extends Error{}class u extends Error{}
1class p extends Error{}class m extends Error{constructor(e){super("This configuration requires On-demand generation."),this.config=e}}},81152:(e,t,r)=>{"use strict";r.d(t,{Y:()=>s});var i=r(41770),a=r(47370),n=r(57411),o=r(52738);function s(e){var t;if(e.video)return(0,o.v)(e),Math.ceil((Math.min(e.video_width,e.video_height)<=n.yV?90:120)*e.video_duration_s);let r=e.resolution===a.RR.RES_720P,s=Math.min((0,i.S)(e).allImages.length,n.oE);return(r?105:75)*Number(null!==(t=e.duration)&&void 0!==t?t:n.xv.duration)+3*s}},82395:(e,t,r)=>{"use strict";r.d(t,{l:()=>i});var i=function(e){return e.SIZE_240P="240p",e.SIZE_360P="360p",e.SIZE_480P="480p",e.SIZE_720P="720p",e}({})},82646:(e,t,r)=>{"use strict";r.d(t,{$I:()=>a,R3:()=>o,qX:()=>n});let i=new Set(["hailuo_pro","hailuo_standard","kling_v16_pro","kling_v16_standard","kling_v21_master","seedance_lite","seedance_pro","flux_kontext_max","flux_kontext_pro","hunyuan"]),a="Deprecated Architecture",n="This model has been retired and is no longer available on Mage. Please pick a different model to continue.";function o(e){return!!e&&i.has(e)}},83315:(e,t,r)=>{"use strict";r.d(t,{Df:()=>o,iZ:()=>s,vN:()=>n});var i=r(62105);let a=[/failed to fetch/i,/load failed/i,/networkerror when attempting to fetch/i,/^network error$/i,/^error in input stream$/i];function n(e){return e instanceof TypeError&&a.some(t=>t.test(e.message))}function o(e){return e instanceof Error&&"digest"in e&&"string"==typeof e.digest&&e.digest.length>0&&!e.digest.startsWith("NEXT_")?e.digest:null}function s(e){if(n(e))return null;let t=o(e);return null!==t?t:i.Cp(e)}},83880:(e,t,r)=>{"use strict";r.d(t,{BW:()=>x,YH:()=>f,ZW:()=>u,_W:()=>C,aH:()=>S,ab:()=>v,dF:()=>o,fR:()=>s,nQ:()=>_,s6:()=>p,sm:()=>c,vO:()=>h,wn:()=>y,x0:()=>d,x9:()=>A,y6:()=>m,yc:()=>R,zh:()=>b});var i=r(56800),a=r(7538),n=r(84563);let o="plum",s="plum-max",l=[o,s],c={[o]:"Plum",[s]:"Plum Max"};function d(e){return l.includes(e)}let u={[o]:[n.f9.RESOLUTION_768P,n.f9.RESOLUTION_2K],[s]:[n.f9.RESOLUTION_480P,n.f9.RESOLUTION_768P]};function p(e,t){return u[e].some(e=>e===t)}function m(e,t){return p(e,t)?t:n.f9.RESOLUTION_768P}let g=[n.p9.DURATION_5S,n.p9.DURATION_6S,n.p9.DURATION_7S,n.p9.DURATION_8S,n.p9.DURATION_9S,n.p9.DURATION_10S,n.p9.DURATION_11S,n.p9.DURATION_12S,n.p9.DURATION_13S,n.p9.DURATION_14S,n.p9.DURATION_15S],h={[o]:[n.p9.DURATION_4S,...g],[s]:g};function f(e,t){return h[e].some(e=>e===t)}function v(e,t){return f(e,t)?t:h[e][0]}function _(e){if(!d(e.model_id))throw Error("Unknown Plum model: ".concat(e.model_id));return e.model_id}function y(e){var t,r;let i=_(e);return{duration:null!==(t=e.duration)&&void 0!==t?t:h[i][0],resolution:null!==(r=e.resolution)&&void 0!==r?r:u[i][0]}}let b=2,A=15,S=2,x=(0,a.jB)(i.qH.PLUM),R={architecture:i.qH.PLUM,model_id:s,prompt:"",plum_aspect_ratio:n.cU.ASPECT_RATIO_16_9,duration:n.p9.DURATION_5S,resolution:n.f9.RESOLUTION_480P},I={...R,use_character_voices:!0},C={architecture:i.qH.PLUM,name:"Plum",short_name:"Plum",popularity:0,tags:[i.fZ,i.tM],models:[{id:o,name:c[o]},{id:s,name:c[s]}],api_path:"/api/v1/plum",agent:{description:"General video model with generated audio, offered as Plum and the faster Plum Max. Start/end frames and reference images are mutually exclusive; set one kind or the other. On Plum Max a last frame must be paired with a first frame.",defaultConfig:I,options:{byModel:Object.fromEntries(l.map(e=>[e,{resolution:[...u[e]],duration:[...h[e]]}]))},imageInputs:{firstFrame:"first_image",lastFrame:"last_image",references:{field:"image",additionalField:"additional_images"}},videoSource:{field:"videos",durationClaim:"video_duration_s"}}}},84461:(e,t,r)=>{"use strict";r.d(t,{Un:()=>a,tv:()=>i,vr:()=>n});var i=function(e){return e.RES_480P="480p",e.RES_720P="720p",e.RES_1080P="1080p",e}({}),a=function(e){return e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_4_3="4:3",e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_3_4="3:4",e.ASPECT_RATIO_9_16="9:16",e}({}),n=function(e){return e.DURATION_5S="5",e.DURATION_10S="10",e}({})},84471:(e,t,r)=>{"use strict";r.d(t,{Fk:()=>n,Mo:()=>a,UP:()=>s,rM:()=>o});var i=r(39427);let a=[...i.uc,...i.mS,i.Y5,...i.yQ],n=i.sN.id;function o(){return Math.random().toString(36).slice(2)}function s(){return{stage:"explore",gender:"female",starterId:null,starterImageUrl:null,starterImageDimensions:null,starterPreparedImageUrl:null,selectedCreationHistoryId:null,modelId:n,resolution:i.sN.resolutions[0]}}},84563:(e,t,r)=>{"use strict";r.d(t,{cU:()=>a,f9:()=>n,p9:()=>i});var i=function(e){return e.DURATION_4S="4",e.DURATION_5S="5",e.DURATION_6S="6",e.DURATION_7S="7",e.DURATION_8S="8",e.DURATION_9S="9",e.DURATION_10S="10",e.DURATION_11S="11",e.DURATION_12S="12",e.DURATION_13S="13",e.DURATION_14S="14",e.DURATION_15S="15",e}({}),a=function(e){return e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_9_16="9:16",e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_4_3="4:3",e.ASPECT_RATIO_3_4="3:4",e.ASPECT_RATIO_21_9="21:9",e}({}),n=function(e){return e.RESOLUTION_480P="480P",e.RESOLUTION_768P="768P",e.RESOLUTION_2K="2K",e}({})},84574:(e,t,r)=>{"use strict";r.d(t,{Y:()=>i});var i=function(e){return e.RES_1K="1k",e.RES_2K="2k",e}({})},84989:(e,t,r)=>{"use strict";r.d(t,{Wv:()=>n,o4:()=>s,s_:()=>o});let i=[".mp3",".wav",".ogg",".pcm"],a=[".mp4",".webm",".ogg",".mov"];function n(e){if(!e)return!1;let t=e.split("?")[0].toLowerCase();return i.some(e=>t.endsWith(e))}function o(e){let t=e.toLowerCase();return n(t)?"audio":a.some(e=>t.endsWith(e))?"video":"image"}function s(e,t){return{prompt:null==e?void 0:e.prompt,duration:null==t?void 0:t.duration}}},85080:(e,t,r)=>{"use strict";r.d(t,{C:()=>n});var i=r(33508),a=r(12115);function n(e,t,r,n){let[o,s]=(0,a.useState)(null),[l,c]=(0,a.useState)(!1),[d,u]=(0,a.useState)(t||[]),[p,m]=(0,a.useState)(!0);async function g(){c(!0),s(null);try{let t=await (0,i.g)(e,r||100,d.length,n);u(e=>[...e,...t.creations]),m(t.hasMore),s(null)}catch(e){s(e)}finally{c(!1)}}
1return{creations:d,loadMore:g,loading:l,hasMore:p,error:o}}},85442:(e,t,r)=>{"use strict";r.d(t,{_S:()=>p,cV:()=>u,je:()=>d,jj:()=>c});var i=r(20036),a=r(17157),n=r(43050),o=r(86819),s=r(84563),l=r(83880);let c={character:void 0},d={imageUrl:null},u={url:null,durationSeconds:0},p={modelId:l.dF,characters:[,,,].fill(c),references:[,,,].fill(d),audio:u,prompt:"",plumResolution:l.ZW[l.dF][0],plumDuration:l.vO[l.dF][0],plumAspectRatio:s.cU.ASPECT_RATIO_9_16,lemonResolution:o.Rc.resolution,lemonDuration:o.Rc.duration,lemonAspectRatio:n.P4.ASPECT_RATIO_9_16,cherryResolution:a.TF.resolution,cherryDuration:a.TF.duration,cherryAspectRatio:i.lr.ASPECT_RATIO_9_16}},85541:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});var i=r(95155),a=r(77567),n=r(60384),o=r(81001),s=r(30282),l=r(8293),c=r(12115),d=r(23552);function u(e){let{audioId:t,hasAudio:r,isFullscreen:u=!1,isHovered:p=!1,position:m="right"}=e,{unmutedAudioId:g,setUnmutedAudioId:h}=(0,a.xV)((0,d.k)(e=>({unmutedAudioId:e.unmutedAudioId,setUnmutedAudioId:e.setUnmutedAudioId}))),f=g===t,v=!0===r,_=(u||p)&&null!==r;(0,c.useEffect)(()=>{u&&v&&h(t)},[t,v,u,h]),(0,c.useEffect)(()=>()=>{let{unmutedAudioId:e,setUnmutedAudioId:r}=a.xV.getState();e===t&&r(null)},[t]);let y=e=>{e.stopPropagation(),v&&(f?h(null):h(t))},b=v&&f?l.A:s.A,A=v?"white":"dimmed";return(0,i.jsx)(n.Transition,{mounted:_,transition:"fade",duration:200,children:e=>(0,i.jsx)(o.ActionIcon,{variant:"light",color:"gray",radius:"xl",size:"md",onClick:y,disabled:!v,style:{...e,position:"absolute",..."left"===m?{left:8}:{right:8},top:"50%",transform:"translateY(-50%)",zIndex:10,cursor:v?"pointer":"not-allowed"},"aria-label":v?f?"Mute audio":"Unmute audio":"No audio available",children:(0,i.jsx)(b,{size:18,color:"var(--mantine-color-".concat(A,")")})})})}},85818:(e,t,r)=>{"use strict";r.d(t,{Oh:()=>o,Wt:()=>s,jR:()=>n});var i=r(39427),a=r(67934);a.KL.FACE_SWAP,a.KL.CHARACTER_SWAP,a.KL.OUTFIT_SWAP;let n=[...i.uc,i.Y5,...i.yQ],o=i.sN.id,s={baseImage:null,baseImageWidth:0,baseImageHeight:0,replacementImage:null,replacementImageWidth:0,replacementImageHeight:0,modelId:o,resolution:i.sN.resolutions[0]}},86438:(e,t,r)=>{"use strict";r.d(t,{Ak:()=>n,Kt:()=>o,_m:()=>a,p7:()=>i});let i=.5833333333333333,a=1.0416666666666667,n=5;function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return 5*Math.ceil(Math.round(e*t*1.2**r*1e6)/1e6/5)+5}},86819:(e,t,r)=>{"use strict";r.d(t,{KZ:()=>h,M0:()=>s,Ng:()=>d,Rc:()=>f,YE:()=>m,bQ:()=>_,fA:()=>c,fi:()=>g,ib:()=>o,nf:()=>u,oo:()=>p,ot:()=>l});var i=r(56800),a=r(7538),n=r(43050);let o="lemon",s=10,l=5,c=1,d=15,u=15,p=30,m=(0,a.jB)(i.qH.LEMON),g=[n.P4.ASPECT_RATIO_16_9,n.P4.ASPECT_RATIO_4_3,n.P4.ASPECT_RATIO_1_1,n.P4.ASPECT_RATIO_3_4,n.P4.ASPECT_RATIO_9_16],h=Object.values(n.yS),f={architecture:i.qH.LEMON,model_id:o,prompt:"",lemon_aspect_ratio:n.P4.ASPECT_RATIO_16_9,resolution:n.so.RES_480P,duration:n.yS.DURATION_3S,audio:!0,prompt_extend:!1},v={...f,use_character_voices:!0},_={architecture:i.qH.LEMON,name:"Lemon",short_name:"Lemon",popularity:0,tags:[i.fZ,i.tM],models:[{id:o}],api_path:"/api/v1/lemon",agent:{description:"All-in-one video model spanning 2-30 second clips. Start/end frames and reference images are mutually exclusive; set one kind or the other.",defaultConfig:v,options:{resolution:Object.values(n.so),duration:h},imageInputs:{firstFrame:"first_image",lastFrame:"last_image",references:{field:"image",additionalField:"additional_images"}},videoSource:{field:"videos",durationClaim:"video_durations_s"}}}},87049:(e,t,r)=>{"use strict";r.d(t,{A:()=>p,G:()=>m});var i=r(95155),a=r(77567),n=r(18403),o=r(49781),s=r(21220),l=r(70112),c=r(93751),d=r(95642),u=r(91423);let p="min(94dvw, 540px)";function m(e){let t,{title:r,children:p,closeDisabled:m,purchaseLayout:g=!1}=e,{isDesktop:h}=(0,a.VT)("isDesktop"),f="h4";h&&(f="h3"),g&&h&&(f="h2");let v="dark.9",_="lg";return g&&(v="black",_={base:"lg",sm:40},t={border:"1px solid var(--mantine-color-dark-4)",borderRadius:"var(--mantine-radius-md)"}),(0,i.jsxs)(n.Card,{bg:v,withBorder:!g,p:_,radius:"lg",children:[(0,i.jsx)(o.FocusTrap.InitialFocus,{}),(0,i.jsxs)(s.Stack,{gap:"lg",children:[(0,i.jsxs)(l.Group,{justify:"space-between",align:"flex-start",wrap:"nowrap",children:[(0,i.jsx)(c.Title,{size:f,order:3,c:"white",style:{minWidth:0},children:r}),(0,i.jsx)(d.CloseButton,{onClick:()=>(0,u.s7)(),"aria-label":"Close modal",size:"lg",c:"white",disabled:m,style:t})]}),p]})]})}},87373:(e,t,r)=>{"use strict";r.d(t,{Te:()=>s,k3:()=>n,lV:()=>o});var i=r(39427),a=r(75704);let n=[...i.uc,...i.uO,i.Y5,...i.yQ],o=i.sN.id,s={image:null,width:0,height:0,direction:a.ZA.FRONT,cameraElevation:0,
1cameraAzimuth:0,modelId:o,resolution:i.sN.resolutions[0]}},88061:(e,t,r)=>{"use strict";r.d(t,{Y:()=>a,k:()=>i});var i=function(e){return e.SIZE_240P="240p",e.SIZE_360P="360p",e.SIZE_480P="480p",e.SIZE_720P="720p",e}({}),a=function(e){return e.LENGTH_1S="1s",e.LENGTH_2S="2s",e.LENGTH_3S="3s",e.LENGTH_4S="4s",e.LENGTH_5S="5s",e.LENGTH_6S="6s",e.LENGTH_7S="7s",e.LENGTH_8S="8s",e.LENGTH_9S="9s",e.LENGTH_10S="10s",e}({})},88179:(e,t,r)=>{"use strict";r.d(t,{NF:()=>I,UH:()=>b,W9:()=>f,Ys:()=>A,Zv:()=>S,cZ:()=>_,iQ:()=>y,to:()=>v,yp:()=>x});var i=r(95155),a=r(2586),n=r(7538),o=r(501),s=r(47558),l=r(7963),c=r(16791),d=r(21220),u=r(93751),p=r(58887),m=r(70112),g=r(26903),h=r(91423);let f="mage:promptbar-focus-end";function v(e,t){return"video"===t&&(!!(0,a.OV)(e)||1===(0,a.Xf)(e))}function _(){setTimeout(()=>{window.dispatchEvent(new CustomEvent(f));let e=document.getElementById(s.jr);if(!e)return;let t=e.querySelector('[contenteditable="true"]');t instanceof HTMLElement&&t.focus()},50)}function y(e,t){return(0,a.Xf)(e,null==t?void 0:t.model_id)}function b(e,t){var r,i,a;let o=[t.image,...null!==(r=t.additional_images)&&void 0!==r?r:[]].filter(e=>!!e).length,s=t.moodboard&&(0,n.DK)(e,t.model_id)?(0,n.fI)(t.model_id):0;return o+(null!==(i=t.characters)&&void 0!==i?i:[]).length+(null!==(a=t.references)&&void 0!==a?a:[]).length+s}function A(e,t){let r=[];e.reservedByCharacters>0&&r.push("characters"),e.reservedByReferences>0&&r.push("references"),e.reservedByMoodboard>0&&r.push("moodboard");let i=r.length>0?" Remove ".concat(r.join("/")," to free up image slots."):"",a="This model supports ".concat(e.defaultMaxImages," total input images.");"attachment"===t?(0,c.p6)({title:"Not enough image slots",message:"".concat(a).concat(i)}):(0,c.p6)({title:"Too many images attached",message:"".concat(a).concat(i)})}function S(e,t){var r,i;let o=(0,a.Xf)(e,t.modelId),s=null!==(r=t.characterCount)&&void 0!==r?r:0,l=null!==(i=t.referenceCount)&&void 0!==i?i:0,c=t.moodboard&&(0,n.DK)(e,t.modelId)?(0,n.fI)(t.modelId):0,d=s+l+c;return{defaultMaxImages:o,maxImages:Math.max(o-d,0),reservedSlots:d,reservedByCharacters:s,reservedByReferences:l,reservedByMoodboard:c,supportsImages:o>0}}function x(e){let{maxImages:t,defaultMaxImages:r,reservedSlots:i}=e;if(0===r)return"This model doesn't support image input.";if(0===i)return 1===t?"This model supports only 1 image.":"This model supports up to ".concat(t," images.");let a=[];e.reservedByCharacters>0&&a.push("characters"),e.reservedByReferences>0&&a.push("references"),e.reservedByMoodboard>0&&a.push("moodboard");let n=a.join("/");return 0===t?"No image slots available. ".concat(i," used by ").concat(n,"."):"".concat(t," image slot").concat(t>1?"s":""," available. ").concat(i," used by ").concat(n,".")}let R={character:{supportSet:n.yQ,kindLabel:"Characters",kindNoun:"character",targetName:"Mango 2"},reference:{supportSet:n.yQ,kindLabel:"References",kindNoun:"reference",targetName:"Mango 2"},moodboard:{supportSet:n.C$,kindLabel:"Moodboards",kindNoun:"moodboard",targetName:"Mango 2"},audio_reference:{supportSet:n.HW,kindLabel:"Audio references",kindNoun:"audio reference",targetName:"Cherry Pro"}};function I(e,t){let r,{supportSet:a,kindLabel:n,kindNoun:s,targetName:c}=R[e],f=[...a].map(o.x);r=1===f.length?f[0]:2===f.length?"".concat(f[0]," and ").concat(f[1]):"".concat(f.slice(0,-1).join(", "),", and ").concat(f[f.length-1]);let v="".concat(n," are supported with ").concat(r," models.");(0,l.q)({children:(0,i.jsxs)(d.Stack,{bg:"dark.9",p:"lg",style:{borderRadius:"16px"},children:[(0,i.jsxs)(u.Title,{order:2,c:"white",children:["Switch To ",c]}),(0,i.jsxs)(p.Text,{c:"dimmed",size:"sm",children:[v," Would you like to switch to ",c," to use this ",s,"?"]}),(0,i.jsxs)(m.Group,{grow:!0,gap:"xs",children:[(0,i.jsx)(g.Button,{size:"lg",variant:"default",onClick:()=>(0,h.s7)(),children:"Cancel"}),(0,i.jsx)(g.Button,{size:"lg",color:"orange",variant:"light",onClick:()=>{(0,h.s7)(),t()},children:"Switch"})]})]})})}},88266:(e,t,r)=>{"use strict";r.d(t,{_e:()=>o,ey:()=>s});var i=r(4717),a=r(56800),n=r(57389);let o={architecture:a.qH.STABLE_DIFFUSION_XL,model_id:"6A35A7855770AE9820A3C931D4964C3817B6D9E3C6F9C4DABB5B3A94E5643B80",prompt:"",negative_prompt:"",num_inference_steps:30,guidance_scale:7,prompt_embed_version:n.jK.V1,aspect_ratio:i.vW.PORTRAIT},s={architecture:a.qH.STABLE_DIFFUSION_XL,name:"Stable Diffusion XL",short_name:"SDXL",popularity:4,tags:[a.fZ,a.R$],api_path:"/api/v1/stable_diffusion_xl",agent:{description:"Classic SDXL, photoreal-tuned.",defaultConfig:o,options:{},imageInputs:{references:{field:"image"}}}}},88920:(e,t,r)=>{"use strict";r.d(t,{Be:()=>p,Pr:()=>m,fY:()=>g});var i=r(2586),a=r(39599),n=r(9746),o=r(64930),s=r(61282),l=r(77567),c=r(16791),d=r(39852),u=r(32191);let p="Bring the image to life with natural, subtle motion.";function m(e){return void 0!==e&&"image"===e.type}async function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!m(e)){(0,c.p6)({title:"Cannot Animate",message:"Only images can be animated."});return}if(!(0,u.gp)(s.c.PRO))return;let g=e.data.image,h=await (0,n.P)(o.In);if(!h){(0,c.p6)({title:"Error",message:"Could not load animation concept. Please try again."});return}if(!h.architecture_config){(0,c.p6)({title:"Error",message:"Animation concept is missing configuration. Please try again."});return}let f=h.architecture_config;if(r){let e=l.xV.getState();if(!e.setActiveArchitectureConfig((0,a.An)({...f,prompt:t||e.prompt},g)))return;e.setConcept(h,!1),(0,c.bA)({title:"Animation Setup Ready",message:"Customize your settings and click Generate when ready."})}else{var v;let r={...f,[(0,i.Ce)(f.architecture)]:g,prompt:null!==(v=(0,a.VQ)(e,t))&&void 0!==v?v:p};if(!await (0,d.o6)({architectureConfig:r,concept:h}))return;(0,c.wB)({title:"Animation Queued",message:"Your image has been queued for animation with MiniMax-H3!"})}}},88970:(e,t,r)=>{"use strict";
1r.d(t,{Wt:()=>o,_D:()=>s});var i=r(4717),a=r(56800),n=r(52141);let o={architecture:a.qH.STABLE_DIFFUSION_V15,model_id:"15012C538F503CE2EBFC2C8547B268C75CCDAFF7A281DB55399940FF1D70E21D",prompt:"",negative_prompt:"",num_inference_steps:20,guidance_scale:7.5,scheduler:n.R.KDPM2_KARRAS,aspect_ratio:i.vW.PORTRAIT},s={architecture:a.qH.STABLE_DIFFUSION_V15,name:"Stable Diffusion v1.5",short_name:"SD1.5",popularity:0,tags:[a.fZ,a.R$],api_path:"/api/v1/stable_diffusion_v15",agent:{description:"Legacy Stable Diffusion 1.5.",defaultConfig:o,options:{},imageInputs:{references:{field:"image"}}}}},89720:(e,t,r)=>{"use strict";r.d(t,{JY:()=>a,Kl:()=>o,aj:()=>n,u:()=>s});var i=r(68541);function a(e){let t=new Map;for(let r of e.output)for(let e of r.classes){let r=t.get(e.class);(void 0===r||e.score>r)&&t.set(e.class,e.score)}return[...t.entries()].map(e=>{let[t,r]=e;return{class:t,score:r}})}function n(e,t){let r=[],a=[];for(let o of e){var n;let e=t[o.class],s=null!==(n=null==e?void 0:e.threshold)&&void 0!==n?n:i.hz;o.score>=s&&(a.push(o.class),e&&r.push(e.concept))}let o=[...new Set(r)],s=i.hc.some(e=>e.every(e=>o.includes(e))),l=i.Qg.some(e=>e.every(e=>o.includes(e)));return{is_nsfw:s,is_forbidden:l,is_forbidden_for_social:l||o.includes(i.ZL.NUDITY),detected_classes:a,detected_moderation:o}}function o(e,t){let r=n(e,t.general),i=n(e,t.enforcement);return{is_nsfw:r.is_nsfw,is_forbidden:i.is_forbidden,is_forbidden_for_social:i.is_forbidden_for_social,detected_classes:[...new Set([...r.detected_classes,...i.detected_classes])],detected_moderation:r.detected_moderation}}function s(e){var t,r;let o=null==e?void 0:null===(r=e.status)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:t.response;if(!o||!Array.isArray(o.output)||0===o.output.length)throw Error("Cached Hive moderation payload has no output frames");return n(a(o),i.dh)}},90099:(e,t,r)=>{"use strict";r.d(t,{E:()=>a});var i=r(34477);let a=(0,i.createServerReference)("40070c3946efe01467836aab3664a46958adec9533",i.callServer,void 0,i.findSourceMapURL,"getModel")},90313:(e,t,r)=>{"use strict";r.d(t,{uN:()=>a,xi:()=>o,zZ:()=>n});var i=r(39427);let a=[...i.uc,...i.mS,i.Y5,...i.yQ],n=i.N9.id,o={selections:{},modelId:n,resolution:i.N9.resolutions[0]}},91788:(e,t,r)=>{"use strict";r.d(t,{Fd:()=>o,S5:()=>s,Vo:()=>n,vw:()=>a});var i=r(56800),a=function(e){return e.SOFT="soft",e.REALISTIC="realistic",e.IMPERFECT="imperfect",e.IMPERFECT_FRECKLES="imperfect-freckles",e}({}),n=function(e){return e.LOW="low",e.MEDIUM="medium",e.HIGH="high",e}({});let o={realistic:{low:"add a restrained amount of natural skin texture, lightly define pores, add very fine grain. keep the enhancement subtle and close to the original skin. only modify skin details. keep rest of image exactly the same.",medium:"add clearly visible natural skin texture, define pores and fine skin detail, add moderate realistic grain. make the skin look noticeably more realistic than the original. only modify skin details. keep rest of image exactly the same.",high:"add dramatic natural skin texture, strongly define pores, fine lines, tiny bumps, and realistic grain. make the skin detail much more pronounced and visibly different from the original. only modify skin details. keep rest of image exactly the same."},soft:{low:"gently reduce wrinkles, scars, acne, and skin blemishes. make skin slightly softer while preserving natural texture and visible skin detail. only modify skin details. keep rest of image exactly the same.",medium:"noticeably reduce wrinkles, scars, acne, blemishes, and uneven texture. make skin smooth and soft while keeping a believable portrait look. only modify skin details. keep rest of image exactly the same.",high:"strongly remove wrinkles, scars, acne, blemishes, pores, and imperfections. make skin very smooth, polished, and visibly softer than the original, like a beauty retouch. only modify skin details. keep rest of image exactly the same."},imperfect:{low:"add a few subtle skin imperfections, very minimal acne, faint scars, light wrinkles, and fine grain. keep the changes understated and close to the original. only modify skin details. keep rest of image exactly the same.",medium:"add noticeable skin imperfections, mild acne, small scars, light wrinkles, uneven texture, and visible grain. make the skin look more naturally imperfect than the original. only modify skin details. keep rest of image exactly the same.",high:"add strong skin imperfections, visible acne, pronounced scars, wrinkles, uneven texture, tiny 
1spots, and coarse natural grain. make the imperfections clearly visible and much stronger than the original. only modify skin details. keep rest of image exactly the same."},"imperfect-freckles":{low:"add a few small, subtle natural freckles lightly scattered across the skin. keep the freckles sparse and easy to miss. only modify skin details. keep rest of image exactly the same.",medium:"add a visible amount of natural freckles scattered across the skin, with varied sizes and placement. make the freckles noticeable but still realistic. only modify skin details. keep rest of image exactly the same.",high:"add many prominent natural freckles densely scattered across the skin, with varied sizes and stronger visibility. make the freckles clearly visible and much more obvious than the original. only modify skin details. keep rest of image exactly the same."}},s={architecture:i.qH.SKIN_ENHANCER,name:"Skin Enhancer",short_name:"Skin Enhancer",popularity:0,tags:[i.R$,i.Mn,i.yu],api_path:"/api/v1/skin_enhancer",agent:null}},92092:(e,t,r)=>{"use strict";r.d(t,{HW:()=>a,qs:()=>n,qu:()=>o});var i=r(39427);let a=[...i.uc,...i.uO,i.Y5,...i.yQ],n=i.sN.id,o={image:null,width:0,height:0,prompt:"",modelId:n,resolution:i.sN.resolutions[0]}},92726:(e,t,r)=>{"use strict";function i(e){return e instanceof Error&&"An unexpected response was received from the server."===e.message}r.d(t,{Yh:()=>n,mO:()=>i});let a=[1e3,3e3];async function n(e){for(let t=0;;t+=1)try{return await e()}catch(e){if(!i(e)||t===a.length)throw e;await new Promise(e=>setTimeout(e,a[t]))}}},93331:(e,t,r)=>{"use strict";r.d(t,{f:()=>a});var i=r(30458);function a(e){var t,r;return Math.ceil(3.75*Number(null!==(r=null!==(t=e.duration)&&void 0!==t?t:i.wM.duration)&&void 0!==r?r:5))}},93772:(e,t,r)=>{"use strict";r.d(t,{OV:()=>l,q7:()=>o,t6:()=>n});var i=r(56800),a=r(45335);let n="raspberry",o={architecture:i.qH.RASPBERRY,model_id:n,prompt:"",raspberry_aspect_ratio:a.qw.ASPECT_RATIO_16_9,duration:a.L1.DURATION_4S,resolution:a.nA.RES_720P},s={...o,use_character_voices:!0},l={architecture:i.qH.RASPBERRY,name:"Raspberry",short_name:"Raspberry",popularity:0,tags:[i.fZ,i.tM],models:[{id:n}],api_path:"/api/v1/raspberry",agent:{description:"General video model.",defaultConfig:s,options:{resolution:Object.values(a.nA),duration:Object.values(a.L1)},imageInputs:{firstFrame:"first_image",references:{field:"image",additionalField:"additional_images"}}}}},94028:(e,t,r)=>{"use strict";r.d(t,{I:()=>u});var i=r(86438),a=r(58649),n=r(99785),o=r(41770),s=r(31896);function l(e){switch(e){case s.p2.SIZE_768P:return 768;case s.p2.SIZE_720P:return 720;case s.p2.SIZE_544P:return 544;case s.p2.SIZE_480P:return 480}throw Error("Unknown base size for MiniMax-H3: ".concat(e))}function c(e){return Math.floor(e*e*1032192/589824)}function d(e){return 5*Math.max(0,Math.floor((e-5)/17))+2}function u(e){var t,r;return(0,i.Kt)(function(e){var t,r;let i=function(e){var t,r,i,s,u,p,m,g;let h,f=l(null!==(t=e.base_size)&&void 0!==t?t:a.NW.base_size),v=[e.first_image,e.last_image].filter(Boolean).length,_=(u=function(e){var t,r;let i=l(null!==(t=e.base_size)&&void 0!==t?t:a.NW.base_size),o=null!==(r=e.aspect_ratio)&&void 0!==r?r:a.NW.aspect_ratio;return function(e,t,r){let i,a;e>=1?(i=t*e,a=t):(i=t,a=t/e);let n=i*a;if(n>r){let e=Math.sqrt(r/n);i*=e,a*=e}return{width:Math.max(32,32*Math.round(i/32)),height:Math.max(32,32*Math.round(a/32))}}((0,n.$n)((0,n.xp)(o)),i,c(i))}(e)).width/32*(u.height/32);v>0&&(_=c(f)/1024);let y=function(e){if(!a.QI.includes(e))throw Error("Unknown duration for MiniMax-H3: ".concat(e));return Math.min(124+17*Math.ceil(Math.max(0,Number(e)*a.UJ-124)/17),345)}(null!==(r=e.duration)&&void 0!==r?r:a.NW.duration),b=d(y),A=(0,o.S)(e).allImages.length,S=null!==(i=e.videos)&&void 0!==i?i:[],x=null!==(s=e.video_durations_s)&&void 0!==s?s:[],R=0;for(let e=0;e<S.length;e++){let t=x[e],r=y;Number.isFinite(t)&&t>0&&(r=Math.min(y,Math.round(t*a.UJ))),R+=1008*d(r)/_}let I=7296*A/_;return{rowsPerFrame:_,latentFrames:b,frameEquivalents:b+v+R+I,referenceCount:A+S.length+(h=0,!1!==e.use_character_voices&&(h=(null!==(m=e.characters)&&void 0!==m?m:[]).filter(e=>!!e.audio_url).length),Math.min(a.Gb,(null!==(g=null===(p=e.audio_references)||void 0===p?void 0:p.length)&&void 0!==g?g:0)+h))}}(e),s=(0,a.X6)(e),u=i.rowsPerFrame/1008,p=i.latentFrames/37;return 5+5.9*u**1.57*(i.frameEquivalents/37)**1.64*s+6.8*u*p+3.5*p+2*i.referenceCount+20*(null!==(r=null===(t=e.videos)||void 0===t?void 0:t.length)&&void 0!==r?r:0)}(e),i._m,null!==(r=null===(t=e.lora)||void 0===t?void 0:t.length)&&void 0!==r?r:0)}},94035:(e,t,r)=>{"use strict";r.d(t,{AU:()=>d,Bt:()=>l,WT:()=>c});var i=r(25352),a=r(61282),n=r(59613),o=r(70954),s=r.n(o);function l(e,t){return t===a.c.FREE&&e===i.o.UNLIMITED}function c(e,t,r){let a=(0,n.zd)(e,r);return a.allowed||"deprecated"!==a.reason?t===i.o.GEMS||a.allowed?{action:"allow"}:{action:"block",membershipRequired:a.membershipRequired}:{action:"block-deprecated"}}function d(e){return i.i.every(t=>!(t in e))?e:s()(e,i.i)}},94055:(e,t,r)=>{"use strict";r.d(t,{bT:()=>s,oW:()=>i,sd:()=>n,u8:()=>a,ww:()=>o});let i=250,a=2,n="200px",o="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",s="linear-gradient(135deg, var(--mantine-color-dark-6), var(--mantine-color-dark-8))"},94669:(e,t,r)=>{"use strict";r.d(t,{U:()=>a,d:()=>i});var i=function(e){return e.RES_1K="1k",e.RES_2K="2k",e}({}),a=function(e){return e.EULER="euler",e.EULER_A="euler_a",e.EULER_KARRAS="euler_karras",e.EULER_EXP="euler_exp",e.EULER_BETA="euler_beta",e}({})},95052:(e,t,r)=>{"use strict";r.d(t,{k:()=>m});var i=r(95155),a=r(67457),n=r(61282),o=r(77567),s=r(41441),l=r(16791),c=r(96089),d=r(12115),u=r(23552),p=r(42840);
1function m(e){let{style:t,buttonText:r,recommendation:m}=e,[g,h]=(0,d.useState)(!1),{userMembership:f,user:v}=(0,o.xV)((0,u.k)(e=>({userMembership:e.userMembership,user:e.user}))),_=f===n.c.MAX,y=(0,a.Ou)(n.c.MAX);return(0,i.jsx)(p.M,{title:y.title,price:y.monthlyPriceUsd,features:y.features,isCurrentPlan:_,onSelect:()=>{(0,c.M3)()&&v&&(f===n.c.FREE?(h(!0),(0,s.m)(n.c.MAX).then(e=>{window.location.assign(e)}).catch(e=>{h(!1),console.error("Error checking out",e),(0,l.p6)({title:"Checkout Issue",message:"We had an issue redirecting you. Try again?"})})):f===n.c.MAX?(0,l.bA)({title:"Already Subscribed!",message:"You are already a Max member. Congrats!"}):(h(!0),(0,s.e)().then(e=>{window.location.assign(e)}).catch(e=>{h(!1),console.error("Error redirection to portal",e),(0,l.p6)({title:"Checkout Issue",message:"We had an issue redirecting you. Try again?"})})))},backgroundImage:y.backgroundImage,loading:g,style:t,buttonText:r,recommendation:m})}},95279:(e,t,r)=>{"use strict";r.d(t,{O:()=>a});var i=r(34477);let a=(0,i.createServerReference)("40298996a84047fd2ad3049b93d36e3756a26e2047",i.callServer,void 0,i.findSourceMapURL,"saveProfileCollections")},95592:(e,t,r)=>{"use strict";r.d(t,{C:()=>c});var i=r(95155),a=r(23288),n=r(26029),o=r(70112),s=r(58887),l=r(68183);function c(e){let{gems:t}=e;return(0,i.jsx)(n.Badge,{p:0,w:50,color:"orange",variant:"light",h:20,children:(0,i.jsxs)(o.Group,{gap:2,children:[(0,i.jsx)(l.A,{size:10}),(0,i.jsx)(s.Text,{size:"xs",fw:"bold",style:{fontSize:"10px"},children:(0,a.Z)(t,1)})]})})}},96089:(e,t,r)=>{"use strict";r.d(t,{M3:()=>a,iM:()=>o,ye:()=>n});var i=r(77567);function a(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],{user:t,setViewLogin:r}=i.xV.getState();return null!==t&&!t.isAnonymous||(e&&r(!0),!1)}function n(e){return!!(["/","/about","/terms-and-conditions","/privacy-policy","/membership","/leaderboard","/updates","/concepts","/models"].includes(e)||e.startsWith("/social")||e.startsWith("/u/")||e.startsWith("/play/")||e.startsWith("/article")||e.startsWith("/share/")||e.startsWith("/leaderboard")||e.startsWith("/refer/"))}function o(e){return!n(e)}r(6063),r(44529)},96117:(e,t,r)=>{"use strict";r.d(t,{H:()=>i,p:()=>a});var i=function(e){return e.RANDOM="random",e.RECENT="recent",e.RECOMMENDED="recommended",e.FEATURED="featured",e}({});let a=()=>({orderBy:"featured",postedBeforeDate:new Date})},96700:(e,t,r)=>{"use strict";r.d(t,{OP:()=>a,Xn:()=>n,qQ:()=>i});var i=function(e){return e.RES_480P="480p",e.RES_720P="720p",e.RES_1080P="1080p",e}({}),a=function(e){return e.DURATION_5S="5",e.DURATION_10S="10",e}({}),n=function(e){return e.ASPECT_RATIO_16_9="16:9",e.ASPECT_RATIO_4_3="4:3",e.ASPECT_RATIO_1_1="1:1",e.ASPECT_RATIO_3_4="3:4",e.ASPECT_RATIO_21_9="21:9",e}({})},97753:e=>{e.exports={cardShell:"plan_card_cardShell__ATduz",recommendationBadgeSlot:"plan_card_recommendationBadgeSlot__zb4u3",recommendationDescriptionSlot:"plan_card_recommendationDescriptionSlot__u9SVn",card:"plan_card_card__K5XWV",button:"plan_card_button__EKtNQ"}},99785:(e,t,r)=>{"use strict";r.d(t,{$n:()=>T,Mq:()=>M,ZX:()=>E,dK:()=>w,jW:()=>O,oS:()=>C,tg:()=>P,ut:()=>D,xp:()=>k});var i=r(40201),a=r(71849),n=r(20036),o=r(17157),s=r(2736),l=r(47370),c=r(84461),d=r(43050),u=r(86819),p=r(25102),m=r(65638),g=r(96700),h=r(73857),f=r(84563),v=r(45335),_=r(20630),y=r(39358),b=r(4717),A=r(68758),S=r(56800);let x={[S.qH.VEO3]:{ratios:Object.values(_.D),fieldKey:"custom_aspect_ratio",defaultRatio:_.D.RATIO_16_9},[S.qH.VEO3_1]:{ratios:Object.values(y.ew),fieldKey:"custom_aspect_ratio",defaultRatio:y.ew.RATIO_16_9},[S.qH.PEACH]:{ratios:Object.values(g.Xn),fieldKey:"peach_aspect_ratio",defaultRatio:g.Xn.ASPECT_RATIO_4_3},[S.qH.PEACH_MAX]:{ratios:Object.values(h.j0),fieldKey:"peach_max_aspect_ratio",defaultRatio:h.j0.ASPECT_RATIO_4_3},[S.qH.KIWI]:{ratios:Object.values(c.Un),fieldKey:"kiwi_aspect_ratio",defaultRatio:c.Un.ASPECT_RATIO_16_9},[S.qH.BLUEBERRY]:{ratios:Object.values(a.Y4),fieldKey:"blueberry_aspect_ratio",defaultRatio:a.Y4.ASPECT_RATIO_16_9},[S.qH.NANO_BANANA_V2]:{ratios:Object.values(m.t6),fieldKey:"nano_banana_v2_aspect_ratio",defaultRatio:m.t6.RATIO_1_1},[S.qH.CHERRY]:{ratios:[...o.zo],fieldKey:"cherry_aspect_ratio",defaultRatio:n.lr.ASPECT_RATIO_16_9},[S.qH.RASPBERRY]:{ratios:Object.values(v.qw),fieldKey:"raspberry_aspect_ratio",defaultRatio:v.qw.ASPECT_RATIO_16_9},[S.qH.GROK_IMAGE]:{ratios:Object.values(s.oS),fieldKey:"grok_image_aspect_ratio",defaultRatio:s.oS.ASPECT_RATIO_1_1},[S.qH.GROK_VIDEO]:{ratios:Object.values(l.mA),fieldKey:"grok_video_aspect_ratio",defaultRatio:l.mA.ASPECT_RATIO_16_9},[S.qH.BERRY]:{ratios:Object.values(i.mv),fieldKey:"berry_aspect_ratio",defaultRatio:i.mv.ASPECT_RATIO_16_9},[S.qH.MELON]:{ratios:Object.values(p.Nf),fieldKey:"melon_aspect_ratio",defaultRatio:p.Nf.ASPECT_RATIO_16_9},[S.qH.PLUM]:{ratios:Object.values(f.cU),fieldKey:"plum_aspect_ratio",defaultRatio:f.cU.ASPECT_RATIO_16_9},[S.qH.LEMON]:{ratios:[...u.fi],fieldKey:"lemon_aspect_ratio",defaultRatio:d.P4.ASPECT_RATIO_16_9}},R=new Set([S.qH.ENHANCE,S.qH.REFINE,S.qH.SELFIE,S.qH.FRAMEPACK]),I=["21:9","16:9","3:2","5:4","1:1","4:5","2:3","9:16","9:21"];function C(e){var t,r;return R.has(e)?[]:null!==(r=null===(t=x[e])||void 0===t?void 0:t.ratios)&&void 0!==r?r:[...I]}function w(e){var t,r;return R.has(e)?null:null!==(r=null===(t=x[e])||void 0===t?void 0:t.fieldKey)&&void 0!==r?r:"aspect_ratio"}function E(e){var t,r;return R.has(e)?null:null!==(r=null===(t=x[e])||void 0===t?void 0:t.defaultRatio)&&void 0!==r?r:"16:9"}function P(e){return e in x}function T(e){let[t,r]=e.split(":").map(Number);return t/r}function M(e,t){return e.reduce((e,r)=>{let i=Math.abs(T(e)-t);return Math.abs(T(r)-t)<i?r:e})}function k(e){return(0,A.Hv)(e)}function O(e){switch(e){case"21:9":return b.vW.ULTRAWIDE;case"16:9":return b.vW.CINEMA;case"3:2":return b.vW.LANDSCAPE;case"5:4":return b.vW.COMPUTER;case"1:1":return b.vW.SQUARE;case"4:5":return b.vW.PORTRAIT;case"2:3":return b.vW.TABLET;case"9:16":return b.vW.PHONE;case"9:21":return b.vW.ULTRATALL;default:return}}function D(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(null==e?void 0:e.metadata){let t=e.metadata,r=(null==t?void 0:t.width)/(null==t?void 0:t.height);if(r>0)return r}return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!(null==e?void 0:e.architecture))return t;let r=w(e.architecture),i=e[r];if("string"!=typeof i)return t;if(i.includes(":"))return T(i)||t;let a=(0,A.Hv)(i);return"Unknown"!==a?T(a):t}(e.architecture_config,t)}}}]);

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.