1import{r as P,j as e,aY as q,s as M,ab as n,cq as J,B as u,a4 as p,S as j,aF as S,Y as K,J as Z,aZ as $,ap as v,bT as H}from"./index-CuSEeJFb.js";import{u as Q,F as X}from"./file-management-panel-CMp7oECT.js";import"./image-fQC3p4ps.js";import"./video-AMZtj4XD.js";import"./upload-rep3KVPL.js";function le({register:d,setValue:b,watch:m,businessProfile:y,isGeneratingField:s,onGenerateField:l}){const x=m("platformContent.title")||"",A=m("platformContent.blogContent")||"",f=m("platformContent.keywords")||"",h=m("platformContent.urlSlug")||"",B=m("platformContent.featuredImage")||"",w=m("platformContent.metaDescription")||"";m("platformContent.introduction"),m("platformContent.conclusion");const[o,C]=P.useState([]),I=t=>{C(a=>[...a,...t]),N([...o,...t],i)},L=t=>{const a=o.filter(r=>r.id!==t);C(a),N(a,i)},D=(t,a)=>{const r=o.findIndex(O=>O.id===t);if(r===-1)return;const c=[...o],g=a==="up"?r-1:r+1;g>=0&&g<c.length&&([c[r],c[g]]=[c[g],c[r]],C(c),N(c,i))},N=(t,a)=>{const r=[...a.map(c=>c.url),...t.map(c=>c.fileUrl)];r.length>0&&b("platformContent.featuredImage",r[0])},{files:i,isUploading:_,addFiles:V,removeFile:T,moveFile:U,triggerFileSelect:z,canAddMore:F}=Q({onFilesChange:t=>{N(o,t)},maxFiles:1,initialFiles:B?[{id:"existing",url:B,name:"Featured Image",type:"image/jpeg",size:0}]:[]}),k=t=>t.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim("-"),E=t=>{const a=t.target.value;b("platformContent.title",a),(!h||h===k(x))&&b("platformContent.urlSlug",k(a))},R=()=>new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),W=()=>(y==null?void 0:y.companyName)||"Your Business",Y=()=>{const t=A.split(/\s+/).length;return`${Math.max(1,Math.ceil(t/200))} min read`};return e.jsxs("div",{className:"max-w-4xl mx-auto bg-white dark:bg-gray-900 rounded-lg shadow-lg overflow-hidden",children:[e.jsx("div",{className:"bg-gradient-to-r from-blue-50 to-purple-50 dark:from-blue-900/20 dark:to-purple-900/20 p-4 border-b",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"Blog Post Preview"})]}),e.jsx(M,{variant:"outline",className:"text-xs",children:"Live Preview"})]})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx(n,{className:"text-sm font-medium mb-2 block",children:"Featured Image"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"relative bg-gray-100 dark:bg-gray-800 rounded-lg overflow-hidden",children:i.length>0?e.jsx("div",{className:"w-full h-64",children:e.jsx("img",{src:i[0].url,alt:x||"Blog featured image",className:"w-full h-full object-cover"})}):o.length>0?e.jsx("div",{className:"w-full h-64",children:e.jsx("img",{src:o[0].fileUrl,alt:x||"Blog featured image",className:"w-full h-full object-cover"})}):e.jsx("div",{className:"w-full h-64 border-2 border-dashed border-gray-300 dark:border-gray-600 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(J,{className:"w-12 h-12 text-gray-400 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Featured blog image"})]})})}),e.jsx(X,{files:i,selectedAssets:o,onRemoveFile:T,onRemoveAsset:L,onMoveFile:U,onMoveAsset:D,onAddFiles:()=>z(!1),onSelectFromLibrary:I,canAddMore:i.length+o.length<1,maxFiles:1,title:"Featured Image",className:"mt-3",onGenerateField:l,isGeneratingField:s})]})]}),e.jsxs("div",{className:"border-b pb-6 mb-6",children:[e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(n,{className:"text-sm font-medium",children:"Blog Title"}),l&&e.jsx(u,{size:"sm",variant:"ghost",onClick:()=>l("title"),disabled:s==null?void 0:s("title"),className:"h-6 px-2 text-xs","data-testid":"button-generate-title",children:s!=null&&s("title")?e.jsx(p,{className:"w-3 h-3 animate-spin"}):e.jsx(j,{className:"w-3 h-3"})})]}),e.jsx(S,{...d("platformContent.title"),onChange:E,placeholder:"Enter your blog post title...",className:"text-lg font-bold border-0 bg-transparent px-0 focus-visible:ring-0 placeholder:text-gray-400","data-testid":"input-blog-title"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-gray-600 dark:text-gray-400",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(K,{className:"w-4 h-4"}),e.jsxs("span",{children:["By ",W()]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Z,{className:"w-4 h-4"}),e.jsx("span",{children:R()})]}),A&&e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("span",{children:Y()})})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(n,{className:"text-sm font-medium",children:"URL Slug"}),e.jsxs(u,{size:"sm",variant:"ghost",onClick:()=>b("platformContent.urlSlug",k(x)),className:"h-6 px-2 text-xs",disabled:!x,"data-testid":"button-generate-slug",children:[e.jsx($,{className:"w-3 h-3 mr-1"}),"Auto-generate"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-gray-500",children:"yoursite.com/blog/"}),e.jsx(S,{...d("platformContent.urlSlug"),placeholder:"blog-post-url-slug",className:"flex-1","data-testid":"input-url-slug"})]}),h&&e.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Full URL: yoursite.com/blog/",h]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(n,{className:"text-sm font-medium",children:"Introduction"}),l&&e.jsx(u,{size:"sm",variant:"ghost",onClick:()=>l("introduction"),disabled:s==null?void 0:s("introduction"),className:"h-6 px-2 text-xs","data-testid":"button-generate-introduction",children:s!=null&&s("introduction")?e.jsx(p,{className:"w-3 h-3 animate-spin"}):e.jsx(j,{className:"w-3 h-3"})})]}),e.jsx(v,{...d("platformContent.introduction"),placeholder:"Write an engaging introduction to hook your readers...",className:"min-h-[80px]","data-testid":"textarea-introduction"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(n,{className:"text-sm font-medium",children:"Main Content"}),l&&e.jsx(u,{size:"sm",variant:"ghost",onClick:()=>l("blogContent"),disabled:s==null?void 0:s("blogContent"),className:"h-6 px-2 text-xs","data-testid":"button-generate-content",children:s!=null&&s("blogContent")?e.jsx(p,{className:"w-3 h-3 animate-spin"}):e.jsx(j,{className:"w-3 h-3"})})]}),e.jsx(v,{...d("platformContent.blogContent"),placeholder:"Write your main blog content here...",className:"min-h-[200px]","data-testid":"textarea-blog-content"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(n,{className:"text-sm font-medium",children:"Conclusion"}),l&&e.jsx(u,{size:"sm",variant:"ghost",onClick:()=>l("conclusion"),disabled:s==null?void 0:s("conclusion"),className:"h-6 px-2 text-xs","data-testid":"button-generate-conclusion",children:s!=null&&s("conclusion")?e.jsx(p,{className:"w-3 h-3 animate-spin"}):e.jsx(j,{className:"w-3 h-3"})})]}),e.jsx(v,{...d("platformContent.conclusion"),placeholder:"Write a compelling conclusion with clear next steps...",className:"min-h-[80px]","data-testid":"textarea-conclusion"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(n,{className:"text-sm font-medium",children:"SEO Keywords"}),e.jsx(H,{className:"w-4 h-4 text-gray-400"})]}),e.jsx(S,{...d("platformContent.keywords"),placeholder:"Enter keywords separated by commas...","data-testid":"input-keywords"}),f&&e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:(Array.isArray(f)?f:f.split(",")).map((t,a)=>e.jsxs(M,{variant:"secondary",className:"text-xs",children:["#",typeof t=="string"?t.trim():t]},a))})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(n,{className:"text-sm font-medium",children:"Meta Description"}),l&&e.jsx(u,{size:"sm",variant:"ghost",onClick:()=>l("metaDescription"),disabled:s==null?void 0:s("metaDescription"),className:"h-6 px-2 text-xs","data-testid":"button-generate-meta",children:s!=null&&s("metaDescription")?e.jsx(p,{className:"w-3 h-3 animate-spin"}):e.jsx(j,{className:"w-3 h-3"})})]}),e.jsx(v,{...d("platformContent.metaDescription"),placeholder:"Brief description for search engines (150-160 characters)...",maxLength:160,className:"min-h-[60
1px]","data-testid":"textarea-meta-description"}),e.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mt-1",children:[e.jsx("span",{children:"SEO description for search results"}),e.jsxs("span",{children:[w.length,"/160"]})]})]}),(x||w)&&e.jsxs("div",{className:"p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-200 dark:border-blue-800",children:[e.jsx("h4",{className:"text-sm font-medium text-blue-900 dark:text-blue-100 mb-2",children:"Search Engine Preview"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-blue-600 dark:text-blue-400 text-sm underline",children:x||"Your Blog Post Title"}),e.jsxs("div",{className:"text-green-600 dark:text-green-400 text-xs",children:["yoursite.com/blog/",h||"blog-post-url"]}),e.jsx("div",{className:"text-gray-600 dark:text-gray-400 text-sm",children:w||"Meta description will appear here..."})]})]})]})]})}export{le as BlogMockup};
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.