@emailmaker/emailmaker 1.0.52 → 1.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[8458],{90219:(e,t,a)=>{a.d(t,{A:()=>B});var s=a(92810),l=a(95838),i=a(12280),n=a(55039),r=a(81662),o=a(66522),c=a(71086),m=a(66726),d=a(81e3),u=a(8701),p=a(28372),h=a(45934),_=a(64617),g=a(23287),A=a(38883),x=a.n(A),j=a(69292),v=a(55701),y=a(86739),b=a(84568),f=a(93563),k=a(8493),w=a(87790),O=a(65983),N=a(56991),D=a(32269),C=a(85163),I=a(70082);const{useToken:P}=l.A,{title:E,description:L,tags:S,type:U,is_template:z,group:T}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template",group:"group"},M={[E]:"",[L]:"",[S]:[],[z]:!1},G={[L]:"",[S]:[],[U]:""};const F=({className:e,element:t})=>{var a,l;const{__:A}=(0,g.s9)(),{projectId:z}=(0,_.g)(),F=(0,h.wA)(),[B]=i.A.useForm(),{token:V}=P(),R=(0,N.rD)(),q=(0,h.Pj)(),K=(0,h.d4)(O.UI),{data:W}=(0,v.h1)(),{data:Y}=(0,_.KC)(),Q=t.hasOwnProperty("type")?C.IE:C.Tm,H=t.hasOwnProperty("type")?C.YY:C.zh,{refetch:$,isLoading:Z,isFetching:X,isUninitialized:J,isSuccess:ee}=(0,f.Oo)({parent:null===(a=Y.group)||void 0===a?void 0:a[0]},{skip:!(null!==(l=Y.group)&&void 0!==l&&l[0])});(0,s.useEffect)((()=>{!J&&$()}),[J,$]);const[te,ae]=(0,s.useState)([]),[se,le]=(0,s.useState)([]),[ie,ne]=(0,s.useState)(t.is_template||!1),{data:re}=b.Nq.endpoints.getProject.select(+z)(q.getState());(0,s.useEffect)((()=>{!J&&$()}),[t.group,$,J]),(0,s.useEffect)((()=>{if(ee&&t.is_template&&t.group.length){const e=t.group;let a={};e.length&&K.length&&(null===e||void 0===e||e.forEach((e=>{null===K||void 0===K||K.forEach((t=>{let s=t.children.find((t=>t.id===e));s&&(a.hasOwnProperty(t.id)||(a[t.id]=[]),a[t.id].push({label:s.name,value:s.id}))}))})));let s={};for(let t in a)a.hasOwnProperty(+t)&&(s[`group_${t}`]=a[t].map((e=>({...e,value:String(e.value)}))));B.setFieldsValue(s)}}),[B,K,t.is_template,t.group,ee]),(0,s.useEffect)((()=>{var e;le(null===(e=function(e){const t=new Set;return null===e||void 0===e?void 0:e.filter((e=>!t.has(e.name)&&(t.add(e.name),!0)))}((0,D.HT)(re,H)))||void 0===e?void 0:e.map((e=>({value:e.name,key:e.id}))))}),[re,H]),(0,s.useEffect)((()=>{if(t){var e,a;const s=null===(e=(0,D._q)(t,H))||void 0===e?void 0:e.map((e=>e.name)),l=t.emailtags||t.blocktags,i=null===(a=(0,D._q)(t,H))||void 0===a?void 0:a.filter((e=>l.includes(e.id))).map((e=>e.name));B.setFieldsValue({title:t.title,description:t.description,tags:t.tags||i||s,type:t.type})}}),[B,t,H]);(0,s.useEffect)((()=>{if(W){const e=W.schema.properties.acf.properties.type.items.enum;let t=[];const a={Applications:A("Apps"),Articles:A("Article"),Banners:A("Banners"),Buttons:A("Buttons"),"Call to Action":A("Call to Action"),Contacts:A("Contacts"),Content:A("Content"),"E-Commerce":A("E-Commerce"),Feature:A("Features"),Footer:A("Footers"),Header:A("Headers"),Lists:A("Lists"),Menu:A("Menus"),Other:A("Others"),Polls:A("Polls"),Promocodes:A("Promocodes"),Separators:A("Separators")};for(let s in e)t.push({label:a[e[s]],value:e[s]});ae(t)}}),[W,A]);return(0,I.jsx)("div",{className:x()("settings-panel",{[e]:e}),children:(0,I.jsxs)(i.A,{form:B,layout:"vertical",name:"settings_panel_form",initialValues:Q===C.Tm?{EmailInitialValues:M}:G,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a.split("_")[0]){case E:t.isNew?F((0,k.BQ)(e[a])):F((0,O.VK)(e[a]));break;case T:F((0,O.Bu)({[a.split("_")[1]]:e[a]}));break;case L:Q===C.Tm?t.isNew?F((0,k.Zs)(e[a])):F(y.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{description:e[a]})}))):t.isNew?F((0,w.AS)(e[a])):F(v.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{description:e[a]})})));break;case"is":t.isNew?F((0,k.TC)(e[a])):F(y.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{is_template:e[a]})})));break;case S:{const s=e[a].map((e=>e.trim()));Q===C.Tm?t.isNew?F((0,k.yY)(s)):F(y.GY.util.updateQueryData("getEmail",t.id,(e=>{Object.assign(e,{tags:s})}))):t.isNew?F((0,w.TB)(s)):F(v.VM.util.updateQueryData("getBlock",t.id,(e=>{Object.assign(e,{tags:s})})));break}case U:F(v.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{type:e[a]})})));break;default:return}},autoComplete:"off",children:[R.subjectEnabled&&Q===C.Tm&&(0,I.jsx)(i.A.Item,{label:A("Title"),name:E,tooltip:{title:A("The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it."),icon:(0,I.jsx)(p.A,{})},children:(0,I.jsx)(n.A.TextArea,{placeholder:A("Type title here"),autoSize:{minRows:1}})}),R.descriptionEnabled&&(0,I.jsx)(i.A.Item,{label:A("Description"),name:L,tooltip:{title:A("Description is used in other sections of the service."),icon:(0,I.jsx)(p.A,{})},children:(0,I.jsx)(n.A.TextArea,{placeholder:A("Type your description here"),autoSize:{minRows:2}})}),R.tagsEnabled&&(0,I.jsx)(i.A.Item,{label:A("Tags"),name:S,tooltip:{title:A("Tags help you find the block in the list."),icon:(0,I.jsx)(p.A,{})},rules:[{message:"Please input your username!",type:"array"}],children:(0,I.jsx)(r.A,{mode:"tags",style:{width:"100%"},placeholder:A("Type your tags here"),options:se,tagRender:e=>{const{label:t,closable:a,onClose:s}=e;return(0,I.jsx)(o.A,{color:V.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:a,onClose:s,style:{borderRadius:6},children:t})},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})}),(0,I.jsx)(c.A,{className:"selected-td-form__divider",style:{marginBottom:16}}),Q===C.Tm&&R.isTemplateEnabled&&(0,I.jsx)(m.A,{title:t.isNew?A("Save email first."):A("Use this email as a template for creating future emails."),children:(0,I.jsxs)(d.A,{size:10,align:"baseline",children:[(0,I.jsx)(i.A.Item,{name:"is_template",valuePropName:"checked",initialValue:ie,children:(0,I.jsx)(u.A,{size:"small",id:"setIsTemplate",onChange:e=>{ne(e)},disabled:t.isNew})}),(0,I.jsx)("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2,fontSize:14,color:V.colorText},children:(0,I.jsx)("label",{htmlFor:"setIsTemplate",children:A("Is a template")})})]})},"isTemplate"),ie&&(0,I.jsx)(j.A,{element:t,refetchProjectGroups:$,isLoading:Z||X}),Q===C.IE&&(0,I.jsx)(i.A.Item,{name:U,label:A("Type"),tooltip:{title:A("Select the block type to find any block on the list faster."),icon:(0,I.jsx)(p.A,{})},rules:[{message:"Please input type!"}],children:(0,I.jsx)(r.A,{placeholder:A("Choose block type"),options:te,getPopupContainer:()=>document.querySelector(".email-settings__collapse")})})]})})};F.defaultProps={className:"",email:void 0};const B=F},13465:(e,t,a)=>{a.d(t,{A:()=>v});a(92810);var s=a(2018),l=a(7744),i=a(68694),n=a.n(i),r=a(38610),o=a.n(r),c=a(73248),m=a.n(c),d=a(41705),u=a.n(d),p=a(96588),h=a.n(p),_=a(97433),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],v=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},85291:(e,t,a)=>{a.d(t,{A:()=>v});a(92810);var s=a(2018),l=a(7744),i=a(69029),n=a.n(i),r=a(41579),o=a.n(r),c=a(70869),m=a.n(c),d=a(8456),u=a.n(d),p=a(20931),h=a.n(p),_=a(24186),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],v=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},57903:(e,t,a)=>{a.d(t,{A:()=>u});a(92810);var s=a(59018),l=a.n(s),i=a(23287),n=a(71157),r=a(86739),o=a(55701),c=a(32269),m=a(70082);const d=({element:e})=>{const{__:t,_x:a}=(0,i.s9)(),[s]=(0,r.dN)(),[l]=(0,o.OZ)(),d=(0,n.hN)(),u=(e,s)=>{if(e.error)return(0,c.p6)(e,d),!1;(0,c.wB)(t("The ")+(s.hasOwnProperty("type")?t("block"):a("email","letter"))+" "+t("\u201c")+e.data.title+t("\u201d")+t("was successfully")+" "+(s.lock?s.hasOwnProperty("type")?a("unlocked.","block"):a("unlocked.","email"):s.hasOwnProperty("type")?a("locked.","block"):a("locked.","email")),d)};return(0,m.jsx)("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:()=>{e.hasOwnProperty("type")?l({blockId:e.id,lock:!e.lock}).then((t=>{u(t,e)})):s({emailId:e.id,lock:!e.lock}).then((t=>{u(t,e)}))},children:e.lock?t("Unlock"):t("Lock")})};d.defaultProps={element:l().shape({lock:null,id:null})};const u=d},90775:(e,t,a)=>{a.d(t,{A:()=>A});var s=a(92810),l=a(12280),i=a(14852),n=a(43005),r=a(2018),o=a(7744),c=a(55039),m=a(71157),d=a(45934),u=a(23287),p=a(64936),h=a(32269),_=a(40869),g=a(70082);const A=({isModalVisible:e,userEmail:t,subscriptionRequest:a,userName:A,currentPlane:x})=>{const{__:j}=(0,u.s9)(),v=(0,d.wA)(),[y]=l.A.useForm(),[b,f]=(0,_.E)(),k=(0,m.hN)(),w=()=>{v((0,p.Oo)())},O=()=>{y.validateFields().then((()=>{const e=y.getFieldsValue(!0);b(JSON.stringify(e)).then((e=>{var t,a,s;200===(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.status)?((0,h.wB)(null===e||void 0===e||null===(s=e.data)||void 0===s?void 0:s.message,k),w()):e.error&&(0,h.p6)(e,k)}))})).catch((e=>{console.warn(e)}))};return(0,s.useEffect)((()=>{a&&(null===y||void 0===y||y.setFieldsValue({request_tariff:a,user_name:A,user_email:t,user_tariff:x}))}),[y,a,x,A,t]),(0,g.jsx)(i.A,{title:j("Request for changing the pricing plan"),className:"blocks-modal",open:e,onOk:O,onCancel:w,centered:!0,width:572,footer:[(0,g.jsx)(n.Ay,{type:"primary",size:"large",onClick:O,disabled:f.isLoading,children:j("Send")},"submit")],forceRender:!0,children:(0,g.jsxs)(l.A,{form:y,layout:"vertical",name:"switch_to_plan_form",onFinish:O,initialValues:{request_email:t,request_phone:"",comment:"",request_tariff:a},autoComplete:"off",style:{padding:"10px 24px 0"},children:[(0,g.jsxs)(r.A,{gutter:16,children:[(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Email"),name:"request_email",rules:[{required:!0,message:j("Please enter your email address"),validator:(e,t)=>h.au.test(t)?Promise.resolve():Promise.reject(new Error(j("Please enter the correct email.")))}],children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Email"),type:"email"})})]}),(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Phone number"),name:"request_phone",children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Phone number")})})]})]}),(0,g.jsx)(l.A.Item,{label:j("Comment"),name:"comment",children:(0,g.jsx)(c.A.TextArea,{placeholder:j("Please add a comment to your request"),autoSize:{minRows:2}})})]})})}},4519:(e,t,a)=>{a.d(t,{A:()=>y});var s=a(92810),l=a(41919),i=a(76662),n=a(81e3),r=a(66726),o=a(43005),c=a(64617),m=a(58013),d=a(23287),u=a(29718),p=a(30961),h=a(20757),_=a(32269),g=a(85163),A=a(90070),x=a(70082);const{Content:j}=l.A,{Paragraph:v}=i.A,y=()=>{const{__:e}=(0,d.s9)(),{projectId:t,emailId:a}=(0,c.g)(),i=(0,A.p6)();let y=(0,c.Zp)();const b=i.get(g.A9.em_template_email)||a;(0,s.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const f=(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)(n.A,{size:10,children:[(0,x.jsx)(r.A,{title:e("To emails"),placement:"left",children:(0,x.jsx)(o.Ay,{type:"text",icon:(0,x.jsx)(m.A,{}),onClick:()=>(0,_.XZ)(y,`/projects/${t}`),shape:"circle"})}),(0,x.jsx)(v,{className:"ant-page-header-heading-title",children:e("Select email template")}),(0,x.jsx)(p.A,{isBlocks:!1,templateEmailId:b})]})}),k=(0,x.jsx)(x.Fragment,{});return(0,x.jsxs)(l.A,{className:"template-page",children:[(0,x.jsx)(h.A,{leftBlock:f,rightBlock:k}),(0,x.jsx)(j,{className:"template-page__container",children:(0,x.jsx)("div",{className:"template-page__content container",children:(0,x.jsx)(u.A,{projectId:g.p5,emailsView:g.Y$,templateEmailId:b})})})]})}},70656:(e,t,a)=>{a.d(t,{A:()=>_});var s=a(92810),l=a(37005),i=a(66726),n=a(45934),r=a(39990),o=a(62303),c=a(65983),m=a(69156),d=a(23287),u=a(45695),p=a(85163),h=a(70082);const _=()=>{var e;const{__:t}=(0,d.s9)(),a=(0,n.wA)(),[_]=(0,r.b9)(),[g,A]=(0,s.useState)(null===(e=window)||void 0===e?void 0:e.localStorage.getItem(p.V0.em_color_scheme)),x=(0,u.XW)(),j=(0,s.useCallback)(((e=null)=>{const t=e;(e=>{let t;if((0,m.Hk)(e),null===e){const e=matchMedia(p.F3).matches?p.nd:p.T;localStorage.removeItem(p.V0.em_color_scheme),t=e}else localStorage.setItem(p.V0.em_color_scheme,e),t=e;a((0,c.eX)(t===p.nd?`vs-${t}`:p.T)),(0,m.A5)(t),x({operation:p.Ru.UPDATE_PREVIEW,theme:t}),_({theme:e})})(t),A(t)}),[a,_,x]);return(0,s.useEffect)((()=>{matchMedia(p.F3).onchange=()=>j()}),[j]),(0,h.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,h.jsx)(l.A,{className:"theme-switcher",style:{cursor:"pointer",color:"var(--colorText)"},value:g,options:[{label:(0,h.jsx)(i.A,{title:t("Light theme"),children:(0,h.jsx)(o.A,{icon:"LightMode",style:{fontSize:18}})}),value:p.T},{label:(0,h.jsx)(i.A,{title:t("System theme"),children:(0,h.jsx)(o.A,{icon:"AutoMode",style:{fontSize:18}})}),value:null},{label:(0,h.jsx)(i.A,{title:t("Dark theme"),children:(0,h.jsx)(o.A,{icon:"DarkMode",style:{fontSize:18}})}),value:p.nd}],onChange:e=>j(e)})})}},54565:(e,t,a)=>{a.d(t,{A:()=>b});var s=a(92810),l=a(12280),i=a(29234),n=a(55039),r=a(28372),o=a(45934),c=a(38883),m=a.n(c),d=a(23287),u=a(86739),p=a(8493),h=a(70082);const{utm_source:_,utm_medium:g,utm_campaign:A,utm_term:x,utm_content:j}={utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content"},v={[_]:"",[g]:"",[A]:"",[x]:"",[j]:""},y=({className:e,email:t})=>{const{__:a}=(0,d.s9)(),c=(0,o.wA)(),[y]=l.A.useForm();(0,s.useEffect)((()=>{var e,a,s,l,i;t&&y.setFieldsValue({utm_source:(null===(e=t.utm_parameters)||void 0===e?void 0:e.utm_source)||"",utm_medium:(null===(a=t.utm_parameters)||void 0===a?void 0:a.utm_medium)||"",utm_campaign:(null===(s=t.utm_parameters)||void 0===s?void 0:s.utm_campaign)||"",utm_term:(null===(l=t.utm_parameters)||void 0===l?void 0:l.utm_term)||"",utm_content:(null===(i=t.utm_parameters)||void 0===i?void 0:i.utm_content)||""})}),[y,t]);return(0,h.jsx)("div",{className:m()("settings-panel",{[e]:e}),children:(0,h.jsxs)(l.A,{form:y,layout:"vertical",name:"settings_panel_form_utm",initialValues:v,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a){case _:t.isNew?c((0,p.K3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_source:e[a]}})})));break;case g:t.isNew?c((0,p.ol)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_medium:e[a]}})})));break;case A:t.isNew?c((0,p.P3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_campaign:e[a]}})})));break;case x:t.isNew?c((0,p.zH)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_term:e[a]}})})));break;case j:t.isNew?c((0,p.mk)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_content:e[a]}})})));break;default:return}},autoComplete:"off",children:[(0,h.jsx)(i.A,{message:a("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),(0,h.jsx)(l.A.Item,{label:a("utm_source"),name:_,tooltip:{title:a("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("google")})}),(0,h.jsx)(l.A.Item,{label:a("utm_medium"),name:g,tooltip:{title:a("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("cpc")})}),(0,h.jsx)(l.A.Item,{label:a("utm_campaign"),name:A,tooltip:{title:a("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("spring_sale")})}),(0,h.jsx)(l.A.Item,{label:a("utm_term"),name:x,tooltip:{title:a("Identifies search terms. For example: utm_term=running+shoes"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("running+shoes")})}),(0,h.jsx)(l.A.Item,{label:a("utm_content"),name:j,tooltip:{title:a("Indicates what user clicked to get to the site: a banner or a text link. It is often used for A/B testing and ad campaigns. Example: utm_content=logolink or utm_content=textlink"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("textlink")})})]})})};y.defaultProps={className:"",email:void 0};const b=y},5559:(e,t,a)=>{a.d(t,{A:()=>w});var s=a(92810),l=a(76662),i=a(43005),n=a(4800),r=a(55039),o=a(66726),c=a(45934),m=a(38883),d=a.n(m),u=a(23287),p=a(77532),h=a(62303),_=a(92779),g=a(64936),A=a(95679),x=a(86286),j=a(36404),v=a(56991),y=a(85163),b=a(85677),f=a(70082);const{Text:k}=l.A,w=({onChange:e,value:t,validateStatus:a,placeholder:l,disabled:m,name:w,elementSettings:O,imageInfo:N})=>{var D,C;const I=(0,c.d4)(x.C1),P=(0,c.d4)(x.B$),E=(0,c.d4)(j.yN),L=(0,v.rD)(),{__:S}=(0,u.s9)(),[U,z]=(0,s.useState)({width:"",height:"",size:""}),[T,M]=(0,s.useState)(!1),[G,F]=(0,s.useState)(0);let B=(0,c.wA)();const V=(0,c.d4)(p.js),R=(0,c.d4)(p.Uf),q=(0,c.d4)(p.Ac),[K]=(0,A.FQ)();let W=!P&&(null===(D=I.id)||void 0===D?void 0:D.toString())===(null===E||void 0===E||null===(C=E.members)||void 0===C?void 0:C.owner.ID);(0,s.useEffect)((()=>{t&&K(t).then((({data:e})=>{e&&z({width:null===e||void 0===e?void 0:e.width,height:null===e||void 0===e?void 0:e.height,size:((null===e||void 0===e?void 0:e.fileSize)/1024).toFixed(0),format:null===e||void 0===e?void 0:e.format})}))}),[t,K]),(0,s.useEffect)((()=>{m||(w.startsWith("src")&&V&&((null===O||void 0===O?void 0:O.type)!==y.bV.CAROUSEL||R===w)?e(V):"backgroundImage"!==w||!q||(null===O||void 0===O?void 0:O.type)===y.bV.CAROUSEL&&R!==w||e(q),B((0,p.BK)()))}),[V,R,q,e,w,m,null===O||void 0===O?void 0:O.type,B]);const Y=(e=null)=>{w.startsWith("src")?(B((0,p.Yw)(w)),B((0,p.tm)(t)),B((0,g.qf)(e||y.lx.UPLOAD_IMAGE_MODAL))):w.startsWith("backgroundImage")&&(B((0,p.Yw)(w)),B((0,p.e_)(t)),B((0,g.qf)(e||y.lx.UPLOAD_BACKGROUND_MODAL)))},Q=[{label:S("Upload"),key:"Upload",onClick:()=>Y(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}];L.imageCenterStockEnabled&&Q.push({label:S("Stock"),key:"Stock",onClick:()=>Y(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_STOCK:y.lx.UPLOAD_BACKGROUND_MODAL_STOCK)}),L.imageCenterGifEnabled&&Q.push({label:S("GIF"),key:"GIF",onClick:()=>Y(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_GIF:y.lx.UPLOAD_BACKGROUND_MODAL_GIF)}),L.elementAIimageEnabled&&Q.push({label:S("AI"),key:"AI",onClick:()=>Y(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_AI:y.lx.UPLOAD_BACKGROUND_MODAL_AI)});return(0,f.jsxs)("div",{className:d()("upload-bg-image",{"upload-bg-image_disabled":m}),children:[!t||t&&"error"===a?(0,f.jsxs)(i.Ay,{type:"default",block:!0,onClick:()=>Y(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD),children:[(0,f.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),S("Add image")]}):(0,f.jsxs)("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:e=>{var t,a,s,l;null!==(t=e.target)&&void 0!==t&&t.closest(".upload-bg-image__edit")||null!==(a=e.target)&&void 0!==a&&a.closest(".upload-bg-image__edit-menu")||null!==(s=e.target)&&void 0!==s&&s.closest(".upload-bg-image__menu")||null!==(l=e.target)&&void 0!==l&&l.closest(".inputGroup")||Y(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)},children:[(0,f.jsx)(n.A,{arrow:!0,dropdownRender:()=>L.imagePathDropdownEnabled?(0,f.jsx)("div",{className:"inputGroup",children:(0,f.jsx)(r.A,{prefix:(0,f.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:t,placeholder:l,name:w,disabled:m,className:"upload-bg-image__input"})}):(0,f.jsx)(f.Fragment,{}),overlayClassName:"upload-bg-image__dropdown-overlay",overlayStyle:{top:32,marginTop:"8px",width:347,left:0},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".upload-bg-image__inner-wrap"),children:(0,f.jsxs)("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"},children:[(0,f.jsx)("div",{className:"upload-bg-image__uploader",children:(0,f.jsx)("div",{className:"upload-bg-image__uploader-content",children:(0,f.jsxs)("div",{className:"upload-bg-image__uploader-content-inner",children:[(0,f.jsx)("div",{className:"upload-bg-image__uploader-img-wrap",children:(0,f.jsx)("img",{className:"upload-bg-image__uploader-img",src:t,alt:""})}),(0,f.jsx)("div",{className:"upload-bg-image__uploader-icons-wrap",children:(0,f.jsx)("div",{className:"upload-bg-image__uploader-content"})})]})})}),U.width&&U.height?(0,f.jsxs)("div",{className:"image-size",children:[U.width," \xd7 ",U.height,!!O&&(O.type===y.bV.IMG||O.type===y.bV.CAROUSEL)&&" \u2192 "+N.renderedWidth+" \xd7 "+N.renderedHeight,(0,f.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,f.jsxs)("span",{children:[U.size," ",S("kB")]}),U.format&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,f.jsx)("span",{className:"image-size-format",children:U.format})]})]}):(0,f.jsx)(k,{type:"secondary",className:"image-empty-text",children:l})]})}),(0,f.jsx)("div",{style:{flexGrow:1}}),"gif"!==U.format&&L.imageCenterEditorEnabled&&(0,f.jsx)(o.A,{title:S("Edit"),children:(0,f.jsx)(k,{type:"link",className:"upload-bg-image__edit",children:(0,f.jsx)(b.A,{style:{fontSize:16},onClick:e=>{W?(M(!0),F(5)):(Y(),B((0,g.Wz)(y.lx.IMAGE_EDITOR_MODAL)))}})})}),(0,f.jsx)(n.A,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:Q},overlayClassName:"upload-bg-image__menu",children:(0,f.jsx)(k,{type:"link",className:"upload-bg-image__edit-menu image-change",children:!t||t&&"error"===a?S("Upload"):(0,f.jsx)(h.A,{style:{fontSize:20},icon:"Reload",onClick:()=>Y(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)})})},"Actions")]}),(0,f.jsx)(_.A,{open:T,onCancel:()=>{M(!1)},initialSlide:G})]})}},13591:()=>{}}]);
1
+ "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[8458],{90219:(e,t,a)=>{a.d(t,{A:()=>F});var s=a(92810),l=a(95838),i=a(12280),n=a(55039),r=a(81662),o=a(66522),c=a(71086),m=a(66726),d=a(81e3),u=a(8701),p=a(28372),h=a(45934),_=a(64617),g=a(23287),A=a(38883),x=a.n(A),j=a(69292),v=a(55701),y=a(86739),b=a(84568),f=a(93563),k=a(8493),w=a(87790),O=a(65983),N=a(56991),D=a(32269),C=a(85163),I=a(70082);const{useToken:E}=l.A,{title:P,description:L,tags:S,type:U,is_template:z,group:T}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template",group:"group"},M={[P]:"",[L]:"",[S]:[],[z]:!1},G={[L]:"",[S]:[],[U]:""};const B=({className:e,element:t})=>{var a,l;const{__:A}=(0,g.s9)(),{projectId:z}=(0,_.g)(),B=(0,h.wA)(),[F]=i.A.useForm(),{token:V}=E(),R=(0,N.rD)(),q=(0,h.Pj)(),K=(0,h.d4)(O.UI),{data:W}=(0,v.h1)(),{data:Y}=(0,_.KC)(),Q=t.hasOwnProperty("type")?C.IE:C.Tm,H=t.hasOwnProperty("type")?C.YY:C.zh,{refetch:$,isLoading:Z,isFetching:X,isUninitialized:J,isSuccess:ee}=(0,f.Oo)({parent:null===(a=Y.group)||void 0===a?void 0:a[0]},{skip:!(null!==(l=Y.group)&&void 0!==l&&l[0])});(0,s.useEffect)((()=>{!J&&$()}),[J,$]);const[te,ae]=(0,s.useState)([]),[se,le]=(0,s.useState)([]),[ie,ne]=(0,s.useState)(t.is_template||!1),{data:re}=b.Nq.endpoints.getProject.select(+z)(q.getState());(0,s.useEffect)((()=>{!J&&$()}),[t.group,$,J]),(0,s.useEffect)((()=>{if(ee&&t.is_template&&t.group.length){const e=t.group;let a={};e.length&&K.length&&(null===e||void 0===e||e.forEach((e=>{null===K||void 0===K||K.forEach((t=>{let s=t.children.find((t=>t.id===e));s&&(a.hasOwnProperty(t.id)||(a[t.id]=[]),a[t.id].push({label:s.name,value:s.id}))}))})));let s={};for(let t in a)a.hasOwnProperty(+t)&&(s[`group_${t}`]=a[t].map((e=>({...e,value:String(e.value)}))));F.setFieldsValue(s)}}),[F,K,t.is_template,t.group,ee]),(0,s.useEffect)((()=>{var e;le(null===(e=function(e){const t=new Set;return null===e||void 0===e?void 0:e.filter((e=>!t.has(e.name)&&(t.add(e.name),!0)))}((0,D.HT)(re,H)))||void 0===e?void 0:e.map((e=>({value:e.name,key:e.id}))))}),[re,H]),(0,s.useEffect)((()=>{if(t){var e,a;const s=null===(e=(0,D._q)(t,H))||void 0===e?void 0:e.map((e=>e.name)),l=t.emailtags||t.blocktags,i=null===(a=(0,D._q)(t,H))||void 0===a?void 0:a.filter((e=>l.includes(e.id))).map((e=>e.name));F.setFieldsValue({title:t.title,description:t.description,tags:t.tags||i||s,type:t.type})}}),[F,t,H]);(0,s.useEffect)((()=>{if(W){const e=W.schema.properties.acf.properties.type.items.enum;let t=[];const a={Applications:A("Apps"),Articles:A("Article"),Banners:A("Banners"),Buttons:A("Buttons"),"Call to Action":A("Call to Action"),Contacts:A("Contacts"),Content:A("Content"),"E-Commerce":A("E-Commerce"),Feature:A("Features"),Footer:A("Footers"),Header:A("Headers"),Lists:A("Lists"),Menu:A("Menus"),Other:A("Others"),Polls:A("Polls"),Promocodes:A("Promocodes"),Separators:A("Separators")};for(let s in e)t.push({label:a[e[s]],value:e[s]});ae(t)}}),[W,A]);return(0,I.jsx)("div",{className:x()("settings-panel",{[e]:e}),children:(0,I.jsxs)(i.A,{form:F,layout:"vertical",name:"settings_panel_form",initialValues:Q===C.Tm?{EmailInitialValues:M}:G,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a.split("_")[0]){case P:t.isNew?B((0,k.BQ)(e[a])):B((0,O.VK)(e[a]));break;case T:B((0,O.Bu)({[a.split("_")[1]]:e[a]}));break;case L:Q===C.Tm?t.isNew?B((0,k.Zs)(e[a])):B(y.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{description:e[a]})}))):t.isNew?B((0,w.AS)(e[a])):B(v.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{description:e[a]})})));break;case"is":t.isNew?B((0,k.TC)(e[a])):B(y.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{is_template:e[a]})})));break;case S:{const s=e[a].map((e=>e.trim()));Q===C.Tm?t.isNew?B((0,k.yY)(s)):B(y.GY.util.updateQueryData("getEmail",t.id,(e=>{Object.assign(e,{tags:s})}))):t.isNew?B((0,w.TB)(s)):B(v.VM.util.updateQueryData("getBlock",t.id,(e=>{Object.assign(e,{tags:s})})));break}case U:B(v.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{type:e[a]})})));break;default:return}},autoComplete:"off",children:[R.subjectEnabled&&Q===C.Tm&&(0,I.jsx)(i.A.Item,{label:A("Title"),name:P,tooltip:{title:A("The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it."),icon:(0,I.jsx)(p.A,{})},children:(0,I.jsx)(n.A.TextArea,{placeholder:A("Type title here"),autoSize:{minRows:1}})}),R.descriptionEnabled&&(0,I.jsx)(i.A.Item,{label:A("Description"),name:L,tooltip:{title:A("Description is used in other sections of the service."),icon:(0,I.jsx)(p.A,{})},children:(0,I.jsx)(n.A.TextArea,{placeholder:A("Type your description here"),autoSize:{minRows:2}})}),R.tagsEnabled&&(0,I.jsx)(i.A.Item,{label:A("Tags"),name:S,tooltip:{title:A("Tags help you find the block in the list."),icon:(0,I.jsx)(p.A,{})},rules:[{message:"Please input your username!",type:"array"}],children:(0,I.jsx)(r.A,{mode:"tags",style:{width:"100%"},placeholder:A("Type your tags here"),options:se,tagRender:e=>{const{label:t,closable:a,onClose:s}=e;return(0,I.jsx)(o.A,{color:V.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:a,onClose:s,style:{borderRadius:6},children:t})},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})}),(0,I.jsx)(c.A,{className:"selected-td-form__divider",style:{marginBottom:16}}),Q===C.Tm&&R.isTemplateEnabled&&(0,I.jsx)(m.A,{title:t.isNew?A("Save email first."):A("Use this email as a template for creating future emails."),children:(0,I.jsxs)(d.A,{size:10,align:"baseline",children:[(0,I.jsx)(i.A.Item,{name:"is_template",valuePropName:"checked",initialValue:ie,children:(0,I.jsx)(u.A,{size:"small",id:"setIsTemplate",onChange:e=>{ne(e)},disabled:t.isNew})}),(0,I.jsx)("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2,fontSize:14,color:V.colorText},children:(0,I.jsx)("label",{htmlFor:"setIsTemplate",children:A("Is a template")})})]})},"isTemplate"),ie&&(0,I.jsx)(j.A,{element:t,refetchProjectGroups:$,isLoading:Z||X}),Q===C.IE&&(0,I.jsx)(i.A.Item,{name:U,label:A("Type"),tooltip:{title:A("Select the block type to find any block on the list faster."),icon:(0,I.jsx)(p.A,{})},rules:[{message:"Please input type!"}],children:(0,I.jsx)(r.A,{placeholder:A("Choose block type"),options:te,getPopupContainer:()=>document.querySelector(".email-settings__collapse")})})]})})};B.defaultProps={className:"",email:void 0};const F=B},13465:(e,t,a)=>{a.d(t,{A:()=>v});a(92810);var s=a(2018),l=a(7744),i=a(68694),n=a.n(i),r=a(38610),o=a.n(r),c=a(73248),m=a.n(c),d=a(41705),u=a.n(d),p=a(96588),h=a.n(p),_=a(97433),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],v=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},85291:(e,t,a)=>{a.d(t,{A:()=>v});a(92810);var s=a(2018),l=a(7744),i=a(69029),n=a.n(i),r=a(41579),o=a.n(r),c=a(70869),m=a.n(c),d=a(8456),u=a.n(d),p=a(20931),h=a.n(p),_=a(24186),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],v=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},57903:(e,t,a)=>{a.d(t,{A:()=>u});a(92810);var s=a(59018),l=a.n(s),i=a(23287),n=a(71157),r=a(86739),o=a(55701),c=a(32269),m=a(70082);const d=({element:e})=>{const{__:t,_x:a}=(0,i.s9)(),[s]=(0,r.dN)(),[l]=(0,o.OZ)(),d=(0,n.hN)(),u=(e,s)=>{if(e.error)return(0,c.p6)(e,d),!1;(0,c.wB)(t("The ")+(s.hasOwnProperty("type")?t("block"):a("email","letter"))+" "+t("\u201c")+e.data.title+t("\u201d")+t("was successfully")+" "+(s.lock?s.hasOwnProperty("type")?a("unlocked.","block"):a("unlocked.","email"):s.hasOwnProperty("type")?a("locked.","block"):a("locked.","email")),d)};return(0,m.jsx)("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:()=>{e.hasOwnProperty("type")?l({blockId:e.id,lock:!e.lock}).then((t=>{u(t,e)})):s({emailId:e.id,lock:!e.lock}).then((t=>{u(t,e)}))},children:e.lock?t("Unlock"):t("Lock")})};d.defaultProps={element:l().shape({lock:null,id:null})};const u=d},90775:(e,t,a)=>{a.d(t,{A:()=>A});var s=a(92810),l=a(12280),i=a(14852),n=a(43005),r=a(2018),o=a(7744),c=a(55039),m=a(71157),d=a(45934),u=a(23287),p=a(64936),h=a(32269),_=a(40869),g=a(70082);const A=({isModalVisible:e,userEmail:t,subscriptionRequest:a,userName:A,currentPlane:x})=>{const{__:j}=(0,u.s9)(),v=(0,d.wA)(),[y]=l.A.useForm(),[b,f]=(0,_.E)(),k=(0,m.hN)(),w=()=>{v((0,p.Oo)())},O=()=>{y.validateFields().then((()=>{const e=y.getFieldsValue(!0);b(JSON.stringify(e)).then((e=>{var t,a,s;200===(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.status)?((0,h.wB)(null===e||void 0===e||null===(s=e.data)||void 0===s?void 0:s.message,k),w()):e.error&&(0,h.p6)(e,k)}))})).catch((e=>{console.warn(e)}))};return(0,s.useEffect)((()=>{a&&(null===y||void 0===y||y.setFieldsValue({request_tariff:a,user_name:A,user_email:t,user_tariff:x}))}),[y,a,x,A,t]),(0,g.jsx)(i.A,{title:j("Request for changing the pricing plan"),className:"blocks-modal",open:e,onOk:O,onCancel:w,centered:!0,width:572,footer:[(0,g.jsx)(n.Ay,{type:"primary",size:"large",onClick:O,disabled:f.isLoading,children:j("Send")},"submit")],forceRender:!0,children:(0,g.jsxs)(l.A,{form:y,layout:"vertical",name:"switch_to_plan_form",onFinish:O,initialValues:{request_email:t,request_phone:"",comment:"",request_tariff:a},autoComplete:"off",style:{padding:"10px 24px 0"},children:[(0,g.jsxs)(r.A,{gutter:16,children:[(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Email"),name:"request_email",rules:[{required:!0,message:j("Please enter your email address"),validator:(e,t)=>h.au.test(t)?Promise.resolve():Promise.reject(new Error(j("Please enter the correct email.")))}],children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Email"),type:"email"})})]}),(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Phone number"),name:"request_phone",children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Phone number")})})]})]}),(0,g.jsx)(l.A.Item,{label:j("Comment"),name:"comment",children:(0,g.jsx)(c.A.TextArea,{placeholder:j("Please add a comment to your request"),autoSize:{minRows:2}})})]})})}},4519:(e,t,a)=>{a.d(t,{A:()=>y});var s=a(92810),l=a(41919),i=a(76662),n=a(81e3),r=a(66726),o=a(43005),c=a(64617),m=a(58013),d=a(23287),u=a(29718),p=a(30961),h=a(20757),_=a(32269),g=a(85163),A=a(90070),x=a(70082);const{Content:j}=l.A,{Paragraph:v}=i.A,y=()=>{const{__:e}=(0,d.s9)(),{projectId:t,emailId:a}=(0,c.g)(),i=(0,A.p6)();let y=(0,c.Zp)();const b=i.get(g.A9.em_template_email)||a;(0,s.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const f=(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)(n.A,{size:10,children:[(0,x.jsx)(r.A,{title:e("To emails"),placement:"left",children:(0,x.jsx)(o.Ay,{type:"text",icon:(0,x.jsx)(m.A,{}),onClick:()=>(0,_.XZ)(y,`/projects/${t}`),shape:"circle"})}),(0,x.jsx)(v,{className:"ant-page-header-heading-title",children:e("Select email template")}),(0,x.jsx)(p.A,{isBlocks:!1,templateEmailId:b})]})}),k=(0,x.jsx)(x.Fragment,{});return(0,x.jsxs)(l.A,{className:"template-page",children:[(0,x.jsx)(h.A,{leftBlock:f,rightBlock:k}),(0,x.jsx)(j,{className:"template-page__container",children:(0,x.jsx)("div",{className:"template-page__content container",children:(0,x.jsx)(u.A,{projectId:g.p5,emailsView:g.Y$,templateEmailId:b})})})]})}},70656:(e,t,a)=>{a.d(t,{A:()=>_});var s=a(92810),l=a(37005),i=a(66726),n=a(45934),r=a(39990),o=a(62303),c=a(65983),m=a(69156),d=a(23287),u=a(45695),p=a(85163),h=a(70082);const _=()=>{var e;const{__:t}=(0,d.s9)(),a=(0,n.wA)(),[_]=(0,r.b9)(),[g,A]=(0,s.useState)(null===(e=window)||void 0===e?void 0:e.localStorage.getItem(p.V0.em_color_scheme)),x=(0,u.XW)(),j=(0,s.useCallback)(((e=null)=>{const t=e;(e=>{let t;if((0,m.Hk)(e),null===e){const e=matchMedia(p.F3).matches?p.nd:p.T;localStorage.removeItem(p.V0.em_color_scheme),t=e}else localStorage.setItem(p.V0.em_color_scheme,e),t=e;a((0,c.eX)(t===p.nd?`vs-${t}`:p.T)),(0,m.A5)(t),x({operation:p.Ru.UPDATE_PREVIEW,theme:t}),_({theme:e})})(t),A(t)}),[a,_,x]);return(0,s.useEffect)((()=>{matchMedia(p.F3).onchange=()=>j()}),[j]),(0,h.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,h.jsx)(l.A,{className:"theme-switcher",style:{cursor:"pointer",color:"var(--colorText)"},value:g,options:[{label:(0,h.jsx)(i.A,{title:t("Light theme"),children:(0,h.jsx)(o.A,{icon:"LightMode",style:{fontSize:18}})}),value:p.T},{label:(0,h.jsx)(i.A,{title:t("System theme"),children:(0,h.jsx)(o.A,{icon:"AutoMode",style:{fontSize:18}})}),value:null},{label:(0,h.jsx)(i.A,{title:t("Dark theme"),children:(0,h.jsx)(o.A,{icon:"DarkMode",style:{fontSize:18}})}),value:p.nd}],onChange:e=>j(e)})})}},54565:(e,t,a)=>{a.d(t,{A:()=>b});var s=a(92810),l=a(12280),i=a(29234),n=a(55039),r=a(28372),o=a(45934),c=a(38883),m=a.n(c),d=a(23287),u=a(86739),p=a(8493),h=a(70082);const{utm_source:_,utm_medium:g,utm_campaign:A,utm_term:x,utm_content:j}={utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content"},v={[_]:"",[g]:"",[A]:"",[x]:"",[j]:""},y=({className:e,email:t})=>{const{__:a}=(0,d.s9)(),c=(0,o.wA)(),[y]=l.A.useForm();(0,s.useEffect)((()=>{var e,a,s,l,i;t&&y.setFieldsValue({utm_source:(null===(e=t.utm_parameters)||void 0===e?void 0:e.utm_source)||"",utm_medium:(null===(a=t.utm_parameters)||void 0===a?void 0:a.utm_medium)||"",utm_campaign:(null===(s=t.utm_parameters)||void 0===s?void 0:s.utm_campaign)||"",utm_term:(null===(l=t.utm_parameters)||void 0===l?void 0:l.utm_term)||"",utm_content:(null===(i=t.utm_parameters)||void 0===i?void 0:i.utm_content)||""})}),[y,t]);return(0,h.jsx)("div",{className:m()("settings-panel",{[e]:e}),children:(0,h.jsxs)(l.A,{form:y,layout:"vertical",name:"settings_panel_form_utm",initialValues:v,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a){case _:t.isNew?c((0,p.K3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_source:e[a]}})})));break;case g:t.isNew?c((0,p.ol)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_medium:e[a]}})})));break;case A:t.isNew?c((0,p.P3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_campaign:e[a]}})})));break;case x:t.isNew?c((0,p.zH)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_term:e[a]}})})));break;case j:t.isNew?c((0,p.mk)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_content:e[a]}})})));break;default:return}},autoComplete:"off",children:[(0,h.jsx)(i.A,{message:a("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),(0,h.jsx)(l.A.Item,{label:a("utm_source"),name:_,tooltip:{title:a("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("google")})}),(0,h.jsx)(l.A.Item,{label:a("utm_medium"),name:g,tooltip:{title:a("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("cpc")})}),(0,h.jsx)(l.A.Item,{label:a("utm_campaign"),name:A,tooltip:{title:a("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("spring_sale")})}),(0,h.jsx)(l.A.Item,{label:a("utm_term"),name:x,tooltip:{title:a("Identifies search terms. For example: utm_term=running+shoes"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("running+shoes")})}),(0,h.jsx)(l.A.Item,{label:a("utm_content"),name:j,tooltip:{title:a("Indicates what user clicked to get to the site: a banner or a text link. It is often used for A/B testing and ad campaigns. Example: utm_content=logolink or utm_content=textlink"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("textlink")})})]})})};y.defaultProps={className:"",email:void 0};const b=y},5559:(e,t,a)=>{a.d(t,{A:()=>w});var s=a(92810),l=a(76662),i=a(43005),n=a(4800),r=a(55039),o=a(66726),c=a(45934),m=a(38883),d=a.n(m),u=a(23287),p=a(77532),h=a(62303),_=a(92779),g=a(64936),A=a(95679),x=a(86286),j=a(36404),v=a(56991),y=a(85163),b=a(85677),f=a(70082);const{Text:k}=l.A,w=({onChange:e,value:t,validateStatus:a,placeholder:l,disabled:m,name:w,elementSettings:O,imageInfo:N})=>{var D,C;const I=(0,c.d4)(x.C1),E=(0,c.d4)(x.B$),P=(0,c.d4)(j.yN),L=(0,v.rD)(),{__:S}=(0,u.s9)(),[U,z]=(0,s.useState)({width:"",height:"",size:""}),[T,M]=(0,s.useState)(!1),[G,B]=(0,s.useState)(0);let F=(0,c.wA)();const V=(0,c.d4)(p.js),R=(0,c.d4)(p.Uf),q=(0,c.d4)(p.Ac),K=(0,c.d4)(g.cL),[W]=(0,A.FQ)();let Y=!E&&(null===(D=I.id)||void 0===D?void 0:D.toString())===(null===P||void 0===P||null===(C=P.members)||void 0===C?void 0:C.owner.ID);(0,s.useEffect)((()=>{t&&W(t).then((({data:e})=>{e&&z({width:null===e||void 0===e?void 0:e.width,height:null===e||void 0===e?void 0:e.height,size:((null===e||void 0===e?void 0:e.fileSize)/1024).toFixed(0),format:null===e||void 0===e?void 0:e.format})}))}),[t,W]),(0,s.useEffect)((()=>{m||(w.startsWith("src")&&V&&((null===O||void 0===O?void 0:O.type)!==y.bV.CAROUSEL||R===w&&!K)?(e(V),F((0,p.BK)())):"backgroundImage"===w&&q&&((null===O||void 0===O?void 0:O.type)!==y.bV.CAROUSEL||R===w&&!K)&&(e(q),F((0,p.BK)())),K&&(null===O||void 0===O?void 0:O.type)===y.bV.CAROUSEL||!R||F((0,p.BK)()))}),[V,R,q,e,w,m,null===O||void 0===O?void 0:O.type,F,K]);const Q=(e=null)=>{w.startsWith("src")?(F((0,p.Yw)(w)),F((0,p.tm)(t)),F((0,g.qf)(e||y.lx.UPLOAD_IMAGE_MODAL))):w.startsWith("backgroundImage")&&(F((0,p.Yw)(w)),F((0,p.e_)(t)),F((0,g.qf)(e||y.lx.UPLOAD_BACKGROUND_MODAL)))},H=[{label:S("Upload"),key:"Upload",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}];L.imageCenterStockEnabled&&H.push({label:S("Stock"),key:"Stock",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_STOCK:y.lx.UPLOAD_BACKGROUND_MODAL_STOCK)}),L.imageCenterGifEnabled&&H.push({label:S("GIF"),key:"GIF",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_GIF:y.lx.UPLOAD_BACKGROUND_MODAL_GIF)}),L.elementAIimageEnabled&&H.push({label:S("AI"),key:"AI",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_AI:y.lx.UPLOAD_BACKGROUND_MODAL_AI)});return(0,f.jsxs)("div",{className:d()("upload-bg-image",{"upload-bg-image_disabled":m}),children:[!t||t&&"error"===a?(0,f.jsxs)(i.Ay,{type:"default",block:!0,onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD),children:[(0,f.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),S("Add image")]}):(0,f.jsxs)("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:e=>{var t,a,s,l;null!==(t=e.target)&&void 0!==t&&t.closest(".upload-bg-image__edit")||null!==(a=e.target)&&void 0!==a&&a.closest(".upload-bg-image__edit-menu")||null!==(s=e.target)&&void 0!==s&&s.closest(".upload-bg-image__menu")||null!==(l=e.target)&&void 0!==l&&l.closest(".inputGroup")||Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)},children:[(0,f.jsx)(n.A,{arrow:!0,dropdownRender:()=>L.imagePathDropdownEnabled?(0,f.jsx)("div",{className:"inputGroup",children:(0,f.jsx)(r.A,{prefix:(0,f.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:t,placeholder:l,name:w,disabled:m,className:"upload-bg-image__input"})}):(0,f.jsx)(f.Fragment,{}),overlayClassName:"upload-bg-image__dropdown-overlay",overlayStyle:{top:32,marginTop:"8px",width:347,left:0},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".upload-bg-image__inner-wrap"),children:(0,f.jsxs)("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"},children:[(0,f.jsx)("div",{className:"upload-bg-image__uploader",children:(0,f.jsx)("div",{className:"upload-bg-image__uploader-content",children:(0,f.jsxs)("div",{className:"upload-bg-image__uploader-content-inner",children:[(0,f.jsx)("div",{className:"upload-bg-image__uploader-img-wrap",children:(0,f.jsx)("img",{className:"upload-bg-image__uploader-img",src:t,alt:""})}),(0,f.jsx)("div",{className:"upload-bg-image__uploader-icons-wrap",children:(0,f.jsx)("div",{className:"upload-bg-image__uploader-content"})})]})})}),U.width&&U.height?(0,f.jsxs)("div",{className:"image-size",children:[U.width," \xd7 ",U.height,!!O&&(O.type===y.bV.IMG||O.type===y.bV.CAROUSEL)&&" \u2192 "+N.renderedWidth+" \xd7 "+N.renderedHeight,(0,f.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,f.jsxs)("span",{children:[U.size," ",S("kB")]}),U.format&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,f.jsx)("span",{className:"image-size-format",children:U.format})]})]}):(0,f.jsx)(k,{type:"secondary",className:"image-empty-text",children:l})]})}),(0,f.jsx)("div",{style:{flexGrow:1}}),"gif"!==U.format&&L.imageCenterEditorEnabled&&(0,f.jsx)(o.A,{title:S("Edit"),children:(0,f.jsx)(k,{type:"link",className:"upload-bg-image__edit",children:(0,f.jsx)(b.A,{style:{fontSize:16},onClick:e=>{Y?(M(!0),B(5)):(Q(),F((0,g.Wz)(y.lx.IMAGE_EDITOR_MODAL)))}})})}),(0,f.jsx)(n.A,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:H},overlayClassName:"upload-bg-image__menu",children:(0,f.jsx)(k,{type:"link",className:"upload-bg-image__edit-menu image-change",children:!t||t&&"error"===a?S("Upload"):(0,f.jsx)(h.A,{style:{fontSize:20},icon:"Reload",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)})})},"Actions")]}),(0,f.jsx)(_.A,{open:T,onCancel:()=>{M(!1)},initialSlide:G})]})}},13591:()=>{}}]);