1import{m as f,j as e,L as b}from"./app-m2ZZUNZw.js";import{A as y}from"./admin-layout-C91JKj_-.js";import{AutoBlogSubNav as N}from"./sub-nav-DDGAvppK.js";import{B as C}from"./button-CRVr6_Jn.js";import{C as d,b as o,c,d as m,a as u}from"./card-ChfqVwTf.js";import{I as i}from"./input-4JWFrMmk.js";import{L as l}from"./label-CDpbFxrK.js";import{S as n}from"./switch-Em8pO4lm.js";import{T as k,a as S,b as h,c as p}from"./tabs-Clpwr-pR.js";import{S as w,a as A,b as T,c as I,d as _}from"./select-BcR13wWa.js";import{S as q}from"./save-CiC_mpEL.js";import{S as D}from"./sliders-vertical-BOPx2LIu.js";import{B as R}from"./bot-BEkc2oe9.js";import{S as L}from"./shield-check-Coj67icO.js";import{C as B}from"./clock-BC6IeN1E.js";/* empty css */import"./app-sidebar-header-BeHEwfqk.js";import"./createLucideIcon-h_FJXIk9.js";import"./app-logo-icon-DGsD5m6d.js";import"./breadcrumb-DkQFKr2Z.js";import"./index-lluC3nh6.js";import"./utils--0HDzF2j.js";import"./x-CPNFyxTU.js";import"./chevron-right-kLG2TwML.js";import"./tooltip-DVBzVA2t.js";import"./floating-ui.react-dom-WW8yS3hh.js";import"./floating-ui.dom-B7cXm8BB.js";import"./layout-dashboard-1YUSHNiB.js";import"./tag-BbQILWHS.js";import"./folder-tree-CQzKnXc3.js";import"./monitor-BZ3vkWgi.js";import"./file-text-DRvew6Hs.js";import"./sparkles-D3zaZYDw.js";import"./users-CXPmENOx.js";import"./mail-DvU1hLxm.js";import"./message-square-B38F35zt.js";import"./settings-C0yz9s95.js";import"./trending-up-SlZY4CiN.js";import"./search-DJqfjM5c.js";import"./file-code-D2Fizyxa.js";import"./circle-play-CzxiP-iw.js";import"./index-B-21rVin.js";import"./chevron-down-C5pHU3JO.js";import"./check-DDaIUxjw.js";import"./chevron-up-B3nKA4Th.js";const P=[{title:"Dashboard",href:"/admin/dashboard"},{title:"AI Auto Blog",href:"/admin/ai-auto-blog"},{title:"Settings",href:"/admin/ai-auto-blog/settings"}];function Ae({settings:s,categories:j}){const{data:r,setData:t,put:g,processing:v}=f({is_enabled:s.is_enabled??!1,trend_research_enabled:s.trend_research_enabled??!0,ai_generation_enabled:s.ai_generation_enabled??!0,auto_publishing_enabled:s.auto_publishing_enabled??!1,require_admin_approval:s.require_admin_approval??!0,draft_mode:s.draft_mode??!0,posts_per_day:s.posts_per_day??2,posts_per_week:s.posts_per_week??10,provider:s.provider??"openrouter",openrouter_api_key:"",primary_model:s.primary_model??"openrouter/free",fallback_model:s.fallback_model??"google/gemma-4-26b-a4b-it:free",temperature:s.temperature??.7,max_tokens:s.max_tokens??4096,retry_count:s.retry_count??3,timeout:s.timeout??180,daily_request_limit:s.daily_request_limit??50,monthly_request_limit:s.monthly_request_limit??1e3,default_language:s.default_language??"en",default_category_id:s.default_category_id??null,default_word_count:s.default_word_count??1500,default_tone:s.default_tone??"authoritative and practical",target_audience:s.target_audience??"developers, AI practitioners, prompt engineers",min_quality_score:s.min_quality_score??80,duplicate_similarity_threshold:s.duplicate_similarity_threshold??85,auto_internal_linking:s.auto_internal_linking??!0,generate_faq:s.generate_faq??!0,generate_featured_image:s.generate_featured_image??!1,generate_schema:s.generate_schema??!0,research_time:s.research_time??"02:00",generation_time:s.generation_time??"04:00",publish_time:s.publish_time??"08:00",timezone:s.timezone??"UTC",max_posts_per_run:s.max_posts_per_run??2}),x=a=>{a.preventDefault(),g("/admin/ai-auto-blog/settings")};return e.jsxs(y,{breadcrumbs:P,children:[e.jsx(b,{title:"AI Auto Blog â Settings"}),e.jsx(N,{}),e.jsxs("div",{className:"p-6 max-w-5xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Auto Blog Configuration"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Configure OpenRouter free-first models, automated schedules, quality thresholds, and publishing rules."})]}),e.jsxs(C,{onClick:x,disabled:v,children:[e.jsx(q,{className:"w-4 h-4 mr-2"}),"Save Changes"]})]}),e.jsx("form",{onSubmit:x,children:e.jsxs(k,{defaultValue:"general",className:"space-y-6",children:[e.jsxs(S,{className:"grid grid-cols-4 w-full",children:[e.jsxs(h,{value:"general",className:"flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"}),e.jsx("span",{children:"General"})]}),e.jsxs(h,{value:"ai",className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),e.jsx("span",{children:"OpenRouter AI"})]}),e.jsxs(h,{value:"blog",className:"flex items-center gap-2",children:[e.jsx(L,{className:"w-4 h-4"}),e.jsx("span",{children:"Blog Defaults"})]}),e.jsxs(h,{value:"schedule",className:"flex items-center gap-2",children:[e.jsx(B,{className:"w-4 h-4"}),e.jsx("span",{children:"Schedule"})]})]}),e.jsx(p,{value:"general",className:"space-y-4",children:e.jsxs(d,{children:[e.jsxs(o,{children:[e.jsx(c,{children:"Master Automation Switches"}),e.jsx(m,{children:"Control which stages of the autonomous pipeline are active."})]}),e.jsxs(u,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(l,{children:"Enable AI Auto Blog"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Master switch for background auto blog pipeline."})]}),e.jsx(n,{checked:r.is_enabled,onCheckedChange:a=>t("is_enabled",a)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(l,{children:"Enable Trend Research"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow scheduled scans of RSS and Google Trends."})]}),e.jsx(n,{checked:r.trend_research_enabled,onCheckedChange:a=>t("trend_research_enabled",a)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(l,{children:"Enable AI Blog Generation"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow LLMs to draft articles for accepted topics."})]}),e.jsx(n,{checked:r.ai_generation_enabled,onCheckedChange:a=>t("ai_generation_enabled",a)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(l,{children:"Require Admin Approval (Recommended)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Hold generated articles as drafts until approved by an admin."})]}),e.jsx(n,{checked:r.require_admin_approval,onCheckedChange:a=>t("require_admin_approval",a)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(l,{children:"Auto Publishing"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directly publish approved articles to the public blog."})]}),e.jsx(n,{checked:r.auto_publishing_enabled,onCheckedChange:a=>t("auto_publishing_enabled",a)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-4 border-t",children:[e.jsxs("div",{children:[e.jsx(l,{children:"Posts Per Day Cap"}),e.jsx(i,{type:"number",value:r.posts_per_day,onChange:a=>t("posts_per_day",parseInt(a.target.value)||1),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Posts Per Week Cap"}),e.jsx(i,{type:"number",value:r.posts_per_week,onChange:a=>t("posts_per_week",parseInt(a.target.value)||1),className:"mt-1"})]})]})]})]})}),e.jsx(p,{value:"ai",className:"space-y-4",children:e.jsxs(d,{children:[e.jsxs(o,{children:[e.jsx(c,{children:"OpenRouter & Model Parameters"}),e.jsx(m,{children:"Configure primary free models, fallback mechanisms, and API limits."})]}),e.jsxs(u,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(l,{children:"OpenRouter API Key"}),e.jsx(i,{type:"password",placeholder:"sk-or-v1-... (Leave blank to keep existing key)",value:r.openrouter_api_key,onChange:a=>t("openrouter_api_key",a.target.value),className:"mt-1 font-mono"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Keys are encrypted server-side and never exposed to client-side scripts."})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(l,{children:"Primary Model (Free-First)"}),e.jsx(i,{value:r.primary_model,onChange:a=>t("primary_model",a.target.value),placeholder:"openrouter/free",className:"mt-1 font-mono"}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Recommended: openrouter/free (Auto-routes to active free models)"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Fallback Model"}),e.jsx(i,{value:r.fallback_model,onChange:a=>t("fallback_model",a.target.value),placeholder:"google/gemma-4-26b-a4b-it:free",className:"mt-1 font-mono"}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Invoked if primary hits 429 rate-limit or 503 overload (Recommended: google/gemma-4-26b-a4b-it:free)."})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx(l,{children:"Temperature"}),e.jsx(i,{type:"number",step:"0.05",min:"0",max:"1.5",value:r.temperature,onChange:a=>t("temperature",parseFloat(a.target.value)||.7),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Max Output Tokens"}),e.jsx(i,{type:"number",value:r.max_tokens,onChange:a=>t("max_tokens",parseInt(a.target.value)||4096),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Timeout (seconds)"}),e.jsx(i,{type:"number",value:r.timeout,onChange:a=>t("timeout",parseInt(a.target.value)||180),className:"mt-1"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2 border-t",children:[e.jsxs("div",{children:[e.jsx(l,{children:"Daily AI Request Limit"}),e.jsx(i,{type:"number",value:r.daily_request_limit,onChange:a=>t("daily_request_limit",parseInt(a.target.value)||50),className:"mt-1"}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Hard cap to prevent infinite loops."})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Monthly Request Limit"}),e.jsx(i,{type:"number",value:r.monthly_request_limit,onChange:a=>t("monthly_request_limit",parseInt(a.target.value)||1e3),className:"mt-1"})]})]})]})]})}),e.jsx(p,{value:"blog",className:"space-y-4",children:e.jsxs(d,{children:[e.jsxs(o,{children:[e.jsx(c,{children:"Content & SEO Defaults"}),e.jsx(m,{children:"Default voice, length, categories, and automated linking."})]}),e.jsxs(u,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(l,{children:"Default Category"}),e.jsxs(w,{value:r.default_category_id?String(r.default_category_id):"none",onValueChange:a=>t("default_category_id",a==="none"?null:parseInt(a)),children:[e.jsx(A,{className:"mt-1",children:e.jsx(T,{placeholder:"Select default category"})}),e.jsxs(I,{children:[e.jsx(_,{value:"none",children:"None (Auto Detect)"}),j.map(a=>e.jsx(_,{value:String(a.id),children:a.name},a.id))]})]})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Default Target Word Count"}),e.jsx(i,{type:"number",value:r.default_word_count,onChange:a=>t("default_word_count",parseInt(a.target.value)||1500),className:"mt-1"})]})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Default Brand Tone"}),e.jsx(i,{value:r.default_tone,onChange:a=>t("default_tone",a.target.value),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Target Audience"}),e.jsx(i,{value:r.target_audience,onChange:a=>t("target_audience",a.target.value),className:"mt-1"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-4 border-t",children:[e.jsxs("div",{children:[e.jsx(l,{children:"Minimum Quality Score (0-100)"}),e.jsx(i,{type:"number",min:"50",max:"95",value:r.min_quality_score,onChange:a=>t("min_quality_score",parseInt(a.target.value)||80),className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Posts scoring below this require manual review."})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Duplicate Similarity Threshold (%)"}),e.jsx(i,{type:"number",min:"50",max:"100",value:r.duplicate_similarity_threshold,onChange:a=>t("duplicate_similarity_threshold",parseInt(a.target.value)||85),className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Rejects candidates if similarity exceeds this percentage."})]})]}),e.jsxs("div",{className:"space-y-3 pt-4 border-t",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(l,{children:"Auto Internal Linking"}),e.jsx(n,{checked:r.auto_internal_linking,onCheckedChange:a=>t("auto_internal_linking",a)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(l,{children:"Generate JSON-LD Schema (Article & FAQ)"}),e.jsx(n,{checked:r.generate_schema,onCheckedChange:a=>t("generate_schema",a)})]})]})]})]})}),e.jsx(p,{value:"schedule",className:"space-y-4",children:e.jsxs(d,{children:[e.jsxs(o,{children:[e.jsx(c,{children:"Schedule & Timing"}),e.jsx(m,{children:"Control when automated jobs execute via Laravel Scheduler."})]}),e.jsxs(u,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx(l,{children:"Research Time (UTC)"}),e.jsx(i,{value:r.research_time,onChange:a=>t("research_time",a.target.value),className:"mt-1 font-mono"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Generation Time (UTC)"}),e.jsx(i,{value:r.generation_time,onChange:a=>t("generation_time",a.target.value),className:"mt-1 font-mono"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Publish Time (UTC)"}),e.jsx(i,{value:r.publish_time,onChange:a=>t("publish_time",a.target.value),className:"mt-1 font-mono"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(l,{children:"Timezone"}),e.jsx(i,{value:r.timezone,onChange:a=>t("timezone",a.target.value),className:"mt-1 font-mono"})]}),e.jsxs("div",{children:[e.jsx(l,{children:"Max Posts Per Run"}),e.jsx(i,{type:"number",value:r.max_posts_per_run,onChange:a=>t("max_posts_per_run",parseInt(a.target.value)||2),className:"mt-1"})]})]})]})]})})]})})]})]})}export{Ae as default};
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.