1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2817e13f-0a11-49ad-9639-969533a19b23",e._sentryDebugIdIdentifier="sentry-dbid-2817e13f-0a11-49ad-9639-969533a19b23")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6273,6404,5496],{76404:function(e,t,a){a.r(t),a.d(t,{AICaptionSection:function(){return m}});var s=a(57437),i=a(2265),n=a(34494),r=a(57586),l=a(15863),o=a(42820),d=a(82023),c=a(30401),x=a(78867),p=a(41217);let h=["\uD83D\uDD25 Hook","\uD83D\uDCA1 Value","â¡ Short"];function m(e){let{videoTitle:t,videoDescription:a}=e,[m,u]=(0,i.useState)(!1),[b,g]=(0,i.useState)([]),[w,y]=(0,i.useState)(""),[f,j]=(0,i.useState)(0),[N,v]=(0,i.useState)(null),[k,C]=(0,i.useState)(!1),[S,Z]=(0,i.useState)(null),D=(0,i.useCallback)(async()=>{u(!0),Z(null),g([]),y("");try{let e=await fetch("/api/generate-captions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videoTitle:t,videoDescription:a})}),s=await e.json();s.success&&s.data?(g(s.data.captions),y(s.data.hashtags),j(0)):Z(s.message||"Failed to generate captions")}catch{Z("Something went wrong. Please try again.")}finally{u(!1)}},[t,a]),T=(0,i.useCallback)(async(e,t)=>{try{await navigator.clipboard.writeText(e),v(t),setTimeout(()=>v(null),2e3)}catch{}},[]),I=(0,i.useCallback)(async()=>{try{let e=w.split(" ").filter(Boolean).map(e=>`#${e}`).join(" ");await navigator.clipboard.writeText(e),C(!0),setTimeout(()=>C(!1),2e3)}catch{}},[w]),E=b.length>0;return(0,s.jsxs)("div",{className:"max-w-2xl mx-auto mt-5",children:[!E&&(0,s.jsxs)(n.E.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.3},className:"text-center",children:[(0,s.jsxs)("button",{onClick:D,disabled:m,className:"group relative inline-flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-semibold text-white transition-all duration-300 shadow-md hover:shadow-lg disabled:opacity-60 disabled:cursor-not-allowed overflow-hidden",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-purple-600 via-pink-600 to-orange-500 opacity-90 group-hover:opacity-100 transition-opacity"}),(0,s.jsx)("span",{className:"relative flex items-center gap-2",children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.Z,{className:"w-4 h-4 animate-spin"}),"Generating..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Z,{className:"w-4 h-4"}),"Generate AI Captions"]})})]}),(0,s.jsx)("p",{className:"text-[10px] text-white/30 mt-1.5",children:"Powered by GPT-4o \xb7 3 styles + hashtags"})]}),S&&(0,s.jsx)(n.E.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"mt-3 bg-red-500/10 border border-red-500/20 rounded-lg px-4 py-2 text-center",children:(0,s.jsx)("p",{className:"text-xs text-red-400",children:S})}),(0,s.jsx)(r.M,{children:E&&(0,s.jsx)(n.E.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.4,ease:"easeOut"},children:(0,s.jsxs)("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.03] backdrop-blur-lg overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-3.5 py-2.5 border-b border-white/[0.06]",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-6 h-6 rounded-md bg-gradient-to-br from-purple-500 to-pink-600 flex items-center justify-center",children:(0,s.jsx)(d.Z,{className:"w-3 h-3 text-white"})}),(0,s.jsx)("span",{className:"font-semibold text-white text-xs",children:"AI Captions"})]}),(0,s.jsxs)("button",{onClick:D,disabled:m,className:"text-[11px] text-purple-400 hover:text-purple-300 font-medium flex items-center gap-1 transition-colors disabled:opacity-50",children:[m?(0,s.jsx)(l.Z,{className:"w-3 h-3 animate-spin"}):(0,s.jsx)(o.Z,{className:"w-3 h-3"}),"Redo"]})]}),(0,s.jsx)("div",{className:"flex border-b border-white/[0.06]",children:h.map((e,t)=>(0,s.jsxs)("button",{onClick:()=>j(t),className:`flex-1 px-3 py-2.5 text-sm font-semibold transition-all relative ${f===t?"text-white":"text-white/60 hover:text-white/80"}`,children:[(0,s.jsx)("span",{className:"relative z-10",children:e}),f===t&&(0,s.jsx)(n.E.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-gradient-to-r from-purple-500 to-pink-500",transition:{duration:.25}})]},e))}),(0,s.jsx)("div",{className:"p-3.5",children:(0,s.jsx)(r.M,{mode:"wait",children:(0,s.jsxs)(n.E.div,{initial:{opacity:0,x:6},animate:{opacity:1,x:0},exit:{opacity:0,x:-6},transition:{duration:.15},className:"flex items-start justify-between gap-3",children:[(0,s.jsx)("p",{className:"text-[13px] text-white/75 leading-relaxed flex-1",children:b[f]}),(0,s.jsx)("button",{onClick:()=>T(b[f],f),className:`shrink-0 p-1.5 rounded-md transition-all duration-200 ${N===f?"bg-green-500/20 text-green-400":"bg-white/5 text-white/40 hover:bg-white/10 hover:text-white/60"}`,title:"Copy",children:N===f?(0,s.jsx)(c.Z,{className:"w-3.5 h-3.5"}):(0,s.jsx)(x.Z,{className:"w-3.5 h-3.5"})})]},f)})}),w&&(0,s.jsx)("div",{className:"px-3.5 pb-3",children:(0,s.jsxs)("div",{className:"rounded-lg bg-white/[0.02] border border-white/[0.06] p-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(p.Z,{className:"w-3 h-3 text-purple-400"}),(0,s.jsx)("span",{className:"text-[10px] font-semibold text-white/40 uppercase tracking-wider",children:"Hashtags"})]}),(0,s.jsx)("button",{onClick:I,className:`flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-medium transition-all ${k?"bg-green-500/20 text-green-400":"bg-white/5 text-white/40 hover:bg-white/10"}`,children:k?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.Z,{className:"w-2.5 h-2.5"})," Copied"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x.Z,{className:"w-2.5 h-2.5"})," Copy"]})})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:w.split(" ").filter(Boolean).map((e,t)=>(0,s.jsxs)("span",{className:"px-3 py-1.5 rounded-lg text-[13px] font-medium bg-purple-500/8 text-purple-300/70 border border-purple-500/10 hover:border-purple-400/25 transition-colors cursor-default",children:["#",e]},t))})]})})]})})})]})}},78867:function(e,t,a){a.d(t,{Z:function(){return s}});let s=(0,a(39763).Z)("Copy",[["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"}]])}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.