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