import{A as M,a4 as w,B as r,j as e,T as S,D as o,a5 as v}from"./main-crazy-owls-work.js";import{$ as b}from"./useSocialTemplates-Dcb3t5jQ.js";import{u as I,a as P}from"./useMemoDebounce-BIwvA9Mb.js";import{u as D}from"./useUpdateSocialTemplates-BBEsnaqI.js";import{D as j}from"./DiscordPreview-BjtfliZ_.js";import{T as A,p as d}from"./TemplateDocLink-C5Om0X4f.js";import{I as x}from"./index-Bm9W7Nqt.js";import{M as k}from"./AiPromptConfigModal-BrZd34tw.js";import{p as $}from"./optionsHelper-B_8X5Dll.js";import{s as F}from"./index-C903bx6G.js";import{C as i}from"./index-9x8aFyWV.js";import{F as n}from"./index-DLeF0Q26.js";import{S as N}from"./index-CV7ZrOqa.js";import{S as z}from"./index-Uj_IJMNj.js";import{C as h,R as B}from"./row-DAt4Bs0l.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"./EllipsisOutlined-7nGPDvd9.js";import"./Dropdown-D0863Mnh.js";import"./move-ULSkkuK6.js";import"./mediaQueryUtil-BSyvLspT.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(a,s){return this.cache.has(a)?this.cache.get(a):(this.cache.set(a,s),s)}};const{Title:g}=S;function le(){const{token:a}=M.useToken(),[s,f]=w(b),{isTemplatesUpdateSuccessfully:u,updateSocialTemplates:y}=D(),[T,C]=F.useMessage();I(async()=>{const{status:t}=await y(s);u&&t&&P(T,t)},400,[s]);const p=(t,m)=>{f(c=>v(c,l=>{t==="postingType"&&c.discord.postingType==="isPromptImage"&&m!=="isPromptImage"&&(l.discord.promptImage=""),l.discord[t]=m}))};return r(B,{gutter:20,children:[C,e(h,{span:14,children:r(i,{size:"small",style:{backgroundColor:a.colorFillAlter},children:[e(g,{level:4,children:o("Discord Template Settings")}),e(A,{platform:"Discord"}),r(i,{children:[e(i.Meta,{description:o("Custom message settings."),title:o("Custom Message")}),e("div",{children:e(k,{onChange:t=>p("content",t),rows:5,style:{minWidth:200},value:s.discord.content})})]}),e(i,{style:{marginTop:10},children:r(n,{gap:20,justify:"space-between",children:[e(i.Meta,{description:o("Post styling and type setup."),title:o("Posting type")}),e("div",{children:e(N,{onChange:t=>p("postingType",t),options:$,style:{minWidth:200},value:s.discord.postingType})})]})}),s.discord.postingType==="isPromptImage"&&e(i,{style:{marginTop:10},children:r(n,{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(x,{onChange:t=>p("promptImage",t),value:s.discord.promptImage})})]})}),e(i,{style:{marginTop:10},children:r(n,{gap:20,justify:"space-between",children:[e(i.Meta,{description:`Discord restricts the length of a tweet to ${d.discord.description.length} characters. If you enable this option, the first ${d.discord.description.length} characters of your personalized message will be shared; if not, the limit prevents the tweet from being shared.`,title:o("Trim Message")}),e("div",{children:e(z,{checked:s.discord.trimMessage,onChange:t=>p("trimMessage",t)})})]})})]})}),r(h,{span:10,children:[r(g,{level:5,children:[" ",o("Preview")," "]}),e(j,{message:s.discord.content,type:s.discord.postingType})]})]})}export{le as default};
