1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8823],{91198:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ai-post-create/upload-url",function(){return r(63835)}])},63835:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return u}});var s=r(85893),a=r(67294),l=r(11163),n=r(56137),i=r(9008),o=r.n(i),c=r(22655),d=r(37489),x=r(78773);r(73742),r(20144);var m=r(40196);function u(e){var t,r;let{embedded:i=!1,onBack:u,onGenerate:g}=e,h=c.Z.posts,p=(0,l.useRouter)(),{data:f,status:b}=(0,d.k)(),[j,y]=(0,a.useState)(""),[N,v]=(0,a.useState)(!1),[w,k]=(0,a.useState)(""),[L,C]=(0,a.useState)(null),[E,S]=(0,a.useState)("medium"),[I,U]=(0,a.useState)(m.MY_STYLE_OPTION),[P,R]=(0,a.useState)(!1),[_,M]=(0,a.useState)(""),[T,z]=(0,a.useState)(!1),[A,q]=(0,a.useState)(""),[O,W]=(0,a.useState)("");(0,a.useEffect)(()=>{"loading"===b||f||p.push("/signin")},[f,b,p]);let G=async()=>{if(!j.trim()){k("Please enter a URL");return}try{new URL(j)}catch(e){k("Please enter a valid URL");return}k(""),v(!0);try{g?await g({source:"upload-url",sourceType:"url",url:j,template:L,influencerId:(0,m.resolveInfluencerId)(I),influencer:(0,m.resolveInfluencerMeta)(I),postLength:E}):k("Generation handler not available.")}catch(e){console.error("Error generating post:",e),k("Failed to generate post. Please try again.")}finally{v(!1)}},B=async e=>{if(e.preventDefault(),q(""),W(""),!_.trim()){q("Please enter a LinkedIn URL");return}z(!0);try{let e=await fetch("/api/linkedin-influencers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({linkedinUrl:_.trim()})}),t=await e.json();t.success?(W(t.message||"Influencer request submitted successfully! We will add them to our system soon."),M(""),setTimeout(()=>{R(!1),W("")},2e3)):q(401===e.status?"Please sign in to request an influencer.":t.error||"Failed to submit request. Please try again.")}catch(e){console.error("Error submitting influencer request:",e),q("Failed to submit request. Please try again.")}finally{z(!1)}};return"loading"===b?(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:"Loading..."}):(0,s.jsxs)(s.Fragment,{children:[!i&&(0,s.jsxs)(o(),{children:[(0,s.jsx)("title",{children:"Enter URL - Create AI Post"}),(0,s.jsx)("meta",{name:"description",content:"Enter a URL to extract content and create a LinkedIn post"}),(0,s.jsx)("link",{rel:"icon",href:h.icon})]}),i?(0,s.jsx)("div",{className:"bg-gradient-to-br from-gray-50 to-gray-100 py-8 px-4 sm:px-6 lg:px-8",children:(0,s.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,s.jsxs)("div",{className:"text-center mb-8",children:[(0,s.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-3",children:"Enter URL"}),(0,s.jsx)("p",{className:"text-gray-600",children:"Enter a URL to extract content and create a LinkedIn post from it"})]}),(0,s.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl p-8",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{className:"block text-lg font-semibold text-gray-700 mb-3",children:"Enter URL"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-2xl text-gray-400",children:(0,s.jsx)(x.gjK,{})}),(0,s.jsx)("input",{type:"url",value:j,onChange:e=>{y(e.target.value),k("")},placeholder:"https://example.com/article",className:"text-lg w-full pl-12 pr-4 py-4 border-2 border-gray-200 rounded-xl focus:border-green-500 focus:ring-2 focus:ring-green-200 outline-none transition-all",disabled:N})]}),(0,s.jsx)("p",{className:"mt-2 text-sm text-gray-500",children:"Enter any URL and we'll extract the content to create your LinkedIn post"})]}),w&&(0,s.jsx)("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,s.jsx)("p",{className:"text-sm text-red-700",children:w})}),(0,s.jsx)(m.default,{selected:I,onSelect:e=>{U(e),k("")},onAddClick:()=>R(!0),accent:"green",layout:"row",userImage:null==f?void 0:null===(t=f.user)||void 0===t?void 0:t.image}),(0,s.jsx)("button",{onClick:G,disabled:N||!j.trim(),className:"w-full text-lg py-4 rounded-xl font-semibold text-white transition-all duration-200 ".concat(N||!j.trim()?"bg-gray-400 cursor-not-allowed":"bg-gradient-to-r from-green-500 to-green-600 hover:from-green-600 hover:to-green-700 shadow-lg hover:shadow-xl"),children:N?(0,s.jsxs)("div",{className:"flex items-center justify-center",children:[(0,s.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Generating your post..."]}):"Generate Post"})]})]})}):(0,s.jsx)(n.Z,{children:(0,s.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 py-12 px-4 sm:px-6 lg:px-8",children:(0,s.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,s.jsxs)("div",{className:"text-center mb-8",children:[(0,s.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-3",children:"Enter URL"}),(0,s.jsx)("p",{className:"text-gray-600",children:"Enter a URL to extract content and create a LinkedIn post from it"})]}),(0,s.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl p-8",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{className:"block text-lg font-semibold text-gray-700 mb-3",children:"Post Length"}),(0,s.jsxs)("div",{className:"flex justify-between w-full",children:[(0,s.jsxs)("label",{className:"flex flex-col items-center cursor-pointer flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"radio",name:"postLength",value:"short",checked:"short"===E,onChange:e=>S(e.target.value),className:"w-4 h-4 text-green-600 border-gray-300 focus:ring-green-500"}),(0,s.jsx)("span",{className:"text-base font-medium text-gray-900",children:"Short"})]}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"50â300 characters"})]}),(0,s.jsxs)("label",{className:"flex flex-col items-center cursor-pointer flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"radio",name:"postLength",value:"medium",checked:"medium"===E,onChange:e=>S(e.target.value),className:"w-4 h-4 text-green-600 border-gray-300 focus:ring-green-500"}),(0,s.jsx)("span",{className:"text-base font-medium text-gray-900",children:"Medium"})]}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"300â1,200 characters"})]}),(0,s.jsxs)("label",{className:"flex flex-col items-center cursor-pointer flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"radio",name:"postLength",value:"long",checked:"long"===E,onChange:e=>S(e.target.value),className:"w-4 h-4 text-green-600 border-gray-300 focus:ring-green-500"}),(0,s.jsx)("span",{className:"text-base font-medium text-gray-900",children:"Long"})]}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"1,200â3,000 characters"})]})]})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{className:"block text-lg font-semibold text-gray-700 mb-3",children:"Enter URL"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-2xl text-gray-400",children:(0,s.jsx)(x.gjK,{})}),(0,s.jsx)("input",{type:"url",value:j,onChange:e=>{y(e.target.value),k("")},placeholder:"https://example.com/article",className:"text-lg w-full pl-12 pr-4 py-4 border-2 border-gray-200 rounded-xl focus:border-green-500 focus:ring-2 focus:ring-green-200 outline-none transition-all",disabled:N})]}),(0,s.jsx)("p",{className:"mt-2 text-sm text-gray-500",children:"Enter any URL and we'll extract the content to create your LinkedIn post"})]}),w&&(0,s.jsx)("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,s.jsx)("p",{className:"text-sm text-red-700",children:w})}),(0,s.jsx)(m.default,{selected:I,onSelect:e=>{U(e),k("")},onAddClick:()=>R(!0),accent:"green",layout:"grid",userImage:null==f?void 0:null===(r=f.user)||void 0===r?void 0:r.image}),(0,s.jsx)("button",{onClick:G,disabled:N||!j.trim(),className:"w-full text-lg py-4 rounded-xl font-semibold text-white transition-all duration-200 ".concat(N||!j.trim()?"bg-gray-400 cursor-not-allowed":"bg-gradient-to-r from-green-500 to-green-600 hover:from-green-600 hover:to-green-700 shadow-lg hover:shadow-xl"),children:N?(0,s.jsxs)("div",{className:"flex items-center justify-center",children:[(0,s.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Generating your post..."]}):"Generate Post"})]})]})})}),P&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl max-w-xl w-full p-6 relative",children:[(0,s.jsx)("button",{onClick:()=>{R(!1),M(""),q(""),W("")},className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 transition-colors",children:(0,s.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,s.jsxs)("div",{className:"flex items-center justify-center",children:[(0,s.jsx)("img",{src:"/icon128.png",alt:"Postbold Logo",className:"w-10 h-10 mb-2 mr-2"}),(0,s.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Add Linkedin Influencers"})]}),(0,s.jsx)("p",{className:"text-gray-600 mb-6",children:"Enter the LinkedIn URL of an influencer whose writing style you'd like to replicate. We'll add them to our system soon and notify you."}),(0,s.jsxs)("form",{onSubmit:B,children:[(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("input",{type:"url",id:"linkedinUrl",value:_,onCh
1ange:e=>{M(e.target.value),q("")},placeholder:"https://www.linkedin.com/in/username",className:"w-full px-4 py-2 border-2 border-gray-200 rounded-lg focus:border-green-500 focus:ring-2 focus:ring-green-200 outline-none transition-all",disabled:T,required:!0})}),A&&(0,s.jsx)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg",children:(0,s.jsx)("p",{className:"text-sm text-red-700",children:A})}),O&&(0,s.jsx)("div",{className:"mb-4 p-3 bg-green-50 border border-green-200 rounded-lg",children:(0,s.jsx)("p",{className:"text-sm text-green-700",children:O})}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{R(!1),M(""),q(""),W("")},className:"flex-1 px-4 py-2 border-2 border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-all font-medium",disabled:T,children:"Cancel"}),(0,s.jsx)("button",{type:"submit",disabled:T||!_.trim(),className:"flex-1 px-4 py-2 rounded-lg font-medium text-white transition-all ".concat(T||!_.trim()?"bg-gray-400 cursor-not-allowed":"bg-green-500 hover:bg-green-600"),children:T?(0,s.jsxs)("div",{className:"flex items-center justify-center",children:[(0,s.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Submitting..."]}):"Submit"})]})]})]})})]})}},9008:function(e,t,r){e.exports=r(7828)}},function(e){e.O(0,[4838,4321,6660,4396,509,1664,5675,8005,3542,2655,5069,7517,196,3742,3061,2888,9774,179],function(){return e(e.s=91198)}),_N_E=e.O()}]);
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.