@emailmaker/emailmaker 1.0.67 → 1.0.68
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.
- package/README.md +1 -1
- package/asset-manifest.json +20 -20
- package/emailmaker-esm.js +1 -1
- package/emailmaker.js +1 -1
- package/iframe/429.js +1 -1
- package/iframe/766.js +1 -1
- package/iframe/iframe.7f4a25eb84aaea5b3817.html +1 -1
- package/iframe/js/882.d2dae328.js +1 -0
- package/iframe/js/97.690a8ad1.js +1 -0
- package/iframe/sandbox-eblock.js +1 -1
- package/package.json +1 -1
- package/plugin.html +1 -1
- package/plugin_blocks_test.html +1 -1
- package/plugin_default.html +1 -1
- package/plugin_idigital.html +1 -1
- package/plugin_s.html +1 -1
- package/static/css/6162.77c3ee71.chunk.css +1 -0
- package/static/js/1250.85fde73e.js +1 -0
- package/static/js/{3017.d2e3fc4c.chunk.js → 3017.4f68b70a.chunk.js} +1 -1
- package/static/js/3739.adfe38c2.js +1 -0
- package/static/js/4972.8646ad7f.js +1 -0
- package/static/js/6162.0d7e5643.chunk.js +2 -0
- package/static/js/{7003.53aad4ea.js → 6419.e52a6158.js} +2 -2
- package/static/js/{7298.310f64b1.js → 7298.dfb83b83.js} +2 -2
- package/static/js/7721.470251b4.js +1 -0
- package/static/js/9167.044611fd.js +2 -0
- package/static/js/{emailmaker_core.a2356afa.js → emailmaker_core.06effbe1.js} +2 -2
- package/iframe/js/882.c8374573.js +0 -1
- package/iframe/js/97.ac1d12e1.js +0 -1
- package/static/css/7352.6877a0bf.chunk.css +0 -1
- package/static/js/2327.83204f0b.js +0 -1
- package/static/js/3600.81d4c730.js +0 -1
- package/static/js/5341.6d541f66.js +0 -1
- package/static/js/7296.4b296f63.js +0 -1
- package/static/js/7352.6fc2d188.chunk.js +0 -2
- package/static/js/9395.22659bd6.js +0 -2
- /package/iframe/js/{882.c8374573.js.LICENSE.txt → 882.d2dae328.js.LICENSE.txt} +0 -0
- /package/static/js/{7352.6fc2d188.chunk.js.LICENSE.txt → 6162.0d7e5643.chunk.js.LICENSE.txt} +0 -0
- /package/static/js/{7003.53aad4ea.js.LICENSE.txt → 6419.e52a6158.js.LICENSE.txt} +0 -0
- /package/static/js/{7298.310f64b1.js.LICENSE.txt → 7298.dfb83b83.js.LICENSE.txt} +0 -0
- /package/static/js/{9395.22659bd6.js.LICENSE.txt → 9167.044611fd.js.LICENSE.txt} +0 -0
- /package/static/js/{emailmaker_core.a2356afa.js.LICENSE.txt → emailmaker_core.06effbe1.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[3600],{47827:()=>{},39941:()=>{},25911:(e,t,o)=>{o.d(t,{A:()=>ie});var a=o(98173),l=o(30150),i=o(47555),r=o(40120),n=o(64909),s=o(86406),m=o(77073),d=o(91321),c=o(2604),u=o(26298),p=o.n(u),g=o(37969),b=o(93771),E=o(79245),h=o(12543),f=o(16238),v=o(76428),_=o(58316),A=o(87690),y=o(62296),S=o(1549),k=o(95331),B=o(10267),w=o(6311),x=o(70178),P=o(51070),N=o(85758),T=o(27352),R=o(23424),I=o(84572),C=o(47014),L=o(13216),F=o(40277),O=o(96734),M=o(32947);const D=({isMenuCollapsed:e,setIsMenuCollapsed:t,isLocked:o})=>{var i;const{__:r}=(0,h.s9)();let n=(0,c.wA)(),s=(0,l.Zp)();const{projectId:m}=(0,l.g)(),{pathname:d}=(0,l.zy)(),[u,D]=(0,a.useState)(""),V=(0,c.d4)(I.yN),j=(0,c.d4)(C.C1),z=(0,O.p)(),W=(0,a.useCallback)((()=>{d.includes("blocks")?D("Blocks"):d.includes("emails")?D("Emails"):d.includes("members")&&D("Members"),!o&&t(!0)}),[d,t,o]);(0,a.useEffect)((()=>{W()}),[W]);let G=[],H=[];const U=(null===V||void 0===V?void 0:V.title)||"";let q=[{label:a.createElement("a",{href:"https://emailmaker.ru/help/",target:"_blank",rel:"noopener noreferrer"},r("Help")),key:"Help center",icon:a.createElement(f.A,{style:{fontSize:"16px"}}),className:"help-center"},{label:r("Chat support"),key:"Support chat",icon:a.createElement(v.A,{style:{fontSize:"16px"}}),className:"open-support-chat",onClick:()=>{try{window.carrotquest.open()}catch(e){}}}],X=[{label:r("Account settings"),key:"Account settings",icon:a.createElement(_.A,{style:{fontSize:"16px"}}),className:"em-analytics__account-settings",onClick:()=>{n((0,R.qf)(M.lx.EDIT_PROFILE_MODAL)),!o&&t(!0)}},{label:a.createElement(E.N_,{to:"/billing"},r("Billing")),key:"Billing",icon:a.createElement(A.A,{style:{fontSize:"16px"}}),className:"em-analytics__billing"},{label:r("Sign out"),icon:a.createElement(y.A,{style:{fontSize:"16px"}}),key:"Sign out",className:"em-analytics__sign-out",onClick:()=>{(0,F.Id)(z),n(L.Q2.util.resetApiState()),s("/auth",{replace:!0})}}];const $="/projects"+(m?"/"+m+"/emails?page=1":""),Q=[{label:a.createElement(E.N_,{style:{fontSize:16},to:$},U),key:"Project",popupOffset:[0,16],style:{fontWeight:500},icon:m?a.createElement(E.N_,{to:$,className:"project-menu__block",style:{fontSize:"18px",zIndex:99}},a.createElement(g.Ay,{type:"primary",className:"project-menu__block-button"},null===U||void 0===U?void 0:U.split(" ").slice(0,2).map((e=>Array.from(e)[0])))):a.createElement(E.N_,{to:$,rel:"noopener noreferrer",className:"project-menu__block",style:{fontSize:"28px"}},a.createElement("b",null,a.createElement("span",{className:"letters"},"E"),(!e||o)&&a.createElement("span",{className:"hidden-text"},"mail")),a.createElement("span",{className:"letters"},"M"),(!e||o)&&a.createElement("span",{className:"hidden-text"},"aker")),className:p()("project-menu__list-item project-menu__list-item_project project-menu__list-item_project",{"project-menu__list-item_logo":!m,"project-menu__list-item_project":m}),children:m&&[{label:r("Project settings"),key:"Project settings",className:"em-analytics__account-settings",icon:a.createElement(S.A,{style:{fontSize:"16px"}}),onClick:()=>{n((0,R.qf)(M.lx.EDIT_PROJECT_MODAL)),!o&&t(!0)}},{label:a.createElement(E.N_,{to:"/projects"},r("List of projects")),key:"List of projects",icon:a.createElement(k.A,{style:{fontSize:"16px"}}),className:"em-analytics__sign-out"}]},{type:"divider"}];return G.push({icon:a.createElement(B.A,{style:{fontSize:20}}),label:a.createElement(E.N_,{to:`/projects/${m}/emails`,rel:"noopener noreferrer"},r("Emails")),key:"Emails",className:"project-menu__list-item em-analytics__project-menu-emails"},{icon:a.createElement(w.A,{style:{fontSize:20}}),label:a.createElement(E.N_,{to:`/projects/${m}/blocks`,rel:"noopener noreferrer"},r("Blocks")),key:"Blocks",className:"project-menu__list-item em-analytics__project-menu-blocks"},{icon:a.createElement(x.A,{style:{fontSize:20}}),label:a.createElement(E.N_,{to:`/projects/${m}/members`,rel:"noopener noreferrer"},r("Members")),key:"Members",className:"project-menu__list-item em-analytics__project-menu-members"}),"community"===j.subscription.post_name&&m&&j.counters.emails_counter>2&&H.push({icon:a.createElement(P.A,{style:{fontSize:20,lineHeight:"44px"}}),label:a.createElement(E.N_,{to:"/billing",rel:"noopener noreferrer",style:{fontSize:16,color:"white"}},r("Upgrade")),key:"Emails",className:"project-menu__list-item"}),H.push({icon:a.createElement(N.A,{style:{fontSize:18}}),label:r("Help menu"),key:"Help menu",className:"project-menu__list-item support-center-menu",children:q},{icon:a.createElement(T.A,{style:{fontSize:18}}),label:r("What's new"),key:"What's new",className:"project-menu__list-item ducalis-changelog-widget em-analytics__project-menu-ducalis"},{icon:a.createElement("span",{style:{width:"20px",height:"20px",fontSize:"20px"},className:"user-profile__avatar anticon"},null!==j&&void 0!==j&&null!==(i=j.avatar_urls)&&void 0!==i&&i[24]?[a.createElement("img",{style:{width:"100%"},key:"img",src:null===j||void 0===j?void 0:j.avatar_urls[24],alt:null!==j&&void 0!==j&&j.name?`${null===j||void 0===j?void 0:j.name} avatar`:"User avatar",className:"user-profile__avatar-img"}),a.createElement(_.A,{key:"UserOutlined",style:{position:"absolute",fontSize:20,borderRadius:100,overflow:"hidden",height:20,width:20,lineHeight:0,zIndex:-1}})]:a.createElement(_.A,{style:{color:"white"}})),label:(null===j||void 0===j?void 0:j.name)||null,key:"User profile",className:"project-menu__list-item user-profile",children:X}),a.createElement(a.Fragment,null,a.createElement("div",{className:"project-menu"},a.createElement("div",null,a.createElement(b.A,{disabledOverflow:!0,className:"project-menu__list project-menu__list_top",style:{fontSize:16},items:Q,triggerSubMenuAction:"hover",subMenuOpenDelay:.3,subMenuCloseDelay:.6,selectable:!1}),m&&a.createElement(b.A,{disabledOverflow:!0,selectable:!0,selectedKeys:[u],className:"project-menu__list project-menu__list_second",style:{fontSize:16,marginTop:30},items:G,triggerSubMenuAction:"hover"})),a.createElement(b.A,{disabledOverflow:!0,selectable:!0,selectedKeys:["Emails"],forceSubMenuRender:"true",className:"project-menu__list project-menu__list_bottom",style:{fontSize:14,marginBottom:6},subMenuOpenDelay:.3,subMenuCloseDelay:.6,items:H,triggerSubMenuAction:"hover"})))};var V=o(63837),j=o(99460),z=o(62913),W=o(13785),G=o(8807),H=o(1047),U=o(39420),q=o(52919);const X=()=>{var e;const{__:t}=(0,h.s9)(),o=(0,c.wA)(),[l]=(0,L.b9)(),[i,r]=(0,a.useState)(null===(e=window)||void 0===e?void 0:e.localStorage.getItem(M.V0.em_color_scheme)),n=(0,q.XW)(),s=(0,a.useCallback)(((e=null)=>{const t=e;(e=>{let t;if((0,U.Hk)(e),null===e){const e=matchMedia(M.F3).matches?M.nd:M.T;localStorage.removeItem(M.V0.em_color_scheme),t=e}else localStorage.setItem(M.V0.em_color_scheme,e),t=e;o((0,H.eX)(t===M.nd?`vs-${t}`:M.T)),(0,U.A5)(t),n({operation:M.Ru.UPDATE_PREVIEW,theme:t}),l({theme:e})})(t),r(t)}),[o,l,n]);return(0,a.useEffect)((()=>{matchMedia(M.F3).onchange=()=>s()}),[s]),a.createElement("div",{onClick:e=>e.stopPropagation()},a.createElement(z.A,{className:"theme-switcher",style:{cursor:"pointer",color:"var(--colorText)"},value:i,options:[{label:a.createElement(W.A,{title:t("Light theme")},a.createElement(G.A,{icon:"LightMode",style:{fontSize:18}})),value:M.T},{label:a.createElement(W.A,{title:t("System theme")},a.createElement(G.A,{icon:"AutoMode",style:{fontSize:18}})),value:null},{label:a.createElement(W.A,{title:t("Dark theme")},a.createElement(G.A,{icon:"DarkMode",style:{fontSize:18}})),value:M.nd}],onChange:e=>s(e)}))};var $=o(705),Q=o(22536),K=o(49982),Y=o(69201),J=o(62347),Z=o(86095),ee=o(90121),te=o(27941),oe=o(13668);const{Sider:ae}=i.A,{useToken:le}=r.A,ie=()=>{const{token:e}=le();let t=(0,l.zy)();const o=(0,c.wA)(),r=(0,l.Zp)(),{emailId:u,blockId:g}=(0,l.g)(),b=(0,c.d4)(C.C1),E=(0,c.d4)(R.cL),h=(0,a.useRef)(),[f]=(0,$.bw)(),v=(0,n.hN)();h.current||(h.current=(0,Z.$Z)()),(0,a.useEffect)((()=>{(0,U.FN)(e)}),[e]);const{data:_=[],isSuccess:A}=(0,$.I9)(b.id,{pollingInterval:3e4,skip:E});(0,a.useEffect)((()=>{const e=_.filter((e=>""===e.seen||null===e.seen));setTimeout((()=>{e.length&&A&&e.forEach((e=>{var t,o;v[e.type]({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:(null===(t=e.title)||void 0===t?void 0:t.rendered)||e.title||""}}),description:a.createElement("div",{dangerouslySetInnerHTML:{__html:(null===(o=e.content)||void 0===o?void 0:o.rendered)||""}}),placement:"bottomRight"});const l=(new Date).toLocaleString();f({id:e.id,datetime:l}).unwrap()}))}),5e3)}),[A,f,_,v]),(0,K.A)(),(0,Y.A)(),(0,J.A)(),(0,a.useEffect)((()=>{g||o((0,Q.nJ)()),u||o((0,H.ss)())}),[g,u,o,t.pathname]);let y=null;u||g||t.pathname.endsWith("/new")?y=h.current:h.current&&h.current.getValue()&&setTimeout((()=>h.current.setValue("")),1e3);const S=JSON.parse(localStorage.getItem(M.V0.em_menu_is_locked)),[k,B]=(0,a.useState)((null===S||void 0===S?void 0:S.isLocked)||!1),[w,x]=(0,a.useState)(!0);return(0,a.useEffect)((()=>{const e=()=>localStorage.setItem(M.V0.em_menu_is_locked,JSON.stringify({isLocked:k}));return e(),e()}),[k]),(0,ee.D3)(oe._1,(0,a.useCallback)((e=>{const t=(0,te.Mu)(e);r(t)}),[r])),a.createElement("div",{className:"main"},a.createElement(Z.kx.Provider,{value:y},a.createElement("div",{className:"main__pane main__pane_main"},a.createElement("div",{className:"main__pane-content",id:"pane-content-iframe"},a.createElement(i.A,{className:"main__pane-layout",hasSider:!0},!M.EW.isPlugin&&a.createElement(ae,{theme:"light",style:{borderColor:e.colorBorder,position:"fixed",overflow:window.innerWidth>1400?"hidden":""},collapsible:!0,collapsed:!k&&w,defaultCollapsed:!0,reverseArrow:!k&&!w||k&&!w,trigger:a.createElement("div",{className:"main__pane-trigger"},k?a.createElement(d.A,{style:{fontSize:window.innerWidth>1400?18:13}}):a.createElement(a.Fragment,null,a.createElement(s.A,{style:{fontSize:window.innerWidth>1400?18:13}}),a.createElement(m.A,{style:{fontSize:window.innerWidth>1400?18:13}})),a.createElement(X,null)),className:p()("main__menu",{main__menu_lock:k}),width:260,collapsedWidth:window.innerWidth>1400?80:0,zeroWidthTriggerStyle:{},onCollapse:(e,t)=>{e?!k&&x(!0):x(!e),B(!k)},onMouseEnter:()=>!k&&x(!1),onMouseLeave:()=>!k&&x(!0)},a.createElement(D,{isMenuCollapsed:w,setIsMenuCollapsed:x,isLocked:k})),a.createElement(V.A,{isModalVisible:E===M.lx.EDIT_PROJECT_MODAL}),a.createElement(j.A,{isModalVisible:E===M.lx.EDIT_PROFILE_MODAL}),a.createElement(l.sv,null))))))}},2565:(e,t,o)=>{o.d(t,{A:()=>T});var a=o(98173),l=o(63719),i=o(47555),r=o(37969),n=o(64909),s=o(17488),m=o(30150),d=o(27499),c=o(8218),u=o(2604),p=o(12543),g=o(38927),b=o(83991),E=o(71879),h=o(32947);const f=(e,t,o,a,l,i)=>{var r,n;const s=i("Owner","member"),m=i("Administrator","member"),d=l("The invitation has been sent");let c=[];e.role===d?c.push({label:l("Revoke the invite"),key:h.JE,className:"em-analytics__revoke-invite",onClick:({key:t})=>a(t,e)}):(e.role!==s&&c.push({label:l("Assign the project owner"),key:h.gY,className:"em-analytics__members-owner",onClick:({key:t})=>a(t,e)}),e.role!==m&&c.push({label:l("Change role to Administrator"),key:h.Qz,className:"em-analytics__members-admin",onClick:({key:t})=>a(t,e)}),e.role===m&&c.push({label:l("Change role to User"),key:h.aO,className:"em-analytics__members-user",onClick:({key:t})=>a(t,e)}),c.push({label:l("Remove member"),key:h.eA,onClick:({key:t})=>a(t,e)}));let u=[];(null===(r=e.ID)||void 0===r?void 0:r.toString())===(null===(n=o.id)||void 0===n?void 0:n.toString())&&u.push({label:l("Change role to User"),key:h.aO,className:"em-analytics__members-user",onClick:({key:t})=>a(t,e)}),e.role===h.m3&&u.push({label:l("Change role to Administrator"),key:h.Qz,className:"em-analytics__members-admin",onClick:({key:t})=>a(t,e)}),e.role===h.G$?u.push({label:l("Revoke the invite"),key:h.JE,className:"em-analytics__revoke-invite",onClick:({key:t})=>a(t,e)}):u.push({label:l("Remove member"),key:h.eA,className:"em-analytics__members-remove",onClick:({key:t})=>{a(t,e)}});let p=[{label:l("Remove member"),key:h.eA,className:"em-analytics__members-remove",onClick:({key:t})=>a(t,e)}];switch(t){case h.yo:return c;case h.St:return u;case h.m3:return p;default:return null}};f.propTypes={};const v=f;var _=o(47014),A=o(97032),y=o(80223),S=o(40277);const k=()=>{const{__:e,_x:t}=(0,p.s9)(),o=(0,u.d4)(_.C1),{owner:l,admin:i}=(0,y.A)();let r=(0,m.Zp)();const s=(0,n.hN)(),[d,c]=(0,a.useState)(""),f=t("Owner","member"),k=t("Administrator","member"),B=e("user"),w=e("The invitation has been sent");(0,a.useEffect)((()=>{l||i||c(h.m3),l&&c(h.yo),i&&c(h.St)}),[l,i,o]);const{data:x,isFetching:P,refetch:N}=(0,m.KC)(),[T,R]=(0,a.useState)([]);(0,a.useEffect)((()=>{const{owner:o,admins:a,users:l,invited_users:i}=x.members||{};R([o&&{...o,role:t("Owner","member")},a&&Array.isArray(a)&&a.map((e=>({...e,role:t("Administrator","member")}))),l&&Array.isArray(l)&&l.map((t=>({...t,role:e("user")}))),i&&Array.isArray(i)&&i.filter((e=>null===e||void 0===e?void 0:e.invited_user_email)).map((t=>({role:e("The invitation has been sent"),user_email:t.invited_user_email,user_firstname:" ",user_lastname:" "})))].filter((e=>e)).flat(1))}),[x.members,e,t]);const[I,C]=(0,A.OD)(),L=(a,{role:l,...i})=>{var n,m;let d,c={};switch(a){case h.gY:if(l===k){const e=x.members.admins,t=x.members.owner;c={admins:e&&Array.isArray(e)&&e.length>0?[...e.filter((e=>e.ID!==i.ID)).map((e=>e.ID)),t.ID]:0,owner:i.ID}}if(l===B){const e=x.members.users,t=x.members.owner;c={users:e&&Array.isArray(e)&&e.length>0?[...e.filter((e=>e.ID!==i.ID)).map((e=>e.ID)),t.ID]:0,owner:i.ID}}d=e("You changed the role of ")+i.display_name+t(" to ","member")+e("owner")+".";break;case h.Qz:if(l===B){const o=x.members.users,a=x.members.admins;c={users:o&&Array.isArray(o)&&o.length>1?o.filter((e=>e.ID!==i.ID)).map((e=>e.ID)):0,admins:a&&Array.isArray(a)&&a.length>0?[...a.map((e=>e.ID)),i.ID]:[i.ID]},d=e("You changed the role of ")+i.display_name+t(" to ","member")+e("Administrator")+"."}break;case h.aO:if(l===k){const o=x.members.admins,a=x.members.users;c={admins:o&&Array.isArray(o)&&o.length>1?o.filter((e=>e.ID!==i.ID)).map((e=>e.ID)):0,users:a&&Array.isArray(a)&&a.length>0?[...a.map((e=>e.ID)),i.ID]:[i.ID]},d=e("You changed the role of ")+i.display_name+t(" to ","member")+e("user")+"."}break;case h.eA:if(l===k){const e=x.members.admins;c={admins:e&&Array.isArray(e)&&e.length>1?e.filter((e=>e.ID!==i.ID)).map((e=>e.ID)):0}}if(l===B){const e=x.members.users;c={users:e&&Array.isArray(e)&&e.length>1?e.filter((e=>e.ID!==i.ID)).map((e=>e.ID)):0}}d=(null===(n=o.id)||void 0===n?void 0:n.toString())===(null===(m=i.ID)||void 0===m?void 0:m.toString())?e("You deleted yourself from the project successfully."):e("You deleted ")+i.display_name+" "+e(" from the project successfully.");break;case h.JE:const a=x.members.invited_users;c={invited_users:!!(a&&Array.isArray(a)&&a.length>0)&&a.filter((e=>e.invited_user_email&&e.invited_user_email!==i.user_email))},d=e("You revoke invite for ")+i.user_email+" "+e(" from the project successfully.");break;default:return}I({projectId:x.id,members:{...x.members,...c}}).then((e=>{var t,a;if(e.error)return(null===(t=o.id)||void 0===t?void 0:t.toString())===(null===(a=i.ID)||void 0===a?void 0:a.toString())?((0,S.wB)(d,s),void r("/projects")):void(0,S.p6)(e,s);N(),(0,S.wB)(d,s)}))},F=[{width:"25%",title:e("Email"),dataIndex:["user_email"]},{width:"25%",title:e("Name"),dataIndex:["user_firstname"],render:(e,{user_lastname:t})=>a.createElement(a.Fragment,null,e||t?`${e} ${t}`:"-")},{width:"25%",title:e("Role"),dataIndex:["role"],render:(e,t,o)=>e},{width:"3%",title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(r,n)=>{const s=v(n,d,o,L,e,t);return n.role===f||!l&&!i&&n.role===k||i&&n.role===k&&o.id!==n.ID||!l&&!i&&n.role===B&&o.id!==n.ID||!l&&!i&&n.role===w?null:a.createElement(g.A,{arrow:"true",placement:"bottomRight",menu:{items:s},trigger:["hover"]},a.createElement("span",{className:"members-table__actions"},a.createElement(E.A,null)))}}];return a.createElement("div",null,a.createElement(b.A,{bordered:!0,className:"members-table",rowClassName:e=>e.role===w?"members-table__invite_member_row":"",rowKey:e=>`${e.role}_${e.ID||e.user_email}`,dataSource:T,columns:F,loading:C.isLoading||P,showSizeChanger:!1,pagination:{showSizeChanger:!1,hideOnSinglePage:!0,position:["bottomLeft"]}}))};var B=o(47113),w=o(19992),x=o(54125);const{Paragraph:P}=l.A,{Content:N}=i.A,T=()=>{const{__:e}=(0,p.s9)(),t=(0,u.wA)(),{owner:o,admin:l}=(0,y.A)(),[g]=d.A.useForm(),b=(0,n.hN)(),[E,h]=(0,w.N)(),{data:f,refetch:v}=(0,m.KC)();(0,x.A)(e("Members")),(0,a.useEffect)((()=>{document.body.classList.remove("editor")}));const _=a.createElement(a.Fragment,null,a.createElement(P,{className:"ant-page-header-heading-title"},e("Members"))),T=a.createElement(a.Fragment,null,o||l?[a.createElement(d.A,{form:g,key:"search-members-form",name:"search-members-form",initialValues:{remember:!0},onFinish:({email:e})=>{E({email:e,project_id:f.id}).then((e=>{var o,l,i;e.isError?(0,S.p6)(e,b):(null===(o=e.data)||void 0===o||null===(l=o.data)||void 0===l?void 0:l.status)<400?(g.resetFields(),v(),(0,S.wB)(null===e||void 0===e||null===(i=e.data)||void 0===i?void 0:i.message,b),t(A.Nq.util.invalidateTags([{type:"Projects",id:f.id}]))):b.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:e.data.code}}),description:a.createElement("div",{dangerouslySetInnerHTML:{__html:e.data.message}}),placement:"bottomRight"})}))},autoComplete:"off",layout:"inline",validateTrigger:"onSubmit",onValuesChange:()=>{g.setFields([{errors:[],name:["email"]}])},className:"members-page__search-form"},a.createElement(d.A.Item,{className:"members-page__search-form-item members-page__search-form-item_input-item",name:"email",rules:[{required:!0,message:e("Please enter the correct email address."),type:"email"}]},a.createElement(c.A,{placeholder:e("Email of a new member"),disabled:h.isLoading})),a.createElement(d.A.Item,{className:"members-page__search-form-item"},a.createElement(r.Ay,{type:"primary",className:"em-analytics__members-add",htmlType:"submit",disabled:h.isLoading,icon:a.createElement(s.A,null)},e("Add a member"))))]:[]);return a.createElement(i.A,{className:"members-page"},a.createElement(B.A,{leftBlock:_,rightBlock:T}),a.createElement(N,{className:"members-page__container"},a.createElement("div",{className:"members-page__content container"},a.createElement(k,null))))}},48956:(e,t,o)=>{o.d(t,{A:()=>c});var a=o(98173),l=o(48753),i=o(82021),r=o(37969),n=o(12543),s=o(30150),m=o(89613),d=o(98173);const c=({open:e,sideOnOk:t,onCancel:o,initialSlide:c=0})=>{const{__:u}=(0,n.s9)(),p=(0,s.Zp)(),[g,b]=(0,a.useState)(c),E=(0,a.useRef)(null),h=(0,m.u)();(0,a.useEffect)((()=>{e&&E.current&&(E.current.goTo(c,!0),b(c))}),[e,c]);const f=(0,a.useMemo)((()=>[{image:u("https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png"),backgroundColor:"var(--blue-2)",title:u("More editing functions"),description:u("Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.")},{image:u("https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png"),backgroundColor:"var(--purple-2)",title:u("Work with the HTML code"),description:u("Edit the HTML version of your email template in \xabCode\xbb mode and see the changes in real time. Blocks has no restrictions on the code: you can create templates of any complexity!")},{image:u("https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png"),backgroundColor:"var(--cyan-2)",title:u("AI image generation"),description:u("Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.")},{image:u("https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png"),backgroundColor:"var(--green-2)",title:u("Stock photos and GIFs"),description:u("Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.")},{image:u("https://cdn.useblocks.io/1351/241017_18_NDYloAO.png"),backgroundColor:"var(--magenta-2)",title:u("Version history"),description:u("Check who and when made changes to the email template and, if necessary, restore one of the previous versions.")},{image:u("https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png"),backgroundColor:"var(--red-2)",title:u("Image editor"),description:u("Want to resize an image, add some text, or apply a filter? No need to leave Blocks! You can make all the basic changes in our image editor.")},{image:u("https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png"),backgroundColor:"var(--orange-2)",title:u("Email optimization"),description:u("Check your email against broken links, missing alt texts, heavy images, and other obstacles that might prevent your emails from hitting inboxes.")},{image:u("https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png"),backgroundColor:"var(--volcano-2)",title:u("Team collaboration"),description:u("Add your team members and work on your project simultaneously. Attach comments to individual email blocks and discuss necessary edits right in the editor.")},{image:u("https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png"),backgroundColor:"var(--geekblue-2)",title:u("Email testing"),description:u("Check how your email will look like across various devices and email clients.")},{image:u("https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png"),backgroundColor:"var(--geekblue-2)",title:u("AI assistant"),description:u("Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!")}]),[u]);return(0,a.useEffect)((()=>{if(e&&E.current){E.current.goTo(c,!0),b(c);const e=f[c];h({event:"open_modal",action:"open_premium-features_modal",modal_id:"premium-features",offer_id:e.title})}}),[e,f,c,h]),d.createElement(l.A,{open:e,footer:null,onCancel:o,centered:!0,closable:!1,className:"premium-features-modal",classNames:{mask:"premium-features-modal-mask"},styles:{mask:{background:"rgba(0, 0, 0, 0.65)"}},width:1100,style:{maxWidth:"80%"}},d.createElement(i.A,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:"carousel-slider",draggable:!0,autoplaySpeed:5e3,initialSlide:g,ref:E},f.map(((e,t)=>d.createElement("div",{key:t},d.createElement("div",{className:"carousel-slide",style:{background:`${e.backgroundColor}`}},d.createElement("div",{className:"slide-item-image"},d.createElement("img",{src:e.image,alt:`slide-${t}`})),d.createElement("div",{className:"slide-item-content"},d.createElement("h3",{className:"slide-title"},e.title),d.createElement("p",{className:"slide-description"},e.description))))))),d.createElement("div",{className:"modal-subtitle"},u("This and other features are available for you on any paid billing plan.")),d.createElement("div",{className:"modal-buttons"},d.createElement(r.Ay,{size:"large",onClick:()=>o(!1)},u("Cancel")),d.createElement(r.Ay,{type:"primary",size:"large",onClick:()=>{t&&t(),p("/billing"),o(!1)},style:{padding:"0 30px"}},u("Select plan"))))}},1753:(e,t,o)=>{o.d(t,{A:()=>d});var a=o(98173),l=o(49856),i=o(98447),r=o(38826);const n=a.createElement(r.A,{style:{fontSize:48},rev:null,spin:!0}),s=(0,a.lazy)((()=>Promise.all([o.e(6819),o.e(1880),o.e(5346),o.e(8084)]).then(o.bind(o,10275)))),m={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"};function d(e){return a.createElement(a.Suspense,{fallback:a.createElement(l.A,{size:"large",style:m},a.createElement(i.A,{indicator:n}))},a.createElement(s,e))}},89687:(e,t,o)=>{o.d(t,{A:()=>i});var a=o(98173),l=o(30150);const i=({lastProjectId:e})=>{const{pathname:t,search:o}=(0,l.zy)();return!1===e?a.createElement(l.C5,{to:"/projects"}):e&&a.createElement(l.C5,{to:`/projects/${e+t+o}`})}},67007:(e,t,o)=>{o.d(t,{A:()=>i});var a=o(98173),l=o(30150);const i=({to:e})=>a.createElement(l.C5,{to:e})},96087:(e,t,o)=>{o.d(t,{A:()=>c});var a=o(98173),l=o(47555),i=o(72570),r=o(37969),n=o(30150),s=o(12543),m=o(40277);const{Content:d}=l.A,c=()=>{const{__:e}=(0,s.s9)();let t=(0,n.Zp)();return a.createElement(l.A,null,a.createElement(d,{className:"container"},a.createElement(i.Ay,{status:"500",title:"404",subTitle:e("Sorry, the page you visited does not exist."),extra:a.createElement(r.Ay,{type:"primary",onClick:()=>(0,m.XZ)(t,"/projects")},e("Back Home"))})))}},53821:(e,t,o)=>{o.d(t,{A:()=>Q});var a=o(98173),l=o(30150),i=o(2604),r=o(26298),n=o.n(r),s=o(30753),m=o(63719),d=o(49856),c=o(67034),u=o(94674),p=o(201),g=o(66964),b=o(37969),E=o(38976),h=o(5553),f=o(69194),v=o(13785),_=o(34401),A=o(66711),y=o(51717),S=o(63448),k=o(42567),B=o(2952),w=o(1047),x=o(97032),P=o(40277),N=o(64909),T=o(52919),R=o(90614),I=o(27941),C=o(12543),L=o(86095),F=o(15626),O=o(32947);const{Text:M,Link:D,Title:V}=m.A,j="Links",z="Images",W="Spam assassin",G="Problems",H="valid",U="warnings",q="errors",X=[H,q,U],$=({summary:e,__:t,selectedTags:o,setSelectedTags:l})=>a.createElement(V,{level:5,style:{margin:0,fontSize:"14px"}},a.createElement(d.A,{style:{flexWrap:"wrap"},gap:"6"},X.map(((i,r)=>a.createElement(c.A.CheckableTag,{key:i+r,checked:null===o||void 0===o?void 0:o.includes(i),onChange:e=>((e,t)=>{const a=t?2===o.length?[]:[...o,e]:o.filter((t=>t!==e));l(a)})(i,e),className:n()(`${i} optimise__button`,{[`${i}_active`]:o.includes(i)})},t(i===H?"Valid":i===U?"Warnings":"Errors"),":"," ",(null===e||void 0===e?void 0:e[i])||0))))),Q=()=>{var e,t,o,r,m,d,c;const{__:X}=(0,C.s9)(),Q=(0,i.wA)(),K=(0,L.fn)(),Y=(0,I.rD)(),J=(0,N.hN)(),{emailId:Z,projectId:ee}=(0,l.g)(),te=(0,T.QC)(),oe=(0,i.d4)(w.rd),ae=(0,R.ml)(F.AZ.ON_LIMIT_ID),[le,ie]=(0,B.Sr)(),[re,ne]=(0,B.ku)(),[se,me]=(0,B.Ju)(),{data:de,isSuccess:ce,refetch:ue}=(0,x.fo)(+ee,{skip:!!O.EW.isPlugin||!+ee}),{limits:pe}=O.EW.isPlugin?Y.limits?Y:{limits:{optimization_limit:0}}:de||{limits:{optimization_limit:0}},{optimization_limit:ge}=pe,[be,Ee]=(0,a.useState)(),[he,fe]=(0,a.useState)([]),[ve,_e]=(0,a.useState)([]),[Ae,ye]=(0,a.useState)([]),[Se,ke]=(0,a.useState)([]),[Be,we]=(0,a.useState)(0),[xe,Pe]=(0,a.useState)([]),[Ne,Te]=(0,a.useState)([]),Re=Be>=ge&&ge>0,Ie=!(!Y.limits||!Y.counters)&&O.EW.isPlugin,Ce=(0,a.useCallback)((()=>{ae.fire({name:"OptimizationCount",count:Be+1})}),[ae,Be]);(0,a.useEffect)((()=>{var e,t;Ie?we((null===Y||void 0===Y||null===(e=Y.counters)||void 0===e?void 0:e.optimization_counter)||0):ce&&(null===de||void 0===de||null===(t=de.counters)||void 0===t?void 0:t.optimization_counter)&&we(de.counters.optimization_counter)}),[Ie,de,ce,Y]),(0,a.useEffect)((()=>{var e,t;be===j&&xe.links&&_e(he.length>0?null===(e=xe.links)||void 0===e?void 0:e.filter((e=>he.includes(e.status))):xe.links);be===z&&Ne.images&&ye(he.length>0?null===(t=Ne.images)||void 0===t?void 0:t.filter((e=>he.includes(e.status))):Ne.images)}),[xe.links,Ne.images,he,be]);const Le=()=>{if(!Z)return void J.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});let e;Ie&&(we((e=>e+1)),Ce());const t=K.getValue(),o=(new DOMParser).parseFromString(t,"text/html"),l={},i={};o.querySelectorAll("a[href]").forEach(((e,t)=>{l[`link_${t}`]=e.getAttribute("href"),i[`link_${t}`]=e.innerText})),te.send({operation:"sandbox_set_attr_to_links"}),re({entity_id:Z,data:l}).then((({data:t,error:o})=>{if(o)(0,P.p6)({error:o},J);else if(null!==t&&void 0!==t&&t.result){let o=[...t.result];null===o||void 0===o||o.sort(((e,t)=>e.linkId-t.linkId));const a=e=>{var t,o,a,l;return(null!==e.statusCode?e.statusCode<300&&(null===(t=null===(o=e.page)||void 0===o?void 0:o.secure)||void 0===t||t):"invalid"!==e.type)?H:(e.statusCode&&e.statusCode<400||200===e.statusCode&&(null===(a=null===(l=e.page)||void 0===l?void 0:l.secure)||void 0===a||a))&&"invalid"!==e.type?U:q};e={links:o.map((e=>({...e,text:i[e.linkId],status:a(e)}))),summary:{valid:o.filter((e=>a(e)===H)).length||0,warnings:o.filter((e=>a(e)===U)).length||0,errors:o.filter((e=>a(e)===q)).length||0}},Pe(e),(0,P.wB)(X("Links validation was successfully completed"),J),!O.EW.isPlugin&&ue()}else t.statusCode>300||!t.success?(0,P.p6)({error:{data:t}},J):J.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),!xe.links&&Me("")})).catch((e=>{(0,P.p6)({error:e},J)}))},Fe=()=>{if(!Z)return void J.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});Ie&&(we((e=>e+1)),Ce());const e=K.getValue(),t=(new DOMParser).parseFromString(e,"text/html");let o={};t.querySelectorAll("img").forEach(((e,t)=>o[`image_${t}`]=e.src)),te.send({operation:"sandbox_set_attr_to_images"}),se({entity_id:Z,data:o}).then((({data:e,error:t})=>{let o;if(t)(0,P.p6)({error:t},J);else if(null!==e&&void 0!==e&&e.result){let t=Object.values(e.result);t.sort(((e,t)=>e.imageId-t.imageId));let a=t.reduce(((e,t)=>e+Math.round(t.image.bytes/1024)),0);const l=e=>null!==e.statusCode&&e.statusCode<300?H:e.statusCode<400&&e.statusCode>=300||200===e.statusCode&&!e.valid?U:q;o={images:t.map((e=>({...e,status:l(e)})))||[],summary:{valid:t.filter((e=>l(e)===H)).length||0,warnings:t.filter((e=>l(e)===U)).length||0,errors:t.filter((e=>l(e)===q)).length||0},summaryTime:{value:(a>1200?a/1e3:a).toFixed(1),name:X(a>1200?"MB":"KB")}},o&&Te(o),(0,P.wB)(X("Images validation was successfully completed"),J),!O.EW.isPlugin&&ue()}else{var l;e.statusCode>300||!e.success?(0,P.p6)({error:{data:e}},J):J.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),(null===Ne||void 0===Ne||null===(l=Ne.images)||void 0===l||!l.length)&&Me("")}})).catch((e=>{(0,P.p6)({error:e},J)}))},Oe=()=>{Z?(Ie&&(we((e=>e+1)),Ce()),le({entity_id:Z,data:{html:K.getValue()}}).then((({data:e,error:t})=>{if(t)(0,P.p6)({error:t},J);else if(e&&e.success){const t=!!e.result.report&&Object.values(e.result.report);t&&(t.sort(((e,t)=>e.score-t.score)),ke({...e.result,report:t})),(0,P.wB)(X("Spam validation was successfully completed"),J),!O.EW.isPlugin&&ue()}else e.statusCode>300||!e.success?(0,P.p6)({error:{data:e}},J):J.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430."}}),placement:"bottomRight"}),(null===Se||void 0===Se||!Se.length)&&Me("")})).catch((e=>{(0,P.p6)({error:e},J)}))):J.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"})},Me=e=>{Ee(e!==be?e:""),fe([])};let De=null;return(0,a.useEffect)((()=>{ge>0&&Be>=+ge&&J.error({message:X("The usage limit has been exceeded"),description:X("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"})}),[Be,ge,X,J]),a.createElement("div",{className:"optimise selected_form-props-wrapper selected_form-props-wrapper_optimize"},Ie&&a.createElement(s.A,{counter:Be,limits:ge}),Y.optimizeLinksEnabled&&a.createElement(a.Fragment,null,a.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),a.createElement(p.A,{gutter:10,align:"middle"},a.createElement(g.A,{span:20},a.createElement("div",{className:"form-group-title"},X("Links validation"))),a.createElement(g.A,{span:4,align:"right"},a.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;Me(j),null!==xe&&void 0!==xe&&null!==(e=xe.links)&&void 0!==e&&e.length||be===j||Le()},loading:ne.isLoading,disabled:Re&&!(null!==xe&&void 0!==xe&&null!==(e=xe.links)&&void 0!==e&&e.length)},!ne.isLoading&&(be===j?a.createElement(_.A,null):a.createElement(A.A,null))))),be===j&&!(null===xe||void 0===xe||!xe.links)&&(0===(null===xe||void 0===xe||null===(t=xe.links)||void 0===t?void 0:t.length)?a.createElement(p.A,{style:{marginBottom:24}},a.createElement(E.A,{message:X("No links found."),type:"info"})):a.createElement(a.Fragment,null,a.createElement(p.A,{style:{marginBottom:14}},a.createElement("div",{className:"optimise__title-wrapper"},a.createElement($,{__:X,summary:xe.summary,setSelectedTags:fe,selectedTags:he}),a.createElement(b.Ay,{disabled:Re,loading:ne.isLoading,onClick:Le,icon:a.createElement(y.A,null)},X("Refresh")))),a.createElement(p.A,{style:{marginBottom:24}},a.createElement(g.A,{span:24},a.createElement(h.A,{itemLayout:"horizontal",dataSource:ve,renderItem:(e,t)=>{var o;return a.createElement(h.A.Item,{style:{border:"none"},key:t+"_"+e.id},a.createElement(h.A.Item.Meta,{avatar:e.status===H?a.createElement(S.A,{className:H}):e.status===U?a.createElement(S.A,{className:U}):a.createElement(k.A,{className:q}),title:a.createElement(D,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.linkId,o=600>e.statusCode>399||!e.statusCode,void te.send({operation:O.Ru.SANDBOX_SET_POSITION_TO_LINK,settings:{elementId:t,isError:o}});var t,o}},""===e.url?X("empty link"):e.url),description:a.createElement(a.Fragment,null,!(null===(o=e.text)||void 0===o||!o.length)&&a.createElement(M,{type:"secondary"},e.text),e.page.title&&e.page.title,e.page.secure&&e.status===H&&a.createElement(a.Fragment,null,a.createElement("span",{className:"image-size-splitter"},"\xa0\u2022\xa0"),a.createElement("span",{className:H},X("secure"))),!e.resolvedUrl&&!e.statusCode&&"url"===e.type&&a.createElement(a.Fragment,null,a.createElement("span",{className:"image-size-splitter"},"\xa0\u2022\xa0"),a.createElement(M,{type:"secondary"},X("Failed to load"))))}))}})))))),Y.optimizeImagesEnabled&&a.createElement(a.Fragment,null,a.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),a.createElement(p.A,{gutter:10,align:"middle"},a.createElement(g.A,{span:20},a.createElement("div",{className:"form-group-title"},X("Images validation"))),a.createElement(g.A,{span:4,align:"right"},a.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;Me(z),null!==Ne&&void 0!==Ne&&null!==(e=Ne.images)&&void 0!==e&&e.length||be===z||Fe()},loading:me.isLoading},!me.isLoading&&(be===z?a.createElement(_.A,null):a.createElement(A.A,null))))),be===z&&!(null===Ne||void 0===Ne||!Ne.images)&&(0===(null===Ne||void 0===Ne||null===(o=Ne.images)||void 0===o?void 0:o.length)?a.createElement(p.A,{style:{marginBottom:24}},a.createElement(E.A,{message:X("No images found."),type:"info"})):a.createElement(a.Fragment,null,a.createElement(p.A,{style:{marginBottom:16}},a.createElement(E.A,{style:{padding:14,paddingBottom:10,width:"100%"},message:a.createElement("div",{className:"optimise__summary"},a.createElement("div",null,a.createElement(V,{level:4,style:{marginBottom:"0"}},Ne.images.length," "),a.createElement("span",{style:{fontSize:"12px"}},X("images"))),a.createElement("div",null,a.createElement(V,{level:4,style:{marginBottom:"0"}},null===(r=Ne.summaryTime)||void 0===r?void 0:r.value,null===(m=Ne.summaryTime)||void 0===m?void 0:m.name),a.createElement("span",{style:{fontSize:"12px"}},X("total size"))),a.createElement("div",null,a.createElement(V,{level:4,style:{marginBottom:"0"}},(Math.max(...Ne.images.map((e=>e.image.responseTime)))/1e3).toFixed(2)+X("s")),a.createElement("span",{style:{fontSize:"12px"}},X("time to load")))),type:"warning"})),a.createElement(p.A,{style:{marginBottom:12}},a.createElement("div",{className:"optimise__title-wrapper"},a.createElement($,{__:X,summary:Ne.summary,setSelectedTags:fe,selectedTags:he}),a.createElement(b.Ay,{icon:a.createElement(y.A,null),disabled:Re,loading:me.isLoading,onClick:()=>Fe()},X("Refresh")))),a.createElement(p.A,{style:{marginBottom:12}},a.createElement(g.A,{span:24},a.createElement(h.A,{className:"optimise__result-list",itemLayout:"horizontal",dataSource:Ae,renderItem:(e,t)=>a.createElement(h.A.Item,{className:"optimise__image-item image-item",style:{border:"none"},key:t},a.createElement(h.A.Item.Meta,{className:n()("image-item__meta",{"image-item__meta_fail":!e.resolvedUrl&&!e.statusCode}),avatar:a.createElement(f.A,{className:n()("image-item__image",{"image-item__image_fail":!e.resolvedUrl||!e.valid}),width:92,height:"auto",style:{height:"auto"},src:e.resolvedUrl||"",preview:!1,onMouseEnter:()=>{var t;return((e,t)=>{clearTimeout(De);let o=document.querySelector(".img-preview")?document.querySelector(".img-preview"):null,a=document.querySelector(".img-preview-content")?document.querySelector(".img-preview-content"):null;document.querySelector(".img-preview")||(o=document.createElement("div"),o.classList.add("img-preview"),a=document.createElement("div"),a.classList.add("img-preview-content"),o.append(a),document.querySelector(".email-pane__col_settings-inner").append(o)),a.innerHTML=`<table cellspacing="0" cellpadding="0" border="0" width="100%"><img height="auto" width=${t+"px"} alt="" style="max-width: 100%; object-fit: contain" src=${e}></table>`,"1"!==o.style.opacity&&setTimeout((function(){o.style.opacity="1",o.style.transform="translateX(-100%)"}),10)})(e.url,null===(t=e.image.dimensions)||void 0===t?void 0:t.width)},onMouseLeave:()=>(()=>{let e=document.querySelector(".img-preview");e&&(De=setTimeout((()=>{e.style.opacity="0",e.style.transform="translateX(-99%)",setTimeout((function(){e.remove()}),300)}),300))})()}),title:e.url?a.createElement(v.A,{placement:"top",title:e.message},a.createElement(D,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.imageId,o=600>e.statusCode>399||!e.statusCode,void te.send({operation:O.Ru.SANDBOX_SET_POSITION_TO_IMG,settings:{elementId:t,isError:o}});var t,o}},""===(null===e||void 0===e?void 0:e.url)?X("empty src"):e.url)):e.message,description:a.createElement(a.Fragment,null,a.createElement("div",{className:"image-size"},e.image.dimensions&&a.createElement(a.Fragment,null,e.image.dimensions.width+" \xd7 "+e.image.dimensions.height,a.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),a.createElement("span",null,Math.round(e.image.bytes/1024),X("kB")),a.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),a.createElement("span",null,e.image.responseTime,X("ms")),a.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),a.createElement("span",{className:"image-size-format"},e.image.contentType)),e.image.secure&&a.createElement(a.Fragment,null,a.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),a.createElement("span",{className:H},X("secure"))),e.resolvedUrl&&!e.valid&&a.createElement(M,{type:"danger"},X("not valid")))," ",!e.resolvedUrl&&!e.statusCode&&a.createElement(M,{type:"danger"},X("Failed to load")))}))})))))),Y.optimizeSpamAssassinEnabled&&a.createElement(a.Fragment,null,a.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),a.createElement(p.A,{gutter:10,align:"middle"},a.createElement(g.A,{span:20},a.createElement("div",{className:"form-group-title"},X("SpamAssassin"))),a.createElement(g.A,{span:4,align:"right"},a.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",loading:ie.isLoading,onClick:()=>{var e;Me(W),null!==(e=Se.report)&&void 0!==e&&e.length||Oe()},disabled:Re&&!(null!==Se&&void 0!==Se&&null!==(d=Se.report)&&void 0!==d&&d.length)},!ie.isLoading&&(be===W?a.createElement(_.A,null):a.createElement(A.A,null))))),be===W&&!(null===(c=Se.report)||void 0===c||!c.length)&&a.createElement(a.Fragment,null,a.createElement(p.A,{style:{marginBottom:8}},a.createElement("div",{className:"optimise__title-wrapper optimise__title-wrapper_spam"},a.createElement(V,{level:1,style:{margin:0},type:Se.spamScore<2||!Se.spamScore||Se.spamScore<=Se.baseSpamScore-1?"success":Se.spamScore<Se.baseSpamScore-1?"warning":"danger"},a.createElement("span",{style:{marginRight:"12px"}},Se.spamScore||0),a.createElement(M,{style:{marginRight:"12px",fontSize:"20px"}},"Score")),a.createElement(b.Ay,{disabled:Re,icon:a.createElement(y.A,null),loading:ie.isLoading,onClick:Oe},X("Refresh"))),Se.spamScore>Se.baseSpamScore-1&&a.createElement(M,null,X("Lower scores are better. Aim for a score less than ")+(Se.baseSpamScore-1)+".")),a.createElement(p.A,{style:{marginBottom:8}},a.createElement(g.A,{span:24},a.createElement(h.A,{itemLayout:"horizontal",dataSource:Se.report,renderItem:e=>a.createElement(h.A.Item,{style:{border:"none"}},a.createElement(h.A.Item.Meta,{title:a.createElement(a.Fragment,null,a.createElement(M,{style:{fontSize:"20px"}},e.score),a.createElement("span",{style:{marginLeft:"12px"}},e.description))}))}))))),Y.optimizeCheckCodeEnabled&&a.createElement(a.Fragment,null,a.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),a.createElement(p.A,{gutter:10,align:"middle"},a.createElement(g.A,{span:20},a.createElement("div",{className:"form-group-title"},X("Source code validation"))),a.createElement(g.A,{span:4,align:"right"},a.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>Me(G)},be===G?a.createElement(_.A,null):a.createElement(A.A,null)))),be===G&&a.createElement(a.Fragment,null,null!==oe&&void 0!==oe&&oe.length?a.createElement(p.A,{style:{marginBottom:8}},a.createElement(g.A,{span:24},a.createElement(h.A,{itemLayout:"horizontal",dataSource:oe,renderItem:e=>a.createElement(h.A.Item,{style:{border:"none"}},a.createElement(h.A.Item.Meta,{avatar:e.severity<6?a.createElement(k.A,{className:U}):a.createElement(k.A,{className:q}),title:a.createElement(M,{onClick:()=>(e=>{const t={startColumn:e.startColumn,startLineNumber:e.startLineNumber,endColumn:e.endColumn,endLineNumber:e.endLineNumber};Q((0,w.ps)(t))})(e),style:{cursor:"pointer"},className:e.severity<6?"warning":"error"},"Line: ",e.startLineNumber," ",e.startLineNumber!==e.endLineNumber&&" \u2013 "+e.endLineNumber),description:a.createElement(M,null,e.message)}))}))):a.createElement(p.A,{style:{marginBottom:24}},a.createElement(E.A,{message:X("No problems found."),type:"info"})))))}},56605:(e,t,o)=>{o.d(t,{A:()=>n});var a=o(98173),l=o(49856),i=o(98447),r=o(38826);const n=({small:e=!1,style:t,wrap:o=!1})=>{const n={width:e?"100%":"100vw",height:"80vh",display:"flex",justifyContent:"center",alignItems:"center",...t},s=a.createElement(r.A,{style:{fontSize:48},spin:!0});return a.createElement(l.A,{size:"large",style:n,wrap:o},a.createElement(i.A,{indicator:s}))}},49291:(e,t,o)=>{o.d(t,{A:()=>ee});var a=o(98173),l=o(30150),i=o(40512),r=o(63719),n=o(13785),s=o(38976),m=o(49856),d=o(37969),c=o(201),u=o(66964),p=o(93511),g=o(89715),b=o(6969),E=o(80320),h=o(2604),f=o(12543),v=o(26298),_=o.n(v),A=o(1753),y=o(66079),S=o(38927),k=o(23255),B=o(79245),w=o(1549),x=o(95331),P=o(63837),N=o(23424),T=o(84572),R=o(32947);const I=({title:e})=>{const{__:t}=(0,f.s9)();let o=(0,h.wA)();const{projectId:i}=(0,l.g)(),r=(0,h.d4)(N.cL),n=(0,h.d4)(T.yN);let s=[{label:t("Project settings"),key:"Project settings",className:"em-analytics__account-settings",icon:a.createElement(w.A,{style:{fontSize:"16px"}}),onClick:()=>{o((0,N.qf)(R.lx.EDIT_PROJECT_MODAL))}},{label:a.createElement(B.N_,{to:"/projects"},t("List of projects")),key:"List of projects",icon:a.createElement(x.A,{style:{fontSize:"16px"}}),className:"em-analytics__sign-out"}];const m=(null===n||void 0===n?void 0:n.title)||e;return(0,a.useEffect)((()=>{if(i){const e=document.querySelector(".header__project");null===e||void 0===e||e.setAttribute("data-project-id",i)}}),[i]),a.createElement(a.Fragment,null,a.createElement(S.A,{menu:{items:s},arrow:"true",overlayStyle:{minWidth:0},getPopupContainer:()=>document.querySelector("header")},a.createElement(B.N_,{to:"/projects/"+i+"/emails?page=1",className:"header__project"},a.createElement(k.A,{size:28,style:{backgroundColor:"#777",marginRight:8,fontWeight:700,fontSize:18,textTransform:"uppercase"}},null===m||void 0===m?void 0:m[0],null!==m&&void 0!==m&&m.split(" ")[1]?m.split(" ")[1][0]:""),m)),a.createElement(P.A,{isModalVisible:r===R.lx.EDIT_PROJECT_MODAL}))};var C=o(54880),L=o(98351),F=o(54838),O=o(22536),M=o(12741),D=o(62093),V=o(8111),j=o(98845),z=o(40277),W=o(52919),G=o(72762);const H=[50,50],U=[420,420],q=[45,10,45],X=[0,100,0],$=[50,420,50],Q="all 0.5s ease 0s",{Paragraph:K}=r.A,Y="code",J="view",Z=({email:e,viewMode:t="view",isLoggedIn:o})=>{const{__:r,_x:v}=(0,f.s9)(),S=(0,h.wA)(),k=(0,h.d4)(F.Fv),{emailId:B,blockId:w}=(0,l.g)(),x=(0,W.QC)(),[P,N]=(0,a.useState)(t),[T,Z]=(0,a.useState)(P===J?X:H),[ee,te]=(0,a.useState)(P===J?$:U),[oe,ae]=(0,a.useState)([]),[le,ie]=(0,a.useState)(!1),[re,ne]=(0,a.useState)(!1),se=(0,a.useRef)(null),me=(0,a.useRef)(),de=(0,a.useRef)(),ce=(0,a.useRef)(),ue=B||w,{data:pe=[],refetch:ge}=(0,V.Cf)(ue);(0,a.useEffect)((()=>{ue&&ge(ue)}),[P,ue,ge]),(0,G.f)(e);(0,D.A)((e=>{const t=e.data.operation,o=document.querySelector(".preview-mode__pane_editor")?document.getElementById("pane-content-iframe"):document.querySelector(".preview-mode__row > .preview-mode__col_preview");t===R.Ru.APPLICATION_SCROLL_TO&&setTimeout((()=>{o.scrollTo({top:e.data.settings.value,behavior:"smooth"})}),100),t===R.Ru.APPLICATION_IFRAME_SET_HEIGHT&&(document.querySelector(".preview-mode__iframe").style.height=e.data.settings.height+"px")}));const be=e=>{e.target.classList.contains("preview-mode__resizer")&&(me.current&&(me.current.style.transition="none"),de.current&&(de.current.style.transition="none"),ce.current&&(ce.current.style.transition="none"))},Ee=()=>{const e=P===J?Q:"none";me.current.style.transition!==Q&&(me.current&&(me.current.style.transition=e),de.current&&(de.current.style.transition=e),ce.current&&(ce.current.style.transition=e))};(0,a.useEffect)((()=>(document.addEventListener("mousedown",be),document.addEventListener("mouseup",Ee),()=>{document.removeEventListener("mousedown",be),document.removeEventListener("mouseup",Ee)}))),(0,a.useEffect)((()=>{const e=x.onInit((()=>{x.send({operation:R.Ru.SANDBOX_LOCK_EDIT,data:t===J}),x.send({operation:R.Ru.SANDBOX_LOCK_DISCUSS,value:le})}));return()=>e.dispose()}),[t,P,le,x]),(0,a.useEffect)((()=>{Z(P===J?X:H),te(P===J?$:U)}),[P]);const he=({key:e,domEvent:t})=>{switch(t.preventDefault(),me.current.style.transition=Q,de.current.style.transition=Q,ce.current.style.transition=Q,se.current.resize(),e){case"Desktop":default:Z(P===J?X:H);break;case"Mobile":Z(q)}setTimeout((()=>{x.send({operation:R.Ru.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:me.current.getBoundingClientRect().width}}),se.current.resize()}),550)};(0,a.useEffect)((()=>{const e=new z.jG;if(oe.length<2){var t,o;const a=null===(t=me.current)||void 0===t?void 0:t.getBoundingClientRect(),l=null===(o=document.getElementById("pane-content-iframe"))||void 0===o?void 0:o.getBoundingClientRect(),i=setInterval(n,50);ae((e=>[...e,i]));const r=t=>{e.addDisposable(x.onInit((()=>{x.send({operation:R.Ru.SANDBOX_WINDOW_CHARACTERISTIC,settings:t})})))};function n(){r({iframeOffsetTop:a.top-l.top,scrollTop:l.top?-l.top:0,innerHeight:window.innerHeight,previewHeight:document.querySelector(".preview-mode__pane-content").getBoundingClientRect().height,mode:Y})}}return e.addDispose((()=>clearInterval(oe[oe.length-1]))),()=>e.dispose()}),[oe,x]),(0,a.useEffect)((()=>{if(P===Y){const e=window.localStorage.getItem(R.V0.em_code_mode_pane_sizes);e&&Z(JSON.parse(e))}}),[P]);const fe=e=>{if(P===Y&&window.localStorage.setItem(R.V0.em_code_mode_pane_sizes,JSON.stringify(e)),P===J){const t=(e[2]+e[0])/2;Z([t,e[1],t])}else Z(e);x.send({operation:R.Ru.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:me.current.getBoundingClientRect().width}}),se.current.resize()},ve=()=>{se.current.resize()},_e=(0,a.useCallback)((()=>{e.hasOwnProperty("type")?S((0,O.vs)()):S((0,F.vs)())}),[S,e]);let Ae;const ye=()=>{var e,t;const o=null===(e=me.current)||void 0===e?void 0:e.getBoundingClientRect(),a=null===(t=document.getElementById("pane-content-iframe"))||void 0===t?void 0:t.getBoundingClientRect();Ae&&window.clearTimeout(Ae),Ae=window.setTimeout((function(){x.send({operation:R.Ru.SANDBOX_WINDOW_CHARACTERISTIC,settings:{iframeOffsetTop:o.top-a.top,scrollTop:document.getElementById("pane-content-iframe").scrollTop,innerHeight:window.innerHeight,previewHeight:document.querySelector(".preview-mode__pane-content").getBoundingClientRect().height,CODE:Y}})}),100)};(0,a.useEffect)((()=>(document.addEventListener("scroll",ye,!0),()=>{document.removeEventListener("scroll",ye,!0)})));const Se=()=>{ie((e=>!e)),x.send({operation:R.Ru.SANDBOX_LOCK_DISCUSS,value:!le})},ke=()=>{N(re?J:Y),ne((e=>!e))};let Be=[{key:R.yI,children:a.createElement("div",{className:"preview-mode__collapse-wrapper"})},{label:a.createElement(n.A,{placement:"right",title:v("Discuss","tab")},a.createElement(g.A,null),!!pe.length&&a.createElement("span",{className:"email-pane__comment-counter"},pe.filter((e=>"deleted"!==e.comment_status)).length)),key:R.hc,className:"preview-mode__tab-discuss em-analytics__email-tab-discuss",style:{overflow:"hidden"},children:a.createElement("div",{className:"email-pane__collapse-wrapper"},ue?a.createElement("div",{className:"ant-tabs-content discuss-wrapper"},a.createElement(C.A,{email:e,comments:pe,subjectId:ue,isLoggedIn:!0})):a.createElement("div",{className:"aside-content-wrapper"},e.hasOwnProperty("type")?a.createElement(s.A,{description:r("Save the block before commenting."),type:"info",showIcon:!0}):a.createElement(s.A,{description:r("Save the email before commenting."),type:"info",showIcon:!0})))}];return a.createElement("div",{className:_()("preview-mode",{"preview-mode_view":P===J})},a.createElement("div",{style:{display:"none"}},a.createElement(A.A,{email:e,readOnly:t===J})),a.createElement("div",{className:"preview-mode__header"},a.createElement("div",{className:"preview-mode__header__title"},a.createElement(I,{style:{float:"left",cursor:"none"},title:null===e||void 0===e?void 0:e.project_title}),a.createElement(K,{editable:k&&{icon:a.createElement(b.A,{className:"email-page-header__icon-edit"}),onChange:t=>{e.isNew?S((0,M.BQ)(t)):S(j.GY.util.updateQueryData("getEmail",e.id,(e=>{Object.assign(e,{title:t})})))}}},null===e.title?r("New email title"):e.title)),a.createElement("div",null,a.createElement("div",{className:"preview-mode__buttons"},a.createElement(m.A,{size:10},(o||k)&&a.createElement(n.A,{placement:"bottom",title:r("Close")},a.createElement(d.Ay,{className:"preview-mode__close-btn",onClick:k?_e:()=>{window.close(),window.location.href="/"}},a.createElement(E.A,null))))))),t!==Y&&a.createElement("div",{className:"preview-mode__wrapper"},a.createElement(c.A,{className:"preview-mode__row"},a.createElement(u.A,{xl:{span:le?6:0},lg:{span:le?6:0},md:{span:le?10:0},sm:{span:0},xs:{span:0},className:_()("preview-mode__col preview-mode__col_settings comment-block",{"preview-mode__col_settings-collapsed":!le,"preview-mode__col_code-mode":P===Y})},le&&a.createElement(p.A,{className:"preview-mode__col_settings-inner",size:"middle",animated:{inkBar:!1,tabPane:!0},activeKey:R.hc,onTabClick:Se,renderTabBar:(e,t)=>a.createElement(t,Object.assign({className:"preview-mode__tab-bar"},e)),tabPosition:"left",items:Be})),P===Y&&a.createElement(u.A,{xl:{span:le?18:24},lg:{span:le?18:24},md:{span:le?14:24},sm:{span:24},xs:{span:24},className:_()("preview-mode__col preview-mode__col_preview preview-mode__code-mode",{"preview-mode__col_preview-collapsed":!le})},!le&&a.createElement("div",{className:"preview-mode__content-col preview-mode__content-col_menu"},a.createElement("div",{className:"preview-mode__comments-icon-wrapper",onClick:Se},a.createElement(n.A,{placement:"right",title:v("Discuss","tab")},a.createElement(g.A,{style:{fontSize:"20px"}}),!!pe.length&&a.createElement("span",{className:"preview-mode__comment-counter"},pe.filter((e=>"deleted"!==e.comment_status)).length)))),a.createElement(i.A,{className:"preview-mode__panes",direction:"horizontal",gutterSize:0,snapOffset:0,sizes:T,minSize:ee,gutter:()=>(0,z.Dx)("preview-mode__panes-resizer"),onDragEnd:fe,onDrag:ve},a.createElement("div",{className:"preview-mode__pane preview-mode__pane_editor"},a.createElement("div",{className:"preview-mode__pane-content"},a.createElement(A.A,{email:e,readOnly:t===J}))),a.createElement("div",{className:"preview-mode__pane preview-mode__pane_main",ref:me},a.createElement("div",{className:"preview-mode__pane-content",id:"pane-content-iframe"},a.createElement("div",{className:"preview-mode__iframe-scroll-top",id:"iframe-scroll-top"}),a.createElement(y.A,{ref:se,email:e}),a.createElement("div",{className:"preview-mode__iframe-scroll-bottom",id:"iframe-scroll-bottom"})))),a.createElement("div",{className:"preview-mode__content-col preview-mode__content-col_menu preview-mode__content-col_menu-right"},a.createElement(L.A,{setSizes:he,sizes:[T[1]],codeModeShow:ke,codeModeIsVisible:re,email:e}))),P===J&&a.createElement(u.A,{xl:{span:le?18:24},lg:{span:le?18:24},md:{span:le?14:24},sm:{span:24},xs:{span:24},className:_()("preview-mode__col preview-mode__col_preview",{"preview-mode__col_preview-collapsed":!le})},a.createElement(i.A,{className:"preview-mode__content",sizes:T,minSize:$,snapOffset:0,gutter:()=>(0,z.Dx)("preview-mode__resizer"),onDragEnd:fe,onDrag:ve,expandToMin:!0,gutterAlign:"center",dragInterval:1},a.createElement("div",{className:"preview-mode__content-col preview-mode__content-col_menu",ref:de},!le&&a.createElement("div",{className:"element-preview-menu",style:{width:"100%"}},a.createElement("div",{className:"preview-mode__comments-icon-wrapper",onClick:Se},a.createElement(n.A,{placement:"right",title:v("Discuss","tab")},a.createElement(g.A,{style:{fontSize:"20px"}}),!!pe.length&&a.createElement("span",{className:"preview-mode__comment-counter"},pe.filter((e=>"deleted"!==e.comment_status)).length))))),a.createElement("div",{className:"preview-mode__content-col preview-mode__pane-content preview-mode__content-col_main",ref:me,id:"pane-content-iframe"},a.createElement("div",{className:"preview-mode__iframe-scroll-top",id:"iframe-scroll-top"}),a.createElement(y.A,{ref:se,className:"preview-mode__iframe",email:e,handlerSendPosition:ye}),a.createElement("div",{className:"preview-mode__iframe-scroll-bottom",id:"iframe-scroll-bottom"})),a.createElement("div",{className:"preview-mode__content-col preview-mode__content-col_menu preview-mode__content-col_menu-right",ref:ce},a.createElement(L.A,{setSizes:he,sizes:[T[1]],codeModeShow:ke,codeModeIsVisible:re,email:e})))))),a.createElement("div",{className:"preview-mode__footer"}))};Z.defaultProps={viewMode:Y,sendOptionsHandler:()=>{}};const ee=Z},97041:(e,t,o)=>{o.d(t,{A:()=>p});var a=o(98173),l=o(64909),i=o(30150),r=o(79245),n=o(13216),s=o(40277),m=o(96734),d=o(89613),c=o(32947);const u="emailmaker.ru",p=({children:e})=>{const t=(0,i.zy)(),o=(0,l.hN)(),p=(0,m.p)(),[g,b]=(0,r.ok)(),E=(0,d.u)(),[h,{isError:f,isSuccess:v,error:_,data:A}]=(0,n.i2)(),{isError:y,isUninitialized:S,isLoading:k,isSuccess:B,error:w,data:x,refetch:P}=(0,n.CR)("",{skip:c.EW.isPlugin||!p.get(c.A9.em_token)}),N=(0,a.useMemo)((()=>({email:g.get("email"),hash:g.get("hash"),event:"confirmation"===g.get("event")})),[g]);if((0,a.useEffect)((()=>{f?(0,s.p6)({error:_},o):v&&(E({event:"email_confirmation",user_email:null===A||void 0===A?void 0:A.email}),(0,s.wB)(A.message,o),x&&P())}),[A,_,f,v,o,x,P,E]),(0,a.useEffect)((()=>{!(N.email&&N.hash&&N.event)||!1!==(null===x||void 0===x?void 0:x.email_confirmation)&&p.get(c.A9.em_token)||A||h({hash:N.hash,email:N.email,event:N.event}).catch((e=>{})).finally((()=>b("")))}),[N,h,x,p,b,A]),(0,a.useEffect)((()=>{y&&w&&((0,s.p6)({error:w},o),(0,s.Id)(p))}),[x,y,w,o,p]),c.EW.isPlugin)return e;if(!c.EW.isPlugin&&!p.get(c.A9.em_token)&&!t.pathname.includes("auth"))return a.createElement(i.C5,{to:"/auth",state:{from:t}});if((S||k)&&!t.pathname.includes("auth"))return a.createElement(a.Fragment,null);if(y&&!t.pathname.includes("auth"))return a.createElement(i.C5,{to:"/auth",state:{from:t}});if(B){const{id:o,email:l,name:r,locale:n,carrotquest_hash:s,ducalis_hash:m,email_subscription_consent:d,last_used_project:g}=x;return p.set(c.A9.em_id,o,{domain:u}),p.set(c.A9.em_email,l,{domain:u}),p.set(c.A9.em_name,r,{domain:u}),p.set(c.A9.em_locale,n,{domain:u}),p.set(c.A9.em_carrotquest_hash,s,{domain:u}),p.set(c.A9.em_ducalis_hash,m,{domain:u}),p.set(c.A9.em_email_subscription_consent,d,{domain:u}),g&&"/"===t.pathname?a.createElement(i.C5,{to:`/projects/${g}/emails`,replace:!0}):e}return t.pathname.includes("auth")?e:void 0}},97790:(e,t,o)=>{o.d(t,{A:()=>w});var a=o(98173),l=o(47555),i=o(62913),r=o(13785),n=o(95856),s=o(95331),m=o(30150),d=o(79245),c=o(2604),u=o(12543),p=o(18931),g=o(79890),b=o(47113),E=o(19862),h=o(15812),f=o(22536),v=o(32947),_=o(54125),A=o(96734),y=o(40277),S=o(83027),k=o(23424);const{Content:B}=l.A,w=()=>{var e,t,o;const{__:w}=(0,u.s9)(),x=(0,c.wA)(),P=(0,A.p)(),N=P.get(v.A9.em_elements_view),{data:T}=(0,m.KC)(),[R]=(0,d.ok)(),I=(0,c.d4)(f.b9),C=(0,c.d4)(k.o8),L=R.get("folder"),F=+R.get("tag"),O=(0,y.HT)(T,v.YY),[M,D]=(0,a.useState)(L||(F?null:v.y2)),[V,j]=(0,a.useState)(F||null),[z,W]=(0,a.useState)(N||v.Y$),{data:G,refetch:H}=(0,S.Jz)({parent:null===(e=T.blockfolder)||void 0===e?void 0:e[0]},{skip:!(null!==(t=T.blockfolder)&&void 0!==t&&t[0])});(0,a.useEffect)((()=>{x((0,k.sB)(G||[]))}),[x,G]);const U=(e=!1,t=null)=>{j(t),D(e),x((0,f.om)({...I,tags:t?[t]:[],folderTag:e}))};(0,a.useEffect)((()=>{var e;F&&null!==O&&void 0!==O&&O.find((e=>e.id===F))&&(null===I||void 0===I||null===(e=I.tags)||void 0===e?void 0:e[0])!==V&&x((0,f.om)({...I,tags:[F],folderTag:M}))}),[O,F,V,x,I,M]);(0,_.A)(w("Blocks")+" "+T.title),(0,a.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const q=a.createElement(g.A,{isBlocks:!0}),X=a.createElement(a.Fragment,null,a.createElement(i.A,{defaultValue:z,onChange:e=>{W(e),x((0,h.NK)(e)),P.set(v.A9.em_elements_view,e)},value:z,key:"Switch radio",options:[{value:v.Y$,label:a.createElement(r.A,{title:w("Cards view"),placement:"top"},a.createElement(n.A,null))},{value:v.rl,label:a.createElement(r.A,{title:w("Table view"),placement:"top"},a.createElement(s.A,null))}]}));return a.createElement(l.A,{className:"project-blocks-page"},a.createElement(b.A,{leftBlock:q,rightBlock:X}),a.createElement(B,{className:"project-blocks-page__container"},a.createElement("div",{className:"project-blocks-page__content container"},a.createElement("div",{className:"project-blocks-page__menu-wrapper"},a.createElement(E.A,{currentFolderId:M,setCurrentFolderId:D,activeTagId:V,setActiveTagHandler:U,projectTags:O,folderTaxonomy:"blockfolder"})),a.createElement(p.A,{projectId:T.id,projectEmailsCounter:+(null===T||void 0===T||null===(o=T.counters)||void 0===o?void 0:o.blocks_counter),emailsView:z,currentFolderId:M,foldersList:C,refetchProjectFolders:C.length?H:()=>{},projectTags:O,activeTagId:V,setActiveTagHandler:U}))))}},14107:(e,t,o)=>{o.d(t,{A:()=>E});var a=o(98173),l=o(30150),i=o(2604),r=o(47555),n=o(72570),s=o(37969),m=o(12543),d=o(97032),c=o(84572),u=o(56605),p=o(40277),g=o(32947);const{Content:b}=r.A,E=()=>{var e;const{__:t}=(0,m.s9)(),{projectId:o}=(0,l.g)();let E=(0,l.Zp)(),h=(0,l.zy)();const f=(0,i.wA)(),v=(0,d.fo)(+o,{skip:!o}),{isLoading:_,isError:A,error:y,isSuccess:S,data:k}=v;return(0,a.useEffect)((()=>{S&&(null===k||void 0===k?void 0:k.id)!==o&&f((0,c.od)(k))}),[S,k,f,o]),(0,a.useEffect)((()=>{S&&o&&h.pathname.endsWith(o)&&E(`${h.pathname}/emails`)}),[S,h,E,o]),a.createElement(a.Fragment,null,_&&a.createElement(u.A,null),A&&y&&a.createElement(r.A,{className:"project-outlet"},a.createElement(b,{className:"project-outlet__container container"},a.createElement(n.Ay,{status:y.status,title:y.status,subTitle:null===(e=y.data)||void 0===e?void 0:e.message,extra:a.createElement(s.Ay,{type:"primary",onClick:()=>(0,p.XZ)(E,"/projects")},t("Back To Projects"))}))),(S||g.EW.isPlugin)&&a.createElement(l.sv,{context:{...v}}))}},29734:(e,t,o)=>{o.d(t,{A:()=>W});var a=o(98173),l=o(47555),i=o(62913),r=o(13785),n=o(37969),s=o(64909),m=o(95856),d=o(95331),c=o(73195),u=o(47459),p=o(30150),g=o(79245),b=o(2604),E=o(12543),h=o(47638),f=o(47091),v=o(79890),_=o(61736),A=o(56605),y=o(19862),S=o(47113),k=o(54838),B=o(79253),w=o(47014),x=o(23424),P=o(1047),N=o(13216),T=o(92960),R=o(98845),I=o(40835),C=o(83027),L=o(32947),F=o(54125),O=o(71854),M=o(30315),D=o(89613),V=o(40277),j=o(96734);o(65053);const{Content:z}=l.A,W=()=>{var e;const{__:t,_n:o}=(0,E.s9)(),W=(0,b.wA)(),G=(0,p.Zp)(),H=(0,j.p)(),U=(0,s.hN)();let q=(0,p.zy)();const X=(0,b.d4)(P.CT),$=(0,b.d4)(w.C1),Q=(0,b.d4)(k.cL),K=(0,b.d4)(x.o8),Y=(0,b.d4)(x.uM),[J]=(0,N.on)(),[Z]=(0,R.Kh)(),[ee]=(0,I.dS)(),[te]=(0,T.mI)(),[oe]=(0,g.ok)(),{data:ae}=(0,p.KC)(),le=(0,D.u)(),[ie,re]=(0,a.useState)(!1),ne=oe.get("folder"),se=(0,V.HT)(ae,L.zh),{data:me,refetch:de}=(0,C.Jz)({parent:null===ae||void 0===ae?void 0:ae.folder[0]},{skip:!(null!==ae&&void 0!==ae&&ae.folder[0])}),[ce,ue]=(0,a.useState)(ne||(Y?null:L.y2));(0,a.useEffect)((()=>{W((0,x.sB)(me||[]))}),[W,me]);const[pe,ge]=(0,a.useState)(H.get(L.A9.em_elements_view)||L.Y$);(0,F.A)(t("Emails")+" "+ae.title),(0,a.useEffect)((()=>{(null===$||void 0===$?void 0:$.last_used_project)!==ae.id&&W(N.Q2.endpoints.editMe.initiate({last_used_project:ae.id}))}),[W,ae.id,null===$||void 0===$?void 0:$.last_used_project]);const[be,Ee]=(0,a.useState)(null);const he=async e=>{if(1===e.length){const t=e[0];try{re(!0);const e=await(0,O.q2)(t,(async(e,t)=>{try{const o=await(0,O.zn)(e,te);if(!o)return"string"===typeof e?e:"";const a=(0,O.Qm)(t,o.type,h),l=new File([o],a.toLowerCase()),i=await ee({user_id:$.id,folder:ae.id,file:l});return(0,O.$K)(i,e)}catch(o){return"string"===typeof e?e:""}}),(e=>{e.title=e.title||(0,M.Ay)(t.name)[0]})),[o]=(0,M.Ay)(t.name),l=(0,V.ez)(e)||o||"";return Z({title:l,project:ae.id,subject:l,description:"",html:e,parent_email:L.iU,folder:ne!==L.y2?[+ne]:[]}).then((e=>{e&&(e.error?U.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:e.error.data.code}}),description:a.createElement("div",{dangerouslySetInnerHTML:{__html:e.error.data.message}}),placement:"bottomRight"}):(me&&de(),G(`/projects/${ae.id}/emails/${e.data.id}`),le({event:"upload_file",action:"import_email"})))})).finally((()=>re(!1)))}catch(l){re(!1);const e=l instanceof Error?l.message:l;U.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:e}}),placement:"bottomRight"})}}else{const l=[];re(!0);for(let o=0;o<e.length;o++){let i=e[o];const r=await(0,O.q2)(i,(async(e,t)=>{try{const o=await(0,O.zn)(e,te);if(!o)return"string"===typeof e?e:"";const a=(0,O.Qm)(t,o.type,h),l=new File([o],a.toLowerCase()),i=await ee({user_id:$.id,folder:ae.id,file:l});return(0,O.$K)(i,e)}catch(o){return"string"===typeof e?e:""}}),(e=>{e.title=e.title||(0,M.Ay)(i.name)[0]})),[n]=(0,M.Ay)(i.name),s=(0,V.ez)(r)||n||"",m=Z({title:s,project:ae.id,subject:s,description:"",html:r,parent_email:L.iU,folder:ne!==L.y2?[+ne]:[]}).then((e=>{if(e)return e.error?(U.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:e.error.data.code}}),description:a.createElement("div",{dangerouslySetInnerHTML:{__html:e.error.data.message}}),placement:"bottomRight"}),null):(U.success({message:t("The email \u201c")+e.data.title+t("\u201d was successfully imported."),placement:"bottomRight"}),e.data)})).catch((e=>{const t=e instanceof Error?e.message:e;return U.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:t}}),placement:"bottomRight"}),null}));l.push(m)}let i=await Promise.all(l);re(!1),i=i.filter((e=>!!e)),i.length&&U.success({message:i.length+o(" email was"," emails were",i.length)+t(" successfully imported."),placement:"bottomRight"}),be&&be.refetch()}},[fe,ve]=(0,a.useState)(!1);(0,a.useEffect)((()=>{!fe&&$.counters.emails_counter<3&&(J(),ve(!0))}),[J,$.counters.emails_counter,fe]),(0,a.useEffect)((()=>{document.body.classList.remove("editor"),H.remove(L.A9.em_folder)}),[W,H]);const _e=(e=!1,t=null)=>{W((0,x.Cj)(t)),ue(e),W((0,P.om)({...X,tags:t?[t]:[],folderTag:e}))},Ae=a.createElement(v.A,{isBlocks:!1}),ye=a.createElement(a.Fragment,null,a.createElement(i.A,{defaultValue:pe,onChange:e=>{H.set(L.A9.em_elements_view,e),ge(e),W((0,B.NK)(e))},value:pe,key:"Switch radio",options:[{value:L.Y$,label:a.createElement(r.A,{title:t("Cards view"),placement:"top"},a.createElement(m.A,null))},{value:L.rl,label:a.createElement(r.A,{title:t("Table view"),placement:"top"},a.createElement(d.A,null))}]}),a.createElement(r.A,{key:"Import email from file tooltip",title:t("Available formats: HTML, EML, ZIP"),placement:"top"},a.createElement(n.Ay,{key:"Import email from file",className:"em-analytics__project-page__import",type:"default",icon:a.createElement(c.A,null),onClick:()=>{le({event:"click",action:"import_email"}),(0,O.QM)("application/zip, message/rfc822, text/html",he)}},t("Import email"))),a.createElement(n.Ay,{key:"Create new email",className:"em-analytics__email-create",type:"primary",icon:a.createElement(u.A,null),onClick:()=>{W((0,P.om)({tags:[]})),H.set(L.A9.em_folder,"deleted"===ne?L.y2:ne),(0,V.XZ)(G,`${q.pathname}/create/`),le({event:"click",action:"create_new_email",description:"Go to the email template selection"})}},t("Create a new email")));return a.createElement(l.A,{className:"project-page"},a.createElement(S.A,{leftBlock:Ae,rightBlock:ye}),a.createElement(z,{className:"project-page__container"},a.createElement("div",{className:"project-page__content container"},a.createElement("div",{className:"project-page__menu-wrapper"},a.createElement(y.A,{currentFolderId:ce,setCurrentFolderId:ue,activeTagId:Y,setActiveTagHandler:_e,projectTags:se,folderTaxonomy:"folder"})),a.createElement(f.A,{projectId:ae.id,projectEmailsCounter:+(null===ae||void 0===ae||null===(e=ae.counters)||void 0===e?void 0:e.emails_counter),emailsView:pe,currentFolderId:ce,foldersList:K,refetchProjectFolders:K.length?de:()=>{},projectTags:se,activeTagId:Y,setActiveTagHandler:_e,registerFunction:Ee}))),ie&&a.createElement(A.A,{wrap:!0,style:{position:"fixed",width:"100%",height:"100%",top:0,left:0}}),a.createElement(_.A,{isModalVisible:Q===L.lx.ADD_NEW_EMAIL_MODAL}))}},53668:(e,t,o)=>{o.d(t,{A:()=>F});var a=o(98173),l=o(47555),i=o(37969),r=o(2604),n=o(12543),s=o(73631),m=o(71446),d=o(38927),c=o(59010),u=o(38976),p=o(83991),g=o(64909),b=o(40186),E=o(73773),h=o(1549),f=o(1096),v=o(71879),_=o(83612),A=o(30150),y=o(79245),S=o(63837),k=o(97032),B=o(23424),w=o(40277),x=o(32947);const P=(e,t)=>`${e.pathname.replace(/\/+$/,"")}/${t.id}/emails?page=1`,N=(e,t)=>`${e.pathname.replace(/\/+$/,"")}/${t.id}/members`,T=()=>{const{__:e,_x:t}=(0,n.s9)();let o=(0,r.d4)(B.vW),l=(0,A.zy)(),i=(0,r.wA)(),s=(0,r.d4)(B.cL);const{modal:T}=m.A.useApp(),R=(0,g.hN)(),{confirm:I}=T,C=(0,r.Pj)(),L=o=>{I({maskClosable:!0,centered:!0,title:t("Are you sure to delete \u201c","project")+o.title+e("\u201d project?"),icon:a.createElement(b.A,null),okText:e("Yes"),cancelText:e("No"),onOk:()=>(t=>C.dispatch(k.Nq.endpoints.deleteProject.initiate(t.id)).then((t=>{t.error?(0,w.p6)(t,R):t.data&&(0,w.wB)(e("The project \u201c")+t.data.title+e("\u201d was successfully removed."),R)})))(o)})},[F,O]=(0,a.useState)({page:1}),{isLoading:M,isSuccess:D,isError:V,isFetching:j,data:z=[]}=(0,k.su)(F),[W,G]=(0,a.useState)(null),H=[{width:"35%",title:e("Project"),dataIndex:"title",render:(e,t,o)=>a.createElement(y.N_,{to:P(l,t)},e)},{width:"16%",title:e("Owner"),dataIndex:["members","owner","nickname"],render:(e,t,o)=>e||t.members.owner.user_email},{width:"12%",title:t("Created","block"),dataIndex:"date",render:(t,o,a)=>(0,w.Yq)((0,_.A)(t),e),sorter:!0,sortOrder:(0,w.Np)(F.order)},{width:"10%",title:e("Emails"),dataIndex:"emails",sorter:!0,render:(e,t,o)=>null!==e&&void 0!==e&&e.length?null===e||void 0===e?void 0:e.length:"\u2013"},{width:"10%",title:e("Blocks"),dataIndex:"blocks",render:(e,t,o)=>null!==e&&void 0!==e&&e.length?null===e||void 0===e?void 0:e.length:"\u2013"},{width:"3%",title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(t,o)=>{let r=[];return r.push({label:a.createElement(y.N_,{to:P(l,o)},e("Open")),key:"Enter",icon:a.createElement(E.A,{style:{fontSize:"16px"}}),className:"em-analytics__open"},{label:e("Settings"),key:"Edit",icon:a.createElement(h.A,{style:{fontSize:"16px"}}),className:"em-analytics__edit",onClick:()=>(G(o),void i((0,B.qf)(x.lx.EDIT_PROJECT_MODAL)))},{label:a.createElement(y.N_,{to:N(l,o)},e("Members")),key:"Members",icon:a.createElement(f.A,{style:{fontSize:"16px"}}),className:"em-analytics__members"},{label:e("Remove"),key:"Remove",icon:a.createElement(b.A,{style:{fontSize:"16px"}}),className:"em-analytics__remove",style:{color:"#ff4d4f"},onClick:()=>L(o)}),a.createElement(d.A,{arrow:"true",placement:"bottom",menu:{items:r},trigger:["hover"]},a.createElement("span",{className:"projects-table__actions"},a.createElement(v.A,null)))}}];return a.createElement("div",{className:"container"},M&&a.createElement(c.A,{active:!0}),V&&a.createElement(u.A,{message:e("Error"),description:e("Error when receiving data. Try again (reload page) or contact support."),type:"error",showIcon:!0}),D&&0===z.length&&a.createElement(u.A,{message:e("You don't have any projects yet."),description:e("Click the Add a new project button to add your first project."),type:"info",showIcon:!0}),D&&z.length>0&&a.createElement(p.A,{rowKey:e=>e.id,dataSource:z,bordered:!0,columns:H,loading:j,onChange:(e,t,{order:o,field:a},{action:l})=>{"sort"===l&&O(o?{page:1,order:(0,w.gq)(o),orderby:a}:{page:1})},showSizeChanger:!1,pagination:{showSizeChanger:!1,hideOnSinglePage:!0,position:["bottomCenter"],current:F.page,total:o,onChange:(e,t)=>{O({page:e})}},className:"projects-table"}),a.createElement(S.A,{isModalVisible:s===x.lx.EDIT_PROJECT_MODAL,selectedProject:W}))};var R=o(47113),I=o(89613),C=o(54125);const{Content:L}=l.A,F=()=>{const{__:e}=(0,n.s9)(),t=(0,r.d4)(B.cL),o=(0,r.wA)(),m=(0,I.u)();(0,C.A)(e("Projects")),(0,a.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const d=a.createElement("div",{className:"ant-page-header-heading-title"},e("Projects")),c=a.createElement(i.Ay,{key:"Add a new project",className:"em-analytics__add-project",type:"primary",onClick:()=>{m({event:"open_modal",action:"create_new_project"}),o((0,B.qf)(x.lx.ADD_NEW_PROJECT_MODAL))}},e("Add a new project"));return a.createElement(l.A,{className:"projects-page"},a.createElement(R.A,{leftBlock:d,rightBlock:c}),a.createElement(L,{className:"projects-page__container"},a.createElement(T,null),a.createElement(s.A,{isModalVisible:t===x.lx.ADD_NEW_PROJECT_MODAL})))}},25864:(e,t,o)=>{o.d(t,{A:()=>k});var a=o(98173),l=o(51275),i=o(63719),r=o(27499),n=o(8218),s=o(37969),m=o(64909),d=o(10267),c=o(78446),u=o(27010),p=o(30150),g=o(79245),b=o(26298),E=o.n(b),h=o(12543),f=o(98119),v=o(32947),_=o(89613);const{Title:A,Text:y}=i.A,S=({className:e})=>{const{__:t}=(0,h.s9)();let o=(0,p.Zp)();const l=(0,m.hN)(),i=(0,_.u)(),[b,S]=(0,a.useState)(!1),k={name:"email",rules:[{required:!0,message:t("Please type your email address."),type:"email"}],placeholder:t("email"),prefix:a.createElement(d.A,{style:{color:v.VG}})},B={name:"password",rules:[{required:!0,message:t("Please type your password.")},()=>({validator:(e,o)=>o.length>=8&&/[0-9]/.test(o)&&/[a-z]/.test(o)&&/[A-Z]/.test(o)&&/\W+|_/g.test(o)?Promise.resolve():Promise.reject(new Error(t("The password is too simple.")))})],placeholder:t("password"),prefix:a.createElement(c.A,{style:{color:v.VG}})},w={name:"code",rules:[{required:!0,message:t("Please type your password confirmation code.")}],placeholder:t("confirmation code"),prefix:a.createElement(u.A,{style:{color:v.VG}})},[x,P]=(0,f.Lv)(),[N,T]=(0,f.kg)(),[R,I]=(0,a.useState)("");(0,a.useEffect)((()=>{P.isError&&l.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:P.error.data.code}}),description:a.createElement("div",{dangerouslySetInnerHTML:{__html:P.error.data.message}}),placement:"bottomRight"})}),[P,l]),(0,a.useEffect)((()=>{T.isError&&l.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:T.error.data.code}}),description:a.createElement("div",{dangerouslySetInnerHTML:{__html:T.error.data.message}}),placement:"bottomRight"}),T.isSuccess&&(l.success({message:t("Your password successfully reset."),description:t("Try sign in with your new password."),placement:"bottomRight"}),o("/auth",{replace:!0}))}),[T,o,t,l]);return a.createElement("div",{className:E()("recover-password-form",{[e]:e})},!P.isSuccess&&a.createElement(a.Fragment,null,a.createElement("div",{className:"recover-password-form__heading"},a.createElement(A,{level:2,style:{fontWeight:500,fontSize:24}},t("Forgot the password?")),a.createElement(y,{className:"recover-password-form__sub-title"},t("Enter your email address and we will send you password reset instructions."))),a.createElement(r.A,{name:"recover_password_form",initialValues:{remember:!0},onFinish:e=>{I(e.email),i({event:"submit_form",action:"password_recovery",label:e.email}),x({email:e.email})},onFinishFailed:()=>{},autoComplete:"off"},a.createElement(r.A.Item,{name:k.name,rules:k.rules},a.createElement(n.A,{size:"large",disabled:P.isLoading,placeholder:k.name,prefix:k.prefix})),a.createElement(r.A.Item,null,a.createElement(s.Ay,{size:"large",loading:P.isLoading,block:!0,type:"primary",htmlType:"submit",className:"em-analytics__password-reset"},t("Send"))),a.createElement(r.A.Item,null,a.createElement(g.N_,{to:"/auth"},t("Back to Log In"))))),P.isSuccess&&!T.isSuccess&&a.createElement(a.Fragment,null,a.createElement("div",{className:"recover-password-form__heading"},a.createElement(A,{level:2,style:{fontWeight:500,fontSize:24}},t("Set new password")),a.createElement(y,{className:"recover-password-form__sub-title"},t("Enter the confirmation code from the email and set a new password."))),a.createElement(r.A,{name:"set_new_password_form",initialValues:{remember:!0},onFinish:e=>{N({email:R,password:e.password,code:e.code})},onFinishFailed:()=>{},autoComplete:"off"},a.createElement(r.A.Item,{name:B.name,rules:B.rules,extra:t("At least 8 characters, including a combination of uppercase and lowercase letters, numbers, and special characters.")},a.createElement(n.A.Password,{readOnly:!b,onFocus:()=>S(!0),size:"large",type:"password",disabled:T.isLoading,placeholder:t("new password"),prefix:B.prefix})),a.createElement(r.A.Item,{name:w.name,rules:w.rules},a.createElement(n.A,{size:"large",disabled:T.isLoading,placeholder:w.placeholder,prefix:w.prefix})),a.createElement(r.A.Item,null,a.createElement(s.Ay,{size:"large",loading:T.isLoading,block:!0,type:"primary",htmlType:"submit"},t("Recover password"))),a.createElement(r.A.Item,null,a.createElement(g.N_,{to:"/auth"},t("Back to Log In"))))))},k=()=>a.createElement(l.A,{className:"recover-password-page"},a.createElement(S,{className:"recover-password-page__form"}))},14023:(e,t,o)=>{o.d(t,{A:()=>g});var a=o(98173),l=o(27499),i=o(48753),r=o(37969),n=o(8218),s=o(64909),m=o(2604),d=o(12543),c=o(83027),u=o(23424),p=o(32947);const g=({folder:e,refetch:t})=>{const{__:o,_x:g}=(0,d.s9)(),b=(0,m.wA)(),[E]=l.A.useForm(),h=(0,a.useRef)(null),f=(0,m.d4)(u.cL)===p.lx.EDIT_FOLDER_NAME_MODAL,v=(0,s.hN)(),{folderId:_=null,folderName:A=""}=e,y=()=>b((0,u.Oo)()),[S,k]=(0,c.$s)();(0,a.useEffect)((()=>{f&&E.setFieldsValue({name:A})}),[f,A,E]);const B=()=>{E.validateFields().then((({name:e})=>{S({id:_,data:{name:e}}).then((({data:e,error:l})=>{l?(v.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:l.data.code}}),description:a.createElement("div",{dangerouslySetInnerHTML:{__html:l.data.message}}),placement:"bottomRight"}),E.setFieldValue("name",A)):(t().then((({data:e})=>{if(e){var t,o,a;const l=null===(t=e[0])||void 0===t||null===(o=t.children)||void 0===o||null===(a=o.find((e=>e.id===_)))||void 0===a?void 0:a.name;E.setFieldValue("name",l)}})),y(),v.success({message:o("The folder \u201c")+A+g("\u201d was successfully changed to \u201c","folder")+e.name+o("\u201d."),placement:"bottomRight"}))}))}))};return a.createElement(i.A,{title:o("Change folder name"),open:f,onOk:B,onCancel:y,className:"new-folder-name-modal",centered:!0,footer:[a.createElement(r.Ay,{key:"submit",type:"primary",size:"large",loading:k.isLoading,onClick:B},o("Change name"))]},a.createElement(l.A,{form:E,layout:"vertical",name:"rename_folder_form",onFinish:B,initialValues:{remember:!1,name:A},autoComplete:"off",style:{paddingTop:10}},a.createElement(l.A.Item,{name:"name",rules:[{required:!0,message:o("Please enter the folder name")}]},a.createElement(n.A,{disabled:k.isLoading,size:"large",placeholder:o("Enter the folder name"),ref:h,style:{marginBottom:5}}))))}},15737:(e,t,o)=>{o.d(t,{A:()=>g});var a=o(98173),l=o(27499),i=o(48753),r=o(37969),n=o(8218),s=o(64909),m=o(2604),d=o(12543),c=o(83027),u=o(23424),p=o(32947);const g=({group:e,refetch:t})=>{const{__:o,_x:g}=(0,d.s9)(),b=(0,m.wA)(),[E]=l.A.useForm(),h=(0,a.useRef)(null),f=(0,m.d4)(u.cL)===p.lx.EDIT_GROUP_NAME_MODAL,v=(0,s.hN)(),{id:_=null,name:A=""}=e,y=()=>b((0,u.Oo)()),[S,k]=(0,c.CE)();(0,a.useEffect)((()=>{f&&E.setFieldsValue({name:A})}),[f,A,E]);const B=()=>{E.validateFields().then((({name:e})=>{S({id:_,data:{name:e}}).then((({data:l,error:i})=>{i?(v.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:i.data.code}}),description:a.createElement("div",{dangerouslySetInnerHTML:{__html:i.data.message}}),placement:"bottomRight"}),E.setFieldValue("name",e)):(t().then((({data:e})=>{if(e){var t,o,a;const l=null===(t=e[0])||void 0===t||null===(o=t.children)||void 0===o||null===(a=o.find((e=>e.id===_)))||void 0===a?void 0:a.name;E.setFieldValue("name",l)}})),y(),v.success({message:o("The group \u201c")+e+g("\u201d was successfully changed to \u201c","group")+l.name+o("\u201d."),placement:"bottomRight"}))}))}))};return a.createElement(i.A,{title:o("Change group name"),open:f,onOk:B,onCancel:y,className:"new-group-name-modal",centered:!0,footer:[a.createElement(r.Ay,{key:"submit",type:"primary",size:"large",loading:k.isLoading,onClick:B},o("Change name"))]},a.createElement(l.A,{form:E,layout:"vertical",name:"rename_group_form",onFinish:B,initialValues:{remember:!1,name:A},autoComplete:"off",style:{paddingTop:10}},a.createElement(l.A.Item,{name:"name",rules:[{required:!0,message:o("Please enter the group name")}]},a.createElement(n.A,{disabled:k.isLoading,size:"large",placeholder:o("Enter the group name"),ref:h,style:{marginBottom:5}}))))}},95942:(e,t,o)=>{o.d(t,{A:()=>u});var a=o(98173),l=o(37969),i=o(2604),r=o(71446),n=o(94160),s=o(47014),m=o(8807),d=o(40277),c=o(12543);const u=()=>{const{__:e}=(0,c.s9)(),{notification:t}=r.A.useApp(),o=(0,i.d4)(s.C1),[u]=(0,n.C)(),[p,g]=(0,a.useState)(!1);(0,a.useEffect)((()=>{o.hasOwnProperty("email_confirmation")&&g(o.email_confirmation)}),[o,p]);return null!==o&&void 0!==o&&o.email_confirmation||null===o||void 0===o||!o.privacy_policy_agreement?null:a.createElement("div",{className:"main__ribbon"},a.createElement("span",null,a.createElement(m.A,{icon:"EmailConfirmation",style:{fontSize:20,position:"relative",top:2}})," ",e("Confirmation email was sent to"),"\xa0",a.createElement("em",null,o.email),".\xa0",e("Didn't receive an email?"),"\xa0",a.createElement(l.Ay,{type:"primary",size:"small",style:{fontSize:16,lineHeight:1},onClick:()=>{u({userId:o.id,email:o.email}).then((({data:a,error:l})=>{a?(0,d.wB)(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",o.email),t):l&&(0,d.p6)(l,t)}))}},e("Resend")," ",a.createElement(m.A,{icon:"SendOutlined",style:{verticalAlign:"middle"}}))))}},40409:(e,t,o)=>{o.d(t,{A:()=>S});var a=o(98173),l=o(80703),i=o(13785),r=o(37969),n=o(64909),s=o(30150),m=o(2604),d=o(12543),c=o(52218),u=o.n(c),p=o(5618),g=o(97032),b=o(83027),E=o(62093),h=o(22536),f=o(40277),v=o(89613),_=o(86095),A=o(32947);const y=({block:e,isEditableRights:t,rightCol:o,autoSaveBlockResult:c})=>{const{__:y}=(0,d.s9)(),{projectId:S,blockId:k}=(0,s.g)();let B=(0,m.d4)(h.Fv),w=(0,m.d4)(h.Fv),x=(0,m.wA)();const P=(0,n.hN)(),N=(0,_.fn)(),T=(0,m.Pj)(),[R,I]=(0,a.useState)(!1),[C,L]=(0,a.useState)(null),[F,O]=(0,a.useState)(!1),[M,D]=(0,a.useState)(!1),V=(0,v.u)();(0,a.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&L(!0)}),[]);const{data:j,refetch:z}=(0,g.fo)(+S,{skip:!+S}),[W]=(0,p.Gr)(),[G,H]=(0,p.OZ)(),[U,q]=(0,p.pP)(),[X]=(0,g.OD)(),$=`project_${S}`,Q=j&&(0,f._q)(j,A.YY).find((e=>e.name===$)),K=j&&(0,f.HT)(j,A.YY),Y=(0,a.useCallback)((o=>{var a,l;if(O(!0),!t&&e.lock&&M)return P.error({id:"BLOCK_ACCESS_TO_LOCKED_ERROR",message:y("No access to edit the letter."),placement:"bottomRight",data:(0,n.x_)(e)}),void O(!1);if(((null===(a=e.tags)||void 0===a?void 0:a.length)||(null===(l=e.blocktags)||void 0===l?void 0:l.length))>10&&M)return P.error({id:"BLOCK_TOO_MANY_TAGS_ERROR",message:y("Maximum 10 tags available."),placement:"bottomRight",data:(0,n.x_)(e)}),void O(!1);if(""===e.type)return P.error({message:y("Set the type"),description:y("Please set the 'Type' field in the Settings section."),placement:"bottomRight"}),void O(!1);const i=t=>{var a;const l=null===(a=e.tags)||void 0===a?void 0:a.map((e=>{const o=null===K||void 0===K?void 0:K.find((t=>t.name===e));return o?o.id:W({name:e,parent:t}).then((({error:t,data:o})=>{var a,l;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(a=t.data)||void 0===a||null===(l=a.data)||void 0===l?void 0:l.term_id:o?o.id:void(t&&(P.fromError("TAG_CREATING_ERROR",e,t),O(!1)))}))})),i=(a=null)=>{const l=o=>{T.dispatch(b.kE.endpoints.getTags.initiate({parent:t})),z(),M&&(P.success({id:"BLOCK_EDITING_SUCCESS",message:y("The block was successfully saved.","block"),data:(0,n.x_)(e)}),O(!1)),fetch(((e,t,o,a)=>`https://scr.emcdn.ru/screenshot?delay=1000&width=800&fullPage=true&deviceScaleFactor=0.8&format=jpg&clearCache=true${a?`&cacheControl=true&cache-hash=${u()(a)}`:""}&url=${encodeURIComponent(`https://dev-backend-1.emailmaker.ru/get${e}/${o}?secret_hash=${u()(`${t}${o}${A.KI}`)}&raw=true`)}`)(A.IE,S,o.id,o.modified),{mode:"no-cors"}).then((()=>{}))},i=(0,f._q)(e,A.zh).filter((t=>(a||e.blocktags).includes(t.id))).map((e=>e.name));e.isNew?q.status!==A.eG&&U({source:o,title:null===e.title?y("New block title"):e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===N||void 0===N?void 0:N.getValue())||"",blocktags:a?a.join(","):e.blocktags,tags:i}).then((({data:t,error:o})=>{o?(P.fromError("BLOCK_CREATING_ERROR",{title:e.title,html:(null===N||void 0===N?void 0:N.getValue())||""},o),O(!1)):l(t)})):H.status!==A.eG&&G({blockId:e.id,source:o,title:e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===N||void 0===N?void 0:N.getValue())||"",blocktags:a||e.blocktags,tags:i}).then((({data:t,error:o})=>{o&&M?(P.fromError("BLOCK_EDITING_ERROR",(0,n.x_)(e),o),O(!1)):l(t)}))};l?Promise.all(l).then((e=>i(e))):i(null)};O(!0),Q?i(Q.id):W({name:$}).then((async({data:t,error:o})=>{if(o)P.fromError("FOLDER_CREATING_ERROR",$,o),O(!1);else{const{data:o,error:a}=await X({projectId:S,blocktags:t.id});a?(P.fromError("BLOCK_CLONING_ERROR",(0,n.x_)(e),a),O(!1)):o&&i(o.blocktags&&o.blocktags[0])}})).catch((e=>{}))}),[q.status,U,H.status,G,e,t,W,X,S,y,M,N,P,K,z,T,Q,$]);(0,a.useEffect)((()=>{M&&(Y(),D(!1))}),[M,Y]);const J=(0,a.useCallback)((e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),D(!0))}),[]);(0,a.useEffect)((()=>(document.addEventListener("keydown",J),()=>{document.removeEventListener("keydown",J)})),[J]);const Z=(0,a.useCallback)((e=>{const t=e.data.operation,o=e.data.action;t===A.Ru.APPLICATION_ACTION&&"save_email"===o&&D(!0)}),[]);return(0,E.A)(Z),(0,a.useEffect)((()=>{q.isError&&(O(!1),(0,f.p6)(q,P))}),[x,q,P]),(0,a.useEffect)((()=>{const e=setTimeout((()=>{I(!0)}),1e4);return()=>{clearTimeout(e)}}),[]),(0,a.useEffect)((()=>{e.isNew&&!k&&R&&(Y(),I(!1))}),[R,e,Y,k]),a.createElement(i.A,{title:y(C?"Save by \u2318S":"Save by Ctrl+S"),placement:o?"right":"bottomRight"},a.createElement(r.Ay,{type:"primary",block:o,className:"em-analytics__block-save",icon:a.createElement(l.A,null),onClick:()=>{V({event:"click",action:"save_block"}),D(!0)},loading:H.isLoading||X.isLoading||q.isLoading||F||c},o||B||w?"":y("Save")))};y.defaultProps={block:null};const S=y},45887:(e,t,o)=>{o.d(t,{Ay:()=>L,QG:()=>I,Wv:()=>R});var a=o(98173),l=o(13785),i=o(37969),r=o(49856),n=o(64909),s=o(80703),m=o(30150),d=o(2604),c=o(52218),u=o.n(c),p=o(12543),g=o(98845),b=o(97032),E=o(83027),h=o(62093),f=o(12741),v=o(1047),_=o(40277),A=o(27941),y=o(89613),S=o(86095),k=o(90121),B=o(90614),w=o(96734),x=o(32947),P=o(15626),N=o(13668);const T="KEYBOARD",R=(e,t,o,a,l=!0,i=.8,r)=>`${window.location.host.indexOf("localhost"),"https://scr.emcdn.ru"}/screenshot?delay=1000&width=800${r?"":"&fullPage=true"}&deviceScaleFactor=${i}&format=jpg&clearCache=${l}${a?`&cacheControl=true&cache-hash=${u()(a)}`:""}&url=${encodeURIComponent(`https://app.emailmaker.ru/get${e}/${o}?secret_hash=${u()(`${t}${o}${x.KI}`)}&raw=true`)}${r?`&selector=${r}`:""}`,I=(e,t,o=!0,a=.8,l)=>{let i=`https://racs.rest/v3/file/${e}?resource=exportPngApi`;return`${window.location.host.indexOf("localhost"),"https://scr.emcdn.ru"}/screenshot?delay=1000&width=800${l?"":"&fullPage=true"}&deviceScaleFactor=${a}&format=jpg&clearCache=${o}${t?`&cacheControl=true&cache-hash=${u()(t)}`:""}&url=${encodeURIComponent(`${i}`)}${l?`&selector=${l}`:""}`},C=({email:e,isEditableRights:t,autoSaveEmailResult:o,disabled:c})=>{var u,I;let C=(0,d.wA)(),L=(0,m.Zp)();const{__:F,_x:O}=(0,p.s9)(),{projectId:M,emailId:D}=(0,m.g)(),V=(0,w.p)(),j=(0,n.hN)(),z=(0,A.rD)(),W=(0,S.fn)(),G=(0,d.Pj)(),H=(0,d.d4)(v.rY),U=(0,d.d4)(v.UI),[q,X]=(0,a.useState)(!1),[$,Q]=(0,a.useState)(null);(0,a.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&Q(!0)}),[]);const{data:K,refetch:Y}=(0,b.fo)(+M,{skip:!+M}),{data:J,refetch:Z}=(0,E.Jz)({parent:null===K||void 0===K||null===(u=K.folder)||void 0===u?void 0:u[0]},{skip:!x.EW.isPlugin||!(null!==K&&void 0!==K&&null!==(I=K.folder)&&void 0!==I&&I[0])}),[ee]=(0,g.Gr)(),[te]=(0,E.JI)(),[oe,ae]=(0,g.dN)(),[le,ie]=(0,g.Kh)(),[re]=(0,b.OD)(),[ne,se]=(0,a.useState)(!1),[me,de]=(0,a.useState)(""),ce=`project_${M}`,ue=K&&(0,_._q)(K,x.zh).find((e=>e.name===ce)),pe=K&&(0,_.HT)(K,x.zh),ge=(0,B.ml)(P.AZ.BEFORE_SAVE_EMAIL),be=(0,y.u)(),Ee=(0,a.useCallback)((o=>{var a,l;if(!t&&e.lock&&me)return void j.error({id:"EMAIL_ACCESS_TO_LOCKED_ERROR",data:(0,n.Gy)(e),message:F("No access to edit the letter."),placement:"bottomRight"});if(((null===e||void 0===e||null===(a=e.tags)||void 0===a?void 0:a.length)||(null===(l=e.emailtags)||void 0===l?void 0:l.length))>10&&me)return void j.error({id:"EMAIL_TOO_MANY_TAGS_ERROR",data:(0,n.Gy)(e),message:F("Maximum 10 tags available."),placement:"bottomRight"});const i=async t=>{var a;const l=Object.entries(H).flatMap((([e,t])=>t.map((({value:t,label:o})=>({id:+t,name:o,parent:+e.split("_")[0]})))));let i=[];U.length&&U.forEach((e=>{i.push(...null===e||void 0===e?void 0:e.children.map((e=>({id:e.id,parentId:e.parent}))))}));const r=(null===(a=e.tags)||void 0===a?void 0:a.map((e=>{const o=null===pe||void 0===pe?void 0:pe.find((t=>t.name===e));return o?o.id:ee({name:e,parent:t}).then((({error:t,data:o})=>{var a,l;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(a=t.data)||void 0===a||null===(l=a.data)||void 0===l?void 0:l.term_id:o?o.id:void(t&&(j.fromError("TAG_CREATING_ERROR",e,t),se(!1)))}))})))||[],s=(null===l||void 0===l?void 0:l.map((e=>{const t=null===i||void 0===i?void 0:i.find((t=>t.id===e.id));return t?t.id:te({name:e.name,parent:e.parent}).then((({error:t,data:o})=>{var a,l;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(a=t.data)||void 0===a||null===(l=a.data)||void 0===l?void 0:l.term_id:o?o.id:void(t&&(j.fromError("GROUP_CREATING_ERROR",e,t),se(!1)))}))})))||[],m=(e,a=null,l=null,i=[])=>{var r,s;const m=(null===(r=e.title)||void 0===r?void 0:r.trim())||(null===(s=e.subject)||void 0===s?void 0:s.trim())||F("Untitled email."),d=o=>{G.dispatch(E.kE.endpoints.getTags.initiate({parent:t})),!x.EW.isPlugin&&Y&&Y(),me&&(j.success({id:"EMAIL_SAVING_SUCCESS",message:F("The email was successfully saved."),data:(0,n.Gy)(e)}),se(!1),!x.EW.isPlugin&&J&&Z()),x.EW.isPlugin||fetch(R(x.Tm,M,o.id,o.modified),{mode:"no-cors"}).then((()=>{}))},c=(0,_._q)(e,x.zh).filter((t=>(a||e.emailtags).includes(t.id))).map((e=>e.name));var u,p,g,b,h;if(e.isNew){if(ie.status!==x.eG){const t=V.get(x.A9.em_folder);le({title:m,source:o,project:e.project,subject:e.subject,preheader:e.preheader,description:e.description,utm_parameters:{utm_source:e.utm_parameters.utm_source,utm_medium:e.utm_parameters.utm_medium,utm_campaign:e.utm_parameters.utm_campaign,utm_term:e.utm_parameters.utm_term,utm_content:e.utm_parameters.utm_content},html:(null===W||void 0===W?void 0:W.getValue())||"",parent_email:e.parent_email||x.iU,common_styles:e.common_styles||"",emailtags:a?a.join(","):e.emailtags,tags:c,group:l||e.group,is_template:e.is_template||!1,is_inited:e.is_inited,renderGuid:e.renderGuid,folder:t!==x.y2&&t}).then((({data:t,error:o})=>{o?(me&&j.fromError("EMAIL_CREATING_ERROR",{title:e.title,code:(null===W||void 0===W?void 0:W.getValue())||""},o),se(!1)):(C((0,f.aY)(null)),d(t),V.remove(x.A9.em_folder))}))}}else ae.status!==x.eG&&oe({emailId:e.id,source:o,title:m,project:e.project,preheader:e.preheader,subject:e.subject,utm_parameters:{utm_source:null===(u=e.utm_parameters)||void 0===u?void 0:u.utm_source,utm_medium:null===(p=e.utm_parameters)||void 0===p?void 0:p.utm_medium,utm_campaign:null===(g=e.utm_parameters)||void 0===g?void 0:g.utm_campaign,utm_term:null===(b=e.utm_parameters)||void 0===b?void 0:b.utm_term,utm_content:null===(h=e.utm_parameters)||void 0===h?void 0:h.utm_content},description:e.description,html:(null===W||void 0===W?void 0:W.getValue())||"",common_styles:e.common_styles||"",emailtags:a||e.emailtags,tags:c,group:l||e.group,is_template:e.is_template||!1}).then((({error:t})=>{t?(me&&j.fromError("EMAIL_EDITING_ERROR",(0,n.Gy)(e),t),se(!1)):d(e)}));be({event:"save",action:o?"save_email":"auto_save_email",email_id:e.id,project_id:M})},d={...e};ge.fire(d).finally((()=>{r.length||s.length?Promise.all(r).then((e=>{Promise.all(s).then((t=>{m(d,e,t,[])}))})):m(d,null,null,[])}))};se(!0),ue?i(ue.id):ee({name:ce}).then((async({data:t,error:o})=>{if(o)j.fromError("FOLDER_CREATING_ERROR",ce,o),se(!1);else{const{data:o,error:a}=await re({projectId:M,emailtags:t.id});a?(j.fromError("EMAIL_CLONING_ERROR",(0,n.Gy)(e),a),se(!1)):o&&i(o.emailtags&&o.emailtags[0])}})).catch((e=>{}))}),[ie.status,le,ae.status,oe,e,t,ee,C,re,M,K,F,O,me,W,pe,ge]);(0,k.D3)(N.Kp,(0,a.useCallback)((e=>Ee(e||"EXTERNAL")),[Ee]));const he=(0,B.ml)(P.AZ.ON_NEXTBUTTON_CLICK_ID),fe=(0,B.ml)(P.AZ.ON_SAVEBUTTON_CLICK_ID);(0,a.useEffect)((()=>{me&&(setTimeout((()=>Ee(me))),de(""))}),[me]);const ve=(0,a.useCallback)((e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),de(T))}),[Ee]);(0,a.useEffect)((()=>(document.addEventListener("keydown",ve),()=>{document.removeEventListener("keydown",ve)})),[ve]);const _e=(0,a.useCallback)((e=>{const t=e.data.operation,o=e.data.action;t===x.Ru.APPLICATION_ACTION&&"save_email"===o&&de(T)}),[Ee]);(0,h.A)(_e),(0,a.useEffect)((()=>{e.isNew&&ie.isSuccess&&(se(!0),C(g.GY.util.upsertQueryData("getEmail",ie.data.id,{...ie.data,lock:e.lock,isAmp:e.isAmp,subject:e.subject,preheader:e.preheader,description:e.description,html:(null===W||void 0===W?void 0:W.getValue())||"",project:e.project,tags:e.tags,utm_parameters:e.utm_parameters,parent_email:e.parent_email,common_styles:e.common_styles,renderGuid:e.renderGuid,is_inited:e.is_inited,isNew:!1})).then((()=>{L(`/projects/${ie.data.project}/emails/${ie.data.id}`),se(!1),me&&j.success({id:"EMAIL_SAVING_SUCCESS",message:F("The email was successfully saved."),data:(0,n.Gy)(e)})})))}),[L,C,ie,e.isNew,F,O,me,W]);const Ae=(0,B._q)(P.AZ.ON_EMAIL_INIT_ID);(0,a.useEffect)((()=>{let e=0;const t=Ae((()=>{e=setTimeout((()=>X(!0)),1e4)}));return()=>{e&&clearTimeout(e),t.dispose()}}),[X,Ae]),(0,a.useEffect)((()=>{e.isNew&&!D&&q&&(Ee(),X(!1))}),[q,e,Ee,D]);const ye=ae.isLoading||(null===re||void 0===re?void 0:re.isLoading)||ie.isLoading||ne||o&&o.isLoading,Se=z.saveButtonEnabled&&a.createElement(l.A,{key:"save-button",title:F($?"Save by \u2318S":"Save by Ctrl+S"),placement:"bottom"},a.createElement(i.Ay,{disabled:c,type:z.nextButtonEnabled?"default":"primary",block:"false",className:"em-analytics__email-save",loading:ye,icon:a.createElement(s.A,null),onClick:async()=>{const t={...e,html:W.getValue()};try{!1!==await fe.fire(t)&&de("SAVE_BUTTON")}catch(o){j.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",(0,n.Gy)(t),o,!0)}}},z.saveButtonText||F("Save"))),ke=z.nextButtonEnabled&&a.createElement(i.Ay,{disabled:c,key:"next-button",type:"primary",block:"false",className:"em-analytics__email-save",icon:z.primaryCommandButtonIcon,loading:ye,onClick:async()=>{const t={...e,html:W.getValue()};try{!1!==await he.fire(t)&&de("NEXT_BUTTON")}catch(o){j.fromError("NEXT_BUTTON_CLICK_EVENT_ERROR",(0,n.Gy)(t),o,!0)}}},z.nextButtonText||F("Continue"));return a.createElement(a.Fragment,null,z.saveButtonEnabled&&z.nextButtonEnabled?a.createElement(r.A,null,[Se,ke]):[Se,ke])};C.defaultProps={email:null,isEditableRights:null};const L=C},11399:(e,t,o)=>{o.d(t,{A:()=>E});var a=o(98173),l=o(27499),i=o(50483),r=o(49856),n=o(13785),s=o(60994),m=o(2922),d=o(81149),c=o(12543),u=o(32947),p=o(8807),g=o(52919);const b=({form:e,elementSettings:t,imgParent:o,name:b="align",setAlignStateHandle:E=e=>{},withHotKeys:h=!0})=>{const{__:f}=(0,c.s9)(),v=(0,g.XW)(),[_,A]=(0,a.useState)(t[b]),[y,S]=(0,a.useState)(null);(0,a.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&S(!0)}),[]);const k=o=>{const a=o.target.value;E(a);const l={[b]:""};a!==_?A(a):(A(""),e.setFieldsValue(l),v({operation:u.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:l}))};return a.createElement(l.A.Item,{name:b},a.createElement(i.Ay.Group,{disabled:o&&!t.parent},a.createElement(r.A,{size:8},a.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align left ( \u2318+Shift+L )":"Text align left ( Ctrl+Shift+L )":"Text align left")},a.createElement(i.Ay.Button,{value:"left",onClick:k},a.createElement(s.A,null))),a.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align center ( \u2318+Shift+E )":"Text align center ( Ctrl+Shift+E )":"Text align center")},a.createElement(i.Ay.Button,{value:"center",onClick:k},a.createElement(m.A,null))),a.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align right ( \u2318+Shift+R )":"Text align right ( Ctrl+Shift+R )":"Text align right")},a.createElement(i.Ay.Button,{value:"right",onClick:k},a.createElement(d.A,null))),a.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align justify ( \u2318+Shift+J )":"Text align justify ( Ctrl+Shift+J )":"Text align justify")},a.createElement(i.Ay.Button,{value:"justify",onClick:k},a.createElement(p.A,{icon:"Justify"}))))))};b.defaultProps={imgParent:!1};const E=b},23863:(e,t,o)=>{o.d(t,{A:()=>P});var a=o(98173),l=o(40120),i=o(201),r=o(66964),n=o(27499),s=o(42490),m=o(50483),d=o(49856),c=o(13785),u=o(80320),p=o(17216),g=o(82984),b=o(85372),E=o(8239),h=o(91916),f=o(48947),v=o(51157),_=o(42734),A=o(26298),y=o.n(A),S=o(12543),k=o(2604),B=o(77637),w=o(1047);const{useToken:x}=l.A,P=({borders:e,namePrefix:t=""})=>{const o=(0,k.d4)(w.uJ),{__:l,_x:A}=(0,S.s9)(),P=e=>(null===e||void 0===e?void 0:e.width)||(null===e||void 0===e?void 0:e.style)||(null===e||void 0===e?void 0:e.color),{token:N}=x();return a.createElement(i.A,{gutter:30},a.createElement(r.A,{span:12,className:"selected-td-form__border-col"},a.createElement(n.A.Item,{name:t+"borderColor",className:"form-item-margin-xs"},a.createElement(B.A,{placeholder:l("Color"),usedColors:o.usedColors})),a.createElement(n.A.Item,{name:t+"borderWidth",className:"form-item-margin-xs"},a.createElement(s.A,{min:0,placeholder:A("Width","border"),addonAfter:"px"})),a.createElement(n.A.Item,{name:t+"borderStyle",className:"form-item-margin-xs"},a.createElement(m.Ay.Group,null,a.createElement(d.A,{size:8},a.createElement(c.A,{placement:"bottom",title:l("None")},a.createElement(m.Ay.Button,{value:""},a.createElement(u.A,null))),a.createElement(c.A,{placement:"bottom",title:l("Solid")},a.createElement(m.Ay.Button,{value:"solid"},a.createElement(p.A,null))),a.createElement(c.A,{placement:"bottom",title:l("Dashed")},a.createElement(m.Ay.Button,{value:"dashed"},a.createElement(g.A,null))),a.createElement(c.A,{placement:"bottom",title:l("Dotted")},a.createElement(m.Ay.Button,{value:"dotted"},a.createElement(b.A,null))))))),a.createElement(r.A,{span:12,style:{textAlign:"center"}},a.createElement(n.A.Item,{label:"",name:t+"borderPosition",labelCol:{span:8}},a.createElement(m.Ay.Group,null,a.createElement(d.A,{size:N.formItemMarginBottomXS,direction:"vertical"},a.createElement(i.A,null,a.createElement(c.A,{placement:"top",title:l("Above")},a.createElement(m.Ay.Button,{value:"top",style:{margin:"auto"},className:y()("",{"selected-td-form__border-radio":P(null===e||void 0===e?void 0:e.top)})},a.createElement(E.A,null)))),a.createElement(i.A,null,a.createElement(d.A,{size:N.formItemMarginBottomXS},a.createElement(c.A,{placement:"left",title:l("On the left")},a.createElement(m.Ay.Button,{value:"left",className:y()("",{"selected-td-form__border-radio":P(null===e||void 0===e?void 0:e.left)})},a.createElement(h.A,null))),a.createElement(c.A,{placement:"top",title:l("Around")},a.createElement(m.Ay.Button,{value:"all",className:y()("",{"selected-td-form__border-radio":P(null===e||void 0===e?void 0:e.all)})},a.createElement(f.A,null))),a.createElement(c.A,{placement:"right",title:l("On the right")},a.createElement(m.Ay.Button,{value:"right",className:y()("",{"selected-td-form__border-radio":P(null===e||void 0===e?void 0:e.right)})},a.createElement(v.A,null))))),a.createElement(i.A,null,a.createElement(c.A,{placement:"bottom",title:l("Below")},a.createElement(m.Ay.Button,{value:"bottom",className:y()("",{"selected-td-form__border-radio":P(null===e||void 0===e?void 0:e.bottom)}),style:{margin:"auto"}},a.createElement(_.A,null)))))))))}},67151:(e,t,o)=>{o.d(t,{A:()=>A});var a=o(98173),l=o(201),i=o(66964),r=o(49856),n=o(27499),s=o(37969),m=o(13785),d=o(78469),c=o(31573),u=o(39672),p=o(70552),g=o(26298),b=o.n(g),E=o(12543),h=o(88647),f=o(80877),v=o(52919),_=o(32947);const A=({form:e,oneBorderRadiusValue:t,setOneBorderRadiusValue:o,elementSettings:g,namePrefix:A=""})=>{const{__:y}=(0,E.s9)(),S=(0,v.XW)();return a.createElement(l.A,{gutter:10},a.createElement(i.A,{span:12},a.createElement(r.A,{size:10,align:"start"},a.createElement(n.A.Item,{name:A+"borderRadiusAll"},a.createElement(f.A,{min:0,placeholder:y("Border radius"),prefix:a.createElement(h.h,{className:"selected-td-form__icon-radius"}),disabled:!t,addonAfter:"px"})))),a.createElement(i.A,{span:12},a.createElement(s.Ay,{className:b()("selected-td-form__button",{"selected-td-form__button--active":!t}),onClick:()=>{const a=e.getFieldsValue(!0);let l;if(t)e.setFieldsValue({borderRadiusTopLeft:a.borderRadiusAll||null,borderRadiusBottomLeft:a.borderRadiusAll||null,borderRadiusTopRight:a.borderRadiusAll||null,borderRadiusBottomRight:a.borderRadiusAll||null}),l={borderRadius:{[_.wF.borderRadiusTopLeft]:a.borderRadiusAll||0,[_.wF.borderRadiusBottomLeft]:a.borderRadiusAll||0,[_.wF.borderRadiusTopRight]:a.borderRadiusAll||0,[_.wF.borderRadiusBottomRight]:a.borderRadiusAll||0}};else{const t=a.borderRadiusTopLeft===a.borderRadiusBottomLeft&&a.borderRadiusTopLeft===a.borderRadiusTopRight&&a.borderRadiusTopLeft===a.borderRadiusBottomRight;t?(e.setFieldsValue({borderRadiusAll:t?a.borderRadiusTopLeft:null}),l={borderRadius:{[_.wF.borderRadiusAll]:a.borderRadiusTopLeft}}):(e.setFieldsValue({borderRadiusAll:null,borderRadiusTopLeft:null,borderRadiusBottomLeft:null,borderRadiusTopRight:null,borderRadiusBottomRight:null}),l={borderRadius:{[_.wF.borderRadiusAll]:0,[_.wF.borderRadiusTopLeft]:0,[_.wF.borderRadiusBottomLeft]:0,[_.wF.borderRadiusTopRight]:0,[_.wF.borderRadiusBottomRight]:0}})}S({operation:_.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:g.type,settings:{borderRadius:{...g.borderRadius,...l.borderRadius}}}),o((e=>!e))}},a.createElement(h.h,{className:"selected-td-form__icon-radius"}))),a.createElement(i.A,null,a.createElement(l.A,{gutter:10,style:{marginTop:-10}},a.createElement(i.A,{span:12},a.createElement(m.A,{placement:"bottom",title:y("Top left corner")},a.createElement(n.A.Item,{hidden:t,name:A+"borderRadiusTopLeft",className:"form-item-margin-xs"},a.createElement(f.A,{min:0,prefix:a.createElement(d.A,null),style:{minHeight:10},addonAfter:"px"}))),a.createElement(m.A,{placement:"bottom",title:y("Bottom left corner")},a.createElement(n.A.Item,{hidden:t,name:A+"borderRadiusBottomLeft"},a.createElement(f.A,{min:0,prefix:a.createElement(c.A,null),style:{minHeight:10},addonAfter:"px"})))),a.createElement(i.A,{span:12},a.createElement(m.A,{placement:"bottom",title:y("Top right corner")},a.createElement(n.A.Item,{hidden:t,name:A+"borderRadiusTopRight",className:"form-item-margin-xs"},a.createElement(f.A,{min:0,prefix:a.createElement(u.A,null),style:{minHeight:10},addonAfter:"px"}))),a.createElement(m.A,{placement:"bottom",title:y("Bottom right corner")},a.createElement(n.A.Item,{hidden:t,name:A+"borderRadiusBottomRight"},a.createElement(f.A,{min:0,prefix:a.createElement(p.A,null),style:{minHeight:10},addonAfter:"px"})))))))}},37133:(e,t,o)=>{o.d(t,{A:()=>u});var a=o(98173),l=o(27499),i=o(50483),r=o(49856),n=o(13785),s=o(12543),m=o(8807),d=o(32947),c=o(52919);const u=({form:e,elementSettings:t,tooltipTitle:o,disabled:u=!1})=>{const{__:p}=(0,s.s9)(),g=(0,c.XW)(),[b,E]=(0,a.useState)(t.valign),h=o=>{const a=o.target.value,l={valign:""};a!==b?E(a):(E(""),e.setFieldsValue(l),g({operation:d.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:l}))};return a.createElement(l.A.Item,{name:"valign"},a.createElement(i.Ay.Group,{disabled:u},a.createElement(r.A,{size:8},a.createElement(n.A,{placement:"bottom",title:p("Align top")},a.createElement(i.Ay.Button,{value:"top",onClick:h},a.createElement(m.A,{icon:"AlignVerticalTop"}))),a.createElement(n.A,{placement:"bottom",title:p("Center vertically")},a.createElement(i.Ay.Button,{value:"middle",onClick:h},a.createElement(m.A,{icon:"AlignVerticalCenter"}))),a.createElement(n.A,{placement:"bottom",title:p("Align bottom")},a.createElement(i.Ay.Button,{value:"bottom",onClick:h},a.createElement(m.A,{icon:"AlignVerticalBottom"}))))))}},24075:(e,t,o)=>{o.d(t,{A:()=>s});var a=o(98173),l=o(26298),i=o.n(l),r=o(26327);o(47827);const n=({className:e,selectedElement:t,formSettings:o,emailElementType:l})=>a.createElement("div",{className:i()("selected-element-panel",{[e]:e}),style:{height:"100%"}},a.createElement(r.A,{className:i()("selected-element-panel__content SelectedElementPanel",{"column-settings-show":!!t.floatBlocks&&t.floatBlocks.items.length>1}),emailElementType:l,formSettings:o}));n.defaultProps={className:null,selectedElement:{parent:!1}};const s=n},26327:(e,t,o)=>{o.d(t,{A:()=>uo});var a=o(98173),l=o(84893),i=o(26298),r=o.n(i),n=o(2604),s=o(1047),m=o(22536),d=o(30150),c=o(40120),u=o(27499),p=o(13785),g=o(38976),b=o(201),E=o(66964),h=o(94674),f=o(37969),v=o(73114),_=o(49856),A=o(8218),y=o(48300),S=o(5795),k=o(54855),B=o(74984),w=o(72218),x=o(8122),P=o(86956),N=o.n(P),T=o(55207),R=o(23863),I=o(67151),C=o(50483),L=o(12543),F=o(8807),O=o(32947),M=o(52919);const D=({form:e,elementSettings:t,imgParent:o,name:l="align"})=>{const{__:i}=(0,L.s9)(),r=(0,M.XW)(),[n,s]=(0,a.useState)(t[l]),m=o=>{const a=o.target.value,i={[l]:""};a!==n?s(a):(s(""),e.setFieldsValue(i),r({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return a.createElement(u.A.Item,{name:l},a.createElement(C.Ay.Group,{disabled:o&&!t.parent},a.createElement(_.A,{size:8},a.createElement(p.A,{placement:"bottom",title:i("Align left")},a.createElement(C.Ay.Button,{value:"left",onClick:m},a.createElement(F.A,{icon:"AlignHorizontalLeft"}))),a.createElement(p.A,{placement:"bottom",title:i("Center horizontally")},a.createElement(C.Ay.Button,{value:"center",onClick:m},a.createElement(F.A,{icon:"AlignHorizontalCenter"}))),a.createElement(p.A,{placement:"bottom",title:i("Align right ")},a.createElement(C.Ay.Button,{value:"right",onClick:m},a.createElement(F.A,{icon:"AlignHorizontalRight"}))))))};D.defaultProps={imgParent:!1};const V=D;var j=o(37133),z=o(62913),W=o(33365),G=o(80877),H=o(77637);const U=()=>{const{__:e}=(0,L.s9)(),t=(0,n.d4)(s.uJ);return a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{placement:"bottom",title:e("Horizontal offset")},a.createElement(u.A.Item,{name:"boxShadowHOffset",className:"form-item-margin-xs"},a.createElement(G.A,{placeholder:e("Horizontal offset"),prefix:a.createElement(W.A,null),addonAfter:"px"})))),a.createElement(E.A,{span:12},a.createElement(p.A,{placement:"bottom",title:e("Vertical offset")},a.createElement(u.A.Item,{name:"boxShadowVOffset",className:"form-item-margin-xs"},a.createElement(G.A,{placeholder:e("Vertical offset"),prefix:a.createElement(F.A,{icon:"VerticalOffset"}),addonAfter:"px"})))),a.createElement(E.A,{span:12},a.createElement(p.A,{placement:"bottom",title:e("Blur radius")},a.createElement(u.A.Item,{name:"boxShadowBlurRadius",className:"form-item-margin-xs"},a.createElement(G.A,{min:0,placeholder:e("Blur radius"),prefix:a.createElement(F.A,{icon:"Blur",style:{fontSize:16,marginLeft:-2}}),addonAfter:"px"})))),a.createElement(E.A,{span:12},a.createElement(p.A,{placement:"bottom",title:e("Spread radius")},a.createElement(u.A.Item,{name:"boxShadowSpreadRadius",className:"form-item-margin-xs"},a.createElement(G.A,{placeholder:e("Spread radius"),prefix:a.createElement(F.A,{icon:"ZoomOutMap"}),addonAfter:"px"})))),a.createElement(E.A,{span:12},a.createElement(_.A,{size:10,align:"start"},a.createElement(u.A.Item,{name:"boxShadowColor"},a.createElement(H.A,{usedColors:t.usedColors})))),a.createElement(E.A,{span:12},a.createElement(p.A,{title:e("Shadow inside or outside of the element"),key:"inset",placement:"bottom"},a.createElement(u.A.Item,{name:"boxShadowInset",valuePropName:"value"},a.createElement(z.A,{style:{width:"100%"},options:[{label:e("Outside"),value:!1},{label:e("Inside"),value:!0}]}))))))};var q=o(49823),X=o(29123);const{Option:$}=q.A,Q=a.createElement(q.A,{className:"select-after",getPopupContainer:e=>e.parentNode},a.createElement($,{value:"px"},"px"),a.createElement($,{value:"%"},"%")),{useToken:K}=c.A,Y=({form:e,name:t,elementSettings:o,isPicture:l})=>{var i;const{__:r}=(0,L.s9)(),n=(0,M.XW)(),s=(0,a.useRef)(),m=(0,a.useRef)(),[d,c]=(0,a.useState)("auto"===(null===(i=o[t])||void 0===i?void 0:i.value)),{token:p}=K(),[g,b]=(0,a.useState)("");return a.createElement(a.Fragment,null,a.createElement(u.A.Item,{name:t,style:{marginBottom:p.formItemMarginBottomXS/2}},a.createElement(G.A,{ref:s,min:0,max:g,placeholder:r("Width"),onChange:o=>{c(!1),b("%"===e.getFieldsValue(!0)[t+"Dim"]?100:"")},prefix:a.createElement(S.A,null),addonAfter:a.createElement(u.A.Item,{name:t+"Dim",noStyle:!0},Q)})),!l&&a.createElement(_.A,{size:8,align:"end"},a.createElement(X.A,{ref:m,size:"small",checked:d,onChange:a=>{s.current.value=null,e.setFieldsValue({[t]:"",[t+"Dim"]:"px"}),c((e=>!e)),n({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:o.type,settings:{[t]:{classNamePrefix:"em-mob-width-",value:d?null:"auto",dim:""}}})},id:"auto-width"}),a.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},a.createElement("label",{htmlFor:"auto-width"},r("Auto")))))},{useToken:J}=c.A,Z=({form:e,name:t,elementSettings:o,isPicture:l})=>{var i;const{__:r}=(0,L.s9)(),n=(0,M.XW)(),s=(0,a.useRef)(),m=(0,a.useRef)(),[d,c]=(0,a.useState)("auto"===(null===(i=o.mobileHeight)||void 0===i?void 0:i.value)),{token:p}=J();return a.createElement(a.Fragment,null,a.createElement(u.A.Item,{name:t,style:{marginBottom:p.formItemMarginBottomXS/2}},a.createElement(G.A,{ref:s,min:0,placeholder:r("Height"),onChange:e=>{c(!1)},prefix:a.createElement(k.A,null),addonAfter:"px"})),!l&&a.createElement(_.A,{size:8,align:"end"},a.createElement(X.A,{ref:m,size:"small",checked:d,onChange:t=>{s.current.value=null,e.setFieldsValue({mobileHeight:"",mobileHeightDim:"px"}),c((e=>!e)),n({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:o.type,settings:{mobileHeight:{classNamePrefix:"em-mob-height-",value:d?null:"auto",dim:""}}})},id:"auto-height"}),a.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},a.createElement("label",{htmlFor:"auto-height"},r("Auto")))))};var ee=o(42490),te=o(80320),oe=o(17216),ae=o(82984),le=o(85372),ie=o(8239),re=o(91916),ne=o(48947),se=o(51157),me=o(42734);const{useToken:de}=c.A,ce=({mobileBorders:e})=>{const{__:t}=(0,L.s9)(),o=(0,n.d4)(s.uJ),l=e=>(null===e||void 0===e?void 0:e.width)||(null===e||void 0===e?void 0:e.style)||(null===e||void 0===e?void 0:e.color),{token:i}=de();return a.createElement(b.A,{gutter:30},a.createElement(E.A,{span:12,className:"selected-td-form__border-col"},a.createElement(u.A.Item,{name:"mobileBorderColor",className:"form-item-margin-xs"},a.createElement(H.A,{usedColors:o.usedColors})),a.createElement(u.A.Item,{name:"mobileBorderWidth",className:"form-item-margin-xs"},a.createElement(ee.A,{min:0,placeholder:t("Border width"),addonAfter:"px"})),a.createElement(u.A.Item,{name:"mobileBorderStyle",className:"form-item-margin-xs"},a.createElement(C.Ay.Group,null,a.createElement(_.A,{size:8},a.createElement(p.A,{placement:"bottom",title:t("None")},a.createElement(C.Ay.Button,{value:""},a.createElement(te.A,null))),a.createElement(p.A,{placement:"bottom",title:t("Solid")},a.createElement(C.Ay.Button,{value:"solid"},a.createElement(oe.A,null))),a.createElement(p.A,{placement:"bottom",title:t("Dashed")},a.createElement(C.Ay.Button,{value:"dashed"},a.createElement(ae.A,null))),a.createElement(p.A,{placement:"bottom",title:t("Dotted")},a.createElement(C.Ay.Button,{value:"dotted"},a.createElement(le.A,null))))))),a.createElement(E.A,{span:12,style:{textAlign:"center"}},a.createElement(u.A.Item,{label:"",name:"mobileBorderPosition",labelCol:{span:8}},a.createElement(C.Ay.Group,null,a.createElement(_.A,{size:i.formItemMarginBottomXS,direction:"vertical"},a.createElement(b.A,null,a.createElement(p.A,{placement:"top",title:t("Above")},a.createElement(C.Ay.Button,{value:"top",style:{margin:"auto"},className:r()("",{"selected-td-form__border-radio":l(null===e||void 0===e?void 0:e.top)})},a.createElement(ie.A,null)))),a.createElement(b.A,null,a.createElement(_.A,{size:i.formItemMarginBottomXS},a.createElement(p.A,{placement:"left",title:t("On the left")},a.createElement(C.Ay.Button,{value:"left",className:r()("",{"selected-td-form__border-radio":l(null===e||void 0===e?void 0:e.left)})},a.createElement(re.A,null))),a.createElement(p.A,{placement:"top",title:t("Around")},a.createElement(C.Ay.Button,{value:"all",className:r()("",{"selected-td-form__border-radio":l(null===e||void 0===e?void 0:e.all)})},a.createElement(ne.A,null))),a.createElement(p.A,{placement:"right",title:t("On the right")},a.createElement(C.Ay.Button,{value:"right",className:r()("",{"selected-td-form__border-radio":l(null===e||void 0===e?void 0:e.right)})},a.createElement(se.A,null))))),a.createElement(b.A,null,a.createElement(p.A,{placement:"bottom",title:t("Below")},a.createElement(C.Ay.Button,{value:"bottom",className:r()("",{"selected-td-form__border-radio":l(null===e||void 0===e?void 0:e.bottom)}),style:{margin:"auto"}},a.createElement(me.A,null)))))))))};var ue=o(78469),pe=o(31573),ge=o(39672),be=o(70552),Ee=o(88647);const he=({form:e,oneMobileBorderRadiusValue:t,setOneMobileBorderRadiusValue:o})=>{const{__:l}=(0,L.s9)();return a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(_.A,{size:10,align:"start"},a.createElement(u.A.Item,{name:"mobileBorderRadiusAll"},a.createElement(G.A,{min:0,placeholder:l("Border radius"),prefix:a.createElement(Ee.h,{className:"selected-td-form__icon-radius"}),disabled:!t,addonAfter:"px"})))),a.createElement(E.A,{span:12},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!t}),onClick:()=>{const a=e.getFieldsValue(!0);t&&e.setFieldsValue({mobileRadiusTopLeft:a.mobileBorderRadiusAll,mobileRadiusBottomLeft:a.mobileBorderRadiusAll,mobileRadiusTopRight:a.mobileBorderRadiusAll,mobileRadiusBottomRight:a.mobileBorderRadiusAll}),o((e=>!e))}},a.createElement(Ee.h,{className:"selected-td-form__icon-radius"}))),a.createElement(E.A,null,a.createElement(b.A,{gutter:10,style:{marginTop:-10}},a.createElement(E.A,{span:12},a.createElement(p.A,{placement:"bottom",title:l("Top left corner")},a.createElement(u.A.Item,{hidden:t,name:"mobileRadiusTopLeft",className:"form-item-margin-xs"},a.createElement(G.A,{min:0,prefix:a.createElement(ue.A,null),style:{minHeight:10},addonAfter:"px"}))),a.createElement(p.A,{placement:"bottom",title:l("Bottom left corner")},a.createElement(u.A.Item,{hidden:t,name:"mobileRadiusBottomLeft"},a.createElement(G.A,{min:0,prefix:a.createElement(pe.A,null),style:{minHeight:10},addonAfter:"px"})))),a.createElement(E.A,{span:12},a.createElement(p.A,{placement:"bottom",title:l("Top right corner")},a.createElement(u.A.Item,{hidden:t,name:"mobileRadiusTopRight",className:"form-item-margin-xs"},a.createElement(G.A,{min:0,prefix:a.createElement(ge.A,null),style:{minHeight:10},addonAfter:"px"}))),a.createElement(p.A,{placement:"bottom",title:l("Bottom right corner")},a.createElement(u.A.Item,{hidden:t,name:"mobileRadiusBottomRight"},a.createElement(G.A,{min:0,prefix:a.createElement(be.A,null),style:{minHeight:10},addonAfter:"px"})))))))},fe=({form:e,elementSettings:t})=>{const{__:o}=(0,L.s9)(),l=(0,a.useRef)(),i=(0,n.d4)(s.uJ),[r,m]=(0,a.useState)(!t.mobileBoxShadow||0===t.mobileBoxShadow.hOffset&&0===t.mobileBoxShadow.vOffset&&0===t.mobileBoxShadow.blurRadius&&0===t.mobileBoxShadow.spreadRadius&&0===t.mobileBoxShadow.spreadRadius),d=(0,M.XW)(),c=e=>{m(!1)};return a.createElement(a.Fragment,null,a.createElement("div",{style:{float:"right",marginTop:-9,marginRight:50}},a.createElement(_.A,{size:8,align:"end"},a.createElement(X.A,{ref:l,size:"small",checked:r,onChange:o=>{m((e=>!e)),e.setFieldsValue({mobileBoxShadowHOffset:r?"":0,mobileBoxShadowVOffset:r?"":0,mobileBoxShadowBlurRadius:r?"":0,mobileBoxShadowSpreadRadius:r?"":0,mobileBoxShadowColor:"",mobileBoxShadowInset:!1}),d({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobileBoxShadow:{classNamePrefix:"em-mob-box_shadow-",hOffset:r?null:0,vOffset:r?null:0,blurRadius:r?null:0,spreadRadius:r?null:0,color:null,inset:!1}}})},id:"without-shadow"}),a.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},a.createElement("label",{htmlFor:"without-shadow"},o("Without shadow"))))),a.createElement("p",{style:{paddingBottom:"8px",margin:"-30px 0 0"}},"\xa0"),a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{placement:"bottom",title:o("Horizontal offset")},a.createElement(u.A.Item,{name:"mobileBoxShadowHOffset",className:"form-item-margin-xs"},a.createElement(G.A,{min:0,placeholder:o("Horizontal offset"),prefix:a.createElement(W.A,null),addonAfter:"px",onChange:c})))),a.createElement(E.A,{span:12},a.createElement(p.A,{placement:"bottom",title:o("Vertical offset")},a.createElement(u.A.Item,{name:"mobileBoxShadowVOffset",className:"form-item-margin-xs"},a.createElement(G.A,{min:0,placeholder:o("Vertical offset"),prefix:a.createElement(W.A,{style:{transform:"rotate(90deg)"}}),addonAfter:"px",onChange:c})))),a.createElement(E.A,{span:12},a.createElement(p.A,{placement:"bottom",title:o("Blur radius")},a.createElement(u.A.Item,{name:"mobileBoxShadowBlurRadius",className:"form-item-margin-xs"},a.createElement(G.A,{min:0,placeholder:o("Blur radius"),prefix:a.createElement(F.A,{icon:"Blur",style:{fontSize:16,marginLeft:-2}}),addonAfter:"px",onChange:c})))),a.createElement(E.A,{span:12},a.createElement(p.A,{placement:"bottom",title:o("Spread radius")},a.createElement(u.A.Item,{name:"mobileBoxShadowSpreadRadius",className:"form-item-margin-xs"},a.createElement(G.A,{placeholder:o("Spread radius"),prefix:a.createElement(F.A,{icon:"ZoomOutMap"}),addonAfter:"px",onChange:c})))),a.createElement(E.A,{span:12},a.createElement(_.A,{size:10,align:"start"},a.createElement(u.A.Item,{name:"mobileBoxShadowColor"},a.createElement(H.A,{usedColors:i.usedColors})))),a.createElement(E.A,{span:12},a.createElement(p.A,{title:o("Shadow inside or outside of the element"),key:"inset",placement:"bottom"},a.createElement(u.A.Item,{name:"mobileBoxShadowInset",valuePropName:"checked"},a.createElement(z.A,{style:{width:"100%"},options:[{label:o("Outside"),value:!1},{label:o("Inside"),value:!0}]}))))))},ve=({form:e,elementSettings:t,imgParent:o,name:l="mobileAlign"})=>{var i;const{__:r}=(0,L.s9)(),[n,s]=(0,a.useState)(null===(i=t[l])||void 0===i?void 0:i.value),m=(0,M.XW)(),d=o=>{const a=o.target.value,i={[l]:{classNamePrefix:"em-mob-text_align-",value:""}};a!==n?s(a):(s(""),e.setFieldsValue(i),m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return a.createElement(u.A.Item,{name:l},a.createElement(C.Ay.Group,{disabled:o&&!t.parent},a.createElement(_.A,{size:8},a.createElement(p.A,{placement:"bottom",title:r("Align left")},a.createElement(C.Ay.Button,{value:"left",onClick:d},a.createElement(F.A,{icon:"AlignHorizontalLeft"}))),a.createElement(p.A,{placement:"bottom",title:r("Center horizontally")},a.createElement(C.Ay.Button,{value:"center",onClick:d},a.createElement(F.A,{icon:"AlignHorizontalCenter"}))),a.createElement(p.A,{placement:"bottom",title:r("Align right ")},a.createElement(C.Ay.Button,{value:"right",onClick:d},a.createElement(F.A,{icon:"AlignHorizontalRight"}))),a.createElement(p.A,{placement:"bottom",title:r("Text align justify")},a.createElement(C.Ay.Button,{value:"justify",onClick:d},a.createElement(F.A,{icon:"Justify"}))))))};ve.defaultProps={imgParent:!1};const _e=ve,Ae=({form:e,elementSettings:t,tooltipTitle:o})=>{var l;const{__:i}=(0,L.s9)(),[r,n]=(0,a.useState)(null===(l=t.mobileVerticalAlign)||void 0===l?void 0:l.value),s=(0,M.XW)(),m=o=>{const a=o.target.value,l={mobileVerticalAlign:{classNamePrefix:"em-mob-vertical_align",value:""}};a!==r?n(a):(n(""),e.setFieldsValue(l),s({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:l}))};return a.createElement(u.A.Item,{name:"mobileVerticalAlign"},a.createElement(C.Ay.Group,null,a.createElement(_.A,{size:8},a.createElement(p.A,{placement:"bottom",title:i("Align top")},a.createElement(C.Ay.Button,{value:"top",onClick:m},a.createElement(F.A,{icon:"AlignVerticalTop"}))),a.createElement(p.A,{placement:"bottom",title:i("Center vertically")},a.createElement(C.Ay.Button,{value:"middle",onClick:m},a.createElement(F.A,{icon:"AlignVerticalCenter"}))),a.createElement(p.A,{placement:"bottom",title:i("Align bottom")},a.createElement(C.Ay.Button,{value:"bottom",onClick:m},a.createElement(F.A,{icon:"AlignVerticalBottom"}))))))};var ye=o(7333),Se=o(83799);const ke=({form:e,elementSettings:t})=>{const{__:o}=(0,L.s9)();return a.createElement(u.A.Item,{name:"show"},a.createElement(C.Ay.Group,null,a.createElement(_.A,{size:8},a.createElement(C.Ay.Button,{value:"all"},o("Both")),a.createElement(p.A,{placement:"top",title:o("Desktop")},a.createElement(C.Ay.Button,{value:"desktop"},a.createElement(ye.A,null))),a.createElement(p.A,{placement:"top",title:o("Mobile")},a.createElement(C.Ay.Button,{value:"mobile"},a.createElement(Se.A,null))))))};ke.defaultProps={};const Be=ke;var we=o(57140),xe=o(46409),Pe=o(67073),Ne=o(20721);const{useToken:Te}=c.A,Re=({form:e,elementSettings:t,handleChangeValues:o})=>{const{__:l}=(0,L.s9)(),i=(0,a.useRef)(),{token:n}=Te(),[s,m]=(0,a.useState)(!1),[d,c]=(0,a.useState)(!1),[g,h]=(0,a.useState)(!1),[v,A]=(0,a.useState)(!1),[y,S]=(0,a.useState)(!1);(0,a.useEffect)((()=>{let e=new URL("https://emailmaker.ru/?"+t.countdown);m(e.searchParams.get("font1").endsWith("-b")||e.searchParams.get("font1").endsWith("-bi")),c(e.searchParams.get("font1").endsWith("-i")||e.searchParams.get("font1").endsWith("-bi")),h(e.searchParams.get("font2").endsWith("-b")||e.searchParams.get("font2").endsWith("-bi")),A(e.searchParams.get("font2").endsWith("-i")||e.searchParams.get("font2").endsWith("-bi")),S("true"===e.searchParams.get("tp"))}),[t]);const k=[{value:"-12",label:l("-12:00 Apia")},{value:"-11",label:l("-11:00 Pago Pago, Midway Atoll")},{value:"-10",label:l("-10:00 Honolulu, Anchorage")},{value:"-9",label:l("-9:00 Anchorage, Yukon")},{value:"-8",label:l("-8:00 Los Angeles, Vancouver")},{value:"-7",label:l("-7:00 Denver, Phoenix")},{value:"-6",label:l("-6:00 Mexico City, Guadalajara")},{value:"-5",label:l("-5:00 New York, Toronto, Havana")},{value:"-4",label:l("-4:00 Caracas, Santo Domingo")},{value:"-3",label:l("-3:00 Buenos Aires, Santiago, Montevideo")},{value:"-2",label:l("-2:00 South Georgia, Saint Helena")},{value:"-1",label:l("-1:00 Azores, Cape Verde")},{value:"0",label:l("+0:00 London, Lisbon, Dublin")},{value:"1",label:l("+1:00 Paris, Berlin, Rome")},{value:"2",label:l("+2:00 Athens, Kiev, Istanbul")},{value:"3",label:l("+3:00 Istanbul, Doha, Baghdad")},{value:"4",label:l("+4:00 Baku, Dubai, Tbilisi")},{value:"5",label:l("+5:00 Karachi, Tashkent, Islamabad")},{value:"6",label:l("+6:00 Almaty, Dhaka, Bishkek")},{value:"7",label:l("+7:00 Bangkok, Ho Chi Minh City, Jakarta")},{value:"8",label:l("+8:00 Beijing, Hong Kong, Singapore")},{value:"9",label:l("+9:00 Tokyo, Seoul, Jayapura")},{value:"10",label:l("+10:00 Sydney, Melbourne, Port Moresby")},{value:"11",label:l("+11:00 Honiara, Nuku'alofa, Apia")}],B=[{value:"20",label:l("20 c")},{value:"40",label:l("40 c")},{value:"60",label:l("60 c")}],w=[{value:"arial",label:"Arial"},{value:"courier-new",label:"Courier New"},{value:"georgia",label:"Georgia"},{value:"helvetica",label:"Helvetica"},{value:"tahoma",label:"Tahoma"},{value:"times-new-roman",label:"Times New Roman"},{value:"trebuchet-ms",label:"Trebuchet MS"},{value:"verdana",label:"Verdana"},{value:"open-sans",label:"Open Sans"},{value:"roboto",label:"Roboto"}],x=e=>{var t;e.target.closest(".ant-picker-dropdown")||(null===(t=i.current)||void 0===t||t.blur())};(0,a.useEffect)((()=>(window.addEventListener("scroll",x,!0),()=>{window.removeEventListener("scroll",x,!0)})));return a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(u.A.Item,{label:l("End time"),name:"countdownTime"},a.createElement(we.A,{ref:i,format:"DD.MM.YYYY HH:mm",disabledDate:e=>e&&e<N()().endOf("day")-864e5,showTime:!0,getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),allowClear:!1,allowEmpty:!1}))),a.createElement(E.A,{span:12},a.createElement(u.A.Item,{label:l("Time zone"),name:"countdownTimeZone",style:{width:"100%"}},a.createElement(q.A,{placeholder:l("Select the time zone"),getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")},k.map((e=>a.createElement(q.A.Option,{key:e.value,value:e.value},e.label))))))),a.createElement(b.A,{gutter:20},a.createElement(E.A,{span:12},a.createElement(u.A.Item,{label:l("Background color"),name:"countdownBackgroundColor",className:"countdown-color"},a.createElement(H.A,{placeholder:l("Background color"),isDisabled:y,usedColors:t.usedColors}))),a.createElement(E.A,{span:12},a.createElement(_.A,{size:10,align:"baseline",style:{paddingTop:29}},a.createElement(u.A.Item,{name:"countdownTransparency",valuePropName:"checked"},a.createElement(X.A,{size:"small",id:"countdownTransparency",onChange:e=>{S(e)}})),a.createElement("span",{style:{position:"relative",top:2}},a.createElement("label",{htmlFor:"countdownTransparency"},l("Transparency")))))),a.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:8}},l("Countdown font settings")),a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(u.A.Item,{name:"countdownNumbersFont",style:{marginBottom:n.formItemMarginBottomXS}},a.createElement(q.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:w}))),a.createElement(E.A,{span:12},a.createElement(u.A.Item,{name:"countdownNumbersColor",className:"countdown-color",style:{marginBottom:n.formItemMarginBottomXS}},a.createElement(H.A,{usedColors:t.usedColors}))),a.createElement(E.A,{span:12},a.createElement(u.A.Item,{name:"countdownNumbersFontSize"},a.createElement(ee.A,{min:12,placeholder:l("Font size"),prefix:a.createElement(xe.A,null),addonAfter:"px"}))),a.createElement(E.A,{span:3},a.createElement(p.A,{placement:"bottom",title:l("Strong")},a.createElement(u.A.Item,{name:"countdownNumbersStrong"},a.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":s}),onClick:()=>{const t=!s;e.setFieldValue("countdownNumbersStrong",t),o({countdownNumbersStrong:t}),m(t)}},a.createElement(Pe.A,{className:"selected-td-form__icon-radius"}))))),a.createElement(E.A,{span:3},a.createElement(p.A,{placement:"bottom",title:l("Italic")},a.createElement(u.A.Item,{name:"countdownNumbersItalic"},a.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":d}),onClick:()=>{const t=!d;e.setFieldValue("countdownNumbersItalic",t),o({countdownNumbersItalic:t}),c(t)}},a.createElement(Ne.A,{className:"selected-td-form__icon-radius"})))))),a.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:8}},l("Time units font settings")),a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(u.A.Item,{name:"countdownLabelsFont",style:{marginBottom:n.formItemMarginBottomXS}},a.createElement(q.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:w}))),a.createElement(E.A,{span:12},a.createElement(u.A.Item,{name:"countdownLabelsColor",className:"countdown-color",style:{marginBottom:n.formItemMarginBottomXS}},a.createElement(H.A,{usedColors:t.usedColors}))),a.createElement(E.A,{span:12},a.createElement(u.A.Item,{name:"countdownLabelsFontSize"},a.createElement(ee.A,{min:8,placeholder:l("Font size"),addonAfter:"px",prefix:a.createElement(xe.A,null)}))),a.createElement(E.A,{span:3},a.createElement(p.A,{placement:"bottom",title:l("Strong")},a.createElement(u.A.Item,{name:"countdownLabelsStrong"},a.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":g}),onClick:()=>{const t=!g;e.setFieldValue("countdownLabelsStrong",t),o({countdownLabelsStrong:t}),h(t)}},a.createElement(Pe.A,{className:"selected-td-form__icon-radius"}))))),a.createElement(E.A,{span:3},a.createElement(p.A,{placement:"bottom",title:l("Italic")},a.createElement(u.A.Item,{name:"countdownLabelsItalic"},a.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":v}),onClick:()=>{const t=!v;e.setFieldValue("countdownLabelsItalic",t),o({countdownLabelsItalic:t}),A(t)}},a.createElement(Ne.A,{className:"selected-td-form__icon-radius"})))))),a.createElement(b.A,{gutter:10,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(u.A.Item,{label:l("Language"),name:"countdownLanguage",style:{width:"100%"}},a.createElement(q.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:[{value:"ru_RU",label:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439"},{value:"en_US",label:"English"},{value:"uk_UA",label:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"},{value:"pt_BR",label:"Portugu\xeas"},{value:"fr-CA",label:"Fran\xe7ais"},{value:"de_DE",label:"Deutsch"},{value:"pl_PL",label:"Polski"},{value:"es_ES",label:"Espa\xf1ol"},{value:"tr_TR",label:"T\xfcrk\xe7e"},{value:"lt_LT",label:"Lietuvi\u0173 kalba"},{value:"lv_LV",label:"Latvie\u0161u valoda"},{value:"et_EE",label:"Eesti keel"},{value:"hu_HU",label:"Magyar"},{value:"el_GR",label:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"},{value:"it_IT",label:"Italiano"}]}))),a.createElement(E.A,{span:12},a.createElement(u.A.Item,{label:l("Duration"),name:"countdownDuration",style:{width:"100%"}},a.createElement(q.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:B})))))};var Ie=o(9593),Ce=o(30245),Le=o(29312),Fe=o(53056);const{useToken:Oe}=c.A,Me=({form:e,elementSettings:t})=>{const{__:o}=(0,L.s9)(),{token:l}=Oe();return a.createElement(a.Fragment,null,a.createElement(p.A,{trigger:["hover"],title:o("URL of the video clip."),placement:"right"},a.createElement(u.A.Item,{name:"videoSource",className:"selected-image-form__alt"},a.createElement(A.A,{allowClear:!0,placeholder:o("Video URL"),prefix:a.createElement(Ie.A,null)}))),a.createElement(u.A.Item,{label:o("Play button"),name:"videoPlayButton",style:{width:"100%",marginBottom:l.formItemMarginBottomMD+4}},a.createElement(q.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")},a.createElement(q.A.Option,{value:"youtube_red"},a.createElement(Ce.A,{style:{color:"#FF0000"}})," ",o("Youtube Red")),a.createElement(q.A.Option,{value:"youtube_black"},a.createElement(Ce.A,null)," ",o("Youtube Black")),a.createElement(q.A.Option,{value:"youtube_white"},a.createElement(Ce.A,{style:{color:"#aaa"}})," ",o("Youtube White")),a.createElement(q.A.Option,{value:"vimeo"},a.createElement(F.A,{icon:"Vimeo"})," ",o("Vimeo")),a.createElement(q.A.Option,{value:"white_circle"},a.createElement(Le.A,{style:{color:"#aaa"}})," ",o("White circle")),a.createElement(q.A.Option,{value:"black_circle"},a.createElement(Le.A,null)," ",o("Black circle")),a.createElement(q.A.Option,{value:"white_circle_outlined"},a.createElement(Fe.A,{style:{color:"#aaa"}})," ",o("White circle outlined")),a.createElement(q.A.Option,{value:"black_circle_outlined"},a.createElement(Fe.A,null)," ",o("Black circle outlined")),a.createElement(q.A.Option,{value:"none"}," ",o("Without button")))))},De=()=>{const{__:e}=(0,L.s9)();return a.createElement(u.A.Item,{name:"ampShow"},a.createElement(C.Ay.Group,null,a.createElement(_.A,{size:8},a.createElement(C.Ay.Button,{value:"all"},e("Both")),a.createElement(p.A,{placement:"top",title:e("AMP")},a.createElement(C.Ay.Button,{value:"amp"},"AMP")),a.createElement(p.A,{placement:"top",title:e("HTML")},a.createElement(C.Ay.Button,{value:"html"},"HTML")))))};De.defaultProps={};const Ve=De;var je=o(62093),ze=o(40835),We=o(23424),Ge=o(54838),He=o(47014),Ue=o(80772),qe=o(27941),Xe=o(64909),$e=o(40277),Qe=o(99512),Ke=o(16390);o(47827);const{useToken:Ye}=c.A,Je=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:o}=Ye(),[l]=u.A.useForm();let i=(0,n.wA)();const s=(0,qe.rD)(),{projectId:m}=(0,d.g)(),c=(0,Xe.hN)(),P=(0,M.XW)(),C=(0,M.K9)(),D=(0,n.d4)(Ge.Ct),z=(0,n.d4)(Ge.CS),W=(0,n.d4)(He.C1),H=(0,n.d4)(Ge.Fv),q=(0,n.d4)(Ge.yy),[X]=(0,ze.dS)(),[$,Q]=(0,ze.tb)(),K=(0,a.useRef)(null),J=(0,a.useRef)(null),ee=(0,a.useRef)(null),te=(0,a.useRef)(null),oe=(0,a.useRef)(null),ae=(0,a.useRef)(null),le=(0,a.useRef)(null),ie=(0,a.useRef)(null),re=(0,a.useRef)(null),[ne,se]=(0,a.useState)({}),[me,de]=(0,a.useState)({}),[ue,pe]=(0,a.useState)({}),[ge,be]=(0,a.useState)({}),[Ee,ve]=(0,a.useState)(!0),[ye,Se]=(0,a.useState)(!0),[ke,we]=(0,a.useState)(""),[xe,Pe]=(0,a.useState)(""),[Ne,Te]=(0,a.useState)(""),[Ie,Ce]=(0,a.useState)(!1),[Le,Fe]=(0,a.useState)(!1),[Oe,De]=(0,a.useState)(!1),[Je,Ze]=(0,a.useState)(!1),[et,tt]=(0,a.useState)(!1),[ot,at]=(0,a.useState)(!1),[lt,it]=(0,a.useState)(!1),[rt,nt]=(0,a.useState)(!1),[st,mt]=(0,a.useState)("https://"),[dt,ct]=(0,a.useState)(),[ut,pt]=(0,a.useState)(!1),[gt,bt]=(0,a.useState)(null),[Et,ht]=(0,a.useState)({start:0,end:0}),[ft,vt]=(0,a.useState)(!1),[_t,At]=(0,a.useState)(!1),yt=H&&"bottom"!==q;(0,a.useEffect)((()=>{ut&&re.current&&re.current.focus()}),[ut]);const St=(0,n.d4)(Ke.GH);(0,a.useEffect)((()=>{var e;null!==St&&void 0!==St&&null!==(e=St.items)&&void 0!==e&&e.length&&ct((0,qe.cM)(St.items,t,((e,t)=>{pt(!1),C(O.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[St,ct,t,pt,C]);(0,a.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||bt(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||pt(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.addEventListener("click",t)}}),[]);const kt=({target:e})=>{if(e&&!ft){const{selectionStart:t,selectionEnd:o}=e;ht({start:t,end:o})}vt(!1)};(0,a.useEffect)((()=>{if(e){var t,o,a,i,r,n,s,m,d,c,u,p,g,b,E,h,f,v,_,A,y,S,k,B,w,x,P,T,R,I,C,L,F;const D=e.border,V=e.mobileBorder,j=e.boxShadow,z=e.mobileBoxShadow;se(D),de(V),pe(j),be(z);const W=Object.keys(D).find((e=>{var t,o,a;return(null===(t=D[e])||void 0===t?void 0:t.width)||(null===(o=D[e])||void 0===o?void 0:o.style)||(null===(a=D[e])||void 0===a?void 0:a.color)})),G=Object.keys(V).find((e=>{var t,o,a;return(null===(t=V[e])||void 0===t?void 0:t.width)||(null===(o=V[e])||void 0===o?void 0:o.style)||(null===(a=V[e])||void 0===a?void 0:a.color)}));if(e.link&&mt((0,Qe.TW)(e.link,"https://")),l.setFieldsValue({...e,link:e.link?e.link:"https://",width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.dim,height:null===(a=e.height)||void 0===a?void 0:a.value,heightDim:null===(i=e.height)||void 0===i?void 0:i.dim,borderPosition:W||"all",borderWidth:null!==(null===(r=D[W])||void 0===r?void 0:r.width)?null===(n=D[W])||void 0===n?void 0:n.width:"",borderColor:(null===(s=D[W])||void 0===s?void 0:s.color)||"",borderStyle:(null===(m=D[W])||void 0===m?void 0:m.style)||"",borderRadiusAll:(0,Qe.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Qe.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Qe.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Qe.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Qe.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Qe.ok)(null===(d=e.boxShadow)||void 0===d?void 0:d.inset)||!1,boxShadowHOffset:(0,Qe.ok)(null===(c=e.boxShadow)||void 0===c?void 0:c.hOffset),boxShadowVOffset:(0,Qe.ok)(null===(u=e.boxShadow)||void 0===u?void 0:u.vOffset),boxShadowBlurRadius:(0,Qe.ok)(null===(p=e.boxShadow)||void 0===p?void 0:p.blurRadius),boxShadowSpreadRadius:(0,Qe.ok)(null===(g=e.boxShadow)||void 0===g?void 0:g.spreadRadius),boxShadowColor:(0,Qe.ok)(null===(b=e.boxShadow)||void 0===b?void 0:b.color),mobileWidth:(0,Qe.xc)(null===(E=e.mobileWidth)||void 0===E?void 0:E.value),mobileWidthDim:null===(h=e.mobileWidth)||void 0===h?void 0:h.dim,mobileHeight:(0,Qe.xc)(null===(f=e.mobileHeight)||void 0===f?void 0:f.value),mobileHeightDim:null===(v=e.mobileHeight)||void 0===v?void 0:v.dim,mobileBorderPosition:G||"all",mobileBorderWidth:null!==(null===(_=V[G])||void 0===_?void 0:_.width)?null===(A=V[G])||void 0===A?void 0:A.width:"",mobileBorderColor:(null===(y=V[G])||void 0===y?void 0:y.color)||"",mobileBorderStyle:(null===(S=V[G])||void 0===S?void 0:S.style)||"",mobileBorderRadiusAll:(0,Qe.ok)(e.mobileBorderRadius.all),mobileRadiusTopLeft:(0,Qe.ok)(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileRadiusBottomLeft:(0,Qe.ok)(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileRadiusTopRight:(0,Qe.ok)(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileRadiusBottomRight:(0,Qe.ok)(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:(0,Qe.ok)(null===(k=e.mobileBoxShadow)||void 0===k?void 0:k.inset)||!1,mobileBoxShadowHOffset:(0,Qe.ok)(null===(B=e.mobileBoxShadow)||void 0===B?void 0:B.hOffset),mobileBoxShadowVOffset:(0,Qe.ok)(null===(w=e.mobileBoxShadow)||void 0===w?void 0:w.vOffset),mobileBoxShadowBlurRadius:(0,Qe.ok)(null===(x=e.mobileBoxShadow)||void 0===x?void 0:x.blurRadius),mobileBoxShadowSpreadRadius:(0,Qe.ok)(null===(P=e.mobileBoxShadow)||void 0===P?void 0:P.spreadRadius),mobileBoxShadowColor:(0,Qe.ok)(null===(T=e.mobileBoxShadow)||void 0===T?void 0:T.color),mobileAlign:(0,Qe.ok)(null===(R=e.mobileAlign)||void 0===R?void 0:R.value),mobileVerticalAlign:(0,Qe.ok)(null===(I=e.mobileVerticalAlign)||void 0===I?void 0:I.value),show:e.show?e.show:"all",altSrc:e.src}),e.countdown){let t=new URL("https://emailmaker.ru/?"+e.countdown),o=t.searchParams.get("font1"),a=!1,i=!1;o.endsWith("-b")?(o=o.substring(0,o.length-2),a=!0):o.endsWith("-i")?(o=o.substring(0,o.length-2),i=!0):o.endsWith("-bi")&&(o=o.substring(0,o.length-3),a=!0,i=!0);let r=t.searchParams.get("font2"),n=!1,s=!1;r.endsWith("-b")?(r=r.substring(0,r.length-2),n=!0):r.endsWith("-i")?(r=r.substring(0,r.length-2),s=!0):r.endsWith("-bi")&&(r=r.substring(0,r.length-3),n=!0,s=!0),l.setFieldsValue({countdownTime:N()(new Date(Date.parse(t.searchParams.get("time"))+36e5*t.searchParams.get("timezone")+(new Date).getTimezoneOffset()/60*36e5).toISOString()),countdownDuration:t.searchParams.get("frames")||20,countdownTimeZone:t.searchParams.get("timezone"),countdownLanguage:t.searchParams.get("locale").replace("-","_"),countdownBackgroundColor:"#"+t.searchParams.get("bg"),countdownTransparency:"true"===t.searchParams.get("tp")?"checked":"",countdownNumbersFont:o,countdownNumbersFontSize:t.searchParams.get("size1")/2,countdownNumbersFontSizeDim:"px",countdownNumbersColor:"#"+t.searchParams.get("color1"),countdownLabelsFont:r,countdownLabelsFontSize:t.searchParams.get("size2")/2,countdownLabelsFontSizeDim:"px",countdownLabelsColor:"#"+t.searchParams.get("color2"),countdownNumbersStrong:a,countdownNumbersItalic:i,countdownLabelsStrong:n,countdownLabelsItalic:s})}var O,M;if(e.video)l.setFieldsValue({videoPlayButton:null!==(O=e.video.playButton)&&void 0!==O?O:"youtube_red",videoSource:null!==(M=e.video.source)&&void 0!==M?M:""});!(0,Qe.ok)(e.borderRadius.all)&&((0,Qe.ok)(e.borderRadius.topLeft)||(0,Qe.ok)(e.borderRadius.bottomLeft)||(0,Qe.ok)(e.borderRadius.topRight)||(0,Qe.ok)(e.borderRadius.bottomRight))?ve(!1):ve(!0),(0,Qe.ok)(e.mobileBorderRadius.topLeft)||(0,Qe.ok)(e.mobileBorderRadius.bottomLeft)||(0,Qe.ok)(e.mobileBorderRadius.topRight)||(0,Qe.ok)(e.mobileBorderRadius.bottomRight)?Se(!1):Se(!0),Ce(!(null===(C=D[W])||void 0===C||!C.width)),Fe(!(null===(L=V[G])||void 0===L||!L.width)),De(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),Ze(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),tt(!!e.boxShadow),at(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),it(!!e.mobileWidth.value||!!e.mobileHeight.value),we(e.link),Pe(e.alt),Te(e.title),At(null===(F=e.imgReplacer)||void 0===F?void 0:F.length)}}),[l,e]);const Bt=async(e,t,o)=>{const a={};a.user_id=W.id,a.folder=e,t&&("image/gif"!==t.type&&(t=await(0,x.A)(t,{maxSizeMB:s.compressMaxSize||.45,maxWidthOrHeight:s.compressMaxWidthOrHeight||2e3})),a.file=t),o&&(a.page_url=o);const l=await X(a);var i,r,n;if(l.error)c.fromError("IMAGE_UPLOAD_ERROR",t,l.error,!0);else if(400!==(null===(i=l.data.data)||void 0===i?void 0:i.status))return null===(r=l.data)||void 0===r||null===(n=r[0])||void 0===n?void 0:n.file_url},wt=((e,t)=>{let o;return function(...a){clearTimeout(o),o=setTimeout((()=>{clearTimeout(o),e(...a)}),t)}})((()=>{const t=l.getFieldsValue(!0);let o=new URL("https://cdt3.emcdn.ru/timer/?"+e.countdown),a=t.countdownNumbersFont;t.countdownNumbersStrong&&t.countdownNumbersItalic?a+="-bi":t.countdownNumbersStrong?a+="-b":t.countdownNumbersItalic&&(a+="-i");let i=t.countdownLabelsFont;t.countdownLabelsStrong&&t.countdownLabelsItalic?i+="-bi":t.countdownLabelsStrong?i+="-b":t.countdownLabelsItalic&&(i+="-i"),o.searchParams.set("time",new Date(t.countdownTime.$d-36e5*t.countdownTimeZone-(new Date).getTimezoneOffset()/60*36e5).toISOString()),o.searchParams.set("bg",t.countdownBackgroundColor.substring(1)||"#FFFFFF"),o.searchParams.set("tp",!!t.countdownTransparency),o.searchParams.set("font1",a),o.searchParams.set("size1",2*t.countdownNumbersFontSize||12),o.searchParams.set("color1",t.countdownNumbersColor.substring(1)||"#000000"),o.searchParams.set("font2",i),o.searchParams.set("size2",2*t.countdownLabelsFontSize||8),o.searchParams.set("color2",t.countdownLabelsColor.substring(1)||"#959595"),o.searchParams.set("spacing",Math.round(.4*t.countdownNumbersFontSize)||5),o.searchParams.set("locale",t.countdownLanguage.replace("_","-")),o.searchParams.set("timezone",t.countdownTimeZone),o.searchParams.set("frames",t.countdownDuration),$({link:JSON.stringify({target:o.href})}),nt(!0)}),500),xt=(t,...o)=>{const a=l.getFieldsValue(!0),r=Object.keys(t)[0];let n;switch(r){case"link":let e=t[r];"https://http"===e.substring(0,12)&&(e=e.substring(8,e.length),l.setFieldValue("link",e)),n={link:e};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":n={boxShadow:{hOffset:a.boxShadowHOffset,vOffset:a.boxShadowVOffset,blurRadius:a.boxShadowBlurRadius,spreadRadius:a.boxShadowSpreadRadius,color:a.boxShadowColor,inset:a.boxShadowInset}};break;case"borderStyle":n={border:{[a.borderPosition]:{...ne[a.borderPosition],style:t[r]}}},"all"===a.borderPosition?se((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],style:t[r]}}))):se((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],style:t[r]}})));break;case"borderColor":n={border:{[a.borderPosition]:{...ne[a.borderPosition],color:t[r]}}},"all"===a.borderPosition?se((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],color:t[r]}}))):se((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],color:t[r]}})));break;case"borderWidth":n={border:{[a.borderPosition]:{...ne[a.borderPosition],width:t[r]}}},"all"===a.borderPosition?se((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],width:t[r]}}))):se((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],width:t[r]}})));break;case"borderPosition":l.setFieldsValue({borderWidth:ne[t[r]].width||"",borderColor:ne[t[r]].color||"",borderStyle:ne[t[r]].style||""});break;case"width":n={[r]:{value:t[r],dim:a.widthDim}};break;case"widthDim":n={width:{value:a.width,dim:t[r]}};break;case"height":n={[r]:{value:t[r],dim:a.heightDim}};break;case"heightDim":n={height:{value:a.height,dim:t[r]}};break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":n={borderRadius:{[O.wF[r]]:+t[r]}};break;case"mobileWidth":n={[r]:{classNamePrefix:"em-mob-width-",value:t[r],dim:a.mobileWidthDim}};break;case"mobileWidthDim":n={mobileWidth:{classNamePrefix:"em-mob-width-",value:a.mobileWidth,dim:t[r]}};break;case"mobileHeight":n={[r]:{classNamePrefix:"em-mob-height-",value:t[r],dim:a.mobileHeightDim}};break;case"mobileHeightDim":n={mobileHeight:{classNamePrefix:"em-mob-height-",value:a.mobileHeight,dim:t[r]}};break;case"mobileBorderStyle":n={mobileBorder:{[a.mobileBorderPosition]:{...me[a.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?de((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):de((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":n={mobileBorder:{[a.mobileBorderPosition]:{...me[a.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?de((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):de((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":n={mobileBorder:{[a.mobileBorderPosition]:{...me[a.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?de((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):de((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderPosition":l.setFieldsValue({mobileBorderWidth:me[t[r]].width||"",mobileBorderColor:me[t[r]].color||"",mobileBorderStyle:me[t[r]].style||""});break;case"mobileBorderRadiusAll":case"mobileRadiusTopLeft":case"mobileRadiusBottomLeft":case"mobileRadiusTopRight":case"mobileRadiusBottomRight":n={mobileBorderRadius:{[Qe.NW[r]]:t[r],classNamePrefix:"em-mob-border_radius_"+Qe.NW[r]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":n={mobileBoxShadow:{hOffset:a.mobileBoxShadowHOffset,vOffset:a.mobileBoxShadowVOffset,blurRadius:a.mobileBoxShadowBlurRadius,spreadRadius:a.mobileBoxShadowSpreadRadius,color:a.mobileBoxShadowColor,inset:a.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":n={[r]:{classNamePrefix:"em-mob-text_align-",value:t[r]}};break;case"mobileVerticalAlign":n={[r]:{classNamePrefix:"em-mob-vertical_align-",value:t[r]}};break;case"countdownTime":case"countdownTimeZone":case"countdownBackgroundColor":case"countdownNumbersFont":case"countdownNumbersFontSize":case"countdownNumbersColor":case"countdownLabelsFont":case"countdownLabelsFontSize":case"countdownLabelsColor":case"countdownLanguage":case"countdownDuration":case"countdownTransparency":case"countdownNumbersStrong":case"countdownNumbersItalic":case"countdownLabelsStrong":case"countdownLabelsItalic":wt();break;case"videoSource":case"videoPlayButton":(async()=>{const e=l.getFieldsValue(!0);e.videoSource&&Bt("tmp",null,e.videoSource).then((t=>{var o=document.createElement("canvas"),a=o.getContext("2d"),l=new Image,r=new Image;let n=t,d="https://emcdn.ru/app/"+e.videoPlayButton+".png";l.crossOrigin="Anonymous",r.crossOrigin="Anonymous";let c=!1,u=!1;l.onload=function(){a.clearRect(0,0,o.width,o.height),a.drawImage(l,0,0,o.width,o.height),c=!0},l.src=n,r.onload=function(){var e=o.width/2-r.width/2,t=o.height/2-r.height/2;a.drawImage(r,e,t,r.width,r.height),u=!0},r.src=d;let p=setInterval((function(){if(c&&u){o.width=Math.max(l.width,r.width),o.height=Math.max(l.height,r.height),a.clearRect(0,0,o.width,o.height),a.drawImage(l,0,0,l.width,l.height);var e=o.width/2-r.width/2,t=o.height/2-r.height/2;a.drawImage(r,e,t,r.width,r.height),o.toBlob((async function(e){const t=await(0,x.A)(new File([e],"image.jpeg",{type:"image/jpeg"}),{maxSizeMB:s.compressMaxSize||.45,maxWidthOrHeight:s.compressMaxWidthOrHeight||2e3});Bt(m,t).then((e=>{i((0,Ue.tm)(e))}))}),"image/jpg",1),clearInterval(p)}}),300)}))})(),a.link=a.videoSource,P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"video",settings:{video:{source:a.videoSource,playButton:a.videoPlayButton},link:a.link}});break;default:n=t}"borderPosition"!==r&&"mobileBorderPosition"!==r&&-1===r.indexOf("countdown")&&"videoSource"!==r&&"videoPlayButton"!==r&&P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:n})};(0,a.useEffect)((()=>{Q.isError&&((0,$e.p6)(Q,c),nt(!1))}),[Q,c]),(0,a.useEffect)((()=>{if(Q.isSuccess&&rt){var t;if(400===(null===(t=Q.data.data)||void 0===t?void 0:t.status))c.error({message:a.createElement("div",{dangerouslySetInnerHTML:{__html:Q.data.code}}),description:a.createElement("div",{dangerouslySetInnerHTML:{__html:Q.data.message}}),placement:"bottomRight"});else{let t=new URL(Q.data.target),o={countdown:{link:Q.data.link,params:t.search.substring(1)}};P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:o})}nt(!1)}}),[Q,rt,e,c,P]);(0,je.A)((t=>{const o=t.data.operation;o===O.Ru.APPLICATION_OPEN_IMAGE_AI_POPUP?(i((0,Ue.tm)(e.src)),i((0,We.qf)(O.lx.UPLOAD_IMAGE_MODAL_AI))):o===O.Ru.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?(i((0,Ue.tm)(e.src)),i((0,We.qf)(O.lx.UPLOAD_IMAGE_MODAL_UPLOAD))):o===O.Ru.APPLICATION_OPEN_IMAGE_EDIT_POPUP?(i((0,Ue.tm)(e.src)),i((0,We.qf)(O.lx.UPLOAD_IMAGE_MODAL_EDIT))):o===O.Ru.APPLICATION_OPEN_IMAGE_GIF_POPUP?(i((0,Ue.tm)(e.src)),i((0,We.qf)(O.lx.UPLOAD_IMAGE_MODAL_GIF))):o===O.Ru.APPLICATION_OPEN_IMAGE_STOCK_POPUP?(i((0,Ue.tm)(e.src)),i((0,We.qf)(O.lx.UPLOAD_IMAGE_MODAL_STOCK))):o===O.Ru.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(i((0,We.Os)()),i((0,We.Oo)()))}));const Pt=()=>{ke?(we(""),l.setFieldValue("link",""),P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{link:""}})):(we(K.current&&K.current.input.value?K.current.input.value:"..."),setTimeout((()=>{K.current.focus()})))},Nt=e=>{""===e.target.value?we("..."):(J.current.classList.add("selected-td-form__button--active"),we(e.target.value));const t=e.target.value;"https://"===t.substring(0,8)?mt("https://"):"mailto:"===t.substring(0,7)?mt("mailto:"):"tel:"===t.substring(0,4)?mt("tel:"):"sms:"===t.substring(0,4)?mt("sms:"):"ftp://"===t.substring(0,6)?mt("ftp://"):"skype:"===t.substring(0,6)?mt("skype:"):"viber:"===t.substring(0,6)?mt("viber:"):mt("")},Tt=()=>{const t=l.getFieldsValue(!0);xe?(Pe(""),t.alt="",P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{alt:""}})):(Pe(ee.current&&ee.current.input.value?ee.current.input.value:"..."),setTimeout((()=>{ee.current.focus()})))},Rt=e=>{""===e.target.value?Pe("..."):(te.current.classList.add("selected-td-form__button--active"),Pe(e.target.value))},It=()=>{const t=l.getFieldsValue(!0);Ne?(Te(""),t.title="",P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{title:""}})):(Te(oe.current&&oe.current.input.value?oe.current.input.value:"..."),setTimeout((()=>{oe.current.focus()})))},Ct=e=>{""===e.target.value?Te("..."):(ae.current.classList.add("selected-td-form__button--active"),Te(e.target.value))};return a.createElement(u.A,{form:l,layout:"vertical",name:"selected_image_form",initialValues:{src:"",width:"",height:"",widthDim:"",heightDim:"",alt:"",align:"left",border:"",boxShadow:"",show:"all",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"left",mobileVerticalAlign:"",link:"https://",imgReplacer:"",countdownNumbersStrong:!1,countdownNumbersItalic:!1,countdownLabelsStrong:!1,countdownLabelsItalic:!1},onValuesChange:xt,autoComplete:"off",className:"element-controls"},!yt&&a.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},a.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),D===O.ND&&z.styles?a.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},a.createElement("div",{className:"selected_form-mobile-props-wrapper"},a.createElement(b.A,{gutter:30,style:{paddingBottom:4}},a.createElement(E.A,{span:12},a.createElement(_e,{form:l,elementSettings:e,imgParent:!0})),a.createElement(E.A,{span:12,align:"right"},a.createElement(Ae,{form:l,elementSettings:e}))),a.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:"countdown"===e.type?15:24}}),"countdown"===e.type&&a.createElement(a.Fragment,null,a.createElement(Re,{form:l,elementSettings:e}),a.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),"video"===e.type&&a.createElement(a.Fragment,null,a.createElement(Me,{form:l,elementSettings:e}),a.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),("img"===e.type||"video"===e.type)&&a.createElement(u.A.Item,{style:{marginBottom:0}},a.createElement(T.A,{form:l,label:t("Image path"),name:"src",placeholder:t("Image path"),elementSettings:e,tooltipTitle:""})),a.createElement(_.A,{size:8,style:{marginBottom:xe||ke||Ne?o.formItemMarginBottomXS:o.formItemMarginBottomMD+4}},a.createElement(p.A,{title:ke||t("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!ke}),icon:a.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:Pt,ref:J})),a.createElement(p.A,{title:xe||t("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!xe}),onClick:Tt,ref:te},a.createElement("span",{className:"addon-text-content"},"Alt"))),s.formFieldImageTitleEnabled&&a.createElement(p.A,{title:Ne||t("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!Ne}),onClick:It,ref:ae},a.createElement("span",{className:"addon-text-content"},"Title")))),(!!ke||!!xe||!!Ne)&&a.createElement("div",{style:{marginBottom:o.formItemMarginBottomMD+4}},!!ke&&a.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"bottom"},a.createElement(u.A.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},a.createElement(A.A,{ref:K,allowClear:!0,placeholder:t("Hyperlink URL"),prefix:a.createElement(y.A,null),onChange:Nt}))),!!xe&&a.createElement(p.A,{trigger:["hover"],title:t("Alternative text"),placement:"bottom"},a.createElement(u.A.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},a.createElement(A.A,{placeholder:t("Alternative text"),allowClear:!0,prefix:a.createElement("span",{className:"addon-text-content"},"Alt"),onChange:Rt,ref:ee}))),s.formFieldImageTitleEnabled&&!!Ne&&a.createElement(p.A,{trigger:["hover"],title:t("Tooltip text"),placement:"bottom"},a.createElement(u.A.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},a.createElement(A.A,{placeholder:t("Tooltip text"),allowClear:!0,prefix:a.createElement("span",{className:"addon-text-content"},"Title"),onChange:Ct,ref:oe})))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Size"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{it((e=>!e)),lt&&(t.mobileWidth="",t.mobileHeight="",P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))}))}},lt?a.createElement(w.A,null):a.createElement(B.A,null)))),lt&&a.createElement(b.A,{gutter:10,style:{paddingBottom:24}},a.createElement(E.A,{span:12},a.createElement(Y,{form:l,name:"mobileWidth",elementSettings:e,isPicture:"true"})),a.createElement(E.A,{span:12},a.createElement(Z,{form:l,name:"mobileHeight",elementSettings:e,isPicture:"true"}))),s.formFieldBorderEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Borders"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{Fe((e=>!e)),Le&&(t.mobileBorderWidth=null,t.mobileBorderColor="",t.mobileBorderStyle=""),de((e=>({...O.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderColor,style:t.mobileBorderStyle,width:t.mobileBorderWidth,classNamePrefix:"em-mob-border_"+t.mobileBorderPosition+"-"}}}})}))}},Le?a.createElement(w.A,null):a.createElement(B.A,null)))),Le&&a.createElement("div",{style:{marginBottom:4}},a.createElement(ce,{mobileBorders:me}))),s.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{Ze((e=>!e)),t.mobileBorderRadiusAll=Je?null:5,P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},Je?a.createElement(w.A,null):a.createElement(B.A,null)))),Je&&a.createElement("div",{style:{marginBottom:4}},a.createElement(he,{form:l,oneMobileBorderRadiusValue:ye,setOneMobileBorderRadiusValue:Se}))),s.formFieldBoxShadowEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Box shadow"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{at((e=>!e)),ot?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},ot?a.createElement(w.A,null):a.createElement(B.A,null)))),ot&&a.createElement("div",{style:{marginBottom:4}},a.createElement(fe,{mobileBoxShadow:ge,form:l,elementSettings:e}))),s.formFieldVisibilityEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Display control")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Be,{elementSettings:e,form:l})))),s.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Amp visibility")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Ve,null)))))):a.createElement("div",{id:"selected_element_form_desktop_props"},a.createElement("div",{className:"selected_form-props-wrapper"},a.createElement(b.A,{gutter:10,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(V,{form:l,elementSettings:e,imgParent:!0})),a.createElement(E.A,{span:12,align:"right"},a.createElement(j.A,{form:l,elementSettings:e}))),a.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:"countdown"===e.type?15:24}}),"countdown"===e.type&&a.createElement(a.Fragment,null,a.createElement(Re,{form:l,elementSettings:e,handleChangeValues:xt}),a.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),dt&&a.createElement(E.A,{span:24,id:"merge_tags_wrapper"},a.createElement(u.A.Item,{style:{marginBottom:24}},a.createElement(f.Ay,{id:"merge_tags_button",icon:a.createElement(F.A,{icon:"MergeTags"}),style:{width:"100%",display:ut?"none":"block"},onClick:()=>pt(!0)},t("Merge tags")),a.createElement(v.A,{ref:re,popupClassName:"merge-tags",options:dt,placeholder:t("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const o=t.map(((t,o)=>{const l=t.label.split(new RegExp(`(${e})`,"gi"));return a.createElement("span",{key:t.value},0!==o&&a.createElement("span",null,"\xa0/\xa0"),l.map(((t,o)=>t.toLowerCase()===e.toLowerCase()?a.createElement("span",{key:o,style:{color:"red"}},t):t)))}));return a.createElement("div",{title:t.map((e=>e.label)).join(" / ")},o)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(t,o)=>{if(pt(!1),t){const a=St.syntax.length>1?dt.findIndex((e=>e.key===o[0].key)):0,i=St.syntax[a].replace("%value%",t[t.length-1]);"selected_image_form_title"===(null===gt||void 0===gt?void 0:gt.getAttribute("id"))||"selected_image_form_alt"===(null===gt||void 0===gt?void 0:gt.getAttribute("id"))||"selected_image_form_link"===(null===gt||void 0===gt?void 0:gt.getAttribute("id"))||"selected_image_form_imgReplacer"===(null===gt||void 0===gt?void 0:gt.getAttribute("id"))?((t,o)=>{const a=document.getElementById(o);if(a){var i,r;const n="selected_image_form_",s=o.substring(o.indexOf(n)+n.length),m=null===(i=a.value)||void 0===i?void 0:i.substring(0,Et.start),d=null===(r=a.value)||void 0===r?void 0:r.substring(Et.end);P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{...e,[s]:m+t+d}}),l.setFieldValue(s,m+t+d),a.focus(),setTimeout((()=>{a.selectionStart=Et.start,a.selectionEnd=Et.start+t.length}),400),vt(!0)}})(i,null===gt||void 0===gt?void 0:gt.getAttribute("id")):(l.setFieldValue("imgReplacer",i),P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:i}}))}},style:{display:ut?"block":"none"},open:ut,onKeyDown:e=>{"Escape"===e.key&&pt(!1)}}))),"video"===e.type&&a.createElement(a.Fragment,null,a.createElement(Me,{form:l,elementSettings:e}),a.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),("img"===e.type||"video"===e.type)&&a.createElement(u.A.Item,{style:{marginBottom:0}},a.createElement(T.A,{form:l,label:t("Image path"),name:"src",placeholder:t("Image path"),elementSettings:e,tooltipTitle:""})),a.createElement(_.A,{size:8,style:{marginBottom:xe||ke||Ne||_t?o.formItemMarginBottomXS:o.formItemMarginBottomMD+4}},a.createElement(p.A,{title:xe||t("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!xe}),onClick:Tt,ref:te},a.createElement("span",{className:"addon-text-content"},"Alt"))),s.formFieldImageTitleEnabled&&a.createElement(p.A,{title:Ne||t("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!Ne}),onClick:It,ref:ae},a.createElement("span",{className:"addon-text-content"},"Title"))),a.createElement(p.A,{title:ke||t("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!ke}),icon:a.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:Pt,ref:J})),a.createElement(p.A,{title:t("Image replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":_t}),icon:a.createElement(F.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{At(!_t),_t?(l.setFieldValue("imgReplacer",""),P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:""}})):setTimeout((()=>le.current.focus()))},ref:ie}))),(!!ke||!!xe||!!Ne||!!_t)&&a.createElement("div",{style:{marginBottom:o.formItemMarginBottomMD+4}},!!ke&&a.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"bottom"},a.createElement(u.A.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},a.createElement(A.A,{addonBefore:a.createElement(Qe.Ai,{linkProtocol:st,handleLinkProtocolsChange:e=>{l.setFieldValue("link","mergetag"!==e?e:""),mt(e)},__:t}),placeholder:t("Hyperlink URL"),allowClear:!0,ref:K,onChange:Nt,onSelect:kt,prefix:a.createElement(Qe.RM,{linkProtocol:st})}))),!!xe&&a.createElement(p.A,{trigger:["hover"],title:t("Alternative text"),placement:"bottom"},a.createElement(u.A.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},a.createElement(A.A,{placeholder:t("Alternative text"),allowClear:!0,prefix:a.createElement("span",{className:"addon-text-content"},"Alt"),onChange:Rt,ref:ee,onSelect:kt}))),s.formFieldImageTitleEnabled&&!!Ne&&a.createElement(p.A,{trigger:["hover"],title:t("Tooltip text"),placement:"bottom"},a.createElement(u.A.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},a.createElement(A.A,{placeholder:t("Enter the title of the image"),allowClear:!0,prefix:a.createElement("span",{className:"addon-text-content"},"Title"),onChange:Ct,ref:oe,onSelect:kt}))),!!_t&&a.createElement(p.A,{trigger:["hover"],title:t("Image src"),placement:"bottom"},a.createElement(u.A.Item,{name:"imgReplacer",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},a.createElement(A.A,{placeholder:t("\u0421ode that will replace the image `src`"),allowClear:!0,prefix:a.createElement("span",{className:"addon-text-content"},t("Image src")),onChange:e=>{""!==e.target.value&&ie.current.classList.add("selected-td-form__button--active")},ref:le,onSelect:kt})))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Size")),a.createElement(b.A,{gutter:o.marginSM,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(p.A,{title:t("Width"),placement:"bottom"},a.createElement(u.A.Item,{name:"width",style:{marginBottom:o.formItemMarginBottomXS}},a.createElement(G.A,{min:0,max:e.maxWidth,placeholder:t("Width"),prefix:a.createElement(S.A,null),addonAfter:"px"})))),a.createElement(E.A,{span:12},a.createElement(p.A,{title:t("Height"),placement:"bottom"},a.createElement(u.A.Item,{name:"height"},a.createElement(G.A,{min:0,placeholder:t("Height"),prefix:a.createElement(k.A,null),addonAfter:"px"}))))),s.formFieldBorderEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Borders"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{Ce((e=>!e)),Ie&&(t.borderWidth=null,t.borderColor="",t.borderStyle=""),se((e=>({...O.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},Ie?a.createElement(w.A,null):a.createElement(B.A,null)))),Ie&&a.createElement("div",{style:{marginBottom:4}},a.createElement(R.A,{borders:ne}))),s.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{De((e=>!e)),t.borderRadiusAll=Oe?0:5,P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},Oe?a.createElement(w.A,null):a.createElement(B.A,null)))),Oe&&a.createElement("div",{style:{marginBottom:4}},a.createElement(I.A,{form:l,oneBorderRadiusValue:Ee,setOneBorderRadiusValue:ve,elementSettings:e}))),s.formFieldBoxShadowEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Box shadow"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{tt((e=>!e)),et?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),P({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},et?a.createElement(w.A,null):a.createElement(B.A,null)))),et&&a.createElement("div",{style:{marginBottom:4}},a.createElement(U,{boxShadow:ue}))),s.formFieldVisibilityEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Display control")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Be,{elementSettings:e,form:l})))),s.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Amp visibility")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Ve,null)))))))};var Ze=o(78320);const et=()=>{const{__:e}=(0,L.s9)();return a.createElement(p.A,{trigger:["hover"],title:e("The font-size CSS property sets the size of the font."),placement:"top"},a.createElement(u.A.Item,{name:"mobileFontSize"},a.createElement(G.A,{min:0,placeholder:e("Font size"),prefix:a.createElement(xe.A,null),addonAfter:"px"})))};var tt=o(38927),ot=o(44484),at=o(96698);const lt=({form:e,elementSettings:t,name:o,icon:l,tooltipTitle:i=null,showTooltip:n=!0})=>{const{__:s}=(0,L.s9)(),m=e.getFieldValue(o),d=(0,M.XW)(),[c,g]=(0,a.useState)(t[o]);(0,a.useEffect)((()=>{t[o]!==e.getFieldValue(o)&&(e.setFieldValue(o,t[o]),g(t[o]))}),[t,e,o]),(0,a.useEffect)((()=>{c!==m&&g(m)}),[m,c,o]);const b=()=>{const a={[o]:!c};e.setFieldValue(o,!c),d({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}),g((e=>!e))};return a.createElement(u.A.Item,{name:o},n?a.createElement(p.A,{placement:"bottom",title:i||s(o.substring(4))},a.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":c}),onClick:b},l)):a.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":c}),onClick:b},l))};lt.defaultProps={imgParent:!1};const it=lt;var rt=o(11399),nt=o(52427);const{useToken:st}=c.A,mt=({form:e,elementSettings:t,showAddParagraph:o=!0,isButton:l=!1,linkProtocol:i,setLinkProtocol:s,linkTarget:m})=>{const{__:d}=(0,L.s9)(),{token:c}=st(),g=(0,Xe.hN)(),_=(0,M.XW)(),S=(0,M.K9)(),k=(0,a.useRef)(),B=(0,a.useRef)(null),w=(0,a.useRef)(null),[x,P]=(0,a.useState)(!1),[N,T]=(0,a.useState)(null),[R,I]=(0,a.useState)({start:0,end:0}),[C,D]=(0,a.useState)(!1);(0,je.A)((e=>{e.data.operation===O.Ru.APPLICATION_FOCUS_IN_IFRAME&&T(null)}));const[V,j]=(0,a.useState)(null);(0,a.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&j(!0)}),[]);const z=(0,a.useRef)(null),W=e=>{_({operation:O.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"}),g.success({message:d("It`s done!"),placement:"bottomRight"})},U=[{key:"1",label:d("This element"),onClick:()=>W("typograf")},{key:"2",label:d("The whole email"),onClick:()=>W("typograf_all")}],[q,X]=(0,a.useState)(),[$,Q]=(0,a.useState)(!1);(0,a.useEffect)((()=>{t.linkHref&&("https://"===t.linkHref.substring(0,8)||"http://"===t.linkHref.substring(0,7)?s("https://"):"mailto:"===t.linkHref.substring(0,7)?s("mailto:"):"tel:"===t.linkHref.substring(0,4)?s("tel:"):"sms:"===t.linkHref.substring(0,4)?s("sms:"):"ftp://"===t.linkHref.substring(0,6)?s("ftp://"):"skype:"===t.linkHref.substring(0,6)?s("skype:"):"viber:"===t.linkHref.substring(0,6)?s("viber:"):s("")),e.setFieldsValue({linkHref:t.linkHref?t.linkHref:"https://"})}),[e,t,s]);const K=(0,n.d4)(Ke.GH);(0,a.useEffect)((()=>{var e;null!==K&&void 0!==K&&null!==(e=K.items)&&void 0!==e&&e.length&&X((0,qe.cM)(K.items,d,((e,t)=>{Q(!1),S(O.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[K,X,d,Q,S]);(0,a.useEffect)((()=>{$&&z.current&&z.current.focus()}),[$]),(0,a.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||T(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||Q(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.addEventListener("click",t)}}),[]);const Y=(0,a.useCallback)((({target:e})=>{if(e&&!C){const{selectionStart:t,selectionEnd:o}=e;I({start:t,end:o})}D(!1)}),[C]);(0,a.useEffect)((()=>Y({target:null===m||void 0===m?void 0:m.target})),[m,Y]);const J=(o,a)=>{const l=document.getElementById(a);if(l){var i,r;const n=null===(i=l.value)||void 0===i?void 0:i.substring(0,R.start),s=null===(r=l.value)||void 0===r?void 0:r.substring(R.end),m=a.substring(a.lastIndexOf("_")+1);_({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{[m]:n+o+s}}),e.setFieldValue(m,n+o+s),l.focus(),setTimeout((()=>{l.selectionStart=R.start,l.selectionEnd=R.start+o.length}),400),D(!0)}};return(0,a.useEffect)((()=>{var e;P(!(null===(e=t.textReplacer)||void 0===e||!e.length))}),[t,e]),a.createElement(a.Fragment,null,o&&!t.showOnMobile&&a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:20,style:{paddingBottom:4}},a.createElement(E.A,{span:12,gutter:20},a.createElement(rt.A,{form:e,elementSettings:t,name:"textAlign"}))),a.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:20}})),t.showOnMobile&&a.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:20}}),a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(u.A.Item,{name:"AddImage",style:{marginBottom:c.formItemMarginBottomXS}},a.createElement(f.Ay,{icon:a.createElement(F.A,{icon:"AddImage"}),onClick:()=>W("add_img"),style:{width:"100%"}},d("Add image")))),a.createElement(E.A,{span:12},a.createElement(u.A.Item,{name:"Typography",style:{marginBottom:c.formItemMarginBottomXS}},a.createElement(tt.A,{arrow:!0,menu:{items:U},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected-element-panel")},a.createElement(f.Ay,{icon:a.createElement(F.A,{icon:"Typograf"}),onClick:()=>W("typograf"),style:{width:"100%"}},d("Typography"))))),q&&a.createElement(E.A,{span:24,id:"merge_tags_wrapper",style:{marginBottom:0}},a.createElement(f.Ay,{id:"merge_tags_button",icon:a.createElement(F.A,{icon:"MergeTags"}),style:{width:"100%",display:$?"none":"block"},onClick:()=>Q(!0)},d("Merge tags")),a.createElement(v.A,{ref:z,popupClassName:"merge-tags",options:q,placeholder:d("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const o=t.map(((t,o)=>{const l=t.label.split(new RegExp(`(${e})`,"gi"));return a.createElement("span",{key:t.value},0!==o&&a.createElement("span",null,"\xa0/\xa0"),l.map(((t,o)=>t.toLowerCase()===e.toLowerCase()?a.createElement("span",{key:o,style:{color:"red"}},t):t)))}));return a.createElement("div",{title:t.map((e=>e.label)).join(" / ")},o)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(o,a)=>{if(Q(!1),o){const l=K.syntax.length>1?q.findIndex((e=>e.key===a[0].key)):0,i=K.syntax[l].replace("%value%",o[o.length-1]);"selected_button_form_href"===(null===N||void 0===N?void 0:N.getAttribute("id"))||"selected_text_form_linkHref"===(null===N||void 0===N?void 0:N.getAttribute("id"))||"selected_text_form_textReplacer"===(null===N||void 0===N?void 0:N.getAttribute("id"))?J(i,null===N||void 0===N?void 0:N.getAttribute("id")):(e.setFieldValue("textReplacer",i),_({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:i}}))}},style:{display:$?"block":"none",width:"100%"},open:$,onKeyDown:e=>{"Escape"===e.key&&Q(!1)}}))),a.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:t.showOnMobile?20:0,marginTop:20}}),!t.showOnMobile&&a.createElement("div",{className:"form-group-title"},d("Text")),a.createElement(p.A,{trigger:["hover"],title:d("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},a.createElement(u.A.Item,{name:"fontFamily",className:"form-item-margin-xs"},a.createElement(nt.A,{textEditor:!0}))),!t.showOnMobile&&a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:d("Font size"),placement:"bottom"},a.createElement(u.A.Item,{name:"fontSize"},a.createElement(G.A,{min:0,placeholder:d("Font size"),prefix:a.createElement(xe.A,null),addonAfter:"px"})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:d("Line height"),placement:"bottom"},a.createElement(u.A.Item,{name:"lineHeight"},a.createElement(G.A,{min:0,placeholder:d("Line height"),prefix:a.createElement(Ze.A,null),addonAfter:"px"}))))),a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:3},a.createElement(it,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:d(V?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:a.createElement(Pe.A,{className:"selected-text-common-form__icon-radius"})})),a.createElement(E.A,{span:3},a.createElement(it,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:d(V?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:a.createElement(Ne.A,{className:"selected-text-common-form__icon-radius"})})),a.createElement(E.A,{span:3},a.createElement(it,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:d(V?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:a.createElement(ot.A,{className:"selected-text-common-form__icon-radius"})})),a.createElement(E.A,{span:3},a.createElement(it,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:d(V?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:a.createElement(at.A,{className:"selected-text-common-form__icon-radius"})})),o&&a.createElement(E.A,{span:3},a.createElement(it,{form:e,className:r()("selected-text-common-form__button selected-text-common-form__button_style",{"selected-text-common-form__button--active":"string"===typeof t.linkHref}),elementSettings:t,name:"textLink",tooltipTitle:d("Link"),icon:a.createElement(y.A,{className:"selected-text-common-form__icon-radius"}),onSelect:Y})),l&&a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:d("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},a.createElement(u.A.Item,{name:"textColor",rules:[{message:d("Please set the font color")}]},a.createElement(H.A,{placeholder:d("Color"),usedColors:t.usedColors})))),!l&&a.createElement(E.A,{span:3},a.createElement(p.A,{title:d("Text replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button ant-form-item",{"selected-td-form__button--active":x}),icon:a.createElement(F.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{P(!x),x?(e.setFieldValue("textReplacer",""),_({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:""}})):setTimeout((()=>B.current.focus()))},ref:w})))),o&&"string"===typeof t.linkHref&&a.createElement(p.A,{trigger:["hover"],title:d("The URL that the hyperlink directs to."),placement:"bottom"},a.createElement(u.A.Item,{name:"linkHref"},a.createElement(A.A,{ref:k,addonBefore:a.createElement(Qe.Ai,{linkProtocol:i,handleLinkProtocolsChange:t=>{e.setFieldValue("linkHref","mergetag"!==t?t:""),s(t)},__:d}),allowClear:!0,placeholder:d("Hyperlink URL"),autoFocus:null===t||void 0===t?void 0:t.isNewLink,onSelect:Y,prefix:a.createElement(Qe.RM,{linkProtocol:i})}))),!l&&x&&a.createElement(p.A,{trigger:["hover"],title:d("Text"),placement:"bottom"},a.createElement(u.A.Item,{name:"textReplacer"},a.createElement(A.A,{placeholder:d("The code that will replace this text"),allowClear:!0,prefix:a.createElement("span",{className:"addon-text-content"},d("Text")),onChange:e=>{""!==e.target.value&&w.current.classList.add("selected-td-form__button--active")},ref:B,onSelect:Y}))),!l&&a.createElement(b.A,{gutter:10,style:{paddingBottom:4}},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:d("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},a.createElement(u.A.Item,{name:"textColor",rules:[{message:d("Please set the font color")}]},a.createElement(H.A,{placeholder:d("Color"),usedColors:t.usedColors})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:d("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},a.createElement(u.A.Item,{name:"textBackgroundColor",rules:[{message:d("Please set the background color")}]},a.createElement(H.A,{placeholder:d("Background color"),usedColors:t.usedColors}))))))};var dt=o(81149),ct=o(2922),ut=o(60994);const pt=({form:e,elementSettings:t,showAddParagraph:o=!0,isButton:l=!1})=>{const{__:i}=(0,L.s9)(),r=(0,M.XW)(),c=(0,n.wA)(),{emailId:g}=(0,d.g)(),b=(0,n.d4)(g?s.Hs:m.gm).hasOwnProperty("type")?O.IE:O.Tm,[E,v]=(0,a.useState)(null);(0,a.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&v(!0)}),[]);const S=e=>{r({operation:O.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"})},k=[{key:"1",label:i("This element"),onClick:()=>S("typograf")},{key:"2",label:i("The whole email"),onClick:()=>S("typograf_all")}],[B,w]=(0,a.useState)(t.textAlign),[x,P]=(0,a.useState)(t.linkHref),N=e=>w(e);return(0,a.useEffect)((()=>{w(t.textAlign),P(t.linkHref)}),[t]),a.createElement("div",{className:"selected_text_common_form_mobile"},a.createElement(_.A,{size:"8",split:a.createElement(h.A,{type:"vertical"})},a.createElement(_.A,{size:8,className:"selected_text_common_form_mobile__group"},a.createElement("div",{style:{width:190}},a.createElement(p.A,{trigger:["hover"],title:i("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},a.createElement(u.A.Item,{name:"fontFamily"},a.createElement(nt.A,{textEditor:!0,codeMode:!0})))),a.createElement("div",{style:{width:90}},a.createElement(p.A,{trigger:["hover"],title:i("Font size"),placement:"bottom"},a.createElement(u.A.Item,{name:"fontSize"},a.createElement(G.A,{min:0,placeholder:i("Font size"),prefix:a.createElement(xe.A,null),addonAfter:"px"})))),a.createElement("div",{style:{width:90}},a.createElement(p.A,{trigger:["hover"],title:i("Line height"),placement:"bottom"},a.createElement(u.A.Item,{name:"lineHeight"},a.createElement(G.A,{min:0,placeholder:i("Line height"),prefix:a.createElement(Ze.A,null),addonAfter:"px"}))))),a.createElement(_.A,{size:8,className:"selected_text_common_form_mobile__group"},a.createElement(it,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:i(E?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:a.createElement(Pe.A,{className:"selected-td-form__icon-radius"})}),a.createElement(it,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:i(E?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:a.createElement(Ne.A,{className:"selected-td-form__icon-radius"})}),a.createElement(it,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:i(E?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:a.createElement(ot.A,{className:"selected-td-form__icon-radius"})}),a.createElement(it,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:i(E?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:a.createElement(at.A,{className:"selected-td-form__icon-radius"})})),a.createElement(_.A,{size:8,className:"selected_text_common_form_mobile__group"},a.createElement(p.A,{trigger:["hover"],title:i("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},a.createElement(u.A.Item,{name:"textColor",rules:[{message:i("Please set the font color")}]},a.createElement(H.A,{placeholder:i("Color"),usedColors:t.usedColors,codeMode:!0}))),!l&&a.createElement(a.Fragment,null,a.createElement(p.A,{trigger:["hover"],title:i("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},a.createElement(u.A.Item,{name:"textBackgroundColor",rules:[{message:i("Please set the background color")}]},a.createElement(H.A,{placeholder:i("Background color"),usedColors:t.usedColors}))))),o&&a.createElement(_.A,{size:8,className:"selected_text_common_form_mobile__group"},a.createElement(a.Fragment,null,"string"===typeof x?a.createElement(tt.A,{arrow:!0,dropdownRender:()=>a.createElement(p.A,{trigger:["hover"],title:i("The URL that the hyperlink directs to."),placement:"bottom"},a.createElement(u.A.Item,{name:"linkHref"},a.createElement(A.A,{allowClear:!0,placeholder:"href",prefix:a.createElement(y.A,null),autoFocus:null===t||void 0===t?void 0:t.isNewLink}))),overlayClassName:"codemode-textalign-dropdown",overlayStyle:{left:520,top:52,transform:"translateX(0)",marginLeft:57},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile")},a.createElement("div",null,a.createElement(it,{form:e,className:"selected-td-form__button selected-td-form__button_style selected-td-form__button--active",elementSettings:t,name:"textLink",icon:a.createElement(y.A,{className:"selected-td-form__icon-radius"}),showTooltip:!1}))):a.createElement(it,{form:e,className:"selected-td-form__button selected-td-form__button_style",elementSettings:t,name:"textLink",tooltipTitle:i("Link"),icon:a.createElement(y.A,{className:"selected-td-form__icon-radius"})}),a.createElement(tt.A,{arrow:!0,dropdownRender:()=>a.createElement(rt.A,{form:e,elementSettings:t,name:"textAlign",setAlignStateHandle:N}),overlayClassName:"codemode-textalign-dropdown",overlayStyle:{left:615,top:52,transform:"translateX(0)",marginLeft:57},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile")},a.createElement(f.Ay,{icon:"right"===B?a.createElement(dt.A,null):"center"===B?a.createElement(ct.A,null):a.createElement(ut.A,null),className:"selected-td-form__button"})))),a.createElement(_.A,{size:8,className:"selected_text_common_form_mobile__group"},o&&a.createElement(p.A,{trigger:["hover"],title:i("Add paragraph"),placement:"bottom"},a.createElement(f.Ay,{icon:a.createElement(F.A,{icon:"Paragraph"}),onClick:()=>S("add_p"),className:"selected-td-form__button"})),a.createElement(p.A,{trigger:["hover"],title:i("Add inline image"),placement:"bottom"},a.createElement(f.Ay,{icon:a.createElement(F.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),onClick:()=>S("add_img"),className:"selected-td-form__button"})),a.createElement(tt.A,{arrow:!0,menu:{items:k},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile"),overlayStyle:{left:750,top:52,transform:"translateX(0)",marginLeft:57}},a.createElement(f.Ay,{icon:a.createElement(F.A,{icon:"Typograf"}),className:"selected-td-form__button"})),a.createElement(f.Ay,{icon:a.createElement(te.A,null),type:"icon",style:{marginLeft:26},onClick:()=>{r({operation:O.Ru.SANDBOX_ELEMENT_ACTIVE_RESET}),c((0,Ge.Fk)()),setTimeout((()=>{b===O.IE?c((0,m.A9)({type:null})):c((0,s.A9)({type:null}))}),300)}}))))},gt=({form:e,elementSettings:t,imgParent:o,name:l="mobileAlign"})=>{var i;const{__:r}=(0,L.s9)(),[n,s]=(0,a.useState)(null===(i=t[l])||void 0===i?void 0:i.value),m=(0,M.XW)(),d=o=>{const a=o.target.value,i={[l]:{classNamePrefix:"em-mob-text_align-",value:""}};a!==n?s(a):(s(""),e.setFieldsValue(i),m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return a.createElement(u.A.Item,{name:l},a.createElement(C.Ay.Group,{disabled:o&&!t.parent},a.createElement(_.A,{size:8},a.createElement(p.A,{placement:"bottom",title:r("Text align left")},a.createElement(C.Ay.Button,{value:"left",onClick:d},a.createElement(ut.A,null))),a.createElement(p.A,{placement:"bottom",title:r("Text align center")},a.createElement(C.Ay.Button,{value:"center",onClick:d},a.createElement(ct.A,null))),a.createElement(p.A,{placement:"bottom",title:r("Text align right")},a.createElement(C.Ay.Button,{value:"right",onClick:d},a.createElement(dt.A,null))),a.createElement(p.A,{placement:"bottom",title:r("Text align justify")},a.createElement(C.Ay.Button,{value:"justify",onClick:d},a.createElement(F.A,{icon:"Justify"}))))))};gt.defaultProps={imgParent:!1};const bt=gt,Et=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,M.XW)(),[l]=u.A.useForm(),i=(0,n.d4)(Ge.Ct),r=(0,n.d4)(Ge.CS),s=(0,n.d4)(Ge.Fv),m=(0,n.d4)(Ge.yy),d=s&&"bottom"!==m,[c,h]=(0,a.useState)("https://");(0,a.useEffect)((()=>{var t,o,a,i,r;e&&l.setFieldsValue({...e,linkHref:e.linkHref?e.linkHref:"https://",mobileFontSize:(0,Qe.ok)(null===(t=e.mobileFontSize)||void 0===t?void 0:t.value),mobileFontSizeDim:null===(o=e.mobileFontSize)||void 0===o?void 0:o.dim,mobileLineHeight:(0,Qe.ok)(null===(a=e.mobileLineHeight)||void 0===a?void 0:a.value),mobileLineHeightDim:null===(i=e.mobileLineHeight)||void 0===i?void 0:i.dim,mobileTextAlign:(0,Qe.ok)(null===(r=e.mobileTextAlign)||void 0===r?void 0:r.value)})}),[l,e]);return a.createElement(u.A,{form:l,layout:"vertical",name:"selected_text_form",autoComplete:"off",onValuesChange:t=>{const a=l.getFieldsValue(!0),i=Object.keys(t)[0];let r;switch(i){case"mobileFontSize":r={[i]:{classNamePrefix:"em-mob-font_size-",value:t[i],dim:a.mobileFontSizeDim}};break;case"mobileLineHeight":r={[i]:{classNamePrefix:"em-mob-line_height-",value:t[i],dim:a.mobileLineHeightDim}};break;case"mobileTextAlign":r={[i]:{classNamePrefix:"em-mob-text_align-",value:t[i]}};break;case"linkHref":let e=t[i];"https://http"===e.substring(0,12)&&(e=e.substring(8,e.length),l.setFieldValue("linkHref",e)),r={[i]:e},"https://"===t[i].substring(0,8)||"http://"===t[i].substring(0,7)?h("https://"):"mailto:"===t[i].substring(0,7)?h("mailto:"):"tel:"===t[i].substring(0,4)?h("tel:"):"sms:"===t[i].substring(0,4)?h("sms:"):"ftp://"===t[i].substring(0,6)?h("ftp://"):"skype:"===t[i].substring(0,6)?h("skype:"):"viber:"===t[i].substring(0,6)?h("viber:"):h("");break;default:r=t}o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r})},className:"element-controls",initialValues:{textAlign:"left",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textColor:"",textBackgroundColor:"",textLink:!1,textReplacer:""}},!d&&a.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},a.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),!(i===O.ND&&!d&&r.styles)&&a.createElement("div",{id:"selected_element_form_desktop_props",style:{paddingRight:0}},a.createElement("div",{className:"selected_form-props-wrapper"},d?a.createElement(pt,{form:l,elementSettings:e}):a.createElement(mt,{form:l,elementSettings:e,linkProtocol:c,setLinkProtocol:h}))),!d&&a.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:i===O.ND&&r.styles?"block":"none"}},a.createElement("div",{className:"selected_form-mobile-props-wrapper"},a.createElement(b.A,{gutter:20},a.createElement(E.A,{span:12},a.createElement(bt,{form:l,elementSettings:e,name:"mobileTextAlign"}))),!!e.showOnMobile&&a.createElement(mt,{form:l,elementSettings:e,linkProtocol:c,setLinkProtocol:h}),a.createElement(b.A,{gutter:10,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(et,null)),a.createElement(E.A,{span:12},a.createElement(u.A.Item,{name:"mobileLineHeight"},a.createElement(G.A,{min:0,placeholder:t("Line height"),prefix:a.createElement(Ze.A,null),addonAfter:"px"})))))))},{useToken:ht}=c.A,ft=({form:e,elementSettings:t,label:o})=>{var l;const{__:i}=(0,L.s9)(),r=(0,a.useRef)(),[n,s]=(0,a.useState)("none"===(null===(l=t.mobileBackgroundColor)||void 0===l?void 0:l.value)),{token:m}=ht(),d=(0,M.XW)();return a.createElement(a.Fragment,null,a.createElement(p.A,{trigger:["hover"],title:i("Background color"),placement:"left"},a.createElement(u.A.Item,{name:"mobileBackgroundColor",style:{marginBottom:m.formItemMarginBottomXS/2}},a.createElement(H.A,{onChange:e=>{s(!1)},placeholder:o,usedColors:t.usedColors})),a.createElement(_.A,{size:8,align:"end"},a.createElement(X.A,{ref:r,size:"small",checked:n,onChange:o=>{e.setFieldsValue({mobileBackgroundColor:""}),s((e=>!e)),d({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:n?"":"none"}}})},id:"without-background-color"}),a.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},a.createElement("label",{htmlFor:"without-background-color"},i("Without background color"))))))};o(3783);const vt=(e,t)=>{const{__:o}=(0,L.s9)();return a.createElement(p.A,{title:o("During export, the element is converted into an image."),key:"exportAsPicture"},a.createElement(_.A,{size:10,align:"baseline"},a.createElement(u.A.Item,{name:"exportAsPicture",valuePropName:"checked"},a.createElement(X.A,{size:"small",id:"convern-in-image"})),a.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2}},a.createElement("label",{htmlFor:"convern-in-image"},o("Convert into an image")))))},{Option:_t}=q.A,At=a.createElement(q.A,{className:"select-after",getPopupContainer:e=>e.parentNode},a.createElement(_t,{value:"px"},"px"),a.createElement(_t,{value:"%"},"%")),{useToken:yt}=c.A,St=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,M.XW)(),[l]=u.A.useForm(),[i,r]=(0,a.useState)({}),[s,m]=(0,a.useState)({}),[d,c]=(0,a.useState)(!0),[v,_]=(0,a.useState)({}),[A,y]=(0,a.useState)({}),[k,x]=(0,a.useState)(!0),P=(0,n.d4)(Ge.Ct),N=(0,n.d4)(Ge.CS),C=(0,qe.rD)(),[D,j]=(0,a.useState)(""===e.backgroundImage[0].value),{token:z}=yt(),W=(0,n.d4)(Ge.Fv),X=(0,n.d4)(Ge.yy),$=W&&"bottom"!==X,[Q,K]=(0,a.useState)(!1),[J,Z]=(0,a.useState)(!1),[ee,te]=(0,a.useState)(!1),[oe,ae]=(0,a.useState)(!1),[le,ie]=(0,a.useState)(!1),[re,ne]=(0,a.useState)(!1),[se,me]=(0,a.useState)(!1),[de,ue]=(0,a.useState)(!1),[pe,ge]=(0,a.useState)(!1),[be,Ee]=(0,a.useState)(!1),[ve,Ae]=(0,a.useState)(!1),ye=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],Se=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}];(0,a.useEffect)((()=>{if(e){var t,o,a,i,n,s,d,u,p,g,b,E,h,f,v,A,S,k,B,w,P,N,T,R,I,C,L,F,O,M,D,V,z,W,G,H,U,q,X;const $=e.border,Q=e.boxShadow,Y=e.mobileBorder,J=e.mobileBoxShadow;r($),m(Q),_(Y),y(J);const ee=Object.keys($).find((e=>{var t,o,a;return(null===(t=$[e])||void 0===t?void 0:t.width)||(null===(o=$[e])||void 0===o?void 0:o.style)||(null===(a=$[e])||void 0===a?void 0:a.color)})),oe=Object.keys(Y).find((e=>{var t,o,a;return(null===(t=Y[e])||void 0===t?void 0:t.width)||(null===(o=Y[e])||void 0===o?void 0:o.style)||(null===(a=Y[e])||void 0===a?void 0:a.color)}));l.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.dim,maxWidth:null===(a=e.maxWidth)||void 0===a?void 0:a.value,maxWidthDim:null===(i=e.maxWidth)||void 0===i?void 0:i.dim,minWidth:null===(n=e.minWidth)||void 0===n?void 0:n.value,minWidthDim:null===(s=e.minWidth)||void 0===s?void 0:s.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",borderPosition:ee||"all",borderWidth:(null===(d=$[ee])||void 0===d?void 0:d.width)||"",borderColor:(null===(u=$[ee])||void 0===u?void 0:u.color)||"",borderStyle:(null===(p=$[ee])||void 0===p?void 0:p.style)||"",borderRadiusAll:(0,Qe.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Qe.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Qe.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Qe.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Qe.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Qe.ok)(null===(g=e.boxShadow)||void 0===g?void 0:g.inset)||!1,boxShadowHOffset:(0,Qe.ok)(null===(b=e.boxShadow)||void 0===b?void 0:b.hOffset),boxShadowVOffset:(0,Qe.ok)(null===(E=e.boxShadow)||void 0===E?void 0:E.vOffset),boxShadowBlurRadius:(0,Qe.ok)(null===(h=e.boxShadow)||void 0===h?void 0:h.blurRadius),boxShadowSpreadRadius:(0,Qe.ok)(null===(f=e.boxShadow)||void 0===f?void 0:f.spreadRadius),boxShadowColor:(0,Qe.ok)(null===(v=e.boxShadow)||void 0===v?void 0:v.color),mobileWidth:(0,Qe.xc)(null===(A=e.mobileWidth)||void 0===A?void 0:A.value),mobileWidthDim:null===(S=e.mobileWidth)||void 0===S?void 0:S.dim,mobileAlign:null===(k=e.mobileAlign)||void 0===k?void 0:k.value,mobileBorderPosition:oe||"all",mobileBorderWidth:null!==(null===(B=Y[oe])||void 0===B?void 0:B.width)?null===(w=Y[oe])||void 0===w?void 0:w.width:"",mobileBorderColor:(null===(P=Y[oe])||void 0===P?void 0:P.color)||"",mobileBorderStyle:(null===(N=Y[oe])||void 0===N?void 0:N.style)||"",mobileBorderRadiusAll:(0,Qe.ok)(e.mobileBorderRadius.all),mobileRadiusTopLeft:(0,Qe.ok)(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileRadiusBottomLeft:(0,Qe.ok)(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileRadiusTopRight:(0,Qe.ok)(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileRadiusBottomRight:(0,Qe.ok)(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:(0,Qe.ok)(null===(T=e.mobileBoxShadow)||void 0===T?void 0:T.inset)||!1,mobileBoxShadowHOffset:(0,Qe.ok)(null===(R=e.mobileBoxShadow)||void 0===R?void 0:R.hOffset),mobileBoxShadowVOffset:(0,Qe.ok)(null===(I=e.mobileBoxShadow)||void 0===I?void 0:I.vOffset),mobileBoxShadowBlurRadius:(0,Qe.ok)(null===(C=e.mobileBoxShadow)||void 0===C?void 0:C.blurRadius),mobileBoxShadowSpreadRadius:(0,Qe.ok)(null===(L=e.mobileBoxShadow)||void 0===L?void 0:L.spreadRadius),mobileBoxShadowColor:(0,Qe.ok)(null===(F=e.mobileBoxShadow)||void 0===F?void 0:F.color),mobileBackgroundColor:(0,Qe.ok)("none"!==(null===(O=e.mobileBackgroundColor)||void 0===O?void 0:O.value)?null===(M=e.mobileBackgroundColor)||void 0===M?void 0:M.value:""),mobileBackgroundImage:"none"!==e.mobileBackgroundImage[0].value?e.mobileBackgroundImage[0].value:"",mobileBackgroundPositionX:(0,Qe.ok)(null===(D=e.mobileBackgroundPositionX)||void 0===D?void 0:D.value),mobileBackgroundPositionY:(0,Qe.ok)(null===(V=e.mobileBackgroundPositionY)||void 0===V?void 0:V.value),mobileBackgroundRepeat:null!==(z=e.mobileBackgroundRepeat)&&void 0!==z&&z.value?null===(W=e.mobileBackgroundRepeat)||void 0===W?void 0:W.value:"none",exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,Qe.ok)(e.borderRadius.all)&&((0,Qe.ok)(e.borderRadius.topLeft)||(0,Qe.ok)(e.borderRadius.bottomLeft)||(0,Qe.ok)(e.borderRadius.topRight)||(0,Qe.ok)(e.borderRadius.bottomRight))?c(!1):c(!0),(0,Qe.ok)(e.mobileBorderRadius.topLeft)||(0,Qe.ok)(e.mobileBorderRadius.bottomLeft)||(0,Qe.ok)(e.mobileBorderRadius.topRight)||(0,Qe.ok)(e.mobileBorderRadius.bottomRight)?x(!1):x(!0),j(""===e.backgroundImage[0].value),K(!(null===(G=$[ee])||void 0===G||!G.width)),Z(!(null===(H=Y[oe])||void 0===H||!H.width)),te(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),ae(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),ie(!!e.boxShadow),ne(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),me(!(null===(U=e.width)||void 0===U||!U.value)||!(null===(q=e.minWidth)||void 0===q||!q.value)||!(null===(X=e.maxWidth)||void 0===X||!X.value)),ue(!!e.mobileWidth.value),ge(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Ee(!!e.mobileBackgroundColor.value),Ae(!!e.exportAsPicture)}}),[l,e]);return a.createElement(u.A,{form:l,layout:"vertical",name:"selected_table_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,show:"all",width:{value:"",dim:""},maxWidth:{value:"",dim:""},minWidth:{value:"",dim:""},align:"",mobileAlign:"",border:"",boxShadow:"",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileBackgroundColor:"",mobileBackgroundImage:""},onValuesChange:t=>{const a=l.getFieldsValue(!0),n=Object.keys(t)[0];let s;switch(n){case"exportAsPicture":s={exportAsPicture:a.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":s={boxShadow:{hOffset:a.boxShadowHOffset,vOffset:a.boxShadowVOffset,blurRadius:a.boxShadowBlurRadius,spreadRadius:a.boxShadowSpreadRadius,color:a.boxShadowColor,inset:a.boxShadowInset}};break;case"borderStyle":s={border:{[a.borderPosition]:{...i[a.borderPosition],style:t[n]}}},"all"===a.borderPosition?r((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],style:t[n]}}))):r((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],style:t[n]}})));break;case"borderColor":s={border:{[a.borderPosition]:{...i[a.borderPosition],color:t[n]}}},"all"===a.borderPosition?r((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],color:t[n]}}))):r((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],color:t[n]}})));break;case"borderWidth":s={border:{[a.borderPosition]:{...i[a.borderPosition],width:t[n]}}},"all"===a.borderPosition?r((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],width:t[n]}}))):r((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],width:t[n]}})));break;case"borderPosition":l.setFieldsValue({borderWidth:i[t[n]].width||"",borderColor:i[t[n]].color||"",borderStyle:i[t[n]].style||""});break;case"width":s={[n]:{value:t[n],dim:a.widthDim}};break;case"widthDim":s={width:{value:a.width,dim:t[n]}};break;case"maxWidth":s={[n]:{value:t[n],dim:a.maxWidthDim}};break;case"maxWidthDim":s={maxWidth:{value:a.maxWidth,dim:t[n]}};break;case"minWidth":s={[n]:{value:t[n],dim:a.minWidthDim}};break;case"minWidthDim":s={minWidth:{value:a.minWidth,dim:t[n]}};break;case"backgroundImage":j(""===t[n]),s={[n]:[{...e.backgroundImage[0],value:t[n]}],backgroundSize:"cover"};break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":s={borderRadius:{[O.wF[n]]:+t[n]}};break;case"mobileWidth":s={[n]:{classNamePrefix:"em-mob-width-",value:t[n],dim:a.mobileWidthDim}};break;case"mobileWidthDim":s={mobileWidth:{classNamePrefix:"em-mob-width-",value:a.mobileWidth,dim:t[n]}};break;case"mobileBorderStyle":s={mobileBorder:{[a.mobileBorderPosition]:{...v[a.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?_((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):_((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":s={mobileBorder:{[a.mobileBorderPosition]:{...v[a.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?_((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):_((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":s={mobileBorder:{[a.mobileBorderPosition]:{...v[a.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?_((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):_((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderPosition":l.setFieldsValue({mobileBorderWidth:v[t[n]].width||"",mobileBorderColor:v[t[n]].color||"",mobileBorderStyle:v[t[n]].style||""});break;case"mobileBorderRadiusAll":case"mobileRadiusTopLeft":case"mobileRadiusBottomLeft":case"mobileRadiusTopRight":case"mobileRadiusBottomRight":s={mobileBorderRadius:{[Qe.NW[n]]:t[n],classNamePrefix:"em-mob-border_radius_"+Qe.NW[n]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":s={mobileBoxShadow:{hOffset:a.mobileBoxShadowHOffset,vOffset:a.mobileBoxShadowVOffset,blurRadius:a.mobileBoxShadowBlurRadius,spreadRadius:a.mobileBoxShadowSpreadRadius,color:a.mobileBoxShadowColor,inset:a.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileBackgroundColor":s={[n]:{classNamePrefix:"em-mob-background_color-",value:t[n]}};break;case"mobileBackgroundImage":s={[n]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[n]}]};break;case"mobileBackgroundPositionX":s={[n]:{classNamePrefix:"em-mob-background_position_x-",value:t[n]}};break;case"mobileBackgroundPositionY":s={[n]:{classNamePrefix:"em-mob-background_position_x-",value:t[n]}};break;case"mobileBackgroundRepeat":s={[n]:{classNamePrefix:"em-mob-background_repeat-",value:t[n]}};break;case"mobileAlign":s={[n]:{classNamePrefix:"em-mob-table_align-",value:t[n]}};break;default:s=t}"borderPosition"!==n&&o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:s})},autoComplete:"off",className:"element-controls"},!$&&a.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},a.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),P===O.ND&&N.styles?a.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},a.createElement("div",{className:"selected_form-mobile-props-wrapper"},a.createElement("div",{style:{paddingBottom:4}},a.createElement(_e,{form:l,elementSettings:e})),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Size"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{ue((e=>!e)),de&&(t.mobileWidth="",o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"}}}))}))}},de?a.createElement(w.A,null):a.createElement(B.A,null)))),de&&a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Table width"),placement:"left"},a.createElement("div",{style:{marginBottom:z.formItemMarginBottomMD+4}},a.createElement(Y,{form:l,name:"mobileWidth",elementSettings:e})))))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Background"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{Ee((e=>!e)),t.mobileBackgroundColor=be?"":"#E5E5E5",o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},be?a.createElement(w.A,null):a.createElement(B.A,null)))),be&&a.createElement("div",{style:{marginBottom:(C.formTableFieldBackgroundImageEnabled,z.formItemMarginBottomMD+4)}},a.createElement(ft,{form:l,elementSettings:e})),!1,C.formFieldBorderEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Borders"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{Z((e=>!e)),J&&(t.mobileBorderWidth=null,t.mobileBorderColor="",t.mobileBorderStyle=""),_((e=>({...O.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderColor,style:t.mobileBorderStyle,width:t.mobileBorderWidth,classNamePrefix:"em-mob-border_"+t.mobileBorderPosition+"-"}}}})}))}},J?a.createElement(w.A,null):a.createElement(B.A,null)))),J&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(ce,{mobileBorders:v}))),C.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{ae((e=>!e)),t.mobileBorderRadiusAll=oe?null:5,o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},oe?a.createElement(w.A,null):a.createElement(B.A,null)))),oe&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(he,{form:l,oneMobileBorderRadiusValue:k,setOneMobileBorderRadiusValue:x}))),C.formFieldBoxShadowEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Box shadow"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{ne((e=>!e)),re?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},re?a.createElement(w.A,null):a.createElement(B.A,null)))),re&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(fe,{mobileBoxShadow:A,form:l,elementSettings:e}))),C.formFieldVisibilityEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Display control")),a.createElement(b.A,{gutter:20},a.createElement(E.A,{span:12},a.createElement("div",{style:{paddingBottom:4}},a.createElement(Be,{elementSettings:e,form:l}))))),C.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Amp visibility")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Ve,null)))))):a.createElement("div",{id:"selected_element_form_desktop_props"},a.createElement("div",{className:"selected_form-props-wrapper"},a.createElement("div",{style:{paddingBottom:4}},a.createElement(V,{form:l,elementSettings:e,tooltipTitle:t("The align attribute sets the horizontal alignment of the table.")})),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Size"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{me((e=>!e)),se&&(t.width="",t.minWidth="",t.maxWidth="",o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{width:{value:null,dim:"px"},minWidth:{value:null,dim:"px"},maxWidth:{value:null,dim:"px"}}}))}))}},se?a.createElement(w.A,null):a.createElement(B.A,null)))),se&&a.createElement(a.Fragment,null,a.createElement(p.A,{trigger:["hover"],title:t("Table width"),placement:"left"},a.createElement(u.A.Item,{name:"width",style:{marginBottom:z.formItemMarginBottomXS}},a.createElement(G.A,{min:0,placeholder:t("Width"),prefix:a.createElement(S.A,null),addonAfter:a.createElement(u.A.Item,{name:"widthDim",noStyle:!0},At),style:{width:"100%"}}))),a.createElement(b.A,{gutter:10,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Minimum width"),placement:"left"},a.createElement(u.A.Item,{name:"minWidth"},a.createElement(G.A,{min:0,placeholder:t("Table min width"),prefix:a.createElement(F.A,{icon:"MinWidth"}),addonAfter:a.createElement(u.A.Item,{name:"minWidthDim",noStyle:!0},At)})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Maximum width"),placement:"top"},a.createElement(u.A.Item,{name:"maxWidth"},a.createElement(G.A,{min:0,placeholder:t("Table max width"),prefix:a.createElement(F.A,{icon:"MaxWidth"}),addonAfter:a.createElement(u.A.Item,{name:"maxWidthDim",noStyle:!0},At)})))))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Background"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{ge((e=>!e)),pe?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",j(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},pe?a.createElement(w.A,null):a.createElement(B.A,null)))),pe&&a.createElement(b.A,{gutter:10,style:{marginBottom:D?16:0}},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},a.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:C.formTableFieldBackgroundImageEnabled?z.formItemMarginBottomXS:z.formItemMarginBottomMD+4}},a.createElement(H.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),C.formTableFieldBackgroundImageEnabled&&a.createElement(E.A,{span:D?12:24},a.createElement("div",{style:{paddingBottom:D?4:0}},a.createElement(T.A,{form:l,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"})),!D&&a.createElement(u.A.Item,{style:{marginBottom:"0"}},a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},a.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:z.formItemMarginBottomXS}},a.createElement(G.A,{placeholder:t("Horizontal position"),prefix:a.createElement(F.A,{icon:"BgPositionHorizontal"})})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},a.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:z.formItemMarginBottomXS}},a.createElement(G.A,{placeholder:t("Vertical position"),prefix:a.createElement(F.A,{icon:"BgPositionVertical"})}))))),a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},a.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:z.formItemMarginBottomMD+4}},a.createElement(q.A,{placeholder:"Please choose",options:ye,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},a.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:z.formItemMarginBottomMD+4}},a.createElement(q.A,{placeholder:"Please choose",options:Se,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),C.formFieldBorderEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Borders"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{K((e=>!e)),Q&&(t.borderWidth=null,t.borderColor="",t.borderStyle=""),r((e=>({...O.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},Q?a.createElement(w.A,null):a.createElement(B.A,null)))),Q&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(R.A,{borders:i}))),C.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{te((e=>!e)),t.borderRadiusAll=ee?0:5,o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},ee?a.createElement(w.A,null):a.createElement(B.A,null)))),ee&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(I.A,{form:l,oneBorderRadiusValue:d,setOneBorderRadiusValue:c,elementSettings:e}))),C.formFieldBoxShadowEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Box shadow"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{ie((e=>!e)),le?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},le?a.createElement(w.A,null):a.createElement(B.A,null)))),le&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(U,{boxShadow:s}))),C.formFieldExportAsPictureEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Export settings"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{Ae((e=>!e)),ve&&(t.exportAsPicture=!1,o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))}))}},ve?a.createElement(w.A,null):a.createElement(B.A,null)))),ve&&a.createElement(vt,{form:l,elementSettings:e})),C.formFieldVisibilityEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Display control")),a.createElement(b.A,{gutter:20},a.createElement(E.A,{span:12},a.createElement("div",{style:{paddingBottom:4}},a.createElement(Be,{elementSettings:e,form:l}))))),C.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Amp visibility")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Ve,null)))))))};var kt=o(10206);const Bt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,M.XW)(),[l]=u.A.useForm(),i=(0,qe.rD)(),r=(0,n.d4)(Ge.Fv),s=(0,n.d4)(Ge.yy),[m,d]=(0,a.useState)({});(0,a.useEffect)((()=>{e&&l.setFieldsValue(e)}),[l,e]);return a.createElement(u.A,{form:l,layout:"vertical",name:"selected_link_form",initialValues:{href:"https://",target:"",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textReplacer:""},onValuesChange:t=>{o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:t})},autoComplete:"off",className:"element-controls"},r&&"bottom"!==s?a.createElement(pt,{form:l,elementSettings:e,showAddParagraph:!1}):a.createElement(a.Fragment,null,a.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"left"},a.createElement(u.A.Item,{name:"href",style:{marginBottom:24,paddingRight:10}},a.createElement(A.A,{allowClear:!0,placeholder:"href",prefix:a.createElement(y.A,null),onSelect:({target:e})=>{const{selectionStart:t,selectionEnd:o}=e;e&&d({target:e,selection:{start:t,end:o}})}}))),i.formLinkFieldInsertImageEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Actions with the chosen text")),a.createElement(u.A.Item,null,a.createElement(f.Ay,{icon:a.createElement(kt.A,null),onClick:()=>{return e="add_img",void o({operation:O.Ru.SANDBOX_ELEMENT_TEXT,action:e});var e}},t("Add inline image")))),a.createElement(mt,{form:l,elementSettings:e,showAddParagraph:!1,linkTarget:m})))},wt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),[o]=u.A.useForm(),l=(0,M.XW)(),i=(0,n.d4)(Ge.Ct),r=(0,n.d4)(Ge.CS),s=(0,n.d4)(Ge.Fv),m=(0,n.d4)(Ge.yy),d=s&&"bottom"!==m;(0,a.useEffect)((()=>{var t,a,l,i,r;e&&o.setFieldsValue({...e,height:null===(t=e.height)||void 0===t?void 0:t.value,heightDim:null===(a=e.height)||void 0===a?void 0:a.dim,mobileHeight:(r=null===(l=e.mobileHeight)||void 0===l?void 0:l.value,r&&"auto"!==r?r:0===r?"0":""),mobileHeightDim:null===(i=e.mobileHeight)||void 0===i?void 0:i.dim})}),[o,e]);return a.createElement(u.A,{form:o,layout:"vertical",name:"selected_vindent_form",initialValues:{height:"",heightDim:"",mobileHeight:"",mobileHeightDim:""},onValuesChange:t=>{const a=o.getFieldsValue(!0),i=Object.keys(t)[0];let r;switch(i){case"height":r={[i]:{value:t[i],dim:a.heightDim}};break;case"heightDim":r={height:{value:a.height,dim:t[i]}};break;case"mobileHeight":r={[i]:{classNamePrefix:"em-mob-height-",value:t[i],dim:a.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:a.mobileHeight,dim:t[i]}};break;default:r=t}l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r})},autoComplete:"off"},!d&&a.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},a.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),i===O.ND&&r.styles?a.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:i===O.ND&&r.styles?"block":"none",marginBottom:10}},a.createElement("div",{className:"selected_form-mobile-props-wrapper"},a.createElement(b.A,{gutter:10,style:{marginBottom:20}},a.createElement(E.A,{span:12},a.createElement(Z,{form:o,name:"mobileHeight",elementSettings:e}))))):a.createElement("div",{id:"selected_element_form_desktop_props",style:{display:i===O.ND&&r.styles?"none":"block"}},a.createElement("div",{className:"selected_form-props-wrapper"},a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:14},a.createElement(u.A.Item,{name:"height"},a.createElement(G.A,{min:0,placeholder:t("Indent height"),prefix:a.createElement(k.A,null),addonAfter:"px"})))))))};var xt=o(50078),Pt=o(35850);const Nt=({form:e,elementSettings:t})=>{const{__:o}=(0,L.s9)(),l=(0,M.XW)(),[i,r]=(0,a.useState)(t.direction),n=o=>{const a=o.target.value,n={direction:""};a!==i?r(a):(r(""),e.setFieldsValue(n),l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:n}))};return a.createElement(u.A.Item,{name:"direction"},a.createElement(C.Ay.Group,null,a.createElement(_.A,{size:8},a.createElement(p.A,{placement:"top",title:o("Right to left")},a.createElement(C.Ay.Button,{value:"rtl",onClick:n},a.createElement(xt.A,null))),a.createElement(p.A,{placement:"top",title:o("Left to right")},a.createElement(C.Ay.Button,{value:"ltr",onClick:n},a.createElement(Pt.A,null))))))};Nt.defaultProps={};const Tt=Nt,{useToken:Rt}=c.A,It=({form:e,elementSettings:t,mobilePaddingsExt:o,setMobilePaddingsExt:l})=>{const{__:i}=(0,L.s9)(),{token:n}=Rt(),s=(0,M.XW)();return a.createElement(a.Fragment,null,a.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},a.createElement("div",{className:"padding-collapsed",style:{display:o?"block":"none"}},a.createElement(p.A,{title:i("Horizontal padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"mobilePaddingLeftRight"},a.createElement(G.A,{min:0,placeholder:i("Horizontal"),prefix:a.createElement(F.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),a.createElement("div",{className:"padding-extended",style:{display:o?"none":"block"}},a.createElement(p.A,{trigger:["hover"],title:i("Left padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"mobilePaddingLeft",style:{marginBottom:n.formItemMarginBottomXS}},a.createElement(G.A,{min:0,placeholder:i("Left"),prefix:a.createElement(F.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),a.createElement(p.A,{trigger:["hover"],title:i("Right padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"mobilePaddingRight"},a.createElement(G.A,{min:0,placeholder:i("Right"),prefix:a.createElement(F.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),a.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},a.createElement("div",{className:"padding-collapsed",style:{display:o?"block":"none"}},a.createElement(p.A,{title:i("Vertical padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"mobilePaddingTopBottom"},a.createElement(G.A,{min:0,placeholder:i("Vertical"),prefix:a.createElement(F.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),a.createElement("div",{className:"padding-extended",style:{display:o?"none":"block"}},a.createElement(p.A,{trigger:["hover"],title:i("Top padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"mobilePaddingTop",style:{marginBottom:n.formItemMarginBottomXS}},a.createElement(G.A,{min:0,placeholder:i("Top"),prefix:a.createElement(F.A,{icon:"PaddingTop"}),addonAfter:"px"}))),a.createElement(p.A,{trigger:["hover"],title:i("Bottom padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"mobilePaddingBottom"},a.createElement(G.A,{min:0,placeholder:i("Bottom"),prefix:a.createElement(F.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),a.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"none"}},a.createElement(p.A,{title:i("Individual padding"),placement:"bottom"},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!o}),onClick:()=>{l((e=>!e));const a=e.getFieldsValue(!0);o||(a.mobilePaddingLeftRight=a.mobilePaddingLeft,a.mobilePaddingTopBottom=a.mobilePaddingTop,a.mobilePaddingRight=a.mobilePaddingLeft,a.mobilePaddingBottom=a.mobilePaddingTop,s({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobilePadding:{top:""!==a.mobilePaddingTop?a.mobilePaddingTop:null,bottom:""!==a.mobilePaddingTopBottom?a.mobilePaddingTopBottom:null,left:""!==a.mobilePaddingLeft?a.mobilePaddingLeft:null,right:""!==a.mobilePaddingRight?a.mobilePaddingRight:null,classNamePrefix:"em-mob-padding_"}}}))}},a.createElement(F.A,{icon:"PaddingSwitcher"})))))},Ct=({form:e,elementSettings:t})=>{var o;const{__:l}=(0,L.s9)(),[i,r]=(0,a.useState)(null===(o=t.mobileDirection)||void 0===o?void 0:o.value),n=(0,M.XW)(),s=o=>{const a=o.target.value,l={mobileDirection:{classNamePrefix:"em-mob-direction-",value:""}};a!==i?r(a):(r(""),e.setFieldsValue(l),n({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:l}))};return a.createElement(u.A.Item,{name:"mobileDirection"},a.createElement(C.Ay.Group,null,a.createElement(_.A,{size:8},a.createElement(p.A,{placement:"top",title:l("Right to left")},a.createElement(C.Ay.Button,{value:"rtl",onClick:s},a.createElement(xt.A,null))),a.createElement(p.A,{placement:"top",title:l("Left to right")},a.createElement(C.Ay.Button,{value:"ltr",onClick:s},a.createElement(Pt.A,null))))))};Ct.defaultProps={};const Lt=Ct,{Option:Ft}=q.A,Ot=a.createElement(q.A,{className:"select-after",getPopupContainer:e=>e.parentNode},a.createElement(Ft,{value:"px"},"px"),a.createElement(Ft,{value:"%"},"%")),{useToken:Mt}=c.A,Dt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,M.XW)(),l=(0,n.wA)(),[i]=u.A.useForm(),[d,c]=(0,a.useState)(""),[v,y]=(0,a.useState)({}),[x,P]=(0,a.useState)({}),[N,C]=(0,a.useState)({}),[D,V]=(0,a.useState)({}),[z,W]=(0,a.useState)(!0),[$,Q]=(0,a.useState)(!0),K=(0,n.d4)(Ge.Ct),J=(0,n.d4)(Ge.CS),ee=(0,n.d4)(s.Hs),te=(0,qe.rD)(),[oe,ae]=(0,a.useState)(""===e.backgroundImage[0].value),{token:le}=Mt(),ie=(0,n.d4)(Ge.Fv),re=(0,n.d4)(Ge.yy),ne=ie&&"bottom"!==re,[se,me]=(0,a.useState)(!1),[de,ue]=(0,a.useState)(!1),[pe,ge]=(0,a.useState)(!1),[be,Ee]=(0,a.useState)(!1),[ve,ye]=(0,a.useState)(!1),[Se,ke]=(0,a.useState)(!1),[we,xe]=(0,a.useState)(!1),[Pe,Ne]=(0,a.useState)(!1),[Te,Re]=(0,a.useState)(!1),[Ie,Ce]=(0,a.useState)(!1),[Le,Fe]=(0,a.useState)(!1),[Oe,Me]=(0,a.useState)(!1),[De,je]=(0,a.useState)(!1),[ze,We]=(0,a.useState)(!1),He=ee.hasOwnProperty("type")?O.IE:O.Tm,Ue=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],Xe=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}];(0,a.useEffect)((()=>{if(e){var t,o,a,l,r,n,s,m,d,c,u,p,g,b,E,h,f,v,_,A,S,k,B,w,x,N,T,R,I,L,F,O,M,D,j,z,G,H,U,q,X,$,K,Y,J,Z,ee,te,oe,le,ie,re,ne;const se=e.border,de=e.boxShadow,ce=e.mobileBorder,pe=e.mobileBoxShadow;y(se),C(de),P(ce),V(pe);const be=Object.keys(se).find((e=>{var t,o,a;return(null===(t=se[e])||void 0===t?void 0:t.width)||(null===(o=se[e])||void 0===o?void 0:o.style)||(null===(a=se[e])||void 0===a?void 0:a.color)})),he=Object.keys(ce).find((e=>{var t,o,a;return(null===(t=ce[e])||void 0===t?void 0:t.width)||(null===(o=ce[e])||void 0===o?void 0:o.style)||(null===(a=ce[e])||void 0===a?void 0:a.color)}));i.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.dim,height:null===(a=e.height)||void 0===a?void 0:a.value,heightDim:null===(l=e.height)||void 0===l?void 0:l.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",isContrastBlock:e.isContrastBlock,borderPosition:be||"all",borderWidth:(null===(r=se[be])||void 0===r?void 0:r.width)||"",borderColor:(null===(n=se[be])||void 0===n?void 0:n.color)||"",borderStyle:(null===(s=se[be])||void 0===s?void 0:s.style)||"",paddingTop:(0,Qe.ok)(null===(m=e.padding)||void 0===m?void 0:m.all)||(0,Qe.ok)(null===(d=e.padding)||void 0===d?void 0:d.top),paddingLeft:(0,Qe.ok)(null===(c=e.padding)||void 0===c?void 0:c.all)||(0,Qe.ok)(null===(u=e.padding)||void 0===u?void 0:u.left),paddingRight:(0,Qe.ok)(null===(p=e.padding)||void 0===p?void 0:p.all)||(0,Qe.ok)(null===(g=e.padding)||void 0===g?void 0:g.right),paddingBottom:(0,Qe.ok)(null===(b=e.padding)||void 0===b?void 0:b.all)||(0,Qe.ok)(null===(E=e.padding)||void 0===E?void 0:E.bottom),paddingLeftRight:(0,Qe.ok)(null===(h=e.padding)||void 0===h?void 0:h.left)||(0,Qe.ok)(null===(f=e.padding)||void 0===f?void 0:f.right),paddingTopBottom:(0,Qe.ok)(null===(v=e.padding)||void 0===v?void 0:v.top)||(0,Qe.ok)(null===(_=e.padding)||void 0===_?void 0:_.bottom),borderRadiusAll:(0,Qe.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Qe.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Qe.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Qe.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Qe.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Qe.ok)(null===(A=e.boxShadow)||void 0===A?void 0:A.inset)||!1,boxShadowHOffset:(0,Qe.ok)(null===(S=e.boxShadow)||void 0===S?void 0:S.hOffset),boxShadowVOffset:(0,Qe.ok)(null===(k=e.boxShadow)||void 0===k?void 0:k.vOffset),boxShadowBlurRadius:(0,Qe.ok)(null===(B=e.boxShadow)||void 0===B?void 0:B.blurRadius),boxShadowSpreadRadius:(0,Qe.ok)(null===(w=e.boxShadow)||void 0===w?void 0:w.spreadRadius),boxShadowColor:(0,Qe.ok)(null===(x=e.boxShadow)||void 0===x?void 0:x.color),mobileWidth:(0,Qe.xc)(null===(N=e.mobileWidth)||void 0===N?void 0:N.value),mobileWidthDim:null===(T=e.mobileWidth)||void 0===T?void 0:T.dim,mobileHeight:(0,Qe.xc)(null===(R=e.mobileHeight)||void 0===R?void 0:R.value),mobileHeightDim:null===(I=e.mobileHeight)||void 0===I?void 0:I.dim,mobileBorderPosition:he||"all",mobileBorderWidth:null!==(null===(L=ce[he])||void 0===L?void 0:L.width)?null===(F=ce[he])||void 0===F?void 0:F.width:"",mobileBorderColor:(null===(O=ce[he])||void 0===O?void 0:O.color)||"",mobileBorderStyle:(null===(M=ce[he])||void 0===M?void 0:M.style)||"",mobileBorderRadiusAll:(0,Qe.ok)(e.mobileBorderRadius.all),mobileRadiusTopLeft:(0,Qe.ok)(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileRadiusBottomLeft:(0,Qe.ok)(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileRadiusTopRight:(0,Qe.ok)(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileRadiusBottomRight:(0,Qe.ok)(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:(0,Qe.ok)(null===(D=e.mobileBoxShadow)||void 0===D?void 0:D.inset)||!1,mobileBoxShadowHOffset:(0,Qe.ok)(null===(j=e.mobileBoxShadow)||void 0===j?void 0:j.hOffset),mobileBoxShadowVOffset:(0,Qe.ok)(null===(z=e.mobileBoxShadow)||void 0===z?void 0:z.vOffset),mobileBoxShadowBlurRadius:(0,Qe.ok)(null===(G=e.mobileBoxShadow)||void 0===G?void 0:G.blurRadius),mobileBoxShadowSpreadRadius:(0,Qe.ok)(null===(H=e.mobileBoxShadow)||void 0===H?void 0:H.spreadRadius),mobileBoxShadowColor:(0,Qe.ok)(null===(U=e.mobileBoxShadow)||void 0===U?void 0:U.color),mobileAlign:(0,Qe.ok)(null===(q=e.mobileAlign)||void 0===q?void 0:q.value),mobileVerticalAlign:(0,Qe.ok)(null===(X=e.mobileVerticalAlign)||void 0===X?void 0:X.value),mobileBackgroundColor:(0,Qe.ok)("none"!==(null===($=e.mobileBackgroundColor)||void 0===$?void 0:$.value)?null===(K=e.mobileBackgroundColor)||void 0===K?void 0:K.value:""),mobileBackgroundImage:"none"!==e.mobileBackgroundImage[0].value?e.mobileBackgroundImage[0].value:"",mobileBackgroundPositionX:(0,Qe.ok)(null===(Y=e.mobileBackgroundPositionX)||void 0===Y?void 0:Y.value),mobileBackgroundPositionY:(0,Qe.ok)(null===(J=e.mobileBackgroundPositionY)||void 0===J?void 0:J.value),mobileBackgroundRepeat:null!==(Z=e.mobileBackgroundRepeat)&&void 0!==Z&&Z.value?null===(ee=e.mobileBackgroundRepeat)||void 0===ee?void 0:ee.value:"none",mobilePaddingTop:(0,Qe.ok)(e.mobilePadding.all)||(0,Qe.ok)(e.mobilePadding.top),mobilePaddingLeft:(0,Qe.ok)(e.mobilePadding.all)||(0,Qe.ok)(e.mobilePadding.left),mobilePaddingRight:(0,Qe.ok)(e.mobilePadding.all)||(0,Qe.ok)(e.mobilePadding.right),mobilePaddingBottom:(0,Qe.ok)(e.mobilePadding.all)||(0,Qe.ok)(e.mobilePadding.bottom),mobilePaddingTopBottom:(0,Qe.ok)(e.mobilePadding.top)||(0,Qe.ok)(e.mobilePadding.bottom),mobilePaddingLeftRight:(0,Qe.ok)(e.mobilePadding.left)||(0,Qe.ok)(e.mobilePadding.right),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,Qe.ok)(e.borderRadius.all)&&((0,Qe.ok)(e.borderRadius.topLeft)||(0,Qe.ok)(e.borderRadius.bottomLeft)||(0,Qe.ok)(e.borderRadius.topRight)||(0,Qe.ok)(e.borderRadius.bottomRight))?W(!1):W(!0),(0,Qe.ok)(e.mobileBorderRadius.topLeft)||(0,Qe.ok)(e.mobileBorderRadius.bottomLeft)||(0,Qe.ok)(e.mobileBorderRadius.topRight)||(0,Qe.ok)(e.mobileBorderRadius.bottomRight)?Q(!1):Q(!0),ae(""===e.backgroundImage[0].value),(0,Qe.ok)(e.padding.all)||!((0,Qe.ok)(e.padding.top)||(0,Qe.ok)(e.padding.right)||(0,Qe.ok)(e.padding.bottom)||(0,Qe.ok)(e.padding.left))||e.padding.top===e.padding.bottom&&e.padding.right===e.padding.left?me(!0):me(!1),(0,Qe.ok)(e.mobilePadding.all)||!((0,Qe.ok)(e.mobilePadding.top)||(0,Qe.ok)(e.mobilePadding.right)||(0,Qe.ok)(e.mobilePadding.bottom)||(0,Qe.ok)(e.mobilePadding.left))||e.mobilePadding.top===e.mobilePadding.bottom&&e.mobilePadding.right===e.mobilePadding.left?ue(!0):ue(!1),ge(!(null===(te=se[be])||void 0===te||!te.width)||!(null===(oe=se[be])||void 0===oe||!oe.style)||!(null===(le=se[be])||void 0===le||!le.color)),Ee(!(null===(ie=ce[he])||void 0===ie||!ie.width)||!(null===(re=ce[he])||void 0===re||!re.style)||!(null===(ne=ce[he])||void 0===ne||!ne.color)),ye(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),ke(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),xe(!!e.boxShadow),Ne(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),Re(!!e.width.value&&"column"!==e.type||!!e.height.value),Ce(!!e.mobileWidth.value||!!e.mobileHeight.value),Fe(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Me(!!e.mobileBackgroundColor.value),je(!!e.exportAsPicture||!!e.isContrastBlock),We(!!e.mobilePadding.all||0===e.mobilePadding.all||!!e.mobilePadding.top||0===e.mobilePadding.top||!!e.mobilePadding.bottom||0===e.mobilePadding.bottom||!!e.mobilePadding.left||0===e.mobilePadding.left||!!e.mobilePadding.right||0===e.mobilePadding.right)}}),[i,e]);const $e=(0,a.useCallback)((e=>{l(He===O.Tm?(0,s.A9)(e):(0,m.A9)(e))}),[l,He]);return a.createElement(u.A,{form:i,layout:"vertical",name:"selected_td_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",align:"",valign:"",border:"",show:"all",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",boxShadowInset:"",boxShadowHOffset:"",boxShadowVOffset:"",boxShadowBlurRadius:"",boxShadowSpreadRadius:"",boxShadowColor:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1},onValuesChange:t=>{const a=i.getFieldsValue(!0),l=Object.keys(t)[0];let r;switch(c("%"===i.getFieldsValue(!0).widthDim?100:""),l){case"exportAsPicture":r={exportAsPicture:a.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":r={boxShadow:{hOffset:a.boxShadowHOffset,vOffset:a.boxShadowVOffset,blurRadius:a.boxShadowBlurRadius,spreadRadius:a.boxShadowSpreadRadius,color:a.boxShadowColor,inset:a.boxShadowInset}};break;case"borderStyle":r={border:{[a.borderPosition]:{...v[a.borderPosition],style:t[l]}}},"all"===a.borderPosition?y((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],style:t[l]}}))):y((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],style:t[l]}})));break;case"borderColor":r={border:{[a.borderPosition]:{...v[a.borderPosition],color:t[l]}}},"all"===a.borderPosition?y((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],color:t[l]}}))):y((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],color:t[l]}})));break;case"borderWidth":r={border:{[a.borderPosition]:{...v[a.borderPosition],width:t[l]}}},"all"===a.borderPosition?y((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],width:t[l]}}))):y((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],width:t[l]}})));break;case"borderPosition":i.setFieldsValue({borderWidth:v[t[l]].width||"",borderColor:v[t[l]].color||"",borderStyle:v[t[l]].style||""});break;case"width":r={[l]:{value:t[l],dim:a.widthDim}};break;case"height":r={[l]:{value:t[l],dim:a.heightDim}};break;case"widthDim":r={width:{value:a.width,dim:t[l]}};break;case"heightDim":r={height:{value:a.height,dim:t[l]}};break;case"backgroundImage":ae(""===t[l]),r={[l]:[{...e.backgroundImage[0],value:t[l]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":r={padding:{left:a.paddingLeft,right:a.paddingRight,top:a.paddingTop,bottom:a.paddingBottom,[Qe.yy[l]]:+t[l]}};break;case"paddingTopBottom":r={padding:{left:a.paddingLeft,right:a.paddingRight,top:+t[l],bottom:+t[l]}},a.paddingTop=a.paddingBottom=+t[l];break;case"paddingLeftRight":r={padding:{top:a.paddingTop,bottom:a.paddingBottom,left:+t[l],right:+t[l]}},a.paddingLeft=a.paddingRight=+t[l];break;case"borderRadiusAll":r={borderRadius:{[O.wF[l]]:+t[l]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":r={borderRadius:{topLeft:a.borderRadiusTopLeft,bottomLeft:a.borderRadiusBottomLeft,topRight:a.borderRadiusTopRight,bottomRight:a.borderRadiusBottomRight,[O.wF[l]]:+t[l]}};break;case"mobileWidth":r={[l]:{classNamePrefix:"em-mob-width-",value:t[l],dim:a.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:a.mobileWidth,dim:t[l]}};break;case"mobileHeight":r={[l]:{classNamePrefix:"em-mob-height-",value:t[l],dim:a.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:a.mobileHeight,dim:t[l]}};break;case"mobileBorderStyle":r={mobileBorder:{[a.mobileBorderPosition]:{...x[a.mobileBorderPosition],style:t[l],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?P((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],style:t[l],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):P((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],style:t[l],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":r={mobileBorder:{[a.mobileBorderPosition]:{...x[a.mobileBorderPosition],color:t[l],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?P((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],color:t[l],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):P((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],color:t[l],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":r={mobileBorder:{[a.mobileBorderPosition]:{...x[a.mobileBorderPosition],width:t[l],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?P((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],width:t[l],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):P((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],width:t[l],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderPosition":i.setFieldsValue({mobileBorderWidth:x[t[l]].width||"",mobileBorderColor:x[t[l]].color||"",mobileBorderStyle:x[t[l]].style||""});break;case"mobileBorderRadiusAll":case"mobileRadiusTopLeft":case"mobileRadiusBottomLeft":case"mobileRadiusTopRight":case"mobileRadiusBottomRight":r={mobileBorderRadius:{[Qe.NW[l]]:t[l],classNamePrefix:"em-mob-border_radius_"+Qe.NW[l]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":r={mobileBoxShadow:{hOffset:a.mobileBoxShadowHOffset,vOffset:a.mobileBoxShadowVOffset,blurRadius:a.mobileBoxShadowBlurRadius,spreadRadius:a.mobileBoxShadowSpreadRadius,color:a.mobileBoxShadowColor,inset:a.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":r={[l]:{classNamePrefix:"em-mob-text_align-",value:t[l]}};break;case"mobileVerticalAlign":r={[l]:{classNamePrefix:"em-mob-vertical_align-",value:t[l]}};break;case"mobileBackgroundColor":r={[l]:{classNamePrefix:"em-mob-background_color-",value:t[l]}};break;case"mobileBackgroundImage":r={[l]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[l]}]};break;case"mobileBackgroundPositionX":r={[l]:{classNamePrefix:"em-mob-background_position_x-",value:t[l]}};break;case"mobileBackgroundPositionY":r={[l]:{classNamePrefix:"em-mob-background_position_y-",value:t[l]}};break;case"mobileBackgroundRepeat":r={[l]:{classNamePrefix:"em-mob-background_repeat-",value:t[l]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":r={mobilePadding:{all:null,top:""!==a.mobilePaddingTop?a.mobilePaddingTop:null,right:""!==a.mobilePaddingRight?a.mobilePaddingRight:null,bottom:""!==a.mobilePaddingBottom?a.mobilePaddingBottom:null,left:""!==a.mobilePaddingLeft?a.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":a.mobilePaddingTop=a.mobilePaddingBottom=t[l],r={mobilePadding:{all:null,top:""!==a.mobilePaddingTop?a.mobilePaddingTop:null,right:""!==a.mobilePaddingRight?a.mobilePaddingRight:null,bottom:""!==a.mobilePaddingBottom?a.mobilePaddingBottom:null,left:""!==a.mobilePaddingLeft?a.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":a.mobilePaddingLeft=a.mobilePaddingRight=t[l],r={mobilePadding:{all:null,top:""!==a.mobilePaddingTop?a.mobilePaddingTop:null,right:""!==a.mobilePaddingRight?a.mobilePaddingRight:null,bottom:""!==a.mobilePaddingBottom?a.mobilePaddingBottom:null,left:""!==a.mobilePaddingLeft?a.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;default:r=t}"borderPosition"!==l&&(o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r}),l.includes("mobileRadius")||$e({...e,...r,activateSection:null,changeKey:l}))},autoComplete:"off",className:"element-controls"},!ne&&a.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},a.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),K===O.ND&&J.styles?a.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:K===O.ND&&J.styles?"block":"none"}},a.createElement("div",{className:"selected_form-mobile-props-wrapper"},a.createElement(b.A,{gutter:20},a.createElement(E.A,{span:12},a.createElement(_e,{form:i,elementSettings:e,imgParent:!0})),te.formCellFieldVerticalAlignEnabled&&"group"!==e.type&&("structure"!==e.type||"structure"===e.type&&1===e.floatBlocks.items.length)&&a.createElement(E.A,{span:12,style:{textAlign:"right"}},a.createElement(Ae,{form:i,elementSettings:e}))),a.createElement(h.A,{className:"selected-td-form__divider"}),te.formCellFieldPaddingsEnabled&&a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Padding"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{We((e=>!e)),ze&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))}))}},ze?a.createElement(w.A,null):a.createElement(B.A,null)))),ze&&a.createElement(b.A,{gutter:10,style:{paddingBottom:4}},a.createElement(a.Fragment,null,a.createElement(It,{form:i,elementSettings:e,mobilePaddingsExt:de,setMobilePaddingsExt:ue}))),a.createElement(h.A,{className:"selected-td-form__divider"})),"group"!==e.type&&a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Size"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ce((e=>!e)),Ie&&(t.mobileWidth="",t.mobileHeight="",o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))}))}},Ie?a.createElement(w.A,null):a.createElement(B.A,null)))),Ie&&a.createElement(b.A,{gutter:10,style:{paddingBottom:9}},"structure"!==e.type&&a.createElement(E.A,{span:12},a.createElement("div",{style:{marginBottom:15}},a.createElement(Y,{form:i,name:"mobileWidth",elementSettings:e}))),a.createElement(E.A,{span:12},a.createElement("div",{style:{marginBottom:15}},a.createElement(Z,{form:i,name:"mobileHeight",elementSettings:e})))),a.createElement(h.A,{className:"selected-td-form__divider"})),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Background"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Me((e=>!e)),t.mobileBackgroundColor=Oe?"":"#E5E5E5",o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Oe?a.createElement(w.A,null):a.createElement(B.A,null)))),Oe&&a.createElement(a.Fragment,null,a.createElement("div",{style:{marginBottom:(te.formCellFieldBackgroundImageEnabled,le.formItemMarginBottomMD+4)}},a.createElement(ft,{form:i,elementSettings:e,label:t("Background color")}))),!1,te.formFieldBorderEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Borders"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ee((e=>!e)),be&&(t.mobileBorderWidth=null,t.mobileBorderColor="",t.mobileBorderStyle=""),P((e=>({...O.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderColor,style:t.mobileBorderStyle,width:t.mobileBorderWidth,classNamePrefix:"em-mob-border_"+t.mobileBorderPosition+"-"}}}})}))}},be?a.createElement(w.A,null):a.createElement(B.A,null)))),be&&a.createElement("div",{style:{marginBottom:4}},a.createElement(ce,{mobileBorders:x}))),te.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ke((e=>!e)),t.mobileBorderRadiusAll=Se?null:5,o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},Se?a.createElement(w.A,null):a.createElement(B.A,null)))),Se&&a.createElement("div",{style:{marginBottom:4}},a.createElement(he,{form:i,oneMobileBorderRadiusValue:$,setOneMobileBorderRadiusValue:Q}))),te.formFieldBoxShadowEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Box shadow"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ne((e=>!e)),Pe?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},Pe?a.createElement(w.A,null):a.createElement(B.A,null)))),Pe&&a.createElement("div",{style:{marginBottom:4}},a.createElement(fe,{mobileBoxShadow:D,form:i,elementSettings:e}))),te.formFieldVisibilityEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("group"!==e.type?"Display control & Direction":"Display control")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Be,{elementSettings:e,form:i})),"group"!==e.type&&a.createElement(E.A,{span:12,style:{textAlign:"group"!==e.type?"right":"left"}},a.createElement(Lt,{elementSettings:e,form:i})))),te.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Amp visibility")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Ve,null)))))):a.createElement("div",{id:"selected_element_form_desktop_props"},a.createElement("div",{className:"selected_form-props-wrapper"},a.createElement(b.A,{gutter:10,style:{paddingBottom:4}},a.createElement(E.A,{span:12},a.createElement(rt.A,{form:i,elementSettings:e})),te.formCellFieldVerticalAlignEnabled&&"group"!==e.type&&("structure"!==e.type||"structure"===e.type&&1===e.floatBlocks.items.length)&&a.createElement(E.A,{span:12,style:{textAlign:"right"}},a.createElement(j.A,{form:i,elementSettings:e}))),a.createElement(h.A,{className:"selected-td-form__divider"}),te.formCellFieldPaddingsEnabled&&a.createElement(a.Fragment,null,a.createElement("div",{className:"form-group-title"},t("Padding")),a.createElement(b.A,{gutter:10,style:{paddingBottom:4}},a.createElement(a.Fragment,null,"group"!==e.type&&"column"!==e.type&&a.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},a.createElement("div",{className:"padding-collapsed",style:{display:se?"block":"none"}},a.createElement(p.A,{title:t("Horizontal padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingLeftRight"},a.createElement(G.A,{min:0,placeholder:t("Horizontal"),prefix:a.createElement(F.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),a.createElement("div",{className:"padding-extended",style:{display:se?"none":"block"}},a.createElement(p.A,{trigger:["hover"],title:t("Left padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:le.formItemMarginBottomXS}},a.createElement(G.A,{min:0,placeholder:t("Left"),prefix:a.createElement(F.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),a.createElement(p.A,{trigger:["hover"],title:t("Right padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingRight"},a.createElement(G.A,{min:0,placeholder:t("Right"),prefix:a.createElement(F.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),a.createElement(E.A,{span:10,style:{width:"group"!==e.type&&"column"!==e.type?156:45,flex:"auto",maxWidth:"44%"}},a.createElement("div",{className:"padding-collapsed",style:{display:se?"block":"none"}},a.createElement(p.A,{title:t("Vertical padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingTopBottom"},a.createElement(G.A,{min:0,placeholder:t("Vertical"),prefix:a.createElement(F.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),a.createElement("div",{className:"padding-extended",style:{display:se?"none":"block"}},a.createElement(p.A,{trigger:["hover"],title:t("Top padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:le.formItemMarginBottomXS}},a.createElement(G.A,{min:0,placeholder:t("Top"),prefix:a.createElement(F.A,{icon:"PaddingTop"}),addonAfter:"px"}))),a.createElement(p.A,{trigger:["hover"],title:t("Bottom padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingBottom"},a.createElement(G.A,{min:0,placeholder:t("Bottom"),prefix:a.createElement(F.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),a.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"12%"}},a.createElement(p.A,{title:t("Individual padding"),placement:"bottom"},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!se}),onClick:()=>{me((e=>!e));const t=i.getFieldsValue(!0);se||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},a.createElement(F.A,{icon:"PaddingSwitcher"})))))),a.createElement(h.A,{className:"selected-td-form__divider"})),"group"!==e.type&&a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Size"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Re((e=>!e)),Te&&(t.width="",t.height="",o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{width:{value:null,dim:"px"},height:{value:null,dim:"px"}}}))}))}},Te?a.createElement(w.A,null):a.createElement(B.A,null)))),Te&&a.createElement(b.A,{gutter:10,style:{paddingBottom:4}},"structure"!==e.type&&"column"!==e.type&&a.createElement(E.A,{span:12},a.createElement(p.A,{title:t("Width"),placement:"bottom"},a.createElement(u.A.Item,{name:"width",style:{marginBottom:le.formItemMarginBottomXS}},a.createElement(G.A,{min:0,max:d,placeholder:t("Width"),prefix:a.createElement(S.A,null),addonAfter:a.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Ot)})))),a.createElement(E.A,{span:12},a.createElement(p.A,{title:t("Height"),placement:"bottom"},a.createElement(u.A.Item,{name:"height"},a.createElement(G.A,{min:0,placeholder:t("Height"),prefix:a.createElement(k.A,null),addonAfter:"px"}))))),a.createElement(h.A,{className:"selected-td-form__divider"})),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Background"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Fe((e=>!e)),Le?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",ae(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},Le?a.createElement(w.A,null):a.createElement(B.A,null)))),Le&&a.createElement(b.A,{gutter:10,style:{marginBottom:oe?16:0}},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},a.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:te.formCellFieldBackgroundImageEnabled?le.formItemMarginBottomXS:le.formItemMarginBottomMD+4}},a.createElement(H.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),te.formCellFieldBackgroundImageEnabled&&a.createElement(E.A,{span:oe?12:24},a.createElement(T.A,{form:i,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"}),!oe&&a.createElement(u.A.Item,{style:{marginBottom:"0"}},a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},a.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:le.formItemMarginBottomXS}},a.createElement(A.A,{placeholder:t("Horizontal position"),prefix:a.createElement(F.A,{icon:"BgPositionHorizontal"})})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},a.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:le.formItemMarginBottomXS}},a.createElement(A.A,{placeholder:t("Vertical position"),prefix:a.createElement(F.A,{icon:"BgPositionVertical"})}))))),a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},a.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:le.formItemMarginBottomMD+4}},a.createElement(q.A,{placeholder:t("Please choose"),options:Ue,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},a.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:le.formItemMarginBottomMD+4}},a.createElement(q.A,{placeholder:t("Please choose"),options:Xe,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),te.formFieldBorderEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Borders"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ge((e=>!e)),pe&&(t.borderWidth=null,t.borderColor="",t.borderStyle=""),y((e=>({...O.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},pe?a.createElement(w.A,null):a.createElement(B.A,null)))),pe&&a.createElement("div",{style:{marginBottom:4}},a.createElement(R.A,{borders:v}))),te.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ye((e=>!e)),t.borderRadiusAll=ve?0:5,o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},ve?a.createElement(w.A,null):a.createElement(B.A,null)))),ve&&a.createElement("div",{style:{marginBottom:4}},a.createElement(I.A,{form:i,oneBorderRadiusValue:z,setOneBorderRadiusValue:W,elementSettings:e}))),te.formFieldBoxShadowEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Box shadow"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{xe((e=>!e)),we?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},we?a.createElement(w.A,null):a.createElement(B.A,null)))),we&&a.createElement("div",{style:{marginBottom:4}},a.createElement(U,{boxShadow:N}))),te.formFieldExportAsPictureEnabled&&"group"!==e.type&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Settings"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{je((e=>!e)),De&&(t.exportAsPicture=!1,t.isContrastBlock=!1,o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1,isContrastBlock:!1}}))}))}},De?a.createElement(w.A,null):a.createElement(B.A,null)))),De&&a.createElement(a.Fragment,null,"structure"===e.type&&a.createElement(p.A,{title:t("The block will change its colors to contrasting colors. You can change them in the Content Styles section."),key:"isContrastBlock"},a.createElement(_.A,{size:10,align:"baseline"},a.createElement(u.A.Item,{name:"isContrastBlock",valuePropName:"checked",style:{marginBottom:0}},a.createElement(X.A,{size:"small",id:"contrast-colors"})),a.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2}},a.createElement("label",{htmlFor:"contrast-colors"},t("Contrast block"))))),a.createElement(vt,{form:i,elementSettings:e}))),te.formFieldVisibilityEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("group"!==e.type?"Display control & Direction":"Display control")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Be,{elementSettings:e,form:i})),"group"!==e.type&&a.createElement(E.A,{span:12,style:{textAlign:"group"!==e.type?"right":"left"}},a.createElement(Tt,{elementSettings:e,form:i})))),te.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Amp visibility")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Ve,null)))))))},{Option:Vt}=q.A,jt=a.createElement(q.A,{className:"select-after",getPopupContainer:e=>e.parentNode},a.createElement(Vt,{value:"px"},"px"),a.createElement(Vt,{value:"%"},"%")),{useToken:zt}=c.A,Wt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,M.XW)(),[l]=u.A.useForm(),[i,s]=(0,a.useState)({}),[m,d]=(0,a.useState)({}),[c,v]=(0,a.useState)(!0),[_,y]=(0,a.useState)({}),[x,P]=(0,a.useState)({}),[N,C]=(0,a.useState)(!0),D=(0,n.d4)(Ge.Ct),V=(0,n.d4)(Ge.CS),z=(0,qe.rD)(),[W,X]=(0,a.useState)(""===e.backgroundImage[0].value),{token:$}=zt(),Q=(0,n.d4)(Ge.Fv),K=(0,n.d4)(Ge.yy),J=Q&&"bottom"!==K,[ee,te]=(0,a.useState)(!1),[oe,ae]=(0,a.useState)(!1),[le,ie]=(0,a.useState)(!1),[re,ne]=(0,a.useState)(!1),[se,me]=(0,a.useState)(!1),[de,ue]=(0,a.useState)(!1),[pe,ge]=(0,a.useState)(!1),[be,Ee]=(0,a.useState)(!1),[ve,_e]=(0,a.useState)(!1),[ye,Se]=(0,a.useState)(!1),[ke,we]=(0,a.useState)(!1),[xe,Pe]=(0,a.useState)(!1),[Ne,Te]=(0,a.useState)(!1),[Re,Ie]=(0,a.useState)(!1),[Ce,Le]=(0,a.useState)(!1),[Fe,Oe]=(0,a.useState)(""),Me=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],De=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}];(0,a.useEffect)((()=>{if(e){var t,o,a,i,r,n,m,c,u,p,g,b,E,h,f,_,A,S,k,B,w,x,N,T,R,I,L,F,O,M,D,V,j,z,W,G,H,U,q,$,Q,K,Y,J,Z,ee,oe,le,re,se,de;const ce=e.border,pe=e.boxShadow,be=e.mobileBorder,he=e.mobileBoxShadow;s(ce),d(pe),y(be),P(he);const fe=Object.keys(ce).find((e=>{var t,o,a;return(null===(t=ce[e])||void 0===t?void 0:t.width)||(null===(o=ce[e])||void 0===o?void 0:o.style)||(null===(a=ce[e])||void 0===a?void 0:a.color)})),ve=Object.keys(be).find((e=>{var t,o,a;return(null===(t=be[e])||void 0===t?void 0:t.width)||(null===(o=be[e])||void 0===o?void 0:o.style)||(null===(a=be[e])||void 0===a?void 0:a.color)}));l.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.dim,height:null===(a=e.height)||void 0===a?void 0:a.value,heightDim:null===(i=e.height)||void 0===i?void 0:i.dim,maxWidth:null===(r=e.maxWidth)||void 0===r?void 0:r.value,maxWidthDim:null===(n=e.maxWidth)||void 0===n?void 0:n.dim,minWidth:null===(m=e.minWidth)||void 0===m?void 0:m.value,minWidthDim:null===(c=e.minWidth)||void 0===c?void 0:c.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",borderPosition:fe||"all",borderWidth:(null===(u=ce[fe])||void 0===u?void 0:u.width)||"",borderColor:(null===(p=ce[fe])||void 0===p?void 0:p.color)||"",borderStyle:(null===(g=ce[fe])||void 0===g?void 0:g.style)||"",paddingTop:(0,Qe.ok)(e.padding.all)||(0,Qe.ok)(e.padding.top),paddingLeft:(0,Qe.ok)(e.padding.all)||(0,Qe.ok)(e.padding.left),paddingRight:(0,Qe.ok)(e.padding.all)||(0,Qe.ok)(e.padding.right),paddingBottom:(0,Qe.ok)(e.padding.all)||(0,Qe.ok)(e.padding.bottom),paddingLeftRight:(0,Qe.ok)(null===(b=e.padding)||void 0===b?void 0:b.left)||(0,Qe.ok)(null===(E=e.padding)||void 0===E?void 0:E.right),paddingTopBottom:(0,Qe.ok)(null===(h=e.padding)||void 0===h?void 0:h.top)||(0,Qe.ok)(null===(f=e.padding)||void 0===f?void 0:f.bottom),borderRadiusAll:(0,Qe.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Qe.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Qe.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Qe.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Qe.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Qe.ok)(null===(_=e.boxShadow)||void 0===_?void 0:_.inset)||!1,boxShadowHOffset:(0,Qe.ok)(null===(A=e.boxShadow)||void 0===A?void 0:A.hOffset),boxShadowVOffset:(0,Qe.ok)(null===(S=e.boxShadow)||void 0===S?void 0:S.vOffset),boxShadowBlurRadius:(0,Qe.ok)(null===(k=e.boxShadow)||void 0===k?void 0:k.blurRadius),boxShadowSpreadRadius:(0,Qe.ok)(null===(B=e.boxShadow)||void 0===B?void 0:B.spreadRadius),boxShadowColor:(0,Qe.ok)(null===(w=e.boxShadow)||void 0===w?void 0:w.color),mobileWidth:(0,Qe.xc)(null===(x=e.mobileWidth)||void 0===x?void 0:x.value),mobileWidthDim:null===(N=e.mobileWidth)||void 0===N?void 0:N.dim,mobileHeight:(0,Qe.xc)(null===(T=e.mobileHeight)||void 0===T?void 0:T.value),mobileHeightDim:null===(R=e.mobileHeight)||void 0===R?void 0:R.dim,mobileBorderPosition:ve||"all",mobileBorderWidth:null!==(null===(I=be[ve])||void 0===I?void 0:I.width)?null===(L=be[ve])||void 0===L?void 0:L.width:"",mobileBorderColor:(null===(F=be[ve])||void 0===F?void 0:F.color)||"",mobileBorderStyle:(null===(O=be[ve])||void 0===O?void 0:O.style)||"",mobileBorderRadiusAll:(0,Qe.ok)(e.mobileBorderRadius.all),mobileRadiusTopLeft:(0,Qe.ok)(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileRadiusBottomLeft:(0,Qe.ok)(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileRadiusTopRight:(0,Qe.ok)(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileRadiusBottomRight:(0,Qe.ok)(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:(0,Qe.ok)(null===(M=e.mobileBoxShadow)||void 0===M?void 0:M.inset)||!1,mobileBoxShadowHOffset:(0,Qe.ok)(null===(D=e.mobileBoxShadow)||void 0===D?void 0:D.hOffset),mobileBoxShadowVOffset:(0,Qe.ok)(null===(V=e.mobileBoxShadow)||void 0===V?void 0:V.vOffset),mobileBoxShadowBlurRadius:(0,Qe.ok)(null===(j=e.mobileBoxShadow)||void 0===j?void 0:j.blurRadius),mobileBoxShadowSpreadRadius:(0,Qe.ok)(null===(z=e.mobileBoxShadow)||void 0===z?void 0:z.spreadRadius),mobileBoxShadowColor:(0,Qe.ok)(null===(W=e.mobileBoxShadow)||void 0===W?void 0:W.color),mobileAlign:(0,Qe.ok)(null===(G=e.mobileAlign)||void 0===G?void 0:G.value),mobileVerticalAlign:(0,Qe.ok)(null===(H=e.mobileVerticalAlign)||void 0===H?void 0:H.value),mobileDirection:(0,Qe.ok)(null===(U=e.mobileDirection)||void 0===U?void 0:U.value),mobileBackgroundColor:(0,Qe.ok)("none"!==(null===(q=e.mobileBackgroundColor)||void 0===q?void 0:q.value)?null===($=e.mobileBackgroundColor)||void 0===$?void 0:$.value:""),mobileBackgroundImage:"none"!==e.mobileBackgroundImage[0].value?e.mobileBackgroundImage[0].value:"",mobileBackgroundPositionX:(0,Qe.ok)(null===(Q=e.mobileBackgroundPositionX)||void 0===Q?void 0:Q.value),mobileBackgroundPositionY:(0,Qe.ok)(null===(K=e.mobileBackgroundPositionY)||void 0===K?void 0:K.value),mobileBackgroundRepeat:null!==(Y=e.mobileBackgroundRepeat)&&void 0!==Y&&Y.value?null===(J=e.mobileBackgroundRepeat)||void 0===J?void 0:J.value:"none",mobilePaddingTop:(0,Qe.ok)(e.mobilePadding.all)||(0,Qe.ok)(e.mobilePadding.top),mobilePaddingLeft:(0,Qe.ok)(e.mobilePadding.all)||(0,Qe.ok)(e.mobilePadding.left),mobilePaddingRight:(0,Qe.ok)(e.mobilePadding.all)||(0,Qe.ok)(e.mobilePadding.right),mobilePaddingBottom:(0,Qe.ok)(e.mobilePadding.all)||(0,Qe.ok)(e.mobilePadding.bottom),mobilePaddingTopBottom:(0,Qe.ok)(e.mobilePadding.top)||(0,Qe.ok)(e.mobilePadding.bottom),mobilePaddingLeftRight:(0,Qe.ok)(e.mobilePadding.left)||(0,Qe.ok)(e.mobilePadding.right),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,Qe.ok)(e.borderRadius.all)&&((0,Qe.ok)(e.borderRadius.topLeft)||(0,Qe.ok)(e.borderRadius.bottomLeft)||(0,Qe.ok)(e.borderRadius.topRight)||(0,Qe.ok)(e.borderRadius.bottomRight))?v(!1):v(!0),!(0,Qe.ok)(e.mobileBorderRadius.all)&&((0,Qe.ok)(e.mobileBorderRadius.topLeft)||(0,Qe.ok)(e.mobileBorderRadius.bottomLeft)||(0,Qe.ok)(e.mobileBorderRadius.topRight)||(0,Qe.ok)(e.mobileBorderRadius.bottomRight))?C(!1):C(!0),X(""===e.backgroundImage[0].value),(0,Qe.ok)(e.padding.all)||!((0,Qe.ok)(e.padding.top)||(0,Qe.ok)(e.padding.right)||(0,Qe.ok)(e.padding.bottom)||(0,Qe.ok)(e.padding.left))||e.padding.top===e.padding.bottom&&e.padding.right===e.padding.left?te(!0):te(!1),(0,Qe.ok)(e.mobilePadding.all)||!((0,Qe.ok)(e.mobilePadding.top)||(0,Qe.ok)(e.mobilePadding.right)||(0,Qe.ok)(e.mobilePadding.bottom)||(0,Qe.ok)(e.mobilePadding.left))||e.mobilePadding.top===e.mobilePadding.bottom&&e.mobilePadding.right===e.mobilePadding.left?ae(!0):ae(!1),ie(!(null===(Z=ce[fe])||void 0===Z||!Z.width)),ne(!(null===(ee=be[ve])||void 0===ee||!ee.width)),me(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),ue(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),ge(!!e.boxShadow),Ee(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),_e(!!e.width.value||!!e.height.value||!!e.minWidth.value||!!e.maxWidth.value),Se(!!e.mobileWidth.value||!!e.mobileHeight.value),we(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Pe(!!e.mobileBackgroundColor.value),Te(!!e.exportAsPicture),Ie(!(null===(oe=e.padding)||void 0===oe||!oe.all)||!(null===(le=e.padding)||void 0===le||!le.top)||!(null===(re=e.padding)||void 0===re||!re.bottom)||!(null===(se=e.padding)||void 0===se||!se.left)||!(null===(de=e.padding)||void 0===de||!de.right)),Le(!!e.mobilePadding.all||!!e.mobilePadding.top||!!e.mobilePadding.bottom||!!e.mobilePadding.left||!!e.mobilePadding.right)}}),[l,e]);return a.createElement(u.A,{form:l,layout:"vertical",name:"selected_div_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",maxWidth:{value:"",dim:""},minWidth:{value:"",dim:""},align:"",valign:"",border:"",boxShadow:"",show:"all",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileDirection:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:""},onValuesChange:t=>{const a=l.getFieldsValue(!0),r=Object.keys(t)[0];let n;switch(Oe("%"===l.getFieldsValue(!0).widthDim?100:""),r){case"exportAsPicture":n={exportAsPicture:a.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":n={boxShadow:{hOffset:a.boxShadowHOffset,vOffset:a.boxShadowVOffset,blurRadius:a.boxShadowBlurRadius,spreadRadius:a.boxShadowSpreadRadius,color:a.boxShadowColor,inset:a.boxShadowInset}};break;case"borderStyle":n={border:{[a.borderPosition]:{...i[a.borderPosition],style:t[r]}}},"all"===a.borderPosition?s((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],style:t[r]}}))):s((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],style:t[r]}})));break;case"borderColor":n={border:{[a.borderPosition]:{...i[a.borderPosition],color:t[r]}}},"all"===a.borderPosition?s((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],color:t[r]}}))):s((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],color:t[r]}})));break;case"borderWidth":n={border:{[a.borderPosition]:{...i[a.borderPosition],width:t[r]}}},"all"===a.borderPosition?s((e=>({...O.iV,[a.borderPosition]:{...e[a.borderPosition],width:t[r]}}))):s((e=>({...e,[a.borderPosition]:{...e[a.borderPosition],width:t[r]}})));break;case"borderPosition":l.setFieldsValue({borderWidth:i[t[r]].width||"",borderColor:i[t[r]].color||"",borderStyle:i[t[r]].style||""});break;case"width":n={[r]:{value:t[r],dim:a.widthDim}};break;case"height":n={[r]:{value:t[r],dim:a.heightDim}};break;case"widthDim":n={width:{value:a.width,dim:t[r]}};break;case"heightDim":n={height:{value:a.height,dim:t[r]}};break;case"maxWidth":n={[r]:{value:t[r],dim:a.maxWidthDim}};break;case"maxWidthDim":n={maxWidth:{value:a.maxWidth,dim:t[r]}};break;case"minWidth":n={[r]:{value:t[r],dim:a.minWidthDim}};break;case"minWidthDim":n={minWidth:{value:a.minWidth,dim:t[r]}};break;case"backgroundImage":X(""===t[r]),n={[r]:[{...e.backgroundImage[0],value:t[r]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":n={padding:{[Qe.yy[r]]:+t[r]}};break;case"paddingTopBottom":n={padding:{top:+t[r],bottom:+t[r]}},a.paddingTop=a.paddingBottom=+t[r];break;case"paddingLeftRight":n={padding:{left:+t[r],right:+t[r]}},a.paddingLeft=a.paddingRight=+t[r];break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":n={borderRadius:{[O.wF[r]]:+t[r]}};break;case"mobileWidth":n={[r]:{classNamePrefix:"em-mob-width-",value:t[r],dim:a.mobileWidthDim}};break;case"mobileWidthDim":n={mobileWidth:{classNamePrefix:"em-mob-width-",value:a.mobileWidth,dim:t[r]}};break;case"mobileHeight":n={[r]:{classNamePrefix:"em-mob-height-",value:t[r],dim:a.mobileHeightDim}};break;case"mobileHeightDim":n={mobileHeight:{classNamePrefix:"em-mob-height-",value:a.mobileHeight,dim:t[r]}};break;case"mobileBorderStyle":n={mobileBorder:{[a.mobileBorderPosition]:{..._[a.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?y((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):y((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":n={mobileBorder:{[a.mobileBorderPosition]:{..._[a.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?y((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):y((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":n={mobileBorder:{[a.mobileBorderPosition]:{..._[a.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}},"all"===a.mobileBorderPosition?y((e=>({...O.iV,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}}))):y((e=>({...e,[a.mobileBorderPosition]:{...e[a.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+a.mobileBorderPosition+"-"}})));break;case"mobileBorderPosition":l.setFieldsValue({mobileBorderWidth:_[t[r]].width||"",mobileBorderColor:_[t[r]].color||"",mobileBorderStyle:_[t[r]].style||""});break;case"mobileBorderRadiusAll":case"mobileRadiusTopLeft":case"mobileRadiusBottomLeft":case"mobileRadiusTopRight":case"mobileRadiusBottomRight":n={mobileBorderRadius:{[Qe.NW[r]]:t[r],classNamePrefix:"em-mob-border_radius_"+Qe.NW[r]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":n={mobileBoxShadow:{hOffset:a.mobileBoxShadowHOffset,vOffset:a.mobileBoxShadowVOffset,blurRadius:a.mobileBoxShadowBlurRadius,spreadRadius:a.mobileBoxShadowSpreadRadius,color:a.mobileBoxShadowColor,inset:a.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":n={[r]:{classNamePrefix:"em-mob-text_align-",value:t[r]}};break;case"mobileVerticalAlign":n={[r]:{classNamePrefix:"em-mob-vertical_align-",value:t[r]}};break;case"mobileBackgroundColor":n={[r]:{classNamePrefix:"em-mob-background_color-",value:t[r]}};break;case"mobileBackgroundImage":n={[r]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[r]}]};break;case"mobileBackgroundPositionX":n={[r]:{classNamePrefix:"em-mob-background_position_x-",value:t[r]}};break;case"mobileBackgroundPositionY":n={[r]:{classNamePrefix:"em-mob-background_position_x-",value:t[r]}};break;case"mobileBackgroundRepeat":n={[r]:{classNamePrefix:"em-mob-background_repeat-",value:t[r]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":n={mobilePadding:{all:null,top:""!==a.mobilePaddingTop?a.mobilePaddingTop:null,right:""!==a.mobilePaddingRight?a.mobilePaddingRight:null,bottom:""!==a.mobilePaddingBottom?a.mobilePaddingBottom:null,left:""!==a.mobilePaddingLeft?a.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":a.mobilePaddingTop=a.mobilePaddingBottom=t[r],n={mobilePadding:{all:null,top:""!==a.mobilePaddingTop?a.mobilePaddingTop:null,right:""!==a.mobilePaddingRight?a.mobilePaddingRight:null,bottom:""!==a.mobilePaddingBottom?a.mobilePaddingBottom:null,left:""!==a.mobilePaddingLeft?a.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":a.mobilePaddingLeft=a.mobilePaddingRight=t[r],n={mobilePadding:{all:null,top:""!==a.mobilePaddingTop?a.mobilePaddingTop:null,right:""!==a.mobilePaddingRight?a.mobilePaddingRight:null,bottom:""!==a.mobilePaddingBottom?a.mobilePaddingBottom:null,left:""!==a.mobilePaddingLeft?a.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobileDirection":n={[r]:{classNamePrefix:"em-mob-direction-",value:t[r]}};break;default:n=t}"borderPosition"!==r&&o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:n})},autoComplete:"off",className:"element-controls"},!J&&a.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},a.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),D===O.ND&&V.styles?a.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},a.createElement("div",{className:"selected_form-mobile-props-wrapper"},a.createElement(b.A,{gutter:20,style:{paddingBottom:4}},a.createElement(E.A,{span:12},a.createElement(bt,{form:l,elementSettings:e,imgParent:!0})),a.createElement(E.A,{span:12,style:{textAlign:"right"}},a.createElement(Ae,{form:l,elementSettings:e}))),a.createElement(h.A,{className:"selected-td-form__divider"}),z.formCellFieldPaddingsEnabled&&a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Padding"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{Le((e=>!e)),Ce&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))}))}},Ce?a.createElement(w.A,null):a.createElement(B.A,null)))),Ce&&a.createElement(b.A,{gutter:10,style:{paddingBottom:4}},a.createElement(a.Fragment,null,a.createElement(It,{form:l,elementSettings:e,mobilePaddingsExt:oe,setMobilePaddingsExt:ae})))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Size"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{Se((e=>!e))}))}},ye?a.createElement(w.A,null):a.createElement(B.A,null)))),ye&&a.createElement(b.A,{gutter:10,style:{paddingBottom:8}},a.createElement(E.A,{span:12},a.createElement("div",{style:{marginBottom:2*$.formItemMarginBottomXS}},a.createElement(Y,{form:l,name:"mobileWidth",elementSettings:e}))),a.createElement(E.A,{span:12},a.createElement("div",{style:{marginBottom:$.formItemMarginBottomXS}},a.createElement(Z,{form:l,name:"mobileHeight",elementSettings:e})))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Background"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{Pe((e=>!e)),t.mobileBackgroundColor=xe?"":"#E5E5E5",o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},xe?a.createElement(w.A,null):a.createElement(B.A,null)))),xe&&a.createElement("div",{style:{marginBottom:(z.formDivFieldBackgroundImageEnabled,$.formItemMarginBottomMD+4)}},a.createElement(ft,{form:l,elementSettings:e,label:t("Background color")})),!1,z.formFieldBorderEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Borders"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{ne((e=>!e)),re&&(t.mobileBorderWidth=null,t.mobileBorderColor="",t.mobileBorderStyle=""),y((e=>({...O.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderColor,style:t.mobileBorderStyle,width:t.mobileBorderWidth,classNamePrefix:"em-mob-border_"+t.mobileBorderPosition+"-"}}}})}))}},re?a.createElement(w.A,null):a.createElement(B.A,null)))),re&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(ce,{mobileBorders:_}))),z.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{ue((e=>!e)),t.mobileBorderRadiusAll=de?null:5,o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},de?a.createElement(w.A,null):a.createElement(B.A,null)))),de&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(he,{form:l,oneMobileBorderRadiusValue:N,setOneMobileBorderRadiusValue:C}))),z.formFieldBoxShadowEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Box shadow"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{Ee((e=>!e)),be?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},be?a.createElement(w.A,null):a.createElement(B.A,null)))),be&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(fe,{mobileBoxShadow:x,form:l,elementSettings:e}))),z.formFieldVisibilityEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Display control & Direction")),a.createElement(b.A,{gutter:20,style:{paddingBottom:4}},a.createElement(E.A,{span:12},a.createElement(Be,{elementSettings:e,form:l})),a.createElement(E.A,{span:12,style:{textAlign:"right"}},a.createElement(Lt,{elementSettings:e,form:l})))),z.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Amp visibility")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Ve,null)))))):a.createElement("div",{id:"selected_element_form_desktop_props"},a.createElement(g.A,{className:"selected_form-desktop-props-title",message:t("Appearance on mobile devices"),type:"info"}),a.createElement("div",{className:"selected_form-props-wrapper"},a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(rt.A,{form:l,elementSettings:e})),a.createElement(E.A,{span:12,style:{textAlign:"right"}},a.createElement(j.A,{form:l,elementSettings:e}))),a.createElement(h.A,{className:"selected-td-form__divider"}),z.formCellFieldPaddingsEnabled&&a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Padding"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{Ie((e=>!e)),Re&&(t.paddingLeftRight="",t.paddingLeft="",t.paddingRight="",t.paddingTopBottom="",t.paddingTop="",t.paddingBottom="",o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))}))}},Re?a.createElement(w.A,null):a.createElement(B.A,null)))),Re&&a.createElement(b.A,{gutter:10,style:{marginBottom:4}},a.createElement(a.Fragment,null,a.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},a.createElement("div",{className:"padding-collapsed",style:{display:ee?"block":"none"}},a.createElement(p.A,{title:t("Horizontal padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingLeftRight"},a.createElement(G.A,{min:0,placeholder:t("Horizontal"),prefix:a.createElement(F.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),a.createElement("div",{className:"padding-extended",style:{display:ee?"none":"block"}},a.createElement(p.A,{trigger:["hover"],title:t("Left padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:$.formItemMarginBottomXS}},a.createElement(G.A,{min:0,placeholder:t("Left"),prefix:a.createElement(F.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),a.createElement(p.A,{trigger:["hover"],title:t("Right padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingRight"},a.createElement(G.A,{min:0,placeholder:t("Right"),prefix:a.createElement(F.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),a.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},a.createElement("div",{className:"padding-collapsed",style:{display:ee?"block":"none"}},a.createElement(p.A,{title:t("Vertical padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingTopBottom"},a.createElement(G.A,{min:0,placeholder:t("Vertical"),prefix:a.createElement(F.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),a.createElement("div",{className:"padding-extended",style:{display:ee?"none":"block"}},a.createElement(p.A,{trigger:["hover"],title:t("Top padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:$.formItemMarginBottomXS}},a.createElement(G.A,{min:0,placeholder:t("Top"),prefix:a.createElement(F.A,{icon:"PaddingTop"}),addonAfter:"px"}))),a.createElement(p.A,{trigger:["hover"],title:t("Bottom padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingBottom"},a.createElement(G.A,{min:0,placeholder:t("Bottom"),prefix:a.createElement(F.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),a.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"none"}},a.createElement(p.A,{title:t("Individual padding"),placement:"bottom"},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!ee}),onClick:()=>{te((e=>!e));const t=l.getFieldsValue(!0);ee||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},a.createElement(F.A,{icon:"PaddingSwitcher"}))))))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Size"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{_e((e=>!e))}))}},ve?a.createElement(w.A,null):a.createElement(B.A,null)))),ve&&a.createElement(b.A,{gutter:10,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Width"),placement:"bottom"},a.createElement(u.A.Item,{name:"width",className:"form-item-margin-xs"}," ",a.createElement(G.A,{min:0,max:Fe,placeholder:t("Width"),prefix:a.createElement(S.A,null),addonAfter:a.createElement(u.A.Item,{name:"widthDim",noStyle:!0},jt)}))),a.createElement(p.A,{trigger:["hover"],title:t("Height"),placement:"bottom"},a.createElement(u.A.Item,{name:"height"},a.createElement(G.A,{min:0,placeholder:t("Height"),prefix:a.createElement(k.A,null),addonAfter:"px"})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Minimum width"),placement:"bottom"},a.createElement(u.A.Item,{name:"minWidth",className:"form-item-margin-xs"},a.createElement(G.A,{min:0,placeholder:t("Min width"),prefix:a.createElement(F.A,{icon:"MinWidth"}),addonAfter:a.createElement(u.A.Item,{name:"minWidthDim",noStyle:!0},jt)}))),a.createElement(p.A,{trigger:["hover"],title:t("Maximum width"),placement:"bottom"},a.createElement(u.A.Item,{name:"maxWidth",className:"form-item-margin-xs"},a.createElement(G.A,{min:0,placeholder:t("Max width"),prefix:a.createElement(F.A,{icon:"MaxWidth"}),addonAfter:a.createElement(u.A.Item,{name:"maxWidthDim",noStyle:!0},jt)}))))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Background"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{we((e=>!e)),ke?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",X(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},ke?a.createElement(w.A,null):a.createElement(B.A,null)))),ke&&a.createElement(b.A,{gutter:10,style:{marginBottom:W?16:0}},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},a.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:z.formDivFieldBackgroundImageEnabled?$.formItemMarginBottomXS:$.formItemMarginBottomMD+4}},a.createElement(H.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),z.formDivFieldBackgroundImageEnabled&&a.createElement(E.A,{span:W?12:24},a.createElement("div",{style:{paddingBottom:W?4:0}},a.createElement(T.A,{form:l,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"})),!W&&a.createElement(u.A.Item,{style:{marginBottom:"0"}},a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},a.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:$.formItemMarginBottomXS}},a.createElement(A.A,{placeholder:t("Horizontal position"),prefix:a.createElement(F.A,{icon:"BgPositionHorizontal"})})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},a.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:$.formItemMarginBottomXS}},a.createElement(A.A,{placeholder:t("Vertical position"),prefix:a.createElement(F.A,{icon:"BgPositionVertical"})}))))),a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},a.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:$.formItemMarginBottomMD+4}},a.createElement(q.A,{placeholder:t("Please choose"),options:Me,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},a.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:$.formItemMarginBottomMD+4}},a.createElement(q.A,{placeholder:t("Please choose"),options:De,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),z.formFieldBorderEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Borders"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{ie((e=>!e)),le&&(t.borderWidth=null,t.borderColor="",t.borderStyle=""),s((e=>({...O.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},le?a.createElement(w.A,null):a.createElement(B.A,null)))),le&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(R.A,{borders:i}))),z.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{me((e=>!e)),t.borderRadiusAll=se?0:5,o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},se?a.createElement(w.A,null):a.createElement(B.A,null)))),se&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(I.A,{form:l,oneBorderRadiusValue:c,setOneBorderRadiusValue:v,elementSettings:e}))),z.formFieldBoxShadowEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Box shadow"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{ge((e=>!e)),pe?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},pe?a.createElement(w.A,null):a.createElement(B.A,null)))),pe&&a.createElement("div",{style:{paddingBottom:4}},a.createElement(U,{boxShadow:m}))),z.formFieldExportAsPictureEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Export settings"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=l.getFieldsValue(!0);setTimeout((()=>{Te((e=>!e)),Ne&&(t.exportAsPicture=!1,o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))}))}},Ne?a.createElement(w.A,null):a.createElement(B.A,null)))),Ne&&a.createElement(vt,{form:l,elementSettings:e})),z.formFieldVisibilityEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Display control & Direction")),a.createElement(b.A,{gutter:20,style:{paddingBottom:4}},a.createElement(E.A,{span:12},a.createElement(Be,{elementSettings:e,form:l})),a.createElement(E.A,{span:12,style:{textAlign:"right"}},a.createElement(Tt,{elementSettings:e,form:l})))),z.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Amp visibility")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Ve,null)))))))};var Gt=o(61153);const{Option:Ht}=q.A,Ut=a.createElement(q.A,{className:"select-after",getPopupContainer:e=>e.parentNode},a.createElement(Ht,{value:"px"},"px"),a.createElement(Ht,{value:"%"},"%")),qt=a.createElement(q.A,{className:"select-after",getPopupContainer:e=>e.parentNode},a.createElement(Ht,{value:"px"},"px"));let Xt=0;const $t=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,M.XW)(),[l]=u.A.useForm(),i=(0,n.d4)(Ge.Ct),r=(0,n.d4)(Ge.CS),s=(0,n.d4)(Ge.Fv),m=(0,n.d4)(Ge.yy),d=(0,qe.rD)(),c=s&&"bottom"!==m;(0,a.useEffect)((()=>{const t=e=>e&&"auto"!==e?e:0===e?"0":"";var o,a,i,r,n,s,m,d,c,u,p,g,b,E;e&&(l.setFieldsValue({...e,width:null===(o=e.width)||void 0===o?void 0:o.value,widthDim:null===(a=e.width)||void 0===a?void 0:a.dim,gap:null===(i=e.gap)||void 0===i?void 0:i.value,gapDim:null===(r=e.gap)||void 0===r?void 0:r.dim,maxWidth:null===(n=e.maxWidth)||void 0===n?void 0:n.value,maxWidthDim:null===(s=e.maxWidth)||void 0===s?void 0:s.dim,minWidth:null===(m=e.minWidth)||void 0===m?void 0:m.value,minWidthDim:null===(d=e.minWidth)||void 0===d?void 0:d.dim,show:e.show?e.show:"all",mobileWidth:t(null===(c=e.mobileWidth)||void 0===c?void 0:c.value),mobileWidthDim:null===(u=e.mobileWidth)||void 0===u?void 0:u.dim,mobileContentWidth:t(null===(p=e.mobileContentWidth)||void 0===p?void 0:p.value),mobileContentWidthDim:null===(g=e.mobileContentWidth)||void 0===g?void 0:g.dim,mobileVerticalAlign:(E=null===(b=e.mobileVerticalAlign)||void 0===b?void 0:b.value,E||(0===E?"0":""))}),Xt=e.width.value+e.gap.value)}),[l,e]);return a.createElement(u.A,{form:l,layout:"vertical",name:"selected_float_block_form",initialValues:{width:{value:"",dim:""},gap:{value:"",dim:"px"},valign:"",show:"all",mobileWidth:"",mobileWidthDim:"",mobileContentWidth:"",mobileContentWidthDim:"",mobileVerticalAlign:""},onValuesChange:t=>{const a=l.getFieldsValue(!0),i=Object.keys(t)[0];let r;switch(i){case"width":Xt=t[i]+a.gap,r={[i]:{value:t[i],dim:a.widthDim},gap:{value:a.gap}};break;case"widthDim":r={width:{value:a.width,dim:t[i]},gap:{value:a.gap}};break;case"gap":a.width=Xt-t[i],r={[i]:{value:t[i],dim:"px"}};break;case"mobileWidth":r={[i]:{classNamePrefix:"em-mob-width-",value:t[i],dim:a.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:a.mobileWidth,dim:t[i]}};break;case"mobileContentWidth":r={[i]:{classNamePrefix:"em-mob-width-",value:t[i],dim:a.mobileContentWidthDim}};break;case"mobileContentWidthDim":r={mobileContentWidth:{classNamePrefix:"em-mob-width-",value:a.mobileContentWidth,dim:t[i]}};break;case"mobileVerticalAlign":r={[i]:{classNamePrefix:"em-mob-vertical_align-",value:t[i]}};break;default:r=t}o({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r})},autoComplete:"off",className:"element-controls"},c&&a.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},a.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),i===O.ND&&r.styles?a.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:i===O.ND&&r.styles?"block":"none"}},a.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},a.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),a.createElement("div",{className:"selected_form-mobile-props-wrapper"},a.createElement(b.A,{gutter:10,style:{marginBottom:20}},a.createElement(E.A,{span:12},a.createElement(Y,{form:l,name:"mobileWidth",elementSettings:e})),a.createElement(E.A,{span:12})),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Alignments")),a.createElement(Ae,{form:l,elementSettings:e}),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Display control")),a.createElement(Be,{elementSettings:e,form:l}),d.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement("div",{className:"form-group-title"},t("Amp visibility")),a.createElement(Ve,null)))):a.createElement("div",{id:"selected_element_form_desktop_props"},a.createElement("div",{className:"selected_form-props-wrapper"},a.createElement(u.A.Item,{style:{marginBottom:"0"}},a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Float block width"),placement:"bottom"},a.createElement(u.A.Item,{name:"width"},a.createElement(ee.A,{min:0,placeholder:t("Float block width"),prefix:a.createElement(S.A,null),addonAfter:a.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Ut)})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:t("Column gap"),placement:"bottom"},a.createElement(u.A.Item,{name:"gap"},a.createElement(ee.A,{min:0,placeholder:t("Column gap"),prefix:a.createElement(Gt.A,null),addonAfter:a.createElement(u.A.Item,{name:"widthDim",noStyle:!0},qt)})))))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Vertical alignment")),a.createElement(j.A,{form:l,elementSettings:e}),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},t("Display control")),a.createElement(Be,{elementSettings:e,form:l}),d.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement("div",{className:"form-group-title"},t("Amp visibility")),a.createElement(Ve,null)))))},{Option:Qt}=q.A,Kt=a.createElement(q.A,{className:"select-after",getPopupContainer:e=>e.parentNode},a.createElement(Qt,{value:"px"},"px"),a.createElement(Qt,{value:"%"},"%")),{useToken:Yt}=c.A,Jt=({elementSettings:e})=>{var t;const{__:o}=(0,L.s9)(),l=(0,M.XW)(),[i]=u.A.useForm(),[s,m]=(0,a.useState)({}),[d,c]=(0,a.useState)({}),[v,_]=(0,a.useState)(!0),[y,x]=(0,a.useState)({}),[P,N]=(0,a.useState)({}),[C,D]=(0,a.useState)(!0),j=(0,n.d4)(Ge.Ct),z=(0,n.d4)(Ge.CS),W=(0,qe.rD)(),[X,$]=(0,a.useState)(""===(null===(t=e.backgroundImage)||void 0===t?void 0:t[0].value)),Q=(0,n.d4)(Ge.Fv),K=(0,n.d4)(Ge.yy),J=Q&&"bottom"!==K,{token:ee}=Yt(),te=(0,a.useRef)(null),oe=(0,a.useRef)(null),[ae,le]=(0,a.useState)(!1),[ie,re]=(0,a.useState)(!1),[ne,se]=(0,a.useState)(!1),[me,de]=(0,a.useState)(!1),[ue,pe]=(0,a.useState)(!1),[ge,be]=(0,a.useState)(!1),[Ee,ve]=(0,a.useState)(!1),[Ae,ye]=(0,a.useState)(!1),[Se,ke]=(0,a.useState)(!1),[we,xe]=(0,a.useState)(!1),[Pe,Ne]=(0,a.useState)(!1),[Te,Re]=(0,a.useState)(!1),[Ie,Ce]=(0,a.useState)(!1),[Le,Fe]=(0,a.useState)(!1),[Oe,Me]=(0,a.useState)(""),[De,je]=(0,a.useState)("https://"),[ze,We]=(0,a.useState)({}),[He,Ue]=(0,a.useState)(!1),Xe=[{label:o("Not defined"),value:"none"},{label:o("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:o("Repeat background (repeat)"),value:"repeat"},{label:o("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:o("Repeat background vertically (repeat-y)"),value:"repeat-y"}],$e=[{label:o("Not defined"),value:""},{label:o("Contain"),value:"contain"},{label:o("Cover"),value:"cover"}];(0,a.useEffect)((()=>{if(e){var t,o,a,l,r,n,s,d,u,p,g,b,E,h,f,v,A,y,S,k,B,w,P,T,R,I,C,L,F,O,M,V,j,z,W,G,H,U,q,X,Q,K,Y,J,Z,ee,te,oe,ae,ie,ne,me,ce,ue,ge,Ee,he,fe,_e,Ae,Se,Be,we,Pe,Te,Ie,Le,Oe,Me,De,Ve,ze,We,Ge,He,Ue,qe,Xe,$e,Ke,Ye,Je,Ze,et,tt,ot,at,lt,it,rt,nt,st,mt,dt,ct,ut,pt,gt,bt,Et,ht,ft,vt,_t,At,yt,St,kt,Bt,wt;const xt=e.border||{},Pt=e.boxShadow||{},Nt=e.mobileBorder||{},Tt=e.mobileBoxShadow||{},Rt=e.mobileBorderRadius||{},It=e.mobilePadding||{},Ct=e.mobileBoxShadow||{},Lt=e.mobileAlign||{},Ft=e.mobileBackgroundImage||[];m(xt),c(Pt),x(Nt),N(Tt);const Ot=Object.keys(xt).find((e=>{var t,o,a;return(null===(t=xt[e])||void 0===t?void 0:t.width)||(null===(o=xt[e])||void 0===o?void 0:o.style)||(null===(a=xt[e])||void 0===a?void 0:a.color)})),Mt=Object.keys(Nt).find((e=>{var t,o,a;return(null===(t=Nt[e])||void 0===t?void 0:t.width)||(null===(o=Nt[e])||void 0===o?void 0:o.style)||(null===(a=Nt[e])||void 0===a?void 0:a.color)}));e.href&&("https://"===e.href.substring(0,8)||"http://"===e.href.substring(0,7)?je("https://"):"mailto:"===e.href.substring(0,7)?je("mailto:"):"tel:"===e.href.substring(0,4)?je("tel:"):"sms:"===e.href.substring(0,4)?je("sms:"):"ftp://"===e.href.substring(0,6)?je("ftp://"):"skype:"===e.href.substring(0,6)?je("skype:"):"viber:"===e.href.substring(0,6)?je("viber:"):je("")),i.setFieldsValue({...e,href:e.href?e.href:"https://",width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.dim,height:null===(a=e.height)||void 0===a?void 0:a.value,heightDim:null===(l=e.height)||void 0===l?void 0:l.dim,backgroundImage:null===(r=e.backgroundImage)||void 0===r?void 0:r[0].value,show:e.show?e.show:"all",borderPosition:Ot||"all",borderWidth:(null===(n=xt[Ot])||void 0===n?void 0:n.width)||"",borderColor:(null===(s=xt[Ot])||void 0===s?void 0:s.color)||"",borderStyle:(null===(d=xt[Ot])||void 0===d?void 0:d.style)||"",paddingTop:(0,Qe.ok)(null===(u=e.padding)||void 0===u?void 0:u.all)||(0,Qe.ok)(null===(p=e.padding)||void 0===p?void 0:p.top),paddingLeft:(0,Qe.ok)(null===(g=e.padding)||void 0===g?void 0:g.all)||(0,Qe.ok)(null===(b=e.padding)||void 0===b?void 0:b.left),paddingRight:(0,Qe.ok)(null===(E=e.padding)||void 0===E?void 0:E.all)||(0,Qe.ok)(null===(h=e.padding)||void 0===h?void 0:h.right),paddingBottom:(0,Qe.ok)(null===(f=e.padding)||void 0===f?void 0:f.all)||(0,Qe.ok)(null===(v=e.padding)||void 0===v?void 0:v.bottom),paddingLeftRight:(0,Qe.ok)(null===(A=e.padding)||void 0===A?void 0:A.left)||(0,Qe.ok)(null===(y=e.padding)||void 0===y?void 0:y.right),paddingTopBottom:(0,Qe.ok)(null===(S=e.padding)||void 0===S?void 0:S.top)||(0,Qe.ok)(null===(k=e.padding)||void 0===k?void 0:k.bottom),borderRadiusAll:(0,Qe.ok)(null===(B=e.borderRadius)||void 0===B?void 0:B.all),borderRadiusTopLeft:(0,Qe.ok)(null===(w=e.borderRadius)||void 0===w?void 0:w.topLeft),borderRadiusBottomLeft:(0,Qe.ok)(null===(P=e.borderRadius)||void 0===P?void 0:P.bottomLeft),borderRadiusTopRight:(0,Qe.ok)(null===(T=e.borderRadius)||void 0===T?void 0:T.topRight),borderRadiusBottomRight:(0,Qe.ok)(null===(R=e.borderRadius)||void 0===R?void 0:R.bottomRight),boxShadowInset:(0,Qe.ok)(null===(I=e.boxShadow)||void 0===I?void 0:I.inset)||!1,boxShadowHOffset:(0,Qe.ok)(null===(C=e.boxShadow)||void 0===C?void 0:C.hOffset),boxShadowVOffset:(0,Qe.ok)(null===(L=e.boxShadow)||void 0===L?void 0:L.vOffset),boxShadowBlurRadius:(0,Qe.ok)(null===(F=e.boxShadow)||void 0===F?void 0:F.blurRadius),boxShadowSpreadRadius:(0,Qe.ok)(null===(O=e.boxShadow)||void 0===O?void 0:O.spreadRadius),boxShadowColor:(0,Qe.ok)(null===(M=e.boxShadow)||void 0===M?void 0:M.color),mobileWidth:(0,Qe.xc)(null===(V=e.mobileWidth)||void 0===V?void 0:V.value),mobileWidthDim:null===(j=e.mobileWidth)||void 0===j?void 0:j.dim,mobileHeight:(0,Qe.xc)(null===(z=e.mobileHeight)||void 0===z?void 0:z.value),mobileHeightDim:null===(W=e.mobileHeight)||void 0===W?void 0:W.dim,mobileBorderPosition:Mt||"all",mobileBorderWidth:null!==(null===(G=Nt[Mt])||void 0===G?void 0:G.width)?null===(H=Nt[Mt])||void 0===H?void 0:H.width:"",mobileBorderColor:(null===(U=Nt[Mt])||void 0===U?void 0:U.color)||"",mobileBorderStyle:(null===(q=Nt[Mt])||void 0===q?void 0:q.style)||"",mobileBorderRadiusAll:(0,Qe.ok)(null===(X=e.mobileBorderRadius)||void 0===X?void 0:X.all),mobileRadiusTopLeft:(0,Qe.ok)(null!==(null===(Q=e.mobileBorderRadius)||void 0===Q?void 0:Q.topLeft)?null===(K=e.mobileBorderRadius)||void 0===K?void 0:K.topLeft:null===(Y=e.mobileBorderRadius)||void 0===Y?void 0:Y.all),mobileRadiusBottomLeft:(0,Qe.ok)(null!==(null===(J=e.mobileBorderRadius)||void 0===J?void 0:J.bottomLeft)?null===(Z=e.mobileBorderRadius)||void 0===Z?void 0:Z.bottomLeft:null===(ee=e.mobileBorderRadius)||void 0===ee?void 0:ee.all),mobileRadiusTopRight:(0,Qe.ok)(null!==(null===(te=e.mobileBorderRadius)||void 0===te?void 0:te.topRight)?null===(oe=e.mobileBorderRadius)||void 0===oe?void 0:oe.topRight:null===(ae=e.mobileBorderRadius)||void 0===ae?void 0:ae.all),mobileRadiusBottomRight:(0,Qe.ok)(null!==(null===(ie=e.mobileBorderRadius)||void 0===ie?void 0:ie.bottomRight)?null===(ne=e.mobileBorderRadius)||void 0===ne?void 0:ne.bottomRight:null===(me=e.mobileBorderRadius)||void 0===me?void 0:me.all),mobileBoxShadowInset:(0,Qe.ok)(null===Ct||void 0===Ct?void 0:Ct.inset)||!1,mobileBoxShadowHOffset:(0,Qe.ok)(null===Ct||void 0===Ct?void 0:Ct.hOffset),mobileBoxShadowVOffset:(0,Qe.ok)(null===Ct||void 0===Ct?void 0:Ct.vOffset),mobileBoxShadowBlurRadius:(0,Qe.ok)(null===Ct||void 0===Ct?void 0:Ct.blurRadius),mobileBoxShadowSpreadRadius:(0,Qe.ok)(null===Ct||void 0===Ct?void 0:Ct.spreadRadius),mobileBoxShadowColor:(0,Qe.ok)(null===Ct||void 0===Ct?void 0:Ct.color),mobileAlign:(0,Qe.ok)(null===Lt||void 0===Lt?void 0:Lt.value),mobileVerticalAlign:(0,Qe.ok)(null===(ce=e.mobileVerticalAlign)||void 0===ce?void 0:ce.value),mobileBackgroundColor:(0,Qe.ok)("none"!==(null===(ue=e.mobileBackgroundColor)||void 0===ue?void 0:ue.value)?null===(ge=e.mobileBackgroundColor)||void 0===ge?void 0:ge.value:""),mobileBackgroundImage:"none"!==(null===(Ee=Ft[0])||void 0===Ee?void 0:Ee.value)?null===(he=Ft[0])||void 0===he?void 0:he.value:"",mobileBackgroundPositionX:(0,Qe.ok)(null===(fe=e.mobileBackgroundPositionX)||void 0===fe?void 0:fe.value),mobileBackgroundPositionY:(0,Qe.ok)(null===(_e=e.mobileBackgroundPositionY)||void 0===_e?void 0:_e.value),mobileBackgroundRepeat:null!==(Ae=e.mobileBackgroundRepeat)&&void 0!==Ae&&Ae.value?null===(Se=e.mobileBackgroundRepeat)||void 0===Se?void 0:Se.value:"none",mobilePaddingTop:(0,Qe.ok)(It.all)||(0,Qe.ok)(It.top),mobilePaddingLeft:(0,Qe.ok)(It.all)||(0,Qe.ok)(It.left),mobilePaddingRight:(0,Qe.ok)(It.all)||(0,Qe.ok)(It.right),mobilePaddingBottom:(0,Qe.ok)(It.all)||(0,Qe.ok)(It.bottom),mobilePaddingTopBottom:(0,Qe.ok)(It.top)||(0,Qe.ok)(It.bottom),mobilePaddingLeftRight:(0,Qe.ok)(It.left)||(0,Qe.ok)(It.right),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture,mobileFontSize:(0,Qe.ok)(null===(Be=e.mobileFontSize)||void 0===Be?void 0:Be.value)}),!(0,Qe.ok)(null===(we=e.borderRadius)||void 0===we?void 0:we.all)&&((0,Qe.ok)(null===(Pe=e.borderRadius)||void 0===Pe?void 0:Pe.topLeft)||(0,Qe.ok)(null===(Te=e.borderRadius)||void 0===Te?void 0:Te.bottomLeft)||(0,Qe.ok)(null===(Ie=e.borderRadius)||void 0===Ie?void 0:Ie.topRight)||(0,Qe.ok)(null===(Le=e.borderRadius)||void 0===Le?void 0:Le.bottomRight))?_(!1):_(!0),(0,Qe.ok)(Rt.topLeft)||(0,Qe.ok)(Rt.bottomLeft)||(0,Qe.ok)(Rt.topRight)||(0,Qe.ok)(Rt.bottomRight)?D(!1):D(!0),$(""===(null===(Oe=e.backgroundImage)||void 0===Oe?void 0:Oe[0].value)),(0,Qe.ok)(null===(Me=e.padding)||void 0===Me?void 0:Me.all)||!((0,Qe.ok)(null===(De=e.padding)||void 0===De?void 0:De.top)||(0,Qe.ok)(null===(Ve=e.padding)||void 0===Ve?void 0:Ve.right)||(0,Qe.ok)(null===(ze=e.padding)||void 0===ze?void 0:ze.bottom)||(0,Qe.ok)(null===(We=e.padding)||void 0===We?void 0:We.left))||(null===(Ge=e.padding)||void 0===Ge?void 0:Ge.top)===(null===(He=e.padding)||void 0===He?void 0:He.bottom)&&(null===(Ue=e.padding)||void 0===Ue?void 0:Ue.right)===(null===(qe=e.padding)||void 0===qe?void 0:qe.left)?le(!0):le(!1),(0,Qe.ok)(It.all)||!((0,Qe.ok)(It.top)||(0,Qe.ok)(It.right)||(0,Qe.ok)(It.bottom)||(0,Qe.ok)(It.left))||It.top===It.bottom&&It.right===It.left?re(!0):re(!1),se(!(null===(Xe=xt[Ot])||void 0===Xe||!Xe.width)),de(!(null===($e=Nt[Mt])||void 0===$e||!$e.width)),pe(!(null===(Ke=e.borderRadius)||void 0===Ke||!Ke.all)||!(null===(Ye=e.borderRadius)||void 0===Ye||!Ye.topLeft)||!(null===(Je=e.borderRadius)||void 0===Je||!Je.bottomLeft)||!(null===(Ze=e.borderRadius)||void 0===Ze||!Ze.topRight)||!(null===(et=e.borderRadius)||void 0===et||!et.bottomRight)),be(!(null===(tt=e.mobileBorderRadius)||void 0===tt||!tt.all)||!(null===(ot=e.mobileBorderRadius)||void 0===ot||!ot.topLeft)||!(null===(at=e.mobileBorderRadius)||void 0===at||!at.bottomLeft)||!(null===(lt=e.mobileBorderRadius)||void 0===lt||!lt.topRight)||!(null===(it=e.mobileBorderRadius)||void 0===it||!it.bottomRight)),ve(!!e.boxShadow),ye(!(null===(rt=e.mobileBoxShadow)||void 0===rt||!rt.blurRadius)||!(null===(nt=e.mobileBoxShadow)||void 0===nt||!nt.color)||!(null===(st=e.mobileBoxShadow)||void 0===st||!st.hOffset)||!(null===(mt=e.mobileBoxShadow)||void 0===mt||!mt.inset)||!(null===(dt=e.mobileBoxShadow)||void 0===dt||!dt.spreadRadius)||!(null===(ct=e.mobileBoxShadow)||void 0===ct||!ct.vOffset)),ke(!(null===(ut=e.mobileWidth)||void 0===ut||!ut.value)||!(null===(pt=e.mobileHeight)||void 0===pt||!pt.value)),xe(!!e.backgroundColor||!(null===(gt=e.backgroundImage)||void 0===gt||!gt[0].value)||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Ne(!(null===(bt=e.mobileBackgroundColor)||void 0===bt||!bt.value)),Re(!(null===(Et=e.mobileFontSize)||void 0===Et||!Et.value)||!!e.showOnMobile),Ce(!(null===(ht=e.padding)||void 0===ht||!ht.all)||!(null===(ft=e.padding)||void 0===ft||!ft.top)||!(null===(vt=e.padding)||void 0===vt||!vt.bottom)||!(null===(_t=e.padding)||void 0===_t||!_t.left)||!(null===(At=e.padding)||void 0===At||!At.right)),Fe(!(null===(yt=e.mobilePadding)||void 0===yt||!yt.all)||!(null===(St=e.mobilePadding)||void 0===St||!St.top)||!(null===(kt=e.mobilePadding)||void 0===kt||!kt.bottom)||!(null===(Bt=e.mobilePadding)||void 0===Bt||!Bt.left)||!(null===(wt=e.mobilePadding)||void 0===wt||!wt.right))}}),[i,e,J]);const Ke=e=>{i.setFieldValue("href","mergetag"!==e?e:""),je(e)},Ye=({target:e})=>{const{selectionStart:t,selectionEnd:o}=e;e&&We({target:e,selection:{start:t,end:o}})};return(0,a.useEffect)((()=>{var t;Ue(!(null===(t=e.textReplacer)||void 0===t||!t.length))}),[e]),a.createElement(u.A,{form:i,layout:"vertical",name:"selected_button_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",align:"",valign:"",border:"",boxShadow:"",show:"all",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",href:"https://"},onValuesChange:t=>{const o=i.getFieldsValue(!0),a=Object.keys(t)[0];let r;switch(Me("%"===i.getFieldsValue(!0).widthDim?100:""),a){case"exportAsPicture":r={exportAsPicture:o.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":r={boxShadow:{hOffset:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderStyle":r={border:{[o.borderPosition]:{...s[o.borderPosition],style:t[a]}}},"all"===o.borderPosition?m((e=>({...O.iV,[o.borderPosition]:{...e[o.borderPosition],style:t[a]}}))):m((e=>({...e,[o.borderPosition]:{...e[o.borderPosition],style:t[a]}})));break;case"borderColor":r={border:{[o.borderPosition]:{...s[o.borderPosition],color:t[a]}}},"all"===o.borderPosition?m((e=>({...O.iV,[o.borderPosition]:{...e[o.borderPosition],color:t[a]}}))):m((e=>({...e,[o.borderPosition]:{...e[o.borderPosition],color:t[a]}})));break;case"borderWidth":r={border:{[o.borderPosition]:{...s[o.borderPosition],width:t[a]}}},"all"===o.borderPosition?m((e=>({...O.iV,[o.borderPosition]:{...e[o.borderPosition],width:t[a]}}))):m((e=>({...e,[o.borderPosition]:{...e[o.borderPosition],width:t[a]}})));break;case"borderPosition":i.setFieldsValue({borderWidth:s[t[a]].width||"",borderColor:s[t[a]].color||"",borderStyle:s[t[a]].style||""});break;case"width":r={[a]:{value:t[a],dim:o.widthDim}};break;case"height":r={[a]:{value:t[a],dim:o.heightDim}};break;case"widthDim":r={width:{value:o.width,dim:t[a]}};break;case"heightDim":r={height:{value:o.height,dim:t[a]}};break;case"backgroundImage":$(""===t[a]),r={[a]:[{...e.backgroundImage[0],value:t[a]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":r={padding:{[Qe.yy[a]]:+t[a]}};break;case"paddingTopBottom":r={padding:{top:+t[a],bottom:+t[a]}},o.paddingTop=o.paddingBottom=+t[a];break;case"paddingLeftRight":r={padding:{left:+t[a],right:+t[a]}},o.paddingLeft=o.paddingRight=+t[a];break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":r={borderRadius:{[O.wF[a]]:+t[a]}};break;case"mobileWidth":r={[a]:{classNamePrefix:"em-mob-width-",value:t[a],dim:o.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth,dim:t[a]}};break;case"mobileHeight":r={[a]:{classNamePrefix:"em-mob-height-",value:t[a],dim:o.mobileHeightDim},mobileLineHeight:{classNamePrefix:"em-mob-line_height-",value:t[a],dim:o.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[a]}};break;case"mobileBorderStyle":r={mobileBorder:{[o.mobileBorderPosition]:{...y[o.mobileBorderPosition],style:t[a],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?x((e=>({...O.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],style:t[a],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):x((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],style:t[a],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":r={mobileBorder:{[o.mobileBorderPosition]:{...y[o.mobileBorderPosition],color:t[a],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?x((e=>({...O.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],color:t[a],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):x((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],color:t[a],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":r={mobileBorder:{[o.mobileBorderPosition]:{...y[o.mobileBorderPosition],width:t[a],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?x((e=>({...O.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],width:t[a],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):x((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],width:t[a],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}})));break;case"mobileBorderPosition":i.setFieldsValue({mobileBorderWidth:y[t[a]].width||"",mobileBorderColor:y[t[a]].color||"",mobileBorderStyle:y[t[a]].style||""});break;case"mobileBorderRadiusAll":case"mobileRadiusTopLeft":case"mobileRadiusBottomLeft":case"mobileRadiusTopRight":case"mobileRadiusBottomRight":r={mobileBorderRadius:{[Qe.NW[a]]:t[a],classNamePrefix:"em-mob-border_radius_"+Qe.NW[a]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":r={mobileBoxShadow:{hOffset:o.mobileBoxShadowHOffset,vOffset:o.mobileBoxShadowVOffset,blurRadius:o.mobileBoxShadowBlurRadius,spreadRadius:o.mobileBoxShadowSpreadRadius,color:o.mobileBoxShadowColor,inset:o.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":r={[a]:{classNamePrefix:"em-mob-table_align-",value:t[a]}};break;case"mobileTextAlign":r={[a]:{classNamePrefix:"em-mob-text_align-",value:t[a]}};break;case"mobileVerticalAlign":r={[a]:{classNamePrefix:"em-mob-vertical_align-",value:t[a]}};break;case"mobileBackgroundColor":r={[a]:{classNamePrefix:"em-mob-background_color-",value:t[a]}};break;case"mobileBackgroundPositionX":r={[a]:{classNamePrefix:"em-mob-background_position_x-",value:t[a]}};break;case"mobileBackgroundPositionY":r={[a]:{classNamePrefix:"em-mob-background_position_x-",value:t[a]}};break;case"mobileBackgroundRepeat":r={[a]:{classNamePrefix:"em-mob-background_repeat-",value:t[a]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":o.mobilePaddingTop=o.mobilePaddingBottom=t[a],r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":o.mobilePaddingLeft=o.mobilePaddingRight=t[a],r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobileFontSize":r={[a]:{classNamePrefix:"em-mob-font_size-",value:t[a],dim:o.mobileFontSizeDim}};break;case"href":let l=t[a];"https://http"===l.substring(0,12)&&(l=l.substring(8,l.length),o.href=l),r={[a]:l},"https://"===t[a].substring(0,8)||"http://"===t[a].substring(0,7)?je("https://"):"mailto:"===t[a].substring(0,7)?je("mailto:"):"tel:"===t[a].substring(0,4)?je("tel:"):"sms:"===t[a].substring(0,4)?je("sms:"):"ftp://"===t[a].substring(0,6)?je("ftp://"):"skype:"===t[a].substring(0,6)?je("skype:"):"viber:"===t[a].substring(0,6)?je("viber:"):je("");break;default:r=t}"borderPosition"!==a&&l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r})},autoComplete:"off",className:"element-controls"},!J&&a.createElement(p.A,{title:o("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},a.createElement(g.A,{className:"selected_form-mobile-props-title",message:o("Appearance on mobile devices"),type:"info"})),J?a.createElement(pt,{form:i,elementSettings:e,showAddParagraph:!1,isButton:!0}):a.createElement(a.Fragment,null,j===O.ND&&z.styles?a.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},a.createElement("div",{className:"selected_form-mobile-props-wrapper"},a.createElement(b.A,{gutter:20,style:{paddingBottom:4}},a.createElement(E.A,{span:12},a.createElement(_e,{form:i,elementSettings:e,imgParent:!0})),W.formButtonFieldTextAlignEnabled&&a.createElement(E.A,{span:12,style:{textAlign:"right"}},a.createElement(bt,{form:i,name:"mobileTextAlign",elementSettings:e,imgParent:!0}))),!!e.showOnMobile&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}}),a.createElement(p.A,{trigger:["hover"],title:o("Hyperlink URL"),placement:"bottom"},a.createElement(u.A.Item,{name:"href",style:{marginBottom:ee.formItemMarginBottomMD+4}},a.createElement(A.A,{addonBefore:a.createElement(Qe.Ai,{linkProtocol:De,handleLinkProtocolsChange:Ke,__:o}),placeholder:o("Hyperlink URL"),allowClear:!0,prefix:a.createElement(Qe.RM,{linkProtocol:De})})))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Text"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Re((e=>!e)),Te&&(t.mobileFontSize="",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileFontSize:{value:null,dim:"px",classNamePrefix:"em-mob-font_size-"}}}))}))}},Te?a.createElement(w.A,null):a.createElement(B.A,null)))),Te&&a.createElement(a.Fragment,null,!!e.showOnMobile&&a.createElement(mt,{form:i,elementSettings:e,setLinkProtocol:je,linkProtocol:De,showAddParagraph:!1,isButton:!0}),a.createElement(b.A,{gutter:10,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(et,null)))),a.createElement(h.A,{className:"selected-td-form__divider"}),W.formButtonFieldPaddingsEnabled&&a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Padding"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Fe((e=>!e)),Le&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))}))}},Le?a.createElement(w.A,null):a.createElement(B.A,null)))),Le&&a.createElement(b.A,{gutter:10,style:{paddingBottom:8}},a.createElement(a.Fragment,null,a.createElement(It,{form:i,elementSettings:e,mobilePaddingsExt:ie,setMobilePaddingsExt:re}))),a.createElement(h.A,{className:"selected-td-form__divider"})),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Size"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ke((e=>!e)),Se&&(t.mobileWidth="",t.mobileHeight="",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))}))}},Se?a.createElement(w.A,null):a.createElement(B.A,null)))),Se&&a.createElement(b.A,{gutter:10,style:{paddingBottom:8}},a.createElement(E.A,{span:12},a.createElement("div",{style:{marginBottom:2*ee.formItemMarginBottomXS}},a.createElement(p.A,{title:o("Width"),placement:"bottom"},a.createElement(Y,{form:i,name:"mobileWidth",elementSettings:e})))),a.createElement(E.A,{span:12},a.createElement("div",{style:{marginBottom:2*ee.formItemMarginBottomXS}},a.createElement(p.A,{title:o("Height"),placement:"bottom"},a.createElement(Z,{form:i,name:"mobileHeight",elementSettings:e}))))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Background"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ne((e=>!e)),t.mobileBackgroundColor=Pe?"":e.commonStyles.buttons.backgroundColor||"#1C52DC",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Pe?a.createElement(w.A,null):a.createElement(B.A,null)))),Pe&&a.createElement(a.Fragment,null,a.createElement("div",{style:{marginBottom:(W.formButtonFieldBackgroundImageEnabled,ee.formItemMarginBottomMD+4)}},a.createElement(ft,{form:i,elementSettings:e,label:o("Background color")}))),W.formFieldBorderEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Borders"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{de((e=>!e)),me&&(t.mobileBorderWidth=null,t.mobileBorderColor="",t.mobileBorderStyle=""),x((e=>({...O.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderColor,style:t.mobileBorderStyle,width:t.mobileBorderWidth,classNamePrefix:"em-mob-border_"+t.mobileBorderPosition+"-"}}}})}))}},me?a.createElement(w.A,null):a.createElement(B.A,null)))),me&&a.createElement("div",{style:{marginBottom:4}},a.createElement(ce,{mobileBorders:y}))),W.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{be((e=>!e)),t.mobileBorderRadiusAll=ge?null:5,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},ge?a.createElement(w.A,null):a.createElement(B.A,null)))),ge&&a.createElement("div",{style:{marginBottom:4}},a.createElement(he,{form:i,oneMobileBorderRadiusValue:C,setOneMobileBorderRadiusValue:D}))),W.formFieldBoxShadowEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Box shadow"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ye((e=>!e)),Ae?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},Ae?a.createElement(w.A,null):a.createElement(B.A,null)))),Ae&&a.createElement("div",{style:{marginBottom:4}},a.createElement(fe,{mobileBoxShadow:P,form:i,elementSettings:e}))),W.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},o("AMP visibility")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Ve,null)))),W.formFieldAmpVisibilityEnabled&&e.isAmp&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},o("AMP visibility")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Ve,null)))))):a.createElement("div",{id:"selected_element_form_desktop_props"},a.createElement(g.A,{className:"selected_form-desktop-props-title",message:o("Appearance on mobile devices"),type:"info"}),a.createElement("div",{className:"selected_form-props-wrapper"},a.createElement(b.A,{gutter:20,style:{paddingBottom:4}},a.createElement(E.A,{span:12},a.createElement(V,{form:i,elementSettings:e})),W.formButtonFieldTextAlignEnabled&&a.createElement(E.A,{span:12,style:{textAlign:"right"}},a.createElement(rt.A,{form:i,name:"textAlign",elementSettings:e}))),a.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}}),a.createElement(p.A,{trigger:["hover"],title:o("Hyperlink URL"),placement:"bottom"},a.createElement(u.A.Item,{name:"href",style:{marginBottom:ee.formItemMarginBottomXS}},a.createElement(A.A,{addonBefore:a.createElement(Qe.Ai,{linkProtocol:De,handleLinkProtocolsChange:Ke,__:o}),placeholder:o("Hyperlink URL"),allowClear:!0,onSelect:Ye,prefix:a.createElement(Qe.RM,{linkProtocol:De})}))),a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:3},a.createElement(p.A,{title:o("Text replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button ant-form-item",{"selected-td-form__button--active":He}),icon:a.createElement(F.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{Ue(!He),He?(i.setFieldValue("textReplacer",""),l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{textReplacer:""}})):setTimeout((()=>te.current.focus()))},ref:oe}))),a.createElement(E.A,{span:21},He&&a.createElement(p.A,{trigger:["hover"],title:o("Text"),placement:"bottom"},a.createElement(u.A.Item,{name:"textReplacer"},a.createElement(A.A,{placeholder:o("The code that will replace this text"),allowClear:!0,prefix:a.createElement("span",{className:"addon-text-content"},"Text"),onChange:e=>{""!==e.target.value&&oe.current.classList.add("selected-td-form__button--active")},ref:te,onSelect:Ye}))))),a.createElement(h.A,{className:"selected-td-form__divider"}),W.formButtonFieldPaddingsEnabled&&a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Padding"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ce((e=>!e)),Ie&&(t.paddingLeftRight="",t.paddingLeft="",t.paddingRight="",t.paddingTopBottom="",t.paddingTop="",t.paddingBottom="",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))}))}},Ie?a.createElement(w.A,null):a.createElement(B.A,null)))),Ie&&a.createElement(b.A,{gutter:ee.marginSM,style:{marginBottom:4}},a.createElement(a.Fragment,null,a.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},a.createElement("div",{className:"padding-collapsed",style:{display:ae?"block":"none"}},a.createElement(p.A,{title:o("Horizontal padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingLeftRight"},a.createElement(G.A,{min:0,placeholder:o("Horizontal"),prefix:a.createElement(F.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),a.createElement("div",{className:"padding-extended",style:{display:ae?"none":"block"}},a.createElement(p.A,{trigger:["hover"],title:o("Left padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:ee.formItemMarginBottomXS}},a.createElement(G.A,{min:0,placeholder:o("Left"),prefix:a.createElement(F.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),a.createElement(p.A,{trigger:["hover"],title:o("Right padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingRight"},a.createElement(G.A,{min:0,placeholder:o("Right"),prefix:a.createElement(F.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),a.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},a.createElement("div",{className:"padding-collapsed",style:{display:ae?"block":"none"}},a.createElement(p.A,{title:o("Vertical padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingTopBottom"},a.createElement(G.A,{min:0,placeholder:o("Vertical"),prefix:a.createElement(F.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),a.createElement("div",{className:"padding-extended",style:{display:ae?"none":"block"}},a.createElement(p.A,{trigger:["hover"],title:o("Top padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:ee.formItemMarginBottomXS}},a.createElement(G.A,{min:0,placeholder:o("Top"),prefix:a.createElement(F.A,{icon:"PaddingTop"}),addonAfter:"px"}))),a.createElement(p.A,{trigger:["hover"],title:o("Bottom padding"),placement:"bottom"},a.createElement(u.A.Item,{name:"paddingBottom"},a.createElement(G.A,{min:0,placeholder:o("Bottom"),prefix:a.createElement(F.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),a.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"12%"}},a.createElement(p.A,{title:o("Individual padding"),placement:"bottom"},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!ae}),onClick:()=>{le((e=>!e));const t=i.getFieldsValue(!0);ae||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},a.createElement(F.A,{icon:"PaddingSwitcher"})))))),a.createElement(h.A,{className:"selected-td-form__divider"})),a.createElement("div",{className:"form-group-title"},o("Size")),a.createElement(b.A,{gutter:ee.marginSM,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(p.A,{title:o("Width"),placement:"left"},a.createElement(u.A.Item,{name:"width",style:{marginBottom:ee.formItemMarginBottomXS}},a.createElement(G.A,{min:0,max:Oe,placeholder:o("Width"),prefix:a.createElement(S.A,null),addonAfter:a.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Kt)})))),a.createElement(E.A,{span:12},a.createElement(p.A,{title:o("Height"),placement:"left"},a.createElement(u.A.Item,{name:"height"},a.createElement(G.A,{min:0,placeholder:o("Height"),prefix:a.createElement(k.A,null),addonAfter:"px"}))))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{style:{paddingTop:ee.formItemMarginBottomMD+4,paddingBottom:4}},a.createElement(mt,{form:i,elementSettings:e,showAddParagraph:!1,isButton:!0,setLinkProtocol:je,linkProtocol:De,linkTarget:ze})),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Background"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{xe((e=>!e)),we?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",$(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},we?a.createElement(w.A,null):a.createElement(B.A,null)))),we&&a.createElement(b.A,{gutter:10,style:{marginBottom:X?14:0}},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:o("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},a.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:W.formButtonFieldBackgroundImageEnabled?ee.formItemMarginBottomXS:ee.formItemMarginBottomMD+4}},a.createElement(H.A,{placeholder:o("Background color"),usedColors:e.usedColors})))),W.formButtonFieldBackgroundImageEnabled&&a.createElement(E.A,{span:X?12:24},a.createElement("div",{style:{paddingBottom:X?4:0}},a.createElement(T.A,{form:i,label:o("Background image"),name:"backgroundImage",tooltipTitle:o("Background image")})),!X&&a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:o("Horizontal position"),placement:"bottom"},a.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:ee.formItemMarginBottomXS}},a.createElement(G.A,{placeholder:o("Horizontal position"),prefix:a.createElement(F.A,{icon:"BgPositionHorizontal"})})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:o("Vertical position"),placement:"bottom"},a.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:ee.formItemMarginBottomXS}},a.createElement(G.A,{placeholder:o("Vertical position"),prefix:a.createElement(F.A,{icon:"BgPositionVertical"})}))))),a.createElement(b.A,{gutter:10},a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:o("Background image repeat"),placement:"top"},a.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:ee.formItemMarginBottomMD+4}},a.createElement(q.A,{placeholder:o("Please choose"),options:Xe,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),a.createElement(E.A,{span:12},a.createElement(p.A,{trigger:["hover"],title:o("Background image size"),placement:"top"},a.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:ee.formItemMarginBottomMD+4}},a.createElement(q.A,{placeholder:o("Please choose"),options:$e,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),W.formFieldBorderEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Borders"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{se((e=>!e)),ne&&(t.borderWidth=null,t.borderColor="",t.borderStyle=""),m((e=>({...O.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},ne?a.createElement(w.A,null):a.createElement(B.A,null)))),ne&&a.createElement("div",{style:{marginBottom:4}},a.createElement(R.A,{borders:s}))),W.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{pe((e=>!e)),t.borderRadiusAll=ue?0:5,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},ue?a.createElement(w.A,null):a.createElement(B.A,null)))),ue&&a.createElement("div",{style:{marginBottom:4}},a.createElement(I.A,{form:i,oneBorderRadiusValue:v,setOneBorderRadiusValue:_,elementSettings:e}))),W.formFieldBoxShadowEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},o("Box shadow"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ve((e=>!e)),Ee?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},Ee?a.createElement(w.A,null):a.createElement(B.A,null)))),Ee&&a.createElement("div",{style:{marginBottom:4}},a.createElement(U,{boxShadow:d}))),W.formFieldVisibilityEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},o("Display control")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Be,{elementSettings:e,form:i})))),W.formFieldAmpVisibilityEnabled&&e.ampShow&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement("div",{className:"form-group-title"},o("AMP visibility")),a.createElement(b.A,{gutter:20,style:{marginBottom:4}},a.createElement(E.A,{span:12},a.createElement(Ve,null))))))))};var Zt=o(94780);const eo=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),[o]=u.A.useForm(),{TextArea:l}=A.A,i=(0,M.XW)();(0,a.useEffect)((()=>{e&&o.setFieldsValue({...e})}),[o,e]);return a.createElement(u.A,{form:o,layout:"vertical",name:"selected_variable_form",initialValues:{value:""},onValuesChange:t=>{i({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:t})},autoComplete:"off"},a.createElement("div",{className:"selected_form-props-wrapper"},a.createElement(u.A.Item,{label:t("Variable value"),name:"value",tooltip:{title:t("Type the output parameters of your platform. E.g., ")+"${Recipient.FirstName}",icon:a.createElement(Zt.A,null)},style:{marginBottom:35}},a.createElement(l,{rows:4,placeholder:t("Variable value")}))))};var to=o(40186);const{useToken:oo}=c.A,ao=({elementSettings:e,setElementSettings:t,postfix:o="",form:l,handleSelect:i})=>{const{__:n}=(0,L.s9)(),{token:s}=oo(),m=(0,qe.rD)(),d=(0,M.XW)(),c="src"+o,g="title"+o,b="alt"+o,E="link"+o,h="imgReplacer"+o,v=(0,a.useRef)(null),S=(0,a.useRef)(null),k=(0,a.useRef)(null),B=(0,a.useRef)(null),w=(0,a.useRef)(null),x=(0,a.useRef)(null),P=(0,a.useRef)(null),N=(0,a.useRef)(null),[R,I]=(0,a.useState)(""),[C,D]=(0,a.useState)(""),[V,j]=(0,a.useState)(""),[z,W]=(0,a.useState)(!1),[G,H]=(0,a.useState)("https://");(0,a.useEffect)((()=>{var t,o,a;D(null===(t=e.images)||void 0===t?void 0:t[b]),j(null===(o=e.images)||void 0===o?void 0:o[g]),I(null===(a=e.images)||void 0===a?void 0:a[E])}),[e,b,g,E]);return a.createElement(a.Fragment,null,("img"===e.type||"video"===e.type||"carousel"===e.type)&&a.createElement(u.A.Item,{style:{marginBottom:0}},a.createElement(T.A,{form:l,label:n("Image path"),name:c,placeholder:n("Image path"),elementSettings:e,tooltipTitle:""})),a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},a.createElement(_.A,{size:8},a.createElement(p.A,{title:C||n("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!C}),onClick:()=>{C?(D(""),l.setFieldValue("alt",""),d({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[b]:""}})):(D(k.current&&k.current.input.value?k.current.input.value:"..."),setTimeout((()=>{k.current.focus()})))},ref:B},a.createElement("span",{className:"addon-text-content"},"Alt"))),m.formFieldImageTitleEnabled&&a.createElement(p.A,{title:V||n("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!V}),onClick:()=>{V?(j(!1),l.setFieldValue("title",""),d({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[g]:""}})):(j(w.current&&w.current.input.value?w.current.input.value:"..."),setTimeout((()=>{w.current.focus()})))},ref:x},a.createElement("span",{className:"addon-text-content"},"Title"))),a.createElement(p.A,{title:R||n("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!R}),icon:a.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:()=>{R?(I(""),l.setFieldValue(E,""),d({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[E]:""}})):(I(v.current&&v.current.input.value?v.current.input.value:"..."),setTimeout((()=>{v.current.focus()})))},ref:S})),a.createElement(p.A,{title:n("Image replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},a.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":z}),icon:a.createElement(F.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{W(!z),z?(l.setFieldValue(h,""),d({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[h]:""}})):setTimeout((()=>P.current.focus()))},ref:N}))),a.createElement(_.A,{size:8},a.createElement(p.A,{title:n("Remove slide"),placement:"bottom"},a.createElement(f.Ay,{type:"text",onClick:a=>{var i;const r=l.getFieldsValue(!0),n=+o.substring(1),s=Object.keys(null===r||void 0===r?void 0:r.images).reduce(((e,t)=>(t.includes(o)||(e[t]=r[t]),e)),{}),m=null===(i=e.carouselImages)||void 0===i?void 0:i.filter(((e,t)=>t!==n));t((e=>({...e,settings:{...e.settings,carouselImages:m}}))),d({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,caption:e.caption,settings:{...e,carouselImages:m}}),l.setFieldsValue({images:s})},icon:a.createElement(to.A,null)})))),(!!R||!!C||!!V||!!z)&&a.createElement("div",null,!!R&&a.createElement(p.A,{trigger:["hover"],title:n("Hyperlink URL"),placement:"bottom"},a.createElement(u.A.Item,{name:E,className:"selected-image-form__alt",style:{marginTop:s.formItemMarginBottomXS,marginBottom:0}},a.createElement(A.A,{addonBefore:a.createElement(Qe.Ai,{linkProtocol:G,handleLinkProtocolsChange:e=>{l.setFieldValue("LinkName","mergetag"!==e?e:""),H(e)},__:n}),placeholder:n("Hyperlink URL"),allowClear:!0,ref:v,onChange:e=>{""===e.target.value?I("..."):(S.current.classList.add("selected-td-form__button--active"),I(e.target.value));const t=e.target.value;"https://"===t.substring(0,8)?H("https://"):"mailto:"===t.substring(0,7)?H("mailto:"):"tel:"===t.substring(0,4)?H("tel:"):"sms:"===t.substring(0,4)?H("sms:"):"ftp://"===t.substring(0,6)?H("ftp://"):"skype:"===t.substring(0,6)?H("skype:"):"viber:"===t.substring(0,6)?H("viber:"):H("")},onSelect:i,prefix:a.createElement(Qe.RM,{linkProtocol:G})}))),!!C&&a.createElement(p.A,{trigger:["hover"],title:n("Alternative text"),placement:"bottom"},a.createElement(u.A.Item,{name:b,className:"selected-image-form__alt",style:{marginTop:s.formItemMarginBottomXS,marginBottom:0}},a.createElement(A.A,{placeholder:n("Alternative text"),allowClear:!0,prefix:a.createElement("span",{className:"addon-text-content"},"Alt"),onChange:e=>{""===e.target.value?D("..."):(B.current.classList.add("selected-td-form__button--active"),D(e.target.value))},ref:k,onSelect:i}))),m.formFieldImageTitleEnabled&&!!V&&a.createElement(p.A,{trigger:["hover"],title:n("Tooltip text"),placement:"bottom"},a.createElement(u.A.Item,{name:g,className:"selected-image-form__alt",style:{marginTop:s.formItemMarginBottomXS,marginBottom:0}},a.createElement(A.A,{placeholder:n("Enter the title of the image"),allowClear:!0,prefix:a.createElement("span",{className:"addon-text-content"},"Title"),onChange:e=>{""===e.target.value?j("..."):(x.current.classList.add("selected-td-form__button--active"),j(e.target.value))},ref:w,onSelect:i}))),!!z&&a.createElement(p.A,{trigger:["hover"],title:n("Image src"),placement:"bottom"},a.createElement(u.A.Item,{name:h,className:"selected-image-form__alt",style:{marginTop:s.formItemMarginBottomXS,marginBottom:0}},a.createElement(A.A,{placeholder:n("\u0421ode that will replace the image `src`"),allowClear:!0,prefix:a.createElement("span",{className:"addon-text-content"},n("Image src")),onChange:e=>{""!==e.target.value&&N.current.classList.add("selected-td-form__button--active")},ref:P,onSelect:i})))))},lo={loop:!1,autoplay:!1,borderRadiusAll:0,borderRadiusTopLeft:0,borderRadiusBottomLeft:0,borderRadiusTopRight:0,borderRadiusBottomRight:0,link:"https://",images:{},src_0:"",renderedHeight_0:0,renderedWidth_0:0,imgReplacer_0:"",title_0:"",alt_0:""},{useToken:io}=c.A,ro=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:o}=io(),[l]=u.A.useForm();let i=(0,n.wA)();const r=(0,qe.rD)(),s=(0,M.K9)(),m=(0,M.XW)(),d=(0,n.d4)(Ge.Ct),c=(0,n.d4)(Ge.CS),[g,y]=(0,a.useState)(!0),[S,k]=(0,a.useState)(!0),[x,P]=(0,a.useState)(!1),[N,T]=(0,a.useState)(!1),[R,C]=(0,a.useState)("https://"),[D,V]=(0,a.useState)(null===l||void 0===l?void 0:l.getFieldsValue(!0)),[j,z]=(0,a.useState)(e),[W,G]=(0,a.useState)(null),[H,U]=(0,a.useState)(),[q,$]=(0,a.useState)(!1),[Q,K]=(0,a.useState)(!1),[Y,J]=(0,a.useState)({start:0,end:0}),Z=(0,a.useRef)(null),ee=`selected_${j.type}_form_link`;(0,a.useEffect)((()=>{q&&Z.current&&Z.current.focus()}),[q]),(0,a.useEffect)((()=>{z(e)}),[e]);const te=(0,n.d4)(Ke.GH);(0,a.useEffect)((()=>{var e;null!==te&&void 0!==te&&null!==(e=te.items)&&void 0!==e&&e.length&&U((0,qe.cM)(te.items,t,((e,t)=>{$(!1),s(O.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[te,U,t,$,s]);(0,a.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||G(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||$(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.addEventListener("click",t)}}),[]);(0,a.useEffect)((()=>{const e=null===l||void 0===l?void 0:l.getFieldsValue(!0);V(e)}),[l]);const oe=({target:e})=>{if(e&&!Q){const{selectionStart:t,selectionEnd:o}=e;J({start:t,end:o})}K(!1)};(0,a.useEffect)((()=>{if(j.settings){var e,t,o,a,i,r,n,s,m,d,c,u,p,g,b;const A=j.settings,S=(0,Qe.AO)(A);var E,h,f,v,_;if(null===l||void 0===l||l.setFieldsValue(S),V(S),A.link&&C((0,Qe.TW)(A.link,"https://")),!(0,Qe.ok)(null===(e=A.borderRadius)||void 0===e?void 0:e.all))(0,Qe.ok)(null===(E=A.borderRadius)||void 0===E?void 0:E.topLeft)||(0,Qe.ok)(null===(h=A.borderRadius)||void 0===h?void 0:h.bottomLeft)||(0,Qe.ok)(null===(f=A.borderRadius)||void 0===f?void 0:f.topRight)||(0,Qe.ok)(null===(v=A.borderRadius)||void 0===v?void 0:v.bottomRight)?y(!1):(0,Qe.ok)(null===(_=A.borderRadius)||void 0===_?void 0:_.all)||y(!0);(0,Qe.ok)(null===(t=A.mobileBorderRadius)||void 0===t?void 0:t.topLeft)||(0,Qe.ok)(null===(o=A.mobileBorderRadius)||void 0===o?void 0:o.bottomLeft)||(0,Qe.ok)(null===(a=A.mobileBorderRadius)||void 0===a?void 0:a.topRight)||(0,Qe.ok)(null===(i=A.mobileBorderRadius)||void 0===i?void 0:i.bottomRight)?k(!1):k(!0),P(!(null===(r=A.borderRadius)||void 0===r||!r.all)||!(null===(n=A.borderRadius)||void 0===n||!n.topLeft)||!(null===(s=A.borderRadius)||void 0===s||!s.bottomLeft)||!(null===(m=A.borderRadius)||void 0===m||!m.topRight)||!(null===(d=A.borderRadius)||void 0===d||!d.bottomRight)),T(!(null===(c=A.mobileBorderRadius)||void 0===c||!c.all)||!(null===(u=A.mobileBorderRadius)||void 0===u||!u.topLeft)||!(null===(p=A.mobileBorderRadius)||void 0===p||!p.bottomLeft)||!(null===(g=A.mobileBorderRadius)||void 0===g||!g.topRight)||!(null===(b=A.mobileBorderRadius)||void 0===b||!b.bottomRight))}}),[l,j]);(0,je.A)((e=>{const t=e.data.operation;t===O.Ru.APPLICATION_OPEN_IMAGE_AI_POPUP?(i((0,Ue.tm)(j.settings.src)),i((0,We.qf)(O.lx.UPLOAD_IMAGE_MODAL_AI))):t===O.Ru.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?(i((0,Ue.tm)(j.settings.src)),i((0,We.qf)(O.lx.UPLOAD_IMAGE_MODAL_UPLOAD))):t===O.Ru.APPLICATION_OPEN_IMAGE_EDIT_POPUP?(i((0,Ue.tm)(j.settings.src)),i((0,We.qf)(O.lx.UPLOAD_IMAGE_MODAL_EDIT))):t===O.Ru.APPLICATION_OPEN_IMAGE_GIF_POPUP?(i((0,Ue.tm)(j.settings.src)),i((0,We.qf)(O.lx.UPLOAD_IMAGE_MODAL_GIF))):t===O.Ru.APPLICATION_OPEN_IMAGE_STOCK_POPUP?(i((0,Ue.tm)(j.settings.src)),i((0,We.qf)(O.lx.UPLOAD_IMAGE_MODAL_STOCK))):t===O.Ru.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(i((0,We.Os)()),i((0,We.Oo)()))}));return a.createElement(u.A,{form:l,layout:"vertical",name:"selected_carousel_form",initialValues:lo,onValuesChange:e=>{const t=(0,Qe.Ze)(j.settings,l,e);m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,caption:t.caption,settings:t}),z((e=>({...e,settings:{...e.settings,...t}})))},autoComplete:"off",className:"element-controls"},d===O.ND&&c.styles?a.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},a.createElement("div",{className:"selected_form-mobile-props-wrapper"},r.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const e=null===l||void 0===l?void 0:l.getFieldsValue(!0);setTimeout((()=>{T((e=>!e)),e.mobileBorderRadiusAll=N?null:5,m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,settings:{...j.settings,mobileBorderRadius:{...j.settings.mobileBorderRadius,all:e.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}}),z((t=>({...t,settings:{...t.settings,mobileBorderRadius:{...t.settings.mobileBorderRadius,all:e.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})))}))}},N?a.createElement(w.A,null):a.createElement(B.A,null)))),N&&a.createElement("div",{style:{marginBottom:4}},a.createElement(he,{form:l,oneMobileBorderRadiusValue:S,setOneMobileBorderRadiusValue:k}))),a.createElement(h.A,{className:"selected-td-form__divider"}),!!j.settings.showOnMobile&&a.createElement(u.A.List,{name:"images"},(()=>{var e,t;return a.createElement("div",{style:{paddingTop:o.formItemMarginBottomMD+4}},null===j||void 0===j||null===(e=j.settings)||void 0===e||null===(t=e.carouselImages)||void 0===t?void 0:t.map(((e,t)=>a.createElement(ao,{key:t,elementSettings:D,setElementSettings:z,postfix:"_"+t,form:l,handleSelect:oe}))))})),a.createElement(h.A,{className:"selected-td-form__divider"}))):a.createElement("div",{id:"selected_element_form_desktop_props"},a.createElement("div",{className:"selected_form-props-wrapper"},a.createElement(p.A,{trigger:["hover"],title:t("Link for all slides"),placement:"bottom"},a.createElement(u.A.Item,{name:"link"},a.createElement(A.A,{addonBefore:a.createElement(Qe.Ai,{linkProtocol:R,handleLinkProtocolsChange:e=>{l.setFieldValue("link","mergetag"!==e?e:""),C(e)},__:t}),placeholder:t("Link for all slides"),allowClear:!0,onSelect:oe,prefix:a.createElement(Qe.RM,{linkProtocol:R})}))),a.createElement(h.A,{className:"selected-td-form__divider"}),H&&a.createElement(a.Fragment,null,a.createElement(E.A,{span:24,id:"merge_tags_wrapper"},a.createElement(u.A.Item,{style:{marginBottom:o.formItemMarginBottomMD,marginTop:o.formItemMarginBottomMD}},a.createElement(f.Ay,{id:"merge_tags_button",icon:a.createElement(F.A,{icon:"MergeTags"}),style:{width:"100%",display:q?"none":"block"},onClick:()=>$(!0)},t("Merge tags")),a.createElement(v.A,{ref:Z,popupClassName:"merge-tags",options:H,placeholder:t("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const o=t.map(((t,o)=>{const l=t.label.split(new RegExp(`(${e})`,"gi"));return a.createElement("span",{key:t.value},0!==o&&a.createElement("span",null,"\xa0/\xa0"),l.map(((t,o)=>t.toLowerCase()===e.toLowerCase()?a.createElement("span",{key:o,style:{color:"red"}},t):t)))}));return a.createElement("div",{title:t.map((e=>e.label)).join(" / ")},o)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(e,t)=>{if($(!1),e){const o=te.syntax.length>1?H.findIndex((e=>e.key===t[0].key)):0,a=te.syntax[o].replace("%value%",e[e.length-1]),i=`selected_${j.type}_form${"carousel"===j.type?"_images":""}`;["imgReplacer","title","alt","src","link"].some((e=>null===W||void 0===W?void 0:W.getAttribute("id").includes(`${i}_${e}`)))||null!==W&&void 0!==W&&W.getAttribute("id").includes(ee)?((e,t)=>{const o=document.getElementById(t);if(o){var a,i;const s=`selected_${j.type}_form_${t.includes("__images_")?"_images":""}_`,d=t.substring(t.indexOf(s)+s.length),c=null===(a=o.value)||void 0===a?void 0:a.substring(0,Y.start),u=null===(i=o.value)||void 0===i?void 0:i.substring(Y.end);let p={[d]:c+e+u};var r;if(d.includes("_"))p={carouselImages:[...(null===(r=j.settings)||void 0===r?void 0:r.carouselImages)||[]]},p.carouselImages[d.split("_")[1]][d.split("_")[0]]=c+e+u;else if(j.type===O.bV.CAROUSEL&&ee===t){var n;p={[d]:c+e+u,carouselImages:[...(null===(n=j.settings)||void 0===n?void 0:n.carouselImages.map((t=>({...t,link:c+e+u}))))||[]]}}m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,settings:{...j.settings,...p}}),z((e=>({...e,settings:{...e.settings,...p}}))),l.setFieldValue(d,c+e+u),o.focus(),setTimeout((()=>{o.selectionStart=Y.start,o.selectionEnd=Y.start+e.length}),400),K(!0)}})(a,null===W||void 0===W?void 0:W.getAttribute("id")):(l.setFieldValue("imgReplacer",a),m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,settings:{...j.settings,imgReplacer:a}}),z((e=>({...e,settings:{...e.settings,imgReplacer:a}}))))}},style:{display:q?"block":"none"},open:q,onKeyDown:e=>{"Escape"===e.key&&$(!1)}}))),a.createElement(h.A,{className:"selected-td-form__divider"})),a.createElement(u.A.List,{name:"images",initialValue:null===D||void 0===D?void 0:D.images},(()=>{var e,t;return a.createElement("div",{style:{paddingTop:o.formItemMarginBottomMD+4}},null===j||void 0===j||null===(e=j.settings)||void 0===e||null===(t=e.carouselImages)||void 0===t?void 0:t.map(((e,t)=>a.createElement("div",{className:"carousel__slide",key:t},a.createElement(ao,{elementSettings:D,setElementSettings:z,postfix:"_"+t,form:l,handleSelect:oe})))))})),a.createElement(E.A,{span:24},a.createElement(u.A.Item,{style:{marginBottom:o.formItemMarginBottomMD}},a.createElement(f.Ay,{id:"add_slide_button",icon:a.createElement(F.A,{icon:"AddSlide"}),style:{width:"100%"},onClick:()=>(()=>{var e,t;const{width:o,height:a,renderedWidth:l,renderedHeight:i}=(null===j||void 0===j||null===(e=j.settings)||void 0===e?void 0:e.carouselImages[0])||{width:{value:600},height:{value:600},renderedWidth:600,renderedHeight:600},r={src:"https://emcdn.ru/1865/231031_17_BGU9Mso.png",width:{value:o.value,dim:"px"},height:{value:a.value,dim:"px"},alt:"",title:"",link:null,renderedWidth:l,renderedHeight:i,imgReplacer:"",mobileWidth:{value:null,dim:"px"},mobileHeight:{value:null,dim:"px"},mobileBorderRadius:{all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null}},n=[...null===j||void 0===j||null===(t=j.settings)||void 0===t?void 0:t.carouselImages,r];m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,settings:{...j.settings,carouselImages:n}}),z((e=>({...e,settings:{...e.settings,carouselImages:n}})))})()},t("Add slide")))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(b.A,{gutter:20,style:{marginTop:o.formItemMarginBottomMD-10}},a.createElement(E.A,{span:12},a.createElement(_.A,{size:10,align:"baseline"},a.createElement(u.A.Item,{name:"loop",valuePropName:"checked",style:{marginBottom:o.formItemMarginBottomMD-6}},a.createElement(X.A,{size:"small",id:"Loop"})),a.createElement("span",{style:{position:"relative",top:2}},a.createElement("label",{htmlFor:"Loop"},t("Loop"))))),a.createElement(E.A,{span:12},a.createElement(_.A,{size:10,align:"baseline"},a.createElement(u.A.Item,{name:"autoplay",valuePropName:"checked",style:{marginBottom:o.formItemMarginBottomMD-6}},a.createElement(X.A,{size:"small",id:"Autoplay"})),a.createElement("span",{style:{position:"relative",top:2}},a.createElement("label",{htmlFor:"Autoplay"},t("Autoplay")))))),a.createElement(h.A,{className:"selected-td-form__divider"}),r.formFieldBorderRadiusEnabled&&a.createElement(a.Fragment,null,a.createElement(b.A,{gutter:10,align:"middle"},a.createElement(E.A,{span:20},a.createElement("div",{className:"form-group-title"},t("Border radius"))),a.createElement(E.A,{span:4,align:"right"},a.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{P((e=>!e)),l.setFieldValue("borderRadiusAll",x?0:5),m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,settings:{...j.settings,borderRadius:{all:x?"":5}}}),z((e=>({...e,settings:{...e.settings,borderRadius:{all:x?null:5}}})))}))}},x?a.createElement(w.A,null):a.createElement(B.A,null)))),x&&a.createElement("div",{style:{marginBottom:4}},a.createElement(I.A,{form:l,oneBorderRadiusValue:g,setOneBorderRadiusValue:y,elementSettings:j.settings}))))))},no={animate:!0,expandSingleSection:!0,sections:[{expanded:!1,index:0}]},{useToken:so}=c.A,mo=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:o}=so(),[l]=u.A.useForm(),i=(0,M.XW)(),[r,n]=(0,a.useState)(e);(0,a.useEffect)((()=>{n(e)}),[e]),(0,a.useEffect)((()=>{if(r.settings){const e=r.settings,t=(0,Qe.AO)(e);null===l||void 0===l||l.setFieldsValue(t)}}),[l,r]);return a.createElement(u.A,{form:l,layout:"vertical",name:"selected_carousel_form",initialValues:no,onValuesChange:e=>{const t=(0,Qe.Ze)(r.settings,l,e);i({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:r.type,caption:t.caption,settings:t}),n((e=>({...e,settings:{...e.settings,...t}})))},autoComplete:"off",className:"element-controls"},a.createElement("div",{id:"selected_element_form_desktop_props"},a.createElement("div",{className:"selected_form-props-wrapper"},a.createElement(b.A,{gutter:20},a.createElement(E.A,{span:15},a.createElement(_.A,{size:10,align:"baseline"},a.createElement(u.A.Item,{name:"expandSingleSection",valuePropName:"checked"},a.createElement(X.A,{size:"small",id:"ExpandSingleSection"})),a.createElement("span",{style:{position:"relative",top:2}},a.createElement("label",{htmlFor:"ExpandSingleSection"},t("Expand only one section"))))),a.createElement(E.A,{span:9},a.createElement(_.A,{size:10,align:"baseline"},a.createElement(u.A.Item,{name:"animate",valuePropName:"checked"},a.createElement(X.A,{size:"small",id:"Animate"})),a.createElement("span",{style:{position:"relative",top:2}},a.createElement("label",{htmlFor:"Animate"},t("Animate")))))),a.createElement(h.A,{className:"selected-td-form__divider"}),a.createElement(u.A.List,{name:"sections"},(()=>{var e,l;return a.createElement("div",{style:{paddingTop:o.formItemMarginBottomMD+4}},null===r||void 0===r||null===(e=r.settings)||void 0===e||null===(l=e.sections)||void 0===l?void 0:l.map(((e,o)=>{var l,s;return a.createElement(b.A,{gutter:24,key:`expanded_${o}`},a.createElement(E.A,{span:20},a.createElement(_.A,{size:10,align:"baseline"},a.createElement("span",{style:{position:"relative",top:2}},t("Section ")+(o+1)),a.createElement(u.A.Item,{name:`expanded_${o}`},a.createElement(X.A,{size:"small",id:`expanded_${o}`,checked:e.expanded})),a.createElement("span",{style:{position:"relative",top:2}},a.createElement("label",{htmlFor:`expanded_${o}`},t("expanded"))))),a.createElement(E.A,null,(null===r||void 0===r||null===(l=r.settings)||void 0===l||null===(s=l.sections)||void 0===s?void 0:s.length)>1&&a.createElement(f.Ay,{type:"text",icon:a.createElement(to.A,null),style:{marginRight:"auto"},onClick:()=>{return e=o,n((t=>{var o;return{...t,settings:{...t.settings,sections:null===(o=r.settings.sections)||void 0===o?void 0:o.filter(((t,o)=>o!==e))}}})),void i({operation:O.Ru.SANDBOX_ACCORDION_REMOVE_SECTION,settings:{index:e}});var e}})))})))})),a.createElement(b.A,{gutter:20},a.createElement(E.A,{span:24},a.createElement(u.A.Item,{style:{marginBottom:o.formItemMarginBottomMD}},a.createElement(f.Ay,{style:{width:"100%",display:"block"},icon:a.createElement(F.A,{icon:"MergeTags"}),onClick:()=>(n((e=>{var t;return{...e,sections:null===r||void 0===r||null===(t=r.settings)||void 0===t?void 0:t.sections.push({expanded:!1})}})),void i({operation:O.Ru.SANDBOX_ACCORDION_ADD_SECTION,settings:{section:t("Section title"),text:t("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}}))},t(" Add section"))))),a.createElement(h.A,{className:"selected-td-form__divider"}))))},co=({className:e,formSettings:t,emailElementType:o})=>{const i=(0,n.wA)(),d=(0,$e.Cb)(),c=(0,a.useRef)(),u=(0,n.d4)(Ge.B),p=(0,n.d4)(s.qX),g=(0,n.d4)(m.qX),b=o===O.Tm?p:g,[E,h]=(0,a.useState)(b);(0,a.useEffect)((()=>{h(b.type===O.bV.CAROUSEL||b.type===O.bV.IMG?t.settings:b)}),[b,t.settings]);return(0,je.A)((e=>{const t=e.data.operation,o=e.data.action;if(t===O.Ru.APPLICATION_ACTION){function a(e,t=null){const o={[e]:t||!E[e]};d(o,E.type),i((0,s.G_)(o)),h((e=>({...e,...o})))}"toggle_strong"===o&&a("textStrong"),"toggle_italic"===o&&a("textItalic"),"toggle_underline"===o&&a("textUnderline"),"toggle_strikethrough"===o&&a("textStrikethrough"),"textAlign_left"===o&&a("textAlign","left"),"textAlign_right"===o&&a("textAlign","right"),"textAlign_center"===o&&a("textAlign","center")}})),a.createElement(l.A,{nodeRef:c,in:u===O.yI,timeout:300,classNames:"transition"},a.createElement("div",{ref:c,className:r()("selected-element-panel-content",{[e]:e})},b.type===O.bV.IMG&&a.createElement(Je,{elementSettings:b}),b.type===O.bV.COUNTDOWN&&a.createElement(Je,{elementSettings:b}),b.type===O.bV.VIDEO&&a.createElement(Je,{elementSettings:b}),b.type===O.bV.TEXT&&a.createElement(Et,{elementSettings:b}),b.type===O.bV.LINK&&a.createElement(Bt,{elementSettings:b})," ",b.type===O.bV.TABLE&&a.createElement(St,{elementSettings:b}),(b.type===O.bV.TD||b.type===O.bV.STRUCTURE||b.type===O.bV.GROUP||b.type===O.bV.COLUMN)&&a.createElement(Dt,{elementSettings:b}),b.type===O.bV.VAR&&a.createElement(eo,{elementSettings:b}),b.type===O.bV.BUTTON&&a.createElement(Jt,{elementSettings:b}),b.type===O.bV.DIV&&a.createElement(Wt,{elementSettings:b}),b.type===O.bV.VINDENT&&a.createElement(wt,{elementSettings:b}),b.type===O.bV.FLOAT_BLOCK&&a.createElement($t,{elementSettings:b}),t.type===O.bV.CAROUSEL&&a.createElement(ro,{elementSettings:t}),t.type===O.bV.ACCORDION&&a.createElement(mo,{elementSettings:t})))};co.defaultProps={className:null};const uo=co},52995:(e,t,o)=>{o.d(t,{A:()=>N});var a=o(98173),l=o(2604),i=o(30150),r=o(40120),n=o(27499),s=o(48753),m=o(37969),d=o(8218),c=o(49823),u=o(67034),p=o(64909),g=o(94780),b=o(12543),E=o(8807),h=o(23424),f=o(47014),v=o(97032),_=o(40835),A=o(40277),y=o(32947),S=o(86095),k=o(90614),B=o(15626),w=o(27941);const{useToken:x}=r.A,P=({isModalVisible:e,email:t})=>{const{__:o}=(0,b.s9)(),[r]=n.A.useForm(),P=(0,l.wA)(),{emailId:N}=(0,i.g)(),T=(0,l.d4)(f.C1),[R,I]=(0,_.lg)(),{token:C}=x(),L=(0,p.hN)(),F=(0,l.Pj)(),[O,M]=(0,a.useState)(!1),D=t.project,[V,j]=(0,v.OD)(),{data:z}=v.Nq.endpoints.getProject.select(+D)(F.getState()),{testEmails:W}=(0,w.rD)(),[G,H]=(0,a.useState)([]),[U,q]=(0,a.useState)(!1),X=(0,k.ml)(B.AZ.ON_SEND_EMAIL_MODAL_ID);(0,a.useEffect)((()=>{y.EW.isPlugin&&e?X.fire(t).then((t=>{t.some((e=>!1===e))?P((0,h.Oo)()):M(e)})):M(e)}),[e,P,M,t,X]),(0,a.useEffect)((()=>{if(z&&!y.EW.isPlugin){const{owner:e,admins:t,users:o,invited_users:a}=z.members;let l=[];const i=localStorage.getItem(y.V0.em_test_emails)?JSON.parse(localStorage.getItem(y.V0.em_test_emails)):[];if(i.length&&i[D]&&i[D].map((({prevLSEmail:e})=>l.push(e))),a&&a.map((({invited_user_email:e})=>l.push(e))),o&&o.map((({user_email:e})=>l.push(e))),e&&l.push(e.user_email),t&&t.map((({user_email:e})=>l.push(e))),z.projects_test_emails){const e=z.projects_test_emails.map((({projects_test_email:e})=>e));l.push(...e)}const r=Array.from(new Set(l));l.length&&H(r.map((e=>({value:e}))))}}),[z,D]),(0,a.useEffect)((()=>{y.EW.isPlugin&&H(W.map((e=>({value:e}))))}),[W]),(0,a.useEffect)((()=>{var e;const t=localStorage.getItem(y.V0.em_test_emails);if(t&&O&&0===(null===(e=r.getFieldValue("recipients"))||void 0===e?void 0:e.length)){const e=JSON.parse(t);null!==e&&void 0!==e&&e[D]&&r.setFieldsValue({recipients:e[D]})}}),[D,O,r]),(0,a.useEffect)((()=>{r.setFieldsValue({subject:t.subject})}),[r,t.subject]);const $=(0,S.fn)();return(0,a.useEffect)((()=>{if(I.isSuccess&&U){var e;if(200!==(null===(e=I.data)||void 0===e?void 0:e.status)){var a,l;(0,A.p6)({error:{data:{code:null===(a=I.data)||void 0===a?void 0:a.code,message:null===(l=I.data)||void 0===l?void 0:l.message}}},L)}else{const e=[...new Set([...G.map((e=>e.value)),...r.getFieldValue("recipients")])];V({projectId:D,projects_test_emails:e.map((e=>({projects_test_email:e})))});const a=localStorage.getItem(y.V0.em_test_emails)?JSON.parse(localStorage.getItem(y.V0.em_test_emails)):[];let l=r.getFieldValue("recipients");localStorage.setItem(y.V0.em_test_emails,JSON.stringify({...a,[D]:[...new Set(l)]})),(0,A.wB)(o("The email \u201c")+t.title+o("\u201d was successfully sent."),L)}q(!1),r.resetFields(),P((0,h.Oo)())}}),[I,r,D,V,G,U,P,t.title,j,o,L]),(0,a.useEffect)((()=>{j.isError&&((0,A.p6)(j,L),q(!1),r.resetFields(),P((0,h.Oo)()))}),[P,j,r,L]),(0,a.useEffect)((()=>{r.setFieldsValue({subject:t.subject||t.title})}),[t,r]),a.createElement(s.A,{width:572,title:a.createElement("div",null,a.createElement(E.A,{icon:"SendOutlined"})," ",o("Send a test email")),className:"blocks-modal",open:O,onCancel:()=>{P((0,h.Oo)()),r.resetFields()},centered:!0,footer:[a.createElement(m.Ay,{key:"submit",size:"large",className:"em-analytics__email-send-test",type:"primary",htmlType:"submit",form:"Send mail",loading:j.isLoading,icon:a.createElement(E.A,{icon:"SendOutlined",className:"email-preview-menu__list-item-icon"}),onClick:()=>{r.validateFields().then((()=>{const e={user_id:T.id,project_id:D,email_id:N,subject:r.getFieldValue("subject"),email:r.getFieldValue("recipients").join(","),html:(t=(null===$||void 0===$?void 0:$.getValue())||"",t.replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[/]/g,"\\/").replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"))};var t;R(e),q(!0)})).catch((e=>{}))},disabled:I.isLoading},o("Send"))],forceRender:!0},a.createElement(n.A,{form:r,layout:"vertical",name:"send_mail_form",initialValues:{subject:t.subject||t.title,recipients:[]},autoComplete:"off",style:{padding:"10px 24px 0"}},a.createElement(n.A.Item,{label:o("Subject"),name:"subject",rules:[{required:!1,message:o("Please type subject")}]},a.createElement(d.A,{size:"large",placeholder:o("Type subject")})),a.createElement(n.A.Item,{label:o("Recipients"),name:"recipients",tooltip:{title:o("The test email will be sent to the specified addresses."),icon:a.createElement(g.A,null)},rules:[{required:!0,validator:(e,t)=>t.length>10?Promise.reject(new Error(o("A test email can be sent to a maximum of 10 addresses."))):0!==t.length?t.every((e=>A.au.test(e.toLowerCase())))?Promise.resolve():Promise.reject(new Error(o("Please type correct emails"))):Promise.reject(new Error(o("Please type emails")))}]},a.createElement(c.A,{size:"large",mode:"tags",placeholder:o("Add up to 10 recipients"),tooltip:{title:"Tooltip with customize icon",icon:a.createElement(g.A,null)},options:G,tagRender:e=>{const{label:t,closable:o,onClose:l}=e;return a.createElement(u.A,{color:C.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:o,onClose:l,style:{borderRadius:6}},t)},getPopupContainer:()=>document.getElementById("send_mail_form")}))))};P.defaultProps={isModalVisible:!1,email:null};const N=P},72915:(e,t,o)=>{o.d(t,{A:()=>j});var a=o(98173),l=o(40120),i=o(27499),r=o(8218),n=o(49823),s=o(67034),m=o(94674),d=o(13785),c=o(49856),u=o(29123),p=o(94780),g=o(2604),b=o(30150),E=o(12543),h=o(26298),f=o.n(h),v=o(77306),_=o(5618),A=o(98845),y=o(97032),S=o(83027),k=o(12741),B=o(39206),w=o(1047),x=o(27941),P=o(40277),N=o(32947);const{useToken:T}=l.A,{title:R,description:I,tags:C,type:L,is_template:F,group:O}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template",group:"group"},M={[R]:"",[I]:"",[C]:[],[F]:!1},D={[I]:"",[C]:[],[L]:""};const V=({className:e,element:t})=>{var o,l;const{__:h}=(0,E.s9)(),{projectId:F}=(0,b.g)(),V=(0,g.wA)(),[j]=i.A.useForm(),{token:z}=T(),W=(0,x.rD)(),G=(0,g.Pj)(),H=(0,g.d4)(w.UI),{data:U}=(0,_.h1)(),{data:q}=(0,b.KC)(),X=t.hasOwnProperty("type")?N.IE:N.Tm,$=t.hasOwnProperty("type")?N.YY:N.zh,{refetch:Q,isLoading:K,isFetching:Y,isUninitialized:J,isSuccess:Z}=(0,S.Oo)({parent:null===(o=q.group)||void 0===o?void 0:o[0]},{skip:!(null!==(l=q.group)&&void 0!==l&&l[0])});(0,a.useEffect)((()=>{!J&&Q()}),[J,Q]);const[ee,te]=(0,a.useState)([]),[oe,ae]=(0,a.useState)([]),[le,ie]=(0,a.useState)(t.is_template||!1),{data:re}=y.Nq.endpoints.getProject.select(+F)(G.getState());(0,a.useEffect)((()=>{!J&&Q()}),[t.group,Q,J]),(0,a.useEffect)((()=>{if(Z&&t.is_template&&t.group.length){const e=t.group;let o={};e.length&&H.length&&(null===e||void 0===e||e.forEach((e=>{null===H||void 0===H||H.forEach((t=>{let a=t.children.find((t=>t.id===e));a&&(o.hasOwnProperty(t.id)||(o[t.id]=[]),o[t.id].push({label:a.name,value:a.id}))}))})));let a={};for(let t in o)o.hasOwnProperty(+t)&&(a[`group_${t}`]=o[t].map((e=>({...e,value:String(e.value)}))));j.setFieldsValue(a)}}),[j,H,t.is_template,t.group,Z]),(0,a.useEffect)((()=>{var e;ae(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,P.HT)(re,$)))||void 0===e?void 0:e.map((e=>({value:e.name,key:e.id}))))}),[re,$]),(0,a.useEffect)((()=>{if(t){var e,o;const a=null===(e=(0,P._q)(t,$))||void 0===e?void 0:e.map((e=>e.name)),l=t.emailtags||t.blocktags,i=null===(o=(0,P._q)(t,$))||void 0===o?void 0:o.filter((e=>l.includes(e.id))).map((e=>e.name));j.setFieldsValue({title:t.title,description:t.description,tags:t.tags||i||a,type:t.type})}}),[j,t,$]);(0,a.useEffect)((()=>{if(U){const e=U.schema.properties.acf.properties.type.items.enum;let t=[];const o={Applications:h("Apps"),Articles:h("Article"),Banners:h("Banners"),Buttons:h("Buttons"),"Call to Action":h("Call to Action"),Contacts:h("Contacts"),Content:h("Content"),"E-Commerce":h("E-Commerce"),Feature:h("Features"),Footer:h("Footers"),Header:h("Headers"),Lists:h("Lists"),Menu:h("Menus"),Other:h("Others"),Polls:h("Polls"),Promocodes:h("Promocodes"),Separators:h("Separators")};for(let a in e)t.push({label:o[e[a]],value:e[a]});te(t)}}),[U,h]);return a.createElement("div",{className:f()("settings-panel",{[e]:e})},a.createElement(i.A,{form:j,layout:"vertical",name:"settings_panel_form",initialValues:X===N.Tm?{EmailInitialValues:M}:D,onValuesChange:e=>{const o=Object.keys(e)[0];switch(o.split("_")[0]){case R:t.isNew?V((0,k.BQ)(e[o])):V((0,w.VK)(e[o]));break;case O:V((0,w.Bu)({[o.split("_")[1]]:e[o]}));break;case I:X===N.Tm?t.isNew?V((0,k.Zs)(e[o])):V(A.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{description:e[o]})}))):t.isNew?V((0,B.AS)(e[o])):V(_.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{description:e[o]})})));break;case"is":t.isNew?V((0,k.TC)(e[o])):V(A.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{is_template:e[o]})})));break;case C:{const a=e[o].map((e=>e.trim()));X===N.Tm?t.isNew?V((0,k.yY)(a)):V(A.GY.util.updateQueryData("getEmail",t.id,(e=>{Object.assign(e,{tags:a})}))):t.isNew?V((0,B.TB)(a)):V(_.VM.util.updateQueryData("getBlock",t.id,(e=>{Object.assign(e,{tags:a})})));break}case L:V(_.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{type:e[o]})})));break;default:return}},autoComplete:"off"},W.subjectEnabled&&X===N.Tm&&a.createElement(i.A.Item,{label:h("Title"),name:R,tooltip:{title:h("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:a.createElement(p.A,null)}},a.createElement(r.A.TextArea,{placeholder:h("Type title here"),autoSize:{minRows:1}})),W.descriptionEnabled&&a.createElement(i.A.Item,{label:h("Description"),name:I,tooltip:{title:h("Description is used in other sections of the service."),icon:a.createElement(p.A,null)}},a.createElement(r.A.TextArea,{placeholder:h("Type your description here"),autoSize:{minRows:2}})),W.tagsEnabled&&a.createElement(i.A.Item,{label:h("Tags"),name:C,tooltip:{title:h("Tags help you find the block in the list."),icon:a.createElement(p.A,null)},rules:[{message:"Please input your username!",type:"array"}]},a.createElement(n.A,{mode:"tags",style:{width:"100%"},placeholder:h("Type your tags here"),options:oe,tagRender:e=>{const{label:t,closable:o,onClose:l}=e;return a.createElement(s.A,{color:z.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:o,onClose:l,style:{borderRadius:6}},t)},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})),a.createElement(m.A,{className:"selected-td-form__divider",style:{marginBottom:16}}),X===N.Tm&&W.isTemplateEnabled&&a.createElement(d.A,{title:t.isNew?h("Save email first."):h("Use this email as a template for creating future emails."),key:"isTemplate"},a.createElement(c.A,{size:10,align:"baseline"},a.createElement(i.A.Item,{name:"is_template",valuePropName:"checked",initialValue:le},a.createElement(u.A,{size:"small",id:"setIsTemplate",onChange:e=>{ie(e)},disabled:t.isNew})),a.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2,fontSize:14,color:z.colorText}},a.createElement("label",{htmlFor:"setIsTemplate"},h("Is a template"))))),le&&a.createElement(v.A,{element:t,refetchProjectGroups:Q,isLoading:K||Y}),X===N.IE&&a.createElement(i.A.Item,{name:L,label:h("Type"),tooltip:{title:h("Select the block type to find any block on the list faster."),icon:a.createElement(p.A,null)},rules:[{message:"Please input type!"}]},a.createElement(n.A,{placeholder:h("Choose block type"),options:ee,getPopupContainer:()=>document.querySelector(".email-settings__collapse")}))))};V.defaultProps={className:"",email:void 0};const j=V},45185:(e,t,o)=>{o.d(t,{A:()=>_});var a=o(98173),l=o(201),i=o(66964),r=o(10750),n=o.n(r),s=o(97946),m=o.n(s),d=o(50664),c=o.n(d),u=o(36529),p=o.n(u),g=o(22548),b=o.n(g),E=o(20065),h=o.n(E),f=o(40277);o(39941);const v=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:p()},{sizeArray:[8,8,8],name:"column-three",html:b()},{sizeArray:[6,6,6,6],name:"column-four",html:h()},{sizeArray:[8,16],name:"column-two-33",html:m()},{sizeArray:[16,8],name:"column-two-66",html:c()}],_=()=>{const e=(0,f.sh)(),t=(0,f._9)();return a.createElement("div",{className:"structures blocks-search__empty-wrapper"},a.createElement("div",{className:"structures__list"},a.createElement("div",null,v&&v.map(((o,r)=>a.createElement("div",{key:o.name},a.createElement("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,o.html),onDragStart:e=>t(e,o.html)},a.createElement(l.A,{gutter:[6,6],className:"structures__item-row"},o.sizeArray.map(((e,t)=>a.createElement(i.A,{span:e,key:o.name+t},a.createElement("div",{className:"structures__item-col"}))))))))))))}},58099:(e,t,o)=>{o.d(t,{A:()=>_});var a=o(98173),l=o(201),i=o(66964),r=o(7549),n=o.n(r),s=o(29539),m=o.n(s),d=o(6573),c=o.n(d),u=o(75424),p=o.n(u),g=o(43643),b=o.n(g),E=o(96786),h=o.n(E),f=o(40277);o(39941);const v=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:p()},{sizeArray:[8,8,8],name:"column-three",html:b()},{sizeArray:[6,6,6,6],name:"column-four",html:h()},{sizeArray:[8,16],name:"column-two-33",html:m()},{sizeArray:[16,8],name:"column-two-66",html:c()}],_=()=>{const e=(0,f.sh)(),t=(0,f._9)();return a.createElement("div",{className:"structures blocks-search__empty-wrapper"},a.createElement("div",{className:"structures__list"},a.createElement("div",null,v&&v.map(((o,r)=>a.createElement("div",{key:o.name},a.createElement("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,o.html),onDragStart:e=>t(e,o.html)},a.createElement(l.A,{gutter:[6,6],className:"structures__item-row"},o.sizeArray.map(((e,t)=>a.createElement(i.A,{span:e,key:o.name+t},a.createElement("div",{className:"structures__item-col"}))))))))))))}},45271:(e,t,o)=>{o.d(t,{A:()=>u});var a=o(98173),l=o(2407),i=o.n(l),r=o(12543),n=o(64909),s=o(98845),m=o(5618),d=o(40277);const c=({element:e})=>{const{__:t,_x:o}=(0,r.s9)(),[l]=(0,s.dN)(),[i]=(0,m.OZ)(),c=(0,n.hN)(),u=(e,a)=>{if(e.error)return(0,d.p6)(e,c),!1;(0,d.wB)(t("The ")+(a.hasOwnProperty("type")?t("block"):o("email","letter"))+" "+t("\u201c")+e.data.title+t("\u201d")+t("was successfully")+" "+(a.lock?a.hasOwnProperty("type")?o("unlocked.","block"):o("unlocked.","email"):a.hasOwnProperty("type")?o("locked.","block"):o("locked.","email")),c)};return a.createElement("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:()=>{e.hasOwnProperty("type")?i({blockId:e.id,lock:!e.lock}).then((t=>{u(t,e)})):l({emailId:e.id,lock:!e.lock}).then((t=>{u(t,e)}))}},e.lock?t("Unlock"):t("Lock"))};c.defaultProps={element:i().shape({lock:null,id:null})};const u=c},30751:(e,t,o)=>{o.d(t,{A:()=>E});var a=o(98173),l=o(27499),i=o(48753),r=o(37969),n=o(201),s=o(66964),m=o(8218),d=o(64909),c=o(2604),u=o(12543),p=o(23424),g=o(40277),b=o(79965);const E=({isModalVisible:e,userEmail:t,subscriptionRequest:o,userName:E,currentPlane:h})=>{const{__:f}=(0,u.s9)(),v=(0,c.wA)(),[_]=l.A.useForm(),[A,y]=(0,b.E)(),S=(0,d.hN)(),k=()=>{v((0,p.Oo)())},B=()=>{_.validateFields().then((()=>{const e=_.getFieldsValue(!0);A(JSON.stringify(e)).then((e=>{var t,o,a;200===(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(o=t.data)||void 0===o?void 0:o.status)?((0,g.wB)(null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.message,S),k()):e.error&&(0,g.p6)(e,S)}))})).catch((e=>{}))};return(0,a.useEffect)((()=>{o&&(null===_||void 0===_||_.setFieldsValue({request_tariff:o,user_name:E,user_email:t,user_tariff:h}))}),[_,o,h,E,t]),a.createElement(i.A,{title:f("Request for changing the pricing plan"),className:"blocks-modal",open:e,onOk:B,onCancel:k,centered:!0,width:572,footer:[a.createElement(r.Ay,{key:"submit",type:"primary",size:"large",onClick:B,disabled:y.isLoading},f("Send"))],forceRender:!0},a.createElement(l.A,{form:_,layout:"vertical",name:"switch_to_plan_form",onFinish:B,initialValues:{request_email:t,request_phone:"",comment:"",request_tariff:o},autoComplete:"off",style:{padding:"10px 24px 0"}},a.createElement(n.A,{gutter:16},a.createElement(s.A,{span:12}," ",a.createElement(l.A.Item,{label:f("Email"),name:"request_email",rules:[{required:!0,message:f("Please enter your email address"),validator:(e,t)=>g.au.test(t)?Promise.resolve():Promise.reject(new Error(f("Please enter the correct email.")))}]},a.createElement(m.A,{size:"large",placeholder:f("Email"),type:"email"}))),a.createElement(s.A,{span:12}," ",a.createElement(l.A.Item,{label:f("Phone number"),name:"request_phone"},a.createElement(m.A,{size:"large",placeholder:f("Phone number")})))),a.createElement(l.A.Item,{label:f("Comment"),name:"comment"},a.createElement(m.A.TextArea,{placeholder:f("Please add a comment to your request"),autoSize:{minRows:2}}))))}},41882:(e,t,o)=>{o.d(t,{A:()=>_});var a=o(98173),l=o(47555),i=o(63719),r=o(49856),n=o(13785),s=o(37969),m=o(30150),d=o(50078),c=o(12543),u=o(47091),p=o(79890),g=o(47113),b=o(40277),E=o(32947),h=o(96734);const{Content:f}=l.A,{Paragraph:v}=i.A,_=()=>{const{__:e}=(0,c.s9)(),{projectId:t,emailId:o}=(0,m.g)(),i=(0,h.p)();let _=(0,m.Zp)();const A=i.get(E.A9.em_template_email)||o;(0,a.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const y=a.createElement(a.Fragment,null,a.createElement(r.A,{size:10},a.createElement(n.A,{title:e("To emails"),placement:"left"},a.createElement(s.Ay,{type:"text",icon:a.createElement(d.A,null),onClick:()=>(0,b.XZ)(_,`/projects/${t}`),shape:"circle"})),a.createElement(v,{className:"ant-page-header-heading-title"},e("Select email template")),a.createElement(p.A,{isBlocks:!1,templateEmailId:A}))),S=a.createElement(a.Fragment,null);return a.createElement(l.A,{className:"template-page"},a.createElement(g.A,{leftBlock:y,rightBlock:S}),a.createElement(f,{className:"template-page__container"},a.createElement("div",{className:"template-page__content container"},a.createElement(u.A,{projectId:E.p5,emailsView:E.Y$,templateEmailId:A}))))}},37037:(e,t,o)=>{o.d(t,{A:()=>A});var a=o(98173),l=o(27499),i=o(38976),r=o(8218),n=o(94780),s=o(2604),m=o(26298),d=o.n(m),c=o(12543),u=o(98845),p=o(12741);const{utm_source:g,utm_medium:b,utm_campaign:E,utm_term:h,utm_content:f}={utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content"},v={[g]:"",[b]:"",[E]:"",[h]:"",[f]:""},_=({className:e,email:t})=>{const{__:o}=(0,c.s9)(),m=(0,s.wA)(),[_]=l.A.useForm();(0,a.useEffect)((()=>{var e,o,a,l,i;t&&_.setFieldsValue({utm_source:(null===(e=t.utm_parameters)||void 0===e?void 0:e.utm_source)||"",utm_medium:(null===(o=t.utm_parameters)||void 0===o?void 0:o.utm_medium)||"",utm_campaign:(null===(a=t.utm_parameters)||void 0===a?void 0:a.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)||""})}),[_,t]);return a.createElement("div",{className:d()("settings-panel",{[e]:e})},a.createElement(l.A,{form:_,layout:"vertical",name:"settings_panel_form_utm",initialValues:v,onValuesChange:e=>{const o=Object.keys(e)[0];switch(o){case g:t.isNew?m((0,p.K3)(e[o])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_source:e[o]}})})));break;case b:t.isNew?m((0,p.ol)(e[o])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_medium:e[o]}})})));break;case E:t.isNew?m((0,p.P3)(e[o])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_campaign:e[o]}})})));break;case h:t.isNew?m((0,p.zH)(e[o])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_term:e[o]}})})));break;case f:t.isNew?m((0,p.mk)(e[o])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_content:e[o]}})})));break;default:return}},autoComplete:"off"},a.createElement(i.A,{message:o("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),a.createElement(l.A.Item,{label:o("utm_source"),name:g,tooltip:{title:o("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:a.createElement(n.A,null)}},a.createElement(r.A,{placeholder:o("google")})),a.createElement(l.A.Item,{label:o("utm_medium"),name:b,tooltip:{title:o("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:a.createElement(n.A,null)}},a.createElement(r.A,{placeholder:o("cpc")})),a.createElement(l.A.Item,{label:o("utm_campaign"),name:E,tooltip:{title:o("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:a.createElement(n.A,null)}},a.createElement(r.A,{placeholder:o("spring_sale")})),a.createElement(l.A.Item,{label:o("utm_term"),name:h,tooltip:{title:o("Identifies search terms. For example: utm_term=running+shoes"),icon:a.createElement(n.A,null)}},a.createElement(r.A,{placeholder:o("running+shoes")})),a.createElement(l.A.Item,{label:o("utm_content"),name:f,tooltip:{title:o("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:a.createElement(n.A,null)}},a.createElement(r.A,{placeholder:o("textlink")}))))};_.defaultProps={className:"",email:void 0};const A=_},86774:(e,t,o)=>{o.d(t,{A:()=>k});var a=o(98173),l=o(63719),i=o(37969),r=o(38927),n=o(8218),s=o(13785),m=o(2604),d=o(26298),c=o.n(d),u=o(12543),p=o(80772),g=o(8807),b=o(48956),E=o(23424),h=o(871),f=o(47014),v=o(84572),_=o(27941),A=o(32947),y=o(6969);const{Text:S}=l.A,k=({onChange:e,value:t,validateStatus:o,placeholder:l,disabled:d,name:k,elementSettings:B,imageInfo:w})=>{var x,P;const N=(0,m.d4)(f.C1),T=(0,m.d4)(f.B$),R=(0,m.d4)(v.yN),I=(0,_.rD)(),{__:C}=(0,u.s9)(),[L,F]=(0,a.useState)({width:"",height:"",size:""}),[O,M]=(0,a.useState)(!1),[D,V]=(0,a.useState)(0);let j=(0,m.wA)();const z=(0,m.d4)(p.js),W=(0,m.d4)(p.Uf),G=(0,m.d4)(p.Ac),H=(0,m.d4)(E.cL),[U]=(0,h.FQ)();let q=!T&&(null===(x=N.id)||void 0===x?void 0:x.toString())===(null===R||void 0===R||null===(P=R.members)||void 0===P?void 0:P.owner.ID)&&!0;(0,a.useEffect)((()=>{t&&U(t).then((({data:e})=>{e&&F({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,U]),(0,a.useEffect)((()=>{d||(k.startsWith("src")&&z&&((null===B||void 0===B?void 0:B.type)!==A.bV.CAROUSEL||W===k&&!H)?(e(z),j((0,p.BK)())):"backgroundImage"===k&&G&&((null===B||void 0===B?void 0:B.type)!==A.bV.CAROUSEL||W===k&&!H)&&(e(G),j((0,p.BK)())),H&&(null===B||void 0===B?void 0:B.type)===A.bV.CAROUSEL||!W||j((0,p.BK)()))}),[z,W,G,e,k,d,null===B||void 0===B?void 0:B.type,j,H]);const X=(e=null)=>{k.startsWith("src")?(j((0,p.Yw)(k)),j((0,p.tm)(t)),j((0,E.qf)(e||A.lx.UPLOAD_IMAGE_MODAL))):k.startsWith("backgroundImage")&&(j((0,p.Yw)(k)),j((0,p.e_)(t)),j((0,E.qf)(e||A.lx.UPLOAD_BACKGROUND_MODAL)))},$=[{label:C("Upload"),key:"Upload",onClick:()=>X(k.startsWith("src")?A.lx.UPLOAD_IMAGE_MODAL_UPLOAD:A.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}];I.imageCenterStockEnabled&&$.push({label:C("Stock"),key:"Stock",onClick:()=>X(k.startsWith("src")?A.lx.UPLOAD_IMAGE_MODAL_STOCK:A.lx.UPLOAD_BACKGROUND_MODAL_STOCK)}),I.imageCenterGifEnabled&&$.push({label:C("GIF"),key:"GIF",onClick:()=>X(k.startsWith("src")?A.lx.UPLOAD_IMAGE_MODAL_GIF:A.lx.UPLOAD_BACKGROUND_MODAL_GIF)}),I.elementAIimageEnabled&&$.push({label:C("AI"),key:"AI",onClick:()=>X(k.startsWith("src")?A.lx.UPLOAD_IMAGE_MODAL_AI:A.lx.UPLOAD_BACKGROUND_MODAL_AI)});return a.createElement("div",{className:c()("upload-bg-image",{"upload-bg-image_disabled":d})},!t||t&&"error"===o?a.createElement(i.Ay,{type:"default",block:!0,onClick:()=>X(k.startsWith("src")?A.lx.UPLOAD_IMAGE_MODAL_UPLOAD:A.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)},a.createElement(g.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),C("Add image")):a.createElement("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:e=>{var t,o,a,l;null!==(t=e.target)&&void 0!==t&&t.closest(".upload-bg-image__edit")||null!==(o=e.target)&&void 0!==o&&o.closest(".upload-bg-image__edit-menu")||null!==(a=e.target)&&void 0!==a&&a.closest(".upload-bg-image__menu")||null!==(l=e.target)&&void 0!==l&&l.closest(".inputGroup")||X(k.startsWith("src")?A.lx.UPLOAD_IMAGE_MODAL_UPLOAD:A.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}},a.createElement(r.A,{arrow:!0,dropdownRender:()=>I.imagePathDropdownEnabled?a.createElement("div",{className:"inputGroup"},a.createElement(n.A,{prefix:a.createElement(g.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:t,placeholder:l,name:k,disabled:d,className:"upload-bg-image__input"})):a.createElement(a.Fragment,null),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")},a.createElement("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"}},a.createElement("div",{className:"upload-bg-image__uploader"},a.createElement("div",{className:"upload-bg-image__uploader-content"},a.createElement("div",{className:"upload-bg-image__uploader-content-inner"},a.createElement("div",{className:"upload-bg-image__uploader-img-wrap"},a.createElement("img",{className:"upload-bg-image__uploader-img",src:t,alt:""})),a.createElement("div",{className:"upload-bg-image__uploader-icons-wrap"},a.createElement("div",{className:"upload-bg-image__uploader-content"}))))),L.width&&L.height?a.createElement("div",{className:"image-size"},L.width," \xd7 ",L.height,!!B&&(B.type===A.bV.IMG||B.type===A.bV.CAROUSEL)&&" \u2192 "+w.renderedWidth+" \xd7 "+w.renderedHeight,a.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),a.createElement("span",null,L.size," ",C("kB")),L.format&&a.createElement(a.Fragment,null,a.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),a.createElement("span",{className:"image-size-format"},L.format))):a.createElement(S,{type:"secondary",className:"image-empty-text"},l))),a.createElement("div",{style:{flexGrow:1}}),"gif"!==L.format&&I.imageCenterEditorEnabled&&a.createElement(s.A,{title:C("Edit")},a.createElement(S,{type:"link",className:"upload-bg-image__edit"},a.createElement(y.A,{style:{fontSize:16},onClick:e=>{q?(M(!0),V(5)):(X(),j((0,E.Wz)(A.lx.IMAGE_EDITOR_MODAL)))}}))),a.createElement(r.A,{key:"Actions",arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:$},overlayClassName:"upload-bg-image__menu"},a.createElement(S,{type:"link",className:"upload-bg-image__edit-menu image-change"},!t||t&&"error"===o?C("Upload"):a.createElement(g.A,{style:{fontSize:20},icon:"Reload",onClick:()=>X(k.startsWith("src")?A.lx.UPLOAD_IMAGE_MODAL_UPLOAD:A.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)})))),a.createElement(b.A,{open:O,onCancel:()=>{M(!1)},initialSlide:D}))}},33932:(e,t,o)=>{o.d(t,{EQ:()=>s,YG:()=>d,Zs:()=>n,gb:()=>m});var a=o(14721),l=o(39539),i=o(58521);const r="Ai",n=(0,a.xP)({reducerPath:"AiApi",tagTypes:[r],baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({sendMessage:e.mutation({queryFn:({body:e},t)=>(0,i.KU)(t).saveFile.ai_create(e,{type:l.cM.FormData})}),getDialog:e.query({queryFn:({entity_id:e,connection:t="chat"},o)=>(0,i.KU)(o).saveFile.ai_status_list({connection:t,entity_id:e}),providesTags:e=>null!==e&&void 0!==e&&e.documents?[...e.documents.map((({id:e})=>({type:r,id:e}))),{type:r,id:"LIST"}]:[{type:r,id:"LIST"}]})})}),{useSendMessageMutation:s,useGetDialogQuery:m,useLazyGetDialogQuery:d}=n},70875:(e,t,o)=>{o.d(t,{Ll:()=>g,MN:()=>E,Uu:()=>c,y4:()=>b});var a=o(14721),l=o(58521),i=o(32947),r=o(97404),n=o(79596),s=o(18987),m=o(12352),d=o(3792);const c=(0,a.xP)({reducerPath:"AiApiGenerator",baseQuery:r.i,endpoints:e=>({generateIdForTask:e.mutation({queryFn:(e,t)=>(0,l.u$)(t).tasks.tasksControllerCreateTask(e).then((e=>e))}),clearAiChat:e.query({queryFn:(e,t)=>(0,l.KU)(t).aiGenerator.clear_history_list(e).then((e=>e))}),getGeneratedContent:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({id:e,setError:t},o){const{updateCachedData:a,cacheEntryRemoved:r}=o;let c=(0,l.KU)(o).baseUrl.indexOf("emailmaker")>=0?i.e3.maker:i.e3.blocks;const u=i.EW.isPlugin?await d.di.getInstance(o,m.Y):s.A.get(i.A9.em_token),p=u?{Authorization:`Bearer ${u}`}:{},g=new n.EventSourcePolyfill(`${c}/tasks/${e}`,{headers:p});g.onmessage=e=>{const t=JSON.parse(e.data);a((e=>{e.push(t)}))},g.onerror=e=>{t("Error connecting to EventSource"),g.close()},await r,g.close()}}),getAiGenerateStatus:e.mutation({query:e=>({url:"/constructor/v1/ai-save-task",method:"POST",body:e})})})}),{useGenerateIdForTaskMutation:u,useGetGeneratedContentQuery:p,useLazyClearAiChatQuery:g,useLazyGetGeneratedContentQuery:b,useGetAiGenerateStatusMutation:E}=c},19992:(e,t,o)=>{o.d(t,{B:()=>r,N:()=>n});var a=o(14721),l=o(39539),i=o(58521);const r=(0,a.xP)({reducerPath:"addUserToProjectApi",baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/user_to_project/v1/add_user"}),endpoints:e=>({addUserToProject:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).userToProject.add_user_create(e,{type:l.cM.FormData})})})}),{useAddUserToProjectMutation:n}=r},13216:(e,t,o)=>{o.d(t,{Q2:()=>d,b9:()=>b,Lj:()=>v,CR:()=>p,W5:()=>h,i2:()=>f,on:()=>g,hZ:()=>E});var a=o(14721),l=o(39539),i=o(93778),r=o(31926);function n({title:e,acf:{limits:t,price:o},...a}){return{...a,title:(0,r.vf)(e)||"",limits:t,price:o}}function s({acf:{autosaves:e,hide_mergetags:t,theme:o,newsletter_consent:a,code_editor:l,counters:i,subscription:n,subscription_end:s,recurring_payments:m,subscription_id:d,promocode:c,subscription_amount:u,enterprise_users_limit:p,enterprise_price:g,enterprise_12_price:b,privacy_policy_agreement:E,last_used_project:h,email_confirmation:f,email_builder_config:v},id:_,...A}){return{...A,id:(0,r.WY)(_),autosaves:e,hide_mergetags:t,theme:o,newsletter_consent:a,code_editor:l?{...l,font_size:Number(l.font_size)}:void 0,counters:Object.keys(i).reduce(((e,t)=>(e[t]=Number(i[t]),e)),{}),subscription:n,subscription_end:s,recurring_payments:m,subscription_id:d,promocode:c,subscription_amount:u,enterprise_users_limit:p,enterprise_price:g,enterprise_12_price:b,privacy_policy_agreement:E,last_used_project:h,email_confirmation:f,email_builder_config:v}}var m=o(58521);const d=(0,a.xP)({reducerPath:"authorizationApi",baseQuery:(0,m.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({userRegistration:e.mutation({queryFn:(e,t)=>(0,m.KU)(t).wp.users_register_create({body:e,type:l.cM.Json})}),emailUserRegistration:e.mutation({query:e=>({url:`${"https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,"")}/wp-json/auth/v1/users/register`,method:"POST",body:e})}),getMailConfirmation:e.query({queryFn:(e,t)=>(0,m.KU)(t).wp.confirmation_list({...e})}),getSchema:e.query({queryFn:(e,t)=>(0,m.KU)(t).wp.users_me_list(void 0,{method:"OPTIONS",extraQuery:{_fields:"schema"}})}),verifyPassword:e.mutation({queryFn:(e,t)=>(0,m.KU)(t).auth.check_password_create({body:e,type:l.cM.Json})}),getMe:e.query({queryFn:(e,t)=>(0,m.KU)(t).wp.users_me_list(null).then((0,i.SC)((e=>e instanceof Array?e[0]:e))).then((0,i.SC)(s))}),getUser:e.query({queryFn:(e,t)=>(0,m.KU)(t).wp.users_detail({id:e}).then((0,i.SC)(s))}),editMe:e.mutation({queryFn(e,t){const o=(0,m.KU)(t),a=(0,r.TB)(function({autosaves:e,theme:t,newsletter_consent:o,code_editor:a,counters:l,subscription:i,subscription_end:n,recurring_payments:s,subscription_id:m,promocode:d,subscription_amount:c,enterprise_users_limit:u,enterprise_price:p,enterprise_12_price:g,privacy_policy_agreement:b,locale:E,last_used_project:h,email_confirmation:f,email_builder_config:v,id:_,...A}){return{...A,id:(0,r.mQ)(_),locale:E,acf:{autosaves:e,theme:t,newsletter_consent:o,code_editor:a?{...a,font_size:String(a.font_size)}:void 0,counters:l,subscription:i,subscription_end:n,recurring_payments:s,subscription_id:m,promocode:d,subscription_amount:c,enterprise_users_limit:u,enterprise_price:p,enterprise_12_price:g,privacy_policy_agreement:b,last_used_project:h,email_confirmation:f,email_builder_config:v}}}(e),!0);return o.wp.users_me_create(a,{type:l.cM.Json}).then((0,i.SC)(s))}}),getSubscriptions:e.query({queryFn:(e,t)=>(0,m.KU)(t).wp.subscription_list(void 0).then((0,i.Ih)(n))})})}),{useUserRegistrationMutation:c,useVerifyPasswordMutation:u,useGetMeQuery:p,useLazyGetMeQuery:g,useEditMeMutation:b,useLazyGetSchemaQuery:E,useGetSubscriptionsQuery:h,useLazyGetMailConfirmationQuery:f,useEmailUserRegistrationMutation:v}=d},5618:(e,t,o)=>{o.d(t,{VM:()=>g,pP:()=>y,Gr:()=>k,yW:()=>B,OZ:()=>S,J4:()=>f,bg:()=>E,SB:()=>b,h1:()=>_,OD:()=>A,kz:()=>w,lx:()=>v,R2:()=>h});var a=o(14721),l=o(39539),i=o(93778),r=o(31926),n=o(39218);function s({id:e,type:t,title:o,excerpt:a,author:l,acf:{subject:i,description:s,html:m,project:d,related_email:c,tags:u,type:p,is_template:g,lock:b},...E}){return{...E,id:String(e),author:String(l),renderGuid:(0,n.l)(),description:s,html:m,excerpt:(0,r.vf)(o),project:(0,r.pT)(d)?d.ID:d,project_author:(0,r.pT)(d)?d.post_author:void 0,project_title:(0,r.pT)(d)?d.post_title:void 0,tags:u,is_template:g,type:p,related_email:(0,r.WY)((0,r.pT)(c)?c.ID:c),title:(0,r.vf)(o)||"",lock:b}}function m({title:e,subject:t,description:o,renderGuid:a,html:l,project:i,tags:n,type:s,related_email:m,is_template:d,lock:c,author:u,...p}){return{...p,author:(0,r.mQ)(u),title:e,acf:{description:o,related_email:(0,r.mQ)(m),html:l,project:i,tags:n,type:s,is_template:d,lock:c}}}function d({id:e,title:t,acf:{html:o},excerpt:a,parent:l,author:i,...n}){return{...n,id:(0,r.WY)(e),author:(0,r.WY)(i),parent:(0,r.WY)(l),title:(0,r.vf)(t)||"",html:o,excerpt:(0,r.pT)(a)?a.rendered:a}}var c=o(58521),u=o(50861),p=o(32947);const g=(0,a.xP)({reducerPath:"blocksApi",tagTypes:["Blocks","TemplatesBlocks","ParentsBlocks","Block"],baseQuery:(0,c.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getBlocks:e.query({queryFn(e,t){var o,a;const l=(0,c.KU)(t),r={order:"desc",orderby:"modified"},n={};if(e.notEmbed||(n._embed=""),e.projectId&&(n._embed="author",n._fields="id,title,blocktags,blockfolder,group,modified,date,type,acf.lock,acf.project.ID,acf.type,author,acf.is_template,acf.html",r["filter[meta_key]"]="project",r["filter[meta_value]"]=e.projectId),e.fields&&(n._fields=e.fields),e.page&&(r.page=e.page),e.order&&(r.order=e.order),e.orderby&&(r.orderby=e.orderby),e.folderTag&&e.folderTag!==p.y2?(r["filter[tax_query][relation]"]="AND",r["filter[tax_query][0][taxonomy]"]="blockfolder",r["filter[tax_query][0][field]"]="id",r["filter[tax_query][0][terms]"]=e.folderTag):!e.hasOwnProperty("folderTag")||e.folderTag===p.y2&&("object"!==typeof e.folderTag||null!==e.folderTag)||null!==(o=e.tags)&&void 0!==o&&o.length||"trash"===e.status||(r["filter[tax_query][0][taxonomy]"]="blockfolder",r["filter[tax_query][0][operator]"]="NOT EXISTS"),(null===(a=e.tags)||void 0===a?void 0:a.length)>0&&"trash"!==e.status){r["filter[tax_query][relation]"]="AND";for(let t=0,o=e.tags.length;t<o;t++){const o=e.tags[t];r[`filter[tax_query][${t+1}][taxonomy]`]="blocktags",r[`filter[tax_query][${t+1}][field]`]="id",r[`filter[tax_query][${t+1}][terms]`]=o}}return e.type&&(r["filter[meta_query][2][key]"]="type",r["filter[meta_query][2][value]"]=e.type),e.name&&(r.search=e.name),e.pageSize&&(r.per_page=e.pageSize),"trash"===e.status&&(n.status="trash"),l.wp.eblock_list(r,{extraQuery:n}).then((0,i.Ih)(s))},providesTags:(e,t,o,a)=>{var l,i;const r=null===a||void 0===a?void 0:a.response,n=(null===r||void 0===r?void 0:r.headers.get("X-WP-Total"))||0;return e?[...e.map((({id:e})=>{var t;return{type:"Blocks",id:`${o.folderTag||(null===(t=o.tags)||void 0===t?void 0:t[0])||o.projectId}_${o.page}_${o.status}_${n}`}})),{type:"Blocks",id:`${o.folderTag||(null===(l=o.tags)||void 0===l?void 0:l[0])||o.projectId}_${o.page}_${o.status}_${n}`}]:[{type:"Blocks",id:`${o.folderTag||(null===(i=o.tags)||void 0===i?void 0:i[0])||o.projectId}_${o.page}_${o.status}_${n}`}]},keepUnusedDataFor:0}),getBlocksSchema:e.query({queryFn:(e,t)=>(0,c.KU)(t).wp.eblock_list(void 0,{method:"OPTIONS",extraQuery:{_fields:"schema.properties.acf"}})}),getParentEmailBlocks:e.query({queryFn(e,t){var o;const a=(0,c.KU)(t),l={"filter[meta_query][0][compare]":"LIKE"},r={};if(e.notEmbed||(r._embed=""),e.emailId&&(l["filter[meta_query][0][key]"]="related_email",l["filter[meta_query][0][value]"]=e.emailId),e.fields&&(r._fields=e.fields),e.page&&(l.page=e.page),(null===(o=e.tags)||void 0===o?void 0:o.length)>0){l["filter[tax_query][relation]"]="AND";for(let t=0,o=e.tags.length;t<o;t++){const o=e.tags[t];l[`filter[tax_query][${t}][taxonomy]`]="blocktags",l[`filter[tax_query][${t}][field]`]="id",l[`filter[tax_query][${t}][terms]`]=o}}return e.type&&(l["filter[meta_query][2][key]"]="type",l["filter[meta_query][2][value]"]=e.type),e.name&&(l.search=e.name),e.pageSize&&(l.per_page=e.pageSize),a.wp.eblock_list(l,{extraQuery:r}).then((0,i.Ih)(s))},providesTags:e=>e?[...e.map((({id:e})=>({type:"ParentsBlocks",id:e}))),{type:"ParentsBlocks",id:"LIST"}]:[{type:"ParentsBlocks",id:"LIST"}],keepUnusedDataFor:0}),getTemplateBlocks:e.query({queryFn:(e,t)=>{var o;const a=(0,c.KU)(t),l={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1",orderby:"modified",order:"desc"},r={};if(e.notEmbed||(r._embed=""),e.fields&&(r._fields=e.fields),e.page&&(l.page=e.page),(null===(o=e.tags)||void 0===o?void 0:o.length)>0){l["filter[tax_query][relation]"]="AND";for(let t=0,o=e.tags.length;t<o;t++){const o=e.tags[t];l[`filter[tax_query][${t}][taxonomy]`]="blocktags",l[`filter[tax_query][${t}][field]`]="id",l[`filter[tax_query][${t}][terms]`]=o}}return e.type&&(l["filter[meta_query][2][key]"]="type",l["filter[meta_query][2][value]"]=e.type),e.name&&(l.search=e.name),e.pageSize&&(l.per_page=e.pageSize),a.wp.eblock_list(l,{extraQuery:r}).then((0,i.Ih)(s))},providesTags:e=>e?[...e.map((({id:e})=>({type:"TemplatesBlocks",id:e}))),{type:"TemplatesBlocks",id:"LIST"}]:[{type:"TemplatesBlocks",id:"LIST"}],keepUnusedDataFor:0}),getBlock:e.query({queryFn:(e,t)=>(0,c.KU)(t).wp.eblock_detail({id:(0,r.mQ)(e)},{extraQuery:{_embed:""}}).then((0,i.SC)(s)),providesTags:(e,t,o)=>[{type:"Block",id:o}],keepUnusedDataFor:0}),getBlockHistory:e.query({queryFn:({blockId:e,page:t=1},o)=>(0,c.KU)(o).wp.eblock_revisions_detail({parent:e,per_page:20,page:t},{extraQuery:{_fields:"author,slug,date,modified,title,acf.html,acf.common_styles,id"}}).then((o=>(0,i.SA)(o,((o,a)=>({data:o.filter((e=>e.acf.html)).map((e=>({...e,acf:{...e.acf,html:e.acf.html}}))).map(d),totalPages:+a.response.headers.get("X-WP-TotalPages"),args:{blockId:e,page:t}}))))),keepUnusedDataFor:0}),addBlock:e.mutation({queryFn:(e,t)=>(0,c.KU)(t).wp.eblock_create({...m(e),status:"publish"},{type:l.cM.Json}).then((0,i.SC)(s)),invalidatesTags:[{type:"Blocks",id:"LIST"}]}),editBlock:e.mutation({queryFn:(0,u.p)((e=>({blockId:t,source:o,...a},n)=>{const d=(0,c.KU)(e),u=(0,r.TB)(m(a));return d.wp.eblock_partial_update(t,u,{type:l.cM.Json,extraQuery:{_embed:"wp:term"}}).then((0,i.SC)(s))}))}),deleteBlock:e.mutation({queryFn(e,t){const o=(0,c.KU)(t);let a,l;return"object"===typeof e?(a=e.id,l=e.force):(a=e,l=!1),o.wp.eblock_delete(a,{force:l}).then((0,i.PI)(s))},invalidatesTags:(e,t,o)=>[{type:"Blocks",id:o}]}),addTag:e.mutation({queryFn:(e,t)=>(0,c.KU)(t).wp.blocktags_create({...e},{type:l.cM.Json})}),getDeletableTag:e.query({queryFn:([e,t],o)=>(0,c.KU)(o).wp.eblock_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":e,blocktags:[t]},{extraQuery:{"_fields[]":"blocktags"}}).then((0,i.Ih)(s))}),autoSaveBlock:e.mutation({queryFn({blockId:e,body:t},o){const a=(0,c.KU)(o),n=function({parent:e,title:t,html:o,project:a,author:l,...i}){return{...i,author:(0,r.mQ)(l),parent:(0,r.mQ)(e),title:(0,r.vf)(t),"acf[html]":o,"acf[project]":a}}(t);return a.wp.eblock_autosaves_create(e,n,{type:l.cM.Json}).then((0,i.SC)(d))}})})}),{useGetBlocksQuery:b,useGetBlockQuery:E,useLazyGetBlockQuery:h,useGetBlockHistoryQuery:f,useLazyGetBlockHistoryQuery:v,useGetBlocksSchemaQuery:_,useGetParentEmailBlocksQuery:A,useAddBlockMutation:y,useEditBlockMutation:S,useAddTagMutation:k,useAutoSaveBlockMutation:B,useGetTemplateBlocksQuery:w}=g},8111:(e,t,o)=>{o.d(t,{Jg:()=>d,z2:()=>u,HI:()=>p,vn:()=>b,kk:()=>g,Cf:()=>c});var a=o(14721),l=o(39539),i=o(93778),r=o(31926);function n({id:e,post:t,parent:o,author:a,content:l,acf:{status:i,target_id:n},...s}){return{...s,id:(0,r.WY)(e),post:(0,r.WY)(t),parent:(0,r.WY)(o),author:(0,r.WY)(a),content:(0,r.vf)(l),target_id:n,comment_status:i}}var s=o(58521);const m="Comments",d=(0,a.xP)({reducerPath:"commentsApi",tagTypes:[m],baseQuery:(0,s.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getComments:e.query({queryFn:function(e,t){return(0,s.KU)(t).wp.comments_list({post:[(0,r.mQ)(e)],per_page:50,order:"asc"}).then((0,i.Ih)(n))},providesTags:e=>e?[...e.map((({id:e})=>({type:m,id:e}))),{type:m,id:"LIST"}]:[{type:m,id:"LIST"}]}),addComment:e.mutation({queryFn({subjectId:e,author:t,parent:o,content:a,author_name:m,author_email:d,targetId:c},u){const p=(0,s.KU)(u),g={post:(0,r.mQ)(e),author:(0,r.mQ)(t),author_name:m,author_email:d},b={};return a&&(g.content=a),o&&(g.parent=(0,r.mQ)(o)),c&&(b["acf[target_id]"]=c),p.wp.comments_create(g,{type:l.cM.UrlEncoded,extraQuery:b}).then((0,i.SC)(n))},invalidatesTags:[{type:m,id:"LIST"}]}),deleteComment:e.mutation({queryFn:(e,t)=>(0,s.KU)(t).wp.comments_delete(e,{}).then((0,i.PI)(n)),invalidatesTags:[{type:m,id:"LIST"}]}),editComment:e.mutation({queryFn({commentId:e,content:t,status:o,targetId:a},r){const m=(0,s.KU)(r),d={},c={};return t&&(d.content=t),o&&(c["acf[status]"]=o),a&&(c["acf[targetId]"]=a),m.wp.comments_update(e,d,{type:l.cM.UrlEncoded,extraQuery:c}).then((0,i.SC)(n))},invalidatesTags:[{type:m,id:"LIST"}]}),deleteTarget:e.mutation({queryFn:(e,t)=>(0,s.KU)(t).wp.comments_delete(e,{},{extraQuery:{"acf[target_id]":""}}).then((0,i.PI)(n)),invalidatesTags:[{type:m,id:"LIST"}]})})}),{useGetCommentsQuery:c,useAddCommentMutation:u,useDeleteCommentMutation:p,useEditCommentMutation:g,useDeleteTargetMutation:b}=d},94160:(e,t,o)=>{o.d(t,{C:()=>r,F:()=>i});var a=o(14721),l=o(27943);const i=(0,a.xP)({reducerPath:"confirmationMailApi",baseQuery:(0,l.cw)({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:e,email:t})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${e}&user_email=${t}`)}`})})})}),{useLazyGetConfirmationMailQuery:r}=i},73668:(e,t,o)=>{o.d(t,{c:()=>d,f:()=>m});var a=o(14721),l=o(27943),i=o(93778),r=o(93207),n=o(76233);const s="EmailRaw",m=(0,a.xP)({reducerPath:"emailRawApi",tagTypes:[s],baseQuery:(0,l.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmailRaw:e.query({queryFn:function({emailId:e,secret_hash:t},o){return(0,n.mg)(o).wp.email_detail({id:e},{extraQuery:{secret_hash:t}}).then((0,i.SC)(r.V))},providesTags:(e,t,o)=>[{type:s,id:o}]})})}),{useGetEmailRawQuery:d}=m},98845:(e,t,o)=>{o.d(t,{GY:()=>u,Kh:()=>v,Gr:()=>S,LX:()=>k,dN:()=>_,YV:()=>h,sl:()=>b,Xw:()=>p,PX:()=>g,YE:()=>f,_3:()=>E});var a=o(14721),l=o(39539),i=o(93207),r=o(31926);function n({id:e,title:t,acf:{html:o,common_styles:a},parent:l,excerpt:i,author:n,...s}){return{...s,author:(0,r.WY)(n),id:(0,r.WY)(e),parent:(0,r.WY)(l),title:(0,r.vf)(t)||"",html:o,common_styles:a,excerpt:(0,r.pT)(i)?i.rendered:i}}var s=o(58521),m=o(93778),d=o(50861),c=o(32947);const u=(0,a.xP)({reducerPath:"emailsApi",tagTypes:["Emails","Email","EmailAutosaves","TemplateEmail"],baseQuery:(0,s.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmails:e.query({queryFn(e,t){var o,a;const l=(0,s.KU)(t),r={order:"desc",orderby:"modified"},n={};if(e.notEmbed||(n._embed=""),e.projectId&&(n._embed="author",n._fields="id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template",r["filter[meta_key]"]="project",r["filter[meta_value]"]=e.projectId),e.fields&&(n._fields=e.fields),e.page&&(r.page=e.page),e.order&&(r.order=e.order),e.orderby&&(r.orderby=e.orderby),e.folderTag&&e.folderTag!==c.y2?(r["filter[tax_query][relation]"]="AND",r["filter[tax_query][0][taxonomy]"]="folder",r["filter[tax_query][0][field]"]="id",r["filter[tax_query][0][terms]"]=e.folderTag):e.folderTag===c.y2&&("object"!==typeof e.folderTag||null!==e.folderTag)||null!==(o=e.tags)&&void 0!==o&&o.length||!e.status||"trash"===e.status||(r["filter[tax_query][0][taxonomy]"]="folder",r["filter[tax_query][0][operator]"]="NOT EXISTS"),(null===(a=e.tags)||void 0===a?void 0:a.length)>0&&"trash"!==e.status){r["filter[tax_query][relation]"]="AND";for(let t=0,o=e.tags.length;t<o;t++){const o=e.tags[t];r[`filter[tax_query][${t+1}][taxonomy]`]="emailtags",r[`filter[tax_query][${t+1}][field]`]="id",r[`filter[tax_query][${t+1}][terms]`]=o}}return e.name&&(r.search=e.name),e.pageSize&&(r.per_page=e.pageSize),"trash"===e.status&&(n.status="trash"),l.wp.email_list(r,{extraQuery:n}).then((0,m.Ih)(i.V))},providesTags:(e,t,o,{response:a})=>{var l,i;const r=(null===a||void 0===a?void 0:a.headers.get("X-WP-Total"))||0;return e?[...e.map((({id:e})=>{var t;return{type:"Emails",id:`${o.folderTag||(null===(t=o.tags)||void 0===t?void 0:t[0])||o.projectId}_${o.page}_${o.status}_${r}`}})),{type:"Emails",id:`${o.folderTag||(null===(l=o.tags)||void 0===l?void 0:l[0])||o.projectId}_${o.page}_${o.status}_${r}`}]:[{type:"Emails",id:`${o.folderTag||(null===(i=o.tags)||void 0===i?void 0:i[0])||o.projectId}_${o.page}_${o.status}_${r}`}]},keepUnusedDataFor:0}),getTemplateEmails:e.query({queryFn(e,t){var o,a,l;const r=(0,s.KU)(t);let n={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1","filter[meta_query][0][compare]":"LIKE",orderby:"modified",order:"desc"};const d={_embed:"wp:term",_fields:"_embedded,id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,acf.is_template"};if(e.emailId&&(n["filter[meta_query][0][key]"]="parent_email",n["filter[meta_query][0][value]"]=e.emailId),e.fields&&(d._fields=e.fields),(null===(o=e.group)||void 0===o?void 0:o.length)>0||(null===(a=e.projectGroup)||void 0===a?void 0:a.length)>0){const t=[...e.group||[],...e.projectGroup||[]].reduce(((e,{key:t,parentId:o})=>(e[o]||(e[o]=[]),e[o].push(String(t)),e)),{}),o=Object.values(t).map((e=>e.sort()));n["filter[tax_query][relation]"]="AND",o.forEach(((e,t)=>{n[`filter[tax_query][${t}][relation]`]="OR",e.forEach(((e,o)=>{n[`filter[tax_query][${t}][${o}][taxonomy]`]="group",n[`filter[tax_query][${t}][${o}][field]`]="id",n[`filter[tax_query][${t}][${o}][terms]`]=e}))}))}if((null===(l=e.tags)||void 0===l?void 0:l.length)>0){n["filter[tax_query][relation]"]="AND";for(let t=0,o=e.tags.length;t<o;t++){const o=e.tags[t];n[`filter[tax_query][${t}][taxonomy]`]="emailtags",n[`filter[tax_query][${t}][field]`]="id",n[`filter[tax_query][${t}][terms]`]=o}}if(e.type&&(n["filter[meta_query][2][key]"]="type",n["filter[meta_query][2][value]"]=e.type),e.name&&(n.search=e.name),e.pageSize&&(n.per_page=e.pageSize),e.page){var u,p;n.page=e.page;const o=t.getState(),{groupsTemplateProjectTotal:a,groupsTemplateProjectTotalPages:l}=null===o||void 0===o?void 0:o.projectSlice;if((null===(u=e.projectGroup)||void 0===u||!u.length)&&(null===(p=e.group)||void 0===p||!p.length)&&l<e.page&&e.groupType===c.ti.ALL&&a&&l&&!e.projectId){const t=c.mU-a%c.mU+(e.page-(l+1))*c.mU;t&&(n.page=1,n.offset=t)}}return e.projectId&&(n["filter[meta_key]"]="project",n["filter[meta_value]"]=e.projectId),r.wp.email_list(n,{extraQuery:d}).then((0,m.Ih)(i.V))},keepUnusedDataFor:0}),getEmail:e.query({queryFn:(e,t)=>(0,s.KU)(t).wp.email_detail({id:(0,r.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,parent,date_gmt\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,m.SC)(i.V)),providesTags:(e,t,o)=>[{type:"Email",id:o}],keepUnusedDataFor:0}),getTemplateEmail:e.query({queryFn:(e,t)=>(0,s.KU)(t).wp.email_detail({id:(0,r.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,parent,date_gmt\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,m.SC)(i.V)),providesTags:(e,t,o)=>[{type:"TemplateEmail",id:o}],keepUnusedDataFor:0}),getEmailHistory:e.query({queryFn:({emailId:e,page:t=1},o)=>(0,s.KU)(o).wp.email_revisions_detail({parent:e,per_page:20,page:t},{extraQuery:{_fields:"author,slug,date,modified,title,acf.html,acf.common_styles,id,parent,date_gmt"}}).then((o=>(0,m.SA)(o,((o,a)=>({data:o.filter((e=>e.acf.html)).map((e=>({...e,acf:{...e.acf,html:e.acf.html}}))).map(n),totalPages:+a.response.headers.get("X-WP-TotalPages"),args:{emailId:e,page:t}}))))),providesTags:e=>e?[...e.data.map((({id:e})=>({type:"EmailAutosaves",id:e}))),{type:"EmailAutosaves",id:"LIST"}]:[{type:"EmailAutosaves",id:"LIST"}],keepUnusedDataFor:0}),addEmail:e.mutation({queryFn:(0,d.p)((e=>({source:t,...o})=>(0,s.KU)(e).wp.email_create({status:"publish",...(0,i.v)(o)},{type:l.cM.Json}).then((0,m.SC)(i.V)))),invalidatesTags:[{type:"Emails",id:"LIST"}]}),editEmail:e.mutation({queryFn:(0,d.p)((e=>({emailId:t,source:o,...a})=>{const n=(0,s.KU)(e),d=(0,r.TB)((0,i.v)(a));return n.wp.email_partial_update(t,d,{type:l.cM.Json,extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,acf.description,acf.html,acf.common_styles,acf.is_template,acf.lock,acf.parent_email,acf.project,acf.secret_hash,acf.subject,acf.utm_parameters"}}).then((0,m.SC)(i.V))}))}),deleteEmail:e.mutation({queryFn(e,t){const o=(0,s.KU)(t);let a,l;return"object"===typeof e?(a=e.id,l=e.force):(a=e,l=!1),o.wp.email_delete(a,{force:l}).then((0,m.PI)(i.V))},invalidatesTags:(e,t,o)=>[{type:"Emails",id:o}]}),addTag:e.mutation({queryFn:(e,t)=>(0,s.KU)(t).wp.emailtags_create({...e},{type:l.cM.Json})}),getDeletableTag:e.query({queryFn:([e,t],o)=>(0,s.KU)(o).wp.email_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":e,emailtags:[t]},{extraQuery:{"_fields[]":"emailtags"}}).then((0,m.Ih)(i.V))}),autoSaveEmail:e.mutation({queryFn({emailId:e,body:t},o){const a=(0,s.KU)(o),i=function({parent:e,title:t,html:o,project:a,subject:l,preheader:i,common_styles:n,author:s,parent_email:m,...d}){return{...d,author:(0,r.mQ)(s),title:t,parent:(0,r.mQ)(e),"acf[html]":o,"acf[project]":a,"acf[parent_email]":m,"acf[common_styles]":n}}(t);return a.wp.email_autosaves_create(e,i,{type:l.cM.FormData}).then((0,m.SC)(n))}})})}),{useGetEmailsQuery:p,useGetTemplateEmailsQuery:g,useGetEmailQuery:b,useLazyGetEmailQuery:E,useGetEmailHistoryQuery:h,useLazyGetEmailHistoryQuery:f,useAddEmailMutation:v,useEditEmailMutation:_,useDeleteEmailMutation:A,useGetDeletableTagQuery:y,useAddTagMutation:S,useAutoSaveEmailMutation:k}=u},38251:(e,t,o)=>{o.d(t,{U8:()=>r,cA:()=>s,ri:()=>n});var a=o(27943),l=o(14721),i=o(40277);const r=(0,l.xP)({reducerPath:"exportPngApi",baseQuery:async(e,t,o)=>{try{const{notification:l,...i}=e,r=await(0,a.cw)({baseUrl:"https://racs.rest/v3"})(i,t,o);if(r.error)throw new Error;return r}catch(l){const t=null===e||void 0===e?void 0:e.notification;return(0,i.p6)(l,t),{error:l}}},endpoints:e=>({makeTemporaryMailForPng:e.mutation({query:({file:e,title:t,notification:o})=>{const a=new Blob([e],{type:"text/html"}),l=new FormData;return l.append("file",a,"base.html"),l.append("contentType","text/html"),{url:"?resource=exportPngApi",method:"POST",body:l,notification:o}}}),deleteTemporaryMail:e.mutation({query:({id:e,notification:t})=>({url:`/${e}?resource=exportPngApi`,method:"DELETE",notification:t})})})}),{useMakeTemporaryMailForPngMutation:n,useDeleteTemporaryMailMutation:s}=r},30397:(e,t,o)=>{o.d(t,{C:()=>i,N:()=>r});var a=o(14721),l=o(27943);const i=(0,a.xP)({reducerPath:"webHookApi",baseQuery:(0,l.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({postDataByWebHook:e.mutation({query:({url:e,body:t})=>({url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t})})})}),{usePostDataByWebHookMutation:r}=i},90925:(e,t,o)=>{o.d(t,{O:()=>r,y:()=>i});var a=o(14721),l=o(27943);const i=(0,a.xP)({reducerPath:"getCheckoutUrlApi",baseQuery:(0,l.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({GetCheckoutUrl:e.mutation({query:e=>({url:`?proxy_url=${encodeURIComponent({}.REACT_APP_PIPEDREAM_GET_CHECKOUT_URL)}`,method:"POST",body:e})})})}),{useGetCheckoutUrlMutation:r}=i},92485:(e,t,o)=>{o.d(t,{k:()=>i,x:()=>r});var a=o(14721),l=o(58521);const i=(0,a.xP)({reducerPath:"googleAuthApi",baseQuery:(0,l.hI)({baseUrl:"https://app.emailmaker.ru/api//wp-json/auth/v1/google/callback"}),endpoints:e=>({validateGoogleToken:e.mutation({query:e=>({url:"",method:"POST",body:e})})})}),{useValidateGoogleTokenMutation:r}=i},64706:(e,t,o)=>{o.d(t,{N:()=>r,m:()=>n});var a=o(27943),l=o(14721),i=o(40277);const r=(0,l.xP)({reducerPath:"htmlToPdfPlusApi",baseQuery:async(e,t,o)=>{try{const{notification:l,...i}=e,r=await(0,a.cw)({baseUrl:"https://html2pdf.emcdn.ru/convert/html-to-pdf"})(i,t,o);if(r.error)throw new Error;return r}catch(l){const t=null===e||void 0===e?void 0:e.notification;return(0,i.p6)(l,t),{error:l}}},endpoints:e=>({generateHtmlToPdf:e.mutation({query:({htmlContent:e,notification:t})=>({url:"",method:"POST",body:e,notification:t,responseHandler:e=>e.blob()})})})}),{useGenerateHtmlToPdfMutation:n}=r},871:(e,t,o)=>{o.d(t,{CL:()=>c,FQ:()=>u,Jg:()=>A,Mv:()=>h,eo:()=>S,gg:()=>B,h4:()=>b});var a=o(14721),l=o(79596),i=o(39539),r=o(58521),n=o(18987),s=o(32947),m=o(12352),d=o(3792);const c=(0,a.xP)({reducerPath:"imageApi",baseQuery:void 0,endpoints:e=>({getImageInfo:e.query({queryFn:async function(e,t){try{var o,a;const l=(null===(o=t.getState().configSlice)||void 0===o||null===(a=o.config)||void 0===a?void 0:a.imageInfoToolUrl)||"https://scr.emcdn.ru/imageinfo",i=await fetch(`${l}?url=${encodeURIComponent(e)}`);return{data:await i.json()}}catch(l){}}}),getSearchImage:e.query({queryFn:async function({query:e,page:t}){const o=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let a=`https://api.unsplash.com/search/photos?client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o&lang=ru&per_page=18&query=${o}&page=${t}`;""!==e.color&&(a+=`&color=${e.color}`),""!==e.orientation&&(a+=`&orientation=${e.orientation}`);const l=await fetch(a);return{data:await l.json()}}catch(a){}}}),getUnsplashImage:e.query({queryFn:async function(e){try{const t=await fetch(`${e}&client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o`);return{data:await t.json()}}catch(t){}}}),sendAiImageRequest:e.query({queryFn:async function({body:e},t){try{const o=(0,r.KU)(t);return await o.saveFile.ai_create(e,{type:i.cM.FormData})}catch(o){throw new Error(o)}}}),getAiImage:e.query({queryFn:async function(e,t){try{const o=(0,r.KU)(t);return await o.saveFile.ai_status_list(e)}catch(o){}}}),getAiImageSSE:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({task_id:e,entity_id:t,setError:o},a){const{updateCachedData:i,cacheEntryRemoved:c}=a;let u=(0,r.KU)(a).baseUrl.indexOf("emailmaker")>=0?s.Rn.maker:s.Rn.blocks;const p=s.EW.isPlugin?await d.di.getInstance(a,m.Y):n.A.get(s.A9.em_token),g=p?{Authorization:`Bearer ${p}`}:{},b=new l.EventSourcePolyfill(` ${u}/wp-json/ai-generator/v1/ai-status?entity_id=${t}&stream=1&task_id=${e}`,{headers:g});b.onmessage=e=>{const t=JSON.parse(e.data);i((e=>{e.push(t)})),100===t.progress&&b.close()},b.onerror=e=>{b.close()},await c,b.close()}}),getSearchGif:e.query({queryFn:async function({query:e,page:t}){const o=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let e=`https://api.giphy.com/v1/gifs/search?api_key=Nh77eBlPeMn1ed9MBAvL542NUGeNO26F&q=${o}&limit=25&offset=${t}&lang=en`;const a=await fetch(e);return{data:await a.json()}}catch(a){}}})})}),{useLazyGetImageInfoQuery:u,useGetImageInfoQuery:p,useGetSearchImageQuery:g,useLazyGetSearchImageQuery:b,useSendAiImageRequestQuery:E,useLazySendAiImageRequestQuery:h,useGetAiImageQuery:f,useLazyGetAiImageQuery:v,useGetUnsplashImageQuery:_,useLazyGetUnsplashImageQuery:A,useGetSearchGifQuery:y,useLazyGetSearchGifQuery:S,useGetAiImageSSEQuery:k,useLazyGetAiImageSSEQuery:B}=c},12005:(e,t,o)=>{o.d(t,{Ad:()=>n,HO:()=>c,Yj:()=>d});var a=o(14721),l=o(27943),i=o(58521);const r="LOCALES",n=(0,a.xP)({reducerPath:"localesApi",tagTypes:[r],baseQuery:(0,l.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/translations/v1"}),endpoints:e=>({getLocale:e.query({async queryFn({id:e},t){const o=(0,i.KU)(t);try{return await o.translations.get_translations3(e,"react_app")}catch(a){return o.translations.get_translations3("en_US","react_app")}},providesTags:(e,t,o)=>[{type:r,id:o}]}),getLocales:e.query({queryFn:function(e,t){return(0,i.KU)(t).translations.get_translations2("react_app")},providesTags:(e,t,o)=>[{type:r,id:o}]})})}),{useGetLocalesQuery:s,useGetLocaleQuery:m,useLazyGetLocaleQuery:d,useLazyGetLocalesQuery:c}=n},93207:(e,t,o)=>{o.d(t,{V:()=>i,v:()=>r});var a=o(31926),l=o(39218);function i({id:e,title:t,type:o,guid:i,acf:{lock:r,subject:n,description:s,html:m,project:d,tags:c,utm_parameters:u,parent_email:p,common_styles:g,is_template:b},author:E,...h}){return{...h,id:(0,a.WY)(e),author:(0,a.WY)(E),title:(0,a.vf)(t)||"",lock:r,renderGuid:(0,l.l)(),description:s,html:m,project:(0,a.pT)(d)?d.ID:d,project_author:(0,a.pT)(d)?d.post_author:void 0,project_title:(0,a.pT)(d)?d.post_title:void 0,tags:c,utm_parameters:u,parent_email:(0,a.WY)(p instanceof Array&&p[0]?p[0].ID:p),common_styles:g,is_template:b}}function r({title:e,lock:t,subject:o,description:l,html:i,project:r,tags:n,renderGuid:s,utm_parameters:m,parent_email:d,common_styles:c,is_template:u,author:p,...g}){return{...g,author:(0,a.mQ)(p),title:e,acf:{lock:t,description:l,html:i,project:r,tags:n,utm_parameters:m,parent_email:(0,a.mQ)(d),common_styles:c,is_template:u}}}},31926:(e,t,o)=>{function a(e,t=!1){const o={};for(const l of Object.keys(e)){let i=e[l];void 0===i||"number"===typeof i&&Number.isNaN(i)||(t&&"object"===typeof i&&null!==i&&(i=a(i)),o[l]=i)}return o}function l(e){return"object"===typeof e&&e}function i(e){const t=Number(e);return isNaN(t)?e:t}function r(e){return"number"===typeof e?String(e):e}function n(e){return"object"===typeof e?e.rendered:e}o.d(t,{TB:()=>a,WY:()=>r,mQ:()=>i,pT:()=>l,vf:()=>n})},705:(e,t,o)=>{o.d(t,{vx:()=>d,I9:()=>c,bw:()=>u});var a=o(14721),l=o(39539),i=o(93778),r=o(31926);function n({title:e,content:t,acf:{seen:o,type:a},...l}){return{...l,seen:o,type:a,title:(0,r.vf)(e),content:t}}var s=o(58521);const m="Notifications",d=(0,a.xP)({reducerPath:"notificationsApi",tagTypes:[m],baseQuery:(0,s.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getNotifications:e.query({queryFn:(e,t)=>(0,s.KU)(t).wp.notification_list({author:[Number(e)]}).then((0,i.Ih)(n)),providesTags:e=>e?[...e.map((({id:e})=>({type:m,id:e}))),{type:m,id:"LIST"}]:[{type:m,id:"LIST"}]}),notificationShown:e.mutation({queryFn:({id:e,datetime:t},o)=>(0,s.KU)(o).wp.notification_create2(e,{},{type:l.cM.Json,extraQuery:{"acf[seen]":t}}).then((0,i.SC)(n)),invalidatesTags:[{type:m,id:"LIST"}]})})}),{useGetNotificationsQuery:c,useNotificationShownMutation:u}=d},2952:(e,t,o)=>{o.d(t,{Ju:()=>s,Sr:()=>m,ku:()=>n,tO:()=>r});var a=o(14721),l=o(58521);const i="Optimise",r=(0,a.xP)({reducerPath:"optimiseApi",tagTypes:[i],baseQuery:async(e,t,o)=>{const a=(0,l.KU)(t).baseUrl.replaceAll(/[\\/]$/g,""),i=(0,l.hI)({baseUrl:`${a}/optimization/v1/validate`});let r=await i(e,t,o);if(r.error){let e=r.error;if("function"===typeof e.json)try{e=await e.json()}catch{e=await e}return{error:e}}return r},endpoints:e=>({editLinks:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/links",body:e}),invalidatesTags:[i]}),editImages:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/images",body:e})}),editSpam:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/spamassasin",body:e})})})}),{useEditLinksMutation:n,useEditImagesMutation:s,useEditSpamMutation:m}=r},97032:(e,t,o)=>{o.d(t,{Nq:()=>c,lD:()=>g,OD:()=>b,fo:()=>p,su:()=>u});var a=o(14721),l=o(39539),i=o(93778),r=o(31926);function n({title:e,acf:{members:t,projects_test_emails:o,ftp_settings:a,emails:l,blocks:i,webhook:n},...s}){return{...s,title:(0,r.vf)(e)||"",members:(0,r.pT)(t)?{admins:t.admins&&t.admins.map((e=>({...e,ID:(0,r.WY)(e.ID)}))),users:t.users&&t.users.map((e=>({...e,ID:(0,r.WY)(e.ID)}))),invited_users:t.invited_users&&t.invited_users.map((e=>({...e,ID:(0,r.WY)(e.ID)}))),owner:(0,r.pT)(t.owner)?{...t.owner,ID:(0,r.WY)(t.owner.ID)}:t.owner}:void 0,projects_test_emails:o,ftp_settings:a,webhook:n,emails:l,blocks:i}}function s({title:e,members:t,projects_test_emails:o,ftp_settings:a,webhook:l,emails:i,blocks:n,...s}){const m=e=>({ID:(0,r.mQ)(e.ID||e)}),d=e=>{return(t=e,Array.isArray(t)?t:t?[t]:[]).map(m);var t};return{...s,title:e,acf:{members:t&&{admins:d(t.admins),users:d(t.users),invited_users:d(t.invited_users),owner:t.owner&&m(t.owner)},webhook:l,projects_test_emails:o,ftp_settings:a,emails:i,blocks:n}}}var m=o(58521);const d="Projects",c=(0,a.xP)({reducerPath:"projectsApi",tagTypes:[d,"project"],baseQuery:(0,m.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getProjects:e.query({queryFn(e={page:1},t){const o=(0,m.KU)(t),a={status:["private"]};return e.page&&(a.page=e.page),e.order&&(a.order=e.order),e.orderby&&(a.orderby=e.order),o.wp.project_list(a).then((0,i.Ih)(n))},providesTags:e=>e?[...e.map((({id:e})=>({type:d,id:e}))),{type:d,id:"LIST"}]:[{type:d,id:"LIST"}]}),getProject:e.query({queryFn:(e,t)=>(0,m.KU)(t).wp.project_detail({id:e},{extraQuery:{_embed:"wp:term"}}).then((0,i.SC)(n)),providesTags:(e,t,o)=>[{type:"project",id:o}]}),addProject:e.mutation({queryFn:(e,t)=>(0,m.KU)(t).wp.project_create({status:"private",...s(e)},{type:l.cM.Json}).then((0,i.SC)(n)),invalidatesTags:[{type:d,id:"LIST"}]}),editProject:e.mutation({queryFn({projectId:e,...t},o){const a=(0,m.KU)(o),d=(0,r.TB)(s(t),!0);return a.wp.project_partial_update(e,d,{type:l.cM.Json}).then((0,i.SC)(n))},invalidatesTags:(e,t,{projectId:o})=>[{type:d,id:o}]}),deleteProject:e.mutation({queryFn:(e,t)=>(0,m.KU)(t).wp.project_delete(e,{}).then((0,i.PI)(n)),invalidatesTags:(e,t,o)=>[{type:d,id:o}]})})}),{useGetProjectsQuery:u,useGetProjectQuery:p,useAddProjectMutation:g,useEditProjectMutation:b}=c},59089:(e,t,o)=>{o.d(t,{So:()=>i});var a=o(14721),l=o(58521);const i=(0,a.xP)({reducerPath:"promoApi",baseQuery:(0,l.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:e,type:t},o)=>(0,l.KU)(o).promo.set_code_create({code:e,type:t})}),getPromoInfo:e.query({queryFn:({code:e},t)=>(0,l.KU)(t).promo.get_code_info_list({code:e})})})}),{useCheckPromoMutation:r,useGetPromoInfoQuery:n}=i},92960:(e,t,o)=>{o.d(t,{Z8:()=>i,mI:()=>n});var a=o(14721),l=o(58521);const i=(0,a.xP)({reducerPath:"proxyApi",tagTypes:["Proxy"],baseQuery:(0,l.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get"}),endpoints:e=>({getFile:e.query({queryFn({url:e,tryFetch:t=!0,type:o},a){const i=(0,l.KU)(a),r=t?fetch(e):Promise.reject(),n=e=>(e=>{switch(o){case"json":return e.json();case"text":return e.text();default:return e.blob()}})(e).then((e=>({data:e})));return r.then((e=>n(e))).catch((()=>i.corsProxy.get_list({format:"blob",extraQuery:{url:encodeURIComponent(e)}})))}})})}),{useGetFileQuery:r,useLazyGetFileQuery:n}=i},98119:(e,t,o)=>{o.d(t,{Lv:()=>s,kg:()=>m,yR:()=>n});var a=o(14721),l=o(27943),i=o(39539),r=o(76233);const n=(0,a.xP)({reducerPath:"recoverPasswordApi",baseQuery:(0,l.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/bdpwr/v1/"}),endpoints:e=>({resetPassword:e.mutation({queryFn:(e,t)=>(0,r.mg)(t).bdpwr.reset_password_create({body:e,type:i.cM.Json})}),setPassword:e.mutation({queryFn:(e,t)=>(0,r.mg)(t).bdpwr.set_password_create({body:e,type:i.cM.Json})}),validateRecoverPasswordCode:e.mutation({queryFn:(e,t)=>(0,r.mg)(t).bdpwr.validate_code_create({body:e,type:i.cM.Json})})})}),{useResetPasswordMutation:s,useSetPasswordMutation:m,useValidateRecoverPasswordCodeMutation:d}=n},6193:(e,t,o)=>{o.d(t,{Cl:()=>r,KA:()=>i});var a=o(14721),l=o(27943);const i=(0,a.xP)({reducerPath:"recurrenceSubscriptionsOffApi",baseQuery:(0,l.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getCanselRecurrence:e.query({query:e=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/07ae4159-132b-4a00-998b-bc47c20365ba?subscription_id=${e.sid}&user_id=${e.uid}`)}`})})})}),{useLazyGetCanselRecurrenceQuery:r,useGetCanselRecurrenceQuery:n}=i},47491:(e,t,o)=>{o.d(t,{IJ:()=>r,Sd:()=>i});var a=o(14721),l=o(27943);const i=(0,a.xP)({reducerPath:"recurrenceSubscriptionsOnApi",baseQuery:(0,l.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRecurrence:e.query({query:e=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/e1dd37b1-c3d4-4441-b329-d6b3aa51bfe7?subscription_id=${e.sid}&user_id=${e.uid}`)}`})})})}),{useLazyGetRecurrenceQuery:r,useGetRecurrenceQuery:n}=i},79965:(e,t,o)=>{o.d(t,{E:()=>r,M:()=>i});var a=o(14721),l=o(27943);const i=(0,a.xP)({reducerPath:"requestPlaneApi",baseQuery:(0,l.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRequest:e.mutation({query:e=>({url:`?proxy_url=${encodeURIComponent("https://webhook.latenode.com/5868/prod/9e7a6445-2244-4dd5-bda4-5bca82997bf8")}`,method:"POST",body:e})})})}),{useGetRequestMutation:r}=i},40835:(e,t,o)=>{o.d(t,{Zf:()=>m,dS:()=>n,lg:()=>s,tb:()=>d,yH:()=>r});var a=o(14721),l=o(39539),i=o(58521);const r=(0,a.xP)({reducerPath:"saveFileApi",tagTypes:["Images"],baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({uploadImage:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.upload_create(e,{type:l.cM.FormData})}),sendTestEmail:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.send_email_create(e,{type:l.cM.FormData})}),sendLivePreview:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.get_link_create(e,{type:l.cM.FormData})}),sendShortLink:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.shortener_create(e,{type:l.cM.FormData})})})}),{useUploadImageMutation:n,useSendTestEmailMutation:s,useSendLivePreviewMutation:m,useSendShortLinkMutation:d}=r},83027:(e,t,o)=>{o.d(t,{$s:()=>E,CE:()=>c,JI:()=>u,Jz:()=>n,Lh:()=>d,Oo:()=>s,Yb:()=>b,f1:()=>g,kE:()=>r,y$:()=>m});var a=o(14721),l=o(58521);const i=()=>window.location.toString().includes("/blocks")?"block":"",r=(0,a.xP)({reducerPath:"taxonomiesApi",tagTypes:["Taxonomies","folder","block_folder","Group"],baseQuery:(0,l.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({addFolder:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp[i()+"folder_create"](e).then((e=>e))}),editFolder:e.mutation({queryFn:({id:e,data:t},o)=>(0,l.KU)(o).wp[i()+"folder_partial_update"](e,t).then((e=>e))}),deleteFolder:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp[i()+"folder_delete"](e,{force:!0}).then((e=>e))}),getFolders:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp[i()+"folder_list"]({per_page:100,...e}).then((e=>e)),providesTags:(e,t,o)=>[{type:"folder",id:o}]}),addGroup:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp[i()+"group_create"](e).then((e=>e))}),editGroup:e.mutation({queryFn:({id:e,data:t},o)=>(0,l.KU)(o).wp[i()+"group_partial_update"](e,t).then((e=>e))}),getGroups:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp[i()+"group_list"]({per_page:100,...e}).then((e=>e)),providesTags:(e,t,o)=>[{type:"Group",id:o}]}),deleteGroup:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp[i()+"group_delete"](e,{force:!0}).then((e=>e))}),addEmailsTag:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp.emailtags_create(e).then((e=>e))}),editEmailsTag:e.mutation({queryFn:({id:e,...t},o)=>(0,l.KU)(o).wp.emailtags_partial_update(e,t).then((e=>e))}),deleteEmailsTag:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp.emailtags_delete(e,{force:!0}).then((e=>e))}),getTags:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp[(window.location.toString().includes("/blocks")?"block":"email")+"tags_list"]({per_page:100,...e}).then((e=>e))})})}),{useGetFoldersQuery:n,useGetGroupsQuery:s,useLazyGetGroupsQuery:m,useDeleteGroupMutation:d,useEditGroupMutation:c,useAddGroupMutation:u,useGetTagsQuery:p,useLazyGetFoldersQuery:g,useAddFolderMutation:b,useEditFolderMutation:E}=r},46767:(e,t,o)=>{o.d(t,{OV:()=>r,UH:()=>s,uX:()=>n});var a=o(14721),l=o(39539),i=o(58521);const r=(0,a.xP)({reducerPath:"tokenApi",baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/jwt-auth/v1/"}),endpoints:e=>({tokenCreate:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).jwtAuth.token_create({body:e,type:l.cM.Json})}),tokenValidate:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).jwtAuth.token_validate_create({type:l.cM.Json})})})}),{useTokenCreateMutation:n,useTokenValidateMutation:s}=r},52779:(e,t,o)=>{o.d(t,{S:()=>i,p:()=>r});var a=o(14721),l=o(58521);const i=(0,a.xP)({reducerPath:"yandexAuthApi",baseQuery:(0,l.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/auth/v1/yandex/callback"}),endpoints:e=>({validateYandexToken:e.mutation({query:e=>({url:"",method:"POST",body:e})})})}),{useValidateYandexTokenMutation:r}=i},22536:(e,t,o)=>{o.d(t,{A9:()=>u,Ay:()=>B,DL:()=>b,Dz:()=>c,Fv:()=>f,JV:()=>_,Up:()=>v,b9:()=>S,eX:()=>d,gm:()=>k,iy:()=>y,nJ:()=>E,om:()=>g,qX:()=>A,rc:()=>p,vs:()=>m});var a=o(1029),l=o(93778),i=o(5618);const r=(0,l.ur)({invalidateBlockId:null,isCodeMode:!1,codeModeDirection:"right",editorThemeColor:"light",isSettingsDisabled:!1,settings:{width:""},elementSettings:{},searchFilters:{},block:{id:void 0,isNew:!1,subject:"",description:"",html:"",project:void 0,project_title:"",project_author:void 0,tags:[],type:"Other",title:null,isAmp:!1},monacoDidMount:!1}),n="blockSlice",s=(0,a.createSlice)({name:n,initialState:r,reducers:{switchCodeMode:e=>{e.isCodeMode=!e.isCodeMode},setEditorThemeColor:(e,t)=>{e.editorThemeColor=t.payload},setBlockSettings:(e,t)=>{Object.assign(e,{...e,settings:t.payload,isSettingsDisabled:!1})},setBlockSettingsDisable:(e,t)=>{e.isSettingsDisabled=t.payload},setElementSettings:(e,t)=>{e.elementSettings=t.payload},setSearchFilters:(e,t)=>{e.searchFilters=t.payload},setBlockHtml:(e,t)=>{e.block.html=t.payload},resetBlockSlice:()=>r,setBlockIsAmp:(e,t)=>{e.block.isAmp=t.payload}},extraReducers:e=>{e.addMatcher((e=>"blocksApi/queries/queryResultPatched"===e.type),((e,t)=>{var o,a;const l=t.payload.queryCacheKey.match(/\(([0-9]+)\)/),i=null===(o=t.payload)||void 0===o?void 0:o.patches[0];if(null!==i&&void 0!==i&&null!==(a=i.path)&&void 0!==a&&a[0]&&(e.block[null===i||void 0===i?void 0:i.path[0]]=i.value),null!==l&&void 0!==l&&l[1]&&(e.invalidateBlockId=l[1]),t.payload.queryCacheKey.startsWith("getBlock")){var r,n;const o=null===(r=t.payload)||void 0===r?void 0:r.patches[0];null!==o&&void 0!==o&&null!==(n=o.path)&&void 0!==n&&n[0]&&(e.block[null===o||void 0===o?void 0:o.path[0]]=o.value)}})),e.addMatcher((e=>"blocksApi/invalidateTags"===e.type),((e,t)=>{if(t.payload[0].id===+e.invalidateBlockId)return{...r,isCodeMode:null===e||void 0===e?void 0:e.isCodeMode,codeModeDirection:e.codeModeDirection}})),e.addMatcher(i.VM.endpoints.editBlock.matchFulfilled,((e,{payload:t})=>{e.invalidateBlockId=null,e.block={...e.block,...t,renderGuid:e.block.renderGuid}})),e.addMatcher(i.VM.endpoints.autoSaveBlock.matchFulfilled,((e,t)=>{var o,a;(null===e||void 0===e||null===(o=e.block.id)||void 0===o?void 0:o.toString())===(null===(a=t.payload.id)||void 0===a?void 0:a.toString())&&(e.block.html=t.payload.html)})),e.addMatcher(i.VM.endpoints.getBlock.matchFulfilled,((e,{payload:t})=>{e.block={...r.block,...t}}))}}),{switchCodeMode:m,setEditorThemeColor:d,setBlockSettings:c,setElementSettings:u,setBlockSettingsDisable:p,setSearchFilters:g,setBlockHtml:b,resetBlockSlice:E,setBlockIsAmp:h}=s.actions,f=e=>e[n].isCodeMode,v=e=>e[n].editorThemeColor,_=e=>e[n].settings,A=e=>e[n].elementSettings,y=e=>e[n].isSettingsDisabled,S=e=>e[n].searchFilters,k=e=>e[n].block,B=s},15812:(e,t,o)=>{o.d(t,{Ay:()=>A,D2:()=>g,FC:()=>c,NK:()=>u,NP:()=>h,dV:()=>_,hc:()=>b,jr:()=>E,qM:()=>f,ux:()=>v,wK:()=>p});var a=o(1029),l=o(5618),i=o(18987),r=o(32947);const n=(0,o(93778).ur)({blocksTotal:null,blocksTotalPages:null,parentEmailBlocksTotal:null,parentEmailBlocksTotalPages:null,templateBlocks:[],templateBlocksTotal:null,templateBlocksTotalPages:null,elementsView:!r.EW.isPlugin&&i.A.get(r.A9.em_elements_view)||r.Y$,elementsList:[],customFolders:{},blocksTrashTotal:0,elementsTrashList:[]}),s="blocksPageSlice",m=(0,a.createSlice)({name:s,initialState:n,reducers:{resetPagesAndTotal:()=>n,resetElementsList:e=>{e.elementsList=[]},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeBlockFromList:(e,{payload:t})=>{var o;const a=e.customFolders;t.folder!==r.y2&&null!==(o=a[t.folder])&&void 0!==o&&o.list&&(a[t.folder]={...a[t.folder],list:a[t.folder].list.filter((e=>e.id!==t.emailId)),total:a[t.folder].total-1},e.customFolders=a)}},extraReducers:e=>{e.addMatcher(l.VM.endpoints.getBlocks.matchFulfilled,((e,{meta:t,payload:o})=>{var a,l,i,r,n,s,m,d;const c=(null===(a=t.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-Total"))||(null===o||void 0===o?void 0:o.length),u="trash"===(null===(l=t.arg.originalArgs)||void 0===l?void 0:l.status),p=!(null===(i=t.arg.originalArgs)||void 0===i||null===(r=i.name)||void 0===r||!r.length),g=null===(n=t.arg.originalArgs)||void 0===n?void 0:n.page,b=(null===(s=t.arg.originalArgs)||void 0===s?void 0:s.folderTag)||(null===(m=t.arg.originalArgs)||void 0===m||null===(d=m.tags)||void 0===d?void 0:d[0]);u?(p||(e.blocksTrashTotal=c),e.elementsTrashList=o):b?e.customFolders={...e.customFolders,[b]:{list:o,page:g,total:c}}:(t.arg.originalArgs.tags||p||(e.blocksTotal=c),e.elementsList=o)})),e.addMatcher(l.VM.endpoints.getParentEmailBlocks.matchFulfilled,((e,{meta:t,payload:o})=>{var a,l;const i=(null===(a=t.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-Total"))||(null===o||void 0===o?void 0:o.length)||null,r=null===(l=t.baseQueryMeta)||void 0===l?void 0:l.response.headers.get("X-WP-TotalPages");e.parentEmailBlocksTotal=i,e.parentEmailBlocksTotalPages=r})),e.addMatcher(l.VM.endpoints.getTemplateBlocks.matchFulfilled,((e,{meta:t,payload:o})=>{var a,l;const i=(null===(a=t.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-Total"))||(null===o||void 0===o?void 0:o.length)||null,r=null===(l=t.baseQueryMeta)||void 0===l?void 0:l.response.headers.get("X-WP-TotalPages");e.templateBlocks=o,e.templateBlocksTotal=i,e.templateBlocksTotalPages=r})),e.addMatcher(l.VM.endpoints.editBlock.matchFulfilled,((e,{payload:t})=>{e.elementsList.map((e=>{var o,a;return(null===(o=e.id)||void 0===o?void 0:o.toString())===(null===(a=t.id)||void 0===a?void 0:a.toString())?Object.assign(e,{lock:t.lock,title:t.title,blocktags:t.blocktags}):e}))}))}}),{resetPagesAndTotal:d,resetElementsList:c,toggleElementsView:u,removeBlockFromList:p}=m.actions,g=e=>e[s].blocksTotal,b=e=>e[s].parentEmailBlocksTotal,E=e=>e[s].templateBlocksTotal,h=e=>e[s].customFolders,f=e=>e[s].elementsList,v=e=>e[s].elementsTrashList,_=e=>e[s].blocksTrashTotal,A=m},53774:(e,t,o)=>{o.d(t,{i:()=>i,$:()=>l});const a={pro:{config:{mode:"pro",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,styles:"",revisionService:!1,headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,webversionEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!0,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!0,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!0,formFieldBorderRadiusEnabled:!0,formFieldBoxShadowEnabled:!0,formFieldVisibilityEnabled:!0,formFieldExportAsPictureEnabled:!0,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!0,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!0,elementCarouselEnabled:!0,elementAccordionEnabled:!0,elementFormEnabled:!0,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!0,formFieldAmpVisibilityEnabled:!0,testEmails:[],pushToGTM:!0},project:void 0,page:{isNew:!0,type:"email",project:0,id:""}},editor:{config:{mode:"editor",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,styles:"",headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,webversionEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!0,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!1,editImageControlEnabled:!0,lockEditor:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!0,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!1,formFieldBorderRadiusEnabled:!1,formFieldBoxShadowEnabled:!1,formFieldVisibilityEnabled:!1,formFieldExportAsPictureEnabled:!1,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!1,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!0,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!0,elementCarouselEnabled:!0,elementAccordionEnabled:!0,elementFormEnabled:!0,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!0,formFieldAmpVisibilityEnabled:!0,testEmails:[],pushToGTM:!0},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}},simple:{config:{mode:"simple",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,styles:"",headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!1,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!1,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!1,formFieldBorderRadiusEnabled:!1,formFieldBoxShadowEnabled:!1,formFieldVisibilityEnabled:!1,formFieldExportAsPictureEnabled:!1,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!0,elementCountdownEnabled:!1,elementVideoEnabled:!1,elementAIimageEnabled:!0,elementAItextEnabled:!1,elementCarouselEnabled:!1,elementAccordionEnabled:!1,elementFormEnabled:!1,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!1,formFieldAmpVisibilityEnabled:!1,testEmails:[],pushToGTM:!0},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}},blocks:{config:{mode:"freeUserBlocks",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,styles:"",revisionService:!1,headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,webversionEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!0,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!0,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!0,formFieldBorderRadiusEnabled:!0,formFieldBoxShadowEnabled:!0,formFieldVisibilityEnabled:!0,formFieldExportAsPictureEnabled:!0,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!0,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!0,elementCarouselEnabled:!0,elementAccordionEnabled:!0,elementFormEnabled:!0,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!0,formFieldAmpVisibilityEnabled:!0,testEmails:[],pushToGTM:!0},project:void 0,page:{isNew:!0,type:"email",project:0,id:""}}},l=e=>{const t=a[e];return t||a.editor},i=["mode","formFieldBorderEnabled","formFieldBorderRadiusEnabled","formFieldBoxShadowEnabled","formFieldVisibilityEnabled","formFieldExportAsPictureEnabled","formButtonFieldInsertImageEnabled","formButtonFieldVerticalAlignEnabled","formButtonFieldTextAlignEnabled","formButtonFieldBackgroundImageEnabled","formButtonFieldPaddingsEnabled","formCellFieldVerticalAlignEnabled","formCellFieldBackgroundImageEnabled","formCellFieldPaddingsEnabled","formLinkFieldInsertImageEnabled","formTableFieldBackgroundImageEnabled","formDivFieldBackgroundImageEnabled","formEmailFieldBackgroundImageEnabled"]},38540:(e,t,o)=>{o.d(t,{Ay:()=>d,M:()=>m,YT:()=>s,rI:()=>n});var a=o(1029);const l=(0,o(93778).ur)({isCollapsed:!0,isMonacoFocusing:!1}),i="defaultModePanesSlice",r=(0,a.createSlice)({name:i,initialState:l,reducers:{setMonacoFocusing:(e,t)=>{e.isMonacoFocusing=t.payload},resetPanes:()=>l}}),{resetPanes:n,setMonacoFocusing:s}=r.actions,m=e=>e[i].isMonacoFocusing,d=r},1047:(e,t,o)=>{o.d(t,{A9:()=>p,AJ:()=>v,Ay:()=>G,Bj:()=>B,Bu:()=>x,CT:()=>F,G_:()=>u,HO:()=>h,Hs:()=>O,M7:()=>g,RC:()=>N,S_:()=>P,UI:()=>j,Up:()=>R,VK:()=>A,VO:()=>k,VZ:()=>D,Wm:()=>S,dH:()=>z,eX:()=>c,iy:()=>L,mD:()=>W,no:()=>y,om:()=>b,pl:()=>f,ps:()=>w,qX:()=>C,rY:()=>V,rd:()=>M,ry:()=>E,ss:()=>_,uJ:()=>I,zn:()=>T});var a=o(1029),l=o(93778),i=o(98845),r=o(83027),n=o(97032);const s=(0,l.ur)({invalidateEmailId:null,editorThemeColor:"light",isSettingsDisabled:!1,settings:{backgroundColor:"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",textStrong:!1,textItalic:!1,textUnderline:!1},elementSettings:{},searchFilters:{},emailCommonStyles:"",saveTime:null,mobileViewActive:{shutdown:!0,styles:!0},email:{id:void 0,is_inited:!1,isNew:!1,subject:void 0,preheader:void 0,description:"",html:"",project:void 0,project_author:"",project_title:"",tags:[],utm_parameters:{utm_source:"",utm_medium:"",utm_campaign:"",utm_term:"",utm_content:""},parent_email:null,common_styles:"{}",title:null,emailtags:[],group:[],isAmp:!1},emailIsEdit:!1,isCodeMode:!1,codeModeDirection:void 0,emailViewType:void 0,changeKey:null,problemsList:[],activeProblemRange:null,emailGroups:{},parentGroupOfProject:null,projectGroups:[],isNeedUpdateAppearance:!1,isNeedUpdateContentAppearance:!1}),m="emailSlice",d=(0,a.createSlice)({name:m,initialState:s,reducers:{setEditorThemeColor:(e,t)=>{e.editorThemeColor=t.payload},setEmailFromHistory:(e,{payload:t})=>{const o=e.email,a=void 0===(null===t||void 0===t?void 0:t.preheader),l=void 0===(null===t||void 0===t?void 0:t.subject);e.email={...o,html:null===t||void 0===t?void 0:t.html,preheader:a?o.preheader:null===t||void 0===t?void 0:t.preheader,subject:l?o.subject:null===t||void 0===t?void 0:t.subject,common_styles:"string"===typeof(null===t||void 0===t?void 0:t.common_styles)&&null!==t&&void 0!==t&&t.common_styles.startsWith("{")?null===t||void 0===t?void 0:t.common_styles:o.common_styles||"{}"},e.isNeedUpdateAppearance=!0,e.isNeedUpdateContentAppearance=!0},setEmailSettings:(e,{payload:t})=>{Object.assign(e,{...e,settings:{...t},isSettingsDisabled:!1})},setEmailSettingsDisable:(e,t)=>{e.isSettingsDisabled=t.payload},setElementSettings:(e,{payload:t})=>{e.elementSettings=t},setSearchFilters:(e,t)=>{e.searchFilters=t.payload},updateSearchFilters:(e,t)=>{const o=e.searchFilters;e.searchFilters={...o,...t.payload}},setEmailHTML:(e,t)=>{e.email.html=t.payload},setEmailSubject:(e,t)=>{e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=t.payload),e.email.subject=t.payload},setEmailPreheader:(e,t)=>{e.email.preheader=t.payload},resetEmailSlice:()=>s,setEmailTitle:(e,t)=>{e.email.title=t.payload},setIsInited:(e,t)=>{e.email.is_inited=t.payload},setEmailIsAmp:(e,t)=>{e.email.isAmp=t.payload},setProblemsList:(e,t)=>{e.problemsList=t.payload},setActiveProblemRange:(e,t)=>{e.activeProblemRange=t.payload},setIsNeedUpdateContentAppearance:(e,t)=>{e.isNeedUpdateContentAppearance=t.payload},setIsNeedUpdateAppearance:(e,t)=>{e.isNeedUpdateAppearance=t.payload},setEmailGroups:(e,{payload:t})=>{const o=Object.keys(t)[0],a=e.emailGroups,l=e.parentGroupOfProject,i=e.projectGroups,r={};var n;l&&i.length&&(null===(n=t[o])||void 0===n||n.forEach((e=>{const t=i.find((e=>e.id===+o)),a=null===t||void 0===t?void 0:t.children.find((t=>t.id===+e));a?(r.hasOwnProperty(t.id)||(r[t.id]=[]),r[t.id].push({label:a.name,value:a.id})):(r.hasOwnProperty(o)||(r[o]=[]),r[o].push({label:e,value:null}))})),0===t[o].length&&(r[o]=[]));e.emailGroups={...a,...r}}},extraReducers:e=>{e.addMatcher((e=>"emailsApi/queries/queryResultPatched"===e.type),((e,t)=>{var o,a;const l=t.payload.queryCacheKey.match(/\("([0-9]+)"\)/),i=null===(o=t.payload)||void 0===o?void 0:o.patches[0];null!==i&&void 0!==i&&null!==(a=i.path)&&void 0!==a&&a[0]&&(e.email[null===i||void 0===i?void 0:i.path[0]]=i.value),null!==l&&void 0!==l&&l[1]&&(e.invalidateEmailId=l[1]),e.emailIsEdit=!0})),e.addMatcher((e=>"emailsApi/invalidateTags"===e.type),((e,t)=>{if(t.payload[0].id===+e.invalidateEmailId)return s})),e.addMatcher(i.GY.endpoints.editEmail.matchFulfilled,((e,{payload:t})=>{e.invalidateEmailId=null,e.email={...e.email,...t,renderGuid:e.email.renderGuid}})),e.addMatcher(i.GY.endpoints.autoSaveEmail.matchFulfilled,((e,t)=>{var o,a;(null===(o=e.email.id)||void 0===o?void 0:o.toString())===(null===(a=t.payload.id)||void 0===a?void 0:a.toString())&&(e.email.html=t.payload.html)})),e.addMatcher(i.GY.endpoints.getEmail.matchFulfilled,((e,{payload:t})=>{var o,a;e.email={...s.email,...t,is_inited:t.is_inited||(t.id===(null===(o=e.email)||void 0===o?void 0:o.id)?null===(a=e.email)||void 0===a?void 0:a.is_inited:s.email.is_inited),common_styles:"string"===typeof(null===t||void 0===t?void 0:t.common_styles)&&null!==t&&void 0!==t&&t.common_styles.startsWith("{")?null===t||void 0===t?void 0:t.common_styles:"{}"},e.emailIsEdit=!1})),e.addMatcher(r.kE.endpoints.getGroups.matchFulfilled,((e,{meta:t,payload:o})=>{const a=e.email.group,l=t.arg.originalArgs.parent,i=o;l&&(e.parentGroupOfProject=l,i.length>0&&(e.projectGroups=i));const r={};l&&a.length&&i.length&&(null===a||void 0===a||a.forEach((e=>{null===i||void 0===i||i.forEach((t=>{const o=t.children.find((t=>t.id===e));o&&(r.hasOwnProperty(t.id)||(r[t.id]=[]),r[t.id].push({label:o.name,value:o.id}))}))}))),e.emailGroups=r})),e.addMatcher(n.Nq.endpoints.getProject.matchFulfilled,((e,{meta:t,payload:o})=>{var a;e.parentGroupOfProject=(null===(a=o.group)||void 0===a?void 0:a[0])||null}))}}),{setEditorThemeColor:c,setEmailSettings:u,setElementSettings:p,setEmailSettingsDisable:g,setSearchFilters:b,updateSearchFilters:E,setEmailSubject:h,setEmailPreheader:f,setEmailHTML:v,resetEmailSlice:_,setEmailTitle:A,setEmailFromHistory:y,setIsInited:S,setEmailIsAmp:k,setProblemsList:B,setActiveProblemRange:w,setEmailGroups:x,setIsNeedUpdateAppearance:P,setIsNeedUpdateContentAppearance:N}=d.actions,T=e=>e[m].invalidateEmailId,R=e=>e[m].editorThemeColor,I=e=>e[m].settings,C=e=>e[m].elementSettings,L=e=>e[m].isSettingsDisabled,F=e=>e[m].searchFilters,O=e=>e[m].email,M=e=>e[m].problemsList,D=e=>e[m].activeProblemRange,V=e=>e[m].emailGroups,j=e=>e[m].projectGroups,z=e=>e[m].isNeedUpdateContentAppearance,W=e=>e[m].isNeedUpdateAppearance,G=d},79253:(e,t,o)=>{o.d(t,{Ay:()=>v,FC:()=>u,MY:()=>g,NK:()=>c,NP:()=>f,X:()=>p,aO:()=>h,ff:()=>d,qM:()=>b,ux:()=>E});var a=o(1029),l=o(98845),i=o(18987),r=o(32947);const n=(0,o(93778).ur)({emailsTotal:0,elementsList:[],emailsTrashTotal:0,elementsTrashList:[],customFolders:{},elementsView:!r.EW.isPlugin&&i.A.get(r.A9.em_elements_view)||r.Y$}),s="emailsPageSlice",m=(0,a.createSlice)({name:s,initialState:n,reducers:{resetPagesAndTotal:()=>n,resetElementsList:e=>{e.elementsList=[]},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeEmailFromList:(e,{payload:t})=>{var o;let a=e.customFolders;t.folder!==r.y2&&null!==(o=a[t.folder])&&void 0!==o&&o.list&&(a[t.folder]={...a[t.folder],list:a[t.folder].list.filter((e=>e.id!==t.emailId)),total:a[t.folder].total-1},e.customFolders=a)}},extraReducers:e=>{e.addMatcher(l.GY.endpoints.getEmails.matchFulfilled,((e,{meta:t,payload:o})=>{var a,l,i,r,n,s,m,d;const c=+(null===(a=t.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-Total"))||0,u="trash"===(null===(l=t.arg.originalArgs)||void 0===l?void 0:l.status),p=!(null===(i=t.arg.originalArgs)||void 0===i||null===(r=i.name)||void 0===r||!r.length),g=null===(n=t.arg.originalArgs)||void 0===n?void 0:n.page,b=(null===(s=t.arg.originalArgs)||void 0===s?void 0:s.folderTag)||(null===(m=t.arg.originalArgs)||void 0===m||null===(d=m.tags)||void 0===d?void 0:d[0]);u?(p||(e.emailsTrashTotal=c),e.elementsTrashList=o):b?e.customFolders={...e.customFolders,[b]:{list:o,page:g,total:c}}:(t.arg.originalArgs.tags||p||(e.emailsTotal=c),e.elementsList=o)})),e.addMatcher(l.GY.endpoints.getTemplateEmails.matchFulfilled,((e,{meta:t,payload:o})=>{var a;const l=+(null===(a=t.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-Total"))||0;e.elementsList=o,e.emailsTotal=l;const{projectGroup:i,projectId:r,tags:n}=t.arg.originalArgs;!(null!==i&&void 0!==i&&i.length&&r||null!==n&&void 0!==n&&n.length)&&(null!==n&&void 0!==n&&n.length||null!==i&&void 0!==i&&i.length)||(e.emailsTotal=l)})),e.addMatcher(l.GY.endpoints.editEmail.matchFulfilled,((e,{payload:t})=>{e.elementsList.map((e=>{var o,a;return(null===(o=e.id)||void 0===o?void 0:o.toString())===(null===(a=t.id)||void 0===a?void 0:a.toString())?Object.assign(e,{lock:t.lock,title:t.title,emailtags:t.emailtags}):e}))}))}}),{resetPagesAndTotal:d,toggleElementsView:c,resetElementsList:u,removeEmailFromList:p}=m.actions,g=e=>e[s].emailsTotal,b=e=>e[s].elementsList,E=e=>e[s].elementsTrashList,h=e=>e[s].emailsTrashTotal,f=e=>e[s].customFolders,v=m},80772:(e,t,o)=>{o.d(t,{Ac:()=>g,Ay:()=>b,BK:()=>c,Uf:()=>p,Yw:()=>m,e_:()=>d,js:()=>u,tm:()=>s});var a=o(1029),l=o(93778);const i="imageSlice",r=(0,l.ur)({currentImage:"",currentBackground:"",currentImageName:""}),n=(0,a.createSlice)({name:i,initialState:r,reducers:{setCurrentImageName(e,t){e.currentImageName=t.payload},setCurrentImage(e,t){e.currentImage=t.payload},setCurrentBackground(e,t){e.currentBackground=t.payload},clearCurrentImages(e,t){e.currentImage="",e.currentBackground="",e.currentImageName=""}}}),{setCurrentImage:s,setCurrentImageName:m,setCurrentBackground:d,clearCurrentImages:c}=n.actions,u=e=>e[i].currentImage,p=e=>e[i].currentImageName,g=e=>e[i].currentBackground,b=n},39206:(e,t,o)=>{o.d(t,{AS:()=>p,Ay:()=>_,Bp:()=>c,Sl:()=>v,TB:()=>b,X8:()=>E,ah:()=>f,qT:()=>u});var a=o(1029),l=o(5618),i=o(97032),r=o(92048),n=o.n(r);const s=(0,o(93778).ur)({block:{isNew:!0,subject:"",description:"",html:'<table cellspacing="0" cellpadding="0" border="0" width="100%">'+n()+"</table>",project:void 0,project_title:"",tags:[],type:"Other",title:null},hasChanged:!1}),m="newBlockSlice",d=(0,a.createSlice)({name:m,initialState:s,reducers:{setNewBlockAll:(e,{payload:{subject:t="",description:o="",renderGuid:a,html:l='<table cellspacing="0" cellpadding="0" border="0" width="100%">'+n()+"</table>",tags:i=[],type:r="Other",title:s,isAmp:m=!1}})=>{e.hasChanged||(e.hasChanged=!0),e.block.title=s,e.block.subject=t,e.block.description=o,e.block.html=l,e.block.tags=i,e.block.type=r,e.block.renderGuid=a,e.block.isAmp=m},setNewBlockTitle:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.block.title=t.payload},setNewBlockDescription:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.block.description=t.payload},setNewBlockHtml:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.block.html=t.payload},setNewBlockTags:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.block.tags=t.payload},resetNewBlockSlice:e=>({...s,block:{...s.block,project:e.block.project,project_title:e.block.project_title}}),setBlockIsAmp:(e,t)=>{e.block.isAmp=t.payload}},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,t)=>{e.block.project=t.payload.id,e.block.project_title=t.payload.title})),e.addMatcher(l.VM.endpoints.getBlock.matchFulfilled,(e=>({...s,block:{...s.block,project:e.block.project,project_title:e.block.project_title}})))}}),{setNewBlockAll:c,setNewBlockTitle:u,setNewBlockDescription:p,setNewBlockHtml:g,setNewBlockTags:b,resetNewBlockSlice:E,setBlockIsAmp:h}=d.actions,f=e=>e[m].block,v=e=>e[m].hasChanged,_=d},12741:(e,t,o)=>{o.d(t,{$S:()=>C,Ay:()=>L,BQ:()=>E,Et:()=>N,K3:()=>k,MZ:()=>b,P3:()=>w,TC:()=>_,TU:()=>h,Uh:()=>T,YG:()=>I,Zs:()=>v,aY:()=>A,lg:()=>R,mk:()=>x,ol:()=>B,x3:()=>f,yY:()=>S,zH:()=>P});var a=o(1029),l=o(98845),i=o(97032),r=o(32947),n=o(31557),s=o.n(n),m=o(93778),d=o(39218),c=o(40277);const u=(0,m.ur)({emailtags:[],email:{isNew:!0,is_inited:!1,subject:void 0,preheader:void 0,description:"",html:s(),project:void 0,project_title:"",tags:[],utm_parameters:{utm_source:"",utm_medium:"",utm_campaign:"",utm_term:"",utm_content:""},parent_email:null,common_styles:"{}",title:"",emailtags:[],isAmp:!1},hasChanged:!1}),p="newEmailSlice",g=(0,a.createSlice)({name:p,initialState:u,reducers:{setNewEmailAll:(e,{payload:{id:t,subject:o,description:a="",preheader:l,html:i=s(),utm_parameters:{utm_source:n="",utm_medium:m="",utm_campaign:d="",utm_term:u="",utm_content:p=""}={},common_styles:g="{}",emailtags:b=null,renderGuid:E,title:h,_embedded:f,isAmp:v=!1}})=>{var _;e.hasChanged||(e.hasChanged=!0),e.email.isAmp=v,e.email.title=h,e.emailtags=b,e.email.subject=o,e.email.description=a,e.email.common_styles=g||JSON.stringify(r.BD),e.email.preheader=l,e.email.is_template=!1,e.email.html=i,e.email.tags=(null===(_=(0,c._q)({_embedded:f},r.zh))||void 0===_?void 0:_.map((e=>e.name)))||[],e.email.renderGuid=E,e.email.parent_email=t,e.email.utm_parameters={utm_source:n,utm_medium:m,utm_campaign:d,utm_term:u,utm_content:p}},setNewEmailTitle:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.title=t.payload},setNewEmailSubject:(e,t)=>{e.hasChanged||e.email.subject===t.payload||(e.hasChanged=!0),e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=t.payload),e.email.subject=t.payload},setNewEmailPreheader:(e,t)=>{e.hasChanged||e.email.preheader===t.payload||(e.hasChanged=!0),e.email.preheader=t.payload},setNewEmailDescription:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.description=t.payload},setNewEmailIsTemplate:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.is_template=t.payload},setNewEmailHtml:(e,t)=>{e.hasChanged||(e.hasChanged=!0),t.payload&&(e.email.html=t.payload)},setNewCommonStyles:(e,t)=>{e.hasChanged||(e.hasChanged=!0),t.payload&&(e.email.common_styles=t.payload)},setNewEmailTags:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.tags=t.payload},setNewEmailUtmSource:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_source=t.payload},setNewEmailUtmMedium:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_medium=t.payload},setNewEmailUtmCampaign:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_campaign=t.payload},setNewEmailUtmTerm:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_term=t.payload},setNewEmailUtmContent:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_content=t.payload},setNewIsInited:(e,t)=>{e.email.is_inited=t.payload},setNewEmailIsAmp:(e,t)=>{e.email.isAmp=t.payload},resetNewEmailSlice:e=>({...u,email:{...u.email,guid:(0,d.l)(),project:e.email.project,project_title:e.email.project_title}})},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,t)=>{e.email.project=t.payload.id,e.email.project_title=t.payload.title})),e.addMatcher(l.GY.endpoints.getEmail.matchFulfilled,(e=>({...u,email:{...u.email,project:e.email.project,project_title:e.email.project_title}})))}}),{setNewEmailAll:b,setNewEmailTitle:E,setNewEmailSubject:h,setNewEmailPreheader:f,setNewEmailDescription:v,setNewEmailIsTemplate:_,setNewEmailHtml:A,setNewCommonStyles:y,setNewEmailTags:S,setNewEmailUtmSource:k,setNewEmailUtmMedium:B,setNewEmailUtmCampaign:w,setNewEmailUtmContent:x,setNewEmailUtmTerm:P,resetNewEmailSlice:N,setNewIsInited:T,setNewEmailIsAmp:R}=g.actions,I=e=>e[p].email,C=e=>e[p].hasChanged,L=g},84572:(e,t,o)=>{o.d(t,{AQ:()=>f,Ay:()=>_,BN:()=>u,GD:()=>b,RP:()=>h,Rw:()=>E,es:()=>c,mb:()=>p,od:()=>d,qV:()=>v,yN:()=>g});var a=o(1029),l=o(93778),i=o(97032),r=o(98845);const n=(0,l.ur)({project:null,activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),s="projectSlice",m=(0,a.createSlice)({name:s,initialState:n,reducers:{setProject:(e,{payload:t})=>{e.project=t},setActiveGroupsTags:(e,{payload:t})=>{e.activeGroupsTags=t,t.length&&(e.activeProjectGroupsTags=[])},setActiveProjectGroupsTags:(e,{payload:t})=>{e.activeProjectGroupsTags=t,t.length&&(e.activeGroupsTags=[])},resetAllTags:e=>{e.activeProjectGroupsTags=[],e.activeGroupsTags=[]}},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,{payload:t})=>{e.project={...n.project,...t}})),e.addMatcher(i.Nq.endpoints.editProject.matchFulfilled,((e,{payload:t})=>{e.project={...n.project,...t}})),e.addMatcher(r.GY.endpoints.getTemplateEmails.matchFulfilled,((e,{payload:t,meta:o})=>{const{projectId:a}=o.arg.originalArgs;var l,i,r;a?(e.groupsTemplateProjectTotal=+(null===(l=o.baseQueryMeta)||void 0===l?void 0:l.response.headers.get("X-WP-Total")),e.groupsTemplateProjectTotalPages=+(null===(i=o.baseQueryMeta)||void 0===i?void 0:i.response.headers.get("X-WP-TotalPages"))):e.groupsTemplateTotal=+(null===(r=o.baseQueryMeta)||void 0===r?void 0:r.response.headers.get("X-WP-Total"))}))}}),{setProject:d,setActiveGroupsTags:c,setActiveProjectGroupsTags:u,resetAllTags:p}=m.actions,g=e=>e[s].project,b=e=>e[s].activeGroupsTags,E=e=>e[s].activeProjectGroupsTags,h=e=>e[s].groupsTemplateTotal,f=e=>e[s].groupsTemplateProjectTotal,v=e=>e[s].groupsTemplateProjectTotalPages,_=m},23424:(e,t,o)=>{o.d(t,{Ay:()=>x,Cj:()=>_,Oo:()=>E,Os:()=>f,Wz:()=>h,YF:()=>b,cL:()=>A,gU:()=>w,o8:()=>k,qf:()=>g,sB:()=>v,sK:()=>y,uM:()=>B,vW:()=>S});var a=o(1029),l=o(93778),i=o(97032),r=o(83027),n=o(32947);const s=new URLSearchParams(window.location.search),m=s.get("tag"),d=s.get("folder"),c=(0,l.ur)({activeModal:"",secondModal:"",projectsTotal:"",projectsTotalPages:"",folders:[],activeTagId:m||null,activeFolderId:d||(m?null:n.y2),activeTab:null}),u="projectsPageSlice",p=(0,a.createSlice)({name:u,initialState:c,reducers:{openModal(e,t){e.activeModal=t.payload},setActiveTab(e,t){e.activeTab=t.payload},closeModal(e){e.activeModal=""},openSecondModal(e,t){e.secondModal=t.payload},closeSecondModal(e){e.secondModal=""},setFolders(e,{payload:t}){e.folders=t},setActiveTagId(e,{payload:t}){e.activeTagId=t}},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProjects.matchFulfilled,((e,{meta:t})=>{var o,a;const l=null===(o=t.baseQueryMeta)||void 0===o?void 0:o.response.headers.get("X-WP-Total"),i=null===(a=t.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-TotalPages");e.projectsTotal=l,e.projectsTotalPages=i})),e.addMatcher(r.kE.endpoints.getFolders.matchFulfilled,((e,{payload:t})=>{e.folders=t}))}}),{openModal:g,setActiveTab:b,closeModal:E,openSecondModal:h,closeSecondModal:f,setFolders:v,setActiveTagId:_}=p.actions,A=e=>e[u].activeModal,y=e=>e[u].secondModal,S=e=>e[u].projectsTotal,k=e=>e[u].folders,B=e=>e[u].activeTagId,w=e=>e[u].activeTab,x=p},61058:(e,t,o)=>{o.d(t,{Ay:()=>p,RL:()=>u,p1:()=>c,qX:()=>m});var a=o(1029),l=o(98845),i=o(5618);const r=(0,o(93778).ur)({historyData:[],elementHistoryTotalPages:1}),n="revisionHistorySlice",s=(0,a.createSlice)({name:n,initialState:r,reducers:{resetElementHistorySlice:()=>({...r}),setElementHistory:(e,t)=>{0!==t.payload.length&&(e.historyData=t.payload)}},extraReducers:e=>{e.addMatcher(l.GY.endpoints.getEmailHistory.matchFulfilled,((e,{meta:t,payload:o})=>{var a;e.elementHistoryTotalPages=+(null===(a=t.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-TotalPages")),t.arg.originalArgs.page&&1!==t.arg.originalArgs.page||(e.historyData=o.data||[])})),e.addMatcher(i.VM.endpoints.getBlockHistory.matchFulfilled,((e,{meta:t,payload:o})=>{var a;e.elementHistoryTotalPages=+(null===(a=t.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-TotalPages")),o.args.page&&1!==o.args.page||(e.historyData=o.data||[])}))}}),{resetElementHistorySlice:m}=s.actions,{setElementHistory:d}=s.actions,c=e=>e[n].historyData,u=e=>e[n].elementHistoryTotalPages,p=s},47014:(e,t,o)=>{o.d(t,{Ay:()=>A,B:()=>E,B$:()=>_,C1:()=>h,hZ:()=>v,ko:()=>p,ku:()=>c,ww:()=>m,yf:()=>f});var a=o(1029),l=o(13216),i=o(32947),r=o(40277);const n=(0,o(93778).ur)({currentUser:{},currentSchema:{},monacoOptions:i.rW,monacoDidMount:!1}),s="userSlice",m=(0,a.createAsyncThunk)("user/setMonacoOptions",(async(e,{getState:t})=>{const o=t()[s],a="string"===typeof e.font_family?`${e.font_family}, sans-serif`:void 0,l=void 0!==e.word_wrap?e.word_wrap?"on":"off":void 0;return a&&o.monacoOptions.fontFamily!==a&&await(0,r.iV)(e.font_family),{tabSize:e.tab_size,fontFamily:a,fontSize:e.font_size,wordWrap:l,insertSpaces:e.insert_spaces,minimap:{enabled:e.minimap}}})),d=(0,a.createSlice)({name:s,initialState:n,reducers:{setMonacoDidMount:(e,{payload:t})=>{e.monacoDidMount=t},setTheme:(e,{payload:t})=>{e.currentUser.theme=t},setUserLocale:(e,{payload:t})=>{e.currentUser.locale=t},setUserAutosaves:(e,{payload:t})=>{e.currentUser.autosaves=t},setUser:(e,{payload:t})=>{e.currentUser={...e.currentUser,...t}}},extraReducers:e=>{e.addCase(m.fulfilled,((e,t)=>{const o=t.payload;e.monacoOptions=(0,r.i0)({...e.monacoOptions},o)})),e.addMatcher(l.Q2.endpoints.editMe.matchFulfilled,((e,t)=>{e.currentUser=t.payload})),e.addMatcher(l.Q2.endpoints.getMe.matchFulfilled,((e,t)=>{e.currentUser=t.payload})),e.addMatcher(l.Q2.endpoints.getSchema.matchFulfilled,((e,t)=>{e.currentSchema=t.payload.schema}))}}),{setMonacoDidMount:c,setTheme:u,setUserLocale:p,setUserAutosaves:g,setUser:b}=d.actions,E=e=>{var t;return null===(t=e[s].currentUser)||void 0===t?void 0:t.locale},h=e=>e[s].currentUser,f=e=>e[s].currentSchema,v=e=>e[s].monacoOptions,_=e=>{var t;return 3891!==(null===(t=e[s].currentUser.subscription)||void 0===t?void 0:t.ID)},A=d}}]);
|