@socialgen_user/socialgen 2.3.6 → 2.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{BnHqhu28.js → 1ESij7sf.js} +1 -1
- package/.output/public/_nuxt/{Yv0VQg56.js → 8t3Wih-_.js} +2 -2
- package/.output/public/_nuxt/{WNF4vvWg.js → CpvOZWox.js} +1 -1
- package/.output/public/_nuxt/{C5k0IulZ.js → DO1pBuIJ.js} +1 -1
- package/.output/public/_nuxt/{ztWrJaao.js → DR2NdyVN.js} +1 -1
- package/.output/public/_nuxt/JDUjn-YJ.js +91 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/dd531369-b462-4ab9-9c49-be9d1a58097d.json +1 -0
- package/.output/public/_nuxt/{BkcabsD-.js → wZeFhB0j.js} +1 -1
- package/.output/public/mobile-demo.html +788 -0
- package/.output/server/chunks/_/nitro.mjs +125 -118
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/entry-styles.BcjSvkjT.mjs +8 -0
- package/.output/server/chunks/build/entry-styles.BcjSvkjT.mjs.map +1 -0
- package/.output/server/chunks/build/{pages-BsPKZpHw.mjs → pages-DAxeAK3-.mjs} +350 -45
- package/.output/server/chunks/build/pages-DAxeAK3-.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +1 -1
- package/.output/server/chunks/build/styles.mjs +4 -4
- package/.output/server/chunks/build/styles.mjs.map +1 -1
- package/.output/server/chunks/routes/api/files/_...path_.get.mjs +1 -0
- package/.output/server/chunks/routes/api/files/_...path_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/media.get.mjs +80 -50
- package/.output/server/chunks/routes/api/media.get.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/data/history.json +23 -8
- package/data/history_generations.json +171 -0
- package/data/templates.json +40 -0
- package/package.json +1 -1
- package/public/mobile-demo.html +788 -0
- package/.output/public/_nuxt/CDdFfo0w.js +0 -91
- package/.output/public/_nuxt/builds/meta/4b90bf55-5441-4724-8537-3192f91ec217.json +0 -1
- package/.output/server/chunks/build/entry-styles.BPr_nTP3.mjs +0 -8
- package/.output/server/chunks/build/entry-styles.BPr_nTP3.mjs.map +0 -1
- package/.output/server/chunks/build/pages-BsPKZpHw.mjs.map +0 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import{h as ea,d as ca,i as S,M as ke,o as pa,A as p,B as m,l as o,C as t,E as k,G as J,D as x,N as $,O as fe,P as Ae,Q as et,R as pt,S as me,T as xe,U as Ne,V as ft,W as j,X as Pe,Y as ta,m as be,c as is,Z as Ca}from"./8t3Wih-_.js";import{_ as ls}from"./DR2NdyVN.js";async function xt(n){if(!n)return!1;if(typeof window<"u"&&window.isSecureContext&&navigator?.clipboard?.writeText)try{return await navigator.clipboard.writeText(n),!0}catch(e){console.warn("[SocialGen Clipboard] navigator.clipboard.writeText failed, falling back to execCommand:",e)}if(typeof document<"u")try{const e=document.createElement("textarea");if(e.value=n,e.style.position="fixed",e.style.left="-9999px",e.style.top=(window.pageYOffset||document.documentElement.scrollTop||0)+"px",e.style.width="2em",e.style.height="2em",e.style.padding="0",e.style.border="none",e.style.outline="none",e.style.boxShadow="none",e.style.background="transparent",e.style.fontSize="16px",document.body.appendChild(e),typeof navigator<"u"&&/ipad|iphone|ipod/i.test(navigator.userAgent)){e.contentEditable="true",e.readOnly=!1;const l=document.createRange();l.selectNodeContents(e);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(l)),e.setSelectionRange(0,999999)}else e.focus(),e.select();let i=!1;try{i=document.execCommand("copy")}catch(l){console.warn("[SocialGen Clipboard] execCommand call threw error:",l)}if(document.body.removeChild(e),i)return!0}catch(e){console.warn("[SocialGen Clipboard] DOM fallback failed:",e)}return!1}const rs=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var St={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const ds=({size:n,strokeWidth:e=2,absoluteStrokeWidth:s,color:i,iconNode:l,name:d,class:f,...c},{slots:C})=>ea("svg",{...St,width:n||St.width,height:n||St.height,stroke:i||St.stroke,"stroke-width":s?Number(e)*24/Number(n):e,class:["lucide",`lucide-${rs(d??"icon")}`],...c},[...l.map(w=>ea(...w)),...C.default?[C.default()]:[]]);const z=(n,e)=>(s,{slots:i})=>ea(ds,{...s,iconNode:e,name:n},i);const Kt=z("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);const at=z("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Oa=z("CircleAlertIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const us=z("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Wt=z("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const cs=z("CodeIcon",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const We=z("CopyIcon",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Aa=z("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const qt=z("FileTextIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const aa=z("FilmIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);const ps=z("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const Na=z("LayoutTemplateIcon",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);const sa=z("MusicIcon",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);const fs=z("PauseIcon",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);const Tt=z("PenIcon",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);const Ga=z("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Ct=z("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Ia=z("RefreshCwIcon",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const Ka=z("RotateCcwIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const na=z("ScissorsIcon",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);const Yt=z("SettingsIcon",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const ms=z("ShieldAlertIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);const ht=z("SparklesIcon",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const tt=z("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const Ot=z("UploadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);const xs=z("Volume2Icon",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);const hs=z("VolumeXIcon",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);const bs=z("WandSparklesIcon",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);const Xt=z("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const gs=z("ZoomInIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);const vs=z("ZoomOutIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),ys={class:"flex flex-col gap-3 text-slate-100"},ks={key:0,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},ws={class:"bg-slate-900 border border-slate-700 rounded-3xl max-w-xl w-full p-5 shadow-2xl flex flex-col gap-4 text-xs max-h-[90vh] overflow-y-auto custom-scrollbar"},_s={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Ss={class:"text-sm font-black text-white flex items-center gap-2"},Ts={class:"p-3.5 bg-slate-950 rounded-2xl border border-slate-800 flex flex-col gap-2.5"},Cs={class:"font-bold text-sky-400 flex items-center justify-between"},Os={class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},As={class:"flex flex-col gap-2"},Ns={class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},Is={class:"flex flex-col gap-2 max-h-[220px] overflow-y-auto pr-1 custom-scrollbar"},Ms={class:"flex-1"},$s={class:"flex items-center gap-2 mb-1"},Ds={class:"font-extrabold text-white text-xs"},js={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-slate-800 text-slate-300 border border-slate-700"},Es={class:"text-[11px] text-slate-400 leading-snug"},Rs={class:"flex items-center gap-1"},Ps=["onClick"],Ls=["onClick"],Vs={key:1,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Bs={class:"bg-slate-900 border border-slate-700 rounded-3xl max-w-2xl w-full p-6 shadow-2xl flex flex-col gap-4 text-xs max-h-[90vh]"},Js={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Fs={class:"text-sm font-black text-white flex items-center gap-2"},Zs={class:"flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px] flex-wrap"},Hs={class:"text-white font-semibold"},Us={class:"text-white font-semibold"},zs={class:"text-white font-semibold"},Gs={class:"text-purple-400 font-bold"},Ks={class:"relative flex-1 min-h-[220px]"},Ws=["value"],qs={class:"flex items-center justify-between pt-2 border-t border-slate-800"},Ys={class:"bg-slate-900 border border-slate-700 rounded-3xl max-w-2xl w-full p-5 shadow-2xl flex flex-col gap-4 text-xs max-h-[92vh] overflow-hidden"},Xs={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Qs={class:"text-sm font-black text-white flex items-center gap-2"},en={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800"},tn={class:"flex items-center gap-1"},an={key:0,class:"px-2.5 py-0.5 rounded-lg bg-amber-500/20 text-amber-300 border border-amber-500/40 text-[10px] font-bold flex items-center gap-1"},sn={key:0,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-2.5 custom-scrollbar min-h-[300px]"},nn={key:0,class:"text-center py-12 text-slate-500 text-xs"},on={class:"flex-1 min-w-0"},ln={class:"flex items-center gap-2 mb-1 flex-wrap"},rn={class:"font-extrabold text-white text-xs"},dn={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-sky-950 text-sky-300 border border-sky-800"},un={class:"text-[9px] text-slate-500 font-mono"},cn={class:"text-[11px] text-slate-400 leading-snug line-clamp-2"},pn={class:"flex items-center gap-1.5 flex-shrink-0 self-end sm:self-center"},fn=["onClick"],mn=["onClick"],xn=["onClick"],hn=["onClick"],bn={key:1,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-3 custom-scrollbar min-h-[350px]"},gn={key:0,class:"p-2 rounded-xl bg-rose-950/60 border border-rose-500/50 text-rose-300 text-[11px] font-semibold"},vn={key:1,class:"p-2.5 rounded-2xl bg-amber-950/60 border border-amber-500/50 text-amber-200 text-xs flex items-center justify-between shadow-lg"},yn={class:"flex items-center gap-2 min-w-0"},kn={class:"p-1 rounded-lg bg-amber-500/20 text-amber-400 shrink-0"},wn={class:"min-w-0"},_n={class:"font-extrabold text-white text-xs flex items-center gap-1.5 truncate"},Sn={class:"text-amber-300 truncate"},Tn={class:"text-[10px] text-amber-400/80"},Cn={class:"p-3 rounded-2xl bg-gradient-to-r from-sky-950/60 via-indigo-950/40 to-slate-900 border border-sky-500/30 flex flex-col gap-2.5"},On={class:"flex flex-col sm:flex-row sm:items-center justify-between gap-2"},An={class:"flex items-center gap-1.5 shrink-0 flex-wrap"},Nn=["title"],In={key:0,class:"mt-1 flex flex-col gap-2 p-2.5 rounded-xl bg-slate-950/90 border border-sky-500/40"},Mn={class:"flex items-center justify-between"},$n=["value"],Dn={key:1,class:"mt-1 flex flex-col gap-2 p-2.5 rounded-xl bg-slate-950/90 border border-sky-500/40"},jn={class:"flex justify-end gap-2"},En={class:"grid grid-cols-1 sm:grid-cols-3 gap-2.5"},Rn=["disabled"],Pn={class:"grid grid-cols-1 sm:grid-cols-2 gap-2.5"},Ln=["value"],Vn={key:2,class:"flex flex-col gap-2.5 p-3 rounded-2xl bg-slate-950/80 border border-sky-500/30"},Bn={class:"flex items-center justify-between"},Jn={class:"text-[11px] font-black text-sky-400 flex items-center gap-1"},Fn={class:"flex items-center justify-end gap-2 pt-2 border-t border-slate-800"},Zn={class:"flex lg:hidden flex-col gap-3 pb-24"},Hn={class:"flex items-center justify-between gap-1 p-1 bg-slate-900/95 border border-slate-800 rounded-2xl shadow-lg sticky top-0 z-20 backdrop-blur-md"},Un={class:"flex items-center gap-1 overflow-x-auto no-scrollbar flex-1 py-0.5"},zn={key:0,class:"flex flex-col gap-3"},Gn={class:"flex items-start gap-2.5"},Kn={class:"min-w-0 flex-1"},Wn={class:"font-black text-white text-xs"},qn={class:"text-[11px] mt-0.5 leading-relaxed opacity-90"},Yn={key:0},Xn={key:1},Qn={class:"underline text-white"},eo={class:"underline text-white"},to={key:2},ao={class:"flex items-center gap-2 pt-1 border-t border-white/10 flex-wrap"},so={key:1,class:"p-2.5 rounded-xl bg-slate-900/60 border border-slate-800 flex items-center justify-between text-[11px] shadow-sm"},no={class:"flex items-center gap-2 text-slate-300 truncate"},oo={class:"font-extrabold text-white truncate"},io={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1.5 shadow-md"},lo=["value"],ro={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1.5 shadow-md"},uo=["value"],co={class:"grid grid-cols-1 sm:grid-cols-2 gap-2.5"},po={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1 shadow-md"},fo=["value"],mo={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1 shadow-md"},xo=["value"],ho={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2 shadow-md"},bo={class:"flex items-center justify-between"},go=["value"],vo={key:1,class:"flex flex-col gap-3"},yo={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},ko={class:"flex items-center justify-between"},wo={class:"text-xs font-extrabold text-white"},_o={key:0,class:"p-2.5 rounded-xl bg-amber-950/70 border border-amber-500/40 text-amber-200 text-xs flex items-center justify-between shadow"},So={class:"flex items-center gap-1.5 truncate"},To={class:"text-[11px] truncate"},Co={key:0},Oo={key:1},Ao={key:2},No={class:"flex gap-2 overflow-x-auto no-scrollbar py-1"},Io=["onClick"],Mo={class:"w-8 h-8 rounded-xl bg-slate-800 flex items-center justify-center text-sm shadow"},$o={class:"text-[10px] font-black text-white leading-tight truncate w-full"},Do={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},jo={class:"flex items-center justify-between"},Eo={class:"text-[10px] text-sky-400 font-bold"},Ro={class:"grid grid-cols-5 gap-2.5 py-1"},Po=["onClick","title"],Lo={class:"text-[8px] text-slate-400 truncate w-full text-center"},Vo={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-3 shadow-md"},Bo={class:"flex items-center justify-between"},Jo={class:"pt-2.5 border-t border-slate-800/80 flex items-center justify-between gap-2"},Fo={class:"flex items-center gap-1.5"},Zo={key:0,class:"p-2 rounded-xl bg-slate-950 border border-sky-500/40"},Ho=["value"],Uo={key:2,class:"flex flex-col gap-3"},zo={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},Go={class:"flex items-center justify-between"},Ko={class:"text-xs font-extrabold text-sky-400 flex items-center gap-1.5"},Wo=["disabled"],qo=["value"],Yo=["value"],Xo={class:"pt-1 space-y-1"},Qo={class:"flex items-center justify-between text-[11px]"},ei={class:"text-slate-400 font-mono"},ti={class:"text-sky-300 font-bold"},ai=["max","value"],si={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},ni={class:"flex items-center justify-between"},oi={class:"text-xs font-extrabold text-purple-400 flex items-center gap-1.5"},ii=["disabled"],li=["value"],ri=["value"],di={class:"pt-1 space-y-1"},ui={class:"flex items-center justify-between text-[11px]"},ci={class:"text-slate-400 font-mono"},pi={class:"text-purple-300 font-bold"},fi=["max","value"],mi={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl flex items-center justify-between shadow-md"},xi={class:"text-xs font-bold text-slate-300 flex items-center gap-1.5"},hi={class:"flex items-center gap-1.5"},bi=["onClick"],gi={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1.5 shadow-md"},vi={class:"grid grid-cols-3 gap-2"},yi=["checked"],ki=["checked"],wi=["checked"],_i={key:3,class:"flex flex-col gap-3"},Si={class:"p-4 rounded-3xl bg-gradient-to-br from-indigo-950/80 via-slate-900 to-sky-950/80 border border-sky-500/30 space-y-3 shadow-xl"},Ti={class:"flex items-center justify-between"},Ci={class:"text-xs font-black text-sky-300 uppercase tracking-wider flex items-center gap-1.5"},Oi={class:"text-[9px] px-2 py-0.5 rounded-full bg-emerald-500/20 text-emerald-400 font-bold border border-emerald-500/30"},Ai={class:"grid grid-cols-2 gap-2"},Ni={class:"space-y-1"},Ii=["value"],Mi={class:"space-y-1"},$i=["disabled"],Di={class:"p-3.5 bg-slate-900/90 border border-purple-500/30 rounded-2xl space-y-2.5 shadow-md"},ji={class:"flex items-center justify-between"},Ei={class:"flex items-center gap-1.5"},Ri={class:"flex items-center gap-2"},Pi=["disabled"],Li={key:4,class:"flex flex-col gap-3"},Vi={class:"flex items-center justify-between bg-slate-900/90 p-1 rounded-2xl border border-slate-800 text-xs font-bold shadow-md"},Bi={key:0,class:"flex flex-col gap-2"},Ji={class:"flex items-center justify-between px-1"},Fi={key:0,class:"text-center py-10 text-slate-500 text-xs bg-slate-900/50 rounded-2xl border border-slate-800"},Zi=["onClick"],Hi={class:"flex-1 pr-2 truncate"},Ui={class:"font-extrabold text-xs text-white truncate"},zi={class:"text-[10px] text-slate-400 font-mono"},Gi=["onClick"],Ki={key:1,class:"flex flex-col gap-2"},Wi={class:"flex items-center justify-between px-1"},qi={key:0,class:"text-center py-10 text-slate-500 text-xs bg-slate-900/50 rounded-2xl border border-slate-800"},Yi=["onClick"],Xi={class:"flex-1 pr-2 truncate"},Qi={class:"font-extrabold text-xs text-white truncate"},el={class:"text-[10px] text-slate-400 font-mono"},tl=["onClick"],al={key:5,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex flex-col justify-end"},sl={class:"w-full max-h-[80vh] bg-slate-900 border-t border-slate-700 rounded-t-3xl p-4 flex flex-col gap-3 shadow-2xl animate-in slide-in-from-bottom"},nl={class:"flex items-center justify-between pb-2 border-b border-slate-800"},ol={class:"flex items-center gap-1.5 truncate"},il={class:"truncate"},ll={key:0},rl={key:1},dl={key:2},ul=["value"],cl={class:"flex items-center justify-between gap-2"},pl={class:"hidden lg:flex flex-col gap-3"},fl={class:"flex flex-wrap items-center justify-between gap-2.5 p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl shadow-lg"},ml={class:"text-xs font-black text-white flex items-center gap-2"},xl={class:"flex items-center gap-1.5 flex-wrap"},hl={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 mr-1.5 shadow-inner"},bl=["value"],gl={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 mr-1.5 shadow-inner",title:"Pilih Bahasa Konten"},vl=["disabled"],yl={class:"relative group"},kl={class:"absolute right-0 mt-1 hidden group-hover:flex flex-col bg-slate-900 border border-slate-800 rounded-xl shadow-2xl py-2 z-20 w-60 text-xs"},wl={class:"px-3 py-1.5"},_l={class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase flex items-center justify-between"},Sl={class:"text-[9px] text-sky-400"},Tl={class:"max-h-60 overflow-y-auto custom-scrollbar flex flex-col"},Cl=["onClick"],Ol={class:"truncate"},Al={key:0,class:"text-[8px] px-1 py-0.2 rounded bg-purple-500/20 text-purple-300 ml-1"},Nl={key:0,class:"p-3 bg-gradient-to-r from-sky-950 via-indigo-950 to-purple-950 border border-sky-500/50 rounded-2xl flex items-center gap-3 animate-pulse shadow-lg shadow-sky-500/10"},Il={class:"w-6 h-6 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0"},Ml={class:"text-[11px]"},$l={class:"font-extrabold text-white flex items-center gap-2"},Dl={class:"text-[9px] px-1.5 py-0.2 rounded bg-sky-500/30 text-sky-200 border border-sky-400/30"},jl={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-semibold"},El={class:"flex items-center gap-1"},Rl={class:"flex items-center gap-1.5"},Pl={key:1,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[320px] overflow-y-auto custom-scrollbar"},Ll={key:0,class:"p-2 rounded-xl bg-amber-500/15 border border-amber-500/40 text-amber-200 flex items-center justify-between gap-2 shadow-sm text-xs sticky top-0 z-10 backdrop-blur-md"},Vl={class:"flex items-center gap-2 min-w-0"},Bl={class:"truncate"},Jl={class:"text-[11px] text-amber-100 font-semibold truncate block"},Fl={class:"flex items-center gap-1.5 flex-shrink-0"},Zl={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},Hl=["onClick"],Ul={class:"flex-1 pr-2"},zl={class:"flex items-center gap-1.5 mb-0.5"},Gl={class:"px-1.5 py-0.2 rounded text-[8px] font-bold uppercase bg-amber-500/20 text-amber-300 border border-amber-500/30"},Kl={class:"text-[9px] text-slate-400 font-semibold"},Wl={class:"font-bold text-[11px] truncate text-slate-100"},ql=["onClick"],Yl={key:2,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[320px] overflow-y-auto custom-scrollbar"},Xl={key:0,class:"p-2 rounded-xl bg-purple-500/15 border border-purple-500/40 text-purple-200 flex items-center justify-between gap-2 shadow-sm text-xs sticky top-0 z-10 backdrop-blur-md"},Ql={class:"flex items-center gap-2 min-w-0"},er={class:"truncate"},tr={class:"text-[11px] text-purple-100 font-semibold truncate block"},ar={class:"flex items-center gap-1.5 flex-shrink-0"},sr={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},nr=["onClick"],or={class:"flex-1 pr-2"},ir={class:"flex items-center gap-1.5 mb-0.5"},lr={class:"px-1.5 py-0.2 rounded text-[8px] font-bold uppercase bg-purple-500/20 text-purple-300 border border-purple-500/30"},rr={class:"text-[9px] text-slate-400 font-semibold"},dr={key:0,class:"text-[9px] text-slate-500 font-mono ml-auto"},ur={class:"font-bold text-[11px] truncate text-slate-100"},cr=["onClick"],pr={key:3,class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl overflow-hidden shadow-lg"},fr={class:"grid grid-cols-2 gap-2 p-2.5 bg-slate-950/70 border-b border-slate-800 text-xs"},mr={class:"flex items-center justify-between mb-1"},xr={class:"text-[10px] font-bold text-slate-300 flex items-center gap-1"},hr=["value"],br=["value"],gr=["value"],vr={class:"col-span-2 grid grid-cols-3 gap-2 pt-1 border-t border-slate-800/60 mt-1"},yr={class:"col-span-1"},kr=["value"],wr={class:"col-span-2"},_r=["value"],Sr={class:"flex items-center justify-between px-3 py-1.5 bg-slate-950/50 border-b border-slate-800"},Tr={class:"flex items-center gap-2 text-xs"},Cr={key:0,class:"inline-flex items-center gap-0.5 px-1.5 py-0.2 rounded-full text-[9px] font-semibold bg-emerald-500/20 text-emerald-400 border border-emerald-500/30"},Or={key:1,class:"inline-flex items-center gap-0.5 px-1.5 py-0.2 rounded-full text-[9px] font-semibold bg-rose-500/20 text-rose-400 border border-rose-500/30"},Ar={class:"flex items-center gap-2"},Nr={key:0},Ir={class:"underline"},Mr={class:"font-mono text-[10px]"},$r={key:1},Dr={class:"font-mono text-[10px]"},jr={class:"flex items-center gap-1.5 shrink-0"},Er={class:"relative p-2"},Rr=["value"],Pr={key:0,class:"text-[10px] text-rose-400 mt-1 px-1"},Lr={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-lg text-xs"},Vr={class:"flex flex-col gap-1.5"},Br={class:"flex items-center justify-between gap-2"},Jr={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},Fr={class:"flex items-center gap-1.5"},Zr=["value"],Hr=["value"],Ur=["disabled"],zr={class:"hidden sm:inline"},Gr={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},Kr={class:"flex items-center gap-1 text-sky-300 font-mono"},Wr=["max","value"],qr={class:"flex flex-col gap-1.5 pt-1.5 border-t border-slate-800"},Yr={class:"flex items-center justify-between gap-2"},Xr={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},Qr={class:"flex items-center gap-1.5"},ed=["value"],td=["value"],ad=["disabled"],sd={class:"hidden sm:inline"},nd={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},od={class:"flex items-center gap-1 text-purple-300 font-mono"},id=["max","value"],ld={class:"flex items-center justify-between pt-1.5 border-t border-slate-800"},rd={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},dd={class:"flex items-center gap-1.5 flex-wrap justify-end"},ud=["onClick"],cd={class:"grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"},pd=["checked"],fd=["checked"],md=["checked"],xd=["disabled"],hd=ca({__name:"DashboardControls",props:{modelValue:{},options:{},isValid:{type:Boolean},validationError:{},isGenerating:{type:Boolean},generateStage:{},isAutoTopicLoading:{type:Boolean},drafts:{},activeDraftIndex:{},history:{},activeHistoryIndex:{},unsavedStash:{}},emits:["update:modelValue","update:options","generate","autoTopic","selectDraft","deleteDraft","saveDraft","selectHistory","deleteHistory","clearAllHistory","restoreStash","clearStash","toast"],setup(n,{emit:e}){const s=n,i=e,l=S(""),d=S(s.modelValue?.templateId||s.modelValue?.layoutType||"table"),f=S(!0),c=S(""),C=S(""),w=S("gemini-3.8-flash"),M=S("editor");function Y(){i("restoreStash"),M.value="editor"}const ue=S([]),q=S("tech"),V=S(!1),D=S(null),F=S({id:"",name:"",theme:"blue-tech",description:""});async function ce(){try{const u=await $fetch("/api/niches");u?.niches&&u.niches.length>0&&(ue.value=u.niches,ue.value.some(a=>a.id===q.value)||(q.value=ue.value[0].id))}catch(u){console.error("Failed to load niches:",u)}}function Ce(){D.value=null,F.value={id:"",name:"",theme:s.modelValue.theme||"blue-tech",description:""},V.value=!0}function $e(u){D.value=u.id,F.value={id:u.id,name:u.name,theme:u.theme||"blue-tech",description:u.description}}async function ge(){if(!F.value.name.trim()){alert("Nama Niche wajib diisi");return}const a={id:D.value||F.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"_"),name:F.value.name.trim(),theme:F.value.theme,description:F.value.description.trim()||`Fokus pada topik ${F.value.name.trim()}`};try{const r=await $fetch("/api/niches",{method:"POST",body:a});r?.niches&&(ue.value=r.niches,q.value=a.id,D.value=null,F.value={id:"",name:"",theme:"blue-tech",description:""})}catch(r){alert("Gagal menyimpan niche: "+(r.data?.statusMessage||r.message))}}async function X(u){if(ue.value.length<=1){alert("Minimal harus ada 1 niche tersisa.");return}if(confirm("Hapus niche ini?"))try{const a=await $fetch(`/api/niches?id=${u}`,{method:"DELETE"});a?.niches&&(ue.value=a.niches,q.value===u&&(q.value=a.niches[0].id),D.value===u&&(D.value=null))}catch(a){alert("Gagal menghapus niche: "+(a.data?.statusMessage||a.message))}}const K=S("id"),W=S([{id:"table",name:"📊 Comparison Table",category:"Perbandingan",description:"Tabel komparasi 2 entitas",icon:"Table",layoutType:"table",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"versus",name:"⚔️ Versus Showdown Arena",category:"Perbandingan",description:"Duel head-to-head dua kubu",icon:"Swords",layoutType:"versus",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"receipt",name:"🧾 Monthly Living Invoice",category:"Finansial",description:"Format slip gaji pengeluaran bulanan",icon:"Receipt",layoutType:"receipt",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"news",name:"📰 Special Report Pamphlet",category:"Jurnalisme",description:"Pamflet investigasi dengan 3 poin kunci",icon:"Newspaper",layoutType:"news",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"stat",name:"🎯 Big Shocking Number",category:"Analisis",description:"Fokus pada satu angka kontras raksasa",icon:"Target",layoutType:"stat",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"timeline",name:"⏳ 10-Year Shift (Then vs Now)",category:"Tren",description:"Pergeseran tren 10 tahun lalu vs sekarang",icon:"Clock",layoutType:"timeline",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"barchart",name:"📈 Income Allocation Bars",category:"Finansial",description:"Distribusi alokasi dana dengan bar chart",icon:"BarChart3",layoutType:"barchart",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"list",name:"🏆 Top 5 Ranked List",category:"Peringkat",description:"Ranking 5 teratas dengan kartu metrik",icon:"ListOrdered",layoutType:"list",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"quote",name:"💬 Hot Take / Quote Debate",category:"Opini",description:"Kutipan tajam memicu perdebatan",icon:"Quote",layoutType:"quote",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"leaderboard",name:"🥇 Multi-Country Leaderboard (Top 10)",category:"Peringkat",description:"Peringkat 5-10 negara dengan horizontal bar chart",icon:"Trophy",layoutType:"leaderboard",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"editorial",name:"📰 Editorial Storytelling Deep Dive",category:"Jurnalisme",description:"Format narasi editorial 3 kartu bertahap",icon:"BookOpen",layoutType:"editorial",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"matrix",name:"📊 Multi-Column Matrix (3-4 Negara)",category:"Perbandingan",description:"Tabel matriks komparasi 3-4 negara sekaligus",icon:"Grid",layoutType:"matrix",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"debate",name:"⚡ Debate Arena (Pro vs Kontra)",category:"Interaktif",description:"Arena debat dua kubu dengan skor komunitas",icon:"Flame",layoutType:"debate",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"tierlist",name:"🎖️ Tier List Ranking (S, A, B, C)",category:"Peringkat",description:"Hierarki tingkatan Tier S, A, B, C",icon:"Layers",layoutType:"tierlist",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"breaking-notifications",name:"📱 Breaking Alert Notification Stack",category:"Berita Viral",description:"Tumpukan 3 kartu notifikasi darurat kaca iOS/Android",icon:"Bell",layoutType:"custom",isBuiltin:!0,sampleData:{},promptDirective:""}]),we=S(!1),ne=S("list"),Q=S(null),ie=S(""),U=S(""),ve=S(!1),te=S(!1),_e=S(!1),ae=S(""),N=S({id:"",name:"",category:"Kustom",description:"",layoutType:"custom",customHtml:"",customCss:"",promptDirective:"",sampleJsonText:""});async function ze(){try{const u=await $fetch("/api/templates");u?.templates&&u.templates.length>0&&(W.value=u.templates)}catch(u){console.error("Failed to load templates:",u)}}function I(u="list"){ne.value=u,U.value="",u==="form"&&B(),we.value=!0}function h(){B(),U.value="",ne.value="form",we.value=!0}function ee(){B(),U.value="",ne.value="list"}function Me(){we.value=!1,B(),U.value="",ne.value="list"}function B(){Q.value=null,N.value={id:"",name:"",category:"Kustom",description:"",layoutType:"custom",customHtml:`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700/80 text-center shadow-xl">
|
|
2
|
+
<span class="px-3 py-1 rounded-full text-xs font-black uppercase tracking-wider bg-sky-500/20 text-sky-400 border border-sky-500/30 mb-3 inline-block">{{ data.category }}</span>
|
|
3
|
+
<h2 class="text-3xl font-black text-white mb-2 leading-tight">{{ data.title }}</h2>
|
|
4
|
+
<p class="text-lg text-sky-300 font-bold mb-4">{{ data.subtitle }}</p>
|
|
5
|
+
</div>`,customCss:".custom-card-glow { box-shadow: 0 10px 30px -5px rgba(14, 165, 233, 0.3); }",promptDirective:"Instruksi khusus untuk AI saat generate format ini...",sampleJsonText:JSON.stringify({title:"JUDUL KONTEN MENARIK 2026",subtitle:"Subjudul penjelas berbasis fakta data",category:"KUSTOM VIRAL",watermark:"@SocialGen"},null,2)}}function Be(u){if(N.value.layoutType=u,u==="custom"){N.value.customHtml||(N.value.customHtml=`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700/80 text-center shadow-xl">
|
|
6
|
+
<span class="px-3 py-1 rounded-full text-xs font-black uppercase tracking-wider bg-sky-500/20 text-sky-400 border border-sky-500/30 mb-3 inline-block">{{ data.category }}</span>
|
|
7
|
+
<h2 class="text-3xl font-black text-white mb-2 leading-tight">{{ data.title }}</h2>
|
|
8
|
+
<p class="text-lg text-sky-300 font-bold mb-4">{{ data.subtitle }}</p>
|
|
9
|
+
</div>`);return}const a=W.value.find(r=>r.id===u||r.layoutType===u);a&&(N.value.promptDirective=a.promptDirective,N.value.sampleJsonText=JSON.stringify(a.sampleData,null,2),N.value.customHtml=a.customHtml||"",N.value.customCss=a.customCss||"")}function jt(u){Q.value=u.id,N.value={id:u.id,name:u.name,category:u.category,description:u.description,layoutType:u.layoutType,customHtml:u.customHtml||"",customCss:u.customCss||"",promptDirective:u.promptDirective,sampleJsonText:JSON.stringify(u.sampleData,null,2)},ne.value="form"}function Ye(u){Q.value=null,N.value={id:`${u.id}-custom-${Date.now().toString().slice(-4)}`,name:`${u.name} (Kustom)`,category:u.category||"Kustom",description:u.description,layoutType:u.layoutType,customHtml:u.customHtml||"",customCss:u.customCss||"",promptDirective:u.promptDirective,sampleJsonText:JSON.stringify(u.sampleData,null,2)},ne.value="form"}const dt=be(()=>`Bertindaklah sebagai Lead Design Technologist & Senior Frontend Engineer untuk SocialGen (Dynamic Visual Engine for High-CPM Meta Monetization).
|
|
10
|
+
|
|
11
|
+
Saya melampirkan screenshot / gambar desain kartu visual media sosial.
|
|
12
|
+
|
|
13
|
+
Tugas Anda:
|
|
14
|
+
Analisis tata letak visual, dekorasi, tipografi, warna, bingkai, dan struktur konten pada gambar ini, lalu ubah menjadi template visual kustom SocialGen dalam format 1 objek JSON valid persis seperti ini:
|
|
15
|
+
|
|
16
|
+
{
|
|
17
|
+
"id": "slug-unik-kebab-case",
|
|
18
|
+
"name": "Nama Template Unik (Awali dengan Emoji, misal: 📰 Orange Pill Hero & News Tablet)",
|
|
19
|
+
"category": "Kategori Template (misal: Edukasi, Finansial, Berita Viral, Ranking, Perbandingan)",
|
|
20
|
+
"description": "Deskripsi singkat 1-2 kalimat mengenai gaya visual dan kegunaan template ini.",
|
|
21
|
+
"layoutType": "custom",
|
|
22
|
+
"customHtml": "<div class=\\"my-container\\">\\n <!-- Header / Hero Section -->\\n <div class=\\"my-hero\\">\\n <div class=\\"my-subtitle\\">{{ data.subtitle }}</div>\\n <div class=\\"my-title-box\\">\\n <h1 class=\\"my-title\\">{{ data.title }}</h1>\\n </div>\\n </div>\\n\\n <!-- Body / Main Content Visual Structure (Tablet / Frame / Pill Cards) -->\\n <div class=\\"my-frame-box\\">\\n {{#each data.items}}\\n <div class=\\"my-item-card\\">\\n <div class=\\"my-item-dot\\"></div>\\n <div class=\\"my-item-text\\">{{ text }}</div>\\n </div>\\n {{/each}}\\n </div>\\n\\n <!-- Footer / Source Attribution -->\\n <div class=\\"my-footer\\">\\n <span class=\\"my-source\\">{{ data.footerNote }}</span>\\n </div>\\n</div>",
|
|
23
|
+
"customCss": ".my-container { width: 100%; max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } .my-hero { display: flex; flex-direction: column; gap: 12px; } .my-subtitle { font-size: 24px; font-weight: 800; color: #ffffff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); } .my-title-box { background: #ffffff; border-radius: 24px; padding: 22px 32px; box-shadow: 0 12px 28px rgba(0,0,0,0.25); } .my-title { margin: 0; font-size: 56px; font-weight: 900; line-height: 1.1; color: #d84e1f; text-transform: uppercase; } .my-frame-box { display: flex; flex-direction: column; gap: 16px; background: rgba(30, 41, 59, 0.9); border-radius: 32px; padding: 26px; border: 2px solid rgba(255,255,255,0.15); box-shadow: 0 20px 40px rgba(0,0,0,0.35); } .my-item-card { display: flex; align-items: flex-start; gap: 16px; background: #ffffff; border-radius: 18px; padding: 20px 24px; border-left: 8px solid #eb6a37; box-shadow: 0 4px 12px rgba(0,0,0,0.06); } .my-item-dot { width: 14px; height: 14px; min-width: 14px; border-radius: 50%; background: #f5b027; margin-top: 6px; } .my-item-text { font-size: 22px; font-weight: 700; line-height: 1.45; color: #1e293b; margin: 0; } .my-footer { display: flex; justify-content: center; } .my-source { font-size: 17px; font-weight: 700; color: rgba(255,255,255,0.9); background: rgba(15,23,42,0.6); padding: 10px 22px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.2); text-shadow: 0 1px 3px rgba(0,0,0,0.4); }",
|
|
24
|
+
"sampleData": {
|
|
25
|
+
"templateId": "slug-unik-kebab-case",
|
|
26
|
+
"layoutType": "custom",
|
|
27
|
+
"title": "CONTOH JUDUL BESAR KAPITAL SESUAI GAMBAR",
|
|
28
|
+
"subtitle": "Contoh subjudul pengantar informatif sesuai konteks gambar",
|
|
29
|
+
"category": "KATEGORI KONTEN",
|
|
30
|
+
"watermark": "@SocialGen",
|
|
31
|
+
"theme": "sunset-orange",
|
|
32
|
+
"footerNote": "Sumber: Lembaga Riset / Instansi Resmi (domain.go.id / .org) 2026",
|
|
33
|
+
"methodologyBadge": "Metodologi Riset Resmi 2026",
|
|
34
|
+
"disclaimer": "Ringkasan data edukasi • Bukan nasihat resmi",
|
|
35
|
+
"sourceUrl": "https://domain-resmi.org",
|
|
36
|
+
"reelsDuration": 30,
|
|
37
|
+
"caption": "Pertanyaan pemantik interaksi netizen? Tulis pendapatmu di bawah! 👇 #hashtags",
|
|
38
|
+
"items": [
|
|
39
|
+
{ "text": "Poin penjelasan pertama yang ringkas dan padat (maksimal 20 kata per poin)..." },
|
|
40
|
+
{ "text": "Poin penjelasan kedua yang mereplikasi isi kartu pada gambar..." },
|
|
41
|
+
{ "text": "Poin penjelasan ketiga yang melengkapi data infografis..." }
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"promptDirective": "FORMAT STRUKTUR JSON:\\n- 'templateId': Wajib cantumkan 'slug-unik-kebab-case'.\\n- 'layoutType': Wajib 'custom'.\\n- 'title': Judul utama singkat, padat, kapital (2-4 kata) yang menonjol.\\n- 'subtitle': Subjudul informatif 1 baris (6-10 kata) sebagai pengantar.\\n- 'footerNote': WAJIB cantumkan nama lembaga/sumber data riset resmi & tahun data.\\n- 'items': Array berisi 3 hingga 5 objek dengan properti 'text' (1-2 kalimat ringkas padat)."
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
=======================================================
|
|
48
|
+
PANDUAN STANDAR WAJIB ARSITEKTUR TEMPLATE SOCIALGEN:
|
|
49
|
+
|
|
50
|
+
1. ATURAN KRUSIAL KODE HTML (JANGAN PERNAH DIHAPUS):
|
|
51
|
+
- Kolom \\"customHtml\\" WAJIB berupa string HTML utuh dengan seluruh tag pembuka & penutup <div>, <h1>, <p>, <span>.
|
|
52
|
+
- DILARANG KERAS hanya menulis variabel {{ data.title }} {{ data.items }} tanpa tag pembungkus HTML dan class CSS!
|
|
53
|
+
- Semua tanda kutip dua atribut di dalam JSON wajib di-escape (misal: class=\\"my-card\\").
|
|
54
|
+
|
|
55
|
+
2. KESERASIAN ID TEMPLATE (ID MATCHING):
|
|
56
|
+
- Field root \\"id\\" dan field \\"sampleData.templateId\\" HARUS BERNILAI SAMA PERSIS (contoh: \\"orange-pill-hero\\").
|
|
57
|
+
- Jangan menggunakan ID yang berbeda antara root dan sampleData karena sistem SocialGen auto-switch menggunakan ID ini.
|
|
58
|
+
|
|
59
|
+
3. KANVAS RESPONSIVE MULTI-FORMAT (FEED 4:5 & REELS 9:16):
|
|
60
|
+
- SocialGen mengekspor konten ke Feed 4:5 (1080x1350) dan Story/Reels 9:16 (1080x1920).
|
|
61
|
+
- JANGAN PERNAH memberi tinggi mati (height: 1350px) pada kontainer utama!
|
|
62
|
+
- Kontainer terluar WAJIB menggunakan:
|
|
63
|
+
width: 100%; max-width: 960px; margin: 0 auto; display: flex; flex-direction: column;
|
|
64
|
+
- Dengan aturan ini, kartu akan selalu berada tepat di tengah (center) dan berada di dalam Safe Zone baik pada format Feed maupun Reels.
|
|
65
|
+
|
|
66
|
+
4. JANGAN DUPLIKASI HEADER & FOOTER GLOBAL SOCIALGEN:
|
|
67
|
+
- SocialGen SUDAH otomatis merender Top Metadata Bar (Category Badge & Watermark @SocialGen) di bagian paling atas kanvas.
|
|
68
|
+
- SocialGen SUDAH otomatis merender Bottom Callout (\\"💬 Drop your opinion below • Share to your feed ↗\\" & Disclaimer) di bagian paling bawah.
|
|
69
|
+
- Oleh karena itu, customHtml HANYA fokus mendesain kartu konten di bagian tengah:
|
|
70
|
+
* Header kartu (Subtitle + Judul Besar)
|
|
71
|
+
* Badan kartu (mockup tablet, framed box, kartu list pil/bubble)
|
|
72
|
+
* Sumber data (footerNote) di bagian bawah kartu
|
|
73
|
+
|
|
74
|
+
5. TIPOGRAFI STANDAR 1080px (READABILITY V2.3.4):
|
|
75
|
+
- Kanvas beresolusi 1080px lebar. Agar terbaca jelas di HP tanpa zoom:
|
|
76
|
+
* Judul Utama (title): font-size: 52px – 64px (font-weight: 900, line-height: 1.08 - 1.15)
|
|
77
|
+
* Subjudul (subtitle): font-size: 22px – 26px (font-weight: 700-800)
|
|
78
|
+
* Teks Kartu Poin (items): font-size: 20px – 24px (font-weight: 700, line-height: 1.45)
|
|
79
|
+
* Sumber Data (footerNote): font-size: 16px – 18px (font-weight: 600-700)
|
|
80
|
+
|
|
81
|
+
6. MURNI CSS EKSPLISIT DI 'customCss':
|
|
82
|
+
- Karena aplikasi sudah di-compile, jangan mengandalkan arbitrary Tailwind baru (seperti text-[55px] atau bg-[#123456]).
|
|
83
|
+
- Semua warna, background, border, radius, bayangan, font-size, dan flexbox WAJIB ditulis lengkap dan eksplisit di \\"customCss\\".
|
|
84
|
+
|
|
85
|
+
7. KREDIBILITAS TIER 1 (META CPM MONETIZATION):
|
|
86
|
+
- Selalu sertakan field \\"methodologyBadge\\", \\"disclaimer\\", dan \\"sourceUrl\\" di sampleData untuk lolos verifikasi transparansi data audiens Tier 1.
|
|
87
|
+
|
|
88
|
+
Keluarkan HANYA 1 objek JSON valid tanpa markdown formatting (\`\`\`json) agar bisa langsung diimpor otomatis ke aplikasi SocialGen.`);async function ut(){await xt(dt.value)&&(ve.value=!0,setTimeout(()=>{ve.value=!1},3e3))}function Et(){if(U.value="",!!ae.value.trim())try{let u=ae.value.trim();u=u.replace(/^```json\s*/i,"").replace(/```$/i,"").trim();const a=JSON.parse(u),r=(a.id||a.sampleData?.templateId||a.name||"").toLowerCase().replace(/[^a-z0-9_-]/g,"-").replace(/^-+|-+$/g,"");if(r&&(N.value.id=r),a.name&&(N.value.name=a.name),a.category&&(N.value.category=a.category),a.description&&(N.value.description=a.description),N.value.layoutType=a.layoutType||"custom",a.customHtml){const v=a.customHtml.trim();N.value.customHtml=v,/<[a-z][\s\S]*>/i.test(v)||(U.value="⚠️ Perhatian: customHtml tidak mendeteksi tag HTML (seperti <div>, <p>). Pastikan AI menyertakan elemen HTML pembungkus class CSS.")}if(a.customCss&&(N.value.customCss=a.customCss),a.promptDirective&&(N.value.promptDirective=a.promptDirective),a.sampleData){const v={...a.sampleData};N.value.id&&(v.templateId=N.value.id,v.layoutType="custom"),v.id||(v.id="sample-"+(N.value.id||Date.now())),N.value.sampleJsonText=JSON.stringify(v,null,2)}te.value=!1,ae.value=""}catch(u){U.value="Gagal membaca JSON dari AI: "+u.message}}async function Rt(){if(U.value="",!N.value.name.trim()){U.value="Nama template wajib diisi";return}const u=Q.value||N.value.id.trim()||N.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"-");let a=null;try{a=JSON.parse(N.value.sampleJsonText),a.id||(a.id=u)}catch(r){U.value="JSON Sampel Data tidak valid: "+r.message;return}try{const r=await $fetch("/api/templates",{method:"POST",body:{id:u,name:N.value.name.trim(),category:N.value.category.trim()||"Kustom",description:N.value.description.trim(),layoutType:N.value.layoutType,customHtml:N.value.customHtml?.trim()||void 0,customCss:N.value.customCss?.trim()||void 0,sampleData:a,promptDirective:N.value.promptDirective.trim(),isBuiltin:!!(Q.value&&W.value.find(v=>v.id===Q.value)?.isBuiltin)}});r?.templates&&(W.value=r.templates),ne.value="list",Q.value=null}catch(r){U.value=r.data?.statusMessage||r.message||"Gagal menyimpan template"}}async function yt(u){if(confirm("Yakin ingin menghapus template kustom ini?"))try{const a=await $fetch(`/api/templates?id=${u}`,{method:"DELETE"});a?.templates&&(W.value=a.templates)}catch(a){alert(a.data?.statusMessage||a.message||"Gagal menghapus template")}}function Pt(u){Xe(u.layoutType==="custom"?u.id:u.layoutType||u.id),we.value=!1}const T=be(()=>{if(!ie.value.trim())return W.value;const u=ie.value.toLowerCase();return W.value.filter(a=>a.name.toLowerCase().includes(u)||a.category.toLowerCase().includes(u)||a.description.toLowerCase().includes(u)||a.layoutType.toLowerCase().includes(u))}),b=S(!1),ye=S(""),le=S({}),ma=S(!1),kt=S(!1),Lt=S(["cyber_blue.mp4","emerald_flow.mp4","default_bg.mp4"]),Vt=S(["synthwave_pulse.mp3","lofi_chill.mp3","default_ambient.mp3"]),De=S({"neon_cyber_grid.mp4":8,"financial_pulse_flow.mp4":8,"dark_luxury_particles.mp4":8,"cyber_matrix_stream.mp4":10,"cyber_blue.mp4":15,"default_bg.mp4":15,"emerald_flow.mp4":15,"cyber_pulse.mp4":15,"cyber_future_tech.mp3":15,"dark_phonk_pulse.mp3":15,"deep_finance_groove.mp3":15,"synthwave_pulse.mp3":15,"lofi_chill.mp3":15,"default_ambient.mp3":15,"motivation_cinematic.mp3":110,"lofi_viral_study.mp3":147}),Bt=be(()=>{const u=s.options.backgroundSource||"";return De.value[u]||15}),Ge=be(()=>Math.max(1,Bt.value-1)),Jt=be(()=>{const u=s.options.musicFile||"";return De.value[u]||30}),Ke=be(()=>Math.max(1,Jt.value-1));function xa(u,a){if(!u||u==="random"||typeof window>"u")return;const r=a==="video"?`/api/stream/videos/${encodeURIComponent(u)}`:`/api/stream/musics/${encodeURIComponent(u)}`;if(a==="audio"){const v=new Audio;v.preload="metadata",v.src=r,v.onloadedmetadata=()=>{if(v.duration&&!isNaN(v.duration)&&isFinite(v.duration)){const P=Math.round(v.duration);P>0&&P!==De.value[u]&&(De.value={...De.value,[u]:P})}}}else{const v=document.createElement("video");v.preload="metadata",v.src=r,v.onloadedmetadata=()=>{if(v.duration&&!isNaN(v.duration)&&isFinite(v.duration)){const P=Math.round(v.duration);P>0&&P!==De.value[u]&&(De.value={...De.value,[u]:P})}}}}ke(()=>s.options.backgroundSource,(u,a)=>{if(u&&xa(u,"video"),a!==void 0&&u!==a)je("videoStartOffset",0);else{const r=Ge.value;(s.options.videoStartOffset||0)>r&&je("videoStartOffset",r)}},{immediate:!0}),ke(()=>s.options.musicFile,(u,a)=>{if(u&&xa(u,"audio"),a!==void 0&&u!==a)je("audioStartOffset",0);else{const r=Ke.value;(s.options.audioStartOffset||0)>r&&je("audioStartOffset",r)}},{immediate:!0});const Je=S(!1),Ft=S(null),Zt=S(null);async function ha(){try{const u=await $fetch("/api/media");u?.videos?.length&&(Lt.value=u.videos),u?.audio?.length&&(Vt.value=u.audio),u?.durations&&(De.value={...De.value,...u.durations})}catch(u){console.error("Failed to fetch media list:",u)}}pa(()=>{try{const u=localStorage.getItem("sg_selected_language");u&&(K.value=u)}catch{}ha(),ce(),ze()}),ke(K,u=>{try{localStorage.setItem("sg_selected_language",u)}catch{}});async function ba(u,a){const r=u.target,v=r.files?.[0];if(v){Je.value=!0;try{const P=new FormData;P.append("file",v);const Oe=await $fetch("/api/upload-media",{method:"POST",body:P});Oe?.success&&(await ha(),Oe.type==="video"?i("update:options",{...s.options,backgroundSource:Oe.filename,videoStartOffset:0}):i("update:options",{...s.options,musicFile:Oe.filename,audioStartOffset:0}))}catch(P){alert("Upload gagal: "+(P.data?.statusMessage||P.message))}finally{Je.value=!1,r.value=""}}}const de=be(()=>{const u=(d.value||"table").trim().toLowerCase();return W.value.find(a=>a.id.toLowerCase()===u||a.layoutType&&a.layoutType.toLowerCase()===u)||W.value[0]}),pe=be(()=>{const u=l.value.trim();if(!u)return null;try{return JSON.parse(u)}catch{return null}}),G=be(()=>{if(!l.value.trim()||!pe.value)return null;const u=(pe.value.templateId||pe.value.layoutType||(W.value.some(P=>P.id===pe.value?.id)?pe.value?.id:"")||"").trim().toLowerCase();if(!u)return null;const a=(d.value||"").trim().toLowerCase(),r=(de.value?.layoutType||"").trim().toLowerCase();if(u===a||u===r)return null;const v=W.value.find(P=>P.id.toLowerCase()===u||P.layoutType&&P.layoutType.toLowerCase()===u);return{jsonTemplateId:pe.value.templateId||pe.value.layoutType||pe.value.id,matchedTarget:v||null,isKnown:!!v}}),Fe=be(()=>{if(!l.value.trim()){const u=de.value?.sampleData?JSON.parse(JSON.stringify(de.value.sampleData)):{},a=de.value?.id||"table",r=de.value?.layoutType==="custom"?a:de.value?.layoutType||a;return{...u,id:u.id||a,templateId:a,layoutType:r,customHtml:de.value?.customHtml||void 0,customCss:de.value?.customCss||void 0}}if(pe.value){const u=de.value?.id||pe.value.templateId||"table",a=de.value?.layoutType==="custom"?u:de.value?.layoutType||u;return{...pe.value,templateId:u,layoutType:a,customHtml:de.value?.customHtml||pe.value.customHtml||void 0,customCss:de.value?.customCss||pe.value.customCss||void 0}}return s.modelValue});ke(()=>Fe.value,u=>{i("update:modelValue",u),u.theme&&u.theme!==s.options.theme&&i("update:options",{...s.options,theme:u.theme})},{immediate:!0,deep:!0}),ke(()=>s.modelValue,u=>{if(!u)return;const a=JSON.stringify(Fe.value),r=JSON.stringify(u);if(a!==r){const v=u.templateId||u.layoutType;if(v){const P=W.value.find(Oe=>Oe.id.toLowerCase()===v.toLowerCase()||Oe.layoutType&&Oe.layoutType.toLowerCase()===v.toLowerCase());P&&(d.value=P.id)}l.value=JSON.stringify(u,null,2)}},{deep:!0}),ke(()=>s.unsavedStash,(u,a)=>{a&&!u&&(M.value="editor")});function ga(u){const a=u.target;if(l.value=a.value,!a.value.trim()){c.value="";return}try{const r=JSON.parse(a.value);if(c.value="",f.value){const v=(r.templateId||r.layoutType||(W.value.some(P=>P.id===r.id)?r.id:"")||"").trim().toLowerCase();if(v){const P=W.value.find(Oe=>Oe.id.toLowerCase()===v||Oe.layoutType&&Oe.layoutType.toLowerCase()===v);P?P.id.toLowerCase()!==d.value.toLowerCase()?(d.value=P.id,i("toast",`✓ JSON terdeteksi: Otomatis beralih ke template ${P.name}`,"success")):i("toast",`✓ JSON cocok dengan template ${P.name}`,"success"):i("toast",`⚠️ Format JSON: Template ID "${v}" tidak terdaftar di sistem`,"error")}else i("toast",`JSON valid dimasukkan untuk template ${de.value?.name}`,"success")}}catch(r){c.value="Format JSON tidak valid: "+r.message}}function Ht(){l.value="",c.value="",i("toast",`Format direset ke sampel template ${de.value?.name||""}`,"success")}function Ut(){l.value="",c.value="",i("toast",`Format disesuaikan ke data sampel ${de.value?.name||""}`,"success")}function va(){if(l.value.trim())try{const u=JSON.parse(l.value);l.value=JSON.stringify(u,null,2),c.value="",i("toast","JSON berhasil dirapikan","success")}catch{c.value="Format JSON tidak valid, periksa kembali kurung/tanda petik"}}function Xe(u){d.value=u;const a=W.value.find(v=>v.id===u),r=a?.name||u;if(l.value.trim()&&pe.value){const v=(pe.value.templateId||pe.value.layoutType||(W.value.some(os=>os.id===pe.value?.id)?pe.value?.id:"")||"").trim().toLowerCase(),P=u.trim().toLowerCase(),Oe=(a?.layoutType||"").trim().toLowerCase();v&&v!==P&&v!==Oe?i("toast",`Beralih ke template ${r}. Format JSON berbeda, klik 'Pakai Sampel' untuk menyesuaikan.`,"info"):i("toast",`Template diubah ke ${r}`,"success")}else i("toast",`Template diubah ke ${r}`,"success")}function ya(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Fe.value};a.title=u,l.value=JSON.stringify(a,null,2)}catch{}}function ka(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Fe.value};a.watermark=u,l.value=JSON.stringify(a,null,2)}catch{}}function Xa(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Fe.value};a.subtitle=u,l.value=JSON.stringify(a,null,2)}catch{}}function Qa(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Fe.value};a.footerNote=u,l.value=JSON.stringify(a,null,2)}catch{}}function es(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Fe.value};a.caption=u,l.value=JSON.stringify(a,null,2)}catch{}}const Se=S("content"),ct=S(!1),ts=[{id:"blue-tech",name:"Blue Tech",color:"#0284c7"},{id:"emerald-finance",name:"Emerald Finance",color:"#059669"},{id:"slate-education",name:"Slate Education",color:"#64748b"},{id:"dark-contrast",name:"Dark Contrast",color:"#1e293b"},{id:"crimson-alert",name:"Crimson Alert",color:"#e11d48"},{id:"amber-gold",name:"Amber Gold",color:"#d97706"},{id:"cyber-violet",name:"Cyber Violet",color:"#7c3aed"},{id:"sunset-orange",name:"Sunset Orange",color:"#ea580c"},{id:"nordic-frost",name:"Nordic Frost",color:"#0891b2"},{id:"monochrome-luxe",name:"Monochrome Luxe",color:"#475569"}];function as(u,a){const r=(a||u||"").toLowerCase();return r.includes("orange")||r.includes("news")?"📰":r.includes("edu")||r.includes("infografis")?"📜":r.includes("breaking")||r.includes("alert")?"🚨":r.includes("stat")?"🎯":r.includes("table")||r.includes("matrix")?"📊":r.includes("versus")||r.includes("debate")?"⚔️":r.includes("receipt")?"🧾":r.includes("tierlist")?"🎖️":r.includes("leaderboard")||r.includes("list")?"🏆":r.includes("quote")?"💬":r.includes("timeline")?"⏳":r.includes("barchart")?"📈":"🎨"}function wa(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Fe.value};a.theme=u,l.value=JSON.stringify(a,null,2)}catch{}i("update:options",{...s.options,theme:u})}function _a(u){const a={...s.modelValue,reelsDuration:u};i("update:modelValue",a)}function je(u,a){i("update:options",{...s.options,[u]:a})}function Qe(u,a){const r=s.options.outputs||{feed:!0,story:!0,reels:!0};i("update:options",{...s.options,outputs:{...r,[u]:a}})}function zt(u,a){i("autoTopic",q.value,a||C.value||void 0,w.value,K.value)}async function Gt(){b.value=!0,ma.value=!0;try{const u=await $fetch("/api/copy-prompt",{query:{niche:q.value,layout:s.modelValue.layoutType||"table",language:K.value}});ye.value=u.prompt,le.value={topic:u.topic,pair:u.pair,niche:u.niche,template:u.template,usedCount:u.usedCount,language:u.language||K.value}}catch(u){console.error("Failed to get manual prompt:",u)}finally{ma.value=!1}}async function ss(){if(!ye.value)return;await xt(ye.value)&&(kt.value=!0,setTimeout(()=>{kt.value=!1},2500))}const wt=S(!1),_t=S(!1);async function ns(){wt.value=!0;try{const u=await $fetch("/api/copy-prompt",{query:{niche:q.value,layout:s.modelValue.layoutType||"table",language:K.value}});ye.value=u.prompt,le.value={topic:u.topic,pair:u.pair,niche:u.niche,template:u.template,usedCount:u.usedCount,language:u.language||K.value},await xt(u.prompt)&&(_t.value=!0,setTimeout(()=>{_t.value=!1},2500))}catch(u){console.error("Failed to copy topic prompt:",u)}finally{wt.value=!1}}function Sa(){s.history.length!==0&&confirm(`Bersihkan semua ${s.history.length} riwayat generate otomatis?`)&&i("clearAllHistory")}function Ta(u){if(!u)return"";try{return new Date(u).toLocaleDateString("id-ID",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}catch{return""}}return(u,a)=>(p(),m("div",ys,[o(V)?(p(),m("div",ks,[t("div",ws,[t("div",_s,[t("div",null,[t("h3",Ss,[k(o(Yt),{class:"w-4 h-4 text-sky-400"}),a[85]||(a[85]=J(" Kelola & Buat Niche Baru ",-1))]),a[86]||(a[86]=t("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Simpan niche favoritmu. AI dan Prompt Generator akan otomatis menggunakannya. ",-1))]),t("button",{onClick:a[0]||(a[0]=r=>V.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[k(o(Xt),{class:"w-4 h-4"})])]),t("div",Ts,[t("div",Cs,[t("span",null,x(o(D)?"✏️ Edit Niche":"➕ Tambah Niche Baru"),1),o(D)?(p(),m("button",{key:0,onClick:a[1]||(a[1]=r=>{D.value=null,F.value={id:"",name:"",theme:"blue-tech",description:""}}),class:"text-[10px] text-slate-400 hover:text-white"}," Batal Edit ")):$("",!0)]),t("div",Os,[t("div",null,[a[87]||(a[87]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Niche",-1)),fe(t("input",{"onUpdate:modelValue":a[2]||(a[2]=r=>o(F).name=r),type:"text",placeholder:"Contoh: Kuliner & Restoran, Otomotif EV",class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[Ae,o(F).name]])]),t("div",null,[a[89]||(a[89]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Tema Default",-1)),fe(t("select",{"onUpdate:modelValue":a[3]||(a[3]=r=>o(F).theme=r),class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},[...a[88]||(a[88]=[pt('<option value="blue-tech">🔵 Blue Tech</option><option value="emerald-finance">🟢 Emerald Finance</option><option value="slate-education">🟣 Slate Education</option><option value="dark-contrast">⚫ Dark Contrast</option><option value="crimson-alert">🔴 Crimson Alert</option><option value="amber-gold">🟡 Amber Gold</option><option value="cyber-violet">🟪 Cyber Violet</option><option value="sunset-orange">🟠 Sunset Orange</option><option value="nordic-frost">❄️ Nordic Frost</option><option value="monochrome-luxe">⚪ Monochrome Luxe</option>',10)])],512),[[et,o(F).theme]])])]),t("div",null,[a[90]||(a[90]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Fokus Topik & Instruksi Prompt",-1)),fe(t("textarea",{"onUpdate:modelValue":a[4]||(a[4]=r=>o(F).description=r),rows:"2",placeholder:"Jelaskan topik yang ingin disorot AI (misal: perbandingan harga kopi, biaya buka gerai, margin laba kuliner...)",class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2 text-xs text-slate-200 focus:outline-none focus:border-sky-500 resize-none leading-relaxed"},null,512),[[Ae,o(F).description]])]),t("button",{onClick:ge,class:"self-end px-4 py-1.5 rounded-xl bg-sky-600 hover:bg-sky-500 text-white font-bold text-xs transition flex items-center gap-1.5 shadow"},[k(o(at),{class:"w-3.5 h-3.5"}),t("span",null,x(o(D)?"Perbarui Niche":"Simpan Niche"),1)])]),t("div",As,[t("div",Ns," Daftar Niche Tersimpan ("+x(o(ue).length)+") ",1),t("div",Is,[(p(!0),m(me,null,xe(o(ue),r=>(p(),m("div",{key:r.id,class:"p-2.5 rounded-xl border bg-slate-950 border-slate-800 flex items-start justify-between gap-2"},[t("div",Ms,[t("div",$s,[t("span",Ds,x(r.name),1),t("span",js,x(r.theme||"blue-tech"),1)]),t("p",Es,x(r.description),1)]),t("div",Rs,[t("button",{onClick:v=>$e(r),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Edit Niche"},[k(o(Tt),{class:"w-3.5 h-3.5"})],8,Ps),t("button",{onClick:v=>X(r.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus Niche"},[k(o(tt),{class:"w-3.5 h-3.5"})],8,Ls)])]))),128))])])])])):$("",!0),o(b)?(p(),m("div",Vs,[t("div",Bs,[t("div",Js,[t("div",null,[t("h3",Fs,[k(o(qt),{class:"w-4 h-4 text-purple-400"}),a[91]||(a[91]=J(" Master Prompt AI (Dynamic Research & Zero-Collision) ",-1))]),a[92]||(a[92]=t("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Salin prompt ini ke ChatGPT / Gemini / Claude / DeepSeek untuk mencari topik terbaru. ",-1))]),t("button",{onClick:a[5]||(a[5]=r=>b.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[k(o(Xt),{class:"w-4 h-4"})])]),t("div",Zs,[a[93]||(a[93]=t("span",{class:"font-bold text-sky-400"},"Niche Aktif:",-1)),t("span",Hs,x(o(ue).find(r=>r.id===o(q))?.name||"Default"),1),a[94]||(a[94]=t("span",{class:"text-slate-500"},"•",-1)),a[95]||(a[95]=t("span",{class:"font-bold text-amber-400"},"Template:",-1)),t("span",Us,x(o(le).template||"Otomatis"),1),a[96]||(a[96]=t("span",{class:"text-slate-500"},"•",-1)),a[97]||(a[97]=t("span",{class:"font-bold text-emerald-400"},"Bahasa:",-1)),t("span",zs,x(o(le).language||"Bahasa Indonesia 🇮🇩"),1),a[98]||(a[98]=t("span",{class:"text-slate-500"},"•",-1)),t("span",Gs,x(o(le).usedCount||0)+" Topik Riwayat Dikecualikan",1)]),t("div",Ks,[t("textarea",{value:o(ye),readonly:"",rows:"12",class:"w-full h-full bg-slate-950 text-slate-300 font-mono text-[11px] p-3 rounded-xl border border-slate-800 focus:outline-none resize-none leading-relaxed select-all"},null,8,Ws)]),t("div",qs,[a[99]||(a[99]=t("span",{class:"text-[11px] text-slate-400"},[J(" Paste hasil JSON yang kamu buat ke kolom "),t("b",null,"RAW JSON"),J(" SocialGen. ")],-1)),t("button",{onClick:ss,class:"px-5 py-2.5 rounded-xl font-bold bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-500 hover:to-indigo-500 text-white shadow-lg flex items-center gap-2 transition"},[o(kt)?(p(),Ne(o(at),{key:0,class:"w-4 h-4 text-emerald-400"})):(p(),Ne(o(We),{key:1,class:"w-4 h-4"})),t("span",null,x(o(kt)?"Prompt Berhasil Disalin!":"Copy Master Prompt"),1)])])])])):$("",!0),o(we)?(p(),m("div",{key:2,onClick:ft(Me,["self"]),class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},[t("div",Ys,[t("div",Xs,[t("div",null,[t("h3",Qs,[k(o(Na),{class:"w-4 h-4 text-sky-400"}),a[100]||(a[100]=J(" Kelola Template Visual (Dynamic Template System) ",-1))]),a[101]||(a[101]=t("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Buat format baru, edit sampel tampilan, dan atur prompt AI spesifik per template. ",-1))]),t("button",{onClick:Me,class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[k(o(Xt),{class:"w-4 h-4"})])]),t("div",en,[t("div",tn,[t("button",{onClick:ee,class:j(["px-3 py-1 rounded-lg transition font-bold text-xs",o(ne)==="list"?"bg-slate-800 text-sky-400 shadow":"text-slate-400 hover:text-white"])}," Daftar Template ("+x(o(W).length)+") ",3),t("button",{onClick:h,class:j(["px-3 py-1 rounded-lg transition font-bold text-xs flex items-center gap-1",o(ne)==="form"&&!o(Q)?"bg-slate-800 text-emerald-400 shadow":"text-slate-400 hover:text-white"])},[k(o(Ct),{class:"w-3.5 h-3.5"}),a[102]||(a[102]=t("span",null,"Buat Template Baru",-1))],2),o(Q)&&o(ne)==="form"?(p(),m("span",an,[k(o(Tt),{class:"w-3 h-3"}),a[103]||(a[103]=t("span",null,"Sedang Edit Template",-1))])):$("",!0)]),o(ne)==="list"?fe((p(),m("input",{key:0,"onUpdate:modelValue":a[6]||(a[6]=r=>Pe(ie)?ie.value=r:null),type:"text",placeholder:"Cari template...",class:"bg-slate-900 border border-slate-800 rounded-lg px-2 py-0.5 text-[11px] text-white focus:outline-none focus:border-sky-500 w-36"},null,512)),[[Ae,o(ie)]]):$("",!0)]),o(ne)==="list"?(p(),m("div",sn,[o(T).length===0?(p(),m("div",nn,' Tidak ada template yang cocok dengan pencarian "'+x(o(ie))+'". ',1)):$("",!0),(p(!0),m(me,null,xe(o(T),r=>(p(),m("div",{key:r.id,class:"p-3 rounded-2xl border bg-slate-950 border-slate-800/80 hover:border-slate-700 transition flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 group"},[t("div",on,[t("div",ln,[t("span",rn,x(r.name),1),t("span",dn,x(r.category),1),t("span",{class:j(["px-1.5 py-0.2 rounded text-[8px] font-bold uppercase tracking-wider",r.isBuiltin?"bg-slate-800 text-slate-400 border border-slate-700":"bg-purple-950 text-purple-300 border border-purple-800"])},x(r.isBuiltin?"Bawaan":"⭐ Kustom"),3),t("span",un," layout: "+x(r.layoutType),1)]),t("p",cn,x(r.description||"Tidak ada deskripsi."),1)]),t("div",pn,[t("button",{onClick:v=>Pt(r),class:"px-2.5 py-1 rounded-xl bg-sky-600/20 hover:bg-sky-600/40 text-sky-300 border border-sky-500/40 font-bold text-[10px] transition flex items-center gap-1",title:"Pilih dan gunakan format template ini"},[k(o(at),{class:"w-3 h-3"}),a[104]||(a[104]=t("span",null,"Pilih Format",-1))],8,fn),t("button",{onClick:v=>Ye(r),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Duplikasi sebagai template kustom baru"},[k(o(We),{class:"w-3.5 h-3.5"})],8,mn),r.isBuiltin?$("",!0):(p(),m("button",{key:0,onClick:v=>jt(r),class:"p-1.5 rounded-lg text-slate-400 hover:text-amber-300 hover:bg-slate-800 transition",title:"Edit template kustom"},[k(o(Tt),{class:"w-3.5 h-3.5"})],8,xn)),r.isBuiltin?$("",!0):(p(),m("button",{key:1,onClick:v=>yt(r.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus template kustom"},[k(o(tt),{class:"w-3.5 h-3.5"})],8,hn))])]))),128))])):(p(),m("div",bn,[o(U)?(p(),m("div",gn,x(o(U)),1)):$("",!0),o(Q)?(p(),m("div",vn,[t("div",yn,[t("div",kn,[k(o(Tt),{class:"w-4 h-4"})]),t("div",wn,[t("div",_n,[a[105]||(a[105]=t("span",null,"Sedang Mengedit:",-1)),t("span",Sn,x(o(N).name),1)]),t("div",Tn,"ID: "+x(o(N).id)+" • Perubahan akan memperbarui template yang tersimpan",1)])]),t("button",{onClick:h,type:"button",class:"px-2.5 py-1 rounded-xl bg-slate-900 hover:bg-slate-800 text-slate-200 border border-slate-700 text-[10px] font-bold transition flex items-center gap-1 shrink-0 ml-2"},[k(o(Ct),{class:"w-3 h-3"}),a[106]||(a[106]=t("span",null,"Beralih ke Buat Baru",-1))])])):$("",!0),t("div",Cn,[t("div",On,[a[108]||(a[108]=t("div",{class:"flex items-center gap-2"},[t("span",{class:"text-xl"},"🤖"),t("div",null,[t("h4",{class:"text-xs font-black text-white"},"Buat Template Otomatis dari Screenshot / Gambar"),t("p",{class:"text-[10px] text-slate-400"},"Punya referensi gambar desain? Salin prompt AI dan kirim bersama screenshot ke ChatGPT / Claude / Gemini.")])],-1)),t("div",An,[t("button",{onClick:ut,type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold transition flex items-center gap-1.5 shadow",o(ve)?"bg-emerald-600 text-white":"bg-sky-600 hover:bg-sky-500 text-white"])},[k(o(We),{class:"w-3.5 h-3.5"}),t("span",null,x(o(ve)?"✓ Prompt Tersalin!":"Salin Prompt Bantuan AI"),1)],2),t("button",{onClick:a[7]||(a[7]=r=>_e.value=!o(_e)),type:"button",class:"px-2 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-bold transition flex items-center gap-1",title:o(_e)?"Sembunyikan teks prompt":"Lihat / salin teks prompt manual di HP"},[t("span",null,x(o(_e)?"Tutup Teks":"👁️ Lihat Teks Prompt"),1)],8,Nn),t("button",{onClick:a[8]||(a[8]=r=>te.value=!o(te)),type:"button",class:"px-2.5 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-bold transition flex items-center gap-1"},[...a[107]||(a[107]=[t("span",null,"📥 Tempel JSON",-1)])])])]),o(_e)?(p(),m("div",In,[t("div",Mn,[a[109]||(a[109]=t("label",{class:"text-[10px] font-bold text-sky-400"},"Teks Lengkap Prompt Bantuan AI (Bisa ditandai/disalin manual di HP):",-1)),t("button",{onClick:a[9]||(a[9]=r=>_e.value=!1),class:"text-[10px] text-slate-400 hover:text-white"},"✕ Tutup")]),t("textarea",{value:o(dt),readonly:"",rows:"6",class:"w-full bg-slate-900 border border-slate-700 rounded-lg p-2 text-[11px] text-sky-200 font-mono select-all focus:outline-none focus:border-sky-500 custom-scrollbar"},null,8,$n)])):$("",!0),o(te)?(p(),m("div",Dn,[a[110]||(a[110]=t("label",{class:"text-[10px] font-bold text-sky-400"},"Tempelkan respon JSON dari AI di sini:",-1)),fe(t("textarea",{"onUpdate:modelValue":a[10]||(a[10]=r=>Pe(ae)?ae.value=r:null),rows:"4",placeholder:'Tempelkan respon JSON dari AI di sini (contoh: { "name": "...", "layoutType": "custom", "customHtml": "...", "sampleData": {...} })...',class:"w-full bg-slate-900 border border-slate-700 rounded-lg p-2 text-xs text-sky-200 font-mono focus:outline-none focus:border-sky-500"},null,512),[[Ae,o(ae)]]),t("div",jn,[t("button",{onClick:a[11]||(a[11]=r=>te.value=!1),type:"button",class:"px-2.5 py-1 rounded-lg text-[10px] font-bold text-slate-400 hover:text-white"}," Tutup "),t("button",{onClick:Et,type:"button",class:"px-3 py-1 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white text-[10px] font-bold shadow"}," Terapkan ke Form Otomatis ")])])):$("",!0)]),t("div",En,[t("div",null,[a[111]||(a[111]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"ID Template (Slug Unik)",-1)),fe(t("input",{"onUpdate:modelValue":a[12]||(a[12]=r=>o(N).id=r),disabled:!!o(Q),type:"text",placeholder:"misal: tech-radar, crypto-card",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500 disabled:opacity-50"},null,8,Rn),[[Ae,o(N).id]])]),t("div",null,[a[112]||(a[112]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Template",-1)),fe(t("input",{"onUpdate:modelValue":a[13]||(a[13]=r=>o(N).name=r),type:"text",placeholder:"misal: ⚡ Tech Radar 2026",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[Ae,o(N).name]])]),t("div",null,[a[113]||(a[113]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Kategori",-1)),fe(t("input",{"onUpdate:modelValue":a[14]||(a[14]=r=>o(N).category=r),type:"text",placeholder:"misal: Perbandingan, Peringkat, Finansial",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[Ae,o(N).category]])])]),t("div",Pn,[t("div",null,[a[115]||(a[115]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Base Layout Visual Engine",-1)),t("select",{value:o(N).layoutType,onChange:a[15]||(a[15]=r=>Be(r.target.value)),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-sky-300 font-semibold focus:outline-none focus:border-sky-500"},[...a[114]||(a[114]=[pt('<option value="custom">🎨 Custom HTML & CSS (Bebas / Desain Sendiri)</option><option value="table">📊 Comparison Table</option><option value="versus">⚔️ Versus Showdown Arena</option><option value="receipt">🧾 Monthly Living Invoice</option><option value="news">📰 Special Report Pamphlet</option><option value="stat">🎯 Big Shocking Number</option><option value="timeline">⏳ 10-Year Shift (Then vs Now)</option><option value="barchart">📈 Income Allocation Bars</option><option value="list">🏆 Top 5 Ranked List</option><option value="quote">💬 Hot Take / Quote Debate</option><option value="leaderboard">🥇 Multi-Country Leaderboard (Top 10)</option><option value="editorial">📰 Editorial Storytelling Deep Dive</option><option value="matrix">📊 Multi-Column Matrix (3-4 Negara)</option><option value="debate">⚡ Debate Arena (Pro vs Kontra)</option><option value="tierlist">🎖️ Tier List Ranking (S, A, B, C)</option>',15)])],40,Ln)]),t("div",null,[a[116]||(a[116]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Deskripsi Ringkas",-1)),fe(t("input",{"onUpdate:modelValue":a[16]||(a[16]=r=>o(N).description=r),type:"text",placeholder:"Jelaskan kegunaan format tampilan template ini...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[Ae,o(N).description]])])]),o(N).layoutType==="custom"?(p(),m("div",Vn,[t("div",Bn,[t("span",Jn,[k(o(cs),{class:"w-3.5 h-3.5"}),a[117]||(a[117]=J(" Template Engine HTML & Styling CSS ",-1))]),a[118]||(a[118]=t("span",{class:"text-[10px] text-slate-400 font-mono"},"Gunakan {{ data.title }} & {{#each data.items}}",-1))]),t("div",null,[a[119]||(a[119]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"HTML Template (Tailwind utility classes didukung penuh)",-1)),fe(t("textarea",{"onUpdate:modelValue":a[17]||(a[17]=r=>o(N).customHtml=r),rows:"6",placeholder:`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700 text-center">
|
|
89
|
+
<h2 class="text-3xl font-black text-white">{{ data.title }}</h2>
|
|
90
|
+
<p class="text-slate-300">{{ data.subtitle }}</p>
|
|
91
|
+
</div>`,class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2.5 text-xs text-sky-300 font-mono leading-relaxed focus:outline-none focus:border-sky-500"},null,512),[[Ae,o(N).customHtml]])]),t("div",null,[a[120]||(a[120]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Custom CSS (Opsional - animasi, gradien unik, glassmorphism)",-1)),fe(t("textarea",{"onUpdate:modelValue":a[18]||(a[18]=r=>o(N).customCss=r),rows:"3",placeholder:".my-custom-card { backdrop-filter: blur(16px); }",class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2.5 text-xs text-emerald-300 font-mono leading-relaxed focus:outline-none focus:border-emerald-500"},null,512),[[Ae,o(N).customCss]])])])):$("",!0),t("div",null,[a[121]||(a[121]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"AI Prompt Directive (Aturan Khusus Generator)",-1)),fe(t("textarea",{"onUpdate:modelValue":a[19]||(a[19]=r=>o(N).promptDirective=r),rows:"3",placeholder:"Instruksi spesifik untuk AI Gemini / ChatGPT saat meriset konten dengan template ini...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-slate-200 focus:outline-none focus:border-sky-500 font-mono leading-relaxed"},null,512),[[Ae,o(N).promptDirective]])]),t("div",null,[a[122]||(a[122]=t("div",{class:"flex items-center justify-between mb-1"},[t("label",{class:"text-[10px] font-bold text-slate-400"},"Sampel Data JSON (Pristine Default Tampilan)"),t("span",{class:"text-[10px] text-slate-500"},"Akan langsung ditampilkan di Live Preview")],-1)),fe(t("textarea",{"onUpdate:modelValue":a[20]||(a[20]=r=>o(N).sampleJsonText=r),rows:"7",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-sky-200 focus:outline-none focus:border-sky-500 font-mono leading-relaxed select-all"},null,512),[[Ae,o(N).sampleJsonText]])]),t("div",Fn,[t("button",{onClick:ee,class:"px-3.5 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-300 font-bold text-xs transition"}," Batal "),t("button",{onClick:Rt,class:"px-5 py-1.5 rounded-xl bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 text-white font-bold text-xs shadow-lg transition flex items-center gap-1.5"},[k(o(at),{class:"w-3.5 h-3.5"}),t("span",null,x(o(Q)?"Perbarui Template":"Simpan Template"),1)])])]))])])):$("",!0),t("div",Zn,[t("div",Hn,[t("div",Un,[t("button",{onClick:a[21]||(a[21]=r=>Se.value="content"),type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",o(Se)==="content"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[123]||(a[123]=[t("span",null,"📝 Konten",-1)])],2),t("button",{onClick:a[22]||(a[22]=r=>Se.value="design"),type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",o(Se)==="design"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[124]||(a[124]=[t("span",null,"🎨 Template",-1)])],2),t("button",{onClick:a[23]||(a[23]=r=>Se.value="media"),type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",o(Se)==="media"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[125]||(a[125]=[t("span",null,"🎬 Media",-1)])],2),t("button",{onClick:a[24]||(a[24]=r=>Se.value="ai"),type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",o(Se)==="ai"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[126]||(a[126]=[t("span",null,"⚡ AI Topic",-1)])],2),t("button",{onClick:a[25]||(a[25]=r=>Se.value="history"),type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",o(Se)==="history"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[127]||(a[127]=[t("span",null,"💾 Draft",-1)])],2)]),t("button",{onClick:a[26]||(a[26]=r=>ct.value=!0),type:"button",class:"px-2 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-[10px] font-mono font-bold text-sky-300 border border-slate-700 flex items-center gap-0.5 shrink-0 ml-1",title:"Buka RAW JSON Editor"},[...a[128]||(a[128]=[t("span",null,"</> JSON",-1)])])]),o(Se)==="content"?(p(),m("div",zn,[o(c)||n.validationError||o(G)?(p(),m("div",{key:0,class:j(["p-3.5 rounded-2xl border text-xs shadow-lg space-y-2.5 animate-in fade-in",o(c)||n.validationError?"bg-rose-950/80 border-rose-500/60 text-rose-200":"bg-amber-950/80 border-amber-500/60 text-amber-200"])},[t("div",Gn,[k(o(Oa),{class:j(["w-4 h-4 shrink-0 mt-0.5",o(c)||n.validationError?"text-rose-400":"text-amber-400"])},null,8,["class"]),t("div",Kn,[t("div",Wn,x(o(c)?"Sintaks JSON Tidak Valid":o(G)?"Perbedaan Format Template":"Data Belum Sesuai Template"),1),t("p",qn,[o(c)?(p(),m("span",Yn,x(o(c)),1)):o(G)?(p(),m("span",Xn,[a[129]||(a[129]=J(" Data JSON saat ini dibuat untuk template ",-1)),t("b",Qn,x(o(G).matchedTarget?.name||o(G).jsonTemplateId),1),a[130]||(a[130]=J(", sedangkan template aktif saat ini adalah ",-1)),t("b",eo,x(o(de).name),1),a[131]||(a[131]=J(". ",-1))])):(p(),m("span",to,x(n.validationError),1))])])]),t("div",ao,[t("button",{onClick:Ut,type:"button",class:"px-3 py-1.5 rounded-xl bg-white text-slate-950 text-xs font-black shadow transition active:scale-95 flex items-center gap-1.5"},[k(o(Ia),{class:"w-3.5 h-3.5"}),t("span",null,"Pakai Sampel "+x(o(de).name),1)]),o(G)?.isKnown&&o(G).matchedTarget?(p(),m("button",{key:0,onClick:a[27]||(a[27]=r=>Xe(o(G).matchedTarget.id)),type:"button",class:"px-2.5 py-1.5 rounded-xl bg-amber-500/20 hover:bg-amber-500/40 text-amber-300 border border-amber-500/40 text-xs font-bold transition flex items-center gap-1 active:scale-95"},[t("span",null,"Beralih ke "+x(o(G).matchedTarget.name),1)])):$("",!0),t("button",{onClick:a[28]||(a[28]=r=>ct.value=!0),type:"button",class:"px-2.5 py-1.5 rounded-xl bg-slate-800 text-slate-200 text-xs font-bold border border-slate-700 transition ml-auto active:scale-95"},[...a[132]||(a[132]=[t("span",null,"</> Buka JSON",-1)])])])],2)):(p(),m("div",so,[t("div",no,[a[133]||(a[133]=t("span",{class:"w-2 h-2 rounded-full bg-emerald-400 shrink-0"},null,-1)),a[134]||(a[134]=t("span",{class:"text-slate-400"},"Template Aktif:",-1)),t("span",oo,x(o(de).name),1)]),t("button",{onClick:Ut,type:"button",class:"text-[10px] text-sky-400 hover:text-sky-300 font-bold shrink-0 ml-2 transition",title:"Muat ulang sampel data template aktif"}," Reset ke Sampel ")])),t("div",io,[a[135]||(a[135]=t("div",{class:"flex items-center justify-between"},[t("label",{class:"text-xs font-extrabold text-white flex items-center gap-1.5"},[t("span",null,"Judul Utama (Title)")]),t("span",{class:"text-[9px] text-sky-400 font-bold uppercase tracking-wider"},"Wajib")],-1)),t("input",{type:"text",value:n.modelValue.title,onInput:a[29]||(a[29]=r=>ya(r.target.value)),placeholder:"Judul Utama Konten...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-xs text-white font-bold focus:outline-none focus:border-sky-500 transition"},null,40,lo)]),t("div",ro,[a[136]||(a[136]=t("label",{class:"text-xs font-bold text-slate-300"},"Subtitle / Penjelasan Ringkas",-1)),t("textarea",{value:n.modelValue.subtitle||"",onInput:a[30]||(a[30]=r=>Xa(r.target.value)),rows:"2",placeholder:"Ringkasan atau penjelas judul...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-slate-200 focus:outline-none focus:border-sky-500 transition resize-none leading-relaxed"},null,40,uo)]),t("div",co,[t("div",po,[a[137]||(a[137]=t("label",{class:"text-[11px] font-bold text-slate-400"},"Watermark Handle",-1)),t("input",{type:"text",value:n.modelValue.watermark||"@SocialGen",onInput:a[31]||(a[31]=r=>ka(r.target.value)),placeholder:"@NamaAkun",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-sky-400 font-bold text-xs focus:outline-none focus:border-sky-500"},null,40,fo)]),t("div",mo,[a[138]||(a[138]=t("label",{class:"text-[11px] font-bold text-slate-400"},"Sumber (Footer Note)",-1)),t("input",{type:"text",value:n.modelValue.footerNote||"",onInput:a[32]||(a[32]=r=>Qa(r.target.value)),placeholder:"Source: Data Wire 2026...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-slate-300 text-xs focus:outline-none focus:border-sky-500"},null,40,xo)])]),t("div",ho,[t("div",bo,[a[140]||(a[140]=t("span",{class:"text-xs font-bold text-slate-300"},"Viral Caption & Hashtags",-1)),t("button",{onClick:a[33]||(a[33]=async()=>{n.modelValue.caption&&(await o(xt)(n.modelValue.caption),i("toast","Caption berhasil disalin!","success"))}),type:"button",class:"text-[11px] font-bold text-sky-400 hover:text-sky-300 flex items-center gap-1 active:scale-95 transition"},[k(o(We),{class:"w-3 h-3"}),a[139]||(a[139]=t("span",null,"Salin Caption",-1))])]),t("textarea",{value:n.modelValue.caption||"",onInput:a[34]||(a[34]=r=>es(r.target.value)),rows:"3",placeholder:"Tulis caption reels / post di sini...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-slate-200 focus:outline-none focus:border-sky-500 leading-relaxed resize-none"},null,40,go)])])):o(Se)==="design"?(p(),m("div",vo,[t("div",yo,[t("div",ko,[t("div",null,[t("span",wo,"Pilih Format Template ("+x(o(W).length)+")",1),a[141]||(a[141]=t("p",{class:"text-[10px] text-slate-400"},"Geser ke kanan untuk melihat semua format",-1))]),t("button",{onClick:a[35]||(a[35]=r=>I("list")),type:"button",class:"text-[10px] font-bold text-sky-400 hover:text-sky-300 flex items-center gap-1 bg-slate-800 px-2 py-1 rounded-lg border border-slate-700"},[k(o(Yt),{class:"w-3 h-3"}),a[142]||(a[142]=t("span",null,"Kelola",-1))])]),o(G)||n.validationError||o(c)?(p(),m("div",_o,[t("div",So,[a[144]||(a[144]=t("span",{class:"text-sm"},"⚠️",-1)),t("span",To,[o(G)?(p(),m("span",Co,[a[143]||(a[143]=J("Format JSON milik: ",-1)),t("b",null,x(o(G).matchedTarget?.name||o(G).jsonTemplateId),1)])):o(c)?(p(),m("span",Oo,"Sintaks JSON tidak valid")):(p(),m("span",Ao,x(n.validationError),1))])]),t("button",{onClick:Ut,type:"button",class:"px-2.5 py-1 rounded-lg bg-amber-500 text-slate-950 font-black text-[10px] shrink-0 active:scale-95 shadow ml-2"}," Pakai Sampel ")])):$("",!0),t("div",No,[(p(!0),m(me,null,xe(o(W),r=>(p(),m("button",{key:r.id,onClick:v=>Xe(r.id),type:"button",class:j(["shrink-0 w-28 p-2.5 rounded-2xl border text-center flex flex-col items-center gap-1.5 transition active:scale-95",o(d)===r.id?"bg-slate-950 border-sky-500 shadow-lg shadow-sky-500/20":"bg-slate-950/70 border-slate-800 hover:border-slate-700"])},[t("div",Mo,x(as(r.layoutType,r.id)),1),t("span",$o,x(r.name),1),t("span",{class:j(["text-[8px] font-bold px-1.5 py-0.2 rounded uppercase tracking-wider",r.isBuiltin?"bg-slate-800 text-slate-400":"bg-purple-950 text-purple-300 border border-purple-800"])},x(r.isBuiltin?r.category:"⭐ Kustom"),3)],10,Io))),128))])]),t("div",Do,[t("div",jo,[a[145]||(a[145]=t("span",{class:"text-xs font-extrabold text-white"},"Tema Warna (Visual Swatches)",-1)),t("span",Eo,x(n.modelValue.theme||"blue-tech"),1)]),t("div",Ro,[(p(),m(me,null,xe(ts,r=>t("button",{key:r.id,onClick:v=>wa(r.id),type:"button",class:"flex flex-col items-center gap-1 p-1 rounded-xl transition",title:r.name},[t("div",{class:j(["w-8 h-8 rounded-full border-2 transition transform active:scale-90",n.modelValue.theme===r.id?"ring-2 ring-white ring-offset-2 ring-offset-slate-950 scale-105":"border-white/10 hover:border-white/40"]),style:ta({backgroundColor:r.color})},null,6),t("span",Lo,x(r.name.split(" ")[0]),1)],8,Po)),64))])]),t("div",Vo,[t("div",Bo,[a[147]||(a[147]=t("div",{class:"flex flex-col"},[t("span",{class:"text-xs font-bold text-white"},"Buat Template Kustom"),t("span",{class:"text-[10px] text-slate-400"},"Punya referensi kartu baru? Tambahkan ke sistem.")],-1)),t("button",{onClick:h,type:"button",class:"px-3 py-1.5 rounded-xl bg-gradient-to-r from-sky-600 to-indigo-600 hover:from-sky-500 text-white text-xs font-bold shadow flex items-center gap-1.5 active:scale-95 transition"},[k(o(Ct),{class:"w-3.5 h-3.5"}),a[146]||(a[146]=t("span",null,"+ Buat Template",-1))])]),t("div",Jo,[a[148]||(a[148]=t("span",{class:"text-[10px] text-slate-400 flex items-center gap-1"},[t("span",null,"🤖 Prompt AI Buat Template")],-1)),t("div",Fo,[t("button",{onClick:ut,type:"button",class:"px-2.5 py-1 rounded-lg bg-sky-600/20 hover:bg-sky-600/40 text-sky-300 text-[10px] font-bold border border-sky-500/30 flex items-center gap-1 transition active:scale-95"},[k(o(We),{class:"w-3 h-3"}),t("span",null,x(o(ve)?"✓ Tersalin":"Salin Prompt"),1)]),t("button",{onClick:a[36]||(a[36]=r=>_e.value=!o(_e)),type:"button",class:"px-2 py-1 rounded-lg bg-slate-800 text-slate-300 text-[10px] font-bold border border-slate-700"},[t("span",null,x(o(_e)?"Tutup":"Lihat"),1)])])]),o(_e)?(p(),m("div",Zo,[a[149]||(a[149]=t("p",{class:"text-[9px] text-slate-400 mb-1"},"Kirim prompt ini bersama screenshot kartu ke ChatGPT / Gemini / Claude untuk menghasilkan HTML & CSS template:",-1)),t("textarea",{value:o(dt),readonly:"",rows:"5",class:"w-full bg-slate-900 border border-slate-700 rounded-lg p-2 text-[10px] text-sky-200 font-mono select-all focus:outline-none custom-scrollbar"},null,8,Ho)])):$("",!0)])])):o(Se)==="media"?(p(),m("div",Uo,[t("div",zo,[t("div",Go,[t("label",Ko,[k(o(aa),{class:"w-4 h-4"}),a[150]||(a[150]=t("span",null,"Background Video",-1))]),t("button",{onClick:a[37]||(a[37]=r=>o(Ft)?.click()),disabled:o(Je),type:"button",class:"px-2.5 py-1 rounded-xl bg-sky-950/60 border border-sky-500/40 text-sky-300 text-[10px] font-bold flex items-center gap-1"},[k(o(Ot),{class:"w-3 h-3"}),a[151]||(a[151]=t("span",null,"Upload MP4",-1))],8,Wo)]),t("select",{value:n.options.backgroundSource||"random",onChange:a[38]||(a[38]=r=>{const v=r.target.value;i("update:options",{...n.options,backgroundSource:v,videoStartOffset:0})}),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-slate-200 text-xs font-semibold focus:outline-none focus:border-sky-500"},[a[152]||(a[152]=t("option",{value:"random"},"🔀 Acak Video",-1)),(p(!0),m(me,null,xe(o(Lt),r=>(p(),m("option",{key:r,value:r},x(r.replace(".mp4","").replace(/_/g," ")),9,Yo))),128)),a[153]||(a[153]=t("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,qo),t("div",Xo,[t("div",Qo,[t("span",ei,[a[154]||(a[154]=J(" ✂️ Mulai Detik: ",-1)),t("strong",ti,x(Math.min(n.options.videoStartOffset||0,o(Ge)))+"s",1),J(" / "+x(o(Bt))+"s ",1)]),t("button",{onClick:a[39]||(a[39]=r=>je("videoStartOffset",0)),type:"button",class:"text-[10px] text-sky-400 hover:text-white"}," Reset 0s ")]),t("input",{type:"range",min:"0",max:o(Ge),step:"1",value:Math.min(n.options.videoStartOffset||0,o(Ge)),onInput:a[40]||(a[40]=r=>je("videoStartOffset",Number(r.target.value))),class:"w-full h-1.5 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,ai)])]),t("div",si,[t("div",ni,[t("label",oi,[k(o(sa),{class:"w-4 h-4"}),a[155]||(a[155]=t("span",null,"Musik Reels",-1))]),t("button",{onClick:a[41]||(a[41]=r=>o(Zt)?.click()),disabled:o(Je),type:"button",class:"px-2.5 py-1 rounded-xl bg-purple-950/60 border border-purple-500/40 text-purple-300 text-[10px] font-bold flex items-center gap-1"},[k(o(Ot),{class:"w-3 h-3"}),a[156]||(a[156]=t("span",null,"Upload MP3",-1))],8,ii)]),t("select",{value:n.options.musicFile||"random",onChange:a[42]||(a[42]=r=>{const v=r.target.value;i("update:options",{...n.options,musicFile:v,audioStartOffset:0})}),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-slate-200 text-xs font-semibold focus:outline-none focus:border-purple-500"},[a[157]||(a[157]=t("option",{value:"random"},"🔀 Acak Musik",-1)),(p(!0),m(me,null,xe(o(Vt),r=>(p(),m("option",{key:r,value:r},x(r.replace(".mp3","").replace(/_/g," ")),9,ri))),128))],40,li),t("div",di,[t("div",ui,[t("span",ci,[a[158]||(a[158]=J(" ✂️ Mulai Intro: ",-1)),t("strong",pi,x(Math.min(n.options.audioStartOffset||0,o(Ke)))+"s",1),J(" / "+x(o(Jt))+"s ",1)]),t("button",{onClick:a[43]||(a[43]=r=>je("audioStartOffset",0)),type:"button",class:"text-[10px] text-purple-400 hover:text-white"}," Reset 0s ")]),t("input",{type:"range",min:"0",max:o(Ke),step:"1",value:Math.min(n.options.audioStartOffset||0,o(Ke)),onInput:a[44]||(a[44]=r=>je("audioStartOffset",Number(r.target.value))),class:"w-full h-1.5 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,fi)])]),t("div",mi,[t("label",xi,[k(o(Wt),{class:"w-3.5 h-3.5 text-emerald-400"}),a[159]||(a[159]=t("span",null,"Durasi Reels:",-1))]),t("div",hi,[(p(),m(me,null,xe([7,10,15,30,60],r=>t("button",{key:r,onClick:v=>_a(r),type:"button",class:j(["px-2.5 py-1 rounded-xl text-xs font-bold transition",n.modelValue.reelsDuration===r?"bg-emerald-500 text-white shadow":"bg-slate-950 text-slate-400 border border-slate-800"])},x(r)+"s ",11,bi)),64))])]),t("div",gi,[a[163]||(a[163]=t("span",{class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider block"},"Format Output Aktif",-1)),t("div",vi,[t("label",{class:j(["flex items-center gap-1.5 p-2 rounded-xl border text-xs cursor-pointer select-none",n.options.outputs?.feed!==!1?"bg-sky-500/10 border-sky-500/40 text-sky-200":"bg-slate-950 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.feed!==!1,onChange:a[45]||(a[45]=r=>Qe("feed",r.target.checked)),class:"rounded text-sky-500"},null,40,yi),a[160]||(a[160]=t("span",{class:"font-bold"},"Feed 4:5",-1))],2),t("label",{class:j(["flex items-center gap-1.5 p-2 rounded-xl border text-xs cursor-pointer select-none",n.options.outputs?.story!==!1?"bg-indigo-500/10 border-indigo-500/40 text-indigo-200":"bg-slate-950 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.story!==!1,onChange:a[46]||(a[46]=r=>Qe("story",r.target.checked)),class:"rounded text-indigo-500"},null,40,ki),a[161]||(a[161]=t("span",{class:"font-bold"},"Story 9:16",-1))],2),t("label",{class:j(["flex items-center gap-1.5 p-2 rounded-xl border text-xs cursor-pointer select-none",n.options.outputs?.reels!==!1?"bg-emerald-500/10 border-emerald-500/40 text-emerald-200":"bg-slate-950 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.reels!==!1,onChange:a[47]||(a[47]=r=>Qe("reels",r.target.checked)),class:"rounded text-emerald-500"},null,40,wi),a[162]||(a[162]=t("span",{class:"font-bold"},"Reels MP4",-1))],2)])])])):o(Se)==="ai"?(p(),m("div",_i,[t("div",Si,[t("div",Ti,[t("span",Ci,[k(o(ht),{class:"w-4 h-4 text-sky-400"}),a[164]||(a[164]=J(" Auto-Topic AI Generator ",-1))]),t("span",Oi,x(o(w)),1)]),t("div",Ai,[t("div",Ni,[a[165]||(a[165]=t("label",{class:"text-[10px] font-bold text-slate-400"},"Pilih Niche",-1)),fe(t("select",{"onUpdate:modelValue":a[48]||(a[48]=r=>Pe(q)?q.value=r:null),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-2 text-xs text-white font-bold focus:outline-none"},[(p(!0),m(me,null,xe(o(ue),r=>(p(),m("option",{key:r.id,value:r.id},x(r.name),9,Ii))),128))],512),[[et,o(q)]])]),t("div",Mi,[a[167]||(a[167]=t("label",{class:"text-[10px] font-bold text-slate-400"},"Bahasa Konten",-1)),fe(t("select",{"onUpdate:modelValue":a[49]||(a[49]=r=>Pe(K)?K.value=r:null),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-2 text-xs text-emerald-300 font-bold focus:outline-none"},[...a[166]||(a[166]=[pt('<option value="id">🇮🇩 Indonesia</option><option value="en">🇺🇸 English</option><option value="es">🇪🇸 Español</option><option value="ja">🇯🇵 日本語</option><option value="de">🇩🇪 Deutsch</option>',5)])],512),[[et,o(K)]])])]),t("button",{onClick:a[50]||(a[50]=r=>zt()),disabled:n.isGenerating||n.isAutoTopicLoading,type:"button",class:"w-full py-3 rounded-2xl bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 text-white font-black text-xs shadow-xl shadow-sky-500/25 flex items-center justify-center gap-2 active:scale-98 transition disabled:opacity-50"},[k(o(ht),{class:j(["w-4 h-4",{"animate-spin":n.isAutoTopicLoading}])},null,8,["class"]),t("span",null,x(n.isAutoTopicLoading?"Meriset Data Viral...":"✨ Auto-Topic Viral Baru"),1)],8,$i)]),t("div",Di,[t("div",ji,[t("div",Ei,[k(o(qt),{class:"w-4 h-4 text-purple-400"}),a[168]||(a[168]=t("span",{class:"text-xs font-black text-white"},"Master Prompt Riset Topik AI",-1))]),t("button",{onClick:Gt,type:"button",class:"px-2 py-0.5 rounded-lg bg-purple-950/60 border border-purple-500/40 text-purple-300 text-[10px] font-bold flex items-center gap-1 hover:text-white"},[k(o(Aa),{class:"w-3 h-3"}),a[169]||(a[169]=t("span",null,"Buka Detail",-1))])]),a[170]||(a[170]=t("p",{class:"text-[11px] text-slate-400 leading-relaxed"},[J(" Salin prompt riset cerdas ini ke "),t("b",null,"ChatGPT / Gemini / Claude"),J(" untuk riset topik konten viral terbaru sesuai niche & template yang aktif (bebas bentrok riwayat): ")],-1)),t("div",Ri,[t("button",{onClick:ns,disabled:o(wt),type:"button",class:"flex-1 px-3 py-2.5 rounded-xl bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-500 text-white text-xs font-bold shadow-lg transition flex items-center justify-center gap-1.5 active:scale-95 disabled:opacity-50"},[o(_t)?(p(),Ne(o(at),{key:0,class:"w-3.5 h-3.5 text-emerald-300"})):(p(),Ne(o(We),{key:1,class:"w-3.5 h-3.5"})),t("span",null,x(o(wt)?"Menyiapkan Prompt...":o(_t)?"✓ Master Prompt Tersalin!":"Salin Master Prompt Topik"),1)],8,Pi),t("button",{onClick:Gt,type:"button",title:"Lihat teks prompt manual lengkap",class:"px-3 py-2.5 rounded-xl bg-slate-800 text-slate-300 text-xs font-bold border border-slate-700 hover:bg-slate-700 transition"},[k(o(Aa),{class:"w-3.5 h-3.5"})])])])])):o(Se)==="history"?(p(),m("div",Li,[t("div",Vi,[t("button",{onClick:a[51]||(a[51]=r=>M.value="drafts"),type:"button",class:j(["flex-1 py-1.5 px-3 rounded-xl transition text-center",o(M)==="drafts"?"bg-amber-500 text-slate-950 font-black shadow":"text-slate-400 hover:text-white"])},[t("span",null,"Drafts ("+x(n.drafts.length)+")",1)],2),t("button",{onClick:a[52]||(a[52]=r=>M.value="history"),type:"button",class:j(["flex-1 py-1.5 px-3 rounded-xl transition text-center",o(M)==="history"?"bg-purple-600 text-white font-black shadow":"text-slate-400 hover:text-white"])},[t("span",null,"Riwayat ("+x(n.history.length)+")",1)],2)]),o(M)==="drafts"?(p(),m("div",Bi,[t("div",Ji,[a[172]||(a[172]=t("span",{class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},"Daftar Draft Tersimpan",-1)),t("button",{onClick:a[53]||(a[53]=r=>i("saveDraft")),type:"button",class:"text-[11px] font-bold text-amber-400 hover:text-amber-300 flex items-center gap-1"},[k(o(Kt),{class:"w-3 h-3"}),a[171]||(a[171]=t("span",null,"+ Simpan Draft",-1))])]),n.drafts.length===0?(p(),m("div",Fi," Belum ada draft tersimpan. ")):$("",!0),(p(!0),m(me,null,xe(n.drafts,(r,v)=>(p(),m("div",{key:v,onClick:P=>i("selectDraft",v),class:"p-3 rounded-2xl border bg-slate-900/80 border-slate-800 hover:border-amber-500/40 flex items-center justify-between cursor-pointer active:scale-98 transition shadow"},[t("div",Hi,[t("div",Ui,x(r.title||"Tanpa Judul"),1),t("div",zi,x(r.category||"Draft"),1)]),t("button",{onClick:ft(P=>i("deleteDraft",v),["stop"]),type:"button",class:"p-1.5 text-slate-400 hover:text-rose-400 rounded-lg transition"},[k(o(tt),{class:"w-3.5 h-3.5"})],8,Gi)],8,Zi))),128))])):(p(),m("div",Ki,[t("div",Wi,[a[173]||(a[173]=t("span",{class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},"Riwayat Generasi Terakhir",-1)),n.history.length>0?(p(),m("button",{key:0,onClick:Sa,type:"button",class:"text-[10px] font-bold text-rose-400 hover:text-rose-300"}," Hapus Semua ")):$("",!0)]),n.history.length===0?(p(),m("div",qi," Belum ada riwayat pembuatan. ")):$("",!0),(p(!0),m(me,null,xe(n.history,(r,v)=>(p(),m("div",{key:v,onClick:P=>i("selectHistory",v),class:"p-3 rounded-2xl border bg-slate-900/80 border-slate-800 hover:border-purple-500/40 flex items-center justify-between cursor-pointer active:scale-98 transition shadow"},[t("div",Xi,[t("div",Qi,x(r.title),1),t("div",el,x(r.category)+" • "+x(Ta(r.generatedAt)),1)]),t("button",{onClick:ft(P=>i("deleteHistory",v),["stop"]),type:"button",class:"p-1.5 text-slate-400 hover:text-rose-400 rounded-lg transition"},[k(o(tt),{class:"w-3.5 h-3.5"})],8,tl)],8,Yi))),128))]))])):$("",!0),o(ct)?(p(),m("div",al,[t("div",sl,[t("div",nl,[a[174]||(a[174]=t("div",{class:"flex items-center gap-2"},[t("span",{class:"text-xs font-bold text-white font-mono"},"</> RAW JSON SocialGen"),t("span",{class:"text-[9px] px-1.5 py-0.2 rounded-full bg-sky-500/20 text-sky-300 font-mono"},"Format V2")],-1)),t("button",{onClick:a[54]||(a[54]=r=>ct.value=!1),type:"button",class:"w-7 h-7 rounded-full bg-slate-800 flex items-center justify-center text-xs text-slate-400 hover:text-white"}," ✕ ")]),o(G)||o(c)||n.validationError?(p(),m("div",{key:0,class:j(["p-2.5 rounded-xl border text-[11px] flex items-center justify-between gap-2 shadow",o(c)||n.validationError?"bg-rose-950/80 border-rose-500/50 text-rose-200":"bg-amber-950/80 border-amber-500/50 text-amber-200"])},[t("div",ol,[a[176]||(a[176]=t("span",null,"⚠️",-1)),t("span",il,[o(c)?(p(),m("span",ll,x(o(c)),1)):o(G)?(p(),m("span",rl,[a[175]||(a[175]=J("JSON untuk template: ",-1)),t("b",null,x(o(G).matchedTarget?.name||o(G).jsonTemplateId),1)])):(p(),m("span",dl,x(n.validationError),1))])]),o(G)?.isKnown&&o(G).matchedTarget?(p(),m("button",{key:0,onClick:a[55]||(a[55]=r=>Xe(o(G).matchedTarget.id)),type:"button",class:"px-2 py-0.5 rounded-lg bg-amber-500 text-slate-950 font-bold text-[10px] shrink-0 active:scale-95 shadow"}," Ganti Template ")):$("",!0)],2)):$("",!0),t("textarea",{value:o(l),onInput:ga,rows:"8",spellcheck:"false",class:"w-full bg-slate-950 text-sky-200 text-xs font-mono p-3 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-y leading-relaxed",placeholder:"Paste Content JSON here..."},null,40,ul),t("div",cl,[t("button",{onClick:Ht,type:"button",class:"px-3 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-amber-400"}," Pakai Sample "),t("button",{onClick:va,type:"button",class:"px-3 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-sky-400"}," Format JSON "),t("button",{onClick:a[56]||(a[56]=r=>ct.value=!1),type:"button",class:"px-4 py-2 rounded-xl bg-sky-500 hover:bg-sky-400 text-xs font-bold text-white shadow-lg"}," Selesai ")])])])):$("",!0)]),t("div",pl,[t("div",fl,[t("div",null,[t("h2",ml,[k(o(bs),{class:"w-3.5 h-3.5 text-sky-400"}),a[177]||(a[177]=J(" Content Studio ",-1))]),a[178]||(a[178]=t("p",{class:"text-[10px] text-slate-400"},"Multi-Format Studio",-1))]),t("div",xl,[t("div",hl,[fe(t("select",{"onUpdate:modelValue":a[57]||(a[57]=r=>Pe(q)?q.value=r:null),class:"bg-transparent text-[11px] font-bold text-sky-300 focus:outline-none px-2 py-0.5 cursor-pointer max-w-[130px] truncate",title:"Pilih Niche Konten"},[(p(!0),m(me,null,xe(o(ue),r=>(p(),m("option",{key:r.id,value:r.id,class:"bg-slate-900 text-white"},x(r.name),9,bl))),128))],512),[[et,o(q)]]),t("button",{onClick:Ce,class:"p-1 px-1.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-sky-400 hover:text-sky-300 border border-slate-700 text-[10px] font-bold transition flex items-center gap-1",title:"Kelola & Buat Niche Baru"},[k(o(Ct),{class:"w-3 h-3"}),a[179]||(a[179]=t("span",{class:"hidden sm:inline"},"Niche",-1))])]),t("div",gl,[k(o(ps),{class:"w-3 h-3 text-emerald-400 ml-1 flex-shrink-0"}),fe(t("select",{"onUpdate:modelValue":a[58]||(a[58]=r=>Pe(K)?K.value=r:null),class:"bg-transparent text-[11px] font-bold text-emerald-300 focus:outline-none px-1.5 py-0.5 cursor-pointer max-w-[130px] truncate"},[...a[180]||(a[180]=[pt('<option value="id" class="bg-slate-900 text-white">🇮🇩 Indonesia</option><option value="en" class="bg-slate-900 text-white">🇺🇸 English</option><option value="es" class="bg-slate-900 text-white">🇪🇸 Español</option><option value="ja" class="bg-slate-900 text-white">🇯🇵 日本語</option><option value="de" class="bg-slate-900 text-white">🇩🇪 Deutsch</option>',5)])],512),[[et,o(K)]])]),t("button",{onClick:Gt,title:"Buat prompt manual bebas bentrok untuk ChatGPT / Gemini Web",class:"inline-flex items-center gap-1 px-2.5 py-1.5 text-[11px] font-bold text-purple-300 bg-purple-950/40 hover:bg-purple-900/50 border border-purple-500/30 rounded-xl transition shadow-sm"},[k(o(qt),{class:"w-3 h-3"}),a[181]||(a[181]=t("span",{class:"hidden sm:inline"},"Prompt Manual",-1))]),t("button",{onClick:a[59]||(a[59]=r=>zt()),disabled:n.isGenerating||n.isAutoTopicLoading,class:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-bold text-white bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 hover:from-sky-400 hover:to-indigo-500 rounded-xl shadow-md transition disabled:opacity-50"},[k(o(ht),{class:j(["w-3.5 h-3.5",{"animate-spin":n.isAutoTopicLoading}])},null,8,["class"]),t("span",null,x(n.isAutoTopicLoading?"Meriset Data...":"✨ Auto-Topic"),1)],8,vl),t("div",yl,[a[186]||(a[186]=t("button",{class:"px-2 py-1.5 text-xs font-bold text-slate-300 bg-slate-800 hover:bg-slate-700 border border-slate-700 rounded-xl"}," ▾ ",-1)),t("div",kl,[a[184]||(a[184]=t("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Model AI Engine",-1)),t("div",wl,[fe(t("select",{"onUpdate:modelValue":a[60]||(a[60]=r=>Pe(w)?w.value=r:null),class:"w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"},[...a[182]||(a[182]=[t("option",{value:"gemini-3.8-flash"},"⚡ Gemini 3.8 Flash",-1),t("option",{value:"gemini-3.5-flash"},"⚡ Gemini 3.5 Flash",-1),t("option",{value:"gemini-2.5-pro"},"💎 Gemini 2.5 Pro",-1),t("option",{value:"gemini-1.5-pro"},"💎 Gemini 1.5 Pro",-1)])],512),[[et,o(w)]])]),a[185]||(a[185]=t("div",{class:"border-t border-slate-800 my-1"},null,-1)),t("div",_l,[a[183]||(a[183]=t("span",null,"Pilih Format Template",-1)),t("span",Sl,x(o(W).length)+" opsi",1)]),t("div",Tl,[(p(!0),m(me,null,xe(o(W),r=>(p(),m("button",{key:r.id,onClick:v=>zt(void 0,r.id),class:"px-3 py-1.5 text-left text-slate-200 hover:bg-slate-800 text-[11px] flex items-center justify-between group/item"},[t("span",Ol,x(r.name),1),r.isBuiltin?$("",!0):(p(),m("span",Al,"Kustom"))],8,Cl))),128))])])])])]),n.isAutoTopicLoading?(p(),m("div",Nl,[t("div",Il,[k(o(ht),{class:"w-3.5 h-3.5 text-sky-400 animate-spin"})]),t("div",Ml,[t("div",$l,[a[187]||(a[187]=t("span",null,"AI Research Engine Sedang Bekerja...",-1)),t("span",Dl,x(o(w)),1)]),a[188]||(a[188]=t("p",{class:"text-[10px] text-slate-300 mt-0.5"},"Menganalisis angka perbandingan 2026 & meracik copywriting viral.",-1))])])):$("",!0),t("div",jl,[t("div",El,[t("button",{onClick:a[61]||(a[61]=r=>M.value="editor"),class:j(["px-2.5 py-1 rounded-lg transition text-[11px]",o(M)==="editor"?"bg-slate-800 text-sky-400 shadow font-bold":"text-slate-400 hover:text-white"])}," JSON Editor ",2),t("button",{onClick:a[62]||(a[62]=r=>M.value="drafts"),class:j(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",o(M)==="drafts"?"bg-slate-800 text-amber-400 shadow font-bold":"text-slate-400 hover:text-white"]),title:"Draft yang kamu simpan manual untuk dipakai nanti"},[k(o(Kt),{class:"w-3 h-3"}),t("span",null,"Drafts ("+x(n.drafts.length)+")",1)],2),t("button",{onClick:a[63]||(a[63]=r=>M.value="history"),class:j(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",o(M)==="history"?"bg-slate-800 text-purple-400 shadow font-bold":"text-slate-400 hover:text-white"]),title:"Riwayat otomatis setiap kali generate"},[k(o(Wt),{class:"w-3 h-3"}),t("span",null,"Riwayat ("+x(n.history.length)+")",1)],2)]),t("div",Rl,[n.unsavedStash?(p(),m("button",{key:0,onClick:Y,class:"text-[10px] text-amber-400 hover:text-amber-300 transition font-bold px-2 py-0.5 rounded-lg border border-amber-500/30 bg-amber-500/10 flex items-center gap-1",title:"Kembalikan editan aktif sebelum memilih draft/riwayat"},[...a[189]||(a[189]=[t("span",null,"↩️ Kembali ke Editan",-1)])])):$("",!0),o(M)==="history"&&n.history.length>0?(p(),m("button",{key:1,onClick:Sa,class:"text-[10px] text-rose-400 hover:text-rose-300 transition font-bold pr-1",title:"Bersihkan semua riwayat generate"}," Bersihkan Riwayat ")):$("",!0),t("button",{onClick:a[64]||(a[64]=r=>i("saveDraft")),class:"text-[10px] text-amber-400 hover:text-amber-300 transition pr-2 font-bold flex items-center gap-1",title:"Simpan data saat ini ke Drafts untuk digunakan nanti"},[k(o(Kt),{class:"w-3 h-3"}),a[190]||(a[190]=t("span",null,"+ Simpan ke Draft",-1))])])]),o(M)==="drafts"?(p(),m("div",Pl,[n.unsavedStash?(p(),m("div",Ll,[t("div",Vl,[a[192]||(a[192]=t("span",{class:"text-sm"},"✏️",-1)),t("div",Bl,[a[191]||(a[191]=t("span",{class:"font-bold text-[10px] block text-amber-300"},"Ada editan aktif sebelumnya:",-1)),t("span",Jl,'"'+x(n.unsavedStash.title||"Tanpa Judul")+'"',1)])]),t("div",Fl,[t("button",{onClick:Y,class:"px-2 py-1 bg-amber-500 hover:bg-amber-400 text-slate-950 font-bold rounded-lg text-[10px] transition shadow flex items-center gap-1 active:scale-95",title:"Kembalikan editan aktif sebelum membuka draft ini"},[...a[193]||(a[193]=[t("span",null,"↩️ Kembali ke Editan",-1)])]),t("button",{onClick:a[65]||(a[65]=r=>i("clearStash")),class:"p-1 hover:text-white text-amber-400/70 transition text-xs",title:"Abaikan & buang simpanan editan ini"}," ✕ ")])])):$("",!0),n.drafts.length===0?(p(),m("div",Zl,[...a[194]||(a[194]=[J(" Belum ada draft tersimpan.",-1),t("br",null,null,-1),J(" Klik ",-1),t("b",{class:"text-amber-400"},"+ Simpan ke Draft",-1),J(" di atas untuk menyimpan konten ini agar bisa diedit/digenerate nanti! ",-1)])])):$("",!0),(p(!0),m(me,null,xe(n.drafts,(r,v)=>(p(),m("div",{key:v,onClick:P=>i("selectDraft",v),"data-draft-item":"",class:j(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",n.activeDraftIndex===v?"bg-amber-500/15 border-amber-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[t("div",Ul,[t("div",zl,[t("span",Gl,x(r.layoutType||"table"),1),t("span",Kl,x(r.category),1)]),t("div",Wl,x(r.title),1)]),t("button",{onClick:ft(P=>i("deleteDraft",v),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus draft ini"},[k(o(tt),{class:"w-3.5 h-3.5"})],8,ql)],10,Hl))),128))])):o(M)==="history"?(p(),m("div",Yl,[n.unsavedStash?(p(),m("div",Xl,[t("div",Ql,[a[196]||(a[196]=t("span",{class:"text-sm"},"✏️",-1)),t("div",er,[a[195]||(a[195]=t("span",{class:"font-bold text-[10px] block text-purple-300"},"Ada editan aktif sebelumnya:",-1)),t("span",tr,'"'+x(n.unsavedStash.title||"Tanpa Judul")+'"',1)])]),t("div",ar,[t("button",{onClick:Y,class:"px-2 py-1 bg-purple-500 hover:bg-purple-400 text-white font-bold rounded-lg text-[10px] transition shadow flex items-center gap-1 active:scale-95",title:"Kembalikan editan aktif sebelum membuka riwayat ini"},[...a[197]||(a[197]=[t("span",null,"↩️ Kembali ke Editan",-1)])]),t("button",{onClick:a[66]||(a[66]=r=>i("clearStash")),class:"p-1 hover:text-white text-purple-400/70 transition text-xs",title:"Abaikan & buang simpanan editan ini"}," ✕ ")])])):$("",!0),n.history.length===0?(p(),m("div",sr,[...a[198]||(a[198]=[J(" Belum ada riwayat pembuatan.",-1),t("br",null,null,-1),J(" Setiap kali kamu klik ",-1),t("b",{class:"text-sky-400"},"GENERATE CONTENT",-1),J(", hasil pembuatan akan otomatis tercatat di sini! ",-1)])])):$("",!0),(p(!0),m(me,null,xe(n.history,(r,v)=>(p(),m("div",{key:v,onClick:P=>i("selectHistory",v),"data-history-item":"",class:j(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",n.activeHistoryIndex===v?"bg-purple-500/15 border-purple-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[t("div",or,[t("div",ir,[t("span",lr,x(r.layoutType||"reels"),1),t("span",rr,x(r.category),1),r.generatedAt?(p(),m("span",dr,x(Ta(r.generatedAt)),1)):$("",!0)]),t("div",ur,x(r.title),1)]),t("button",{onClick:ft(P=>i("deleteHistory",v),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus riwayat ini"},[k(o(tt),{class:"w-3.5 h-3.5"})],8,cr)],10,nr))),128))])):(p(),m("div",pr,[t("div",fr,[t("div",null,[t("div",mr,[t("label",xr,[k(o(Na),{class:"w-3 h-3 text-sky-400"}),a[199]||(a[199]=J(" Format Template ",-1))]),t("button",{onClick:a[67]||(a[67]=r=>I("list")),class:"text-[10px] font-bold text-sky-400 hover:text-sky-300 flex items-center gap-0.5 transition",title:"Kelola & buat template kustom baru"},[k(o(Yt),{class:"w-3 h-3"}),a[200]||(a[200]=t("span",null,"Kelola",-1))])]),t("select",{value:o(d),onChange:a[68]||(a[68]=r=>Xe(r.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"},[(p(!0),m(me,null,xe(o(W),r=>(p(),m("option",{key:r.id,value:r.id},x(r.name)+" "+x(r.isBuiltin?"":"⭐ (Kustom)"),9,br))),128))],40,hr)]),t("div",null,[a[202]||(a[202]=t("label",{class:"block text-[10px] font-bold text-slate-300 mb-1"}," Theme Color (10 Pilihan) ",-1)),t("select",{value:n.modelValue.theme||"blue-tech",onChange:a[69]||(a[69]=r=>wa(r.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"},[...a[201]||(a[201]=[pt('<option value="blue-tech">🔵 Blue Tech (AI & Software)</option><option value="emerald-finance">🟢 Emerald Finance (Salaries & Living)</option><option value="slate-education">🟣 Slate Education (Education & Career)</option><option value="dark-contrast">⚫ Dark Contrast (Universal Bold)</option><option value="crimson-alert">🔴 Crimson Alert (Breaking Shock)</option><option value="amber-gold">🟡 Amber Gold (Luxury & Executive)</option><option value="cyber-violet">🟪 Cyber Violet (Synthwave & Neon)</option><option value="sunset-orange">🟠 Sunset Orange (Warm Energy)</option><option value="nordic-frost">❄️ Nordic Frost (Polar Cyan Clean)</option><option value="monochrome-luxe">⚪ Monochrome Luxe (Minimalist)</option>',10)])],40,gr)]),t("div",vr,[t("div",yr,[a[203]||(a[203]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Watermark Handle ",-1)),t("input",{type:"text",value:n.modelValue.watermark||"@SocialGen",onInput:a[70]||(a[70]=r=>ka(r.target.value)),placeholder:"@NamaAkun",class:"w-full bg-slate-900 border border-slate-800 rounded-lg px-2.5 py-1.5 text-sky-400 font-semibold text-[11px] focus:outline-none focus:border-sky-500 transition"},null,40,kr)]),t("div",wr,[a[204]||(a[204]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Judul Konten (Title) ",-1)),t("input",{type:"text",value:n.modelValue.title,onInput:a[71]||(a[71]=r=>ya(r.target.value)),placeholder:"Judul Utama Konten...",class:"w-full bg-slate-900 border border-slate-800 rounded-lg px-2.5 py-1.5 text-slate-100 font-semibold text-[11px] focus:outline-none focus:border-sky-500 transition"},null,40,_r)])])]),t("div",Sr,[t("div",Tr,[a[206]||(a[206]=t("span",{class:"font-bold text-slate-300 text-[10px]"},"RAW JSON SocialGen",-1)),o(c)?(p(),m("span",Or,[k(o(Oa),{class:"w-2.5 h-2.5"}),a[205]||(a[205]=J(" Invalid ",-1))])):(p(),m("span",Cr,[k(o(us),{class:"w-2.5 h-2.5"}),J(" "+x(o(l).trim()?"Valid":"Sample Mode"),1)]))]),t("div",Ar,[t("button",{onClick:Ht,class:"text-[10px] text-slate-400 hover:text-amber-400 transition flex items-center gap-1",title:"Kosongkan JSON dan gunakan data sampel bawaan template aktif"},[k(o(Ka),{class:"w-2.5 h-2.5"}),a[207]||(a[207]=t("span",null,"Clear / Pakai Sample",-1))]),a[208]||(a[208]=t("span",{class:"text-slate-700"},"|",-1)),t("button",{onClick:va,class:"text-[10px] text-slate-400 hover:text-sky-400 transition"}," Format JSON ")])]),o(G)?(p(),m("div",{key:0,class:j(["mx-2.5 mt-2.5 p-2 rounded-xl border text-xs transition-all shadow-md flex flex-col sm:flex-row sm:items-center justify-between gap-2",o(G).isKnown?"bg-amber-500/10 border-amber-500/30":"bg-rose-500/10 border-rose-500/30"])},[t("div",{class:j(["flex items-center gap-1.5 text-[11px]",o(G).isKnown?"text-amber-300":"text-rose-300"])},[a[214]||(a[214]=t("span",{class:"text-sm"},"⚠️",-1)),o(G).isKnown?(p(),m("span",Nr,[a[209]||(a[209]=J(" JSON ini dibuat untuk template ",-1)),t("b",Ir,x(o(G).matchedTarget?.name),1),a[210]||(a[210]=J(" (",-1)),t("span",Mr,x(o(G).jsonTemplateId),1),a[211]||(a[211]=J(") ",-1))])):(p(),m("span",$r,[a[212]||(a[212]=J(' Template dengan ID "',-1)),t("span",Dr,x(o(G).jsonTemplateId),1),a[213]||(a[213]=J('" tidak ditemukan di sistem. ',-1))]))],2),t("div",jr,[o(G).isKnown&&o(G).matchedTarget?(p(),m("button",{key:0,onClick:a[72]||(a[72]=r=>Xe(o(G).matchedTarget.id)),class:"px-2 py-0.5 rounded-lg bg-amber-500/20 hover:bg-amber-500/30 text-amber-200 border border-amber-500/40 text-[10px] font-bold transition flex items-center gap-1"}," Pindah ke Template Ini ")):$("",!0),t("button",{onClick:Ht,class:"px-2 py-0.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 text-[10px] font-semibold transition"}," Hapus JSON (Pakai Sample) ")])],2)):$("",!0),t("div",Er,[t("textarea",{value:o(l),onInput:ga,rows:"7",spellcheck:"false",class:"w-full bg-slate-950 text-sky-200 text-[11px] font-mono p-2.5 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-y leading-relaxed",placeholder:"Paste Content JSON here... (kosong = otomatis menggunakan data sampel template aktif)"},null,40,Rr),o(c)||n.validationError?(p(),m("p",Pr," ⚠️ "+x(o(c)||n.validationError),1)):$("",!0)])])),t("input",{type:"file",ref_key:"videoInputRef",ref:Ft,accept:"video/mp4,video/webm",class:"hidden",onChange:a[73]||(a[73]=r=>ba(r))},null,544),t("input",{type:"file",ref_key:"audioInputRef",ref:Zt,accept:"audio/mp3,audio/mpeg,audio/wav",class:"hidden",onChange:a[74]||(a[74]=r=>ba(r))},null,544),t("div",Lr,[t("div",Vr,[t("div",Br,[t("label",Jr,[k(o(aa),{class:"w-3.5 h-3.5 text-sky-400"}),a[215]||(a[215]=t("span",null,"Background",-1))]),t("div",Fr,[t("select",{value:n.options.backgroundSource||"random",onChange:a[75]||(a[75]=r=>{const v=r.target.value;i("update:options",{...n.options,backgroundSource:v,videoStartOffset:0})}),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"},[a[216]||(a[216]=t("option",{value:"random"},"🔀 Acak Video",-1)),(p(!0),m(me,null,xe(o(Lt),r=>(p(),m("option",{key:r,value:r},x(r.replace(".mp4","").replace(/_/g," ")),9,Hr))),128)),a[217]||(a[217]=t("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,Zr),t("button",{onClick:a[76]||(a[76]=r=>o(Ft)?.click()),disabled:o(Je),title:"Upload Video MP4 Sendiri",class:"p-1 px-2 rounded-lg border border-sky-500/30 text-sky-300 bg-sky-950/40 hover:bg-sky-900/60 text-[10px] flex items-center gap-1 font-bold transition disabled:opacity-50"},[k(o(Ot),{class:"w-3 h-3"}),t("span",zr,x(o(Je)?"...":"Upload"),1)],8,Ur)])]),t("div",Gr,[t("span",Kr,[k(o(na),{class:"w-2.5 h-2.5"}),J(" Mulai: "+x(Math.min(n.options.videoStartOffset||0,o(Ge)))+"s / "+x(o(Bt))+"s ",1)]),t("input",{type:"range",min:"0",max:o(Ge),step:"1",value:Math.min(n.options.videoStartOffset||0,o(Ge)),onInput:a[77]||(a[77]=r=>je("videoStartOffset",Number(r.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,Wr)])]),t("div",qr,[t("div",Yr,[t("label",Xr,[k(o(sa),{class:"w-3.5 h-3.5 text-purple-400"}),a[218]||(a[218]=t("span",null,"Musik Reels",-1))]),t("div",Qr,[t("select",{value:n.options.musicFile||"random",onChange:a[78]||(a[78]=r=>{const v=r.target.value;i("update:options",{...n.options,musicFile:v,audioStartOffset:0})}),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"},[a[219]||(a[219]=t("option",{value:"random"},"🔀 Acak Musik",-1)),(p(!0),m(me,null,xe(o(Vt),r=>(p(),m("option",{key:r,value:r},x(r.replace(".mp3","").replace(/_/g," ")),9,td))),128))],40,ed),t("button",{onClick:a[79]||(a[79]=r=>o(Zt)?.click()),disabled:o(Je),title:"Upload Musik MP3 Sendiri",class:"p-1 px-2 rounded-lg border border-purple-500/30 text-purple-300 bg-purple-950/40 hover:bg-purple-900/60 text-[10px] flex items-center gap-1 font-bold transition disabled:opacity-50"},[k(o(Ot),{class:"w-3 h-3"}),t("span",sd,x(o(Je)?"...":"Upload"),1)],8,ad)])]),t("div",nd,[t("span",od,[k(o(na),{class:"w-2.5 h-2.5"}),J(" Mulai: "+x(Math.min(n.options.audioStartOffset||0,o(Ke)))+"s / "+x(o(Jt))+"s ",1)]),t("input",{type:"range",min:"0",max:o(Ke),step:"1",value:Math.min(n.options.audioStartOffset||0,o(Ke)),onInput:a[80]||(a[80]=r=>je("audioStartOffset",Number(r.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,id)])]),t("div",ld,[t("label",rd,[k(o(Wt),{class:"w-3.5 h-3.5 text-emerald-400"}),a[220]||(a[220]=t("span",null,"Durasi Reels:",-1))]),t("div",dd,[(p(),m(me,null,xe([7,10,15,30,60],r=>t("button",{key:r,onClick:v=>_a(r),class:j(["px-2 py-0.5 text-[10px] font-bold rounded-lg border transition",(n.modelValue.reelsDuration||30)===r?"bg-emerald-500/20 border-emerald-500/60 text-emerald-300":"bg-slate-950 border-slate-800 text-slate-400 hover:text-white"])},x(r===60?"1m":r+"s"),11,ud)),64))])]),t("div",cd,[t("label",{class:j(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",n.options.outputs?.feed!==!1?"bg-sky-500/10 border-sky-500/40 text-sky-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.feed!==!1,onChange:a[81]||(a[81]=r=>Qe("feed",r.target.checked)),class:"rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,pd),a[221]||(a[221]=t("span",{class:"font-bold"},"Feed 4:5",-1))],2),t("label",{class:j(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",n.options.outputs?.story!==!1?"bg-indigo-500/10 border-indigo-500/40 text-indigo-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.story!==!1,onChange:a[82]||(a[82]=r=>Qe("story",r.target.checked)),class:"rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,fd),a[222]||(a[222]=t("span",{class:"font-bold"},"Story 9:16",-1))],2),t("label",{class:j(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",n.options.outputs?.reels!==!1?"bg-emerald-500/10 border-emerald-500/40 text-emerald-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.reels!==!1,onChange:a[83]||(a[83]=r=>Qe("reels",r.target.checked)),class:"rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,md),a[223]||(a[223]=t("span",{class:"font-bold"},"Reels MP4",-1))],2)])]),t("button",{onClick:a[84]||(a[84]=r=>i("generate")),disabled:!n.isValid||n.isGenerating||!!o(c),class:j(["w-full py-3 px-4 rounded-xl font-black text-xs tracking-wide shadow-xl transition flex items-center justify-center gap-2",[!n.isValid||n.isGenerating||o(c)?"bg-slate-800 text-slate-500 cursor-not-allowed border border-slate-700":"bg-gradient-to-r from-sky-500 via-blue-600 to-indigo-600 text-white hover:from-sky-400 hover:to-indigo-500 shadow-sky-500/25 active:scale-[0.99]"]])},[n.isGenerating?(p(),Ne(o(Ia),{key:0,class:"w-3.5 h-3.5 animate-spin"})):(p(),Ne(o(Ga),{key:1,class:"w-3.5 h-3.5 fill-current"})),t("span",null,x(n.isGenerating?n.generateStage||"Rendering Content...":"GENERATE CONTENT"),1)],10,xd)])]))}}),bd={class:"flex flex-col gap-2.5 h-full text-slate-100 min-h-0 justify-between relative"},gd={key:0,class:"absolute inset-0 z-50 bg-slate-950/85 backdrop-blur-md rounded-2xl flex flex-col items-center justify-center p-6 text-center animate-in fade-in duration-200"},vd={class:"relative flex items-center justify-center mb-5"},yd={class:"absolute inset-0 flex items-center justify-center"},kd={class:"text-xs text-sky-300 font-bold mb-4 flex items-center gap-2"},wd={class:"flex flex-wrap items-center justify-between gap-2 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl shadow-lg flex-shrink-0"},_d={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"},Sd={key:0,class:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"},Td={class:"flex items-center gap-2 text-xs"},Cd={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"},Od={key:0,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"360px",height:"450px"}},Ad={style:{width:"1080px",height:"1350px",transform:"scale(0.333333)","transform-origin":"top left"}},Nd={key:1,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"300px",height:"533.33px"}},Id={key:0,class:"absolute inset-0 z-0 bg-slate-950 overflow-hidden"},Md=["src"],$d=["src","muted"],Dd={class:"relative z-10 pointer-events-none",style:{width:"1080px",height:"1920px",transform:"scale(0.277778)","transform-origin":"top left"}},jd={key:1,class:"absolute inset-0 z-20 pointer-events-none flex flex-col justify-between"},Ed={class:"flex-1 flex justify-end p-2"},Rd={key:0,class:"w-10 bg-red-500/20 border-l border-dashed border-red-500/60 rounded flex flex-col items-center justify-center gap-3 text-[8px] text-red-200 py-3 text-center px-0.5 font-bold"},Pd={key:1,class:"flex flex-col bg-slate-900/95 border border-slate-800 rounded-2xl p-2.5 gap-2 shadow-xl flex-shrink-0 text-xs"},Ld={class:"flex items-center justify-between gap-3"},Vd=["title"],Bd={class:"text-[11px] hidden sm:inline"},Jd={class:"flex-1 flex items-center gap-2"},Fd=["max","value"],Zd={class:"font-mono text-[11px] font-bold text-slate-300 min-w-[75px] text-right"},Hd=["title"],Ud={key:0,class:"grid grid-cols-1 sm:grid-cols-2 gap-3 p-2.5 bg-slate-950/80 rounded-xl border border-slate-800/80 animate-fadeIn"},zd={class:"flex flex-col gap-1.5"},Gd={class:"flex items-center justify-between text-[11px]"},Kd={class:"font-bold text-sky-300 flex items-center gap-1"},Wd=["max","value"],qd={class:"text-[9px] text-slate-500"},Yd={class:"flex flex-col gap-1.5"},Xd={class:"flex items-center justify-between text-[11px]"},Qd={class:"font-bold text-purple-300 flex items-center gap-1"},eu=["max","value"],tu={class:"text-[9px] text-slate-500"},au={class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl p-2.5 gap-1.5 shadow-lg flex-shrink-0"},su={class:"flex items-center justify-between text-xs"},nu=["value"],ou=ca({__name:"LivePreview",props:{data:{},selectedVideo:{},selectedMusic:{},videoStartOffset:{default:0},audioStartOffset:{default:0},isGenerating:{type:Boolean,default:!1},generateStage:{default:""},generatedResult:{}},emits:["update:videoStartOffset","update:audioStartOffset"],setup(n,{emit:e}){const s=n,i=e,l={"neon_cyber_grid.mp4":8,"financial_pulse_flow.mp4":8,"dark_luxury_particles.mp4":8,"cyber_matrix_stream.mp4":10,"cyber_blue.mp4":15,"default_bg.mp4":15,"emerald_flow.mp4":15,"cyber_pulse.mp4":15,"cyber_future_tech.mp3":15,"dark_phonk_pulse.mp3":15,"deep_finance_groove.mp3":15,"synthwave_pulse.mp3":15,"lofi_chill.mp3":15,"default_ambient.mp3":15,"motivation_cinematic.mp3":110,"lofi_viral_study.mp3":147},d=be(()=>s.selectedVideo&&s.selectedVideo!=="pexels"&&s.selectedVideo!=="random"?`/api/stream/videos/${s.selectedVideo}`:"/api/stream/videos/default_bg.mp4"),f=be(()=>s.selectedMusic&&s.selectedMusic!=="random"?`/api/stream/audio/${s.selectedMusic}`:"/api/stream/audio/lofi_viral_study.mp3"),c=S("feed"),C=S(!1),w=S(!1),M=S(!1),Y=S(1),ue=be(()=>c.value==="feed"?360:300),q=be(()=>c.value==="feed"?450:533.33),V=S(null),D=S(null),F=S(!0),ce=S(!1),Ce=S(0),$e=be(()=>s.data.reelsDuration||30),ge=S(l[s.selectedVideo||""]||8),X=S(l[s.selectedMusic||""]||30),K=be(()=>Math.max(1,Math.floor(ge.value-1))),oe=be(()=>Math.max(1,Math.floor(X.value-1)));function W(){Y.value<2.5&&(Y.value=Math.min(2.5,+(Y.value+.15).toFixed(2)))}function we(){Y.value>.5&&(Y.value=Math.max(.5,+(Y.value-.15).toFixed(2)))}function ne(){Y.value=1}function Q(T){(T.ctrlKey||T.metaKey)&&(T.preventDefault(),T.deltaY<0?W():we())}let ie=0,U=null;function ve(T){if(F.value){if(ie>0){const b=(T-ie)/1e3;b>0&&b<1&&(Ce.value+=b,Ce.value>=$e.value&&(Ce.value=0,Ye(0)))}ie=T,U=requestAnimationFrame(ve)}}const te=S({});async function _e(){try{const T=await $fetch("/api/media");if(T?.durations){te.value=T.durations;const b=s.selectedVideo||"";te.value[b]&&(ge.value=te.value[b]);const ye=s.selectedMusic||"";te.value[ye]&&(X.value=te.value[ye])}}catch{}}pa(()=>{_e(),F.value&&(ie=performance.now(),U&&cancelAnimationFrame(U),U=requestAnimationFrame(ve))}),is(()=>{U&&(cancelAnimationFrame(U),U=null)}),ke($e,T=>{Ce.value>T&&(Ce.value=0,Ye(0))});function ae(){F.value?ze():N()}function N(){F.value=!0,ie=performance.now(),U&&cancelAnimationFrame(U),U=requestAnimationFrame(ve),V.value&&V.value.play().catch(()=>{}),D.value&&(D.value.muted=ce.value,D.value.volume=.85,D.value.play().catch(()=>{}))}function ze(){F.value=!1,ie=0,U&&(cancelAnimationFrame(U),U=null),V.value&&V.value.pause(),D.value&&D.value.pause()}function I(){if(ce.value=!ce.value,D.value)if(D.value.muted=ce.value,D.value.volume=.85,!ce.value&&F.value){const T=s.audioStartOffset||0;D.value.currentTime=T+Ce.value%Math.max(1,X.value-T),D.value.play().catch(()=>{})}else D.value.pause()}function h(T){const b=T.target;b&&b.duration&&!isNaN(b.duration)&&isFinite(b.duration)&&(ge.value=Math.max(1,Math.floor(b.duration)),s.videoStartOffset&&s.videoStartOffset>=ge.value&&i("update:videoStartOffset",Math.max(0,ge.value-2))),V.value&&(V.value.currentTime=Math.min(s.videoStartOffset||0,K.value),F.value&&V.value.play().catch(()=>{}))}function ee(T){const b=T.target;b&&b.duration&&!isNaN(b.duration)&&isFinite(b.duration)&&(X.value=Math.max(1,Math.floor(b.duration)),s.audioStartOffset&&s.audioStartOffset>=X.value&&i("update:audioStartOffset",Math.max(0,X.value-2))),D.value&&(D.value.muted=ce.value,D.value.volume=.85,D.value.currentTime=Math.min(s.audioStartOffset||0,oe.value),F.value&&!ce.value&&D.value.play().catch(()=>{}))}function Me(){if(!V.value)return;const T=Math.min(s.videoStartOffset||0,K.value);V.value.currentTime=T,F.value&&V.value.play().catch(()=>{})}function B(){if(!D.value)return;const T=Math.min(s.audioStartOffset||0,oe.value);D.value.currentTime=T,F.value&&!ce.value&&D.value.play().catch(()=>{})}function Be(){if(!V.value)return;const T=Math.min(s.videoStartOffset||0,K.value),b=ge.value;V.value.currentTime>=b-.25&&(V.value.currentTime=T,F.value&&V.value.play().catch(()=>{}))}function jt(){if(!D.value)return;const T=Math.min(s.audioStartOffset||0,oe.value),b=X.value;D.value.currentTime>=b-.25&&(D.value.currentTime=T,F.value&&!ce.value&&D.value.play().catch(()=>{}))}function Ye(T){Ce.value=Math.min(Math.max(0,T),$e.value),ie=performance.now();const b=Math.min(s.videoStartOffset||0,K.value),ye=Math.min(s.audioStartOffset||0,oe.value);if(V.value){const le=b+T%Math.max(1,ge.value-b);V.value.currentTime=Math.min(le,ge.value-.1)}if(D.value){const le=ye+T%Math.max(1,X.value-ye);D.value.currentTime=Math.min(le,X.value-.1)}}function dt(T){const b=Number(T.target.value);Ye(b)}ke(()=>s.selectedVideo,(T,b)=>{b!==void 0&&T!==b&&(i("update:videoStartOffset",0),Ce.value=0,V.value&&(V.value.currentTime=0))}),ke(()=>s.selectedMusic,(T,b)=>{b!==void 0&&T!==b&&(i("update:audioStartOffset",0),D.value&&(D.value.currentTime=0))}),ke(()=>s.videoStartOffset,T=>{const b=Math.min(T||0,K.value);V.value&&(V.value.currentTime=b)}),ke(()=>s.audioStartOffset,T=>{const b=Math.min(T||0,oe.value);D.value&&(D.value.currentTime=b)});function ut(T){const b=Math.min(T,K.value);i("update:videoStartOffset",b),V.value&&(V.value.currentTime=b)}function Et(T){const b=Math.min(T,oe.value);i("update:audioStartOffset",b),D.value&&(D.value.currentTime=b)}function Rt(){if(V.value){const T=Math.min(Math.floor(V.value.currentTime),K.value);ut(T)}}function yt(T){const b=Math.floor(T/60),ye=Math.floor(T%60);return`${b.toString().padStart(2,"0")}:${ye.toString().padStart(2,"0")}`}async function Pt(){if(!s.data.caption)return;await xt(s.data.caption)&&(M.value=!0,setTimeout(()=>{M.value=!1},2e3))}return ke(()=>d.value,()=>{const T=s.selectedVideo||"";(te.value[T]||l[T])&&(ge.value=te.value[T]||l[T]),Ca(()=>{Ye(0)})}),ke(()=>f.value,()=>{const T=s.selectedMusic||"";(te.value[T]||l[T])&&(X.value=te.value[T]||l[T])}),ke(()=>c.value,T=>{T==="reels"?Ca(()=>{F.value&&N()}):D.value&&D.value.pause()}),(T,b)=>{const ye=ls;return p(),m("div",bd,[n.isGenerating?(p(),m("div",gd,[t("div",vd,[b[8]||(b[8]=t("div",{class:"w-20 h-20 rounded-full border-4 border-sky-500/20 border-t-sky-400 border-r-indigo-500 animate-spin"},null,-1)),t("div",yd,[k(o(ht),{class:"w-8 h-8 text-sky-400 animate-pulse"})])]),b[10]||(b[10]=t("h3",{class:"text-base font-black text-white tracking-wide mb-1.5"}," Sedang Men-generate Konten... ",-1)),t("p",kd,[b[9]||(b[9]=t("span",{class:"w-2 h-2 rounded-full bg-sky-400 animate-ping"},null,-1)),t("span",null,x(n.generateStage||"Merender Gambar & Video Reels..."),1)]),b[11]||(b[11]=t("div",{class:"w-64 max-w-full bg-slate-900 border border-slate-800 rounded-full h-2.5 overflow-hidden shadow-inner mb-3"},[t("div",{class:"h-full bg-gradient-to-r from-sky-500 via-indigo-500 to-purple-500 rounded-full animate-pulse w-full"})],-1)),b[12]||(b[12]=t("span",{class:"text-[10px] text-slate-400 font-mono tracking-wider uppercase"}," Multi-Format Studio Engine • Mohon Tunggu Sebentar ",-1))])):$("",!0),t("div",wd,[t("div",_d,[t("button",{onClick:b[0]||(b[0]=le=>c.value="feed"),class:j(["px-3 py-1.5 rounded-lg transition",o(c)==="feed"?"bg-sky-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Feed 4:5 ",2),t("button",{onClick:b[1]||(b[1]=le=>c.value="story"),class:j(["px-3 py-1.5 rounded-lg transition",o(c)==="story"?"bg-indigo-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Story 9:16 ",2),t("button",{onClick:b[2]||(b[2]=le=>c.value="reels"),class:j(["px-3 py-1.5 rounded-lg transition flex items-center gap-1.5",o(c)==="reels"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-white"])},[b[13]||(b[13]=t("span",null,"Reels 9:16 (Video)",-1)),o(c)==="reels"&&o(F)?(p(),m("span",Sd)):$("",!0)],2)]),t("div",Td,[t("div",Cd,[t("button",{onClick:we,title:"Zoom Out (-15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[k(o(vs),{class:"w-3.5 h-3.5"})]),t("button",{onClick:ne,title:"Klik untuk Reset Zoom (100% Fit)",class:"px-2 py-0.5 rounded-lg text-[11px] font-bold text-sky-400 hover:bg-slate-800 hover:text-sky-300 transition font-mono min-w-[42px] text-center"},x(Math.round(o(Y)*100))+"% ",1),t("button",{onClick:W,title:"Zoom In (+15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[k(o(gs),{class:"w-3.5 h-3.5"})]),o(Y)!==1?(p(),m("button",{key:0,onClick:ne,title:"Reset ke Ukuran Pas",class:"p-1.5 rounded-lg text-amber-400 hover:bg-slate-800 transition"},[k(o(Ka),{class:"w-3.5 h-3.5"})])):$("",!0)]),o(c)!=="feed"?(p(),m("button",{key:0,onClick:b[3]||(b[3]=le=>C.value=!o(C)),class:j(["inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition",o(C)?"bg-amber-500/20 text-amber-300 border-amber-500/50":"bg-slate-950 text-slate-400 border-slate-800"])},[k(o(ms),{class:"w-3.5 h-3.5"}),b[14]||(b[14]=t("span",{class:"hidden sm:inline"},"Safe Zones",-1))],2)):$("",!0)])]),t("div",{onWheel:Q,class:"relative flex-1 min-h-0 bg-slate-950/80 border border-slate-800/80 rounded-2xl flex p-4 overflow-auto shadow-inner custom-scrollbar"},[t("div",{class:"m-auto flex-shrink-0 relative transition-all duration-200 ease-out",style:ta({width:`${Math.round(o(ue)*o(Y))}px`,height:`${Math.round(o(q)*o(Y))}px`})},[t("div",{class:"origin-top-left transition-transform duration-200 ease-out absolute top-0 left-0",style:ta({width:`${o(ue)}px`,height:`${o(q)}px`,transform:`scale(${o(Y)})`})},[o(c)==="feed"?(p(),m("div",Od,[t("div",Ad,[k(ye,{data:n.data,mode:"feed","is-render":!0},null,8,["data"])])])):(p(),m("div",Nd,[o(c)==="reels"?(p(),m("div",Id,[(p(),m("video",{ref_key:"videoElement",ref:V,key:o(d),autoplay:"",muted:"",playsinline:"",class:"w-full h-full object-cover brightness-90 contrast-105",src:o(d),onLoadedmetadata:h,onTimeupdate:Be,onEnded:Me},null,40,Md)),b[15]||(b[15]=t("div",{class:"absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"},null,-1)),(p(),m("audio",{ref_key:"audioElement",ref:D,key:o(f),src:o(f),muted:o(ce),onLoadedmetadata:ee,onTimeupdate:jt,onEnded:B},null,40,$d))])):$("",!0),t("div",Dd,[k(ye,{data:n.data,mode:o(c)==="reels"?"overlay":"story","is-render":!0},null,8,["data","mode"])]),o(C)?(p(),m("div",jd,[b[17]||(b[17]=t("div",{class:"h-14 bg-red-500/20 border-b border-dashed border-red-500/60 flex items-center justify-center text-[9px] text-red-200 font-bold tracking-wider"}," TOP SAFE ZONE (Profile & Status) ",-1)),t("div",Ed,[o(c)==="reels"?(p(),m("div",Rd,[...b[16]||(b[16]=[t("span",null,"❤️ Like",-1),t("span",null,"💬 Comm",-1),t("span",null,"↗️ Share",-1)])])):$("",!0)]),b[18]||(b[18]=t("div",{class:"h-20 bg-red-500/20 border-t border-dashed border-red-500/60 flex items-center justify-center text-[9px] text-red-200 font-bold tracking-wider"}," BOTTOM SAFE ZONE (Caption & Audio) ",-1))])):$("",!0)]))],4)],4)],32),o(c)==="reels"?(p(),m("div",Pd,[t("div",Ld,[t("button",{onClick:ae,class:"p-2 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold transition flex items-center gap-1.5 shadow-md",title:o(F)?"Pause Preview":"Putar Preview"},[o(F)?(p(),Ne(o(fs),{key:0,class:"w-3.5 h-3.5 fill-current"})):(p(),Ne(o(Ga),{key:1,class:"w-3.5 h-3.5 fill-current"})),t("span",Bd,x(o(F)?"Pause":"Play"),1)],8,Vd),t("div",Jd,[t("input",{type:"range",min:"0",max:o($e),step:"0.1",value:o(Ce),onInput:dt,class:"flex-1 h-1.5 bg-slate-950 rounded-lg appearance-none cursor-pointer accent-emerald-500 hover:accent-emerald-400"},null,40,Fd),t("span",Zd,x(yt(o(Ce)))+" / "+x(yt(o($e))),1)]),t("button",{onClick:I,class:j(["px-2.5 py-2 rounded-xl border transition flex items-center gap-1.5 font-bold text-[11px]",o(ce)?"bg-slate-950 text-slate-400 border-slate-800 hover:text-white":"bg-purple-600/40 text-purple-200 border-purple-500/60 shadow-md ring-1 ring-purple-500/40"]),title:o(ce)?"Aktifkan Suara Musik (Unmute)":"Matikan Suara Musik (Mute)"},[o(ce)?(p(),Ne(o(hs),{key:1,class:"w-3.5 h-3.5"})):(p(),Ne(o(xs),{key:0,class:"w-3.5 h-3.5 text-purple-300 animate-pulse"})),t("span",null,x(o(ce)?"Muted":"Audio ON"),1)],10,Hd),t("button",{onClick:b[4]||(b[4]=le=>w.value=!o(w)),class:j(["px-2.5 py-2 rounded-xl border text-[11px] font-bold flex items-center gap-1.5 transition",o(w)?"bg-sky-500/20 text-sky-300 border-sky-500/50":"bg-slate-950 text-slate-400 border-slate-800 hover:text-white"]),title:"Atur Detik Awal Video & Musik"},[k(o(na),{class:"w-3.5 h-3.5 text-sky-400"}),b[19]||(b[19]=t("span",{class:"hidden sm:inline"},"Trim Offset",-1))],2)]),o(w)?(p(),m("div",Ud,[t("div",zd,[t("div",Gd,[t("span",Kd,[k(o(aa),{class:"w-3 h-3"}),J(" Mulai Video: "+x(Math.min(n.videoStartOffset||0,o(K)))+"s / "+x(o(ge))+"s ",1)]),t("button",{onClick:Rt,class:"text-[9px] px-1.5 py-0.5 rounded bg-slate-800 hover:bg-slate-700 text-sky-300 border border-slate-700 transition",title:"Gunakan posisi video saat ini sebagai detik mulai"}," Set Detik Ini ")]),t("input",{type:"range",min:"0",max:o(K),step:"1",value:Math.min(n.videoStartOffset||0,o(K)),onInput:b[5]||(b[5]=le=>ut(Number(le.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-sky-400"},null,40,Wd),t("div",qd," Maksimal offset: "+x(o(K))+" detik (panjang asli video: "+x(o(ge))+"s) ",1)]),t("div",Yd,[t("div",Xd,[t("span",Qd,[k(o(sa),{class:"w-3 h-3"}),J(" Mulai Musik: "+x(Math.min(n.audioStartOffset||0,o(oe)))+"s / "+x(o(X))+"s ",1)]),b[20]||(b[20]=t("span",{class:"text-[10px] text-slate-500 font-mono"}," (Skip intro) ",-1))]),t("input",{type:"range",min:"0",max:o(oe),step:"1",value:Math.min(n.audioStartOffset||0,o(oe)),onInput:b[6]||(b[6]=le=>Et(Number(le.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-purple-400"},null,40,eu),t("div",tu," Maksimal offset: "+x(o(oe))+" detik (panjang asli musik: "+x(o(X))+"s) ",1)])])):$("",!0)])):$("",!0),t("div",au,[t("div",su,[b[21]||(b[21]=t("span",{class:"font-extrabold text-slate-300 text-[11px]"},"VIRAL CAPTION & HASHTAGS",-1)),t("button",{onClick:Pt,class:"inline-flex items-center gap-1.5 px-3 py-1 bg-slate-800 hover:bg-slate-700 text-sky-300 border border-slate-700 rounded-lg transition text-[11px] font-bold"},[o(M)?(p(),Ne(o(at),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(p(),Ne(o(We),{key:1,class:"w-3.5 h-3.5"})),t("span",null,x(o(M)?"Tersalin!":"Copy Caption"),1)])]),t("textarea",{value:n.data.caption,onInput:b[7]||(b[7]=le=>n.data.caption=le.target.value),rows:"2",class:"w-full bg-slate-950 text-slate-200 text-xs p-2 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-none leading-relaxed font-sans",placeholder:"Caption will appear here..."},null,40,nu)])])}}});var H;(function(n){n.assertEqual=l=>{};function e(l){}n.assertIs=e;function s(l){throw new Error}n.assertNever=s,n.arrayToEnum=l=>{const d={};for(const f of l)d[f]=f;return d},n.getValidEnumValues=l=>{const d=n.objectKeys(l).filter(c=>typeof l[l[c]]!="number"),f={};for(const c of d)f[c]=l[c];return n.objectValues(f)},n.objectValues=l=>n.objectKeys(l).map(function(d){return l[d]}),n.objectKeys=typeof Object.keys=="function"?l=>Object.keys(l):l=>{const d=[];for(const f in l)Object.prototype.hasOwnProperty.call(l,f)&&d.push(f);return d},n.find=(l,d)=>{for(const f of l)if(d(f))return f},n.isInteger=typeof Number.isInteger=="function"?l=>Number.isInteger(l):l=>typeof l=="number"&&Number.isFinite(l)&&Math.floor(l)===l;function i(l,d=" | "){return l.map(f=>typeof f=="string"?`'${f}'`:f).join(d)}n.joinValues=i,n.jsonStringifyReplacer=(l,d)=>typeof d=="bigint"?d.toString():d})(H||(H={}));var Ma;(function(n){n.mergeShapes=(e,s)=>({...e,...s})})(Ma||(Ma={}));const O=H.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ze=n=>{switch(typeof n){case"undefined":return O.undefined;case"string":return O.string;case"number":return Number.isNaN(n)?O.nan:O.number;case"boolean":return O.boolean;case"function":return O.function;case"bigint":return O.bigint;case"symbol":return O.symbol;case"object":return Array.isArray(n)?O.array:n===null?O.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?O.promise:typeof Map<"u"&&n instanceof Map?O.map:typeof Set<"u"&&n instanceof Set?O.set:typeof Date<"u"&&n instanceof Date?O.date:O.object;default:return O.unknown}},g=H.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ve extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}format(e){const s=e||function(d){return d.message},i={_errors:[]},l=d=>{for(const f of d.issues)if(f.code==="invalid_union")f.unionErrors.map(l);else if(f.code==="invalid_return_type")l(f.returnTypeError);else if(f.code==="invalid_arguments")l(f.argumentsError);else if(f.path.length===0)i._errors.push(s(f));else{let c=i,C=0;for(;C<f.path.length;){const w=f.path[C];C===f.path.length-1?(c[w]=c[w]||{_errors:[]},c[w]._errors.push(s(f))):c[w]=c[w]||{_errors:[]},c=c[w],C++}}};return l(this),i}static assert(e){if(!(e instanceof Ve))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,H.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){const s={},i=[];for(const l of this.issues)if(l.path.length>0){const d=l.path[0];s[d]=s[d]||[],s[d].push(e(l))}else i.push(e(l));return{formErrors:i,fieldErrors:s}}get formErrors(){return this.flatten()}}Ve.create=n=>new Ve(n);const oa=(n,e)=>{let s;switch(n.code){case g.invalid_type:n.received===O.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case g.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,H.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:s=`Unrecognized key(s) in object: ${H.joinValues(n.keys,", ")}`;break;case g.invalid_union:s="Invalid input";break;case g.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${H.joinValues(n.options)}`;break;case g.invalid_enum_value:s=`Invalid enum value. Expected ${H.joinValues(n.options)}, received '${n.received}'`;break;case g.invalid_arguments:s="Invalid function arguments";break;case g.invalid_return_type:s="Invalid function return type";break;case g.invalid_date:s="Invalid date";break;case g.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(s=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?s=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?s=`Invalid input: must end with "${n.validation.endsWith}"`:H.assertNever(n.validation):n.validation!=="regex"?s=`Invalid ${n.validation}`:s="Invalid";break;case g.too_small:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:s="Invalid input";break;case g.too_big:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?s=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:s="Invalid input";break;case g.custom:s="Invalid input";break;case g.invalid_intersection_types:s="Intersection results could not be merged";break;case g.not_multiple_of:s=`Number must be a multiple of ${n.multipleOf}`;break;case g.not_finite:s="Number must be finite";break;default:s=e.defaultError,H.assertNever(n)}return{message:s}};let iu=oa;function lu(){return iu}const ru=n=>{const{data:e,path:s,errorMaps:i,issueData:l}=n,d=[...s,...l.path||[]],f={...l,path:d};if(l.message!==void 0)return{...l,path:d,message:l.message};let c="";const C=i.filter(w=>!!w).slice().reverse();for(const w of C)c=w(f,{data:e,defaultError:c}).message;return{...l,path:d,message:c}};function _(n,e){const s=lu(),i=ru({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s,s===oa?void 0:oa].filter(l=>!!l)});n.common.issues.push(i)}class Te{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){const i=[];for(const l of s){if(l.status==="aborted")return R;l.status==="dirty"&&e.dirty(),i.push(l.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,s){const i=[];for(const l of s){const d=await l.key,f=await l.value;i.push({key:d,value:f})}return Te.mergeObjectSync(e,i)}static mergeObjectSync(e,s){const i={};for(const l of s){const{key:d,value:f}=l;if(d.status==="aborted"||f.status==="aborted")return R;d.status==="dirty"&&e.dirty(),f.status==="dirty"&&e.dirty(),d.value!=="__proto__"&&(typeof f.value<"u"||l.alwaysSet)&&(i[d.value]=f.value)}return{status:e.value,value:i}}}const R=Object.freeze({status:"aborted"}),bt=n=>({status:"dirty",value:n}),Ie=n=>({status:"valid",value:n}),$a=n=>n.status==="aborted",Da=n=>n.status==="dirty",nt=n=>n.status==="valid",At=n=>typeof Promise<"u"&&n instanceof Promise;var A;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(A||(A={}));class Re{constructor(e,s,i,l){this._cachedPath=[],this.parent=e,this.data=s,this._path=i,this._key=l}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ja=(n,e)=>{if(nt(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new Ve(n.common.issues);return this._error=s,this._error}}};function L(n){if(!n)return{};const{errorMap:e,invalid_type_error:s,required_error:i,description:l}=n;if(e&&(s||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:l}:{errorMap:(f,c)=>{const{message:C}=n;return f.code==="invalid_enum_value"?{message:C??c.defaultError}:typeof c.data>"u"?{message:C??i??c.defaultError}:f.code!=="invalid_type"?{message:c.defaultError}:{message:C??s??c.defaultError}},description:l}}class Z{get description(){return this._def.description}_getType(e){return Ze(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:Ze(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Te,ctx:{common:e.parent.common,data:e.data,parsedType:Ze(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const s=this._parse(e);if(At(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){const s=this._parse(e);return Promise.resolve(s)}parse(e,s){const i=this.safeParse(e,s);if(i.success)return i.data;throw i.error}safeParse(e,s){const i={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ze(e)},l=this._parseSync({data:e,path:i.path,parent:i});return ja(i,l)}"~validate"(e){const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ze(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:s});return nt(i)?{value:i.value}:{issues:s.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(i=>nt(i)?{value:i.value}:{issues:s.common.issues})}async parseAsync(e,s){const i=await this.safeParseAsync(e,s);if(i.success)return i.data;throw i.error}async safeParseAsync(e,s){const i={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ze(e)},l=this._parse({data:e,path:i.path,parent:i}),d=await(At(l)?l:Promise.resolve(l));return ja(i,d)}refine(e,s){const i=l=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(l):s;return this._refinement((l,d)=>{const f=e(l),c=()=>d.addIssue({code:g.custom,...i(l)});return typeof Promise<"u"&&f instanceof Promise?f.then(C=>C?!0:(c(),!1)):f?!0:(c(),!1)})}refinement(e,s){return this._refinement((i,l)=>e(i)?!0:(l.addIssue(typeof s=="function"?s(i,l):s),!1))}_refinement(e){return new lt({schema:this,typeName:E.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return He.create(this,this._def)}nullable(){return rt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ee.create(this)}promise(){return Dt.create(this,this._def)}or(e){return It.create([this,e],this._def)}and(e){return Mt.create(this,e,this._def)}transform(e){return new lt({...L(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const s=typeof e=="function"?e:()=>e;return new ra({...L(this._def),innerType:this,defaultValue:s,typeName:E.ZodDefault})}brand(){return new Mu({typeName:E.ZodBranded,type:this,...L(this._def)})}catch(e){const s=typeof e=="function"?e:()=>e;return new da({...L(this._def),innerType:this,catchValue:s,typeName:E.ZodCatch})}describe(e){const s=this.constructor;return new s({...this._def,description:e})}pipe(e){return fa.create(this,e)}readonly(){return ua.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const du=/^c[^\s-]{8,}$/i,uu=/^[0-9a-z]+$/,cu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,pu=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,fu=/^[a-z0-9_-]{21}$/i,mu=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,xu=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hu=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,bu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Qt;const gu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,yu=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ku=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wu=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_u=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Wa="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Su=new RegExp(`^${Wa}$`);function qa(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const s=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`}function Tu(n){return new RegExp(`^${qa(n)}$`)}function Cu(n){let e=`${Wa}T${qa(n)}`;const s=[];return s.push(n.local?"Z?":"Z"),n.offset&&s.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${s.join("|")})`,new RegExp(`^${e}$`)}function Ou(n,e){return!!((e==="v4"||!e)&&gu.test(n)||(e==="v6"||!e)&&yu.test(n))}function Au(n,e){if(!mu.test(n))return!1;try{const[s]=n.split(".");if(!s)return!1;const i=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),l=JSON.parse(atob(i));return!(typeof l!="object"||l===null||"typ"in l&&l?.typ!=="JWT"||!l.alg||e&&l.alg!==e)}catch{return!1}}function Nu(n,e){return!!((e==="v4"||!e)&&vu.test(n)||(e==="v6"||!e)&&ku.test(n))}class Le extends Z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==O.string){const d=this._getOrReturnCtx(e);return _(d,{code:g.invalid_type,expected:O.string,received:d.parsedType}),R}const i=new Te;let l;for(const d of this._def.checks)if(d.kind==="min")e.data.length<d.value&&(l=this._getOrReturnCtx(e,l),_(l,{code:g.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),i.dirty());else if(d.kind==="max")e.data.length>d.value&&(l=this._getOrReturnCtx(e,l),_(l,{code:g.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),i.dirty());else if(d.kind==="length"){const f=e.data.length>d.value,c=e.data.length<d.value;(f||c)&&(l=this._getOrReturnCtx(e,l),f?_(l,{code:g.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}):c&&_(l,{code:g.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}),i.dirty())}else if(d.kind==="email")hu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"email",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="emoji")Qt||(Qt=new RegExp(bu,"u")),Qt.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"emoji",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="uuid")pu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"uuid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="nanoid")fu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"nanoid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="cuid")du.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"cuid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="cuid2")uu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"cuid2",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="ulid")cu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"ulid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="url")try{new URL(e.data)}catch{l=this._getOrReturnCtx(e,l),_(l,{validation:"url",code:g.invalid_string,message:d.message}),i.dirty()}else d.kind==="regex"?(d.regex.lastIndex=0,d.regex.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"regex",code:g.invalid_string,message:d.message}),i.dirty())):d.kind==="trim"?e.data=e.data.trim():d.kind==="includes"?e.data.includes(d.value,d.position)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:{includes:d.value,position:d.position},message:d.message}),i.dirty()):d.kind==="toLowerCase"?e.data=e.data.toLowerCase():d.kind==="toUpperCase"?e.data=e.data.toUpperCase():d.kind==="startsWith"?e.data.startsWith(d.value)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:{startsWith:d.value},message:d.message}),i.dirty()):d.kind==="endsWith"?e.data.endsWith(d.value)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:{endsWith:d.value},message:d.message}),i.dirty()):d.kind==="datetime"?Cu(d).test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:"datetime",message:d.message}),i.dirty()):d.kind==="date"?Su.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:"date",message:d.message}),i.dirty()):d.kind==="time"?Tu(d).test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:"time",message:d.message}),i.dirty()):d.kind==="duration"?xu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"duration",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="ip"?Ou(e.data,d.version)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"ip",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="jwt"?Au(e.data,d.alg)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"jwt",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="cidr"?Nu(e.data,d.version)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"cidr",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="base64"?wu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"base64",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="base64url"?_u.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"base64url",code:g.invalid_string,message:d.message}),i.dirty()):H.assertNever(d);return{status:i.value,value:e.data}}_regex(e,s,i){return this.refinement(l=>e.test(l),{validation:s,code:g.invalid_string,...A.errToObj(i)})}_addCheck(e){return new Le({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...A.errToObj(e)})}url(e){return this._addCheck({kind:"url",...A.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...A.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...A.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...A.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...A.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...A.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...A.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...A.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...A.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...A.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...A.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...A.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...A.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...A.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...A.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...A.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...A.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...A.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...A.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...A.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...A.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...A.errToObj(s)})}nonempty(e){return this.min(1,A.errToObj(e))}trim(){return new Le({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Le({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Le({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}Le.create=n=>new Le({checks:[],typeName:E.ZodString,coerce:n?.coerce??!1,...L(n)});function Iu(n,e){const s=(n.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,l=s>i?s:i,d=Number.parseInt(n.toFixed(l).replace(".","")),f=Number.parseInt(e.toFixed(l).replace(".",""));return d%f/10**l}class ot extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==O.number){const d=this._getOrReturnCtx(e);return _(d,{code:g.invalid_type,expected:O.number,received:d.parsedType}),R}let i;const l=new Te;for(const d of this._def.checks)d.kind==="int"?H.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{code:g.invalid_type,expected:"integer",received:"float",message:d.message}),l.dirty()):d.kind==="min"?(d.inclusive?e.data<d.value:e.data<=d.value)&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.too_small,minimum:d.value,type:"number",inclusive:d.inclusive,exact:!1,message:d.message}),l.dirty()):d.kind==="max"?(d.inclusive?e.data>d.value:e.data>=d.value)&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.too_big,maximum:d.value,type:"number",inclusive:d.inclusive,exact:!1,message:d.message}),l.dirty()):d.kind==="multipleOf"?Iu(e.data,d.value)!==0&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.not_multiple_of,multipleOf:d.value,message:d.message}),l.dirty()):d.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{code:g.not_finite,message:d.message}),l.dirty()):H.assertNever(d);return{status:l.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,A.toString(s))}gt(e,s){return this.setLimit("min",e,!1,A.toString(s))}lte(e,s){return this.setLimit("max",e,!0,A.toString(s))}lt(e,s){return this.setLimit("max",e,!1,A.toString(s))}setLimit(e,s,i,l){return new ot({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:i,message:A.toString(l)}]})}_addCheck(e){return new ot({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:A.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:A.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.toString(e)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&H.isInteger(e.value))}get isFinite(){let e=null,s=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(s===null||i.value>s)&&(s=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(s)&&Number.isFinite(e)}}ot.create=n=>new ot({checks:[],typeName:E.ZodNumber,coerce:n?.coerce||!1,...L(n)});class gt extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==O.bigint)return this._getInvalidInput(e);let i;const l=new Te;for(const d of this._def.checks)d.kind==="min"?(d.inclusive?e.data<d.value:e.data<=d.value)&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.too_small,type:"bigint",minimum:d.value,inclusive:d.inclusive,message:d.message}),l.dirty()):d.kind==="max"?(d.inclusive?e.data>d.value:e.data>=d.value)&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.too_big,type:"bigint",maximum:d.value,inclusive:d.inclusive,message:d.message}),l.dirty()):d.kind==="multipleOf"?e.data%d.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.not_multiple_of,multipleOf:d.value,message:d.message}),l.dirty()):H.assertNever(d);return{status:l.value,value:e.data}}_getInvalidInput(e){const s=this._getOrReturnCtx(e);return _(s,{code:g.invalid_type,expected:O.bigint,received:s.parsedType}),R}gte(e,s){return this.setLimit("min",e,!0,A.toString(s))}gt(e,s){return this.setLimit("min",e,!1,A.toString(s))}lte(e,s){return this.setLimit("max",e,!0,A.toString(s))}lt(e,s){return this.setLimit("max",e,!1,A.toString(s))}setLimit(e,s,i,l){return new gt({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:i,message:A.toString(l)}]})}_addCheck(e){return new gt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(s)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}gt.create=n=>new gt({checks:[],typeName:E.ZodBigInt,coerce:n?.coerce??!1,...L(n)});class Ea extends Z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==O.boolean){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:O.boolean,received:i.parsedType}),R}return Ie(e.data)}}Ea.create=n=>new Ea({typeName:E.ZodBoolean,coerce:n?.coerce||!1,...L(n)});class Nt extends Z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==O.date){const d=this._getOrReturnCtx(e);return _(d,{code:g.invalid_type,expected:O.date,received:d.parsedType}),R}if(Number.isNaN(e.data.getTime())){const d=this._getOrReturnCtx(e);return _(d,{code:g.invalid_date}),R}const i=new Te;let l;for(const d of this._def.checks)d.kind==="min"?e.data.getTime()<d.value&&(l=this._getOrReturnCtx(e,l),_(l,{code:g.too_small,message:d.message,inclusive:!0,exact:!1,minimum:d.value,type:"date"}),i.dirty()):d.kind==="max"?e.data.getTime()>d.value&&(l=this._getOrReturnCtx(e,l),_(l,{code:g.too_big,message:d.message,inclusive:!0,exact:!1,maximum:d.value,type:"date"}),i.dirty()):H.assertNever(d);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Nt({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:A.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:A.toString(s)})}get minDate(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}}Nt.create=n=>new Nt({checks:[],coerce:n?.coerce||!1,typeName:E.ZodDate,...L(n)});class Ra extends Z{_parse(e){if(this._getType(e)!==O.symbol){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:O.symbol,received:i.parsedType}),R}return Ie(e.data)}}Ra.create=n=>new Ra({typeName:E.ZodSymbol,...L(n)});class Pa extends Z{_parse(e){if(this._getType(e)!==O.undefined){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:O.undefined,received:i.parsedType}),R}return Ie(e.data)}}Pa.create=n=>new Pa({typeName:E.ZodUndefined,...L(n)});class La extends Z{_parse(e){if(this._getType(e)!==O.null){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:O.null,received:i.parsedType}),R}return Ie(e.data)}}La.create=n=>new La({typeName:E.ZodNull,...L(n)});class ia extends Z{constructor(){super(...arguments),this._any=!0}_parse(e){return Ie(e.data)}}ia.create=n=>new ia({typeName:E.ZodAny,...L(n)});class Va extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ie(e.data)}}Va.create=n=>new Va({typeName:E.ZodUnknown,...L(n)});class Ue extends Z{_parse(e){const s=this._getOrReturnCtx(e);return _(s,{code:g.invalid_type,expected:O.never,received:s.parsedType}),R}}Ue.create=n=>new Ue({typeName:E.ZodNever,...L(n)});class Ba extends Z{_parse(e){if(this._getType(e)!==O.undefined){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:O.void,received:i.parsedType}),R}return Ie(e.data)}}Ba.create=n=>new Ba({typeName:E.ZodVoid,...L(n)});class Ee extends Z{_parse(e){const{ctx:s,status:i}=this._processInputParams(e),l=this._def;if(s.parsedType!==O.array)return _(s,{code:g.invalid_type,expected:O.array,received:s.parsedType}),R;if(l.exactLength!==null){const f=s.data.length>l.exactLength.value,c=s.data.length<l.exactLength.value;(f||c)&&(_(s,{code:f?g.too_big:g.too_small,minimum:c?l.exactLength.value:void 0,maximum:f?l.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:l.exactLength.message}),i.dirty())}if(l.minLength!==null&&s.data.length<l.minLength.value&&(_(s,{code:g.too_small,minimum:l.minLength.value,type:"array",inclusive:!0,exact:!1,message:l.minLength.message}),i.dirty()),l.maxLength!==null&&s.data.length>l.maxLength.value&&(_(s,{code:g.too_big,maximum:l.maxLength.value,type:"array",inclusive:!0,exact:!1,message:l.maxLength.message}),i.dirty()),s.common.async)return Promise.all([...s.data].map((f,c)=>l.type._parseAsync(new Re(s,f,s.path,c)))).then(f=>Te.mergeArray(i,f));const d=[...s.data].map((f,c)=>l.type._parseSync(new Re(s,f,s.path,c)));return Te.mergeArray(i,d)}get element(){return this._def.type}min(e,s){return new Ee({...this._def,minLength:{value:e,message:A.toString(s)}})}max(e,s){return new Ee({...this._def,maxLength:{value:e,message:A.toString(s)}})}length(e,s){return new Ee({...this._def,exactLength:{value:e,message:A.toString(s)}})}nonempty(e){return this.min(1,e)}}Ee.create=(n,e)=>new Ee({type:n,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...L(e)});function st(n){if(n instanceof re){const e={};for(const s in n.shape){const i=n.shape[s];e[s]=He.create(st(i))}return new re({...n._def,shape:()=>e})}else return n instanceof Ee?new Ee({...n._def,type:st(n.element)}):n instanceof He?He.create(st(n.unwrap())):n instanceof rt?rt.create(st(n.unwrap())):n instanceof qe?qe.create(n.items.map(e=>st(e))):n}class re extends Z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),s=H.objectKeys(e);return this._cached={shape:e,keys:s},this._cached}_parse(e){if(this._getType(e)!==O.object){const w=this._getOrReturnCtx(e);return _(w,{code:g.invalid_type,expected:O.object,received:w.parsedType}),R}const{status:i,ctx:l}=this._processInputParams(e),{shape:d,keys:f}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ue&&this._def.unknownKeys==="strip"))for(const w in l.data)f.includes(w)||c.push(w);const C=[];for(const w of f){const M=d[w],Y=l.data[w];C.push({key:{status:"valid",value:w},value:M._parse(new Re(l,Y,l.path,w)),alwaysSet:w in l.data})}if(this._def.catchall instanceof Ue){const w=this._def.unknownKeys;if(w==="passthrough")for(const M of c)C.push({key:{status:"valid",value:M},value:{status:"valid",value:l.data[M]}});else if(w==="strict")c.length>0&&(_(l,{code:g.unrecognized_keys,keys:c}),i.dirty());else if(w!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const w=this._def.catchall;for(const M of c){const Y=l.data[M];C.push({key:{status:"valid",value:M},value:w._parse(new Re(l,Y,l.path,M)),alwaysSet:M in l.data})}}return l.common.async?Promise.resolve().then(async()=>{const w=[];for(const M of C){const Y=await M.key,ue=await M.value;w.push({key:Y,value:ue,alwaysSet:M.alwaysSet})}return w}).then(w=>Te.mergeObjectSync(i,w)):Te.mergeObjectSync(i,C)}get shape(){return this._def.shape()}strict(e){return A.errToObj,new re({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,i)=>{const l=this._def.errorMap?.(s,i).message??i.defaultError;return s.code==="unrecognized_keys"?{message:A.errToObj(e).message??l}:{message:l}}}:{}})}strip(){return new re({...this._def,unknownKeys:"strip"})}passthrough(){return new re({...this._def,unknownKeys:"passthrough"})}extend(e){return new re({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new re({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:E.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new re({...this._def,catchall:e})}pick(e){const s={};for(const i of H.objectKeys(e))e[i]&&this.shape[i]&&(s[i]=this.shape[i]);return new re({...this._def,shape:()=>s})}omit(e){const s={};for(const i of H.objectKeys(this.shape))e[i]||(s[i]=this.shape[i]);return new re({...this._def,shape:()=>s})}deepPartial(){return st(this)}partial(e){const s={};for(const i of H.objectKeys(this.shape)){const l=this.shape[i];e&&!e[i]?s[i]=l:s[i]=l.optional()}return new re({...this._def,shape:()=>s})}required(e){const s={};for(const i of H.objectKeys(this.shape))if(e&&!e[i])s[i]=this.shape[i];else{let d=this.shape[i];for(;d instanceof He;)d=d._def.innerType;s[i]=d}return new re({...this._def,shape:()=>s})}keyof(){return Ya(H.objectKeys(this.shape))}}re.create=(n,e)=>new re({shape:()=>n,unknownKeys:"strip",catchall:Ue.create(),typeName:E.ZodObject,...L(e)});re.strictCreate=(n,e)=>new re({shape:()=>n,unknownKeys:"strict",catchall:Ue.create(),typeName:E.ZodObject,...L(e)});re.lazycreate=(n,e)=>new re({shape:n,unknownKeys:"strip",catchall:Ue.create(),typeName:E.ZodObject,...L(e)});class It extends Z{_parse(e){const{ctx:s}=this._processInputParams(e),i=this._def.options;function l(d){for(const c of d)if(c.result.status==="valid")return c.result;for(const c of d)if(c.result.status==="dirty")return s.common.issues.push(...c.ctx.common.issues),c.result;const f=d.map(c=>new Ve(c.ctx.common.issues));return _(s,{code:g.invalid_union,unionErrors:f}),R}if(s.common.async)return Promise.all(i.map(async d=>{const f={...s,common:{...s.common,issues:[]},parent:null};return{result:await d._parseAsync({data:s.data,path:s.path,parent:f}),ctx:f}})).then(l);{let d;const f=[];for(const C of i){const w={...s,common:{...s.common,issues:[]},parent:null},M=C._parseSync({data:s.data,path:s.path,parent:w});if(M.status==="valid")return M;M.status==="dirty"&&!d&&(d={result:M,ctx:w}),w.common.issues.length&&f.push(w.common.issues)}if(d)return s.common.issues.push(...d.ctx.common.issues),d.result;const c=f.map(C=>new Ve(C));return _(s,{code:g.invalid_union,unionErrors:c}),R}}get options(){return this._def.options}}It.create=(n,e)=>new It({options:n,typeName:E.ZodUnion,...L(e)});function la(n,e){const s=Ze(n),i=Ze(e);if(n===e)return{valid:!0,data:n};if(s===O.object&&i===O.object){const l=H.objectKeys(e),d=H.objectKeys(n).filter(c=>l.indexOf(c)!==-1),f={...n,...e};for(const c of d){const C=la(n[c],e[c]);if(!C.valid)return{valid:!1};f[c]=C.data}return{valid:!0,data:f}}else if(s===O.array&&i===O.array){if(n.length!==e.length)return{valid:!1};const l=[];for(let d=0;d<n.length;d++){const f=n[d],c=e[d],C=la(f,c);if(!C.valid)return{valid:!1};l.push(C.data)}return{valid:!0,data:l}}else return s===O.date&&i===O.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Mt extends Z{_parse(e){const{status:s,ctx:i}=this._processInputParams(e),l=(d,f)=>{if($a(d)||$a(f))return R;const c=la(d.value,f.value);return c.valid?((Da(d)||Da(f))&&s.dirty(),{status:s.value,value:c.data}):(_(i,{code:g.invalid_intersection_types}),R)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([d,f])=>l(d,f)):l(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Mt.create=(n,e,s)=>new Mt({left:n,right:e,typeName:E.ZodIntersection,...L(s)});class qe extends Z{_parse(e){const{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==O.array)return _(i,{code:g.invalid_type,expected:O.array,received:i.parsedType}),R;if(i.data.length<this._def.items.length)return _(i,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),R;!this._def.rest&&i.data.length>this._def.items.length&&(_(i,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const d=[...i.data].map((f,c)=>{const C=this._def.items[c]||this._def.rest;return C?C._parse(new Re(i,f,i.path,c)):null}).filter(f=>!!f);return i.common.async?Promise.all(d).then(f=>Te.mergeArray(s,f)):Te.mergeArray(s,d)}get items(){return this._def.items}rest(e){return new qe({...this._def,rest:e})}}qe.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qe({items:n,typeName:E.ZodTuple,rest:null,...L(e)})};class $t extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==O.object)return _(i,{code:g.invalid_type,expected:O.object,received:i.parsedType}),R;const l=[],d=this._def.keyType,f=this._def.valueType;for(const c in i.data)l.push({key:d._parse(new Re(i,c,i.path,c)),value:f._parse(new Re(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?Te.mergeObjectAsync(s,l):Te.mergeObjectSync(s,l)}get element(){return this._def.valueType}static create(e,s,i){return s instanceof Z?new $t({keyType:e,valueType:s,typeName:E.ZodRecord,...L(i)}):new $t({keyType:Le.create(),valueType:e,typeName:E.ZodRecord,...L(s)})}}class Ja extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==O.map)return _(i,{code:g.invalid_type,expected:O.map,received:i.parsedType}),R;const l=this._def.keyType,d=this._def.valueType,f=[...i.data.entries()].map(([c,C],w)=>({key:l._parse(new Re(i,c,i.path,[w,"key"])),value:d._parse(new Re(i,C,i.path,[w,"value"]))}));if(i.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const C of f){const w=await C.key,M=await C.value;if(w.status==="aborted"||M.status==="aborted")return R;(w.status==="dirty"||M.status==="dirty")&&s.dirty(),c.set(w.value,M.value)}return{status:s.value,value:c}})}else{const c=new Map;for(const C of f){const w=C.key,M=C.value;if(w.status==="aborted"||M.status==="aborted")return R;(w.status==="dirty"||M.status==="dirty")&&s.dirty(),c.set(w.value,M.value)}return{status:s.value,value:c}}}}Ja.create=(n,e,s)=>new Ja({valueType:e,keyType:n,typeName:E.ZodMap,...L(s)});class vt extends Z{_parse(e){const{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==O.set)return _(i,{code:g.invalid_type,expected:O.set,received:i.parsedType}),R;const l=this._def;l.minSize!==null&&i.data.size<l.minSize.value&&(_(i,{code:g.too_small,minimum:l.minSize.value,type:"set",inclusive:!0,exact:!1,message:l.minSize.message}),s.dirty()),l.maxSize!==null&&i.data.size>l.maxSize.value&&(_(i,{code:g.too_big,maximum:l.maxSize.value,type:"set",inclusive:!0,exact:!1,message:l.maxSize.message}),s.dirty());const d=this._def.valueType;function f(C){const w=new Set;for(const M of C){if(M.status==="aborted")return R;M.status==="dirty"&&s.dirty(),w.add(M.value)}return{status:s.value,value:w}}const c=[...i.data.values()].map((C,w)=>d._parse(new Re(i,C,i.path,w)));return i.common.async?Promise.all(c).then(C=>f(C)):f(c)}min(e,s){return new vt({...this._def,minSize:{value:e,message:A.toString(s)}})}max(e,s){return new vt({...this._def,maxSize:{value:e,message:A.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}}vt.create=(n,e)=>new vt({valueType:n,minSize:null,maxSize:null,typeName:E.ZodSet,...L(e)});class Fa extends Z{get schema(){return this._def.getter()}_parse(e){const{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}Fa.create=(n,e)=>new Fa({getter:n,typeName:E.ZodLazy,...L(e)});class Za extends Z{_parse(e){if(e.data!==this._def.value){const s=this._getOrReturnCtx(e);return _(s,{received:s.data,code:g.invalid_literal,expected:this._def.value}),R}return{status:"valid",value:e.data}}get value(){return this._def.value}}Za.create=(n,e)=>new Za({value:n,typeName:E.ZodLiteral,...L(e)});function Ya(n,e){return new it({values:n,typeName:E.ZodEnum,...L(e)})}class it extends Z{_parse(e){if(typeof e.data!="string"){const s=this._getOrReturnCtx(e),i=this._def.values;return _(s,{expected:H.joinValues(i),received:s.parsedType,code:g.invalid_type}),R}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const s=this._getOrReturnCtx(e),i=this._def.values;return _(s,{received:s.data,code:g.invalid_enum_value,options:i}),R}return Ie(e.data)}get options(){return this._def.values}get enum(){const e={};for(const s of this._def.values)e[s]=s;return e}get Values(){const e={};for(const s of this._def.values)e[s]=s;return e}get Enum(){const e={};for(const s of this._def.values)e[s]=s;return e}extract(e,s=this._def){return it.create(e,{...this._def,...s})}exclude(e,s=this._def){return it.create(this.options.filter(i=>!e.includes(i)),{...this._def,...s})}}it.create=Ya;class Ha extends Z{_parse(e){const s=H.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==O.string&&i.parsedType!==O.number){const l=H.objectValues(s);return _(i,{expected:H.joinValues(l),received:i.parsedType,code:g.invalid_type}),R}if(this._cache||(this._cache=new Set(H.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const l=H.objectValues(s);return _(i,{received:i.data,code:g.invalid_enum_value,options:l}),R}return Ie(e.data)}get enum(){return this._def.values}}Ha.create=(n,e)=>new Ha({values:n,typeName:E.ZodNativeEnum,...L(e)});class Dt extends Z{unwrap(){return this._def.type}_parse(e){const{ctx:s}=this._processInputParams(e);if(s.parsedType!==O.promise&&s.common.async===!1)return _(s,{code:g.invalid_type,expected:O.promise,received:s.parsedType}),R;const i=s.parsedType===O.promise?s.data:Promise.resolve(s.data);return Ie(i.then(l=>this._def.type.parseAsync(l,{path:s.path,errorMap:s.common.contextualErrorMap})))}}Dt.create=(n,e)=>new Dt({type:n,typeName:E.ZodPromise,...L(e)});class lt extends Z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:s,ctx:i}=this._processInputParams(e),l=this._def.effect||null,d={addIssue:f=>{_(i,f),f.fatal?s.abort():s.dirty()},get path(){return i.path}};if(d.addIssue=d.addIssue.bind(d),l.type==="preprocess"){const f=l.transform(i.data,d);if(i.common.async)return Promise.resolve(f).then(async c=>{if(s.value==="aborted")return R;const C=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return C.status==="aborted"?R:C.status==="dirty"||s.value==="dirty"?bt(C.value):C});{if(s.value==="aborted")return R;const c=this._def.schema._parseSync({data:f,path:i.path,parent:i});return c.status==="aborted"?R:c.status==="dirty"||s.value==="dirty"?bt(c.value):c}}if(l.type==="refinement"){const f=c=>{const C=l.refinement(c,d);if(i.common.async)return Promise.resolve(C);if(C instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?R:(c.status==="dirty"&&s.dirty(),f(c.value),{status:s.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?R:(c.status==="dirty"&&s.dirty(),f(c.value).then(()=>({status:s.value,value:c.value}))))}if(l.type==="transform")if(i.common.async===!1){const f=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!nt(f))return R;const c=l.transform(f.value,d);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(f=>nt(f)?Promise.resolve(l.transform(f.value,d)).then(c=>({status:s.value,value:c})):R);H.assertNever(l)}}lt.create=(n,e,s)=>new lt({schema:n,typeName:E.ZodEffects,effect:e,...L(s)});lt.createWithPreprocess=(n,e,s)=>new lt({schema:e,effect:{type:"preprocess",transform:n},typeName:E.ZodEffects,...L(s)});class He extends Z{_parse(e){return this._getType(e)===O.undefined?Ie(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}He.create=(n,e)=>new He({innerType:n,typeName:E.ZodOptional,...L(e)});class rt extends Z{_parse(e){return this._getType(e)===O.null?Ie(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}rt.create=(n,e)=>new rt({innerType:n,typeName:E.ZodNullable,...L(e)});class ra extends Z{_parse(e){const{ctx:s}=this._processInputParams(e);let i=s.data;return s.parsedType===O.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}ra.create=(n,e)=>new ra({innerType:n,typeName:E.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class da extends Z{_parse(e){const{ctx:s}=this._processInputParams(e),i={...s,common:{...s.common,issues:[]}},l=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return At(l)?l.then(d=>({status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new Ve(i.common.issues)},input:i.data})})):{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ve(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}da.create=(n,e)=>new da({innerType:n,typeName:E.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class Ua extends Z{_parse(e){if(this._getType(e)!==O.nan){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:O.nan,received:i.parsedType}),R}return{status:"valid",value:e.data}}}Ua.create=n=>new Ua({typeName:E.ZodNaN,...L(n)});class Mu extends Z{_parse(e){const{ctx:s}=this._processInputParams(e),i=s.data;return this._def.type._parse({data:i,path:s.path,parent:s})}unwrap(){return this._def.type}}class fa extends Z{_parse(e){const{status:s,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const d=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return d.status==="aborted"?R:d.status==="dirty"?(s.dirty(),bt(d.value)):this._def.out._parseAsync({data:d.value,path:i.path,parent:i})})();{const l=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?R:l.status==="dirty"?(s.dirty(),{status:"dirty",value:l.value}):this._def.out._parseSync({data:l.value,path:i.path,parent:i})}}static create(e,s){return new fa({in:e,out:s,typeName:E.ZodPipeline})}}class ua extends Z{_parse(e){const s=this._def.innerType._parse(e),i=l=>(nt(l)&&(l.value=Object.freeze(l.value)),l);return At(s)?s.then(l=>i(l)):i(s)}unwrap(){return this._def.innerType}}ua.create=(n,e)=>new ua({innerType:n,typeName:E.ZodReadonly,...L(e)});var E;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(E||(E={}));const y=Le.create,mt=ot.create,za=ia.create;Ue.create;const he=Ee.create,se=re.create;It.create;Mt.create;qe.create;const $u=$t.create,Du=it.create;Dt.create;He.create;rt.create;const ju=se({label:y().min(1).max(40),left:y().min(1).max(35),right:y().min(1).max(35)}),Eu=se({id:y().optional().default(()=>`post-${Date.now()}`).transform(n=>n||`post-${Date.now()}`),templateId:y().optional(),category:y().optional().default("TECH"),theme:Du(["blue-tech","emerald-finance","slate-education","dark-contrast","crimson-alert","amber-gold","cyber-violet","sunset-orange","nordic-frost","monochrome-luxe"]).default("blue-tech"),layoutType:y().default("table"),title:y().min(1).max(120),subtitle:y().min(1).max(250),leftHeader:y().optional().default("USA 🇺🇸"),rightHeader:y().optional().default("UK 🇬🇧"),rows:he(ju).optional().default([]),bullets:he(se({highlight:y().optional().default(""),text:y().min(1)})).optional().default([]),bigStat:se({number:y().default("$165,000"),label:y().default("Average Compensation"),subtext:y().optional().default(""),secondaryNumber:y().optional().default(""),secondaryLabel:y().optional().default("")}).optional(),listItems:he(se({rank:mt(),title:y(),value:y(),tag:y().optional().default("")})).optional().default([]),quoteData:se({quote:y(),highlight:y().optional().default(""),source:y().default("Industry Insider")}).optional(),versusData:se({leftEntity:y().optional(),leftStats:he(se({label:y(),value:y()})).optional(),leftPerk:y().optional(),rightEntity:y().optional(),rightStats:he(se({label:y(),value:y()})).optional(),rightPerk:y().optional(),verdict:y().optional()}).optional(),receiptData:se({grossMonthly:y().optional(),items:he(se({label:y(),amount:y(),note:y().optional()})).optional(),totalDeductions:y().optional(),netRemaining:y().optional()}).optional(),timelineData:se({pastYear:y().optional().default("2016"),presentYear:y().optional().default("2026"),items:he(se({label:y(),pastValue:y(),presentValue:y(),changeBadge:y().optional()})).optional(),bottomInsight:y().optional()}).optional(),barchartData:he(se({label:y(),percentage:mt().min(0).max(100),amount:y().optional(),tag:y().optional()})).optional().default([]),leaderboardData:se({calloutNote:y().optional().default("*Asumsi kurs : Rp15.500/US$"),items:he(se({rank:mt(),name:y(),flag:y().optional().default("🌐"),value:y(),percentage:mt().min(0).max(100).optional()})).optional()}).optional(),editorialData:se({badge:y().optional().default("INVESTIGASI KHUSUS"),highlightPhrase:y().optional(),cards:he(se({step:y().optional(),title:y(),text:y(),stat:y().optional()})).optional(),keyTakeaway:y().optional()}).optional(),matrixData:se({headers:he(y()).optional().default(["Indikator","🇮🇩 IDN","🇲🇾 MYS","🇸🇬 SGP"]),rows:he(se({label:y(),values:he(y())})).optional()}).optional(),debateData:se({proTitle:y().optional().default("SISI PRO / BENEFIT"),proScore:y().optional().default("65%"),proPoints:he(y()).optional(),conTitle:y().optional().default("SISI KONTRA / RISIKO"),conScore:y().optional().default("35%"),conPoints:he(y()).optional(),callToAction:y().optional().default("Kalian di tim mana? Tulis pendapatmu di bawah! 👇")}).optional(),tierlistData:he(se({tier:y(),tierColor:y().optional(),items:he(se({name:y(),badge:y().optional(),desc:y().optional()}))})).optional().default([]),customHtml:y().optional(),customCss:y().optional(),customFields:$u(za()).optional(),items:he(za()).optional(),footerNote:y().optional().default("Industry Benchmark 2026"),sourceUrl:y().optional(),methodologyBadge:y().optional(),disclaimer:y().optional(),watermark:y().optional().default("@SocialGen"),bgKeyword:y().optional().default("modern office coding night"),reelsDuration:mt().min(5).max(90).default(30),caption:y().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")}),Ru={class:"h-screen w-screen bg-slate-950 text-slate-100 flex flex-col font-sans selection:bg-sky-500 selection:text-white overflow-hidden"},Pu={class:"h-14 flex-shrink-0 border-b border-slate-800/80 bg-slate-900/60 backdrop-blur sticky top-0 z-30 px-3 sm:px-6 flex items-center justify-between"},Lu={class:"flex items-center gap-2.5 sm:gap-3"},Vu={class:"text-sm font-extrabold tracking-tight text-white flex items-center gap-1.5 sm:gap-2"},Bu={class:"text-[9px] sm:text-[10px] font-bold px-2 py-0.5 rounded-full bg-slate-800 text-slate-300 border border-slate-700"},Ju={class:"flex items-center gap-2 sm:gap-3 text-xs"},Fu={key:0,class:"px-2.5 py-0.5 sm:py-1 rounded-full bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 font-semibold text-[10px] sm:text-[11px]"},Zu={key:1,class:"px-2.5 py-0.5 sm:py-1 rounded-full bg-slate-800 text-slate-400 border border-slate-700 font-semibold text-[10px] sm:text-[11px]"},Hu={class:"lg:hidden flex items-center justify-center px-3 py-2 bg-slate-900/90 border-b border-slate-800 flex-shrink-0"},Uu={class:"grid grid-cols-2 w-full max-w-sm bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold shadow-inner"},zu={key:0,class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"},Gu={class:"flex items-center gap-2"},Ku={key:0,class:"text-emerald-400"},Wu={key:1,class:"text-sky-400"},qu={key:2,class:"text-rose-400"},Yu={class:"flex-1 w-full max-w-[1720px] mx-auto p-2 sm:p-4 grid grid-cols-1 lg:grid-cols-12 gap-4 overflow-hidden min-h-0"},Xu={key:2,class:"lg:hidden fixed bottom-0 left-0 right-0 z-30 h-16 px-4 bg-slate-900/95 backdrop-blur-lg border-t border-slate-800 flex items-center justify-between gap-3 shadow-2xl"},Qu={class:"flex flex-col"},ec={class:"flex items-center gap-1 text-[10px] font-bold text-sky-400"},tc={key:0},ac={key:1},sc={key:2},nc=["disabled"],oc={key:0,class:"animate-spin"},ic={key:1},lc={key:3,class:"lg:hidden fixed inset-0 z-50 bg-slate-950 flex flex-col justify-between overflow-hidden animate-in slide-in-from-bottom"},rc={class:"h-14 px-4 bg-slate-900/95 border-b border-slate-800 flex items-center justify-between shrink-0 shadow-md"},dc={class:"flex-1 overflow-hidden p-2 flex flex-col min-h-0"},uc={class:"h-16 px-4 bg-slate-900/95 border-t border-slate-800 flex items-center justify-between gap-2 shrink-0"},cc=["disabled"],mc=ca({__name:"index",setup(n){const e=S({id:"news-us-germany-salary-divide-2026",category:"TECH REPORT",theme:"blue-tech",layoutType:"news",title:"THE $90,000 TRANSATLANTIC TECH DIVIDE",subtitle:"United States 🇺🇸 vs Germany 🇩🇪 (2026 Real Purchasing Power)",leftHeader:"USA 🇺🇸",rightHeader:"Germany 🇩🇪",rows:[{label:"Junior Dev",left:"$88,000/yr",right:"$52,000/yr"},{label:"Mid-Level",left:"$135,000/yr",right:"$75,000/yr"},{label:"Senior Lead",left:"$180,000/yr",right:"$98,000/yr"},{label:"Effective Tax",left:"24%",right:"42%"},{label:"Paid Vacation",left:"15 Days",right:"30 Days"}],bullets:[{highlight:"Gross Salary Lead",text:"American engineers take home up to 84% higher base compensation."},{highlight:"Work-Life Balance",text:"German labor laws guarantee 30 paid days off with zero expectation of after-hours Slack."},{highlight:"Healthcare Drag",text:"US health insurance deductibles and out-of-pocket costs eat up to $14,000/yr per family."}],bigStat:{number:"$180,000",label:"Senior Tech Base in California",secondaryNumber:"$98,000",secondaryLabel:"Munich Hub",subtext:"The gap widens at senior level, but so does cost of childcare and housing inflation."},listItems:[{rank:1,title:"Switzerland 🇨🇭",value:"$145,000/yr",tag:"Top Net Pay"},{rank:2,title:"United States 🇺🇸",value:"$135,000/yr",tag:"Fast Growth"},{rank:3,title:"Australia 🇦🇺",value:"$98,000/yr",tag:"High Super"},{rank:4,title:"Germany 🇩🇪",value:"$84,000/yr",tag:"Pension Safety"},{rank:5,title:"United Kingdom 🇬🇧",value:"$72,000/yr",tag:"Flexible"}],quoteData:{quote:"Chasing the American gross salary without calculating healthcare deductibles and 50-hour workweeks is the most common financial illusion in global tech.",highlight:"most common financial illusion",source:"Principal Tech Recruiter"},footerNote:"Source: Verified Industry Compensation Survey 2026",watermark:"@SocialGen",bgKeyword:"modern office coding night technology",reelsDuration:30,caption:"Higher gross salary in the US or guaranteed 30 days off in Germany? Which lifestyle would you choose? Drop your vote below! 👇 #techcareers #salary #softwareengineer #worklife"}),s=S({theme:"blue-tech",backgroundSource:"pexels",musicFile:"random",videoStartOffset:0,audioStartOffset:0,outputs:{feed:!0,story:!0,reels:!0}}),i=S([]),l=S(-1),d=S(null);function f(I){if(!e.value||!e.value.title||d.value)return;const h=JSON.stringify(e.value),ee=I?JSON.stringify(I):"";if(h!==ee){d.value=JSON.parse(h);try{localStorage.setItem("sg_unsaved_stash",h)}catch{}}}function c(){if(!d.value)return;const I=d.value.title||"Editan Anda";e.value=JSON.parse(JSON.stringify(d.value)),d.value.theme&&(s.value.theme=d.value.theme),d.value=null,l.value=-1,V.value=-1;try{localStorage.removeItem("sg_unsaved_stash")}catch{}ae(`Editan sebelumnya ("${I.slice(0,24)}...") berhasil dikembalikan! ↩️`,"success")}function C(){d.value=null;try{localStorage.removeItem("sg_unsaved_stash")}catch{}}function w(){try{localStorage.setItem("sg_drafts",JSON.stringify(i.value))}catch{}$fetch("/api/drafts",{method:"POST",body:{drafts:i.value}}).catch(()=>{})}function M(){i.value.unshift(JSON.parse(JSON.stringify(e.value))),l.value=0,V.value=-1,w(),ae("Draft berhasil disimpan!")}function Y(I){const h=i.value[I];if(h){f(h),e.value=JSON.parse(JSON.stringify(h)),h.theme&&(s.value.theme=h.theme),l.value=I,V.value=-1;const ee=!!d.value;ae(`Memuat draft #${I+1}: "${(h.title||"Untitled").slice(0,20)}..."`,"success",ee?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function ue(I){i.value.splice(I,1),l.value===I&&(l.value=-1),w(),ae("Draft dihapus")}const q=S([]),V=S(-1);function D(){try{localStorage.setItem("sg_gen_history",JSON.stringify(q.value))}catch{}$fetch("/api/generation-history",{method:"POST",body:{history:q.value}}).catch(()=>{})}function F(I){const h=q.value[I];if(h){const ee=h.contentData||h;f(ee),e.value=JSON.parse(JSON.stringify(ee)),h.options&&(s.value={...s.value,...h.options}),V.value=I,l.value=-1;const Me=!!d.value;ae(`Memuat riwayat: "${(h.title||"Untitled").slice(0,24)}..."`,"success",Me?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function ce(I){q.value.splice(I,1),V.value===I&&(V.value=-1),D(),ae("Item riwayat dihapus")}function Ce(){q.value=[],V.value=-1,D(),ae("Seluruh riwayat generate berhasil dibersihkan!")}let $e=null;function ge(){try{localStorage.setItem("sg_active_content",JSON.stringify(e.value)),localStorage.setItem("sg_active_options",JSON.stringify(s.value))}catch{}clearTimeout($e),$e=setTimeout(()=>{$fetch("/api/last-session",{method:"POST",body:{content:e.value,options:s.value}}).catch(()=>{})},1e3)}ke(()=>e.value,ge,{deep:!0}),ke(()=>s.value,ge,{deep:!0});const X=S(!1),K=S(!1),oe=S(""),W=S(null),we=S(""),ne=S("success"),Q=S("editor"),ie=S(!1),U=S(null);pa(async()=>{try{const I=localStorage.getItem("sg_active_content");if(I){const h=JSON.parse(I);h&&h.title&&(e.value=h)}else{const h=await $fetch("/api/last-session");h?.session?.content&&(e.value=h.session.content,h.session.options&&(s.value={...s.value,...h.session.options}))}}catch{}try{const I=localStorage.getItem("sg_active_options");if(I){const h=JSON.parse(I);h&&(s.value={...s.value,...h})}}catch{}try{const I=await $fetch("/api/drafts");if(I?.drafts&&Array.isArray(I.drafts)&&I.drafts.length>0)i.value=I.drafts;else{const h=localStorage.getItem("sg_drafts");if(h){const ee=JSON.parse(h);Array.isArray(ee)&&ee.length>0&&(i.value=ee,$fetch("/api/drafts",{method:"POST",body:{drafts:ee}}).catch(()=>{}))}}}catch{const I=localStorage.getItem("sg_drafts");if(I)try{i.value=JSON.parse(I)}catch{}}try{const I=await $fetch("/api/generation-history");if(I?.history&&Array.isArray(I.history)&&I.history.length>0)q.value=I.history;else{const h=localStorage.getItem("sg_gen_history");h&&(q.value=JSON.parse(h))}}catch{}try{const I=await $fetch("/api/status");U.value=I}catch{}try{const I=localStorage.getItem("sg_unsaved_stash");I&&(d.value=JSON.parse(I))}catch{}});const ve=be(()=>{const I=Eu.safeParse(e.value);if(I.success)return{isValid:!0,error:""};{const h=I.error.errors[0];return{isValid:!1,error:`${h.path.join(".")}: ${h.message}`}}}),te=S(null);let _e=null;function ae(I,h="success",ee){clearTimeout(_e),we.value=I,ne.value=h,te.value=ee||null,_e=setTimeout(()=>{we.value="",te.value=null},ee?7e3:4e3)}async function N(I,h,ee,Me){K.value=!0,oe.value=`AI Research (${ee||"Gemini"})...`;try{const B=await $fetch("/api/auto-topic",{method:"POST",body:{niche:I,layoutType:h,model:ee,language:Me}});if(B?.dataset){f(B.dataset),e.value=B.dataset,s.value.theme=B.dataset.theme,i.value.unshift(B.dataset),l.value=0,w();const Be=!!d.value;B.source==="gemini"?ae(`✨ [${B.modelUsed||"Gemini"}] Berhasil meriset: "${B.dataset.title.slice(0,32)}..."`,"success",Be?{label:"↩️ Kembalikan Editan",onClick:c}:void 0):ae(`ℹ️ [Curated Data] Topik siap: "${B.dataset.title.slice(0,32)}..."`,"success",Be?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}catch(B){ae("Gagal auto-topic: "+(B.data?.statusMessage||B.message),"error")}finally{K.value=!1,oe.value=""}}async function ze(){if(!ve.value.isValid){ae("Data tidak valid: "+ve.value.error,"error");return}X.value=!0,oe.value="Rendering Images & Reels...",W.value=null;const I={id:e.value.id||String(Date.now()),title:e.value.title||"Untitled Creation",layoutType:e.value.layoutType||"table",category:e.value.category||"GENERAL",theme:e.value.theme||"blue-tech",generatedAt:new Date().toISOString(),contentData:JSON.parse(JSON.stringify(e.value)),options:JSON.parse(JSON.stringify(s.value))};q.value.unshift(I),V.value=0,D(),Q.value="preview";try{const h=await $fetch("/api/generate",{method:"POST",body:{data:e.value,options:s.value}});h?.success&&(W.value=h,ae(`✅ Generate selesai! Berhasil dirender dalam ${(h.durationMs/1e3).toFixed(1)} detik.`,"success"))}catch(h){ae("Gagal render: "+(h.data?.statusMessage||h.message),"error")}finally{X.value=!1,oe.value=""}}return(I,h)=>{const ee=hd,Me=ou;return p(),m("div",Ru,[t("header",Pu,[t("div",Lu,[h[16]||(h[16]=t("div",{class:"w-8 h-8 rounded-xl bg-gradient-to-tr from-sky-500 via-indigo-600 to-purple-600 flex items-center justify-center font-black text-white shadow-md shadow-sky-500/20 text-xs"}," SG ",-1)),t("div",null,[t("h1",Vu,[h[15]||(h[15]=J(" SocialGen ",-1)),t("span",Bu," v"+x(o(U)?.version||"2.3.7"),1)])])]),t("div",Ju,[o(U)?.geminiActive?(p(),m("span",Fu," ● AI Connected ")):(p(),m("span",Zu," ● Local Engine "))])]),t("div",Hu,[t("div",Uu,[t("button",{onClick:h[0]||(h[0]=B=>Q.value="editor"),class:j(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",o(Q)==="editor"?"bg-sky-500 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[...h[17]||(h[17]=[t("span",null,"⚙️ Studio & Editor",-1)])],2),t("button",{onClick:h[1]||(h[1]=B=>Q.value="preview"),class:j(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",o(Q)==="preview"?"bg-indigo-600 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[h[18]||(h[18]=t("span",null,"👁️ Live Preview",-1)),o(W)?(p(),m("span",zu)):$("",!0)],2)])]),o(we)?(p(),m("div",{key:0,class:j(["fixed bottom-20 lg:bottom-6 right-4 lg:right-6 z-50 flex items-center gap-3 px-4 py-3 rounded-2xl shadow-2xl text-xs font-bold border transition-all max-w-[90vw]",o(ne)==="success"?"bg-slate-900 text-slate-100 border-sky-500/50 shadow-sky-950/50":o(ne)==="info"?"bg-slate-900 text-sky-200 border-indigo-500/50 shadow-indigo-950/50":"bg-rose-950 text-rose-200 border-rose-500/50"])},[t("div",Gu,[o(ne)==="success"?(p(),m("span",Ku,"●")):o(ne)==="info"?(p(),m("span",Wu,"ℹ️")):(p(),m("span",qu,"⚠️")),t("span",null,x(o(we)),1)]),o(te)?(p(),m("button",{key:0,onClick:h[2]||(h[2]=()=>{o(te)?.onClick(),we.value="",te.value=null}),class:"px-2.5 py-1 bg-sky-500 hover:bg-sky-400 text-white font-extrabold rounded-lg shadow transition text-[11px] flex items-center gap-1 active:scale-95"},x(o(te).label),1)):$("",!0),t("button",{onClick:h[3]||(h[3]=B=>{we.value="",te.value=null}),class:"text-slate-400 hover:text-white transition ml-1 text-xs"}," ✕ ")],2)):$("",!0),t("main",Yu,[t("section",{class:j(["lg:col-span-5 h-full overflow-y-auto pr-1 flex-col gap-3 custom-scrollbar",o(Q)==="editor"?"flex":"hidden lg:flex"])},[k(ee,{modelValue:o(e),"onUpdate:modelValue":h[4]||(h[4]=B=>Pe(e)?e.value=B:null),options:o(s),"onUpdate:options":h[5]||(h[5]=B=>Pe(s)?s.value=B:null),"is-valid":o(ve).isValid,"validation-error":o(ve).error,"is-generating":o(X),"generate-stage":o(oe),"is-auto-topic-loading":o(K),drafts:o(i),"active-draft-index":o(l),history:o(q),"active-history-index":o(V),"unsaved-stash":o(d),onGenerate:ze,onAutoTopic:N,onSelectDraft:Y,onDeleteDraft:ue,onSaveDraft:M,onSelectHistory:F,onDeleteHistory:ce,onClearAllHistory:Ce,onRestoreStash:c,onClearStash:C,onToast:h[6]||(h[6]=(B,Be)=>ae(B,Be))},null,8,["modelValue","options","is-valid","validation-error","is-generating","generate-stage","is-auto-topic-loading","drafts","active-draft-index","history","active-history-index","unsaved-stash"])],2),t("section",{class:j(["lg:col-span-7 h-full flex-col gap-3 overflow-hidden justify-between min-h-0",o(Q)==="preview"?"flex":"hidden lg:flex"])},[k(Me,{data:o(e),"selected-video":o(s).backgroundSource,"selected-music":o(s).musicFile,"video-start-offset":o(s).videoStartOffset,"onUpdate:videoStartOffset":h[7]||(h[7]=B=>o(s).videoStartOffset=B),"audio-start-offset":o(s).audioStartOffset,"onUpdate:audioStartOffset":h[8]||(h[8]=B=>o(s).audioStartOffset=B),"is-generating":o(X),"generate-stage":o(oe)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","is-generating","generate-stage"])],2)]),o(Q)==="editor"?(p(),m("button",{key:1,onClick:h[9]||(h[9]=B=>ie.value=!0),type:"button",class:"lg:hidden fixed bottom-20 right-4 z-40 px-4 py-2.5 rounded-full bg-gradient-to-r from-sky-500 to-indigo-600 hover:from-sky-400 hover:to-indigo-500 text-white font-black text-xs shadow-2xl border border-sky-400/40 flex items-center gap-1.5 active:scale-95 transition"},[...h[19]||(h[19]=[t("span",{class:"text-sm"},"👁️",-1),t("span",null,"Intip Canvas",-1)])])):$("",!0),o(Q)==="editor"?(p(),m("div",Xu,[t("div",Qu,[h[20]||(h[20]=t("span",{class:"text-[9px] font-bold text-slate-400 uppercase tracking-wider"},"Output",-1)),t("div",ec,[o(s).outputs?.feed!==!1?(p(),m("span",tc,"Feed")):$("",!0),o(s).outputs?.feed!==!1&&o(s).outputs?.reels!==!1?(p(),m("span",ac,"•")):$("",!0),o(s).outputs?.reels!==!1?(p(),m("span",sc,"Reels")):$("",!0)])]),t("button",{onClick:ze,disabled:o(X)||!o(ve).isValid,type:"button",class:"flex-1 py-3 px-4 rounded-2xl bg-gradient-to-r from-sky-500 to-indigo-600 hover:from-sky-400 hover:to-indigo-500 text-white font-black text-xs tracking-wide shadow-xl shadow-sky-500/25 flex items-center justify-center gap-2 active:scale-95 transition disabled:opacity-50"},[o(X)?(p(),m("span",oc,"🔄")):(p(),m("span",ic,"🚀")),t("span",null,x(o(X)?o(oe)||"Rendering Content...":"GENERATE SEKARANG"),1)],8,nc)])):$("",!0),o(ie)?(p(),m("div",lc,[t("div",rc,[h[22]||(h[22]=t("div",{class:"flex items-center gap-2"},[t("span",{class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"}),t("span",{class:"text-xs font-black text-white"},"Preview Canvas Penuh")],-1)),t("button",{onClick:h[10]||(h[10]=B=>ie.value=!1),type:"button",class:"px-3 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-slate-200 border border-slate-700 flex items-center gap-1 active:scale-95 transition"},[...h[21]||(h[21]=[t("span",null,"✕ Tutup Preview",-1)])])]),t("div",dc,[k(Me,{data:o(e),"selected-video":o(s).backgroundSource,"selected-music":o(s).musicFile,"video-start-offset":o(s).videoStartOffset,"onUpdate:videoStartOffset":h[11]||(h[11]=B=>o(s).videoStartOffset=B),"audio-start-offset":o(s).audioStartOffset,"onUpdate:audioStartOffset":h[12]||(h[12]=B=>o(s).audioStartOffset=B),"is-generating":o(X),"generate-stage":o(oe)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","is-generating","generate-stage"])]),t("div",uc,[t("button",{onClick:h[13]||(h[13]=B=>ie.value=!1),type:"button",class:"flex-1 py-2.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-slate-200 active:scale-95 transition"}," ✏️ Lanjut Edit Form "),t("button",{onClick:h[14]||(h[14]=()=>{ie.value=!1,ze()}),disabled:o(X)||!o(ve).isValid,type:"button",class:"flex-1 py-2.5 rounded-xl bg-gradient-to-r from-sky-500 to-indigo-600 text-xs font-bold text-white shadow-lg active:scale-95 transition disabled:opacity-50"}," 🚀 Langsung Render ",8,cc)])])):$("",!0)])}}});export{mc as default};
|