1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[74278],{51897:(e,t,s)=>{s.r(t),s.d(t,{InstagramBurnedModal:()=>f});var a=s(95155),r=s(12115),l=s(67161),n=s(65229),i=s(6132),d=s(42529),c=s(93499),o=s(35299),x=s(18085),m=s(89419),h=s(28445);function f(e){let{burnedVideoUrl:t,initialCaption:s,defaultDmLink:f,product:p,productTitle:b,coverOffsetMs:u,onClose:g,onPosted:j}=e,[k,N]=(0,r.useState)((s||"").slice(0,2200)),[y,w]=(0,r.useState)(!1),[v,C]=(0,r.useState)(null),[I,A]=(0,r.useState)(!1),S=(0,h.$6)(),[z,P]=(0,r.useState)(S&&!!(f&&f.trim())),[D,L]=(0,r.useState)("LINK"),[K,M]=(0,r.useState)((f||"").trim()),E=(0,r.useCallback)(async()=>{if(y||I)return;let e=z&&/^https?:\/\//i.test(K.trim());w(!0),C(null);try{let s=await fetch("/api/instagram/publish-burned",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({videoUrl:t,caption:k,...p&&p.trim()?{product:p.trim(),productTitle:(b||"").trim()}:{},..."number"==typeof u&&u>=0?{thumbOffsetMs:Math.round(u)}:{},...e?{autoDm:{link:K.trim(),keyword:D.trim()||"LINK"}}:{}})}),a=await s.json();if(!s.ok||!a.ok)return void C(a.error||"Instagram publish failed.");A(!0),j&&j()}catch(e){C(e instanceof Error?e.message:"Posting failed.")}finally{w(!1)}},[y,I,t,k,p,b,u,z,D,K,j]),R=!y,_=(0,r.useRef)(null),O=(0,m.f)(!0,_,()=>{R&&g()});return(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:()=>R&&g(),onKeyDown:O,role:"presentation",children:(0,a.jsxs)("div",{ref:_,className:"bg-white dark:bg-[#1c1c1e] rounded-2xl shadow-2xl max-w-lg w-full max-h-[92vh] flex flex-col outline-none",onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Post Short to Instagram",tabIndex:-1,children:[(0,a.jsxs)("div",{className:"flex items-start justify-between p-5 border-b border-gray-100 dark:border-white/10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)("span",{className:"inline-flex items-center justify-center w-8 h-8 rounded-lg flex-shrink-0",style:{background:"linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%)"},children:(0,a.jsx)(l.A,{size:16,className:"text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-[#1d1d1f] dark:text-[#f5f5f7]",children:"Post Short to Instagram"}),(0,a.jsx)("p",{className:"text-[11px] text-[#6e6e73] dark:text-[#ebebf0] mt-0.5",children:"Review your caption, then post as a Reel"})]})]}),(0,a.jsx)("button",{onClick:g,disabled:!R,className:"text-[#86868b] hover:text-[#1d1d1f] dark:hover:text-[#f5f5f7] disabled:opacity-40 flex-shrink-0",children:(0,a.jsx)(n.A,{size:18})})]}),(0,a.jsx)("div",{className:"overflow-y-auto flex-1 p-5",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)("div",{className:"rounded-xl overflow-hidden bg-[#000] aspect-[9/16] max-w-[200px]",children:(0,a.jsx)("video",{src:t,controls:!0,playsInline:!0,className:"w-full h-full"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-[10px] font-semibold text-[#3a3a3c] dark:text-[#d2d2d7] uppercase tracking-wide mb-1.5",children:"Caption (edit freely)"}),(0,a.jsx)("textarea",{value:k,onChange:e=>N(e.target.value),maxLength:2200,rows:7,className:"w-full text-sm px-3 py-2 rounded-md border border-gray-200 dark:border-white/10 bg-white dark:bg-[#2c2c2e] text-[#1d1d1f] dark:text-[#f5f5f7]"}),(0,a.jsxs)("p",{className:"text-[10px] text-[#86868b] mt-1",children:[k.length," / 2200 \xb7 Hashtags + disclaimer included."]})]}),S&&(0,a.jsxs)("div",{className:"rounded-lg border border-gray-200 dark:border-white/10 p-3",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,a.jsx)("input",{type:"checkbox",checked:z,onChange:e=>P(e.target.checked),className:"accent-[#7C3AED]"}),(0,a.jsx)("span",{className:"text-[13px] font-medium text-[#1d1d1f] dark:text-[#f5f5f7]",children:"Auto-DM the link when someone comments"})]}),z&&(0,a.jsxs)("div",{className:"mt-2.5 flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] text-[#86868b] shrink-0",children:"When they comment"}),(0,a.jsx)("input",{value:D,onChange:e=>L(e.target.value.replace(/\s+/g," ").trimStart().slice(0,30)),placeholder:"LINK",className:"flex-1 text-sm px-2.5 py-1.5 rounded-md border border-gray-200 dark:border-white/10 bg-white dark:bg-[#2c2c2e] text-[#1d1d1f] dark:text-[#f5f5f7]"})]}),(0,a.jsx)("input",{value:K,onChange:e=>M(e.target.value),placeholder:"Link to DM them (https://â¦)",className:"w-full text-sm px-2.5 py-1.5 rounded-md border border-gray-200 dark:border-white/10 bg-white dark:bg-[#2c2c2e] text-[#1d1d1f] dark:text-[#f5f5f7]"}),(0,a.jsxs)("p",{className:"text-[10px] text-[#86868b]",children:["Anyone who comments ",(0,a.jsx)("span",{className:"font-semibold",children:(D||"LINK").toUpperCase()}),' on this Reel gets your link in their DMs automatically. Tip: add "Comment ',(D||"LINK").toUpperCase(),' for the link" to the caption or the video.']})]})]}),v&&(0,a.jsx)("div",{className:"rounded-lg border-[#ff3b30]/20 bg-[#ff3b30]/5 p-3",children:(0,a.jsxs)("p",{className:"text-xs text-[#ff3b30] flex items-center gap-1.5",children:[(0,a.jsx)(i.A,{size:12})," ",v]})}),I&&(0,a.jsxs)("div",{className:"rounded-lg border-[#34c759]/20 bg-[#34c759]/5 p-3 flex flex-col gap-1",children:[(0,a.jsxs)("p",{className:"text-xs text-[#34c759] flex items-center gap-1.5",children:[(0,a.jsx)(d.A,{size:12})," Reel live on Instagram."]}),(0,a.jsxs)("a",{href:"https://www.instagram.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[11px] text-[#7C3AED] hover:underline self-start",children:["Open Instagram ",(0,a.jsx)(c.A,{size:10})]})]})]})}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2 p-5 border-t border-gray-100 dark:border-white/10",children:[(0,a.jsx)("button",{onClick:g,disabled:!R,className:"btn-secondary text-sm",children:"Cancel"}),(0,a.jsx)("button",{onClick:()=>
1void E(),disabled:y||I,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-semibold text-white disabled:opacity-50",style:{background:I?"#34c759":"linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%)"},children:y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.A,{size:14,className:"animate-spin"})," Postingâ¦"]}):I?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.A,{size:14})," Posted"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.A,{size:14})," Post to Instagram"]})})]})]})})}}}]);
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.