import{A as M,a4 as v,B as r,j as e,T as S,D as o,au as b,a5 as I}from"./main-crazy-owls-work.js";import{$ as P}from"./useSocialTemplates-Dcb3t5jQ.js";import{u as j,a as A}from"./useMemoDebounce-BIwvA9Mb.js";import{u as x}from"./useUpdateSocialTemplates-BBEsnaqI.js";import{T as k}from"./ThreadsPreview-BEaX-2Ch.js";import{T as F,p}from"./TemplateDocLink-C5Om0X4f.js";import{I as W}from"./index-Bm9W7Nqt.js";import{M as m}from"./AiPromptConfigModal-BrZd34tw.js";import{p as $}from"./optionsHelper-B_8X5Dll.js";import{s as D}from"./index-C903bx6G.js";import{R as N,C as g}from"./row-DAt4Bs0l.js";import{C as i}from"./index-9x8aFyWV.js";import{F as l}from"./index-DLeF0Q26.js";import{S as B}from"./index-CV7ZrOqa.js";import{S as L}from"./index-Uj_IJMNj.js";import"./PreviewCard-DAT49Z9x.js";import"./emotion-react.browser.esm-Y_LRzwGN.js";import"./index-B1hhaeCD.js";import"./index-DbMzUBXN.js";import"./AntIconWrapper-CV4oO3YH.js";import"./index-D66C40IV.js";import"./Input-DrlF5Epd.js";import"./EyeOutlined-BpDfhdMV.js";import"./context-DxDN2Q9A.js";import"./mediaQueryUtil-BSyvLspT.js";import"./EllipsisOutlined-7nGPDvd9.js";import"./Dropdown-D0863Mnh.js";import"./move-ULSkkuK6.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,s){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,s),s)}};const{Title:u}=S;function he(){const{token:n}=M.useToken(),[s,f]=v(P),{isTemplatesUpdateSuccessfully:y,updateSocialTemplates:T}=x(),[C,w]=D.useMessage();j(async()=>{const{status:t}=await T(s);y&&t&&A(C,t)},400,[s]);const a=(t,c)=>{f(h=>I(h,d=>{t==="postingType"&&h.threads.postingType==="isPromptImage"&&c!=="isPromptImage"&&(d.threads.promptImage=""),d.threads[t]=c}))};return r(i,{style:{backgroundColor:n.colorFillAlter},children:[w,r(N,{gutter:20,children:[r(g,{span:14,children:[r(u,{level:4,children:[o("threads Template Settings")," "]}),e(F,{platform:"threads"}),r(i,{children:[e(i.Meta,{description:o("Custom message settings."),title:o("Custom Message")}),e("div",{children:e(m,{onChange:t=>a("content",t),rows:5,style:{minWidth:200},value:s.threads.content,wordCount:p.threads.content.length})})]}),e(i,{style:{marginTop:10},children:r(l,{gap:20,justify:"space-between",children:[e(i.Meta,{description:o("Post styling and type setup."),title:o("Posting type")}),e("div",{children:e(B,{onChange:t=>a("postingType",t),options:$,style:{minWidth:200},value:s.threads.postingType})})]})}),s.threads.postingType==="isPromptImage"&&e(i,{style:{marginTop:10},children:r(l,{gap:20,justify:"space-between",children:[e(i.Meta,{description:o("Select an AI prompt for image generation."),title:o("Prompt Name")}),e("div",{children:e(W,{onChange:t=>a("promptImage",t),value:s.threads.promptImage})})]})}),r(i,{style:{marginTop:10},children:[e(i.Meta,{description:o("Add a topic"),title:o("Topic")}),e("div",{children:e(m,{onChange:t=>a("topic",t),rows:1,style:{minWidth:200},value:s.threads.topic,wordCount:p.threads.topic.length})})]}),r(i,{style:{marginTop:10},children:[e(i.Meta,{description:o("Your reply"),title:o("First reply")}),e("div",{children:e(m,{onChange:t=>a("comment",t),rows:2,style:{minWidth:200},value:s.threads.comment,wordCount:p.threads.comment.length})})]}),e(i,{style:{marginTop:10},children:r(l,{gap:20,justify:"space-between",children:[e(i.Meta,{description:b(o("Threads restricts the length of a post to %1$d characters. If you enable this option, the first %1$d characters of your personalized message will be shared; if not, the limit prevents the post from being shared"),p.threads.content.length),title:o("Trim Message")}),e("div",{children:e(L,{checked:s.threads.trimMessage,onChange:t=>a("trimMessage",t)})})]})})]}),r(g,{span:10,children:[r(u,{level:5,children:[" ",o("Preview")," "]}),e(k,{message:s.threads.content,type:s.threads.postingType})]})]})]})}export{he as default};
