@socialgen_user/socialgen 2.3.2 → 2.3.4
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/{0RIjmg7W.js → BtKmsB9q.js} +2 -2
- package/.output/public/_nuxt/C9XqBRXJ.js +54 -0
- package/.output/public/_nuxt/{DRusTTlf.js → CM-UI5hL.js} +2 -2
- package/.output/public/_nuxt/{iVjTAqAc.js → CQXr302O.js} +1 -1
- package/.output/public/_nuxt/{BLan0KCi.js → Dgl4noWn.js} +1 -1
- package/.output/public/_nuxt/{CF_CSrzv.js → DwUTbHJ_.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/980cc751-3dff-4a66-8e0b-7f65f4e7ac90.json +1 -0
- package/.output/public/_nuxt/{CDx9Plzv.js → ywBICWor.js} +1 -1
- package/.output/server/chunks/_/nitro.mjs +117 -117
- package/.output/server/chunks/_/templates.mjs +60 -40
- package/.output/server/chunks/_/templates.mjs.map +1 -1
- package/.output/server/chunks/build/{TableCard-vnBDCQSP.mjs → TableCard-0mU9UOj0.mjs} +85 -80
- package/.output/server/chunks/build/TableCard-0mU9UOj0.mjs.map +1 -0
- package/.output/server/chunks/build/{_mode_-CLm1JEXx.mjs → _mode_-CU43fOkL.mjs} +2 -2
- package/.output/server/chunks/build/{_mode_-CLm1JEXx.mjs.map → _mode_-CU43fOkL.mjs.map} +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs.map +1 -1
- package/.output/server/chunks/build/entry-styles.Dh7WksUb.mjs +8 -0
- package/.output/server/chunks/build/entry-styles.Dh7WksUb.mjs.map +1 -0
- package/.output/server/chunks/build/{pages-DE_FiRQK.mjs → pages-BU0ozIwn.mjs} +3 -3
- package/.output/server/chunks/build/{pages-DE_FiRQK.mjs.map → pages-BU0ozIwn.mjs.map} +1 -1
- package/.output/server/chunks/build/server.mjs +2 -2
- package/.output/server/chunks/build/styles.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/data/history.json +21 -0
- package/data/history_generations.json +176 -1
- package/data/last_session.json +49 -29
- package/data/templates.json +2 -2
- package/package.json +1 -1
- package/.output/public/_nuxt/CbpyshRE.js +0 -49
- package/.output/public/_nuxt/builds/meta/4729b4e7-c7d1-47ef-b244-7712fdcd0b03.json +0 -1
- package/.output/server/chunks/build/TableCard-vnBDCQSP.mjs.map +0 -1
- package/.output/server/chunks/build/entry-styles.CkucDgkd.mjs +0 -8
- package/.output/server/chunks/build/entry-styles.CkucDgkd.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as Mt,d as Vt,i as S,M as xe,o as Bt,A as f,B as g,l,C as a,E as A,G as z,D as y,N as E,O as le,P as ke,Q as lt,R as dt,S as Ae,T as Ne,U as Ie,V as At,W as H,X as Be,m as ce,c as Ba,Y as Za,Z as Qt}from"./DRusTTlf.js";import{_ as Ua}from"./CbpyshRE.js";const Ja=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var ut={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 Fa=({size:s,strokeWidth:e=2,absoluteStrokeWidth:t,color:n,iconNode:r,name:o,class:p,...c},{slots:w})=>Mt("svg",{...ut,width:s||ut.width,height:s||ut.height,stroke:n||ut.stroke,"stroke-width":t?Number(e)*24/Number(s):e,class:["lucide",`lucide-${Ja(o??"icon")}`],...c},[...r.map(b=>Mt(...b)),...w.default?[w.default()]:[]]);const J=(s,e)=>(t,{slots:n})=>Mt(Fa,{...t,iconNode:e,name:s},n);const ea=J("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);const Fe=J("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Ha=J("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 za=J("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const ta=J("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ga=J("CodeIcon",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const mt=J("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 Ka=J("DownloadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const aa=J("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 _a=J("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 Wa=J("FolderOpenIcon",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);const qa=J("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 sa=J("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=J("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 Ya=J("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 ct=J("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 Ta=J("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Nt=J("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Xa=J("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 Ca=J("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 Dt=J("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 na=J("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 Qa=J("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 ia=J("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 pt=J("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 ra=J("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 es=J("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 ts=J("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 as=J("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 It=J("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const ss=J("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 ns=J("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"}]]),is={class:"flex flex-col gap-3 text-slate-100"},rs={key:0,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},os={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"},ls={class:"flex items-center justify-between pb-3 border-b border-slate-800"},ds={class:"text-sm font-black text-white flex items-center gap-2"},us={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"},ps={class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},ms={class:"flex flex-col gap-2"},fs={class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},hs={class:"flex flex-col gap-2 max-h-[220px] overflow-y-auto pr-1 custom-scrollbar"},xs={class:"flex-1"},vs={class:"flex items-center gap-2 mb-1"},gs={class:"font-extrabold text-white text-xs"},ys={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-slate-800 text-slate-300 border border-slate-700"},bs={class:"text-[11px] text-slate-400 leading-snug"},ks={class:"flex items-center gap-1"},ws=["onClick"],_s=["onClick"],Ss={key:1,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Ts={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]"},Cs={class:"flex items-center justify-between pb-3 border-b border-slate-800"},As={class:"text-sm font-black text-white flex items-center gap-2"},Ns={class:"flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px] flex-wrap"},Is={class:"text-white font-semibold"},Os={class:"text-white font-semibold"},Ms={class:"text-white font-semibold"},Ds={class:"text-purple-400 font-bold"},$s={class:"relative flex-1 min-h-[220px]"},js=["value"],Rs={class:"flex items-center justify-between pt-2 border-t border-slate-800"},Es={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"},Ls={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Ps={class:"text-sm font-black text-white flex items-center gap-2"},Vs={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800"},Bs={class:"flex items-center gap-1"},Zs={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"},Us={key:0,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-2.5 custom-scrollbar min-h-[300px]"},Js={key:0,class:"text-center py-12 text-slate-500 text-xs"},Fs={class:"flex-1 min-w-0"},Hs={class:"flex items-center gap-2 mb-1 flex-wrap"},zs={class:"font-extrabold text-white text-xs"},Gs={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-sky-950 text-sky-300 border border-sky-800"},Ks={class:"text-[9px] text-slate-500 font-mono"},Ws={class:"text-[11px] text-slate-400 leading-snug line-clamp-2"},qs={class:"flex items-center gap-1.5 flex-shrink-0 self-end sm:self-center"},Ys=["onClick"],Xs=["onClick"],Qs=["onClick"],en=["onClick"],tn={key:1,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-3 custom-scrollbar min-h-[350px]"},an={key:0,class:"p-2 rounded-xl bg-rose-950/60 border border-rose-500/50 text-rose-300 text-[11px] font-semibold"},sn={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"},nn={class:"flex items-center gap-2 min-w-0"},rn={class:"p-1 rounded-lg bg-amber-500/20 text-amber-400 shrink-0"},on={class:"min-w-0"},ln={class:"font-extrabold text-white text-xs flex items-center gap-1.5 truncate"},dn={class:"text-amber-300 truncate"},un={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"},pn={class:"flex flex-col sm:flex-row sm:items-center justify-between gap-2"},mn={class:"flex items-center gap-1.5 shrink-0"},fn={key:0,class:"mt-1 flex flex-col gap-2 p-2.5 rounded-xl bg-slate-950/90 border border-sky-500/40"},hn={class:"flex justify-end gap-2"},xn={class:"grid grid-cols-1 sm:grid-cols-3 gap-2.5"},vn=["disabled"],gn={class:"grid grid-cols-1 sm:grid-cols-2 gap-2.5"},yn=["value"],bn={key:2,class:"flex flex-col gap-2.5 p-3 rounded-2xl bg-slate-950/80 border border-sky-500/30"},kn={class:"flex items-center justify-between"},wn={class:"text-[11px] font-black text-sky-400 flex items-center gap-1"},_n={class:"flex items-center justify-end gap-2 pt-2 border-t border-slate-800"},Sn={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"},Tn={class:"text-xs font-black text-white flex items-center gap-2"},Cn={class:"flex items-center gap-1.5 flex-wrap"},An={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 mr-1.5 shadow-inner"},Nn=["value"],In={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"},On=["disabled"],Mn={class:"relative group"},Dn={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"},$n={class:"px-3 py-1.5"},jn={class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase flex items-center justify-between"},Rn={class:"text-[9px] text-sky-400"},En={class:"max-h-60 overflow-y-auto custom-scrollbar flex flex-col"},Ln=["onClick"],Pn={class:"truncate"},Vn={key:0,class:"text-[8px] px-1 py-0.2 rounded bg-purple-500/20 text-purple-300 ml-1"},Bn={key:3,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"},Zn={class:"w-6 h-6 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0"},Un={class:"text-[11px]"},Jn={class:"font-extrabold text-white flex items-center gap-2"},Fn={class:"text-[9px] px-1.5 py-0.2 rounded bg-sky-500/30 text-sky-200 border border-sky-400/30"},Hn={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-semibold"},zn={class:"flex items-center gap-1"},Gn={class:"flex items-center gap-1.5"},Kn={key:4,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"},Wn={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"},qn={class:"flex items-center gap-2 min-w-0"},Yn={class:"truncate"},Xn={class:"text-[11px] text-amber-100 font-semibold truncate block"},Qn={class:"flex items-center gap-1.5 flex-shrink-0"},ei={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},ti=["onClick"],ai={class:"flex-1 pr-2"},si={class:"flex items-center gap-1.5 mb-0.5"},ni={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"},ii={class:"text-[9px] text-slate-400 font-semibold"},ri={class:"font-bold text-[11px] truncate text-slate-100"},oi=["onClick"],li={key:5,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"},di={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"},ui={class:"flex items-center gap-2 min-w-0"},ci={class:"truncate"},pi={class:"text-[11px] text-purple-100 font-semibold truncate block"},mi={class:"flex items-center gap-1.5 flex-shrink-0"},fi={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},hi=["onClick"],xi={class:"flex-1 pr-2"},vi={class:"flex items-center gap-1.5 mb-0.5"},gi={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"},yi={class:"text-[9px] text-slate-400 font-semibold"},bi={key:0,class:"text-[9px] text-slate-500 font-mono ml-auto"},ki={class:"font-bold text-[11px] truncate text-slate-100"},wi=["onClick"],_i={key:6,class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl overflow-hidden shadow-lg"},Si={class:"grid grid-cols-2 gap-2 p-2.5 bg-slate-950/70 border-b border-slate-800 text-xs"},Ti={class:"flex items-center justify-between mb-1"},Ci={class:"text-[10px] font-bold text-slate-300 flex items-center gap-1"},Ai=["value"],Ni=["value"],Ii=["value"],Oi={class:"col-span-2 grid grid-cols-3 gap-2 pt-1 border-t border-slate-800/60 mt-1"},Mi={class:"col-span-1"},Di=["value"],$i={class:"col-span-2"},ji=["value"],Ri={class:"flex items-center justify-between px-3 py-1.5 bg-slate-950/50 border-b border-slate-800"},Ei={class:"flex items-center gap-2 text-xs"},Li={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"},Pi={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"},Vi={class:"flex items-center gap-2"},Bi={key:0},Zi={class:"underline"},Ui={class:"font-mono text-[10px]"},Ji={key:1},Fi={class:"font-mono text-[10px]"},Hi={class:"flex items-center gap-1.5 shrink-0"},zi={class:"relative p-2"},Gi=["value"],Ki={key:0,class:"text-[10px] text-rose-400 mt-1 px-1"},Wi={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-lg text-xs"},qi={class:"flex flex-col gap-1.5"},Yi={class:"flex items-center justify-between gap-2"},Xi={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},Qi={class:"flex items-center gap-1.5"},er=["value"],tr=["value"],ar=["disabled"],sr={class:"hidden sm:inline"},nr={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},ir={class:"flex items-center gap-1 text-sky-300 font-mono"},rr=["max","value"],or={class:"flex flex-col gap-1.5 pt-1.5 border-t border-slate-800"},lr={class:"flex items-center justify-between gap-2"},dr={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},ur={class:"flex items-center gap-1.5"},cr=["value"],pr=["value"],mr=["disabled"],fr={class:"hidden sm:inline"},hr={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},xr={class:"flex items-center gap-1 text-purple-300 font-mono"},vr=["max","value"],gr={class:"flex items-center justify-between pt-1.5 border-t border-slate-800"},yr={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},br={class:"flex items-center gap-1.5 flex-wrap justify-end"},kr=["onClick"],wr={class:"grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"},_r=["checked"],Sr=["checked"],Tr=["checked"],Cr=["disabled"],Ar=Vt({__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(s,{emit:e}){const t=s,n=e,r=S(""),o=S(t.modelValue?.templateId||t.modelValue?.layoutType||"table"),p=S(!0),c=S(""),w=S(""),b=S("gemini-3.8-flash"),O=S("editor");function de(){n("restoreStash"),O.value="editor"}const K=S([]),$=S("tech"),M=S(!1),Z=S(null),P=S({id:"",name:"",theme:"blue-tech",description:""});async function ve(){try{const u=await $fetch("/api/niches");u?.niches&&u.niches.length>0&&(K.value=u.niches,K.value.some(i=>i.id===$.value)||($.value=K.value[0].id))}catch(u){console.error("Failed to load niches:",u)}}function De(){Z.value=null,P.value={id:"",name:"",theme:t.modelValue.theme||"blue-tech",description:""},M.value=!0}function ue(u){Z.value=u.id,P.value={id:u.id,name:u.name,theme:u.theme||"blue-tech",description:u.description}}async function oe(){if(!P.value.name.trim()){alert("Nama Niche wajib diisi");return}const i={id:Z.value||P.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"_"),name:P.value.name.trim(),theme:P.value.theme,description:P.value.description.trim()||`Fokus pada topik ${P.value.name.trim()}`};try{const d=await $fetch("/api/niches",{method:"POST",body:i});d?.niches&&(K.value=d.niches,$.value=i.id,Z.value=null,P.value={id:"",name:"",theme:"blue-tech",description:""})}catch(d){alert("Gagal menyimpan niche: "+(d.data?.statusMessage||d.message))}}async function re(u){if(K.value.length<=1){alert("Minimal harus ada 1 niche tersisa.");return}if(confirm("Hapus niche ini?"))try{const i=await $fetch(`/api/niches?id=${u}`,{method:"DELETE"});i?.niches&&(K.value=i.niches,$.value===u&&($.value=i.niches[0].id),Z.value===u&&(Z.value=null))}catch(i){alert("Gagal menghapus niche: "+(i.data?.statusMessage||i.message))}}const X=S("id"),G=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:""}]),me=S(!1),ne=S("list"),F=S(null),q=S(""),te=S(""),fe=S(!1),_e=S(!1),Q=S(""),I=S({id:"",name:"",category:"Kustom",description:"",layoutType:"custom",customHtml:"",customCss:"",promptDirective:"",sampleJsonText:""});async function qe(){try{const u=await $fetch("/api/templates");u?.templates&&u.templates.length>0&&(G.value=u.templates)}catch(u){console.error("Failed to load templates:",u)}}function N(u="list"){ne.value=u,te.value="",u==="form"&&V(),me.value=!0}function h(){V(),te.value="",ne.value="form"}function Y(){V(),te.value="",ne.value="list"}function Te(){me.value=!1,V(),te.value="",ne.value="list"}function V(){F.value=null,I.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">
|
|
1
|
+
import{h as Mt,d as Vt,i as S,M as xe,o as Bt,A as f,B as g,l,C as a,E as A,G as z,D as y,N as E,O as le,P as ke,Q as lt,R as dt,S as Ae,T as Ne,U as Ie,V as At,W as H,X as Be,m as ce,c as Ba,Y as Za,Z as Qt}from"./CM-UI5hL.js";import{_ as Ua}from"./C9XqBRXJ.js";const Ja=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var ut={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 Fa=({size:s,strokeWidth:e=2,absoluteStrokeWidth:t,color:n,iconNode:r,name:o,class:p,...c},{slots:w})=>Mt("svg",{...ut,width:s||ut.width,height:s||ut.height,stroke:n||ut.stroke,"stroke-width":t?Number(e)*24/Number(s):e,class:["lucide",`lucide-${Ja(o??"icon")}`],...c},[...r.map(b=>Mt(...b)),...w.default?[w.default()]:[]]);const J=(s,e)=>(t,{slots:n})=>Mt(Fa,{...t,iconNode:e,name:s},n);const ea=J("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);const Fe=J("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Ha=J("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 za=J("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const ta=J("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ga=J("CodeIcon",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const mt=J("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 Ka=J("DownloadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const aa=J("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 _a=J("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 Wa=J("FolderOpenIcon",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);const qa=J("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 sa=J("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=J("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 Ya=J("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 ct=J("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 Ta=J("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Nt=J("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Xa=J("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 Ca=J("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 Dt=J("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 na=J("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 Qa=J("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 ia=J("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 pt=J("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 ra=J("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 es=J("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 ts=J("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 as=J("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 It=J("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const ss=J("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 ns=J("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"}]]),is={class:"flex flex-col gap-3 text-slate-100"},rs={key:0,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},os={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"},ls={class:"flex items-center justify-between pb-3 border-b border-slate-800"},ds={class:"text-sm font-black text-white flex items-center gap-2"},us={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"},ps={class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},ms={class:"flex flex-col gap-2"},fs={class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},hs={class:"flex flex-col gap-2 max-h-[220px] overflow-y-auto pr-1 custom-scrollbar"},xs={class:"flex-1"},vs={class:"flex items-center gap-2 mb-1"},gs={class:"font-extrabold text-white text-xs"},ys={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-slate-800 text-slate-300 border border-slate-700"},bs={class:"text-[11px] text-slate-400 leading-snug"},ks={class:"flex items-center gap-1"},ws=["onClick"],_s=["onClick"],Ss={key:1,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Ts={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]"},Cs={class:"flex items-center justify-between pb-3 border-b border-slate-800"},As={class:"text-sm font-black text-white flex items-center gap-2"},Ns={class:"flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px] flex-wrap"},Is={class:"text-white font-semibold"},Os={class:"text-white font-semibold"},Ms={class:"text-white font-semibold"},Ds={class:"text-purple-400 font-bold"},$s={class:"relative flex-1 min-h-[220px]"},js=["value"],Rs={class:"flex items-center justify-between pt-2 border-t border-slate-800"},Es={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"},Ls={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Ps={class:"text-sm font-black text-white flex items-center gap-2"},Vs={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800"},Bs={class:"flex items-center gap-1"},Zs={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"},Us={key:0,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-2.5 custom-scrollbar min-h-[300px]"},Js={key:0,class:"text-center py-12 text-slate-500 text-xs"},Fs={class:"flex-1 min-w-0"},Hs={class:"flex items-center gap-2 mb-1 flex-wrap"},zs={class:"font-extrabold text-white text-xs"},Gs={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-sky-950 text-sky-300 border border-sky-800"},Ks={class:"text-[9px] text-slate-500 font-mono"},Ws={class:"text-[11px] text-slate-400 leading-snug line-clamp-2"},qs={class:"flex items-center gap-1.5 flex-shrink-0 self-end sm:self-center"},Ys=["onClick"],Xs=["onClick"],Qs=["onClick"],en=["onClick"],tn={key:1,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-3 custom-scrollbar min-h-[350px]"},an={key:0,class:"p-2 rounded-xl bg-rose-950/60 border border-rose-500/50 text-rose-300 text-[11px] font-semibold"},sn={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"},nn={class:"flex items-center gap-2 min-w-0"},rn={class:"p-1 rounded-lg bg-amber-500/20 text-amber-400 shrink-0"},on={class:"min-w-0"},ln={class:"font-extrabold text-white text-xs flex items-center gap-1.5 truncate"},dn={class:"text-amber-300 truncate"},un={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"},pn={class:"flex flex-col sm:flex-row sm:items-center justify-between gap-2"},mn={class:"flex items-center gap-1.5 shrink-0"},fn={key:0,class:"mt-1 flex flex-col gap-2 p-2.5 rounded-xl bg-slate-950/90 border border-sky-500/40"},hn={class:"flex justify-end gap-2"},xn={class:"grid grid-cols-1 sm:grid-cols-3 gap-2.5"},vn=["disabled"],gn={class:"grid grid-cols-1 sm:grid-cols-2 gap-2.5"},yn=["value"],bn={key:2,class:"flex flex-col gap-2.5 p-3 rounded-2xl bg-slate-950/80 border border-sky-500/30"},kn={class:"flex items-center justify-between"},wn={class:"text-[11px] font-black text-sky-400 flex items-center gap-1"},_n={class:"flex items-center justify-end gap-2 pt-2 border-t border-slate-800"},Sn={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"},Tn={class:"text-xs font-black text-white flex items-center gap-2"},Cn={class:"flex items-center gap-1.5 flex-wrap"},An={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 mr-1.5 shadow-inner"},Nn=["value"],In={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"},On=["disabled"],Mn={class:"relative group"},Dn={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"},$n={class:"px-3 py-1.5"},jn={class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase flex items-center justify-between"},Rn={class:"text-[9px] text-sky-400"},En={class:"max-h-60 overflow-y-auto custom-scrollbar flex flex-col"},Ln=["onClick"],Pn={class:"truncate"},Vn={key:0,class:"text-[8px] px-1 py-0.2 rounded bg-purple-500/20 text-purple-300 ml-1"},Bn={key:3,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"},Zn={class:"w-6 h-6 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0"},Un={class:"text-[11px]"},Jn={class:"font-extrabold text-white flex items-center gap-2"},Fn={class:"text-[9px] px-1.5 py-0.2 rounded bg-sky-500/30 text-sky-200 border border-sky-400/30"},Hn={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-semibold"},zn={class:"flex items-center gap-1"},Gn={class:"flex items-center gap-1.5"},Kn={key:4,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"},Wn={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"},qn={class:"flex items-center gap-2 min-w-0"},Yn={class:"truncate"},Xn={class:"text-[11px] text-amber-100 font-semibold truncate block"},Qn={class:"flex items-center gap-1.5 flex-shrink-0"},ei={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},ti=["onClick"],ai={class:"flex-1 pr-2"},si={class:"flex items-center gap-1.5 mb-0.5"},ni={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"},ii={class:"text-[9px] text-slate-400 font-semibold"},ri={class:"font-bold text-[11px] truncate text-slate-100"},oi=["onClick"],li={key:5,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"},di={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"},ui={class:"flex items-center gap-2 min-w-0"},ci={class:"truncate"},pi={class:"text-[11px] text-purple-100 font-semibold truncate block"},mi={class:"flex items-center gap-1.5 flex-shrink-0"},fi={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},hi=["onClick"],xi={class:"flex-1 pr-2"},vi={class:"flex items-center gap-1.5 mb-0.5"},gi={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"},yi={class:"text-[9px] text-slate-400 font-semibold"},bi={key:0,class:"text-[9px] text-slate-500 font-mono ml-auto"},ki={class:"font-bold text-[11px] truncate text-slate-100"},wi=["onClick"],_i={key:6,class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl overflow-hidden shadow-lg"},Si={class:"grid grid-cols-2 gap-2 p-2.5 bg-slate-950/70 border-b border-slate-800 text-xs"},Ti={class:"flex items-center justify-between mb-1"},Ci={class:"text-[10px] font-bold text-slate-300 flex items-center gap-1"},Ai=["value"],Ni=["value"],Ii=["value"],Oi={class:"col-span-2 grid grid-cols-3 gap-2 pt-1 border-t border-slate-800/60 mt-1"},Mi={class:"col-span-1"},Di=["value"],$i={class:"col-span-2"},ji=["value"],Ri={class:"flex items-center justify-between px-3 py-1.5 bg-slate-950/50 border-b border-slate-800"},Ei={class:"flex items-center gap-2 text-xs"},Li={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"},Pi={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"},Vi={class:"flex items-center gap-2"},Bi={key:0},Zi={class:"underline"},Ui={class:"font-mono text-[10px]"},Ji={key:1},Fi={class:"font-mono text-[10px]"},Hi={class:"flex items-center gap-1.5 shrink-0"},zi={class:"relative p-2"},Gi=["value"],Ki={key:0,class:"text-[10px] text-rose-400 mt-1 px-1"},Wi={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-lg text-xs"},qi={class:"flex flex-col gap-1.5"},Yi={class:"flex items-center justify-between gap-2"},Xi={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},Qi={class:"flex items-center gap-1.5"},er=["value"],tr=["value"],ar=["disabled"],sr={class:"hidden sm:inline"},nr={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},ir={class:"flex items-center gap-1 text-sky-300 font-mono"},rr=["max","value"],or={class:"flex flex-col gap-1.5 pt-1.5 border-t border-slate-800"},lr={class:"flex items-center justify-between gap-2"},dr={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},ur={class:"flex items-center gap-1.5"},cr=["value"],pr=["value"],mr=["disabled"],fr={class:"hidden sm:inline"},hr={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},xr={class:"flex items-center gap-1 text-purple-300 font-mono"},vr=["max","value"],gr={class:"flex items-center justify-between pt-1.5 border-t border-slate-800"},yr={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},br={class:"flex items-center gap-1.5 flex-wrap justify-end"},kr=["onClick"],wr={class:"grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"},_r=["checked"],Sr=["checked"],Tr=["checked"],Cr=["disabled"],Ar=Vt({__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(s,{emit:e}){const t=s,n=e,r=S(""),o=S(t.modelValue?.templateId||t.modelValue?.layoutType||"table"),p=S(!0),c=S(""),w=S(""),b=S("gemini-3.8-flash"),O=S("editor");function de(){n("restoreStash"),O.value="editor"}const K=S([]),$=S("tech"),M=S(!1),Z=S(null),P=S({id:"",name:"",theme:"blue-tech",description:""});async function ve(){try{const u=await $fetch("/api/niches");u?.niches&&u.niches.length>0&&(K.value=u.niches,K.value.some(i=>i.id===$.value)||($.value=K.value[0].id))}catch(u){console.error("Failed to load niches:",u)}}function De(){Z.value=null,P.value={id:"",name:"",theme:t.modelValue.theme||"blue-tech",description:""},M.value=!0}function ue(u){Z.value=u.id,P.value={id:u.id,name:u.name,theme:u.theme||"blue-tech",description:u.description}}async function oe(){if(!P.value.name.trim()){alert("Nama Niche wajib diisi");return}const i={id:Z.value||P.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"_"),name:P.value.name.trim(),theme:P.value.theme,description:P.value.description.trim()||`Fokus pada topik ${P.value.name.trim()}`};try{const d=await $fetch("/api/niches",{method:"POST",body:i});d?.niches&&(K.value=d.niches,$.value=i.id,Z.value=null,P.value={id:"",name:"",theme:"blue-tech",description:""})}catch(d){alert("Gagal menyimpan niche: "+(d.data?.statusMessage||d.message))}}async function re(u){if(K.value.length<=1){alert("Minimal harus ada 1 niche tersisa.");return}if(confirm("Hapus niche ini?"))try{const i=await $fetch(`/api/niches?id=${u}`,{method:"DELETE"});i?.niches&&(K.value=i.niches,$.value===u&&($.value=i.niches[0].id),Z.value===u&&(Z.value=null))}catch(i){alert("Gagal menghapus niche: "+(i.data?.statusMessage||i.message))}}const X=S("id"),G=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:""}]),me=S(!1),ne=S("list"),F=S(null),q=S(""),te=S(""),fe=S(!1),_e=S(!1),Q=S(""),I=S({id:"",name:"",category:"Kustom",description:"",layoutType:"custom",customHtml:"",customCss:"",promptDirective:"",sampleJsonText:""});async function qe(){try{const u=await $fetch("/api/templates");u?.templates&&u.templates.length>0&&(G.value=u.templates)}catch(u){console.error("Failed to load templates:",u)}}function N(u="list"){ne.value=u,te.value="",u==="form"&&V(),me.value=!0}function h(){V(),te.value="",ne.value="form"}function Y(){V(),te.value="",ne.value="list"}function Te(){me.value=!1,V(),te.value="",ne.value="list"}function V(){F.value=null,I.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
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
3
|
<h2 class="text-3xl font-black text-white mb-2 leading-tight">{{ data.title }}</h2>
|
|
4
4
|
<p class="text-lg text-sky-300 font-bold mb-4">{{ data.subtitle }}</p>
|
|
@@ -67,4 +67,4 @@ PANDUAN KRUSIAL PEMBUATAN TEMPLATE VISUAL SOCIALGEN:
|
|
|
67
67
|
Keluarkan HANYA 1 objek JSON valid tanpa markdown formatting (\`\`\`json) agar bisa langsung diimpor otomatis ke aplikasi SocialGen.`),fe.value=!0,setTimeout(()=>{fe.value=!1},3e3)}function wt(){if(te.value="",!!Q.value.trim())try{let u=Q.value.trim();u=u.replace(/^```json\s*/i,"").replace(/```$/i,"").trim();const i=JSON.parse(u);i.name&&(I.value.name=i.name),i.category&&(I.value.category=i.category),i.description&&(I.value.description=i.description),I.value.layoutType=i.layoutType||"custom",i.customHtml&&(I.value.customHtml=i.customHtml),i.customCss&&(I.value.customCss=i.customCss),i.promptDirective&&(I.value.promptDirective=i.promptDirective),i.sampleData&&(i.sampleData.id||(i.sampleData.id=i.id||I.value.id||"sample-"+Date.now()),I.value.sampleJsonText=JSON.stringify(i.sampleData,null,2)),_e.value=!1,Q.value=""}catch(u){te.value="Gagal membaca JSON dari AI: "+u.message}}async function st(){if(te.value="",!I.value.name.trim()){te.value="Nama template wajib diisi";return}const u=F.value||I.value.id.trim()||I.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"-");let i=null;try{i=JSON.parse(I.value.sampleJsonText),i.id||(i.id=u)}catch(d){te.value="JSON Sampel Data tidak valid: "+d.message;return}try{const d=await $fetch("/api/templates",{method:"POST",body:{id:u,name:I.value.name.trim(),category:I.value.category.trim()||"Kustom",description:I.value.description.trim(),layoutType:I.value.layoutType,customHtml:I.value.customHtml?.trim()||void 0,customCss:I.value.customCss?.trim()||void 0,sampleData:i,promptDirective:I.value.promptDirective.trim(),isBuiltin:!!(F.value&&G.value.find(B=>B.id===F.value)?.isBuiltin)}});d?.templates&&(G.value=d.templates),ne.value="list",F.value=null}catch(d){te.value=d.data?.statusMessage||d.message||"Gagal menyimpan template"}}async function _t(u){if(confirm("Yakin ingin menghapus template kustom ini?"))try{const i=await $fetch(`/api/templates?id=${u}`,{method:"DELETE"});i?.templates&&(G.value=i.templates)}catch(i){alert(i.data?.statusMessage||i.message||"Gagal menghapus template")}}function St(u){Tt(u.layoutType==="custom"?u.id:u.layoutType||u.id),me.value=!1}const C=ce(()=>{if(!q.value.trim())return G.value;const u=q.value.toLowerCase();return G.value.filter(i=>i.name.toLowerCase().includes(u)||i.category.toLowerCase().includes(u)||i.description.toLowerCase().includes(u)||i.layoutType.toLowerCase().includes(u))}),v=S(!1),ye=S(""),se=S({}),Ut=S(!1),nt=S(!1),Jt=S(["cyber_blue.mp4","emerald_flow.mp4","default_bg.mp4"]),Ft=S(["synthwave_pulse.mp3","lofi_chill.mp3","default_ambient.mp3"]),it=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}),Ht=ce(()=>{const u=t.options.backgroundSource||"";return it.value[u]||15}),rt=ce(()=>Math.max(1,Ht.value-1)),zt=ce(()=>{const u=t.options.musicFile||"";return it.value[u]||30}),ot=ce(()=>Math.max(1,zt.value-1));xe(()=>t.options.backgroundSource,()=>{const u=rt.value;(t.options.videoStartOffset||0)>u&&Ee("videoStartOffset",u)}),xe(()=>t.options.musicFile,()=>{const u=ot.value;(t.options.audioStartOffset||0)>u&&Ee("audioStartOffset",u)});const Ue=S(!1),Gt=S(null),Kt=S(null);async function Wt(){try{const u=await $fetch("/api/media");u?.videos?.length&&(Jt.value=u.videos),u?.audio?.length&&(Ft.value=u.audio),u?.durations&&(it.value={...it.value,...u.durations})}catch(u){console.error("Failed to fetch media list:",u)}}Bt(()=>{try{const u=localStorage.getItem("sg_selected_language");u&&(X.value=u)}catch{}Wt(),ve(),qe()}),xe(X,u=>{try{localStorage.setItem("sg_selected_language",u)}catch{}});async function qt(u,i){const d=u.target,B=d.files?.[0];if(B){Ue.value=!0;try{const W=new FormData;W.append("file",B);const be=await $fetch("/api/upload-media",{method:"POST",body:W});be?.success&&(await Wt(),be.type==="video"?Ee("backgroundSource",be.filename):Ee("musicFile",be.filename))}catch(W){alert("Upload gagal: "+(W.data?.statusMessage||W.message))}finally{Ue.value=!1,d.value=""}}}const he=ce(()=>{const u=(o.value||"table").trim().toLowerCase();return G.value.find(i=>i.id.toLowerCase()===u||i.layoutType&&i.layoutType.toLowerCase()===u)||G.value[0]}),ge=ce(()=>{const u=r.value.trim();if(!u)return null;try{return JSON.parse(u)}catch{return null}}),Ce=ce(()=>{if(!r.value.trim()||!ge.value)return null;const u=(ge.value.templateId||ge.value.layoutType||(G.value.some(W=>W.id===ge.value?.id)?ge.value?.id:"")||"").trim().toLowerCase();if(!u)return null;const i=(o.value||"").trim().toLowerCase(),d=(he.value?.layoutType||"").trim().toLowerCase();if(u===i||u===d)return null;const B=G.value.find(W=>W.id.toLowerCase()===u||W.layoutType&&W.layoutType.toLowerCase()===u);return{jsonTemplateId:ge.value.templateId||ge.value.layoutType||ge.value.id,matchedTarget:B||null,isKnown:!!B}}),Ye=ce(()=>{if(!r.value.trim()){const u=he.value?.sampleData?JSON.parse(JSON.stringify(he.value.sampleData)):{},i=he.value?.id||"table",d=he.value?.layoutType==="custom"?i:he.value?.layoutType||i;return{...u,id:u.id||i,templateId:i,layoutType:d,customHtml:he.value?.customHtml||void 0,customCss:he.value?.customCss||void 0}}if(ge.value){const u=he.value?.id||ge.value.templateId||"table",i=he.value?.layoutType==="custom"?u:he.value?.layoutType||u;return{...ge.value,templateId:u,layoutType:i,customHtml:he.value?.customHtml||ge.value.customHtml||void 0,customCss:he.value?.customCss||ge.value.customCss||void 0}}return t.modelValue});xe(()=>Ye.value,u=>{n("update:modelValue",u),u.theme&&u.theme!==t.options.theme&&n("update:options",{...t.options,theme:u.theme})},{immediate:!0,deep:!0}),xe(()=>t.modelValue,u=>{if(!u)return;const i=JSON.stringify(Ye.value),d=JSON.stringify(u);if(i!==d){const B=u.templateId||u.layoutType;if(B){const W=G.value.find(be=>be.id.toLowerCase()===B.toLowerCase()||be.layoutType&&be.layoutType.toLowerCase()===B.toLowerCase());W&&(o.value=W.id)}r.value=JSON.stringify(u,null,2)}},{deep:!0}),xe(()=>t.unsavedStash,(u,i)=>{i&&!u&&(O.value="editor")});function Oa(u){const i=u.target;if(r.value=i.value,!i.value.trim()){c.value="";return}try{const d=JSON.parse(i.value);if(c.value="",p.value){const B=(d.templateId||d.layoutType||(G.value.some(W=>W.id===d.id)?d.id:"")||"").trim().toLowerCase();if(B){const W=G.value.find(be=>be.id.toLowerCase()===B||be.layoutType&&be.layoutType.toLowerCase()===B);W&&W.id.toLowerCase()!==o.value.toLowerCase()&&(o.value=W.id,n("toast",`Otomatis pindah ke template ${W.name}`,"success"))}}}catch(d){c.value="Invalid JSON: "+d.message}}function Yt(){r.value="",c.value="",n("toast",`Menggunakan data sampel template ${he.value?.name||""}`,"success")}function Ma(){if(r.value.trim())try{const u=JSON.parse(r.value);r.value=JSON.stringify(u,null,2),c.value=""}catch{c.value="Cannot format invalid JSON"}}function Tt(u){o.value=u}function Da(u){try{const i=r.value.trim()?JSON.parse(r.value):{...Ye.value};i.title=u,r.value=JSON.stringify(i,null,2)}catch{}}function $a(u){try{const i=r.value.trim()?JSON.parse(r.value):{...Ye.value};i.watermark=u,r.value=JSON.stringify(i,null,2)}catch{}}function ja(u){try{const i=r.value.trim()?JSON.parse(r.value):{...Ye.value};i.theme=u,r.value=JSON.stringify(i,null,2)}catch{}n("update:options",{...t.options,theme:u})}function Ra(u){const i={...t.modelValue,reelsDuration:u};n("update:modelValue",i)}function Ee(u,i){n("update:options",{...t.options,[u]:i})}function Ct(u,i){const d=t.options.outputs||{feed:!0,story:!0,reels:!0};n("update:options",{...t.options,outputs:{...d,[u]:i}})}function Xt(u,i){n("autoTopic",$.value,i||w.value||void 0,b.value,X.value)}async function Ea(){v.value=!0,Ut.value=!0;try{const u=await $fetch("/api/copy-prompt",{query:{niche:$.value,layout:t.modelValue.layoutType||"table",language:X.value}});ye.value=u.prompt,se.value={topic:u.topic,pair:u.pair,niche:u.niche,template:u.template,usedCount:u.usedCount,language:u.language||X.value}}catch(u){console.error("Failed to get manual prompt:",u)}finally{Ut.value=!1}}function La(){ye.value&&(navigator.clipboard.writeText(ye.value),nt.value=!0,setTimeout(()=>{nt.value=!1},2500))}function Pa(){t.history.length!==0&&confirm(`Bersihkan semua ${t.history.length} riwayat generate otomatis?`)&&n("clearAllHistory")}function Va(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,i)=>(f(),g("div",is,[l(M)?(f(),g("div",rs,[a("div",os,[a("div",ls,[a("div",null,[a("h3",ds,[A(l(na),{class:"w-4 h-4 text-sky-400"}),i[47]||(i[47]=z(" Kelola & Buat Niche Baru ",-1))]),i[48]||(i[48]=a("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Simpan niche favoritmu. AI dan Prompt Generator akan otomatis menggunakannya. ",-1))]),a("button",{onClick:i[0]||(i[0]=d=>M.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[A(l(It),{class:"w-4 h-4"})])]),a("div",us,[a("div",cs,[a("span",null,y(l(Z)?"✏️ Edit Niche":"➕ Tambah Niche Baru"),1),l(Z)?(f(),g("button",{key:0,onClick:i[1]||(i[1]=d=>{Z.value=null,P.value={id:"",name:"",theme:"blue-tech",description:""}}),class:"text-[10px] text-slate-400 hover:text-white"}," Batal Edit ")):E("",!0)]),a("div",ps,[a("div",null,[i[49]||(i[49]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Niche",-1)),le(a("input",{"onUpdate:modelValue":i[2]||(i[2]=d=>l(P).name=d),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),[[ke,l(P).name]])]),a("div",null,[i[51]||(i[51]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Tema Default",-1)),le(a("select",{"onUpdate:modelValue":i[3]||(i[3]=d=>l(P).theme=d),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"},[...i[50]||(i[50]=[dt('<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),[[lt,l(P).theme]])])]),a("div",null,[i[52]||(i[52]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Fokus Topik & Instruksi Prompt",-1)),le(a("textarea",{"onUpdate:modelValue":i[4]||(i[4]=d=>l(P).description=d),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),[[ke,l(P).description]])]),a("button",{onClick:oe,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"},[A(l(Fe),{class:"w-3.5 h-3.5"}),a("span",null,y(l(Z)?"Perbarui Niche":"Simpan Niche"),1)])]),a("div",ms,[a("div",fs," Daftar Niche Tersimpan ("+y(l(K).length)+") ",1),a("div",hs,[(f(!0),g(Ae,null,Ne(l(K),d=>(f(),g("div",{key:d.id,class:"p-2.5 rounded-xl border bg-slate-950 border-slate-800 flex items-start justify-between gap-2"},[a("div",xs,[a("div",vs,[a("span",gs,y(d.name),1),a("span",ys,y(d.theme||"blue-tech"),1)]),a("p",bs,y(d.description),1)]),a("div",ks,[a("button",{onClick:B=>ue(d),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Edit Niche"},[A(l(ct),{class:"w-3.5 h-3.5"})],8,ws),a("button",{onClick:B=>re(d.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus Niche"},[A(l(pt),{class:"w-3.5 h-3.5"})],8,_s)])]))),128))])])])])):E("",!0),l(v)?(f(),g("div",Ss,[a("div",Ts,[a("div",Cs,[a("div",null,[a("h3",As,[A(l(aa),{class:"w-4 h-4 text-purple-400"}),i[53]||(i[53]=z(" Master Prompt AI (Dynamic Research & Zero-Collision) ",-1))]),i[54]||(i[54]=a("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Salin prompt ini ke ChatGPT / Gemini / Claude / DeepSeek untuk mencari topik terbaru. ",-1))]),a("button",{onClick:i[5]||(i[5]=d=>v.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[A(l(It),{class:"w-4 h-4"})])]),a("div",Ns,[i[55]||(i[55]=a("span",{class:"font-bold text-sky-400"},"Niche Aktif:",-1)),a("span",Is,y(l(K).find(d=>d.id===l($))?.name||"Default"),1),i[56]||(i[56]=a("span",{class:"text-slate-500"},"•",-1)),i[57]||(i[57]=a("span",{class:"font-bold text-amber-400"},"Template:",-1)),a("span",Os,y(l(se).template||"Otomatis"),1),i[58]||(i[58]=a("span",{class:"text-slate-500"},"•",-1)),i[59]||(i[59]=a("span",{class:"font-bold text-emerald-400"},"Bahasa:",-1)),a("span",Ms,y(l(se).language||"Bahasa Indonesia 🇮🇩"),1),i[60]||(i[60]=a("span",{class:"text-slate-500"},"•",-1)),a("span",Ds,y(l(se).usedCount||0)+" Topik Riwayat Dikecualikan",1)]),a("div",$s,[a("textarea",{value:l(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,js)]),a("div",Rs,[i[61]||(i[61]=a("span",{class:"text-[11px] text-slate-400"},[z(" Paste hasil JSON yang kamu buat ke kolom "),a("b",null,"RAW JSON"),z(" SocialGen. ")],-1)),a("button",{onClick:La,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"},[l(nt)?(f(),Ie(l(Fe),{key:0,class:"w-4 h-4 text-emerald-400"})):(f(),Ie(l(mt),{key:1,class:"w-4 h-4"})),a("span",null,y(l(nt)?"Prompt Berhasil Disalin!":"Copy Master Prompt"),1)])])])])):E("",!0),l(me)?(f(),g("div",{key:2,onClick:At(Te,["self"]),class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},[a("div",Es,[a("div",Ls,[a("div",null,[a("h3",Ps,[A(l(sa),{class:"w-4 h-4 text-sky-400"}),i[62]||(i[62]=z(" Kelola Template Visual (Dynamic Template System) ",-1))]),i[63]||(i[63]=a("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Buat format baru, edit sampel tampilan, dan atur prompt AI spesifik per template. ",-1))]),a("button",{onClick:Te,class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[A(l(It),{class:"w-4 h-4"})])]),a("div",Vs,[a("div",Bs,[a("button",{onClick:Y,class:H(["px-3 py-1 rounded-lg transition font-bold text-xs",l(ne)==="list"?"bg-slate-800 text-sky-400 shadow":"text-slate-400 hover:text-white"])}," Daftar Template ("+y(l(G).length)+") ",3),a("button",{onClick:h,class:H(["px-3 py-1 rounded-lg transition font-bold text-xs flex items-center gap-1",l(ne)==="form"&&!l(F)?"bg-slate-800 text-emerald-400 shadow":"text-slate-400 hover:text-white"])},[A(l(Nt),{class:"w-3.5 h-3.5"}),i[64]||(i[64]=a("span",null,"Buat Template Baru",-1))],2),l(F)&&l(ne)==="form"?(f(),g("span",Zs,[A(l(ct),{class:"w-3 h-3"}),i[65]||(i[65]=a("span",null,"Sedang Edit Template",-1))])):E("",!0)]),l(ne)==="list"?le((f(),g("input",{key:0,"onUpdate:modelValue":i[6]||(i[6]=d=>Be(q)?q.value=d: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)),[[ke,l(q)]]):E("",!0)]),l(ne)==="list"?(f(),g("div",Us,[l(C).length===0?(f(),g("div",Js,' Tidak ada template yang cocok dengan pencarian "'+y(l(q))+'". ',1)):E("",!0),(f(!0),g(Ae,null,Ne(l(C),d=>(f(),g("div",{key:d.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"},[a("div",Fs,[a("div",Hs,[a("span",zs,y(d.name),1),a("span",Gs,y(d.category),1),a("span",{class:H(["px-1.5 py-0.2 rounded text-[8px] font-bold uppercase tracking-wider",d.isBuiltin?"bg-slate-800 text-slate-400 border border-slate-700":"bg-purple-950 text-purple-300 border border-purple-800"])},y(d.isBuiltin?"Bawaan":"⭐ Kustom"),3),a("span",Ks," layout: "+y(d.layoutType),1)]),a("p",Ws,y(d.description||"Tidak ada deskripsi."),1)]),a("div",qs,[a("button",{onClick:B=>St(d),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"},[A(l(Fe),{class:"w-3 h-3"}),i[66]||(i[66]=a("span",null,"Pilih Format",-1))],8,Ys),a("button",{onClick:B=>at(d),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Duplikasi sebagai template kustom baru"},[A(l(mt),{class:"w-3.5 h-3.5"})],8,Xs),d.isBuiltin?E("",!0):(f(),g("button",{key:0,onClick:B=>bt(d),class:"p-1.5 rounded-lg text-slate-400 hover:text-amber-300 hover:bg-slate-800 transition",title:"Edit template kustom"},[A(l(ct),{class:"w-3.5 h-3.5"})],8,Qs)),d.isBuiltin?E("",!0):(f(),g("button",{key:1,onClick:B=>_t(d.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus template kustom"},[A(l(pt),{class:"w-3.5 h-3.5"})],8,en))])]))),128))])):(f(),g("div",tn,[l(te)?(f(),g("div",an,y(l(te)),1)):E("",!0),l(F)?(f(),g("div",sn,[a("div",nn,[a("div",rn,[A(l(ct),{class:"w-4 h-4"})]),a("div",on,[a("div",ln,[i[67]||(i[67]=a("span",null,"Sedang Mengedit:",-1)),a("span",dn,y(l(I).name),1)]),a("div",un,"ID: "+y(l(I).id)+" • Perubahan akan memperbarui template yang tersimpan",1)])]),a("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"},[A(l(Nt),{class:"w-3 h-3"}),i[68]||(i[68]=a("span",null,"Beralih ke Buat Baru",-1))])])):E("",!0),a("div",cn,[a("div",pn,[i[70]||(i[70]=a("div",{class:"flex items-center gap-2"},[a("span",{class:"text-xl"},"🤖"),a("div",null,[a("h4",{class:"text-xs font-black text-white"},"Buat Template Otomatis dari Screenshot / Gambar"),a("p",{class:"text-[10px] text-slate-400"},"Punya referensi gambar desain? Salin prompt AI dan kirim bersama screenshot ke ChatGPT / Claude / Gemini.")])],-1)),a("div",mn,[a("button",{onClick:kt,type:"button",class:H(["px-2.5 py-1.5 rounded-xl text-xs font-bold transition flex items-center gap-1.5 shadow",l(fe)?"bg-emerald-600 text-white":"bg-sky-600 hover:bg-sky-500 text-white"])},[A(l(mt),{class:"w-3.5 h-3.5"}),a("span",null,y(l(fe)?"✓ Prompt Tersalin!":"Salin Prompt Bantuan AI"),1)],2),a("button",{onClick:i[7]||(i[7]=d=>_e.value=!l(_e)),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"},[...i[69]||(i[69]=[a("span",null,"📥 Tempel JSON dari AI",-1)])])])]),l(_e)?(f(),g("div",fn,[i[71]||(i[71]=a("label",{class:"text-[10px] font-bold text-sky-400"},"Tempelkan respon JSON dari AI di sini:",-1)),le(a("textarea",{"onUpdate:modelValue":i[8]||(i[8]=d=>Be(Q)?Q.value=d: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),[[ke,l(Q)]]),a("div",hn,[a("button",{onClick:i[9]||(i[9]=d=>_e.value=!1),type:"button",class:"px-2.5 py-1 rounded-lg text-[10px] font-bold text-slate-400 hover:text-white"}," Tutup "),a("button",{onClick:wt,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 ")])])):E("",!0)]),a("div",xn,[a("div",null,[i[72]||(i[72]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"ID Template (Slug Unik)",-1)),le(a("input",{"onUpdate:modelValue":i[10]||(i[10]=d=>l(I).id=d),disabled:!!l(F),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,vn),[[ke,l(I).id]])]),a("div",null,[i[73]||(i[73]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Template",-1)),le(a("input",{"onUpdate:modelValue":i[11]||(i[11]=d=>l(I).name=d),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),[[ke,l(I).name]])]),a("div",null,[i[74]||(i[74]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Kategori",-1)),le(a("input",{"onUpdate:modelValue":i[12]||(i[12]=d=>l(I).category=d),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),[[ke,l(I).category]])])]),a("div",gn,[a("div",null,[i[76]||(i[76]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Base Layout Visual Engine",-1)),a("select",{value:l(I).layoutType,onChange:i[13]||(i[13]=d=>Se(d.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"},[...i[75]||(i[75]=[dt('<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,yn)]),a("div",null,[i[77]||(i[77]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Deskripsi Ringkas",-1)),le(a("input",{"onUpdate:modelValue":i[14]||(i[14]=d=>l(I).description=d),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),[[ke,l(I).description]])])]),l(I).layoutType==="custom"?(f(),g("div",bn,[a("div",kn,[a("span",wn,[A(l(Ga),{class:"w-3.5 h-3.5"}),i[78]||(i[78]=z(" Template Engine HTML & Styling CSS ",-1))]),i[79]||(i[79]=a("span",{class:"text-[10px] text-slate-400 font-mono"},"Gunakan {{ data.title }} & {{#each data.items}}",-1))]),a("div",null,[i[80]||(i[80]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"HTML Template (Tailwind utility classes didukung penuh)",-1)),le(a("textarea",{"onUpdate:modelValue":i[15]||(i[15]=d=>l(I).customHtml=d),rows:"6",placeholder:`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700 text-center">
|
|
68
68
|
<h2 class="text-3xl font-black text-white">{{ data.title }}</h2>
|
|
69
69
|
<p class="text-slate-300">{{ data.subtitle }}</p>
|
|
70
|
-
</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),[[ke,l(I).customHtml]])]),a("div",null,[i[81]||(i[81]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Custom CSS (Opsional - animasi, gradien unik, glassmorphism)",-1)),le(a("textarea",{"onUpdate:modelValue":i[16]||(i[16]=d=>l(I).customCss=d),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),[[ke,l(I).customCss]])])])):E("",!0),a("div",null,[i[82]||(i[82]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"AI Prompt Directive (Aturan Khusus Generator)",-1)),le(a("textarea",{"onUpdate:modelValue":i[17]||(i[17]=d=>l(I).promptDirective=d),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),[[ke,l(I).promptDirective]])]),a("div",null,[i[83]||(i[83]=a("div",{class:"flex items-center justify-between mb-1"},[a("label",{class:"text-[10px] font-bold text-slate-400"},"Sampel Data JSON (Pristine Default Tampilan)"),a("span",{class:"text-[10px] text-slate-500"},"Akan langsung ditampilkan di Live Preview")],-1)),le(a("textarea",{"onUpdate:modelValue":i[18]||(i[18]=d=>l(I).sampleJsonText=d),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),[[ke,l(I).sampleJsonText]])]),a("div",_n,[a("button",{onClick:Y,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 "),a("button",{onClick:st,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"},[A(l(Fe),{class:"w-3.5 h-3.5"}),a("span",null,y(l(F)?"Perbarui Template":"Simpan Template"),1)])])]))])])):E("",!0),a("div",Sn,[a("div",null,[a("h2",Tn,[A(l(as),{class:"w-3.5 h-3.5 text-sky-400"}),i[84]||(i[84]=z(" Content Studio ",-1))]),i[85]||(i[85]=a("p",{class:"text-[10px] text-slate-400"},"Multi-Format Studio",-1))]),a("div",Cn,[a("div",An,[le(a("select",{"onUpdate:modelValue":i[19]||(i[19]=d=>Be($)?$.value=d: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"},[(f(!0),g(Ae,null,Ne(l(K),d=>(f(),g("option",{key:d.id,value:d.id,class:"bg-slate-900 text-white"},y(d.name),9,Nn))),128))],512),[[lt,l($)]]),a("button",{onClick:De,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"},[A(l(Nt),{class:"w-3 h-3"}),i[86]||(i[86]=a("span",{class:"hidden sm:inline"},"Niche",-1))])]),a("div",In,[A(l(qa),{class:"w-3 h-3 text-emerald-400 ml-1 flex-shrink-0"}),le(a("select",{"onUpdate:modelValue":i[20]||(i[20]=d=>Be(X)?X.value=d: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"},[...i[87]||(i[87]=[dt('<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),[[lt,l(X)]])]),a("button",{onClick:Ea,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"},[A(l(aa),{class:"w-3 h-3"}),i[88]||(i[88]=a("span",{class:"hidden sm:inline"},"Prompt Manual",-1))]),a("button",{onClick:i[21]||(i[21]=d=>Xt()),disabled:s.isGenerating||s.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"},[A(l(ia),{class:H(["w-3.5 h-3.5",{"animate-spin":s.isAutoTopicLoading}])},null,8,["class"]),a("span",null,y(s.isAutoTopicLoading?"Meriset Data...":"✨ Auto-Topic"),1)],8,On),a("div",Mn,[i[93]||(i[93]=a("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)),a("div",Dn,[i[91]||(i[91]=a("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Model AI Engine",-1)),a("div",$n,[le(a("select",{"onUpdate:modelValue":i[22]||(i[22]=d=>Be(b)?b.value=d:null),class:"w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"},[...i[89]||(i[89]=[a("option",{value:"gemini-3.8-flash"},"⚡ Gemini 3.8 Flash",-1),a("option",{value:"gemini-3.5-flash"},"⚡ Gemini 3.5 Flash",-1),a("option",{value:"gemini-2.5-pro"},"💎 Gemini 2.5 Pro",-1),a("option",{value:"gemini-1.5-pro"},"💎 Gemini 1.5 Pro",-1)])],512),[[lt,l(b)]])]),i[92]||(i[92]=a("div",{class:"border-t border-slate-800 my-1"},null,-1)),a("div",jn,[i[90]||(i[90]=a("span",null,"Pilih Format Template",-1)),a("span",Rn,y(l(G).length)+" opsi",1)]),a("div",En,[(f(!0),g(Ae,null,Ne(l(G),d=>(f(),g("button",{key:d.id,onClick:B=>Xt(void 0,d.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"},[a("span",Pn,y(d.name),1),d.isBuiltin?E("",!0):(f(),g("span",Vn,"Kustom"))],8,Ln))),128))])])])])]),s.isAutoTopicLoading?(f(),g("div",Bn,[a("div",Zn,[A(l(ia),{class:"w-3.5 h-3.5 text-sky-400 animate-spin"})]),a("div",Un,[a("div",Jn,[i[94]||(i[94]=a("span",null,"AI Research Engine Sedang Bekerja...",-1)),a("span",Fn,y(l(b)),1)]),i[95]||(i[95]=a("p",{class:"text-[10px] text-slate-300 mt-0.5"},"Menganalisis angka perbandingan 2026 & meracik copywriting viral.",-1))])])):E("",!0),a("div",Hn,[a("div",zn,[a("button",{onClick:i[23]||(i[23]=d=>O.value="editor"),class:H(["px-2.5 py-1 rounded-lg transition text-[11px]",l(O)==="editor"?"bg-slate-800 text-sky-400 shadow font-bold":"text-slate-400 hover:text-white"])}," JSON Editor ",2),a("button",{onClick:i[24]||(i[24]=d=>O.value="drafts"),class:H(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(O)==="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"},[A(l(ea),{class:"w-3 h-3"}),a("span",null,"Drafts ("+y(s.drafts.length)+")",1)],2),a("button",{onClick:i[25]||(i[25]=d=>O.value="history"),class:H(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(O)==="history"?"bg-slate-800 text-purple-400 shadow font-bold":"text-slate-400 hover:text-white"]),title:"Riwayat otomatis setiap kali generate"},[A(l(ta),{class:"w-3 h-3"}),a("span",null,"Riwayat ("+y(s.history.length)+")",1)],2)]),a("div",Gn,[s.unsavedStash?(f(),g("button",{key:0,onClick:de,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"},[...i[96]||(i[96]=[a("span",null,"↩️ Kembali ke Editan",-1)])])):E("",!0),l(O)==="history"&&s.history.length>0?(f(),g("button",{key:1,onClick:Pa,class:"text-[10px] text-rose-400 hover:text-rose-300 transition font-bold pr-1",title:"Bersihkan semua riwayat generate"}," Bersihkan Riwayat ")):E("",!0),a("button",{onClick:i[26]||(i[26]=d=>n("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"},[A(l(ea),{class:"w-3 h-3"}),i[97]||(i[97]=a("span",null,"+ Simpan ke Draft",-1))])])]),l(O)==="drafts"?(f(),g("div",Kn,[s.unsavedStash?(f(),g("div",Wn,[a("div",qn,[i[99]||(i[99]=a("span",{class:"text-sm"},"✏️",-1)),a("div",Yn,[i[98]||(i[98]=a("span",{class:"font-bold text-[10px] block text-amber-300"},"Ada editan aktif sebelumnya:",-1)),a("span",Xn,'"'+y(s.unsavedStash.title||"Tanpa Judul")+'"',1)])]),a("div",Qn,[a("button",{onClick:de,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"},[...i[100]||(i[100]=[a("span",null,"↩️ Kembali ke Editan",-1)])]),a("button",{onClick:i[27]||(i[27]=d=>n("clearStash")),class:"p-1 hover:text-white text-amber-400/70 transition text-xs",title:"Abaikan & buang simpanan editan ini"}," ✕ ")])])):E("",!0),s.drafts.length===0?(f(),g("div",ei,[...i[101]||(i[101]=[z(" Belum ada draft tersimpan.",-1),a("br",null,null,-1),z(" Klik ",-1),a("b",{class:"text-amber-400"},"+ Simpan ke Draft",-1),z(" di atas untuk menyimpan konten ini agar bisa diedit/digenerate nanti! ",-1)])])):E("",!0),(f(!0),g(Ae,null,Ne(s.drafts,(d,B)=>(f(),g("div",{key:B,onClick:W=>n("selectDraft",B),"data-draft-item":"",class:H(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",s.activeDraftIndex===B?"bg-amber-500/15 border-amber-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[a("div",ai,[a("div",si,[a("span",ni,y(d.layoutType||"table"),1),a("span",ii,y(d.category),1)]),a("div",ri,y(d.title),1)]),a("button",{onClick:At(W=>n("deleteDraft",B),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus draft ini"},[A(l(pt),{class:"w-3.5 h-3.5"})],8,oi)],10,ti))),128))])):l(O)==="history"?(f(),g("div",li,[s.unsavedStash?(f(),g("div",di,[a("div",ui,[i[103]||(i[103]=a("span",{class:"text-sm"},"✏️",-1)),a("div",ci,[i[102]||(i[102]=a("span",{class:"font-bold text-[10px] block text-purple-300"},"Ada editan aktif sebelumnya:",-1)),a("span",pi,'"'+y(s.unsavedStash.title||"Tanpa Judul")+'"',1)])]),a("div",mi,[a("button",{onClick:de,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"},[...i[104]||(i[104]=[a("span",null,"↩️ Kembali ke Editan",-1)])]),a("button",{onClick:i[28]||(i[28]=d=>n("clearStash")),class:"p-1 hover:text-white text-purple-400/70 transition text-xs",title:"Abaikan & buang simpanan editan ini"}," ✕ ")])])):E("",!0),s.history.length===0?(f(),g("div",fi,[...i[105]||(i[105]=[z(" Belum ada riwayat pembuatan.",-1),a("br",null,null,-1),z(" Setiap kali kamu klik ",-1),a("b",{class:"text-sky-400"},"GENERATE CONTENT",-1),z(", hasil pembuatan akan otomatis tercatat di sini! ",-1)])])):E("",!0),(f(!0),g(Ae,null,Ne(s.history,(d,B)=>(f(),g("div",{key:B,onClick:W=>n("selectHistory",B),"data-history-item":"",class:H(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",s.activeHistoryIndex===B?"bg-purple-500/15 border-purple-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[a("div",xi,[a("div",vi,[a("span",gi,y(d.layoutType||"reels"),1),a("span",yi,y(d.category),1),d.generatedAt?(f(),g("span",bi,y(Va(d.generatedAt)),1)):E("",!0)]),a("div",ki,y(d.title),1)]),a("button",{onClick:At(W=>n("deleteHistory",B),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus riwayat ini"},[A(l(pt),{class:"w-3.5 h-3.5"})],8,wi)],10,hi))),128))])):(f(),g("div",_i,[a("div",Si,[a("div",null,[a("div",Ti,[a("label",Ci,[A(l(sa),{class:"w-3 h-3 text-sky-400"}),i[106]||(i[106]=z(" Format Template ",-1))]),a("button",{onClick:i[29]||(i[29]=d=>N("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"},[A(l(na),{class:"w-3 h-3"}),i[107]||(i[107]=a("span",null,"Kelola",-1))])]),a("select",{value:l(o),onChange:i[30]||(i[30]=d=>Tt(d.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]"},[(f(!0),g(Ae,null,Ne(l(G),d=>(f(),g("option",{key:d.id,value:d.id},y(d.name)+" "+y(d.isBuiltin?"":"⭐ (Kustom)"),9,Ni))),128))],40,Ai)]),a("div",null,[i[109]||(i[109]=a("label",{class:"block text-[10px] font-bold text-slate-300 mb-1"}," Theme Color (10 Pilihan) ",-1)),a("select",{value:s.modelValue.theme||"blue-tech",onChange:i[31]||(i[31]=d=>ja(d.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]"},[...i[108]||(i[108]=[dt('<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,Ii)]),a("div",Oi,[a("div",Mi,[i[110]||(i[110]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Watermark Handle ",-1)),a("input",{type:"text",value:s.modelValue.watermark||"@SocialGen",onInput:i[32]||(i[32]=d=>$a(d.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,Di)]),a("div",$i,[i[111]||(i[111]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Judul Konten (Title) ",-1)),a("input",{type:"text",value:s.modelValue.title,onInput:i[33]||(i[33]=d=>Da(d.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,ji)])])]),a("div",Ri,[a("div",Ei,[i[113]||(i[113]=a("span",{class:"font-bold text-slate-300 text-[10px]"},"RAW JSON SocialGen",-1)),l(c)?(f(),g("span",Pi,[A(l(Ha),{class:"w-2.5 h-2.5"}),i[112]||(i[112]=z(" Invalid ",-1))])):(f(),g("span",Li,[A(l(za),{class:"w-2.5 h-2.5"}),z(" "+y(l(r).trim()?"Valid":"Sample Mode"),1)]))]),a("div",Vi,[a("button",{onClick:Yt,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"},[A(l(Ca),{class:"w-2.5 h-2.5"}),i[114]||(i[114]=a("span",null,"Clear / Pakai Sample",-1))]),i[115]||(i[115]=a("span",{class:"text-slate-700"},"|",-1)),a("button",{onClick:Ma,class:"text-[10px] text-slate-400 hover:text-sky-400 transition"}," Format JSON ")])]),l(Ce)?(f(),g("div",{key:0,class:H(["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",l(Ce).isKnown?"bg-amber-500/10 border-amber-500/30":"bg-rose-500/10 border-rose-500/30"])},[a("div",{class:H(["flex items-center gap-1.5 text-[11px]",l(Ce).isKnown?"text-amber-300":"text-rose-300"])},[i[121]||(i[121]=a("span",{class:"text-sm"},"⚠️",-1)),l(Ce).isKnown?(f(),g("span",Bi,[i[116]||(i[116]=z(" JSON ini dibuat untuk template ",-1)),a("b",Zi,y(l(Ce).matchedTarget?.name),1),i[117]||(i[117]=z(" (",-1)),a("span",Ui,y(l(Ce).jsonTemplateId),1),i[118]||(i[118]=z(") ",-1))])):(f(),g("span",Ji,[i[119]||(i[119]=z(' Template dengan ID "',-1)),a("span",Fi,y(l(Ce).jsonTemplateId),1),i[120]||(i[120]=z('" tidak ditemukan di sistem. ',-1))]))],2),a("div",Hi,[l(Ce).isKnown&&l(Ce).matchedTarget?(f(),g("button",{key:0,onClick:i[34]||(i[34]=d=>Tt(l(Ce).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 ")):E("",!0),a("button",{onClick:Yt,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)):E("",!0),a("div",zi,[a("textarea",{value:l(r),onInput:Oa,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,Gi),l(c)||s.validationError?(f(),g("p",Ki," ⚠️ "+y(l(c)||s.validationError),1)):E("",!0)])])),a("input",{type:"file",ref_key:"videoInputRef",ref:Gt,accept:"video/mp4,video/webm",class:"hidden",onChange:i[35]||(i[35]=d=>qt(d))},null,544),a("input",{type:"file",ref_key:"audioInputRef",ref:Kt,accept:"audio/mp3,audio/mpeg,audio/wav",class:"hidden",onChange:i[36]||(i[36]=d=>qt(d))},null,544),a("div",Wi,[a("div",qi,[a("div",Yi,[a("label",Xi,[A(l(_a),{class:"w-3.5 h-3.5 text-sky-400"}),i[122]||(i[122]=a("span",null,"Background",-1))]),a("div",Qi,[a("select",{value:s.options.backgroundSource||"random",onChange:i[37]||(i[37]=d=>Ee("backgroundSource",d.target.value)),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]"},[i[123]||(i[123]=a("option",{value:"random"},"🔀 Acak Video",-1)),(f(!0),g(Ae,null,Ne(l(Jt),d=>(f(),g("option",{key:d,value:d},y(d.replace(".mp4","").replace(/_/g," ")),9,tr))),128)),i[124]||(i[124]=a("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,er),a("button",{onClick:i[38]||(i[38]=d=>l(Gt)?.click()),disabled:l(Ue),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"},[A(l(ra),{class:"w-3 h-3"}),a("span",sr,y(l(Ue)?"...":"Upload"),1)],8,ar)])]),a("div",nr,[a("span",ir,[A(l(Dt),{class:"w-2.5 h-2.5"}),z(" Mulai: "+y(Math.min(s.options.videoStartOffset||0,l(rt)))+"s / "+y(l(Ht))+"s ",1)]),a("input",{type:"range",min:"0",max:l(rt),step:"1",value:Math.min(s.options.videoStartOffset||0,l(rt)),onInput:i[39]||(i[39]=d=>Ee("videoStartOffset",Number(d.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,rr)])]),a("div",or,[a("div",lr,[a("label",dr,[A(l(Sa),{class:"w-3.5 h-3.5 text-purple-400"}),i[125]||(i[125]=a("span",null,"Musik Reels",-1))]),a("div",ur,[a("select",{value:s.options.musicFile||"random",onChange:i[40]||(i[40]=d=>Ee("musicFile",d.target.value)),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]"},[i[126]||(i[126]=a("option",{value:"random"},"🔀 Acak Musik",-1)),(f(!0),g(Ae,null,Ne(l(Ft),d=>(f(),g("option",{key:d,value:d},y(d.replace(".mp3","").replace(/_/g," ")),9,pr))),128))],40,cr),a("button",{onClick:i[41]||(i[41]=d=>l(Kt)?.click()),disabled:l(Ue),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"},[A(l(ra),{class:"w-3 h-3"}),a("span",fr,y(l(Ue)?"...":"Upload"),1)],8,mr)])]),a("div",hr,[a("span",xr,[A(l(Dt),{class:"w-2.5 h-2.5"}),z(" Mulai: "+y(Math.min(s.options.audioStartOffset||0,l(ot)))+"s / "+y(l(zt))+"s ",1)]),a("input",{type:"range",min:"0",max:l(ot),step:"1",value:Math.min(s.options.audioStartOffset||0,l(ot)),onInput:i[42]||(i[42]=d=>Ee("audioStartOffset",Number(d.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,vr)])]),a("div",gr,[a("label",yr,[A(l(ta),{class:"w-3.5 h-3.5 text-emerald-400"}),i[127]||(i[127]=a("span",null,"Durasi Reels:",-1))]),a("div",br,[(f(),g(Ae,null,Ne([7,10,15,30,60],d=>a("button",{key:d,onClick:B=>Ra(d),class:H(["px-2 py-0.5 text-[10px] font-bold rounded-lg border transition",(s.modelValue.reelsDuration||30)===d?"bg-emerald-500/20 border-emerald-500/60 text-emerald-300":"bg-slate-950 border-slate-800 text-slate-400 hover:text-white"])},y(d===60?"1m":d+"s"),11,kr)),64))])]),a("div",wr,[a("label",{class:H(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.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"])},[a("input",{type:"checkbox",checked:s.options.outputs?.feed!==!1,onChange:i[43]||(i[43]=d=>Ct("feed",d.target.checked)),class:"rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,_r),i[128]||(i[128]=a("span",{class:"font-bold"},"Feed 4:5",-1))],2),a("label",{class:H(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.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"])},[a("input",{type:"checkbox",checked:s.options.outputs?.story!==!1,onChange:i[44]||(i[44]=d=>Ct("story",d.target.checked)),class:"rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Sr),i[129]||(i[129]=a("span",{class:"font-bold"},"Story 9:16",-1))],2),a("label",{class:H(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.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"])},[a("input",{type:"checkbox",checked:s.options.outputs?.reels!==!1,onChange:i[45]||(i[45]=d=>Ct("reels",d.target.checked)),class:"rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Tr),i[130]||(i[130]=a("span",{class:"font-bold"},"Reels MP4",-1))],2)])]),a("button",{onClick:i[46]||(i[46]=d=>n("generate")),disabled:!s.isValid||s.isGenerating||!!l(c),class:H(["w-full py-3 px-4 rounded-xl font-black text-xs tracking-wide shadow-xl transition flex items-center justify-center gap-2",[!s.isValid||s.isGenerating||l(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]"]])},[s.isGenerating?(f(),Ie(l(Xa),{key:0,class:"w-3.5 h-3.5 animate-spin"})):(f(),Ie(l(Ta),{key:1,class:"w-3.5 h-3.5 fill-current"})),a("span",null,y(s.isGenerating?s.generateStage||"Rendering Content...":"GENERATE CONTENT"),1)],10,Cr)]))}}),Nr={class:"flex flex-col gap-2.5 h-full text-slate-100 min-h-0 justify-between"},Ir={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"},Or={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"},Mr={key:0,class:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"},Dr={class:"flex items-center gap-2 text-xs"},$r={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"},jr={key:0,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"360px",height:"450px"}},Rr={style:{width:"1080px",height:"1350px",transform:"scale(0.333333)","transform-origin":"top left"}},Er={key:1,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"300px",height:"533.33px"}},Lr={key:0,class:"absolute inset-0 z-0 bg-slate-950 overflow-hidden"},Pr=["src"],Vr=["src","muted"],Br={class:"relative z-10 pointer-events-none",style:{width:"1080px",height:"1920px",transform:"scale(0.277778)","transform-origin":"top left"}},Zr={key:1,class:"absolute inset-0 z-20 pointer-events-none flex flex-col justify-between"},Ur={class:"flex-1 flex justify-end p-2"},Jr={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"},Fr={key:0,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"},Hr={class:"flex items-center justify-between gap-3"},zr=["title"],Gr={class:"text-[11px] hidden sm:inline"},Kr={class:"flex-1 flex items-center gap-2"},Wr=["max","value"],qr={class:"font-mono text-[11px] font-bold text-slate-300 min-w-[75px] text-right"},Yr=["title"],Xr={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"},Qr={class:"flex flex-col gap-1.5"},eo={class:"flex items-center justify-between text-[11px]"},to={class:"font-bold text-sky-300 flex items-center gap-1"},ao=["max","value"],so={class:"text-[9px] text-slate-500"},no={class:"flex flex-col gap-1.5"},io={class:"flex items-center justify-between text-[11px]"},ro={class:"font-bold text-purple-300 flex items-center gap-1"},oo=["max","value"],lo={class:"text-[9px] text-slate-500"},uo={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"},co={class:"flex items-center justify-between text-xs"},po=["value"],mo={key:1,class:"flex flex-wrap items-center justify-between gap-2 p-3 bg-emerald-950/40 border border-emerald-500/40 rounded-2xl shadow-xl flex-shrink-0"},fo={class:"flex items-center gap-2 text-xs font-black text-emerald-300"},ho={class:"text-[11px] text-slate-400 font-mono mt-0.5"},xo={class:"flex items-center gap-2"},vo=["href"],go=["disabled"],yo=Vt({__name:"LivePreview",props:{data:{},selectedVideo:{},selectedMusic:{},videoStartOffset:{default:0},audioStartOffset:{default:0},generatedResult:{}},emits:["update:videoStartOffset","update:audioStartOffset"],setup(s,{emit:e}){const t=s,n=e,r={"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},o=ce(()=>t.selectedVideo&&t.selectedVideo!=="pexels"&&t.selectedVideo!=="random"?`/api/stream/videos/${t.selectedVideo}`:"/api/stream/videos/default_bg.mp4"),p=ce(()=>t.selectedMusic&&t.selectedMusic!=="random"?`/api/stream/audio/${t.selectedMusic}`:"/api/stream/audio/lofi_viral_study.mp3"),c=S("feed"),w=S(!1),b=S(!1),O=S(!1),de=S(!1),K=S(1),$=S(null),M=S(null),Z=S(!0),P=S(!1),ve=S(0),De=ce(()=>t.data.reelsDuration||30),ue=S(r[t.selectedVideo||""]||8),oe=S(r[t.selectedMusic||""]||30),re=ce(()=>Math.max(1,Math.floor(ue.value-1))),X=ce(()=>Math.max(1,Math.floor(oe.value-1)));function $e(){K.value<2.5&&(K.value=Math.min(2.5,+(K.value+.15).toFixed(2)))}function G(){K.value>.5&&(K.value=Math.max(.5,+(K.value-.15).toFixed(2)))}function me(){K.value=1}function ne(C){(C.ctrlKey||C.metaKey)&&(C.preventDefault(),C.deltaY<0?$e():G())}let F=0,q=null;function te(C){if(Z.value){if(F>0){const v=(C-F)/1e3;v>0&&v<1&&(ve.value+=v,ve.value>=De.value&&(ve.value=0,Se(0)))}F=C,q=requestAnimationFrame(te)}}Bt(()=>{Z.value&&(F=performance.now(),q&&cancelAnimationFrame(q),q=requestAnimationFrame(te))}),Ba(()=>{q&&(cancelAnimationFrame(q),q=null)}),xe(De,C=>{ve.value>C&&(ve.value=0,Se(0))});function fe(){Z.value?Q():_e()}function _e(){Z.value=!0,F=performance.now(),q&&cancelAnimationFrame(q),q=requestAnimationFrame(te),$.value&&$.value.play().catch(()=>{}),M.value&&(M.value.muted=P.value,M.value.volume=.85,M.value.play().catch(()=>{}))}function Q(){Z.value=!1,F=0,q&&(cancelAnimationFrame(q),q=null),$.value&&$.value.pause(),M.value&&M.value.pause()}function I(){if(P.value=!P.value,M.value)if(M.value.muted=P.value,M.value.volume=.85,!P.value&&Z.value){const C=t.audioStartOffset||0;M.value.currentTime=C+ve.value%Math.max(1,oe.value-C),M.value.play().catch(()=>{})}else M.value.pause()}function qe(C){const v=C.target;v&&v.duration&&!isNaN(v.duration)&&isFinite(v.duration)&&(ue.value=Math.max(1,Math.floor(v.duration)),t.videoStartOffset&&t.videoStartOffset>=ue.value&&n("update:videoStartOffset",Math.max(0,ue.value-2))),$.value&&($.value.currentTime=Math.min(t.videoStartOffset||0,re.value),Z.value&&$.value.play().catch(()=>{}))}function N(C){const v=C.target;v&&v.duration&&!isNaN(v.duration)&&isFinite(v.duration)&&(oe.value=Math.max(1,Math.floor(v.duration)),t.audioStartOffset&&t.audioStartOffset>=oe.value&&n("update:audioStartOffset",Math.max(0,oe.value-2))),M.value&&(M.value.muted=P.value,M.value.volume=.85,M.value.currentTime=Math.min(t.audioStartOffset||0,X.value),Z.value&&!P.value&&M.value.play().catch(()=>{}))}function h(){if(!$.value)return;const C=Math.min(t.videoStartOffset||0,re.value);$.value.currentTime=C,Z.value&&$.value.play().catch(()=>{})}function Y(){if(!M.value)return;const C=Math.min(t.audioStartOffset||0,X.value);M.value.currentTime=C,Z.value&&!P.value&&M.value.play().catch(()=>{})}function Te(){if(!$.value)return;const C=Math.min(t.videoStartOffset||0,re.value),v=ue.value;$.value.currentTime>=v-.25&&($.value.currentTime=C,Z.value&&$.value.play().catch(()=>{}))}function V(){if(!M.value)return;const C=Math.min(t.audioStartOffset||0,X.value),v=oe.value;M.value.currentTime>=v-.25&&(M.value.currentTime=C,Z.value&&!P.value&&M.value.play().catch(()=>{}))}function Se(C){ve.value=Math.min(Math.max(0,C),De.value),F=performance.now();const v=Math.min(t.videoStartOffset||0,re.value),ye=Math.min(t.audioStartOffset||0,X.value);if($.value){const se=v+C%Math.max(1,ue.value-v);$.value.currentTime=Math.min(se,ue.value-.1)}if(M.value){const se=ye+C%Math.max(1,oe.value-ye);M.value.currentTime=Math.min(se,oe.value-.1)}}function bt(C){const v=Number(C.target.value);Se(v)}xe(()=>t.videoStartOffset,C=>{const v=Math.min(C||0,re.value);$.value&&($.value.currentTime=v)}),xe(()=>t.audioStartOffset,C=>{const v=Math.min(C||0,X.value);M.value&&(M.value.currentTime=v)});function at(C){const v=Math.min(C,re.value);n("update:videoStartOffset",v),$.value&&($.value.currentTime=v)}function kt(C){const v=Math.min(C,X.value);n("update:audioStartOffset",v),M.value&&(M.value.currentTime=v)}function wt(){if($.value){const C=Math.min(Math.floor($.value.currentTime),re.value);at(C)}}function st(C){const v=Math.floor(C/60),ye=Math.floor(C%60);return`${v.toString().padStart(2,"0")}:${ye.toString().padStart(2,"0")}`}function _t(){t.data.caption&&(navigator.clipboard.writeText(t.data.caption),O.value=!0,setTimeout(()=>{O.value=!1},2e3))}async function St(){if(t.generatedResult){de.value=!0;try{await $fetch("/api/open-folder",{method:"POST",body:{jobId:t.generatedResult.jobId,resultDir:t.generatedResult.resultDir}})}catch(C){console.error("Failed to open folder:",C)}finally{de.value=!1}}}return xe(()=>o.value,()=>{const C=t.selectedVideo||"";r[C]&&(ue.value=r[C]),Qt(()=>{Se(0)})}),xe(()=>p.value,()=>{const C=t.selectedMusic||"";r[C]&&(oe.value=r[C])}),xe(()=>c.value,C=>{C==="reels"?Qt(()=>{Z.value&&_e()}):M.value&&M.value.pause()}),(C,v)=>{const ye=Ua;return f(),g("div",Nr,[a("div",Ir,[a("div",Or,[a("button",{onClick:v[0]||(v[0]=se=>c.value="feed"),class:H(["px-3 py-1.5 rounded-lg transition",l(c)==="feed"?"bg-sky-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Feed 4:5 ",2),a("button",{onClick:v[1]||(v[1]=se=>c.value="story"),class:H(["px-3 py-1.5 rounded-lg transition",l(c)==="story"?"bg-indigo-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Story 9:16 ",2),a("button",{onClick:v[2]||(v[2]=se=>c.value="reels"),class:H(["px-3 py-1.5 rounded-lg transition flex items-center gap-1.5",l(c)==="reels"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-white"])},[v[8]||(v[8]=a("span",null,"Reels 9:16 (Video)",-1)),l(c)==="reels"&&l(Z)?(f(),g("span",Mr)):E("",!0)],2)]),a("div",Dr,[a("div",$r,[a("button",{onClick:G,title:"Zoom Out (-15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[A(l(ns),{class:"w-3.5 h-3.5"})]),a("button",{onClick:me,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"},y(Math.round(l(K)*100))+"% ",1),a("button",{onClick:$e,title:"Zoom In (+15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[A(l(ss),{class:"w-3.5 h-3.5"})]),l(K)!==1?(f(),g("button",{key:0,onClick:me,title:"Reset ke Ukuran Pas",class:"p-1.5 rounded-lg text-amber-400 hover:bg-slate-800 transition"},[A(l(Ca),{class:"w-3.5 h-3.5"})])):E("",!0)]),l(c)!=="feed"?(f(),g("button",{key:0,onClick:v[3]||(v[3]=se=>w.value=!l(w)),class:H(["inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition",l(w)?"bg-amber-500/20 text-amber-300 border-amber-500/50":"bg-slate-950 text-slate-400 border-slate-800"])},[A(l(Qa),{class:"w-3.5 h-3.5"}),v[9]||(v[9]=a("span",{class:"hidden sm:inline"},"Safe Zones",-1))],2)):E("",!0)])]),a("div",{onWheel:ne,class:"relative flex-1 min-h-0 bg-slate-950/80 border border-slate-800/80 rounded-2xl flex items-center justify-center p-3 overflow-auto shadow-inner custom-scrollbar"},[a("div",{class:"transition-transform duration-200 ease-out origin-center flex-shrink-0",style:Za({transform:`scale(${l(K)})`})},[l(c)==="feed"?(f(),g("div",jr,[a("div",Rr,[A(ye,{data:s.data,mode:"feed","is-render":!0},null,8,["data"])])])):(f(),g("div",Er,[l(c)==="reels"?(f(),g("div",Lr,[(f(),g("video",{ref_key:"videoElement",ref:$,key:l(o),autoplay:"",muted:"",playsinline:"",class:"w-full h-full object-cover brightness-90 contrast-105",src:l(o),onLoadedmetadata:qe,onTimeupdate:Te,onEnded:h},null,40,Pr)),v[10]||(v[10]=a("div",{class:"absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"},null,-1)),(f(),g("audio",{ref_key:"audioElement",ref:M,key:l(p),src:l(p),muted:l(P),onLoadedmetadata:N,onTimeupdate:V,onEnded:Y},null,40,Vr))])):E("",!0),a("div",Br,[A(ye,{data:s.data,mode:l(c)==="reels"?"overlay":"story","is-render":!0},null,8,["data","mode"])]),l(w)?(f(),g("div",Zr,[v[12]||(v[12]=a("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)),a("div",Ur,[l(c)==="reels"?(f(),g("div",Jr,[...v[11]||(v[11]=[a("span",null,"❤️ Like",-1),a("span",null,"💬 Comm",-1),a("span",null,"↗️ Share",-1)])])):E("",!0)]),v[13]||(v[13]=a("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))])):E("",!0)]))],4)],32),l(c)==="reels"?(f(),g("div",Fr,[a("div",Hr,[a("button",{onClick:fe,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:l(Z)?"Pause Preview":"Putar Preview"},[l(Z)?(f(),Ie(l(Ya),{key:0,class:"w-3.5 h-3.5 fill-current"})):(f(),Ie(l(Ta),{key:1,class:"w-3.5 h-3.5 fill-current"})),a("span",Gr,y(l(Z)?"Pause":"Play"),1)],8,zr),a("div",Kr,[a("input",{type:"range",min:"0",max:l(De),step:"0.1",value:l(ve),onInput:bt,class:"flex-1 h-1.5 bg-slate-950 rounded-lg appearance-none cursor-pointer accent-emerald-500 hover:accent-emerald-400"},null,40,Wr),a("span",qr,y(st(l(ve)))+" / "+y(st(l(De))),1)]),a("button",{onClick:I,class:H(["px-2.5 py-2 rounded-xl border transition flex items-center gap-1.5 font-bold text-[11px]",l(P)?"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:l(P)?"Aktifkan Suara Musik (Unmute)":"Matikan Suara Musik (Mute)"},[l(P)?(f(),Ie(l(ts),{key:1,class:"w-3.5 h-3.5"})):(f(),Ie(l(es),{key:0,class:"w-3.5 h-3.5 text-purple-300 animate-pulse"})),a("span",null,y(l(P)?"Muted":"Audio ON"),1)],10,Yr),a("button",{onClick:v[4]||(v[4]=se=>b.value=!l(b)),class:H(["px-2.5 py-2 rounded-xl border text-[11px] font-bold flex items-center gap-1.5 transition",l(b)?"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"},[A(l(Dt),{class:"w-3.5 h-3.5 text-sky-400"}),v[14]||(v[14]=a("span",{class:"hidden sm:inline"},"Trim Offset",-1))],2)]),l(b)?(f(),g("div",Xr,[a("div",Qr,[a("div",eo,[a("span",to,[A(l(_a),{class:"w-3 h-3"}),z(" Mulai Video: "+y(Math.min(s.videoStartOffset||0,l(re)))+"s / "+y(l(ue))+"s ",1)]),a("button",{onClick:wt,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 ")]),a("input",{type:"range",min:"0",max:l(re),step:"1",value:Math.min(s.videoStartOffset||0,l(re)),onInput:v[5]||(v[5]=se=>at(Number(se.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-sky-400"},null,40,ao),a("div",so," Maksimal offset: "+y(l(re))+" detik (panjang asli video: "+y(l(ue))+"s) ",1)]),a("div",no,[a("div",io,[a("span",ro,[A(l(Sa),{class:"w-3 h-3"}),z(" Mulai Musik: "+y(Math.min(s.audioStartOffset||0,l(X)))+"s / "+y(l(oe))+"s ",1)]),v[15]||(v[15]=a("span",{class:"text-[10px] text-slate-500 font-mono"}," (Skip intro) ",-1))]),a("input",{type:"range",min:"0",max:l(X),step:"1",value:Math.min(s.audioStartOffset||0,l(X)),onInput:v[6]||(v[6]=se=>kt(Number(se.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-purple-400"},null,40,oo),a("div",lo," Maksimal offset: "+y(l(X))+" detik (panjang asli musik: "+y(l(oe))+"s) ",1)])])):E("",!0)])):E("",!0),a("div",uo,[a("div",co,[v[16]||(v[16]=a("span",{class:"font-extrabold text-slate-300 text-[11px]"},"VIRAL CAPTION & HASHTAGS",-1)),a("button",{onClick:_t,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"},[l(O)?(f(),Ie(l(Fe),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(f(),Ie(l(mt),{key:1,class:"w-3.5 h-3.5"})),a("span",null,y(l(O)?"Tersalin!":"Copy Caption"),1)])]),a("textarea",{value:s.data.caption,onInput:v[7]||(v[7]=se=>s.data.caption=se.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,po)]),s.generatedResult?(f(),g("div",mo,[a("div",null,[a("div",fo,[A(l(Fe),{class:"w-4 h-4 text-emerald-400"}),z(" Render Selesai ("+y((s.generatedResult.durationMs/1e3).toFixed(1))+"s) ",1)]),a("div",ho,y(s.generatedResult.jobId),1)]),a("div",xo,[a("a",{href:`/api/download?jobId=${s.generatedResult.jobId}`,download:"",class:"inline-flex items-center gap-1.5 px-4 py-2 bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl text-xs font-black shadow-lg transition"},[A(l(Ka),{class:"w-3.5 h-3.5"}),v[17]||(v[17]=a("span",null,"Download ZIP",-1))],8,vo),a("button",{onClick:St,disabled:l(de),class:"inline-flex items-center gap-1.5 px-4 py-2 bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 rounded-xl text-xs font-bold transition"},[A(l(Wa),{class:"w-3.5 h-3.5 text-amber-400"}),v[18]||(v[18]=a("span",null,"Open Folder",-1))],8,go)])])):E("",!0)])}}});var U;(function(s){s.assertEqual=r=>{};function e(r){}s.assertIs=e;function t(r){throw new Error}s.assertNever=t,s.arrayToEnum=r=>{const o={};for(const p of r)o[p]=p;return o},s.getValidEnumValues=r=>{const o=s.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),p={};for(const c of o)p[c]=r[c];return s.objectValues(p)},s.objectValues=r=>s.objectKeys(r).map(function(o){return r[o]}),s.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const p in r)Object.prototype.hasOwnProperty.call(r,p)&&o.push(p);return o},s.find=(r,o)=>{for(const p of r)if(o(p))return p},s.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,o=" | "){return r.map(p=>typeof p=="string"?`'${p}'`:p).join(o)}s.joinValues=n,s.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(U||(U={}));var oa;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(oa||(oa={}));const _=U.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Le=s=>{switch(typeof s){case"undefined":return _.undefined;case"string":return _.string;case"number":return Number.isNaN(s)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(s)?_.array:s===null?_.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?_.promise:typeof Map<"u"&&s instanceof Map?_.map:typeof Set<"u"&&s instanceof Set?_.set:typeof Date<"u"&&s instanceof Date?_.date:_.object;default:return _.unknown}},m=U.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 Re extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(o){return o.message},n={_errors:[]},r=o=>{for(const p of o.issues)if(p.code==="invalid_union")p.unionErrors.map(r);else if(p.code==="invalid_return_type")r(p.returnTypeError);else if(p.code==="invalid_arguments")r(p.argumentsError);else if(p.path.length===0)n._errors.push(t(p));else{let c=n,w=0;for(;w<p.path.length;){const b=p.path[w];w===p.path.length-1?(c[b]=c[b]||{_errors:[]},c[b]._errors.push(t(p))):c[b]=c[b]||{_errors:[]},c=c[b],w++}}};return r(this),n}static assert(e){if(!(e instanceof Re))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,U.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Re.create=s=>new Re(s);const $t=(s,e)=>{let t;switch(s.code){case m.invalid_type:s.received===_.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case m.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,U.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:t=`Unrecognized key(s) in object: ${U.joinValues(s.keys,", ")}`;break;case m.invalid_union:t="Invalid input";break;case m.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${U.joinValues(s.options)}`;break;case m.invalid_enum_value:t=`Invalid enum value. Expected ${U.joinValues(s.options)}, received '${s.received}'`;break;case m.invalid_arguments:t="Invalid function arguments";break;case m.invalid_return_type:t="Invalid function return type";break;case m.invalid_date:t="Invalid date";break;case m.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:U.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case m.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case m.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case m.custom:t="Invalid input";break;case m.invalid_intersection_types:t="Intersection results could not be merged";break;case m.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case m.not_finite:t="Number must be finite";break;default:t=e.defaultError,U.assertNever(s)}return{message:t}};let bo=$t;function ko(){return bo}const wo=s=>{const{data:e,path:t,errorMaps:n,issueData:r}=s,o=[...t,...r.path||[]],p={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let c="";const w=n.filter(b=>!!b).slice().reverse();for(const b of w)c=b(p,{data:e,defaultError:c}).message;return{...r,path:o,message:c}};function k(s,e){const t=ko(),n=wo({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===$t?void 0:$t].filter(r=>!!r)});s.common.issues.push(n)}class pe{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if(r.status==="aborted")return j;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const o=await r.key,p=await r.value;n.push({key:o,value:p})}return pe.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:o,value:p}=r;if(o.status==="aborted"||p.status==="aborted")return j;o.status==="dirty"&&e.dirty(),p.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof p.value<"u"||r.alwaysSet)&&(n[o.value]=p.value)}return{status:e.value,value:n}}}const j=Object.freeze({status:"aborted"}),Qe=s=>({status:"dirty",value:s}),we=s=>({status:"valid",value:s}),la=s=>s.status==="aborted",da=s=>s.status==="dirty",He=s=>s.status==="valid",ft=s=>typeof Promise<"u"&&s instanceof Promise;var T;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e?.message})(T||(T={}));class Me{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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 ua=(s,e)=>{if(He(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Re(s.common.issues);return this._error=t,this._error}}};function R(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:r}=s;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(p,c)=>{const{message:w}=s;return p.code==="invalid_enum_value"?{message:w??c.defaultError}:typeof c.data>"u"?{message:w??n??c.defaultError}:p.code!=="invalid_type"?{message:c.defaultError}:{message:w??t??c.defaultError}},description:r}}class L{get description(){return this._def.description}_getType(e){return Le(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pe,ctx:{common:e.parent.common,data:e.data,parsedType:Le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ft(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)},r=this._parseSync({data:e,path:n.path,parent:n});return ua(n,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return He(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>He(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(ft(r)?r:Promise.resolve(r));return ua(n,o)}refine(e,t){const n=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,o)=>{const p=e(r),c=()=>o.addIssue({code:m.custom,...n(r)});return typeof Promise<"u"&&p instanceof Promise?p.then(w=>w?!0:(c(),!1)):p?!0:(c(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t=="function"?t(n,r):t),!1))}_refinement(e){return new Ke({schema:this,typeName:D.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:t=>this["~validate"](t)}}optional(){return Pe.create(this,this._def)}nullable(){return We.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Oe.create(this)}promise(){return yt.create(this,this._def)}or(e){return xt.create([this,e],this._def)}and(e){return vt.create(this,e,this._def)}transform(e){return new Ke({...R(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Et({...R(this._def),innerType:this,defaultValue:t,typeName:D.ZodDefault})}brand(){return new Ho({typeName:D.ZodBranded,type:this,...R(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Lt({...R(this._def),innerType:this,catchValue:t,typeName:D.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Zt.create(this,e)}readonly(){return Pt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const _o=/^c[^\s-]{8,}$/i,So=/^[0-9a-z]+$/,To=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Co=/^[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,Ao=/^[a-z0-9_-]{21}$/i,No=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Io=/^[-+]?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)?)??$/,Oo=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Mo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ot;const Do=/^(?:(?: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])$/,$o=/^(?:(?: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])$/,jo=/^(([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]))$/,Ro=/^(([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])$/,Eo=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Lo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Aa="((\\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])))",Po=new RegExp(`^${Aa}$`);function Na(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Vo(s){return new RegExp(`^${Na(s)}$`)}function Bo(s){let e=`${Aa}T${Na(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Zo(s,e){return!!((e==="v4"||!e)&&Do.test(s)||(e==="v6"||!e)&&jo.test(s))}function Uo(s,e){if(!No.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function Jo(s,e){return!!((e==="v4"||!e)&&$o.test(s)||(e==="v6"||!e)&&Ro.test(s))}class je extends L{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_type,expected:_.string,received:o.parsedType}),j}const n=new pe;let r;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const p=e.data.length>o.value,c=e.data.length<o.value;(p||c)&&(r=this._getOrReturnCtx(e,r),p?k(r,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&k(r,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Oo.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"email",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Ot||(Ot=new RegExp(Mo,"u")),Ot.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"emoji",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Co.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"uuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Ao.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"nanoid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")_o.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")So.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cuid2",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")To.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"ulid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),k(r,{validation:"url",code:m.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"regex",code:m.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Bo(o).test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Po.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Vo(o).test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Io.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"duration",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Zo(e.data,o.version)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"ip",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Uo(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"jwt",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Jo(e.data,o.version)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cidr",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Eo.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"base64",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Lo.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"base64url",code:m.invalid_string,message:o.message}),n.dirty()):U.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(r=>e.test(r),{validation:t,code:m.invalid_string,...T.errToObj(n)})}_addCheck(e){return new je({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...T.errToObj(e)})}url(e){return this._addCheck({kind:"url",...T.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...T.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...T.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...T.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...T.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...T.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...T.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...T.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...T.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...T.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...T.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...T.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,...T.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,...T.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...T.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...T.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...T.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...T.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...T.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...T.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...T.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...T.errToObj(t)})}nonempty(e){return this.min(1,T.errToObj(e))}trim(){return new je({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new je({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new je({...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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}je.create=s=>new je({checks:[],typeName:D.ZodString,coerce:s?.coerce??!1,...R(s)});function Fo(s,e){const t=(s.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=t>n?t:n,o=Number.parseInt(s.toFixed(r).replace(".","")),p=Number.parseInt(e.toFixed(r).replace(".",""));return o%p/10**r}class ze extends L{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)!==_.number){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_type,expected:_.number,received:o.parsedType}),j}let n;const r=new pe;for(const o of this._def.checks)o.kind==="int"?U.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:m.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?Fo(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_finite,message:o.message}),r.dirty()):U.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,T.toString(t))}gt(e,t){return this.setLimit("min",e,!1,T.toString(t))}lte(e,t){return this.setLimit("max",e,!0,T.toString(t))}lt(e,t){return this.setLimit("max",e,!1,T.toString(t))}setLimit(e,t,n,r){return new ze({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:T.toString(r)}]})}_addCheck(e){return new ze({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:T.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:T.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:T.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:T.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&U.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ze.create=s=>new ze({checks:[],typeName:D.ZodNumber,coerce:s?.coerce||!1,...R(s)});class et extends L{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)!==_.bigint)return this._getInvalidInput(e);let n;const r=new pe;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):U.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return k(t,{code:m.invalid_type,expected:_.bigint,received:t.parsedType}),j}gte(e,t){return this.setLimit("min",e,!0,T.toString(t))}gt(e,t){return this.setLimit("min",e,!1,T.toString(t))}lte(e,t){return this.setLimit("max",e,!0,T.toString(t))}lt(e,t){return this.setLimit("max",e,!1,T.toString(t))}setLimit(e,t,n,r){return new et({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:T.toString(r)}]})}_addCheck(e){return new et({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}et.create=s=>new et({checks:[],typeName:D.ZodBigInt,coerce:s?.coerce??!1,...R(s)});class ca extends L{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.boolean,received:n.parsedType}),j}return we(e.data)}}ca.create=s=>new ca({typeName:D.ZodBoolean,coerce:s?.coerce||!1,...R(s)});class ht extends L{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_type,expected:_.date,received:o.parsedType}),j}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_date}),j}const n=new pe;let r;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):U.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ht({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:T.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:T.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}ht.create=s=>new ht({checks:[],coerce:s?.coerce||!1,typeName:D.ZodDate,...R(s)});class pa extends L{_parse(e){if(this._getType(e)!==_.symbol){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.symbol,received:n.parsedType}),j}return we(e.data)}}pa.create=s=>new pa({typeName:D.ZodSymbol,...R(s)});class ma extends L{_parse(e){if(this._getType(e)!==_.undefined){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.undefined,received:n.parsedType}),j}return we(e.data)}}ma.create=s=>new ma({typeName:D.ZodUndefined,...R(s)});class fa extends L{_parse(e){if(this._getType(e)!==_.null){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.null,received:n.parsedType}),j}return we(e.data)}}fa.create=s=>new fa({typeName:D.ZodNull,...R(s)});class jt extends L{constructor(){super(...arguments),this._any=!0}_parse(e){return we(e.data)}}jt.create=s=>new jt({typeName:D.ZodAny,...R(s)});class ha extends L{constructor(){super(...arguments),this._unknown=!0}_parse(e){return we(e.data)}}ha.create=s=>new ha({typeName:D.ZodUnknown,...R(s)});class Ve extends L{_parse(e){const t=this._getOrReturnCtx(e);return k(t,{code:m.invalid_type,expected:_.never,received:t.parsedType}),j}}Ve.create=s=>new Ve({typeName:D.ZodNever,...R(s)});class xa extends L{_parse(e){if(this._getType(e)!==_.undefined){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.void,received:n.parsedType}),j}return we(e.data)}}xa.create=s=>new xa({typeName:D.ZodVoid,...R(s)});class Oe extends L{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==_.array)return k(t,{code:m.invalid_type,expected:_.array,received:t.parsedType}),j;if(r.exactLength!==null){const p=t.data.length>r.exactLength.value,c=t.data.length<r.exactLength.value;(p||c)&&(k(t,{code:p?m.too_big:m.too_small,minimum:c?r.exactLength.value:void 0,maximum:p?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(k(t,{code:m.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(k(t,{code:m.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((p,c)=>r.type._parseAsync(new Me(t,p,t.path,c)))).then(p=>pe.mergeArray(n,p));const o=[...t.data].map((p,c)=>r.type._parseSync(new Me(t,p,t.path,c)));return pe.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Oe({...this._def,minLength:{value:e,message:T.toString(t)}})}max(e,t){return new Oe({...this._def,maxLength:{value:e,message:T.toString(t)}})}length(e,t){return new Oe({...this._def,exactLength:{value:e,message:T.toString(t)}})}nonempty(e){return this.min(1,e)}}Oe.create=(s,e)=>new Oe({type:s,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...R(e)});function Je(s){if(s instanceof ae){const e={};for(const t in s.shape){const n=s.shape[t];e[t]=Pe.create(Je(n))}return new ae({...s._def,shape:()=>e})}else return s instanceof Oe?new Oe({...s._def,type:Je(s.element)}):s instanceof Pe?Pe.create(Je(s.unwrap())):s instanceof We?We.create(Je(s.unwrap())):s instanceof Ze?Ze.create(s.items.map(e=>Je(e))):s}class ae extends L{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(),t=U.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==_.object){const b=this._getOrReturnCtx(e);return k(b,{code:m.invalid_type,expected:_.object,received:b.parsedType}),j}const{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:p}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ve&&this._def.unknownKeys==="strip"))for(const b in r.data)p.includes(b)||c.push(b);const w=[];for(const b of p){const O=o[b],de=r.data[b];w.push({key:{status:"valid",value:b},value:O._parse(new Me(r,de,r.path,b)),alwaysSet:b in r.data})}if(this._def.catchall instanceof Ve){const b=this._def.unknownKeys;if(b==="passthrough")for(const O of c)w.push({key:{status:"valid",value:O},value:{status:"valid",value:r.data[O]}});else if(b==="strict")c.length>0&&(k(r,{code:m.unrecognized_keys,keys:c}),n.dirty());else if(b!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const b=this._def.catchall;for(const O of c){const de=r.data[O];w.push({key:{status:"valid",value:O},value:b._parse(new Me(r,de,r.path,O)),alwaysSet:O in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const b=[];for(const O of w){const de=await O.key,K=await O.value;b.push({key:de,value:K,alwaysSet:O.alwaysSet})}return b}).then(b=>pe.mergeObjectSync(n,b)):pe.mergeObjectSync(n,w)}get shape(){return this._def.shape()}strict(e){return T.errToObj,new ae({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{const r=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:T.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:D.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ae({...this._def,catchall:e})}pick(e){const t={};for(const n of U.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new ae({...this._def,shape:()=>t})}omit(e){const t={};for(const n of U.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new ae({...this._def,shape:()=>t})}deepPartial(){return Je(this)}partial(e){const t={};for(const n of U.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new ae({...this._def,shape:()=>t})}required(e){const t={};for(const n of U.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Pe;)o=o._def.innerType;t[n]=o}return new ae({...this._def,shape:()=>t})}keyof(){return Ia(U.objectKeys(this.shape))}}ae.create=(s,e)=>new ae({shape:()=>s,unknownKeys:"strip",catchall:Ve.create(),typeName:D.ZodObject,...R(e)});ae.strictCreate=(s,e)=>new ae({shape:()=>s,unknownKeys:"strict",catchall:Ve.create(),typeName:D.ZodObject,...R(e)});ae.lazycreate=(s,e)=>new ae({shape:s,unknownKeys:"strip",catchall:Ve.create(),typeName:D.ZodObject,...R(e)});class xt extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(const c of o)if(c.result.status==="valid")return c.result;for(const c of o)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;const p=o.map(c=>new Re(c.ctx.common.issues));return k(t,{code:m.invalid_union,unionErrors:p}),j}if(t.common.async)return Promise.all(n.map(async o=>{const p={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:p}),ctx:p}})).then(r);{let o;const p=[];for(const w of n){const b={...t,common:{...t.common,issues:[]},parent:null},O=w._parseSync({data:t.data,path:t.path,parent:b});if(O.status==="valid")return O;O.status==="dirty"&&!o&&(o={result:O,ctx:b}),b.common.issues.length&&p.push(b.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;const c=p.map(w=>new Re(w));return k(t,{code:m.invalid_union,unionErrors:c}),j}}get options(){return this._def.options}}xt.create=(s,e)=>new xt({options:s,typeName:D.ZodUnion,...R(e)});function Rt(s,e){const t=Le(s),n=Le(e);if(s===e)return{valid:!0,data:s};if(t===_.object&&n===_.object){const r=U.objectKeys(e),o=U.objectKeys(s).filter(c=>r.indexOf(c)!==-1),p={...s,...e};for(const c of o){const w=Rt(s[c],e[c]);if(!w.valid)return{valid:!1};p[c]=w.data}return{valid:!0,data:p}}else if(t===_.array&&n===_.array){if(s.length!==e.length)return{valid:!1};const r=[];for(let o=0;o<s.length;o++){const p=s[o],c=e[o],w=Rt(p,c);if(!w.valid)return{valid:!1};r.push(w.data)}return{valid:!0,data:r}}else return t===_.date&&n===_.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class vt extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(o,p)=>{if(la(o)||la(p))return j;const c=Rt(o.value,p.value);return c.valid?((da(o)||da(p))&&t.dirty(),{status:t.value,value:c.data}):(k(n,{code:m.invalid_intersection_types}),j)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,p])=>r(o,p)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}vt.create=(s,e,t)=>new vt({left:s,right:e,typeName:D.ZodIntersection,...R(t)});class Ze extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.array)return k(n,{code:m.invalid_type,expected:_.array,received:n.parsedType}),j;if(n.data.length<this._def.items.length)return k(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&n.data.length>this._def.items.length&&(k(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...n.data].map((p,c)=>{const w=this._def.items[c]||this._def.rest;return w?w._parse(new Me(n,p,n.path,c)):null}).filter(p=>!!p);return n.common.async?Promise.all(o).then(p=>pe.mergeArray(t,p)):pe.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Ze({...this._def,rest:e})}}Ze.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ze({items:s,typeName:D.ZodTuple,rest:null,...R(e)})};class gt extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.object)return k(n,{code:m.invalid_type,expected:_.object,received:n.parsedType}),j;const r=[],o=this._def.keyType,p=this._def.valueType;for(const c in n.data)r.push({key:o._parse(new Me(n,c,n.path,c)),value:p._parse(new Me(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?pe.mergeObjectAsync(t,r):pe.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof L?new gt({keyType:e,valueType:t,typeName:D.ZodRecord,...R(n)}):new gt({keyType:je.create(),valueType:e,typeName:D.ZodRecord,...R(t)})}}class va extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.map)return k(n,{code:m.invalid_type,expected:_.map,received:n.parsedType}),j;const r=this._def.keyType,o=this._def.valueType,p=[...n.data.entries()].map(([c,w],b)=>({key:r._parse(new Me(n,c,n.path,[b,"key"])),value:o._parse(new Me(n,w,n.path,[b,"value"]))}));if(n.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const w of p){const b=await w.key,O=await w.value;if(b.status==="aborted"||O.status==="aborted")return j;(b.status==="dirty"||O.status==="dirty")&&t.dirty(),c.set(b.value,O.value)}return{status:t.value,value:c}})}else{const c=new Map;for(const w of p){const b=w.key,O=w.value;if(b.status==="aborted"||O.status==="aborted")return j;(b.status==="dirty"||O.status==="dirty")&&t.dirty(),c.set(b.value,O.value)}return{status:t.value,value:c}}}}va.create=(s,e,t)=>new va({valueType:e,keyType:s,typeName:D.ZodMap,...R(t)});class tt extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.set)return k(n,{code:m.invalid_type,expected:_.set,received:n.parsedType}),j;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(k(n,{code:m.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(k(n,{code:m.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const o=this._def.valueType;function p(w){const b=new Set;for(const O of w){if(O.status==="aborted")return j;O.status==="dirty"&&t.dirty(),b.add(O.value)}return{status:t.value,value:b}}const c=[...n.data.values()].map((w,b)=>o._parse(new Me(n,w,n.path,b)));return n.common.async?Promise.all(c).then(w=>p(w)):p(c)}min(e,t){return new tt({...this._def,minSize:{value:e,message:T.toString(t)}})}max(e,t){return new tt({...this._def,maxSize:{value:e,message:T.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}tt.create=(s,e)=>new tt({valueType:s,minSize:null,maxSize:null,typeName:D.ZodSet,...R(e)});class ga extends L{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ga.create=(s,e)=>new ga({getter:s,typeName:D.ZodLazy,...R(e)});class ya extends L{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return k(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}}ya.create=(s,e)=>new ya({value:s,typeName:D.ZodLiteral,...R(e)});function Ia(s,e){return new Ge({values:s,typeName:D.ZodEnum,...R(e)})}class Ge extends L{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return k(t,{expected:U.joinValues(n),received:t.parsedType,code:m.invalid_type}),j}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return k(t,{received:t.data,code:m.invalid_enum_value,options:n}),j}return we(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ge.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ge.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}Ge.create=Ia;class ba extends L{_parse(e){const t=U.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_.string&&n.parsedType!==_.number){const r=U.objectValues(t);return k(n,{expected:U.joinValues(r),received:n.parsedType,code:m.invalid_type}),j}if(this._cache||(this._cache=new Set(U.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=U.objectValues(t);return k(n,{received:n.data,code:m.invalid_enum_value,options:r}),j}return we(e.data)}get enum(){return this._def.values}}ba.create=(s,e)=>new ba({values:s,typeName:D.ZodNativeEnum,...R(e)});class yt extends L{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.promise&&t.common.async===!1)return k(t,{code:m.invalid_type,expected:_.promise,received:t.parsedType}),j;const n=t.parsedType===_.promise?t.data:Promise.resolve(t.data);return we(n.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}yt.create=(s,e)=>new yt({type:s,typeName:D.ZodPromise,...R(e)});class Ke extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:p=>{k(n,p),p.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){const p=r.transform(n.data,o);if(n.common.async)return Promise.resolve(p).then(async c=>{if(t.value==="aborted")return j;const w=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return w.status==="aborted"?j:w.status==="dirty"||t.value==="dirty"?Qe(w.value):w});{if(t.value==="aborted")return j;const c=this._def.schema._parseSync({data:p,path:n.path,parent:n});return c.status==="aborted"?j:c.status==="dirty"||t.value==="dirty"?Qe(c.value):c}}if(r.type==="refinement"){const p=c=>{const w=r.refinement(c,o);if(n.common.async)return Promise.resolve(w);if(w instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?j:(c.status==="dirty"&&t.dirty(),p(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?j:(c.status==="dirty"&&t.dirty(),p(c.value).then(()=>({status:t.value,value:c.value}))))}if(r.type==="transform")if(n.common.async===!1){const p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!He(p))return j;const c=r.transform(p.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>He(p)?Promise.resolve(r.transform(p.value,o)).then(c=>({status:t.value,value:c})):j);U.assertNever(r)}}Ke.create=(s,e,t)=>new Ke({schema:s,typeName:D.ZodEffects,effect:e,...R(t)});Ke.createWithPreprocess=(s,e,t)=>new Ke({schema:e,effect:{type:"preprocess",transform:s},typeName:D.ZodEffects,...R(t)});class Pe extends L{_parse(e){return this._getType(e)===_.undefined?we(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pe.create=(s,e)=>new Pe({innerType:s,typeName:D.ZodOptional,...R(e)});class We extends L{_parse(e){return this._getType(e)===_.null?we(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}We.create=(s,e)=>new We({innerType:s,typeName:D.ZodNullable,...R(e)});class Et extends L{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Et.create=(s,e)=>new Et({innerType:s,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...R(e)});class Lt extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ft(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Re(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Re(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Lt.create=(s,e)=>new Lt({innerType:s,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...R(e)});class ka extends L{_parse(e){if(this._getType(e)!==_.nan){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.nan,received:n.parsedType}),j}return{status:"valid",value:e.data}}}ka.create=s=>new ka({typeName:D.ZodNaN,...R(s)});class Ho extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Zt extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?j:o.status==="dirty"?(t.dirty(),Qe(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?j:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new Zt({in:e,out:t,typeName:D.ZodPipeline})}}class Pt extends L{_parse(e){const t=this._def.innerType._parse(e),n=r=>(He(r)&&(r.value=Object.freeze(r.value)),r);return ft(t)?t.then(r=>n(r)):n(t)}unwrap(){return this._def.innerType}}Pt.create=(s,e)=>new Pt({innerType:s,typeName:D.ZodReadonly,...R(e)});var D;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(D||(D={}));const x=je.create,Xe=ze.create,wa=jt.create;Ve.create;const ie=Oe.create,ee=ae.create;xt.create;vt.create;Ze.create;const zo=gt.create,Go=Ge.create;yt.create;Pe.create;We.create;const Ko=ee({label:x().min(1).max(40),left:x().min(1).max(35),right:x().min(1).max(35)}),Wo=ee({id:x().optional().default(()=>`post-${Date.now()}`).transform(s=>s||`post-${Date.now()}`),templateId:x().optional(),category:x().optional().default("TECH"),theme:Go(["blue-tech","emerald-finance","slate-education","dark-contrast","crimson-alert","amber-gold","cyber-violet","sunset-orange","nordic-frost","monochrome-luxe"]).default("blue-tech"),layoutType:x().default("table"),title:x().min(1).max(120),subtitle:x().min(1).max(250),leftHeader:x().optional().default("USA 🇺🇸"),rightHeader:x().optional().default("UK 🇬🇧"),rows:ie(Ko).optional().default([]),bullets:ie(ee({highlight:x().optional().default(""),text:x().min(1)})).optional().default([]),bigStat:ee({number:x().default("$165,000"),label:x().default("Average Compensation"),subtext:x().optional().default(""),secondaryNumber:x().optional().default(""),secondaryLabel:x().optional().default("")}).optional(),listItems:ie(ee({rank:Xe(),title:x(),value:x(),tag:x().optional().default("")})).optional().default([]),quoteData:ee({quote:x(),highlight:x().optional().default(""),source:x().default("Industry Insider")}).optional(),versusData:ee({leftEntity:x().optional(),leftStats:ie(ee({label:x(),value:x()})).optional(),leftPerk:x().optional(),rightEntity:x().optional(),rightStats:ie(ee({label:x(),value:x()})).optional(),rightPerk:x().optional(),verdict:x().optional()}).optional(),receiptData:ee({grossMonthly:x().optional(),items:ie(ee({label:x(),amount:x(),note:x().optional()})).optional(),totalDeductions:x().optional(),netRemaining:x().optional()}).optional(),timelineData:ee({pastYear:x().optional().default("2016"),presentYear:x().optional().default("2026"),items:ie(ee({label:x(),pastValue:x(),presentValue:x(),changeBadge:x().optional()})).optional(),bottomInsight:x().optional()}).optional(),barchartData:ie(ee({label:x(),percentage:Xe().min(0).max(100),amount:x().optional(),tag:x().optional()})).optional().default([]),leaderboardData:ee({calloutNote:x().optional().default("*Asumsi kurs : Rp15.500/US$"),items:ie(ee({rank:Xe(),name:x(),flag:x().optional().default("🌐"),value:x(),percentage:Xe().min(0).max(100).optional()})).optional()}).optional(),editorialData:ee({badge:x().optional().default("INVESTIGASI KHUSUS"),highlightPhrase:x().optional(),cards:ie(ee({step:x().optional(),title:x(),text:x(),stat:x().optional()})).optional(),keyTakeaway:x().optional()}).optional(),matrixData:ee({headers:ie(x()).optional().default(["Indikator","🇮🇩 IDN","🇲🇾 MYS","🇸🇬 SGP"]),rows:ie(ee({label:x(),values:ie(x())})).optional()}).optional(),debateData:ee({proTitle:x().optional().default("SISI PRO / BENEFIT"),proScore:x().optional().default("65%"),proPoints:ie(x()).optional(),conTitle:x().optional().default("SISI KONTRA / RISIKO"),conScore:x().optional().default("35%"),conPoints:ie(x()).optional(),callToAction:x().optional().default("Kalian di tim mana? Tulis pendapatmu di bawah! 👇")}).optional(),tierlistData:ie(ee({tier:x(),tierColor:x().optional(),items:ie(ee({name:x(),badge:x().optional(),desc:x().optional()}))})).optional().default([]),customHtml:x().optional(),customCss:x().optional(),customFields:zo(wa()).optional(),items:ie(wa()).optional(),footerNote:x().optional().default("Industry Benchmark 2026"),sourceUrl:x().optional(),methodologyBadge:x().optional(),disclaimer:x().optional(),watermark:x().optional().default("@SocialGen"),bgKeyword:x().optional().default("modern office coding night"),reelsDuration:Xe().min(5).max(90).default(30),caption:x().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")}),qo={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"},Yo={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"},Xo={class:"flex items-center gap-2.5 sm:gap-3"},Qo={class:"text-sm font-extrabold tracking-tight text-white flex items-center gap-1.5 sm:gap-2"},el={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"},tl={class:"flex items-center gap-2 sm:gap-3 text-xs"},al={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]"},sl={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]"},nl={class:"lg:hidden flex items-center justify-center px-3 py-2 bg-slate-900/90 border-b border-slate-800 flex-shrink-0"},il={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"},rl={key:0,class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"},ol={class:"flex items-center gap-2"},ll={key:0,class:"text-emerald-400"},dl={key:1,class:"text-rose-400"},ul={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"},ml=Vt({__name:"index",setup(s){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"}),t=S({theme:"blue-tech",backgroundSource:"pexels",musicFile:"random",videoStartOffset:0,audioStartOffset:0,outputs:{feed:!0,story:!0,reels:!0}}),n=S([]),r=S(-1),o=S(null);function p(N){if(!e.value||!e.value.title||o.value)return;const h=JSON.stringify(e.value),Y=N?JSON.stringify(N):"";if(h!==Y){o.value=JSON.parse(h);try{localStorage.setItem("sg_unsaved_stash",h)}catch{}}}function c(){if(!o.value)return;const N=o.value.title||"Editan Anda";e.value=JSON.parse(JSON.stringify(o.value)),o.value.theme&&(t.value.theme=o.value.theme),o.value=null,r.value=-1,M.value=-1;try{localStorage.removeItem("sg_unsaved_stash")}catch{}Q(`Editan sebelumnya ("${N.slice(0,24)}...") berhasil dikembalikan! ↩️`,"success")}function w(){o.value=null;try{localStorage.removeItem("sg_unsaved_stash")}catch{}}function b(){try{localStorage.setItem("sg_drafts",JSON.stringify(n.value))}catch{}$fetch("/api/drafts",{method:"POST",body:{drafts:n.value}}).catch(()=>{})}function O(){n.value.unshift(JSON.parse(JSON.stringify(e.value))),r.value=0,M.value=-1,b(),Q("Draft berhasil disimpan!")}function de(N){const h=n.value[N];if(h){p(h),e.value=JSON.parse(JSON.stringify(h)),h.theme&&(t.value.theme=h.theme),r.value=N,M.value=-1;const Y=!!o.value;Q(`Memuat draft #${N+1}: "${(h.title||"Untitled").slice(0,20)}..."`,"success",Y?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function K(N){n.value.splice(N,1),r.value===N&&(r.value=-1),b(),Q("Draft dihapus")}const $=S([]),M=S(-1);function Z(){try{localStorage.setItem("sg_gen_history",JSON.stringify($.value))}catch{}$fetch("/api/generation-history",{method:"POST",body:{history:$.value}}).catch(()=>{})}function P(N){const h=$.value[N];if(h){const Y=h.contentData||h;p(Y),e.value=JSON.parse(JSON.stringify(Y)),h.options&&(t.value={...t.value,...h.options}),M.value=N,r.value=-1;const Te=!!o.value;Q(`Memuat riwayat: "${(h.title||"Untitled").slice(0,24)}..."`,"success",Te?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function ve(N){$.value.splice(N,1),M.value===N&&(M.value=-1),Z(),Q("Item riwayat dihapus")}function De(){$.value=[],M.value=-1,Z(),Q("Seluruh riwayat generate berhasil dibersihkan!")}let ue=null;function oe(){try{localStorage.setItem("sg_active_content",JSON.stringify(e.value)),localStorage.setItem("sg_active_options",JSON.stringify(t.value))}catch{}clearTimeout(ue),ue=setTimeout(()=>{$fetch("/api/last-session",{method:"POST",body:{content:e.value,options:t.value}}).catch(()=>{})},1e3)}xe(()=>e.value,oe,{deep:!0}),xe(()=>t.value,oe,{deep:!0});const re=S(!1),X=S(!1),$e=S(""),G=S(null),me=S(""),ne=S("success"),F=S("editor"),q=S(null);Bt(async()=>{try{const N=localStorage.getItem("sg_active_content");if(N){const h=JSON.parse(N);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&&(t.value={...t.value,...h.session.options}))}}catch{}try{const N=localStorage.getItem("sg_active_options");if(N){const h=JSON.parse(N);h&&(t.value={...t.value,...h})}}catch{}try{const N=await $fetch("/api/drafts");if(N?.drafts&&Array.isArray(N.drafts)&&N.drafts.length>0)n.value=N.drafts;else{const h=localStorage.getItem("sg_drafts");if(h){const Y=JSON.parse(h);Array.isArray(Y)&&Y.length>0&&(n.value=Y,$fetch("/api/drafts",{method:"POST",body:{drafts:Y}}).catch(()=>{}))}}}catch{const N=localStorage.getItem("sg_drafts");if(N)try{n.value=JSON.parse(N)}catch{}}try{const N=await $fetch("/api/generation-history");if(N?.history&&Array.isArray(N.history)&&N.history.length>0)$.value=N.history;else{const h=localStorage.getItem("sg_gen_history");h&&($.value=JSON.parse(h))}}catch{}try{const N=await $fetch("/api/status");q.value=N}catch{}try{const N=localStorage.getItem("sg_unsaved_stash");N&&(o.value=JSON.parse(N))}catch{}});const te=ce(()=>{const N=Wo.safeParse(e.value);if(N.success)return{isValid:!0,error:""};{const h=N.error.errors[0];return{isValid:!1,error:`${h.path.join(".")}: ${h.message}`}}}),fe=S(null);let _e=null;function Q(N,h="success",Y){clearTimeout(_e),me.value=N,ne.value=h,fe.value=Y||null,_e=setTimeout(()=>{me.value="",fe.value=null},Y?7e3:4e3)}async function I(N,h,Y,Te){X.value=!0,$e.value=`AI Research (${Y||"Gemini"})...`;try{const V=await $fetch("/api/auto-topic",{method:"POST",body:{niche:N,layoutType:h,model:Y,language:Te}});if(V?.dataset){p(V.dataset),e.value=V.dataset,t.value.theme=V.dataset.theme,n.value.unshift(V.dataset),r.value=0,b();const Se=!!o.value;V.source==="gemini"?Q(`✨ [${V.modelUsed||"Gemini"}] Berhasil meriset: "${V.dataset.title.slice(0,32)}..."`,"success",Se?{label:"↩️ Kembalikan Editan",onClick:c}:void 0):Q(`ℹ️ [Curated Data] Topik siap: "${V.dataset.title.slice(0,32)}..."`,"success",Se?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}catch(V){Q("Gagal auto-topic: "+(V.data?.statusMessage||V.message),"error")}finally{X.value=!1,$e.value=""}}async function qe(){if(!te.value.isValid){Q("Data tidak valid: "+te.value.error,"error");return}re.value=!0,$e.value="Rendering Images & Reels...",G.value=null;const N={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(t.value))};$.value.unshift(N),M.value=0,Z(),F.value="preview";try{const h=await $fetch("/api/generate",{method:"POST",body:{data:e.value,options:t.value}});h?.success&&(G.value=h,Q(`Sukses dirender dalam ${(h.durationMs/1e3).toFixed(1)} detik!`))}catch(h){Q("Gagal render: "+(h.data?.statusMessage||h.message),"error")}finally{re.value=!1,$e.value=""}}return(N,h)=>{const Y=Ar,Te=yo;return f(),g("div",qo,[a("header",Yo,[a("div",Xo,[h[11]||(h[11]=a("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)),a("div",null,[a("h1",Qo,[h[10]||(h[10]=z(" SocialGen ",-1)),a("span",el," v"+y(l(q)?.version||"2.3.2"),1)])])]),a("div",tl,[l(q)?.geminiActive?(f(),g("span",al," ● AI Connected ")):(f(),g("span",sl," ● Local Engine "))])]),a("div",nl,[a("div",il,[a("button",{onClick:h[0]||(h[0]=V=>F.value="editor"),class:H(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(F)==="editor"?"bg-sky-500 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[...h[12]||(h[12]=[a("span",null,"⚙️ Studio & Editor",-1)])],2),a("button",{onClick:h[1]||(h[1]=V=>F.value="preview"),class:H(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(F)==="preview"?"bg-indigo-600 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[h[13]||(h[13]=a("span",null,"👁️ Live Preview",-1)),l(G)?(f(),g("span",rl)):E("",!0)],2)])]),l(me)?(f(),g("div",{key:0,class:H(["fixed bottom-6 right-6 z-50 flex items-center gap-3 px-4 py-3 rounded-2xl shadow-2xl text-xs font-bold border transition-all",l(ne)==="success"?"bg-slate-900 text-slate-100 border-sky-500/50 shadow-sky-950/50":"bg-rose-950 text-rose-200 border-rose-500/50"])},[a("div",ol,[l(ne)==="success"?(f(),g("span",ll,"●")):(f(),g("span",dl,"⚠️")),a("span",null,y(l(me)),1)]),l(fe)?(f(),g("button",{key:0,onClick:h[2]||(h[2]=()=>{l(fe)?.onClick(),me.value="",fe.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"},y(l(fe).label),1)):E("",!0),a("button",{onClick:h[3]||(h[3]=V=>{me.value="",fe.value=null}),class:"text-slate-400 hover:text-white transition ml-1 text-xs"}," ✕ ")],2)):E("",!0),a("main",ul,[a("section",{class:H(["lg:col-span-5 h-full overflow-y-auto pr-1 flex-col gap-3 custom-scrollbar",l(F)==="editor"?"flex":"hidden lg:flex"])},[A(Y,{modelValue:l(e),"onUpdate:modelValue":h[4]||(h[4]=V=>Be(e)?e.value=V:null),options:l(t),"onUpdate:options":h[5]||(h[5]=V=>Be(t)?t.value=V:null),"is-valid":l(te).isValid,"validation-error":l(te).error,"is-generating":l(re),"generate-stage":l($e),"is-auto-topic-loading":l(X),drafts:l(n),"active-draft-index":l(r),history:l($),"active-history-index":l(M),"unsaved-stash":l(o),onGenerate:qe,onAutoTopic:I,onSelectDraft:de,onDeleteDraft:K,onSaveDraft:O,onSelectHistory:P,onDeleteHistory:ve,onClearAllHistory:De,onRestoreStash:c,onClearStash:w,onToast:h[6]||(h[6]=(V,Se)=>Q(V,Se))},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),a("section",{class:H(["lg:col-span-7 h-full flex-col gap-3 overflow-hidden justify-between min-h-0",l(F)==="preview"?"flex":"hidden lg:flex"])},[A(Te,{data:l(e),"selected-video":l(t).backgroundSource,"selected-music":l(t).musicFile,"video-start-offset":l(t).videoStartOffset,"onUpdate:videoStartOffset":h[7]||(h[7]=V=>l(t).videoStartOffset=V),"audio-start-offset":l(t).audioStartOffset,"onUpdate:audioStartOffset":h[8]||(h[8]=V=>l(t).audioStartOffset=V),"generated-result":l(G)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","generated-result"])],2)]),l(F)==="editor"?(f(),g("button",{key:1,onClick:h[9]||(h[9]=V=>F.value="preview"),class:"lg:hidden fixed bottom-5 left-1/2 -translate-x-1/2 z-40 px-5 py-2.5 rounded-full bg-gradient-to-r from-sky-500 to-indigo-600 text-white font-extrabold text-xs shadow-2xl border border-sky-400/40 flex items-center gap-2 hover:opacity-95"},[...h[14]||(h[14]=[a("span",null,"👁️ Lihat Preview Canvas",-1)])])):E("",!0)])}}});export{ml as default};
|
|
70
|
+
</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),[[ke,l(I).customHtml]])]),a("div",null,[i[81]||(i[81]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Custom CSS (Opsional - animasi, gradien unik, glassmorphism)",-1)),le(a("textarea",{"onUpdate:modelValue":i[16]||(i[16]=d=>l(I).customCss=d),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),[[ke,l(I).customCss]])])])):E("",!0),a("div",null,[i[82]||(i[82]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"AI Prompt Directive (Aturan Khusus Generator)",-1)),le(a("textarea",{"onUpdate:modelValue":i[17]||(i[17]=d=>l(I).promptDirective=d),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),[[ke,l(I).promptDirective]])]),a("div",null,[i[83]||(i[83]=a("div",{class:"flex items-center justify-between mb-1"},[a("label",{class:"text-[10px] font-bold text-slate-400"},"Sampel Data JSON (Pristine Default Tampilan)"),a("span",{class:"text-[10px] text-slate-500"},"Akan langsung ditampilkan di Live Preview")],-1)),le(a("textarea",{"onUpdate:modelValue":i[18]||(i[18]=d=>l(I).sampleJsonText=d),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),[[ke,l(I).sampleJsonText]])]),a("div",_n,[a("button",{onClick:Y,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 "),a("button",{onClick:st,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"},[A(l(Fe),{class:"w-3.5 h-3.5"}),a("span",null,y(l(F)?"Perbarui Template":"Simpan Template"),1)])])]))])])):E("",!0),a("div",Sn,[a("div",null,[a("h2",Tn,[A(l(as),{class:"w-3.5 h-3.5 text-sky-400"}),i[84]||(i[84]=z(" Content Studio ",-1))]),i[85]||(i[85]=a("p",{class:"text-[10px] text-slate-400"},"Multi-Format Studio",-1))]),a("div",Cn,[a("div",An,[le(a("select",{"onUpdate:modelValue":i[19]||(i[19]=d=>Be($)?$.value=d: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"},[(f(!0),g(Ae,null,Ne(l(K),d=>(f(),g("option",{key:d.id,value:d.id,class:"bg-slate-900 text-white"},y(d.name),9,Nn))),128))],512),[[lt,l($)]]),a("button",{onClick:De,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"},[A(l(Nt),{class:"w-3 h-3"}),i[86]||(i[86]=a("span",{class:"hidden sm:inline"},"Niche",-1))])]),a("div",In,[A(l(qa),{class:"w-3 h-3 text-emerald-400 ml-1 flex-shrink-0"}),le(a("select",{"onUpdate:modelValue":i[20]||(i[20]=d=>Be(X)?X.value=d: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"},[...i[87]||(i[87]=[dt('<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),[[lt,l(X)]])]),a("button",{onClick:Ea,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"},[A(l(aa),{class:"w-3 h-3"}),i[88]||(i[88]=a("span",{class:"hidden sm:inline"},"Prompt Manual",-1))]),a("button",{onClick:i[21]||(i[21]=d=>Xt()),disabled:s.isGenerating||s.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"},[A(l(ia),{class:H(["w-3.5 h-3.5",{"animate-spin":s.isAutoTopicLoading}])},null,8,["class"]),a("span",null,y(s.isAutoTopicLoading?"Meriset Data...":"✨ Auto-Topic"),1)],8,On),a("div",Mn,[i[93]||(i[93]=a("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)),a("div",Dn,[i[91]||(i[91]=a("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Model AI Engine",-1)),a("div",$n,[le(a("select",{"onUpdate:modelValue":i[22]||(i[22]=d=>Be(b)?b.value=d:null),class:"w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"},[...i[89]||(i[89]=[a("option",{value:"gemini-3.8-flash"},"⚡ Gemini 3.8 Flash",-1),a("option",{value:"gemini-3.5-flash"},"⚡ Gemini 3.5 Flash",-1),a("option",{value:"gemini-2.5-pro"},"💎 Gemini 2.5 Pro",-1),a("option",{value:"gemini-1.5-pro"},"💎 Gemini 1.5 Pro",-1)])],512),[[lt,l(b)]])]),i[92]||(i[92]=a("div",{class:"border-t border-slate-800 my-1"},null,-1)),a("div",jn,[i[90]||(i[90]=a("span",null,"Pilih Format Template",-1)),a("span",Rn,y(l(G).length)+" opsi",1)]),a("div",En,[(f(!0),g(Ae,null,Ne(l(G),d=>(f(),g("button",{key:d.id,onClick:B=>Xt(void 0,d.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"},[a("span",Pn,y(d.name),1),d.isBuiltin?E("",!0):(f(),g("span",Vn,"Kustom"))],8,Ln))),128))])])])])]),s.isAutoTopicLoading?(f(),g("div",Bn,[a("div",Zn,[A(l(ia),{class:"w-3.5 h-3.5 text-sky-400 animate-spin"})]),a("div",Un,[a("div",Jn,[i[94]||(i[94]=a("span",null,"AI Research Engine Sedang Bekerja...",-1)),a("span",Fn,y(l(b)),1)]),i[95]||(i[95]=a("p",{class:"text-[10px] text-slate-300 mt-0.5"},"Menganalisis angka perbandingan 2026 & meracik copywriting viral.",-1))])])):E("",!0),a("div",Hn,[a("div",zn,[a("button",{onClick:i[23]||(i[23]=d=>O.value="editor"),class:H(["px-2.5 py-1 rounded-lg transition text-[11px]",l(O)==="editor"?"bg-slate-800 text-sky-400 shadow font-bold":"text-slate-400 hover:text-white"])}," JSON Editor ",2),a("button",{onClick:i[24]||(i[24]=d=>O.value="drafts"),class:H(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(O)==="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"},[A(l(ea),{class:"w-3 h-3"}),a("span",null,"Drafts ("+y(s.drafts.length)+")",1)],2),a("button",{onClick:i[25]||(i[25]=d=>O.value="history"),class:H(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(O)==="history"?"bg-slate-800 text-purple-400 shadow font-bold":"text-slate-400 hover:text-white"]),title:"Riwayat otomatis setiap kali generate"},[A(l(ta),{class:"w-3 h-3"}),a("span",null,"Riwayat ("+y(s.history.length)+")",1)],2)]),a("div",Gn,[s.unsavedStash?(f(),g("button",{key:0,onClick:de,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"},[...i[96]||(i[96]=[a("span",null,"↩️ Kembali ke Editan",-1)])])):E("",!0),l(O)==="history"&&s.history.length>0?(f(),g("button",{key:1,onClick:Pa,class:"text-[10px] text-rose-400 hover:text-rose-300 transition font-bold pr-1",title:"Bersihkan semua riwayat generate"}," Bersihkan Riwayat ")):E("",!0),a("button",{onClick:i[26]||(i[26]=d=>n("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"},[A(l(ea),{class:"w-3 h-3"}),i[97]||(i[97]=a("span",null,"+ Simpan ke Draft",-1))])])]),l(O)==="drafts"?(f(),g("div",Kn,[s.unsavedStash?(f(),g("div",Wn,[a("div",qn,[i[99]||(i[99]=a("span",{class:"text-sm"},"✏️",-1)),a("div",Yn,[i[98]||(i[98]=a("span",{class:"font-bold text-[10px] block text-amber-300"},"Ada editan aktif sebelumnya:",-1)),a("span",Xn,'"'+y(s.unsavedStash.title||"Tanpa Judul")+'"',1)])]),a("div",Qn,[a("button",{onClick:de,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"},[...i[100]||(i[100]=[a("span",null,"↩️ Kembali ke Editan",-1)])]),a("button",{onClick:i[27]||(i[27]=d=>n("clearStash")),class:"p-1 hover:text-white text-amber-400/70 transition text-xs",title:"Abaikan & buang simpanan editan ini"}," ✕ ")])])):E("",!0),s.drafts.length===0?(f(),g("div",ei,[...i[101]||(i[101]=[z(" Belum ada draft tersimpan.",-1),a("br",null,null,-1),z(" Klik ",-1),a("b",{class:"text-amber-400"},"+ Simpan ke Draft",-1),z(" di atas untuk menyimpan konten ini agar bisa diedit/digenerate nanti! ",-1)])])):E("",!0),(f(!0),g(Ae,null,Ne(s.drafts,(d,B)=>(f(),g("div",{key:B,onClick:W=>n("selectDraft",B),"data-draft-item":"",class:H(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",s.activeDraftIndex===B?"bg-amber-500/15 border-amber-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[a("div",ai,[a("div",si,[a("span",ni,y(d.layoutType||"table"),1),a("span",ii,y(d.category),1)]),a("div",ri,y(d.title),1)]),a("button",{onClick:At(W=>n("deleteDraft",B),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus draft ini"},[A(l(pt),{class:"w-3.5 h-3.5"})],8,oi)],10,ti))),128))])):l(O)==="history"?(f(),g("div",li,[s.unsavedStash?(f(),g("div",di,[a("div",ui,[i[103]||(i[103]=a("span",{class:"text-sm"},"✏️",-1)),a("div",ci,[i[102]||(i[102]=a("span",{class:"font-bold text-[10px] block text-purple-300"},"Ada editan aktif sebelumnya:",-1)),a("span",pi,'"'+y(s.unsavedStash.title||"Tanpa Judul")+'"',1)])]),a("div",mi,[a("button",{onClick:de,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"},[...i[104]||(i[104]=[a("span",null,"↩️ Kembali ke Editan",-1)])]),a("button",{onClick:i[28]||(i[28]=d=>n("clearStash")),class:"p-1 hover:text-white text-purple-400/70 transition text-xs",title:"Abaikan & buang simpanan editan ini"}," ✕ ")])])):E("",!0),s.history.length===0?(f(),g("div",fi,[...i[105]||(i[105]=[z(" Belum ada riwayat pembuatan.",-1),a("br",null,null,-1),z(" Setiap kali kamu klik ",-1),a("b",{class:"text-sky-400"},"GENERATE CONTENT",-1),z(", hasil pembuatan akan otomatis tercatat di sini! ",-1)])])):E("",!0),(f(!0),g(Ae,null,Ne(s.history,(d,B)=>(f(),g("div",{key:B,onClick:W=>n("selectHistory",B),"data-history-item":"",class:H(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",s.activeHistoryIndex===B?"bg-purple-500/15 border-purple-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[a("div",xi,[a("div",vi,[a("span",gi,y(d.layoutType||"reels"),1),a("span",yi,y(d.category),1),d.generatedAt?(f(),g("span",bi,y(Va(d.generatedAt)),1)):E("",!0)]),a("div",ki,y(d.title),1)]),a("button",{onClick:At(W=>n("deleteHistory",B),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus riwayat ini"},[A(l(pt),{class:"w-3.5 h-3.5"})],8,wi)],10,hi))),128))])):(f(),g("div",_i,[a("div",Si,[a("div",null,[a("div",Ti,[a("label",Ci,[A(l(sa),{class:"w-3 h-3 text-sky-400"}),i[106]||(i[106]=z(" Format Template ",-1))]),a("button",{onClick:i[29]||(i[29]=d=>N("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"},[A(l(na),{class:"w-3 h-3"}),i[107]||(i[107]=a("span",null,"Kelola",-1))])]),a("select",{value:l(o),onChange:i[30]||(i[30]=d=>Tt(d.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]"},[(f(!0),g(Ae,null,Ne(l(G),d=>(f(),g("option",{key:d.id,value:d.id},y(d.name)+" "+y(d.isBuiltin?"":"⭐ (Kustom)"),9,Ni))),128))],40,Ai)]),a("div",null,[i[109]||(i[109]=a("label",{class:"block text-[10px] font-bold text-slate-300 mb-1"}," Theme Color (10 Pilihan) ",-1)),a("select",{value:s.modelValue.theme||"blue-tech",onChange:i[31]||(i[31]=d=>ja(d.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]"},[...i[108]||(i[108]=[dt('<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,Ii)]),a("div",Oi,[a("div",Mi,[i[110]||(i[110]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Watermark Handle ",-1)),a("input",{type:"text",value:s.modelValue.watermark||"@SocialGen",onInput:i[32]||(i[32]=d=>$a(d.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,Di)]),a("div",$i,[i[111]||(i[111]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Judul Konten (Title) ",-1)),a("input",{type:"text",value:s.modelValue.title,onInput:i[33]||(i[33]=d=>Da(d.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,ji)])])]),a("div",Ri,[a("div",Ei,[i[113]||(i[113]=a("span",{class:"font-bold text-slate-300 text-[10px]"},"RAW JSON SocialGen",-1)),l(c)?(f(),g("span",Pi,[A(l(Ha),{class:"w-2.5 h-2.5"}),i[112]||(i[112]=z(" Invalid ",-1))])):(f(),g("span",Li,[A(l(za),{class:"w-2.5 h-2.5"}),z(" "+y(l(r).trim()?"Valid":"Sample Mode"),1)]))]),a("div",Vi,[a("button",{onClick:Yt,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"},[A(l(Ca),{class:"w-2.5 h-2.5"}),i[114]||(i[114]=a("span",null,"Clear / Pakai Sample",-1))]),i[115]||(i[115]=a("span",{class:"text-slate-700"},"|",-1)),a("button",{onClick:Ma,class:"text-[10px] text-slate-400 hover:text-sky-400 transition"}," Format JSON ")])]),l(Ce)?(f(),g("div",{key:0,class:H(["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",l(Ce).isKnown?"bg-amber-500/10 border-amber-500/30":"bg-rose-500/10 border-rose-500/30"])},[a("div",{class:H(["flex items-center gap-1.5 text-[11px]",l(Ce).isKnown?"text-amber-300":"text-rose-300"])},[i[121]||(i[121]=a("span",{class:"text-sm"},"⚠️",-1)),l(Ce).isKnown?(f(),g("span",Bi,[i[116]||(i[116]=z(" JSON ini dibuat untuk template ",-1)),a("b",Zi,y(l(Ce).matchedTarget?.name),1),i[117]||(i[117]=z(" (",-1)),a("span",Ui,y(l(Ce).jsonTemplateId),1),i[118]||(i[118]=z(") ",-1))])):(f(),g("span",Ji,[i[119]||(i[119]=z(' Template dengan ID "',-1)),a("span",Fi,y(l(Ce).jsonTemplateId),1),i[120]||(i[120]=z('" tidak ditemukan di sistem. ',-1))]))],2),a("div",Hi,[l(Ce).isKnown&&l(Ce).matchedTarget?(f(),g("button",{key:0,onClick:i[34]||(i[34]=d=>Tt(l(Ce).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 ")):E("",!0),a("button",{onClick:Yt,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)):E("",!0),a("div",zi,[a("textarea",{value:l(r),onInput:Oa,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,Gi),l(c)||s.validationError?(f(),g("p",Ki," ⚠️ "+y(l(c)||s.validationError),1)):E("",!0)])])),a("input",{type:"file",ref_key:"videoInputRef",ref:Gt,accept:"video/mp4,video/webm",class:"hidden",onChange:i[35]||(i[35]=d=>qt(d))},null,544),a("input",{type:"file",ref_key:"audioInputRef",ref:Kt,accept:"audio/mp3,audio/mpeg,audio/wav",class:"hidden",onChange:i[36]||(i[36]=d=>qt(d))},null,544),a("div",Wi,[a("div",qi,[a("div",Yi,[a("label",Xi,[A(l(_a),{class:"w-3.5 h-3.5 text-sky-400"}),i[122]||(i[122]=a("span",null,"Background",-1))]),a("div",Qi,[a("select",{value:s.options.backgroundSource||"random",onChange:i[37]||(i[37]=d=>Ee("backgroundSource",d.target.value)),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]"},[i[123]||(i[123]=a("option",{value:"random"},"🔀 Acak Video",-1)),(f(!0),g(Ae,null,Ne(l(Jt),d=>(f(),g("option",{key:d,value:d},y(d.replace(".mp4","").replace(/_/g," ")),9,tr))),128)),i[124]||(i[124]=a("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,er),a("button",{onClick:i[38]||(i[38]=d=>l(Gt)?.click()),disabled:l(Ue),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"},[A(l(ra),{class:"w-3 h-3"}),a("span",sr,y(l(Ue)?"...":"Upload"),1)],8,ar)])]),a("div",nr,[a("span",ir,[A(l(Dt),{class:"w-2.5 h-2.5"}),z(" Mulai: "+y(Math.min(s.options.videoStartOffset||0,l(rt)))+"s / "+y(l(Ht))+"s ",1)]),a("input",{type:"range",min:"0",max:l(rt),step:"1",value:Math.min(s.options.videoStartOffset||0,l(rt)),onInput:i[39]||(i[39]=d=>Ee("videoStartOffset",Number(d.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,rr)])]),a("div",or,[a("div",lr,[a("label",dr,[A(l(Sa),{class:"w-3.5 h-3.5 text-purple-400"}),i[125]||(i[125]=a("span",null,"Musik Reels",-1))]),a("div",ur,[a("select",{value:s.options.musicFile||"random",onChange:i[40]||(i[40]=d=>Ee("musicFile",d.target.value)),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]"},[i[126]||(i[126]=a("option",{value:"random"},"🔀 Acak Musik",-1)),(f(!0),g(Ae,null,Ne(l(Ft),d=>(f(),g("option",{key:d,value:d},y(d.replace(".mp3","").replace(/_/g," ")),9,pr))),128))],40,cr),a("button",{onClick:i[41]||(i[41]=d=>l(Kt)?.click()),disabled:l(Ue),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"},[A(l(ra),{class:"w-3 h-3"}),a("span",fr,y(l(Ue)?"...":"Upload"),1)],8,mr)])]),a("div",hr,[a("span",xr,[A(l(Dt),{class:"w-2.5 h-2.5"}),z(" Mulai: "+y(Math.min(s.options.audioStartOffset||0,l(ot)))+"s / "+y(l(zt))+"s ",1)]),a("input",{type:"range",min:"0",max:l(ot),step:"1",value:Math.min(s.options.audioStartOffset||0,l(ot)),onInput:i[42]||(i[42]=d=>Ee("audioStartOffset",Number(d.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,vr)])]),a("div",gr,[a("label",yr,[A(l(ta),{class:"w-3.5 h-3.5 text-emerald-400"}),i[127]||(i[127]=a("span",null,"Durasi Reels:",-1))]),a("div",br,[(f(),g(Ae,null,Ne([7,10,15,30,60],d=>a("button",{key:d,onClick:B=>Ra(d),class:H(["px-2 py-0.5 text-[10px] font-bold rounded-lg border transition",(s.modelValue.reelsDuration||30)===d?"bg-emerald-500/20 border-emerald-500/60 text-emerald-300":"bg-slate-950 border-slate-800 text-slate-400 hover:text-white"])},y(d===60?"1m":d+"s"),11,kr)),64))])]),a("div",wr,[a("label",{class:H(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.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"])},[a("input",{type:"checkbox",checked:s.options.outputs?.feed!==!1,onChange:i[43]||(i[43]=d=>Ct("feed",d.target.checked)),class:"rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,_r),i[128]||(i[128]=a("span",{class:"font-bold"},"Feed 4:5",-1))],2),a("label",{class:H(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.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"])},[a("input",{type:"checkbox",checked:s.options.outputs?.story!==!1,onChange:i[44]||(i[44]=d=>Ct("story",d.target.checked)),class:"rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Sr),i[129]||(i[129]=a("span",{class:"font-bold"},"Story 9:16",-1))],2),a("label",{class:H(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.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"])},[a("input",{type:"checkbox",checked:s.options.outputs?.reels!==!1,onChange:i[45]||(i[45]=d=>Ct("reels",d.target.checked)),class:"rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Tr),i[130]||(i[130]=a("span",{class:"font-bold"},"Reels MP4",-1))],2)])]),a("button",{onClick:i[46]||(i[46]=d=>n("generate")),disabled:!s.isValid||s.isGenerating||!!l(c),class:H(["w-full py-3 px-4 rounded-xl font-black text-xs tracking-wide shadow-xl transition flex items-center justify-center gap-2",[!s.isValid||s.isGenerating||l(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]"]])},[s.isGenerating?(f(),Ie(l(Xa),{key:0,class:"w-3.5 h-3.5 animate-spin"})):(f(),Ie(l(Ta),{key:1,class:"w-3.5 h-3.5 fill-current"})),a("span",null,y(s.isGenerating?s.generateStage||"Rendering Content...":"GENERATE CONTENT"),1)],10,Cr)]))}}),Nr={class:"flex flex-col gap-2.5 h-full text-slate-100 min-h-0 justify-between"},Ir={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"},Or={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"},Mr={key:0,class:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"},Dr={class:"flex items-center gap-2 text-xs"},$r={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"},jr={key:0,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"360px",height:"450px"}},Rr={style:{width:"1080px",height:"1350px",transform:"scale(0.333333)","transform-origin":"top left"}},Er={key:1,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"300px",height:"533.33px"}},Lr={key:0,class:"absolute inset-0 z-0 bg-slate-950 overflow-hidden"},Pr=["src"],Vr=["src","muted"],Br={class:"relative z-10 pointer-events-none",style:{width:"1080px",height:"1920px",transform:"scale(0.277778)","transform-origin":"top left"}},Zr={key:1,class:"absolute inset-0 z-20 pointer-events-none flex flex-col justify-between"},Ur={class:"flex-1 flex justify-end p-2"},Jr={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"},Fr={key:0,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"},Hr={class:"flex items-center justify-between gap-3"},zr=["title"],Gr={class:"text-[11px] hidden sm:inline"},Kr={class:"flex-1 flex items-center gap-2"},Wr=["max","value"],qr={class:"font-mono text-[11px] font-bold text-slate-300 min-w-[75px] text-right"},Yr=["title"],Xr={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"},Qr={class:"flex flex-col gap-1.5"},eo={class:"flex items-center justify-between text-[11px]"},to={class:"font-bold text-sky-300 flex items-center gap-1"},ao=["max","value"],so={class:"text-[9px] text-slate-500"},no={class:"flex flex-col gap-1.5"},io={class:"flex items-center justify-between text-[11px]"},ro={class:"font-bold text-purple-300 flex items-center gap-1"},oo=["max","value"],lo={class:"text-[9px] text-slate-500"},uo={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"},co={class:"flex items-center justify-between text-xs"},po=["value"],mo={key:1,class:"flex flex-wrap items-center justify-between gap-2 p-3 bg-emerald-950/40 border border-emerald-500/40 rounded-2xl shadow-xl flex-shrink-0"},fo={class:"flex items-center gap-2 text-xs font-black text-emerald-300"},ho={class:"text-[11px] text-slate-400 font-mono mt-0.5"},xo={class:"flex items-center gap-2"},vo=["href"],go=["disabled"],yo=Vt({__name:"LivePreview",props:{data:{},selectedVideo:{},selectedMusic:{},videoStartOffset:{default:0},audioStartOffset:{default:0},generatedResult:{}},emits:["update:videoStartOffset","update:audioStartOffset"],setup(s,{emit:e}){const t=s,n=e,r={"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},o=ce(()=>t.selectedVideo&&t.selectedVideo!=="pexels"&&t.selectedVideo!=="random"?`/api/stream/videos/${t.selectedVideo}`:"/api/stream/videos/default_bg.mp4"),p=ce(()=>t.selectedMusic&&t.selectedMusic!=="random"?`/api/stream/audio/${t.selectedMusic}`:"/api/stream/audio/lofi_viral_study.mp3"),c=S("feed"),w=S(!1),b=S(!1),O=S(!1),de=S(!1),K=S(1),$=S(null),M=S(null),Z=S(!0),P=S(!1),ve=S(0),De=ce(()=>t.data.reelsDuration||30),ue=S(r[t.selectedVideo||""]||8),oe=S(r[t.selectedMusic||""]||30),re=ce(()=>Math.max(1,Math.floor(ue.value-1))),X=ce(()=>Math.max(1,Math.floor(oe.value-1)));function $e(){K.value<2.5&&(K.value=Math.min(2.5,+(K.value+.15).toFixed(2)))}function G(){K.value>.5&&(K.value=Math.max(.5,+(K.value-.15).toFixed(2)))}function me(){K.value=1}function ne(C){(C.ctrlKey||C.metaKey)&&(C.preventDefault(),C.deltaY<0?$e():G())}let F=0,q=null;function te(C){if(Z.value){if(F>0){const v=(C-F)/1e3;v>0&&v<1&&(ve.value+=v,ve.value>=De.value&&(ve.value=0,Se(0)))}F=C,q=requestAnimationFrame(te)}}Bt(()=>{Z.value&&(F=performance.now(),q&&cancelAnimationFrame(q),q=requestAnimationFrame(te))}),Ba(()=>{q&&(cancelAnimationFrame(q),q=null)}),xe(De,C=>{ve.value>C&&(ve.value=0,Se(0))});function fe(){Z.value?Q():_e()}function _e(){Z.value=!0,F=performance.now(),q&&cancelAnimationFrame(q),q=requestAnimationFrame(te),$.value&&$.value.play().catch(()=>{}),M.value&&(M.value.muted=P.value,M.value.volume=.85,M.value.play().catch(()=>{}))}function Q(){Z.value=!1,F=0,q&&(cancelAnimationFrame(q),q=null),$.value&&$.value.pause(),M.value&&M.value.pause()}function I(){if(P.value=!P.value,M.value)if(M.value.muted=P.value,M.value.volume=.85,!P.value&&Z.value){const C=t.audioStartOffset||0;M.value.currentTime=C+ve.value%Math.max(1,oe.value-C),M.value.play().catch(()=>{})}else M.value.pause()}function qe(C){const v=C.target;v&&v.duration&&!isNaN(v.duration)&&isFinite(v.duration)&&(ue.value=Math.max(1,Math.floor(v.duration)),t.videoStartOffset&&t.videoStartOffset>=ue.value&&n("update:videoStartOffset",Math.max(0,ue.value-2))),$.value&&($.value.currentTime=Math.min(t.videoStartOffset||0,re.value),Z.value&&$.value.play().catch(()=>{}))}function N(C){const v=C.target;v&&v.duration&&!isNaN(v.duration)&&isFinite(v.duration)&&(oe.value=Math.max(1,Math.floor(v.duration)),t.audioStartOffset&&t.audioStartOffset>=oe.value&&n("update:audioStartOffset",Math.max(0,oe.value-2))),M.value&&(M.value.muted=P.value,M.value.volume=.85,M.value.currentTime=Math.min(t.audioStartOffset||0,X.value),Z.value&&!P.value&&M.value.play().catch(()=>{}))}function h(){if(!$.value)return;const C=Math.min(t.videoStartOffset||0,re.value);$.value.currentTime=C,Z.value&&$.value.play().catch(()=>{})}function Y(){if(!M.value)return;const C=Math.min(t.audioStartOffset||0,X.value);M.value.currentTime=C,Z.value&&!P.value&&M.value.play().catch(()=>{})}function Te(){if(!$.value)return;const C=Math.min(t.videoStartOffset||0,re.value),v=ue.value;$.value.currentTime>=v-.25&&($.value.currentTime=C,Z.value&&$.value.play().catch(()=>{}))}function V(){if(!M.value)return;const C=Math.min(t.audioStartOffset||0,X.value),v=oe.value;M.value.currentTime>=v-.25&&(M.value.currentTime=C,Z.value&&!P.value&&M.value.play().catch(()=>{}))}function Se(C){ve.value=Math.min(Math.max(0,C),De.value),F=performance.now();const v=Math.min(t.videoStartOffset||0,re.value),ye=Math.min(t.audioStartOffset||0,X.value);if($.value){const se=v+C%Math.max(1,ue.value-v);$.value.currentTime=Math.min(se,ue.value-.1)}if(M.value){const se=ye+C%Math.max(1,oe.value-ye);M.value.currentTime=Math.min(se,oe.value-.1)}}function bt(C){const v=Number(C.target.value);Se(v)}xe(()=>t.videoStartOffset,C=>{const v=Math.min(C||0,re.value);$.value&&($.value.currentTime=v)}),xe(()=>t.audioStartOffset,C=>{const v=Math.min(C||0,X.value);M.value&&(M.value.currentTime=v)});function at(C){const v=Math.min(C,re.value);n("update:videoStartOffset",v),$.value&&($.value.currentTime=v)}function kt(C){const v=Math.min(C,X.value);n("update:audioStartOffset",v),M.value&&(M.value.currentTime=v)}function wt(){if($.value){const C=Math.min(Math.floor($.value.currentTime),re.value);at(C)}}function st(C){const v=Math.floor(C/60),ye=Math.floor(C%60);return`${v.toString().padStart(2,"0")}:${ye.toString().padStart(2,"0")}`}function _t(){t.data.caption&&(navigator.clipboard.writeText(t.data.caption),O.value=!0,setTimeout(()=>{O.value=!1},2e3))}async function St(){if(t.generatedResult){de.value=!0;try{await $fetch("/api/open-folder",{method:"POST",body:{jobId:t.generatedResult.jobId,resultDir:t.generatedResult.resultDir}})}catch(C){console.error("Failed to open folder:",C)}finally{de.value=!1}}}return xe(()=>o.value,()=>{const C=t.selectedVideo||"";r[C]&&(ue.value=r[C]),Qt(()=>{Se(0)})}),xe(()=>p.value,()=>{const C=t.selectedMusic||"";r[C]&&(oe.value=r[C])}),xe(()=>c.value,C=>{C==="reels"?Qt(()=>{Z.value&&_e()}):M.value&&M.value.pause()}),(C,v)=>{const ye=Ua;return f(),g("div",Nr,[a("div",Ir,[a("div",Or,[a("button",{onClick:v[0]||(v[0]=se=>c.value="feed"),class:H(["px-3 py-1.5 rounded-lg transition",l(c)==="feed"?"bg-sky-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Feed 4:5 ",2),a("button",{onClick:v[1]||(v[1]=se=>c.value="story"),class:H(["px-3 py-1.5 rounded-lg transition",l(c)==="story"?"bg-indigo-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Story 9:16 ",2),a("button",{onClick:v[2]||(v[2]=se=>c.value="reels"),class:H(["px-3 py-1.5 rounded-lg transition flex items-center gap-1.5",l(c)==="reels"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-white"])},[v[8]||(v[8]=a("span",null,"Reels 9:16 (Video)",-1)),l(c)==="reels"&&l(Z)?(f(),g("span",Mr)):E("",!0)],2)]),a("div",Dr,[a("div",$r,[a("button",{onClick:G,title:"Zoom Out (-15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[A(l(ns),{class:"w-3.5 h-3.5"})]),a("button",{onClick:me,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"},y(Math.round(l(K)*100))+"% ",1),a("button",{onClick:$e,title:"Zoom In (+15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[A(l(ss),{class:"w-3.5 h-3.5"})]),l(K)!==1?(f(),g("button",{key:0,onClick:me,title:"Reset ke Ukuran Pas",class:"p-1.5 rounded-lg text-amber-400 hover:bg-slate-800 transition"},[A(l(Ca),{class:"w-3.5 h-3.5"})])):E("",!0)]),l(c)!=="feed"?(f(),g("button",{key:0,onClick:v[3]||(v[3]=se=>w.value=!l(w)),class:H(["inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition",l(w)?"bg-amber-500/20 text-amber-300 border-amber-500/50":"bg-slate-950 text-slate-400 border-slate-800"])},[A(l(Qa),{class:"w-3.5 h-3.5"}),v[9]||(v[9]=a("span",{class:"hidden sm:inline"},"Safe Zones",-1))],2)):E("",!0)])]),a("div",{onWheel:ne,class:"relative flex-1 min-h-0 bg-slate-950/80 border border-slate-800/80 rounded-2xl flex items-center justify-center p-3 overflow-auto shadow-inner custom-scrollbar"},[a("div",{class:"transition-transform duration-200 ease-out origin-center flex-shrink-0",style:Za({transform:`scale(${l(K)})`})},[l(c)==="feed"?(f(),g("div",jr,[a("div",Rr,[A(ye,{data:s.data,mode:"feed","is-render":!0},null,8,["data"])])])):(f(),g("div",Er,[l(c)==="reels"?(f(),g("div",Lr,[(f(),g("video",{ref_key:"videoElement",ref:$,key:l(o),autoplay:"",muted:"",playsinline:"",class:"w-full h-full object-cover brightness-90 contrast-105",src:l(o),onLoadedmetadata:qe,onTimeupdate:Te,onEnded:h},null,40,Pr)),v[10]||(v[10]=a("div",{class:"absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"},null,-1)),(f(),g("audio",{ref_key:"audioElement",ref:M,key:l(p),src:l(p),muted:l(P),onLoadedmetadata:N,onTimeupdate:V,onEnded:Y},null,40,Vr))])):E("",!0),a("div",Br,[A(ye,{data:s.data,mode:l(c)==="reels"?"overlay":"story","is-render":!0},null,8,["data","mode"])]),l(w)?(f(),g("div",Zr,[v[12]||(v[12]=a("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)),a("div",Ur,[l(c)==="reels"?(f(),g("div",Jr,[...v[11]||(v[11]=[a("span",null,"❤️ Like",-1),a("span",null,"💬 Comm",-1),a("span",null,"↗️ Share",-1)])])):E("",!0)]),v[13]||(v[13]=a("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))])):E("",!0)]))],4)],32),l(c)==="reels"?(f(),g("div",Fr,[a("div",Hr,[a("button",{onClick:fe,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:l(Z)?"Pause Preview":"Putar Preview"},[l(Z)?(f(),Ie(l(Ya),{key:0,class:"w-3.5 h-3.5 fill-current"})):(f(),Ie(l(Ta),{key:1,class:"w-3.5 h-3.5 fill-current"})),a("span",Gr,y(l(Z)?"Pause":"Play"),1)],8,zr),a("div",Kr,[a("input",{type:"range",min:"0",max:l(De),step:"0.1",value:l(ve),onInput:bt,class:"flex-1 h-1.5 bg-slate-950 rounded-lg appearance-none cursor-pointer accent-emerald-500 hover:accent-emerald-400"},null,40,Wr),a("span",qr,y(st(l(ve)))+" / "+y(st(l(De))),1)]),a("button",{onClick:I,class:H(["px-2.5 py-2 rounded-xl border transition flex items-center gap-1.5 font-bold text-[11px]",l(P)?"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:l(P)?"Aktifkan Suara Musik (Unmute)":"Matikan Suara Musik (Mute)"},[l(P)?(f(),Ie(l(ts),{key:1,class:"w-3.5 h-3.5"})):(f(),Ie(l(es),{key:0,class:"w-3.5 h-3.5 text-purple-300 animate-pulse"})),a("span",null,y(l(P)?"Muted":"Audio ON"),1)],10,Yr),a("button",{onClick:v[4]||(v[4]=se=>b.value=!l(b)),class:H(["px-2.5 py-2 rounded-xl border text-[11px] font-bold flex items-center gap-1.5 transition",l(b)?"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"},[A(l(Dt),{class:"w-3.5 h-3.5 text-sky-400"}),v[14]||(v[14]=a("span",{class:"hidden sm:inline"},"Trim Offset",-1))],2)]),l(b)?(f(),g("div",Xr,[a("div",Qr,[a("div",eo,[a("span",to,[A(l(_a),{class:"w-3 h-3"}),z(" Mulai Video: "+y(Math.min(s.videoStartOffset||0,l(re)))+"s / "+y(l(ue))+"s ",1)]),a("button",{onClick:wt,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 ")]),a("input",{type:"range",min:"0",max:l(re),step:"1",value:Math.min(s.videoStartOffset||0,l(re)),onInput:v[5]||(v[5]=se=>at(Number(se.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-sky-400"},null,40,ao),a("div",so," Maksimal offset: "+y(l(re))+" detik (panjang asli video: "+y(l(ue))+"s) ",1)]),a("div",no,[a("div",io,[a("span",ro,[A(l(Sa),{class:"w-3 h-3"}),z(" Mulai Musik: "+y(Math.min(s.audioStartOffset||0,l(X)))+"s / "+y(l(oe))+"s ",1)]),v[15]||(v[15]=a("span",{class:"text-[10px] text-slate-500 font-mono"}," (Skip intro) ",-1))]),a("input",{type:"range",min:"0",max:l(X),step:"1",value:Math.min(s.audioStartOffset||0,l(X)),onInput:v[6]||(v[6]=se=>kt(Number(se.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-purple-400"},null,40,oo),a("div",lo," Maksimal offset: "+y(l(X))+" detik (panjang asli musik: "+y(l(oe))+"s) ",1)])])):E("",!0)])):E("",!0),a("div",uo,[a("div",co,[v[16]||(v[16]=a("span",{class:"font-extrabold text-slate-300 text-[11px]"},"VIRAL CAPTION & HASHTAGS",-1)),a("button",{onClick:_t,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"},[l(O)?(f(),Ie(l(Fe),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(f(),Ie(l(mt),{key:1,class:"w-3.5 h-3.5"})),a("span",null,y(l(O)?"Tersalin!":"Copy Caption"),1)])]),a("textarea",{value:s.data.caption,onInput:v[7]||(v[7]=se=>s.data.caption=se.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,po)]),s.generatedResult?(f(),g("div",mo,[a("div",null,[a("div",fo,[A(l(Fe),{class:"w-4 h-4 text-emerald-400"}),z(" Render Selesai ("+y((s.generatedResult.durationMs/1e3).toFixed(1))+"s) ",1)]),a("div",ho,y(s.generatedResult.jobId),1)]),a("div",xo,[a("a",{href:`/api/download?jobId=${s.generatedResult.jobId}`,download:"",class:"inline-flex items-center gap-1.5 px-4 py-2 bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl text-xs font-black shadow-lg transition"},[A(l(Ka),{class:"w-3.5 h-3.5"}),v[17]||(v[17]=a("span",null,"Download ZIP",-1))],8,vo),a("button",{onClick:St,disabled:l(de),class:"inline-flex items-center gap-1.5 px-4 py-2 bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 rounded-xl text-xs font-bold transition"},[A(l(Wa),{class:"w-3.5 h-3.5 text-amber-400"}),v[18]||(v[18]=a("span",null,"Open Folder",-1))],8,go)])])):E("",!0)])}}});var U;(function(s){s.assertEqual=r=>{};function e(r){}s.assertIs=e;function t(r){throw new Error}s.assertNever=t,s.arrayToEnum=r=>{const o={};for(const p of r)o[p]=p;return o},s.getValidEnumValues=r=>{const o=s.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),p={};for(const c of o)p[c]=r[c];return s.objectValues(p)},s.objectValues=r=>s.objectKeys(r).map(function(o){return r[o]}),s.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const p in r)Object.prototype.hasOwnProperty.call(r,p)&&o.push(p);return o},s.find=(r,o)=>{for(const p of r)if(o(p))return p},s.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,o=" | "){return r.map(p=>typeof p=="string"?`'${p}'`:p).join(o)}s.joinValues=n,s.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(U||(U={}));var oa;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(oa||(oa={}));const _=U.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Le=s=>{switch(typeof s){case"undefined":return _.undefined;case"string":return _.string;case"number":return Number.isNaN(s)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(s)?_.array:s===null?_.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?_.promise:typeof Map<"u"&&s instanceof Map?_.map:typeof Set<"u"&&s instanceof Set?_.set:typeof Date<"u"&&s instanceof Date?_.date:_.object;default:return _.unknown}},m=U.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 Re extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(o){return o.message},n={_errors:[]},r=o=>{for(const p of o.issues)if(p.code==="invalid_union")p.unionErrors.map(r);else if(p.code==="invalid_return_type")r(p.returnTypeError);else if(p.code==="invalid_arguments")r(p.argumentsError);else if(p.path.length===0)n._errors.push(t(p));else{let c=n,w=0;for(;w<p.path.length;){const b=p.path[w];w===p.path.length-1?(c[b]=c[b]||{_errors:[]},c[b]._errors.push(t(p))):c[b]=c[b]||{_errors:[]},c=c[b],w++}}};return r(this),n}static assert(e){if(!(e instanceof Re))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,U.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Re.create=s=>new Re(s);const $t=(s,e)=>{let t;switch(s.code){case m.invalid_type:s.received===_.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case m.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,U.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:t=`Unrecognized key(s) in object: ${U.joinValues(s.keys,", ")}`;break;case m.invalid_union:t="Invalid input";break;case m.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${U.joinValues(s.options)}`;break;case m.invalid_enum_value:t=`Invalid enum value. Expected ${U.joinValues(s.options)}, received '${s.received}'`;break;case m.invalid_arguments:t="Invalid function arguments";break;case m.invalid_return_type:t="Invalid function return type";break;case m.invalid_date:t="Invalid date";break;case m.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:U.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case m.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case m.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case m.custom:t="Invalid input";break;case m.invalid_intersection_types:t="Intersection results could not be merged";break;case m.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case m.not_finite:t="Number must be finite";break;default:t=e.defaultError,U.assertNever(s)}return{message:t}};let bo=$t;function ko(){return bo}const wo=s=>{const{data:e,path:t,errorMaps:n,issueData:r}=s,o=[...t,...r.path||[]],p={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let c="";const w=n.filter(b=>!!b).slice().reverse();for(const b of w)c=b(p,{data:e,defaultError:c}).message;return{...r,path:o,message:c}};function k(s,e){const t=ko(),n=wo({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===$t?void 0:$t].filter(r=>!!r)});s.common.issues.push(n)}class pe{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if(r.status==="aborted")return j;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const o=await r.key,p=await r.value;n.push({key:o,value:p})}return pe.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:o,value:p}=r;if(o.status==="aborted"||p.status==="aborted")return j;o.status==="dirty"&&e.dirty(),p.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof p.value<"u"||r.alwaysSet)&&(n[o.value]=p.value)}return{status:e.value,value:n}}}const j=Object.freeze({status:"aborted"}),Qe=s=>({status:"dirty",value:s}),we=s=>({status:"valid",value:s}),la=s=>s.status==="aborted",da=s=>s.status==="dirty",He=s=>s.status==="valid",ft=s=>typeof Promise<"u"&&s instanceof Promise;var T;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e?.message})(T||(T={}));class Me{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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 ua=(s,e)=>{if(He(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Re(s.common.issues);return this._error=t,this._error}}};function R(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:r}=s;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(p,c)=>{const{message:w}=s;return p.code==="invalid_enum_value"?{message:w??c.defaultError}:typeof c.data>"u"?{message:w??n??c.defaultError}:p.code!=="invalid_type"?{message:c.defaultError}:{message:w??t??c.defaultError}},description:r}}class L{get description(){return this._def.description}_getType(e){return Le(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pe,ctx:{common:e.parent.common,data:e.data,parsedType:Le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ft(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)},r=this._parseSync({data:e,path:n.path,parent:n});return ua(n,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return He(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>He(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(ft(r)?r:Promise.resolve(r));return ua(n,o)}refine(e,t){const n=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,o)=>{const p=e(r),c=()=>o.addIssue({code:m.custom,...n(r)});return typeof Promise<"u"&&p instanceof Promise?p.then(w=>w?!0:(c(),!1)):p?!0:(c(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t=="function"?t(n,r):t),!1))}_refinement(e){return new Ke({schema:this,typeName:D.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:t=>this["~validate"](t)}}optional(){return Pe.create(this,this._def)}nullable(){return We.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Oe.create(this)}promise(){return yt.create(this,this._def)}or(e){return xt.create([this,e],this._def)}and(e){return vt.create(this,e,this._def)}transform(e){return new Ke({...R(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Et({...R(this._def),innerType:this,defaultValue:t,typeName:D.ZodDefault})}brand(){return new Ho({typeName:D.ZodBranded,type:this,...R(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Lt({...R(this._def),innerType:this,catchValue:t,typeName:D.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Zt.create(this,e)}readonly(){return Pt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const _o=/^c[^\s-]{8,}$/i,So=/^[0-9a-z]+$/,To=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Co=/^[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,Ao=/^[a-z0-9_-]{21}$/i,No=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Io=/^[-+]?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)?)??$/,Oo=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Mo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ot;const Do=/^(?:(?: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])$/,$o=/^(?:(?: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])$/,jo=/^(([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]))$/,Ro=/^(([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])$/,Eo=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Lo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Aa="((\\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])))",Po=new RegExp(`^${Aa}$`);function Na(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Vo(s){return new RegExp(`^${Na(s)}$`)}function Bo(s){let e=`${Aa}T${Na(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Zo(s,e){return!!((e==="v4"||!e)&&Do.test(s)||(e==="v6"||!e)&&jo.test(s))}function Uo(s,e){if(!No.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function Jo(s,e){return!!((e==="v4"||!e)&&$o.test(s)||(e==="v6"||!e)&&Ro.test(s))}class je extends L{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_type,expected:_.string,received:o.parsedType}),j}const n=new pe;let r;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const p=e.data.length>o.value,c=e.data.length<o.value;(p||c)&&(r=this._getOrReturnCtx(e,r),p?k(r,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&k(r,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Oo.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"email",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Ot||(Ot=new RegExp(Mo,"u")),Ot.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"emoji",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Co.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"uuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Ao.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"nanoid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")_o.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")So.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cuid2",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")To.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"ulid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),k(r,{validation:"url",code:m.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"regex",code:m.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Bo(o).test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Po.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Vo(o).test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Io.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"duration",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Zo(e.data,o.version)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"ip",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Uo(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"jwt",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Jo(e.data,o.version)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cidr",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Eo.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"base64",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Lo.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"base64url",code:m.invalid_string,message:o.message}),n.dirty()):U.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(r=>e.test(r),{validation:t,code:m.invalid_string,...T.errToObj(n)})}_addCheck(e){return new je({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...T.errToObj(e)})}url(e){return this._addCheck({kind:"url",...T.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...T.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...T.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...T.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...T.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...T.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...T.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...T.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...T.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...T.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...T.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...T.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,...T.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,...T.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...T.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...T.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...T.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...T.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...T.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...T.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...T.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...T.errToObj(t)})}nonempty(e){return this.min(1,T.errToObj(e))}trim(){return new je({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new je({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new je({...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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}je.create=s=>new je({checks:[],typeName:D.ZodString,coerce:s?.coerce??!1,...R(s)});function Fo(s,e){const t=(s.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=t>n?t:n,o=Number.parseInt(s.toFixed(r).replace(".","")),p=Number.parseInt(e.toFixed(r).replace(".",""));return o%p/10**r}class ze extends L{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)!==_.number){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_type,expected:_.number,received:o.parsedType}),j}let n;const r=new pe;for(const o of this._def.checks)o.kind==="int"?U.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:m.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?Fo(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_finite,message:o.message}),r.dirty()):U.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,T.toString(t))}gt(e,t){return this.setLimit("min",e,!1,T.toString(t))}lte(e,t){return this.setLimit("max",e,!0,T.toString(t))}lt(e,t){return this.setLimit("max",e,!1,T.toString(t))}setLimit(e,t,n,r){return new ze({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:T.toString(r)}]})}_addCheck(e){return new ze({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:T.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:T.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:T.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:T.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&U.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ze.create=s=>new ze({checks:[],typeName:D.ZodNumber,coerce:s?.coerce||!1,...R(s)});class et extends L{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)!==_.bigint)return this._getInvalidInput(e);let n;const r=new pe;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):U.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return k(t,{code:m.invalid_type,expected:_.bigint,received:t.parsedType}),j}gte(e,t){return this.setLimit("min",e,!0,T.toString(t))}gt(e,t){return this.setLimit("min",e,!1,T.toString(t))}lte(e,t){return this.setLimit("max",e,!0,T.toString(t))}lt(e,t){return this.setLimit("max",e,!1,T.toString(t))}setLimit(e,t,n,r){return new et({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:T.toString(r)}]})}_addCheck(e){return new et({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}et.create=s=>new et({checks:[],typeName:D.ZodBigInt,coerce:s?.coerce??!1,...R(s)});class ca extends L{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.boolean,received:n.parsedType}),j}return we(e.data)}}ca.create=s=>new ca({typeName:D.ZodBoolean,coerce:s?.coerce||!1,...R(s)});class ht extends L{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_type,expected:_.date,received:o.parsedType}),j}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_date}),j}const n=new pe;let r;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):U.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ht({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:T.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:T.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}ht.create=s=>new ht({checks:[],coerce:s?.coerce||!1,typeName:D.ZodDate,...R(s)});class pa extends L{_parse(e){if(this._getType(e)!==_.symbol){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.symbol,received:n.parsedType}),j}return we(e.data)}}pa.create=s=>new pa({typeName:D.ZodSymbol,...R(s)});class ma extends L{_parse(e){if(this._getType(e)!==_.undefined){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.undefined,received:n.parsedType}),j}return we(e.data)}}ma.create=s=>new ma({typeName:D.ZodUndefined,...R(s)});class fa extends L{_parse(e){if(this._getType(e)!==_.null){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.null,received:n.parsedType}),j}return we(e.data)}}fa.create=s=>new fa({typeName:D.ZodNull,...R(s)});class jt extends L{constructor(){super(...arguments),this._any=!0}_parse(e){return we(e.data)}}jt.create=s=>new jt({typeName:D.ZodAny,...R(s)});class ha extends L{constructor(){super(...arguments),this._unknown=!0}_parse(e){return we(e.data)}}ha.create=s=>new ha({typeName:D.ZodUnknown,...R(s)});class Ve extends L{_parse(e){const t=this._getOrReturnCtx(e);return k(t,{code:m.invalid_type,expected:_.never,received:t.parsedType}),j}}Ve.create=s=>new Ve({typeName:D.ZodNever,...R(s)});class xa extends L{_parse(e){if(this._getType(e)!==_.undefined){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.void,received:n.parsedType}),j}return we(e.data)}}xa.create=s=>new xa({typeName:D.ZodVoid,...R(s)});class Oe extends L{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==_.array)return k(t,{code:m.invalid_type,expected:_.array,received:t.parsedType}),j;if(r.exactLength!==null){const p=t.data.length>r.exactLength.value,c=t.data.length<r.exactLength.value;(p||c)&&(k(t,{code:p?m.too_big:m.too_small,minimum:c?r.exactLength.value:void 0,maximum:p?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(k(t,{code:m.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(k(t,{code:m.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((p,c)=>r.type._parseAsync(new Me(t,p,t.path,c)))).then(p=>pe.mergeArray(n,p));const o=[...t.data].map((p,c)=>r.type._parseSync(new Me(t,p,t.path,c)));return pe.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Oe({...this._def,minLength:{value:e,message:T.toString(t)}})}max(e,t){return new Oe({...this._def,maxLength:{value:e,message:T.toString(t)}})}length(e,t){return new Oe({...this._def,exactLength:{value:e,message:T.toString(t)}})}nonempty(e){return this.min(1,e)}}Oe.create=(s,e)=>new Oe({type:s,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...R(e)});function Je(s){if(s instanceof ae){const e={};for(const t in s.shape){const n=s.shape[t];e[t]=Pe.create(Je(n))}return new ae({...s._def,shape:()=>e})}else return s instanceof Oe?new Oe({...s._def,type:Je(s.element)}):s instanceof Pe?Pe.create(Je(s.unwrap())):s instanceof We?We.create(Je(s.unwrap())):s instanceof Ze?Ze.create(s.items.map(e=>Je(e))):s}class ae extends L{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(),t=U.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==_.object){const b=this._getOrReturnCtx(e);return k(b,{code:m.invalid_type,expected:_.object,received:b.parsedType}),j}const{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:p}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ve&&this._def.unknownKeys==="strip"))for(const b in r.data)p.includes(b)||c.push(b);const w=[];for(const b of p){const O=o[b],de=r.data[b];w.push({key:{status:"valid",value:b},value:O._parse(new Me(r,de,r.path,b)),alwaysSet:b in r.data})}if(this._def.catchall instanceof Ve){const b=this._def.unknownKeys;if(b==="passthrough")for(const O of c)w.push({key:{status:"valid",value:O},value:{status:"valid",value:r.data[O]}});else if(b==="strict")c.length>0&&(k(r,{code:m.unrecognized_keys,keys:c}),n.dirty());else if(b!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const b=this._def.catchall;for(const O of c){const de=r.data[O];w.push({key:{status:"valid",value:O},value:b._parse(new Me(r,de,r.path,O)),alwaysSet:O in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const b=[];for(const O of w){const de=await O.key,K=await O.value;b.push({key:de,value:K,alwaysSet:O.alwaysSet})}return b}).then(b=>pe.mergeObjectSync(n,b)):pe.mergeObjectSync(n,w)}get shape(){return this._def.shape()}strict(e){return T.errToObj,new ae({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{const r=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:T.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:D.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ae({...this._def,catchall:e})}pick(e){const t={};for(const n of U.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new ae({...this._def,shape:()=>t})}omit(e){const t={};for(const n of U.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new ae({...this._def,shape:()=>t})}deepPartial(){return Je(this)}partial(e){const t={};for(const n of U.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new ae({...this._def,shape:()=>t})}required(e){const t={};for(const n of U.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Pe;)o=o._def.innerType;t[n]=o}return new ae({...this._def,shape:()=>t})}keyof(){return Ia(U.objectKeys(this.shape))}}ae.create=(s,e)=>new ae({shape:()=>s,unknownKeys:"strip",catchall:Ve.create(),typeName:D.ZodObject,...R(e)});ae.strictCreate=(s,e)=>new ae({shape:()=>s,unknownKeys:"strict",catchall:Ve.create(),typeName:D.ZodObject,...R(e)});ae.lazycreate=(s,e)=>new ae({shape:s,unknownKeys:"strip",catchall:Ve.create(),typeName:D.ZodObject,...R(e)});class xt extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(const c of o)if(c.result.status==="valid")return c.result;for(const c of o)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;const p=o.map(c=>new Re(c.ctx.common.issues));return k(t,{code:m.invalid_union,unionErrors:p}),j}if(t.common.async)return Promise.all(n.map(async o=>{const p={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:p}),ctx:p}})).then(r);{let o;const p=[];for(const w of n){const b={...t,common:{...t.common,issues:[]},parent:null},O=w._parseSync({data:t.data,path:t.path,parent:b});if(O.status==="valid")return O;O.status==="dirty"&&!o&&(o={result:O,ctx:b}),b.common.issues.length&&p.push(b.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;const c=p.map(w=>new Re(w));return k(t,{code:m.invalid_union,unionErrors:c}),j}}get options(){return this._def.options}}xt.create=(s,e)=>new xt({options:s,typeName:D.ZodUnion,...R(e)});function Rt(s,e){const t=Le(s),n=Le(e);if(s===e)return{valid:!0,data:s};if(t===_.object&&n===_.object){const r=U.objectKeys(e),o=U.objectKeys(s).filter(c=>r.indexOf(c)!==-1),p={...s,...e};for(const c of o){const w=Rt(s[c],e[c]);if(!w.valid)return{valid:!1};p[c]=w.data}return{valid:!0,data:p}}else if(t===_.array&&n===_.array){if(s.length!==e.length)return{valid:!1};const r=[];for(let o=0;o<s.length;o++){const p=s[o],c=e[o],w=Rt(p,c);if(!w.valid)return{valid:!1};r.push(w.data)}return{valid:!0,data:r}}else return t===_.date&&n===_.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class vt extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(o,p)=>{if(la(o)||la(p))return j;const c=Rt(o.value,p.value);return c.valid?((da(o)||da(p))&&t.dirty(),{status:t.value,value:c.data}):(k(n,{code:m.invalid_intersection_types}),j)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,p])=>r(o,p)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}vt.create=(s,e,t)=>new vt({left:s,right:e,typeName:D.ZodIntersection,...R(t)});class Ze extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.array)return k(n,{code:m.invalid_type,expected:_.array,received:n.parsedType}),j;if(n.data.length<this._def.items.length)return k(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&n.data.length>this._def.items.length&&(k(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...n.data].map((p,c)=>{const w=this._def.items[c]||this._def.rest;return w?w._parse(new Me(n,p,n.path,c)):null}).filter(p=>!!p);return n.common.async?Promise.all(o).then(p=>pe.mergeArray(t,p)):pe.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Ze({...this._def,rest:e})}}Ze.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ze({items:s,typeName:D.ZodTuple,rest:null,...R(e)})};class gt extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.object)return k(n,{code:m.invalid_type,expected:_.object,received:n.parsedType}),j;const r=[],o=this._def.keyType,p=this._def.valueType;for(const c in n.data)r.push({key:o._parse(new Me(n,c,n.path,c)),value:p._parse(new Me(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?pe.mergeObjectAsync(t,r):pe.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof L?new gt({keyType:e,valueType:t,typeName:D.ZodRecord,...R(n)}):new gt({keyType:je.create(),valueType:e,typeName:D.ZodRecord,...R(t)})}}class va extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.map)return k(n,{code:m.invalid_type,expected:_.map,received:n.parsedType}),j;const r=this._def.keyType,o=this._def.valueType,p=[...n.data.entries()].map(([c,w],b)=>({key:r._parse(new Me(n,c,n.path,[b,"key"])),value:o._parse(new Me(n,w,n.path,[b,"value"]))}));if(n.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const w of p){const b=await w.key,O=await w.value;if(b.status==="aborted"||O.status==="aborted")return j;(b.status==="dirty"||O.status==="dirty")&&t.dirty(),c.set(b.value,O.value)}return{status:t.value,value:c}})}else{const c=new Map;for(const w of p){const b=w.key,O=w.value;if(b.status==="aborted"||O.status==="aborted")return j;(b.status==="dirty"||O.status==="dirty")&&t.dirty(),c.set(b.value,O.value)}return{status:t.value,value:c}}}}va.create=(s,e,t)=>new va({valueType:e,keyType:s,typeName:D.ZodMap,...R(t)});class tt extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.set)return k(n,{code:m.invalid_type,expected:_.set,received:n.parsedType}),j;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(k(n,{code:m.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(k(n,{code:m.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const o=this._def.valueType;function p(w){const b=new Set;for(const O of w){if(O.status==="aborted")return j;O.status==="dirty"&&t.dirty(),b.add(O.value)}return{status:t.value,value:b}}const c=[...n.data.values()].map((w,b)=>o._parse(new Me(n,w,n.path,b)));return n.common.async?Promise.all(c).then(w=>p(w)):p(c)}min(e,t){return new tt({...this._def,minSize:{value:e,message:T.toString(t)}})}max(e,t){return new tt({...this._def,maxSize:{value:e,message:T.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}tt.create=(s,e)=>new tt({valueType:s,minSize:null,maxSize:null,typeName:D.ZodSet,...R(e)});class ga extends L{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ga.create=(s,e)=>new ga({getter:s,typeName:D.ZodLazy,...R(e)});class ya extends L{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return k(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}}ya.create=(s,e)=>new ya({value:s,typeName:D.ZodLiteral,...R(e)});function Ia(s,e){return new Ge({values:s,typeName:D.ZodEnum,...R(e)})}class Ge extends L{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return k(t,{expected:U.joinValues(n),received:t.parsedType,code:m.invalid_type}),j}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return k(t,{received:t.data,code:m.invalid_enum_value,options:n}),j}return we(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ge.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ge.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}Ge.create=Ia;class ba extends L{_parse(e){const t=U.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_.string&&n.parsedType!==_.number){const r=U.objectValues(t);return k(n,{expected:U.joinValues(r),received:n.parsedType,code:m.invalid_type}),j}if(this._cache||(this._cache=new Set(U.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=U.objectValues(t);return k(n,{received:n.data,code:m.invalid_enum_value,options:r}),j}return we(e.data)}get enum(){return this._def.values}}ba.create=(s,e)=>new ba({values:s,typeName:D.ZodNativeEnum,...R(e)});class yt extends L{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.promise&&t.common.async===!1)return k(t,{code:m.invalid_type,expected:_.promise,received:t.parsedType}),j;const n=t.parsedType===_.promise?t.data:Promise.resolve(t.data);return we(n.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}yt.create=(s,e)=>new yt({type:s,typeName:D.ZodPromise,...R(e)});class Ke extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:p=>{k(n,p),p.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){const p=r.transform(n.data,o);if(n.common.async)return Promise.resolve(p).then(async c=>{if(t.value==="aborted")return j;const w=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return w.status==="aborted"?j:w.status==="dirty"||t.value==="dirty"?Qe(w.value):w});{if(t.value==="aborted")return j;const c=this._def.schema._parseSync({data:p,path:n.path,parent:n});return c.status==="aborted"?j:c.status==="dirty"||t.value==="dirty"?Qe(c.value):c}}if(r.type==="refinement"){const p=c=>{const w=r.refinement(c,o);if(n.common.async)return Promise.resolve(w);if(w instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?j:(c.status==="dirty"&&t.dirty(),p(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?j:(c.status==="dirty"&&t.dirty(),p(c.value).then(()=>({status:t.value,value:c.value}))))}if(r.type==="transform")if(n.common.async===!1){const p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!He(p))return j;const c=r.transform(p.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>He(p)?Promise.resolve(r.transform(p.value,o)).then(c=>({status:t.value,value:c})):j);U.assertNever(r)}}Ke.create=(s,e,t)=>new Ke({schema:s,typeName:D.ZodEffects,effect:e,...R(t)});Ke.createWithPreprocess=(s,e,t)=>new Ke({schema:e,effect:{type:"preprocess",transform:s},typeName:D.ZodEffects,...R(t)});class Pe extends L{_parse(e){return this._getType(e)===_.undefined?we(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pe.create=(s,e)=>new Pe({innerType:s,typeName:D.ZodOptional,...R(e)});class We extends L{_parse(e){return this._getType(e)===_.null?we(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}We.create=(s,e)=>new We({innerType:s,typeName:D.ZodNullable,...R(e)});class Et extends L{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Et.create=(s,e)=>new Et({innerType:s,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...R(e)});class Lt extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ft(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Re(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Re(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Lt.create=(s,e)=>new Lt({innerType:s,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...R(e)});class ka extends L{_parse(e){if(this._getType(e)!==_.nan){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.nan,received:n.parsedType}),j}return{status:"valid",value:e.data}}}ka.create=s=>new ka({typeName:D.ZodNaN,...R(s)});class Ho extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Zt extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?j:o.status==="dirty"?(t.dirty(),Qe(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?j:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new Zt({in:e,out:t,typeName:D.ZodPipeline})}}class Pt extends L{_parse(e){const t=this._def.innerType._parse(e),n=r=>(He(r)&&(r.value=Object.freeze(r.value)),r);return ft(t)?t.then(r=>n(r)):n(t)}unwrap(){return this._def.innerType}}Pt.create=(s,e)=>new Pt({innerType:s,typeName:D.ZodReadonly,...R(e)});var D;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(D||(D={}));const x=je.create,Xe=ze.create,wa=jt.create;Ve.create;const ie=Oe.create,ee=ae.create;xt.create;vt.create;Ze.create;const zo=gt.create,Go=Ge.create;yt.create;Pe.create;We.create;const Ko=ee({label:x().min(1).max(40),left:x().min(1).max(35),right:x().min(1).max(35)}),Wo=ee({id:x().optional().default(()=>`post-${Date.now()}`).transform(s=>s||`post-${Date.now()}`),templateId:x().optional(),category:x().optional().default("TECH"),theme:Go(["blue-tech","emerald-finance","slate-education","dark-contrast","crimson-alert","amber-gold","cyber-violet","sunset-orange","nordic-frost","monochrome-luxe"]).default("blue-tech"),layoutType:x().default("table"),title:x().min(1).max(120),subtitle:x().min(1).max(250),leftHeader:x().optional().default("USA 🇺🇸"),rightHeader:x().optional().default("UK 🇬🇧"),rows:ie(Ko).optional().default([]),bullets:ie(ee({highlight:x().optional().default(""),text:x().min(1)})).optional().default([]),bigStat:ee({number:x().default("$165,000"),label:x().default("Average Compensation"),subtext:x().optional().default(""),secondaryNumber:x().optional().default(""),secondaryLabel:x().optional().default("")}).optional(),listItems:ie(ee({rank:Xe(),title:x(),value:x(),tag:x().optional().default("")})).optional().default([]),quoteData:ee({quote:x(),highlight:x().optional().default(""),source:x().default("Industry Insider")}).optional(),versusData:ee({leftEntity:x().optional(),leftStats:ie(ee({label:x(),value:x()})).optional(),leftPerk:x().optional(),rightEntity:x().optional(),rightStats:ie(ee({label:x(),value:x()})).optional(),rightPerk:x().optional(),verdict:x().optional()}).optional(),receiptData:ee({grossMonthly:x().optional(),items:ie(ee({label:x(),amount:x(),note:x().optional()})).optional(),totalDeductions:x().optional(),netRemaining:x().optional()}).optional(),timelineData:ee({pastYear:x().optional().default("2016"),presentYear:x().optional().default("2026"),items:ie(ee({label:x(),pastValue:x(),presentValue:x(),changeBadge:x().optional()})).optional(),bottomInsight:x().optional()}).optional(),barchartData:ie(ee({label:x(),percentage:Xe().min(0).max(100),amount:x().optional(),tag:x().optional()})).optional().default([]),leaderboardData:ee({calloutNote:x().optional().default("*Asumsi kurs : Rp15.500/US$"),items:ie(ee({rank:Xe(),name:x(),flag:x().optional().default("🌐"),value:x(),percentage:Xe().min(0).max(100).optional()})).optional()}).optional(),editorialData:ee({badge:x().optional().default("INVESTIGASI KHUSUS"),highlightPhrase:x().optional(),cards:ie(ee({step:x().optional(),title:x(),text:x(),stat:x().optional()})).optional(),keyTakeaway:x().optional()}).optional(),matrixData:ee({headers:ie(x()).optional().default(["Indikator","🇮🇩 IDN","🇲🇾 MYS","🇸🇬 SGP"]),rows:ie(ee({label:x(),values:ie(x())})).optional()}).optional(),debateData:ee({proTitle:x().optional().default("SISI PRO / BENEFIT"),proScore:x().optional().default("65%"),proPoints:ie(x()).optional(),conTitle:x().optional().default("SISI KONTRA / RISIKO"),conScore:x().optional().default("35%"),conPoints:ie(x()).optional(),callToAction:x().optional().default("Kalian di tim mana? Tulis pendapatmu di bawah! 👇")}).optional(),tierlistData:ie(ee({tier:x(),tierColor:x().optional(),items:ie(ee({name:x(),badge:x().optional(),desc:x().optional()}))})).optional().default([]),customHtml:x().optional(),customCss:x().optional(),customFields:zo(wa()).optional(),items:ie(wa()).optional(),footerNote:x().optional().default("Industry Benchmark 2026"),sourceUrl:x().optional(),methodologyBadge:x().optional(),disclaimer:x().optional(),watermark:x().optional().default("@SocialGen"),bgKeyword:x().optional().default("modern office coding night"),reelsDuration:Xe().min(5).max(90).default(30),caption:x().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")}),qo={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"},Yo={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"},Xo={class:"flex items-center gap-2.5 sm:gap-3"},Qo={class:"text-sm font-extrabold tracking-tight text-white flex items-center gap-1.5 sm:gap-2"},el={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"},tl={class:"flex items-center gap-2 sm:gap-3 text-xs"},al={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]"},sl={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]"},nl={class:"lg:hidden flex items-center justify-center px-3 py-2 bg-slate-900/90 border-b border-slate-800 flex-shrink-0"},il={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"},rl={key:0,class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"},ol={class:"flex items-center gap-2"},ll={key:0,class:"text-emerald-400"},dl={key:1,class:"text-rose-400"},ul={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"},ml=Vt({__name:"index",setup(s){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"}),t=S({theme:"blue-tech",backgroundSource:"pexels",musicFile:"random",videoStartOffset:0,audioStartOffset:0,outputs:{feed:!0,story:!0,reels:!0}}),n=S([]),r=S(-1),o=S(null);function p(N){if(!e.value||!e.value.title||o.value)return;const h=JSON.stringify(e.value),Y=N?JSON.stringify(N):"";if(h!==Y){o.value=JSON.parse(h);try{localStorage.setItem("sg_unsaved_stash",h)}catch{}}}function c(){if(!o.value)return;const N=o.value.title||"Editan Anda";e.value=JSON.parse(JSON.stringify(o.value)),o.value.theme&&(t.value.theme=o.value.theme),o.value=null,r.value=-1,M.value=-1;try{localStorage.removeItem("sg_unsaved_stash")}catch{}Q(`Editan sebelumnya ("${N.slice(0,24)}...") berhasil dikembalikan! ↩️`,"success")}function w(){o.value=null;try{localStorage.removeItem("sg_unsaved_stash")}catch{}}function b(){try{localStorage.setItem("sg_drafts",JSON.stringify(n.value))}catch{}$fetch("/api/drafts",{method:"POST",body:{drafts:n.value}}).catch(()=>{})}function O(){n.value.unshift(JSON.parse(JSON.stringify(e.value))),r.value=0,M.value=-1,b(),Q("Draft berhasil disimpan!")}function de(N){const h=n.value[N];if(h){p(h),e.value=JSON.parse(JSON.stringify(h)),h.theme&&(t.value.theme=h.theme),r.value=N,M.value=-1;const Y=!!o.value;Q(`Memuat draft #${N+1}: "${(h.title||"Untitled").slice(0,20)}..."`,"success",Y?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function K(N){n.value.splice(N,1),r.value===N&&(r.value=-1),b(),Q("Draft dihapus")}const $=S([]),M=S(-1);function Z(){try{localStorage.setItem("sg_gen_history",JSON.stringify($.value))}catch{}$fetch("/api/generation-history",{method:"POST",body:{history:$.value}}).catch(()=>{})}function P(N){const h=$.value[N];if(h){const Y=h.contentData||h;p(Y),e.value=JSON.parse(JSON.stringify(Y)),h.options&&(t.value={...t.value,...h.options}),M.value=N,r.value=-1;const Te=!!o.value;Q(`Memuat riwayat: "${(h.title||"Untitled").slice(0,24)}..."`,"success",Te?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function ve(N){$.value.splice(N,1),M.value===N&&(M.value=-1),Z(),Q("Item riwayat dihapus")}function De(){$.value=[],M.value=-1,Z(),Q("Seluruh riwayat generate berhasil dibersihkan!")}let ue=null;function oe(){try{localStorage.setItem("sg_active_content",JSON.stringify(e.value)),localStorage.setItem("sg_active_options",JSON.stringify(t.value))}catch{}clearTimeout(ue),ue=setTimeout(()=>{$fetch("/api/last-session",{method:"POST",body:{content:e.value,options:t.value}}).catch(()=>{})},1e3)}xe(()=>e.value,oe,{deep:!0}),xe(()=>t.value,oe,{deep:!0});const re=S(!1),X=S(!1),$e=S(""),G=S(null),me=S(""),ne=S("success"),F=S("editor"),q=S(null);Bt(async()=>{try{const N=localStorage.getItem("sg_active_content");if(N){const h=JSON.parse(N);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&&(t.value={...t.value,...h.session.options}))}}catch{}try{const N=localStorage.getItem("sg_active_options");if(N){const h=JSON.parse(N);h&&(t.value={...t.value,...h})}}catch{}try{const N=await $fetch("/api/drafts");if(N?.drafts&&Array.isArray(N.drafts)&&N.drafts.length>0)n.value=N.drafts;else{const h=localStorage.getItem("sg_drafts");if(h){const Y=JSON.parse(h);Array.isArray(Y)&&Y.length>0&&(n.value=Y,$fetch("/api/drafts",{method:"POST",body:{drafts:Y}}).catch(()=>{}))}}}catch{const N=localStorage.getItem("sg_drafts");if(N)try{n.value=JSON.parse(N)}catch{}}try{const N=await $fetch("/api/generation-history");if(N?.history&&Array.isArray(N.history)&&N.history.length>0)$.value=N.history;else{const h=localStorage.getItem("sg_gen_history");h&&($.value=JSON.parse(h))}}catch{}try{const N=await $fetch("/api/status");q.value=N}catch{}try{const N=localStorage.getItem("sg_unsaved_stash");N&&(o.value=JSON.parse(N))}catch{}});const te=ce(()=>{const N=Wo.safeParse(e.value);if(N.success)return{isValid:!0,error:""};{const h=N.error.errors[0];return{isValid:!1,error:`${h.path.join(".")}: ${h.message}`}}}),fe=S(null);let _e=null;function Q(N,h="success",Y){clearTimeout(_e),me.value=N,ne.value=h,fe.value=Y||null,_e=setTimeout(()=>{me.value="",fe.value=null},Y?7e3:4e3)}async function I(N,h,Y,Te){X.value=!0,$e.value=`AI Research (${Y||"Gemini"})...`;try{const V=await $fetch("/api/auto-topic",{method:"POST",body:{niche:N,layoutType:h,model:Y,language:Te}});if(V?.dataset){p(V.dataset),e.value=V.dataset,t.value.theme=V.dataset.theme,n.value.unshift(V.dataset),r.value=0,b();const Se=!!o.value;V.source==="gemini"?Q(`✨ [${V.modelUsed||"Gemini"}] Berhasil meriset: "${V.dataset.title.slice(0,32)}..."`,"success",Se?{label:"↩️ Kembalikan Editan",onClick:c}:void 0):Q(`ℹ️ [Curated Data] Topik siap: "${V.dataset.title.slice(0,32)}..."`,"success",Se?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}catch(V){Q("Gagal auto-topic: "+(V.data?.statusMessage||V.message),"error")}finally{X.value=!1,$e.value=""}}async function qe(){if(!te.value.isValid){Q("Data tidak valid: "+te.value.error,"error");return}re.value=!0,$e.value="Rendering Images & Reels...",G.value=null;const N={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(t.value))};$.value.unshift(N),M.value=0,Z(),F.value="preview";try{const h=await $fetch("/api/generate",{method:"POST",body:{data:e.value,options:t.value}});h?.success&&(G.value=h,Q(`Sukses dirender dalam ${(h.durationMs/1e3).toFixed(1)} detik!`))}catch(h){Q("Gagal render: "+(h.data?.statusMessage||h.message),"error")}finally{re.value=!1,$e.value=""}}return(N,h)=>{const Y=Ar,Te=yo;return f(),g("div",qo,[a("header",Yo,[a("div",Xo,[h[11]||(h[11]=a("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)),a("div",null,[a("h1",Qo,[h[10]||(h[10]=z(" SocialGen ",-1)),a("span",el," v"+y(l(q)?.version||"2.3.4"),1)])])]),a("div",tl,[l(q)?.geminiActive?(f(),g("span",al," ● AI Connected ")):(f(),g("span",sl," ● Local Engine "))])]),a("div",nl,[a("div",il,[a("button",{onClick:h[0]||(h[0]=V=>F.value="editor"),class:H(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(F)==="editor"?"bg-sky-500 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[...h[12]||(h[12]=[a("span",null,"⚙️ Studio & Editor",-1)])],2),a("button",{onClick:h[1]||(h[1]=V=>F.value="preview"),class:H(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(F)==="preview"?"bg-indigo-600 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[h[13]||(h[13]=a("span",null,"👁️ Live Preview",-1)),l(G)?(f(),g("span",rl)):E("",!0)],2)])]),l(me)?(f(),g("div",{key:0,class:H(["fixed bottom-6 right-6 z-50 flex items-center gap-3 px-4 py-3 rounded-2xl shadow-2xl text-xs font-bold border transition-all",l(ne)==="success"?"bg-slate-900 text-slate-100 border-sky-500/50 shadow-sky-950/50":"bg-rose-950 text-rose-200 border-rose-500/50"])},[a("div",ol,[l(ne)==="success"?(f(),g("span",ll,"●")):(f(),g("span",dl,"⚠️")),a("span",null,y(l(me)),1)]),l(fe)?(f(),g("button",{key:0,onClick:h[2]||(h[2]=()=>{l(fe)?.onClick(),me.value="",fe.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"},y(l(fe).label),1)):E("",!0),a("button",{onClick:h[3]||(h[3]=V=>{me.value="",fe.value=null}),class:"text-slate-400 hover:text-white transition ml-1 text-xs"}," ✕ ")],2)):E("",!0),a("main",ul,[a("section",{class:H(["lg:col-span-5 h-full overflow-y-auto pr-1 flex-col gap-3 custom-scrollbar",l(F)==="editor"?"flex":"hidden lg:flex"])},[A(Y,{modelValue:l(e),"onUpdate:modelValue":h[4]||(h[4]=V=>Be(e)?e.value=V:null),options:l(t),"onUpdate:options":h[5]||(h[5]=V=>Be(t)?t.value=V:null),"is-valid":l(te).isValid,"validation-error":l(te).error,"is-generating":l(re),"generate-stage":l($e),"is-auto-topic-loading":l(X),drafts:l(n),"active-draft-index":l(r),history:l($),"active-history-index":l(M),"unsaved-stash":l(o),onGenerate:qe,onAutoTopic:I,onSelectDraft:de,onDeleteDraft:K,onSaveDraft:O,onSelectHistory:P,onDeleteHistory:ve,onClearAllHistory:De,onRestoreStash:c,onClearStash:w,onToast:h[6]||(h[6]=(V,Se)=>Q(V,Se))},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),a("section",{class:H(["lg:col-span-7 h-full flex-col gap-3 overflow-hidden justify-between min-h-0",l(F)==="preview"?"flex":"hidden lg:flex"])},[A(Te,{data:l(e),"selected-video":l(t).backgroundSource,"selected-music":l(t).musicFile,"video-start-offset":l(t).videoStartOffset,"onUpdate:videoStartOffset":h[7]||(h[7]=V=>l(t).videoStartOffset=V),"audio-start-offset":l(t).audioStartOffset,"onUpdate:audioStartOffset":h[8]||(h[8]=V=>l(t).audioStartOffset=V),"generated-result":l(G)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","generated-result"])],2)]),l(F)==="editor"?(f(),g("button",{key:1,onClick:h[9]||(h[9]=V=>F.value="preview"),class:"lg:hidden fixed bottom-5 left-1/2 -translate-x-1/2 z-40 px-5 py-2.5 rounded-full bg-gradient-to-r from-sky-500 to-indigo-600 text-white font-extrabold text-xs shadow-2xl border border-sky-400/40 flex items-center gap-2 hover:opacity-95"},[...h[14]||(h[14]=[a("span",null,"👁️ Lihat Preview Canvas",-1)])])):E("",!0)])}}});export{ml as default};
|