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