1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,20882,e=>{"use strict";var t=e.i(47167);let r={appName:"Ai Royal Portrait",auth:{google:{clientId:t.default.env.GOOGLE_CLIENT_ID,clientSecret:t.default.env.GOOGLE_CLIENT_SECRET},secret:t.default.env.NEXTAUTH_SECRET,url:t.default.env.NEXTAUTH_URL||"http://localhost:3000",webhook_url:t.default.env.WEBHOOK_URL||t.default.env.NEXTAUTH_URL||"http://localhost:3000"},stripe:{publishableKey:t.default.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY,secretKey:t.default.env.STRIPE_SECRET_KEY,webhookSecret:t.default.env.STRIPE_WEBHOOK_SECRET,plans:{basic:{id:"basic",name:"Basic Pack",credits:1e3,price:500,description:"1,000 Credits â generate up to 500 royal portraits."},standard:{id:"standard",name:"Standard Pack",credits:2e3,price:1e3,description:"2,000 Credits â generate up to 1,000 royal portraits."},pro:{id:"pro",name:"Pro Pack",credits:4e3,price:2e3,description:"4,000 Credits â generate up to 2,000 royal portraits."},business:{id:"business",name:"Business Pack",credits:1e4,price:5e3,description:"10,000 Credits â generate up to 5,000 royal portraits."}}},ai:{apiKey:t.default.env.MU_API_KEY,uploadEndpoint:"https://api.muapi.ai/api/v1/upload_file",pollEndpoint:e=>`https://api.muapi.ai/api/v1/predictions/${e}/result`,model:{id:"portrait-stylist",name:"AI Portrait Stylist",creditCost:2,endpoint:"https://api.muapi.ai/api/v1/portrait-stylist",description:"Professional AI portrait transformations â hair, makeup, accessories, outfit & lighting."},styles:[{name:"Voluminous Frizzy Hair",category:"Hair",emoji:"ð"},{name:"Platinum Blonde Hair",category:"Hair",emoji:"ð±"},{name:"Deep Burgundy Hair",category:"Hair",emoji:"ð´"},{name:"Jet Black Hair",category:"Hair",emoji:"ð¤"},{name:"Bold Hair Highlights",category:"Hair",emoji:"â¨"},{name:"Bold Red Lipstick",category:"Makeup",emoji:"ð"},{name:"Smokey Eye Makeup",category:"Makeup",emoji:"ðï¸"},{name:"Glossy Nude Makeup",category:"Makeup",emoji:"ð¸"},{name:"Winged Eyeliner",category:"Makeup",emoji:"ðª¶"},{name:"Party Glam Makeup",category:"Makeup",emoji:"ð"},{name:"Aviator Sunglasses",category:"Accessories",emoji:"ð¶ï¸"},{name:"Oversized Sunglasses",category:"Accessories",emoji:"ð"},{name:"Modern Transparent Glasses",category:"Accessories",emoji:"ð"},{name:"Bold Fashion Hat",category:"Accessories",emoji:"ð©"},{name:"Bright Pink Outfit",category:"Outfit",emoji:"ð©·"},{name:"Black Leather Jacket",category:"Outfit",emoji:"ð¤"},{name:"White Formal Shirt",category:"Outfit",emoji:"ð"},{name:"Neon Green Hoodie",category:"Outfit",emoji:"ð¢"},{name:"Cinematic Lighting",category:"Lighting",emoji:"ð¬"},{name:"Cyberpunk Lighting",category:"Lighting",emoji:"â¡"}]},db:{url:t.default.env.DATABASE_URL}};e.s(["default",0,r])},49987,e=>{"use strict";var t=e.i(43476),r=e.i(17255),a=e.i(71645),i=e.i(20882);e.s(["Providers",0,function({children:e}){return(0,a.useEffect)(()=>{{let e=i.default?.theme||"slate-indigo";document.documentElement.setAttribute("data-theme",e)}},[]),(0,t.jsx)(r.SessionProvider,{children:e})}])},90468,e=>{"use strict";var t=e.i(43476),r=e.i(22016),a=e.i(17255),i=e.i(71645),s=e.i(18566),o=e.i(40141);function n(e){return(0,o.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"48",d:"M88 152h336M88 256h336M88 360h336"},child:[]}]})(e)}function l(e){return(0,o.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z"},child:[]}]})(e)}function d(e){return(0,o.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}function c(e){return(0,o.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},child:[]},{tag:"circle",attr:{cx:"12",cy:"7",r:"4"},child:[]}]})(e)}function m(e){return(0,o.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]},{tag:"line",attr:{x1:"10",y1:"11",x2:"10",y2:"17"},child:[]},{tag:"line",attr:{x1:"14",y1:"11",x2:"14",y2:"17"},child:[]}]})(e)}function p(e){return(0,o.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"5",x2:"12",y2:"19"},child:[]},{tag:"line",attr:{x1:"5",y1:"12",x2:"19",y2:"12"},child:[]}]})(e)}function u(e){return(0,o.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"},child:[]},{tag:"polyline",attr:{points:"16 17 21 12 16 7"},child:[]},{tag:"line",attr:{x1:"21",y1:"12",x2:"9",y2:"12"},child:[]}]})(e)}function x(e){return(0,o.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"},child:[]}]})(e)}function h(e){return(0,o.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"12",y1:"1",x2:"12",y2:"23"},child:[]},{tag:"path",attr:{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"},child:[]}]})(e)}function g(e){return(0,o.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 6 9 17 4 12"},child:[]}]})(e)}function y(e){return(0,o.GenIcon)({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m12 1.608 12 20.784H0Z"},child:[]}]})(e)}var b=e.i(20882),f=e.i(5766);e.s(["default",0,function(){let{data:e,status:o,update:v}=(0,a.useSession)(),j=(0,s.usePathname)(),[k,w]=(0,i.useState)(!1),[N,A]=(0,i.useState)(!1),[I,P]=(0,i.useState)(!1),[C,S]=(0,i.useState)(""),[E,K]=(0,i.useState)(!1),L=b.default?.appName||"AI SaaS",B=L.trim().charAt(0).toUpperCase(),T=!!e?.user?.customApiKey;(0,i.useEffect)(()=>
1{e?.user?.customApiKey&&S(e.user.customApiKey)},[e?.user?.customApiKey]);let H=j?j.match(/^\/app\/([^\/]+)/):null,M=H?H[1]:null,_=M?[{name:"Workspace",path:`/app/${M}`},{name:"Gallery",path:`/app/${M}/gallery`},{name:"Pricing",path:`/app/${M}/pricing`}]:[{name:"Workspace",path:"/"},{name:"Gallery",path:"/gallery"},{name:"Pricing",path:"/pricing"}],G=async e=>{e.preventDefault();let t=C.trim();if(!t)return void f.default.error("Please enter a valid API Key");K(!0);try{if("authenticated"===o){let e=await fetch("/api/user/apikey",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t})}),r=await e.json();if(!e.ok)throw Error(r.error||"Failed to save API key");await v({customApiKey:t}),f.default.success("Custom API Key updated!"),P(!1),window.location.reload()}else{let e=await (0,a.signIn)("credentials",{apiKey:t,redirect:!1});if(e?.error)throw Error(e.error||"Failed to sign in with API key");f.default.success("Signed in with API Key!"),P(!1),window.location.reload()}}catch(e){f.default.error(e.message||"Failed to save API Key")}finally{K(!1)}},O=async()=>{K(!0);try{let e=await fetch("/api/user/apikey",{method:"DELETE"}),t=await e.json();if(!e.ok)throw Error(t.error||"Failed to remove API key");await v({customApiKey:null}),S(""),f.default.success("Custom API Key removed"),P(!1),window.location.reload()}catch(e){f.default.error(e.message||"Failed to remove API Key")}finally{K(!1)}};return(0,t.jsxs)("header",{className:"sticky top-0 z-50 w-full glass-panel border-b border-divider/50 shadow-md",children:[(0,t.jsxs)("div",{className:"mx-auto flex max-w-7xl items-center justify-between px-4 py-4 sm:px-6 lg:px-8",children:[(0,t.jsxs)(r.default,{href:"/",className:"flex items-center gap-2 transition-transform hover:scale-[1.02] active:scale-95",children:[(0,t.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-primary text-white font-extrabold text-lg shadow-md shadow-primary/30",children:B}),(0,t.jsx)("span",{className:"text-lg font-black tracking-tight text-primary-text text-nowrap",children:L})]}),(0,t.jsx)("nav",{className:"hidden md:flex items-center gap-6",children:_.map(e=>{let a=j===e.path;return(0,t.jsxs)(r.default,{href:e.path,className:`text-[13px] font-semibold transition-all relative py-1 ${a?"text-primary":"text-secondary-text hover:text-primary-text"}`,children:[e.name,a&&(0,t.jsx)("div",{className:"absolute -bottom-[20px] left-0 right-0 h-0.5 bg-primary rounded-full"})]},e.name)})}),(0,t.jsxs)("div",{className:"hidden md:flex items-center gap-3",children:[(0,t.jsxs)("a",{href:"https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FSamurAIGPT%2Fcommon-saas-template",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 rounded-full border border-divider px-4 py-1.5 text-xs font-bold text-secondary-text hover:text-primary-text hover:bg-bg-card transition-colors shadow-sm",children:[(0,t.jsx)(y,{className:"text-xs text-white"}),(0,t.jsx)("span",{children:"Deploy"})]}),(0,t.jsxs)("button",{onClick:()=>P(!0),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-bold border transition-all cursor-pointer ${T?"bg-amber-500/10 border-amber-500/30 text-amber-400 hover:bg-amber-500/20":"bg-bg-page/50 border-divider text-secondary-text hover:text-white hover:border-primary/40"}`,children:[(0,t.jsx)(x,{className:T?"text-amber-400":"text-secondary-text"}),(0,t.jsx)("span",{children:T?"Custom API Key":"Add API Key"})]}),"authenticated"===o?(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)("div",{className:"flex items-center h-9 border border-divider rounded-l bg-bg-page/30 overflow-hidden pr-2",children:[(0,t.jsxs)("span",{className:"font-bold text-[13px] px-3 flex items-center text-primary-text gap-1",children:[(0,t.jsx)(h,{className:"text-emerald-500 text-xs"}),T?"â (API Key)":void 0!==e.user.credits?e.user.credits:0]}),!T&&(0,t.jsx)(r.default,{href:"/pricing",className:"flex items-center justify-center w-5 h-5 rounded hover:bg-bg-card text-secondary-text transition-colors",children:(0,t.jsx)(p,{size:14})})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("button",{onClick:()=>A(!N),onBlur:()=>setTimeout(()=>A(!1),200),className:"h-9 w-9 flex items-center justify-center border-y border-r border-divider rounded-r bg-bg-page/30 hover:bg-bg-page transition-colors cursor-pointer",children:e.user.image?(0,t.jsx)("img",{src:e.user.image,alt:"Profile",className:"h-6 w-6 rounded-full object-cover"}):(0,t.jsx)(c,{className:"text-secondary-text",size:16})}),N&&(0,t.jsxs)("div",{className:"absolute right-0 top-11 w-52 rounded border border-divider bg-bg-card p-1 shadow-lg z-[100] animate-scale-up",children:[(0,t.jsx)("div",{className:"px-3 py-2 text-xs text-secondary-text border-b border-divider/50 mb-1 truncate",children:e.user.email}),(0,t.jsxs)("button",{onClick:()=>P(!0),className:"flex w-full items-center gap-2 rounded px-3 py-2 text-left text-xs font-semibold text-primary-text hover:bg-primary/10 transition-colors",children:[(0,t.jsx)(x,{size:14,className:"text-amber-400"}),(0,t.jsx)("span",{children:T?"Manage API Key":"Add API Key"})]}),(0,t.jsxs)("button",{onClick:()=>(0,a.signOut)({callbackUrl:"/login"}),className:"flex w-full items-center gap-2 rounded px-3 py-2 text-left text-xs font-semibold text-red-500 hover:bg-red-500/10 transition-colors",children:[(0,t.jsx)(u,{size:14}),(0,t.jsx)("span",{children:"Sign Out"})]})]})]})]}):(0,t.jsx)(r.default,{href:"/login",className:"bg-primary text-white px-5 py-1.5 rounded-full text-sm font-bold hover:bg-primary-hover transition-all shadow-md shadow-primary/20",children:"Sign In"})]}),(0,t.jsxs)("div",{className:"flex md:hidden items-center gap-2",children:["authenticated"===o&&(0,t.jsxs)("div",{className:"flex items-center h-8 border border-divider rounded bg-bg-page/30 px-2.5 text-xs font-bold text-primary-text gap-0.5",children:[(0,t.jsx)(h,{className:"text-emerald-500 text-[10px]"}),T?"â Key":void 0!==e.user.credits?e.user.credits:0]}),(0,t.jsx)("button",{onClick:()=>w(!k),className:"hover:bg-bg-card p-2 rounded cursor-pointer transition-colors text-primary-text border border-divider/50","aria-label":"Toggle Menu",children:k?(0,t.jsx)(l,{size:20}):(0,t.jsx)(n,{size:20})})]})]}
1),k&&(0,t.jsx)("div",{className:"absolute top-full left-0 right-0 z-[200] glass-dropdown border-b border-divider shadow-2xl py-4 px-6 md:hidden animate-fade-in",children:(0,t.jsxs)("nav",{className:"flex flex-col gap-3",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase font-bold text-secondary-text tracking-widest mb-1",children:"Navigation"}),_.map(e=>(0,t.jsx)(r.default,{href:e.path,onClick:()=>w(!1),className:`flex items-center py-2.5 rounded text-sm font-semibold transition-all ${j===e.path?"bg-primary/10 text-primary px-3 border border-primary/20":"text-primary-text hover:bg-bg-card"}`,children:e.name},e.name)),(0,t.jsx)("button",{onClick:()=>{w(!1),P(!0)},className:"flex w-full items-center justify-between rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2.5 text-xs font-bold text-amber-400",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x,{}),(0,t.jsx)("span",{children:T?"Manage Custom API Key":"Add API Key"})]})}),(0,t.jsx)("div",{className:"h-px bg-divider/50 my-2"}),(0,t.jsxs)("a",{href:"https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FSamurAIGPT%2Fcommon-saas-template",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center justify-center gap-2 rounded-full border border-divider py-3 text-xs font-bold text-secondary-text hover:text-primary-text hover:bg-bg-card transition-all",children:[(0,t.jsx)(y,{className:"text-xs text-white"}),(0,t.jsx)("span",{children:"Clone & Deploy Template"})]}),"authenticated"===o?(0,t.jsxs)("button",{onClick:()=>{w(!1),(0,a.signOut)({callbackUrl:"/login"})},className:"flex w-full items-center justify-center gap-2 rounded bg-red-500/10 text-red-500 py-3 text-sm font-bold hover:bg-red-500/20 transition-all border border-red-500/20 mt-2",children:[(0,t.jsx)(u,{size:16}),(0,t.jsx)("span",{children:"Sign Out"})]}):(0,t.jsx)(r.default,{href:"/login",onClick:()=>w(!1),className:"flex w-full items-center justify-center rounded bg-primary text-white py-3 text-sm font-bold hover:bg-primary-hover transition-all shadow-md shadow-primary/20 mt-2",children:"Sign In"})]})}),I&&(0,t.jsx)("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/70 backdrop-blur-sm p-4",children:(0,t.jsxs)("div",{className:"bg-bg-card border border-divider w-full max-w-md rounded-xl p-6 space-y-5 shadow-2xl animate-scale-up",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-divider/60 pb-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400 font-black text-sm uppercase",children:[(0,t.jsx)(x,{className:"text-base"}),(0,t.jsx)("span",{children:"Custom API Key Settings"})]}),(0,t.jsx)("button",{onClick:()=>P(!1),className:"text-secondary-text hover:text-white transition-colors cursor-pointer",children:(0,t.jsx)(d,{size:18})})]}),(0,t.jsxs)("p",{className:"text-xs text-secondary-text leading-relaxed",children:["Use your own ",(0,t.jsx)("strong",{children:"MuAPI Key"})," to generate royal portraits directly without consuming or purchasing website credits."]}),(0,t.jsxs)("form",{onSubmit:G,className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-[11px] uppercase font-bold text-secondary-text tracking-wider",children:"MuAPI Secret Key"}),(0,t.jsx)("input",{type:"password",value:C,onChange:e=>S(e.target.value),placeholder:"mu_...",className:"w-full bg-bg-page border border-divider rounded-lg px-3.5 py-2.5 text-xs text-white placeholder-secondary-text/50 focus:outline-none focus:border-amber-400 transition-colors"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 pt-2",children:[T&&"authenticated"===o&&(0,t.jsxs)("button",{type:"button",onClick:O,disabled:E,className:"flex items-center gap-1.5 px-3 py-2 rounded-lg bg-red-500/10 hover:bg-red-500/20 text-red-500 text-xs font-bold border border-red-500/20 transition-all cursor-pointer",children:[(0,t.jsx)(m,{}),(0,t.jsx)("span",{children:"Remove Key"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[(0,t.jsx)("button",{type:"button",onClick:()=>P(!1),className:"px-4 py-2 rounded-lg bg-bg-page border border-divider text-xs font-semibold text-secondary-text hover:text-white cursor-pointer",children:"Cancel"}),(0,t.jsxs)("button",{type:"submit",disabled:E||!C.trim(),className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-amber-500 hover:bg-amber-400 text-neutral-950 text-xs font-bold transition-all disabled:opacity-50 cursor-pointer shadow-md shadow-amber-500/20",children:[(0,t.jsx)(g,{}),(0,t.jsx)("span",{children:E?"Processing...":"authenticated"===o?"Save Key":"Sign In with API Key"})]})]})]})]})]})})]})}],90468)}]);
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.