import{L as b,ae as w,N as s,M as i,j as e,T as g,af as I}from"./main-fine-mails-rush.js";import{$ as S}from"./useSocialTemplates-CALaJ7Id.js";import{u as x,a as j}from"./useMemoDebounce-Bwtl1ukJ.js";import{u as A}from"./useUpdateSocialTemplates-CGdlKwjv.js";import{P}from"./PreviewDummy-B4JEjQhp.js";import{T as F}from"./TemplateDocLink-DZ7n7_Zf.js";import{M as l,p as m}from"./platformsLimitations-BpHu19Pc.js";import{s as k}from"./index-CFr-oYcN.js";import{R as $,C as c}from"./row-DS7Wtzse.js";import{C as o}from"./index-CYdJlGpp.js";import{F as p}from"./index-DvXnyFAQ.js";import{S as D}from"./Input-DqvQHhaj.js";import{S as L}from"./index-_4I6v-bI.js";import"./index-CzEr1K2Q.js";import"./index-C4jBXdje.js";import"./EyeOutlined-BwUAwdeL.js";import"./context-BHbH7wco.js";import"./EllipsisOutlined-Bu1rzp5h.js";import"./Dropdown-4_vtvAKA.js";import"./move-DlKUsITS.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,a){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,a),a)}};const{Title:N}=g;function se(){const{token:r}=b.useToken(),[a,d]=w(S),{isTemplatesUpdateSuccessfully:h,updateSocialTemplates:u}=A(),[f,y]=k.useMessage();x(async()=>{const{status:t}=await u(a);h&&t&&j(f,t)},400,[a]);const n=(t,C)=>{d(M=>I(M,v=>{v.instagram[t]=C}))},T=[{label:s("Feature image"),value:"isFeaturedImage"},{label:s("Product Image"),value:"isProductImage"},{label:s("All images"),value:"isAllImages"}];return i(o,{style:{backgroundColor:r.colorFillAlter},children:[y,i($,{gutter:20,children:[i(c,{span:14,children:[i(N,{level:4,children:[s("Instagram Template Settings")," "]}),e(F,{platform:"Instagram"}),i(o,{children:[e(o.Meta,{description:s("Custom message settings."),title:s("Custom Message")}),e("div",{children:e(l,{onChange:t=>n("content",t),rows:5,style:{minWidth:200},value:a.instagram.content,wordCount:m.instagram.description.length})})]}),i(o,{style:{marginTop:10},children:[i(p,{gap:20,justify:"space-between",children:[e(o.Meta,{description:s("Post styling and type setup."),title:s("Posting type")}),e("div",{children:e(D,{onChange:t=>n("postingType",t),options:T,style:{minWidth:200},value:a.instagram.postingType})})]}),e("div",{className:"pt-2",children:e(g.Text,{type:"secondary",children:s("Instagram media images must be 1.91:1 to 4:5 aspect ratio, 320-1440px resolution (recommended 1080px), and under 8MB.")})})]}),i(o,{style:{marginTop:10},children:[e(o.Meta,{description:s("Your comment"),title:s("First comment")}),e("div",{children:e(l,{onChange:t=>n("comment",t),rows:1,style:{minWidth:200},value:a.instagram.comment,wordCount:m.instagram.comment.length})})]}),e(o,{style:{marginTop:10},children:i(p,{gap:20,justify:"space-between",children:[e(o.Meta,{description:`Instagram restricts the length of a post to ${m.instagram.description.length} characters. If you enable this option, the first ${m.instagram.description.length} characters of your personalized message will be shared; if not, the limit prevents the post from being shared.`,title:s("Trim Message")}),e("div",{children:e(L,{checked:a.instagram.trimMessage,onChange:t=>n("trimMessage",t)})})]})})]}),e(c,{span:10,children:e(P,{})})]})]})}export{se as default};
