@emailmaker/emailmaker 1.1.85-dev.3 → 1.1.85-dev.4
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 +20 -0
- package/{emailmaker-core.fc1d4d9a.js → emailmaker-core.273a13d0.js} +1 -1
- package/emailmaker-esm.js +9 -9
- package/{emailmaker-po.fc1d4d9a.js → emailmaker-po.273a13d0.js} +1 -1
- package/emailmaker.js +10 -10
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/js/{discussHandlers.DPWv0hV2.js → discussHandlers.Cn70h-Yt.js} +2 -2
- package/iframe/js/iframe-eblock.body.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.body.js +2 -2
- package/iframe/js/iframe.js +1 -1
- package/node_modules/@emailmaker/ui-kit/package.json +1 -1
- package/package.json +2 -2
- package/runtime/react/index.js +1 -1
- package/static/umd-runtime/runtime.js +1 -1
- package/vite/index.cjs +1 -2
- package/vite/index.js +1 -2
- /package/iframe/{iframe-eblock.fc1d4d9a.html → iframe-eblock.273a13d0.html} +0 -0
- /package/iframe/{iframe.fc1d4d9a.html → iframe.273a13d0.html} +0 -0
|
@@ -854,4 +854,4 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
|
|
|
854
854
|
</amp-accordion>
|
|
855
855
|
</td></tr></table>`,Fc={image:"element_image","ai-image":"element_ai_image",text:"element_text",header:"element_heading",button:"element_button",spacer:"element_spacer","list-ul":"element_lists","list-ol":"element_lists",divider:"element_divider",social:"element_social",table:"element_table",countdown:"element_timer",video:"element_video","amp-carousel":"element_amp_carousel","amp-accordion":"element_amp_accordion","amp-form":"element_amp_form"};function vi(e){return Fc[e]??null}var Ei=e=>Number(e)||void 0,Bc={colors:[],fonts:[],socials:[]},Ko=(e="entity")=>{const t=typeof globalThis<"u"?globalThis.crypto:void 0;if(t?.randomUUID)return t.randomUUID();const n=typeof performance<"u"?performance.now().toString(36).replace(".",""):String(Date.now());return`${e}-${Date.now().toString(36)}-${n}`},Uc=()=>Ko("soc"),$c=/^[a-z][a-z0-9+.-]*:/i,Si=e=>{const t=String(e??"").trim();return t?$c.test(t)?t:`https://${t}`:""},zc=e=>{const t=Si(e);if(!t)return!1;try{const n=new URL(t);return n.protocol==="https:"&&!!n.hostname}catch{return!1}},Gc=e=>[...e].filter(t=>t.url.trim()!=="").sort((t,n)=>t.order-n.order),Wc=e=>Gc(e).map(t=>({platform:t.icon_key,href:t.url,label:t.name,...t.icon_url?{iconSrc:t.icon_url}:{}})),Hc=/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,qc=/^#?([0-9a-f]{6})$/i,Qo=e=>{if(!e)return null;const t=String(e).trim().toLowerCase(),n=qc.exec(t);if(n)return`#${n[1]}`;const r=Hc.exec(t);if(r){const[,i,a,c]=r;return`#${i}${i}${a}${a}${c}${c}`}return null},wi=()=>Ko("bc"),Vc=/\.(woff2|woff|ttf|otf)$/i,Yc=e=>{const t=Vc.exec(e.trim().toLowerCase());return t?`.${t[1]}`:null},Kc={".woff":"application/x-font-woff",".woff2":"application/font-woff2",".ttf":"font/sfnt",".otf":"font/sfnt"},Qc={".woff":["application/x-font-woff","font/woff","application/font-woff"],".woff2":["application/font-woff2","font/woff2"],".ttf":["font/sfnt","application/font-sfnt","application/x-font-ttf","font/ttf","application/x-font-truetype"],".otf":["font/sfnt","application/font-sfnt","application/vnd.ms-opentype","application/x-font-opentype","font/otf","font/opentype"]},Xc=new Set(["","application/octet-stream","binary/octet-stream"]),Jc=e=>{const t=Yc(e.name);if(!t)return e;const n=e.type.trim().toLowerCase();return Qc[t].includes(n)||!Xc.has(n)?e:new File([e],e.name,{type:Kc[t],lastModified:e.lastModified})},Zc=()=>Ko("fnt"),ed=e=>e.family?.trim()||e.name.trim(),td=e=>e.filter(t=>t.source_url?.trim()).map(t=>({family:t.family?.trim()||t.name.trim(),source_url:t.source_url?.trim()??"",weight:t.weight?.trim()||"400",style:t.style??"normal"})),nd=(e,t={})=>{const n=t.srcOverride?.trim()||e.source_url?.trim();if(!n||!t.srcOverride&&ki(e)||t.srcOverride&&o.isGoogleFontsCssUrl(n))return null;const r=t.familyOverride?.trim()||ed(e),i=e.weight?.trim()||"400",a=e.style??"normal";return`@font-face{font-family:${JSON.stringify(r)};src:url(${JSON.stringify(n)});font-weight:${i};font-style:${a};font-display:swap;}`},od=e=>e.source_kind?e.source_kind:o.isGoogleFontsCssUrl(e.source_url)?"google_stylesheet":e.file_name?.trim()?"uploaded":"remote_file",ki=e=>e.source_kind?e.source_kind==="google_stylesheet"||e.source_kind==="remote_stylesheet":o.isGoogleFontsCssUrl(e.source_url),Ci="data-em-project-fonts-face",Ti="data-em-project-font-link",rd=e=>{const t=e.filter(n=>ki(n)).map(n=>n.source_url?.trim()??"").filter(Boolean);return[...new Set(t)]},id=e=>e.map(t=>nd(t)).filter(t=>!!t).join(""),ad=(e,t=document)=>{const n=id(e),{head:r}=t;let i=r.querySelector(`style[${Ci}]`);if(!n){i?.remove();return}i||(i=t.createElement("style"),i.setAttribute(Ci,""),r.appendChild(i)),i.textContent=n},sd=(e,t=document)=>{const n=new Set(rd(e)),{head:r}=t;r.querySelectorAll(`link[${Ti}]`).forEach(i=>{const a=i.getAttribute("href")??"";n.has(a)?n.delete(a):i.remove()}),n.forEach(i=>{const a=t.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("href",i),a.setAttribute(Ti,""),r.appendChild(a)})},ld=(e,t=document)=>{ad(e,t),sd(e,t)},cd=new Set(["normal","italic","oblique"]),Qb="[emailmaker] projectStyles:",Wt=e=>{},bt=e=>typeof e=="string"?e.trim():"",Ii=e=>!e||e.startsWith("//")?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")?!0:e.toLowerCase().startsWith("https://"),dd=e=>o.isGoogleFontsCssUrl(e)?"google_stylesheet":(e.split(/[?#]/)[0]??"").toLowerCase().endsWith(".css")?"remote_stylesheet":"remote_file",Xo=(e,t,n)=>e.length<=t?e:(Wt(`${n} list is capped at ${t} entries, ${e.length-t} dropped`),e.slice(0,t)),ud=(e,t)=>{const n=Qo(e?.hex);if(!n){Wt(`colors[${t}] skipped: "${String(e?.hex)}" is not a hex color`);return}return{id:bt(e.id)||wi(),name:bt(e.name),hex:n,order:0}},md=(e,t)=>{const n=bt(e?.family),r=bt(e?.source_url);if(!n){Wt(`fonts[${t}] skipped: family is required`);return}if(!r){Wt(`fonts[${t}] skipped: source_url is required`);return}if(!Ii(r)){Wt(`fonts[${t}] skipped: source_url must be https or relative, got "${r}"`);return}const i=bt(e.style);return{id:bt(e.id)||Zc(),name:bt(e.name)||n,family:n,source_url:r,source_kind:dd(r),weight:bt(e.weight)||"400",style:cd.has(i)?i:"normal",order:0}},pd=(e,t)=>{const n=Si(e?.url);if(!n||!zc(n)){Wt(`socials[${t}] skipped: url must be https, got "${String(e?.url)}"`);return}const r=bt(e.icon_key),i=bt(e.icon_url);let a;if(i&&Ii(i)?a=i:i&&Wt(`socials[${t}]: icon_url must be https or relative, got "${i}" — icon dropped`),!r&&!a){Wt(`socials[${t}] skipped: icon_key or icon_url is required`);return}return{id:bt(e.id)||Uc(),name:bt(e.name),url:n,icon_key:r,...a?{icon_url:a}:{},enabled:!0,order:0}},Jo=e=>e.map((t,n)=>({...t,order:n})),fd=e=>({colors:Jo(Xo(e?.colors??[],32,"colors").map(ud).filter(t=>t!==void 0)),fonts:Jo(Xo(e?.fonts??[],20,"fonts").map(md).filter(t=>t!==void 0)),socials:Jo(Xo(e?.socials??[],20,"socials").map(pd).filter(t=>t!==void 0))}),hd={tg:"telegram",yt:"youtube",yd:"yandex_zen",tt:"tiktok",pi:"pinterest",ig:"instagram",fb:"facebook",xa:"x",tw:"twitter"},Ai="vk",gd=new Set(o.EM_SOCIAL_SELECT_ORDER),yd=e=>gd.has(e),xi=e=>{const t=String(e??"").trim().toLowerCase();return t?yd(t)?t:hd[t]??Ai:Ai},_d=e=>xi(e),bd=new Set(["normal","italic","oblique"]),vd=new Set(["uploaded","remote_file","google_stylesheet"]),Pt=e=>(e??"").trim(),wn=e=>Pt(e)||void 0,Pi=e=>typeof e=="number"&&e>0?e:void 0,Ed=e=>bd.has(e)?e:void 0,Sd=e=>vd.has(e)?e:void 0,wd=(e,t)=>{const n=Qo(Pt(e.hex));return n?{id:Pt(e.id)||wi(),name:Pt(e.name),hex:n,order:e.order??t}:null},Ri=(e,t=0)=>({id:Pt(e.id),name:Pt(e.name),source_url:wn(e.source_url),source_kind:Sd(e.source_kind),file_name:wn(e.file_name),family:wn(e.family),weight:wn(e.weight),style:Ed(e.style),preview_url:wn(e.preview_url),storage_fallback:e.storage_fallback||void 0,font_size_px:Pi(e.font_size_px),line_height_px:Pi(e.line_height_px),order:e.order??t}),kd=(e,t)=>{const n=Pt(e.url);return n?{id:Pt(e.id),name:Pt(e.name),url:n,icon_key:xi(Pt(e.icon_key)),enabled:e.enabled??!0,order:e.order??t}:null},on=e=>[...e].sort((t,n)=>t.order-n.order),ji=e=>e?{colors:on((e.colors??[]).map(wd).filter(t=>t!==null)),fonts:on((e.fonts??[]).map(Ri)),socials:on((e.socials??[]).map(kd).filter(t=>t!==null))}:Bc,Cd=e=>e==="remote_stylesheet"?"remote_file":e,Td=e=>{const t={};return e.colors&&(t.colors=on(e.colors).map(n=>({id:n.id,name:n.name.trim(),hex:Qo(n.hex)||n.hex}))),e.fonts&&(t.fonts=on(e.fonts).map(n=>({id:n.id,name:n.name.trim(),source_url:n.source_url??"",source_kind:Cd(od(n)),file_name:n.file_name??"",family:n.family??"",weight:n.weight??"",style:n.style??"",preview_url:n.preview_url??"",storage_fallback:n.storage_fallback??!1,font_size_px:n.font_size_px??0,line_height_px:n.line_height_px??0}))),e.socials&&(t.socials=on(e.socials).map(n=>({id:n.id,name:n.name.trim(),url:n.url,icon_key:_d(n.icon_key),enabled:n.enabled}))),t},Li="ProjectBrandStyles",Qt=o.createApi({reducerPath:"projectSettingsStylesApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Li],endpoints:e=>({getProjectStyles:e.query({async queryFn({projectId:t},n){const r=o.v2ResultOf(await o.getClientV2(g.getContainer(n)).projects.stylesList({id:String(t)}));return"error"in r?{error:r.error}:{data:ji(r.data)}},providesTags:(t,n,{projectId:r})=>[{type:Li,id:String(r)}]}),updateProjectStyles:e.mutation({async queryFn({projectId:t,patch:n},r){const i=o.v2ResultOf(await o.getClientV2(g.getContainer(r)).projects.stylesPartialUpdate({id:String(t)},Td(n)));return"error"in i?{error:i.error}:{data:ji(i.data)}},async onQueryStarted({projectId:t,patch:n},{dispatch:r,queryFulfilled:i}){const a=r(Qt.util.updateQueryData("getProjectStyles",{projectId:t},c=>Object.assign(c,n)));try{const{data:c}=await i;r(Qt.util.upsertQueryData("getProjectStyles",{projectId:t},c))}catch{a.undo()}}}),uploadProjectFont:e.mutation({async queryFn({projectId:t,file:n},r){const i=new FormData;i.append("file",Jc(n));const a=o.v2ResultOf(await o.getClientV2(g.getContainer(r)).request({path:`/projects/${String(t)}/styles/fonts`,method:"POST",body:i,secure:!0,type:o.ContentType.FormData,format:"json"}));return"error"in a?{error:a.error}:{data:Ri(a.data)}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;n(Qt.util.updateQueryData("getProjectStyles",{projectId:t},a=>{a.fonts=a.fonts.some(c=>c.id===i.id)?a.fonts.map(c=>c.id===i.id?i:c):[...a.fonts,i],a.fonts.sort((c,d)=>c.order-d.order)}))}catch{}}})})}),{useGetProjectStylesQuery:Id,useUpdateProjectStylesMutation:Xb,useUploadProjectFontMutation:Jb}=Qt,Oi=e=>{const t=o.useIntegratorConfigValue("projectStyles"),{data:n}=Id({projectId:e},{skip:!0});return(0,l.useMemo)(()=>fd(t),[t])},Ad=2.5,xd=({atom:e,onSelect:t,onDragStart:n,isDroppedAtom:r})=>{const i=(0,l.useCallback)(d=>t(d,e),[t,e]),a=(0,l.useCallback)(d=>n(d,e,r),[n,e,r]),c=(0,l.useCallback)(d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t(d,e))},[t,e]);return(0,s.jsxs)("button",{type:"button",className:"ant-card-hoverable atoms__item "+e.className+(e.isLockedByPlan?" atoms__item_locked":""),draggable:!0,onClick:i,onKeyDown:c,onDragStart:a,"data-test-name":e.name,children:[(0,s.jsxs)("span",{className:"atom-image",children:[e.icon,e.isLockedByPlan&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:12,strokeWidth:Ad,className:"atom-image__lock"})]}),(0,s.jsx)("span",{className:"atom-title",children:e.title})]})},Mi=()=>{const e=o.useI18n(),{__:t}=e,n=o.useAppConfig(),r=o.useProjectData(),i=o.useCurrentUserLocale()||"ru_RU",a=xt.useSetHtmlAtomInIframeHandler(),c=xt.useDragStartAtomToIframeHandler(),[d,u]=(0,l.useState)(!1),[m,f]=(0,l.useState)(0),h=o.useMessageService(),_=o.useServices(g.ATOMS_HANDLERS_ID),p=o.useEventEmitter(g.HANDLE_ATOM_INSERT_ID),E=o.usePlanFeatureLocks(),k=Ei(r?.id),w=Oi(k),b=w?Wc(w.socials):[],x=b.length>0?yi(b):Pc;let P=[];if(n.elementImageEnabled&&P.push({title:t("Image"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementImage",component:y.icons$ElementImage,size:24,strokeWidth:n.iconStrokeWidth}),html:pc,className:"",name:"image"}),n.elementAIimageEnabled&&P.push({title:t("AI image"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementImageAI",component:y.icons$ElementImageAI,size:24,strokeWidth:n.iconStrokeWidth}),html:fc,className:"ai",name:"ai-image"}),n.elementTextEnabled&&P.push({title:t("Text"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementText",component:y.icons$ElementText,size:24,strokeWidth:n.iconStrokeWidth}),html:hc(e),className:"",name:"text"}),n.elementHeaderEnabled&&P.push({title:t("Header"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementTitle",component:y.icons$ElementTitle,size:24,strokeWidth:n.iconStrokeWidth}),html:gc(e),className:"",name:"header"}),n.elementButtonEnabled&&P.push({title:t("Button"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementButton",component:y.icons$ElementButton,size:24,strokeWidth:n.iconStrokeWidth}),html:yc(e),className:"",name:"button"}),n.elementSpacerEnabled&&P.push({title:t("Spacer"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementSpacer",component:y.icons$ElementSpacer,size:24,strokeWidth:n.iconStrokeWidth}),html:Ec,className:"",name:"spacer"}),n.elementListULEnabled&&P.push({title:t("List UL"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementListUL",component:y.icons$ElementListUL,size:24,strokeWidth:n.iconStrokeWidth}),html:_c(e),className:"",name:"list-ul"}),n.elementListOLEnabled&&P.push({title:t("List OL"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementListOL",component:y.icons$ElementListOL,size:24,strokeWidth:n.iconStrokeWidth}),html:bc(e),className:"",name:"list-ol"}),n.elementDividerEnabled&&P.push({title:t("Divider"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementDivider",component:y.icons$ElementDivider,size:24,strokeWidth:n.iconStrokeWidth}),html:vc,className:"",name:"divider"}),n.elementSocialEnabled&&P.push({title:t("Social media"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementSocial",component:y.icons$ElementSocial,size:24,strokeWidth:n.iconStrokeWidth}),html:x,className:"",name:"social"}),n.elementTableEnabled&&P.push({title:t("Table"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementTable",component:y.icons$ElementTable,size:24,strokeWidth:n.iconStrokeWidth}),html:Rc(e),className:"",name:"table"}),n.elementCountdownEnabled&&P.push({title:t("Countdown"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementCountdown",component:y.icons$ElementCountdown,size:24,strokeWidth:n.iconStrokeWidth}),html:Oc(i),className:"",name:"countdown"}),n.elementVideoEnabled&&P.push({title:t("Video"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementVideo",component:y.icons$ElementVideo,size:24,strokeWidth:n.iconStrokeWidth}),html:Mc,className:"",name:"video"}),n.elementCarouselEnabled&&P.push({title:t("Carousel"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementCarousel",component:y.icons$ElementCarousel,size:24,strokeWidth:n.iconStrokeWidth}),html:Nc(e),className:"amp",name:"amp-carousel"}),n.elementAccordionEnabled&&P.push({title:t("Accordion"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementAccordion",component:y.icons$ElementAccordion,size:24,strokeWidth:n.iconStrokeWidth}),html:Dc(e),className:"amp",name:"amp-accordion"}),n.elementFormEnabled&&P.push({title:t("Form"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementForm",component:y.icons$ElementForm,size:24,strokeWidth:n.iconStrokeWidth}),html:null,className:"amp",name:"amp-form"}),P=P.map(A=>({...A,fallbackTooltip:t("Coming soon"),planFeature:vi(A.name),isLockedByPlan:E(vi(A.name))})),_){const A={value:P};for(const L of _)L.execute(A);P=A.value}(0,l.useEffect)(()=>{const{dispose:A}=h.addListener(o.EVENT_TYPES.APPLICATION_ATOM_INSERTED,L=>{const z=P.find(B=>B.name===L);z&&p.fire(z)});return()=>A()},[h,P,p]);const Y=(0,l.useCallback)(A=>{u(!0),f(A.planFeature?o.FEATURE_UPSELL_SLIDE[A.planFeature]:1)},[]),J=(0,l.useCallback)(A=>A.isLockedByPlan?(setTimeout(()=>Y(A),1e3),!1):!0,[Y]),N=(0,l.useCallback)((A,L)=>{if(L.isLockedByPlan){Y(L);return}a(A,L)},[Y,a]),O=(0,l.useCallback)((A,L,z)=>{c(A,L,z)},[c]);return(0,s.jsxs)("div",{className:"atoms",children:[(0,s.jsx)("div",{className:"atoms__list",children:(0,s.jsx)(y.ui_kit$Space,{wrap:!0,style:{justifyContent:"space-between",rowGap:10},children:P&&P.map((A,L)=>A.html?(0,s.jsx)(xd,{atom:A,onSelect:N,onDragStart:O,isDroppedAtom:J},A.title+L.toString()):(0,s.jsx)(y.ui_kit$Tooltip,{title:A.fallbackTooltip||t("Coming soon"),placement:"top",children:(0,s.jsxs)("div",{className:"atoms__item atoms__item_inactive "+A.className,"data-test-name":A.name,children:[(0,s.jsx)("span",{className:"atom-image",children:A.icon}),(0,s.jsx)("span",{className:"atom-title",children:A.title})]},A.title+L.toString())},A.title+L.toString()))})}),(0,s.jsx)(o.PlanUpgradePrompt,{open:d,onCancel:()=>u(!1),initialSlide:m})]})};Mi.propTypes={};var Pd={full:{flexGrow:1},768:{width:171},425:{width:25},375:{width:28},320:{width:320}},Ni={right:-12,top:4,zIndex:999,padding:0,position:"absolute"},Rd=[{kind:"full",width:1200},{kind:"768",width:768},{kind:"425",width:425},{kind:"375",width:375},{kind:"320",width:320,showLabel:!0},{kind:"375",width:375},{kind:"425",width:425,control:"mobile"},{kind:"768",width:768,control:"desktop"},{kind:"full",width:1200}];function jd({kind:e,width:t,label:n,onSelect:r,onHover:i,children:a}){const c=(0,l.useCallback)(()=>i(e,n),[i,e,n]),d=(0,l.useCallback)(()=>i(null,""),[i]),u=(0,l.useCallback)(()=>r(t),[r,t]),m=(0,l.useCallback)(f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),r(t))},[r,t]);return(0,s.jsx)("div",{className:`device-width__${e}`,style:Pd[e],role:"button",tabIndex:0,"aria-label":n,onMouseEnter:c,onMouseLeave:d,onClick:u,onKeyDown:m,children:a})}function Ld({onSelectWidth:e,themeToggle:t}){const{__:n}=o.useI18n(),[r,i]=(0,l.useState)(""),[a,c]=(0,l.useState)(""),d={full:n("Desktop"),768:n("Small desktop – 768px"),425:n("Mobile L – 425px"),375:n("Mobile M – 375px"),320:n("Mobile S – 320px")},u=(0,l.useCallback)((m,f)=>{i(m?`device-width__${m}-hovered`:""),c(f)},[]);return(0,s.jsx)("div",{className:`email-pane__sizes ${r}`,children:(0,s.jsxs)("div",{className:"email-pane__width-selectors-wrapper",children:[(0,s.jsx)("div",{className:"device-width__theme",children:t}),Rd.map((m,f)=>(0,s.jsxs)(jd,{kind:m.kind,width:m.width,label:d[m.kind],onSelect:e,onHover:u,children:[m.showLabel?a:null,m.control==="mobile"&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Mobile view"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"default",icon:(0,s.jsx)(o.EmIcons,{icon:"MobileOutlined",component:y.icons$MobileOutlined,size:16,strokeWidth:2}),size:"small",shape:"circle",style:Ni})}),m.control==="desktop"&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Desktop view"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"default",icon:(0,s.jsx)(o.EmIcons,{icon:"DesktopOutlined",component:y.icons$DesktopOutlined,size:16,strokeWidth:2}),size:"small",shape:"circle",style:Ni})})]},`${m.kind}-${f}`)),(0,s.jsx)("div",{className:"device-width__theme-placeholder"})]})})}var Ue=zt.__toESM(o.require_prop_types()),Di=g.createIdentifier$1("canvas.resizerBinder"),Od=g.createIdentifier$1("canvas.service"),Zb={created:o.PHASES.canvasCreated,loaded:o.PHASES.canvasLoaded};function Md(e){return e.getInstance(Od)}function Fi(e){return{undo:()=>e.undo(),redo:()=>e.redo(),clear:()=>e.clear(),canUndo:()=>e.canUndo(),canRedo:()=>e.canRedo(),createSnapshot:()=>e.createSnapshot(),restoreSnapshot:t=>{e.restoreSnapshot(t)},getPast:t=>e.getPast(t).map(n=>({changes:n})),getFuture:t=>e.getFuture(t).map(n=>({changes:n}))}}var Nd={canUndo:!1,canRedo:!1},Dd={undo:()=>{},redo:()=>{},clear:()=>{},canUndo:()=>!1,canRedo:()=>!1,createSnapshot:()=>{},restoreSnapshot:()=>{},getPast:()=>[],getFuture:()=>[]};function Zo(e){const t=o.useDocumentSessionContext(),{history:n}=e??t;return(0,l.useMemo)(()=>n?Fi(n):Dd,[n])}function Fd(){const{history:e}=o.useDocumentSessionContext(),t=(0,l.useCallback)(i=>e?e.subscribe(i):()=>{},[e]),n=(0,l.useRef)(null),r=(0,l.useCallback)(()=>{if(!e)return Nd;const i={canUndo:e.canUndo(),canRedo:e.canRedo()},a=n.current;return a&&a.canUndo===i.canUndo&&a.canRedo===i.canRedo?a:(n.current=i,i)},[e]);return(0,l.useSyncExternalStore)(t,r)}var Bi=2e3,Bd=10,Ud="iframe_errors",$d=5;function zd(e){const{__:t}=o.useI18n(),n=o.useMessageService(),r=Zo(),{error:i}=o.useNotification(),{document:a}=o.useDocumentSessionContext(),c=(0,l.useCallback)(()=>a?.getContent()??"",[a]),d=(0,l.useRef)(0),u=(0,l.useRef)(void 0),m=(0,l.useRef)(!1),f=o.useCurrentUser(),h=(0,l.useCallback)(p=>new Promise((E,k)=>{const w=n.addListener(o.EVENT_TYPES.SANDBOX_READY,()=>{w.dispose(),E()});p&&setTimeout(()=>{w.dispose(),k("timeout")})}),[n]),_=(0,l.useCallback)(p=>{h(Bi).catch(E=>{}).finally(()=>{Promise.resolve().then(()=>{if(!m.current){if(++d.current){if(u.current){if(d.current<$d){r.restoreSnapshot(u.current);for(let E=0;E<d.current;E++)r.undo()}}else u.current=r.createSnapshot();n.send(o.EVENT_TYPES.RELOAD)}setTimeout(()=>{if(--d.current===0){u.current=null;const E=new Error(p.message);p.stack&&(E.stack=p.stack);const k=o.reportError(E,{origin:"iframe"}),w={past:r.getPast(Bd),future:r.getFuture(),errorResolved:!m.current,text:c(),message:p.message,stack:p.stack,userId:f?.id,entityId:e?.id,entityType:document.location.pathname.indexOf("emails")>0?"email":"block",sentryEventId:k};i({id:"IFRAME_ERROR",data:w,title:t("Something went wrong")}),g.RACS.post(Ud,w).catch(b=>{}),m.current=!1}},Bi)}})})},[r,c,i,f?.id,e?.id,t,h,n]);o.useListenPostMessage(o.EVENT_TYPES.APPLICATION_DOMPARSER_ERROR,_)}function Gd(e,t){const n=JSON.stringify(t??{});Wd(e?.get().attributes.common_styles,n)||o.writeEmailAttributes(e,{common_styles:n})}function Wd(e,t){if(e===t)return!0;try{return g.deepEqual(JSON.parse(e||"{}"),JSON.parse(t||"{}"))}catch{return!1}}var Wn=Symbol("isIframeEvent");function Hd({children:e}){const[t,n]=(0,l.useState)(),[r,i]=(0,l.useState)(),[a,c]=(0,l.useState)(!1),d=o.useMessageService();return(0,l.useEffect)(()=>{if(t){const u=d.addListener(o.EVENT_TYPES.APPLICATION_IFRAME_DRAG_EVENT,m=>{if(m.type!=="drageleave"&&m.type!=="dragenter"){const f=t.getBoundingClientRect(),h=m.clientX+f.x+window.scrollX,_=m.clientY+f.y+window.scrollY,p=document.elementFromPoint(h,_);if(p){const E=new DataTransfer,k=new DragEvent(m.type,{clientX:h,clientY:_,cancelable:!0,bubbles:!0,dataTransfer:E});k[Wn]=!0,p.dispatchEvent(k)}}});return()=>u.dispose()}},[d,t]),(0,l.useEffect)(()=>{const u=f=>{f[Wn]||c(!0)},m=f=>{f[Wn]||c(!1)};return window.addEventListener("dragstart",u),window.addEventListener("dragend",m),()=>{window.removeEventListener("dragstart",u),window.removeEventListener("dragend",m)}},[r]),(0,l.useEffect)(()=>{const u=m=>{if(!m[Wn]){const f=r.getBoundingClientRect();d.send(o.EVENT_TYPES.SANDBOX_DRAG_EVENT,{value:m.dataTransfer?.getData("Text")||"",type:m.type,clientX:m.pageX-f.x-window.scrollX,clientY:m.pageY-f.y-window.scrollY})}};if(r)return r.addEventListener("dragenter",u),r.addEventListener("dragover",u),r.addEventListener("dragleave",u),r.addEventListener("drop",u),r.addEventListener("dragend",u),()=>{r.removeEventListener("dragenter",u),r.removeEventListener("dragover",u),r.removeEventListener("dragleave",u),r.removeEventListener("drop",u),r.removeEventListener("dragend",u)}},[r,d]),(0,s.jsxs)("div",{ref:n,children:[a&&(0,s.jsx)("div",{ref:i,className:"iframe-provider"}),e]})}var qd=["colorBgBase","colorBgElevated","colorError","colorInfo","colorInfoBg","colorInfoBgHover","colorInfoBorder","colorInfoBorderHover","colorLink","colorPrimary","colorPrimaryBg","colorPrimaryBgHover","colorPrimaryBorder","colorPrimaryBorderHover"];function Vd(e){const t={};for(const n of qd){const r=e[n];typeof r=="string"&&(t[n]=r)}return t}function er(e,t){const n=o.useMessageService(),r=t?.async??!1;(0,l.useEffect)(()=>{const i=r?n.addListenerAsync(o.EVENT_TYPES.RELOAD,e):n.addListener(o.EVENT_TYPES.RELOAD,e);return()=>i.dispose()},[n,e,r]),(0,l.useEffect)(()=>{},[e])}function Yd(){const e=o.useMessageService(),{token:t}=(0,y.ui_kit$useToken)(),[n,r]=(0,l.useState)();(0,l.useEffect)(()=>{if(!g.deepEqual(n,t)){const a=e.onInit(()=>{e.send(o.EVENT_TYPES.SANDBOX_SET_THEME_VARIABLES,Vd(t)),r(t)});return()=>a.dispose()}},[t,n,r,e]);const i=(0,l.useCallback)(()=>{r(void 0)},[]);er(i)}var Kd={minHeight:600},Qd="#pane-content-wrapper, .email-pane__col_preview, .preview-mode__pane-content";function Ui(e){e?.current?.resize?.()}var $i=(0,l.forwardRef)(({className:e=null,email:t=null,handlerSendPosition:n=()=>{},surface:r,clip:i=null},a)=>{const c=o.useAppConfig(),d=o.useContainer(),u=r??(t?.hasOwnProperty("type")?"block":"email"),m=(0,l.useMemo)(()=>Md(d),[d]),f=(0,l.useMemo)(()=>m?.current(u),[m,u]),h=(0,l.useRef)(null),_=(0,l.useCallback)(()=>{o.mark(o.PHASES.canvasLoaded),Ui(a),n()},[n,a]);(0,l.useImperativeHandle)(a,()=>({getIframeElement:()=>m?.current(u)?.element,resize:()=>m?.current(u)?.resize()}),[m,u]),(0,l.useEffect)(()=>{if(!m)return;const w=h.current,b=i??w?.closest(Qd)??null;return m.alignSurface(u,w,b),()=>m.alignSurface(u,null)},[m,u,i,c.sidePanelFloating]);const p=(0,l.useRef)(_);p.current=_,(0,l.useEffect)(()=>{if(!f)return;let w=!1;const b=()=>{w||p.current({target:f.element})};return f.ready().then(b).catch(()=>{window.requestAnimationFrame(()=>{w||f.ready().then(b).catch(()=>{})})}),()=>{w=!0}},[f]),Yd(),zd(t);const{document:E}=o.useDocumentSessionContext();(0,l.useEffect)(()=>{const w=o.subscribeToContent(E,()=>{Ui(a)});return()=>w.dispose()},[E,a]);const k=(0,l.useCallback)(w=>{const{operation:b,settings:x}=w.data;b===o.EVENT_TYPES.APPLICATION_COMMON_STYLES_UPDATE&&Gd(E,x?.commonStyles)},[E]);return o.useListenPostMessage(k),(0,s.jsx)(Hd,{children:(0,s.jsx)("div",{ref:h,className:(0,ot.default)("email-preview",e),id:"email_iframe_slot",style:Kd})})});$i.propTypes={className:Ue.default.string,surface:Ue.default.oneOf(["email","block","preview"]),email:Ue.default.shape({html:Ue.default.string}),handlerSendPosition:Ue.default.func,clip:Ue.default.object};var tr=new Map,Xd=new Map;function Jd(e,t){e.set(t,(e.get(t)??0)+1)}function Zd(e,t){const n=e.get(t)??0;n<=1?e.delete(t):e.set(t,n-1)}function zi(e,t){return(e.get(t)??0)>0}function eu(e){return zi(tr,e)||zi(Xd,e)}function tu(e){Jd(tr,e);let t=!1;return{dispose(){t||(t=!0,nu(e))}}}function nu(e){Zd(tr,e)}function ou(e,t){return iu([...e.changes].sort((n,r)=>n.rangeOffset-r.rangeOffset).map(n=>({start:n.rangeOffset,end:n.rangeOffset+n.rangeLength,text:n.text})),t)}function ru(e,t){return e.map(n=>{const r=t.getPositionAt(n.oldPosition),i=t.getPositionAt(n.oldEnd);return{text:n.newText,range:{startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:i.lineNumber,endColumn:i.column}}})}function iu(e,t){let n=0;return e.map(({start:r,end:i,text:a})=>{const c=new o.TextChange(r,t.slice(r,i),r+n,a);return n+=a.length-(i-r),c})}var Gi=new WeakMap;function au(e){const t=Gi.get(e);if(t)return t;const n=Fl(e);return Gi.set(e,n),n}var Wi="monaco";function su(e,t){(0,l.useEffect)(()=>{if(!e||!t)return;const n=au(e);let r=!1;const i=d=>{r=!0;const u=tu(t);try{d()}finally{u.dispose(),r=!1}},a=n.attach({id:Wi,apply(d){return t.getValue()!==d&&i(()=>t.setValue(d)),Promise.resolve()},applyChanges(d){return i(()=>t.applyEdits(ru(d,t))),Promise.resolve()}}),c=t.onDidChangeContent(d=>{if(r)return;const u=eu(t)?"remote":"user";n.mutateFrom(Wi,{changes:ou(d,e.getContent())},{source:u})});return()=>{a.detach(),c.dispose()}},[e,t])}function lu(e,t){const[n,r]=(0,l.useState)(void 0),i=(0,l.useRef)(!1),{error:a}=o.useNotification(),{__:c}=o.useI18n(),d=(0,l.useRef)(t);d.current=t;const u=(0,l.useRef)({error:a,__:c});u.current={error:a,__:c},(0,l.useEffect)(()=>{if(!e||n||i.current)return;i.current=!0;let f=!1;return d.current().then(h=>{if(f){h.dispose();return}r(h)}).catch(()=>{const{error:h,__:_}=u.current;h({id:"CODE_EDITOR_LOAD_FAILED",title:_("Failed to load the code editor")})}).finally(()=>{i.current=!1}),()=>{f=!0}},[e,n]);const m=(0,l.useRef)(void 0);return m.current=n,(0,l.useEffect)(()=>()=>{m.current?.dispose()},[]),n}var Hn;function nr(){return Hn===void 0&&(Hn=(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/a215213f.js")),void 0,{}.url).catch(e=>{throw Hn=void 0,e})),Hn}function cu(){return nr().then(e=>e.ensureMonaco())}var du=o.lazyRoute(()=>nr().then(e=>({default:e.MonacoEditor}))),uu=()=>nr().then(e=>e.loadEditorModel()),mu={height:"100%"};function pu(e){const t=lu(!0,uu),{document:n}=o.useDocumentSessionContext();return(0,l.useEffect)(()=>{},[]),(0,l.useEffect)(()=>{},[t]),su(n,t),(0,s.jsx)(o.EditorModelContext.Provider,{value:t,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$Flex,{justify:"center",align:"center",style:mu,children:(0,s.jsx)(y.ui_kit$Spin,{size:"large"})}),children:(0,s.jsx)(du,{...e})})})}var fu=({elementPath:e})=>{const{_x:t}=o.useI18n(),n=o.useDispatch(),r=o.useMessageService(),i=o.useAppConfig(),{blockId:a}=o.useRouteParams(),c=o.useEditorProjectId(),d=o.useRouteEmailId(),u=o.useProjectData(),m=o.usePushToDataLayer(),f=(0,l.useCallback)(x=>{r.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_SET,index:x})},[r]),h=(0,l.useCallback)(x=>{let P="element";x?.target?.closest("svg")||x?.target?.closest(".anticon")||x?.target?.closest('[class*="icon"]')?P="icon":x?.target?.textContent&&!x?.target?.closest("svg")&&!x?.target?.closest(".anticon")&&(P="text"),n(o.setActiveSettingsTab(o.STYLES)),r.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),r.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),m({event:"click",action:"click_breadcrumb_email",email_id:d||a,project_id:u?.id||c,click_target:P})},[r,n,m,d,a,c,u]),_={title:(0,s.jsxs)("span",{onClick:h,children:[(0,s.jsx)(o.EmIcons,{icon:"Email",component:y.icons$Email,size:16,strokeWidth:i.iconStrokeWidth})," ",t("Email","letter")]})},[p,E]=(0,l.useState)([_]),k=(0,l.useCallback)(x=>{r.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_HOVER_SET,index:x})},[r]),w=x=>{if(x.includes("em-element-path-item-text"))return(0,s.jsx)(o.EmIcons,{icon:"ElementText",component:y.icons$ElementText,size:16,strokeWidth:i.iconStrokeWidth});if(x.includes("em-element-path-item-image"))return(0,s.jsx)(o.EmIcons,{icon:"ElementImage",component:y.icons$ElementImage,size:16,strokeWidth:i.iconStrokeWidth});if(x.includes("em-element-path-item-link"))return(0,s.jsx)(o.EmIcons,{icon:"LinkOutlined",component:y.icons$LinkOutlined,size:16,strokeWidth:i.iconStrokeWidth});if(x.includes("em-element-path-item-atom"))return(0,s.jsx)(o.EmIcons,{icon:"Atom",component:y.icons$Atom,size:16,strokeWidth:i.iconStrokeWidth});if(x.includes("em-element-path-item-column"))return(0,s.jsx)(o.EmIcons,{icon:"Column",component:y.icons$Column,size:16,strokeWidth:i.iconStrokeWidth});if(x.includes("em-element-path-item-block"))return(0,s.jsx)(o.EmIcons,{icon:"Block",component:y.icons$Block,size:16,strokeWidth:i.iconStrokeWidth});if(x.includes("em-element-path-item-group"))return(0,s.jsx)(o.EmIcons,{icon:"Group",component:y.icons$Group,size:16,strokeWidth:i.iconStrokeWidth});if(x.includes("em-element-path-item-button"))return(0,s.jsx)(o.EmIcons,{icon:"ElementButton",component:y.icons$ElementButton,size:16,strokeWidth:i.iconStrokeWidth});if(x.includes("em-element-path-item-table"))return(0,s.jsx)(o.EmIcons,{icon:"ElementTable",component:y.icons$ElementTable,size:16,strokeWidth:i.iconStrokeWidth});if(x.includes("em-element-path-item-amp"))return(0,s.jsx)(o.EmIcons,{icon:"AMP",component:y.icons$AMP,size:16,strokeWidth:i.iconStrokeWidth})},b=(0,l.useCallback)((x,P)=>{const Y=J=>{let N="element";J.target.closest("svg")||J.target.closest(".anticon")||J.target.closest('[class*="icon"]')?N="icon":J.target.textContent&&!J.target.closest("svg")&&!J.target.closest(".anticon")&&(N="text");const O=e?.[P],A=O?.className?.replace("em-element-path-item-","")||"unknown";m({event:"click",action:"click_breadcrumb_element",email_id:d||a,project_id:u?.id||c,element_type:A,element_index:P,element_title:O?.title||"",click_target:N}),f(P)};return(0,s.jsxs)("span",{className:x.className,onClick:Y,onMouseOver:()=>{k(P)},children:[w(x.className)," ",x.title]})},[f,k,e,m,d,a,c,u]);return(0,l.useEffect)(()=>{if(e){const x=e.map((P,Y)=>({title:b(P,Y)}));E([{title:(0,s.jsxs)("span",{onClick:h,children:[(0,s.jsx)(o.EmIcons,{icon:"Email",component:y.icons$Email,size:16,strokeWidth:i.iconStrokeWidth})," ",t("Email","letter")]})},...x])}},[e,b,h,t]),(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(y.ui_kit$Breadcrumb,{items:p,type:"separator",separator:""})})};function hu(){const{document:e}=o.useDocumentSessionContext(),t=(0,l.useCallback)(r=>e?e.subscribe(r):()=>{},[e]),n=(0,l.useCallback)(()=>e?.getContent()??"",[e]);return(0,l.useSyncExternalStore)(t,n)}var gu=({fallbackHtml:e})=>{const{__:t}=o.useI18n(),n=hu(),r=(0,l.useMemo)(()=>o.getCodeSize(n||e||""),[e,n]),i=o.formatCodeSize(r),a=o.isCodeSizeExceeded(r);return(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:t(a?"The code size exceeds the recommended value 90kB":"Code size"),children:(0,s.jsx)("span",{className:(0,ot.default)("email-pane__code-size",{"email-pane__code-size_exceeded":a}),children:i})})};function Hi(e){const{limits:t,isLoaded:n}=o.useProjectPlanLimits();return o.useProjectData(),(0,l.useMemo)(()=>({isLocked:!1,state:{state:"allowed"},isPlanDataReady:n,exceeded:null}),[!1,e,t,n])}var yu=({open:e,onClose:t})=>{const{__:n}=o.useI18n();return(0,s.jsxs)(y.ui_kit$Modal,{open:e,centered:!0,closable:!1,mask:{closable:!1},footer:null,width:520,className:"browser-extension-warning-modal",title:n("Browser extension detected"),onCancel:t,children:[(0,s.jsx)("p",{children:n("A browser extension (for example, Urban VPN Proxy or similar ad blockers/VPN tools) is injecting code into the email preview. This can corrupt your template when saving.")}),(0,s.jsx)("p",{children:n("We removed the injected code automatically. To avoid this issue, disable the extension for this site or use the editor in an incognito window without extensions.")}),(0,s.jsx)("div",{className:"browser-extension-warning-modal__footer",children:(0,s.jsxs)(y.ui_kit$Button,{type:"primary",onClick:t,children:[n("Got it")," "]})})]})},_u={closable:!1},bu=({open:e,onClose:t})=>{const{__:n}=o.useI18n();return(0,s.jsxs)(y.ui_kit$Modal,{open:e,centered:!0,closable:!1,mask:_u,footer:null,width:520,className:"browser-translate-warning-modal",title:n("Browser translation detected"),children:[(0,s.jsx)("p",{children:n("Browser page translation (for example, Google Translate) is active. It can break the editor and cause errors when saving.")}),(0,s.jsx)("p",{children:n("To avoid this issue, disable translation for this site in your browser settings or turn off auto-translate.")}),(0,s.jsx)("div",{className:"browser-translate-warning-modal__footer",children:(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:t,children:n("Got it")})})]})},vu=g.createIdentifier$1("prewarm.editorVisible");function Eu(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function Su(e={}){const t=e.paint??Eu;let n=!1,r=!1,i=!1,a=!1,c=!1;const d=[],u=()=>{c||a||!n||!r||!i||(a=!0,t(()=>{c=!0,o.mark(o.PHASES.editorVisible);for(const m of d.splice(0))m()}))};return{noteShellVisible(){n=!0,u()},notePagePainted(){r=!0,u()},noteContentShown(){i=!0,u()},whenVisible(m){if(c){m();return}d.push(m)},contentShown:()=>i}}function Ht(e){return e.getOrCreateInstance(vu,()=>Su())}function kn(e){const t=(0,l.useRef)(!1);return e&&(t.current=!0),t.current}var qi=4e3;function Xt(e){const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:qi});return}window.setTimeout(e,qi)}var qn,or;function rr(){return qn===void 0&&(qn=(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/a6fed2cf.js")).then(e=>e.panels_exports).then(e=>(or=e,e),e=>{throw qn=void 0,e}),void 0,{}.url)),qn}function wu(e){(0,l.useEffect)(()=>{Ht(e).whenVisible(()=>{Xt(()=>{rr().catch(()=>{})})})},[e])}function ut(e){const t=o.lazyRoute(()=>rr().then(r=>({default:r[e]})),"panels");function n(r){const[i]=(0,l.useState)(()=>or?or[e]:t);return(0,l.createElement)(i,r)}return n.displayName=`PanelDoor(${String(e)})`,n}var Vi=ut("EmailProperties"),ku=ut("SelectedElementPanel"),Cu=ut("EmailSettings"),Tu=ut("EmailStyles"),Iu=ut("DiscussAi"),Au=ut("Optimise"),xu=ut("FileManagerDataLayer"),Pu=ut("BlocksSearch"),Ru=ut("Discuss"),ju=ut("HistoryPanel"),Lu=ut("AddNewBlockModal"),Ou=ut("AddAllBlocksModal"),Mu=ut("SendTestEmailModal"),Nu=ut("SaveBlockBtn"),ir=ut("LimitUpgradeModal"),Du={height:"100%"},Fu=()=>{const e=o.useContainer(),t=o.isImageCenterModal(o.useSelector(o.selectActiveModal$1)),[n,r]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{e&&Ht(e).whenVisible(()=>r(!0))},[e]),kn(n||t)?(0,s.jsx)(l.Suspense,{fallback:t?(0,s.jsx)(y.ui_kit$PageLoader,{style:Du}):null,children:(0,s.jsx)(xu,{})}):null},Vn;function Bu(){return Vn===void 0&&(Vn=(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/ef34ebcd.js")),void 0,{}.url).catch(e=>{throw Vn=void 0,e})),Vn}function Cn(e){return o.lazyRoute(()=>Bu().then(t=>({default:t[e]})),"form-panels")}var ev=Cn("FormEditorCalendarPanel"),tv=Cn("FormEditorCheckboxPanel"),nv=Cn("FormEditorDropdownListPanel"),ov=Cn("FormEditorInputPanel"),rv=Cn("FormEditorRadioPanel");function Uu(){try{const e=new URLSearchParams(window.location.search).get("deferChrome");return e===null?void 0:e!=="0"&&e!=="false"}catch{return}}function $u(e,t){const n=Uu()??o.readLocalToggle(o.LOCAL_STORAGE_ITEMS.em_defer_chrome);if(n!==void 0)return n;const r=t?.deferEditorChrome;return typeof r=="boolean"?r:r&&typeof r=="object"?r[e]??!0:{}.REACT_APP_DEFER_EDITOR_CHROME_DEFAULT!=="false"}function Yi(e){const t=o.useAppConfig(),[n,r]=(0,l.useState)(()=>!$u(e,t));return(0,l.useEffect)(()=>{if(n)return;let i=0;const a=window.requestAnimationFrame(()=>{i=window.requestAnimationFrame(()=>(0,l.startTransition)(()=>r(!0)))});return()=>{window.cancelAnimationFrame(a),window.cancelAnimationFrame(i)}},[n]),n}var Ki=o.createState({blocksTotal:null,blocksTotalPages:null,parentEmailBlocksTotal:null,parentEmailBlocksTotalPages:null,templateBlocks:[],templateBlocksTotal:null,templateBlocksTotalPages:null,elementsView:o.CARDS,elementsList:[],customFolders:{},blocksTrashTotal:0,elementsTrashList:[]}),Yn="blocksPageSlice",ar=o.createSlice({name:Yn,initialState:Ki,reducers:{resetPagesAndTotal:()=>Ki,resetElementsList:e=>{e.elementsList=[]},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeBlockFromList:(e,{payload:t})=>{const n=e.customFolders;t.folder!=="all"&&n[t.folder]?.list&&(n[t.folder]={...n[t.folder],list:n[t.folder].list.filter(r=>r.id!==t.emailId),total:n[t.folder].total-1},e.customFolders=n)}},extraReducers:e=>{e.addMatcher(o.blocksApi.endpoints.getBlocks.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||r?.length,a=n.arg.originalArgs?.status==="trash",c=!!n.arg.originalArgs?.name?.length,d=n.arg.originalArgs?.page,u=n.arg.originalArgs?.folderTag||n.arg.originalArgs?.tags?.[0];a?(c||(t.blocksTrashTotal=i),t.elementsTrashList=r):u?t.customFolders={...t.customFolders,[u]:{list:r,page:d,total:i}}:(t.blocksTotal=i,t.elementsList=r)}),e.addMatcher(o.blocksApi.endpoints.getParentEmailBlocks.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||r?.length||null,a=n.baseQueryMeta?.response.headers.get("X-WP-TotalPages");t.parentEmailBlocksTotal=i,t.parentEmailBlocksTotalPages=a}),e.addMatcher(o.blocksApi.endpoints.getTemplateBlocks.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||r?.length||null,a=n.baseQueryMeta?.response.headers.get("X-WP-TotalPages");t.templateBlocks=r,t.templateBlocksTotal=i,t.templateBlocksTotalPages=a}),e.addMatcher(o.blocksApi.endpoints.editBlock.matchFulfilled,(t,{payload:n})=>{t.elementsList.map(r=>r.id?.toString()===n.id?.toString()?Object.assign(r,{lock:n.lock,title:n.title,blocktags:n.blocktags}):r)})}}),{resetPagesAndTotal:iv,resetElementsList:av,toggleElementsView:sv,removeBlockFromList:lv}=ar.actions,zu=e=>e[Yn].blocksTotal,Gu=e=>e[Yn].templateBlocksTotal,Wu=e=>e[Yn].parentEmailBlocksTotal,Hu=class extends Error{label;timeoutMs;constructor(e){super(`[sandbox:ready] iframe handshake timed out after ${e}ms`),this.name="SandboxReadyTimeoutError",this.label="sandbox:ready",this.timeoutMs=e}};function Qi(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.isInited=="function"&&typeof t.getTarget=="function"&&typeof t.onInit=="function"}function Xi(e,t,n){return e.isInited()&&e.getTarget()?Promise.resolve():(g.throwIfAborted(n),new Promise((r,i)=>{let a=!1,c,d;const u=f=>{a||(a=!0,c!==void 0&&(clearTimeout(c),c=void 0),d?.dispose(),n?.removeEventListener("abort",m),f())},m=()=>{u(()=>i(g.createAbortError(n?.reason)))};if(d=e.onInit(()=>{e.isInited()&&e.getTarget()&&u(()=>r())}),e.isInited()&&e.getTarget()){u(()=>r());return}t>0&&(c=setTimeout(()=>{u(()=>i(new Hu(t)))},t)),n?.addEventListener("abort",m)}))}var qu=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},Tn=(e,t)=>{qu()},Vu=e=>[...e].sort((t,n)=>t.order-n.order).map(t=>t.hex.toUpperCase()),Yu=(e,t)=>{const n=Array.isArray(e?.usedColors)?e.usedColors:[],r=new Set,i=[];for(const a of[...n,...Vu(t)]){const c=String(a??"").trim().toUpperCase();!c||r.has(c)||(r.add(c),i.push(a))}return{...e,usedColors:i}},Ji,Ku=e=>{Ji=e},Kn=e=>Yu(e,Ji?.colors??[]),Qu=e=>{const t=o.useMessageService(),n=Oi(e),[r,i]=(0,l.useState)("");(0,l.useEffect)(()=>{Ku(n);const c=n?.fonts??[];o.setCachedProjectFonts(c),ld(c),Tn("parent: cache + host @font-face synced",{projectId:e,fontsCount:c.length,families:c.map(d=>d.family?.trim()||d.name)})},[n,e]),(0,l.useEffect)(()=>{const c=n?.fonts??[],d=td(c),u=JSON.stringify(d);if(u===r){Tn("parent: iframe send skipped (unchanged)",{entriesCount:d.length});return}Tn("parent: scheduling SANDBOX_SET_PROJECT_FONTS",{entriesCount:d.length,entries:d});const m=()=>{t.send(o.EVENT_TYPES.SANDBOX_SET_PROJECT_FONTS,d),i(u),Tn("parent: SANDBOX_SET_PROJECT_FONTS sent",{entriesCount:d.length})};if(t.inited){m();return}const f=t.onInit(()=>{m()});return()=>f.dispose()},[t,n,r]);const a=(0,l.useCallback)(()=>{Tn("parent: iframe reload — will resend project fonts map"),i("")},[]);er(a)};function Xu(e,t){const n=e,r=n?.data?.operation!==void 0?n.data:n;if(r?.operation===t)return r.file instanceof File?r.file:void 0}async function Ju(e,t){const{userId:n,folderId:r}=t.readContext();if(n==null||r==null||r==="")return{status:"skipped"};try{const i=await t.prepare(e),a=await t.upload({user_id:n,folder:String(r),file:i});if(a.error)return{status:"failed",error:a.error};const{extractUploadResult:c}=await(0,Ve.__vitePreload)(async()=>{const{extractUploadResult:u}=await Promise.resolve().then(()=>_e("./static/core/424385ee.js")).then(m=>m.import_exports);return{extractUploadResult:u}},void 0,{}.url),d=c(a.data);return d.error||!d.file_url?{status:"skipped"}:{status:"uploaded",url:d.file_url}}catch(i){return{status:"failed",error:i}}}function Zu(){const[e,t]=(0,l.useState)(!1),n=o.useHeadless(),r=o.useEventEmitter(g.events.ON_BROWSER_EXTENSION_DETECTED_ID),i=(0,l.useCallback)(()=>{t(!1)},[]);return(0,l.useEffect)(()=>{const a=r.event(()=>{n||t(!0)});return()=>a.dispose()},[r,n]),{open:e,close:i}}function em(){const[e,t]=(0,l.useState)(!1),n=o.useHeadless(),r=o.useEventEmitter(g.events.ON_BROWSER_TRANSLATE_DETECTED_ID),i=(0,l.useCallback)(()=>{t(!1)},[]);return(0,l.useEffect)(()=>{const a=r.event(()=>{n||t(!0)});return()=>a.dispose()},[r,n]),{open:e,close:i}}var tm=["translated-ltr","translated-rtl"],nm=".goog-te-banner-frame",sr=!1;function om(e){if(e)return e;if(!(typeof document>"u"))return document}function rm(e){const t=om(e);if(!t?.documentElement)return!1;const n=t.documentElement.classList;return tm.some(r=>n.contains(r))?!0:t.querySelector(nm)!=null}function im(){sr=!1}function am(e){const t=rm();return t&&!sr&&e(),sr=t,t}var sm=500;function lm(){const e=o.useEventEmitter(g.events.ON_BROWSER_TRANSLATE_DETECTED_ID),t=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(typeof window>"u")return;const n=()=>{am(()=>{e.fire()})},r=()=>{t.current!=null&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,n()},sm)};n();const i=()=>{r()},a=()=>{document.visibilityState==="visible"&&r()},c=new MutationObserver(()=>{r()});return c.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("focus",i),document.addEventListener("visibilitychange",a),()=>{t.current!=null&&clearTimeout(t.current),im(),c.disconnect(),window.removeEventListener("focus",i),document.removeEventListener("visibilitychange",a)}},[e])}var lr={},Zi=(0,l.createContext)(lr),ea=(0,l.createContext)({current:lr}),ta=(0,l.createContext)(()=>{});function cm({children:e}){const t=o.useDispatch(),n=o.useSelector(o.selectActiveSettingsTab),r=o.useEvent(g.SETTINGS_PANEL_EVENT),[i,a]=(0,l.useState)(lr),c=(0,l.useRef)(i);return c.current=i,(0,l.useEffect)(()=>{const d=r(u=>{const m=u?.type===g.ADVANCED_SETTINGS_PANEL;if((!u||!u.type&&!u.content&&!u.advancedTabs?.length)&&n==="Properties")a({}),t(o.resetToLastActiveSettingsTab());else if(n!=="Properties"&&t(o.setActiveSettingsTab(o.PROPERTIES)),u.advancedTabs?.length&&!m&&!u.content){const f=u.advancedTabs.map(h=>({content:h.content,label:h.label,key:h.key,className:h.className}));a(h=>({settings:{},extraTabs:f}))}else if(m&&u.content){const f=u.advancedTabs?.map(h=>({content:h.content,label:h.label,key:h.key,className:h.className}));a(h=>({settings:{},type:u.type,content:u.content,instanceKey:u.instanceKey,parent:u.parent,caption:u.caption,extraTabs:f,deletable:u.deletable}))}});return()=>d.dispose()},[r,a,t,n]),(0,s.jsx)(ta.Provider,{value:a,children:(0,s.jsx)(ea.Provider,{value:c,children:(0,s.jsx)(Zi.Provider,{value:i,children:e})})})}function cr(){return(0,l.useContext)(Zi)}function dm(){return(0,l.useContext)(ea)}function um(){return(0,l.useContext)(ta)}var na={widthCodeSplit:50,isResizing:!1,currentSide:null},oa=(0,l.createContext)({current:na}),ra=(0,l.createContext)(na.widthCodeSplit),ia=(0,l.createContext)({isResizing:!1,currentSide:null}),aa=(0,l.createContext)({setWidthCodeSplit:()=>{},setIsResizing:()=>{},setCurrentSide:()=>{},setBlockMaxHeight:()=>{}}),sa=(0,l.createContext)("unset");function mm({children:e}){const[t,n]=(0,l.useState)(()=>+window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_code_mode_pane_sizes)||50),[r,i]=(0,l.useState)(!1),[a,c]=(0,l.useState)(null),[d,u]=(0,l.useState)("unset"),m=(0,l.useMemo)(()=>({widthCodeSplit:t,isResizing:r,currentSide:a}),[t,r,a]),f=(0,l.useMemo)(()=>({isResizing:r,currentSide:a}),[r,a]),h=(0,l.useRef)(m);h.current=m;const _=(0,l.useMemo)(()=>({setWidthCodeSplit:n,setIsResizing:i,setCurrentSide:c,setBlockMaxHeight:u}),[]);return(0,s.jsx)(aa.Provider,{value:_,children:(0,s.jsx)(oa.Provider,{value:h,children:(0,s.jsx)(ia.Provider,{value:f,children:(0,s.jsx)(ra.Provider,{value:t,children:(0,s.jsx)(sa.Provider,{value:d,children:e})})})})})}function la(){return(0,l.useContext)(ia)}function ca(){return(0,l.useContext)(ra)}function pm(){return(0,l.useContext)(oa)}function fm(){return(0,l.useContext)(sa)}function hm(){return(0,l.useContext)(aa)}var da=(0,l.createContext)({previewAlertShow:!1,templateNotEmAlertShow:!1}),ua=(0,l.createContext)({setPreviewAlertShow:()=>{},setTemplateNotEmAlertShow:()=>{}});function gm({children:e}){const[t,n]=(0,l.useState)(!1),[r,i]=(0,l.useState)(!1),a=(0,l.useMemo)(()=>({previewAlertShow:t,templateNotEmAlertShow:r}),[t,r]),c=(0,l.useMemo)(()=>({setPreviewAlertShow:n,setTemplateNotEmAlertShow:i}),[]);return(0,s.jsx)(ua.Provider,{value:c,children:(0,s.jsx)(da.Provider,{value:a,children:e})})}function ym(){return(0,l.useContext)(da)}function _m(){return(0,l.useContext)(ua)}function bm({className:e,sidePanelFloating:t,isCodeMode:n,codeModeDirection:r,children:i}){const a=fm(),c=(0,l.useMemo)(()=>{const d=Number.isFinite(a)?`${a}px`:"unset";return{"--em-pane-block-height":t?n&&r==="bottom"?d:"calc(100% - 30px)":"100%"}},[t,n,r,a]);return(0,s.jsx)(y.ui_kit$Layout,{className:e,style:c,children:i})}function vm({maxPaneWidth:e,isCodeMode:t,codeModeDirection:n,isShowMobileSettings:r,desktopMobileSwitchPanel:i,children:a}){const c=o.useSelector(o.selectEmailWidth),{isResizing:d,currentSide:u}=la(),m=t&&n!=="bottom"&&!r&&i?"100%":c,f=(0,l.useMemo)(()=>({maxWidth:typeof m=="number"?Math.min(m,e):e}),[m,e]);return(0,s.jsx)("div",{className:(0,ot.default)("email-pane__resizable",{"email-pane__resizable_drag":u||d}),style:f,children:a})}function Em({isCodeMode:e,codeModeDirection:t,sidePanelFloating:n,contentWrapperRef:r,children:i}){const a=ca(),c=(0,l.useMemo)(()=>({flexGrow:1,overflowY:n?"scroll":"hidden",overflowX:"hidden",height:e&&t==="bottom"?`calc(${a}%)`:"100%",width:`${t==="left"?100-a:t==="bottom"?100:a}%`}),[e,t,n,a]);return(0,s.jsx)(y.ui_kit$Col,{style:c,id:"pane-content-wrapper",ref:r,children:i})}function Sm({isCodeMode:e,codeModeDirection:t,children:n}){const r=ca(),i=(0,l.useMemo)(()=>({width:`${t==="right"?100-r:t==="bottom"?100:r}%`,position:"relative",height:t==="bottom"?`calc(${100-r}%)`:"unset",display:e?"initial":"none"}),[e,t,r]);return(0,s.jsx)(y.ui_kit$Col,{style:i,children:n})}function wm({wrapperRef:e,children:t}){const{isResizing:n,currentSide:r}=la();return(0,s.jsx)("div",{className:(0,ot.default)("email-pane__content-col email-pane__content-col_main",{"email-pane__content-col_disable":r||n}),ref:e,children:t})}function km({isShowMobileSettings:e,headless:t,templateNotEmAlertEnabled:n}){const{__:r}=o.useI18n(),{previewAlertShow:i,templateNotEmAlertShow:a}=ym();return(0,s.jsxs)(s.Fragment,{children:[i&&e&&(0,s.jsx)(y.ui_kit$Alert,{title:r("Template is not mobile-friendly"),description:r("While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices."),type:"warning",className:"email-pane__col__alert",closable:!0}),a&&!t&&n&&(0,s.jsx)(y.ui_kit$Alert,{title:r("Template from another editor"),description:r("This template was created in another editor. Rebuild it from our components to get stable rendering, error-free editing, and full design control."),type:"warning",className:"email-pane__col__alert",closable:!0})]})}function ma(){const e=o.useElementEntityKind(),t=o.useSelector(o.selectElementSettings$1),n=o.useSelector(o.selectElementSettings);return e==="email"?t:n}function Cm({isShowMobileSettings:e,propertiesPanelKey:t,onMouseLeave:n,email:r,onClosePanel:i}){const a=ma(),c=cr();return a?.type||c?.type||c?.content||c?.extraTabs?.length?(0,s.jsx)("div",{className:(0,ot.default)("email-pane__collapse-wrapper",{"mobile-view":e,"mobile-properties":e&&t!=="Structure"}),onMouseLeave:n,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Vi,{email:r,formSettings:c,onClosePanel:i})})}):null}function Tm({className:e,emailElementType:t}){return(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(ku,{className:e,emailElementType:t,formSettings:cr()})})}function Im({isCodeMode:e,codeModeDirection:t}){const n=o.useElementEntityKind(),r=ma()?.type;return!(r===o.ELEMENT_TYPES.TEXT||r===o.ELEMENT_TYPES.LINK||r===o.ELEMENT_TYPES.IMG||r===o.ELEMENT_TYPES.BUTTON)||!e||t==="bottom"?null:(0,s.jsx)(Tm,{className:(0,ot.default)("selected-element-panel__content selected-element-panel__content_abs",{"selected-element-panel__hidden":r===o.ELEMENT_TYPES.IMG}),emailElementType:n})}function Am({isCodeMode:e,codeModeDirection:t,email:n,onClosePanel:r}){const i=cr();return i?.type!=="img"||!e||t==="bottom"?null:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper email-pane__collapse-wrapper_disabled",children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Vi,{email:n,formSettings:i,onClosePanel:r})})})}var xm="code",Pm=(e,t)=>(0,s.jsx)(t,{className:"email-pane__tab-bar",...e}),{Content:Rm}=y.ui_kit$Layout,jm=()=>{rr().catch(()=>{})},Jt=e=>(0,l.memo)(t=>(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(e,{...t})})),Lm=Jt(Iu),Om=Jt(Tu),Mm=Jt(Au),Nm=Jt(Pu),Dm=(0,l.memo)(e=>(0,s.jsx)(pu,{...e})),Fm=(0,l.memo)((0,l.forwardRef)((e,t)=>(0,s.jsx)($i,{...e,ref:t}))),Bm=(0,l.memo)(e=>(0,s.jsx)(Mi,{...e})),Um=Jt(Cu),$m=Jt(ju),zm=Jt(Ru),pa=({emailElement:e,isSuccess:t,setIsCollaborationEditor:n,isShowAddAllBlocksModal:r,triggerOpenSavedBlocksTab:i,setIsShowAddAllBlocksModal:a})=>{const{__:d,_x:u}=o.useI18n(),m=o.useMessageService(),{blockId:f}=o.useRouteParams(),h=o.useEditorProjectId(),_=o.useRouteEmailId(),p=o.useDispatch(),E=Yo(),k=o.useOpenPlanCatalog(),{modal:w}=y.ui_kit$App.useApp(),b=o.useAppConfig(),x=o.useConfigSource(),P=o.useHeadless(),Y=o.useContainer(),J=Yi("panel");wu(Y),(0,l.useEffect)(()=>{Ht(Y).notePagePainted()},[Y]);const{token:N}=(0,y.ui_kit$useToken)(),O=o.useNotification(),A=o.usePushToDataLayer(),L=o.useProjectData(),z=Ei(L?.id||h);Qu(z);const B=o.useCookieManager(),$=o.useSelector(o.selectActiveSettingsTab),de=o.useCurrentUser(),pe=o.toLanguageCode(o.useInterfaceLocale()),H=o.useStore(),Z=pm(),{setWidthCodeSplit:De,setIsResizing:be,setCurrentSide:et,setBlockMaxHeight:ve}=hm(),fe=o.useSelector(o.selectActiveModal$1),K=o.useSelector(o.selectIsCodeMode),me=o.useSelector(o.selectCodeModeDirection),[ie,ae]=(0,l.useState)(K);(0,l.useEffect)(()=>{K&&ae(!0)},[K]);const Ae=o.useSelector(zu),Te=o.useSelector(Gu),Fe=o.useSelector(Wu),X=o.useSelector(o.selectPropertiesPanelKey),[Ee]=o.useLazyClearAiChatQuery(),[Ie]=o.useUploadImageMutation(),he=o.useSelector(o.selectEmailViewType)===o.MOBILE,[Re,$e]=(0,l.useState)(o.LIGHT),[C,T]=(0,l.useState)(),[R,D]=(0,l.useState)(b.defaultBuildPanel||"empty"),[I,S]=(0,l.useState)("empty"),[se,we]=(0,l.useState)(!1),[Ke,Qe]=(0,l.useState)([]),[ze,Ze]=(0,l.useState)([]),{setPreviewAlertShow:mt,setTemplateNotEmAlertShow:vt}=_m(),{open:ft,close:lt}=Zu(),{open:G,close:V}=em();lm();const te=o.useRootElement(),ue=o.isEditorLockedByPlan(L,{isPlugin:!0}),ge=o.usePlanFeatureGate("discussion"),Ge=o.usePlanFeatureGate("code_editor"),qe=Hi("ai"),at=qe.exceeded?o.getLimitUpgradePresetDefinition(qe.exceeded.presetId):null,Bt=b?.configSwither||!1;(0,l.useEffect)(()=>{p(o.resetParentBlocks())},[p]),(0,l.useEffect)(()=>{const v=window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_active_tab);v&&p(o.setActiveSettingsTab(v))},[B,p]);const Oe=_||f,Xe=e.hasOwnProperty("type")?o.BLOCK:o.EMAIL,re=um(),ee=dm(),U=(0,l.useRef)(null),le=(0,l.useRef)(null),xe=(0,l.useRef)(),Se=(0,l.useRef)(),Me=(0,l.useRef)(null),We=(0,l.useRef)(),Be=(0,l.useRef)(),rt=(0,l.useRef)(null),fn=(0,l.useRef)(!1),Lt=(0,l.useRef)(!1),ct=(0,l.useCallback)(()=>{Lt.current=!1},[]),Et=(0,l.useCallback)(()=>{Lt.current=!0},[]),Ot=(0,l.useCallback)(v=>{v?.type===o.ELEMENT_TYPES.SOCIAL&&Et()},[Et]),[jn,Ln]=(0,l.useState)(!1),[hn,On]=(0,l.useState)(!1),[Mn]=o.useEditMeMutation(),[ht,St]=(0,l.useState)(!1),[ce,ke]=(0,l.useState)(0),[Ne,nt]=(0,l.useState)(!1),je=(0,l.useCallback)(()=>nt(!1),[]),Kt=(0,l.useCallback)(()=>{nt(!1),k()},[k]),[Ut,dt]=(0,l.useState)(!1),Nn=b.configSwither?localStorage.getItem("configSwither")==="pro"?!0:localStorage.getItem("configSwither")==="editor"?!1:b.mode==="pro":!1,$t=(0,l.useCallback)(()=>{clearTimeout(rt.current);const v=".blocks-search__result-holder";te.querySelector(v)&&(Ae||Te||Fe)&&(te.querySelector(v).style.removeProperty("transition"),te.querySelector(v).style.opacity=0,rt.current=setTimeout(()=>{o.measureBlockPreviews(te,207/660),te.querySelector(v)&&(te.querySelector(v).style.transition="opacity 0.2s",te.querySelectorAll(v).forEach(j=>j.style.opacity=1))},200))},[Te,Ae,Fe]),Tt=(0,l.useRef)(void 0),It=(0,l.useCallback)(v=>{const j=v.target;j&&(window.clearTimeout(Tt.current),Tt.current=window.setTimeout(()=>{Ln(!!j.closest(".desktop_view")),On(!!j.closest(".mobile_view"))},100))},[]);(0,l.useEffect)(()=>()=>{window.clearTimeout(Tt.current)},[]),(0,l.useEffect)(()=>{const v=o.addDocumentListenerFromShadow(te,"mouseover",It);return()=>{v.dispose()}},[te,It]),(0,l.useEffect)(()=>{typeof n=="function"&&(ze.length>0?n(!0):n(!1))},[ze]);const[Fo]=o.useSendMessageMutation(),{data:gt={},refetch:M,status:q}=o.useGetDialogQuery({entity_id:Oe},{skip:!Oe||b.aiAssistentEnabled===!1||ue}),Q=o.useEventEmitter(g.events.AI_TEXT_REQUEST_ID).hasListeners(),oe=o.useIsStandalone(),ne=!Q&&!oe,W=(0,l.useMemo)(()=>ne?[{data:{role:"assistant",message:d("Typing..."),isLoading:!0}}]:[],[ne,d]),[Ce,ye]=(0,l.useState)([]),[He,gn]=(0,l.useState)(b.defaultBuildPanel!==""?o.BLOCKS:o.ATOMS),Dn=(0,l.useRef)(null),pt=(0,l.useCallback)(()=>{const v=Se.current?.getBoundingClientRect(),j=C?.getBoundingClientRect();m.send({operation:o.EVENT_TYPES.SANDBOX_WINDOW_CHARACTERISTIC,settings:{iframeOffsetTop:K&&me!=="bottom"?0:30,scrollTop:-v?.top+j?.top+30,innerHeight:window.innerHeight,previewHeight:j?.height,mode:K&&me!=="bottom"?xm:"default"}})},[me,K,C,m]),Bo=t&&e,yn=(0,l.useCallback)(v=>{const j=window.navigator.platform.match("Mac");b.codeEnabled&&b.codeSideEnabled&&v.altKey&&v.keyCode===88&&(E.toggle(),Ge.isLocked&&(St(!0),ke(o.FEATURE_UPSELL_SLIDE.code_editor))),((j?v.metaKey:v.ctrlKey)&&v.shiftKey&&v.keyCode===76||(j?v.metaKey:v.ctrlKey)&&v.shiftKey&&v.keyCode===69||(j?v.metaKey:v.ctrlKey)&&v.shiftKey&&v.keyCode===82)&&v.preventDefault()},[b.codeEnabled,Ge.isLocked,b.codeSideEnabled,E]),wt=fe.includes("UPLOAD_IMAGE_")||fe.includes("UPLOAD_BACKGROUND_"),_n=(0,l.useRef)(!1),yt=(0,l.useCallback)(v=>{const j=v.target,F=j.closest(".email-pane__content-col")||j.closest(".email-pane__collapse-wrapper")||j.closest(".selected-element-panel-content")||j.closest(".selected-element-panel")||j.closest(".em-analytics__email-tab-properties")||j.closest(".em-analytics__email-tab-styles")||j.closest(".em-analytics__email-tab-history")||j.closest(".blocks-modal-container")||j.closest(".email-pane__sizes")||j.closest(".email-preview-menu")||j.closest(".monaco-editor")||j.closest(".ant-modal-wrap");_n.current=!!F},[]),qs=(0,l.useCallback)(v=>{const j=_n.current,F=window.getSelection().toString().length>0||document.activeElement&&document.activeElement.tagName==="INPUT"&&document.activeElement.selectionStart!==document.activeElement.selectionEnd;_n.current=!1,!(j||F)&&(!document.querySelector(".easylogic-colorpicker")&&!te.querySelector(".easylogic-colorpicker")&&!v.target.closest(".email-pane__content-col")&&!v.target.closest(".blocks-modal-container")&&!v.target.closest(".email-pane__collapse-wrapper")&&!v.target.closest(".selected-element-panel__columns-settings__controls__column__remove")&&!v.target.closest(".email-preview__content-col_main")&&!v.target.closest(".email-preview-menu")&&!v.target.closest(".monaco-editor")&&!v.target.closest(".main__pane-close-btn")&&!v.target.closest(".main__pane-trigger")&&!v.target.closest(".ant-modal-wrap")&&!v.target.closest(".email-pane__sizes")&&!v.target.closest(".ant-input-clear-icon")&&!v.target.closest(".ant-color-picker")&&!v.target.closest(".control-font-family-dropdown")&&!Dn.current&&!v.target.closest(".email-preview-menu__history")&&!v.target.closest(".selected-element-panel-content")&&!v.target.closest(".ant-select-dropdown")&&!v.target.closest(".ant-picker-dropdown")&&!v.target.closest(".toggle_view")&&!v.target.closest(".upload-bg-image__menu")&&!v.target.closest(".email-pane__paths")&&!v.target.closest(".ant-tabs-extra-content")&&!v.target.closest(".anticon-delete")&&!wt&&fe!==o.MODALS.IMAGE_EDITOR_MODAL&&($==="Properties"&&(Et(),p(o.resetToLastActiveSettingsTab()),m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),Qe([])),$==="History"&&p(o.setActiveSettingsTab(o.BUILD)),p(o.switchIsPanelHistoryCollapsed(!0)),m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),setTimeout(()=>{e.type?p(o.setElementSettings({type:null})):p(o.setElementSettings$1({type:null}))},300)),Dn.current=null)},[p,e.type,fe,$,m,wt]),[wb,Vs]=(0,l.useState)(!0),{data:qr=[],refetch:Uo}=o.useGetCommentsQuery(Oe,{skip:!Oe||ue});(0,l.useEffect)(()=>{Oe&&!ue&&Uo()},[$,Oe,ue,Uo]),(0,l.useEffect)(()=>{Oe&&!Object.keys(gt).length&&q==="fulfilled"&&M()},[$,Oe,M,gt,q]),(0,l.useEffect)(()=>{const v=new g.Disposable,j=window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_active_tab);if(gt?.totalCount===0&&q!=="pending"){const Pe={project_id:h,connection:"chat",entity_id:Oe,context:"default",locale:pe};!j&&ne&&o.runOnceInFlight(`email-default-context:${Oe}`,()=>{o.swallowPromiseRejection(Fo({body:Pe}).then(()=>{v.isDisposed()||q==="fulfilled"&&M()}))})}const F={data:{role:"assistant",message:d("Typing..."),isLoading:!0}};return gt?.documents?.length>0?(window.localStorage.removeItem(o.LOCAL_STORAGE_ITEMS.em_active_tab),ye(gt?.documents),ne&>?.documents[gt?.documents?.length-1].data?.userInfo&&ye([...gt?.documents,F])):j||ye(ne?[F]:[]),()=>v.dispose()},[Oe,pe,gt?.totalCount,gt?.documents,ne,h,M,Fo,q]),(0,l.useEffect)(()=>{re({}),p(Xe==="email"?o.setElementSettings$1({}):o.setElementSettings({}))},[p,Xe]);const Ys=(0,l.useCallback)(v=>{p(o.setEmailSettings(Kn(v)))},[p]),Ks=(0,l.useCallback)(v=>{p(o.setBlockSettings(Kn(v)))},[p]),Fn=(0,l.useCallback)(v=>{p(Xe==="email"?o.setElementSettings$1(Kn(v)):o.setElementSettings(Kn(v)))},[p,Xe]);(0,l.useEffect)(()=>{const v=We.current,j=Me.current;T(K?j??v:v)},[K,me]);const[kb,Cb]=(0,l.useState)(null),Tb=(0,l.useCallback)(v=>{b.sidePanelFloating&&(Me.current=v),Cb(v)},[b.sidePanelFloating]),Bn=(0,l.useCallback)(v=>{D(v),v==="search"?we(!0):(we(!1),S(v)),setTimeout($t,50)},[$t]),Ib=(0,l.useCallback)(v=>{const j=v.data.operation,F=v.data,Pe=v.data.action;if(j==="application_block_inserted"||v.data.operationId==="application_block_inserted"){const Le=v.data.operationId?v.data.data:F||{},Nt=Le.type==="project"||Le.type==="template"||Le.type==="common"?"block":"structure",vn=Le.name||Le.type||(Nt==="block"?"block":"structure");A({event:"add",action:"add_element_to_email",element_type:Nt,element_name:vn,entity_id:e?.id||_||f,project_id:L?.id||h})}if(j===o.EVENT_TYPES.APPLICATION_SCROLL_TO&&setTimeout(()=>{Me.current?.scrollTo({top:v.data.settings.value,behavior:"smooth"})},100),j===o.EVENT_TYPES.APPLICATION_PREVIEW_ALERT_SHOW&&mt(F.settings.show),j===o.EVENT_TYPES.APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW&&vt(!0),j===o.EVENT_TYPES.APPLICATION_ACTION&&Pe==="toggle_editor"&&E.toggle(),j===o.EVENT_TYPES.APPLICATION_IFRAME_SET_HEIGHT&&(te.querySelector(".email-pane__iframe").style.height=F.settings.height+"px"),j===o.EVENT_TYPES.APPLICATION_EMAIL_SETTINGS_SET){let Le=Object.assign({},F.settings);delete Le.preheader,Object.values(Le).every(Nt=>!Nt)?(p(o.setEmailSettingsDisable(!0)),p(o.resetToLastActiveSettingsTab())):Ys(F.settings),F.settings.noBlocks,p(o.setMobileViewActive(F.settings.responsive)),Vs(Le.structuresMedia)}if(j===o.EVENT_TYPES.APPLICATION_BLOCK_SETTINGS_SET&&(Object.values(F.settings).every(Le=>!Le)?(p(o.setBlockSettingsDisable(!0)),p(o.resetToLastActiveSettingsTab())):(Ks(F.settings),Vs(F.settings.structuresMedia))),j===o.EVENT_TYPES.APPLICATION_ELEMENT_SETTINGS_SET){const Le=Object.values(o.ELEMENT_TYPES).includes(F.type),Nt=ee.current,vn=Nt?.type==="advanced"&&!!Nt.content,At=F.tab?!0:!Le&&!vn,{type:$b,caption:zb,settings:Gb}=F,rl=JSON.stringify([$b,zb,Gb]),Wb=rl!==U.current;if(U.current=rl,At&&$==="Properties"&&p(o.resetToLastActiveSettingsTab()),F.type===o.ELEMENT_TYPES.EMPTY_TABLE||F.type===o.ELEMENT_TYPES.EMPTY_TD?(p(o.setActiveSettingsTab(o.BUILD)),F.type===o.ELEMENT_TYPES.EMPTY_TABLE?(gn(o.BLOCKS),F.tab?Bn(F.tab):Bn("common")):F.type===o.ELEMENT_TYPES.EMPTY_TD&&gn(o.ATOMS)):F.type&&$!=="Properties"?F.type===o.ELEMENT_TYPES.SOCIAL&&Lt.current?ct():(ct(),p(o.setActiveSettingsTab(o.PROPERTIES))):F.type!==o.ELEMENT_TYPES.SOCIAL&&ct(),!Wb)return;F.type===o.ELEMENT_TYPES.CAROUSEL||F.type===o.ELEMENT_TYPES.ACCORDION||F.type===o.ELEMENT_TYPES.SOCIAL?(re(tn=>({settings:{...F.settings,type:At?null:F.type,caption:F.caption,parent:At?null:F.settings.parent},type:At?null:F.type,parent:At?null:F.settings.parent,caption:F.caption,extraTabs:tn.extraTabs})),Fn({})):(Fn({...F.settings,type:At?null:F.type,parent:At?null:F.settings.parent,caption:F.caption}),re(tn=>!Le&&tn.type==="advanced"&&tn.content?{...tn,settings:{...F.settings,type:F.type,parent:F.settings?.parent,caption:F.caption}}:tn.extraTabs?.length?{extraTabs:tn.extraTabs}:{})),F.settings?.path?.length>0&&Qe(F.settings?.path)}j===o.EVENT_TYPES.APPLICATION_ELEMENT_SETTINGS_CLOSE&&(U.current=null,ee.current?.type===o.ELEMENT_TYPES.SOCIAL&&Et(),p(o.resetToLastActiveSettingsTab()))},[p,Ys,Ks,Fn,$,Bn,te,A,e,_,f,L,ct,Et,E,h,ee,re,mt,vt]);(0,l.useEffect)(()=>{o.identifyUser({id:de?.id,email:de?.email,username:de?.name})},[de]),(0,l.useEffect)(()=>{const v=de.email_builder_config,j=!ue,F=x.get()?.mode;if(!v||typeof v!="string")return;const Pe=j&&v==="simple"?"pro":v;Pe!==F&&p(o.changeConfig(Pe))},[ue,de.email_builder_config,de.id,p,H,x]),(0,l.useEffect)(()=>{if(K&&Ge.isLocked&&E.toggle(),b.configSwither){let v=localStorage.getItem("configSwither")||b.mode||"editor";localStorage.setItem("configSwither",v),p(o.changeConfig(v))}},[]);const Qs=v=>{setTimeout(()=>{if(ue)p(o.changeConfig("pro")),dt(!0),St(!0),A({event:"change",action:"change_config_mode",config_mode:"pro",entity_id:e?.id||_||f,project_id:L?.id||h});else{let j=v?"pro":"editor";localStorage.setItem("configSwither",j),p(o.changeConfig(j)),A({event:"change",action:"change_config_mode",config_mode:j,entity_id:e?.id||_||f,project_id:L?.id||h})}},200)},Ab=()=>{K&&E.toggle(),p(o.resetToLastActiveSettingsTab()),p(o.changeConfig("simple")),dt(!1),St(!1),A({event:"change",action:"change_config_mode",config_mode:"simple",entity_id:e?.id||_||f,project_id:L?.id||h})},xb=(0,l.useCallback)(()=>{St(!1)},[]);o.useListenPostMessage(Ib),(0,l.useEffect)(()=>{const v=m.addListener(j=>{const F=Xu(j,o.EVENT_TYPES.APPLICATION_NATIVE_IMAGE_DROP);if(!F)return;const Pe=()=>m.send({operation:o.EVENT_TYPES.SANDBOX_NATIVE_IMAGE_DROP_CLEAR});(async()=>{const Le=await Ju(F,{readContext:()=>({userId:de?.id,folderId:L?.id??h}),prepare:At=>o.prepareImageForEditorUpload(At,b),upload:At=>Ie(At)});if(Le.status==="failed"&&O.fromError("IMAGE_UPLOAD_ERROR",F,Le.error,!0),Le.status!=="uploaded"){Pe();return}m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:o.ELEMENT_TYPES.IMG,settings:{src:Le.url}});const Nt=H.getState(),vn=Xe==="email"?o.selectElementSettings$1(Nt):o.selectElementSettings(Nt);vn?.type===o.ELEMENT_TYPES.IMG&&Fn({...vn,src:Le.url,changeKey:"src"})})()});return()=>v.dispose()},[m,Ie,de,h,L?.id,b,O,Fn,H,Xe]),(0,l.useEffect)(()=>{const v=m.addListener("application_atom_inserted",F=>{A({event:"add",action:"add_element_to_email",element_type:"atom",element_name:F||"atom",entity_id:e?.id||_||f,project_id:L?.id||h})}),j=m.addListener("application_block_inserted",F=>{const Pe=F?.type==="project"||F?.type==="template"||F?.type==="common"?"block":"structure",Le=F?.name||F?.type||(Pe==="block"?"block":"structure");A({event:"add",action:"add_element_to_email",element_type:Pe,element_name:Le,entity_id:e?.id||_||f,project_id:L?.id||h})});return()=>{v?.dispose(),j?.dispose()}},[m,A,e?.id,_,f,h,L?.id]);const Pb=v=>{let j=te.querySelector(".atoms__list");b.toggleSidePanel&&v===$?p(o.setActiveSettingsTab(o.DISABLED_TAB)):v==="Optimize"?xt.comingSoonHandler(d,w):v!=="Properties"&&v!=="History"?(p(o.setActiveSettingsTab(v)),A({event:"navigate",action:"navigate_email_pane_tab",tab_name:v==="Disabled_tab"?"DISABLED_TAB":v,entity_id:e?.id||_||f,project_id:L?.id||h}),m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),Qe([])):(v==="Properties"||v==="History")&&A({event:"navigate",action:"navigate_email_pane_tab",tab_name:v,entity_id:e?.id||_||f,project_id:L?.id||h}),ge.isLocked&&v==="Discuss"&&(St(!0),ke(o.FEATURE_UPSELL_SLIDE.discussion)),ue&&v==="Optimise"&&(St(!0),ke(6)),qe.isLocked&&v==="AiChat"&&(qe.state.state==="locked_by_limit"&&qe.exceeded?nt(!0):(St(!0),ke(9)))},Vr=(0,l.useRef)(null),$o=(0,l.useRef)(void 0),Mt=(0,l.useCallback)(()=>{const v=Me.current?.getBoundingClientRect();if(Vr?.current?.getBoundingClientRect().top>=0&&v){const j=Math.round(v.height-30);Vr.current.style.height=`${j}px`,ve(j-30)}$o.current&&window.clearTimeout($o.current),$o.current=window.setTimeout(function(){m.isInited()&&pt()},100)},[pt,m,ve]);(0,l.useEffect)(()=>()=>{window.clearTimeout($o.current)},[]),(0,l.useEffect)(()=>($==="AiChat"&&!ue?le.current=setInterval(()=>{M({entity_id:Oe})},5e3):clearInterval(le.current),clearInterval(le.current)),[Oe,ue,M,$]);const Rb=v=>gn(v||""),jb=()=>{we(!1),D(I)},Yr=()=>{let v=te.querySelector(".block-search__preview");v&&(v.style.opacity="0",v.style.transform="translateX(-99%)",setTimeout(function(){v.remove()},300))};let bn=[];const Un={display:"flex",alignItems:"center",justifyContent:"center"};b.blocksEmptyEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Empty blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"BorderOuterOutlined",component:y.icons$BorderOuterOutlined,style:{fontSize:18}})})}),value:"empty"}),b.blocksSavedEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Saved blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"AppstoreAddOutlined",component:y.icons$AppstoreAddOutlined,style:{fontSize:18}})})}),value:"project"}),b.blocksCommonEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Common blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"AppstoreOutlined",component:y.icons$AppstoreOutlined,style:{fontSize:18}})})}),value:"common"}),b.blocksTemplateEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Template blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"BuildOutlined",component:y.icons$BuildOutlined,style:{fontSize:18}})})}),value:"template"}),b.blocksSearchEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Blocks search"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"SearchOutlined",component:y.icons$SearchOutlined,style:{fontSize:18}})})}),value:"search"});const zo=R!=="empty"||se,Lb=!b.blocksSectionsShow||zo?"100%":"calc(100% - 44px)";let Ob=[{label:(0,s.jsx)("div",{className:"email-pane__tab",children:d("Elements")}),key:o.ATOMS,className:"email-pane__collapse-panel email-pane__atoms",children:(0,s.jsx)(Bm,{})},{label:(0,s.jsx)("div",{className:"email-pane__tab",children:d("Blocks")}),key:o.BLOCKS,className:"email-pane__collapse-panel email-pane__blocks-search",style:{height:Lb},children:(0,s.jsxs)("div",{className:(0,ot.default)("email-pane__blocks-panel",{"email-pane__blocks-panel_scrollable":zo}),children:[b.blocksSectionsShow&&(0,s.jsxs)("div",{className:"email-pane__blocks-panel-header",children:[(0,s.jsxs)(y.ui_kit$Space.Compact,{block:!0,children:[!se&&(0,s.jsx)(y.ui_kit$Segmented,{block:!0,style:{width:"100%",marginTop:24},onChange:Bn,value:R,options:bn}),se&&(0,s.jsx)("div",{style:{width:"100%",height:36}}),se&&(0,s.jsx)("div",{style:{width:36,textAlign:"right",marginTop:22},children:(0,s.jsx)(o.EmIcons,{icon:"CloseOutlined",component:y.icons$CloseOutlined,style:{padding:"0 2px 0",cursor:"pointer"},onClick:jb})})]}),(0,s.jsx)("div",{className:"blocks-search__divider-wrapper",style:{marginTop:se?28:12},children:(0,s.jsx)(y.ui_kit$Divider,{className:"blocks-search__divider"})})]}),(0,s.jsxs)("div",{className:"email-pane__blocks-panel-body",children:[(0,s.jsx)("div",{className:"blocks-search__empty-shadow",style:{display:R==="empty"&&!se?"block":"none"},children:wb?(0,s.jsx)(mi,{}):(0,s.jsx)(di,{})}),(0,s.jsx)("div",{className:(0,ot.default)("email-pane__blocks-panel-results",{"email-pane__blocks-panel-results_visible":zo}),children:(0,s.jsx)(Nm,{parentEmailId:e?.parent_email,blocksTab:R,search:se,reloadBlockScreens:$t,setIsShowAddAllBlocksModal:a})})]})]})}];const $n=[{disabled:ht,key:o.PROPERTIES,style:{height:"var(--em-pane-block-height)"},className:"em-analytics__email-tab-properties",children:(0,s.jsx)(Cm,{isShowMobileSettings:he,propertiesPanelKey:X,onMouseLeave:Yr,email:e,onClosePanel:Ot})},{disabled:ht,key:o.HISTORY,style:{height:"var(--em-pane-block-height)"},className:"em-analytics__email-tab-history",children:Bo&&(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",onMouseLeave:Yr,children:(0,s.jsx)($m,{setCollapsedHistory:()=>p(o.switchIsPanelHistoryCollapsed(!0)),emailElement:Bo})})},{key:o.DISABLED_TAB,className:"em-analytics__email-tab-properties"},{disabled:ht,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Build","tab"),children:(0,s.jsx)(o.EmIcons,{"data-testid":"contentIcon",icon:"PlusCircleOutlined",component:y.icons$PlusCircleOutlined,size:24,strokeWidth:b.iconStrokeWidth})}),key:o.BUILD,className:"em-analytics__email-tab-build",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:(0,ot.default)("email-pane__collapse-wrapper",{"email-pane__collapse-wrapper_no-topleft-radius":$==="Build"||!$,"email-pane__collapse-wrapper_build":He==="Blocks"&&zo}),onMouseLeave:Yr,children:(0,s.jsx)(y.ui_kit$Tabs,{className:(0,ot.default)("secondary-tabs email-pane__collapse",{"secondary-tabs_unset_scroll":He===o.BLOCKS}),size:"large",activeKey:He,onChange:Rb,items:Ob})})},{disabled:ht,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Styles","tab"),children:(0,s.jsx)(o.EmIcons,{"data-testid":"stylesIcon",icon:"Styles",component:y.icons$Styles,size:24,strokeWidth:b.iconStrokeWidth})}),key:o.STYLES,className:"em-analytics__email-tab-styles",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(Om,{email:e})})}];b.commentsEnabled&&$n.push({disabled:ht,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("Discuss","tab"),children:[(0,s.jsx)(o.EmIcons,{"data-testid":"commentsIcon",icon:"CommentOutlined",component:y.icons$CommentOutlined,size:24,strokeWidth:b.iconStrokeWidth}),ge.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:b.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),!!qr.length&&(0,s.jsx)("span",{className:"email-pane__comment-counter",children:qr.filter(v=>v.comment_status!=="deleted").length})]}),key:"Discuss",className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse discuss-wrapper",size:"large",activeKey:"Discuss",items:[{label:(0,s.jsx)(s.Fragment,{children:d("Discuss")}),key:"Discuss",forceRender:!0,className:"email-settings__collapse-panel",children:Oe?(0,s.jsx)(zm,{email:e,comments:qr,subjectId:Oe,isLoggedIn:!0,emailElementType:Xe}):(0,s.jsx)("div",{className:"aside-content-wrapper",children:e.hasOwnProperty("type")?(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}})})}]})})});const Mb=()=>{Ee({entity_id:Oe}).then(v=>{v.error?O.error({title:v.error.data.code,description:v.error.data.message}):v.data.success&&O.success({title:d("Success"),description:v.data.success}),ue||M()})};b.aiAssistentEnabled&&$n.push({disabled:ht,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("AI assistant","tab"),children:[(0,s.jsx)(o.EmIcons,{"data-testid":"aiAssistentIcon",icon:"AI",component:y.icons$AI,size:24,strokeWidth:b.iconStrokeWidth}),qe.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:b.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),gt?.totalCount>0&&Oe&&(0,s.jsx)("span",{className:"email-pane__comment-counter",children:gt?.totalCount})]}),key:"AiChat",className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse discuss-ai-wrapper",size:"large",activeKey:"AiChat",tabBarExtraContent:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Clear chat"),children:(0,s.jsx)(y.ui_kit$Popconfirm,{description:d("Clear chat history?"),onConfirm:Mb,okText:d("Yes"),cancelText:d("No"),icon:"",placement:"leftTop",title:!1,children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsx)(o.EmIcons,{icon:"ClearChat",component:y.icons$ClearChat,style:{fontSize:16}}),style:{marginRight:16}})})}),items:[{label:(0,s.jsx)(s.Fragment,{children:d("AI assistant")}),key:"AiChat",forceRender:!0,className:"email-settings__collapse-panel",children:Oe||window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_active_tab)?(0,s.jsx)(Lm,{messages:Ce.length>0?Ce:W,newEmailAiGeneratorRef:fn}):(0,s.jsx)("div",{className:"aside-content-wrapper",children:e.hasOwnProperty("type")?(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}})})}]})})})}),b.optimizeEnabled&&$n.push({disabled:ht,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("Optimize","tab"),children:[(0,s.jsx)(o.EmIcons,{"data-testid":"optimizeIcon",icon:"Speed",component:y.icons$Speed,size:24,strokeWidth:b.iconStrokeWidth}),ue&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:b.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"})]}),key:"Optimise",className:"em-analytics__email-tab-optimise",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs secondary-tabs_optimise email-settings__collapse optimise-wrapper",size:"large",activeKey:"Optimise",items:[{label:(0,s.jsx)(s.Fragment,{children:d("Optimize")}),key:"Optimise",forceRender:!0,className:"email-settings__collapse-panel",children:(0,s.jsx)(Mm,{})}]})})}),b.settingsEnabled&&$n.push({disabled:ht,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Settings","tab"),children:(0,s.jsx)(o.EmIcons,{"data-testid":"settingsIcon",icon:"SettingOutlined",component:y.icons$SettingOutlined,size:24,strokeWidth:b.iconStrokeWidth})}),key:"Edit",className:"em-analytics__email-tab-edit",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(Um,{email:e})})});const Xs=$===o.DISCUSS,Js=(0,l.useRef)(0),Zs=(0,l.useRef)(0),el=(0,l.useRef)(0),Nb=(0,l.useCallback)(()=>(te.querySelector(".email-pane__col_preview")?.getBoundingClientRect().width??0)-(b.sidePanelFloating?0:38),[te,b.sidePanelFloating]);(0,l.useEffect)(()=>{Oe&&!ue&&Uo()},[Oe,ue,Uo]),(0,l.useEffect)(()=>{const v=m.onInit(()=>{m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_DISCUSS,value:Xs})});return()=>v.dispose()},[Xs,m]),(0,l.useEffect)(()=>{if(!C||!Qi(m))return;const v=new AbortController;return Xi(m,o.DEFAULT_SANDBOX_READY_TIMEOUT_MS,v.signal).then(()=>pt()).catch(()=>{}),()=>v.abort()},[C,pt,m]);const Kr=(0,l.useCallback)(v=>{const j=v??o.selectEmailWidth(H.getState());m.send({operation:o.EVENT_TYPES.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:typeof j=="number"?j+2:j}}),xe.current?.resize()},[H,m]);(0,l.useEffect)(()=>{if(!he&&$!=="Disabled_tab"){const v=te.querySelector(".email-pane__row")?.getBoundingClientRect().width;Se?.current?.getBoundingClientRect().width+540>v&&p(o.setEmailWidth("100%"))}},[p,$,te,he]);const Qr=(0,l.useCallback)(()=>{const v=Se.current;v&&(v.style.borderWidth="1px",b.sidePanelFloating||(v.style.marginLeft="-1px",v.style.marginRight="-1px"),v.style.borderLeftColor=null,v.style.borderRightColor=null)},[b.sidePanelFloating]),tl=(0,l.useCallback)(v=>{const j=Z.current.widthCodeSplit;be(!1),Z.current.currentSide&&(setTimeout(()=>Kr(),50),et(null)),v.target.classList.contains("email-pane__handle")||Qr(),window.localStorage.setItem(o.LOCAL_STORAGE_ITEMS.em_code_mode_pane_sizes,JSON.stringify(j))},[Kr,Z,be,et,Qr]),nl=v=>j=>{j.target.classList.contains("email-pane__handle")&&(j.preventDefault(),Js.current=j.target.parentNode.offsetWidth,Zs.current=j.pageX,el.current=Nb(),et(v),Dn.current=v)},Go=v=>{const j=Se.current,{currentSide:F}=Z.current;typeof v=="string"&&(!F||F===v)?(te.querySelector(".email-pane__iframe").style.width="calc(100% + 1px)",v==="right"?(j.style.borderRightColor=N.colorPrimary,j.style.borderRightWidth="2px"):(j.style.borderLeftColor=N.colorPrimary,j.style.borderLeftWidth="2px",te.querySelector(".email-pane__iframe").style.marginLeft="-1px")):F||(Qr(),te.querySelector(".email-pane__iframe").style.width="1px",te.querySelector(".email-pane__iframe").style.removeProperty("margin-left"))},Db=(0,l.useCallback)(()=>{be(!0)},[be]),Xr=(0,l.useCallback)(v=>{const{currentSide:j}=Z.current;if(!j)return;const F=(v.pageX-Zs.current)*2,Pe=Js.current+(j==="left"?-F:F),Le=Math.min(el.current,1200);Pe>318&&Pe<Le&&(p(o.setEmailWidth(Math.min(Pe,1200))),xe.current?.resize())},[p,Z]),Jr=(0,l.useCallback)(v=>{if(Z.current.isResizing)if(me==="bottom"){const j=Be.current.getBoundingClientRect().height,F=Be.current.getBoundingClientRect().top,Pe=(v.clientY-F)/j*100;if(Pe<20||Pe>80)return;De(Pe),Mt()}else{const j=Be.current.getBoundingClientRect().width,F=Be.current.getBoundingClientRect().left,Pe=(v.clientX-F)/j*100,Le=Se.current.getBoundingClientRect().width;if(b.desktopMobileSwitchPanel&&typeof Le=="number"&&Le<=425&&p(o.setEmailWidth(425)),Pe<20||Pe>80)return;De(Pe)}},[Z,De,me,Mt,p,b.desktopMobileSwitchPanel]);(0,l.useEffect)(()=>{Mt()},[K,Mt]);const Fb=v=>{v?.stopPropagation?.();const j=Re==="light"?o.DARK:o.LIGHT;m.send({operation:o.EVENT_TYPES.SANDBOX_SWITCH_THEME,data:{theme:j}}),$e(j)},ol=(v="panel")=>{const j=v==="panel",F=Re===o.DARK,Pe={size:j?18:16,strokeWidth:j?b.iconStrokeWidth:2};return(0,s.jsx)(y.ui_kit$Tooltip,{title:d(F?"Light theme":"Dark theme"),placement:j?"top":"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:j?F?"primary":"text":"default",icon:F?(0,s.jsx)(o.EmIcons,{icon:"LightMode",component:y.icons$LightMode,...Pe}):(0,s.jsx)(o.EmIcons,{icon:"DarkMode",component:y.icons$DarkMode,...Pe}),shape:"circle",size:j?void 0:"small",onClick:Fb,className:"toggle_view theme_view email-pane__theme-toggle",style:j?void 0:{left:4,top:4,zIndex:999,padding:0,position:"absolute"}})})},Zr=v=>{const j=typeof v=="number"?Math.min(v,1200):v;p(o.setEmailWidth(j)),setTimeout(()=>Kr(j),700);const F=typeof j=="number"?j:j==="100%"?"full":j,Pe=typeof j=="number"&&j<=425?"mobile":"desktop";A({event:"change",action:"change_email_size",email_id:e?.id||_||f,project_id:L?.id||h,width:F,view_type:Pe})};(0,l.useEffect)(()=>{const v=new g.Disposable;return v.addDisposable(o.addWindowListenerFromShadow(te,"mousedown",yt,!0)),v.addDisposable(o.addWindowListenerFromShadow(te,"click",qs)),v.addDisposable(o.addWindowListenerFromShadow(te,"mouseup",j=>tl(j),!0)),()=>{v.dispose()}},[te,qs,yt,tl]),(0,l.useEffect)(()=>{const v=Me.current;if(!v||typeof ResizeObserver!="function")return;const j=new ResizeObserver(Mt);return j.observe(v),()=>j.disconnect()},[Mt,b.sidePanelFloating]),(0,l.useEffect)(()=>(window.addEventListener("scroll",Mt,!0),window.addEventListener("mousemove",Xr,!0),window.addEventListener("mousemove",Jr),window.addEventListener("keydown",yn),()=>{window.removeEventListener("mousemove",Xr,!0),window.removeEventListener("mousemove",Jr),window.removeEventListener("scroll",Mt,!0),window.removeEventListener("keydown",yn)}),[Mt,Xr,Jr,yn]);const Bb=v=>{const j=K?"visual":"code",F=!K;if(K?E.toggle():typeof v=="string"?(E.setDirection(v),!K&&E.toggle()):E.toggle(),F){const Pe=Xe==="block"?"block":"email",Le=typeof v=="string"?v:me||"toggle";A({event:"activate",action:"activate_code_mode",entity_type:Pe,entity_id:e?.id||_||f,project_id:L?.id||h,code_mode_direction:Le})}A({event:"change",action:"change_editor_mode",editor_mode:j,entity_id:e?.id||_||f,project_id:L?.id||h}),p(o.resetToLastActiveSettingsTab()),setTimeout(()=>{p(Xe==="block"?o.setElementSettings({type:null}):o.setElementSettings$1({type:null}))},300),m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),p(o.resetPanes())};(0,l.useEffect)(()=>{b.emailPaneDesktopSize&&p(o.setEmailWidth(b.emailPaneDesktopSize))},[p,b.emailPaneDesktopSize]);const Ub=()=>{gn(o.BLOCKS),Bn("project")};return(0,l.useEffect)(()=>{i&&Ub()},[i]),(0,s.jsx)(o.ElementEntityKindProvider,{kind:Xe,children:(0,s.jsxs)(bm,{className:(0,ot.default)("email-pane",{"email-pane_code-mode":K,"email-pane_only_code_mode_mobile":b.onlyCodeModeInMobile,"email-pane_code-mode-bottom":K&&me==="bottom","email-pane_no-element-navigation":!b.switchDesktopMobilePropsEnabled&&!b.stepToOtherElementEnabled&&!b.deleteButtonEnabled,"email-pane_is-mobile":he,"email-pane_path-enabled":b.pathEnabled}),sidePanelFloating:!!b.sidePanelFloating,isCodeMode:!!K,codeModeDirection:String(me),children:[(0,s.jsxs)(Rm,{className:"email-pane__container",ref:We,children:[(0,s.jsx)(Im,{isCodeMode:K,codeModeDirection:me}),(0,s.jsx)(km,{isShowMobileSettings:he,headless:!!P,templateNotEmAlertEnabled:!!b.templateNotEmAlertShow}),(0,s.jsxs)(y.ui_kit$Row,{ref:Be,className:(0,ot.default)("email-pane__row",{"email-pane__left":K&&me==="right","email-pane__right":K&&me==="left","email-pane__bottom":K&&me==="bottom","email-pane__sizeSwitcher":b.desktopMobileSwitchPanel,"email-pane__reverse":b.menuDirection==="left","email-pane__pinch":!b.sidePanelFloating}),children:[(0,s.jsxs)(Em,{isCodeMode:K,codeModeDirection:me,sidePanelFloating:b.sidePanelFloating,contentWrapperRef:Tb,children:[(0,s.jsx)("div",{className:"email-pane__iframe-scroll-top",id:"iframe-scroll-top"}),b.desktopMobileSwitchPanel&&(0,s.jsxs)(y.ui_kit$Space,{className:"email-pane__sizes-panel-wrapper",orientation:"vertical",size:10,children:[(0,s.jsxs)(y.ui_kit$Space,{className:"email-pane__sizes-panel",size:0,children:[ol("panel"),(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Desktop view"),placement:"top",open:jn,children:(0,s.jsx)(y.ui_kit$Button,{type:he?"text":"primary",icon:(0,s.jsx)(o.EmIcons,{icon:"DesktopOutlined",component:y.icons$DesktopOutlined,size:18,strokeWidth:b.iconStrokeWidth}),shape:"circle",onClick:()=>Zr(b.emailPaneDesktopSize||1e3),className:"toggle_view desktop_view"})}),(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Mobile view"),placement:"top",open:hn,children:(0,s.jsx)(y.ui_kit$Button,{type:he?"primary":"text",icon:(0,s.jsx)(o.EmIcons,{icon:"MobileOutlined",component:y.icons$MobileOutlined,size:18,strokeWidth:b.iconStrokeWidth}),shape:"circle",onClick:()=>Zr(425),className:"toggle_view mobile_view"})})]}),b.codeSideEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Code mode"),placement:"right",children:(0,s.jsx)(y.ui_kit$Button,{type:K?"primary":"default",icon:(0,s.jsx)(o.EmIcons,{icon:"Code",component:y.icons$Code}),shape:"circle",onClick:()=>Bb("right")})})]}),(0,s.jsxs)(y.ui_kit$Row,{className:(0,ot.default)("email-pane__col-wrapper",{container:K&&me==="bottom"||!K,"email-pane__col-wrapper_reverse":b.menuDirection==="left","email-pane__col-wrapper_pinch":!b.sidePanelFloating}),style:{flexGrow:1,maxWidth:"unset",paddingTop:b.desktopMobileSwitchPanel&&K&&me!=="bottom"?"60px":""},children:[(0,s.jsxs)(y.ui_kit$Col,{className:"email-pane__col email-pane__col_preview",style:{flexGrow:1,maxWidth:"unset"},ref:b.sidePanelFloating?null:Me,children:[b.desktopMobileSwitchRule&&(0,s.jsx)(Ld,{onSelectWidth:Zr,themeToggle:ol("rule")}),(0,s.jsxs)(vm,{maxPaneWidth:1200,isCodeMode:K,codeModeDirection:me,isShowMobileSettings:he,desktopMobileSwitchPanel:b.desktopMobileSwitchPanel,children:[(0,s.jsx)("div",{className:"email-pane__handle left",onMouseDown:nl("left"),onMouseEnter:()=>Go("left"),onMouseLeave:Go}),(0,s.jsx)("div",{className:"email-pane__handle right",onMouseDown:nl("right"),onMouseEnter:()=>Go("right"),onMouseLeave:Go}),(0,s.jsx)(wm,{wrapperRef:Se,children:(0,s.jsx)(Fm,{ref:xe,className:"email-pane__iframe",email:e,handlerSendPosition:Mt,clip:kb})})]})]}),(0,s.jsx)(y.ui_kit$Col,{style:{display:K&&me!=="bottom"||b.disableSideMenu?"none":"initial"},ref:Vr,onPointerEnter:jm,className:(0,ot.default)("email-pane__content-col email-pane__content-col_menu email-pane__content-col_tabs email-pane__col email-pane__col_settings",{"email-pane__col_disabled":$===o.DISABLED_TAB}),children:(!K||me==="bottom")&&J&&(0,s.jsx)(y.ui_kit$Tabs,{className:(0,ot.default)("email-pane__col_settings-inner",{"email-pane__col_settings-inner_reverse":b.menuDirection==="left"}),size:"medium",activeKey:$,onTabClick:Pb,renderTabBar:Pm,tabPlacement:"right",items:$n,tabBarExtraContent:Bt&&(0,s.jsx)("div",{style:{paddingTop:15,textAlign:"center"},children:ue?(0,s.jsx)(y.ui_kit$Switch,{variant:"editorMode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:Qs,checked:Ut}):(0,s.jsx)(y.ui_kit$Switch,{variant:"editorMode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:Qs,defaultChecked:Nn})})})})]}),(0,s.jsx)("div",{className:"email-pane__iframe-scroll-bottom",id:"iframe-scroll-bottom"})]}),(0,s.jsxs)(Sm,{isCodeMode:K,codeModeDirection:me,children:[(0,s.jsx)("div",{className:"email-pane__code-divider",onMouseDown:Db}),(0,s.jsx)("div",{className:"code-mode__pane code-mode__pane_editor email-pane__pane email-pane__pane_editor",children:(0,s.jsx)("div",{className:"code-mode__pane-content email-pane__pane-content",children:ie&&(0,s.jsx)(Dm,{email:e,setOtherUsers:Ze,readOnly:b.lockEditor,newEmailAiGeneratorRef:fn})})})]})]}),b.pathEnabled&&(0,s.jsxs)("div",{className:"email-pane__paths",children:[(0,s.jsx)(fu,{elementPath:Ke}),(0,s.jsx)(gu,{fallbackHtml:e?.html})]}),(0,s.jsx)("div",{className:"collaborator-list",children:(0,s.jsx)(o.CollaboratorList,{users:ze,isEditor:!1,isPlugin:!0,token:N})})]}),(0,s.jsx)(Am,{isCodeMode:K,codeModeDirection:me,email:e,onClosePanel:Ot}),(0,s.jsx)(Fu,{}),(0,s.jsx)(o.PlanUpgradePrompt,{open:ht,onCancel:Ab,onTrialActivated:xb,initialSlide:ce}),at&&qe.exceeded?(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(ir,{open:Ne,onClose:je,title:d(at.titleKey),subtitle:d(at.subtitleKey),usageResource:at.usageResource,previousDisplay:o.presetLimitDisplay(qe.exceeded.previousLimit),nextDisplay:o.presetLimitDisplay(qe.exceeded.nextLimit),onChangePlan:Kt})}):null,(0,s.jsx)(yu,{open:ft,onClose:lt}),(0,s.jsx)(bu,{open:G,onClose:V})]})})};pa.propTypes={};var Gm=e=>(0,s.jsx)(cm,{children:(0,s.jsx)(mm,{children:(0,s.jsx)(gm,{children:(0,s.jsx)(pa,{...e})})})}),Wm=(0,l.memo)(Gm),Hm=({open:e,onClose:t})=>{const{__:n}=o.useI18n(),r=o.getSupportEmail(),[i,a=""]=n("To send a test email, you need to confirm your email address. If you haven’t received the confirmation link, contact support in the chat or email {supportEmail}.").split("{supportEmail}");return(0,s.jsx)(y.ui_kit$Modal,{width:440,open:e,onCancel:t,title:(0,s.jsxs)("div",{style:{paddingBottom:8},children:[(0,s.jsx)(o.EmIcons,{icon:"EmailConfirmation",component:y.icons$EmailConfirmation,size:20,strokeWidth:2})," ",n("Email confirmation required")]}),footer:[(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:t,children:n("Got it")},"ok")],children:(0,s.jsxs)("p",{children:[i,(0,s.jsx)("a",{href:`mailto:${r}`,children:r}),a]})})},Qn=e=>{const t=o.useCurrentUser(),[n,r]=(0,l.useState)({owner:!1,admin:!1,user:!1}),i=o.useProjectData(),{data:a}=o.useGetProjectQuery(e,{skip:!e||!t.id||!!i}),c=i||a;return(0,l.useEffect)(()=>{if(c){const d=o.getMyProjectRole(c,t);r({owner:d==="owner",admin:d==="admin",user:d==="user"})}},[c,t]),n},dr=o.getLimitUpgradePresetDefinition("preview_exceeded"),fa=({emailElement:e,isCollaborationEditor:t})=>{const{__:n}=o.useI18n(),r=o.useDispatch(),i=Yo(),a=o.useOpenPlanCatalog(),c=o.useSendPostMessage(),{blockId:d}=o.useRouteParams(),u=o.useRouteEmailId(),m=o.useSelector(o.selectActiveModal$1)===o.MODALS.SEND_TEST_EMAIL,f=kn(m),[h,_]=(0,l.useState)(!1),[p,E]=o.useSendLivePreviewMutation(),k=o.useCurrentUser(),w=o.useDocumentHistoryReader(),b=o.useProjectPlanLimitPreflight(),{owner:x}=Qn(),P=Zo(),Y=Fd(),J=o.useContentReader(),N=o.useSelector(o.selectIsPanelHistoryCollapsed),O=o.useSelector(o.selectIsCodeMode),A=o.useSelector(o.selectCodeModeDirection),{token:L}=(0,y.ui_kit$useToken)(),z=o.useNotification(),B=o.useAppConfig(),$=e.hasOwnProperty("type")?o.BLOCK:o.EMAIL,de=o.useEventEmitter(g.events.ON_SHARE_ID),pe=o.useEventEmitter(g.events.ON_SHOW_PREVIEW_ID),[H,Z]=(0,l.useState)(!1),[De,be]=(0,l.useState)(0),[et,ve]=(0,l.useState)(!1),fe=kn(et),K=(0,l.useCallback)(()=>ve(!1),[]),me=(0,l.useCallback)(()=>{ve(!1),a()},[a]),[ie,ae]=(0,l.useState)(n("—")),[Ae,Te]=(0,l.useState)(!1),Fe=o.useProjectData(),X=o.usePlanFeatureGate("version_history"),Ee=o.usePlanFeatureGate("code_editor"),Ie=o.usePlanFeatureGate("preview_service"),he=o.usePlanFeatureGate("undo_redo"),Re=o.isEditorLockedByPlan(Fe,{isPlugin:!0}),$e=o.usePushToDataLayer(),C=e?.project,T=ge=>{const Ge=$==="block"?"block":"email";typeof ge=="string"?(i.setDirection(ge),!O&&i.toggle()):i.toggle(),$e({event:"activate",action:"activate_code_mode",entity_type:Ge,entity_id:e?.id||u||d,project_id:e?.project||C}),setTimeout(()=>{r($==="block"?o.setElementSettings({type:null}):o.setElementSettings$1({type:null}))},300),c({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),Ee.isLocked&&(Z(!0),be(o.FEATURE_UPSELL_SLIDE.code_editor))},R=(0,l.useCallback)(async()=>!0,[b]),D=async()=>{if(Re){Z(!0),be(8);return}await R()&&(r(o.openModal$1(o.MODALS.SEND_TEST_EMAIL)),$e({event:"open",action:"open_test_email_modal",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C}))},I=()=>{Z(!0),be(o.FEATURE_UPSELL_SLIDE.undo_redo)},S=()=>{P.undo()},se=()=>{P.redo()},we=async()=>{const ge=(await de.fire({project:C,id:u})).find(Ge=>Ge===!1||typeof Ge=="string");ge!==!1&&navigator.clipboard.writeText(ge||o.buildEmailRawShareUrl(u,C)).then(()=>{z.success(n("A shareable link to this page has been copied to the clipboard.")),$e({event:"click",action:"share_email",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C})})},Ke=async()=>{if(!h){if(!await R())return;const ge={email:u,subject:encodeURIComponent("#"+e.project+" "+e.title).replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A"),content:encodeURIComponent(J()).replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A")};p(ge),_(!0),$e({event:"click",action:"open_email_inbox_tests",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C})}},Qe=(0,l.useCallback)(async()=>{await R()&&(ae(n("—")),ve(!0))},[n,R]);(0,l.useEffect)(()=>{E.isError&&(z.error(E),_(!1))},[E]),(0,l.useEffect)(()=>{if(E.isSuccess&&h){if(E.data?.status===401)z.error({title:E.data.code,description:E.data.message});else if(E.data){let ge=document.createElement("A");ge.setAttribute("target","_blank"),ge.setAttribute("href",E.data.message),ge.click()}_(!1)}},[E,h,z]);const[ze,Ze]=(0,l.useState)(!1),mt=()=>{c({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:N}),r(o.switchIsPanelHistoryCollapsed(!N))},vt=()=>w(e?.id),ft=()=>{N?(Ze(!0),vt().then(ge=>{ge.isSuccess?ge.data.data.length:ge.isError&&z.error(ge),mt(),r(o.setActiveSettingsTab(o.HISTORY)),Ze(!1),$e({event:"open",action:"open_version_control",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C}),X.isLocked&&(Z(!0),be(o.FEATURE_UPSELL_SLIDE.version_history))})):(r(o.resetToLastActiveSettingsTab()),mt())},lt=()=>{N||(mt(),r(o.resetToLastActiveSettingsTab())),O&&i.toggle(),Z(!1)};let G=[];const V=(0,l.useCallback)(async()=>{const ge=await pe.fire({project:C,id:u});ge.find(Ge=>Ge===!1||typeof Ge=="string")!==!1&&(window.open(ge.find(Ge=>Ge)||o.buildEmailRawSharePath(u,C)),$e({event:"click",action:"open_email_preview",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C}))},[pe,C,u,$e,$,e,d]),te=(0,l.useCallback)(async()=>{window.open(o.buildGetElementPreviewPath(o.EMAIL,u,C)),$e({event:"click",action:"open_web_version",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C})},[C,u,$e,$,e,d]);B.previewModeEnabled&&G.push({key:"Preview_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Preview mode"),onClick:V}),B.livePreviewEnabled&&G.push({key:"Live_preview",icon:h?(0,s.jsx)(o.EmIcons,{icon:"LoadingOutlined",component:y.icons$LoadingOutlined,style:{fontSize:16}}):(0,s.jsx)(o.EmIcons,{icon:"CheckCircleVerified",component:y.icons$CheckCircleVerified,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Live preview"),onClick:k.id?.toString()===e.project_author?.toString()&&k?.subscription?.post_name==="community"&&x?Qe:Ke}),B.webversionEnabled&&G.push({key:"Web version",icon:(0,s.jsx)(o.EmIcons,{icon:"Web",component:y.icons$Web,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Web version"),onClick:te}),B.sharePreviewEnabled&&G.push({key:"Share",icon:(0,s.jsx)(o.EmIcons,{icon:"ShareAltOutlined",component:y.icons$ShareAltOutlined,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Share"),onClick:we,className:"em-analytics__email-share"});const ue=[{key:"Left_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:B.iconStrokeWidth,style:{color:A==="left"&&O?L.colorPrimary:"inherit"}}),label:n("Left Code panel"),onClick:()=>T("left")},{key:"Right_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:B.iconStrokeWidth,style:{transform:"rotate(180deg)",color:A==="right"&&O?L.colorPrimary:"inherit"}}),label:n("Right Code panel"),onClick:()=>T("right")},{key:"Bottom_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:B.iconStrokeWidth,style:{transform:"rotate(-90deg)",color:A==="bottom"&&O?L.colorPrimary:"inherit"}}),label:n("Bottom Code panel"),onClick:()=>T("bottom")}];return(0,s.jsxs)("div",{className:"email-preview-menu email-preview-menu_new",children:[(0,s.jsxs)(y.ui_kit$Space,{size:32,children:[(0,s.jsxs)(y.ui_kit$Space,{className:"email-preview-menu__versions",size:8,style:{borderRadius:`calc(${o.emCssVar("borderRadius")} * 1px)`},children:[(0,s.jsx)(y.ui_kit$Tooltip,{title:n(t?o.COLLABORATION_EDITOR_WARNING_TEXT:"Undo (Ctrl+Z)"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"UndoOutlined",component:y.icons$UndoOutlined,size:22,strokeWidth:B.iconStrokeWidth}),he.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:he.isLocked?I:S,disabled:!he.isLocked&&!Y.canUndo})}),(0,s.jsx)(y.ui_kit$Tooltip,{title:n(t?o.COLLABORATION_EDITOR_WARNING_TEXT:"Redo (Ctrl+Shift+Z)"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"RedoOutlined",component:y.icons$RedoOutlined,size:22,strokeWidth:B.iconStrokeWidth}),he.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:he.isLocked?I:se,disabled:!he.isLocked&&!Y.canRedo})}),B.historyEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Version history"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:N?"text":"primary",ghost:!N,onClick:ft,disabled:e.isNew||ze,className:"email-preview-menu__history",icon:ze?(0,s.jsx)(y.ui_kit$Spin,{size:"small"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"HistoryOutlined",component:y.icons$HistoryOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon email-preview-menu__list-item-icon_revert"}),X.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]})})})]}),(0,s.jsxs)(y.ui_kit$Space,{size:8,style:{borderRadius:`calc(${o.emCssVar("borderRadius")} * 1px)`},children:[B.codeEnabled&&(0,s.jsx)(y.ui_kit$Dropdown,{arrow:!0,placement:"bottom",menu:{items:ue},trigger:"hover",mouseEnterDelay:0,className:"email-preview-menu__code",children:(0,s.jsx)(y.ui_kit$Button,{type:O?"primary":"text",ghost:O,icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"Code",component:y.icons$Code,size:22,strokeWidth:B.iconStrokeWidth}),Ee.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:T})},"Code mode"),B.previewIconEnabled&&(Ie.isLocked?(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Preview mode"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:()=>{Z(!0),be(o.FEATURE_UPSELL_SLIDE.preview_service)}})}):(0,s.jsx)(y.ui_kit$Dropdown,{arrow:!0,placement:"bottom",menu:{items:G},className:"email-preview-menu__preview",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",target:"_blank",rel:"noreferrer",icon:(0,s.jsx)(o.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),onClick:B.previewModeEnabled?V:void 0})},"Preview")),B.sendTestEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Send a test email"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__email-open-test email-preview-menu__test",type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"SendOutlined",component:y.icons$SendOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),Re&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:D})})]})]}),f&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Mu,{isModalVisible:m,email:e})}),(0,s.jsx)(Hm,{open:Ae,onClose:()=>Te(!1)}),(0,s.jsx)(o.PlanUpgradePrompt,{open:H,onCancel:lt,initialSlide:De}),fe&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(ir,{open:et,onClose:K,title:n(dr.titleKey),subtitle:n(dr.subtitleKey),usageResource:dr.usageResource,previousDisplay:ie,nextDisplay:o.presetLimitDisplay("infinity"),onChangePlan:me})})]})};fa.propTypes={};var qm=[["brace-percent",/<!--\{%/],["brace-hash",/<!--\{#/],["proscript",/<!--\[%/],["getresponse",/<!--\[\[(?:if|else\]\]|endif\]\])/i],["mailchimp",/<!--\*\|/],["expert-sender",/<!--<\/?(?:if|else|var)/i]],Vm=200;function ha(e=new Set){const t=new Set;return(n,r)=>{if(!qm.some(([a,c])=>!e.has(a)&&c.test(n)))return;const i=r??`new:${n.length}:${n.slice(0,200)}`;t.has(i)||(t.size>=Vm&&t.clear(),t.add(i))}}function ga(){return{isConfigured:()=>!1,toEditorForm:e=>e,toOutputForm:e=>e,keepWrappedOnOutput:new Set,editorPolicy:{},warnAboutUnconfiguredInput:ha()}}var Ym=ga();function rn(e){return e?.getInstance(g.TEMPLATE_DIRECTIVES_ID)??Ym}function Km({html:e,renderGuid:t,showToken:n,showId:r,...i},a){const{requested:c}=o.getCurrentProject(a),d=o.getAppConfig(a);return o.filterUndefined({...i,code:rn(a).toOutputForm(e),project:c===void 0?i.project:c,utm_parameters:d.UTMEnabled?i.utm_parameters:void 0,tags:void 0,template:void 0,guid:void 0,emailtags:void 0,project_title:void 0,project_author:void 0,is_template:void 0,is_inited:void 0})}var Qm=zt.__commonJSMin(((e,t)=>{o.init__polyfill_node_global(),(function(n,r){typeof define=="function"&&define.amd?define([],r):typeof e<"u"?r():(r(),n.FileSaver={})})(e,function(){"use strict";function n(m,f){return typeof f>"u"?f={autoBom:!1}:typeof f!="object"&&(f={autoBom:!f}),f.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(m.type)?new Blob(["\uFEFF",m],{type:m.type}):m}function r(m,f,h){var _=new XMLHttpRequest;_.open("GET",m),_.responseType="blob",_.onload=function(){u(_.response,f,h)},_.onerror=function(){},_.send()}function i(m){var f=new XMLHttpRequest;f.open("HEAD",m,!1);try{f.send()}catch{}return 200<=f.status&&299>=f.status}function a(m){try{m.dispatchEvent(new MouseEvent("click"))}catch{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),m.dispatchEvent(f)}}var c=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof o._polyfill_node_global_default=="object"&&o._polyfill_node_global_default.global===o._polyfill_node_global_default?o._polyfill_node_global_default:void 0,d=c.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=c.saveAs||(typeof window!="object"||window!==c?function(){}:"download"in HTMLAnchorElement.prototype&&!d?function(m,f,h){var _=c.URL||c.webkitURL,p=document.createElement("a");f=f||m.name||"download",p.download=f,p.rel="noopener",typeof m=="string"?(p.href=m,p.origin===location.origin?a(p):i(p.href)?r(m,f,h):a(p,p.target="_blank")):(p.href=_.createObjectURL(m),setTimeout(function(){_.revokeObjectURL(p.href)},4e4),setTimeout(function(){a(p)},0))}:"msSaveOrOpenBlob"in navigator?function(m,f,h){if(f=f||m.name||"download",typeof m!="string")navigator.msSaveOrOpenBlob(n(m,h),f);else if(i(m))r(m,f,h);else{var _=document.createElement("a");_.href=m,_.target="_blank",setTimeout(function(){a(_)})}}:function(m,f,h,_){if(_=_||open("","_blank"),_&&(_.document.title=_.document.body.innerText="downloading..."),typeof m=="string")return r(m,f,h);var p=m.type==="application/octet-stream",E=/constructor/i.test(c.HTMLElement)||c.safari,k=/CriOS\/[\d]+/.test(navigator.userAgent);if((k||p&&E||d)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var P=w.result;P=k?P:P.replace(/^data:[^;]*;/,"data:attachment/file;"),_?_.location.href=P:location=P,_=null},w.readAsDataURL(m)}else{var b=c.URL||c.webkitURL,x=b.createObjectURL(m);_?_.location=x:location.href=x,_=null,setTimeout(function(){b.revokeObjectURL(x)},4e4)}});c.saveAs=u.saveAs=u,typeof t<"u"&&(t.exports=u)})})),an=Qm(),In="NEXT_BUTTON",ur="SAVE_BUTTON",mr="KEYBOARD",Xm="EXTERNAL",Jm=new Set([ur,In,mr]);function Zm(e){return e!=null&&e!==""&&Jm.has(e)}function ya(e){if(!e||e==="all")return;const t=Number(e);return Number.isFinite(t)?[t]:void 0}var _a=(0,l.createContext)(null);function ep(){const e=(0,l.useContext)(_a);if(!e)throw new Error("useEmailSaveController must be used within EmailSaveContext.Provider");return e}var tp=2;function np({email:e,documentSession:t,save:n,saveState:r}){const i=o.useDispatch(),{__:a}=o.useI18n(),c=o.useEditorProjectId();o.useRouteEmailId();const d=+c,u=Number.isFinite(d)&&d>0?d:e?.project,m=o.useCookieManager(),f=o.useContainer(),h=o.useNotification(),_=o.useAppConfig(),p=o.useConfigSource(),[E,k]=(0,l.useState)(0),w=(0,l.useRef)(""),[b,x]=(0,l.useState)(!1),P=o.useEventEmitter(g.events.ON_NEXTBUTTON_CLICK_ID),Y=o.useEventEmitter(g.events.ON_SAVEBUTTON_CLICK_ID);o.useEvent(g.events.ON_EMAIL_INIT_ID);const J=_.activeNextButton===!1,N=_.disableDoubleClickNextButton!==!1,O=(0,l.useRef)(!1),A=(0,l.useRef)(void 0),L=(0,l.useRef)(null),z=(0,l.useRef)(null),B=(0,l.useRef)(e);B.current=e;const $=(0,l.useCallback)(()=>{A.current=void 0},[]),de=(0,l.useCallback)(X=>{p.merge({activeNextButton:!X},"user")},[p]),pe=(0,l.useCallback)((X,Ee)=>{const Ie=o.saveRefusalReason(Ee);if(Ie==="locked"){h.error({id:"EMAIL_ACCESS_TO_LOCKED_ERROR",data:o.getEmailDesc(X),message:a("No access to edit the letter.")});return}if(Ie==="too-many-tags"){h.error({id:"EMAIL_TOO_MANY_TAGS_ERROR",data:o.getEmailDesc(X),message:a("Maximum 10 tags available.")});return}const he=o.failedTerms(Ee);if(he){he.failed.forEach(Re=>{if(he.kind==="group"){h.fromError("GROUP_CREATING_ERROR",{id:Re.id??0,name:Re.name,parent:Re.parent??0},Ee);return}h.fromError("TAG_CREATING_ERROR",Re.name,Ee)});return}h.fromError(X.isNew?"EMAIL_CREATING_ERROR":"EMAIL_EDITING_ERROR",o.getEmailDesc(X),Ee)},[h,a]),H=(0,l.useCallback)(X=>{const Ee=Zm(X),Ie=()=>{x(!1),X===In&&(O.current=!1,de(!1))};if(!e){Ie();return}const he=async()=>{($e=>{n("publish",{project:$e.isNew?u:$e.project,folder:ya(m.get(o.APP_COOKIES.em_folder)),source:X}).then(C=>{if(x(!1),O.current=!1,!C){X===In&&de(!1),Ee&&(pe($e,r().error),$());return}Ee&&(h.success({id:"EMAIL_SAVING_SUCCESS",message:a("The email was successfully saved."),data:o.getEmailDesc($e)}),$())})})(e)};x(!0),he()},[e,i,c,a,t,m,u,h,pe,n,r,de,$]);o.useCommand(o.SAVE_COMMAND_ID,(0,l.useCallback)(X=>H(X||Xm),[H]));const Z=(0,l.useRef)(void 0),De=(0,l.useRef)(H);De.current=H;const be=(0,l.useCallback)(X=>{w.current=X,k(Ee=>Ee+1)},[]);(0,l.useEffect)(()=>()=>{Z.current!==void 0&&clearTimeout(Z.current)},[]),(0,l.useEffect)(()=>{if(E===0)return;const X=w.current;B.current?.isNew&&(A.current=X),Z.current!==void 0&&clearTimeout(Z.current),Z.current=setTimeout(()=>{Z.current=void 0,De.current(X)})},[E]);const et=(0,l.useCallback)(X=>{(X.ctrlKey||X.metaKey)&&X.keyCode===83&&(X.preventDefault(),be(mr))},[be]);(0,l.useEffect)(()=>(document.addEventListener("keydown",et),()=>{document.removeEventListener("keydown",et)}),[et]);const ve=(0,l.useCallback)(X=>{const Ee=X.data.operation,Ie=X.data.action;Ee===o.EVENT_TYPES.APPLICATION_ACTION&&Ie==="save_email"&&be(mr)},[be]);o.useListenPostMessage(ve),(0,l.useEffect)(()=>{e?.isNew&&(z.current=null,L.current=null)},[e?.isNew,e?.renderGuid]),(0,l.useEffect)(()=>{O.current=!1},[e?.id]);const fe=m.get(o.APP_COOKIES.em_folder),K=f?o.provideAutosaveUiFacts(f):void 0;(0,l.useEffect)(()=>{K?.set({...K?.get()??{isUserBusy:!1,saveContext:{}},saveContext:{project:u,folder:ya(fe)}})},[K,u,fe]);const me=(0,l.useRef)(!1),ie=r().failures;(0,l.useEffect)(()=>{ie>=tp&&!me.current&&(me.current=!0,h.warning({message:a("Changes are not being saved. Check your connection.")})),ie===0&&(me.current=!1)},[ie,h,a]);const ae=b,Ae=r().saving,Te=(0,l.useCallback)(X=>{be(X||ur)},[be]),Fe=(0,l.useCallback)(async(X,Ee)=>{if(X===In){if(O.current)return;O.current=!0;try{N&&de(!0),(await P.fire(Ee)).every(Ie=>Ie!==!1)?be(In):(de(!1),O.current=!1)}catch(Ie){h.fromError("NEXT_BUTTON_CLICK_EVENT_ERROR",o.getEmailDesc(Ee),Ie,!0),de(!1),O.current=!1}return}try{(await Y.fire(Ee)).every(Ie=>Ie!==!1)&&be(X||ur)}catch(Ie){h.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",o.getEmailDesc(Ee),Ie,!0)}},[N,P,Y,h,de,be]);return(0,l.useMemo)(()=>({requestSave:Te,requestSaveWithEvents:Fe,isLoading:ae,isAutosaveLoading:Ae,nextButtonDisabled:J}),[Te,Fe,ae,Ae,J])}var op="NEXT_BUTTON",rp="SAVE_BUTTON",ba=({email:e=null,disabled:t})=>{const{__:n}=o.useI18n(),r=o.useAppConfig(),i=o.useContentReader(),a=o.useNotification(),{requestSaveWithEvents:c,isLoading:d,isAutosaveLoading:u,nextButtonDisabled:m}=ep(),f=d||u,[h,_]=(0,l.useState)(null);(0,l.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&_(!0)},[]);const p=r.saveButtonEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n(h?"Save by ⌘S":"Save by Ctrl+S"),placement:"bottom",children:(0,s.jsx)("span",{className:"em-analytics__email-save-tooltip-target",children:(0,s.jsx)(y.ui_kit$Button,{disabled:t||u,type:r.nextButtonEnabled?"default":"primary",block:"false",className:"em-analytics__email-save",loading:f,icon:(0,s.jsx)(o.EmIcons,{icon:"SaveOutlined",component:y.icons$SaveOutlined,size:16,strokeWidth:r.iconStrokeWidth}),onClick:async k=>{const w=k.currentTarget,b={...e,html:i()};try{await c(rp,b)}catch(x){a.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",o.getEmailDesc(b),x,!0)}finally{try{w?.blur?.()}catch{}}},children:r.saveButtonText||n("Save")})})},"save-button"),E=r.nextButtonEnabled&&(0,s.jsx)(y.ui_kit$Button,{disabled:t||m,type:"primary",block:"false",className:"em-analytics__email-save",icon:r.primaryCommandButtonIcon,loading:d,onClick:async()=>{const k={...e,html:i()};await c(op,k)},children:r.nextButtonText||n("Continue")},"next-button");return(0,s.jsx)(s.Fragment,{children:r.saveButtonEnabled&&r.nextButtonEnabled?(0,s.jsx)(y.ui_kit$Space,{children:[p,E]}):[p,E]})};ba.propTypes={email:Ue.default.shape({id:Ue.default.string,isNew:Ue.default.bool,title:Ue.default.string,lock:Ue.default.bool,subject:Ue.default.string,html:Ue.default.string,description:Ue.default.string,utm_parameters:Ue.default.shape({utm_source:Ue.default.string,utm_medium:Ue.default.string,utm_campaign:Ue.default.string,utm_term:Ue.default.string,utm_content:Ue.default.string}),project:Ue.default.number,is_template:Ue.default.bool}),disabled:Ue.default.bool};var va=({element:e,context:t="list"})=>{const{__:n,_x:r}=o.useI18n(),[i]=o.useEditEmailMutation(),[a]=o.useEditBlockMutation(),c=o.useNotification(),d=o.usePushToDataLayer();e.hasOwnProperty("type");const u=(f,h)=>{if(f.error)return c.error(f),!1;c.success(n("The ")+(h.hasOwnProperty("type")?n("block"):r("email","letter"))+" "+n("“")+f.data.title+n("”")+n("was successfully")+" "+(h.lock?h.hasOwnProperty("type")?r("unlocked.","block"):r("unlocked.","email"):h.hasOwnProperty("type")?r("locked.","block"):r("locked.","email")))},m=()=>{const f=!e.lock,h=f?"lock_email":"unlock_email";e.hasOwnProperty("type")?a({blockId:e.id,lock:f}).then(_=>{u(_,e),_.error||d({event:f?"lock":"unlock",action:f?"lock_block":"unlock_block",entity_type:"block",entity_id:e.id,project_id:e.project,context:t})}):i({emailId:e.id,lock:f}).then(_=>{u(_,e),_.error||d({event:f?"lock":"unlock",action:h,entity_type:"email",entity_id:e.id,project_id:e.project,context:t})})};return(0,s.jsx)("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:m,children:e.lock?n("Unlock"):n("Lock")})};va.propTypes={element:Ue.default.shape({lock:Ue.default.bool,id:Ue.default.string})};var ip=({open:e,codeSize:t,onMinimize:n,onDownloadAsIs:r,onCancel:i})=>{const{__:a}=o.useI18n(),c=o.formatCodeSize(t);return(0,s.jsx)(y.ui_kit$Modal,{open:e,onCancel:i,footer:null,className:"code-size-warning-modal",width:480,children:(0,s.jsxs)("div",{className:"code-size-warning-modal__content",children:[(0,s.jsx)("h3",{className:"code-size-warning-modal__title",children:a("Code Size Warning")}),(0,s.jsxs)("div",{className:"code-size-warning-modal__message",children:[(0,s.jsxs)("p",{children:[a("The current code size is")," ",(0,s.jsx)("strong",{children:c}),","," ",a("which exceeds the recommended 90 KB limit.")]}),(0,s.jsx)("p",{children:a("Large emails may have delivery issues and load slowly. We recommend minimizing code before exporting.")})]}),(0,s.jsxs)(y.ui_kit$Space,{className:"code-size-warning-modal__actions",size:"medium",children:[(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:n,size:"large",children:a("Minimize code")}),(0,s.jsx)(y.ui_kit$Button,{onClick:r,size:"large",children:a("Download as is")})]})]})})};function ap(e){return e.includes("em-narrow-table")}function sp(e){if(!e||ap(e))return!1;const t=e.includes("nl-container"),n=/row-content\s+stack/.test(e)||/stack\s+row-content/.test(e),r=/\brow-\d/.test(e),i=/_block\s+block-\d/.test(e),a=e.includes('role="presentation"');return t&&n&&(r||i)&&a}function lp(e){return e?e.includes("em-narrow-table"):!1}function cp(e){return e.includes("em-narrow-table")}function dp(e){return e.includes("i-amphtml")||e.includes("amp-runtime")||e.includes("amp-version")}function up(e){if(!e||cp(e)||dp(e))return!1;const t=e.includes("es-wrapper"),n=/es-(?:header|content|footer)-body/.test(e);return t||n}function Ea(){o.useAppConfig();const e=o.useIntegratorConfigValue("beeFreeConverterEnabled"),t=o.useIntegratorConfigValue("stripoConverterEnabled"),n=o.useIntegratorConfigValue("aiLayoutConverterEnabled"),r=e===!0,i=t===!0,a=n===!0;return{beeFreeConverterEnabled:r,stripoConverterEnabled:i,aiLayoutConverterEnabled:a,anyConverterEnabled:r||i||a}}function Sa(e,t){return!e||lp(e)?null:sp(e)?t.beeFreeConverterEnabled?"beefree":null:up(e)?t.stripoConverterEnabled?"stripo":null:t.aiLayoutConverterEnabled?"ai":null}var mp=()=>"emailmaker",pp={unisender:{id:"unisender",name:"Unisender",icon:"/images/integrations/unisender.svg",description:"Export emails to Unisender",cardDescription:"Mass mailing automation, audience segmentation, and campaign performance analytics.",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Unisender API key",helpUrl:"https://app.unisender.com/ru/v5/cp/user/info/api"},{name:"sender_email",type:"email",label:"Sender Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Unisender"},{name:"sender_name",type:"text",label:"Sender Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"number",label:"Contact List ID",required:!0,placeholder:"e.g., 123456"}]},mailganer:{id:"mailganer",name:"Mailganer",icon:"/images/integrations/mailganer.svg",description:"Export emails to Mailganer",cardDescription:"Contact sync, content personalization, and real-time campaign results tracking.",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Mailganer API key",helpUrl:"https://mailganer.com/app/profile/"},{name:"from_email",type:"email",label:"Sender Email",required:!1,placeholder:"sender@example.com",extra:"This email must be verified in Mailganer"},{name:"from_name",type:"text",label:"Sender Name",required:!1,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Mailing Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"theme",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},sendsay:{id:"sendsay",name:"Sendsay",icon:"/images/integrations/sendsay.svg",description:"Export emails to Sendsay",cardDescription:"Mailing automation, audience segmentation, and email personalization.",apps:["emailmaker"],settingsFields:[{name:"login",type:"text",label:"Account Login",required:!0,placeholder:"e.g., myaccount or myaccount/sublogin",extra:"Your Sendsay account login (not email). For sublogin use format: account/sublogin",fullWidth:!0},{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Sendsay API key",helpUrl:"https://docs.sendsay.ru/sendsay-api/how-to-get-apikey"},{name:"from_email",type:"email",label:"Sender Email",required:!1,placeholder:"sender@example.com",extra:"This email must be verified in Sendsay"},{name:"from_name",type:"text",label:"Sender Name",required:!1,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Draft Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!0,placeholder:"e.g., Special offer for you!"}]},klaviyo:{id:"klaviyo",name:"Klaviyo",icon:"/images/integrations/klaviyo.svg",description:"Export emails to Klaviyo",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"e.g., pk_xxxxxxxx",helpUrl:"https://help.klaviyo.com/hc/en-us/articles/7423954176283-How-to-create-a-private-API-key",extra:"Use a custom key with templates:write and campaigns:write (or Full access). Campaigns-only is not enough — export creates a template first."},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Klaviyo"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., ABC123",helpText:"Find your List ID in Klaviyo: Lists & Segments → List → Settings"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},campaign_monitor:{id:"campaign_monitor",name:"Campaign Monitor",icon:"/images/integrations/campaign_monitor.svg",description:"Export emails to Campaign Monitor",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://help.campaignmonitor.com/s/article/api-keys"},{name:"client_id",type:"text",label:"Client ID",required:!0,placeholder:"e.g., 4a397ccaaa55eb4e6aa1221e1e2d7122",helpText:"Find in Account Settings → API Keys"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Campaign Monitor"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",helpText:"Find in Lists → List ID"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},constant_contact:{id:"constant_contact",name:"Constant Contact",icon:"/images/integrations/constant_contact.svg",description:"Export emails to Constant Contact",apps:["useblocks"],settingsFields:[{name:"access_token",type:"password",label:"Access Token",required:!0,placeholder:"OAuth2 Bearer token",fullWidth:!0,helpText:"Get from Constant Contact Developer Portal. Token expires in 24 hours.",helpUrl:"https://developer.constantcontact.com/api_guide/getting_started.html"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be confirmed in Constant Contact"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"text",label:"Contact List ID",required:!0,placeholder:"e.g., fa32f620-6d82-11e8-8b59-fa163e56c9b0",helpText:"Find via GET /contact_lists API"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},bento:{id:"bento",name:"Bento",icon:"/images/integrations/bento.svg",description:"Export emails to Bento",apps:["useblocks"],settingsFields:[{name:"publishable_key",type:"password",label:"Publishable Key",required:!0,placeholder:"Enter Publishable Key",fullWidth:!0,helpUrl:"https://app.bentonow.com/account/teams"},{name:"secret_key",type:"password",label:"Secret Key",required:!0,placeholder:"Enter Secret Key",fullWidth:!0},{name:"site_uuid",type:"text",label:"Site UUID",required:!0,placeholder:"Your site UUID",helpText:"Find in Bento dashboard"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be an author in your Bento account"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Broadcast Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"},{name:"inclusive_tags",type:"text",label:"Tags (inclusive)",required:!1,placeholder:"e.g., subscribers,newsletter",helpText:"Comma-separated tags to send to. Default: subscribers"}]},dotdigital:{id:"dotdigital",name:"Dotdigital",icon:"/images/integrations/dotdigital.svg",description:"Export emails to Dotdigital",apps:["useblocks"],settingsFields:[{name:"username",type:"text",label:"API Username",required:!0,placeholder:"API user email",helpText:"API user email from Settings → Access → API users",helpUrl:"https://developer.dotdigital.com/docs/setting-up-an-api-user"},{name:"password",type:"password",label:"API Password",required:!0,placeholder:"API user password",fullWidth:!0},{name:"region",type:"text",label:"Region",required:!0,placeholder:"r1, r2, or r3",helpText:"r1=Europe, r2=North America, r3=Asia Pacific"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",fullWidth:!0,extra:"Use an email registered as a Custom from address in Dotdigital (see support.dotdigital.com — “Create a custom from address”). If it does not match, export uses your account default sender."},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},getresponse:{id:"getresponse",name:"GetResponse",icon:"/images/integrations/getresponse.svg",description:"Export emails to GetResponse",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://app.getresponse.com/api"},{name:"from_field_id",type:"text",label:"From Field ID",required:!0,placeholder:"e.g., V",helpText:"Find via GET /from-fields API"}],exportFields:[{name:"name",type:"text",label:"Newsletter Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"campaign_id",type:"text",label:"Campaign ID",required:!0,placeholder:"e.g., C",helpText:"List/campaign ID from GET /campaigns"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},brevo:{id:"brevo",name:"Brevo",icon:"/images/integrations/brevo.svg",description:"Export emails to Brevo",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://help.brevo.com/hc/en-us/articles/209467485-Create-and-manage-your-API-keys"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Brevo"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"number",label:"List ID",required:!0,placeholder:"e.g., 2",helpText:"Find in Contacts → Lists"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},activecampaign:{id:"activecampaign",name:"ActiveCampaign",icon:"/images/integrations/activecampaign.svg",description:"Export emails as draft campaigns to ActiveCampaign",apps:["useblocks"],settingsFields:[{name:"api_url",type:"text",label:"API URL",required:!0,placeholder:"e.g., https://youraccount.api-us1.com",helpText:"Find in Settings → Developer → API Access",helpUrl:"https://help.activecampaign.com/hc/en-us/articles/207317590-Getting-started-with-the-API"},{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0},{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., 1",extra:"Find in Lists → Click your list → The ID is in the URL (e.g., /app/contacts?listid=1)"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in ActiveCampaign"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},salesforce_mc:{id:"salesforce_mc",name:"Salesforce",icon:"/images/integrations/salesforce.svg",description:"Export emails to Salesforce",apps:["useblocks"],settingsFields:[{name:"subdomain",type:"text",label:"Tenant Subdomain",required:!0,placeholder:"e.g., mc563885gzs27c5t9-63k636ttgm",helpText:"Find in Installed Packages → API Integration → REST Base URI",helpUrl:"https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/your-subdomain-tenant-specific-endpoints.html"},{name:"client_id",type:"text",label:"Client ID",required:!0,placeholder:"From Installed Package"},{name:"client_secret",type:"password",label:"Client Secret",required:!0,placeholder:"From Installed Package"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Marketing Cloud"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Email Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},hubspot:{id:"hubspot",name:"HubSpot Email",icon:"/images/integrations/hubspot.svg",description:"Export emails to HubSpot",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"Private App Access Token",required:!0,placeholder:"e.g., pat-na1-xxxx",helpUrl:"https://developers.hubspot.com/docs/api/private-apps"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in HubSpot"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Email Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},mailchimp:{id:"mailchimp",name:"Mailchimp",icon:"/images/integrations/mailchimp.svg",description:"Export emails to Mailchimp",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"e.g., xxxxxxxx-us1",helpUrl:"https://mailchimp.com/help/about-api-keys/"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Mailchimp"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"text",label:"Audience ID",required:!0,placeholder:"e.g., a1b2c3d4e5",helpText:"Find your Audience ID in Audience settings → Audience name and defaults"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},enkod:{id:"enkod",name:"enKod",icon:"/images/integrations/enkod.svg",description:"Export emails to enKod",cardDescription:"Multi-channel campaigns automation (email, SMS, push, WhatsApp, and more).",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter enKod API key",helpUrl:"https://help.enkod.io/doku.php/api:start"},{name:"sender_email",type:"email",label:"Sender Email",required:!0,placeholder:"sender@example.com"},{name:"sender_name",type:"text",label:"Sender Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"subject",type:"text",label:"Email Subject",required:!0,placeholder:"e.g., Special offer for you!"}]}},fp=(e,t)=>!e.apps||e.apps.length===0?!0:e.apps.includes(t),pr=e=>{const t=pp[e];if(t&&fp(t,mp()))return t},hp=(e,t)=>{const n={placeholder:e.placeholder?t(e.placeholder):void 0,style:{width:"100%"}};switch(e.type){case"number":return(0,s.jsx)(y.ui_kit$InputNumber,{...n,min:1});case"email":return(0,s.jsx)(y.ui_kit$Input,{...n,type:"email"});default:return(0,s.jsx)(y.ui_kit$Input,{...n})}},gp=({integration:e,visible:t,loading:n=!1,onConfirm:r,onCancel:i,__:a})=>{const[c]=y.ui_kit$Form.useForm(),d=e.exportFields||[];(0,l.useEffect)(()=>{t||c.resetFields()},[t,c]);const u=()=>{n||c.validateFields().then(h=>{r(h)})},m=()=>{c.resetFields(),i()};if(d.length===0)return null;const f=d.find(h=>h.helpText);return(0,s.jsxs)(y.ui_kit$Modal,{title:a(`Export to ${e.name}`),open:t,onOk:u,onCancel:m,okText:a("Export"),cancelText:a("Cancel"),confirmLoading:n,cancelButtonProps:{disabled:n},children:[f&&(0,s.jsx)(y.ui_kit$Alert,{title:a(f.label),description:a(f.helpText),type:"info",showIcon:!0,style:{marginBottom:16}}),(0,s.jsx)(y.ui_kit$Form,{form:c,layout:"vertical",children:d.map(h=>(0,s.jsx)(y.ui_kit$Form.Item,{label:a(h.label),name:h.name,rules:[...h.required?[{required:!0,message:a(`Please enter ${h.label.toLowerCase()}`)}]:[],...h.type==="number"?[{type:"number",message:a(`${h.label} must be a number`)}]:[]],children:hp(h,a)},h.name))})]})},Xn=o.createApi({reducerPath:"unisenderApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmailMessage:e.mutation({query:t=>{const n="https://api.unisender.com/ru/api/createEmailMessage",r=new URLSearchParams;return r.append("format","json"),Object.entries(t).forEach(([i,a])=>{r.append(i,String(a))}),{url:`?proxy_url=${encodeURIComponent(n)}`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()}}})})}),{useCreateEmailMessageMutation:yp}=Xn,Jn=o.createApi({reducerPath:"mailganerApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://mailganer.com"}),endpoints:e=>({createMailing:e.mutation({query:t=>{const n=new URLSearchParams;return n.append("api_key",t.api_key),n.append("name",t.name),n.append("html-content",t.html_content),t.theme&&n.append("theme",t.theme),t.from_name&&n.append("from_name",t.from_name),t.from_email&&n.append("from_email",t.from_email),t.segment_id&&n.append("segment_id",String(t.segment_id)),t.utm_campaign&&n.append("utm_campaign",t.utm_campaign),t.utm_source&&n.append("utm_source",t.utm_source),t.utm_medium&&n.append("utm_medium",t.utm_medium),{url:"/api/v1/mailing/create/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()}}})})}),{useCreateMailingMutation:_p}=Jn,Zn=o.createApi({reducerPath:"sendsayApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://api.sendsay.ru"}),endpoints:e=>({createDraft:e.mutation({query:t=>{const n={action:"issue.draft.set",apikey:t.api_key,return_fresh_obj:1,obj:{name:t.name,letter:{subject:t.subject,"from.name":t.from_name||void 0,"from.email":t.from_email||void 0,message:{html:t.html_content}}}};return{url:`/general/api/v100/json/${t.login.split("/").map(r=>encodeURIComponent(r)).join("/")}`,method:"POST",headers:{"Content-Type":"application/json"},body:n}}})})}),{useCreateDraftMutation:bp}=Zn,eo=o.createApi({reducerPath:"altcraftApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({addTemplate:e.mutation({query:t=>{const n=`${t.api_url}/api/v1.1/templates/add`,r={token:t.api_key,name:t.name,channels:[{sid:"email",fields:{html:t.html_content,text:"",subject:t.subject||t.name,from_email:t.from_email||"",from_name:t.from_name||"",replyto_email:"",replyto_name:"",is_not_inline:!0}}],is_draft:t.is_draft??!1};return{url:`?proxy_url=${encodeURIComponent(n)}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}}})})}),{useAddTemplateMutation:vp}=eo,Ep=e=>e.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/\s+/g," ").trim(),to=o.createApi({reducerPath:"enkodApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://api.enkod.ru"}),endpoints:e=>({createMessage:e.mutation({query:t=>{const n=Ep(t.html_content)||t.subject,r={message:{subject:t.subject,fromEmail:t.sender_email||"",fromName:t.sender_name||"",html:t.html_content,plainText:n},isDraft:!0};return{url:"/v1/message/onetime/",method:"POST",headers:{"Content-Type":"application/json",Apikey:t.api_key},body:r}}})})}),{useCreateMessageMutation:Sp}=to,wp=e=>{const t=e.split("-");return t.length>1?t[1]:"us1"},kp=e=>`https://${wp(e)}.api.mailchimp.com/3.0`,no=o.createApi({reducerPath:"mailchimpApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=kp(t.api_key),c=btoa(`anystring:${t.api_key}`),d={type:"regular",recipients:{list_id:t.list_id},settings:{subject_line:t.subject,from_name:t.from_name,reply_to:t.from_email}},u=await i({url:`?proxy_url=${encodeURIComponent(`${a}/campaigns`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Basic ${c}`},body:JSON.stringify(d)});if(u.error){const _=u.error,p=_?.data?.detail||_?.error||String(u.error),E=_?.data?.errors;return{error:{status:"CUSTOM_ERROR",error:E?.length?E.map(k=>k.detail||k.title).join("; "):p}}}const m=u.data;if(!m?.id)return{error:{status:"CUSTOM_ERROR",error:u.data?.errors?.map(_=>_.detail||_.title).join("; ")||"Failed to create campaign"}};const f={html:t.html},h=await i({url:`?proxy_url=${encodeURIComponent(`${a}/campaigns/${m.id}/content`)}`,method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Basic ${c}`},body:JSON.stringify(f)});if(h.error){const _=h.error;return{error:{status:"CUSTOM_ERROR",error:_?.data?.detail||_?.error||String(h.error)}}}return{data:{id:m.id,status:m.status,web_id:m.web_id}}}})})}),{useCreateCampaignMutation:Cp}=no,fr="https://a.klaviyo.com/api",Tp="2025-04-15",Ip=e=>({"Content-Type":"application/json",Accept:"application/json",Authorization:`Klaviyo-API-Key ${e}`,revision:Tp}),oo=o.createApi({reducerPath:"klaviyoApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=Ip(t.api_key),c={data:{type:"template",attributes:{name:`Email ${Date.now()}`,editor_type:"CODE",html:t.html}}},d=await i({url:`?proxy_url=${encodeURIComponent(`${fr}/templates`)}`,method:"POST",headers:a,body:JSON.stringify(c)});if(d.error){const w=d.error,b=w?.data?.errors,x=w?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:b?.length?b.map(P=>P.detail||P.status).join("; "):x||w?.error||String(d.error)}}}const u=d.data?.data?.id;if(!u)return{error:{status:"CUSTOM_ERROR",error:"Failed to create template"}};const m={data:{type:"campaign",attributes:{name:`Campaign ${Date.now()}`,audiences:{included:[t.list_id],excluded:[]},send_strategy:{method:"immediate"},"campaign-messages":{data:[{type:"campaign-message",attributes:{definition:{channel:"email",label:t.subject,content:{subject:t.subject,from_email:t.from_email,from_label:t.from_name,reply_to_email:t.from_email}}}}]}}}},f=await i({url:`?proxy_url=${encodeURIComponent(`${fr}/campaigns`)}`,method:"POST",headers:a,body:JSON.stringify(m)});if(f.error){const w=f.error,b=w?.data?.errors,x=w?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:b?.length?b.map(P=>P.detail||P.status).join("; "):x||w?.error||String(f.error)}}}const h=f.data,_=h?.data?.relationships?.["campaign-messages"]?.data?.[0]?.id,p=h?.data?.id;if(!_)return{error:{status:"CUSTOM_ERROR",error:"Failed to get campaign message from campaign"}};const E={data:{type:"campaign-message",id:_,relationships:{template:{data:{type:"template",id:u}}}}},k=await i({url:`?proxy_url=${encodeURIComponent(`${fr}/campaign-message-assign-template`)}`,method:"POST",headers:a,body:JSON.stringify(E)});if(k.error){const w=k.error,b=w?.data?.errors,x=w?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:b?.length?b.map(P=>P.detail||P.status).join("; "):x||w?.error||String(k.error)}}}return{data:{id:p,campaign_message_id:_}}}})})}),{useCreateCampaignMutation:Ap}=oo,xp="https://api.hubapi.com",Pp=e=>({"Content-Type":"application/json",Authorization:`Bearer ${e}`}),ro=o.createApi({reducerPath:"hubspotApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmail:e.mutation({queryFn:async(t,n,r,i)=>{const a=Pp(t.api_key),c={name:t.name,subject:t.subject,from:{fromName:t.from_name,replyTo:t.from_email},content:{templatePath:"@hubspot/email/dnd/plain_text.html",widgets:{"module-0-1-1":{body:{html:t.html,path:"@hubspot/rich_text",schema_version:2},child_css:{},css:{},id:"module-0-1-1",name:"module-0-1-1",order:2,styles:{},type:"module"},"module-1-1-1":{body:{align:"center",path:"@hubspot/email_footer",schema_version:2,unsubscribe_link_type:"both"},child_css:{},css:{},id:"module-1-1-1",name:"module-1-1-1",order:3,styles:{},type:"module"}}}},d=await i({url:`?proxy_url=${encodeURIComponent(`${xp}/marketing/v3/emails/`)}`,method:"POST",headers:a,body:JSON.stringify(c)});if(d.error){const m=d.error,f=m?.data?.errors,h=m?.data?.message;return{error:{status:"CUSTOM_ERROR",error:f?.length?f.map(_=>_.message||_.errorType).join("; "):h||m?.error||String(d.error)}}}const u=d.data;return u?.id?{data:{id:u.id}}:{error:{status:"CUSTOM_ERROR",error:d.data?.errors?.map(m=>m.message||m.errorType).join("; ")||"Failed to create email"}}}})})}),{useCreateEmailMutation:Rp}=ro,io=o.createApi({reducerPath:"salesforceMcApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmail:e.mutation({queryFn:async(t,n,r,i)=>{const a=`https://${t.subdomain}.auth.marketingcloudapis.com/v2/token`,c=await i({url:`?proxy_url=${encodeURIComponent(a)}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:t.client_id,client_secret:t.client_secret})});if(c.error){const p=c.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_description||p?.data?.error||p?.error||String(c.error)}}}const d=c.data,u=d?.access_token,m=d?.rest_instance_url;if(!u||!m)return{error:{status:"CUSTOM_ERROR",error:d?.error_description||d?.error||"Failed to get access token"}};const f={name:t.name,assetType:{id:208,name:"htmlemail"},views:{html:{content:t.html},text:{},subjectline:{content:t.subject},preheader:{}},data:{email:{options:{characterEncoding:"utf-8"}}}},h=await i({url:`?proxy_url=${encodeURIComponent(`${m.replace(/\/$/,"")}/asset/v1/content/assets`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify(f)});if(h.error){const p=h.error,E=p?.data?.errors,k=p?.data?.message;return{error:{status:"CUSTOM_ERROR",error:E?.length?E.map(w=>w.message||w.documentation).join("; "):k||p?.error||String(h.error)}}}const _=h.data;return _?.id?{data:{id:_.id}}:{error:{status:"CUSTOM_ERROR",error:h.data?.errors?.map(p=>p.message).join("; ")||"Failed to create email"}}}})})}),{useCreateEmailMutation:jp}=io,Lp=e=>e.replace(/\/$/,""),Op=e=>e.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim()||" ",ao=o.createApi({reducerPath:"activecampaignApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=Lp(t.api_url),c=t.api_key,d={"Content-Type":"application/json","Api-Token":c},u=await i({url:`?proxy_url=${encodeURIComponent(`${a}/api/3/addresses`)}`,method:"GET",headers:{"Api-Token":c}});if(u.error)return{error:{status:"CUSTOM_ERROR",error:"Failed to load mailing addresses. Check your API URL and Key."}};const m=u.data?.addresses??[],f=m.find(P=>P.isDefault==="1")??m[0];if(!f?.id)return{error:{status:"CUSTOM_ERROR",error:"NO_MAILING_ADDRESS"}};const h={message:{name:t.name,fromname:t.from_name,fromemail:t.from_email,email:t.from_email,reply2:t.from_email,subject:t.subject,html:t.html,text:Op(t.html),preheader_text:"",format:"mime"}},_=await i({url:`?proxy_url=${encodeURIComponent(`${a}/api/3/messages`)}`,method:"POST",headers:d,body:JSON.stringify(h)});if(_.error){const P=_.error;return{error:{status:"CUSTOM_ERROR",error:P?.data?.message||P?.error||"Failed to create message."}}}const p=_.data?.message?.id;if(!p)return{error:{status:"CUSTOM_ERROR",error:"Message created but no ID returned."}};const E=`${a}/admin/api.php?api_action=campaign_create&api_output=json`,k=new URLSearchParams;k.append("type","single"),k.append("name",t.name),k.append("sdate","2099-12-31 12:00:00"),k.append("status","0"),k.append("public","1"),k.append("trackreads","1"),k.append("tracklinks","all"),k.append("htmlunsub","1"),k.append("textunsub","1"),k.append("addressid",String(f.id)),k.append(`p[${t.list_id}]`,t.list_id),k.append(`m[${p}]`,"100");const w=await i({url:`?proxy_url=${encodeURIComponent(E)}`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","Api-Token":c},body:k.toString()});if(w.error){const P=w.error;return{error:{status:"CUSTOM_ERROR",error:P?.data?.result_message||P?.error||"Message created, but campaign creation failed."}}}const b=w.data;if(Number(b?.result_code)===0)return{error:{status:"CUSTOM_ERROR",error:b?.result_message||"Campaign creation failed (v1 API)."}};const x=b?.id;return x?{data:{campaignId:String(x)}}:{error:{status:"CUSTOM_ERROR",error:b?.result_message||"Campaign created but no ID returned."}}}})})}),{useCreateCampaignMutation:Mp}=ao,Np="https://api.brevo.com/v3",so=o.createApi({reducerPath:"brevoApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a={name:t.name,subject:t.subject,sender:{name:t.from_name,email:t.from_email},htmlContent:t.html,recipients:{listIds:[t.list_id]}},c=await i({url:`?proxy_url=${encodeURIComponent(`${Np}/emailCampaigns`)}`,method:"POST",headers:{"Content-Type":"application/json","api-key":t.api_key},body:JSON.stringify(a)});if(c.error){const u=c.error;return{error:{status:"CUSTOM_ERROR",error:u?.data?.message||u?.data?.code||u?.error||String(c.error)}}}const d=c.data;return d?.id?{data:{id:d.id}}:{error:{status:"CUSTOM_ERROR",error:c.data?.message||"Failed to create campaign"}}}})})}),{useCreateCampaignMutation:Dp}=so,Fp="https://api.createsend.com/api/v3.3",Bp=e=>`Basic ${btoa(`${e}:x`)}`,lo=o.createApi({reducerPath:"campaignMonitorApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a={Name:t.name,Subject:t.subject,FromName:t.from_name,FromEmail:t.from_email,ReplyTo:t.from_email,HtmlUrl:t.html_url,ListIDs:[t.list_id],InlineCss:!0},c=await i({url:`?proxy_url=${encodeURIComponent(`${Fp}/campaigns/${t.client_id}.json`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:Bp(t.api_key)},body:JSON.stringify(a)});if(c.error){const m=c.error;return{error:{status:"CUSTOM_ERROR",error:m?.data?.Message||m?.error||String(c.error)}}}const d=c.data,u=typeof d=="string"?d:d?.id;return!u||typeof u!="string"?{error:{status:"CUSTOM_ERROR",error:d?.Message||"Failed to create campaign"}}:{data:{id:u}}}})})}),{useCreateCampaignMutation:Up}=lo,wa="https://api.cc.email/v3",$p=e=>e.includes("[[trackingImage]]")?e:e.replace(/<body([^>]*)>/i,"<body$1>[[trackingImage]]"),co=o.createApi({reducerPath:"constantContactApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=$p(t.html),c={name:t.name,email_campaign_activities:[{format_type:5,from_email:t.from_email,reply_to_email:t.from_email,from_name:t.from_name,subject:t.subject,html_content:a}]},d=await i({url:`?proxy_url=${encodeURIComponent(`${wa}/emails`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify(c)});if(d.error){const p=d.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_message||p?.data?.error_key||p?.error||String(d.error)}}}const u=d.data,m=u?.campaign_activities?.find(p=>p.role==="primary_email")?.campaign_activity_id,f=u?.campaign_id;if(!m||!f)return{error:{status:"CUSTOM_ERROR",error:"Failed to create campaign"}};const h={campaign_activity_id:m,campaign_id:f,role:"primary_email",contact_list_ids:[t.list_id],segment_ids:[],current_status:"DRAFT",format_type:5,from_email:t.from_email,from_name:t.from_name,reply_to_email:t.from_email,subject:t.subject,html_content:a},_=await i({url:`?proxy_url=${encodeURIComponent(`${wa}/emails/activities/${m}`)}`,method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify(h)});if(_.error){const p=_.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_message||p?.data?.error_key||p?.error||String(_.error)}}}return{data:{campaign_id:f}}}})})}),{useCreateCampaignMutation:zp}=co,Gp="https://api.getresponse.com/v3",Wp=e=>`api-key ${e}`,uo=o.createApi({reducerPath:"getresponseApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createNewsletter:e.mutation({queryFn:async(t,n,r,i)=>{const a=t.html.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),c={name:t.name,type:"draft",subject:t.subject,fromField:{fromFieldId:t.from_field_id},replyTo:{fromFieldId:t.from_field_id},campaign:{campaignId:t.campaign_id},content:{html:t.html,plain:a||"Newsletter"},flags:["openrate","clicktrack"],sendSettings:{selectedCampaigns:[t.campaign_id]}},d=await i({url:`?proxy_url=${encodeURIComponent(`${Gp}/newsletters`)}`,method:"POST",headers:{"Content-Type":"application/json","X-Auth-Token":Wp(t.api_key)},body:JSON.stringify(c)});if(d.error){const m=d.error;return{error:{status:"CUSTOM_ERROR",error:m?.data?.message||m?.data?.code||m?.error||String(d.error)}}}const u=d.data;return u?.newsletterId?{data:{newsletterId:u.newsletterId}}:{error:{status:"CUSTOM_ERROR",error:d.data?.message||"Failed to create newsletter"}}}})})}),{useCreateNewsletterMutation:Hp}=uo,qp=e=>`https://${e||"r1"}-api.dotdigital.com/v2`,ka=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,Ca=e=>e&&typeof e=="object"&&"data"in e&&e.data!==void 0?e.data:e,Ta=e=>e.trim().toLowerCase(),mo=o.createApi({reducerPath:"dotdigitalApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=t.html.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),c=qp(t.region),d={"Content-Type":"application/json",Authorization:ka(t.username,t.password)},u=await i({url:`?proxy_url=${encodeURIComponent(`${c}/custom-from-addresses`)}`,method:"GET",headers:{Authorization:ka(t.username,t.password)}});let m=[];if(!u.error){const w=Ca(u.data);Array.isArray(w)?m=w:w&&typeof w=="object"&&Array.isArray(w.items)&&(m=w.items)}const f=Ta(t.from_email),h=m.find(w=>w.email&&Ta(w.email)===f),_={name:t.name,subject:t.subject,fromName:t.from_name,htmlContent:t.html,plainTextContent:a||"Newsletter"},p=!h?.id;h?.id!=null&&(_.fromAddress={id:h.id});const E=await i({url:`?proxy_url=${encodeURIComponent(`${c}/campaigns`)}`,method:"POST",headers:d,body:JSON.stringify(_)});if(E.error){const w=E.error;return{error:{status:"CUSTOM_ERROR",error:w?.data?.message||w?.error||String(E.error)}}}const k=Ca(E.data);return k?.id?{data:{id:k.id,usedAccountDefaultFromAddress:p}}:{error:{status:"CUSTOM_ERROR",error:E.data?.message||k?.message||"Failed to create campaign"}}}})})}),{useCreateCampaignMutation:Vp}=mo,Yp="https://app.bentonow.com/api/v1",Kp=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,po=o.createApi({reducerPath:"bentoApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createBroadcast:e.mutation({queryFn:async(t,n,r,i)=>{const a={broadcasts:[{name:t.name,subject:t.subject,content:t.html,type:"raw",from:{email:t.from_email,name:t.from_name},inclusive_tags:t.inclusive_tags||"subscribers",exclusive_tags:"",segment_id:t.segment_id||"",batch_size_per_hour:500,approved:!1}]},c=`${Yp}/batch/broadcasts?site_uuid=${encodeURIComponent(t.site_uuid)}`,d=await i({url:`?proxy_url=${encodeURIComponent(c)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:Kp(t.publishable_key,t.secret_key),"User-Agent":"EmailMaker/1.0"},body:JSON.stringify(a)});if(d.error){const u=d.error;return{error:{status:"CUSTOM_ERROR",error:u?.data?.message||u?.error||String(d.error)}}}return{data:{count:d.data?.count??1}}}})})}),{useCreateBroadcastMutation:Qp}=po,Xp=()=>{const{__:e}=o.useI18n(),[t,{isLoading:n}]=yp(),[r,{isLoading:i}]=_p(),[a,{isLoading:c}]=bp(),[d,{isLoading:u}]=vp(),[m,{isLoading:f}]=Sp(),[h,{isLoading:_}]=Cp(),[p,{isLoading:E}]=Ap(),[k,{isLoading:w}]=Rp(),[b,{isLoading:x}]=jp(),[P,{isLoading:Y}]=Mp(),[J,{isLoading:N}]=Dp(),[O,{isLoading:A}]=Up(),[L,{isLoading:z}]=zp(),[B,{isLoading:$}]=Hp(),[de,{isLoading:pe}]=Vp(),[H,{isLoading:Z}]=Qp(),De=n||i||c||u||f||_||E||w||x||Y||N||A||z||$||pe||Z,$e={unisender:async(T,R,D,I)=>{try{const S=await t({api_key:T.api_key,sender_name:T.sender_name,sender_email:T.sender_email,subject:I,body:D,list_id:R.list_id,generate_text:1,lang:"ru"}).unwrap();return S.result?.message_id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.unisender.com/ru/v5/spa/email-campaign/editor/${S.result.message_id}?step=send`,text:e("Open in Unisender")}}:S.error?{success:!1,error:S.error+(S.code?` (${S.code})`:"")}:{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create email")}}},mailganer:async(T,R,D,I)=>{try{const S=await r({api_key:T.api_key,name:R.name,html_content:D,theme:R.theme||I,from_name:T.from_name,from_email:T.from_email}).unwrap();return S.status===1&&S.public_id?{success:!0,message:e("Mailing successfully created!"),link:S.step1_url?{url:S.step1_url,text:e("Open in Mailganer")}:void 0}:S.error?{success:!1,error:S.error}:{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create mailing")}}},sendsay:async(T,R,D,I)=>{try{const S=await a({login:T.login,api_key:T.api_key,name:R.name,subject:R.subject,html_content:D,from_name:T.from_name,from_email:T.from_email}).unwrap();return S.obj?.id?{success:!0,message:e("Draft successfully created!"),link:{url:`https://app.sendsay.ru/content/drafts/email/${S.obj.id}/settings`,text:e("Open in Sendsay")}}:S.errors&&S.errors.length>0?{success:!1,error:S.errors.map(se=>se.explain).join(", ")}:S.error?{success:!1,error:S.explain||S.error}:{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create draft")}}},altcraft:async(T,R,D,I)=>{try{const S=await d({api_url:T.api_url,api_key:T.api_key,name:R.name,html_content:D,subject:R.subject||I,from_name:T.from_name,from_email:T.from_email}).unwrap();return S.error===0?{success:!0,message:e("Template successfully created!")}:{success:!1,error:S.error_text||e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create template")}}},enkod:async(T,R,D,I)=>{try{const S=await m({api_key:T.api_key,subject:R.subject,html_content:D,sender_name:T.sender_name,sender_email:T.sender_email}).unwrap();if(S.success||S.messageId||S.id){const se=S.messageId||S.id;return{success:!0,message:e("Draft successfully created!"),link:se?{url:`https://app.enkod.ru/ensend/messages/detail/${se}/preview`,text:e("Open in enKod")}:void 0}}else if(S.error||S.message)return{success:!1,error:S.error||S.message||e("Unknown error")};return{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create draft")}}},mailchimp:async(T,R,D,I)=>{try{const S=await h({api_key:T.api_key,list_id:R.list_id,subject:R.subject||I,from_name:T.from_name,from_email:T.from_email,html:D}).unwrap();if(S.id){const se=T.api_key?.split("-")[1]||"us1";return{success:!0,message:e("Campaign successfully created!"),link:{url:`https://${se}.admin.mailchimp.com/campaigns/#r:campaignId=${S.id}`,text:e("Open in Mailchimp")}}}return{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create campaign")}}},klaviyo:async(T,R,D,I)=>{try{const S=await p({api_key:T.api_key,list_id:R.list_id,subject:R.subject||I,from_name:T.from_name,from_email:T.from_email,html:D}).unwrap();return S.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://www.klaviyo.com/campaign/${S.id}/wizard/1`,text:e("Open in Klaviyo")}}:{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create campaign")}}},hubspot:async(T,R,D,I)=>{try{const S=await k({api_key:T.api_key,name:R.name,subject:R.subject||I,from_name:T.from_name,from_email:T.from_email,html:D}).unwrap();return S.id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.hubspot.com/email/0/edit/${S.id}`,text:e("Open in HubSpot")}}:{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create email")}}},salesforce_mc:async(T,R,D,I)=>{try{const S=await b({subdomain:T.subdomain,client_id:T.client_id,client_secret:T.client_secret,name:R.name,subject:R.subject||I,from_name:T.from_name,from_email:T.from_email,html:D}).unwrap();return S.id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.s7.exacttarget.com/ContentBuilder?app=contentbuilder&id=${S.id}`,text:e("Open in Marketing Cloud")}}:{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create email")}}},activecampaign:async(T,R,D,I)=>{try{const S=await P({api_url:T.api_url,api_key:T.api_key,list_id:T.list_id,name:R.name,subject:R.subject||I,from_name:T.from_name,from_email:T.from_email,html:D}).unwrap();if(S.campaignId){const se=(T.api_url||"").replace(/\/$/,"").match(/https?:\/\/([^.]+)\.api-/),we=se?se[1]:"",Ke=we?`https://${we}.activehosted.com/app/campaigns/${S.campaignId}`:"https://www.activecampaign.com/app/campaigns";return{success:!0,message:e("Draft campaign created! Open it to review and schedule."),link:{url:Ke,text:e("Open draft campaign")}}}return{success:!1,error:e("Unknown error")}}catch(S){const se=S.message||S.error||"";if(se==="NO_MAILING_ADDRESS"){const we=(T.api_url||"").replace(/\/$/,"").match(/https?:\/\/([^.]+)\.api-/),Ke=we?we[1]:"",Qe=Ke?`https://${Ke}.activehosted.com/app/settings/addresses`:"https://www.activecampaign.com/app/settings/addresses";return{success:!1,error:e("No mailing address found. Add one in ActiveCampaign: ")+Qe}}return{success:!1,error:se||e("Failed to create campaign")}}},brevo:async(T,R,D,I)=>{try{const S=await J({api_key:T.api_key,list_id:Number(R.list_id),name:R.name,subject:R.subject||I,from_name:T.from_name,from_email:T.from_email,html:D}).unwrap();return S.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://app.brevo.com/marketing-campaign/edit/${S.id}`,text:e("Open in Brevo")}}:{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create campaign")}}},campaign_monitor:async(T,R,D,I)=>{try{const S=R.html_url?.trim();if(!S)return{success:!1,error:e("HTML URL is required. Save the email first, or paste a custom URL to your hosted HTML.")};const se=await O({api_key:T.api_key,client_id:T.client_id,list_id:R.list_id,name:R.name,subject:R.subject||I,from_name:T.from_name,from_email:T.from_email,html_url:S.trim()}).unwrap();return se.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://app.createsend.com/campaigns/#/${se.id}`,text:e("Open in Campaign Monitor")}}:{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create campaign")}}},constant_contact:async(T,R,D,I)=>{try{return(await L({access_token:T.access_token,list_id:R.list_id,name:R.name,subject:R.subject||I,from_name:T.from_name,from_email:T.from_email,html:D}).unwrap()).campaign_id?{success:!0,message:e("Campaign successfully created!"),link:{url:"https://app.constantcontact.com/pages/email/campaigns",text:e("Open in Constant Contact")}}:{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create campaign")}}},getresponse:async(T,R,D,I)=>{try{const S=await B({api_key:T.api_key,from_field_id:T.from_field_id,campaign_id:R.campaign_id,name:R.name,subject:R.subject||I,html:D}).unwrap();return S.newsletterId?{success:!0,message:e("Newsletter successfully created!"),link:{url:`https://app.getresponse.com/letter/${S.newsletterId}`,text:e("Open in GetResponse")}}:{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create newsletter")}}},dotdigital:async(T,R,D,I)=>{try{const S=await de({username:T.username,password:T.password,region:T.region||"r1",name:R.name,subject:R.subject||I,from_name:T.from_name,from_email:T.from_email,html:D}).unwrap();return S.id?{success:!0,message:S.usedAccountDefaultFromAddress?e("Campaign created. Dotdigital used your account default sender because this From email is not registered as a custom from address. Add the address in Dotdigital and export again to use it."):e("Campaign successfully created!"),link:{url:"https://login.dotdigital.com/",text:e("Open in Dotdigital")}}:{success:!1,error:e("Unknown error")}}catch(S){return{success:!1,error:S.message||e("Failed to create campaign")}}},bento:async(T,R,D,I)=>{try{return await H({publishable_key:T.publishable_key,secret_key:T.secret_key,site_uuid:T.site_uuid,name:R.name,subject:R.subject||I,from_name:T.from_name,from_email:T.from_email,html:D,inclusive_tags:R.inclusive_tags}).unwrap(),{success:!0,message:e("Broadcast successfully created!"),link:{url:"https://app.bentonow.com/",text:e("Open in Bento")}}}catch(S){return{success:!1,error:S.message||e("Failed to create broadcast")}}}};return{exportToIntegration:async(T,R,D,I,S)=>{const se=$e[T];return se?se(R,D,I,S):{success:!1,error:e("Unknown integration")}},isLoading:De}},Rt={INFO:"info",STORAGE:"storage",STYLES:"styles",MEMBERS:"members",INTEGRATIONS:"integrations",PLUGIN:"plugin"},cv=Rt.INFO,dv=[Rt.INFO,Rt.STORAGE,Rt.STYLES,Rt.MEMBERS,Rt.INTEGRATIONS,Rt.PLUGIN],uv={mainsettings:Rt.INFO,ftpsettings:Rt.STORAGE,webhooksettings:Rt.INTEGRATIONS},Jp=async(e,t,n)=>{try{const{notification:r,...i}=e,a=await o.fetchBaseQuery({baseUrl:"https://racs.emcdn.ru/v3"})(i,t,n);if(a.error)throw new Error;return a}catch(r){return(e?.notification).error(r),{error:r}}},fo=o.createApi({reducerPath:"exportPngApi",baseQuery:Jp,endpoints:e=>({makeTemporaryMailForPng:e.mutation({query:({file:t,title:n,notification:r})=>{const i=new Blob([t],{type:"text/html"}),a=new FormData;return a.append("file",i,"base.html"),a.append("contentType","text/html"),{url:"?resource=exportPngApi",method:"POST",body:a,notification:r}}}),deleteTemporaryMail:e.mutation({query:({id:t,notification:n})=>({url:`/${t}?resource=exportPngApi`,method:"DELETE",notification:n})})})}),{useMakeTemporaryMailForPngMutation:Zp,useDeleteTemporaryMailMutation:ef}=fo,ho=o.createApi({reducerPath:"webHookApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({postDataByWebHook:e.mutation({query:({url:t,body:n})=>({url:`?proxy_url=${encodeURIComponent(t)}`,method:"POST",body:n})})})}),{usePostDataByWebHookMutation:tf}=ho,nf=async(e,t,n)=>{try{const{notification:r,...i}=e,a=await o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"})(i,t,n);if(a.error)throw new Error;return a}catch(r){return(e?.notification).error(r),{error:r}}},go=o.createApi({reducerPath:"htmlToPdfPlusApi",baseQuery:nf,endpoints:e=>({generateHtmlToPdf:e.mutation({query:({htmlContent:t,notification:n})=>({url:"emails/pdf",method:"POST",body:t,notification:n,responseHandler:r=>r.blob()})})})}),{useGenerateHtmlToPdfMutation:of}=go,yo=o.createApi({reducerPath:"proxyApi",tagTypes:["Proxy"],baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get"}),endpoints:e=>({getFile:e.query({queryFn({url:t,tryFetch:n=!0,type:r},i){const a=o.clientFromApi(i),c=n?fetch(t):Promise.reject(),d=m=>{switch(r){case"json":return m.json();case"text":return m.text();default:return m.blob()}},u=m=>d(m).then(f=>({data:f}));return c.then(m=>u(m)).catch(()=>a.corsProxy.get_list({format:"blob",extraQuery:{url:encodeURIComponent(t)}}))}})})}),{useGetFileQuery:mv,useLazyGetFileQuery:rf}=yo,pv="email",fv=100;function af(e){return _t.sanitizeFileName(String(e??"").trim()).slice(0,100).trimEnd()||"email"}function Ia(e){const t=af(e);return{archive:`${t}.zip`,desktop:`${t}-desktop.png`,mobile:`${t}-mobile.png`}}function sf(e,t){const n=Ia(e);return{[n.desktop]:t.desktop,[n.mobile]:t.mobile}}var hr=()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/424385ee.js")).then(e=>e.import_exports),void 0,{}.url),lf=1,cf=2,df=375,Dt={fontSize:"16px"},uf={position:"absolute",bottom:-4,right:-4,borderRadius:"100%",backgroundColor:o.emCssVar("colorBgContainer")},mf={position:"relative",display:"inline-flex"},qt=({icon:e,locked:t,strokeWidth:n,className:r})=>(0,s.jsxs)("span",{className:r,style:mf,children:[e,t&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:12,strokeWidth:n,style:uf})]}),pf=({email:e,autoSaveBlockResult:t})=>{const{__:n,_x:r}=o.useI18n(),i=o.useDispatch(),a=o.useEmailAttributesWriter(),[c]=rf(),[d]=o.useUploadImageMutation(),u=o.useAppNavigate(),{owner:m,admin:f}=Qn(),h=o.useCurrentUser(),_=o.useProjectData(),{modal:p}=y.ui_kit$App.useApp(),E=o.useNotification(),{confirm:k}=p,w=o.useAppStore(),b=()=>rn(g.getContainer(w)).keepWrappedOnOutput,x=(M,q,Q,oe)=>_t.prepareHTML(M,q,Q,oe,b()),P=(M,q,Q,oe,ne,W)=>_t.getEML(M,q,Q,oe,ne,W,b()),Y=(M,q,Q,oe,ne)=>_t.htmlToFilesData(M,q,Q,oe,ne,b()),J=o.useCookieManager(),N=o.useAppConfig(),O=Ea(),{beeFreeConverterEnabled:A,aiLayoutConverterEnabled:L}=O,z=o.useEditorProjectId(),B=o.useEventEmitter(g.events.ON_EMAIL_CLONE_ID),$=o.useEventEmitter(g.events.ON_BROWSER_EXTENSION_DETECTED_ID),[de]=tf(),pe=!0,{data:H}=o.useGetProjectIntegrationsQuery(_?.id??0,{skip:pe}),{data:Z}=o.useGetProjectWebhookQuery(_?.id??0,{skip:pe}),[De]=o.useLazyGetIntegrationCredentialsQuery(),{exportToIntegration:be,isLoading:et}=Xp(),ve=o.usePushToDataLayer(),[fe,K]=(0,l.useState)(()=>!Ht(g.getContainer(w)).contentShown()),[me,ie]=(0,l.useState)(!1),[ae,Ae]=(0,l.useState)(null),[Te,Fe]=(0,l.useState)(""),[X,Ee]=(0,l.useState)(!1),[Ie,he]=(0,l.useState)(0),[Re,$e]=(0,l.useState)(null),[C,T]=(0,l.useState)(""),[R,D]=(0,l.useState)(!1),I=o.usePlanFeatureGate("export_html"),S=o.usePlanFeatureGate("export_pdf"),se=o.usePlanFeatureGate("export_png");o.usePlanFeatureGate("export_webhook");const we=o.usePlanFeatureGate("export_platforms"),Ke=o.usePlanFeatureGate("export_amp"),Qe=o.usePlanFeatureGate("template_import"),ze=o.usePlanFeatureGate("code_minify"),Ze=M=>{Ee(!0),he(o.FEATURE_UPSELL_SLIDE[M])},[mt]=o.emailsApi.useDeleteEmailMutation(),vt=async(M,q)=>{try{const Q=await mt(M.id).unwrap();M.project,E.success(n('The email "')+Q.title+r('" was successfully removed.',"email")),ve({event:"delete",action:"delete_email",entity_type:"email",entity_id:M.id,project_id:M.project,context:"editor"})}catch(Q){E.error(Q)}},[ft,lt]=o.useAddEmailMutation(),[G]=Zp(),[V]=ef(),[te]=of(),ue=o.useProjectData(),ge=o.useInvalidateTerms(),Ge=o.useSelector(o.selectIsHeaderCodeMenuOpen);(0,l.useEffect)(()=>{Ge.switched&&K(!1)},[Ge]);const qe=()=>{const{title:M}=e;return M===null?n("New email title"):M},at=(M,q,Q=!1)=>{const oe=o.getCodeSize(M);Q&&o.isCodeSizeExceeded(oe)?(Fe(M),Ae(()=>q),ie(!0)):q(M)},Bt=()=>{if(ie(!1),ze.isLocked){Ze("code_minify");return}if(ae&&Te){o.getCodeSize(Te);const M=o.minifyHtml(Te);o.getCodeSize(M),ae(M),Ae(null),Fe("")}},Oe=()=>{ie(!1),ae&&Te&&(ae(Te),Ae(null),Fe(""))},Xe=()=>{ie(!1),Ae(null),Fe("")},re=o.useContentReader(),ee=o.useContentReplacer(),U=o.useEvent(g.events.ON_EMAIL_INIT_ID),le=o.useEventEmitter(g.events.ON_LAYOUT_CONVERT_REQUEST_ID);(0,l.useEffect)(()=>{const M=U(()=>{K(!1)});return()=>M.dispose()},[U]);const xe=async(M,q=re())=>{const Q=document.querySelector(".email-preview"),oe=getComputedStyle(Q);return q=await x(q,[oe.width],e.utm_parameters,async ne=>{rt(ne)}),G({file:q,title:qe(),notification:E}).unwrap().then(ne=>{const W={id:ne._id,...ne};return M(W,()=>V({id:W.id,notification:E}))}).catch(ne=>{E.error({title:ne.data?.code,description:ne.data?.message})})},Se=(M,q=1)=>xe((Q,oe)=>({hrefs:M.map(ne=>o.previewHrefForRacs(Q.id,void 0,!1,q,void 0,void 0,ne)),dispose:oe})),Me=(M,q,Q=2)=>xe((oe,ne)=>({data:M.map(W=>({selector:W,href:o.previewHrefForRacs(oe.id,void 0,!1,Q,W)})),dispose:ne}),q),We=async(M,q)=>{const Q=typeof M=="string"?(await c({url:M}))?.data:M;if(!Q)return typeof M=="string"?M:"";let oe=o.decodeFileNameFromPath(q);if(typeof M=="string"&&/^https?:\/\//i.test(M)){const He=o.decodeFileNameFromUrl(M);He&&(oe=He)}const ne=Q,{ensureFileExtension:W,extractUploadResult:Ce}=await hr();oe=await W(oe,ne.type||"");const ye=new File([ne],oe.toLowerCase(),{type:ne.type||""});try{const He=Ce(await d({user_id:h.id,folder:String(ue.id),file:ye}).unwrap());if(He.error)return typeof M=="string"?M:"";if(He.file_url)return He.file_url}catch{}return typeof M=="string"?M:""},Be=async M=>{const q=M.document.querySelectorAll("[em-operation=exportAsPicture]"),Q=new Map;for(let oe=0,ne=q.length;oe<ne;oe++){const W=q[oe];W.setAttribute("em-export-id",String(oe)),Q.set(`[em-export-id='${oe}']`,W)}Q.size&&M.handleRender(async({contentDocument:oe,managedNodeController:ne})=>{try{const{data:W,dispose:Ce}=await Me([...Q.keys()],o.getOuterHtml(oe),cf);try{const ye=W.map(async({href:He,selector:gn},Dn)=>{const pt=Q.get(gn);if(pt.tagName==="TD"){pt.removeAttribute("style");for(const yt of[...pt.classList])yt.startsWith("em-mob-")&&pt.classList.remove(yt)}ne.commit();const Bo=await We(He,`${Dn}-${pt.tagName.toLowerCase()}.png`),yn=parseInt(getComputedStyle(pt).width);let wt=new Image(yn);wt.setAttribute("border","0"),wt.setAttribute("style",`display: block; width: 100%; max-width: ${yn}px;`),wt.alt="",wt.src=Bo;const _n=pt.querySelector("a");if(_n){const yt=document.createElement("a");yt.setAttribute("target","_blank"),yt.setAttribute("href",_n.getAttribute("href")),yt.appendChild(wt),wt=yt}if(pt.tagName==="TD"){const yt=pt.cloneNode();yt.removeAttribute("em-operation"),yt.appendChild(wt),wt=yt}pt.replaceWith(wt),ne.commit()});await Promise.all(ye)}catch{}finally{Ce()}}catch{}})},rt=M=>{const q=M.document;if(ue?.limits?.preview_limit==="0"&&z&&h?.counters?.emails_counter>2&&!q.querySelector(".em-powered-logo")){const Q=`<a href="${`https://https://racs.emcdn.ru/v3/v3/link?app=emailmaker&project=${z}&email=${e.id}&link=https%3A%2F%2Femailmaker.ru`}" target="_blank"><img src="https://https://racs.emcdn.ru/v3/v3/pixel/123.png?image=https://emcdn.ru/emailmaker/powered.png&project=${z}&email=${e.id}" width="150" height="50" border="0" alt="" style="display: inline-block; width: 100%; max-width: 150px;"></a>`;q.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child")&&q.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child").insertAdjacentHTML("afterend",`<tr em="block" class="em-powered-logo">
|
|
856
856
|
<td align="center" bgcolor="#FFFFFF">${Q}</td>
|
|
857
|
-
</tr>`)}},fn=async()=>{const M=re();at(M,async q=>{try{const Q=document.querySelector(".email-preview"),oe=getComputedStyle(Q),ne=await x(q,[oe.width],e.utm_parameters,async He=>{rt(He)}),W=await te({htmlContent:ne,notification:E}).unwrap(),Ce=window.URL.createObjectURL(new Blob([W],{type:"application/pdf"})),ye=document.createElement("a");ye.href=Ce,ye.setAttribute("download",`${qe()}.pdf`),document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),window.URL.revokeObjectURL(Ce)}catch{}})},Lt=M=>{const q=re();at(q,Q=>{ve({event:"click",action:"export_email",export_type:"HTML"});const oe=document.querySelector(".email-preview"),ne=getComputedStyle(oe);x(Q,[ne.width],e.utm_parameters,async W=>{await Be(W),rt(W),await o.processAmp(W,M)}).then(W=>{const Ce=new Blob([W],{type:"text/html;charset=utf-8"});(0,an.saveAs)(Ce,`${qe()}.html`)}).catch(W=>{})},!0)},ct=M=>{const q=re();at(q,Q=>{ve({event:"click",action:"export_email",export_type:"TEXT"});const oe=document.querySelector(".email-preview"),ne=getComputedStyle(oe);x(Q,[ne.width],e.utm_parameters,async W=>{await Be(W),rt(W),await o.processAmp(W,M);const[{htmlToText:Ce},{EmailTextPlainConvertOptions:ye}]=await Promise.all([(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/4598405b.js")),void 0,{}.url),(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/9a285b6a.js")),void 0,{}.url)]);W.handleReadHtml(He=>{He.html=Ce(He.contentDocument,ye)})}).then(W=>{const Ce=new Blob([W],{type:"text/plain;charset=utf-8"});(0,an.saveAs)(Ce,`${qe()}.txt`)}).catch(W=>{})})},Et=()=>{const M=re();at(M,q=>{ve({event:"click",action:"export_email",export_type:"MARKDOWN"});const Q=document.querySelector(".email-preview"),oe=getComputedStyle(Q),{utm_parameters:ne}=e;x(q,[oe.width],ne,async W=>{rt(W),await o.processAmp(W,"html");const{htmlToMarkdown:Ce}=await(0,Ve.__vitePreload)(async()=>{const{htmlToMarkdown:ye}=await Promise.resolve().then(()=>_e("./static/core/e2f501f0.js"));return{htmlToMarkdown:ye}},void 0,{}.url);W.handleReadHtml(ye=>{ye.html=Ce(ye.contentDocument)})}).then(W=>{const Ce=new Blob([W],{type:"text/markdown;charset=utf-8"});(0,an.saveAs)(Ce,`${qe()}.md`)}).catch(W=>o.reportError(W,{origin:"markdown-export"}))})},Ot=M=>{const q=re();at(q,Q=>{ve({event:"click",action:"export_email",export_type:"Clipboard"});const oe=document.querySelector(".email-preview"),ne=getComputedStyle(oe);x(Q,[ne.width],e.utm_parameters,async W=>{await Be(W),rt(W),await o.processAmp(W,M)}).then(W=>navigator.clipboard.writeText(W).then(function(){E.success(n("The email has been copied to the clipboard."))})).catch(W=>{})},!0)},jn=async M=>{Re&&pr(Re)},Ln=()=>{$e(null),T("")},hn=async()=>{if(!R){D(!0);try{const M=await Se([800,df],lf);if(!M)return;const{hrefs:q,dispose:Q}=M;try{const[oe,ne]=await Promise.all(q.map(ye=>_t.getImageByUrl(ye).then(He=>_t.imageToBlob(He)))),W=qe(),Ce=await _t.htmlFilesToZip(sf(W,{desktop:oe,mobile:ne}));(0,an.saveAs)(Ce,Ia(W).archive),ve({event:"click",action:"export_email",export_type:"Image"})}finally{Q()}}catch{E.error({title:n("Error"),description:n("Failed to export the email as images. Please try again.")})}finally{D(!1)}}},On=M=>{const q=J.get(o.APP_COOKIES.em_token);return fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(M)}`,{headers:{authorization:`Bearer ${q}`}}).then(Q=>Q.blob())},Mn=M=>new Promise((q,Q)=>{const oe=()=>On(M).then(q,Q);fetch(M).then(ne=>q(ne.blob()),oe).catch(()=>{})}),ht=(M,q)=>{const Q=re();at(Q,oe=>{ve({event:"click",action:"export_email",export_type:"Outlook"});const ne=document.querySelector(".email-preview"),W=getComputedStyle(ne),Ce=async(ye,He)=>{ye.document,await o.processAmp(ye,He),await Be(ye),rt(ye)};P(e.title,oe,[W.width,W.height],e.utm_parameters,M?ye=>Ce(ye,"html"):ye=>Ce(ye),q?{embedImagesAsBase64:!0,getImageBlob:Mn}:void 0).then(ye=>{const He=new Blob([ye],{type:"text/html;charset=utf-8"});(0,an.saveAs)(He,`${qe()}.eml`)}).catch(ye=>{})})},St=M=>{k({centered:!0,mask:{closable:!0},title:n("Embed images in the file?"),content:n('If "Yes", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If "No", images will be loaded from external links.'),okText:n("Yes"),cancelText:n("No"),onOk:()=>ht(M,!0),onCancel:()=>ht(M,!1)})},ce=async()=>{const M=re();at(M,async q=>{ve({event:"click",action:"export_email",export_type:"ZIP"});const Q=document.querySelector(".email-preview"),oe=getComputedStyle(Q),ne=await Y(q,[oe.width,void 0],e.utm_parameters,Mn,async Ce=>{await Be(Ce),rt(Ce),Tt&&await o.processAmp(Ce,"html")});Tt&&(ne["amp.html"]=await x(q,[oe.width],e.utm_parameters,async Ce=>{await Be(Ce),rt(Ce),await o.processAmp(Ce,"amp")}));const W=await _t.htmlFilesToZip(ne);(0,an.saveAs)(W,`${qe()}.zip`)},!0)},ke=async()=>{if(ve({event:"click",action:"duplicate_email",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew)E.warning({title:n("To create a copy, you need to save the email.")});else{if((await B.fire(e)).some(M=>M===!1))return;ft({title:xt.generateCopyTitle(e.title),...e.meta!==void 0?{meta:e.meta}:{},project:Number(ue?.id),description:e.description,html:xt.generateCopyHtml(re()||"",String(e.title)),parent_email:e.parent_email||127017,common_styles:e.common_styles||"",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},emailtags:e.emailtags,folder:e.folder}).unwrap().then(M=>{u(`/projects/${ue.id}/emails/${M.id}`),E.success({title:n('The copy of email "')+e.title+n('" was successfully created.')}),ve({event:"duplicate",action:"duplicate_email_success",entity_type:"email",entity_id:e.id,cloned_entity_id:M.id,project_id:e.project,context:"editor"}),ge("folder")}).catch(M=>{E.error({title:M.data.code,description:M.data.message})})}},Ne=()=>{ve({event:"click",action:"click_delete_email_menu_item",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew?E.success(n("The draft of the email has been deleted.")):nt(e,u)},nt=(M,q)=>{ve({event:"open",action:"open_delete_email_modal",entity_type:"email",entity_id:M.id,project_id:M.project,context:"editor"}),k({mask:{closable:!0},centered:!0,title:r('Are you sure to delete "',"email")+M.title+n('" email?'),icon:(0,s.jsx)(o.EmIcons,{icon:"DeleteOutlined",component:y.icons$DeleteOutlined,size:22,style:{color:y.ui_kit$iconColors.danger,marginInlineEnd:12,flexShrink:0}}),okText:n("Yes"),cancelText:n("No"),onOk:()=>vt(M,q)})},je=()=>{hr().catch(()=>{}),o.uploadFile("application/zip, message/rfc822, text/html",Kt)},Kt=async M=>{const q=M[0];try{i(o.setIsGlobalLoading(!0));const{createDocumentProcessor:Q,createFileProcessor:oe,importEmail:ne}=await hr(),{html:W,hasBrowserExtensionArtifacts:Ce}=await ne(q,oe(c,d,h,ue,N),Q(q))??{html:"",hasBrowserExtensionArtifacts:!1};Ce&&$.fire();const[ye]=_t.getFileNameAndExt(q.name.replaceAll(" "," ")),He=ye||xt.getTitleFromHtml(W)||"";ee(W,{undoable:!0}),a({title:He}),i(o.setIsGlobalLoading(!1)),le.fire({html:W})}catch(Q){i(o.setIsGlobalLoading(!1));const oe=Q instanceof Error?Q.message:Q;E.error({title:oe})}ve({event:"upload_file",action:"import_email"})},Ut=()=>{const M=re();M&&(ve({event:"click",action:"convert_layout"}),le.fire({html:M}))},dt=[];N.emailDropdownMenuClone&&dt.push({label:n("Clone"),icon:(0,s.jsx)(o.EmIcons,{icon:"CopyOutlined",component:y.icons$CopyOutlined,size:16,strokeWidth:N.iconStrokeWidth}),key:"Clone",className:"em-analytics__email-clone",disabled:lt.isLoading,onClick:ke}),N.emailDropdownMenuImport&&dt.push({label:r("Import","verb"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,style:Dt}),locked:Qe.isLocked,strokeWidth:N.iconStrokeWidth}),key:"Import",className:"em-analytics__editor-page__import",onClick:()=>{if(Qe.isLocked){Ze("template_import");return}ve({event:"click",action:"import_email"}),je()}});const Nn=re(),$t=!e.hasOwnProperty("type")&&Sa(Nn,O)!==null;N.emailDropdownMenuConvert&&$t&&dt.push({label:n("Convert"),icon:(0,s.jsx)(o.EmIcons,{icon:"SwapOutlined",component:y.icons$SwapOutlined,size:16,strokeWidth:N.iconStrokeWidth}),key:"ConvertLayout",className:"em-analytics__email-convert",onClick:Ut}),(m||f||h.id?.toString()===e.author?.toString())&&(N.emailDropdownMenuLock&&dt.push({label:(0,s.jsx)(va,{element:e,context:"editor"},"Lock"),icon:e.lock?(0,s.jsx)(o.EmIcons,{icon:"UnLock",component:y.icons$UnLock,size:16,strokeWidth:N.iconStrokeWidth}):(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:16,strokeWidth:N.iconStrokeWidth}),disabled:e.isNew}),N.emailDropdownMenuRemove&&dt.push({label:n("Remove"),icon:(0,s.jsx)(o.EmIcons,{icon:"DeleteOutlined",component:y.icons$DeleteOutlined,size:16,strokeWidth:N.iconStrokeWidth}),key:"Remove",className:"em-analytics__email-remove",style:{color:"#ff4d4f"},onClick:Ne}));const Tt=e.isAmp,It=[],Fo=()=>[...Tt?[{key:"html_txt",label:`${n("Plain text")} (HTML)`,onClick:()=>ct("html")},{key:"сode_txt",label:`${n("Plain text")} (AMP)`,onClick:()=>ct("amp")}]:[{key:"plain_txt",label:n("Plain text"),onClick:()=>ct()}],{key:"markdown",label:n("Markdown"),onClick:()=>Et()}];N.exportHtmlEnabled&&It.push({key:"html",label:n("Code"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileTextOutlined",component:y.icons$FileTextOutlined,style:Dt}),locked:I.isLocked,strokeWidth:N.iconStrokeWidth}),...I.isLocked?{onClick:()=>Ze("export_html")}:Tt?{children:[{key:"сode_html",label:n("AMP"),onClick:()=>Ke.isLocked?Ze("export_amp"):Lt("amp")},{key:"html_amp",label:n("HTML"),onClick:()=>Lt("html")}]}:{onClick:()=>Lt()}}),N.exportZipEnabled&&It.push({key:"zip",label:n("ZIP"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileZipOutlined",component:y.icons$FileZipOutlined,style:Dt}),locked:I.isLocked,strokeWidth:N.iconStrokeWidth}),...I.isLocked?{onClick:()=>Ze("export_html")}:{onClick:()=>ce().catch(M=>{})}}),N.exportClipboardEnabled&&It.push({key:"clipboard",label:n("Clipboard"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"SnippetsOutlined",component:y.icons$SnippetsOutlined,style:Dt}),locked:I.isLocked,strokeWidth:N.iconStrokeWidth}),...I.isLocked?{onClick:()=>Ze("export_html")}:Tt?{children:[{key:"clipboard_html",label:n("AMP"),onClick:()=>Ke.isLocked?Ze("export_amp"):Ot("amp")},{key:"clipboard_amp",label:n("HTML"),onClick:()=>Ot("html")}]}:{onClick:()=>Ot()}}),N.exportTextEnabled&&It.push({key:"text",label:n("Text"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileOutlined",component:y.icons$FileOutlined,style:Dt}),locked:I.isLocked,strokeWidth:N.iconStrokeWidth}),...I.isLocked?{onClick:()=>Ze("export_html")}:N.exportMarkdownEnabled?{children:Fo()}:Tt?{children:[{key:"сode_txt",label:n("AMP"),onClick:()=>Ke.isLocked?Ze("export_amp"):ct("amp")},{key:"html_txt",label:n("HTML"),onClick:()=>ct("html")}]}:{onClick:()=>ct()}}),N.exportOutlookEnabled&&It.push({key:"outlook",icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileWordOutlined",component:y.icons$FileWordOutlined,style:Dt}),locked:we.isLocked,strokeWidth:N.iconStrokeWidth}),label:n("Outlook"),onClick:()=>we.isLocked?Ze("export_platforms"):St(!!Tt)}),N.exportPdfEnabled&&It.push({key:"pdf",icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FilePdfOutlined",component:y.icons$FilePdfOutlined,style:Dt}),locked:S.isLocked,strokeWidth:N.iconStrokeWidth}),label:n("PDF"),onClick:()=>S.isLocked?Ze("export_pdf"):fn()}),N.exportPngEnabled&&It.push({key:"img",icon:(0,s.jsx)(qt,{icon:R?(0,s.jsx)(o.EmIcons,{icon:"LoadingOutlined",component:y.icons$LoadingOutlined,spin:!0,style:Dt}):(0,s.jsx)(o.EmIcons,{icon:"FileImageOutlined",component:y.icons$FileImageOutlined,style:Dt}),locked:se.isLocked,strokeWidth:N.iconStrokeWidth}),label:n("PNG"),disabled:!se.isLocked&&R,onClick:()=>se.isLocked?Ze("export_png"):hn()});const gt=e.author;return(0,s.jsxs)(y.ui_kit$Space,{children:[N.emailDropdownMenuEnabled?(0,s.jsx)(y.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:dt},children:(0,s.jsx)(y.ui_kit$Button,{type:"default",block:!1,className:"email-page-header__btn email-page-header__btn_extra",onClick:()=>{},children:(0,s.jsx)(o.EmIcons,{icon:"DotsHoriz",component:y.icons$DotsHoriz,size:18,strokeWidth:N.iconStrokeWidth})})},"Actions"):N.emailDropdownMenuImport&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Import","verb"),placement:"bottom",children:N.emailDropdownMenuImportButton?(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__editor-page__import",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,size:16,strokeWidth:N.iconStrokeWidth}),onClick:()=>{ve({event:"click",action:"import_email"}),je()},children:n("Import")}):(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__editor-page__import",type:"text",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,size:22,strokeWidth:N.iconStrokeWidth}),onClick:()=>{ve({event:"click",action:"import_email"}),je()}})}),N.emailExportEnabled&&(0,s.jsx)(y.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:It},children:(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__email-page__export",type:"default",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudDownloadOutlined",component:y.icons$CloudDownloadOutlined,size:16,strokeWidth:N.iconStrokeWidth}),children:n("Export")},"Export")},"Export"),!e.hasOwnProperty("type")&&(0,s.jsx)(ba,{disabled:fe,email:e},"Save"),!!e.hasOwnProperty("type")&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Nu,{disabled:fe,rightCol:void 0,block:e,isEditableRights:m||f||h.id?.toString()===gt?.toString(),autoSaveBlockResult:t})},"Save"),(0,s.jsx)(ip,{open:me,codeSize:o.getCodeSize(Te),onMinimize:Bt,onDownloadAsIs:Oe,onCancel:Xe}),Re&&pr(Re)&&(0,s.jsx)(gp,{integration:pr(Re),visible:!!Re,loading:et,onConfirm:jn,onCancel:Ln,__:n}),(0,s.jsx)(o.PlanUpgradePrompt,{open:X,sideOnOk:void 0,onCancel:()=>Ee(!1),initialSlide:Ie})]})},_o=o.createApi({reducerPath:"confirmationMailApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:t,email:n})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${t}&user_email=${n}`)}`})})})}),{useLazyGetConfirmationMailQuery:ff}=_o,hf=()=>{const{__:e}=o.useI18n(),t=o.useNotification(),n=o.useCurrentUser(),[r]=ff(),[i,a]=(0,l.useState)(!1),c=o.usePushToDataLayer();(0,l.useEffect)(()=>{n.hasOwnProperty("email_confirmation")&&a(n.email_confirmation)},[n,i]);const d=()=>{c({event:"click",action:"click_resend_confirmation_email",user_email:n.email,user_id:n.id}),r({userId:n.id,email:n.email}).then(({data:u,error:m})=>{u?t.success(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",n.email)):m&&t.error(m)})};return n?.email_confirmation||!n?.privacy_policy_agreement?null:(0,s.jsx)("div",{className:"main__ribbon",children:(0,s.jsxs)("span",{children:[(0,s.jsx)(o.EmIcons,{icon:"EmailConfirmation",component:y.icons$EmailConfirmation,size:16,style:{marginRight:10,verticalAlign:"-0.15em"}}),e("Confirmation email was sent to")," ",(0,s.jsx)("em",{children:n.email}),". ",e("Didn't receive an email?")," ",(0,s.jsxs)(y.ui_kit$Button,{type:"primary",size:"small",className:"main__ribbon-resend",style:{fontSize:16,lineHeight:1,display:"inline-flex",alignItems:"center",gap:8},onClick:d,children:[e("Resend"),(0,s.jsx)(o.EmIcons,{icon:"SendOutlined",component:y.icons$SendOutlined,size:16,style:{flexShrink:0}})]})]})})},gf=({className:e,leftBlock:t,rightBlock:n,isHeaderCodeMenuOpen:r=!1})=>{const{token:i}=(0,y.ui_kit$useToken)(),a=(0,l.useRef)(),c=o.useAppConfig();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(hf,{}),c.headerShow&&(0,s.jsx)("header",{className:(0,ot.default)("header",{[e]:e}),style:{borderColor:i.colorBorder},children:!r&&(0,s.jsx)(o.CSSTransition,{nodeRef:a,in:!r,timeout:300,classNames:"transition",children:(0,s.jsxs)("div",{className:"header__container container",children:[(0,s.jsx)("div",{className:"header__left",style:{flexGrow:1},children:t}),(0,s.jsx)("div",{className:"header__right",children:(0,s.jsx)(y.ui_kit$Space,{size:10,children:n})})]})})})]})},yf=e=>{},Aa=g.createIdentifier$1("canvas.headerFlow");function _f(e){const t=(0,l.useCallback)(n=>e?e.subscribe(n):()=>{},[e]);return(0,l.useSyncExternalStore)(t,()=>e?.isReady()===!0)}var xa=({email:e,isCollaborationEditor:t})=>{const[n]=y.ui_kit$Form.useForm(),{__:r}=o.useI18n();let i=o.useDispatch();const a=o.useEmailAttributesWriter(),c=o.useAppNavigate(),d=o.useOpenPlanCatalog(),u=Yi("header"),m=o.useCurrentUser(),f=o.useContainer().getInstance(Aa),h=o.useProjectData(),{owner:_,admin:p}=Qn(),{token:E}=(0,y.ui_kit$useToken)(),k=o.useAppConfig(),w=o.usePushToDataLayer(),b=(0,l.useRef)(),x=(0,l.useRef)(),P=(0,l.useRef)(),Y=o.useEventEmitter(g.events.ON_PREVIOUSBUTTON_CLICK_ID),J=o.useEventEmitter(g.events.ON_PREHEADER_CHANGED_ID),N=o.useEventEmitter(g.events.ON_SUBJECT_CHANGED_ID),O=o.useSelector(o.selectCodeModeDirection),A=e.hasOwnProperty("type")?o.BLOCK:o.EMAIL,L=o.useSelector(o.selectElementSettings$1),z=o.useSelector(o.selectElementSettings),B=A==="email"?L:z,$=o.useSelector(o.selectIsCodeMode),[de,pe]=(0,l.useState)(!1),[H,Z]=(0,l.useState)(!1),[De,be]=(0,l.useState)(!1),et=(0,l.useCallback)(()=>be(!1),[]),ve=(0,l.useCallback)(()=>{be(!1),d()},[d]),fe=Hi("email_generate"),K=fe.exceeded?o.getLimitUpgradePresetDefinition(fe.exceeded.presetId):null;(0,l.useEffect)(()=>{const I=!!B?.type&&(B?.type===o.ELEMENT_TYPES.TEXT||B?.type===o.ELEMENT_TYPES.LINK||B.type===o.ELEMENT_TYPES.BUTTON)&&$&&O!=="bottom";pe(I),i(o.setHeaderCodeMenuOpen(I))},[B,O,$]);const me=(0,l.useCallback)(()=>{w({event:"click",action:"click_back_button",entity_type:A==="block"?"block":"email",entity_id:e?.id,project_id:e?.project||h?.id,context:"editor"}),Y.fire(e)},[c,Y,e,h?.id,w,A]),{document:ie}=o.useCurrentSession(),ae=_f(ie);o.usePrevious(([I])=>{ae&&I!==e.subject&&N.fire(e.subject)},[e.subject,ae]);const Ae=(0,l.useCallback)(I=>{const S=I.target.value;N.fire(S)},[N]),Te=(0,l.useCallback)(I=>{const S=I.target.value;J.fire(S)},[J]);o.usePrevious(([I])=>{ae&&I!==e.preheader&&J.fire(e.preheader)},[e.preheader,ae]);const Fe=(0,l.useCallback)((I,S="?")=>{I.subject?.length,I.preheader?.length,n.setFieldValue("subject",I.subject??""),n.setFieldValue("preheader",I.preheader??"")},[n]),X=(0,l.useRef)(void 0);(0,l.useEffect)(()=>{const I=e?.renderGuid??(e?.id!=null?String(e.id):void 0);!ae||!I||X.current===I||(X.current=I,Fe(e,"identity"))},[ae,e,Fe]);const Ee=(0,l.useCallback)(I=>{const S=I.target.value.trim();a({subject:S})},[a]),Ie=o.useEvent(g.events.BEFORE_SAVE_EMAIL),he=(0,l.useCallback)(async I=>{const S=x.current?.input;if(document.activeElement===S){const we=S.value.trim();we!==I.subject&&(I.subject=we,a({subject:we}))}const se=P.current?.input;if(document.activeElement===se){const we=se.value.trim();we!==I.preheader&&(I.preheader=we,a({preheader:we}))}await f?.whenDelivered()},[f,a]);(0,l.useEffect)(()=>{const I=Ie(he);return()=>I.dispose()},[Ie,he]);const Re=(0,l.useCallback)(I=>{const S=I.target.value.trim();a({preheader:S})},[a]),$e=o.useEvent(g.events.ON_HEADER_APPLIED_ID);(0,l.useEffect)(()=>{const I=$e(({field:S,value:se})=>{n.setFieldValue(S,se)});return()=>I.dispose()},[$e,n]),yf(e.title===null?r("New email title"):e.title);const C=(0,l.useCallback)(()=>{i(o.setActiveSettingsTab(o.AICHAT)),setTimeout(()=>{const I=document.querySelector('li.ai-response-change-context[role="theme-and-preheader-generator"]');I&&I.click()},100)},[i]),T=(0,l.useCallback)(()=>{fe.isLocked?fe.state.state==="locked_by_limit"&&fe.exceeded?be(!0):Z(!0):C()},[fe,C]),R=(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(y.ui_kit$Space,{ref:b,size:10,children:[k.headerArrowBackVisible&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Back"),placement:"left",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsx)(o.EmIcons,{icon:"ArrowLeftOutlined",component:y.icons$ArrowLeftOutlined,size:22,strokeWidth:k.iconStrokeWidth}),onClick:me,shape:"circle"})}),(0,s.jsx)("div",{children:(k.headerTitleVisible||k.headerPreheaderVisible)&&(0,s.jsxs)(y.ui_kit$Form,{form:n,layout:"vertical",name:"subject_preheader_form",autoComplete:"off",initialValues:{subject:"",preheader:""},children:[k.headerTitleVisible&&(0,s.jsx)("div",{style:{marginTop:ae?-3:0},children:(0,s.jsxs)(y.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,s.jsx)("div",{className:"subject_preheader_form__title",children:r("Subject")}),ae?(0,s.jsxs)("div",{className:"ant-page-header-heading",children:[(0,s.jsx)(y.ui_kit$Form.Item,{name:"subject",noStyle:!0,children:(0,s.jsx)(y.ui_kit$Input,{className:"ant-page-header-heading-title",ref:x,placeholder:r("Enter subject line here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:Ae,onPressEnter:Ee,onBlur:I=>{Ee(I),document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.add("focus")},disabled:k.lockPreheaderAndTitle})}),k.aiAssistentEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Generate with AI"),children:(0,s.jsx)(o.EmIcons,{icon:"AI",component:y.icons$AI,size:12,strokeWidth:k.iconStrokeWidth,onClick:T})})]}):(0,s.jsx)(y.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"40%",marginTop:3}})]})}),k.headerPreheaderVisible&&(0,s.jsx)("div",{children:(0,s.jsxs)(y.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,s.jsx)("div",{className:"subject_preheader_form__title",children:r("Preheader")}),ae?(0,s.jsxs)("div",{className:"ant-page-header-heading ant-page-header-heading_preheader",children:[(0,s.jsx)(y.ui_kit$Form.Item,{name:"preheader",noStyle:!0,children:(0,s.jsx)(y.ui_kit$Input,{className:"ant-page-header-heading-preheader",ref:P,placeholder:r("Enter preheader here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:Te,onPressEnter:Re,onBlur:I=>{Re(I),document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.add("focus")},disabled:k.lockPreheaderAndTitle})}),k.aiAssistentEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Generate with AI"),children:(0,s.jsx)(o.EmIcons,{icon:"AI",component:y.icons$AI,size:12,strokeWidth:k.iconStrokeWidth,onClick:T})})]}):(0,s.jsx)(y.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"80%",marginTop:2}})]})})]})})]})}),D=(0,s.jsxs)(s.Fragment,{children:[k.emailIdShow&&!!e.id&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"email-page-header__email-id",children:"ID"+e.id}),(0,s.jsx)(y.ui_kit$Divider,{orientation:"vertical"})]}),(0,s.jsx)(fa,{emailElement:e,isCollaborationEditor:t}),k.commandButtonsEnabled&&(0,s.jsxs)(s.Fragment,{children:[e.lock?(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:18,strokeWidth:k.iconStrokeWidth,className:(0,ot.default)("lock-icon",{"lock-icon__disabled":!(_||p||m.id?.toString()===e.author?.toString())}),style:{color:E.colorPrimary,verticalAlign:"sub"}},"Lock"):null,(0,s.jsx)(pf,{email:e,isHeaderCodeMenuOpen:de},"Buttons")]})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(gf,{className:"email-pane__header",leftBlock:u?R:null,rightBlock:u?D:null,isHeaderCodeMenuOpen:de}),(0,s.jsx)(o.PlanUpgradePrompt,{open:H,onCancel:()=>Z(!1),initialSlide:9}),K&&fe.exceeded?(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(ir,{open:De,onClose:et,title:r(K.titleKey),subtitle:r(K.subtitleKey),usageResource:K.usageResource,previousDisplay:o.presetLimitDisplay(fe.exceeded.previousLimit),nextDisplay:o.presetLimitDisplay(fe.exceeded.nextLimit),onChangePlan:ve})}):null]})};xa.propTypes={};function bf(e){const t=o.parseEmBlockVersion(e);if(!t)return e;const n=r=>String(r).padStart(2,"0");return`${n(t.getDate())}.${n(t.getMonth()+1)}.${t.getFullYear()} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var vf=({open:e,blocks:t,projectId:n,onClose:r})=>{const{__:i,_n:a}=o.useI18n(),c=o.useSendPostMessage(),d=o.useNotification(),[u,m]=(0,l.useState)({});(0,l.useEffect)(()=>{e&&m(Object.fromEntries(t.map(p=>[p.emBlockId,!0])))},[e,t]);const f=(0,l.useMemo)(()=>Object.values(u).filter(Boolean).length,[u]),h=(p,E)=>{m(k=>({...k,[p]:E}))},_=()=>{const p=t.filter(E=>u[E.emBlockId]);p.length&&(p.forEach(E=>{c({operation:o.EVENT_TYPES.SANDBOX_GLOBAL_BLOCK_REPLACE,settings:{emBlockId:E.emBlockId,blockHTML:E.savedHtml,type:"project",...n?{project:String(n)}:{}}})}),d.success({message:i("Updated")+" "+p.length+" "+a("block","blocks",p.length),placement:"bottomRight"}),r())};return(0,s.jsxs)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:i("Update global blocks")}),open:e,onOk:_,onCancel:r,footer:(0,s.jsxs)("div",{className:"update-global-blocks-modal__footer",children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:r,children:i("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",disabled:f===0,onClick:_,children:i("Update")})]}),children:[(0,s.jsx)("div",{className:"update-global-blocks-modal__hint",children:i("These global blocks have a newer saved version. Select the ones to update in the template.")}),(0,s.jsx)("div",{className:"update-global-blocks-modal__list",children:t.map(p=>(0,s.jsxs)("div",{className:"update-global-blocks-modal__row",children:[(0,s.jsx)(y.ui_kit$Switch,{checked:!!u[p.emBlockId],onChange:E=>h(p.emBlockId,E)}),(0,s.jsxs)("span",{className:"update-global-blocks-modal__title",title:p.title,children:[p.title,(0,s.jsxs)("span",{className:"update-global-blocks-modal__version",children:[i("Version of")," ",bf(p.savedVersion)]})]}),p.instances>1&&(0,s.jsxs)("span",{className:"update-global-blocks-modal__count",children:[p.instances," ",a("instance","instances",p.instances)]})]},p.emBlockId))})]})};function Ef(e){const t=new Map;return e?.trim()&&new DOMParser().parseFromString(e,"text/html").querySelectorAll('[em="block"][em-block-id]').forEach(n=>{const r=n.getAttribute("em-block-id");if(!r)return;const i=n.getAttribute("em-block-version")??void 0,a=t.get(r);a?(a.versions.add(i),a.count+=1):t.set(r,{versions:new Set([i]),count:1})}),t}function Sf(e,t){const n=Ef(e);if(!n.size||!t?.length)return[];const r=[];for(const i of t){if(!i.global_block||!i.id||!i.html)continue;const a=String(i.id),c=n.get(a);if(!c)continue;const d=o.readRootEmBlockAttrs(i.html).emBlockVersion;d&&[...c.versions].some(u=>u!==d)&&r.push({emBlockId:a,title:i.title?.trim()||a,savedHtml:i.html,savedVersion:d,templateVersion:[...c.versions][0],instances:c.count})}return r}var Pa="em-block-id";function wf({projectId:e,document:t}){const n=o.useEvent(g.events.ON_EMAIL_INIT_ID),r=o.useHeadless(),[i,a]=(0,l.useState)([]),[c,d]=(0,l.useState)(!1),[u,m]=(0,l.useState)(null),f=(0,l.useCallback)(E=>t?.subscribe(E)??(()=>{}),[t]),h=(0,l.useSyncExternalStore)(f,()=>!!t?.getContent().includes(Pa)),{data:_}=o.blocksApi.endpoints.getBlocks.useQuery(o.projectBlocksArgs(e),{skip:!e||!h}),p=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{h&&p.current&&t&&(p.current=!1,m(t.getContent()))},[h,t]),(0,l.useEffect)(()=>{const E=new g.Disposable;return E.addDisposable(n(k=>{if(k?.reset)return;const w=k?.html??"",b=w.includes(Pa);p.current=!b,m(b?w:null)})),()=>E.dispose()},[n]),(0,l.useEffect)(()=>{if(u==null||!_)return;if(r){m(null);return}const E=Sf(u,_);E.length&&(a(E),d(!0)),m(null)},[u,_,r]),{outdatedBlocks:i,isOpen:c,close:(0,l.useCallback)(()=>d(!1),[])}}var kf=({open:e,html:t,emBlockId:n,onSaveAsNew:r,onClose:i})=>{const{__:a}=o.useI18n(),c=o.useSendPostMessage(),d=o.useNotification(),[u]=o.useEditBlockMutation(),[m,f]=(0,l.useState)(!1),h=async()=>{if(!n||!t){i();return}f(!0);const _=new Date,p=o.formatEmBlockVersion(_),E=o.injectEmBlockIdIntoBlockHtml(t,String(n),_),k=await u({blockId:String(n),html:E});if(f(!1),"error"in k&&k.error){d.error({message:a("Failed to update the global block."),placement:"bottomRight"});return}c({operation:o.EVENT_TYPES.SANDBOX_EBLOCK_SET_EM_BLOCK_ID,settings:{emBlockId:String(n),emBlockVersion:p}}),d.success({message:a("The global block was updated."),placement:"bottomRight"}),i()};return(0,s.jsx)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:a("Saving changes in the block")}),open:e,onCancel:i,footer:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",disabled:m,onClick:r,children:a("Create new block")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",loading:m,onClick:h,children:a("Update current block")})]}),children:(0,s.jsx)("div",{children:a("This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.")})})},Cf=(function(){var e=window.__emailmaker__;if(e&&e.assetUrl)return e.assetUrl("converter-intro.bf4ee74d750b35ae2c10.png");if(e&&e.publicPath)try{return new URL("static/media/converter-intro.bf4ee74d750b35ae2c10.png",e.publicPath).href}catch{}try{return new URL("/static/media/converter-intro.bf4ee74d750b35ae2c10.png",typeof document<"u"&&document.baseURI?document.baseURI:typeof window<"u"&&window.location?window.location.href:"").href}catch{return"/static/media/converter-intro.bf4ee74d750b35ae2c10.png"}})(),Tf={closable:!1},If=Cf,Af=({open:e,onConfirm:t,onCancel:n,neverSuggestAgain:r,onNeverSuggestAgainChange:i})=>{const{__:a}=o.useI18n();return(0,s.jsx)(y.ui_kit$Modal,{className:"convert-layout-modal",title:(0,s.jsx)("div",{className:"convert-layout-modal__title",children:a("Template conversion")}),open:e,onOk:t,onCancel:n,mask:Tf,width:480,footer:(0,s.jsxs)("div",{className:"convert-layout-modal__footer",style:{display:"flex",flexDirection:"column",gap:16},children:[(0,s.jsx)(y.ui_kit$Switch,{size:"small",checked:r,onChange:i,label:a("Don't suggest again"),labelSize:"small"}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:n,children:a("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:t,children:a("Convert")})]})]}),children:(0,s.jsxs)("div",{className:"convert-layout-modal__content",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:24,padding:"0 8px",overflow:"hidden"},children:[(0,s.jsx)("div",{className:"convert-layout-modal__text convert-layout-modal__intro-text",style:{textAlign:"center"},children:a("This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.")}),(0,s.jsx)("img",{src:If,alt:"Converter Intro",className:"convert-layout-modal__image",style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",borderRadius:8}})]})})},xf={closable:!1},Pf=({open:e,message:t,onRetry:n,onCancel:r})=>{const{__:i}=o.useI18n();return(0,s.jsx)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:i("Conversion failed")}),open:e,onOk:n,onCancel:r,mask:xf,footer:(0,s.jsxs)("div",{className:"convert-layout-modal__footer",children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:r,children:i("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:n,children:i("Try again")})]}),children:(0,s.jsxs)("div",{className:"convert-layout-modal__text",children:[i("Something went wrong during layout conversion. You can try running the conversion again."),t?(0,s.jsx)("div",{className:"convert-layout-modal__error-details",children:t}):null]})})},Rf=({open:e,progress:t})=>{const{__:n}=o.useI18n();return e?(0,s.jsx)("div",{className:"conversion-overlay",children:(0,s.jsxs)("div",{className:"conversion-overlay__content",children:[(0,s.jsx)(y.ui_kit$Spin,{size:"large"}),(0,s.jsx)("div",{className:"conversion-overlay__title",children:n("Converting layout…")}),(0,s.jsx)("div",{className:"conversion-overlay__hint",children:n("This may take several minutes. Please keep this tab open.")}),(0,s.jsx)(y.ui_kit$Progress,{className:"conversion-overlay__progress",percent:Math.round(t),status:"active",strokeColor:o.emCssVar("colorPrimary")})]})}):null},bo=o.createApi({reducerPath:"layoutConverterApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({createConvertJob:e.mutation({query:({html:t})=>({url:"/ai/converter/jobs",method:"POST",body:{html:t}})}),getConvertJobStatus:e.query({query:t=>({url:`/ai/converter/jobs/${t}`,method:"GET"})})})}),{useCreateConvertJobMutation:jf,useLazyGetConvertJobStatusQuery:Lf}=bo;function Of(){try{return window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)==="true"}catch{return!1}}function Mf(e){try{e?window.localStorage.setItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest,"true"):window.localStorage.removeItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)}catch{}}function Ra(e){return e==="beefree"?(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/cbcede3f.js")).then(t=>t.convertBeeFreeToEmailMaker),void 0,{}.url):(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/bebf981d.js")).then(t=>t.convertStripoToEmailMaker),void 0,{}.url)}var Nf=5,ja=95,Df=35e3,Ff=1e3,Bf=e=>new Promise(t=>setTimeout(t,e));function Uf(e,t){if(e&&typeof e=="object"){const n=e,r=n.data;if(r&&typeof r=="object"){const i=r.error;if(typeof i=="object"&&i?.message)return i.message;if(typeof i=="string"&&i)return i;if(r.message)return r.message}if(typeof r=="string"&&r)return r;if(n.error)return n.error;if(n.message)return n.message}return t}function $f(){const{__:e}=o.useI18n(),t=o.useContentReplacer(),n=o.useNotification(),r=Ea(),{aiLayoutConverterEnabled:i,anyConverterEnabled:a}=r,c=o.useHeadless(),d=o.useEvent(g.events.ON_EMAIL_INIT_ID),u=o.useEvent(g.events.ON_LAYOUT_CONVERT_REQUEST_ID),[m]=jf(),[f]=Lf(),[h,_]=(0,l.useState)(Of),p=(0,l.useRef)(h),E=(0,l.useCallback)(ie=>{p.current=ie,_(ie),Mf(ie)},[]),[k,w]=(0,l.useState)(!1),[b,x]=(0,l.useState)(!1),[P,Y]=(0,l.useState)(0),[J,N]=(0,l.useState)(!1),[O,A]=(0,l.useState)(""),L=(0,l.useRef)(""),z=(0,l.useRef)(null),B=(0,l.useRef)(null),$=(0,l.useRef)(!1),de=(0,l.useRef)({cancelled:!0}),pe=(0,l.useRef)(null);(0,l.useEffect)(()=>{$.current=b},[b]);const H=(0,l.useCallback)(()=>{pe.current!==null&&(clearInterval(pe.current),pe.current=null)},[]),Z=(0,l.useCallback)(()=>{H();const ie=Date.now();pe.current=setInterval(()=>{const ae=Date.now()-ie,Ae=ja*(1-Math.exp(-ae/Df));Y(Te=>Math.max(Te,Math.min(ja,Ae)))},Ff)},[H]),De=(0,l.useCallback)(ie=>{ie&&(t(ie,{undoable:!0}),B.current=ie)},[t]),be=(0,l.useCallback)(async ie=>{const ae={cancelled:!1};de.current=ae,N(!1);const Ae=z.current;if(Ae==="beefree"||Ae==="stripo"){try{const Te=await Ra(Ae),Fe=ae.cancelled?"":Te(ie);if(Fe&&!ae.cancelled){De(Fe),n.success({message:o.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"});return}}catch{}if(!i){ae.cancelled||(A(e("Layout conversion failed")),N(!0));return}}if(i){x(!0),Y(0),Z();try{const Te=await m({html:ie}).unwrap();if(ae.cancelled)return;let Fe=Te.retry_after>0?Te.retry_after:Nf;for(;!ae.cancelled;){if(await Bf(Fe*1e3),ae.cancelled)return;const X=await f(Te.job_id).unwrap();if(ae.cancelled)return;if(X.retry_after&&X.retry_after>0&&(Fe=X.retry_after),X.status==="completed"){H(),Y(100),De(X.html??""),n.success({message:o.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"}),setTimeout(()=>{ae.cancelled||(x(!1),Y(0))},400);return}if(X.status==="failed")throw new Error(X.error?.message||e("Layout conversion failed"))}}catch(Te){if(ae.cancelled)return;H(),x(!1),Y(0),A(Uf(Te,e("Layout conversion failed"))),N(!0)}}},[e,i,De,m,n,f,Z,H]),et=(0,l.useCallback)(()=>{w(!1);const ie=L.current;ie&&be(ie)},[be]),ve=(0,l.useCallback)(()=>{w(!1),B.current=L.current},[]),fe=(0,l.useCallback)(()=>{N(!1);const ie=L.current;ie&&be(ie)},[be]),K=(0,l.useCallback)(()=>{N(!1),B.current=L.current},[]),me=(0,l.useCallback)((ie,ae=!1)=>{const Ae=Sa(ie,r);if(a&&!c&&Ae&&!$.current){if(ae)B.current=null;else{if(p.current)return;if(B.current===ie)return}L.current=ie,z.current=Ae,Ae!=="ai"&&Ra(Ae).catch(()=>{}),w(!0)}},[a,r,c]);return(0,l.useEffect)(()=>{if(!a)return;const ie=new g.Disposable;return ie.addDisposable(d(ae=>{ae?.reset||me(ae?.html??"")})),()=>ie.dispose()},[a,d,me]),(0,l.useEffect)(()=>{if(!a)return;const ie=new g.Disposable;return ie.addDisposable(u(ae=>{me(ae?.html??"",!0)})),()=>ie.dispose()},[a,u,me]),(0,l.useEffect)(()=>()=>{de.current.cancelled=!0,H()},[H]),{isPromptOpen:k,isConverting:b,progress:P,isErrorOpen:J,errorMessage:O,confirmConversion:et,cancelPrompt:ve,retryConversion:fe,closeError:K,neverSuggestAgain:h,setNeverSuggestAgain:E}}var zf=6e4,La=new Map;function Gf(e){const t=e?String(e):"",n=La.get(t);if(n&&(La.delete(t),!(Date.now()-n.at>zf)))return n.promise}var gr={data:void 0,isSuccess:!1,isError:!1,error:void 0,isLoading:!1};function Wf(e){const t=o.useStore(),n=(0,l.useRef)(t);n.current=t;const[r,i]=(0,l.useState)(gr),a=e?String(e):void 0;return(0,l.useEffect)(()=>{if(!a){i(gr);return}let c=!1;return i({...gr,isLoading:!0}),(Gf(a)??o.resolveEmailPort(g.getContainer(n.current)).readEmail(a)).then(d=>{c||i({data:d??void 0,isSuccess:!0,isError:!1,error:void 0,isLoading:!1})}).catch(d=>{c||i({data:void 0,isSuccess:!1,isError:!0,error:d,isLoading:!1})}),()=>{c=!0}},[a]),r}var hv=2;function Hf(){const e=o.useProjectData()?.id,t=!0,{data:n,isError:r,isFetching:i,refetch:a}=o.useGetProjectPlanQuery(e,{skip:t}),[c,d]=(0,l.useState)(0),u=(0,l.useRef)(!1),m=!!r,f=c>=2,h=(0,l.useCallback)(()=>{u.current=!1,d(0),a()},[a]);(0,l.useEffect)(()=>{},[m,i,a,c,t]),(0,l.useEffect)(()=>{},[m,e,f,t]);const _="ready";return(0,l.useMemo)(()=>({status:_,retry:h}),[_,h])}var gv=300,qf=g.createIdentifier$1("prewarm.queue");function Vf(e){const t=[];let n=!1,r=!1,i;const a=()=>{i&&(i.unwatch(),e.clearTimer(i.timer),i=void 0)},c=()=>{const m=t.shift();if(!m)return;r=!0;const f=()=>{r=!1,u()};m.start().then(f,f)},d=()=>{a(),e.idle(()=>{if(!(r||t.length===0)){if(e.activity.inFlight()>0){u();return}c()}})};function u(){if(!n||r||i||t.length===0)return;const m=()=>e.setTimer(d,300),f={timer:e.activity.inFlight()===0?m():void 0,unwatch:e.activity.watch(()=>{e.clearTimer(f.timer),f.timer=e.activity.inFlight()===0?m():void 0})};i=f}return e.whenVisible(()=>{n=!0,u()}),{add(m){t.some(f=>f.name===m.name)||(t.push(m),u())},remove(m){const f=t.findIndex(h=>h.name===m);f>=0&&t.splice(f,1),t.length===0&&a()}}}function Yf(e){return e.getOrCreateInstance(qf,()=>Vf({activity:g.getNetworkActivity(e),whenVisible:t=>Ht(e).whenVisible(t),idle:Xt,setTimer:(t,n)=>window.setTimeout(t,n),clearTimer:t=>window.clearTimeout(t)}))}function Kf({projectId:e,project:t,emailProjectId:n,parentEmailId:r}){const i=o.useContainer(),a=o.useAppDispatch(),d=!!o.useCookieManager().get(o.APP_COOKIES.em_token);(0,l.useEffect)(()=>{const u=Yf(i),m=[],f=[],h=(p,E)=>{f.push(p),u.add({name:p,start:()=>{const k=E();return m.push(k),Promise.resolve(k)}})},_=o.parentEmailSource(r);return _&&h("blocks.parentEmail",()=>a(o.blocksApi.endpoints.getParentEmailBlocks.initiate(o.parentEmailBlocksArgs(_)))),h("blocks.template",()=>a(o.blocksApi.endpoints.getTemplateBlocks.initiate(o.templateBlocksArgs()))),e&&h("blocks.list",()=>a(o.blocksApi.endpoints.getBlocks.initiate(o.projectBlocksArgs(e)))),h("blocks.schema",()=>a(o.blocksApi.endpoints.getBlocksSchema.initiate(void 0))),t?.id&&h("blocks.tags",()=>a(o.taxonomiesApi.endpoints.getTerms.initiate({project:t,kind:o.BLOCK_TAGS}))),()=>{f.forEach(p=>u.remove(p)),m.forEach(p=>p.unsubscribe())}},[i,a,e,t,n,r,d])}var yr="AUTOSAVE_RECOVERY";function Qf(e,t,n=!1,r){const i=t?.get().serverId??void 0,{__:a}=o.useI18n(),c=o.useNotification(),d=o.useAppConfig(),u=o.useSelector(o.selectMonacoFocusing),m=o.useContainer(),f=m?.getInstance(Aa),h=(0,l.useRef)(0),_=o.useSelector(o.selectIsPanelHistoryCollapsed),p=o.useSelector(o.selectActiveSettingsTab),E=o.useDispatch(),k=(0,l.useSyncExternalStore)((0,l.useCallback)(O=>r?.subscribe(O)??(()=>{}),[r]),()=>r?.recoveryFacts()),w=d?.revisionService===!0,b=k?.isRecovering===!0,x=k?.applied,P=(0,l.useCallback)(()=>{E(o.markAppearanceNeedsUpdate());const O=e?.renderGuid,A=e?.preheader,L=e?.subject;O&&(A||L)&&f?.reassert({...A?{preheader:A}:{},...L?{subject:L}:{}})},[E,f,e?.preheader,e?.subject,e?.title,e?.common_styles,e?.renderGuid,t,r]);(0,l.useEffect)(()=>()=>{clearTimeout(h.current),r?.endForcedHeaders()},[i,r]),(0,l.useEffect)(()=>{w&&b&&c.info({key:yr,title:a("Loading latest changes..."),duration:0})},[w,b,c,a]);const Y=(0,l.useRef)({emailId:void 0,seq:0});(0,l.useEffect)(()=>{if(!x||k?.emailId!==i||(Y.current.emailId!==i&&(Y.current={emailId:i,seq:0}),x.seq<=Y.current.seq))return;Y.current={emailId:i,seq:x.seq},P();const{phase:O}=x;!w||O==="normal"||(O==="found"?c.success({key:yr,title:a("Changes loaded"),duration:3}):O==="timeout"?c.warning({key:yr,title:a("Locally saved version applied"),description:a("Syncing with the server in the background..."),duration:5}):O==="bg"&&c.info({key:"AUTOSAVE_BG_SYNCED",title:a("Email synced with the server"),duration:3}))},[w,x,k?.emailId,i,P,c,a]),(0,l.useEffect)(()=>{if(!n)return;const O=A=>{A.preventDefault()};return window.addEventListener("beforeunload",O),()=>window.removeEventListener("beforeunload",O)},[n]);const J=!_||u||p==="Discuss",N=m?o.provideAutosaveUiFacts(m):void 0;(0,l.useEffect)(()=>{N?.set({...N.get()??{isUserBusy:!1,saveContext:{}},isUserBusy:J})},[N,J])}var Xf=class extends Error{label;timeoutMs;constructor(e,t){super(`[${e}] timed out after ${t}ms`),this.name="OperationTimeoutError",this.label=e,this.timeoutMs=t}};function Jf(e,t,n){return t<=0?e:new Promise((r,i)=>{let a=!1,c;const d=u=>{a||(a=!0,c!==void 0&&(clearTimeout(c),c=void 0),u())};c=setTimeout(()=>{d(()=>i(new Xf(n,t)))},t),e.then(u=>{d(()=>r(u))},u=>{d(()=>i(u))})})}var Zf=2,vo=Symbol("sandbox:frame-replaced");function sn(e,t,n,r,i,a,c){const d=`sandbox:${t}`,u=a?.getSandboxTimeoutMs(t)??o.DEFAULT_SANDBOX_OP_TIMEOUT_MS[t],m=()=>{let E=Jf(e.sendAsync(n,r),u,d);return E=g.raceWithAbortSignal(E,a?.signal),o.logShowPipelineWait(d,E,i)};if(t==="INIT_START"&&Qi(e)){const E=a?.getSandboxReadyTimeoutMs()??2e4,k=e,w=b=>{const x=Xi(k,E,a?.signal);return o.logShowPipelineWait("sandbox:INIT_START:ready-wait",x,i).then(()=>{if(!c||b<=0)return m();const P=c.getGeneration();let Y;const J=new Promise((O,A)=>{Y=c.onChange(()=>{c.getGeneration()!==P&&A(vo)})}),N=m();return N.catch(()=>{}),Promise.race([N,J]).finally(()=>Y?.()).catch(O=>{if(O!==vo)throw O;return{...i},w(b-1)})})};return w(Zf)}if(!c)return m();const f=c.getGeneration();let h;const _=new Promise((E,k)=>{h=c.onChange(()=>{c.getGeneration()!==f&&k(vo)})}),p=m();return p.catch(()=>{}),Promise.race([p,_]).finally(()=>h?.()).catch(E=>{throw E===vo&&{...i},E})}function Oa(e,t,n,r){return{html:e,guid:t,...Object.keys(n).length>0?{templateDirectivesPolicy:n}:{},...r!==void 0?{rev:r}:{}}}var Ma="self-init:";function eh(e){return e.startsWith(Ma)}function Na(e,t){const n=e.getActiveShowRequest();return eh(t)?n===null:n?.showId===t&&e.hasPendingShow(t)}function th(e){const t=()=>e.initPipeline(),n=e.messageService,r=()=>e.waitScope?.()??t();let i="";const a=()=>e.readDocument()?o.readDocumentContent(e.readDocument()):i,c=()=>rn(e.container).editorPolicy,d=()=>e.readEmail(),u=()=>{const m=d();return{...m,id:e.isTemplate()||m.isNew?void 0:m.id,html:a()}};return{readContent:a,publicEmail:u,sendInitStart:()=>sn(n,"INIT_START",o.EVENT_TYPES.SANDBOX_INIT_START,{guid:d().renderGuid},void 0,r()),sendInited:()=>sn(n,"INITED",o.EVENT_TYPES.SANDBOX_INITED,{guid:d().renderGuid},void 0,r()),async sendContent(){const m=d(),{html:f,hasBrowserExtensionArtifacts:h}=o.prepareEmailHtmlForEditor(m?.html||"");h&&e.events.browserExtensionDetected(),o.loadDocumentContent(e.readDocument(),f),i=f,await sn(n,"SET_ENTITY",o.EVENT_TYPES.SANDBOX_SET_ENTITY,Oa(a(),m.renderGuid,c(),e.readDocument()?.get().version),{guid:m.renderGuid,emailId:m.id??null},r())},refreshContent:()=>sn(n,"SET_ENTITY",o.EVENT_TYPES.SANDBOX_SET_ENTITY,Oa(a(),d().renderGuid,c(),e.readDocument()?.get().version),void 0,r()),sendPreheader:async()=>{const m=d();if(m.preheader!==void 0)return sn(n,"PREHEADER",o.EVENT_TYPES.SANDBOX_PREHEADER_UPDATE,{value:m.preheader,guid:m.renderGuid,force:!0},void 0,r())},sendSubject:async()=>{const m=d();if(m.subject!==void 0)return sn(n,"SUBJECT",o.EVENT_TYPES.SANDBOX_SUBJECT_UPDATE,{value:m.subject,guid:m.renderGuid,force:!0},void 0,r())},revealFilled:()=>e.revealFilled?.()??Promise.resolve(),showFilled:m=>e.showFilled?.(m),readTarget:()=>e.readTarget?.(),fireWillInit:()=>e.events.willInit(u()),fireInit(m,f){if(!Na(t(),m)){t().getActiveShowRequest()?.showId;return}const h=d();h.id,h.renderGuid,t().completeShow(m),o.writeEmailAttributes(e.readDocument(),{is_inited:!0},{source:"system"});const _=u();return f&&(_.reset=!0),e.events.inited(_)},fireEmailChanged(){e.events.emailChanged(u())},fireContentChanged(){e.events.contentChanged(a())}}}function nh(e){const t=()=>e.initPipeline();let n=!1,r,i,a,c=0,d;const u=th({...e,waitScope:()=>({getSandboxTimeoutMs:w=>t().getSandboxTimeoutMs(w),getSandboxReadyTimeoutMs:()=>t().getSandboxReadyTimeoutMs(),signal:d?.signal??t().signal})});let m;const f=(w,b)=>{if(m===w)return;m=w;const x=c;setTimeout(()=>{c!==x||t().signal.aborted||E(w,b).catch(()=>{})},0)},h=()=>{d?.abort(),d=void 0};let _;const p=()=>{const w=t().signal;w!==_&&(_?.removeEventListener("abort",h),_=w,w.addEventListener("abort",h))};async function E(w,b){const x=++c;h(),d=new AbortController,p();const P=()=>c!==x,Y=u.readTarget(),J=t().generation,N=()=>J===t().generation&&!t().signal.aborted,O=b?"init:reset-":"init:";if(!b){const z=u.publicEmail();z?.id,z?.renderGuid,z?.preheader}let A=!1,L=!1;try{n=!0,await u.sendInitStart(),u.fireWillInit(),await(b?u.refreshContent():u.sendContent()),A=!0,b||u.publicEmail()?.id;try{await u.sendPreheader()}catch(z){o.logShowPipelineError(`${O}preheader-failed`,{showId:w,error:String(z)})}try{await u.sendSubject()}catch(z){o.logShowPipelineError(`${O}subject-failed`,{showId:w,error:String(z)})}if(P()||u.showFilled(Y),await u.sendInited(),L=!0,i===w){const z=e.readSandboxGeneration?.()??a;z!==void 0&&(r=z)}await u.revealFilled()}catch(z){throw P()||o.logShowPipelineError(`${O}failed`,{showId:w,contentApplied:A,sandboxInitedAcked:L,superseded:!1,...e.describeSurface?.(),error:String(z)}),!P()&&Na(t(),w)&&t().failShow(w,z),z}finally{k(w,b,O,{superseded:P(),sessionGeneration:J,contentApplied:A,sandboxInitedAcked:L,commit:N()})}}function k(w,b,x,P){const{superseded:Y,contentApplied:J,sandboxInitedAcked:N}=P;if(Y){`${x}`;return}N&&P.commit?u.fireInit(w,b||void 0):N?o.logShowPipelineError(`${x}aborted (stale session or signal)`,{showId:w,sessionGeneration:P.sessionGeneration,currentGeneration:t().generation,aborted:t().signal.aborted}):J?o.logShowPipelineError(`${x}aborted (sandbox INITED ack missing)`,{showId:w}):o.logShowPipelineError(`${x}aborted (content not applied)`,{showId:w}),n=!1,d=void 0,!N&&i===w&&(i=void 0,r===a&&(r=void 0)),!N&&J&&f(w,b)}return{channel:u,isEventsLocked:()=>n,filledGeneration:()=>r,markFilled:w=>{r=w},lastCorrelation:()=>i,markCorrelation:w=>{i=w},bumpRunSeq:()=>{c+=1},noteSandboxGeneration:w=>{a=w},fill:w=>E(w,!1),refill:w=>E(w,!0),stop:()=>{c+=1,h(),n=!1,_?.removeEventListener("abort",h),_=void 0}}}function oh(e,t,n){if(!e?.renderGuid||!e.showId||e.showId!==t.showId)return!1;if(t.isNew)return e.id==null;const r=t.emailId??t.navId;return r!=null&&String(e.id??"")!==String(r)?!1:Da(e,n)}function Da(e,t){return t?e?.id==null?!1:String(e.id)===String(t):!0}function rh(e){const{pipeline:t,readEmail:n,readDocument:r,readRouteEmailId:i,readSandboxGeneration:a}=e,c=f=>{const h=n(),_=i();if(!oh(h,f,_)){f.showId,f.navId,f.emailId,h?.id,h?.showId,h?.renderGuid;return}f.showId,h?.id,h?.renderGuid,t.markFilled(a()),t.markCorrelation(f.showId),t.fill(f.showId).catch(()=>{})};return{showRequested:f=>{c(f)},showRequestIdentityChanged:()=>{const f=e.initPipeline().getActiveShowRequest();f&&c(f)},selfInitChanged:()=>{if(e.initPipeline().getActiveShowRequest())return;const f=a();if(t.filledGeneration()===f)return;const h=n(),_=i();if(!h?.renderGuid||!Da(h,_))return;const p=`${Ma}${h.renderGuid}`;t.markFilled(f),t.markCorrelation(p);const E=r()?.isReady()===!0;h.id,h.renderGuid,(E?k=>t.refill(k):k=>t.fill(k))(p).catch(()=>{t.lastCorrelation()===p&&t.markFilled(void 0)})},saasChanged:()=>{const f=n();f?.renderGuid,f?.showToken,f?.id}}}var Fa=g.createIdentifier$1("canvas.sandboxFill"),ih=class extends Error{showId;constructor(e,t){super(`[emailmaker] show() timed out after ${t}ms waiting for editor init (showId=${e}). Check earlier console errors: wrong host-plugin publicPath (chunks return HTML), mount element removed without destroy(), or sandbox init never completed. Search for [show-pipeline] and [AMD] messages.`),this.name="ShowPipelineTimeoutError",this.showId=e}},ah=class{_activeRequest=null;_pending=new Map;_listeners=new Set;getActiveShowRequest(){return this._activeRequest}onShowRequested(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}requestShow(e,t,n){return this._rejectPending(g.createAbortError("Superseded by newer show()")),n.aborted?Promise.reject(g.createAbortError(n.reason)):(this._activeRequest=e,new Promise((r,i)=>{const a=setTimeout(()=>{this._settle(e.showId,()=>{i(new ih(e.showId,t))})},t);a.unref?.();const c=()=>{this._settle(e.showId,()=>{i(g.createAbortError(n.reason))})};n.addEventListener("abort",c,{once:!0});const d=()=>{clearTimeout(a),n.removeEventListener("abort",c)};this._pending.set(e.showId,{request:e,resolve:r,reject:i,timeoutId:a,dispose:d});for(const u of this._listeners)u(e)}))}completeShow(e){this._settle(e,t=>{t.resolve()})}hasPendingShow(e){return this._pending.has(e)}failShow(e,t){this._settle(e,n=>{n.reject(t)})}rejectAll(e){this._rejectPending(e),this._activeRequest=null}_settle(e,t){const n=this._pending.get(e);n&&(n.dispose(),this._pending.delete(e),this._activeRequest?.showId===e&&(this._activeRequest=null),t(n))}_rejectPending(e){for(const[,t]of this._pending)t.dispose(),t.reject(e);this._pending.clear()}};function sh(e,t){return{contentReady:t.contentReady??e?.contentReady,sandboxReady:t.sandboxReady??e?.sandboxReady,sandbox:t.sandbox?{...e?.sandbox,...t.sandbox}:e?.sandbox}}function lh(e){if(!e||!(e.contentReady!==void 0||e.sandboxReady!==void 0||e.sandbox!==void 0))return;const t=o.resolveContentReadyTimeoutMs(e),n=o.resolveSandboxReadyTimeoutMs(e),r=o.resolveSequentialSandboxOpBudgetMs(e.sandbox);t<n+r}var ch=class{_controller=new AbortController;_externalSignalDisposable=new g.Disposable;_sessionChangeListeners=new Set;_showRegistry=new ah;_timeouts;_generation=0;_sessionStarted=!1;get signal(){return this._controller.signal}get generation(){return this._generation}get contentReadyTimeoutMs(){return o.resolveContentReadyTimeoutMs(this._timeouts)}getSandboxTimeoutMs(e){return o.resolveSandboxOpTimeoutMs(e,this._timeouts?.sandbox)}getSandboxReadyTimeoutMs(){return o.resolveSandboxReadyTimeoutMs(this._timeouts)}bumpGeneration(){this._generation+=1}getActiveShowRequest(){return this._showRegistry.getActiveShowRequest()}onShowRequested(e){return this._showRegistry.onShowRequested(e)}requestShow(e){return this._showRegistry.requestShow(e,this.contentReadyTimeoutMs,this._controller.signal)}completeShow(e){this._showRegistry.completeShow(e)}hasPendingShow(e){return this._showRegistry.hasPendingShow(e)}failShow(e,t){this._showRegistry.failShow(e,t)}rejectAllPendingShows(e){this._showRegistry.rejectAll(e)}onSessionReplaced(e){return this._sessionChangeListeners.add(e),()=>{this._sessionChangeListeners.delete(e)}}configure(e){e.timeouts!==void 0&&(this._timeouts=sh(this._timeouts,e.timeouts),lh(this._timeouts));const t=e.replaceSession===!0||!this._sessionStarted||e.timeouts!==void 0||e.signal!==void 0;this._sessionStarted=!0,t&&(this._replaceSessionController(),this.bumpGeneration()),(e.signal!==void 0||t)&&this._linkExternalSignal(e.signal)}abort(e){const t=e??g.createAbortError("Editor instance destroyed");this._showRegistry.rejectAll(t),this._controller.signal.aborted||(this._controller.abort(t),this.bumpGeneration()),this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new g.Disposable}_replaceSessionController(){this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new g.Disposable,this._showRegistry.rejectAll(g.createAbortError("Init session replaced")),this._controller.signal.aborted||this._controller.abort(g.createAbortError("Init session replaced")),this._controller=new AbortController,this._emitSessionReplaced()}_emitSessionReplaced(){for(const e of this._sessionChangeListeners)e()}_linkExternalSignal(e){if(!e)return;if(e.aborted){this._controller.signal.aborted||(this._controller.abort(e.reason??g.createAbortError()),this.bumpGeneration());return}const t=()=>{this._controller.signal.aborted||(this._controller.abort(e.reason??g.createAbortError()),this.bumpGeneration())};e.addEventListener("abort",t),this._externalSignalDisposable.addDispose(()=>{e.removeEventListener("abort",t)})}},dh=(()=>{const e=new ch;return e.configure({}),e})();function _r(){const e=o.useStore();return(0,l.useMemo)(()=>g.getContainer(e)?.getInstance(g.INIT_PIPELINE_ID)??dh,[e])}function uh(e){const t=_r(),n=(0,l.useRef)(e);n.current=e,(0,l.useEffect)(()=>{let r;const i=()=>{r?.();const c=t.signal;if(c.aborted){n.current();return}const d=()=>n.current();c.addEventListener("abort",d),r=()=>c.removeEventListener("abort",d)};i();const a=t.onSessionReplaced(i);return()=>{a(),r?.()}},[t])}function mh(e){const t=_r(),n=(0,l.useRef)(e);n.current=e,(0,l.useEffect)(()=>t.onShowRequested(r=>n.current(r)),[t])}var ph=(e,t,n,r,i)=>{const a=o.useStore(),c=o.useMessageService(),d=_r(),u=(0,l.useRef)(d);u.current=d;const m=o.useEventEmitter(g.events.WILL_EMAIL_INIT_ID),f=o.useEventEmitter(g.events.ON_EMAIL_INIT_ID),h=o.useEventEmitter(g.events.ON_CONTENT_CHANGED_ID),_=o.useEventEmitter(g.events.ON_EMAIL_CHANGED_ID),p=o.useEventEmitter(g.events.ON_BROWSER_EXTENSION_DETECTED_ID),E=e?.id!==void 0,k=e?.showToken??0,w=k,b=(0,l.useRef)(w);b.current=w;const x=(0,l.useRef)(void 0);x.current=e;const[P,Y]=(0,l.useState)(()=>o.getSandboxGeneration(c)),J=(0,l.useRef)(P);J.current=P,(0,l.useEffect)(()=>(Y(o.getSandboxGeneration(c)),o.onSandboxGenerationChange(c,()=>{Y(o.getSandboxGeneration(c))})),[c]);const N=(0,l.useRef)(r);N.current=r;const O=(0,l.useRef)(t);O.current=t;const A=i?.standalone?void 0:g.getContainer(a)?.getInstance(Fa),L=!A,z=(0,l.useRef)(A?.pipeline);z.current||(z.current=nh({container:g.getContainer(a),messageService:c,initPipeline:()=>u.current,readDocument:()=>N.current,readEmail:()=>x.current,isTemplate:()=>!!O.current,readSandboxGeneration:()=>J.current,events:{willInit:H=>m.fire(H),inited:H=>f.fire(H),contentChanged:H=>h.fire(H),emailChanged:H=>_.fire(H),browserExtensionDetected:()=>p.fire()}}));const B=z.current,$=(0,l.useRef)(n);$.current=n;const de=(0,l.useRef)(void 0);L&&!de.current&&(de.current=rh({pipeline:B,initPipeline:()=>u.current,readEmail:()=>x.current,readDocument:()=>N.current,readRouteEmailId:()=>$.current,readSandboxGeneration:()=>J.current}));const pe=de.current;B.noteSandboxGeneration(J.current),(0,l.useEffect)(()=>{if(L)return()=>z.current?.stop()},[L]),(0,l.useEffect)(()=>{A?.setRoute({emailId:n,isTemplate:t})},[A,n,t]),(0,l.useEffect)(()=>{const H=x.current;if(L&&!B.isEventsLocked()&&e?.renderGuid===H?.renderGuid&&H?.is_inited&&H){const Z=B.channel.readContent();_.fire({...H,id:t||H.isNew?void 0:H.id,html:Z})}},[B,e?.renderGuid,e?.preheader,e?.common_styles,e?.meta,e?.subject,e?.utm_parameters?.utm_campaign||"",e?.utm_parameters?.utm_content||"",e?.utm_parameters?.utm_medium||"",e?.utm_parameters?.utm_source||"",e?.utm_parameters?.utm_term||"",_,t,L]),(0,l.useEffect)(()=>{if(L){const H=o.subscribeToContent(r,()=>{const Z=x.current;if(!B.isEventsLocked()&&e?.renderGuid===Z?.renderGuid&&Z){const De=B.channel.readContent();h.fire(De),_.fire({...Z,id:t||Z.isNew?void 0:Z.id,html:De})}});return()=>H.dispose()}},[r,B,h,_,e,t,L]),uh(()=>{L&&B.stop()}),mh(H=>{pe?.showRequested(H)}),(0,l.useEffect)(()=>{pe?.showRequestIdentityChanged()},[pe,d,e?.renderGuid,e?.showId,e?.id,n]),(0,l.useEffect)(()=>{pe?.selfInitChanged()},[pe,d,e?.renderGuid,e?.showId,e?.id,n,r,P]),o.usePrevious(()=>{pe?.saasChanged()},[e?.renderGuid,k,E,pe]),er(async()=>{if(!L)return;const H=d.getActiveShowRequest()?.showId;H&&(B.markFilled(J.current),await B.refill(H))},{async:!0})};function fh(e){const t=o.useEvent(g.events.ON_EMAIL_INIT_ID);(0,l.useEffect)(()=>{if(!e)return;const n=t(()=>e.clear());return()=>n.dispose()},[e,t])}function hh(e,t){const n=o.useEventEmitter(g.events.ON_DOCUMENT_SESSION_CHANGE);(0,l.useEffect)(()=>{n.fire({document:e,history:t})},[e,t,n])}function gh({templateEmailId:e,templateEmail:t,newEmail:n}){return e?t:n}function yh({routeEmailId:e,draft:t}){const n=o.useStore();(0,l.useRef)(0),(0,l.useEffect)(()=>{},[n,e,t])}function _h(e,t){return t}function bh(e){return!1}function vh({documents:e,push:t,projectId:n,subscription:r}){(0,l.useEffect)(()=>e.onSaved(i=>{i.intent==="publish"&&t({event:"save",action:"save_email",email_id:i.serverId??void 0,project_id:n,subscription:r})}),[e,t,n,r])}function Eh(e){const t=o.useStore();(0,l.useEffect)(()=>{},[t,e])}function Sh(e,t,n){const r=o.useAppNavigate(),i=o.useContainer();(0,l.useEffect)(()=>{},[r,e,t,n,i])}function wh(e){if(!e)return{status:"unknown"};if("status"in e){const t=e.data,n=t&&typeof t=="object"?t.message:void 0,r=typeof n=="string"?n:typeof t=="string"?t:void 0;return{status:String(e.status),message:r}}return{status:e.name??"unknown",message:e.message}}function Ba(e,t,n){const{status:r,message:i}=wh(n);o.reportMessage(`Failed to load ${e} ${t??"?"}: ${r}`,{origin:"entity-load-error",tags:{mechanism:"entity-load-error",entity_type:e,http_status:r},level:"error",contexts:{entity_load_error:{entityType:e,entityId:t,status:r,message:i,url:window.location.href}}})}var{Content:kh}=y.ui_kit$Layout,Ch={paddingTop:"40px"},Th=()=>{const{__:e}=o.useI18n(),{owner:t,admin:n}=Qn(),r=o.useDispatch(),i=Yo(),a=o.useAppNavigate(),{modal:c}=y.ui_kit$App.useApp(),d=o.useAppConfig(),u=o.useRootElement(),m=o.useCookieManager(),f=o.useMessageService(),{emailId:h,preview:_}=o.useRouteParams(),p=o.useEditorProjectId(),E=o.useAppSearchParams(),k=o.useSelector(o.selectIsCodeMode),w=o.useSelector(o.selectActiveModal),b=o.useCurrentUser(),x=o.useProjectData(),P=(0,l.useMemo)(()=>o.createNewEmailDraft(x?{id:Number(x.id),title:x.name}:void 0),[x]),Y=o.useSelector(o.selectIsGlobalLoading),[J]=o.useLazyGetMeQuery(),{isSuccess:N,data:O}=o.useGetSubscriptionsQuery(),A=Hf(),[L,z]=(0,l.useState)(!1),[B,$]=(0,l.useState)(!1),[de,pe]=(0,l.useState)(),[H,Z]=(0,l.useState)(null),[De,be]=(0,l.useState)(!1),[et,ve]=(0,l.useState)(!1),[fe,K]=(0,l.useState)(!1),[me,ie]=(0,l.useState)(!1),[ae,Ae]=(0,l.useState)(!1),Te=(0,l.useRef)(),{confirm:Fe}=c,{counters:X,subscription:Ee}=b,Ie=X?.emails_counter;m.get(o.APP_COOKIES.em_template_email);const he=E.get("template")||!B&&!h&&m.get(o.APP_COOKIES.em_new_email),{isSuccess:Re,isLoading:$e,isError:C,error:T,data:R}=Wf(h?void 0:he),D=gh({templateEmailId:he,templateEmail:R,newEmail:P});yh({routeEmailId:h,draft:D});const{document:I,email:S,error:se}=o.useOpenEmail(),we=S?.id!=null?String(S.id):void 0,Ke=_h(h,we);(0,l.useEffect)(()=>{},[h,we,I,he]),Sh(h,S?.id,p);const Qe=o.useStore(),ze=o.getEmailDocuments(g.getContainer(Qe)),Ze=(0,l.useCallback)((ce,ke)=>ze.save(ce,ke),[ze]),mt=(0,l.useCallback)(()=>ze.saveState(),[ze]),vt=o.usePushToDataLayer();vh({documents:ze,push:vt,projectId:p,subscription:Ee?.post_title}),(0,l.useEffect)(()=>{!B&&S?.id&&$(!0)},[$,B,S?.id]);const ft=ze.history();hh(I,ft),fh(ft),ph(S,bh(h),Ke,I);const lt=Zo({document:I,history:ft});Qf(S,I,ze.saveState().saving,ze),Eh(p),(0,l.useEffect)(()=>{o.injectEmailRightsResolver(g.getContainer(Qe),ce=>!!(t||n||b.id?.toString()===ce?.author?.toString()))},[Qe,t,n,b.id]);const G=np({email:S,save:Ze,saveState:mt,documentSession:I}),{outdatedBlocks:V,isOpen:te,close:ue}=wf({projectId:p,document:I});Kf({projectId:p,project:x,emailProjectId:S?.project,parentEmailId:S?.parent_email});const ge=w===o.MODALS.ADD_NEW_EBLOCK_MODAL,Ge=kn(ge),qe=kn(fe),{isPromptOpen:at,isConverting:Bt,progress:Oe,isErrorOpen:Xe,errorMessage:re,confirmConversion:ee,cancelPrompt:U,retryConversion:le,closeError:xe,neverSuggestAgain:Se,setNeverSuggestAgain:Me}=$f(),We=se??(he?T:void 0),Be=!!We,rt=!S&&!Be,fn=!!S;(0,l.useEffect)(()=>{Be&&We&&Ba("email",h||he,We)},[Be,We,h,he]),(0,l.useEffect)(()=>{he&&Re&&($(!0),E.set({}))},[he,Re,E]),(0,l.useEffect)(()=>(r(o.switchIsPanelHistoryCollapsed(!0)),()=>r(o.switchIsPanelHistoryCollapsed(!0))),[r]);const Lt=(0,l.useCallback)(()=>{i.toggle(),r(o.resetPanes())},[r,i]);(0,l.useEffect)(()=>{_&&!k&&Lt()},[k,_,Lt]),(0,l.useEffect)(()=>{document.body.classList.add("editor"),r(o.setActiveSettingsTab(o.BUILD))},[r]),(0,l.useEffect)(()=>{!L&&Ie<3&&(J(),z(!0))},[J,Ie,L]);const ct=(0,l.useCallback)(()=>{lt.undo()},[lt]),Et=(0,l.useCallback)(()=>{lt.redo()},[lt]);(0,l.useEffect)(()=>{Te.current!==S?.id&&(lt.clear(),Te.current=S?.id)},[S,lt]);const Ot=(0,l.useCallback)(ce=>{(window.navigator.appVersion.indexOf("Mac")&&ce.metaKey||ce.ctrlKey)&&ce.code==="KeyZ"&&(ce.preventDefault(),ce.shiftKey?Et():ct())},[ct,Et]);(0,l.useEffect)(()=>()=>{r(o.resetPanes()),r(o.closeModal()),r(o.closeModal$1()),r(o.resetElementHistorySlice())},[r]);const jn=(0,l.useCallback)(ce=>{const ke=()=>{r(o.openModal(o.MODALS.ADD_NEW_EBLOCK_MODAL))},Ne=ce.data.operation,nt=ce.data,je=ce.data.action,Kt=u.querySelector("#iframe-scroll-top"),Ut=u.querySelector("#iframe-scroll-bottom");if(Ne===o.EVENT_TYPES.APPLICATION_EBLOCK_ADD){const dt=nt.settings?.emBlockId;dt?Z({html:nt.data,emBlockId:String(dt)}):(pe(nt.data),ke())}if(Ne===o.EVENT_TYPES.APPLICATION_ACTION&&(je==="undo"?ct():je==="redo"&&Et()),Ne===o.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_SHOW){const dt=u.querySelector("#email_iframe_slot"),Nn=document.body.getBoundingClientRect().height,$t=dt.getClientRects()[0];$t.top<0&&(Kt.style.display="block"),$t.top+$t.height>Nn&&(Ut.style.display="block")}Ne===o.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_HIDE&&(Kt.style.display="none",Ut.style.display="none")},[r,ct,Et,u]);o.useListenPostMessage(jn);const Ln=ce=>{if(ce.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const ke=ce.dataTransfer,Ne=(ke?Array.from(ke.types||[]):[]).includes(o.DND_SOCIAL_LIST_REORDER_MIME),nt=typeof ce.composedPath=="function"?ce.composedPath():[];ce.target?.closest?.(".selected-social-form")||nt.some(je=>je&&je.nodeType===1&&typeof je.classList?.contains=="function"&&je.classList.contains("selected-social-form"))||Ne||(ce.preventDefault(),ce.target&&f.send({operation:o.EVENT_TYPES.SANDBOX_DRAG_CANCEL}),u.querySelectorAll(".em-dragging-element").forEach(je=>{je.classList.remove("em-dragging-element")}))},hn=(0,l.useRef)({});(0,l.useEffect)(()=>{const ce=new g.Disposable,ke=Ne=>nt=>hn.current[Ne]?.(nt);return ce.addDisposable(o.addWindowListenerFromShadow(u,"drop",ke("drop"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragover",ke("dragover"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragstart",ke("dragstart"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragend",ke("dragend"))),()=>{ce.dispose()}},[u]),(0,l.useEffect)(()=>(window.addEventListener("keydown",Ot),()=>{window.removeEventListener("keydown",Ot)}),[Ot]);const On=ce=>{if(ce.preventDefault(),ce.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const ke=u.querySelector("#iframe-scroll-top"),Ne=u.querySelector("#iframe-scroll-bottom"),nt=d.sidePanelFloating?u.querySelector("#pane-content-wrapper"):u.querySelector(".email-pane__col_preview"),je=u.querySelector(".blocks-app").getBoundingClientRect().top,{height:Kt,top:Ut}=u.querySelector("#email_iframe_slot").getBoundingClientRect(),dt=nt.getBoundingClientRect().height;Ut>96?ke.style.display==="block"&&(ke.style.display="none"):(ke.style.display==="none"||ke.style.display==="")&&(ke.style.display="block"),Kt-dt+Ut-je<44?Ne.style.display==="block"&&(Ne.style.display="none"):Ne.style.display==="none"&&(Ne.style.display="block"),ce.target===ke&&nt.scrollBy(0,-15),ce.target===Ne&&nt.scrollBy(0,15)},Mn=()=>{const ce=u.querySelector("#iframe-scroll-top"),ke=u.querySelector("#iframe-scroll-bottom");ce&&ke&&(ce.style.display="none",ke.style.display="none"),u.querySelectorAll(".em-dragging-element").forEach(Ne=>{Ne.classList.remove("em-dragging-element")})},ht=ce=>{const ke=ce.target,Ne=ke instanceof Element?ke:ke.parentElement;if(!(Ne instanceof Element)||Ne.closest(".selected-social-form"))return;Ne.parentElement?.classList.add("em-dragging-element");const nt=!!Ne.closest(".blocks-search__result-wrapper");var je=nt?o.cloneBlockPreviewForDrag(Ne.querySelector(".blocks-search__result-html")):Ne.cloneNode(!0);je.classList.add("em-ghost-element"),je.style.height=nt?"auto":"70px",je.style.width=nt?"600px":"109px",je.style.position="absolute",je.style.top="0",je.style.left="0",je.style.zIndex="-1",Ne.appendChild(je),ce.dataTransfer.setDragImage(je,0,0),window.setTimeout(function(){je.parentNode.removeChild(je)},1e3)};hn.current={drop:Ln,dragover:On,dragstart:ht,dragend:Mn};const St=(0,l.useCallback)(()=>{Fe({title:e("You reached the plan limit"),icon:(0,s.jsx)(o.EmIcons,{icon:"ExclamationCircleOutlined",component:y.icons$ExclamationCircleOutlined}),content:(0,s.jsx)("div",{style:{maxWidth:"330px"},children:e("Switch to a different plan to save more emails.")}),centered:!0,okText:e("Choose a plan"),cancelText:e("Continue without saving"),width:"unset",onOk(){a("/billing")},onCancel(){}})},[a,e,Fe]);return(0,l.useEffect)(()=>{if(N&&O){const ce=O?.find(ke=>ke.id?.toString()===Ee?.ID?.toString())?.limits?.emails_limit;ce&&Ie>=ce&&!De&&!h&&t&&(St(),be(!0))}},[O,N,Ee,Ie,De,St,h,t]),(0,l.useEffect)(()=>{const ce=f.onInit(()=>{f.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1})});return()=>ce.dispose()},[f]),(0,s.jsx)(o.DocumentSessionProvider,{document:I,history:ft,children:(0,s.jsx)(_a.Provider,{value:G,children:(0,s.jsxs)(y.ui_kit$Layout,{className:"email-page",children:[rt&&(0,s.jsx)(y.ui_kit$PageLoader,{}),!rt&&A.status==="pending"&&(0,s.jsx)(y.ui_kit$PageLoader,{}),A.status==="error"&&(0,s.jsx)(kh,{style:Ch,children:(0,s.jsx)("div",{className:"container",children:(0,s.jsx)(y.ui_kit$Result,{status:"warning",title:e("Failed to load plan data"),subTitle:e("Editor features depend on your plan. Check your connection and try again."),extra:(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:A.retry,children:e("Try again")})})})}),Be&&We&&!1,S&&!rt&&A.status==="ready"&&(0,s.jsxs)(y.ui_kit$Layout,{className:"email-pane",children:[Y&&(0,s.jsx)("div",{className:"email-pane__loader",children:(0,s.jsx)(y.ui_kit$PageLoader,{small:!0})}),(0,s.jsx)(xa,{email:S,isCollaborationEditor:et}),(0,s.jsx)(Wm,{emailElement:S,isSuccess:fn,setIsCollaborationEditor:ve,setIsShowAddAllBlocksModal:K,triggerOpenSavedBlocksTab:me})]}),Ge&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Lu,{isModalVisible:ge,htmlContent:de,projectId:p,setIsShowAddAllBlocksModal:K,setIsShowAddAllBlocksModalForNewEmail:Ae,currentEmail:S})}),(0,s.jsx)(vf,{open:te,blocks:V,projectId:p,onClose:ue}),(0,s.jsx)(kf,{open:!!H,html:H?.html,emBlockId:H?.emBlockId,onSaveAsNew:()=>{pe(H?.html),Z(null),r(o.openModal(o.MODALS.ADD_NEW_EBLOCK_MODAL))},onClose:()=>Z(null)}),qe&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Ou,{isModalVisible:fe,currentEmail:S,setIsShowAddAllBlocksModal:K,setTriggerOpenSavedBlocksTab:ie,autoStart:!ae,projectId:p})}),(0,s.jsx)(Af,{open:at,onConfirm:ee,onCancel:U,neverSuggestAgain:Se,onNeverSuggestAgainChange:Me}),(0,s.jsx)(Rf,{open:Bt,progress:Oe}),(0,s.jsx)(Pf,{open:Xe,message:re,onRetry:le,onCancel:xe})]})})})};function Ih(){const e=o.useStore(),t=o.getEmailDocuments(g.getContainer(e)),n=(0,l.useCallback)(r=>t.subscribe(r),[t]);return(0,l.useSyncExternalStore)(n,()=>!!t.current())}function Ah(e,t){const n=o.useStore(),r=o.useAppConfig(),i=o.useStorageProvider();(0,l.useRef)(new Set),(0,l.useEffect)(()=>{},[e,t,r,n,i])}var xh=30;function Ph(e){const t=o.useContainer(),n=o.useGetProjectQuery(+e,{skip:!e,refetchOnMountOrArgChange:xh}),{isSuccess:r,isError:i,error:a,data:c,isFetching:d}=n;Ah(e,r),(0,l.useEffect)(()=>{t&&o.setCurrentProjectRefreshing(t,d)},[t,d]),(0,l.useEffect)(()=>{t&&r&&c&&String(c.id)===String(e)&&o.setCurrentProjectCard(t,c)},[r,c,t,e]),(0,l.useEffect)(()=>{i&&a&&Ba("project",e,a)},[i,a,e]);const u=o.useProjectData(),m=!!u&&String(u.id)===String(e);return{...n,projectReady:m}}var An=o.createApi({reducerPath:"promoApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:t,type:n},r)=>o.clientFromApi(r).promo.set_code_create({code:t,type:n})}),getPromoInfo:e.query({queryFn({code:t},n){return o.clientFromApi(n).promo.get_code_info_list({code:t})}})})}),{useCheckPromoMutation:yv,useGetPromoInfoQuery:_v}=An;function Rh(){const e=o.useContainer(),[t,n]=(0,l.useState)();return(0,l.useEffect)(()=>{if(!e)return;let r=!0;return o.getAppProject(e).then(i=>{r&&i!=null&&n(String(i))},()=>{}),()=>{r=!1}},[e]),t}var jh=()=>{const e=o.useDispatch(),t=o.useCookieManager(),n=o.useCurrentUser(),r=o.useContainer();(0,l.useEffect)(()=>{const a=n?.code_editor;a&&r&&o.applyEditorOptions(r,a)},[n,r]),(0,l.useEffect)(()=>{const a=t.get(o.APP_COOKIES.em_token),c=t.get(o.APP_COOKIES.promocode);a&&c&&(e(An.endpoints.checkPromo.initiate({code:c,type:"by_link"})),t.remove(o.APP_COOKIES.promocode))},[e,t]),o.useNotifyCommand();const i=Ih();return Ph(Rh()),i?(0,s.jsx)(Zl,{hasEmail:!0,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Th,{})})}):null};function Lh(e,t){const n=(0,l.useRef)(!1);(0,l.useEffect)(()=>{!e||n.current||(n.current=!0,o.mark(o.PHASES.appVisible),t&&Ht(t).noteShellVisible())},[e,t])}var xn=new WeakMap,Oh="data-emailmaker-config-styles";function Mh(e){return typeof e=="string"?e.trim():""}function Ua(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function Nh(e,t,n){if(!e||typeof document>"u")return null;const r=Mh(t),i=xn.get(e),a=n||e;if(!r)return i&&(i.remove(),xn.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&Ua(a,i),i;const c=document.createElement("style");return c.setAttribute(Oh,"true"),c.textContent=r,Ua(a,c),xn.set(e,c),c}function br(e){if(!e)return;const t=xn.get(e);t&&(t.remove(),xn.delete(e))}var Dh={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},Fh=({children:e,handleBeforeRender:t})=>{const[n,r]=(0,l.useState)(),i=o.useIsLocaleInited();Lh(i,o.useContainer());const a=o.useAppConfig().styles,c=(0,l.useRef)(null),d=(0,l.useRef)(!1),u=(0,l.useRef)(void 0),m=o.useRootElement();return(0,l.useLayoutEffect)(()=>{d.current||(d.current=!0,t&&t())},[]),(0,l.useLayoutEffect)(()=>{if(!m){u.current&&(br(u.current),u.current=void 0);return}u.current&&u.current!==m&&br(u.current),Nh(m,a,c.current||void 0),u.current=m},[m,a]),(0,l.useLayoutEffect)(()=>()=>{u.current&&(br(u.current),u.current=void 0)},[]),(0,s.jsxs)(y.ui_kit$StyleProvider,{container:o.findShadowRoot(m)||document.head,children:[(0,s.jsxs)("div",{ref:c,className:"App blocks-app blocks-plugin",style:i?{}:{visibility:"hidden"},children:[(0,s.jsx)(o.ModalRootContext.Provider,{value:n,children:e}),(0,s.jsx)("div",{ref:r,className:"blocks-modal-container"})]}),!i&&(0,s.jsx)(y.ui_kit$Space,{size:"large",style:Dh,children:(0,s.jsx)(y.ui_kit$Spin,{size:"large"})})]})};async function Bh({container:e,renderTarget:t,mapKey:n,disposable:r,chunkLoadedFire:i}){const a=await e.getInstanceAsync(g.STORE_ID);return new Promise(c=>{if(r.isDisposed()){c();return}const d=(0,il.createRoot)(t),u=(0,s.jsx)(o.Provider,{store:a,children:(0,s.jsx)(Vl,{onLoad:c,children:(0,s.jsx)(o.RootContext.Provider,{value:{element:n},children:(0,s.jsx)(y.ui_kit$StyleProvider,{container:o.isDocumentFragment(n)?document.head:n,children:(0,s.jsx)(o.LocaleProvider,{children:(0,s.jsx)(Fh,{handleBeforeRender:i,children:(0,s.jsx)(hl,{children:(0,s.jsx)(ql,{children:(0,s.jsx)(jh,{})})})})})})})})});d.render(u),r.addDispose(c),r.addDispose(()=>{try{d.unmount()}catch(m){if(m instanceof DOMException&&m.name==="NotFoundError"||m instanceof Error&&m.name==="NotFoundError"&&/removeChild/i.test(m.message)){o.logShowPipelineError("mount:unmount-dom-mismatch (host container was already removed)",{hint:"Usually harmless during host React StrictMode teardown. Ensure instance.destroy() runs before the host removes the mount container."});return}throw m}}),r.addDispose(()=>{g.ELEMENT_MAP.delete(n)})})}var bv="multiple init call on single HTMLELEMENT",Uh=zn(async e=>{let t=null,n=!1;const r=g.getEmitter(e,g.events.ON_CHUNKS_LOADED),i=e.getInstance(g.DISPOSABLE_ID);let a,c=!1;const d=()=>{c||(c=!0,o.mark(o.PHASES.chunksLoaded),r.fire())},u=(m,f)=>Bh({container:e,renderTarget:m,mapKey:f,disposable:a,chunkLoadedFire:d});return{instance:{getElement(){return t}},async setOptions(m){const f=e.getInstance(g.INIT_PIPELINE_ID),h=await g.waitForElement(m.element,i,f.signal),_=e.getInstance(g.INSTANCE_ID),p=!!m.hidden&&!!h;if(t===h&&n===p)return;const E=t===h&&n&&!p;n=p,i.addDisposable(r.event(()=>{m.handleChunkLoaded&&m.handleChunkLoaded()})),t&&g.ELEMENT_MAP.delete(t),h&&g.ELEMENT_MAP.has(h),a&&a.dispose(),a=i.addDisposable(new g.Disposable);const k=m.element!==void 0;if(o.setHeadlessMode(e,!h||p),o.setHiddenMount(e,p),!h){o.mark(o.MOUNT_HEADLESS_MARK);const b=document.createElement("div");b.style.position="absolute",b.style.left="-10000px",b.style.top="-10000px",b.style.width="1600px",b.style.height="1000px",document.body.appendChild(b),t=b,d(),a.addDispose(()=>{b.parentNode===document.body&&b.remove()});return}const w=o.findShadowRoot(h);if(w&&a.addDisposable(new fl({shadowRoot:w})),k&&h instanceof Element){const b=h;ll(b,()=>{i.isDisposed()||a?.isDisposed()||(o.logShowPipelineError("mount:detached (host removed element without destroy)",{elementId:b.id||null}),f.abort(sl()))},a)}if(p){o.mark(o.MOUNT_HEADLESS_MARK),t=h,d();return}if(k&&h instanceof Element){const b=h,x=ml(b);t=b;const P=u(x,b);return pl(b,x,a),P}return t=h,u(h,h)},dispose(){a&&!a.isDisposed()&&a.dispose()}}});function vr(e){return zn(async t=>(await t.getInstanceAsync(g.STORE_ID),await e(t)))}function $h({html:e,renderGuid:t,...n},r){const{requested:i}=o.getCurrentProject(r);return o.filterUndefined({...n,code:rn(r).toOutputForm(e),project:i===void 0?n.project:i,guid:void 0,link:void 0,status:void 0,slug:void 0,password:void 0,comment_status:void 0,template:void 0,blocktags:void 0,project_title:void 0,ping_status:void 0,lock:void 0,tag:void 0,is_template:void 0})}function zh(e,t){return o.filterUndefined({...e,link:void 0,comment_status:void 0})}function Gh({html:e,...t},n){return o.filterUndefined({...t,code:e,guid:void 0,compiled:o.filterUndefined({html:e,ampHtml:e&&""})})}var $a=e=>{const t={current:Promise.resolve(),state:e,decorate:(n,r)=>(r&&(n=n.bind(r)),function(...i){const a=t.current.then(()=>n(...i));return t.current=a.then(c=>{t.state=c},c=>{}),a})};return t},Wh=g.createIdentifier$1("emailTemplate.reads");async function Hh(e,t){try{return await o.getRestEmailPortFactories(e).email(e).readEmail(t)??void 0}catch(n){o.logShowPipelineError("show:template-read-failed",{templateId:t,error:n instanceof Error?n.message:"неизвестная ошибка"});return}}function qh(e,t){const n=e.getOrCreateInstance(Wh,()=>new Map),r=n.get(t);if(r!==void 0)return r;const i=Hh(e,t).then(a=>(a===void 0&&n.delete(t),a));return n.set(t,i),i}var kt=class extends g.Disposable{_event;_listener;_disposeEvent;constructor(e){super(),this._event=e}setListener(e){this._listener!==e&&(this._listener=e,this._disposeEvent&&this._disposeEvent(),e?this._disposeEvent=this._event(e):this._disposeEvent=void 0)}dispose(){this._disposeEvent&&this._disposeEvent(),super.dispose()}};function Ct(e,t,n){const r=g.snapshot(e);return(i,a,c)=>{const d=r(async u=>{const m=t?t(u):u;c&&i.bind(c);const f=await i(m);return n?n(f):f},a,c);return()=>d.dispose()}}var vv=g.createIdentifier("application_block_inserted"),Ev=g.createIdentifier$1("DataController"),Sv=g.createIdentifier$1("DataEvents"),Vh=g.createIdentifier$1("plugin.startupShow");function Yh(e){return e.getInstance(Vh)?.current??Promise.resolve()}var za=vr(async()=>({instance:{}})),Ga=vr(async e=>({instance:{},async setOptions(){await Yh(e)}})),wv=g.combineMixins([za,Ga]),Wa=()=>({title:"",description:"",website:"",company_size:"",industry:"",email:"",phone:"",logo_url:""}),Kh={title:"title",description:"description",website:"website",company_size:"company_size",industry:"industry",email:"email",phone:"phone",logo_url:"logo"},Ha=e=>({...Wa(),title:e?.title??"",description:e?.description??"",website:e?.website??"",company_size:e?.company_size??"",industry:e?.industry??"",email:e?.email??"",phone:e?.phone??"",logo_url:e?.logo??""}),qa=e=>(e??[]).filter(t=>!!t?.code).map(({code:t,label:n})=>({value:t,label:n??t})),Qh=e=>({company_sizes:qa(e?.company_sizes),industries:qa(e?.industries)}),kv=Object.keys(Wa()),Va="ProjectProfile",Pn=o.createApi({reducerPath:"projectSettingsProfileApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Va],endpoints:e=>({getProjectProfile:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(g.getContainer(n)).projects.profileList({id:String(t)}));return"error"in r?{error:r.error}:{data:Ha(r.data)}},providesTags:(t,n,r)=>[{type:Va,id:String(r)}]}),getProjectProfileOptions:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(g.getContainer(n)).projects.profileOptionsList());return"error"in r?{error:r.error}:{data:Qh(r.data)}}}),updateProjectProfileField:e.mutation({async queryFn({projectId:t,field:n,value:r},i){const a={[Kh[n]]:r},c=o.v2ResultOf(await o.getClientV2(g.getContainer(i)).projects.profilePartialUpdate({id:String(t)},a));return"error"in c?{error:c.error}:{data:Ha(c.data)}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;n(Pn.util.updateQueryData("getProjectProfile",t,()=>i))}catch{}}})})}),{useGetProjectProfileQuery:Cv,useGetProjectProfileOptionsQuery:Tv,useUpdateProjectProfileFieldMutation:Iv}=Pn,Ya="ProjectStorage",Rn=o.createApi({reducerPath:"projectSettingsStorageApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Ya],endpoints:e=>({getProjectStorage:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(g.getContainer(n)).projects.storageList({id:String(t)}));return"error"in r?{error:r.error}:{data:r.data}},providesTags:(t,n,r)=>[{type:Ya,id:String(r)}]}),updateProjectStorage:e.mutation({async queryFn({projectId:t,body:n},r){const i=o.v2ResultOf(await o.getClientV2(g.getContainer(r)).projects.storageUpdate({id:String(t)},n));return"error"in i?{error:i.error}:{data:i.data}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:r}){const{data:i}=await r;n(Rn.util.upsertQueryData("getProjectStorage",t,i))}}),testProjectStorageConnection:e.mutation({async queryFn({projectId:t,body:n},r){const i=o.v2ResultOf(await o.getClientV2(g.getContainer(r)).projects.storageTestCreate({id:String(t)},n));return"error"in i?{error:i.error}:{data:i.data}}})})}),{useGetProjectStorageQuery:Av,useUpdateProjectStorageMutation:xv,useTestProjectStorageConnectionMutation:Pv}=Rn,Xh=class{http;constructor(e){this.http=e}settings_summary_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/settings-summary/${e}`,method:"GET",...n})},Ka=class{http;constructor(e){this.http=e}developer_credentials_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"GET",...n});developer_credentials_partial_update=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"PATCH",...n});developer_credentials_rotate_secret_create=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/rotate-secret`,method:"POST",...n});developer_credentials_verify_secret_create=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/verify-secret`,method:"POST",...n})},Jh=class{http;constructor(e){this.http=e}developer_kit_postman_collection_list=(e={})=>this.http.request({path:"/projects/v1/developer-kit/postman-collection",method:"GET",...e})},Zh=class{http;constructor(e){this.http=e}billing_context_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/billing-context/${e}`,method:"GET",...n});billing_context_payments_list=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/billing-context/${e}/payments`,method:"GET",query:t,...n})},eg=class{http;constructor(e){this.http=e}usage_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/usage/${e}`,method:"GET",...n});usage_timeseries_list=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/usage/${e}/timeseries`,method:"GET",query:t,...n})},Ye={PLUGIN_INIT:"plugin_init",LINK_CHECK:"link_check",IMAGE_CHECK:"image_check",SPAM_ASSASSIN:"spam_assassin",AI_IMAGE:"ai_image",AI_WRITE:"ai_write",AI_REPHRASE:"ai_rephrase"},Zt={TODAY:"today",WEEK:"week",MONTH:"month",CUSTOM:"custom"},Rv=[Ye.PLUGIN_INIT,Ye.LINK_CHECK,Ye.IMAGE_CHECK,Ye.SPAM_ASSASSIN,Ye.AI_IMAGE,Ye.AI_WRITE],ln={current:0,limit:null},tg=()=>({pluginInit:{...ln},aiAssistant:{...ln},aiImage:{...ln},linkCheck:{...ln},imageCheck:{...ln},spamAssassin:{...ln}}),tt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Je=(e,t,n="")=>{for(const r of t){const i=e[r];if(typeof i=="string")return i;if(typeof i=="number"&&Number.isFinite(i))return String(i)}return n},Ft=(e,t,n=0)=>{for(const r of t){const i=e[r];if(typeof i=="number"&&Number.isFinite(i))return i;if(typeof i=="string"&&i.trim()&&Number.isFinite(Number(i)))return Number(i)}return n},Er=(e,t,n=!1)=>{for(const r of t){const i=e[r];if(typeof i=="boolean")return i}return n},Eo=(e,t)=>{for(const n of t){const r=e[n];if(r===null)return null;if(typeof r=="number"&&Number.isFinite(r))return r;if(typeof r=="string"&&r.trim()&&Number.isFinite(Number(r)))return Number(r)}return null},ng=new Set(Object.values(Ye)),og=e=>ng.has(e)?e:null,en=e=>tt(e)&&"data"in e&&(e.ok===!0||typeof e.success=="boolean"||e.success===void 0)?e.data:e,cn=(e,t)=>{for(const n of t){const r=e[n];if(tt(r))return r}return null},rg=(e,t)=>{for(const n of t){const r=e[n];if(!Array.isArray(r))continue;const i=r.filter(a=>typeof a=="string");if(i.length>0)return i}},ig=e=>tt(e)?{clientId:Je(e,["clientId","client_id"]),clientSecretConfigured:Er(e,["clientSecretConfigured","client_secret_configured"]),rotatedAt:Je(e,["rotatedAt","rotated_at"])||void 0,scopesSuggested:rg(e,["scopesSuggested","scopes_suggested"])}:{clientId:"",clientSecretConfigured:!1},Qa=(e,t)=>{for(const n of t){const r=e[n];if(typeof r=="boolean")return r}},ag=e=>{const t=Qa(e,["pluginConnected","plugin_connected","connected","is_connected"]);if(t!==void 0)return t;for(const n of["plugin","developer_credentials","developerCredentials"]){const r=cn(e,[n]);if(!r)continue;const i=Qa(r,["connected","plugin_connected","is_connected"]);if(i!==void 0)return i;const a=Je(r,["clientId","client_id"]),c=Er(r,["clientSecretConfigured","client_secret_configured"]);if(a)return c}},sg=e=>{const t=en(e);if(!tt(t))return{};const n=cn(t,["members"]);return{myRole:Je(t,["myRole","my_role","role"])||(n?Je(n,["myRole","my_role","role"]):"")||void 0,pluginConnected:ag(t)}},lg=e=>tt(e)?{clientId:Je(e,["clientId","client_id"]),secret:Je(e,["secret","clientSecret","client_secret"])}:{clientId:"",secret:""},cg=e=>{if(!tt(e))return null;const t=Je(e,["event","type","key"]),n=og(t);if(!n)return null;const r=e.delta??e.change??e.trend,i=r==null?null:typeof r=="number"&&Number.isFinite(r)?r:Number.isFinite(Number(r))?Number(r):null;return{event:n,total:Ft(e,["total","count","value"],0),delta:i}},Xa=e=>{if(!tt(e))return null;const t=Je(e,["date","day","x"]);if(!t)return null;const n={date:t},r=e.event_counts??e.eventCounts;if(tt(r)){for(const[i,a]of Object.entries(r))typeof a=="number"&&Number.isFinite(a)&&(n[i]=a);return n}for(const[i,a]of Object.entries(e))i==="date"||i==="day"||i==="x"||i==="event_counts"||i==="eventCounts"||typeof a=="number"&&Number.isFinite(a)&&(n[i]=a);return n},dg=e=>{const t=en(e);return tt(t)?(Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:Array.isArray(t.time_series)?t.time_series:Array.isArray(t.history)?t.history:[]).map(Xa).filter(n=>n!==null):[]},ug=e=>{if(!tt(e))return{current:0,limit:null};const t=Ft(e,["current","count","used","value","total"],0),n=Eo(e,["limit","max","quota","cap"]);return{current:t,limit:n===null?null:n}},dn=(e,t)=>{for(const n of t)if(n in e)return ug(e[n]);return{current:0,limit:null}},un={pluginInit:[Ye.PLUGIN_INIT,"plugin_init","pluginInit"],aiAssistant:["ai_assistant","aiAssistant","ai"],aiImage:[Ye.AI_IMAGE,"ai_image","ai_img","aiImg"],linkCheck:[Ye.LINK_CHECK,"link_check","linkCheck"],imageCheck:[Ye.IMAGE_CHECK,"image_check","imageCheck"],spamAssassin:[Ye.SPAM_ASSASSIN,"spam_assassin","spamAssassin","spam_check","spamCheck"]},Sr=e=>{const t=tg(),n=en(e),r=tt(n)&&tt(n.usage)?n.usage:n;if(!tt(r))return t;const i=Ft(r,["operationsTotal","operations_total"],0),a=Ft(r,["operationsLast30d","operations_last_30d"],0),c=cn(r,["metrics","counters","limits","events","usage_by_event","usageByEvent"])??r;return{pluginInit:dn(c,un.pluginInit),aiAssistant:dn(c,un.aiAssistant),aiImage:dn(c,un.aiImage),linkCheck:dn(c,un.linkCheck),imageCheck:dn(c,un.imageCheck),spamAssassin:dn(c,un.spamAssassin),lastActivityAt:Je(r,["lastActivityAt","last_activity_at"])||void 0,operationsTotal:i>0?i:void 0,operationsLast30d:a>0?a:void 0}},Ja=(e,t)=>{const n=[{event:Ye.LINK_CHECK,total:e.linkCheck.current,delta:null},{event:Ye.IMAGE_CHECK,total:e.imageCheck.current,delta:null},{event:Ye.SPAM_ASSASSIN,total:e.spamAssassin.current,delta:null},{event:Ye.AI_IMAGE,total:e.aiImage.current,delta:null}],r=t?dg(t):[];return r.length>0?{cards:n,chart:r}:{cards:n,chart:[]}},mg=e=>{const t=en(e);if(!tt(t))return Ja(Sr(e),e);const n=Array.isArray(t.cards)?t.cards:Array.isArray(t.summary)?t.summary:[],r=Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:[];return n.length>0||r.length>0?{cards:n.map(cg).filter(i=>i!==null),chart:r.map(Xa).filter(i=>i!==null)}:Ja(Sr(t),t)},pg=e=>{if(!tt(e))return null;const t=Je(e,["id","payment_id"]);return t?{id:t,date:Je(e,["date","created_at","paid_at"]),amount:Ft(e,["amount","sum"],0),currency:Je(e,["currency"],"RUB"),status:Je(e,["status"],"unknown"),receiptUrl:Je(e,["receiptUrl","receipt_url","pdf_url"])||void 0}:null},fg=e=>{const t=en(e),n=tt(t)&&Array.isArray(t.payments)?t.payments:[];return{payments:n.map(pg).filter(r=>r!==null),page:tt(t)?Ft(t,["page"],1):1,perPage:tt(t)?Ft(t,["perPage","per_page"],20):20,total:tt(t)?Ft(t,["total"],n.length):n.length,totalPages:tt(t)?Ft(t,["totalPages","total_pages"],1):1}},hg=e=>{const t=en(e);if(!tt(t))return{viewerSeesBilling:!1};const n=cn(t,["endpoints"])??{},r=cn(t,["documentLinks","document_links"]),i=r?Object.fromEntries(Object.entries(r).filter(f=>typeof f[1]=="string")):void 0,a=Eo(t,["ownerUserId","owner_user_id"]),c=cn(t,["tariff","plan","subscription"]),d=Je(t,["planDescription","plan_description"])||(c?Je(c,["description","about","plan_description"]):"")||void 0,u=Eo(t,["planPrice","plan_price","price","amount"])??(c?Eo(c,["price","amount"]):null),m=Je(t,["planCurrency","plan_currency","currency"])||(c?Je(c,["currency"]):"")||void 0;return{viewerSeesBilling:Er(t,["viewerSeesBilling","viewer_sees_billing"]),ownerUserId:a??void 0,planName:Je(t,["planName","plan_name"])||void 0,planDescription:d,planPrice:u??void 0,planCurrency:m||void 0,endpoints:{limitsStats:Je(n,["limitsStats","limits_stats"])||void 0,subscriptionMe:Je(n,["subscriptionMe","subscription_me"])||void 0,payments:Je(n,["payments"])||void 0},documentLinks:i&&Object.keys(i).length>0?i:void 0}},gg={myRole:"owner"},yg=()=>({...gg}),_g={clientId:"rust-awkward-bear",clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"},Za=()=>({..._g,clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"}),es=Object.values(Ye),bg={[Ye.PLUGIN_INIT]:42,[Ye.LINK_CHECK]:-15,[Ye.IMAGE_CHECK]:28,[Ye.SPAM_ASSASSIN]:9,[Ye.AI_IMAGE]:6,[Ye.AI_WRITE]:-11,[Ye.AI_REPHRASE]:4},vg=(e,t)=>{const n={date:e};return es.forEach((r,i)=>{const a=Math.sin(t*.65+i*.9),c=t*(i%2===0?.35:.2),d=2+i;n[r]=Math.max(0,Math.round(d+a*4+c))}),n},Eg=e=>es.map(t=>({event:t,total:e.reduce((n,r)=>n+(typeof r[t]=="number"?r[t]:0),0),delta:bg[t]})),Sg=({period:e,dateFrom:t,dateTo:n})=>{const r=(0,En.default)().startOf("day");if(e===Zt.WEEK)return{startDate:r.subtract(6,"day"),days:7};if(e===Zt.MONTH)return{startDate:r.subtract(29,"day"),days:30};if(e===Zt.CUSTOM&&t&&n){const i=(0,En.default)(t),a=(0,En.default)(n);return{startDate:i,days:Math.max(1,a.diff(i,"day")+1)}}return{startDate:r,days:1}},wr=(e={period:Zt.TODAY})=>{const{startDate:t,days:n}=Sg(e),r=Array.from({length:n},(i,a)=>vg(t.add(a,"day").format("YYYY-MM-DD"),a));return{cards:Eg(r),chart:r}},jv=wr({period:Zt.WEEK}),wg={pluginInit:{current:0,limit:null},aiAssistant:{current:0,limit:null},aiImage:{current:42,limit:100},linkCheck:{current:128,limit:500},imageCheck:{current:64,limit:200},spamAssassin:{current:31,limit:150},lastActivityAt:"2026-05-02T12:00:00Z"},ts={payments:[{id:"98765",date:"2026-05-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success",receiptUrl:"https://receipts.example/98765.pdf"},{id:"98764",date:"2026-04-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success"},{id:"98763",date:"2026-03-12T10:15:00+00:00",amount:990,currency:"RUB",status:"failed"}],page:1,perPage:20,total:3,totalPages:1},kg={viewerSeesBilling:!0,ownerUserId:1,planName:"Corporate",planDescription:"For fully addressing all necessary tasks in any field.",planPrice:3200,planCurrency:"RUB",endpoints:{limitsStats:"/wp-json/limits/v1/stats",subscriptionMe:"/wp-json/subscription/v2/me",payments:"/wp-json/projects/v1/billing-context/2581/payments"}},Cg={info:{name:"EmailMaker Plugin Requests",schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:[]},Tg=e=>e,Ig=()=>!1,Ag=()=>!1,xg=e=>e,mn="ProjectPlugin",Pg=()=>({}).REACT_APP_PLUGIN_SETTINGS_USE_MOCK==="true",Vt=(e,t,n)=>e.error&&Pg()?{data:n(t)}:o.transformResponseFn(n)(e),Rg=e=>Tg(ig(e)),jg=e=>xg(hg(e)),Lg=({period:e,dateFrom:t,dateTo:n})=>{if(e===Zt.CUSTOM){const r={};return t&&(r.date_from=t),n&&(r.date_to=n),r}return{period:e??Zt.TODAY}},So=o.createApi({reducerPath:"projectSettingsPluginApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,"")}),tagTypes:[mn],endpoints:e=>({getPluginSummary:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Xh]).settings_summary_detail({projectId:t}).then(r=>Vt(r,yg(),sg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:r}]}),getPluginCredentials:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Ka]).developer_credentials_detail({projectId:t}).then(r=>Vt(r,Za(),Rg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`credentials-${r}`}]}),rotatePluginSecret:e.mutation({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Ka]).developer_credentials_rotate_secret_create({projectId:t}).then(r=>Vt(r,{clientId:Za().clientId,secret:"mock-rotated-secret"},lg))},invalidatesTags:(t,n,{projectId:r})=>[{type:mn,id:`credentials-${r}`}]}),getPostmanCollection:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Jh]).developer_kit_postman_collection_list({extraQuery:{project_id:String(t)}}).then(r=>Vt(r,Cg,i=>en(i)??i))}}),getPluginAnalytics:e.query({queryFn({projectId:t,period:n,dateFrom:r,dateTo:i},a){const c={period:n,dateFrom:r,dateTo:i};return Ig()?Promise.resolve({data:wr(c)}):o.getClient(g.getContainer(a)).request({path:`/projects/v1/usage/${t}/timeseries`,method:"GET",query:Lg(c)}).then(d=>Vt(d,wr(c),mg))}}),getPluginBillingContext:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Zh]).billing_context_detail({projectId:t}).then(r=>Vt(r,kg,jg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`billing-${r}`}]}),getPluginUsage:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[eg]).usage_detail({projectId:t}).then(r=>Vt(r,wg,Sr))}}),getPluginPayments:e.query({queryFn({projectId:t,page:n=1,perPage:r=20},i){return Ag()?Promise.resolve({data:ts}):o.getClient(g.getContainer(i)).request({path:`/projects/v1/billing-context/${t}/payments`,method:"GET",query:{page:String(n),per_page:String(r)}}).then(a=>Vt(a,ts,fg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`payments-${r}`}]})})}),{useGetPluginSummaryQuery:Lv,useGetPluginCredentialsQuery:Ov,useRotatePluginSecretMutation:Mv,useLazyGetPostmanCollectionQuery:Nv,useGetPluginAnalyticsQuery:Dv,useGetPluginBillingContextQuery:Fv,useGetPluginPaymentsQuery:Bv,useGetPluginUsageQuery:Uv}=So,ns="EmailRaw",wo=o.createApi({reducerPath:"emailRawApi",tagTypes:[ns],baseQuery:o.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmailRaw:e.query({queryFn:function({emailId:t,secret_hash:n},r){return g.getApi(g.getContainer(r),[g.WpEmailApi]).email_detail({id:t},{extraQuery:{secret_hash:n}}).then(o.transformResponseFn(o.WpEmailToEmail))},providesTags:(t,n,r)=>[{type:ns,id:r}]})})}),{useGetEmailRawQuery:$v}=wo,ko=o.createApi({reducerPath:"yandexAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateYandexToken:e.mutation({query:t=>({url:"/auth/yandex",method:"POST",body:t})})})}),{useValidateYandexTokenMutation:zv}=ko,Co=o.createApi({reducerPath:"elamaAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateElamaCode:e.mutation({query:t=>({url:"/auth/elama",method:"POST",body:t})})})}),{useValidateElamaCodeMutation:Gv}=Co,To=o.createApi({reducerPath:"googleAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateGoogleToken:e.mutation({query:t=>({url:"/auth/google",method:"POST",body:t})})})}),{useValidateGoogleTokenMutation:Wv}=To,os=async e=>{const t=await e.text();let n=t;try{n=JSON.parse(t)}catch{n=t}return n},Og=(e,t,n)=>{if(!e)throw new Error(`Set ${n}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",headers:{"Content-Type":"application/json"},body:t,responseHandler:os}},Mg=(e,t,n)=>{if(!e)throw new Error(`Set ${n}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t,responseHandler:os}},Io=o.createApi({reducerPath:"requestPlaneApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRequest:e.mutation({query:t=>Mg("https://webhook.latenode.com/5868/prod/9e7a6445-2244-4dd5-bda4-5bca82997bf8",t,"REACT_APP_PIPEDREAM_REQUEST_PLANE_SRC")}),getInvoiceRequest:e.mutation({query:t=>Og("https://webhook.latenode.com/5868/prod/6e2d04a8-6cd9-4ec3-b884-ee2fd67267a3",t,"REACT_APP_REQUEST_PLANE_WEBHOOK_URL")})})}),{useGetRequestMutation:Hv,useGetInvoiceRequestMutation:qv}=Io,Ao=o.createApi({reducerPath:"getCheckoutUrlApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({GetCheckoutUrl:e.mutation({query:t=>({url:`?proxy_url=${encodeURIComponent({}.REACT_APP_PIPEDREAM_GET_CHECKOUT_URL)}`,method:"POST",body:t})})})}),{useGetCheckoutUrlMutation:Vv}=Ao,kr=o.createApi({reducerPath:"recoverPasswordApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/bdpwr/v1/"}),endpoints:()=>({})}),xo=o.createApi({reducerPath:"addUserToProjectApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/user_to_project/v1/add_user"}),endpoints:e=>({addUserToProject:e.mutation({queryFn(t,n){return o.clientFromApi(n).userToProject.add_user_create(t,{type:g.ContentType.FormData})}})})}),{useAddUserToProjectMutation:Yv}=xo,Po=o.createApi({reducerPath:"recurrenceSubscriptionsOffApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getCanselRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/07ae4159-132b-4a00-998b-bc47c20365ba?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetCanselRecurrenceQuery:Kv,useGetCanselRecurrenceQuery:Qv}=Po,Ro=o.createApi({reducerPath:"recurrenceSubscriptionsOnApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/e1dd37b1-c3d4-4441-b329-d6b3aa51bfe7?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetRecurrenceQuery:Xv,useGetRecurrenceQuery:Jv}=Ro,Ng="https://app.emailmaker.ru/api/v2",jo=o.createApi({reducerPath:"authApi",baseQuery:o.fetchBaseQueryApp({baseUrl:Ng,prepareHeaders:e=>{const t=o.api.get(o.APP_COOKIES.em_token);return t&&!e.has("authorization")&&e.set("authorization",`Bearer ${t}`),e}}),endpoints:e=>({login:e.mutation({query:t=>({url:"/auth/token",method:"POST",body:t})}),register:e.mutation({query:t=>({url:"/auth/register",method:"POST",body:t})}),refreshToken:e.mutation({query:t=>({url:"/auth/token/refresh",method:"POST",body:t})}),logout:e.mutation({query:()=>({url:"/auth/token",method:"DELETE"})}),getUser:e.query({query:()=>"/auth/user",transformResponse:t=>{const n=Array.isArray(t)?t[0]:t;return o.WpUserToUser(n)}}),changePassword:e.mutation({query:t=>({url:"/auth/password/change",method:"POST",body:t})}),resetPassword:e.mutation({query:t=>({url:"/auth/password/reset",method:"POST",body:t})}),resetPasswordConfirm:e.mutation({query:t=>({url:"/auth/password/reset/confirm",method:"POST",body:t})})})}),{useLoginMutation:Zv,useRegisterMutation:e0,useRefreshTokenMutation:t0,useLogoutMutation:n0,useGetUserQuery:o0,useLazyGetUserQuery:r0,useChangePasswordMutation:i0,useResetPasswordMutation:a0,useResetPasswordConfirmMutation:s0}=jo;function rs(e){return{id:e.id??0,name:e.name??"",children:(e.children??[]).map(rs)}}function Dg(e){return(e?.folders??[]).map(rs)}function Fg(e){return{items:(e?.items??[]).flatMap(t=>t.id?[{kind:t.kind??"email",id:t.id,name:t.name??"",title:t.title??"",preheader:t.preheader??"",folderId:t.folder_id??0,hasAmp:t.has_amp??!1,previewImage:t.preview_image??"",updatedAt:t.updated_at??"",imported:t.imported??!1}]:[]),total:e?.total??0}}function Cr(e){const t=e.status??"pending";return{id:e.id??"",status:t,outcome:e.outcome,total:e.total??0,imported:e.imported??0,warnings:e.warnings??0,failed:e.failed??0,finished:t==="done"||t==="failed",items:(e.items??[]).map(n=>({kind:n.kind??"email",stripoId:n.stripo_id??0,name:n.name??"",status:n.status??"failed",reason:n.reason,emailId:n.email_id})),createdAt:e.created_at??"",finishedAt:e.finished_at}}function Bg(e){return{selectors:e.map(t=>({kind:t.kind,...t.ids?.length?{ids:t.ids}:{},...t.all?{all:!0}:{},...t.folderId?{folder_id:t.folderId}:{},...t.rootOnly?{root_only:!0}:{},...t.search?{search:t.search}:{}}))}}var Tr="StripoItems",Ir="StripoFolders",Lo="StripoImportJob",pn=(e,t)=>{const n=o.v2ResultOf(e);return"error"in n?{error:n.error}:{data:t(n.data)}},Oo=o.createApi({reducerPath:"stripoImportApi",tagTypes:[Tr,Ir,Lo],baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({saveStripoKey:e.mutation({async queryFn({projectId:t,apiKey:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoKeyUpdate({id:String(t)},{api_key:n}),()=>{})},invalidatesTags:[Tr,Ir]}),getStripoFolders:e.query({async queryFn({projectId:t,kind:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoFoldersList({id:String(t),kind:n}),Dg)},providesTags:[Ir]}),getStripoItems:e.query({async queryFn({projectId:t,kind:n,folderId:r,rootOnly:i,search:a,page:c,limit:d},u){return pn(await o.getClientV2(g.getContainer(u)).projects.stripoItemsList({id:String(t),kind:n,...r?{folder_id:r}:{},...i?{root_only:!0}:{},...a?{search:a}:{},page:c,limit:d}),Fg)},providesTags:[Tr]}),startStripoImport:e.mutation({async queryFn({projectId:t,selectors:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoImportsCreate({id:String(t)},Bg(n)),Cr)},invalidatesTags:[Lo]}),getCurrentStripoImport:e.query({async queryFn(t,n){const r=await o.getClientV2(g.getContainer(n)).projects.stripoImportsCurrentList({id:String(t)});return r.status===204?{data:null}:pn(r,Cr)},providesTags:[Lo]}),getStripoImport:e.query({async queryFn({projectId:t,jobId:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoImportsDetail({id:String(t),jobId:n}),Cr)},providesTags:[Lo]})})}),{useSaveStripoKeyMutation:l0,useGetStripoFoldersQuery:c0,useGetStripoItemsQuery:d0,useLazyGetStripoItemsQuery:u0,useStartStripoImportMutation:m0,useGetCurrentStripoImportQuery:p0,useGetStripoImportQuery:f0}=Oo,Ug=o.createState({activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),$g="projectSlice",Ar=o.createSlice({name:$g,initialState:Ug,reducers:{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(o.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{payload:n,meta:r})=>{const{projectId:i}=r.arg.originalArgs;i?(t.groupsTemplateProjectTotal=+r.baseQueryMeta?.response.headers.get("X-WP-Total"),t.groupsTemplateProjectTotalPages=+r.baseQueryMeta?.response.headers.get("X-WP-TotalPages")):t.groupsTemplateTotal=+r.baseQueryMeta?.response.headers.get("X-WP-Total")})}}),{setActiveGroupsTags:h0,setActiveProjectGroupsTags:g0,resetAllTags:y0}=Ar.actions,zg=o.createState({emailsTotal:0,elementsList:[],emailsTrashTotal:0,elementsTrashList:[],customFolders:{},elementsView:o.CARDS}),Gg="emailsPageSlice";function Wg(e){const t=e?.baseQueryMeta?.response;return Number(t?.headers?.get("X-WP-Total"))||0}function is(e,t){const{emails:n,total:r,isSearch:i,page:a,tagOrFolderId:c}=t;if(t.status==="trash")!i&&r!==void 0&&(e.emailsTrashTotal=r),e.elementsTrashList=n;else if(c){const d=e.customFolders[c];e.customFolders={...e.customFolders,[c]:{list:n,page:a,total:r??d?.total??0}}}else r!==void 0&&(e.emailsTotal=r),e.elementsList=n}var xr=o.createSlice({name:Gg,initialState:zg,reducers:{resetElementsList:e=>{e.elementsList=[]},syncElementsList:(e,{payload:t})=>{is(e,t)},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeEmailFromList:(e,{payload:t})=>{const n=e.customFolders;t.folder!=="all"&&n[t.folder]?.list&&(n[t.folder]={...n[t.folder],list:n[t.folder].list.filter(r=>r.id!==t.emailId),total:n[t.folder].total-1},e.customFolders=n)}},extraReducers:e=>{e.addMatcher(o.emailsApi.endpoints.getEmails.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.arg.originalArgs;is(t,{emails:r,total:Wg(n),status:i?.status,page:i?.page,isSearch:!!i?.name?.length,tagOrFolderId:i?.folderTag||i?.tags?.[0]})}),e.addMatcher(o.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{meta:n,payload:r})=>{const i=+n.baseQueryMeta?.response.headers.get("X-WP-Total")||0;t.elementsList=r,t.emailsTotal=i;const{projectGroup:a,projectId:c,tags:d}=n.arg.originalArgs;(a?.length&&c||d?.length||!d?.length&&!a?.length)&&(t.emailsTotal=i)}),e.addMatcher(o.emailsApi.endpoints.editEmail.matchFulfilled,(t,{payload:n})=>{t.elementsList.map(r=>r.id?.toString()===n.id?.toString()?Object.assign(r,{lock:n.lock,title:n.title,emailtags:n.emailtags}):r)})}}),{toggleElementsView:_0,resetElementsList:b0,syncElementsList:v0,removeEmailFromList:E0}=xr.actions,as=o.combineReducers({[o.di.reducerPath]:o.di.reducer,[o.AiApi.reducerPath]:o.AiApi.reducer,[o.userSlice.name]:o.userSlice.reducer,[o.emailSlice.name]:o.emailSlice.reducer,[o.blockSlice.name]:o.blockSlice.reducer,[o.imageApi.reducerPath]:o.imageApi.reducer,[An.reducerPath]:An.reducer,[yo.reducerPath]:yo.reducer,[Ar.name]:Ar.reducer,[o.blocksApi.reducerPath]:o.blocksApi.reducer,[o.emailsApi.reducerPath]:o.emailsApi.reducer,[ho.reducerPath]:ho.reducer,[Xn.reducerPath]:Xn.reducer,[Jn.reducerPath]:Jn.reducer,[Zn.reducerPath]:Zn.reducer,[eo.reducerPath]:eo.reducer,[to.reducerPath]:to.reducer,[no.reducerPath]:no.reducer,[oo.reducerPath]:oo.reducer,[ro.reducerPath]:ro.reducer,[io.reducerPath]:io.reducer,[ao.reducerPath]:ao.reducer,[so.reducerPath]:so.reducer,[lo.reducerPath]:lo.reducer,[co.reducerPath]:co.reducer,[uo.reducerPath]:uo.reducer,[mo.reducerPath]:mo.reducer,[po.reducerPath]:po.reducer,[o.emailPageSlice.name]:o.emailPageSlice.reducer,[o.projectsApi.reducerPath]:o.projectsApi.reducer,[Pn.reducerPath]:Pn.reducer,[Qt.reducerPath]:Qt.reducer,[Rn.reducerPath]:Rn.reducer,[So.reducerPath]:So.reducer,[o.saveFileApi.reducerPath]:o.saveFileApi.reducer,[wo.reducerPath]:wo.reducer,[o.commentsApi.reducerPath]:o.commentsApi.reducer,[o.optimiseApi.reducerPath]:o.optimiseApi.reducer,[ar.name]:ar.reducer,[xr.name]:xr.reducer,[fo.reducerPath]:fo.reducer,[To.reducerPath]:To.reducer,[ko.reducerPath]:ko.reducer,[Co.reducerPath]:Co.reducer,[o.taxonomiesApi.reducerPath]:o.taxonomiesApi.reducer,[o.projectsPageSlice.name]:o.projectsPageSlice.reducer,[o.AiApiGenerator.reducerPath]:o.AiApiGenerator.reducer,[Io.reducerPath]:Io.reducer,[go.reducerPath]:go.reducer,[bo.reducerPath]:bo.reducer,[Gn.reducerPath]:Gn.reducer,[o.authorizationApi.reducerPath]:o.authorizationApi.reducer,[o.limitsApi.reducerPath]:o.limitsApi.reducer,[o.revisionHistorySlice.name]:o.revisionHistorySlice.reducer,[Ao.reducerPath]:Ao.reducer,[o.defaultModePanesSlice.name]:o.defaultModePanesSlice.reducer,[kr.reducerPath]:kr.reducer,[xo.reducerPath]:xo.reducer,[_o.reducerPath]:_o.reducer,[Ro.reducerPath]:Ro.reducer,[Po.reducerPath]:Po.reducer,[jo.reducerPath]:jo.reducer,[o.projectSettingsV2Api.reducerPath]:o.projectSettingsV2Api.reducer,[Oo.reducerPath]:Oo.reducer}),Hg=(e,t)=>t.type==="authorizationApi/resetApiState"?as({[o.reducerPath]:e[o.reducerPath]},t):as(e,t),ss=[o.AiApi,o.imageApi,yo,o.emailsApi,An,o.blocksApi,ho,Xn,Jn,Zn,eo,to,no,oo,ro,io,ao,so,lo,co,uo,mo,po,wo,o.projectsApi,Pn,Qt,Rn,So,o.commentsApi,o.optimiseApi,o.saveFileApi,fo,To,o.taxonomiesApi,ko,Co,o.AiApiGenerator,Io,o.authorizationApi,o.limitsApi,go,bo,Gn,Ao,kr,jo,o.projectSettingsV2Api,Oo,xo,_o,Ro,Po];function qg(e){let t={};if(e){const r=g.createIdentifier$1();g.DependencyResolver.inject(r,e),t={INJECTION:r}}const n=o.configureStore({reducer:Hg,middleware:r=>r({serializableCheck:!1}).concat(ss.map(i=>i.middleware)),preloadedState:t});return o.setupListeners(n.dispatch),n}var ls=g.createIdentifier$1("RtkApiRegistry");function Vg(e,t){e.inject(ls,new Map(t.map(n=>[n.reducerPath,n])))}function st(e,t){const n=e?.getInstance(ls)?.get(t);if(!n)throw new Error(`RTK api "${t}" is not in the container registry (provideRtkApiRegistry did not run)`);return n}function Yg(e,t){let n={isCodeMode:void 0,direction:void 0};return o.provideCodeMode(e).watch(r=>{n.isCodeMode!==r.isCodeMode&&t.dispatch(o.setCodeMode(r.isCodeMode)),n.direction!==r.direction&&t.dispatch(o.switchCodeModeDirection(r.direction)),n={isCodeMode:r.isCodeMode,direction:r.direction}})}function Kg(e,t){const n=o.provideCurrentUser(e),r=o.authorizationApi.endpoints.getMe.select("");let i=n.get()?.profile;const a=()=>{const c=r(t.getState()).data;!c||c===i||(i=c,n.set({profile:c}))};return a(),{dispose:t.subscribe(a)}}var Qg=g.createIdentifier$1("EmailSettingsPort");function Xg(e,t){e.inject(Qg,{read:()=>o.selectEmailSettings(t.getState())??{},write:n=>{t.dispatch(o.setEmailSettings(n))},markAppearanceChanged:()=>{t.dispatch(o.markAppearanceNeedsUpdate())}})}var Jg="Invalid standaloneKey.",Zg="not implemented",S0=1,ey=g.createIdentifier$1("StandaloneMockGuard");function Pr(){const e=new Error(Jg);return e.name="InvalidStandaloneKeyError",e}function Rr(e){return o.isStandaloneRuntime(g.getContainer(e))}function ty(e){return e instanceof Error?e.name==="InvalidStandaloneKeyError"||e.message==="Invalid standaloneKey."||e.message==="not implemented":e===Zg}function cs(e){if(Rr(e))throw Pr()}function ny(e,t,n){return n instanceof Error&&n.name==="InvalidStandaloneKeyError"?n:Pr()}var oy=()=>()=>{throw Pr()};function ry(e){if(!e)throw new Error("DI container not found for standalone mock guard");e.inject(ey,1)}function iy(e){return typeof e!="function"}var w0="[plugin-api-mock]";function ds(){return!0}function ay(e){try{if(e===null||typeof e!="object")return e;const t={};for(const n of Object.keys(e).slice(0,12)){const r=e[n];t[n]=typeof r=="string"&&r.length>120?`${r.slice(0,120)}…(${r.length})`:r}return t}catch{return"(unserializable arg)"}}function sy(e,t){return n=>{const r=n.query,i=n.queryFn||((a,c,d,u)=>{if(!r)throw new Error("query not found EndpointDefinition");return u(r(a))});i&&(n.query=void 0,n.queryFn=async(a,c,d,u)=>{try{let m;const f=g.getContainer(c).getServices(e);for(let h=f.length-1;h>=0;h--){const _=f[h];if(m=m?await m(async p=>await _.execute(p),c):await _.execute(a),iy(m))return{data:m,error:null}}if(m)m=await m(async(h,_=c,p=d,E=u)=>{cs(c);const k=await i(h,_,p,E);if(k.error)throw k.error;return k.data},c);else{cs(c),ds();const h=await i(a,c,d,u);if(h.error)throw h.error;m=h.data}return{data:m,error:null}}catch(m){return Rr(c)&&ty(m)?{error:ny(t,ay(a),m)}:(ds(),{error:m})}})}}var us=new Set;function it(e){return(t,n)=>{const r=Object.create(null),i=Object.keys(n),a=new g.Disposable;for(const c of i){const d=`api_listeners_flag_${t.reducerPath}/${c.toString()}`,u=g.createIdentifier$1(`api_listeners_${t.reducerPath}/${c.toString()}`);us.has(d)||(r[c]=sy(u,`${t.reducerPath}/${c.toString()}`),us.add(d)),a.addDisposable(e.addService(u,{execute:n[c]}))}return Object.keys(r).length&&t.enhanceEndpoints({endpoints:r}),o.getDisposable(e).addDisposable(a),a}}function ms(e,t){for(const n of Object.keys(t))try{t[n](e)}catch{}}function k0(e){return e}function ps(e,t){return e({body:t}).catch(()=>new Promise(n=>setTimeout(n,1e3)))}function ly(e){it(e)(st(e,"AiApi"),{sendMessage:({body:t})=>async(n,r)=>{const i=o.getEmitter(e,g.events.AI_TEXT_REQUEST_ID);if(!i.hasListeners())return ps(n,t);const a=t,c={message:a.message??a.context,locale:a.locale,entityId:a.entity_id,projectId:a.project_id!=null?String(a.project_id):void 0,subject:a.subject,preheader:a.preheader,textContent:a.textContent,context:a.context??a.connection,connection:a.connection,onProgress:(d,u)=>{o.getEmitter(e,g.events.AI_TEXT_PROGRESS_ID).fire({progress:Number.isFinite(d)?d:0,status:typeof u=="string"?u:void 0})},onStreamChunk:d=>{typeof d!="string"||!d||o.getEmitter(e,g.events.AI_TEXT_STREAM_ID).fire({partialHtml:d})},signal:r.signal};for(const d of i.getListeners([c])){const u=await d(c);if(u)return{status:200,_eventResult:!0,aiMessage:typeof u.message=="string"?u.message:"",aiHtml:typeof u.html=="string"?u.html:void 0}}return ps(n,t)},getDialog:t=>(n,r)=>Rr(r)?Promise.resolve({documents:[],totalCount:0}):n(t)})}function cy(e){const t=it(e),n=o.getEmitter(e,g.events.FILE_PROXY_EVENT_ID);t(st(e,"proxyApi"),{async getFile({url:r,tryFetch:i=!0,type:a}){return async c=>{const{requested:d}=o.getCurrentProject(e),u=(await n.fire({url:r,project:d})).filter(m=>m instanceof Blob)[0];if(u)switch(a){case"json":return JSON.parse(await u.text());case"text":return u.text();default:return u}else return c({url:r,tryFetch:i,type:a})}}})}function dy(e){it(e)(st(e,"tokenApi"),{tokenCreate(t){return n=>n(t)},tokenValidate(){return t=>t({})}})}function C0(e){return e}function uy(e){it(e)(st(e,"imageApi"),{sendAiImageRequest:function({body:t}){return async(n,r)=>{const i=o.getEmitter(e,g.events.AI_IMAGE_REQUEST_ID);if(!i.hasListeners()||t.request!=="create-image")return n({body:t});const a={prompt:t.message??"",size:t.size,entityId:t.entity_id,projectId:t.project_id!=null?String(t.project_id):void 0,onProgress:(c,d)=>{o.getEmitter(e,g.events.AI_IMAGE_PROGRESS_ID).fire({progress:Number.isFinite(c)?c:0,status:typeof d=="string"?d:void 0})},signal:r.signal};for(const c of i.getListeners([a])){const d=await c(a);if(d&&d.images?.length)return{data:{status:200,_eventResult:!0,task:{images:d.images}}}}return n({body:t})}},getAiImage(t){return n=>n(t)}})}async function fs(e,t,n,r,i){try{const a=(await e.fire({project:String(t),emailId:n})).filter(c=>c!=null);if(a.length)return a.flat()}catch{}return r(i)}function my(e){const t=it(e),n=st(e,"blocksApi"),r=o.blocksDataSourceProvider(e),i=r.byForeignKey("project"),a=o.blockRevisionsDataSourceProvider(e);a.byForeignKey("parent");const{dispatch:c}=o.getStore(e),d=o.getDisposable(e);d.addDisposable(r.onChange(()=>c(n.util.invalidateTags(["Blocks"])))),d.addDisposable(r.onSave(({prev:f,patch:h,value:_})=>{const p=f?{...f,...h}:h;let E=o.mergeEntityPreservingMeta(f,h,_);return p&&E.html===p.html&&E.title===p.title&&(E={...E,renderGuid:p.renderGuid}),E},Number.MIN_VALUE));const u=o.getEmitter(e,o.READ_COMMON_BLOCKS_EVENT_ID),m=o.getEmitter(e,o.READ_TEMPLATE_BLOCKS_EVENT_ID);t(n,{async getBlocks(f){const h={};f.name&&(h.title=f.name),f.type&&(h.type=f.type);const _=f.projectId??await o.getBlocksProject(e);return await i.get(_,{filter:h,page:f.page,pageSize:f.pageSize,order:f.order,orderBy:f.orderby}).then(({data:p})=>p)},getBlocksSchema(){return f=>f(void 0)},getParentEmailBlocks(f){return async h=>{const _=o.getCurrentProject(e).requested||"";return fs(m,_,f.emailId||"",h,f)}},getTemplateBlocks(f){return async h=>{const _=o.getCurrentProject(e).requested||"";return fs(u,_,f.emailId||"",h,f)}},async getBlock(f){const h=o.getCurrentProject(e).card?.id;if(h!==void 0)return i.first(Number(h),{filter:{id:f}})},addBlock(f){return async h=>{const _=await r.create(f);return o.getAppConfig(e).preventSendDataToEM||h(_).catch(p=>{}),_}},editBlock({blockId:f,...h}){return r.update(f,h)},deleteBlock(f){return r.remove(typeof f=="object"?f.id:f)},addTag(f){return f},getDeletableTag([f,h]){return[]},autoSaveBlock({blockId:f,body:h}){return a.create({...h,parent:f})}})}function py(e){const{emails:t,emailRevisions:n}=o.provideEmailDocuments(e),{dispatch:r}=o.getStore(e),i=o.getDisposable(e),a=it(e),c=st(e,"emailsApi");i.addDisposable(t.onChange(async()=>{r(c.util.invalidateTags(["Email"]))})),a(c,{getEmails:d=>[],getTemplateEmails:d=>[],async addEmail({source:d,...u}){const m=await t.create(u,{source:d});return m.renderGuid||(m.renderGuid=g.generateUUID()),m},editEmail(d){return async u=>{const{emailId:m,source:f,...h}=d;return o.isRevisionServiceEnabled(e)&&await u(d),t.update(m,h,{source:f})}},deleteEmail(d){return t.remove(typeof d=="object"?d.id:d)},addTag(){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},getDeletableTag([d,u]){return[]},autoSaveEmail({emailId:d,body:u}){return async m=>{o.isRevisionServiceEnabled(e)&&await m({emailId:d,body:u});const f=await n.create({...u,parent:d,modified:new Date().toString()});return f&&!f.html&&u.html?{...f,html:u.html}:f}}})}var fy="tmp",T0=g.createIdentifier$1();function hy(e){const t=it(e);if(!e.getInstance(g.DISPOSABLE_ID))throw new Error("Something was wrong");const n=o.getEmitter(e,g.events.UPLOAD_EVENT_ID),r=o.getEmitter(e,g.events.ON_SEND_TESTEMAIL_ID),i=o.getEmitter(e,g.events.ON_SEND_LIVEPREVIEW_ID);t(st(e,"saveFileApi"),{uploadImage(a){return async c=>{const{requested:d}=o.getCurrentProject(e),u=async()=>c({...a,user_id:String((await e.getInstanceAsync(g.APP_ID)).app_id)});if(a.folder===fy)return u();const m=await o.fireUploadImageEvent(n,{file:a.file,project:d});if(m.url)return[{file_url:m.url,project:d}];if(!o.shouldFallbackToBuiltInUpload(m,{isStandalone:o.isStandaloneRuntime(e)}))throw o.toUploadImageError(m);return u()}},sendTestEmail(a){return async c=>{const{requested:d}=o.getCurrentProject(e);(await r.fire({project:d,email_id:a.email_id,subject:a.subject,email:a.email,html:a.html,from_name:a.from_name})).some(u=>u===!1)&&await c({...a,user_id:String((await e.getInstanceAsync(g.APP_ID)).app_id)})}},async sendLivePreview(a){const{requested:c}=o.getCurrentProject(e);(await i.fire({project:c,id:a.email,subject:a.subject,html:a.content})).some(d=>d===!1)},sendShortLink(a){return c=>c(a)}})}function gy(e){it(e)(st(e,"emailRawApi"),{getEmailRaw({emailId:t,secret_hash:n}){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Yt(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}function yy(e,t){var n,r;o.requiredArgs(1,arguments);var i=Dl(e);if(isNaN(i.getTime()))throw new RangeError("Invalid time value");var a=String((n=t?.format)!==null&&n!==void 0?n:"extended"),c=String((r=t?.representation)!==null&&r!==void 0?r:"complete");if(a!=="extended"&&a!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(c!=="date"&&c!=="time"&&c!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var d="",u="",m=a==="extended"?"-":"",f=a==="extended"?":":"";if(c!=="time"){var h=Yt(i.getDate(),2),_=Yt(i.getMonth()+1,2),p=Yt(i.getFullYear(),4);d="".concat(p).concat(m).concat(_).concat(m).concat(h)}if(c!=="date"){var E=i.getTimezoneOffset();if(E!==0){var k=Math.abs(E),w=Yt(Math.floor(k/60),2),b=Yt(k%60,2),x=E<0?"+":"-";u="".concat(x).concat(w,":").concat(b)}else u="Z";var P=Yt(i.getHours(),2),Y=Yt(i.getMinutes(),2),J=Yt(i.getSeconds(),2),N=d===""?"":"T",O=[P,Y,J].join(f);d="".concat(d).concat(N).concat(O).concat(u)}return d}function _y(e){const t=it(e),n=st(e,"commentsApi"),r=o.commentsDataSourceProvider(e),i=r.byForeignKey("post"),{dispatch:a}=o.getStore(e);o.getDisposable(e).addDisposable(r.onChange(()=>a(n.util.invalidateTags(["Comments"])))),t(n,{getComments(c){return i.get(c).then(({data:d})=>d)},addComment({subjectId:c,author:d,parent:u,content:m,author_name:f,author_email:h,targetId:_}){const p={post:c,author:d,author_name:f,author_email:h,content:m,parent:u,target_id:_,date:yy(new Date),author_avatar_urls:{}};return r.create(p)},deleteComment(c){return r.remove(c)},editComment({commentId:c,...d}){return r.update(c,d)},deleteTarget(c){return r.update(c,{target_id:""})}})}function jr(e){return{id:String(e),name:"",myRole:"",members:[],invites:[],emailsCount:0,blocksCount:0,title:"",group:[],folder:[],blockfolder:[]}}function hs(e,t){return{project:Number(e),app_id:t?.app_id||0,app_config:t?.app_config||{},user:t?.user}}function by(e,t){const n=jr(String(t)),r=o.getCurrentProject(e).card;return r&&String(r.id)===String(t)?Promise.resolve({...n,...r,id:String(t)}):Promise.resolve({...n,id:String(t)})}function vy(e){let t,n;const r=i=>((t!==i||!n)&&(t=i,n=by(e,i)),n);it(e)(st(e,"projectsApi"),{getProjects(i={page:1}){return[]},getProject(i){return async a=>o.isStandaloneRuntime(e)?a(i):{...await r(i),id:String(i)}},addProject(i){throw new Error},async editProject({projectId:i,...a}){const c={...await r(i),...a,id:String(i)};return t=i,n=Promise.resolve(c),c},deleteProject(i){throw new Error},mutateProjectMembers(){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},addProjectMember(){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},getFrequentProjects(){return[]}})}function Ey(e){let t={id:"0",username:"",email:"",password:"",code_editor:{},theme:"light",locale:o.getCurrentUser(e).profile?.locale,counters:{},avatar_urls:{},autosaves:!0};it(e)(st(e,"authorizationApi"),{getSchema:()=>n=>n({}),getMe:()=>t,editMe:n=>t={...t,...n},getSubscriptions:()=>[]})}function Sy(e){it(e)(st(e,"notificationsApi"),{getNotifications(t){return[]},notificationShown({id:t,datetime:n}){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function wy(e){it(e)(st(e,"addUserToProjectApi"),{addUserToProject:()=>{}})}function ky(e){o.injectEmailTermsResolver(e,{resolve:async()=>{}}),it(e)(st(e,"taxonomiesApi"),{getTerms:()=>[],getStandardGroups:()=>[],addTerm:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},editTerm:t=>({id:t.id,name:t.name,parent:0,count:0}),deleteTerm:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Cy(e){it(e)(st(e,"projectSettingsV2Api"),{getProjectIntegrations:()=>({}),getProjectWebhook:()=>"",getProjectStorage:()=>({}),getProjectTestRecipients:()=>[],getIntegrationCredentials:()=>({}),putProjectIntegration:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},deleteProjectIntegration:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectWebhook:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectSettings:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectTestRecipients:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Ty(e){it(e)(st(e,"stripoImportApi"),{getStripoFolders:()=>[],getStripoItems:()=>({items:[],total:0}),getCurrentStripoImport:()=>null,getStripoImport:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},saveStripoKey:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},startStripoImport:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}var gs={addUserToProjectApiMock:wy,AiApiMock:ly,authorizationApiMock:Ey,blocksApiMock:my,commentsApiMock:_y,emailsApiMock:py,emailRawApiMock:gy,imageApiMock:uy,notificationsApiMock:Sy,projectsApiMock:vy,projectSettingsV2ApiMock:Cy,proxyApiMock:cy,saveFileApiMock:hy,stripoImportApiMock:Ty,taxonomiesApiMock:ky,tokenApiMock:dy},Lr=o.createApi({reducerPath:"tokenApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/jwt-auth/v1/"}),endpoints:e=>({tokenCreate:e.mutation({queryFn(t,n){return o.clientFromApi(n).jwtAuth.token_create({body:t,type:g.ContentType.Json})}}),tokenValidate:e.mutation({queryFn(t,n){return o.clientFromApi(n).jwtAuth.token_validate_create({type:g.ContentType.Json})}})})}),{useTokenCreateMutation:I0,useTokenValidateMutation:A0}=Lr;function Or(){const e=new Map;for(const t of ss)e.set(t.reducerPath,t);return e.set(Lr.reducerPath,Lr),[...e.values()]}function Iy(e,t){const n=Object.keys(t.endpoints);n.length&&e(t,Object.fromEntries(n.map(r=>[r,oy])))}function Ay(e){ry(e);const t=it(e);for(const n of Or())Iy(t,n)}function xy(e){if(!e)return;const t=g.decodeJwt(e)?.data,n=t?.data?.scope??t?.scope;return(Array.isArray(n)?n.flatMap(r=>typeof r=="string"?r.split(/\s+/):[]):typeof n=="string"?n.split(/\s+/):[]).find(r=>/^project_\d+$/.test(r))?.replace(/^project_/,"")||void 0}var Py={AiApi:new Set(["sendMessage","getDialog"]),imageApi:new Set(["sendAiImageRequest","getAiImage","getAiImageSSE"])};function Ry(e){return o.getAppConfig(g.getContainer(e))}function jy(e){return e?.backendProxy!==void 0&&e?.backendProxyPolicy?.proxyAi===!0}function Ly(e){return jy(Ry(e))}function Oy(e,t,n,r){return Py[t]?.has(n)?i=>Ly(e)?a=>a(i):r(i):r}function My(e){const t=it(e);return((n,r)=>{if(!n||typeof n.reducerPath!="string")return new g.Disposable;const i=Object.fromEntries(Object.entries(r??{}).map(([a,c])=>[a,typeof c=="function"?Oy(e,n.reducerPath,a,c):c]));return t(n,i)})}function Ny(e){const t=`blocks_${g.generateUUID().replaceAll("-","")}`,n=document.createElement("script");return n.type="text/javascript",n.text=`window.${t}(function(module, exports, require) { ${e}; })`,new Promise((r,i)=>{window[t]=function(a){const c={exports:{}},d=()=>{};a(c,c.exports,d),r(c.exports)},document.head.appendChild(n)}).finally(()=>{n.remove(),delete window[t]})}async function ys(e){const t=g.getContainer(e),n=t?.getInstance(g.STANDALONE_PROJECT_ID),r=n?void 0:await t?.getInstanceAsync(g.APP_ID).catch(()=>{}),i=n||(r?.project!==void 0?String(r.project):void 0);i&&t&&o.setCurrentProjectCard(t,jr(i))}async function Dy(e,t){try{const n=function(d){const u=e.getInstance(g.STANDALONE_PROJECT_ID),m=u?hs(u,d):d;e.injectFactory(g.APP_ID,async()=>m)},r=My(e),i=await o.readZipFromBase64(t),a=i.key&&o.zipEntryToText(i.key);if(typeof a!="string")return;const c=await Ny(a);if(typeof c!="object"||c===null||typeof c.execute!="function")return;c.execute(n,r,Or())}catch{}}async function _s(e,t){Ay(g.getContainer(e)),await Dy(g.getContainer(e),t),ms(g.getContainer(e),gs)}var Fy=zn(async e=>{const t=qg(e);e.inject(g.STORE_ID,t),Vg(e,Or()),Xg(e,t),o.getDisposable(e).addDisposable(Kg(e,t)),o.getDisposable(e).addDisposable(Yg(e,t));const n=g.getContainer(t);n&&(e.inject(g.MESSAGE_SERVICE_ID,o.getMessageService(n)),e.inject(o.CURRENT_PROJECT_ID,o.provideCurrentProject(n)));const r=e.getInstance(g.SECURITY_MODULE_ID);return r?(await _s(t,r),await ys(t)):ms(g.getContainer(t),gs),{instance:{}}}),bs=["historyEnabled","commentsEnabled","aiAssistentEnabled","livePreviewEnabled","sendTestEnabled","sharePreviewEnabled","webversionEnabled","optimizeSpamAssassinEnabled","exportWebHookEnabled","aiLayoutConverterEnabled","elementAIimageEnabled","elementAItextEnabled","revisionService"];function By(e){const t={...e};for(const n of bs)t[n]=!1;return t}function Uy(e){const t={...e};for(const n of bs)n in t&&typeof t[n]=="boolean"&&(t[n]=!1);return t}function $y(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t={};for(const[n,r]of Object.entries(e))!r||typeof r!="object"||Array.isArray(r)||(t[n]=Uy(r));return Object.keys(t).length>0?t:void 0}function Mr(e){const t=By(e),n=$y(e.advancedConfigs),r={...t};return n?r.advancedConfigs=n:delete r.advancedConfigs,r}var x0=1,zy=2592e6;function vs(){return"emailmaker".trim()||void 0}function Gy(e){return{schemaVersion:1,savedAt:Date.now(),project:e.project,app_id:e.app_id,app_config:Mr(Ss(e.app_config))}}function Es(e){return{...e,app_config:Ss(e.app_config)}}function Ss(e){if(!e||typeof e!="object"||Array.isArray(e))return{};try{if(typeof structuredClone=="function")return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{return{}}}async function Wy(e){const t=vs();t&&await Xy(t,Gy(e))}async function Hy(e=Date.now()){const t=vs();if(t)return Jy(t,e)}function qy(e,t=Date.now()){return e.savedAt>t?!1:t-e.savedAt<=zy}function ws(e){if(!e||typeof e!="object")return!1;const t=e,n=typeof t.project=="number"&&Number.isFinite(t.project)||typeof t.project=="string"&&t.project.trim()!=="";return t.schemaVersion===1&&typeof t.savedAt=="number"&&Number.isFinite(t.savedAt)&&n&&typeof t.app_id=="number"&&Number.isFinite(t.app_id)&&t.app_config!=null&&typeof t.app_config=="object"&&!Array.isArray(t.app_config)}var jt="snapshots",Vy=1;function Yy(){return`${"emailmaker".trim()||"plugin"}-plugin-deferred-config`}function Mo(){return new Promise((e,t)=>{if(typeof indexedDB>"u"){t(new Error("indexedDB is not available"));return}const n=indexedDB.open(Yy(),Vy);n.onerror=()=>t(n.error||new Error("indexedDB open failed")),n.onupgradeneeded=()=>{const r=n.result;r.objectStoreNames.contains(jt)||r.createObjectStore(jt)},n.onsuccess=()=>e(n.result)})}function Ky(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error||new Error("indexedDB request failed"))})}function Qy(){return{async get(e){const t=await Mo();try{const n=await Ky(t.transaction(jt,"readonly").objectStore(jt).get(e));return n===void 0?void 0:n}finally{t.close()}},async put(e,t){const n=await Mo();try{const r=n.transaction(jt,"readwrite");r.objectStore(jt).put(t,e),await new Promise((i,a)=>{r.oncomplete=()=>i(),r.onerror=()=>a(r.error||new Error("indexedDB write failed")),r.onabort=()=>a(r.error||new Error("indexedDB write aborted"))})}finally{n.close()}},async delete(e){const t=await Mo();try{const n=t.transaction(jt,"readwrite");n.objectStore(jt).delete(e),await new Promise((r,i)=>{n.oncomplete=()=>r(),n.onerror=()=>i(n.error||new Error("indexedDB delete failed")),n.onabort=()=>i(n.error||new Error("indexedDB delete aborted"))})}finally{t.close()}},async clear(){const e=await Mo();try{const t=e.transaction(jt,"readwrite");t.objectStore(jt).clear(),await new Promise((n,r)=>{t.oncomplete=()=>n(),t.onerror=()=>r(t.error||new Error("indexedDB clear failed")),t.onabort=()=>r(t.error||new Error("indexedDB clear aborted"))})}finally{e.close()}}}}var ks,Nr;function Dr(){return ks||(Nr||(Nr=Qy()),Nr)}function Cs(e){Dr().delete(e).catch(()=>{})}async function Xy(e,t){if(ws(t))try{await Dr().put(e,Es(t))}catch{}}async function Jy(e,t=Date.now()){try{const n=await Dr().get(e);if(n===void 0)return;if(!ws(n)){Cs(e);return}if(!qy(n,t)){Cs(e);return}return Es(n)}catch{return}}function Zy(e,t){if(e.getInstance(g.STANDALONE_FILE_PROXY_REGISTERED_ID))return;e.inject(g.STANDALONE_FILE_PROXY_REGISTERED_ID,!0);const n=g.getEvent(e,g.events.FILE_PROXY_EVENT_ID);t.addDisposable(n(async({url:r})=>(await fetch(r)).blob(),Number.MIN_VALUE))}function Ts(e){try{return xy(e)||void 0}catch{return}}async function e_(e,t,n){if(!e)return;let r;try{const i=await e(t,n,void 0);r=String(i||"").trim()}catch{return}if(r)return{token:r,serverProjectId:Ts(r)}}function t_(e){if(e==null)return;const t=String(e).trim();return/^\d+$/.test(t)?t:void 0}function n_(e){const t=String(e.getInstance(g.JWT_TOKEN_ID)||"").trim();if(t)return Ts(t)}function Is(e,t,n){e.inject(g.APP_ID,void 0),e.inject(g.APP_ID,Promise.resolve(hs(t,n)))}function o_(e){return{app_id:e.app_id,app_config:Mr(e.app_config)}}async function As(){const e=await Hy();return e?o_(e):{app_config:Mr({})}}function r_(e,t){e.getInstance(g.STANDALONE_ACTIVATED_ID)||(e.inject(g.SECURITY_MODULE_ID,void 0),e.inject(g.STANDALONE_BOOTSTRAP_TOKEN_ID,void 0),e.inject(g.STANDALONE_PROJECT_ID,void 0),t&&e.inject(g.APP_ID,void 0),e.inject(g.STANDALONE_FILE_PROXY_REGISTERED_ID,void 0))}async function xs(e){const{container:t,store:n,standaloneKey:r,project:i,reason:a,getAuthToken:c,user:d}=e,u=e.disposable||t.getInstance(g.DISPOSABLE_ID);if(t.getInstance(g.STANDALONE_ACTIVATED_ID))return;const m=await e_(c,d,i),f=t_(i),h=m?.serverProjectId??n_(t)??(m?void 0:f);t.inject(g.SECURITY_MODULE_ID,r);let _=!1;try{if(m&&(t.inject(g.STANDALONE_BOOTSTRAP_TOKEN_ID,Promise.resolve(m.token)),c&&g.recreateTokenProvider(t,c,d,i)),h){const p=await As();t.inject(g.STANDALONE_PROJECT_ID,h),Is(t,h,p),_=!0,o.setCurrentProjectCard(t,jr(h))}if(await _s(n,r),_=!0,!h){await ys(n);const p=t.getInstance(g.STANDALONE_PROJECT_ID);if(p)Is(t,p,await As()),_=!0;else if(t.getInstance(g.APP_ID)!==void 0)try{(await t.getInstanceAsync(g.APP_ID))?.project==null}catch{}}u&&Zy(t,u),t.inject(g.STANDALONE_ACTIVATED_ID,!0)}catch(p){throw r_(t,_),p}}async function i_(e,t,n,r){const i=r?.attemptTimeout??g.isFailoverEnabled(n),a=g.isFailoverEnabled(n)?g.getOrderedOriginCandidates(n):g.getOriginChain(n).length>0?[g.getActiveBaseUrl(n)]:[];if(a.length===0)throw new Error("[apiOriginFailover] no API base URL configured");const c=e.startsWith("/")?e:`/${e}`;let d,u;for(let m=0;m<a.length;m++){const f=a[m],h=m===a.length-1,_=i?g.beginFailoverAttempt(t.signal):void 0;try{const p=await fetch(`${f}${c}`,{...t,..._?{signal:_.signal}:{}});if(!p.ok&&g.shouldFailoverResponse(p.status)){if(d=p,!h){g.reportOriginFailure(f,n);continue}break}return p.ok&&g.reportOriginSuccess(f,n),p}catch(p){const E=_?.timeoutError();if(!E&&!g.shouldFailoverError(p))throw p;u=E||p,h||g.reportOriginFailure(f,n)}finally{_?.done()}}if(g.isFailoverEnabled(n)&&g.abandonStickyOrigin(),d)return d;throw u instanceof Error?u:new Error("[apiOriginFailover] fetch chain failed")}function a_(e,t){const n=String(t.baseUrl||"").trim();if(n)return g.resolveExplicitApiBaseUrl(n);const r=e.getInstance(g.REST_CLIENT_FACTORY_ID),i=String(r?.getOptions()?.baseUrl||"").trim();return g.resolveExplicitApiBaseUrl(i||void 0)}async function s_(e,t){if(t.getAuthToken)try{const n=await t.getAuthToken(t.user,t.project,void 0);if(String(n||"").trim())return!0}catch{if(!t.jwtAuth)return!1}if(t.jwtAuth)try{if(String(e.getInstance(g.JWT_TOKEN_ID)||"").trim())return!0;const n=a_(e,t);if(!n)return!1;const r=await i_("/jwt-auth/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.jwtAuth)},n,{attemptTimeout:!0});if(!r.ok)return!1;const i=await r.json();return i.token?(e.inject(g.JWT_ERROR_ID,void 0),e.inject(g.JWT_TOKEN_ID,i.token),!0):!1}catch{return!1}return!1}async function l_(e){try{if(e.getInstance(g.APP_ID)===void 0)return!1;const t=await d_(e.getInstanceAsync(g.APP_ID));return t!=null&&t.project!=null?t:!1}catch{return!1}}function c_(){return g.getFailoverAttemptTimeoutMs()*Math.max(1,g.getOriginChain().length)}function d_(e){const t=c_();return new Promise((n,r)=>{const i=setTimeout(()=>{n(void 0)},t);e.then(a=>{clearTimeout(i),n(a)},a=>{clearTimeout(i),r(a)})})}function Ps(e){return String(e.standaloneKey||"").trim()||void 0}function u_(e){return e.standaloneOnAuthFailure===!0?!0:e.config?.standaloneOnAuthFailure===!0}function m_(e){return u_(e)?!!Ps(e):!1}var p_=zn(async e=>{const t=e.getInstance(g.DISPOSABLE_ID),n=()=>e.getInstanceAsync(g.STORE_ID);return{async setOptions(r){if(!m_(r)){e.getInstance(g.STANDALONE_ACTIVATED_ID);return}const i=Ps(r);if(!i||e.getInstance(g.STANDALONE_ACTIVATED_ID))return;const a=await n(),c=!!(r.getAuthToken||r.jwtAuth),d=c?await s_(e,r):!0;if(c&&!d){await xs({container:e,store:a,standaloneKey:i,project:r.project,getAuthToken:r.getAuthToken,user:r.user,disposable:t,reason:"auth pipeline failed"});return}const u=await l_(e);if(u){await Wy(u).catch(()=>{});return}await xs({container:e,store:a,standaloneKey:i,project:r.project,getAuthToken:r.getAuthToken,user:r.user,disposable:t,reason:"app_init failed"})}}}),f_=g.defineMixin(e=>{let t;const n=o.getDisposable(e),r=g.getEvent(e,g.events.ON_DOCUMENT_SESSION_CHANGE);n.addDisposable(r(({history:a})=>{t=a}));const i=()=>t?Fi(t):void 0;return{instance:{undoRedoService:{undo:()=>i()?.undo(),redo:()=>i()?.redo(),clear:()=>i()?.clear(),getPast:a=>i()?.getPast(a)??[],getFuture:a=>i()?.getFuture(a)??[],canUndo:()=>i()?.canUndo()??!1,canRedo:()=>i()?.canRedo()??!1,createSnapshot:()=>i()?.createSnapshot(),restoreSnapshot:a=>i()?.restoreSnapshot(a)}}}});function h_(e){return{font_size:e.fontSize,font_family:e.fontFamily,tab_size:e.tabSize,word_wrap:e.wordWrap,minimap:e.minimap,insert_spaces:e.insertSpaces}}function g_(e){return{fontSize:e.fontSize,fontFamily:e.fontFamily,tabSize:e.tabSize,wordWrap:e.wordWrap!=="off",minimap:e.minimap?.enabled,insertSpaces:e.insertSpaces}}async function Rs(e){const t=o.getCurrentUser(e).profile;if(t)return t;const n=e.getInstance(g.STORE_ID);if(n)return(await n.dispatch(o.authorizationApi.endpoints.getMe.initiate("",{forceRefetch:!0}))).data}function y_(e){const t=o.resolveTemplateDirectivesConfig(e);if(!(Object.keys(t.output).length>0||Object.keys(t.editor).length>0))return ga();const n=new Set(Object.keys(t.output).filter(i=>t.output[i]==="html-comment")),r=new Set(Object.keys(t.output));return{isConfigured:()=>!0,toEditorForm:i=>o.mapper.normalizeToPolicy(i,t.editor),toOutputForm:i=>o.mapper.normalizeToPolicy(i,t.output),keepWrappedOnOutput:n,editorPolicy:t.editor,warnAboutUnconfiguredInput:ha(r)}}function js(e){const t=o.getCodeMode(e);return{...No(e),editor:g_(o.getEditorOptions(e)),codeModeDirection:t.isCodeMode?t.direction:"none"}}function No(e){return e.getInstance(g.CONFIG_SOURCE_ID)?.get()??{}}function Fr(e){return e.getInstance(g.CONFIG_SOURCE_ID)?.layers()??{base:{},profile:{},serverSide:{},user:{},local:{},advancedConfigs:{}}}var __=vr(e=>{const t=o.getDisposable(e),n=Ct(o.getEvent(e,g.events.ON_LIMIT_ID)),r=t.addDisposable(new kt(n)),i=Ct(o.getEvent(e,g.events.READ_LOCALE)),a=t.addDisposable(new kt(i)),c=Ct(o.getEvent(e,g.events.ON_TRANSLATE_ID)),d=t.addDisposable(new kt(c)),u=o.getEmitter(e,g.CONFIG_CHANGED_EVENT_ID),m=async()=>{try{return e.getInstance(g.APP_ID)===void 0?{}:(await e.getInstanceAsync(g.APP_ID))?.app_config||{}}catch{return{}}},f=$a(),h=$a();let _,p=!1,E;const k=async()=>{const A=js(e);if(!p){E=g.deepClone(A),p=!0;return}E!==void 0&&g.deepEqual(E,A)||(E=g.deepClone(A),await u.fire(A))},w=A=>{if(typeof A=="number")return String(A);if(typeof A=="string")return A},b=A=>{if(A!==void 0){const L=o.provideCurrentProject(e);L.set({...L.get(),requested:String(A)})}},x=async(A,L)=>{if(!A){const Z=await Rs(e);return _=w(Z?.id),{didReset:!1}}const z=await Rs(e),B=A.id!==void 0?w(A.id):w(z?.id),$=_!==void 0?String(_):void 0,de=B!==void 0?String(B):void 0,pe=$!==void 0&&de!==void 0&&$!==de,H={...z,...o.filterUndefined(A),id:B};if(A.id===void 0&&!z?.id&&delete H.id,o.provideCurrentUser(e).set({profile:H}),pe&&L){const Z=e.getInstance(g.INSTANCE_ID);if(Z?.reset)return await Z.reset(L),{didReset:!0}}return _=de,{didReset:!1}},P=A=>{const L=e.getInstance(g.CONFIG_SOURCE_ID);L?.setAdvancedConfigs({...A.advancedConfigs,...A.user?.advancedConfigs}),L?.replace(A.user,"user"),L?.replace(A.serverSide,"server")},Y=async()=>{await e.getInstance(g.CONFIG_SOURCE_ID)?.ready(),o.getRevisionServiceFlag(e).set(No(e).revisionService===!0);const{codeModeDirection:A,editor:L}=No(e);L&&o.applyEditorOptions(e,h_(L)),A!==void 0&&(A==="none"?o.setCodeMode$1(e,!1):(o.setCodeMode$1(e,!0),o.setCodeModeDirection(e,A)))},J=async A=>{P(A),await Y()};let N;const O=f.decorate(async({config:A={},project:L,user:z,advancedConfigs:B},$)=>{e.getInstance(g.CONFIG_SOURCE_ID)?.replace(await m(),"server"),await Y(),e.inject(g.TEMPLATE_DIRECTIVES_ID,y_(No(e).templateDirectives)),b(L),$&&"commonStyles"in $&&o.setDefaultCommonStyles(e,$.commonStyles===void 0?void 0:$.commonStyles);const{didReset:de}=await x(z,$)});return{setOptions:h.decorate(async A=>{const{config:L={},project:z,user:B,advancedConfigs:$,handleReadLocale:de,handleLimitUsage:pe,handleTranslate:H,storageProvider:Z}=A;e.inject(g.STORAGE_PROVIDER_ID,Z),a.setListener(de),r.setListener(pe),d.setListener(H),await O({config:L,project:z,user:B,advancedConfigs:$},A).catch(De=>{}),await k(),N&&N.dispose(),N=new g.Disposable}),instance:{setConfig:h.decorate(async A=>{const L=A,{commonStyles:z,...B}=L;"commonStyles"in L&&o.setDefaultCommonStyles(e,z===void 0?void 0:z),await J({advancedConfigs:Fr(e).advancedConfigs,serverSide:await m(),user:B}),await k()}),getConfig:()=>js(e),updateConfig:h.decorate(async A=>{const L=A,{commonStyles:z,...B}=L;"commonStyles"in L&&o.setDefaultCommonStyles(e,z===void 0?void 0:z),await J({advancedConfigs:Fr(e).advancedConfigs,serverSide:await m(),user:{...Fr(e).user,...B}}),await k()}),handleReadLocale:i,handleLimitUsage:n,handleTranslate:c}}}),Do;function Br(){return Do===void 0&&(Do=(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/d2342090.js")),void 0,{}.url).catch(e=>{throw Do=void 0,e})),Do}var Ls;function b_(){return Ls??=(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/370f04c3.js")).then(e=>zt.__toESM(e.require_core())),void 0,{}.url),Ls}function v_(e){const t=[0],n=[];let r=0;for(;r<e.length;){const i=e.charCodeAt(r);i===10||i===13?(n.push(r-t[t.length-1]),r+=i===13&&e.charCodeAt(r+1)===10?2:1,t.push(r)):r+=1}return n.push(e.length-t[t.length-1]),{starts:t,lengths:n}}function Os({starts:e,lengths:t},n,r){const i=Math.min(Math.max(n,1),e.length)-1;return e[i]+Math.min(Math.max(r,1),t[i]+1)-1}var E_={error:8,warning:4,info:2};function S_(e,t){const n=e.evidence!==""?e.col+e.evidence.length:t.lengths[e.line-1]??e.col+1;return{severity:E_[e.type]??8,message:e.message,startLineNumber:e.line,startColumn:e.col,endLineNumber:e.line,endColumn:n,startOffset:Os(t,e.line,e.col),endOffset:Os(t,e.line,n)}}async function w_(e){const{HTMLHint:t}=await b_(),n=v_(e);return t.verify(e,o.EMAIL_CODE_RULESET).map(r=>S_(r,n))}var k_=class extends g.Disposable{_container;_dataSources;_currentEmail;_blockMetaWrites=Promise.resolve();constructor(e){super(),this._container=e,this._dataSources=o.getDataSources(e),this.addDisposable(g.getEvent(e,g.events.ON_EMAIL_CHANGED_ID)(t=>{this._currentEmail=t}))}async getBlocks(){const e=await this._readProjectBlocks();return await this._blockMetaWrites,(await this._dataSources.blocks.cache.values()).filter(t=>t.project===e).map(t=>$h(t,this._container))}async _readProjectBlocks(){const e=await o.getBlocksProject(this._container);return await this._dataSources.blocks.byForeignKey("project").get(e),e}async getComments(){const{cache:e}=this._dataSources.comments,t=await this.getEmailSnapshot();return(await e.values()).filter(n=>n.post===t.id).map(n=>zh(n,this._container))}async getEmailRevisions(){const{cache:e}=this._dataSources.emailRevisions,t=await this.getEmailSnapshot();return(await e.values()).filter(n=>n.parent===t.id).map(n=>Gh(n,this._container))}async getEmailSnapshot(){return Km(o.getOpenEmail(this._container,this._currentEmail),this._container)}async getEmail(e=!0){return this.compile(e)}async compileEmail(e=!0){return this.compile(e)}async compile(e){const{compileEmail:t}=await Br();return t(await this.getEmailSnapshot(),e,rn(this._container).keepWrappedOnOutput)}setEmailMeta(e){const t=o.getOpenDocument(this._container);if(!t)return;const n=t.get().attributes.meta;o.writeEmailAttributes(t,{meta:o.applyMetaPatch({meta:n},e).meta});const r=t.get().serverId;r!=null&&this._dataSources.emails.cache.addOrUpdate(r,i=>i&&o.applyMetaPatch(i,e))}setBlockMeta(e,t){const n=async()=>{await this._readProjectBlocks();const{cache:r}=this._dataSources.blocks;await r.getIfPresent(e)&&await r.addOrUpdate(e,i=>i&&o.applyMetaPatch(i,t))};this._blockMetaWrites=this._blockMetaWrites.then(n).catch(()=>{})}getCodeErrors(){const e=o.getCodeErrors(this._container);return e.length>0?e:void 0}validateCode(){return Promise.resolve(w_(o.getOpenEmail(this._container,this._currentEmail).html??""))}};function Ms(){Br().catch(()=>{})}function C_(e){const t=o.provideHeadlessMode(e).watch(n=>{n&&Ms()});e.getInstance(g.DISPOSABLE_ID)?.addDisposable(t),Ht(e).whenVisible(()=>{Xt(Ms)})}var T_=g.createIdentifier$1("EmailOperationsController");function Ns(e){return e.getOrCreateInstance(T_,()=>{const t=new k_(e);return e.getInstance(g.DISPOSABLE_ID)?.addDisposable(t),t})}function I_(e){Ns(e),C_(e)}function A_(e){const t=Ns(e);return{getEmailSnapshot:()=>t.getEmailSnapshot(),getEmail:()=>t.getEmail(),async compileEmail(n,r=!0){if(!n)return t.compileEmail(r);const{compileEmail:i}=await Br();return i(n,r,rn(e).keepWrappedOnOutput)},validateCode:()=>t.validateCode(),getCodeErrors:()=>t.getCodeErrors(),getBlocks:()=>t.getBlocks(),getComments:()=>t.getComments(),getEmailRevisions:()=>t.getEmailRevisions(),setEmailMeta:n=>t.setEmailMeta(n),setBlockMeta:(n,r)=>t.setBlockMeta(n,r)}}var x_=g.defineMixin(e=>{const t=e.getInstance(g.DISPOSABLE_ID),n=g.getEvent(e,g.events.UPLOAD_EVENT_ID),r=g.getEvent(e,g.events.FILE_PROXY_EVENT_ID),i=g.getEmitter(e,g.events.PROXY_URL_EVENT_ID).event,a=Ct(n),c=Ct(i),d=Ct(r),u=t.addDisposable(new kt(a)),m=t.addDisposable(new kt(d)),f=t.addDisposable(new kt(c));return{setOptions(h){u.setListener(h.handleLoadImage),m.setListener(h.handleFileProxy),f.setListener(h.handleUrlProxy)},instance:{handleLoadImage:a,handleFileProxy:d,handleUrlProxy:c}}}),P_=g.defineMixin(e=>{const t=e.getInstance(g.DISPOSABLE_ID),n=g.getEvent(e,g.events.AI_TEXT_REQUEST_ID),r=g.getEvent(e,g.events.AI_IMAGE_REQUEST_ID),i=Ct(n),a=Ct(r),c=t.addDisposable(new kt(i)),d=t.addDisposable(new kt(a));return{setOptions(u){c.setListener(u.handleAITextRequest),d.setListener(u.handleAIImageRequest)},instance:{handleAITextRequest:i,handleAIImageRequest:a}}}),R_=class extends Error{cycle;constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),this.cycle=e}};function j_(e){const t=new Map;for(const n of e)for(const r of n.provides??[]){const i=t.get(r)??[];i.push(n),t.set(r,i)}return t}function L_(e,t){const n=[];for(const r of e.awaits?.services??[])for(const i of t.get(r)??[])i!==e&&n.push(i);return n}function O_(e){const t=j_(e),n=[],r=new Set,i=[],a=new Set,c=d=>{if(!r.has(d)){if(a.has(d)){const u=i.indexOf(d);throw new R_([...i.slice(u),d].map(m=>m.name))}a.add(d),i.push(d);for(const u of L_(d,t))c(u);i.pop(),a.delete(d),r.add(d),n.push(d)}};for(const d of e)c(d);return n}var M_="author,slug,date,modified,title,acf.html,id,parent,date_gmt",N_="author,slug,date,modified,modified_gmt,title,acf.html,id,parent",D_=20,Ur=[g.WpEblockApi];function Ds(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}function F_(e){return{async readRevisions(t,n=1){const r=await g.getApi(e,Ur).eblock_revisions_list({parent:t,per_page:D_,page:n},{extraQuery:{_fields:M_}}),i=(r?.data??[]).map(c=>o.WpBlockRevisionToBlockRevision(c)),a=Number(r?.headers?.get("X-WP-TotalPages"));return{revisions:i,page:n,hasMore:Number.isFinite(a)&&n<a}},async readAutosave(t){const n=g.getApi(e,Ur),[r,i]=await Promise.all([n.eblock_autosaves_list({id:t},{extraQuery:{_fields:N_}}),n.eblock_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),a=(r?.data??[]).map(d=>{const u=d,m=o.WpBlockRevisionToBlockRevision(u),f=Ds(u.modified_gmt);return f?{...m,modified:f}:m}),c=Date.parse(Ds(i?.data?.modified_gmt)??"");return o.autosaveStateFromSlots(a,Number.isFinite(c)?c:void 0)},async saveAutosave(t,n){const r=n,i=r.global_block&&r.html?o.injectEmBlockIdIntoBlockHtml(r.html,t):r.html??"";o.writePendingData(t,{sentAt:Date.now(),html:i,common_styles:""});const a=await g.getApi(e,Ur).eblock_autosaves_create({id:t},o.BlockAutoSaveToWpBlockAutoSave({title:r.title,html:i,project:r.project,excerpt:new Date().toISOString()}),{type:g.ContentType.FormData});return o.WpBlockRevisionToBlockRevision(a?.data)}}}var B_="author,slug,date,modified,title,meta,acf.html,acf.common_styles,id,parent,date_gmt",U_="author,slug,date,modified,modified_gmt,title,meta,acf.html,acf.common_styles,id,parent";function Fs(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}var $_=20,$r=[g.WpEmailApi];function z_(e){return{async readRevisions(t,n=1){const r=await g.getApi(e,$r).email_revisions_list({parent:t,per_page:$_,page:n},{extraQuery:{_fields:B_}}),i=(r?.data??[]).map(c=>o.WpEmailRevisionToEmailRevision(c)),a=Number(r?.headers?.get("X-WP-TotalPages"));return{revisions:i,page:n,hasMore:Number.isFinite(a)&&n<a}},async readAutosave(t){const n=g.getApi(e,$r),[r,i]=await Promise.all([n.email_autosaves_list({id:t},{extraQuery:{_fields:U_}}),n.email_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),a=(r?.data??[]).map(d=>{const u=d,m=o.WpEmailRevisionToEmailRevision(u),f=Fs(u.modified_gmt);return f?{...m,modified:f}:m}),c=Date.parse(Fs(i?.data?.modified_gmt)??"");return o.autosaveStateFromSlots(a,Number.isFinite(c)?c:void 0)},async saveAutosave(t,n){const r=await g.getApi(e,$r).email_autosaves_create({id:t},o.EmailAutoSaveToWpEmailAutoSave({...n,excerpt:new Date().toISOString()}),{type:g.ContentType.FormData});return o.WpEmailRevisionToEmailRevision(r?.data)}}}var Bs=["_embedded","id","author","title","meta","emailtags","folder","group","modified","date","type","parent","date_gmt","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"].join(","),zr=[g.WpEmailApi],Us=e=>o.EmailToWpEmail(e);function G_(e){return{async readEmail(t){const n=await g.getApi(e,zr).email_detail({id:o.toNumberSafe(t)},{extraQuery:{_embed:"wp:term",_fields:Bs}});if(!n)throw new o.EmailOpenFailedError("unavailable");if(n.ok===!1)throw o.openFailureFromResponse(n);return n.data?o.WpEmailToEmail(n.data):null},async createEmail(t){const n={status:"publish",...Us(t)},r=await g.getApi(e,zr).email_create(n,{type:g.ContentType.Json});return o.WpEmailToEmail(r?.data)},async updateEmail(t,n){const r=await g.getApi(e,zr).email_partial_update({id:t},Us(n),{type:g.ContentType.Json,extraQuery:{_embed:"wp:term",_fields:Bs}});return o.WpEmailToEmail(r?.data)}}}function W_(e){o.injectRestEmailPortFactories(e,{email:G_,history:z_,blockHistory:F_})}var Gr=20,H_=({source:e,emailtags:t,group:n,tags:r,...i})=>i;function q_({revisions:e,revisionsByBlock:t}){const n=async(r,i)=>(t.clear(),await t.get(r,{page:i}),(await e.cache.values()??[]).filter(a=>String(a?.parent)===String(r)));return{async readRevisions(r,i=1){const a=await n(r,i);return{revisions:a.slice(Gr*(i-1),Gr*i),page:i,hasMore:a.length>Gr*i}},async readAutosave(r){return o.autosaveStateFromRevisions(await n(r,1))},async saveAutosave(r,i){const a=H_(i);return await e.create({...a,parent:r,modified:new Date().toString()})}}}var $s=g.createIdentifier$1("blockDocuments.provided");function V_(e){if(e.getInstance($s))return;e.inject($s,!0);const t=o.blockRevisionsDataSourceProvider(e);o.injectBlockHistoryPort(e,q_({revisions:t,revisionsByBlock:t.byForeignKey("parent")}))}var Y_=zt.__commonJSMin(((e,t)=>{(function(n){if(typeof window>"u")return;var r=0,i,a=!1,c=!1,d=7,u="[iFrameSizer]",m=u.length,f=null,h=window.requestAnimationFrame,_=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),p={},E=null,k=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){L("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function b(C,T,R){C.addEventListener(T,R,!1)}function x(C,T,R){C.removeEventListener(T,R,!1)}function P(){for(var C=["moz","webkit","o","ms"],T=0;T<C.length&&!h;T+=1)h=window[C[T]+"RequestAnimationFrame"];h?h=h.bind(window):O("setup","RequestAnimationFrame not supported")}function Y(C){var T="Host page: "+C;return window.top!==window.self&&(T=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+C:"Nested host page: "+C),T}function J(C){return u+"["+Y(C)+"]"}function N(C){return p[C]?p[C].log:a}function O(C,T){z("log",C,T,N(C))}function A(C,T){z("info",C,T,N(C))}function L(C,T){z("warn",C,T,!0)}function z(C,T,R,D){D===!0&&window.console}function B(C){function T(){function U(){et(re),Z(ee),Ge("onResized",re)}S("Height"),S("Width"),ve(U,re,"init")}function R(){var U=Xe.slice(m).split(":"),le=U[1]?parseInt(U[1],10):0,xe=p[U[0]]&&p[U[0]].iframe,Se=getComputedStyle(xe);return{iframe:xe,id:U[0],height:le+D(Se)+I(Se),width:U[2],type:U[3]}}function D(U){return U.boxSizing!=="border-box"?0:(U.paddingTop?parseInt(U.paddingTop,10):0)+(U.paddingBottom?parseInt(U.paddingBottom,10):0)}function I(U){return U.boxSizing!=="border-box"?0:(U.borderTopWidth?parseInt(U.borderTopWidth,10):0)+(U.borderBottomWidth?parseInt(U.borderBottomWidth,10):0)}function S(U){var le=Number(p[ee]["max"+U]),xe=Number(p[ee]["min"+U]),Se=U.toLowerCase(),Me=Number(re[Se]);O(ee,"Checking "+Se+" is in range "+xe+"-"+le),Me<xe&&(Me=xe,O(ee,"Set "+Se+" to min value")),Me>le&&(Me=le,O(ee,"Set "+Se+" to max value")),re[Se]=""+Me}function se(){function U(){function Se(){var We=0,Be=!1;for(O(ee,"Checking connection is from allowed list of origins: "+xe);We<xe.length;We++)if(xe[We]===le){Be=!0;break}return Be}function Me(){var We=p[ee]&&p[ee].remoteHost;return O(ee,"Checking connection is from: "+We),le===We}return xe.constructor===Array?Se():Me()}var le=C.origin,xe=p[ee]&&p[ee].checkOrigin;if(xe&&""+le!="null"&&!U())throw new Error("Unexpected message received from: "+le+" for "+re.iframe.id+". Message was: "+C.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function we(){return u===(""+Xe).slice(0,m)&&Xe.slice(m).split(":")[0]in p}function Ke(){var U=re.type in{true:1,false:1,undefined:1};return U&&O(ee,"Ignoring init message from meta parent page"),U}function Qe(U){return Xe.slice(Xe.indexOf(":")+d+U)}function ze(U){O(ee,"onMessage passed: {iframe: "+re.iframe.id+", message: "+U+"}"),Ge("onMessage",{iframe:re.iframe,message:JSON.parse(U)}),O(ee,"--")}function Ze(){var U=document.body.getBoundingClientRect(),le=re.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:le.height,iframeWidth:le.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(le.top-U.top,10),offsetLeft:parseInt(le.left-U.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function mt(U,le){function xe(){fe("Send Page Info","pageInfo:"+Ze(),U,le)}Te(xe,32,le)}function vt(){function U(Me,We){function Be(){p[Se]?mt(p[Se].iframe,Se):le()}["scroll","resize"].forEach(function(rt){O(Se,Me+rt+" listener for sendPageInfo"),We(window,rt,Be)})}function le(){U("Remove ",x)}function xe(){U("Add ",b)}var Se=ee;xe(),p[Se]&&(p[Se].stopPageInfo=le)}function ft(){p[ee]&&p[ee].stopPageInfo&&(p[ee].stopPageInfo(),delete p[ee].stopPageInfo)}function lt(){var U=!0;return re.iframe===null&&(L(ee,"IFrame ("+re.id+") not found"),U=!1),U}function G(U){var le=U.getBoundingClientRect();return H(ee),{x:Math.floor(Number(le.left)+Number(f.x)),y:Math.floor(Number(le.top)+Number(f.y))}}function V(U){function le(){f=We,te(),O(ee,"--")}function xe(){return{x:Number(re.width)+Me.x,y:Number(re.height)+Me.y}}function Se(){window.parentIFrame?window.parentIFrame["scrollTo"+(U?"Offset":"")](We.x,We.y):L(ee,"Unable to scroll to requested position, window.parentIFrame not found")}var Me=U?G(re.iframe):{x:0,y:0},We=xe();O(ee,"Reposition requested from iFrame (offset x:"+Me.x+" y:"+Me.y+")"),window.top===window.self?le():Se()}function te(){Ge("onScroll",f)===!1?De():Z(ee)}function ue(U){function le(){var Be=G(We);O(ee,"Moving to in page link (#"+Se+") at x: "+Be.x+" y: "+Be.y),f={x:Be.x,y:Be.y},te(),O(ee,"--")}function xe(){window.parentIFrame?window.parentIFrame.moveToAnchor(Se):O(ee,"In page link #"+Se+" not found and window.parentIFrame not found")}var Se=U.split("#")[1]||"",Me=decodeURIComponent(Se),We=document.getElementById(Me)||document.getElementsByName(Me)[0];We?le():window.top===window.self?O(ee,"In page link #"+Se+" not found"):xe()}function ge(U){var le={};if(Number(re.width)===0&&Number(re.height)===0){var xe=Qe(9).split(":");le={x:xe[1],y:xe[0]}}else le={x:re.width,y:re.height};Ge(U,{iframe:re.iframe,screenX:Number(le.x),screenY:Number(le.y),type:re.type})}function Ge(U,le){return $(ee,U,le)}function qe(){switch(p[ee]&&p[ee].firstRun&&Oe(),re.type){case"close":pe(re.iframe);break;case"message":ze(Qe(6));break;case"mouseenter":ge("onMouseEnter");break;case"mouseleave":ge("onMouseLeave");break;case"autoResize":p[ee].autoResize=JSON.parse(Qe(9));break;case"scrollTo":V(!1);break;case"scrollToOffset":V(!0);break;case"pageInfo":mt(p[ee]&&p[ee].iframe,ee),vt();break;case"pageInfoStop":ft();break;case"inPageLink":ue(Qe(9));break;case"reset":be(re);break;case"init":T(),Ge("onInit",re.iframe);break;default:Number(re.width)===0&&Number(re.height)===0?L("Unsupported message received ("+re.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):T()}}function at(U){var le=!0;return p[U]||(le=!1,L(re.type+" No settings for "+U+". Message was: "+Xe)),le}function Bt(){for(var U in p)fe("iFrame requested init",K(U),p[U].iframe,U)}function Oe(){p[ee]&&(p[ee].firstRun=!1)}var Xe=C.data,re={},ee=null;Xe==="[iFrameResizerChild]Ready"?Bt():we()?(re=R(),ee=re.id,p[ee]&&(p[ee].loaded=!0),!Ke()&&at(ee)&&(O(ee,"Received: "+Xe),lt()&&se()&&qe())):A(ee,"Ignored: "+Xe)}function $(C,T,R){var D=null,I=null;if(p[C])if(D=p[C][T],typeof D=="function")I=D(R);else throw new TypeError(T+" on iFrame["+C+"] is not a function");return I}function de(C){var T=C.id;delete p[T]}function pe(C){var T=C.id;if($(T,"onClose",T)===!1){O(T,"Close iframe cancelled by onClose event");return}O(T,"Removing iFrame: "+T);try{C.parentNode&&C.parentNode.removeChild(C)}catch(R){L(R)}$(T,"onClosed",T),O(T,"--"),de(C),i&&(i.disconnect(),i=null)}function H(C){f===null&&(f={x:window.pageXOffset===n?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===n?document.documentElement.scrollTop:window.pageYOffset},O(C,"Get page position: "+f.x+","+f.y))}function Z(C){f!==null&&(window.scrollTo(f.x,f.y),O(C,"Set page position: "+f.x+","+f.y),De())}function De(){f=null}function be(C){function T(){et(C),fe("reset","reset",C.iframe,C.id)}O(C.id,"Size reset requested by "+(C.type==="init"?"host page":"iFrame")),H(C.id),ve(T,C,"reset")}function et(C){function T(S){if(!C.id){O("undefined","messageData id not set");return}C.iframe.style[S]=C[S]+"px",O(C.id,"IFrame ("+I+") "+S+" set to "+C[S]+"px")}function R(S){!c&&C[S]==="0"&&(c=!0,O(I,"Hidden iFrame detected, creating visibility listener"),Fe())}function D(S){T(S),R(S)}var I=C.iframe.id;p[I]&&(p[I].sizeHeight&&D("height"),p[I].sizeWidth&&D("width"))}function ve(C,T,R){R!==T.type&&h&&!window.jasmine?(O(T.id,"Requesting animation frame"),h(C)):C()}function fe(C,T,R,D,I){function S(){var ze=p[D]&&p[D].targetOrigin;O(D,"["+C+"] Sending msg to iframe["+D+"] ("+T+") targetOrigin: "+ze),R.contentWindow.postMessage(u+T,ze)}function se(){L(D,"["+C+"] IFrame("+D+") not found")}function we(){R&&"contentWindow"in R&&R.contentWindow!==null?S():se()}function Ke(){function ze(){p[D]&&!p[D].loaded&&!Qe&&(Qe=!0,L(D,"IFrame has not responded within "+p[D].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}I&&p[D]&&p[D].warningTimeout&&(p[D].msgTimeout=setTimeout(ze,p[D].warningTimeout))}var Qe=!1;D=D||R.id,p[D]&&(we(),Ke())}function K(C){return C+":"+p[C].bodyMarginV1+":"+p[C].sizeWidth+":"+p[C].log+":"+p[C].interval+":"+p[C].enablePublicMethods+":"+p[C].autoResize+":"+p[C].bodyMargin+":"+p[C].heightCalculationMethod+":"+p[C].bodyBackground+":"+p[C].bodyPadding+":"+p[C].tolerance+":"+p[C].inPageLinks+":"+p[C].resizeFrom+":"+p[C].widthCalculationMethod+":"+p[C].mouseEvents}function me(C){return typeof C=="number"}function ie(C,T){function R(){function V(ue){var ge=p[G][ue];ge!==1/0&&ge!==0&&(C.style[ue]=me(ge)?ge+"px":ge,O(G,"Set "+ue+" = "+C.style[ue]))}function te(ue){if(p[G]["min"+ue]>p[G]["max"+ue])throw new Error("Value for min"+ue+" can not be greater than max"+ue)}te("Height"),te("Width"),V("maxHeight"),V("minHeight"),V("maxWidth"),V("minWidth")}function D(){var V=T&&T.id||k.id+r++;return document.getElementById(V)!==null&&(V+=r++),V}function I(V){if(typeof V!="string")throw new TypeError("Invaild id for iFrame. Expected String");return V===""&&(C.id=V=D(),a=(T||{}).log,O(V,"Added missing iframe ID: "+V+" ("+C.src+")")),V}function S(){switch(O(G,"IFrame scrolling "+(p[G]&&p[G].scrolling?"enabled":"disabled")+" for "+G),C.style.overflow=(p[G]&&p[G].scrolling)===!1?"hidden":"auto",p[G]&&p[G].scrolling){case"omit":break;case!0:C.scrolling="yes";break;case!1:C.scrolling="no";break;default:C.scrolling=p[G]?p[G].scrolling:"no"}}function se(){(typeof(p[G]&&p[G].bodyMargin)=="number"||(p[G]&&p[G].bodyMargin)==="0")&&(p[G].bodyMarginV1=p[G].bodyMargin,p[G].bodyMargin=""+p[G].bodyMargin+"px")}function we(){var V=p[G]&&p[G].firstRun,te=p[G]&&p[G].heightCalculationMethod in _;!V&&te&&be({iframe:C,height:0,width:0,type:"init"})}function Ke(){p[G]&&(p[G].iframe.iFrameResizer={close:pe.bind(null,p[G].iframe),removeListeners:de.bind(null,p[G].iframe),resize:fe.bind(null,"Window resize","resize",p[G].iframe),moveToAnchor:function(V){fe("Move to anchor","moveToAnchor:"+V,p[G].iframe,G)},sendMessage:function(V){V=JSON.stringify(V),fe("Send Message","message:"+V,p[G].iframe,G)}})}function Qe(V){function te(){fe("iFrame.onload",V,C,n,!0),we()}function ue(Ge){if(!C.parentNode)return null;var qe=new Ge(function(at){at.forEach(function(Bt){Array.prototype.slice.call(Bt.removedNodes).forEach(function(Oe){Oe===C&&pe(C)})})});return qe.observe(C.parentNode,{childList:!0}),qe}var ge=w();ge&&(i=ue(ge)),b(C,"load",te),fe("init",V,C,n,!0)}function ze(V){if(typeof V!="object")throw new TypeError("Options is not an object")}function Ze(V){for(var te in k)Object.prototype.hasOwnProperty.call(k,te)&&(p[G][te]=Object.prototype.hasOwnProperty.call(V,te)?V[te]:k[te])}function mt(V){return V===""||V.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":V}function vt(V){var te=V.split("Callback");if(te.length===2){var ue="on"+te[0].charAt(0).toUpperCase()+te[0].slice(1);this[ue]=this[V],delete this[V],L(G,"Deprecated: '"+V+"' has been renamed '"+ue+"'. The old method will be removed in the next major version.")}}function ft(V){V=V||{},p[G]=Object.create(null),p[G].iframe=C,p[G].firstRun=!0,p[G].remoteHost=C.src&&C.src.split("/").slice(0,3).join("/"),ze(V),Object.keys(V).forEach(vt,V),Ze(V),p[G]&&(p[G].targetOrigin=p[G].checkOrigin===!0?mt(p[G].remoteHost):"*")}function lt(){return G in p&&"iFrameResizer"in C}var G=I(C.id);lt()?L(G,"Ignored iFrame, already setup."):(ft(T),S(),R(),se(),Qe(K(G)),Ke())}function ae(C,T){E===null&&(E=setTimeout(function(){E=null,C()},T))}var Ae={};function Te(C,T,R){Ae[R]||(Ae[R]=setTimeout(function(){Ae[R]=null,C()},T))}function Fe(){function C(){function I(S){function se(Ke){return(p[S]&&p[S].iframe.style[Ke])==="0px"}function we(Ke){return Ke.offsetParent!==null}p[S]&&we(p[S].iframe)&&(se("height")||se("width"))&&fe("Visibility change","resize",p[S].iframe,S)}Object.keys(p).forEach(function(S){I(S)})}function T(I){O("window","Mutation observed: "+I[0].target+" "+I[0].type),ae(C,16)}function R(){var I=document.querySelector("body");new D(T).observe(I,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0})}var D=w();D&&R()}function X(C){function T(){Ie("Window "+C,"resize")}O("window","Trigger event: "+C),ae(T,16)}function Ee(){function C(){Ie("Tab Visible","resize")}document.visibilityState!=="hidden"&&(O("document","Trigger event: Visibility change"),ae(C,16))}function Ie(C,T){function R(D){return p[D]&&p[D].resizeFrom==="parent"&&p[D].autoResize&&!p[D].firstRun}Object.keys(p).forEach(function(D){R(D)&&fe(C,T,p[D].iframe,D)})}function he(){b(window,"message",B),b(window,"resize",function(){X("resize")}),b(document,"visibilitychange",Ee),b(document,"-webkit-visibilitychange",Ee)}function Re(){function C(D,I){function S(){if(I.tagName){if(I.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+I.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}I&&(S(),ie(I,D),R.push(I))}function T(D){D&&D.enablePublicMethods&&L("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var R;return P(),he(),function(I,S){switch(R=[],T(I),typeof S){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(S||"iframe"),C.bind(n,I));break;case"object":C(I,S);break;default:throw new TypeError("Unexpected data type ("+typeof S+")")}return R}}function $e(C){C.fn?C.fn.iFrameResize||(C.fn.iFrameResize=function(R){function D(I,S){ie(S,R)}return this.filter("iframe").each(D).end()}):A("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==n&&$e(window.jQuery),typeof define=="function"&&define.amd?define([],Re):typeof t=="object"&&typeof t.exports=="object"&&(t.exports=Re()),window.iFrameResize=window.iFrameResize||Re()})()})),K_=zt.__toESM(Y_()),Q_={checkOrigin:!1,minHeight:600,scrolling:!1};function X_(e){const t=()=>e.iFrameResizer;return(0,K_.default)(Q_,e),{resize:()=>t()?.resize?.(),dispose:()=>t()?.removeListeners?.()}}function J_(e){e.inject(Di,X_)}function Z_(e){const t=o.getMessageService(e),n=e.getInstance(o.LOCALE_SERVICE_ID);if(!n)return;let r="";const i=()=>{const d=n.snapshot(),u=d.id??"";if(!t.isInited()||u===r)return;const m=o.createI18n(d.catalog),f=_=>m.__(_),h=o.SANDBOX_TRANSLATIONS_MAP(f);r=u,t.send(o.EVENT_TYPES.SANDBOX_TRANSLATIONS,{name:u,data:h})},a=t.onInit(()=>{r="",i()}),c=n.state.watch(i);e.getInstance(g.DISPOSABLE_ID)?.addDispose(()=>{a.dispose(),c.dispose()})}function eb(e){const t=e?.content?.templateId;return t==null||t===""?void 0:String(t)}function tb(e){e.getInstance(g.OPTIONS_SOURCE_ID)?.watch(t=>{const n=eb(t);n!==void 0&&qh(e,n)})}var Wr={en_US:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/e9fd7972.js")),void 0,{}.url),ru_RU:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/8ca96066.js")).then(e=>e.ru_RU_exports),void 0,{}.url),uk_UA:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/1655f40f.js")),void 0,{}.url),es_ES:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/fabc717f.js")),void 0,{}.url),pt_BR:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/b9758690.js")),void 0,{}.url),de_DE:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/7b7c0c8c.js")),void 0,{}.url),fr_FR:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/5c7e24b5.js")),void 0,{}.url),it_IT:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/de611927.js")),void 0,{}.url),pl_PL:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/f4a519b0.js")),void 0,{}.url)};async function nb(e){const t=Wr[e];if(!t){const n=Wr.en_US;return n?(await n()).default:void 0}return(await t()).default}var P0=Object.keys(Wr),ob=e=>e==="uk"?"uk_UA":e;function rb(e){e.getInstance(o.LOCALE_SERVICE_ID)?.useAntdLoader(t=>nb(ob(t)))}var zs={id:"ru_RU",time:1790580851,hash:"12de8d6a5e2f68343bd8b4f78da589e3b0af7c67ec27bfe1cc93b975c014c332",catalog:JSON.parse(`{"":{"domain":"default","lang":"ru_RU","plural_forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10 >= 2 && n%10<=4 &&(n%100<10||n%100 >= 20)? 1 : 2);"}," Add section":["Добавить раздел"]," email was":["письмо","письма","писем"]," from the project successfully.":["из проекта."]," successfully imported.":["импортировано."],"\\" email?":["»?"],"\\" was successfully created.":["\\" создано."],"\\" was successfully removed.":["» удалён."],"%d day":["%d день","%d дня","%d дней"],"%d day left":["%d день остался","%d дня осталось","%d дней осталось"],"%s plan":["Тариф %s"],"+0:00 London, Lisbon, Dublin":["+0:00 Лондон, Лиссабон, Дублин"],"+10:00 Sydney, Melbourne, Port Moresby":["+10:00 Сидней, Мельбурн, Порт-Морсби"],"+11:00 Honiara, Nuku'alofa, Apia":["+11:00 Хониара, Нукуалофа, Апиа"],"+1:00 Paris, Berlin, Rome":["+1:00 Париж, Берлин, Рим"],"+2:00 Athens, Kiev, Istanbul":["+2:00 Афины, Киев, Стамбул"],"+3:00 Istanbul, Doha, Baghdad":["+3:00 Москва, Санкт-Петербург, Киев"],"+4:00 Baku, Dubai, Tbilisi":["+4:00 Баку, Дубай, Тбилиси"],"+5:00 Karachi, Tashkent, Islamabad":["+5:00 Екатеринбург, Ташкент, Исламабад"],"+6:00 Almaty, Dhaka, Bishkek":["+6:00 Алматы, Дакка, Омск"],"+7:00 Bangkok, Ho Chi Minh City, Jakarta":["+7:00 Бангкок, Хошимин, Джакарта"],"+8:00 Beijing, Hong Kong, Singapore":["+8:00 Пекин, Гонконг, Сингапур"],"+9:00 Tokyo, Seoul, Jayapura":["+9:00 Токио, Сеул, Якутск"],"-10:00 Honolulu, Anchorage":["-10:00 Гонолулу, Анкоридж"],"-11:00 Pago Pago, Midway Atoll":["- 11:00 Паго-Паго, атолл Мидуэй"],"-12:00 Apia":["-12:00 Апиа"],"-1:00 Azores, Cape Verde":["-1:00 Азорские острова, Кабо-Верде"],"-2:00 South Georgia, Saint Helena":["-2:00 Южная Джорджия, остров Святой Елены"],"-3:00 Buenos Aires, Santiago, Montevideo":["-3:00 Буэнос-Айрес, Сантьяго, Монтевидео"],"-4:00 Caracas, Santo Domingo":["-4:00 Каракас, Санто-Доминго"],"-5:00 New York, Toronto, Havana":["-5:00 Нью-Йорк, Торонто, Гавана"],"-6:00 Mexico City, Guadalajara":["-6:00 Мехико, Гвадалахара"],"-7:00 Denver, Phoenix":["-7:00 Денвер, Феникс"],"-8:00 Los Angeles, Vancouver":["-8:00 Лос-Анджелес, Ванкувер"],"-9:00 Anchorage, Yukon":["-9:00 Анкоридж, Юкон"],"/ month":["/ месяц"],"1000+":["1000+"],"11–50":["11–50"],"12 hours":["12 часов"],"123456, City, 1 Example St.":["123456, Город, ул. Пример, 1"],"14 days free":["14 дней бесплатно"],"1–10":["1–10"],"20 s":["20 s"],"201–500":["201–500"],"24 hours":["24 часа"],"40 s":["40 s"],"501–1000":["501–1000"],"51–200":["51–200"],"60 s":["60 s"],"<1>Upload your own templates</1> or use <2>ready-made ones</2> to create emails from blocks.":["<1>Загружайте свои шаблоны</1> или используйте <2>готовые</2> для создания писем из блоков."],"A browser extension (for example, Urban VPN Proxy or similar ad blockers/VPN tools) is injecting code into the email preview. This can corrupt your template when saving.":["Расширение браузера (например, Urban VPN Proxy или аналогичные блокировщики рекламы/VPN-сервисы) вставляет код в окно предварительного просмотра письма. Это может привести к повреждению шаблона при сохранении."],"A flexible plan tailored to your needs":["Гибкий план, разработанный с учетом ваших потребностей"],"A shareable link to this page has been copied to the clipboard.":["Ссылка на страницу предпросмотра скопирована в буфер обмена."],"A test email can be sent to a maximum of 10 addresses.":["Тестовое письмо можно отправить максимум на 10 адресов."],"A-Z":["А-Я"],"AI":["AI"],"AI Assistant":["AI Ассистент"],"AI assistant":["AI Ассистент"],"AI email generation":["AI генерация письма"],"AI image":["AI картинка"],"AI image generation":["AI генерация изображений"],"AI requests":["Запросы к ИИ"],"AMP":["AMP"],"AMP visibility":["Видимость в AMP"],"API Key":["Ключ API"],"API Token":["Токен API"],"API URL":["URL API"],"Above":["Сверху"],"Accepted formats: PNG, JPG, WEBP, SVG or GIF.":["Доступные форматы: PNG, JPG, SVG или GIF."],"Access Key ID":["Идентификатор ключа доступа"],"Access keys and integration":["Ключи доступа и интеграция"],"Accessibility":["Доступность"],"Accessibility text":["Текст для людей с ограниченными возможностями"],"Accordion":["Аккордеон"],"Account Login":["Логин"],"Account settings":["Настройки аккаунта"],"Actions with the chosen text":["Действия с выбранным текстом"],"Active date background color":["Цвет фона активной даты"],"Active date font":["Шрифт активной даты"],"Add a common block":["Добавить общий блок"],"Add a font file or a link to the font.":["Добавьте файл шрифта или ссылку на него."],"Add a new folder":["Добавить новую папку"],"Add a new group":["Добавить группу"],"Add a new project":["Создать проект"],"Add a note":["Добавить метку"],"Add a saved block":["Добавить сохранённый блок"],"Add a template block":["Добавить шаблонный блок"],"Add an empty block":["Добавить пустой блок"],"Add block":["Добавить блок"],"Add button":["Добавить кнопку"],"Add card":["Добавить карточку"],"Add color":["Добавить цвет"],"Add column":["Добавить колонку"],"Add first color":["Добавить первый цвет"],"Add first link":["Добавить первую ссылку"],"Add group":["Добавить группу"],"Add image":["Изображение"],"Add inline image":["Вставить картинку"],"Add paragraph":["Добавить абзац"],"Add slide":["Добавить слайд"],"Add social network":["Добавить соцсеть"],"Add social network links to use in your email templates.":["Добавьте ссылки на соцсети, чтобы использовать их в шаблонах писем."],"Add some tags":["Укажите несколько тегов"],"Add up to 10 recipients":["Добавьте до 10 получателей"],"Add value":["Добавить значение"],"Add your brand palette and reuse it in the email editor.":["Добавьте палитру бренда и используйте её в редакторе писем."],"Add your first block to the folder...":["Добавьте свой первый блок в папку..."],"Added Drawing":["Добавление рисунка"],"Added Frame":["Добавление рамки"],"Added Image":["Добавление изображения"],"Added Shape":["Добавление фигуры"],"Added Sticker":["Добавление стикера"],"Added Text":["Добавление текста"],"Address of any S3-compatible storage, for example https://storage.example.com":["Адрес любого S3-совместимого хранилища, например https://storage.example.com"],"Adds VML markup so the background image is visible in Outlook.":["Добавляет разметку VML, чтобы фоновое изображение отображалось в Outlook."],"Adds bulletproof VML markup so the button keeps rounded corners in Outlook.":["Добавляет разметку VML, благодаря чему кнопка сохраняет закругленные углы в Outlook."],"Administrator":["Администратор"],"Align bottom":["По нижнему краю"],"Align center":["По центру"],"Align left":["Влево"],"Align middle":["Посередине"],"Align right":["Вправо"],"Align top":["По верхнему краю"],"Alignments":["Выравнивание"],"All":["Все"],"All EmailMaker features are available for 14 days":["Все функции EmailMaker доступны в течение 14 дней."],"All blocks saved at this point can be found in the “Saved Blocks” section in the sidebar.":["Все сохраненные на данный момент блоки можно найти в разделе «Сохраненные блоки» на боковой панели."],"All blocks saved successfully.":["Все блоки сохранены."],"All emails sent to this address will be added to your project as a template.":["Все письма, которые придут на этот адрес, будут добавлены в ваш проект в виде шаблона"],"All folders":["Все папки"],"All roles":["Все роли"],"Allow multiple selection":["Разрешить множественный выбор"],"Allowed protocols":["Допустимые протоколы"],"Already imported":["Уже импортировано"],"Altcraft":["Altcraft"],"Alternative text":["Альтернативный текст"],"Always":["Всегда"],"Amount":["Сумма"],"An unexpected error has occurred. Our team has already been notified. Please try reloading the page.":["Произошла непредвиденная ошибка. Наша команда уже получила уведомление. Попробуйте перезагрузить страницу."],"Anchor":["Якорь"],"Anchor links do not work in Outlook, Gmail, and several other email clients.":["Якорные ссылки не работают в Outlook, Gmail и ряде других почтовых клиентов."],"Anchor name":["Имя якоря"],"Animate":["Анимация"],"Annotation type":["Тип аннотации"],"Annotations":["Аннотации"],"Any additional details":["Любые дополнительные сведения"],"Appearance":["Внешний вид"],"Appearance on mobile devices":["Внешний вид на мобильных устройствах"],"Applied Filters":["Применение фильтров"],"Apply":["Применить"],"Apply horizontal padding to height":["Применить горизонтальный отступ к высоте"],"Approaching usage limit. Remaining":["Приближается предел использования. Остаток"],"Apps":["Приложения"],"Are you sure you want to delete project ":["Вы уверены, что хотите удалить проект "],"Are you sure you want to disable this integration?":["Вы уверены, что хотите отключить эту интеграцию?"],"Are you sure you want to leave the project ":["Вы уверены, что хотите покинуть проект "],"Are you sure?":["Вы уверены"],"Around":["Вокруг"],"Arrow":["Стрелка"],"Arrow color":["Цвет стрелки"],"Article":["Статьи"],"At least 8 characters in both cases, including letters, numbers, and special characters.":["Минимум 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least 8 characters, including a combination of uppercase and lowercase letters, numbers, and special characters.":["Не менее 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least one card needs an image and a link starting with https://":["Нужна хотя бы одна карточка с изображением и ссылкой, начинающейся с https://"],"Author":["Автор"],"Authorization error via Yandex":["Ошибка авторизации через Яндекс"],"Authorization keys":["Ключи авторизации"],"Auto":["Авто"],"Auto-payment enabled":["Автоплатёж включён"],"Auto-payment will be available once the subscription is linked in the payment system.":["Автоматическая оплата станет доступна после привязки подписки в платежной системе."],"Auto-prepend protocol on blur":["Автоматически добавлять протокол при потере фокуса"],"Autoplay":["Автозапуск"],"Autosave in editor":["Автосохранение в редакторе"],"Available formats: HTML, EML, ZIP":["Доступные форматы: HTML, EML, ZIP"],"Available until:":["Оплачен до:"],"BIK (bank ID)":["БИК"],"BIK must be 9 digits":["БИК должен состоять из 9 цифр"],"Back":["Назад"],"Back Home":["Вернуться"],"Back To Project":["Вернуться в проект"],"Back To Projects":["Вернуться к проектам"],"Back to Log In":["Вернуться к авторизации"],"Back to integrations":["К интеграциям"],"Background":["Фон"],"Background color":["Цвет фона"],"Background color of the contrast blocks":["Цвет фона контрастных блоков"],"Background image":["Фоновое изображение"],"Background image in Outlook (VML)":["Фоновое изображение в Outlook (VML)"],"Background image link/route":["Ссылка на фоновое изображение"],"Background image repeat":["Повтор фона"],"Background image size":["Размер фона"],"Bank account (RUB)":["Банковский счет (рубли)"],"Bank name":["Название банка"],"Banners":["Баннеры"],"Base URL for public access to files":["Базовый адрес для публичного доступа к файлам"],"Base background color":["Базовый цвет фона"],"Base colors":["Базовые цвета"],"Base path for uploading files":["Базовый путь для загрузки файлов"],"Base text color":["Базовый цвет текста"],"Beach":["Пляж"],"Before exporting the project, make sure to provide the URL where the webhook request will be sent":["Перед экспортом проекта необходимо заполнить url, на который будет отправляться запрос webHook"],"Below":["Снизу"],"Between bullets and text":["Между буллетами и текстом"],"Between list items":["Между пунктами списка"],"Billing":["Тарифы и оплата"],"Billing period":["Расчетный период"],"Black":["Чёрный"],"Black and White":["Чёрно-белые"],"Black circle":["Чёрный круг"],"Black circle outlined":["Чёрный круг обводка"],"Blank template":["Пустой шаблон"],"Block":["Блок"],"Block name":["Название блока"],"Block not yet loaded or global container not found.":["Код блока не загружен или глобальный контейнер не найден."],"Block styles":["Стили блока"],"Blocks":["Блоки"],"Blocks background color":["Цвет фона блоков"],"Blocks not found":["Блоки не найдены."],"Blocks search":["Поиск блоков"],"Blocks storage":["Хранилище Blocks"],"Blue":["Синий"],"Blur radius":["Размытие"],"Body":["Сообщение"],"Border":["Рамка"],"Border color":["Цвет рамки"],"Border radius":["Скругление"],"Borders":["Рамка"],"Both":["Всегда"],"Bottom":["Снизу"],"Bottom Code panel":["Панель кода снизу"],"Bottom left corner":["Нижний левый угол"],"Bottom margin":["Отступ снизу"],"Bottom padding":["Отступ снизу"],"Bottom padding of the general text":["Нижний отступ у текста"],"Bottom right corner":["Нижний правый угол"],"Box shadow":["Тень"],"Broadcast successfully created!":["Выпуск успешно создан!"],"Browser extension detected":["Обнаружено расширение для браузера"],"Browser page translation (for example, Google Translate) is active. It can break the editor and cause errors when saving.":["Включена функция перевода страницы в браузере (например, Google Translate). Это может привести к сбоям в работе редактора и вызывать ошибки при сохранении."],"Browser translation detected":["Обнаружен перевод с помощью браузера"],"Brush Color":["Цвет кисти"],"Brush Size":["Размер кисти"],"Brush Type":["Тип кисти"],"Bubbles":["Пузыри"],"Bucket name":["Имя бакета"],"Build newsletters from scratch with <1>structures and elements</1>.":["Собирайте рассылки с нуля с помощью <1>структур и элементов</1>."],"Bulk saving of blocks":["Массовое сохранение блоков"],"Bullet":["Буллет"],"Bullets color":["Цвет буллетов"],"Bullets font":["Шрифт буллетов"],"Bullets size":["Размер буллетов"],"Bullets type":["Тип буллетов"],"Button":["Кнопка"],"Button background color in contrasting blocks":["Цвет фона кнопок в контрастных блоках"],"Button size":["Размер кнопки"],"Button text color in contrasting blocks":["Цвет текста кнопок в контрастных блоках"],"Buttons":["Кнопки"],"Buttons background color":["Цвет фона кнопки"],"Buttons font":["Шрифт кнопки"],"Buttons font size":["Размер текста кнопки"],"Buttons letter spacing":["Межбуквенный интервал кнопки"],"Buttons text color":["Цвет текста кнопки"],"Buy":["Купить"],"Buy generations":["Купить генерации"],"Buy image check package":["Купить пакет проверки изображений"],"Buy link check package":["Купить пакет проверки ссылок"],"Buy optimization package":["Купить пакет оптимизации"],"Buy package":["Купить пакет"],"Buy spam check package":["Купить пакет проверки на спам"],"Buy test sends package":["Купить пакет тестов"],"By card":["Картой"],"Calendar":["Календарь"],"Call to Action":["Призыв к действию"],"Campaign created. Dotdigital used your account default sender because this From email is not registered as a custom from address. Add the address in Dotdigital and export again to use it.":["Кампания создана. Dotdigital использовал отправителя по умолчанию вашей учетной записи, поскольку этот адрес электронной почты в поле «От» не зарегистрирован в качестве настраиваемого адреса отправителя. Добавьте адрес в Dotdigital и повторно экспортируйте данные, чтобы использовать его."],"Campaign successfully created!":["Кампания успешно создана!"],"Cancel":["Отмена"],"Cannot disable recurring payments":["Не удается отключить автоплатёж"],"Cannot enable recurring payments":["Не удается включить автоплатёж"],"Captcha required":["Требуется ввести капчу"],"Captcha verification failed":["Ошибка при проверке капчи"],"Caption next to checkbox":["Подпись рядом с чекбоксом"],"Caption next to options":["Подпись рядом с пунктами"],"Card":["Карточка"],"Card payment is not available for this change.":["Для данной операции оплата картой недоступна."],"Card payment is not available for this change. Use an invoice for a legal entity.":["Для данного изменения оплата картой недоступна. Для юридического лица воспользуйтесь счётом-фактурой."],"Card payment is not available for this plan change. Please contact support.":["Оплата картой недоступна при изменении тарифного плана. Пожалуйста, обратитесь в службу поддержки."],"Card payment is not available for this plan change. Use an invoice for a legal entity or contact support.":["Для данного изменения тарифного плана оплата картой недоступна. Для юридических лиц воспользуйтесь счетом-фактурой или обратитесь в службу поддержки."],"Cards":["Карточки"],"Cards view":["Карточки"],"Carousel":["Карусель"],"Case Change":["Изменение ситуации"],"Cell":["Ячейка"],"Center horizontally":["По центру"],"Center vertically":["По центру"],"Change":["Изменить"],"Change Stripo key":["Сменить ключ Stripo"],"Change folder name":["Переименовать папку"],"Change group name":["Переименовать группу"],"Change image":["Сменить изображение"],"Change name":["Переименовать"],"Change plan":["Изменить тариф"],"Change role":["Изменить роль"],"Change role to Administrator":["Изменить роль на Администратор"],"Change tariff":["Сменить тариф"],"Changed Style":["Изменение стиля"],"Changes loaded":["Изменения загружены"],"Character limit":["Ограничение по количеству символов"],"Characters":["Символы"],"Chat support":["Чат поддержки"],"Check how your email appears across various devices and email clients.":["Проверьте, как будет выглядеть ваше письмо на разных устройствах и в разных почтовых клиентах."],"Check who and when made changes to the email template and, if necessary, restore one of the previous versions.":["Проверьте, кто и когда вносил изменения в шаблон, и при необходимости восстановите одну из предыдущих версий."],"Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.":["Проверьте письмо на наличие неработающих ссылок, отсутствующих alt-текстов, тяжелых изображений и других препятствий, которые могут помешать вашим письмам попасть в почтовые ящики."],"Check your network connection and try again.":["Проверьте подключение к сети и попробуйте ещё раз."],"Checkbox":["Чекбокс"],"Checked":["Отмечено"],"Checked fill color":["Цвет заливки отмеченного"],"Checked icon URL":["URL иконки отмеченного"],"Choose":["Выбрать"],"Choose a payment method":["Выберите способ оплаты"],"Choose a plan":["Выбрать тариф"],"Choose allowed protocols":["Выберите разрешенные протоколы"],"Choose block type":["Выберите тип блока"],"Choose complexity rules":["Выберите правила сложности"],"Choose input type":["Выберите тип ввода"],"Choose plan":["Выберите тариф"],"CircleBrush":["Круги"],"Clear":["Очистить"],"Clear all":["Очистить"],"Clear border":["Очистить рамку"],"Clear chat":["Очистить чат"],"Clear chat history?":["Очистить чат?"],"Clear selection":["Очистить выбор"],"Click or drag a block":["Нажмите или перетащите блок"],"Click the Add a new project button to add your first project.":["Нажмите кнопку «Добавить проект», чтобы создать свой первый проект."],"Click to select, paste from the clipboard, or drag and drop":["Перетащите изображения сюда или вставьте из буфера"],"Client ID":["Client ID"],"Client ID copied to clipboard.":["Client ID скопирован."],"Client Secret":["Client Secret"],"Client secret copied to clipboard.":["Client Secret скопирован."],"Client secret rotated successfully.":["Client Secret перевыпущен."],"Clipboard":["Буфер обмена"],"Clone":["Дублировать"],"Clone block":["Клонировать блок"],"Clone element":["Клонировать элемент"],"Clone group":["Клонировать группу"],"Close":["Закрыть"],"Closed field background":["Фон закрытого поля"],"Code":["Код"],"Code Size Warning":["Предупреждение о размере кода"],"Code editor":["Редактор кода"],"Code mode":["Режим кода"],"Code size":["Размер кода"],"Code that will replace the image \`src\`":["Код, который заменит путь к изображению"],"Collapse section":["Свернуть раздел"],"Collection of all HTTP requests used by the plugin (Postman Collection v2.1 format).":["Коллекция всех HTTP-запросов, которые использует плагин (формат Postman Collection v2.1)."],"Color":["Цвет"],"Color of the general text":["Цвет текста"],"Color settings":["Настройки цвета"],"Colors":["Цвета"],"Column":["Колонка"],"Column gap":["Отступ между колонками"],"Columns":["Колонки"],"Come up with a hint":["Придумайте подсказку"],"Coming soon":["В разработке"],"Comment":["Комментарий"],"Comment was removed.":["Комментарий удалён."],"Common blocks":["Общие блоки"],"Company size":["Размер компании"],"Complexity rules":["Правила сложности"],"Configure":["Настроить"],"Configure %s":["Настройка %s"],"Configure integration":["Настроить интеграцию"],"Configure social network link":["Настройка ссылки на соцсеть"],"Confirmation":["Подтверждение"],"Confirmation email has been sent to {confirmedEmail}.":["На адрес {confirmedEmail} отправлено письмо с подтверждением."],"Confirmation email was sent to":["Подтверждение было отправлено на"],"Connect":["Подключить"],"Connect plugin":["Подключить плагин"],"Connected":["Подключено"],"Connection established":["Соединение установлено"],"Connection test failed.":["Не удалось проверить соединение."],"Contact":["Связаться"],"Contact List ID":["ID списка контактов"],"Contact Us":["Связаться с нами"],"Contact person (full name)":["Контактное лицо (полное имя)"],"Contact sync, content personalization, and real-time campaign results tracking.":["Синхронизация контактов, персонализация содержимого и отслеживание результатов кампаний в реальном времени."],"Contacts":["Контакты"],"Contain":["Contain"],"Container":["Контейнер"],"Container width":["Ширина блока"],"Content":["Контент"],"Content styles":["Стили контента"],"Continue":["Продолжить"],"Continue (%d)":["Продолжить (%d)"],"Continue without saving":["Продолжить без сохранения"],"Contract":["Договор"],"Contract / invoice / public offer":["Договор / счёт-фактура / публичная оферта"],"Contract date":["Дата заключения договора"],"Contract number":["Номер договора"],"Contrast block":["Контрастный блок"],"Contrast block header color":["Цвет заголовка контрастного блока"],"Contrast block text color":["Цвет текста контрастного блока"],"Contrasting background color":["Контрастный цвет фона"],"Contrasting colors":["Контрастные цвета"],"Contrasting text color":["Контрастный цвет текста"],"Conversion failed":["Конвертация не удалась"],"Convert":["Конвертировать"],"Convert into an image":["Преобразовать в изображение"],"Converting layout…":["Конвертация шаблона..."],"Copy":["Копировать"],"Copy block to clipboard":["Скопировать блок в буфер обмена"],"Copy client ID":["Скопировать Client ID"],"Copy client secret":["Скопировать Client Secret"],"Copy code":["Скопировать код"],"Copy column":["Скопировать колонку"],"Copy hex":["Копировать HEX"],"Copy to clipboard":["Скопировать в буфер обмена"],"Copywriter":["Писатель"],"Corner radius":["Скругление"],"Corners":["Углы"],"Correspondent account":["Корреспондентский счёт"],"Could not activate the trial. Please try again later or contact support.":["Не удалось активировать пробную версию. Попробуйте позже или обратитесь в службу поддержки."],"Could not move files from old storage":["Не удалось переместить файлы со старого хранилища"],"Could not reach the server. Please try again later.":["Не удалось установить соединение с сервером. Пожалуйста, попробуйте позже."],"Could not save the email":["Не удалось сохранить письмо"],"Couldn\`t determine the email width":["Не удалось определить ширину письма."],"Countdown":["Таймер"],"Countdown font settings":["Шрифт таймера"],"Country selector (flag+code)":["Выбор страны (флаг + код)"],"Cover":["Cover"],"Create":["Создать"],"Create a new email":["Создать письмо"],"Create a password":["Создайте пароль"],"Create email":["Создать письмо"],"Create folder":["Создать папку"],"Create group":["Создать группу"],"Create new block":["Создать новый блок"],"Create new email":["Создать письмо"],"Create project":["Создать проект"],"Creating an email on request":["Создание письма по запросу"],"Creation date":["Дата создания"],"Crop":["Обрезать"],"Cropped Image":["Обрезка картинки"],"Cross":["Крест"],"Current password":["Текущий пароль"],"Custom":["Пользовательский"],"Custom icon":["Пользовательская иконка"],"Customized solutions for large-scale operations with high productivity":["Индивидуальные решения для крупных компаний с высокой производительностью"],"Dark":["Тёмная"],"Dark theme":["Тёмная тема"],"Dash":["Тире"],"Dashed":["Пунктир"],"Date":["Дата"],"Date format":["Формат даты"],"Days":["Дни"],"Deal Annotation":["Аннотация акции"],"Deal Card":["Карточка акции"],"Default or bound value for the field":["Значение по умолчанию или заданное значение для поля"],"Default value":["Значение по умолчанию"],"Delete":["Удалить"],"Delete column":["Удалить колонку"],"Delete from palette":["Удалить из палитры"],"Delete from styles":["Удалить из стилей"],"Delete permanently":["Удалить навсегда"],"Delete this color from the palette?":["Удалить этот цвет из палитры?"],"Delete this font from styles?":["Удалить этот шрифт из стилей?"],"Delete this social network?":["Удалить эту соцсеть?"],"Deleted":["Удалённые"],"Deleted object":["Удаление объекта"],"Describe your project":["Опишите свой проект"],"Description":["Описание"],"Description is used in other sections of the service.":["Описание используется в других разделах сервиса."],"Description must be at most 500 characters.":["Описание не длиннее 500 символов."],"Desktop":["Десктоп"],"Desktop view":["Десктопный вид"],"Details":["Подробнее"],"Developer files":["Файлы для разработчика"],"Diamond":["Ромб"],"DiamondBrush":["Алмаз"],"Didn't receive an email?":["Не получили письмо?"],"Digits (0-9)":["Цифры (0–9)"],"Disable":["Отключить"],"Disable integration":["Отключить интеграцию"],"Disabled":["Отключенный"],"Disconnect Stripo":["Отключить Stripo"],"Discount code":["Промокод"],"Discount description":["Описание скидки"],"Discount description is required":["Нужно описание скидки"],"Discount value":["Размер скидки"],"Discount with promo code: ":["Скидка по промокоду: "],"Discuss":["Обсуждение"],"Display control":["Видимость"],"Display control & Direction":["Видимость и направление"],"Display the minimap.":["Показывать миникарту кода."],"Divider":["Разделитель"],"Do not repeat background (no-repeat)":["Не повторять фон (no-repeat)"],"Domain that serves this folder: it goes into image links in emails":["Домен, который отдаёт эту папку: он попадает в ссылки на изображения в письмах"],"Don't suggest again":["Больше не предлагать"],"Done":["Готово"],"Doodles":["Цветные"],"Dot color":["Цвет точки"],"Dotted":["Точки"],"Double arrow":["Двойная стрелка"],"Double quotation":["Двойная кавычка"],"Download":["Скачать"],"Download as is":["Скачать как есть"],"Draft Name":["Имя черновика"],"Draft campaign created! Open it to review and schedule.":["Проект кампании создан! Откройте его для проверки и планирования."],"Draft successfully created!":["Черновик создан!"],"Drag file here or upload from device":["Перетащите файл сюда или загрузите с устройства"],"Drag to reorder":["Можно перемещать"],"Draw":["Рисунок"],"Drop here":["Вставить сюда"],"Dropdown list":["Выпадающий список"],"Duration":["Длительность"],"During export, the element is converted into an image.":["При экспорте элемент преобразуется в изображение."],"E-Commerce":["Электронная коммерция"],"E-mail":["E-mail"],"Edit":["Редактировать"],"Edit block":["Свойства блока"],"Edit element":["Редактировать элемент"],"Edit group":["Свойства группы"],"Edit icon":["Редактировать иконку"],"Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!":["Редактируйте HTML-версию шаблона письма в режиме кода и наблюдайте за изменениями в реальном времени. В EmailMaker нет ограничений на код: вы можете создавать шаблоны любой сложности!"],"Editing comments":["Редактирование комментариев"],"Education":["Образование"],"Element":["Элемент"],"Elements":["Элементы"],"Email":["Email"],"Email Subject":["Тема письма"],"Email background color":["Цвет фона письма"],"Email builder for your teamwork":["Редактор писем для совместной работы"],"Email confirmation required":["Требуется подтверждение email"],"Email generation":["Генерация писем"],"Email generator":["Генератор Email"],"Email layout width":["Ширина письма"],"Email name":["Название письма"],"Email not yet loaded or global container not found.":["Код письма не загружен или глобальный контейнер не найден."],"Email optimization":["Оптимизация шаблона"],"Email platforms":["Платформы"],"Email successfully copied to clipboard.":["Адрес скопирован в буфер обмена."],"Email successfully created!":["Письмо создано!"],"Email synced with the server":["Email синхронизирован с сервером"],"Email testing":["Тестирование шаблона"],"EmailMaker storage":["Хранилище EmailMaker"],"Emails":["Письма"],"Emails not found":["По данному запросу ничего не найдено."],"Embed images in the file?":["Включить изображения в файл?"],"Emoticons":["Смайлики"],"Empty blocks":["Пустые блоки"],"Enable auto-payment":["Включить автоплатёж"],"Enabled":["Включено"],"End date":["Дата окончания"],"End time":["Время окончания"],"Endpoint":["Адрес хранилища"],"Ends":["Окончание"],"Ends in":["Заканчивается через"],"Enter Altcraft API token":["Введите токен API Altcraft"],"Enter Mailganer API key":["Введите ключ API Mailganer"],"Enter Sendsay API key":["Введите ключ API Sendsay"],"Enter URL":["Введите адрес"],"Enter Unisender API key":["Введите ключ API Unisender"],"Enter a URL starting with http:// or https://":["Адрес должен начинаться с http:// или https://"],"Enter a direct link to a font file (.woff2, .woff, .ttf, .otf) or a Google Fonts stylesheet.":["Укажите прямую ссылку на файл шрифта (.woff2, .woff, .ttf, .otf) или на стили Google Fonts."],"Enter a font name.":["Введите название шрифта."],"Enter a port between 1 and 65535":["Укажите порт от 1 до 65535"],"Enter a valid HEX color (e.g. #1F1F1F).":["Введите корректный HEX-цвет (например, #1F1F1F)."],"Enter a valid HEX color.":["Введите корректный HEX-цвет."],"Enter a valid URL (https://example.com or example.com).":["Введите корректный адрес (https://example.com или example.com)."],"Enter block name":["Укажите название блока"],"Enter color name":["Введите название цвета"],"Enter enKod API key":["Введите ключ API enKod"],"Enter font name":["Введите название шрифта"],"Enter heading":["Введите заголовок"],"Enter link":["Введите ссылку"],"Enter name":["Введите название"],"Enter path":["Введите путь"],"Enter preheader here":["Введите прехедер"],"Enter promo code":["Введите промокод"],"Enter subject line here":["Введите тему письма"],"Enter the access key":["Введите ключ доступа"],"Enter the block name":["Введите название блока"],"Enter the bucket name":["Введите имя бакета"],"Enter the confirmation code from the email and set a new password.":["Введите код подтверждения из письма и установите новый пароль."],"Enter the connection login":["Введите логин для подключения"],"Enter the connection password":["Введите пароль для подключения"],"Enter the email name":["Введите название письма"],"Enter the folder name":["Введите имя папки"],"Enter the group name":["Введите имя группы"],"Enter the project name":["Введите название проекта"],"Enter the secret key":["Введите секретный ключ"],"Enter the server host":["Введите имя хоста"],"Enter the storage endpoint":["Введите адрес хранилища"],"Enter the title of the image":["Введите название изображения"],"Enter value":["Введите значение"],"Enter your contact details":["Укажите свои контакты"],"Enter your current password":["Введите текущий пароль"],"Enter your email":["Укажите ваш email"],"Enter your email address and we will send you password reset instructions.":["Введите свой адрес электронной почты, и мы вышлем вам инструкции по сбросу пароля."],"Enter your first name":["Укажите ваше имя"],"Enter your last name":["Укажите вашу фамилию"],"Enter your new password":["Введите новый пароль"],"Enter your password":["Введите ваш пароль"],"Enter your phone or email":["Введите телефон или email"],"Equalize":["Сравнять"],"Error":["Ошибка"],"Error when initializing file manager":["Ошибка инициализации файлового менеджера"],"Error when receiving data. Try again (reload page) or contact support.":["Ошибка при получении данных. Попробуйте еще раз (перезагрузите страницу) или обратитесь в службу поддержки."],"Errors":["Ошибки"],"Evaluating the task":["Обдумываю задачу"],"Example:":["Например:"],"Expand only one section":["Раскрывать только один раздел"],"Expand section":["Развернуть раздел"],"Expires":["Действует до"],"Export":["Экспорт"],"Export emails as draft campaigns to ActiveCampaign":["Экспорт писем в ActiveCampaign в виде черновиков кампаний"],"Export emails to Altcraft":["Экспорт писем в Altcraft"],"Export emails to Bento":["Экспорт писем в Bento"],"Export emails to Brevo":["Экспорт писем в Brevo"],"Export emails to Campaign Monitor":["Экспорт писем в Campaign Monitor"],"Export emails to Constant Contact":["Экспорт писем в Constant Contact"],"Export emails to Dotdigital":["Экспорт писем в Dotdigital"],"Export emails to GetResponse":["Экспорт писем в GetResponse"],"Export emails to HubSpot":["Экспорт писем в HubSpot"],"Export emails to Klaviyo":["Экспорт писем в Klaviyo"],"Export emails to Mailchimp":["Экспорт писем в Mailchimp"],"Export emails to Mailganer":["Экспорт писем в Mailganer"],"Export emails to Salesforce":["Экспорт писем в Salesforce"],"Export emails to Sendsay":["Экспорт писем в Sendsay"],"Export emails to Unisender":["Экспорт писем в Unisender"],"Export emails to enKod":["Экспорт писем в enKod"],"Export settings":["Настройки экспорта"],"Extend plan":["Продлить тариф"],"Extra limit package":["Расширенный пакет"],"Extra package is not configured for this limit.":["Для этого ограничения дополнительный пакет не настроен."],"Extra packages are only available with CloudPayments at the moment.":["На данный момент дополнительные пакеты доступны только в CloudPayments."],"Eyedropper":["Пипетка"],"Failed to clean trash":["Не удалось очистить корзину"],"Failed to complete Yandex authorization":["Не удалось пройти авторизацию в «Яндексе»"],"Failed to copy.":["Не удалось скопировать."],"Failed to create broadcast":["Не удалось создать выпуск"],"Failed to create campaign":["Не удалось создать кампанию"],"Failed to create draft":["Не удалось создать черновик"],"Failed to create email":["Не удалось создать письмо"],"Failed to create mailing":["Не удалось создать рассылку"],"Failed to create newsletter":["Не удалось создать рассылку"],"Failed to create template":["Не удалось создать шаблон"],"Failed to download file.":["Не удалось скачать файл."],"Failed to download image from URL.":["Не удалось загрузить изображение по URL-адресу."],"Failed to export the email as images. Please try again.":["Не удалось экспортировать письмо в виде изображений. Попробуйте ещё раз."],"Failed to get file: %s":["Не удалось получить файл: %s"],"Failed to load":["Не удалось загрузить"],"Failed to load GIFs":["Не удалось загрузить GIF-файлы"],"Failed to load GIFs through the configured proxy chain.":["Не удалось загрузить GIF-файлы через настроенную цепочку прокси-серверов."],"Failed to load YaSendSuggestToken script":["Не удалось загрузить скрипт YaSendSuggestToken"],"Failed to load Yandex authorization script":["Не удалось загрузить скрипт авторизации Яндекс"],"Failed to load integrations.":["Не удалось загрузить интеграции."],"Failed to load payments.":["Не удалось загрузить платежи."],"Failed to load plugin analytics.":["Не удалось загрузить аналитику плагина."],"Failed to load plugin settings.":["Не удалось загрузить настройки плагина."],"Failed to load plugin usage.":["Не удалось загрузить статистику использования плагина."],"Failed to load project styles.":["Не удалось загрузить стили проекта."],"Failed to load stock images":["Не удалось загрузить стоковые изображения"],"Failed to load stock images through the configured proxy chain.":["Не удалось загрузить стоковые изображения через настроенную цепочку прокси-серверов."],"Failed to load storage settings.":["Не удалось загрузить настройки хранилища."],"Failed to process image URL.":["Не удалось обработать URL-адрес изображения."],"Failed to rotate client secret.":["Не удалось перевыпустить Client Secret."],"Failed to save blocks.":["Не удалось сохранить блоки."],"Failed to save integration settings.":["Не удалось сохранить настройки интеграции."],"Failed to save project settings.":["Не удалось сохранить настройки проекта."],"Failed to save project styles.":["Не удалось сохранить стили проекта."],"Failed to save storage settings.":["Не удалось сохранить настройки хранилища."],"Failed to save the image. Check the file storage settings.":["Не удалось сохранить изображение. Проверьте настройки хранилища файлов."],"Failed to update the global block.":["Не удалось обновить глобальный блок."],"Failed to update the inbox.":["Не удалось обновить папку «Входящие»."],"Features":["Возможности"],"Fewer settings":["Меньше настроек"],"Field heading":["Заголовок поля"],"Field required":["Обязательное поле"],"Field state appearance":["Внешний вид поля"],"File":["Файл"],"File upload failed":["Не удалось загрузить файл"],"Files ready: %s":["Файлы готовы: %s"],"Fill in at least one offer field":["Заполните хотя бы одно поле акции"],"Filter":["Фильтр"],"Filter by type":["Фильтр по типу"],"Finance & Banking":["Финансы и банки"],"First name":["Имя"],"Float block width":["Ширина плавающего блока"],"Folder (Prefix)":["Папка (префикс)"],"Folder name is required":["Имя папки обязательно"],"Folder path":["Путь к папке"],"Folders":["Папки"],"Font":["Шрифт"],"Font Size":["Размер шрифта"],"Font family":["Шрифт"],"Font file":["Файл шрифта"],"Font of the general text":["Шрифта текста"],"Font settings":["Настройки шрифта"],"Font size":["Размер текста"],"Font size of the general text":["Размер текста"],"Fonts":["Шрифты"],"Footers":["Подвалы"],"For basic tasks in business or personal projects":["Для выполнения основных задач в рамках деловых или личных проектов"],"Forgot the password?":["Забыли пароль?"],"Forgot your password?":["Забыли пароль?"],"Form":["Форма"],"Found so far: %s":["Найдено на данный момент: %s"],"Frame":["Рамка"],"Free trial":["Пробная версия"],"From scratch":["С чистого листа"],"Full legal company name":["Полное юридическое название компании"],"GIF":["GIF"],"General settings":["Общие настройки"],"General text":["Текст"],"Generate":["Сгенерировать"],"Generate Email":["Создать письмо"],"Generate image":["Сгенерировать изображение"],"Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.":["С легкостью создавайте потрясающие визуальные эффекты. Мы обучили нашу модель искусственного интеллекта, чтобы обеспечить высочайшее качество изображений."],"Generate with AI":["Генерация с помощью ИИ"],"Generated images":["Генерация картинок"],"Get a discount":["получить со скидкой"],"Get started":["Начать работу"],"Give your users the ability to build beautiful emails without development costs":["Дайте пользователям возможность собирать красивые письма без затрат на разработку"],"Global block":["Глобальный блок"],"Global styles":["Стили письма"],"Gmail annotation was successfully applied to the template code.":["Аннотация Gmail добавлена в код письма."],"Gmail annotations":["аннотаций в Gmail"],"Gmail annotations were removed from the template code.":["Аннотации Gmail удалены из кода письма."],"Go to project settings?":["Перейти в настройки проекта?"],"Go to projects":["Перейти к проектам"],"Google Fonts":["Шрифты Google"],"Got it":["Понятно"],"Gradient":["Градиент"],"Green":["Зелёный"],"Grid":["Сетка"],"Group":["Группа"],"HLineBrush":["Н-образная"],"HTML":["HTML"],"HTML URL is required. Save the email first, or paste a custom URL to your hosted HTML.":["Требуется URL-адрес HTML-страницы. Сначала сохраните письмо или вставьте собственный URL-адрес размещенной у вас HTML-страницы."],"Half year":["Полгода"],"Header":["Заголовок"],"Header text":["Текст заголовка"],"Headers":["Шапки"],"Heading":["Заголовок"],"Heading color":["Цвет заголовка"],"Heading font":["Шрифт заголовка"],"Heading font size":["Размер заголовка"],"Heading letter spacing":["Межбуквенный интервал заголовка"],"Heading line height":["Высота строки заголовка"],"Headings":["Заголовки"],"Headline":["Заголовок"],"Healthcare":["Здравоохранение"],"Height":["Высота"],"Hello":["Привет"],"Help":["Справка"],"Help menu":["Помощь"],"Helper text":["Подсказка"],"Helper text / tooltip":["Подсказка / всплывающая подсказка"],"Hide payment history":["Скрыть историю платежей"],"High contrast mode":["Режим высокой контрастности"],"Hint text":["Подсказка"],"History":["История"],"Horizontal":["Горизонтальный"],"Horizontal alignment":["Горизонтальное выравнивание"],"Horizontal offset":["Гориз. смещение"],"Horizontal padding":["Горизонтальный отступ"],"Horizontal position":["Гориз. смещение"],"Horizontal position of the background image":["Горизонтальное смещение фонового изображения"],"Hospitality & Travel":["Гостиничный бизнес и туризм"],"Host":["Имя хоста"],"Hostname or server IP address":["Имя хоста или IP-адрес сервера"],"How to get an API key?":["Как получить ключ API?"],"Hyperlink URL":["Адрес ссылки"],"I agree to the":["Я согласен с"],"I would like to receive updates from Blocks.":["Я хочу получать новости от Blocks"],"I would like to receive updates from EmailMaker.":["Я хочу получать новости от EmailMaker."],"I'd be happy to create an email for you! ":["Я с удовольствием создам для вас электронное письмо! "],"Icon":["Иконка"],"Icon URL":["URL иконки"],"Icon description":["Описание иконки"],"Identifies search terms. For example: utm_term=running+shoes":["Определяет условия поиска. Например: utm_term=running+shoes"],"Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc":["Определяет, какой тип ссылки использовался, например, цена за клик или электронная почта. Например: utm_medium=cpc"],"If \\"Yes\\", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If \\"No\\", images will be loaded from external links.":["Если «Да», изображения будут включены в сам файл. Это полезно для просмотра без интернета или если внешние изображения заблокированы, но увеличивает размер файла. Если «Нет», изображения будут загружаться по внешним ссылкам."],"If different from the legal address":["Если отличается от юридического адреса"],"If you do not pay, you will be switched to the free plan automatically.":["Если вы не оплатите, вы будете автоматически переведены на бесплатный тарифный план."],"If you have problems connecting the plugin — contact us, our specialists will definitely help you.":["Если возникли сложности с подключением плагина — напишите нам, наши специалисты обязательно помогут."],"If you turn the switch off, lines of code will not wrap. If you turn the switch on, lines of code will wrap at the viewport.":["Если параметр отключен, строки никогда не будут переноситься. Если параметр включен, строки будут переноситься по ширине области просмотра."],"Image":["Картинка"],"Image Center":["Центр изображений"],"Image checks":["Проверка картинок"],"Image editor":["Редактор изображений"],"Image path":["Путь к изображению"],"Image replacer":["Замена картинки"],"Image src":["Картинка"],"Images validation":["Проверка изображений"],"Images validation was successfully completed":["Проверка изображений завершена"],"Import":["Импорт"],"Import email":["Импортировать письмо"],"Import finished":["Импорт завершён"],"Import first %d":["Импортировать первые %d"],"Import from Stripo":["Импорт из Stripo"],"Import problems":["Проблемы импорта"],"Import templates and emails from your Stripo project.":["Импорт шаблонов и писем из вашего проекта Stripo."],"Imported":["Импортировано"],"Imported %1$d of %2$d":["Импортировано %1$d из %2$d"],"Imported: %1$d, failed: %2$d.":["Импортировано: %1$d, не удалось: %2$d."],"Importing from Stripo":["Импорт из Stripo"],"Improves visibility by automatically tuning the form for accessibility. Turn off to restore the previous look.":["Улучшает читаемость за счет автоматической настройки формы с учетом требований доступности. Отключите эту функцию, чтобы вернуть прежний вид."],"Inactive date background color":["Цвет фона неактивной даты"],"Inactive date font":["Шрифт неактивной даты"],"Indent":["Отступ"],"Indent between columns":["Горизонтальный отступ"],"Indent height":["Высота"],"Indent in mobile":["Вертикальный отступ"],"Indexing files…":["Индексация файлов…"],"Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale":["Определяет продвижение конкретного продукта или стратегическую кампанию. Например: utm_campaign=spring_sale"],"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":["Определяет, что именно было нажато, чтобы привести пользователя на сайт, например, рекламный баннер или текстовая ссылка. Он часто используется для A/B-тестирования и рекламы, ориентированной на контент. Например: utm_content=logolink или utm_content=textlink."],"Individual corner radii":["Радиусы отдельных углов"],"Individual padding":["Отдельные отступы"],"Industry":["Отрасль"],"Initial":["Начальный"],"Input":["Поле ввода"],"Input field text":["Текст поля ввода"],"Insert column after":["Вставить столбец справа"],"Insert column before":["Вставить столбец слева"],"Insert row after":["Вставить строку после"],"Insert row before":["Вставить строку перед"],"Insert spaces":["Отступы пробелами"],"Inside":["Внутри"],"Integration settings saved.":["Настройки интеграции сохранены."],"Integrations":["Интеграции"],"Integrations are set up in the project settings. Unsaved changes in the email may be lost.":["Интеграции настраиваются в настройках проекта. Несохранённые изменения в письме могут потеряться."],"Internal padding":["Внутренний отступ"],"Invalid file data":["Неверные данные файла"],"Invite members":["Пригласить участников"],"Invited %s":["Приглашён %s"],"Invoice":["Счёт-фактура"],"Invoice for legal entity":["Счёт для юр. лица"],"Invoice request for a legal entity":["Запрос на выставление счета для юридического лица"],"Is a template":["Шаблон"],"It looks like the email was not created in our service, so the content styles won\`t work. Read more about content styles in the help.":["Похоже, письмо создано не в нашем сервисе, поэтому стили контента работать не будут. Подробнее о стилях содержимого читайте в справке."],"It\`s done!":["Готово!"],"Italic":["Курсив"],"Italic ( Ctrl+I )":["Курсив ( Ctrl+I )"],"Italic ( ⌘I )":["Курсив ( ⌘I )"],"Items to import: %d.":["Элементов к импорту: %d."],"Ivan Ivanov":["Иван Иванов"],"Joined the project":["Присоединился к проекту"],"Just now":["Только что"],"KB":["KB"],"KPP":["КПП"],"KPP must be 9 digits":["КПП должен состоять из 9 цифр"],"LLC \\"Example\\"":["ООО «Пример»"],"Label next to checkbox":["Надпись рядом с чекбоксом"],"Label text style":["Стиль текста подписи"],"Landmarks":["Достопримечательности"],"Landscape":["Горизонтальная"],"Language":["Язык"],"Large emails may have delivery issues and load slowly. We recommend minimizing code before exporting.":["Большие электронные письма могут иметь проблемы с доставкой и медленно загружаться. Мы рекомендуем минимизировать код перед экспортом."],"Last login":["Последний вход"],"Last name":["Фамилия"],"Last update: ":["Обновлено:"],"Layout conversion failed":["Ошибка при преобразовании шаблона"],"Layout converted to Blocks format":["Шаблон преобразован в формат Blocks"],"Layout converted to EmailMaker format":["Шаблон преобразован в формат EmailMaker"],"Learn more about %s":["Подробнее о работе %s"],"Leave":["Уйти"],"Leave your comment":["Оставьте ваш комментарий"],"Left":["Слева"],"Left Code panel":["Панель кода слева"],"Left padding":["Отступ слева"],"Left to right":["Слева направо"],"Legal address":["Юридический адрес"],"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!":["Позвольте нашему помощнику с ИИ улучшить ваше письмо! От создания темы и прехедеров на основе письма до генерации всего письма с учетом особенностей вашего сайта!"],"Letter spacing":["Межбуквенный интервал"],"Light":["Светлая"],"Light theme":["Светлая тема"],"Line break on mobile devices":["Переносить колонки друг под друга"],"Line height":["Высота строки"],"Line height of the general text":["Высота строки текста"],"Line wrap":["Перенос строк"],"Link":["Ссылка"],"Link checks":["Проверка ссылок"],"Link color":["Цвет ссылки"],"Link color in contrasting blocks":["Цвет ссылок в контрастных блоках"],"Link for all slides":["Общая ссылка"],"Link to web version of the font":["Ссылка на веб-версию шрифта"],"Links":["Ссылки"],"Links validation":["Проверка ссылок"],"Links validation was successfully completed":["Проверка ссылок завершена"],"List OL":["Список OL"],"List UL":["Список UL"],"List item appearance":["Внешний вид элемента списка"],"List of projects":["Список проектов"],"List panel background":["Фон панели списка"],"List settings":["Настройки списка"],"List text style":["Стиль текста списка"],"Lists":["Списки"],"Live preview":["Тест в почтовиках"],"Loaded State":["Загрузка состояния"],"Loading Canvas":["Загрузка"],"Loading Image":["Загрузка"],"Loading State":["Загрузка"],"Loading latest changes...":["Загрузка последних изменений..."],"Locally saved version applied":["Применена локально сохраненная версия"],"Lock":["Заблокировать"],"Login for connection":["Логин для подключения"],"Logo must be 2 MB or smaller.":["Логотип должен быть не больше 2 МБ."],"Loop":["Зациклить"],"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.":["С другой стороны, разбавленное изрядной долей эмпатии, рациональное мышление выявляет срочную потребность как самодостаточных, так и внешне зависимых концептуальных решений."],"Lower scores are better. Aim for a score less than ":["Чем ниже балл, тем лучше. Старайтесь набрать как можно меньше."],"Lowercase":["Строчные"],"Lowercase letters (a-z)":["Строчные буквы (a–z)"],"MB":["MB"],"Magenta":["Пурпурный"],"Mailganer":["Mailganer"],"Mailing Name":["Имя рассылки"],"Mailing address":["Почтовый адрес"],"Mailing automation, audience segmentation, and email personalization.":["Автоматизация рассылок, сегментация аудитории и персонализация писем."],"Mailing successfully created!":["Письмо создано!"],"Maintain aspect ratio":["Сохранить соотношение сторон"],"Make columns the same width.":["Сделать колонки одинаковой ширины."],"Managed in billing settings":["Управляется в настройках оплаты"],"Mandatory. Indicates the traffic source. Example: utm_source=google":["Указывает, какой сайт отправил трафик, и является обязательным параметром. Например: utm_source=google"],"Manufacturing":["Производство"],"Margins":["Отступы"],"Markdown":["Markdown"],"Marker shape":["Форма маркера"],"Marketer":["Маркетолог"],"Mass mailing automation, audience segmentation, and campaign performance analytics.":["Автоматизация массовых рассылок, сегментация аудитории и аналитика по кампаниям."],"Max width":["Ширина изображения"],"Maximum 10 tags available.":["Максимум доступно 10 тегов."],"Maximum 64 characters.":["Не длиннее 64 символов."],"Maximum length":["Максимальная длина"],"Maximum width":["Макс. ширина"],"Maximum {0} colors in the palette.":["В палитре не больше {0} цветов."],"Maximum {0} fonts in the project.":["В проекте не больше {0} шрифтов."],"Maximum {0} social networks.":["Не больше {0} соцсетей."],"Media & Marketing":["Медиа и маркетинг"],"Members":["Участники"],"Menus":["Меню"],"Merchant homepage URL":["Ссылка на сайт магазина"],"Merge":["Объединение"],"Merge bottom cell":["Объединить нижнюю ячейку"],"Merge left cell":["Объединить левую ячейку"],"Merge right cell":["Объединить правую ячейку"],"Merge tags":["Переменные"],"Merge top cell":["Объединить верхнюю ячейку"],"Merge with the chosen block":["Объединить с выделенным блоком"],"Merged Objects":["Объединение объектов"],"Message when validation fails":["Сообщение в случае сбоя проверки"],"Minimap":["Миникарта"],"Minimize code":["Минимизировать код"],"Minimum length 8 characters":["Минимальная длина — 8 символов"],"Minimum width":["Мин. ширина"],"Minus":["Минус"],"Mobile":["На мобильном"],"Mobile L – 425px":["Смартфон L – 425px"],"Mobile M – 375px":["Смартфон M – 375px"],"Mobile S – 320px":["Смартфон S – 320px"],"Mobile view":["Мобильный вид"],"Month":["Месяц"],"More editing features":["Больше возможностей редактирования"],"More options":["Больше настроек"],"More settings":["Больше настроек"],"Move %1$d block to folder “%2$s”?":["Переместить %1$d блок в папку «%2$s»?","Переместить %1$d блока в папку «%2$s»?","Переместить %1$d блоков в папку «%2$s»?"],"Move %1$d template to folder “%2$s”?":["Переместить %1$d шаблон в папку «%2$s»?","Переместить %1$d шаблона в папку «%2$s»?","Переместить %1$d шаблонов в папку «%2$s»?"],"Move block “%1$s” to folder “%2$s”?":["Переместить блок «%1$s» в папку «%2$s»?"],"Move down":["Переместить вниз"],"Move stopped":["Перемещение остановлено"],"Move template “%1$s” to folder “%2$s”?":["Переместить шаблон «%1$s» в папку «%2$s»?"],"Move up":["Переместить вверх"],"Moving files from old storage…":["Перенос файлов со старого хранилища…"],"Multi-channel campaigns automation (email, SMS, push, WhatsApp, and more).":["Автоматизация мультиканальных кампаний (email, SMS, push, WhatsApp и другие)."],"Name":["Имя"],"Name must be at most 64 characters.":["Название не длиннее 64 символов."],"Need more?":["Нужно больше?"],"New Text":["Новая надпись"],"New block title":["Название нового блока"],"New blocks":["Новые блоки"],"New email title":["Новое письмо"],"New emails":["Новые письма"],"New file name is required":["Требуется новое имя файла"],"New folder":["Новая папка"],"New folder name is required":["Требуется название новой папки"],"New password":["Новый пароль"],"New project":["Новый проект"],"Newest first":["Сначала новые"],"Newsletter Subscription":["Подписка на новости"],"Newsletter successfully created!":["Рассылка успешно создана!"],"No":["Нет"],"No access to edit the letter.":["Нет доступа к редактированию письма."],"No analytics data for the selected period.":["За выбранный период данных нет."],"No brand colors yet":["Пока нет цветов бренда"],"No card required: we ask for no payment or personal details.":["Карту привязывать не нужно: ни платёжных, ни персональных данных мы не спросим."],"No emails match the search.":["По запросу не найдено ни одного письма."],"No history records available.":["Записи истории отсутствуют."],"No images found.":["Нет изображений."],"No internet connection":["Нет подключения к Интернету"],"No links found.":["Нет ссылок."],"No logo":["Без логотипа"],"No mailing address found. Add one in ActiveCampaign: ":["Почтовый адрес не найден. Добавьте его в ActiveCampaign: "],"No name":["Без названия"],"No one found":["Никого не нашлось"],"No payments yet.":["Платежей пока нет."],"No problems found.":["Проблем не найдено."],"No project fonts yet":["Пока нет шрифтов проекта"],"No projects match the search.":["По запросу не найдено ни одного проекта."],"No properties to edit.":["Нет свойств для редактирования."],"No related blocks found.":["У этого письма нет привязанных шаблонов."],"No social networks yet":["Пока нет соцсетей"],"Non-profit":["Некоммерческая организация"],"None":["Нет"],"Not available for the current payment settings":["Недоступно при текущих настройках оплаты"],"Not available in this context":["Недоступно в данном контексте"],"Not connected":["Не подключено"],"Not defined":["Не определено"],"Not found in Stripo":["Не найдено в Stripo"],"Not imported":["Не импортировано"],"Not now":["Не сейчас"],"Not set":["Не указано"],"Nothing found in Stripo":["В Stripo ничего не найдено"],"Now":["Сейчас"],"Now create an email":["Теперь создайте письмо"],"OGRN / PSRN":["ОГРН / ПСРН"],"OGRN/PSRN must be 13 or 15 digits":["ОГРН / ПСРН должно состоять из 13 или 15 цифр"],"Objects":["Объект"],"Offer page URL":["Ссылка на страницу акции"],"Offer page or merchant homepage link starting with https:// is required":["Нужна ссылка на страницу акции или на сайт магазина, начинающаяся с https://"],"Ok. I'll be waiting":["Хорошо. Я подожду"],"Okay. I'll log in.":["Хорошо, я авторизуюсь."],"Oldest first":["Сначала старые"],"On request":["По запросу"],"On the left":["Слева"],"On the right":["Справа"],"Onboarding":["Тур по редактору"],"Only a-z, 0-9, hyphen, dot":["Только a-z, 0-9, дефис, точка"],"Oops! Something went wrong":["Ой! Что-то пошло не так"],"Opacity":["Прозрачность"],"Open draft campaign":["Открыть черновик кампании "],"Open in Bento":["Открыть в Bento"],"Open in Brevo":["Открыть в Brevo"],"Open in Campaign Monitor":["Открыть в Campaign Monitor"],"Open in Constant Contact":["Открыть в Constant Contact"],"Open in Dotdigital":["Открыть в Dotdigital"],"Open in GetResponse":["Открыть в GetResponse"],"Open in HubSpot":["Открыть в HubSpot"],"Open in Klaviyo":["Открыть в Klaviyo"],"Open in Mailchimp":["Открыть в Mailchimp"],"Open in Mailganer":["Открыть в Mailganer"],"Open in Marketing Cloud":["Открыть в Marketing Cloud"],"Open in Sendsay":["Открыть в Sendsay"],"Open in Unisender":["Открыть в Unisender"],"Open in enKod":["Открыть в enKod"],"Optimize":["Оптимизация"],"Optional fields":["Необязательные поля"],"Orange":["Оранжевый"],"Ordered list":["Нумерованный список"],"Organization logo":["Логотип компании"],"Other":["Другое"],"Others":["Другие"],"Outline":["Контур"],"Outline Color":["Цвет контура"],"Outlook":["Outlook"],"Outside":["Снаружи"],"PDF":["PDF"],"PJSC Sberbank":["ПАО «Сбербанк»"],"PNG":["PNG"],"Padding":["Внутренний отступ"],"Paid until: ":["Оплачен до: "],"Palette":["Палитра"],"Password":["Пароль"],"Password for connection":["Пароль для подключения"],"Paste block from clipboard":["Вставить блок из буфера обмена"],"Paste image URL here":["Вставьте URL изображения"],"Pay":["Оплата"],"Payment":["Оплата"],"Payment basis":["Условия оплаты"],"Payment history":["История платежей"],"Payment was successful. Limits will update in a few seconds.":["Оплата прошла успешно. Лимиты обновятся через несколько секунд."],"Payment was successful. New AI generations are now available.":["Оплата прошла успешно. Теперь доступны новые генерации с помощью ИИ."],"Payment was successful. Your plan features are now available.":["Оплата прошла успешно. Теперь вы можете пользоваться всеми возможностями вашего тарифного плана."],"PencilBrush":["Карандаш"],"Phone":["Телефон"],"Phone must be 3 to 40 characters and contain digits and separators only.":["Телефон — от 3 до 40 символов, только цифры и разделители."],"Phone number":["Телефон"],"Phone or email":["Телефон или email"],"Pick a color.":["Выберите цвет."],"Picture":["Изображение"],"Placeholder":["Плейсхолдер"],"Placeholder text":["Текст плейсхолдера"],"Plain text":["Простой текст"],"Plan":["Тариф"],"Plan usage statistics":["Статистика использования тарифа"],"Play button":["Кнопка воспроизведения"],"Please accept the agreement":["Пожалуйста, примите соглашение"],"Please add a comment to your request":["Введите комментарий к запросу"],"Please choose":["Пожалуйста, выберите"],"Please choose block type":["Пожалуйста, выберите тип блока"],"Please choose the block type":["Пожалуйста, укажите тип блока"],"Please complete payment on the Billing page.":["Пожалуйста, произведите оплату на странице «Тарифы и оплата»."],"Please complete the captcha":["Пожалуйста, пройдите капчу"],"Please complete the captcha to continue.":["Пожалуйста, пройдите капчу, чтобы продолжить."],"Please enter a URL.":["Пожалуйста, введите адрес."],"Please enter a color name.":["Пожалуйста, введите название цвета."],"Please enter a name.":["Пожалуйста, введите название."],"Please enter a valid email address.":["Введите действительный адрес электронной почты."],"Please enter a valid email.":["Пожалуйста, введите корректный email."],"Please enter the URL.":["Пожалуйста, введите адрес"],"Please enter the block name":["Введите название блока"],"Please enter the correct URL.":["Пожалуйста, введите правильный адрес."],"Please enter the correct email address.":["Пожалуйста, введите корректный адрес почты."],"Please enter the correct email.":["Пожалуйста, введите корректную эл. почту"],"Please enter the description":["Введите описание"],"Please enter the email name":["Введите имя письма"],"Please enter the folder name":["Введите имя папки "],"Please enter the group name":["Введите название группы"],"Please enter the project name":["Пожалуйста, введите название проекта"],"Please enter valid email":["Введите действительный адрес электронной почты"],"Please enter your email address":["Пожалуйста, укажите свой адрес эл. почты"],"Please enter your password":["Пожалуйста, введите свой пароль"],"Please input block name":["Пожалуйста укажите название блока"],"Please input container width":["Пожалуйста, укажите ширину блока"],"Please input tags!":["Пожалуйста, введите теги!"],"Please input type!":["Пожалуйста, введите тип!"],"Please log in":["Необходим вход в систему"],"Please select":["Пожалуйста, выберите"],"Please set the 'Type' field in the Settings section.":["Пожалуйста, заполните поле «Тип» в настройках блока."],"Please set the background color":["Пожалуйста, установите цвет фона"],"Please set the font color":["Установите цвет текста"],"Please type correct emails":["Пожалуйста, введите верные адреса получателей"],"Please type emails":["Пожалуйста, введите адреса получателей"],"Please type subject":["Укажите тему письма"],"Please type the project name.":["Пожалуйста, укажите название проекта."],"Please type the webhook URL.":["Пожалуйста, введите адрес вебхука."],"Please type your email address.":["Пожалуйста, укажите свой адрес электронной почты."],"Please type your password confirmation code.":["Пожалуйста, укажите код подтверждения."],"Please type your password.":["Пожалуйста, введите свой пароль."],"Please upgrade your plan.":["Пожалуйста, обновите тарифный план.\\n"],"Please upload a JPG, PNG, or WebP image.":["Загрузите изображение в формате JPG, PNG или WebP."],"Plugin":["Плагин"],"Plugin connected":["Плагин подключён"],"Plugin connection request":["Заявка на подключение плагина"],"Plugin is not connected":["Плагин не подключён"],"Plus":["Плюс"],"Pointer":["Треугольник"],"Polls":["Опросы"],"Port":["Порт"],"Portrait":["Вертикальная"],"Position in cell":["Положение в ячейке"],"Prefer spaces over tabs.":["Делать табуляцию пробелами."],"Prefix path inside the bucket for project files":["Префикс — путь внутри бакета для файлов проекта"],"Preheader":["Прехедер"],"Preheader copied to email settings":["Прехедер скопирован в настройки письма"],"Preparing countdown preview…":["Готовим превью таймера..."],"Preparing video preview…":["Готовим превью видео..."],"Preview":["Предпросмотр"],"Preview mode":["Предпросмотр"],"Price":["Цена"],"Price currency":["Валюта"],"Price currency must be a three-letter ISO 4217 code, for example USD":["Валюта указывается трёхбуквенным кодом ISO 4217, например USD"],"Privacy Policy.":["Политикой конфиденциальности."],"Processing Image":["Загрузка"],"Product carousel":["Карусель товаров"],"Profile":["Профиль"],"Project":["Проект"],"Project files are stored on the built-in Blocks CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN Blocks. Дополнительно настраивать подключение не нужно."],"Project files are stored on the built-in EmailMaker CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN EmailMaker. Дополнительно настраивать подключение не нужно."],"Project information":["Информация о проекте"],"Project name":["Название проекта"],"Project name must be at most 100 characters.":["Название проекта не длиннее 100 символов."],"Project not found.":["Проект не найден."],"Project settings":["Настройки проекта"],"Project styles":["Стили проекта"],"Project styles saved.":["Стили проекта сохранены."],"Project switched to the built-in storage.":["Проект переключён на встроенное хранилище."],"Projects":["Проекты"],"Promo code applied.":["Промокод применен."],"Promocodes":["Промокоды"],"Promotion cards":["Промокарточки"],"Proofreader":["Корректор "],"Psychologist":["Психолог"],"Public URL":["Публичный адрес"],"Public access key":["Публичный ключ доступа"],"Public offer":["Публичная оферта"],"Purple":["Фиолетовый"],"Push block update to all templates":["Применить обновление блока ко всем шаблонам"],"Quality":["Качество"],"Quarter":["Квартал"],"Radio button":["Радиокнопка"],"Radius":["Радиус"],"Ready-made HTML template for testing the plugin locally.":["Готовый HTML-шаблон, чтобы проверить плагин локально."],"Real Estate":["Недвижимость"],"Real-time notifications about email-related events.":["Уведомления о событиях с письмами в реальном времени."],"Receipt":["Чек"],"Recipients":["Получатели"],"Recommended":["Рекомендуемые"],"Recover":["Восстановить"],"Recover password":["Восстановить пароль"],"Recurring payments disabled":["Автоплатёж отключён"],"Recurring payments enabled":["Автоплатёж включён"],"Red":["Красный"],"Redo (Ctrl+Shift+Z)":["Повторить (Ctrl+Shift+Z)"],"Refresh":["Обновить"],"Refresh inbox":["Обновить почтовый ящик"],"Reload page":["Перезагрузить страницу"],"Remaining:":["Осталось:"],"Remember me":["Запомнить меня"],"Remove":["Удалить"],"Remove annotations":["Удалить аннотации"],"Remove block":["Удалить блок"],"Remove column":["Удалить столбец"],"Remove element":["Удалить элемент"],"Remove element by Delete Key":["Удалить элемент (Delete)"],"Remove file":["Удалить файл"],"Remove group":["Удалить группу"],"Remove logo":["Удалить логотип"],"Remove member":["Удалить участника"],"Remove row":["Удалить строку"],"Remove slide":["Удалить слайд"],"Rename":["Переименовать"],"Rename block":["Переименовать блок"],"Rename email":["Переименовать письмо"],"Reorder block":["Переместить блок"],"Reorder element":["Переместить элемент"],"Reorder group":["Переместить группу"],"Repeat background (repeat)":["Повторять фон (repeat)"],"Repeat background horizontally (repeat-x)":["Горизонтальное повторение фона (repeat-x)"],"Repeat background vertically (repeat-y)":["Вертикальное повторение фона (repeat-y)"],"Repeat the new password":["Повторите новый пароль"],"Replace Image":["Заменить изображение"],"Replace the preheader":["Вставить в прехедер письма"],"Replace the title":["Вставить в заголовок письма"],"Replaced Background Image":["Удаление фонового изображения"],"Reply":["Ответить"],"Reply to the comment":["Ответить на комментарий"],"Request for changing the pricing plan":["Запрос на смену тарифа"],"Request sent successfully.":["Запрос отправлен."],"Requests JSON":["JSON с запросами"],"Required field":["Обязательное поле"],"Resend":["Отправить повторно"],"Resize":["Размер"],"Resized Image":["Изменение размера"],"Responsive email":["Адаптировать письмо в моб. устройствах"],"Restore %1$d block to folder “%2$s”?":["Восстановить %1$d блок в папку «%2$s»?","Восстановить %1$d блока в папку «%2$s»?","Восстановить %1$d блоков в папку «%2$s»?"],"Restore %1$d template to folder “%2$s”?":["Восстановить %1$d шаблон в папку «%2$s»?","Восстановить %1$d шаблона в папку «%2$s»?","Восстановить %1$d шаблонов в папку «%2$s»?"],"Restore block “%1$s” to folder “%2$s”?":["Восстановить блок «%1$s» в папку «%2$s»?"],"Restore template “%1$s” to folder “%2$s”?":["Восстановить шаблон «%1$s» в папку «%2$s»?"],"Resume":["Резюме"],"Retail & E-commerce":["Розница и e-commerce"],"Retry":["Повторить"],"Retry failed":["Повторить неудавшиеся"],"Reverse order on desktop":["Изменить порядок в десктопе"],"Revoke the invite":["Отозвать приглашение"],"Right":["Справа"],"Right Code panel":["Панель кода справа"],"Right padding":["Отступ справа"],"Right to left":["Справа налево"],"Role":["Роль"],"Rotate":["Перевыпустить"],"Rotate client secret?":["Перевыпустить Client Secret?"],"Rotate secret":["Перевыпустить секрет"],"Round":["Круглый"],"Rounded Corner":["Загругление углов"],"Rounded corners in Outlook (VML)":["Закругленные углы в Outlook (VML)"],"SMS":["СМС"],"Safe Fonts":["Безопасные шрифты"],"Sandbox HTML file":["HTML-файл песочницы"],"Sans Serif":["Sans Serif"],"Save":["Сохранить"],"Save %d block":["Сохранить %d блок","Сохранить %d блока","Сохранить %d блоков"],"Save all blocks":["Сохранить все блоки"],"Save and continue":["Сохранить и продолжить"],"Save block":["Сохранить блок"],"Save by Ctrl+S":["Ctrl+S"],"Save by ⌘S":["Сохранить ( ⌘S )"],"Save email first.":["Сначала сохраните письмо."],"Save the block before commenting.":["Сохраните блок перед комментированием."],"Save the email before commenting.":["Сохраните письмо перед комментированием."],"Save to Blocks":["Сохранить в Блоки"],"Save to Blocks button.":["Сохранить в Блоки"],"Saved blocks":["Сохранённые блоки"],"Saving changes in the block":["Сохранение изменений в блоке"],"Search":["Поиск"],"Search GIFs":["Поиск GIF"],"Search a block":["Найти блок"],"Search by name":["Поиск по названию"],"Search by title":["Поиск по названию"],"Search image":["Поиск изображения"],"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.":["В обширной галерее стоковых фотографий и GIF-файлов вы найдете изображения для любого случая. Вы можете отфильтровать результаты по ориентации изображения, цветовой гамме и т. д."],"Secret Access Key":["Секретный ключ доступа"],"Secret access key":["Секретный ключ доступа"],"Secret is masked. Use Rotate to get a new secret once.":["Секрет скрыт. Нажмите «Перевыпустить», чтобы один раз увидеть новый."],"Section":["Раздел"],"Section ":["Раздел"],"Section title":["Заголовок раздела"],"Security":["Безопасность"],"Select a font family":["Выберите шрифт"],"Select a theme":["Выберите тему"],"Select all %d":["Выбрать все: %d"],"Select company size":["Выберите размер компании"],"Select email template":["Выберите шаблон письма"],"Select industry":["Выберите отрасль"],"Select period":["Выберите период"],"Select plan":["Выбрать тариф"],"Select the block type to find any block on the list faster.":["Выберите тип блока, чтобы быстрее найти любой блок в списке."],"Select the time zone":["Выберите часовой пояс"],"Selected %1$d, your plan allows %2$d more emails.":["Выбрано: %1$d, по тарифу можно создать ещё писем: %2$d."],"Send":["Отправить"],"Send a test email":["Отправить тест"],"Send again":["Повторить"],"Sender Email":["Email отправителя"],"Sender Name":["Имя отправителя"],"Sendsay":["Sendsay"],"Separators":["Разделители"],"Serif":["Serif"],"Server is unavailable":["Сервер недоступен"],"Set":["Установить"],"Set new password":["Установить новый пароль"],"Set the type":["Укажите тип"],"Settings":["Настройки"],"Shadow":["Тень"],"Shadow Color":["Цвет тени"],"Shadow inside or outside of the element":["Если включено, то тень будет внутри элемента."],"Shapes":["Фигуры"],"Share":["Поделиться"],"Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.":["Поделитесь проектом со своей командой и сотрудничайте в режиме реального времени. Добавляйте комментарии к отдельным блокам писем и обсуждайте необходимые правки прямо в конструкторе."],"Short company name":["Краткое название компании"],"Show eye icon":["Показать иконку глаза"],"Show more":["Показать ещё"],"Shuffle options":["Параметры перемешивания"],"Sign In":["Войти"],"Sign Up":["Зарегистрироваться"],"Sign in to your account to activate the trial period.":["Войдите в свою учетную запись, чтобы активировать пробный период."],"Sign in with eLama":["Войти через eLama"],"Sign out":["Выйти"],"Single image preview":["Одно изображение"],"Single quotation":["Кавычка"],"Site":["Сайт"],"Size":["Размер"],"Small desktop – 768px":["Небольшой десктоп – 768px"],"Social buttons":["Кнопки соцсетей"],"Social media":["Соцсети"],"Social network name":["Название соцсети"],"Social network settings":["Настройки соцсети"],"Social networks":["Соцсети"],"Solid":["Сплошная"],"Some blocks were not saved successfully.":["Некоторые блоки не были сохранены."],"Some images were left as links to Stripo":["Часть картинок осталась ссылками на Stripo"],"Something went wrong":["Ошибка редактирования. Обратитесь в техподдержку."],"Something went wrong during layout conversion. You can try running the conversion again.":["При конвертации шаблона произошла ошибка. Вы можете повторить конвертацию."],"Something went wrong, please try again":["Что-то пошло не так. Попробуйте ещё раз."],"Something went wrong.":["Что-то пошло не так."],"Something went wrong. Try again later.":["Что-то пошло не так. Попробуйте позже."],"Soon":["Скоро"],"Sorry, the page you visited does not exist.":["Извините, страница, которую вы посетили, не существует."],"Source code validation":["Проверка кода"],"Spacer":["Отступ"],"Spacing":["Интервал"],"Spam checks":["Проверка на спам"],"Spam validation was successfully completed":["Проверка на спам завершена"],"SpamAssassin":["SpamAssassin"],"Special characters":["Специальные символы"],"Specifies the block width.":["Задаёт ширину блока."],"Split blocks":["Разделить блоки"],"Split cell":["Разделить ячейку"],"SprayBrush":["Спрей"],"Spread radius":["Распространение"],"Square":["Квадрат"],"SquareBrush":["Квадрат"],"Squarish":["Квадратная"],"Star":["Звезда"],"Start Trial":["Начать Триал"],"Start date":["Дата начала"],"Start from scratch":["Начать с чистого листа"],"Start the trial":["Включить пробный период"],"Start typing the title":["Начните писать название"],"Start with a detailed description of your email.":["Начните с подробного описания вашего письма."],"Starts":["Начало"],"Status":["Статус"],"Stay":["Остаться"],"Stickers":["Стикеры"],"Stock":["Фотосток"],"Stock photos and GIFs":["Стоковые изображения"],"Stopping…":["Остановка…"],"Storage settings":["Настройки хранилища"],"Storage type":["Тип хранилища"],"Stored or bound value for this field":["Сохраненное или заданное значение для этого поля"],"Stored or bound value for this option":["Сохраненное или заданное значение для этого параметра"],"Strikethrough ( Alt+Shift+5 )":["Зачёркнутый ( Alt+Shift+5 )"],"Strikethrough ( ⌘+Shift+X )":["Зачёркнутый ( ⌘+Shift+X )"],"Stripo API key":["API-ключ Stripo"],"Stripo did not accept this key. Check that it is the REST API key of your Stripo project.":["Stripo не принял этот ключ. Проверьте, что это ключ REST API вашего проекта Stripo."],"Stripo did not respond":["Stripo не ответил"],"Stripo is not responding. Try again later.":["Stripo не отвечает. Попробуйте позже."],"Stripo stopped accepting the API key. Update the key and repeat the import.":["Stripo перестал принимать API-ключ. Обновите ключ и повторите импорт."],"Stripo templates become project templates, emails become emails. Folders are recreated, images are copied to the project storage. Items already imported are skipped when you select all.":["Шаблоны Stripo станут шаблонами проекта, письма — письмами. Папки будут воссозданы, картинки скопированы в хранилище проекта. При выборе всех уже импортированные элементы пропускаются."],"Stroke color":["Цвет контура"],"Strong":["Полужирный"],"Strong ( Ctrl+B )":["Полужирный ( Ctrl+B )"],"Strong ( ⌘B )":["Полужирный ( ⌘B )"],"Subject":["Тема"],"Subject line & preheader generator":["Генератор темы и прехедера"],"Subscription ID is missing":["Отсутствует идентификатор подписки"],"Subscription summary":["Сведения о подписке"],"Success":["Готово"],"Success!":["Готово!"],"Supported formats: .woff, .woff2, .ttf, .otf. Maximum file size is 5 MB.":["Поддерживаемые форматы: .woff, .woff2, .ttf, .otf. Файл не больше 5 МБ."],"Supported: .woff, .woff2, .ttf, .otf — up to {0} MB.":["Поддерживаются .woff, .woff2, .ttf, .otf — до {0} МБ."],"Swap columns":["Поменять местами"],"Switch to a different plan to save more emails.":["Перейдите на другой тариф, чтобы иметь возможность сохранять новые шаблоны."],"Syncing with the server in the background...":["Происходит синхронизация с сервером в фоновом режиме..."],"System":["Системная"],"System theme":["Системная тема"],"TIN (INN)":["ИНН"],"TIN (INN) must be 10 or 12 digits":["ИНН должен состоять из 10 или 12 цифр"],"Tab size":["Величина отступа"],"Table":["Таблица"],"Table view":["Таблица"],"Table width":["Ширина таблицы"],"Tags":["Теги"],"Tags help you find the block in the list.":["Теги помогают найти блок в списке."],"Tariff and payment":["Тариф и оплата"],"Teal":["Бирюзовый"],"Team collaboration":["Командная работа"],"Technical support":["Техническая поддержка"],"Technology & Software":["Технологии и ПО"],"Template":[" Шаблон"],"Template Name":["Название шаблона"],"Template blocks":["Блоки шаблона"],"Template conversion":["Конвертация шаблона"],"Template from another editor":["Шаблон из другого редактора"],"Template is not mobile-friendly":["Шаблон может некорректно отображаться в телефоне"],"Template successfully created!":["Шаблон создан!"],"Templates":["Шаблоны"],"Terms":["Условиями использования"],"Test sends":["Тесты отображения"],"Text":["Текст"],"Text & background":["Текст и фон"],"Text align center":["Текст по центру"],"Text align center ( Ctrl+Shift+E )":["По центру ( Ctrl+Shift+E )"],"Text align center ( ⌘+Shift+E )":["По центру ( ⌘+Shift+E )"],"Text align justify":["Текст по ширине"],"Text align justify ( Ctrl+Shift+J )":["По ширине ( Ctrl+Shift+J )"],"Text align justify ( ⌘+Shift+J )":["По ширине ( ⌘+Shift+J )"],"Text align left":["Текст слева"],"Text align left ( Ctrl+Shift+L )":["По левому краю ( Ctrl+Shift+L )"],"Text align left ( ⌘+Shift+L )":["По левому краю ( ⌘+Shift+L )"],"Text align right":["Текст справа"],"Text align right ( Ctrl+Shift+R )":["По правому краю ( Ctrl+Shift+R )"],"Text align right ( ⌘+Shift+R )":["По правому краю ( ⌘+Shift+R )"],"Text background":["Фон текста"],"Text beside the box":["Текст рядом с полем"],"Text color":["Цвет текста"],"Text copied to clipboard":["Скопировано в буфер обмена"],"Text font":["Шрифт текста"],"Text replacer":["Замена текста"],"Text size":["Размер текста"],"Text subscript":["Подстрочный текст"],"Text superscript":["Надстрочный текст"],"Text visible at the start":["Текст, отображаемый в начале"],"Texture":["Текстура"],"That\`s all we could find.":["Это все, что мы смогли найти."],"The ":[" "],"The Pro plan is not available.":["Тариф «Pro» недоступен."],"The URL that the hyperlink directs to.":["URL, на который указывает ссылка."],"The account number must be 20 digits":["Номер счета должен состоять из 20 цифр"],"The align attribute sets the horizontal alignment of the table.":["Атрибут align устанавливает горизонтальное выравнивание таблицы."],"The block \\"":["Блок «"],"The block was successfully renamed.":["Блок переименован."],"The block was successfully saved.":["Блок сохранен."],"The block will change its colors to contrasting colors. You can change them in the Content Styles section.":["Блок изменит свои цвета на контрастные. Вы можете изменить их в разделе «Стили контента»."],"The block “":["Блок «"],"The captcha is invalid or expired. Please try again.":["Капча неверна или срок её действия истек. Пожалуйста, попробуйте ещё раз."],"The code size exceeds the recommended value 90kB":["Размер кода превышает рекомендуемое значение 90 кБ."],"The code that will replace this text":["Код, который заменит этот текст"],"The copies were successfully created.":["Копии созданы."],"The copy of block “":["Копия блока «"],"The copy of email \\"":["Копия письма \\""],"The current code size is":["Текущий размер кода составляет"],"The current template will be changed to the generated one, are you sure about this?":["Текущий шаблон будет заменен на сгенерированный, вы уверены в этом?"],"The draft of the block has been deleted.":["Черновик блока удалён."],"The draft of the email has been deleted.":["Черновик письма удалён."],"The email \\"":["Письмо \\""],"The email has been copied to the clipboard.":["Код письма скопирован в буфер обмена."],"The email limit of your plan has been reached.":["Лимит писем вашего тарифа исчерпан."],"The email was successfully renamed.":["Письмо переименованно."],"The email was successfully saved.":["Письмо сохранено."],"The email “":["Письмо «"],"The feature is under development.":["Функционал находится в разработке."],"The folder \\"":["Папка «"],"The folder “":["Папка «"],"The font-size CSS property sets the size of the font.":["Свойство font-size устанавливает размер шрифта."],"The global block was updated.":["Глобальный блок был обновлён."],"The group “":["Группа «"],"The image could not be uploaded.":["Не удалось загрузить изображение."],"The image was successfully uploaded.":["Изображение загружено."],"The import failed. Try again later.":["Импорт не удался. Попробуйте позже."],"The inbox has been updated.":["Почтовый ящик обновлён."],"The invitation has been sent":["Приглашение отправлено"],"The maximum number of requests for the current subscription period has been reached.\\nSelect the appropriate plan to fulfil more requests":["Максимальное количество запросов для текущего периода подписки достигнуто.\\nВыберите соответствующий тариф для выполнения большего количества запросов."],"The password does not meet the requirements:":["Пароль не соответствует требованиям безопасности:"],"The password is too simple.":["Слишком простой пароль."],"The payment widget failed to load. Refresh the page and try again.":["Не удалось загрузить виджет оплаты. Обновите страницу и попробуйте ещё раз."],"The previous secret will stop working immediately.":["Прежний секрет перестанет работать сразу."],"The project \\"":["Проект «"],"The saved key no longer works. Enter a new one.":["Сохранённый ключ больше не работает. Введите новый."],"The selected element is in the block that supports a multicolumn structure. To add a new column, click the \\"Add a column\\" button.":["Выделенный элемент находится в блоке, в котором можно организовать многоколоночную структуру. Для добавления новой колонки нажмите кнопку «Добавить колонку»."],"The server returned an unexpected response. Please try again or contact support.":["Сервер вернул неожиданный ответ. Попробуйте ещё раз или обратитесь в службу поддержки."],"The specified parameters will be added to all links when exporting the email.":["Специальные параметры будут добавлены во все ссылки при экспорте."],"The test email will be sent to the specified addresses.":["Тестовое письмо будет отправлено на указанные адреса."],"The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it.":["Название отображается в списке шаблонов и зачастую совпадает с темой письма, но вы можете его изменить."],"The trash is empty.":["Корзина пуста."],"The trial has ended. You are on the Free plan.":["Пробный период закончился. Вы пользуетесь тарифом «Free»."],"The two passwords that you entered do not match!":["Два введенных вами пароля не совпадают!"],"The usage limit has been exceeded":["Превышен лимит использования"],"The whole email":["Всё письмо"],"Theme":["Тема"],"There are no blocks for this request.":["По данному запросу ничего не найдено."],"There are no members yet":["Участников пока нет"],"There's no such comment.":["Нет такого комментария."],"There's no such element in the email.":["В письме нет такой метки."],"These global blocks have a newer saved version. Select the ones to update in the template.":["Для этих глобальных блоков имеется более новая сохраненная версия. Выберите в шаблоне те из них, которые необходимо обновить."],"This action cannot be undone.":["Это действие нельзя отменить."],"This and other features are available for you on a higher plan.":["Эти и другие функции доступны для вас на более старшем тарифном плане."],"This can be the name of your company, department, website, project, marketing campaign, or other activity.":["Это может быть название вашей компании, отдела, веб-сайта, проекта или сферы деятельности, для которой вы планируете создать рассылку."],"This element":["Этот элемент"],"This email must be verified in Mailganer":["Адрес необходимо подтвердить в Mailganer"],"This email must be verified in Sendsay":["Адрес необходимо подтвердить в Sendsay"],"This email must be verified in Unisender":["Адрес необходимо подтвердить в Unisender"],"This field is required":["Это обязательное поле"],"This field sets the width of the email.":["Это поле выставляет ширину письма."],"This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.":["Это глобальный блок. Вы можете создать новый блок, чтобы изменения вступили в силу только в этом письме, или обновить текущий — в этом случае изменения будут применены везде, где используется этот блок."],"This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.":["Этот шаблон не был создан в нашем редакторе. Преобразуйте его, чтобы получить доступ ко всем возможностям редактирования: легко изменяйте тексты, заменяйте изображения и управляйте блоками."],"This link cannot be used as a font source.":["Эту ссылку нельзя использовать как источник шрифта."],"This may take several minutes. Please keep this tab open.":["Это может занять несколько минут. Пожалуйста, не закрывайте эту вкладку."],"This promo code is already applied.":["Промокод уже применен."],"This section will be implemented in a separate task.":["Раздел пока в разработке."],"This template was created in another editor. Rebuild it from our components to get stable rendering, error-free editing, and full design control.":["Этот шаблон создан в другом редакторе. Пересоберите его из наших компонентов и получите стабильное отображение, редактирование без ошибок и полный контроль над дизайном."],"Time":["Время"],"Time units font settings":["Шрифт единиц времени"],"Time zone":["Часовой пояс"],"Title":["Название"],"Title copied to email settings":["Заголовок скопирован в настройки письма"],"Title should not be empty":["Заголовок не должен быть пустым"],"Title shown above the control":["Название, отображаемое над элементом управления"],"To add a block from the dashboard click the":["Чтобы добавить блок, нажмите в визуальном редакторе письма кнопку"],"To avoid this issue, disable translation for this site in your browser settings or turn off auto-translate.":["Чтобы избежать этой проблемы, отключите перевод данного сайта в настройках браузера или отключите функцию автоматического перевода."],"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.":["Для изменения внешнего вида элемента в мобильном устройстве, внесите правки в поля ниже. Если поле пустое, то в мобильной версии применятся стили для десктопа."],"To create a copy, you need to save the block.":["Чтобы создать копию, вы должны сохранить блок."],"To create a copy, you need to save the email.":["Чтобы создать копию, вы должны сохранить письмо."],"To emails":["В письма"],"To fully address all necessary tasks in any field":["Чтобы в полной мере решить все необходимые задачи в любой области"],"To get started quickly":["Чтобы быстро приступить к работе"],"To import from Stripo, add the REST API key of your Stripo project: <1>open the project settings in Stripo</1>, find “Access the REST API” and generate a key.":["Чтобы импортировать из Stripo, добавьте ключ REST API вашего проекта Stripo: <1>откройте настройки проекта в Stripo</1>, найдите «Access the REST API» и сгенерируйте ключ."],"To leave comments you must be logged into Blocks and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To leave comments you must be logged into EmailMaker and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To preview and edit the uploaded image":["Предварительный просмотр и редактирование загруженного изображения"],"To send a test email, you need to confirm your email address. If you haven’t received the confirmation link, contact support in the chat or email {supportEmail}.":["Чтобы отправить тестовое письмо, вам необходимо подтвердить свой адрес электронной почты. Если вы не получили ссылку для подтверждения, обратитесь в службу поддержки через чат или по электронной почте {supportEmail}."],"Today":["Сегодня"],"Too many items selected. One import takes up to 1000 items.":["Выбрано слишком много. Один импорт берёт до 1000 элементов."],"Tooltip or hint text":["Всплывающая подсказка или текст подсказки"],"Tooltip text":["Текст всплывающей подсказки"],"Top":["Сверху"],"Top left corner":["Верхний левый угол"],"Top margin":["Отступ сверху"],"Top padding":["Отступ сверху"],"Top right corner":["Верхний правый угол"],"Top up balance":["Пополнить баланс"],"Transfer to folder":["Переместить"],"Translator":["Переводчик"],"Transparency":["Прозрачность"],"Transportation":["Транспорт"],"Trial":["Триал"],"Trial activated":["Пробная версия активирована"],"Trial active":["Пробная версия активна"],"Trial period activated.":["Пробный период активирован."],"Try again":["Попробовать ещё раз"],"Try every editor feature — free":["Попробуйте все возможности редактора — бесплатно"],"Try for free":["Попробуйте бесплатно"],"Try reloading the page.":["Попробуйте перезагрузить страницу."],"Try sign in with your new password.":["Попробуйте войти с новым паролем."],"Turn on a 14-day trial and the whole editor opens up:":["Включим пробный период на 14 дней — и редактор откроется целиком:"],"Type":["Тип"],"Type category here":["Укажите категорию"],"Type in the project's webhook":["Введите проект webHook"],"Type subject":["Укажите тему письма"],"Type the output parameters of your platform. E.g., ":["Указывайте символы вывода параметра вашей платформы. Например, "],"Type title here":["Введите название"],"Type your description here":["Введите описание"],"Type your request":["Введите ваш запрос"],"Type your tags here":["Укажите теги"],"Typing...":["Ввод текста..."],"Typograf":["Типограф"],"Typography":["Типограф"],"URL":["URL"],"URL must start with https://":["Адрес должен начинаться с https://"],"URL of the video clip.":["URL-адрес видеоклипа."],"USD":["USD"],"UTM parameters":["UTM-метки"],"Unavailable":["Недоступно"],"Underline":["Подчёркнутый"],"Underline ( Ctrl+U )":["Подчёркнутый ( Ctrl+U )"],"Underline ( ⌘U )":["Подчёркнутый ( ⌘U )"],"Undo (Ctrl+Z)":["Отменить (Ctrl+Z)"],"Unisender":["Unisender"],"Unknown error":["Неизвестная ошибка"],"Unknown integration":["Неизвестная интеграция"],"Unlimited possibilities with the PRO plan":["Безграничные возможности с тарифом PRO"],"Unlock":["Разблокировать"],"Unordered list":["Ненумерованный список"],"Unsaved changes":["Несохранённые изменения"],"Up to parent element":["Перейти к контейнеру"],"Update":["Обновить"],"Update current block":["Обновить текущий блок"],"Update date":["Дата обновления"],"Update global blocks":["Обновить глобальные блоки"],"Updated":["Обновлено"],"Upload":["Загрузить"],"Upload .woff, .woff2, .ttf or .otf files for use in the email editor.":["Загрузите файлы .woff, .woff2, .ttf или .otf, чтобы использовать их в редакторе писем."],"Upload Image":["Загрузить изображение"],"Upload failed":["Загрузка не удалась"],"Upload first font":["Загрузить первый шрифт"],"Upload font":["Загрузить шрифт"],"Upload logo":["Загрузить логотип"],"Upload your email":["Загрузить своё письмо"],"Uppercase":["Заглавные"],"Uppercase letters (A-Z)":["Заглавные буквы (A–Z)"],"Usage analytics":["Аналитика использования"],"Use custom icon for checked state":["Использовать пользовательскую иконку для отмеченного состояния"],"Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.":["Используйте наш визуальный редактор, чтобы настроить каждый элемент под свои нужды: изменить рамки и их радиус, тени, отступы, фон и многое другое."],"Use this email as a template for creating future emails.":["Используйте это письмо в качестве шаблона для создания будущих писем."],"Use this one":["Использовать эту"],"Use your own styles instead of defaults for states such as error, focus, and success.":["Используйте собственные стили вместо стандартных для таких состояний, как «ошибка», «фокус» и «успех»."],"Used":["Используемые"],"User":["Пользователь"],"Username":["Логин"],"VAT":["НДС"],"VLineBrush":["V-образная"],"Valid":["Верно"],"Valid until":["Оплачен до"],"Validation error message":["Сообщение об ошибке проверки"],"Value":["Значение"],"Variable value":["Значение переменной"],"Version history":["Контроль версий"],"Version of":["Версия от"],"Vertical":["Вертикальный"],"Vertical alignment":["Верт. выравнивание"],"Vertical offset":["Верт. смещение"],"Vertical padding":["Вертикальный отступ"],"Vertical position":["Верт. смещение"],"Vertical position of the background image":["Вертикальное смещение фонового изображения"],"Video":["Видео"],"Video URL":["URL-адрес видео"],"View only — you cannot edit settings in this section.":["Только просмотр — настройки в этом разделе менять нельзя."],"Vimeo":["Vimeo"],"Visibility":["Видимость"],"Visibility in AMP":["Видимость в AMP"],"Visit site":["Перейти на сайт"],"Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.":["Хотите изменить размер изображения, добавить текст или применить фильтр? Не нужно покидать EmailMaker! Все основные изменения вы можете сделать в нашем редакторе изображений."],"Warning":["Предупреждение"],"Warnings":["Предупреждения"],"We are always in touch":["Мы всегда на связи"],"We removed the injected code automatically. To avoid this issue, disable the extension for this site or use the editor in an incognito window without extensions.":["Мы автоматически удалили внедренный код. Чтобы избежать этой проблемы, отключите расширение для этого сайта или воспользуйтесь редактором в окне инкогнито без расширений."],"Web version":["Веб-версия"],"Webhook":["WebHook"],"Webhook URL":["Вебхук"],"Webhook settings":["Настройки вебхука"],"Webhook successfully sent!":["WebHook отправлен!"],"Website link":["Ссылка на сайт"],"Week":["Неделя"],"What's new":["Что нового"],"When the trial ends, the service switches to the free plan.":["Когда триал закончится, сервис перейдёт в бесплатный режим."],"When the trial ends, you will return to the Free plan.":["По окончании пробного периода вы вернётесь к тарифу «Free»."],"When you need more letters, additional projects and participants":["Если вам понадобится больше писем, дополнительных проектов и участников"],"While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices.":["Похоже, при редактировании шаблона, некоторые элементы перестали помещаться в экран мобильного устройства. Попробуйте уменьшить их ширину."],"White":["Белый"],"White circle":["Белый круг"],"White circle outlined":["Белый круг обводка"],"Width":["Ширина"],"With VAT":["С НДС"],"With VAT / without VAT":["С НДС / без НДС"],"With warnings":["С предупреждениями"],"Without VAT":["Без НДС"],"Without background color":["Без цвета фона"],"Without background image":["Без фоновой картинки"],"Without button":["Без кнопки"],"Without folder":["Без папки"],"Without shadow":["Без тени"],"Work with the HTML code":["Работа с HTML-кодом"],"Work with your markup":["Работайте со своей вёрсткой"],"Year":["Год"],"Yes":["Да"],"You are buying a set of AI generation requests:":["Вы приобретаете набор запросов на генерацию с помощью ИИ:"],"You are buying an extra email generation package:":["Вы приобретаете дополнительный пакет для создания писем:"],"You are buying an extra image check package:":["Вы приобретаете дополнительный пакет проверки изображений:"],"You are buying an extra image generation package:":["Вы приобретаете дополнительный пакет для генерации изображений:"],"You are buying an extra link check package:":["Вы приобретаете дополнительный пакет проверки ссылок:"],"You are buying an extra optimization package:":["Вы приобретаете дополнительный пакет оптимизации:"],"You are buying an extra preview/test sends package:":["Вы приобретаете дополнительный пакет тестов:"],"You are buying an extra spam check package:":["Вы приобретаете дополнительный пакет проверки на спам:"],"You are paying for the plan:":["Вы оплачиваете тарифный план:"],"You are running out of AI tool usage.":["Ваш лимит использования инструментов ИИ подходит к концу."],"You can activate a 2-week trial version that includes access to all features.":["Вы можете активировать 2-недельную пробную версию, которая включает доступ ко всем функциям."],"You can add more generations right now; they are billed separately from the generations included in your plan.":["Вы можете добавить дополнительные генерации прямо сейчас; их стоимость оплачивается отдельно от генераций, включенных в ваш тарифный план."],"You can also save all blocks at once. The AI assistant will automatically determine the type and create a name for each block when saving.":["Вы также можете сохранить все блоки сразу. ИИ ассистент автоматически определит тип и создаст имя для каждого блока при сохранении."],"You can close this window: the import continues in the background.":["Окно можно закрыть: импорт продолжится в фоне."],"You can get more emails and access to all features.":["Вы сможете создавать больше писем и получить доступ ко всем функциям."],"You can increase the limit by changing your plan or buying an extra package.":["Вы можете увеличить лимит, сменив тарифный план."],"You can increase the number of emails right now.":["Вы можете увеличить количество писем прямо сейчас."],"You can save blocks from the email template.":["Вы можете сохранить блоки из шаблона письма."],"You cannot switch plans because a limit has been exceeded.":["Вы не можете сменить тарифный план, так как превышен лимит."],"You changed the role of ":["Вы поменяли роль "],"You deleted ":["Вы исключили пользователя "],"You deleted yourself from the project successfully.":["Вы исключили себя из проекта."],"You do not have permission to edit project styles.":["У вас нет прав на редактирование стилей проекта."],"You do not have permission to view this section.":["У вас нет прав на просмотр этого раздела."],"You don't have any blocks in this folder.":["У вас нет блоков в этой папке."],"You don't have any blocks yet.":["У вас еще нет сохранённых блоков."],"You don't have any emails in this folder.":["В папке пока нет писем."],"You don't have any emails yet.":["У вас еще нет сохранённых писем."],"You don't have any projects yet.":["У вас пока нет проектов."],"You don\`t have any saved blocks yet.":["У вас ещё нет сохранённых блоков."],"You have reached the limit of AI chat usage.":["Вы достигли предела использования чата ИИ.\\n"],"You have reached the limit of AI generator usage.":["Вы достигли предела использования генератора ИИ.\\n"],"You have unsaved changes. Leave this page without saving?":["У вас есть несохранённые изменения. Покинуть страницу без сохранения?"],"You have used up the number of emails you can create on your current plan":["Вы исчерпали лимит на количество писем, которое можно создать в рамках вашего текущего тарифа"],"You have used up your AI generations":["Вы исчерпали лимит генераций ИИ"],"You have used up your image check limit":["Вы исчерпали лимит проверки изображений"],"You have used up your image generation limit":["Вы исчерпали лимит на генерацию изображений"],"You have used up your link check limit":["Вы исчерпали лимит проверок ссылок"],"You have used up your optimisation limit":["Вы исчерпали лимит оптимизаций"],"You have used up your preview (test send) limit":["Вы исчерпали лимит на просмотр в почтовиках"],"You have used up your spam check limit":["Вы исчерпали лимит проверок на спам"],"You reached the plan limit":["Достигнут лимит тарифа"],"You revoke invite for ":["Вы отзываете приглашение для "],"Your Altcraft Platform URL (Cloud: ru.altkraft.com or your On-Premises URL)":["URL вашей платформы Altcraft (облачная версия: ru.altkraft.com или URL вашей локальной версии)"],"Your Sendsay account login (not email). For sublogin use format: account/sublogin":["Ваш логин в Sendsay (не email). Для ввода дополнительного логина используйте формат: account/sublogin"],"Your company":["Ваша компания"],"Your current plan":["Ваш текущий тариф"],"Your email doesn't look like spam.":["Ваше письмо не похоже на спам."],"Your generations are running out soon":["Генерации с помощью ИИ скоро закончатся"],"Your letter contains %d block that can be saved for future use.":["Ваше письмо содержит %d блок, который можно сохранить для использования в будущем.","Ваше письмо содержит %d блока, которые можно сохранить для использования в будущем.","Ваше письмо содержит %d блоков, которые можно сохранить для использования в будущем."],"Your package is activated":["Пакет активирован"],"Your password successfully reset.":["Ваш пароль успешно сброшен."],"Your password was successfully changed.":["Ваш пароль успешно изменен."],"Your plan is activated":["Тариф активирован"],"Your plan will expire soon":["Ваш тариф скоро закончится"],"Your profile was successfully updated.":["Настройки сохранены."],"Your project has incoming email":["У вашего проекта есть входящая почта"],"Your templates and emails":["Ваши шаблоны и письма"],"Youtube Black":["Youtube Чёрный"],"Youtube Red":["Youtube Красный"],"Youtube White":["Youtube Белый"],"Z-A":["Я-А"],"ZIP":["ZIP-архив"],"accordion":["аккордеон"],"and":["и"],"before %s":["до %s"],"block":["Блок","",""],"block\\u0004\\" was successfully removed.":["» удалён."],"block\\u0004Are you sure to delete selected blocks?":["Вы уверены, что хотите удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete selected blocks?":["Вы уверены, что хотите безвозвратно удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete the “":["Вы уверены, что хотите удалить «"],"block\\u0004Are you sure you want to delete the “":["Вы уверены, что хотите удалить блок «"],"block\\u0004locked.":["заблокирован."],"block\\u0004unlocked.":["разблокирован."],"block\\u0004” was successfully created.":["» создана."],"block\\u0004” was successfully removed.":["» удалён."],"border\\u0004Width":["Толщина"],"button":["кнопка"],"carousel":["карусель"],"cell":["ячейка"],"column":["колонка"],"confirmation code":["код подтверждения"],"container":["контейнер"],"copy\\u0004\\" was successfully created.":["» создана."],"corners":["углы"],"countdown":["таймер"],"cpc":["cpc"],"day":["день","дня","дней"],"e.g., 123456":["Например, 123456"],"e.g., Newsletter June 2026":["Например, дайджест за июнь"],"e.g., Special offer for you!":["Например: Специальное предложение!"],"e.g., Your Company":["Например, Ваша компания"],"e.g., https://ru.altkraft.com":["Например, https://ru.altkraft.com"],"e.g., myaccount or myaccount/sublogin":["Например, myaccount или myaccount/sublogin"],"element":["элемент"],"email":["эл. почта"],"email\\u0004\\" was successfully removed.":["\\" удалено."],"email\\u0004Are you sure to delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to delete selected emails?":["Вы уверены, что хотите удалить выбранные письма?"],"email\\u0004Are you sure to irrevocably delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to irrevocably delete selected emails?":["Вы уверены, что хотите безвозвратно удалить выбранные письма?"],"email\\u0004locked.":["заблокировано."],"email\\u0004unlocked.":["разблокировано."],"empty link":["пустая ссылка"],"empty src":["нет картинки"],"enKod":["enKod"],"expanded":["Раскрыт"],"filter":["фильтр"],"folder\\u0004\\" was successfully created.":["» создана."],"folder\\u0004Are you sure to delete “":["Вы уверены, что хотите удалить папку «"],"folder\\u0004” was successfully changed to “":["» переименована в «"],"google":["google"],"group":["группа"],"group\\u0004All":["Все"],"group\\u0004Are you sure to delete “":["Вы уверенны, что хотите удалить группу «"],"group\\u0004Project":["Проектные"],"group\\u0004Standard":["Стандартные"],"group\\u0004” was successfully changed to “":["» переименована в «"],"height":["высота"],"hour":["час","часа","часов"],"https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png":["https://emcdn.ru/384263/241017_18_K3O0sad.png"],"https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png":["https://emcdn.ru/644755/241021_5149_MtX8mBz.png"],"https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png":["https://emcdn.ru/384263/241017_18_fsshqsL.png"],"https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png":["https://emcdn.ru/384263/241017_18_I98a6kp.png"],"https://cdn.useblocks.io/1351/241017_18_NDYloAO.png":["https://emcdn.ru/384263/241017_18_QFBYtv0.png"],"https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png":["https://emcdn.ru/384263/241017_18_HFSbGb5.png"],"https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png":["https://emcdn.ru/384263/241017_18_Uu6iuFF.png"],"https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png":["https://emcdn.ru/384263/241017_18_lkaw2P4.png"],"https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png":["https://emcdn.ru/384263/241017_18_ykdbX19.png"],"https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png":["https://emcdn.ru/384263/241017_18_HMNSbZd.png"],"https://cdn.useblocks.io/1351/241031_18_JoH0f3E.png":["https://emcdn.ru/719787/241031_976_jyIsWjj.png"],"https://cdn.useblocks.io/1351/241031_18_OQEyMEF.png":["https://emcdn.ru/719787/241031_976_lgYswn9.png"],"https://cdn.useblocks.io/1351/241031_18_aJAY1Xz.png":["https://emcdn.ru/719787/241031_976_XfDnnmK.png"],"images":["Изображения"],"indent":["отступ"],"kB":["kB"],"letter\\u0004Email":["Письмо"],"letter\\u0004email":["Письмо"],"link":["ссылка"],"loading more":["загрузить ещё"],"mail generator":["генератор писем"],"main heading":["основной заголовок"],"max 10":["максимум 10"],"member\\u0004 to ":[" на "],"member\\u0004Administrator":["Администратор"],"member\\u0004Invited":["Приглашённый"],"member\\u0004Owner":["Владелец"],"messeges":["сообщения"],"minute":["минута","минуты","минут"],"ms":["мс"],"new password":["новый пароль"],"not valid":["не верно"],"of":["из"],"or":["или"],"password":["пароль"],"picture":["изображение"],"project\\u0004 across all your projects?":[" во всех ваших проектах?"],"project\\u0004 from project ":[" из проекта "],"project\\u0004 in project ":["в проекте"],"project\\u0004Actions":["Действия"],"project\\u0004Add members":["Добавить участников"],"project\\u0004Are you sure you want to change permissions for user ":["Вы уверены, что хотите изменить права доступа для пользователя "],"project\\u0004Are you sure you want to invite user ":["Вы уверены, что хотите пригласить этого пользователя "],"project\\u0004Are you sure you want to remove user ":["Вы уверены, что хотите удалить пользователя "],"project\\u0004Are you sure you want to revoke the invitation for ":["Вы уверены, что хотите отозвать приглашение для "],"project\\u0004Change in all projects":["Изменить во всех проектах"],"project\\u0004Confirm":["Подтвердить"],"project\\u0004Could not load the project list":["Не удалось загрузить список проектов"],"project\\u0004Could not undo exclusion":["Не удалось отменить исключение"],"project\\u0004Delete":["Удалить"],"project\\u0004Delete project":["Удалить проект"],"project\\u0004Edit member list":["Изменить список участников"],"project\\u0004Email address":["Email"],"project\\u0004Exclude":["Удалить"],"project\\u0004Failed to send invitation":["Не удалось отправить приглашение"],"project\\u0004Failed to send invitations":["Не удалось отправить приглашения"],"project\\u0004Failed to update permissions":["Не удалось обновить права доступа"],"project\\u0004In all projects":["Во всех проектах"],"project\\u0004Invite":["Пригласить"],"project\\u0004Invite participants":["Пригласить участников"],"project\\u0004Invite to all projects":["Пригласить во все проекты"],"project\\u0004Name":["Имя"],"project\\u0004No matching memberships to update in your other projects":["В других ваших проектах нет подходящих участников для обновления"],"project\\u0004Permissions updated":["Права доступа обновлены"],"project\\u0004Project participants":["Участники проекта"],"project\\u0004Project settings":["Настройки проекта"],"project\\u0004Remove from project":["Удалить из проекта"],"project\\u0004Revoke":["Отозвать"],"project\\u0004Revoke invite":["Отозвать приглашение"],"project\\u0004Role in project":["Роль в проекте"],"project\\u0004The invitation was restored":["Приглашение было восстановлено"],"project\\u0004The invitation was sent to all your projects":["Приглашение было отправлено во все ваши проекты"],"project\\u0004The invitation was sent to some of your projects":["Приглашение было отправлено некоторым из ваших проектов"],"project\\u0004The participant was restored to the project":["Участник был восстановлен в проекте"],"project\\u0004Undo":["Отменить"],"project\\u0004You":["Вы"],"project\\u0004You are not the owner of any project":["Вы не являетесь владельцем какого-либо проекта"],"project\\u0004You excluded user ":["Вы заблокировали пользователя "],"recovery\\u0004\\" was successfully recovered.":["» восстановлен."],"recovery\\u0004” was successfully deleted.":["» удалено."],"recovery\\u0004” was successfully recovered.":["» завершено."],"resize":["размер"],"running+shoes":["running+shoes"],"s":["с"],"secure":["безопасно"],"selected":["выбрано"],"selling blue":["продающий синий"],"sender@example.com":["sender@example.com"],"spring_sale":["spring_sale"],"square":["квадрат"],"tab\\u0004AI assistant":["AI Ассистент"],"tab\\u0004Build":["Контент"],"tab\\u0004Calendar":["Календарь"],"tab\\u0004Checkbox":["Чекбокс"],"tab\\u0004Discuss":["Обсуждение"],"tab\\u0004Dropdown list":["Выпадающий список"],"tab\\u0004Input":["Поле ввода"],"tab\\u0004Optimize":["Оптимизация"],"tab\\u0004Radio button":["Радиокнопка"],"tab\\u0004Settings":["Настройки"],"tab\\u0004Styles":["Стили"],"table":["таблица"],"test":["тест","теста","тестов"],"text":["текст"],"textlink":["textlink"],"time to load":["время загрузки"],"total size":["общий размер"],"user":["Пользователь"],"utm_campaign":["utm_campaign"],"utm_content":["utm_content"],"utm_medium":["utm_medium"],"utm_source":["utm_source"],"utm_term":["utm_term"],"variable":["переменная"],"verb\\u0004Import":["Импортировать"],"video":["видео"],"was successfully":[" успешно"],"was used":["был использован","было использовано","было использовано"],"which exceeds the recommended 90 KB limit.":["что превышает рекомендуемый предел в 90 КБ."],"width":["ширина"],"–":["–"],"—":["—"],"“":["«"],"”":["»"],"” block?":["»?"],"” folder?":["»?"],"” group and all nested groups?":["» вместе со всеми вложениями?"],"” was successfully created.":["» создан."],"” was successfully imported.":["» импортировано."],"” was successfully sent.":["» отправлено."],"”.":["»."],"🎉 Welcome! Pro plan is activated":["🎉 Привет! Тариф Pro активирован"]}`)};function ib(e){if(!zs)return;const{id:t,catalog:n,time:r,hash:i}=zs;e.getInstance(o.LOCALE_SERVICE_ID)?.prime(t,n,{time:r,hash:i})}function Gs(e,t,n){let r=!1;const i=e.watch(a=>{r||!t(a)||(r=!0,n())});r&&i.dispose()}function ab(e,t){const n=e.getInstance(g.CONFIG_SOURCE_ID);n&&Gs(n,r=>!!r?.codeEnabled||!!r?.codeSideEnabled,()=>{cb(e,()=>{db(e,()=>{lb(e,()=>{Ht(e).whenVisible(()=>{Xt(()=>{sb(t).catch(()=>{})})})})})})})}async function sb(e){await e()}function lb(e,t){const n=e.getInstance(Fa);if(!n){Xt(t);return}const r=()=>{if(n.pipeline.filledGeneration()!==void 0){t();return}Xt(r)};Xt(r)}function cb(e,t){const n=e.getInstance(o.EMAIL_DOCUMENTS_ID);if(!n)return;if(n.current()){t();return}let r=!1;const i=n.subscribe(()=>{r||!n.current()||(r=!0,t())});r&&i()}function db(e,t){const n=e.getInstance(g.OPTIONS_SOURCE_ID);n&&Gs(n,r=>!!r?.element,t)}function ub(e){ab(e,cu)}var Ws=g.createIdentifier$1("NotificationService");function Hs(e,t="success"){return typeof e=="string"&&(e={message:e}),o.filterUndefined({type:e.type||t,data:e.data,innerException:e.innerException,title:e.message,description:e.description,actions:e.btn,onClose:e.onClose,duration:e.duration,icon:e.icon,placement:e.placement,style:e.style,closeIcon:e.closeIcon,props:e.props,role:e.role})}var mb="bottomRight";function Hr(e,t){return typeof e=="string"||typeof e=="object"?Hs(e,t):e}var pb=class extends g.Disposable{send;onNotify;onError;onSuccess;constructor(e,t,n){super(),this.send=n,this.onNotify=Ct(t,c=>c,c=>Hr(c)),this.onError=Ct(g.filter(t,c=>c.type==="error"),c=>c,c=>Hr(c,"error")),this.onSuccess=Ct(g.filter(t,c=>c.type==="success"),c=>c,c=>Hr(c));const r=this.addDisposable(new kt(this.onNotify)),i=this.addDisposable(new kt(this.onError)),a=this.addDisposable(new kt(this.onSuccess));this.addDisposable(e.watch(({handleNotify:c,handleError:d,handleSuccess:u})=>{r.setListener(c),i.setListener(d),a.setListener(u)}))}notify(e){this.send({placement:mb,...Hs(e)})}};function fb(e){e.injectFactory(Ws,()=>{const t=new pb(e.getInstance(g.OPTIONS_SOURCE_ID),g.getEvent(e,g.events.ON_NOTIFICATION),n=>{o.executeCommand(e,o.NOTIFY_COMMAND_ID,n)});return e.getInstance(g.DISPOSABLE_ID)?.addDisposable(t),t},!0)}function hb(e){const t=o.getEmailDocuments(e),n=i=>{e.getInstance(g.STORE_ID)?.dispatch(o.taxonomiesApi.util.invalidateTags([{type:"folder",id:i}]))},r=t.onSaved(i=>{i.created&&n("folder")});e.getInstance(g.DISPOSABLE_ID)?.addDispose(r)}function R0(e){return e}var gb=[{name:"rest.legacySections",provides:[g.REST_CLIENT_ID],setup:g.provideLegacyRestSections},{name:"canvas.resizer",provides:[Di],setup:J_},{name:"canvas.sandboxLocale",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:Z_},{name:"locale.brandCatalog",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:ib},{name:"email.restPorts",provides:[o.REST_EMAIL_PORTS_ID],setup:W_},{name:"block.historyPort",setup:V_},{name:"email.templatePrefetch",setup:tb},{name:"locale.antd",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:rb},{name:"save.listsFollow",setup:hb},{name:"monaco.prewarm",awaits:{services:[g.CONFIG_SOURCE_ID]},setup:ub},{name:"notifications",provides:[Ws],setup:fb},{name:"email.operations",setup:I_}],yb=g.defineMixin(e=>{for(const t of O_(gb))t.setup(e);return{instance:A_(e)}}),_b=g.combineMixins([yb,Fy,p_,__,x_,P_,Uh,f_,za,Ga]);async function bb(e){const t=new Map;typeof e=="object"&&(e=e.code);const{amp2html:n,html2amp:r}=await(0,Ve.__vitePreload)(async()=>{const{amp2html:c,html2amp:d}=await Promise.resolve().then(()=>_e("./static/core/f0fb869f.js"));return{amp2html:c,html2amp:d}},void 0,{}.url),i=await _t.changeHtml(e,async c=>{await _t.replaceImagesInDocument(c.document,d=>o.mapper.getEscapedText(d)!==d?d:o.toAbsoluteUrl(d),t);for(const d of c.document.querySelectorAll(".em-amp-show-disabled"))d.remove();c.handleRender(async({contentDocument:d,managedNodeController:u})=>{await r(d,{mappedTags:{script:"___script"},commit:()=>u.commit()})})},[800]),a=await _t.changeHtml(e,async c=>{await _t.replaceImagesInDocument(c.document,d=>o.mapper.getEscapedText(d)!==d?d:o.toAbsoluteUrl(d),t);for(const d of c.document.querySelectorAll(".em-amp-show-only"))d.remove();await n(c.document,{mappedTags:{script:"___script"}})},[800]);return{code:e,html:a,ampHtml:i}}async function vb(){const{installDiagnostics:e}=await(0,Ve.__vitePreload)(async()=>{const{installDiagnostics:t}=await Promise.resolve().then(()=>_e("./static/core/ebeee027.js"));return{installDiagnostics:t}},void 0,{}.url);return e()}async function Eb(e,t){const{initDevTools:n}=await(0,Ve.__vitePreload)(async()=>{const{initDevTools:r}=await Promise.resolve().then(()=>_e("./static/core/28631044.js"));return{initDevTools:r}},void 0,{}.url);n(e,t)}var Sb="1.1.85-dev.3";nn.asyncMixins=_b,nn.initDevTools=Eb,nn.installDiagnostics=vb,nn.parseAMP=bb,nn.version=Sb});
|
|
857
|
+
</tr>`)}},fn=async()=>{const M=re();at(M,async q=>{try{const Q=document.querySelector(".email-preview"),oe=getComputedStyle(Q),ne=await x(q,[oe.width],e.utm_parameters,async He=>{rt(He)}),W=await te({htmlContent:ne,notification:E}).unwrap(),Ce=window.URL.createObjectURL(new Blob([W],{type:"application/pdf"})),ye=document.createElement("a");ye.href=Ce,ye.setAttribute("download",`${qe()}.pdf`),document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),window.URL.revokeObjectURL(Ce)}catch{}})},Lt=M=>{const q=re();at(q,Q=>{ve({event:"click",action:"export_email",export_type:"HTML"});const oe=document.querySelector(".email-preview"),ne=getComputedStyle(oe);x(Q,[ne.width],e.utm_parameters,async W=>{await Be(W),rt(W),await o.processAmp(W,M)}).then(W=>{const Ce=new Blob([W],{type:"text/html;charset=utf-8"});(0,an.saveAs)(Ce,`${qe()}.html`)}).catch(W=>{})},!0)},ct=M=>{const q=re();at(q,Q=>{ve({event:"click",action:"export_email",export_type:"TEXT"});const oe=document.querySelector(".email-preview"),ne=getComputedStyle(oe);x(Q,[ne.width],e.utm_parameters,async W=>{await Be(W),rt(W),await o.processAmp(W,M);const[{htmlToText:Ce},{EmailTextPlainConvertOptions:ye}]=await Promise.all([(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/4598405b.js")),void 0,{}.url),(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/9a285b6a.js")),void 0,{}.url)]);W.handleReadHtml(He=>{He.html=Ce(He.contentDocument,ye)})}).then(W=>{const Ce=new Blob([W],{type:"text/plain;charset=utf-8"});(0,an.saveAs)(Ce,`${qe()}.txt`)}).catch(W=>{})})},Et=()=>{const M=re();at(M,q=>{ve({event:"click",action:"export_email",export_type:"MARKDOWN"});const Q=document.querySelector(".email-preview"),oe=getComputedStyle(Q),{utm_parameters:ne}=e;x(q,[oe.width],ne,async W=>{rt(W),await o.processAmp(W,"html");const{htmlToMarkdown:Ce}=await(0,Ve.__vitePreload)(async()=>{const{htmlToMarkdown:ye}=await Promise.resolve().then(()=>_e("./static/core/e2f501f0.js"));return{htmlToMarkdown:ye}},void 0,{}.url);W.handleReadHtml(ye=>{ye.html=Ce(ye.contentDocument)})}).then(W=>{const Ce=new Blob([W],{type:"text/markdown;charset=utf-8"});(0,an.saveAs)(Ce,`${qe()}.md`)}).catch(W=>o.reportError(W,{origin:"markdown-export"}))})},Ot=M=>{const q=re();at(q,Q=>{ve({event:"click",action:"export_email",export_type:"Clipboard"});const oe=document.querySelector(".email-preview"),ne=getComputedStyle(oe);x(Q,[ne.width],e.utm_parameters,async W=>{await Be(W),rt(W),await o.processAmp(W,M)}).then(W=>navigator.clipboard.writeText(W).then(function(){E.success(n("The email has been copied to the clipboard."))})).catch(W=>{})},!0)},jn=async M=>{Re&&pr(Re)},Ln=()=>{$e(null),T("")},hn=async()=>{if(!R){D(!0);try{const M=await Se([800,df],lf);if(!M)return;const{hrefs:q,dispose:Q}=M;try{const[oe,ne]=await Promise.all(q.map(ye=>_t.getImageByUrl(ye).then(He=>_t.imageToBlob(He)))),W=qe(),Ce=await _t.htmlFilesToZip(sf(W,{desktop:oe,mobile:ne}));(0,an.saveAs)(Ce,Ia(W).archive),ve({event:"click",action:"export_email",export_type:"Image"})}finally{Q()}}catch{E.error({title:n("Error"),description:n("Failed to export the email as images. Please try again.")})}finally{D(!1)}}},On=M=>{const q=J.get(o.APP_COOKIES.em_token);return fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(M)}`,{headers:{authorization:`Bearer ${q}`}}).then(Q=>Q.blob())},Mn=M=>new Promise((q,Q)=>{const oe=()=>On(M).then(q,Q);fetch(M).then(ne=>q(ne.blob()),oe).catch(()=>{})}),ht=(M,q)=>{const Q=re();at(Q,oe=>{ve({event:"click",action:"export_email",export_type:"Outlook"});const ne=document.querySelector(".email-preview"),W=getComputedStyle(ne),Ce=async(ye,He)=>{ye.document,await o.processAmp(ye,He),await Be(ye),rt(ye)};P(e.title,oe,[W.width,W.height],e.utm_parameters,M?ye=>Ce(ye,"html"):ye=>Ce(ye),q?{embedImagesAsBase64:!0,getImageBlob:Mn}:void 0).then(ye=>{const He=new Blob([ye],{type:"text/html;charset=utf-8"});(0,an.saveAs)(He,`${qe()}.eml`)}).catch(ye=>{})})},St=M=>{k({centered:!0,mask:{closable:!0},title:n("Embed images in the file?"),content:n('If "Yes", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If "No", images will be loaded from external links.'),okText:n("Yes"),cancelText:n("No"),onOk:()=>ht(M,!0),onCancel:()=>ht(M,!1)})},ce=async()=>{const M=re();at(M,async q=>{ve({event:"click",action:"export_email",export_type:"ZIP"});const Q=document.querySelector(".email-preview"),oe=getComputedStyle(Q),ne=await Y(q,[oe.width,void 0],e.utm_parameters,Mn,async Ce=>{await Be(Ce),rt(Ce),Tt&&await o.processAmp(Ce,"html")});Tt&&(ne["amp.html"]=await x(q,[oe.width],e.utm_parameters,async Ce=>{await Be(Ce),rt(Ce),await o.processAmp(Ce,"amp")}));const W=await _t.htmlFilesToZip(ne);(0,an.saveAs)(W,`${qe()}.zip`)},!0)},ke=async()=>{if(ve({event:"click",action:"duplicate_email",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew)E.warning({title:n("To create a copy, you need to save the email.")});else{if((await B.fire(e)).some(M=>M===!1))return;ft({title:xt.generateCopyTitle(e.title),...e.meta!==void 0?{meta:e.meta}:{},project:Number(ue?.id),description:e.description,html:xt.generateCopyHtml(re()||"",String(e.title)),parent_email:e.parent_email||127017,common_styles:e.common_styles||"",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},emailtags:e.emailtags,folder:e.folder}).unwrap().then(M=>{u(`/projects/${ue.id}/emails/${M.id}`),E.success({title:n('The copy of email "')+e.title+n('" was successfully created.')}),ve({event:"duplicate",action:"duplicate_email_success",entity_type:"email",entity_id:e.id,cloned_entity_id:M.id,project_id:e.project,context:"editor"}),ge("folder")}).catch(M=>{E.error({title:M.data.code,description:M.data.message})})}},Ne=()=>{ve({event:"click",action:"click_delete_email_menu_item",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew?E.success(n("The draft of the email has been deleted.")):nt(e,u)},nt=(M,q)=>{ve({event:"open",action:"open_delete_email_modal",entity_type:"email",entity_id:M.id,project_id:M.project,context:"editor"}),k({mask:{closable:!0},centered:!0,title:r('Are you sure to delete "',"email")+M.title+n('" email?'),icon:(0,s.jsx)(o.EmIcons,{icon:"DeleteOutlined",component:y.icons$DeleteOutlined,size:22,style:{color:y.ui_kit$iconColors.danger,marginInlineEnd:12,flexShrink:0}}),okText:n("Yes"),cancelText:n("No"),onOk:()=>vt(M,q)})},je=()=>{hr().catch(()=>{}),o.uploadFile("application/zip, message/rfc822, text/html",Kt)},Kt=async M=>{const q=M[0];try{i(o.setIsGlobalLoading(!0));const{createDocumentProcessor:Q,createFileProcessor:oe,importEmail:ne}=await hr(),{html:W,hasBrowserExtensionArtifacts:Ce}=await ne(q,oe(c,d,h,ue,N),Q(q))??{html:"",hasBrowserExtensionArtifacts:!1};Ce&&$.fire();const[ye]=_t.getFileNameAndExt(q.name.replaceAll(" "," ")),He=ye||xt.getTitleFromHtml(W)||"";ee(W,{undoable:!0}),a({title:He}),i(o.setIsGlobalLoading(!1)),le.fire({html:W})}catch(Q){i(o.setIsGlobalLoading(!1));const oe=Q instanceof Error?Q.message:Q;E.error({title:oe})}ve({event:"upload_file",action:"import_email"})},Ut=()=>{const M=re();M&&(ve({event:"click",action:"convert_layout"}),le.fire({html:M}))},dt=[];N.emailDropdownMenuClone&&dt.push({label:n("Clone"),icon:(0,s.jsx)(o.EmIcons,{icon:"CopyOutlined",component:y.icons$CopyOutlined,size:16,strokeWidth:N.iconStrokeWidth}),key:"Clone",className:"em-analytics__email-clone",disabled:lt.isLoading,onClick:ke}),N.emailDropdownMenuImport&&dt.push({label:r("Import","verb"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,style:Dt}),locked:Qe.isLocked,strokeWidth:N.iconStrokeWidth}),key:"Import",className:"em-analytics__editor-page__import",onClick:()=>{if(Qe.isLocked){Ze("template_import");return}ve({event:"click",action:"import_email"}),je()}});const Nn=re(),$t=!e.hasOwnProperty("type")&&Sa(Nn,O)!==null;N.emailDropdownMenuConvert&&$t&&dt.push({label:n("Convert"),icon:(0,s.jsx)(o.EmIcons,{icon:"SwapOutlined",component:y.icons$SwapOutlined,size:16,strokeWidth:N.iconStrokeWidth}),key:"ConvertLayout",className:"em-analytics__email-convert",onClick:Ut}),(m||f||h.id?.toString()===e.author?.toString())&&(N.emailDropdownMenuLock&&dt.push({label:(0,s.jsx)(va,{element:e,context:"editor"},"Lock"),icon:e.lock?(0,s.jsx)(o.EmIcons,{icon:"UnLock",component:y.icons$UnLock,size:16,strokeWidth:N.iconStrokeWidth}):(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:16,strokeWidth:N.iconStrokeWidth}),disabled:e.isNew}),N.emailDropdownMenuRemove&&dt.push({label:n("Remove"),icon:(0,s.jsx)(o.EmIcons,{icon:"DeleteOutlined",component:y.icons$DeleteOutlined,size:16,strokeWidth:N.iconStrokeWidth}),key:"Remove",className:"em-analytics__email-remove",style:{color:"#ff4d4f"},onClick:Ne}));const Tt=e.isAmp,It=[],Fo=()=>[...Tt?[{key:"html_txt",label:`${n("Plain text")} (HTML)`,onClick:()=>ct("html")},{key:"сode_txt",label:`${n("Plain text")} (AMP)`,onClick:()=>ct("amp")}]:[{key:"plain_txt",label:n("Plain text"),onClick:()=>ct()}],{key:"markdown",label:n("Markdown"),onClick:()=>Et()}];N.exportHtmlEnabled&&It.push({key:"html",label:n("Code"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileTextOutlined",component:y.icons$FileTextOutlined,style:Dt}),locked:I.isLocked,strokeWidth:N.iconStrokeWidth}),...I.isLocked?{onClick:()=>Ze("export_html")}:Tt?{children:[{key:"сode_html",label:n("AMP"),onClick:()=>Ke.isLocked?Ze("export_amp"):Lt("amp")},{key:"html_amp",label:n("HTML"),onClick:()=>Lt("html")}]}:{onClick:()=>Lt()}}),N.exportZipEnabled&&It.push({key:"zip",label:n("ZIP"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileZipOutlined",component:y.icons$FileZipOutlined,style:Dt}),locked:I.isLocked,strokeWidth:N.iconStrokeWidth}),...I.isLocked?{onClick:()=>Ze("export_html")}:{onClick:()=>ce().catch(M=>{})}}),N.exportClipboardEnabled&&It.push({key:"clipboard",label:n("Clipboard"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"SnippetsOutlined",component:y.icons$SnippetsOutlined,style:Dt}),locked:I.isLocked,strokeWidth:N.iconStrokeWidth}),...I.isLocked?{onClick:()=>Ze("export_html")}:Tt?{children:[{key:"clipboard_html",label:n("AMP"),onClick:()=>Ke.isLocked?Ze("export_amp"):Ot("amp")},{key:"clipboard_amp",label:n("HTML"),onClick:()=>Ot("html")}]}:{onClick:()=>Ot()}}),N.exportTextEnabled&&It.push({key:"text",label:n("Text"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileOutlined",component:y.icons$FileOutlined,style:Dt}),locked:I.isLocked,strokeWidth:N.iconStrokeWidth}),...I.isLocked?{onClick:()=>Ze("export_html")}:N.exportMarkdownEnabled?{children:Fo()}:Tt?{children:[{key:"сode_txt",label:n("AMP"),onClick:()=>Ke.isLocked?Ze("export_amp"):ct("amp")},{key:"html_txt",label:n("HTML"),onClick:()=>ct("html")}]}:{onClick:()=>ct()}}),N.exportOutlookEnabled&&It.push({key:"outlook",icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileWordOutlined",component:y.icons$FileWordOutlined,style:Dt}),locked:we.isLocked,strokeWidth:N.iconStrokeWidth}),label:n("Outlook"),onClick:()=>we.isLocked?Ze("export_platforms"):St(!!Tt)}),N.exportPdfEnabled&&It.push({key:"pdf",icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FilePdfOutlined",component:y.icons$FilePdfOutlined,style:Dt}),locked:S.isLocked,strokeWidth:N.iconStrokeWidth}),label:n("PDF"),onClick:()=>S.isLocked?Ze("export_pdf"):fn()}),N.exportPngEnabled&&It.push({key:"img",icon:(0,s.jsx)(qt,{icon:R?(0,s.jsx)(o.EmIcons,{icon:"LoadingOutlined",component:y.icons$LoadingOutlined,spin:!0,style:Dt}):(0,s.jsx)(o.EmIcons,{icon:"FileImageOutlined",component:y.icons$FileImageOutlined,style:Dt}),locked:se.isLocked,strokeWidth:N.iconStrokeWidth}),label:n("PNG"),disabled:!se.isLocked&&R,onClick:()=>se.isLocked?Ze("export_png"):hn()});const gt=e.author;return(0,s.jsxs)(y.ui_kit$Space,{children:[N.emailDropdownMenuEnabled?(0,s.jsx)(y.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:dt},children:(0,s.jsx)(y.ui_kit$Button,{type:"default",block:!1,className:"email-page-header__btn email-page-header__btn_extra",onClick:()=>{},children:(0,s.jsx)(o.EmIcons,{icon:"DotsHoriz",component:y.icons$DotsHoriz,size:18,strokeWidth:N.iconStrokeWidth})})},"Actions"):N.emailDropdownMenuImport&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Import","verb"),placement:"bottom",children:N.emailDropdownMenuImportButton?(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__editor-page__import",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,size:16,strokeWidth:N.iconStrokeWidth}),onClick:()=>{ve({event:"click",action:"import_email"}),je()},children:n("Import")}):(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__editor-page__import",type:"text",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,size:22,strokeWidth:N.iconStrokeWidth}),onClick:()=>{ve({event:"click",action:"import_email"}),je()}})}),N.emailExportEnabled&&(0,s.jsx)(y.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:It},children:(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__email-page__export",type:"default",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudDownloadOutlined",component:y.icons$CloudDownloadOutlined,size:16,strokeWidth:N.iconStrokeWidth}),children:n("Export")},"Export")},"Export"),!e.hasOwnProperty("type")&&(0,s.jsx)(ba,{disabled:fe,email:e},"Save"),!!e.hasOwnProperty("type")&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Nu,{disabled:fe,rightCol:void 0,block:e,isEditableRights:m||f||h.id?.toString()===gt?.toString(),autoSaveBlockResult:t})},"Save"),(0,s.jsx)(ip,{open:me,codeSize:o.getCodeSize(Te),onMinimize:Bt,onDownloadAsIs:Oe,onCancel:Xe}),Re&&pr(Re)&&(0,s.jsx)(gp,{integration:pr(Re),visible:!!Re,loading:et,onConfirm:jn,onCancel:Ln,__:n}),(0,s.jsx)(o.PlanUpgradePrompt,{open:X,sideOnOk:void 0,onCancel:()=>Ee(!1),initialSlide:Ie})]})},_o=o.createApi({reducerPath:"confirmationMailApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:t,email:n})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${t}&user_email=${n}`)}`})})})}),{useLazyGetConfirmationMailQuery:ff}=_o,hf=()=>{const{__:e}=o.useI18n(),t=o.useNotification(),n=o.useCurrentUser(),[r]=ff(),[i,a]=(0,l.useState)(!1),c=o.usePushToDataLayer();(0,l.useEffect)(()=>{n.hasOwnProperty("email_confirmation")&&a(n.email_confirmation)},[n,i]);const d=()=>{c({event:"click",action:"click_resend_confirmation_email",user_email:n.email,user_id:n.id}),r({userId:n.id,email:n.email}).then(({data:u,error:m})=>{u?t.success(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",n.email)):m&&t.error(m)})};return n?.email_confirmation||!n?.privacy_policy_agreement?null:(0,s.jsx)("div",{className:"main__ribbon",children:(0,s.jsxs)("span",{children:[(0,s.jsx)(o.EmIcons,{icon:"EmailConfirmation",component:y.icons$EmailConfirmation,size:16,style:{marginRight:10,verticalAlign:"-0.15em"}}),e("Confirmation email was sent to")," ",(0,s.jsx)("em",{children:n.email}),". ",e("Didn't receive an email?")," ",(0,s.jsxs)(y.ui_kit$Button,{type:"primary",size:"small",className:"main__ribbon-resend",style:{fontSize:16,lineHeight:1,display:"inline-flex",alignItems:"center",gap:8},onClick:d,children:[e("Resend"),(0,s.jsx)(o.EmIcons,{icon:"SendOutlined",component:y.icons$SendOutlined,size:16,style:{flexShrink:0}})]})]})})},gf=({className:e,leftBlock:t,rightBlock:n,isHeaderCodeMenuOpen:r=!1})=>{const{token:i}=(0,y.ui_kit$useToken)(),a=(0,l.useRef)(),c=o.useAppConfig();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(hf,{}),c.headerShow&&(0,s.jsx)("header",{className:(0,ot.default)("header",{[e]:e}),style:{borderColor:i.colorBorder},children:!r&&(0,s.jsx)(o.CSSTransition,{nodeRef:a,in:!r,timeout:300,classNames:"transition",children:(0,s.jsxs)("div",{className:"header__container container",children:[(0,s.jsx)("div",{className:"header__left",style:{flexGrow:1},children:t}),(0,s.jsx)("div",{className:"header__right",children:(0,s.jsx)(y.ui_kit$Space,{size:10,children:n})})]})})})]})},yf=e=>{},Aa=g.createIdentifier$1("canvas.headerFlow");function _f(e){const t=(0,l.useCallback)(n=>e?e.subscribe(n):()=>{},[e]);return(0,l.useSyncExternalStore)(t,()=>e?.isReady()===!0)}var xa=({email:e,isCollaborationEditor:t})=>{const[n]=y.ui_kit$Form.useForm(),{__:r}=o.useI18n();let i=o.useDispatch();const a=o.useEmailAttributesWriter(),c=o.useAppNavigate(),d=o.useOpenPlanCatalog(),u=Yi("header"),m=o.useCurrentUser(),f=o.useContainer().getInstance(Aa),h=o.useProjectData(),{owner:_,admin:p}=Qn(),{token:E}=(0,y.ui_kit$useToken)(),k=o.useAppConfig(),w=o.usePushToDataLayer(),b=(0,l.useRef)(),x=(0,l.useRef)(),P=(0,l.useRef)(),Y=o.useEventEmitter(g.events.ON_PREVIOUSBUTTON_CLICK_ID),J=o.useEventEmitter(g.events.ON_PREHEADER_CHANGED_ID),N=o.useEventEmitter(g.events.ON_SUBJECT_CHANGED_ID),O=o.useSelector(o.selectCodeModeDirection),A=e.hasOwnProperty("type")?o.BLOCK:o.EMAIL,L=o.useSelector(o.selectElementSettings$1),z=o.useSelector(o.selectElementSettings),B=A==="email"?L:z,$=o.useSelector(o.selectIsCodeMode),[de,pe]=(0,l.useState)(!1),[H,Z]=(0,l.useState)(!1),[De,be]=(0,l.useState)(!1),et=(0,l.useCallback)(()=>be(!1),[]),ve=(0,l.useCallback)(()=>{be(!1),d()},[d]),fe=Hi("email_generate"),K=fe.exceeded?o.getLimitUpgradePresetDefinition(fe.exceeded.presetId):null;(0,l.useEffect)(()=>{const I=!!B?.type&&(B?.type===o.ELEMENT_TYPES.TEXT||B?.type===o.ELEMENT_TYPES.LINK||B.type===o.ELEMENT_TYPES.BUTTON)&&$&&O!=="bottom";pe(I),i(o.setHeaderCodeMenuOpen(I))},[B,O,$]);const me=(0,l.useCallback)(()=>{w({event:"click",action:"click_back_button",entity_type:A==="block"?"block":"email",entity_id:e?.id,project_id:e?.project||h?.id,context:"editor"}),Y.fire(e)},[c,Y,e,h?.id,w,A]),{document:ie}=o.useCurrentSession(),ae=_f(ie);o.usePrevious(([I])=>{ae&&I!==e.subject&&N.fire(e.subject)},[e.subject,ae]);const Ae=(0,l.useCallback)(I=>{const S=I.target.value;N.fire(S)},[N]),Te=(0,l.useCallback)(I=>{const S=I.target.value;J.fire(S)},[J]);o.usePrevious(([I])=>{ae&&I!==e.preheader&&J.fire(e.preheader)},[e.preheader,ae]);const Fe=(0,l.useCallback)((I,S="?")=>{I.subject?.length,I.preheader?.length,n.setFieldValue("subject",I.subject??""),n.setFieldValue("preheader",I.preheader??"")},[n]),X=(0,l.useRef)(void 0);(0,l.useEffect)(()=>{const I=e?.renderGuid??(e?.id!=null?String(e.id):void 0);!ae||!I||X.current===I||(X.current=I,Fe(e,"identity"))},[ae,e,Fe]);const Ee=(0,l.useCallback)(I=>{const S=I.target.value.trim();a({subject:S})},[a]),Ie=o.useEvent(g.events.BEFORE_SAVE_EMAIL),he=(0,l.useCallback)(async I=>{const S=x.current?.input;if(document.activeElement===S){const we=S.value.trim();we!==I.subject&&(I.subject=we,a({subject:we}))}const se=P.current?.input;if(document.activeElement===se){const we=se.value.trim();we!==I.preheader&&(I.preheader=we,a({preheader:we}))}await f?.whenDelivered()},[f,a]);(0,l.useEffect)(()=>{const I=Ie(he);return()=>I.dispose()},[Ie,he]);const Re=(0,l.useCallback)(I=>{const S=I.target.value.trim();a({preheader:S})},[a]),$e=o.useEvent(g.events.ON_HEADER_APPLIED_ID);(0,l.useEffect)(()=>{const I=$e(({field:S,value:se})=>{n.setFieldValue(S,se)});return()=>I.dispose()},[$e,n]),yf(e.title===null?r("New email title"):e.title);const C=(0,l.useCallback)(()=>{i(o.setActiveSettingsTab(o.AICHAT)),setTimeout(()=>{const I=document.querySelector('li.ai-response-change-context[role="theme-and-preheader-generator"]');I&&I.click()},100)},[i]),T=(0,l.useCallback)(()=>{fe.isLocked?fe.state.state==="locked_by_limit"&&fe.exceeded?be(!0):Z(!0):C()},[fe,C]),R=(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(y.ui_kit$Space,{ref:b,size:10,children:[k.headerArrowBackVisible&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Back"),placement:"left",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsx)(o.EmIcons,{icon:"ArrowLeftOutlined",component:y.icons$ArrowLeftOutlined,size:22,strokeWidth:k.iconStrokeWidth}),onClick:me,shape:"circle"})}),(0,s.jsx)("div",{children:(k.headerTitleVisible||k.headerPreheaderVisible)&&(0,s.jsxs)(y.ui_kit$Form,{form:n,layout:"vertical",name:"subject_preheader_form",autoComplete:"off",initialValues:{subject:"",preheader:""},children:[k.headerTitleVisible&&(0,s.jsx)("div",{style:{marginTop:ae?-3:0},children:(0,s.jsxs)(y.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,s.jsx)("div",{className:"subject_preheader_form__title",children:r("Subject")}),ae?(0,s.jsxs)("div",{className:"ant-page-header-heading",children:[(0,s.jsx)(y.ui_kit$Form.Item,{name:"subject",noStyle:!0,children:(0,s.jsx)(y.ui_kit$Input,{className:"ant-page-header-heading-title",ref:x,placeholder:r("Enter subject line here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:Ae,onPressEnter:Ee,onBlur:I=>{Ee(I),document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.add("focus")},disabled:k.lockPreheaderAndTitle})}),k.aiAssistentEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Generate with AI"),children:(0,s.jsx)(o.EmIcons,{icon:"AI",component:y.icons$AI,size:12,strokeWidth:k.iconStrokeWidth,onClick:T})})]}):(0,s.jsx)(y.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"40%",marginTop:3}})]})}),k.headerPreheaderVisible&&(0,s.jsx)("div",{children:(0,s.jsxs)(y.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,s.jsx)("div",{className:"subject_preheader_form__title",children:r("Preheader")}),ae?(0,s.jsxs)("div",{className:"ant-page-header-heading ant-page-header-heading_preheader",children:[(0,s.jsx)(y.ui_kit$Form.Item,{name:"preheader",noStyle:!0,children:(0,s.jsx)(y.ui_kit$Input,{className:"ant-page-header-heading-preheader",ref:P,placeholder:r("Enter preheader here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:Te,onPressEnter:Re,onBlur:I=>{Re(I),document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.add("focus")},disabled:k.lockPreheaderAndTitle})}),k.aiAssistentEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Generate with AI"),children:(0,s.jsx)(o.EmIcons,{icon:"AI",component:y.icons$AI,size:12,strokeWidth:k.iconStrokeWidth,onClick:T})})]}):(0,s.jsx)(y.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"80%",marginTop:2}})]})})]})})]})}),D=(0,s.jsxs)(s.Fragment,{children:[k.emailIdShow&&!!e.id&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"email-page-header__email-id",children:"ID"+e.id}),(0,s.jsx)(y.ui_kit$Divider,{orientation:"vertical"})]}),(0,s.jsx)(fa,{emailElement:e,isCollaborationEditor:t}),k.commandButtonsEnabled&&(0,s.jsxs)(s.Fragment,{children:[e.lock?(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:18,strokeWidth:k.iconStrokeWidth,className:(0,ot.default)("lock-icon",{"lock-icon__disabled":!(_||p||m.id?.toString()===e.author?.toString())}),style:{color:E.colorPrimary,verticalAlign:"sub"}},"Lock"):null,(0,s.jsx)(pf,{email:e,isHeaderCodeMenuOpen:de},"Buttons")]})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(gf,{className:"email-pane__header",leftBlock:u?R:null,rightBlock:u?D:null,isHeaderCodeMenuOpen:de}),(0,s.jsx)(o.PlanUpgradePrompt,{open:H,onCancel:()=>Z(!1),initialSlide:9}),K&&fe.exceeded?(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(ir,{open:De,onClose:et,title:r(K.titleKey),subtitle:r(K.subtitleKey),usageResource:K.usageResource,previousDisplay:o.presetLimitDisplay(fe.exceeded.previousLimit),nextDisplay:o.presetLimitDisplay(fe.exceeded.nextLimit),onChangePlan:ve})}):null]})};xa.propTypes={};function bf(e){const t=o.parseEmBlockVersion(e);if(!t)return e;const n=r=>String(r).padStart(2,"0");return`${n(t.getDate())}.${n(t.getMonth()+1)}.${t.getFullYear()} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var vf=({open:e,blocks:t,projectId:n,onClose:r})=>{const{__:i,_n:a}=o.useI18n(),c=o.useSendPostMessage(),d=o.useNotification(),[u,m]=(0,l.useState)({});(0,l.useEffect)(()=>{e&&m(Object.fromEntries(t.map(p=>[p.emBlockId,!0])))},[e,t]);const f=(0,l.useMemo)(()=>Object.values(u).filter(Boolean).length,[u]),h=(p,E)=>{m(k=>({...k,[p]:E}))},_=()=>{const p=t.filter(E=>u[E.emBlockId]);p.length&&(p.forEach(E=>{c({operation:o.EVENT_TYPES.SANDBOX_GLOBAL_BLOCK_REPLACE,settings:{emBlockId:E.emBlockId,blockHTML:E.savedHtml,type:"project",...n?{project:String(n)}:{}}})}),d.success({message:i("Updated")+" "+p.length+" "+a("block","blocks",p.length),placement:"bottomRight"}),r())};return(0,s.jsxs)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:i("Update global blocks")}),open:e,onOk:_,onCancel:r,footer:(0,s.jsxs)("div",{className:"update-global-blocks-modal__footer",children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:r,children:i("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",disabled:f===0,onClick:_,children:i("Update")})]}),children:[(0,s.jsx)("div",{className:"update-global-blocks-modal__hint",children:i("These global blocks have a newer saved version. Select the ones to update in the template.")}),(0,s.jsx)("div",{className:"update-global-blocks-modal__list",children:t.map(p=>(0,s.jsxs)("div",{className:"update-global-blocks-modal__row",children:[(0,s.jsx)(y.ui_kit$Switch,{checked:!!u[p.emBlockId],onChange:E=>h(p.emBlockId,E)}),(0,s.jsxs)("span",{className:"update-global-blocks-modal__title",title:p.title,children:[p.title,(0,s.jsxs)("span",{className:"update-global-blocks-modal__version",children:[i("Version of")," ",bf(p.savedVersion)]})]}),p.instances>1&&(0,s.jsxs)("span",{className:"update-global-blocks-modal__count",children:[p.instances," ",a("instance","instances",p.instances)]})]},p.emBlockId))})]})};function Ef(e){const t=new Map;return e?.trim()&&new DOMParser().parseFromString(e,"text/html").querySelectorAll('[em="block"][em-block-id]').forEach(n=>{const r=n.getAttribute("em-block-id");if(!r)return;const i=n.getAttribute("em-block-version")??void 0,a=t.get(r);a?(a.versions.add(i),a.count+=1):t.set(r,{versions:new Set([i]),count:1})}),t}function Sf(e,t){const n=Ef(e);if(!n.size||!t?.length)return[];const r=[];for(const i of t){if(!i.global_block||!i.id||!i.html)continue;const a=String(i.id),c=n.get(a);if(!c)continue;const d=o.readRootEmBlockAttrs(i.html).emBlockVersion;d&&[...c.versions].some(u=>u!==d)&&r.push({emBlockId:a,title:i.title?.trim()||a,savedHtml:i.html,savedVersion:d,templateVersion:[...c.versions][0],instances:c.count})}return r}var Pa="em-block-id";function wf({projectId:e,document:t}){const n=o.useEvent(g.events.ON_EMAIL_INIT_ID),r=o.useHeadless(),[i,a]=(0,l.useState)([]),[c,d]=(0,l.useState)(!1),[u,m]=(0,l.useState)(null),f=(0,l.useCallback)(E=>t?.subscribe(E)??(()=>{}),[t]),h=(0,l.useSyncExternalStore)(f,()=>!!t?.getContent().includes(Pa)),{data:_}=o.blocksApi.endpoints.getBlocks.useQuery(o.projectBlocksArgs(e),{skip:!e||!h}),p=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{h&&p.current&&t&&(p.current=!1,m(t.getContent()))},[h,t]),(0,l.useEffect)(()=>{const E=new g.Disposable;return E.addDisposable(n(k=>{if(k?.reset)return;const w=k?.html??"",b=w.includes(Pa);p.current=!b,m(b?w:null)})),()=>E.dispose()},[n]),(0,l.useEffect)(()=>{if(u==null||!_)return;if(r){m(null);return}const E=Sf(u,_);E.length&&(a(E),d(!0)),m(null)},[u,_,r]),{outdatedBlocks:i,isOpen:c,close:(0,l.useCallback)(()=>d(!1),[])}}var kf=({open:e,html:t,emBlockId:n,onSaveAsNew:r,onClose:i})=>{const{__:a}=o.useI18n(),c=o.useSendPostMessage(),d=o.useNotification(),[u]=o.useEditBlockMutation(),[m,f]=(0,l.useState)(!1),h=async()=>{if(!n||!t){i();return}f(!0);const _=new Date,p=o.formatEmBlockVersion(_),E=o.injectEmBlockIdIntoBlockHtml(t,String(n),_),k=await u({blockId:String(n),html:E});if(f(!1),"error"in k&&k.error){d.error({message:a("Failed to update the global block."),placement:"bottomRight"});return}c({operation:o.EVENT_TYPES.SANDBOX_EBLOCK_SET_EM_BLOCK_ID,settings:{emBlockId:String(n),emBlockVersion:p}}),d.success({message:a("The global block was updated."),placement:"bottomRight"}),i()};return(0,s.jsx)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:a("Saving changes in the block")}),open:e,onCancel:i,footer:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",disabled:m,onClick:r,children:a("Create new block")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",loading:m,onClick:h,children:a("Update current block")})]}),children:(0,s.jsx)("div",{children:a("This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.")})})},Cf=(function(){var e=window.__emailmaker__;if(e&&e.assetUrl)return e.assetUrl("converter-intro.bf4ee74d750b35ae2c10.png");if(e&&e.publicPath)try{return new URL("static/media/converter-intro.bf4ee74d750b35ae2c10.png",e.publicPath).href}catch{}try{return new URL("/static/media/converter-intro.bf4ee74d750b35ae2c10.png",typeof document<"u"&&document.baseURI?document.baseURI:typeof window<"u"&&window.location?window.location.href:"").href}catch{return"/static/media/converter-intro.bf4ee74d750b35ae2c10.png"}})(),Tf={closable:!1},If=Cf,Af=({open:e,onConfirm:t,onCancel:n,neverSuggestAgain:r,onNeverSuggestAgainChange:i})=>{const{__:a}=o.useI18n();return(0,s.jsx)(y.ui_kit$Modal,{className:"convert-layout-modal",title:(0,s.jsx)("div",{className:"convert-layout-modal__title",children:a("Template conversion")}),open:e,onOk:t,onCancel:n,mask:Tf,width:480,footer:(0,s.jsxs)("div",{className:"convert-layout-modal__footer",style:{display:"flex",flexDirection:"column",gap:16},children:[(0,s.jsx)(y.ui_kit$Switch,{size:"small",checked:r,onChange:i,label:a("Don't suggest again"),labelSize:"small"}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:n,children:a("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:t,children:a("Convert")})]})]}),children:(0,s.jsxs)("div",{className:"convert-layout-modal__content",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:24,padding:"0 8px",overflow:"hidden"},children:[(0,s.jsx)("div",{className:"convert-layout-modal__text convert-layout-modal__intro-text",style:{textAlign:"center"},children:a("This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.")}),(0,s.jsx)("img",{src:If,alt:"Converter Intro",className:"convert-layout-modal__image",style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",borderRadius:8}})]})})},xf={closable:!1},Pf=({open:e,message:t,onRetry:n,onCancel:r})=>{const{__:i}=o.useI18n();return(0,s.jsx)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:i("Conversion failed")}),open:e,onOk:n,onCancel:r,mask:xf,footer:(0,s.jsxs)("div",{className:"convert-layout-modal__footer",children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:r,children:i("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:n,children:i("Try again")})]}),children:(0,s.jsxs)("div",{className:"convert-layout-modal__text",children:[i("Something went wrong during layout conversion. You can try running the conversion again."),t?(0,s.jsx)("div",{className:"convert-layout-modal__error-details",children:t}):null]})})},Rf=({open:e,progress:t})=>{const{__:n}=o.useI18n();return e?(0,s.jsx)("div",{className:"conversion-overlay",children:(0,s.jsxs)("div",{className:"conversion-overlay__content",children:[(0,s.jsx)(y.ui_kit$Spin,{size:"large"}),(0,s.jsx)("div",{className:"conversion-overlay__title",children:n("Converting layout…")}),(0,s.jsx)("div",{className:"conversion-overlay__hint",children:n("This may take several minutes. Please keep this tab open.")}),(0,s.jsx)(y.ui_kit$Progress,{className:"conversion-overlay__progress",percent:Math.round(t),status:"active",strokeColor:o.emCssVar("colorPrimary")})]})}):null},bo=o.createApi({reducerPath:"layoutConverterApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({createConvertJob:e.mutation({query:({html:t})=>({url:"/ai/converter/jobs",method:"POST",body:{html:t}})}),getConvertJobStatus:e.query({query:t=>({url:`/ai/converter/jobs/${t}`,method:"GET"})})})}),{useCreateConvertJobMutation:jf,useLazyGetConvertJobStatusQuery:Lf}=bo;function Of(){try{return window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)==="true"}catch{return!1}}function Mf(e){try{e?window.localStorage.setItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest,"true"):window.localStorage.removeItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)}catch{}}function Ra(e){return e==="beefree"?(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/cbcede3f.js")).then(t=>t.convertBeeFreeToEmailMaker),void 0,{}.url):(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/bebf981d.js")).then(t=>t.convertStripoToEmailMaker),void 0,{}.url)}var Nf=5,ja=95,Df=35e3,Ff=1e3,Bf=e=>new Promise(t=>setTimeout(t,e));function Uf(e,t){if(e&&typeof e=="object"){const n=e,r=n.data;if(r&&typeof r=="object"){const i=r.error;if(typeof i=="object"&&i?.message)return i.message;if(typeof i=="string"&&i)return i;if(r.message)return r.message}if(typeof r=="string"&&r)return r;if(n.error)return n.error;if(n.message)return n.message}return t}function $f(){const{__:e}=o.useI18n(),t=o.useContentReplacer(),n=o.useNotification(),r=Ea(),{aiLayoutConverterEnabled:i,anyConverterEnabled:a}=r,c=o.useHeadless(),d=o.useEvent(g.events.ON_EMAIL_INIT_ID),u=o.useEvent(g.events.ON_LAYOUT_CONVERT_REQUEST_ID),[m]=jf(),[f]=Lf(),[h,_]=(0,l.useState)(Of),p=(0,l.useRef)(h),E=(0,l.useCallback)(ie=>{p.current=ie,_(ie),Mf(ie)},[]),[k,w]=(0,l.useState)(!1),[b,x]=(0,l.useState)(!1),[P,Y]=(0,l.useState)(0),[J,N]=(0,l.useState)(!1),[O,A]=(0,l.useState)(""),L=(0,l.useRef)(""),z=(0,l.useRef)(null),B=(0,l.useRef)(null),$=(0,l.useRef)(!1),de=(0,l.useRef)({cancelled:!0}),pe=(0,l.useRef)(null);(0,l.useEffect)(()=>{$.current=b},[b]);const H=(0,l.useCallback)(()=>{pe.current!==null&&(clearInterval(pe.current),pe.current=null)},[]),Z=(0,l.useCallback)(()=>{H();const ie=Date.now();pe.current=setInterval(()=>{const ae=Date.now()-ie,Ae=ja*(1-Math.exp(-ae/Df));Y(Te=>Math.max(Te,Math.min(ja,Ae)))},Ff)},[H]),De=(0,l.useCallback)(ie=>{ie&&(t(ie,{undoable:!0}),B.current=ie)},[t]),be=(0,l.useCallback)(async ie=>{const ae={cancelled:!1};de.current=ae,N(!1);const Ae=z.current;if(Ae==="beefree"||Ae==="stripo"){try{const Te=await Ra(Ae),Fe=ae.cancelled?"":Te(ie);if(Fe&&!ae.cancelled){De(Fe),n.success({message:o.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"});return}}catch{}if(!i){ae.cancelled||(A(e("Layout conversion failed")),N(!0));return}}if(i){x(!0),Y(0),Z();try{const Te=await m({html:ie}).unwrap();if(ae.cancelled)return;let Fe=Te.retry_after>0?Te.retry_after:Nf;for(;!ae.cancelled;){if(await Bf(Fe*1e3),ae.cancelled)return;const X=await f(Te.job_id).unwrap();if(ae.cancelled)return;if(X.retry_after&&X.retry_after>0&&(Fe=X.retry_after),X.status==="completed"){H(),Y(100),De(X.html??""),n.success({message:o.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"}),setTimeout(()=>{ae.cancelled||(x(!1),Y(0))},400);return}if(X.status==="failed")throw new Error(X.error?.message||e("Layout conversion failed"))}}catch(Te){if(ae.cancelled)return;H(),x(!1),Y(0),A(Uf(Te,e("Layout conversion failed"))),N(!0)}}},[e,i,De,m,n,f,Z,H]),et=(0,l.useCallback)(()=>{w(!1);const ie=L.current;ie&&be(ie)},[be]),ve=(0,l.useCallback)(()=>{w(!1),B.current=L.current},[]),fe=(0,l.useCallback)(()=>{N(!1);const ie=L.current;ie&&be(ie)},[be]),K=(0,l.useCallback)(()=>{N(!1),B.current=L.current},[]),me=(0,l.useCallback)((ie,ae=!1)=>{const Ae=Sa(ie,r);if(a&&!c&&Ae&&!$.current){if(ae)B.current=null;else{if(p.current)return;if(B.current===ie)return}L.current=ie,z.current=Ae,Ae!=="ai"&&Ra(Ae).catch(()=>{}),w(!0)}},[a,r,c]);return(0,l.useEffect)(()=>{if(!a)return;const ie=new g.Disposable;return ie.addDisposable(d(ae=>{ae?.reset||me(ae?.html??"")})),()=>ie.dispose()},[a,d,me]),(0,l.useEffect)(()=>{if(!a)return;const ie=new g.Disposable;return ie.addDisposable(u(ae=>{me(ae?.html??"",!0)})),()=>ie.dispose()},[a,u,me]),(0,l.useEffect)(()=>()=>{de.current.cancelled=!0,H()},[H]),{isPromptOpen:k,isConverting:b,progress:P,isErrorOpen:J,errorMessage:O,confirmConversion:et,cancelPrompt:ve,retryConversion:fe,closeError:K,neverSuggestAgain:h,setNeverSuggestAgain:E}}var zf=6e4,La=new Map;function Gf(e){const t=e?String(e):"",n=La.get(t);if(n&&(La.delete(t),!(Date.now()-n.at>zf)))return n.promise}var gr={data:void 0,isSuccess:!1,isError:!1,error:void 0,isLoading:!1};function Wf(e){const t=o.useStore(),n=(0,l.useRef)(t);n.current=t;const[r,i]=(0,l.useState)(gr),a=e?String(e):void 0;return(0,l.useEffect)(()=>{if(!a){i(gr);return}let c=!1;return i({...gr,isLoading:!0}),(Gf(a)??o.resolveEmailPort(g.getContainer(n.current)).readEmail(a)).then(d=>{c||i({data:d??void 0,isSuccess:!0,isError:!1,error:void 0,isLoading:!1})}).catch(d=>{c||i({data:void 0,isSuccess:!1,isError:!0,error:d,isLoading:!1})}),()=>{c=!0}},[a]),r}var hv=2;function Hf(){const e=o.useProjectData()?.id,t=!0,{data:n,isError:r,isFetching:i,refetch:a}=o.useGetProjectPlanQuery(e,{skip:t}),[c,d]=(0,l.useState)(0),u=(0,l.useRef)(!1),m=!!r,f=c>=2,h=(0,l.useCallback)(()=>{u.current=!1,d(0),a()},[a]);(0,l.useEffect)(()=>{},[m,i,a,c,t]),(0,l.useEffect)(()=>{},[m,e,f,t]);const _="ready";return(0,l.useMemo)(()=>({status:_,retry:h}),[_,h])}var gv=300,qf=g.createIdentifier$1("prewarm.queue");function Vf(e){const t=[];let n=!1,r=!1,i;const a=()=>{i&&(i.unwatch(),e.clearTimer(i.timer),i=void 0)},c=()=>{const m=t.shift();if(!m)return;r=!0;const f=()=>{r=!1,u()};m.start().then(f,f)},d=()=>{a(),e.idle(()=>{if(!(r||t.length===0)){if(e.activity.inFlight()>0){u();return}c()}})};function u(){if(!n||r||i||t.length===0)return;const m=()=>e.setTimer(d,300),f={timer:e.activity.inFlight()===0?m():void 0,unwatch:e.activity.watch(()=>{e.clearTimer(f.timer),f.timer=e.activity.inFlight()===0?m():void 0})};i=f}return e.whenVisible(()=>{n=!0,u()}),{add(m){t.some(f=>f.name===m.name)||(t.push(m),u())},remove(m){const f=t.findIndex(h=>h.name===m);f>=0&&t.splice(f,1),t.length===0&&a()}}}function Yf(e){return e.getOrCreateInstance(qf,()=>Vf({activity:g.getNetworkActivity(e),whenVisible:t=>Ht(e).whenVisible(t),idle:Xt,setTimer:(t,n)=>window.setTimeout(t,n),clearTimer:t=>window.clearTimeout(t)}))}function Kf({projectId:e,project:t,emailProjectId:n,parentEmailId:r}){const i=o.useContainer(),a=o.useAppDispatch(),d=!!o.useCookieManager().get(o.APP_COOKIES.em_token);(0,l.useEffect)(()=>{const u=Yf(i),m=[],f=[],h=(p,E)=>{f.push(p),u.add({name:p,start:()=>{const k=E();return m.push(k),Promise.resolve(k)}})},_=o.parentEmailSource(r);return _&&h("blocks.parentEmail",()=>a(o.blocksApi.endpoints.getParentEmailBlocks.initiate(o.parentEmailBlocksArgs(_)))),h("blocks.template",()=>a(o.blocksApi.endpoints.getTemplateBlocks.initiate(o.templateBlocksArgs()))),e&&h("blocks.list",()=>a(o.blocksApi.endpoints.getBlocks.initiate(o.projectBlocksArgs(e)))),h("blocks.schema",()=>a(o.blocksApi.endpoints.getBlocksSchema.initiate(void 0))),t?.id&&h("blocks.tags",()=>a(o.taxonomiesApi.endpoints.getTerms.initiate({project:t,kind:o.BLOCK_TAGS}))),()=>{f.forEach(p=>u.remove(p)),m.forEach(p=>p.unsubscribe())}},[i,a,e,t,n,r,d])}var yr="AUTOSAVE_RECOVERY";function Qf(e,t,n=!1,r){const i=t?.get().serverId??void 0,{__:a}=o.useI18n(),c=o.useNotification(),d=o.useAppConfig(),u=o.useSelector(o.selectMonacoFocusing),m=o.useContainer(),f=m?.getInstance(Aa),h=(0,l.useRef)(0),_=o.useSelector(o.selectIsPanelHistoryCollapsed),p=o.useSelector(o.selectActiveSettingsTab),E=o.useDispatch(),k=(0,l.useSyncExternalStore)((0,l.useCallback)(O=>r?.subscribe(O)??(()=>{}),[r]),()=>r?.recoveryFacts()),w=d?.revisionService===!0,b=k?.isRecovering===!0,x=k?.applied,P=(0,l.useCallback)(()=>{E(o.markAppearanceNeedsUpdate());const O=e?.renderGuid,A=e?.preheader,L=e?.subject;O&&(A||L)&&f?.reassert({...A?{preheader:A}:{},...L?{subject:L}:{}})},[E,f,e?.preheader,e?.subject,e?.title,e?.common_styles,e?.renderGuid,t,r]);(0,l.useEffect)(()=>()=>{clearTimeout(h.current),r?.endForcedHeaders()},[i,r]),(0,l.useEffect)(()=>{w&&b&&c.info({key:yr,title:a("Loading latest changes..."),duration:0})},[w,b,c,a]);const Y=(0,l.useRef)({emailId:void 0,seq:0});(0,l.useEffect)(()=>{if(!x||k?.emailId!==i||(Y.current.emailId!==i&&(Y.current={emailId:i,seq:0}),x.seq<=Y.current.seq))return;Y.current={emailId:i,seq:x.seq},P();const{phase:O}=x;!w||O==="normal"||(O==="found"?c.success({key:yr,title:a("Changes loaded"),duration:3}):O==="timeout"?c.warning({key:yr,title:a("Locally saved version applied"),description:a("Syncing with the server in the background..."),duration:5}):O==="bg"&&c.info({key:"AUTOSAVE_BG_SYNCED",title:a("Email synced with the server"),duration:3}))},[w,x,k?.emailId,i,P,c,a]),(0,l.useEffect)(()=>{if(!n)return;const O=A=>{A.preventDefault()};return window.addEventListener("beforeunload",O),()=>window.removeEventListener("beforeunload",O)},[n]);const J=!_||u||p==="Discuss",N=m?o.provideAutosaveUiFacts(m):void 0;(0,l.useEffect)(()=>{N?.set({...N.get()??{isUserBusy:!1,saveContext:{}},isUserBusy:J})},[N,J])}var Xf=class extends Error{label;timeoutMs;constructor(e,t){super(`[${e}] timed out after ${t}ms`),this.name="OperationTimeoutError",this.label=e,this.timeoutMs=t}};function Jf(e,t,n){return t<=0?e:new Promise((r,i)=>{let a=!1,c;const d=u=>{a||(a=!0,c!==void 0&&(clearTimeout(c),c=void 0),u())};c=setTimeout(()=>{d(()=>i(new Xf(n,t)))},t),e.then(u=>{d(()=>r(u))},u=>{d(()=>i(u))})})}var Zf=2,vo=Symbol("sandbox:frame-replaced");function sn(e,t,n,r,i,a,c){const d=`sandbox:${t}`,u=a?.getSandboxTimeoutMs(t)??o.DEFAULT_SANDBOX_OP_TIMEOUT_MS[t],m=()=>{let E=Jf(e.sendAsync(n,r),u,d);return E=g.raceWithAbortSignal(E,a?.signal),o.logShowPipelineWait(d,E,i)};if(t==="INIT_START"&&Qi(e)){const E=a?.getSandboxReadyTimeoutMs()??2e4,k=e,w=b=>{const x=Xi(k,E,a?.signal);return o.logShowPipelineWait("sandbox:INIT_START:ready-wait",x,i).then(()=>{if(!c||b<=0)return m();const P=c.getGeneration();let Y;const J=new Promise((O,A)=>{Y=c.onChange(()=>{c.getGeneration()!==P&&A(vo)})}),N=m();return N.catch(()=>{}),Promise.race([N,J]).finally(()=>Y?.()).catch(O=>{if(O!==vo)throw O;return{...i},w(b-1)})})};return w(Zf)}if(!c)return m();const f=c.getGeneration();let h;const _=new Promise((E,k)=>{h=c.onChange(()=>{c.getGeneration()!==f&&k(vo)})}),p=m();return p.catch(()=>{}),Promise.race([p,_]).finally(()=>h?.()).catch(E=>{throw E===vo&&{...i},E})}function Oa(e,t,n,r){return{html:e,guid:t,...Object.keys(n).length>0?{templateDirectivesPolicy:n}:{},...r!==void 0?{rev:r}:{}}}var Ma="self-init:";function eh(e){return e.startsWith(Ma)}function Na(e,t){const n=e.getActiveShowRequest();return eh(t)?n===null:n?.showId===t&&e.hasPendingShow(t)}function th(e){const t=()=>e.initPipeline(),n=e.messageService,r=()=>e.waitScope?.()??t();let i="";const a=()=>e.readDocument()?o.readDocumentContent(e.readDocument()):i,c=()=>rn(e.container).editorPolicy,d=()=>e.readEmail(),u=()=>{const m=d();return{...m,id:e.isTemplate()||m.isNew?void 0:m.id,html:a()}};return{readContent:a,publicEmail:u,sendInitStart:()=>sn(n,"INIT_START",o.EVENT_TYPES.SANDBOX_INIT_START,{guid:d().renderGuid},void 0,r()),sendInited:()=>sn(n,"INITED",o.EVENT_TYPES.SANDBOX_INITED,{guid:d().renderGuid},void 0,r()),async sendContent(){const m=d(),{html:f,hasBrowserExtensionArtifacts:h}=o.prepareEmailHtmlForEditor(m?.html||"");h&&e.events.browserExtensionDetected(),o.loadDocumentContent(e.readDocument(),f),i=f,await sn(n,"SET_ENTITY",o.EVENT_TYPES.SANDBOX_SET_ENTITY,Oa(a(),m.renderGuid,c(),e.readDocument()?.get().version),{guid:m.renderGuid,emailId:m.id??null},r())},refreshContent:()=>sn(n,"SET_ENTITY",o.EVENT_TYPES.SANDBOX_SET_ENTITY,Oa(a(),d().renderGuid,c(),e.readDocument()?.get().version),void 0,r()),sendPreheader:async()=>{const m=d();if(m.preheader!==void 0)return sn(n,"PREHEADER",o.EVENT_TYPES.SANDBOX_PREHEADER_UPDATE,{value:m.preheader,guid:m.renderGuid,force:!0},void 0,r())},sendSubject:async()=>{const m=d();if(m.subject!==void 0)return sn(n,"SUBJECT",o.EVENT_TYPES.SANDBOX_SUBJECT_UPDATE,{value:m.subject,guid:m.renderGuid,force:!0},void 0,r())},revealFilled:()=>e.revealFilled?.()??Promise.resolve(),showFilled:m=>e.showFilled?.(m),readTarget:()=>e.readTarget?.(),fireWillInit:()=>e.events.willInit(u()),fireInit(m,f){if(!Na(t(),m)){t().getActiveShowRequest()?.showId;return}const h=d();h.id,h.renderGuid,t().completeShow(m),o.writeEmailAttributes(e.readDocument(),{is_inited:!0},{source:"system"});const _=u();return f&&(_.reset=!0),e.events.inited(_)},fireEmailChanged(){e.events.emailChanged(u())},fireContentChanged(){e.events.contentChanged(a())}}}function nh(e){const t=()=>e.initPipeline();let n=!1,r,i,a,c=0,d;const u=th({...e,waitScope:()=>({getSandboxTimeoutMs:w=>t().getSandboxTimeoutMs(w),getSandboxReadyTimeoutMs:()=>t().getSandboxReadyTimeoutMs(),signal:d?.signal??t().signal})});let m;const f=(w,b)=>{if(m===w)return;m=w;const x=c;setTimeout(()=>{c!==x||t().signal.aborted||E(w,b).catch(()=>{})},0)},h=()=>{d?.abort(),d=void 0};let _;const p=()=>{const w=t().signal;w!==_&&(_?.removeEventListener("abort",h),_=w,w.addEventListener("abort",h))};async function E(w,b){const x=++c;h(),d=new AbortController,p();const P=()=>c!==x,Y=u.readTarget(),J=t().generation,N=()=>J===t().generation&&!t().signal.aborted,O=b?"init:reset-":"init:";if(!b){const z=u.publicEmail();z?.id,z?.renderGuid,z?.preheader}let A=!1,L=!1;try{n=!0,await u.sendInitStart(),u.fireWillInit(),await(b?u.refreshContent():u.sendContent()),A=!0,b||u.publicEmail()?.id;try{await u.sendPreheader()}catch(z){o.logShowPipelineError(`${O}preheader-failed`,{showId:w,error:String(z)})}try{await u.sendSubject()}catch(z){o.logShowPipelineError(`${O}subject-failed`,{showId:w,error:String(z)})}if(P()||u.showFilled(Y),await u.sendInited(),L=!0,i===w){const z=e.readSandboxGeneration?.()??a;z!==void 0&&(r=z)}await u.revealFilled()}catch(z){throw P()||o.logShowPipelineError(`${O}failed`,{showId:w,contentApplied:A,sandboxInitedAcked:L,superseded:!1,...e.describeSurface?.(),error:String(z)}),!P()&&Na(t(),w)&&t().failShow(w,z),z}finally{k(w,b,O,{superseded:P(),sessionGeneration:J,contentApplied:A,sandboxInitedAcked:L,commit:N()})}}function k(w,b,x,P){const{superseded:Y,contentApplied:J,sandboxInitedAcked:N}=P;if(Y){`${x}`;return}N&&P.commit?u.fireInit(w,b||void 0):N?o.logShowPipelineError(`${x}aborted (stale session or signal)`,{showId:w,sessionGeneration:P.sessionGeneration,currentGeneration:t().generation,aborted:t().signal.aborted}):J?o.logShowPipelineError(`${x}aborted (sandbox INITED ack missing)`,{showId:w}):o.logShowPipelineError(`${x}aborted (content not applied)`,{showId:w}),n=!1,d=void 0,!N&&i===w&&(i=void 0,r===a&&(r=void 0)),!N&&J&&f(w,b)}return{channel:u,isEventsLocked:()=>n,filledGeneration:()=>r,markFilled:w=>{r=w},lastCorrelation:()=>i,markCorrelation:w=>{i=w},bumpRunSeq:()=>{c+=1},noteSandboxGeneration:w=>{a=w},fill:w=>E(w,!1),refill:w=>E(w,!0),stop:()=>{c+=1,h(),n=!1,_?.removeEventListener("abort",h),_=void 0}}}function oh(e,t,n){if(!e?.renderGuid||!e.showId||e.showId!==t.showId)return!1;if(t.isNew)return e.id==null;const r=t.emailId??t.navId;return r!=null&&String(e.id??"")!==String(r)?!1:Da(e,n)}function Da(e,t){return t?e?.id==null?!1:String(e.id)===String(t):!0}function rh(e){const{pipeline:t,readEmail:n,readDocument:r,readRouteEmailId:i,readSandboxGeneration:a}=e,c=f=>{const h=n(),_=i();if(!oh(h,f,_)){f.showId,f.navId,f.emailId,h?.id,h?.showId,h?.renderGuid;return}f.showId,h?.id,h?.renderGuid,t.markFilled(a()),t.markCorrelation(f.showId),t.fill(f.showId).catch(()=>{})};return{showRequested:f=>{c(f)},showRequestIdentityChanged:()=>{const f=e.initPipeline().getActiveShowRequest();f&&c(f)},selfInitChanged:()=>{if(e.initPipeline().getActiveShowRequest())return;const f=a();if(t.filledGeneration()===f)return;const h=n(),_=i();if(!h?.renderGuid||!Da(h,_))return;const p=`${Ma}${h.renderGuid}`;t.markFilled(f),t.markCorrelation(p);const E=r()?.isReady()===!0;h.id,h.renderGuid,(E?k=>t.refill(k):k=>t.fill(k))(p).catch(()=>{t.lastCorrelation()===p&&t.markFilled(void 0)})},saasChanged:()=>{const f=n();f?.renderGuid,f?.showToken,f?.id}}}var Fa=g.createIdentifier$1("canvas.sandboxFill"),ih=class extends Error{showId;constructor(e,t){super(`[emailmaker] show() timed out after ${t}ms waiting for editor init (showId=${e}). Check earlier console errors: wrong host-plugin publicPath (chunks return HTML), mount element removed without destroy(), or sandbox init never completed. Search for [show-pipeline] and [AMD] messages.`),this.name="ShowPipelineTimeoutError",this.showId=e}},ah=class{_activeRequest=null;_pending=new Map;_listeners=new Set;getActiveShowRequest(){return this._activeRequest}onShowRequested(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}requestShow(e,t,n){return this._rejectPending(g.createAbortError("Superseded by newer show()")),n.aborted?Promise.reject(g.createAbortError(n.reason)):(this._activeRequest=e,new Promise((r,i)=>{const a=setTimeout(()=>{this._settle(e.showId,()=>{i(new ih(e.showId,t))})},t);a.unref?.();const c=()=>{this._settle(e.showId,()=>{i(g.createAbortError(n.reason))})};n.addEventListener("abort",c,{once:!0});const d=()=>{clearTimeout(a),n.removeEventListener("abort",c)};this._pending.set(e.showId,{request:e,resolve:r,reject:i,timeoutId:a,dispose:d});for(const u of this._listeners)u(e)}))}completeShow(e){this._settle(e,t=>{t.resolve()})}hasPendingShow(e){return this._pending.has(e)}failShow(e,t){this._settle(e,n=>{n.reject(t)})}rejectAll(e){this._rejectPending(e),this._activeRequest=null}_settle(e,t){const n=this._pending.get(e);n&&(n.dispose(),this._pending.delete(e),this._activeRequest?.showId===e&&(this._activeRequest=null),t(n))}_rejectPending(e){for(const[,t]of this._pending)t.dispose(),t.reject(e);this._pending.clear()}};function sh(e,t){return{contentReady:t.contentReady??e?.contentReady,sandboxReady:t.sandboxReady??e?.sandboxReady,sandbox:t.sandbox?{...e?.sandbox,...t.sandbox}:e?.sandbox}}function lh(e){if(!e||!(e.contentReady!==void 0||e.sandboxReady!==void 0||e.sandbox!==void 0))return;const t=o.resolveContentReadyTimeoutMs(e),n=o.resolveSandboxReadyTimeoutMs(e),r=o.resolveSequentialSandboxOpBudgetMs(e.sandbox);t<n+r}var ch=class{_controller=new AbortController;_externalSignalDisposable=new g.Disposable;_sessionChangeListeners=new Set;_showRegistry=new ah;_timeouts;_generation=0;_sessionStarted=!1;get signal(){return this._controller.signal}get generation(){return this._generation}get contentReadyTimeoutMs(){return o.resolveContentReadyTimeoutMs(this._timeouts)}getSandboxTimeoutMs(e){return o.resolveSandboxOpTimeoutMs(e,this._timeouts?.sandbox)}getSandboxReadyTimeoutMs(){return o.resolveSandboxReadyTimeoutMs(this._timeouts)}bumpGeneration(){this._generation+=1}getActiveShowRequest(){return this._showRegistry.getActiveShowRequest()}onShowRequested(e){return this._showRegistry.onShowRequested(e)}requestShow(e){return this._showRegistry.requestShow(e,this.contentReadyTimeoutMs,this._controller.signal)}completeShow(e){this._showRegistry.completeShow(e)}hasPendingShow(e){return this._showRegistry.hasPendingShow(e)}failShow(e,t){this._showRegistry.failShow(e,t)}rejectAllPendingShows(e){this._showRegistry.rejectAll(e)}onSessionReplaced(e){return this._sessionChangeListeners.add(e),()=>{this._sessionChangeListeners.delete(e)}}configure(e){e.timeouts!==void 0&&(this._timeouts=sh(this._timeouts,e.timeouts),lh(this._timeouts));const t=e.replaceSession===!0||!this._sessionStarted||e.timeouts!==void 0||e.signal!==void 0;this._sessionStarted=!0,t&&(this._replaceSessionController(),this.bumpGeneration()),(e.signal!==void 0||t)&&this._linkExternalSignal(e.signal)}abort(e){const t=e??g.createAbortError("Editor instance destroyed");this._showRegistry.rejectAll(t),this._controller.signal.aborted||(this._controller.abort(t),this.bumpGeneration()),this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new g.Disposable}_replaceSessionController(){this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new g.Disposable,this._showRegistry.rejectAll(g.createAbortError("Init session replaced")),this._controller.signal.aborted||this._controller.abort(g.createAbortError("Init session replaced")),this._controller=new AbortController,this._emitSessionReplaced()}_emitSessionReplaced(){for(const e of this._sessionChangeListeners)e()}_linkExternalSignal(e){if(!e)return;if(e.aborted){this._controller.signal.aborted||(this._controller.abort(e.reason??g.createAbortError()),this.bumpGeneration());return}const t=()=>{this._controller.signal.aborted||(this._controller.abort(e.reason??g.createAbortError()),this.bumpGeneration())};e.addEventListener("abort",t),this._externalSignalDisposable.addDispose(()=>{e.removeEventListener("abort",t)})}},dh=(()=>{const e=new ch;return e.configure({}),e})();function _r(){const e=o.useStore();return(0,l.useMemo)(()=>g.getContainer(e)?.getInstance(g.INIT_PIPELINE_ID)??dh,[e])}function uh(e){const t=_r(),n=(0,l.useRef)(e);n.current=e,(0,l.useEffect)(()=>{let r;const i=()=>{r?.();const c=t.signal;if(c.aborted){n.current();return}const d=()=>n.current();c.addEventListener("abort",d),r=()=>c.removeEventListener("abort",d)};i();const a=t.onSessionReplaced(i);return()=>{a(),r?.()}},[t])}function mh(e){const t=_r(),n=(0,l.useRef)(e);n.current=e,(0,l.useEffect)(()=>t.onShowRequested(r=>n.current(r)),[t])}var ph=(e,t,n,r,i)=>{const a=o.useStore(),c=o.useMessageService(),d=_r(),u=(0,l.useRef)(d);u.current=d;const m=o.useEventEmitter(g.events.WILL_EMAIL_INIT_ID),f=o.useEventEmitter(g.events.ON_EMAIL_INIT_ID),h=o.useEventEmitter(g.events.ON_CONTENT_CHANGED_ID),_=o.useEventEmitter(g.events.ON_EMAIL_CHANGED_ID),p=o.useEventEmitter(g.events.ON_BROWSER_EXTENSION_DETECTED_ID),E=e?.id!==void 0,k=e?.showToken??0,w=k,b=(0,l.useRef)(w);b.current=w;const x=(0,l.useRef)(void 0);x.current=e;const[P,Y]=(0,l.useState)(()=>o.getSandboxGeneration(c)),J=(0,l.useRef)(P);J.current=P,(0,l.useEffect)(()=>(Y(o.getSandboxGeneration(c)),o.onSandboxGenerationChange(c,()=>{Y(o.getSandboxGeneration(c))})),[c]);const N=(0,l.useRef)(r);N.current=r;const O=(0,l.useRef)(t);O.current=t;const A=i?.standalone?void 0:g.getContainer(a)?.getInstance(Fa),L=!A,z=(0,l.useRef)(A?.pipeline);z.current||(z.current=nh({container:g.getContainer(a),messageService:c,initPipeline:()=>u.current,readDocument:()=>N.current,readEmail:()=>x.current,isTemplate:()=>!!O.current,readSandboxGeneration:()=>J.current,events:{willInit:H=>m.fire(H),inited:H=>f.fire(H),contentChanged:H=>h.fire(H),emailChanged:H=>_.fire(H),browserExtensionDetected:()=>p.fire()}}));const B=z.current,$=(0,l.useRef)(n);$.current=n;const de=(0,l.useRef)(void 0);L&&!de.current&&(de.current=rh({pipeline:B,initPipeline:()=>u.current,readEmail:()=>x.current,readDocument:()=>N.current,readRouteEmailId:()=>$.current,readSandboxGeneration:()=>J.current}));const pe=de.current;B.noteSandboxGeneration(J.current),(0,l.useEffect)(()=>{if(L)return()=>z.current?.stop()},[L]),(0,l.useEffect)(()=>{A?.setRoute({emailId:n,isTemplate:t})},[A,n,t]),(0,l.useEffect)(()=>{const H=x.current;if(L&&!B.isEventsLocked()&&e?.renderGuid===H?.renderGuid&&H?.is_inited&&H){const Z=B.channel.readContent();_.fire({...H,id:t||H.isNew?void 0:H.id,html:Z})}},[B,e?.renderGuid,e?.preheader,e?.common_styles,e?.meta,e?.subject,e?.utm_parameters?.utm_campaign||"",e?.utm_parameters?.utm_content||"",e?.utm_parameters?.utm_medium||"",e?.utm_parameters?.utm_source||"",e?.utm_parameters?.utm_term||"",_,t,L]),(0,l.useEffect)(()=>{if(L){const H=o.subscribeToContent(r,()=>{const Z=x.current;if(!B.isEventsLocked()&&e?.renderGuid===Z?.renderGuid&&Z){const De=B.channel.readContent();h.fire(De),_.fire({...Z,id:t||Z.isNew?void 0:Z.id,html:De})}});return()=>H.dispose()}},[r,B,h,_,e,t,L]),uh(()=>{L&&B.stop()}),mh(H=>{pe?.showRequested(H)}),(0,l.useEffect)(()=>{pe?.showRequestIdentityChanged()},[pe,d,e?.renderGuid,e?.showId,e?.id,n]),(0,l.useEffect)(()=>{pe?.selfInitChanged()},[pe,d,e?.renderGuid,e?.showId,e?.id,n,r,P]),o.usePrevious(()=>{pe?.saasChanged()},[e?.renderGuid,k,E,pe]),er(async()=>{if(!L)return;const H=d.getActiveShowRequest()?.showId;H&&(B.markFilled(J.current),await B.refill(H))},{async:!0})};function fh(e){const t=o.useEvent(g.events.ON_EMAIL_INIT_ID);(0,l.useEffect)(()=>{if(!e)return;const n=t(()=>e.clear());return()=>n.dispose()},[e,t])}function hh(e,t){const n=o.useEventEmitter(g.events.ON_DOCUMENT_SESSION_CHANGE);(0,l.useEffect)(()=>{n.fire({document:e,history:t})},[e,t,n])}function gh({templateEmailId:e,templateEmail:t,newEmail:n}){return e?t:n}function yh({routeEmailId:e,draft:t}){const n=o.useStore();(0,l.useRef)(0),(0,l.useEffect)(()=>{},[n,e,t])}function _h(e,t){return t}function bh(e){return!1}function vh({documents:e,push:t,projectId:n,subscription:r}){(0,l.useEffect)(()=>e.onSaved(i=>{i.intent==="publish"&&t({event:"save",action:"save_email",email_id:i.serverId??void 0,project_id:n,subscription:r})}),[e,t,n,r])}function Eh(e){const t=o.useStore();(0,l.useEffect)(()=>{},[t,e])}function Sh(e,t,n){const r=o.useAppNavigate(),i=o.useContainer();(0,l.useEffect)(()=>{},[r,e,t,n,i])}function wh(e){if(!e)return{status:"unknown"};if("status"in e){const t=e.data,n=t&&typeof t=="object"?t.message:void 0,r=typeof n=="string"?n:typeof t=="string"?t:void 0;return{status:String(e.status),message:r}}return{status:e.name??"unknown",message:e.message}}function Ba(e,t,n){const{status:r,message:i}=wh(n);o.reportMessage(`Failed to load ${e} ${t??"?"}: ${r}`,{origin:"entity-load-error",tags:{mechanism:"entity-load-error",entity_type:e,http_status:r},level:"error",contexts:{entity_load_error:{entityType:e,entityId:t,status:r,message:i,url:window.location.href}}})}var{Content:kh}=y.ui_kit$Layout,Ch={paddingTop:"40px"},Th=()=>{const{__:e}=o.useI18n(),{owner:t,admin:n}=Qn(),r=o.useDispatch(),i=Yo(),a=o.useAppNavigate(),{modal:c}=y.ui_kit$App.useApp(),d=o.useAppConfig(),u=o.useRootElement(),m=o.useCookieManager(),f=o.useMessageService(),{emailId:h,preview:_}=o.useRouteParams(),p=o.useEditorProjectId(),E=o.useAppSearchParams(),k=o.useSelector(o.selectIsCodeMode),w=o.useSelector(o.selectActiveModal),b=o.useCurrentUser(),x=o.useProjectData(),P=(0,l.useMemo)(()=>o.createNewEmailDraft(x?{id:Number(x.id),title:x.name}:void 0),[x]),Y=o.useSelector(o.selectIsGlobalLoading),[J]=o.useLazyGetMeQuery(),{isSuccess:N,data:O}=o.useGetSubscriptionsQuery(),A=Hf(),[L,z]=(0,l.useState)(!1),[B,$]=(0,l.useState)(!1),[de,pe]=(0,l.useState)(),[H,Z]=(0,l.useState)(null),[De,be]=(0,l.useState)(!1),[et,ve]=(0,l.useState)(!1),[fe,K]=(0,l.useState)(!1),[me,ie]=(0,l.useState)(!1),[ae,Ae]=(0,l.useState)(!1),Te=(0,l.useRef)(),{confirm:Fe}=c,{counters:X,subscription:Ee}=b,Ie=X?.emails_counter;m.get(o.APP_COOKIES.em_template_email);const he=E.get("template")||!B&&!h&&m.get(o.APP_COOKIES.em_new_email),{isSuccess:Re,isLoading:$e,isError:C,error:T,data:R}=Wf(h?void 0:he),D=gh({templateEmailId:he,templateEmail:R,newEmail:P});yh({routeEmailId:h,draft:D});const{document:I,email:S,error:se}=o.useOpenEmail(),we=S?.id!=null?String(S.id):void 0,Ke=_h(h,we);(0,l.useEffect)(()=>{},[h,we,I,he]),Sh(h,S?.id,p);const Qe=o.useStore(),ze=o.getEmailDocuments(g.getContainer(Qe)),Ze=(0,l.useCallback)((ce,ke)=>ze.save(ce,ke),[ze]),mt=(0,l.useCallback)(()=>ze.saveState(),[ze]),vt=o.usePushToDataLayer();vh({documents:ze,push:vt,projectId:p,subscription:Ee?.post_title}),(0,l.useEffect)(()=>{!B&&S?.id&&$(!0)},[$,B,S?.id]);const ft=ze.history();hh(I,ft),fh(ft),ph(S,bh(h),Ke,I);const lt=Zo({document:I,history:ft});Qf(S,I,ze.saveState().saving,ze),Eh(p),(0,l.useEffect)(()=>{o.injectEmailRightsResolver(g.getContainer(Qe),ce=>!!(t||n||b.id?.toString()===ce?.author?.toString()))},[Qe,t,n,b.id]);const G=np({email:S,save:Ze,saveState:mt,documentSession:I}),{outdatedBlocks:V,isOpen:te,close:ue}=wf({projectId:p,document:I});Kf({projectId:p,project:x,emailProjectId:S?.project,parentEmailId:S?.parent_email});const ge=w===o.MODALS.ADD_NEW_EBLOCK_MODAL,Ge=kn(ge),qe=kn(fe),{isPromptOpen:at,isConverting:Bt,progress:Oe,isErrorOpen:Xe,errorMessage:re,confirmConversion:ee,cancelPrompt:U,retryConversion:le,closeError:xe,neverSuggestAgain:Se,setNeverSuggestAgain:Me}=$f(),We=se??(he?T:void 0),Be=!!We,rt=!S&&!Be,fn=!!S;(0,l.useEffect)(()=>{Be&&We&&Ba("email",h||he,We)},[Be,We,h,he]),(0,l.useEffect)(()=>{he&&Re&&($(!0),E.set({}))},[he,Re,E]),(0,l.useEffect)(()=>(r(o.switchIsPanelHistoryCollapsed(!0)),()=>r(o.switchIsPanelHistoryCollapsed(!0))),[r]);const Lt=(0,l.useCallback)(()=>{i.toggle(),r(o.resetPanes())},[r,i]);(0,l.useEffect)(()=>{_&&!k&&Lt()},[k,_,Lt]),(0,l.useEffect)(()=>{document.body.classList.add("editor"),r(o.setActiveSettingsTab(o.BUILD))},[r]),(0,l.useEffect)(()=>{!L&&Ie<3&&(J(),z(!0))},[J,Ie,L]);const ct=(0,l.useCallback)(()=>{lt.undo()},[lt]),Et=(0,l.useCallback)(()=>{lt.redo()},[lt]);(0,l.useEffect)(()=>{Te.current!==S?.id&&(lt.clear(),Te.current=S?.id)},[S,lt]);const Ot=(0,l.useCallback)(ce=>{(window.navigator.appVersion.indexOf("Mac")&&ce.metaKey||ce.ctrlKey)&&ce.code==="KeyZ"&&(ce.preventDefault(),ce.shiftKey?Et():ct())},[ct,Et]);(0,l.useEffect)(()=>()=>{r(o.resetPanes()),r(o.closeModal()),r(o.closeModal$1()),r(o.resetElementHistorySlice())},[r]);const jn=(0,l.useCallback)(ce=>{const ke=()=>{r(o.openModal(o.MODALS.ADD_NEW_EBLOCK_MODAL))},Ne=ce.data.operation,nt=ce.data,je=ce.data.action,Kt=u.querySelector("#iframe-scroll-top"),Ut=u.querySelector("#iframe-scroll-bottom");if(Ne===o.EVENT_TYPES.APPLICATION_EBLOCK_ADD){const dt=nt.settings?.emBlockId;dt?Z({html:nt.data,emBlockId:String(dt)}):(pe(nt.data),ke())}if(Ne===o.EVENT_TYPES.APPLICATION_ACTION&&(je==="undo"?ct():je==="redo"&&Et()),Ne===o.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_SHOW){const dt=u.querySelector("#email_iframe_slot"),Nn=document.body.getBoundingClientRect().height,$t=dt.getClientRects()[0];$t.top<0&&(Kt.style.display="block"),$t.top+$t.height>Nn&&(Ut.style.display="block")}Ne===o.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_HIDE&&(Kt.style.display="none",Ut.style.display="none")},[r,ct,Et,u]);o.useListenPostMessage(jn);const Ln=ce=>{if(ce.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const ke=ce.dataTransfer,Ne=(ke?Array.from(ke.types||[]):[]).includes(o.DND_SOCIAL_LIST_REORDER_MIME),nt=typeof ce.composedPath=="function"?ce.composedPath():[];ce.target?.closest?.(".selected-social-form")||nt.some(je=>je&&je.nodeType===1&&typeof je.classList?.contains=="function"&&je.classList.contains("selected-social-form"))||Ne||(ce.preventDefault(),ce.target&&f.send({operation:o.EVENT_TYPES.SANDBOX_DRAG_CANCEL}),u.querySelectorAll(".em-dragging-element").forEach(je=>{je.classList.remove("em-dragging-element")}))},hn=(0,l.useRef)({});(0,l.useEffect)(()=>{const ce=new g.Disposable,ke=Ne=>nt=>hn.current[Ne]?.(nt);return ce.addDisposable(o.addWindowListenerFromShadow(u,"drop",ke("drop"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragover",ke("dragover"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragstart",ke("dragstart"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragend",ke("dragend"))),()=>{ce.dispose()}},[u]),(0,l.useEffect)(()=>(window.addEventListener("keydown",Ot),()=>{window.removeEventListener("keydown",Ot)}),[Ot]);const On=ce=>{if(ce.preventDefault(),ce.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const ke=u.querySelector("#iframe-scroll-top"),Ne=u.querySelector("#iframe-scroll-bottom"),nt=d.sidePanelFloating?u.querySelector("#pane-content-wrapper"):u.querySelector(".email-pane__col_preview"),je=u.querySelector(".blocks-app").getBoundingClientRect().top,{height:Kt,top:Ut}=u.querySelector("#email_iframe_slot").getBoundingClientRect(),dt=nt.getBoundingClientRect().height;Ut>96?ke.style.display==="block"&&(ke.style.display="none"):(ke.style.display==="none"||ke.style.display==="")&&(ke.style.display="block"),Kt-dt+Ut-je<44?Ne.style.display==="block"&&(Ne.style.display="none"):Ne.style.display==="none"&&(Ne.style.display="block"),ce.target===ke&&nt.scrollBy(0,-15),ce.target===Ne&&nt.scrollBy(0,15)},Mn=()=>{const ce=u.querySelector("#iframe-scroll-top"),ke=u.querySelector("#iframe-scroll-bottom");ce&&ke&&(ce.style.display="none",ke.style.display="none"),u.querySelectorAll(".em-dragging-element").forEach(Ne=>{Ne.classList.remove("em-dragging-element")})},ht=ce=>{const ke=ce.target,Ne=ke instanceof Element?ke:ke.parentElement;if(!(Ne instanceof Element)||Ne.closest(".selected-social-form"))return;Ne.parentElement?.classList.add("em-dragging-element");const nt=!!Ne.closest(".blocks-search__result-wrapper");var je=nt?o.cloneBlockPreviewForDrag(Ne.querySelector(".blocks-search__result-html")):Ne.cloneNode(!0);je.classList.add("em-ghost-element"),je.style.height=nt?"auto":"70px",je.style.width=nt?"600px":"109px",je.style.position="absolute",je.style.top="0",je.style.left="0",je.style.zIndex="-1",Ne.appendChild(je),ce.dataTransfer.setDragImage(je,0,0),window.setTimeout(function(){je.parentNode.removeChild(je)},1e3)};hn.current={drop:Ln,dragover:On,dragstart:ht,dragend:Mn};const St=(0,l.useCallback)(()=>{Fe({title:e("You reached the plan limit"),icon:(0,s.jsx)(o.EmIcons,{icon:"ExclamationCircleOutlined",component:y.icons$ExclamationCircleOutlined}),content:(0,s.jsx)("div",{style:{maxWidth:"330px"},children:e("Switch to a different plan to save more emails.")}),centered:!0,okText:e("Choose a plan"),cancelText:e("Continue without saving"),width:"unset",onOk(){a("/billing")},onCancel(){}})},[a,e,Fe]);return(0,l.useEffect)(()=>{if(N&&O){const ce=O?.find(ke=>ke.id?.toString()===Ee?.ID?.toString())?.limits?.emails_limit;ce&&Ie>=ce&&!De&&!h&&t&&(St(),be(!0))}},[O,N,Ee,Ie,De,St,h,t]),(0,l.useEffect)(()=>{const ce=f.onInit(()=>{f.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1})});return()=>ce.dispose()},[f]),(0,s.jsx)(o.DocumentSessionProvider,{document:I,history:ft,children:(0,s.jsx)(_a.Provider,{value:G,children:(0,s.jsxs)(y.ui_kit$Layout,{className:"email-page",children:[rt&&(0,s.jsx)(y.ui_kit$PageLoader,{}),!rt&&A.status==="pending"&&(0,s.jsx)(y.ui_kit$PageLoader,{}),A.status==="error"&&(0,s.jsx)(kh,{style:Ch,children:(0,s.jsx)("div",{className:"container",children:(0,s.jsx)(y.ui_kit$Result,{status:"warning",title:e("Failed to load plan data"),subTitle:e("Editor features depend on your plan. Check your connection and try again."),extra:(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:A.retry,children:e("Try again")})})})}),Be&&We&&!1,S&&!rt&&A.status==="ready"&&(0,s.jsxs)(y.ui_kit$Layout,{className:"email-pane",children:[Y&&(0,s.jsx)("div",{className:"email-pane__loader",children:(0,s.jsx)(y.ui_kit$PageLoader,{small:!0})}),(0,s.jsx)(xa,{email:S,isCollaborationEditor:et}),(0,s.jsx)(Wm,{emailElement:S,isSuccess:fn,setIsCollaborationEditor:ve,setIsShowAddAllBlocksModal:K,triggerOpenSavedBlocksTab:me})]}),Ge&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Lu,{isModalVisible:ge,htmlContent:de,projectId:p,setIsShowAddAllBlocksModal:K,setIsShowAddAllBlocksModalForNewEmail:Ae,currentEmail:S})}),(0,s.jsx)(vf,{open:te,blocks:V,projectId:p,onClose:ue}),(0,s.jsx)(kf,{open:!!H,html:H?.html,emBlockId:H?.emBlockId,onSaveAsNew:()=>{pe(H?.html),Z(null),r(o.openModal(o.MODALS.ADD_NEW_EBLOCK_MODAL))},onClose:()=>Z(null)}),qe&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Ou,{isModalVisible:fe,currentEmail:S,setIsShowAddAllBlocksModal:K,setTriggerOpenSavedBlocksTab:ie,autoStart:!ae,projectId:p})}),(0,s.jsx)(Af,{open:at,onConfirm:ee,onCancel:U,neverSuggestAgain:Se,onNeverSuggestAgainChange:Me}),(0,s.jsx)(Rf,{open:Bt,progress:Oe}),(0,s.jsx)(Pf,{open:Xe,message:re,onRetry:le,onCancel:xe})]})})})};function Ih(){const e=o.useStore(),t=o.getEmailDocuments(g.getContainer(e)),n=(0,l.useCallback)(r=>t.subscribe(r),[t]);return(0,l.useSyncExternalStore)(n,()=>!!t.current())}function Ah(e,t){const n=o.useStore(),r=o.useAppConfig(),i=o.useStorageProvider();(0,l.useRef)(new Set),(0,l.useEffect)(()=>{},[e,t,r,n,i])}var xh=30;function Ph(e){const t=o.useContainer(),n=o.useGetProjectQuery(+e,{skip:!e,refetchOnMountOrArgChange:xh}),{isSuccess:r,isError:i,error:a,data:c,isFetching:d}=n;Ah(e,r),(0,l.useEffect)(()=>{t&&o.setCurrentProjectRefreshing(t,d)},[t,d]),(0,l.useEffect)(()=>{t&&r&&c&&String(c.id)===String(e)&&o.setCurrentProjectCard(t,c)},[r,c,t,e]),(0,l.useEffect)(()=>{i&&a&&Ba("project",e,a)},[i,a,e]);const u=o.useProjectData(),m=!!u&&String(u.id)===String(e);return{...n,projectReady:m}}var An=o.createApi({reducerPath:"promoApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:t,type:n},r)=>o.clientFromApi(r).promo.set_code_create({code:t,type:n})}),getPromoInfo:e.query({queryFn({code:t},n){return o.clientFromApi(n).promo.get_code_info_list({code:t})}})})}),{useCheckPromoMutation:yv,useGetPromoInfoQuery:_v}=An;function Rh(){const e=o.useContainer(),[t,n]=(0,l.useState)();return(0,l.useEffect)(()=>{if(!e)return;let r=!0;return o.getAppProject(e).then(i=>{r&&i!=null&&n(String(i))},()=>{}),()=>{r=!1}},[e]),t}var jh=()=>{const e=o.useDispatch(),t=o.useCookieManager(),n=o.useCurrentUser(),r=o.useContainer();(0,l.useEffect)(()=>{const a=n?.code_editor;a&&r&&o.applyEditorOptions(r,a)},[n,r]),(0,l.useEffect)(()=>{const a=t.get(o.APP_COOKIES.em_token),c=t.get(o.APP_COOKIES.promocode);a&&c&&(e(An.endpoints.checkPromo.initiate({code:c,type:"by_link"})),t.remove(o.APP_COOKIES.promocode))},[e,t]),o.useNotifyCommand();const i=Ih();return Ph(Rh()),i?(0,s.jsx)(Zl,{hasEmail:!0,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Th,{})})}):null};function Lh(e,t){const n=(0,l.useRef)(!1);(0,l.useEffect)(()=>{!e||n.current||(n.current=!0,o.mark(o.PHASES.appVisible),t&&Ht(t).noteShellVisible())},[e,t])}var xn=new WeakMap,Oh="data-emailmaker-config-styles";function Mh(e){return typeof e=="string"?e.trim():""}function Ua(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function Nh(e,t,n){if(!e||typeof document>"u")return null;const r=Mh(t),i=xn.get(e),a=n||e;if(!r)return i&&(i.remove(),xn.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&Ua(a,i),i;const c=document.createElement("style");return c.setAttribute(Oh,"true"),c.textContent=r,Ua(a,c),xn.set(e,c),c}function br(e){if(!e)return;const t=xn.get(e);t&&(t.remove(),xn.delete(e))}var Dh={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},Fh=({children:e,handleBeforeRender:t})=>{const[n,r]=(0,l.useState)(),i=o.useIsLocaleInited();Lh(i,o.useContainer());const a=o.useAppConfig().styles,c=(0,l.useRef)(null),d=(0,l.useRef)(!1),u=(0,l.useRef)(void 0),m=o.useRootElement();return(0,l.useLayoutEffect)(()=>{d.current||(d.current=!0,t&&t())},[]),(0,l.useLayoutEffect)(()=>{if(!m){u.current&&(br(u.current),u.current=void 0);return}u.current&&u.current!==m&&br(u.current),Nh(m,a,c.current||void 0),u.current=m},[m,a]),(0,l.useLayoutEffect)(()=>()=>{u.current&&(br(u.current),u.current=void 0)},[]),(0,s.jsxs)(y.ui_kit$StyleProvider,{container:o.findShadowRoot(m)||document.head,children:[(0,s.jsxs)("div",{ref:c,className:"App blocks-app blocks-plugin",style:i?{}:{visibility:"hidden"},children:[(0,s.jsx)(o.ModalRootContext.Provider,{value:n,children:e}),(0,s.jsx)("div",{ref:r,className:"blocks-modal-container"})]}),!i&&(0,s.jsx)(y.ui_kit$Space,{size:"large",style:Dh,children:(0,s.jsx)(y.ui_kit$Spin,{size:"large"})})]})};async function Bh({container:e,renderTarget:t,mapKey:n,disposable:r,chunkLoadedFire:i}){const a=await e.getInstanceAsync(g.STORE_ID);return new Promise(c=>{if(r.isDisposed()){c();return}const d=(0,il.createRoot)(t),u=(0,s.jsx)(o.Provider,{store:a,children:(0,s.jsx)(Vl,{onLoad:c,children:(0,s.jsx)(o.RootContext.Provider,{value:{element:n},children:(0,s.jsx)(y.ui_kit$StyleProvider,{container:o.isDocumentFragment(n)?document.head:n,children:(0,s.jsx)(o.LocaleProvider,{children:(0,s.jsx)(Fh,{handleBeforeRender:i,children:(0,s.jsx)(hl,{children:(0,s.jsx)(ql,{children:(0,s.jsx)(jh,{})})})})})})})})});d.render(u),r.addDispose(c),r.addDispose(()=>{try{d.unmount()}catch(m){if(m instanceof DOMException&&m.name==="NotFoundError"||m instanceof Error&&m.name==="NotFoundError"&&/removeChild/i.test(m.message)){o.logShowPipelineError("mount:unmount-dom-mismatch (host container was already removed)",{hint:"Usually harmless during host React StrictMode teardown. Ensure instance.destroy() runs before the host removes the mount container."});return}throw m}}),r.addDispose(()=>{g.ELEMENT_MAP.delete(n)})})}var bv="multiple init call on single HTMLELEMENT",Uh=zn(async e=>{let t=null,n=!1;const r=g.getEmitter(e,g.events.ON_CHUNKS_LOADED),i=e.getInstance(g.DISPOSABLE_ID);let a,c=!1;const d=()=>{c||(c=!0,o.mark(o.PHASES.chunksLoaded),r.fire())},u=(m,f)=>Bh({container:e,renderTarget:m,mapKey:f,disposable:a,chunkLoadedFire:d});return{instance:{getElement(){return t}},async setOptions(m){const f=e.getInstance(g.INIT_PIPELINE_ID),h=await g.waitForElement(m.element,i,f.signal),_=e.getInstance(g.INSTANCE_ID),p=!!m.hidden&&!!h;if(t===h&&n===p)return;const E=t===h&&n&&!p;n=p,i.addDisposable(r.event(()=>{m.handleChunkLoaded&&m.handleChunkLoaded()})),t&&g.ELEMENT_MAP.delete(t),h&&g.ELEMENT_MAP.has(h),a&&a.dispose(),a=i.addDisposable(new g.Disposable);const k=m.element!==void 0;if(o.setHeadlessMode(e,!h||p),o.setHiddenMount(e,p),!h){o.mark(o.MOUNT_HEADLESS_MARK);const b=document.createElement("div");b.style.position="absolute",b.style.left="-10000px",b.style.top="-10000px",b.style.width="1600px",b.style.height="1000px",document.body.appendChild(b),t=b,d(),a.addDispose(()=>{b.parentNode===document.body&&b.remove()});return}const w=o.findShadowRoot(h);if(w&&a.addDisposable(new fl({shadowRoot:w})),k&&h instanceof Element){const b=h;ll(b,()=>{i.isDisposed()||a?.isDisposed()||(o.logShowPipelineError("mount:detached (host removed element without destroy)",{elementId:b.id||null}),f.abort(sl()))},a)}if(p){o.mark(o.MOUNT_HEADLESS_MARK),t=h,d();return}if(k&&h instanceof Element){const b=h,x=ml(b);t=b;const P=u(x,b);return pl(b,x,a),P}return t=h,u(h,h)},dispose(){a&&!a.isDisposed()&&a.dispose()}}});function vr(e){return zn(async t=>(await t.getInstanceAsync(g.STORE_ID),await e(t)))}function $h({html:e,renderGuid:t,...n},r){const{requested:i}=o.getCurrentProject(r);return o.filterUndefined({...n,code:rn(r).toOutputForm(e),project:i===void 0?n.project:i,guid:void 0,link:void 0,status:void 0,slug:void 0,password:void 0,comment_status:void 0,template:void 0,blocktags:void 0,project_title:void 0,ping_status:void 0,lock:void 0,tag:void 0,is_template:void 0})}function zh(e,t){return o.filterUndefined({...e,link:void 0,comment_status:void 0})}function Gh({html:e,...t},n){return o.filterUndefined({...t,code:e,guid:void 0,compiled:o.filterUndefined({html:e,ampHtml:e&&""})})}var $a=e=>{const t={current:Promise.resolve(),state:e,decorate:(n,r)=>(r&&(n=n.bind(r)),function(...i){const a=t.current.then(()=>n(...i));return t.current=a.then(c=>{t.state=c},c=>{}),a})};return t},Wh=g.createIdentifier$1("emailTemplate.reads");async function Hh(e,t){try{return await o.getRestEmailPortFactories(e).email(e).readEmail(t)??void 0}catch(n){o.logShowPipelineError("show:template-read-failed",{templateId:t,error:n instanceof Error?n.message:"неизвестная ошибка"});return}}function qh(e,t){const n=e.getOrCreateInstance(Wh,()=>new Map),r=n.get(t);if(r!==void 0)return r;const i=Hh(e,t).then(a=>(a===void 0&&n.delete(t),a));return n.set(t,i),i}var kt=class extends g.Disposable{_event;_listener;_disposeEvent;constructor(e){super(),this._event=e}setListener(e){this._listener!==e&&(this._listener=e,this._disposeEvent&&this._disposeEvent(),e?this._disposeEvent=this._event(e):this._disposeEvent=void 0)}dispose(){this._disposeEvent&&this._disposeEvent(),super.dispose()}};function Ct(e,t,n){const r=g.snapshot(e);return(i,a,c)=>{const d=r(async u=>{const m=t?t(u):u;c&&i.bind(c);const f=await i(m);return n?n(f):f},a,c);return()=>d.dispose()}}var vv=g.createIdentifier("application_block_inserted"),Ev=g.createIdentifier$1("DataController"),Sv=g.createIdentifier$1("DataEvents"),Vh=g.createIdentifier$1("plugin.startupShow");function Yh(e){return e.getInstance(Vh)?.current??Promise.resolve()}var za=vr(async()=>({instance:{}})),Ga=vr(async e=>({instance:{},async setOptions(){await Yh(e)}})),wv=g.combineMixins([za,Ga]),Wa=()=>({title:"",description:"",website:"",company_size:"",industry:"",email:"",phone:"",logo_url:""}),Kh={title:"title",description:"description",website:"website",company_size:"company_size",industry:"industry",email:"email",phone:"phone",logo_url:"logo"},Ha=e=>({...Wa(),title:e?.title??"",description:e?.description??"",website:e?.website??"",company_size:e?.company_size??"",industry:e?.industry??"",email:e?.email??"",phone:e?.phone??"",logo_url:e?.logo??""}),qa=e=>(e??[]).filter(t=>!!t?.code).map(({code:t,label:n})=>({value:t,label:n??t})),Qh=e=>({company_sizes:qa(e?.company_sizes),industries:qa(e?.industries)}),kv=Object.keys(Wa()),Va="ProjectProfile",Pn=o.createApi({reducerPath:"projectSettingsProfileApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Va],endpoints:e=>({getProjectProfile:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(g.getContainer(n)).projects.profileList({id:String(t)}));return"error"in r?{error:r.error}:{data:Ha(r.data)}},providesTags:(t,n,r)=>[{type:Va,id:String(r)}]}),getProjectProfileOptions:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(g.getContainer(n)).projects.profileOptionsList());return"error"in r?{error:r.error}:{data:Qh(r.data)}}}),updateProjectProfileField:e.mutation({async queryFn({projectId:t,field:n,value:r},i){const a={[Kh[n]]:r},c=o.v2ResultOf(await o.getClientV2(g.getContainer(i)).projects.profilePartialUpdate({id:String(t)},a));return"error"in c?{error:c.error}:{data:Ha(c.data)}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;n(Pn.util.updateQueryData("getProjectProfile",t,()=>i))}catch{}}})})}),{useGetProjectProfileQuery:Cv,useGetProjectProfileOptionsQuery:Tv,useUpdateProjectProfileFieldMutation:Iv}=Pn,Ya="ProjectStorage",Rn=o.createApi({reducerPath:"projectSettingsStorageApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Ya],endpoints:e=>({getProjectStorage:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(g.getContainer(n)).projects.storageList({id:String(t)}));return"error"in r?{error:r.error}:{data:r.data}},providesTags:(t,n,r)=>[{type:Ya,id:String(r)}]}),updateProjectStorage:e.mutation({async queryFn({projectId:t,body:n},r){const i=o.v2ResultOf(await o.getClientV2(g.getContainer(r)).projects.storageUpdate({id:String(t)},n));return"error"in i?{error:i.error}:{data:i.data}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:r}){const{data:i}=await r;n(Rn.util.upsertQueryData("getProjectStorage",t,i))}}),testProjectStorageConnection:e.mutation({async queryFn({projectId:t,body:n},r){const i=o.v2ResultOf(await o.getClientV2(g.getContainer(r)).projects.storageTestCreate({id:String(t)},n));return"error"in i?{error:i.error}:{data:i.data}}})})}),{useGetProjectStorageQuery:Av,useUpdateProjectStorageMutation:xv,useTestProjectStorageConnectionMutation:Pv}=Rn,Xh=class{http;constructor(e){this.http=e}settings_summary_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/settings-summary/${e}`,method:"GET",...n})},Ka=class{http;constructor(e){this.http=e}developer_credentials_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"GET",...n});developer_credentials_partial_update=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"PATCH",...n});developer_credentials_rotate_secret_create=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/rotate-secret`,method:"POST",...n});developer_credentials_verify_secret_create=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/verify-secret`,method:"POST",...n})},Jh=class{http;constructor(e){this.http=e}developer_kit_postman_collection_list=(e={})=>this.http.request({path:"/projects/v1/developer-kit/postman-collection",method:"GET",...e})},Zh=class{http;constructor(e){this.http=e}billing_context_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/billing-context/${e}`,method:"GET",...n});billing_context_payments_list=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/billing-context/${e}/payments`,method:"GET",query:t,...n})},eg=class{http;constructor(e){this.http=e}usage_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/usage/${e}`,method:"GET",...n});usage_timeseries_list=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/usage/${e}/timeseries`,method:"GET",query:t,...n})},Ye={PLUGIN_INIT:"plugin_init",LINK_CHECK:"link_check",IMAGE_CHECK:"image_check",SPAM_ASSASSIN:"spam_assassin",AI_IMAGE:"ai_image",AI_WRITE:"ai_write",AI_REPHRASE:"ai_rephrase"},Zt={TODAY:"today",WEEK:"week",MONTH:"month",CUSTOM:"custom"},Rv=[Ye.PLUGIN_INIT,Ye.LINK_CHECK,Ye.IMAGE_CHECK,Ye.SPAM_ASSASSIN,Ye.AI_IMAGE,Ye.AI_WRITE],ln={current:0,limit:null},tg=()=>({pluginInit:{...ln},aiAssistant:{...ln},aiImage:{...ln},linkCheck:{...ln},imageCheck:{...ln},spamAssassin:{...ln}}),tt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Je=(e,t,n="")=>{for(const r of t){const i=e[r];if(typeof i=="string")return i;if(typeof i=="number"&&Number.isFinite(i))return String(i)}return n},Ft=(e,t,n=0)=>{for(const r of t){const i=e[r];if(typeof i=="number"&&Number.isFinite(i))return i;if(typeof i=="string"&&i.trim()&&Number.isFinite(Number(i)))return Number(i)}return n},Er=(e,t,n=!1)=>{for(const r of t){const i=e[r];if(typeof i=="boolean")return i}return n},Eo=(e,t)=>{for(const n of t){const r=e[n];if(r===null)return null;if(typeof r=="number"&&Number.isFinite(r))return r;if(typeof r=="string"&&r.trim()&&Number.isFinite(Number(r)))return Number(r)}return null},ng=new Set(Object.values(Ye)),og=e=>ng.has(e)?e:null,en=e=>tt(e)&&"data"in e&&(e.ok===!0||typeof e.success=="boolean"||e.success===void 0)?e.data:e,cn=(e,t)=>{for(const n of t){const r=e[n];if(tt(r))return r}return null},rg=(e,t)=>{for(const n of t){const r=e[n];if(!Array.isArray(r))continue;const i=r.filter(a=>typeof a=="string");if(i.length>0)return i}},ig=e=>tt(e)?{clientId:Je(e,["clientId","client_id"]),clientSecretConfigured:Er(e,["clientSecretConfigured","client_secret_configured"]),rotatedAt:Je(e,["rotatedAt","rotated_at"])||void 0,scopesSuggested:rg(e,["scopesSuggested","scopes_suggested"])}:{clientId:"",clientSecretConfigured:!1},Qa=(e,t)=>{for(const n of t){const r=e[n];if(typeof r=="boolean")return r}},ag=e=>{const t=Qa(e,["pluginConnected","plugin_connected","connected","is_connected"]);if(t!==void 0)return t;for(const n of["plugin","developer_credentials","developerCredentials"]){const r=cn(e,[n]);if(!r)continue;const i=Qa(r,["connected","plugin_connected","is_connected"]);if(i!==void 0)return i;const a=Je(r,["clientId","client_id"]),c=Er(r,["clientSecretConfigured","client_secret_configured"]);if(a)return c}},sg=e=>{const t=en(e);if(!tt(t))return{};const n=cn(t,["members"]);return{myRole:Je(t,["myRole","my_role","role"])||(n?Je(n,["myRole","my_role","role"]):"")||void 0,pluginConnected:ag(t)}},lg=e=>tt(e)?{clientId:Je(e,["clientId","client_id"]),secret:Je(e,["secret","clientSecret","client_secret"])}:{clientId:"",secret:""},cg=e=>{if(!tt(e))return null;const t=Je(e,["event","type","key"]),n=og(t);if(!n)return null;const r=e.delta??e.change??e.trend,i=r==null?null:typeof r=="number"&&Number.isFinite(r)?r:Number.isFinite(Number(r))?Number(r):null;return{event:n,total:Ft(e,["total","count","value"],0),delta:i}},Xa=e=>{if(!tt(e))return null;const t=Je(e,["date","day","x"]);if(!t)return null;const n={date:t},r=e.event_counts??e.eventCounts;if(tt(r)){for(const[i,a]of Object.entries(r))typeof a=="number"&&Number.isFinite(a)&&(n[i]=a);return n}for(const[i,a]of Object.entries(e))i==="date"||i==="day"||i==="x"||i==="event_counts"||i==="eventCounts"||typeof a=="number"&&Number.isFinite(a)&&(n[i]=a);return n},dg=e=>{const t=en(e);return tt(t)?(Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:Array.isArray(t.time_series)?t.time_series:Array.isArray(t.history)?t.history:[]).map(Xa).filter(n=>n!==null):[]},ug=e=>{if(!tt(e))return{current:0,limit:null};const t=Ft(e,["current","count","used","value","total"],0),n=Eo(e,["limit","max","quota","cap"]);return{current:t,limit:n===null?null:n}},dn=(e,t)=>{for(const n of t)if(n in e)return ug(e[n]);return{current:0,limit:null}},un={pluginInit:[Ye.PLUGIN_INIT,"plugin_init","pluginInit"],aiAssistant:["ai_assistant","aiAssistant","ai"],aiImage:[Ye.AI_IMAGE,"ai_image","ai_img","aiImg"],linkCheck:[Ye.LINK_CHECK,"link_check","linkCheck"],imageCheck:[Ye.IMAGE_CHECK,"image_check","imageCheck"],spamAssassin:[Ye.SPAM_ASSASSIN,"spam_assassin","spamAssassin","spam_check","spamCheck"]},Sr=e=>{const t=tg(),n=en(e),r=tt(n)&&tt(n.usage)?n.usage:n;if(!tt(r))return t;const i=Ft(r,["operationsTotal","operations_total"],0),a=Ft(r,["operationsLast30d","operations_last_30d"],0),c=cn(r,["metrics","counters","limits","events","usage_by_event","usageByEvent"])??r;return{pluginInit:dn(c,un.pluginInit),aiAssistant:dn(c,un.aiAssistant),aiImage:dn(c,un.aiImage),linkCheck:dn(c,un.linkCheck),imageCheck:dn(c,un.imageCheck),spamAssassin:dn(c,un.spamAssassin),lastActivityAt:Je(r,["lastActivityAt","last_activity_at"])||void 0,operationsTotal:i>0?i:void 0,operationsLast30d:a>0?a:void 0}},Ja=(e,t)=>{const n=[{event:Ye.LINK_CHECK,total:e.linkCheck.current,delta:null},{event:Ye.IMAGE_CHECK,total:e.imageCheck.current,delta:null},{event:Ye.SPAM_ASSASSIN,total:e.spamAssassin.current,delta:null},{event:Ye.AI_IMAGE,total:e.aiImage.current,delta:null}],r=t?dg(t):[];return r.length>0?{cards:n,chart:r}:{cards:n,chart:[]}},mg=e=>{const t=en(e);if(!tt(t))return Ja(Sr(e),e);const n=Array.isArray(t.cards)?t.cards:Array.isArray(t.summary)?t.summary:[],r=Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:[];return n.length>0||r.length>0?{cards:n.map(cg).filter(i=>i!==null),chart:r.map(Xa).filter(i=>i!==null)}:Ja(Sr(t),t)},pg=e=>{if(!tt(e))return null;const t=Je(e,["id","payment_id"]);return t?{id:t,date:Je(e,["date","created_at","paid_at"]),amount:Ft(e,["amount","sum"],0),currency:Je(e,["currency"],"RUB"),status:Je(e,["status"],"unknown"),receiptUrl:Je(e,["receiptUrl","receipt_url","pdf_url"])||void 0}:null},fg=e=>{const t=en(e),n=tt(t)&&Array.isArray(t.payments)?t.payments:[];return{payments:n.map(pg).filter(r=>r!==null),page:tt(t)?Ft(t,["page"],1):1,perPage:tt(t)?Ft(t,["perPage","per_page"],20):20,total:tt(t)?Ft(t,["total"],n.length):n.length,totalPages:tt(t)?Ft(t,["totalPages","total_pages"],1):1}},hg=e=>{const t=en(e);if(!tt(t))return{viewerSeesBilling:!1};const n=cn(t,["endpoints"])??{},r=cn(t,["documentLinks","document_links"]),i=r?Object.fromEntries(Object.entries(r).filter(f=>typeof f[1]=="string")):void 0,a=Eo(t,["ownerUserId","owner_user_id"]),c=cn(t,["tariff","plan","subscription"]),d=Je(t,["planDescription","plan_description"])||(c?Je(c,["description","about","plan_description"]):"")||void 0,u=Eo(t,["planPrice","plan_price","price","amount"])??(c?Eo(c,["price","amount"]):null),m=Je(t,["planCurrency","plan_currency","currency"])||(c?Je(c,["currency"]):"")||void 0;return{viewerSeesBilling:Er(t,["viewerSeesBilling","viewer_sees_billing"]),ownerUserId:a??void 0,planName:Je(t,["planName","plan_name"])||void 0,planDescription:d,planPrice:u??void 0,planCurrency:m||void 0,endpoints:{limitsStats:Je(n,["limitsStats","limits_stats"])||void 0,subscriptionMe:Je(n,["subscriptionMe","subscription_me"])||void 0,payments:Je(n,["payments"])||void 0},documentLinks:i&&Object.keys(i).length>0?i:void 0}},gg={myRole:"owner"},yg=()=>({...gg}),_g={clientId:"rust-awkward-bear",clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"},Za=()=>({..._g,clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"}),es=Object.values(Ye),bg={[Ye.PLUGIN_INIT]:42,[Ye.LINK_CHECK]:-15,[Ye.IMAGE_CHECK]:28,[Ye.SPAM_ASSASSIN]:9,[Ye.AI_IMAGE]:6,[Ye.AI_WRITE]:-11,[Ye.AI_REPHRASE]:4},vg=(e,t)=>{const n={date:e};return es.forEach((r,i)=>{const a=Math.sin(t*.65+i*.9),c=t*(i%2===0?.35:.2),d=2+i;n[r]=Math.max(0,Math.round(d+a*4+c))}),n},Eg=e=>es.map(t=>({event:t,total:e.reduce((n,r)=>n+(typeof r[t]=="number"?r[t]:0),0),delta:bg[t]})),Sg=({period:e,dateFrom:t,dateTo:n})=>{const r=(0,En.default)().startOf("day");if(e===Zt.WEEK)return{startDate:r.subtract(6,"day"),days:7};if(e===Zt.MONTH)return{startDate:r.subtract(29,"day"),days:30};if(e===Zt.CUSTOM&&t&&n){const i=(0,En.default)(t),a=(0,En.default)(n);return{startDate:i,days:Math.max(1,a.diff(i,"day")+1)}}return{startDate:r,days:1}},wr=(e={period:Zt.TODAY})=>{const{startDate:t,days:n}=Sg(e),r=Array.from({length:n},(i,a)=>vg(t.add(a,"day").format("YYYY-MM-DD"),a));return{cards:Eg(r),chart:r}},jv=wr({period:Zt.WEEK}),wg={pluginInit:{current:0,limit:null},aiAssistant:{current:0,limit:null},aiImage:{current:42,limit:100},linkCheck:{current:128,limit:500},imageCheck:{current:64,limit:200},spamAssassin:{current:31,limit:150},lastActivityAt:"2026-05-02T12:00:00Z"},ts={payments:[{id:"98765",date:"2026-05-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success",receiptUrl:"https://receipts.example/98765.pdf"},{id:"98764",date:"2026-04-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success"},{id:"98763",date:"2026-03-12T10:15:00+00:00",amount:990,currency:"RUB",status:"failed"}],page:1,perPage:20,total:3,totalPages:1},kg={viewerSeesBilling:!0,ownerUserId:1,planName:"Corporate",planDescription:"For fully addressing all necessary tasks in any field.",planPrice:3200,planCurrency:"RUB",endpoints:{limitsStats:"/wp-json/limits/v1/stats",subscriptionMe:"/wp-json/subscription/v2/me",payments:"/wp-json/projects/v1/billing-context/2581/payments"}},Cg={info:{name:"EmailMaker Plugin Requests",schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:[]},Tg=e=>e,Ig=()=>!1,Ag=()=>!1,xg=e=>e,mn="ProjectPlugin",Pg=()=>({}).REACT_APP_PLUGIN_SETTINGS_USE_MOCK==="true",Vt=(e,t,n)=>e.error&&Pg()?{data:n(t)}:o.transformResponseFn(n)(e),Rg=e=>Tg(ig(e)),jg=e=>xg(hg(e)),Lg=({period:e,dateFrom:t,dateTo:n})=>{if(e===Zt.CUSTOM){const r={};return t&&(r.date_from=t),n&&(r.date_to=n),r}return{period:e??Zt.TODAY}},So=o.createApi({reducerPath:"projectSettingsPluginApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,"")}),tagTypes:[mn],endpoints:e=>({getPluginSummary:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Xh]).settings_summary_detail({projectId:t}).then(r=>Vt(r,yg(),sg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:r}]}),getPluginCredentials:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Ka]).developer_credentials_detail({projectId:t}).then(r=>Vt(r,Za(),Rg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`credentials-${r}`}]}),rotatePluginSecret:e.mutation({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Ka]).developer_credentials_rotate_secret_create({projectId:t}).then(r=>Vt(r,{clientId:Za().clientId,secret:"mock-rotated-secret"},lg))},invalidatesTags:(t,n,{projectId:r})=>[{type:mn,id:`credentials-${r}`}]}),getPostmanCollection:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Jh]).developer_kit_postman_collection_list({extraQuery:{project_id:String(t)}}).then(r=>Vt(r,Cg,i=>en(i)??i))}}),getPluginAnalytics:e.query({queryFn({projectId:t,period:n,dateFrom:r,dateTo:i},a){const c={period:n,dateFrom:r,dateTo:i};return Ig()?Promise.resolve({data:wr(c)}):o.getClient(g.getContainer(a)).request({path:`/projects/v1/usage/${t}/timeseries`,method:"GET",query:Lg(c)}).then(d=>Vt(d,wr(c),mg))}}),getPluginBillingContext:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Zh]).billing_context_detail({projectId:t}).then(r=>Vt(r,kg,jg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`billing-${r}`}]}),getPluginUsage:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[eg]).usage_detail({projectId:t}).then(r=>Vt(r,wg,Sr))}}),getPluginPayments:e.query({queryFn({projectId:t,page:n=1,perPage:r=20},i){return Ag()?Promise.resolve({data:ts}):o.getClient(g.getContainer(i)).request({path:`/projects/v1/billing-context/${t}/payments`,method:"GET",query:{page:String(n),per_page:String(r)}}).then(a=>Vt(a,ts,fg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`payments-${r}`}]})})}),{useGetPluginSummaryQuery:Lv,useGetPluginCredentialsQuery:Ov,useRotatePluginSecretMutation:Mv,useLazyGetPostmanCollectionQuery:Nv,useGetPluginAnalyticsQuery:Dv,useGetPluginBillingContextQuery:Fv,useGetPluginPaymentsQuery:Bv,useGetPluginUsageQuery:Uv}=So,ns="EmailRaw",wo=o.createApi({reducerPath:"emailRawApi",tagTypes:[ns],baseQuery:o.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmailRaw:e.query({queryFn:function({emailId:t,secret_hash:n},r){return g.getApi(g.getContainer(r),[g.WpEmailApi]).email_detail({id:t},{extraQuery:{secret_hash:n}}).then(o.transformResponseFn(o.WpEmailToEmail))},providesTags:(t,n,r)=>[{type:ns,id:r}]})})}),{useGetEmailRawQuery:$v}=wo,ko=o.createApi({reducerPath:"yandexAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateYandexToken:e.mutation({query:t=>({url:"/auth/yandex",method:"POST",body:t})})})}),{useValidateYandexTokenMutation:zv}=ko,Co=o.createApi({reducerPath:"elamaAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateElamaCode:e.mutation({query:t=>({url:"/auth/elama",method:"POST",body:t})})})}),{useValidateElamaCodeMutation:Gv}=Co,To=o.createApi({reducerPath:"googleAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateGoogleToken:e.mutation({query:t=>({url:"/auth/google",method:"POST",body:t})})})}),{useValidateGoogleTokenMutation:Wv}=To,os=async e=>{const t=await e.text();let n=t;try{n=JSON.parse(t)}catch{n=t}return n},Og=(e,t,n)=>{if(!e)throw new Error(`Set ${n}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",headers:{"Content-Type":"application/json"},body:t,responseHandler:os}},Mg=(e,t,n)=>{if(!e)throw new Error(`Set ${n}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t,responseHandler:os}},Io=o.createApi({reducerPath:"requestPlaneApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRequest:e.mutation({query:t=>Mg("https://webhook.latenode.com/5868/prod/9e7a6445-2244-4dd5-bda4-5bca82997bf8",t,"REACT_APP_PIPEDREAM_REQUEST_PLANE_SRC")}),getInvoiceRequest:e.mutation({query:t=>Og("https://webhook.latenode.com/5868/prod/6e2d04a8-6cd9-4ec3-b884-ee2fd67267a3",t,"REACT_APP_REQUEST_PLANE_WEBHOOK_URL")})})}),{useGetRequestMutation:Hv,useGetInvoiceRequestMutation:qv}=Io,Ao=o.createApi({reducerPath:"getCheckoutUrlApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({GetCheckoutUrl:e.mutation({query:t=>({url:`?proxy_url=${encodeURIComponent({}.REACT_APP_PIPEDREAM_GET_CHECKOUT_URL)}`,method:"POST",body:t})})})}),{useGetCheckoutUrlMutation:Vv}=Ao,kr=o.createApi({reducerPath:"recoverPasswordApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/bdpwr/v1/"}),endpoints:()=>({})}),xo=o.createApi({reducerPath:"addUserToProjectApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/user_to_project/v1/add_user"}),endpoints:e=>({addUserToProject:e.mutation({queryFn(t,n){return o.clientFromApi(n).userToProject.add_user_create(t,{type:g.ContentType.FormData})}})})}),{useAddUserToProjectMutation:Yv}=xo,Po=o.createApi({reducerPath:"recurrenceSubscriptionsOffApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getCanselRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/07ae4159-132b-4a00-998b-bc47c20365ba?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetCanselRecurrenceQuery:Kv,useGetCanselRecurrenceQuery:Qv}=Po,Ro=o.createApi({reducerPath:"recurrenceSubscriptionsOnApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/e1dd37b1-c3d4-4441-b329-d6b3aa51bfe7?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetRecurrenceQuery:Xv,useGetRecurrenceQuery:Jv}=Ro,Ng="https://app.emailmaker.ru/api/v2",jo=o.createApi({reducerPath:"authApi",baseQuery:o.fetchBaseQueryApp({baseUrl:Ng,prepareHeaders:e=>{const t=o.api.get(o.APP_COOKIES.em_token);return t&&!e.has("authorization")&&e.set("authorization",`Bearer ${t}`),e}}),endpoints:e=>({login:e.mutation({query:t=>({url:"/auth/token",method:"POST",body:t})}),register:e.mutation({query:t=>({url:"/auth/register",method:"POST",body:t})}),refreshToken:e.mutation({query:t=>({url:"/auth/token/refresh",method:"POST",body:t})}),logout:e.mutation({query:()=>({url:"/auth/token",method:"DELETE"})}),getUser:e.query({query:()=>"/auth/user",transformResponse:t=>{const n=Array.isArray(t)?t[0]:t;return o.WpUserToUser(n)}}),changePassword:e.mutation({query:t=>({url:"/auth/password/change",method:"POST",body:t})}),resetPassword:e.mutation({query:t=>({url:"/auth/password/reset",method:"POST",body:t})}),resetPasswordConfirm:e.mutation({query:t=>({url:"/auth/password/reset/confirm",method:"POST",body:t})})})}),{useLoginMutation:Zv,useRegisterMutation:e0,useRefreshTokenMutation:t0,useLogoutMutation:n0,useGetUserQuery:o0,useLazyGetUserQuery:r0,useChangePasswordMutation:i0,useResetPasswordMutation:a0,useResetPasswordConfirmMutation:s0}=jo;function rs(e){return{id:e.id??0,name:e.name??"",children:(e.children??[]).map(rs)}}function Dg(e){return(e?.folders??[]).map(rs)}function Fg(e){return{items:(e?.items??[]).flatMap(t=>t.id?[{kind:t.kind??"email",id:t.id,name:t.name??"",title:t.title??"",preheader:t.preheader??"",folderId:t.folder_id??0,hasAmp:t.has_amp??!1,previewImage:t.preview_image??"",updatedAt:t.updated_at??"",imported:t.imported??!1}]:[]),total:e?.total??0}}function Cr(e){const t=e.status??"pending";return{id:e.id??"",status:t,outcome:e.outcome,total:e.total??0,imported:e.imported??0,warnings:e.warnings??0,failed:e.failed??0,finished:t==="done"||t==="failed",items:(e.items??[]).map(n=>({kind:n.kind??"email",stripoId:n.stripo_id??0,name:n.name??"",status:n.status??"failed",reason:n.reason,emailId:n.email_id})),createdAt:e.created_at??"",finishedAt:e.finished_at}}function Bg(e){return{selectors:e.map(t=>({kind:t.kind,...t.ids?.length?{ids:t.ids}:{},...t.all?{all:!0}:{},...t.folderId?{folder_id:t.folderId}:{},...t.rootOnly?{root_only:!0}:{},...t.search?{search:t.search}:{}}))}}var Tr="StripoItems",Ir="StripoFolders",Lo="StripoImportJob",pn=(e,t)=>{const n=o.v2ResultOf(e);return"error"in n?{error:n.error}:{data:t(n.data)}},Oo=o.createApi({reducerPath:"stripoImportApi",tagTypes:[Tr,Ir,Lo],baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({saveStripoKey:e.mutation({async queryFn({projectId:t,apiKey:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoKeyUpdate({id:String(t)},{api_key:n}),()=>{})},invalidatesTags:[Tr,Ir]}),getStripoFolders:e.query({async queryFn({projectId:t,kind:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoFoldersList({id:String(t),kind:n}),Dg)},providesTags:[Ir]}),getStripoItems:e.query({async queryFn({projectId:t,kind:n,folderId:r,rootOnly:i,search:a,page:c,limit:d},u){return pn(await o.getClientV2(g.getContainer(u)).projects.stripoItemsList({id:String(t),kind:n,...r?{folder_id:r}:{},...i?{root_only:!0}:{},...a?{search:a}:{},page:c,limit:d}),Fg)},providesTags:[Tr]}),startStripoImport:e.mutation({async queryFn({projectId:t,selectors:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoImportsCreate({id:String(t)},Bg(n)),Cr)},invalidatesTags:[Lo]}),getCurrentStripoImport:e.query({async queryFn(t,n){const r=await o.getClientV2(g.getContainer(n)).projects.stripoImportsCurrentList({id:String(t)});return r.status===204?{data:null}:pn(r,Cr)},providesTags:[Lo]}),getStripoImport:e.query({async queryFn({projectId:t,jobId:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoImportsDetail({id:String(t),jobId:n}),Cr)},providesTags:[Lo]})})}),{useSaveStripoKeyMutation:l0,useGetStripoFoldersQuery:c0,useGetStripoItemsQuery:d0,useLazyGetStripoItemsQuery:u0,useStartStripoImportMutation:m0,useGetCurrentStripoImportQuery:p0,useGetStripoImportQuery:f0}=Oo,Ug=o.createState({activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),$g="projectSlice",Ar=o.createSlice({name:$g,initialState:Ug,reducers:{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(o.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{payload:n,meta:r})=>{const{projectId:i}=r.arg.originalArgs;i?(t.groupsTemplateProjectTotal=+r.baseQueryMeta?.response.headers.get("X-WP-Total"),t.groupsTemplateProjectTotalPages=+r.baseQueryMeta?.response.headers.get("X-WP-TotalPages")):t.groupsTemplateTotal=+r.baseQueryMeta?.response.headers.get("X-WP-Total")})}}),{setActiveGroupsTags:h0,setActiveProjectGroupsTags:g0,resetAllTags:y0}=Ar.actions,zg=o.createState({emailsTotal:0,elementsList:[],emailsTrashTotal:0,elementsTrashList:[],customFolders:{},elementsView:o.CARDS}),Gg="emailsPageSlice";function Wg(e){const t=e?.baseQueryMeta?.response;return Number(t?.headers?.get("X-WP-Total"))||0}function is(e,t){const{emails:n,total:r,isSearch:i,page:a,tagOrFolderId:c}=t;if(t.status==="trash")!i&&r!==void 0&&(e.emailsTrashTotal=r),e.elementsTrashList=n;else if(c){const d=e.customFolders[c];e.customFolders={...e.customFolders,[c]:{list:n,page:a,total:r??d?.total??0}}}else r!==void 0&&(e.emailsTotal=r),e.elementsList=n}var xr=o.createSlice({name:Gg,initialState:zg,reducers:{resetElementsList:e=>{e.elementsList=[]},syncElementsList:(e,{payload:t})=>{is(e,t)},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeEmailFromList:(e,{payload:t})=>{const n=e.customFolders;t.folder!=="all"&&n[t.folder]?.list&&(n[t.folder]={...n[t.folder],list:n[t.folder].list.filter(r=>r.id!==t.emailId),total:n[t.folder].total-1},e.customFolders=n)}},extraReducers:e=>{e.addMatcher(o.emailsApi.endpoints.getEmails.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.arg.originalArgs;is(t,{emails:r,total:Wg(n),status:i?.status,page:i?.page,isSearch:!!i?.name?.length,tagOrFolderId:i?.folderTag||i?.tags?.[0]})}),e.addMatcher(o.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{meta:n,payload:r})=>{const i=+n.baseQueryMeta?.response.headers.get("X-WP-Total")||0;t.elementsList=r,t.emailsTotal=i;const{projectGroup:a,projectId:c,tags:d}=n.arg.originalArgs;(a?.length&&c||d?.length||!d?.length&&!a?.length)&&(t.emailsTotal=i)}),e.addMatcher(o.emailsApi.endpoints.editEmail.matchFulfilled,(t,{payload:n})=>{t.elementsList.map(r=>r.id?.toString()===n.id?.toString()?Object.assign(r,{lock:n.lock,title:n.title,emailtags:n.emailtags}):r)})}}),{toggleElementsView:_0,resetElementsList:b0,syncElementsList:v0,removeEmailFromList:E0}=xr.actions,as=o.combineReducers({[o.di.reducerPath]:o.di.reducer,[o.AiApi.reducerPath]:o.AiApi.reducer,[o.userSlice.name]:o.userSlice.reducer,[o.emailSlice.name]:o.emailSlice.reducer,[o.blockSlice.name]:o.blockSlice.reducer,[o.imageApi.reducerPath]:o.imageApi.reducer,[An.reducerPath]:An.reducer,[yo.reducerPath]:yo.reducer,[Ar.name]:Ar.reducer,[o.blocksApi.reducerPath]:o.blocksApi.reducer,[o.emailsApi.reducerPath]:o.emailsApi.reducer,[ho.reducerPath]:ho.reducer,[Xn.reducerPath]:Xn.reducer,[Jn.reducerPath]:Jn.reducer,[Zn.reducerPath]:Zn.reducer,[eo.reducerPath]:eo.reducer,[to.reducerPath]:to.reducer,[no.reducerPath]:no.reducer,[oo.reducerPath]:oo.reducer,[ro.reducerPath]:ro.reducer,[io.reducerPath]:io.reducer,[ao.reducerPath]:ao.reducer,[so.reducerPath]:so.reducer,[lo.reducerPath]:lo.reducer,[co.reducerPath]:co.reducer,[uo.reducerPath]:uo.reducer,[mo.reducerPath]:mo.reducer,[po.reducerPath]:po.reducer,[o.emailPageSlice.name]:o.emailPageSlice.reducer,[o.projectsApi.reducerPath]:o.projectsApi.reducer,[Pn.reducerPath]:Pn.reducer,[Qt.reducerPath]:Qt.reducer,[Rn.reducerPath]:Rn.reducer,[So.reducerPath]:So.reducer,[o.saveFileApi.reducerPath]:o.saveFileApi.reducer,[wo.reducerPath]:wo.reducer,[o.commentsApi.reducerPath]:o.commentsApi.reducer,[o.optimiseApi.reducerPath]:o.optimiseApi.reducer,[ar.name]:ar.reducer,[xr.name]:xr.reducer,[fo.reducerPath]:fo.reducer,[To.reducerPath]:To.reducer,[ko.reducerPath]:ko.reducer,[Co.reducerPath]:Co.reducer,[o.taxonomiesApi.reducerPath]:o.taxonomiesApi.reducer,[o.projectsPageSlice.name]:o.projectsPageSlice.reducer,[o.AiApiGenerator.reducerPath]:o.AiApiGenerator.reducer,[Io.reducerPath]:Io.reducer,[go.reducerPath]:go.reducer,[bo.reducerPath]:bo.reducer,[Gn.reducerPath]:Gn.reducer,[o.authorizationApi.reducerPath]:o.authorizationApi.reducer,[o.limitsApi.reducerPath]:o.limitsApi.reducer,[o.revisionHistorySlice.name]:o.revisionHistorySlice.reducer,[Ao.reducerPath]:Ao.reducer,[o.defaultModePanesSlice.name]:o.defaultModePanesSlice.reducer,[kr.reducerPath]:kr.reducer,[xo.reducerPath]:xo.reducer,[_o.reducerPath]:_o.reducer,[Ro.reducerPath]:Ro.reducer,[Po.reducerPath]:Po.reducer,[jo.reducerPath]:jo.reducer,[o.projectSettingsV2Api.reducerPath]:o.projectSettingsV2Api.reducer,[Oo.reducerPath]:Oo.reducer}),Hg=(e,t)=>t.type==="authorizationApi/resetApiState"?as({[o.reducerPath]:e[o.reducerPath]},t):as(e,t),ss=[o.AiApi,o.imageApi,yo,o.emailsApi,An,o.blocksApi,ho,Xn,Jn,Zn,eo,to,no,oo,ro,io,ao,so,lo,co,uo,mo,po,wo,o.projectsApi,Pn,Qt,Rn,So,o.commentsApi,o.optimiseApi,o.saveFileApi,fo,To,o.taxonomiesApi,ko,Co,o.AiApiGenerator,Io,o.authorizationApi,o.limitsApi,go,bo,Gn,Ao,kr,jo,o.projectSettingsV2Api,Oo,xo,_o,Ro,Po];function qg(e){let t={};if(e){const r=g.createIdentifier$1();g.DependencyResolver.inject(r,e),t={INJECTION:r}}const n=o.configureStore({reducer:Hg,middleware:r=>r({serializableCheck:!1}).concat(ss.map(i=>i.middleware)),preloadedState:t});return o.setupListeners(n.dispatch),n}var ls=g.createIdentifier$1("RtkApiRegistry");function Vg(e,t){e.inject(ls,new Map(t.map(n=>[n.reducerPath,n])))}function st(e,t){const n=e?.getInstance(ls)?.get(t);if(!n)throw new Error(`RTK api "${t}" is not in the container registry (provideRtkApiRegistry did not run)`);return n}function Yg(e,t){let n={isCodeMode:void 0,direction:void 0};return o.provideCodeMode(e).watch(r=>{n.isCodeMode!==r.isCodeMode&&t.dispatch(o.setCodeMode(r.isCodeMode)),n.direction!==r.direction&&t.dispatch(o.switchCodeModeDirection(r.direction)),n={isCodeMode:r.isCodeMode,direction:r.direction}})}function Kg(e,t){const n=o.provideCurrentUser(e),r=o.authorizationApi.endpoints.getMe.select("");let i=n.get()?.profile;const a=()=>{const c=r(t.getState()).data;!c||c===i||(i=c,n.set({profile:c}))};return a(),{dispose:t.subscribe(a)}}var Qg=g.createIdentifier$1("EmailSettingsPort");function Xg(e,t){e.inject(Qg,{read:()=>o.selectEmailSettings(t.getState())??{},write:n=>{t.dispatch(o.setEmailSettings(n))},markAppearanceChanged:()=>{t.dispatch(o.markAppearanceNeedsUpdate())}})}var Jg="Invalid standaloneKey.",Zg="not implemented",S0=1,ey=g.createIdentifier$1("StandaloneMockGuard");function Pr(){const e=new Error(Jg);return e.name="InvalidStandaloneKeyError",e}function Rr(e){return o.isStandaloneRuntime(g.getContainer(e))}function ty(e){return e instanceof Error?e.name==="InvalidStandaloneKeyError"||e.message==="Invalid standaloneKey."||e.message==="not implemented":e===Zg}function cs(e){if(Rr(e))throw Pr()}function ny(e,t,n){return n instanceof Error&&n.name==="InvalidStandaloneKeyError"?n:Pr()}var oy=()=>()=>{throw Pr()};function ry(e){if(!e)throw new Error("DI container not found for standalone mock guard");e.inject(ey,1)}function iy(e){return typeof e!="function"}var w0="[plugin-api-mock]";function ds(){return!0}function ay(e){try{if(e===null||typeof e!="object")return e;const t={};for(const n of Object.keys(e).slice(0,12)){const r=e[n];t[n]=typeof r=="string"&&r.length>120?`${r.slice(0,120)}…(${r.length})`:r}return t}catch{return"(unserializable arg)"}}function sy(e,t){return n=>{const r=n.query,i=n.queryFn||((a,c,d,u)=>{if(!r)throw new Error("query not found EndpointDefinition");return u(r(a))});i&&(n.query=void 0,n.queryFn=async(a,c,d,u)=>{try{let m;const f=g.getContainer(c).getServices(e);for(let h=f.length-1;h>=0;h--){const _=f[h];if(m=m?await m(async p=>await _.execute(p),c):await _.execute(a),iy(m))return{data:m,error:null}}if(m)m=await m(async(h,_=c,p=d,E=u)=>{cs(c);const k=await i(h,_,p,E);if(k.error)throw k.error;return k.data},c);else{cs(c),ds();const h=await i(a,c,d,u);if(h.error)throw h.error;m=h.data}return{data:m,error:null}}catch(m){return Rr(c)&&ty(m)?{error:ny(t,ay(a),m)}:(ds(),{error:m})}})}}var us=new Set;function it(e){return(t,n)=>{const r=Object.create(null),i=Object.keys(n),a=new g.Disposable;for(const c of i){const d=`api_listeners_flag_${t.reducerPath}/${c.toString()}`,u=g.createIdentifier$1(`api_listeners_${t.reducerPath}/${c.toString()}`);us.has(d)||(r[c]=sy(u,`${t.reducerPath}/${c.toString()}`),us.add(d)),a.addDisposable(e.addService(u,{execute:n[c]}))}return Object.keys(r).length&&t.enhanceEndpoints({endpoints:r}),o.getDisposable(e).addDisposable(a),a}}function ms(e,t){for(const n of Object.keys(t))try{t[n](e)}catch{}}function k0(e){return e}function ps(e,t){return e({body:t}).catch(()=>new Promise(n=>setTimeout(n,1e3)))}function ly(e){it(e)(st(e,"AiApi"),{sendMessage:({body:t})=>async(n,r)=>{const i=o.getEmitter(e,g.events.AI_TEXT_REQUEST_ID);if(!i.hasListeners())return ps(n,t);const a=t,c={message:a.message??a.context,locale:a.locale,entityId:a.entity_id,projectId:a.project_id!=null?String(a.project_id):void 0,subject:a.subject,preheader:a.preheader,textContent:a.textContent,context:a.context??a.connection,connection:a.connection,onProgress:(d,u)=>{o.getEmitter(e,g.events.AI_TEXT_PROGRESS_ID).fire({progress:Number.isFinite(d)?d:0,status:typeof u=="string"?u:void 0})},onStreamChunk:d=>{typeof d!="string"||!d||o.getEmitter(e,g.events.AI_TEXT_STREAM_ID).fire({partialHtml:d})},signal:r.signal};for(const d of i.getListeners([c])){const u=await d(c);if(u)return{status:200,_eventResult:!0,aiMessage:typeof u.message=="string"?u.message:"",aiHtml:typeof u.html=="string"?u.html:void 0}}return ps(n,t)},getDialog:t=>(n,r)=>Rr(r)?Promise.resolve({documents:[],totalCount:0}):n(t)})}function cy(e){const t=it(e),n=o.getEmitter(e,g.events.FILE_PROXY_EVENT_ID);t(st(e,"proxyApi"),{async getFile({url:r,tryFetch:i=!0,type:a}){return async c=>{const{requested:d}=o.getCurrentProject(e),u=(await n.fire({url:r,project:d})).filter(m=>m instanceof Blob)[0];if(u)switch(a){case"json":return JSON.parse(await u.text());case"text":return u.text();default:return u}else return c({url:r,tryFetch:i,type:a})}}})}function dy(e){it(e)(st(e,"tokenApi"),{tokenCreate(t){return n=>n(t)},tokenValidate(){return t=>t({})}})}function C0(e){return e}function uy(e){it(e)(st(e,"imageApi"),{sendAiImageRequest:function({body:t}){return async(n,r)=>{const i=o.getEmitter(e,g.events.AI_IMAGE_REQUEST_ID);if(!i.hasListeners()||t.request!=="create-image")return n({body:t});const a={prompt:t.message??"",size:t.size,entityId:t.entity_id,projectId:t.project_id!=null?String(t.project_id):void 0,onProgress:(c,d)=>{o.getEmitter(e,g.events.AI_IMAGE_PROGRESS_ID).fire({progress:Number.isFinite(c)?c:0,status:typeof d=="string"?d:void 0})},signal:r.signal};for(const c of i.getListeners([a])){const d=await c(a);if(d&&d.images?.length)return{data:{status:200,_eventResult:!0,task:{images:d.images}}}}return n({body:t})}},getAiImage(t){return n=>n(t)}})}async function fs(e,t,n,r,i){try{const a=(await e.fire({project:String(t),emailId:n})).filter(c=>c!=null);if(a.length)return a.flat()}catch{}return r(i)}function my(e){const t=it(e),n=st(e,"blocksApi"),r=o.blocksDataSourceProvider(e),i=r.byForeignKey("project"),a=o.blockRevisionsDataSourceProvider(e);a.byForeignKey("parent");const{dispatch:c}=o.getStore(e),d=o.getDisposable(e);d.addDisposable(r.onChange(()=>c(n.util.invalidateTags(["Blocks"])))),d.addDisposable(r.onSave(({prev:f,patch:h,value:_})=>{const p=f?{...f,...h}:h;let E=o.mergeEntityPreservingMeta(f,h,_);return p&&E.html===p.html&&E.title===p.title&&(E={...E,renderGuid:p.renderGuid}),E},Number.MIN_VALUE));const u=o.getEmitter(e,o.READ_COMMON_BLOCKS_EVENT_ID),m=o.getEmitter(e,o.READ_TEMPLATE_BLOCKS_EVENT_ID);t(n,{async getBlocks(f){const h={};f.name&&(h.title=f.name),f.type&&(h.type=f.type);const _=f.projectId??await o.getBlocksProject(e);return await i.get(_,{filter:h,page:f.page,pageSize:f.pageSize,order:f.order,orderBy:f.orderby}).then(({data:p})=>p)},getBlocksSchema(){return f=>f(void 0)},getParentEmailBlocks(f){return async h=>{const _=o.getCurrentProject(e).requested||"";return fs(m,_,f.emailId||"",h,f)}},getTemplateBlocks(f){return async h=>{const _=o.getCurrentProject(e).requested||"";return fs(u,_,f.emailId||"",h,f)}},async getBlock(f){const h=o.getCurrentProject(e).card?.id;if(h!==void 0)return i.first(Number(h),{filter:{id:f}})},addBlock(f){return async h=>{const _=await r.create(f);return o.getAppConfig(e).preventSendDataToEM||h(_).catch(p=>{}),_}},editBlock({blockId:f,...h}){return r.update(f,h)},deleteBlock(f){return r.remove(typeof f=="object"?f.id:f)},addTag(f){return f},getDeletableTag([f,h]){return[]},autoSaveBlock({blockId:f,body:h}){return a.create({...h,parent:f})}})}function py(e){const{emails:t,emailRevisions:n}=o.provideEmailDocuments(e),{dispatch:r}=o.getStore(e),i=o.getDisposable(e),a=it(e),c=st(e,"emailsApi");i.addDisposable(t.onChange(async()=>{r(c.util.invalidateTags(["Email"]))})),a(c,{getEmails:d=>[],getTemplateEmails:d=>[],async addEmail({source:d,...u}){const m=await t.create(u,{source:d});return m.renderGuid||(m.renderGuid=g.generateUUID()),m},editEmail(d){return async u=>{const{emailId:m,source:f,...h}=d;return o.isRevisionServiceEnabled(e)&&await u(d),t.update(m,h,{source:f})}},deleteEmail(d){return t.remove(typeof d=="object"?d.id:d)},addTag(){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},getDeletableTag([d,u]){return[]},autoSaveEmail({emailId:d,body:u}){return async m=>{o.isRevisionServiceEnabled(e)&&await m({emailId:d,body:u});const f=await n.create({...u,parent:d,modified:new Date().toString()});return f&&!f.html&&u.html?{...f,html:u.html}:f}}})}var fy="tmp",T0=g.createIdentifier$1();function hy(e){const t=it(e);if(!e.getInstance(g.DISPOSABLE_ID))throw new Error("Something was wrong");const n=o.getEmitter(e,g.events.UPLOAD_EVENT_ID),r=o.getEmitter(e,g.events.ON_SEND_TESTEMAIL_ID),i=o.getEmitter(e,g.events.ON_SEND_LIVEPREVIEW_ID);t(st(e,"saveFileApi"),{uploadImage(a){return async c=>{const{requested:d}=o.getCurrentProject(e),u=async()=>c({...a,user_id:String((await e.getInstanceAsync(g.APP_ID)).app_id)});if(a.folder===fy)return u();const m=await o.fireUploadImageEvent(n,{file:a.file,project:d});if(m.url)return[{file_url:m.url,project:d}];if(!o.shouldFallbackToBuiltInUpload(m,{isStandalone:o.isStandaloneRuntime(e)}))throw o.toUploadImageError(m);return u()}},sendTestEmail(a){return async c=>{const{requested:d}=o.getCurrentProject(e);(await r.fire({project:d,email_id:a.email_id,subject:a.subject,email:a.email,html:a.html,from_name:a.from_name})).some(u=>u===!1)&&await c({...a,user_id:String((await e.getInstanceAsync(g.APP_ID)).app_id)})}},async sendLivePreview(a){const{requested:c}=o.getCurrentProject(e);(await i.fire({project:c,id:a.email,subject:a.subject,html:a.content})).some(d=>d===!1)},sendShortLink(a){return c=>c(a)}})}function gy(e){it(e)(st(e,"emailRawApi"),{getEmailRaw({emailId:t,secret_hash:n}){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Yt(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}function yy(e,t){var n,r;o.requiredArgs(1,arguments);var i=Dl(e);if(isNaN(i.getTime()))throw new RangeError("Invalid time value");var a=String((n=t?.format)!==null&&n!==void 0?n:"extended"),c=String((r=t?.representation)!==null&&r!==void 0?r:"complete");if(a!=="extended"&&a!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(c!=="date"&&c!=="time"&&c!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var d="",u="",m=a==="extended"?"-":"",f=a==="extended"?":":"";if(c!=="time"){var h=Yt(i.getDate(),2),_=Yt(i.getMonth()+1,2),p=Yt(i.getFullYear(),4);d="".concat(p).concat(m).concat(_).concat(m).concat(h)}if(c!=="date"){var E=i.getTimezoneOffset();if(E!==0){var k=Math.abs(E),w=Yt(Math.floor(k/60),2),b=Yt(k%60,2),x=E<0?"+":"-";u="".concat(x).concat(w,":").concat(b)}else u="Z";var P=Yt(i.getHours(),2),Y=Yt(i.getMinutes(),2),J=Yt(i.getSeconds(),2),N=d===""?"":"T",O=[P,Y,J].join(f);d="".concat(d).concat(N).concat(O).concat(u)}return d}function _y(e){const t=it(e),n=st(e,"commentsApi"),r=o.commentsDataSourceProvider(e),i=r.byForeignKey("post"),{dispatch:a}=o.getStore(e);o.getDisposable(e).addDisposable(r.onChange(()=>a(n.util.invalidateTags(["Comments"])))),t(n,{getComments(c){return i.get(c).then(({data:d})=>d)},addComment({subjectId:c,author:d,parent:u,content:m,author_name:f,author_email:h,targetId:_}){const p={post:c,author:d,author_name:f,author_email:h,content:m,parent:u,target_id:_,date:yy(new Date),author_avatar_urls:{}};return r.create(p)},deleteComment(c){return r.remove(c)},editComment({commentId:c,...d}){return r.update(c,d)},deleteTarget(c){return r.update(c,{target_id:""})}})}function jr(e){return{id:String(e),name:"",myRole:"",members:[],invites:[],emailsCount:0,blocksCount:0,title:"",group:[],folder:[],blockfolder:[]}}function hs(e,t){return{project:Number(e),app_id:t?.app_id||0,app_config:t?.app_config||{},user:t?.user}}function by(e,t){const n=jr(String(t)),r=o.getCurrentProject(e).card;return r&&String(r.id)===String(t)?Promise.resolve({...n,...r,id:String(t)}):Promise.resolve({...n,id:String(t)})}function vy(e){let t,n;const r=i=>((t!==i||!n)&&(t=i,n=by(e,i)),n);it(e)(st(e,"projectsApi"),{getProjects(i={page:1}){return[]},getProject(i){return async a=>o.isStandaloneRuntime(e)?a(i):{...await r(i),id:String(i)}},addProject(i){throw new Error},async editProject({projectId:i,...a}){const c={...await r(i),...a,id:String(i)};return t=i,n=Promise.resolve(c),c},deleteProject(i){throw new Error},mutateProjectMembers(){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},addProjectMember(){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},getFrequentProjects(){return[]}})}function Ey(e){let t={id:"0",username:"",email:"",password:"",code_editor:{},theme:"light",locale:o.getCurrentUser(e).profile?.locale,counters:{},avatar_urls:{},autosaves:!0};it(e)(st(e,"authorizationApi"),{getSchema:()=>n=>n({}),getMe:()=>t,editMe:n=>t={...t,...n},getSubscriptions:()=>[]})}function Sy(e){it(e)(st(e,"notificationsApi"),{getNotifications(t){return[]},notificationShown({id:t,datetime:n}){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function wy(e){it(e)(st(e,"addUserToProjectApi"),{addUserToProject:()=>{}})}function ky(e){o.injectEmailTermsResolver(e,{resolve:async()=>{}}),it(e)(st(e,"taxonomiesApi"),{getTerms:()=>[],getStandardGroups:()=>[],addTerm:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},editTerm:t=>({id:t.id,name:t.name,parent:0,count:0}),deleteTerm:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Cy(e){it(e)(st(e,"projectSettingsV2Api"),{getProjectIntegrations:()=>({}),getProjectWebhook:()=>"",getProjectStorage:()=>({}),getProjectTestRecipients:()=>[],getIntegrationCredentials:()=>({}),putProjectIntegration:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},deleteProjectIntegration:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectWebhook:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectSettings:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectTestRecipients:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Ty(e){it(e)(st(e,"stripoImportApi"),{getStripoFolders:()=>[],getStripoItems:()=>({items:[],total:0}),getCurrentStripoImport:()=>null,getStripoImport:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},saveStripoKey:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},startStripoImport:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}var gs={addUserToProjectApiMock:wy,AiApiMock:ly,authorizationApiMock:Ey,blocksApiMock:my,commentsApiMock:_y,emailsApiMock:py,emailRawApiMock:gy,imageApiMock:uy,notificationsApiMock:Sy,projectsApiMock:vy,projectSettingsV2ApiMock:Cy,proxyApiMock:cy,saveFileApiMock:hy,stripoImportApiMock:Ty,taxonomiesApiMock:ky,tokenApiMock:dy},Lr=o.createApi({reducerPath:"tokenApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/jwt-auth/v1/"}),endpoints:e=>({tokenCreate:e.mutation({queryFn(t,n){return o.clientFromApi(n).jwtAuth.token_create({body:t,type:g.ContentType.Json})}}),tokenValidate:e.mutation({queryFn(t,n){return o.clientFromApi(n).jwtAuth.token_validate_create({type:g.ContentType.Json})}})})}),{useTokenCreateMutation:I0,useTokenValidateMutation:A0}=Lr;function Or(){const e=new Map;for(const t of ss)e.set(t.reducerPath,t);return e.set(Lr.reducerPath,Lr),[...e.values()]}function Iy(e,t){const n=Object.keys(t.endpoints);n.length&&e(t,Object.fromEntries(n.map(r=>[r,oy])))}function Ay(e){ry(e);const t=it(e);for(const n of Or())Iy(t,n)}function xy(e){if(!e)return;const t=g.decodeJwt(e)?.data,n=t?.data?.scope??t?.scope;return(Array.isArray(n)?n.flatMap(r=>typeof r=="string"?r.split(/\s+/):[]):typeof n=="string"?n.split(/\s+/):[]).find(r=>/^project_\d+$/.test(r))?.replace(/^project_/,"")||void 0}var Py={AiApi:new Set(["sendMessage","getDialog"]),imageApi:new Set(["sendAiImageRequest","getAiImage","getAiImageSSE"])};function Ry(e){return o.getAppConfig(g.getContainer(e))}function jy(e){return e?.backendProxy!==void 0&&e?.backendProxyPolicy?.proxyAi===!0}function Ly(e){return jy(Ry(e))}function Oy(e,t,n,r){return Py[t]?.has(n)?i=>Ly(e)?a=>a(i):r(i):r}function My(e){const t=it(e);return((n,r)=>{if(!n||typeof n.reducerPath!="string")return new g.Disposable;const i=Object.fromEntries(Object.entries(r??{}).map(([a,c])=>[a,typeof c=="function"?Oy(e,n.reducerPath,a,c):c]));return t(n,i)})}function Ny(e){const t=`blocks_${g.generateUUID().replaceAll("-","")}`,n=document.createElement("script");return n.type="text/javascript",n.text=`window.${t}(function(module, exports, require) { ${e}; })`,new Promise((r,i)=>{window[t]=function(a){const c={exports:{}},d=()=>{};a(c,c.exports,d),r(c.exports)},document.head.appendChild(n)}).finally(()=>{n.remove(),delete window[t]})}async function ys(e){const t=g.getContainer(e),n=t?.getInstance(g.STANDALONE_PROJECT_ID),r=n?void 0:await t?.getInstanceAsync(g.APP_ID).catch(()=>{}),i=n||(r?.project!==void 0?String(r.project):void 0);i&&t&&o.setCurrentProjectCard(t,jr(i))}async function Dy(e,t){try{const n=function(d){const u=e.getInstance(g.STANDALONE_PROJECT_ID),m=u?hs(u,d):d;e.injectFactory(g.APP_ID,async()=>m)},r=My(e),i=await o.readZipFromBase64(t),a=i.key&&o.zipEntryToText(i.key);if(typeof a!="string")return;const c=await Ny(a);if(typeof c!="object"||c===null||typeof c.execute!="function")return;c.execute(n,r,Or())}catch{}}async function _s(e,t){Ay(g.getContainer(e)),await Dy(g.getContainer(e),t),ms(g.getContainer(e),gs)}var Fy=zn(async e=>{const t=qg(e);e.inject(g.STORE_ID,t),Vg(e,Or()),Xg(e,t),o.getDisposable(e).addDisposable(Kg(e,t)),o.getDisposable(e).addDisposable(Yg(e,t));const n=g.getContainer(t);n&&(e.inject(g.MESSAGE_SERVICE_ID,o.getMessageService(n)),e.inject(o.CURRENT_PROJECT_ID,o.provideCurrentProject(n)));const r=e.getInstance(g.SECURITY_MODULE_ID);return r?(await _s(t,r),await ys(t)):ms(g.getContainer(t),gs),{instance:{}}}),bs=["historyEnabled","commentsEnabled","aiAssistentEnabled","livePreviewEnabled","sendTestEnabled","sharePreviewEnabled","webversionEnabled","optimizeSpamAssassinEnabled","exportWebHookEnabled","aiLayoutConverterEnabled","elementAIimageEnabled","elementAItextEnabled","revisionService"];function By(e){const t={...e};for(const n of bs)t[n]=!1;return t}function Uy(e){const t={...e};for(const n of bs)n in t&&typeof t[n]=="boolean"&&(t[n]=!1);return t}function $y(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t={};for(const[n,r]of Object.entries(e))!r||typeof r!="object"||Array.isArray(r)||(t[n]=Uy(r));return Object.keys(t).length>0?t:void 0}function Mr(e){const t=By(e),n=$y(e.advancedConfigs),r={...t};return n?r.advancedConfigs=n:delete r.advancedConfigs,r}var x0=1,zy=2592e6;function vs(){return"emailmaker".trim()||void 0}function Gy(e){return{schemaVersion:1,savedAt:Date.now(),project:e.project,app_id:e.app_id,app_config:Mr(Ss(e.app_config))}}function Es(e){return{...e,app_config:Ss(e.app_config)}}function Ss(e){if(!e||typeof e!="object"||Array.isArray(e))return{};try{if(typeof structuredClone=="function")return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{return{}}}async function Wy(e){const t=vs();t&&await Xy(t,Gy(e))}async function Hy(e=Date.now()){const t=vs();if(t)return Jy(t,e)}function qy(e,t=Date.now()){return e.savedAt>t?!1:t-e.savedAt<=zy}function ws(e){if(!e||typeof e!="object")return!1;const t=e,n=typeof t.project=="number"&&Number.isFinite(t.project)||typeof t.project=="string"&&t.project.trim()!=="";return t.schemaVersion===1&&typeof t.savedAt=="number"&&Number.isFinite(t.savedAt)&&n&&typeof t.app_id=="number"&&Number.isFinite(t.app_id)&&t.app_config!=null&&typeof t.app_config=="object"&&!Array.isArray(t.app_config)}var jt="snapshots",Vy=1;function Yy(){return`${"emailmaker".trim()||"plugin"}-plugin-deferred-config`}function Mo(){return new Promise((e,t)=>{if(typeof indexedDB>"u"){t(new Error("indexedDB is not available"));return}const n=indexedDB.open(Yy(),Vy);n.onerror=()=>t(n.error||new Error("indexedDB open failed")),n.onupgradeneeded=()=>{const r=n.result;r.objectStoreNames.contains(jt)||r.createObjectStore(jt)},n.onsuccess=()=>e(n.result)})}function Ky(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error||new Error("indexedDB request failed"))})}function Qy(){return{async get(e){const t=await Mo();try{const n=await Ky(t.transaction(jt,"readonly").objectStore(jt).get(e));return n===void 0?void 0:n}finally{t.close()}},async put(e,t){const n=await Mo();try{const r=n.transaction(jt,"readwrite");r.objectStore(jt).put(t,e),await new Promise((i,a)=>{r.oncomplete=()=>i(),r.onerror=()=>a(r.error||new Error("indexedDB write failed")),r.onabort=()=>a(r.error||new Error("indexedDB write aborted"))})}finally{n.close()}},async delete(e){const t=await Mo();try{const n=t.transaction(jt,"readwrite");n.objectStore(jt).delete(e),await new Promise((r,i)=>{n.oncomplete=()=>r(),n.onerror=()=>i(n.error||new Error("indexedDB delete failed")),n.onabort=()=>i(n.error||new Error("indexedDB delete aborted"))})}finally{t.close()}},async clear(){const e=await Mo();try{const t=e.transaction(jt,"readwrite");t.objectStore(jt).clear(),await new Promise((n,r)=>{t.oncomplete=()=>n(),t.onerror=()=>r(t.error||new Error("indexedDB clear failed")),t.onabort=()=>r(t.error||new Error("indexedDB clear aborted"))})}finally{e.close()}}}}var ks,Nr;function Dr(){return ks||(Nr||(Nr=Qy()),Nr)}function Cs(e){Dr().delete(e).catch(()=>{})}async function Xy(e,t){if(ws(t))try{await Dr().put(e,Es(t))}catch{}}async function Jy(e,t=Date.now()){try{const n=await Dr().get(e);if(n===void 0)return;if(!ws(n)){Cs(e);return}if(!qy(n,t)){Cs(e);return}return Es(n)}catch{return}}function Zy(e,t){if(e.getInstance(g.STANDALONE_FILE_PROXY_REGISTERED_ID))return;e.inject(g.STANDALONE_FILE_PROXY_REGISTERED_ID,!0);const n=g.getEvent(e,g.events.FILE_PROXY_EVENT_ID);t.addDisposable(n(async({url:r})=>(await fetch(r)).blob(),Number.MIN_VALUE))}function Ts(e){try{return xy(e)||void 0}catch{return}}async function e_(e,t,n){if(!e)return;let r;try{const i=await e(t,n,void 0);r=String(i||"").trim()}catch{return}if(r)return{token:r,serverProjectId:Ts(r)}}function t_(e){if(e==null)return;const t=String(e).trim();return/^\d+$/.test(t)?t:void 0}function n_(e){const t=String(e.getInstance(g.JWT_TOKEN_ID)||"").trim();if(t)return Ts(t)}function Is(e,t,n){e.inject(g.APP_ID,void 0),e.inject(g.APP_ID,Promise.resolve(hs(t,n)))}function o_(e){return{app_id:e.app_id,app_config:Mr(e.app_config)}}async function As(){const e=await Hy();return e?o_(e):{app_config:Mr({})}}function r_(e,t){e.getInstance(g.STANDALONE_ACTIVATED_ID)||(e.inject(g.SECURITY_MODULE_ID,void 0),e.inject(g.STANDALONE_BOOTSTRAP_TOKEN_ID,void 0),e.inject(g.STANDALONE_PROJECT_ID,void 0),t&&e.inject(g.APP_ID,void 0),e.inject(g.STANDALONE_FILE_PROXY_REGISTERED_ID,void 0))}async function xs(e){const{container:t,store:n,standaloneKey:r,project:i,reason:a,getAuthToken:c,user:d}=e,u=e.disposable||t.getInstance(g.DISPOSABLE_ID);if(t.getInstance(g.STANDALONE_ACTIVATED_ID))return;const m=await e_(c,d,i),f=t_(i),h=m?.serverProjectId??n_(t)??(m?void 0:f);t.inject(g.SECURITY_MODULE_ID,r);let _=!1;try{if(m&&(t.inject(g.STANDALONE_BOOTSTRAP_TOKEN_ID,Promise.resolve(m.token)),c&&g.recreateTokenProvider(t,c,d,i)),h){const p=await As();t.inject(g.STANDALONE_PROJECT_ID,h),Is(t,h,p),_=!0,o.setCurrentProjectCard(t,jr(h))}if(await _s(n,r),_=!0,!h){await ys(n);const p=t.getInstance(g.STANDALONE_PROJECT_ID);if(p)Is(t,p,await As()),_=!0;else if(t.getInstance(g.APP_ID)!==void 0)try{(await t.getInstanceAsync(g.APP_ID))?.project==null}catch{}}u&&Zy(t,u),t.inject(g.STANDALONE_ACTIVATED_ID,!0)}catch(p){throw r_(t,_),p}}async function i_(e,t,n,r){const i=r?.attemptTimeout??g.isFailoverEnabled(n),a=g.isFailoverEnabled(n)?g.getOrderedOriginCandidates(n):g.getOriginChain(n).length>0?[g.getActiveBaseUrl(n)]:[];if(a.length===0)throw new Error("[apiOriginFailover] no API base URL configured");const c=e.startsWith("/")?e:`/${e}`;let d,u;for(let m=0;m<a.length;m++){const f=a[m],h=m===a.length-1,_=i?g.beginFailoverAttempt(t.signal):void 0;try{const p=await fetch(`${f}${c}`,{...t,..._?{signal:_.signal}:{}});if(!p.ok&&g.shouldFailoverResponse(p.status)){if(d=p,!h){g.reportOriginFailure(f,n);continue}break}return p.ok&&g.reportOriginSuccess(f,n),p}catch(p){const E=_?.timeoutError();if(!E&&!g.shouldFailoverError(p))throw p;u=E||p,h||g.reportOriginFailure(f,n)}finally{_?.done()}}if(g.isFailoverEnabled(n)&&g.abandonStickyOrigin(),d)return d;throw u instanceof Error?u:new Error("[apiOriginFailover] fetch chain failed")}function a_(e,t){const n=String(t.baseUrl||"").trim();if(n)return g.resolveExplicitApiBaseUrl(n);const r=e.getInstance(g.REST_CLIENT_FACTORY_ID),i=String(r?.getOptions()?.baseUrl||"").trim();return g.resolveExplicitApiBaseUrl(i||void 0)}async function s_(e,t){if(t.getAuthToken)try{const n=await t.getAuthToken(t.user,t.project,void 0);if(String(n||"").trim())return!0}catch{if(!t.jwtAuth)return!1}if(t.jwtAuth)try{if(String(e.getInstance(g.JWT_TOKEN_ID)||"").trim())return!0;const n=a_(e,t);if(!n)return!1;const r=await i_("/jwt-auth/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.jwtAuth)},n,{attemptTimeout:!0});if(!r.ok)return!1;const i=await r.json();return i.token?(e.inject(g.JWT_ERROR_ID,void 0),e.inject(g.JWT_TOKEN_ID,i.token),!0):!1}catch{return!1}return!1}async function l_(e){try{if(e.getInstance(g.APP_ID)===void 0)return!1;const t=await d_(e.getInstanceAsync(g.APP_ID));return t!=null&&t.project!=null?t:!1}catch{return!1}}function c_(){return g.getFailoverAttemptTimeoutMs()*Math.max(1,g.getOriginChain().length)}function d_(e){const t=c_();return new Promise((n,r)=>{const i=setTimeout(()=>{n(void 0)},t);e.then(a=>{clearTimeout(i),n(a)},a=>{clearTimeout(i),r(a)})})}function Ps(e){return String(e.standaloneKey||"").trim()||void 0}function u_(e){return e.standaloneOnAuthFailure===!0?!0:e.config?.standaloneOnAuthFailure===!0}function m_(e){return u_(e)?!!Ps(e):!1}var p_=zn(async e=>{const t=e.getInstance(g.DISPOSABLE_ID),n=()=>e.getInstanceAsync(g.STORE_ID);return{async setOptions(r){if(!m_(r)){e.getInstance(g.STANDALONE_ACTIVATED_ID);return}const i=Ps(r);if(!i||e.getInstance(g.STANDALONE_ACTIVATED_ID))return;const a=await n(),c=!!(r.getAuthToken||r.jwtAuth),d=c?await s_(e,r):!0;if(c&&!d){await xs({container:e,store:a,standaloneKey:i,project:r.project,getAuthToken:r.getAuthToken,user:r.user,disposable:t,reason:"auth pipeline failed"});return}const u=await l_(e);if(u){await Wy(u).catch(()=>{});return}await xs({container:e,store:a,standaloneKey:i,project:r.project,getAuthToken:r.getAuthToken,user:r.user,disposable:t,reason:"app_init failed"})}}}),f_=g.defineMixin(e=>{let t;const n=o.getDisposable(e),r=g.getEvent(e,g.events.ON_DOCUMENT_SESSION_CHANGE);n.addDisposable(r(({history:a})=>{t=a}));const i=()=>t?Fi(t):void 0;return{instance:{undoRedoService:{undo:()=>i()?.undo(),redo:()=>i()?.redo(),clear:()=>i()?.clear(),getPast:a=>i()?.getPast(a)??[],getFuture:a=>i()?.getFuture(a)??[],canUndo:()=>i()?.canUndo()??!1,canRedo:()=>i()?.canRedo()??!1,createSnapshot:()=>i()?.createSnapshot(),restoreSnapshot:a=>i()?.restoreSnapshot(a)}}}});function h_(e){return{font_size:e.fontSize,font_family:e.fontFamily,tab_size:e.tabSize,word_wrap:e.wordWrap,minimap:e.minimap,insert_spaces:e.insertSpaces}}function g_(e){return{fontSize:e.fontSize,fontFamily:e.fontFamily,tabSize:e.tabSize,wordWrap:e.wordWrap!=="off",minimap:e.minimap?.enabled,insertSpaces:e.insertSpaces}}async function Rs(e){const t=o.getCurrentUser(e).profile;if(t)return t;const n=e.getInstance(g.STORE_ID);if(n)return(await n.dispatch(o.authorizationApi.endpoints.getMe.initiate("",{forceRefetch:!0}))).data}function y_(e){const t=o.resolveTemplateDirectivesConfig(e);if(!(Object.keys(t.output).length>0||Object.keys(t.editor).length>0))return ga();const n=new Set(Object.keys(t.output).filter(i=>t.output[i]==="html-comment")),r=new Set(Object.keys(t.output));return{isConfigured:()=>!0,toEditorForm:i=>o.mapper.normalizeToPolicy(i,t.editor),toOutputForm:i=>o.mapper.normalizeToPolicy(i,t.output),keepWrappedOnOutput:n,editorPolicy:t.editor,warnAboutUnconfiguredInput:ha(r)}}function js(e){const t=o.getCodeMode(e);return{...No(e),editor:g_(o.getEditorOptions(e)),codeModeDirection:t.isCodeMode?t.direction:"none"}}function No(e){return e.getInstance(g.CONFIG_SOURCE_ID)?.get()??{}}function Fr(e){return e.getInstance(g.CONFIG_SOURCE_ID)?.layers()??{base:{},profile:{},serverSide:{},user:{},local:{},advancedConfigs:{}}}var __=vr(e=>{const t=o.getDisposable(e),n=Ct(o.getEvent(e,g.events.ON_LIMIT_ID)),r=t.addDisposable(new kt(n)),i=Ct(o.getEvent(e,g.events.READ_LOCALE)),a=t.addDisposable(new kt(i)),c=Ct(o.getEvent(e,g.events.ON_TRANSLATE_ID)),d=t.addDisposable(new kt(c)),u=o.getEmitter(e,g.CONFIG_CHANGED_EVENT_ID),m=async()=>{try{return e.getInstance(g.APP_ID)===void 0?{}:(await e.getInstanceAsync(g.APP_ID))?.app_config||{}}catch{return{}}},f=$a(),h=$a();let _,p=!1,E;const k=async()=>{const A=js(e);if(!p){E=g.deepClone(A),p=!0;return}E!==void 0&&g.deepEqual(E,A)||(E=g.deepClone(A),await u.fire(A))},w=A=>{if(typeof A=="number")return String(A);if(typeof A=="string")return A},b=A=>{if(A!==void 0){const L=o.provideCurrentProject(e);L.set({...L.get(),requested:String(A)})}},x=async(A,L)=>{if(!A){const Z=await Rs(e);return _=w(Z?.id),{didReset:!1}}const z=await Rs(e),B=A.id!==void 0?w(A.id):w(z?.id),$=_!==void 0?String(_):void 0,de=B!==void 0?String(B):void 0,pe=$!==void 0&&de!==void 0&&$!==de,H={...z,...o.filterUndefined(A),id:B};if(A.id===void 0&&!z?.id&&delete H.id,o.provideCurrentUser(e).set({profile:H}),pe&&L){const Z=e.getInstance(g.INSTANCE_ID);if(Z?.reset)return await Z.reset(L),{didReset:!0}}return _=de,{didReset:!1}},P=A=>{const L=e.getInstance(g.CONFIG_SOURCE_ID);L?.setAdvancedConfigs({...A.advancedConfigs,...A.user?.advancedConfigs}),L?.replace(A.user,"user"),L?.replace(A.serverSide,"server")},Y=async()=>{await e.getInstance(g.CONFIG_SOURCE_ID)?.ready(),o.getRevisionServiceFlag(e).set(No(e).revisionService===!0);const{codeModeDirection:A,editor:L}=No(e);L&&o.applyEditorOptions(e,h_(L)),A!==void 0&&(A==="none"?o.setCodeMode$1(e,!1):(o.setCodeMode$1(e,!0),o.setCodeModeDirection(e,A)))},J=async A=>{P(A),await Y()};let N;const O=f.decorate(async({config:A={},project:L,user:z,advancedConfigs:B},$)=>{e.getInstance(g.CONFIG_SOURCE_ID)?.replace(await m(),"server"),await Y(),e.inject(g.TEMPLATE_DIRECTIVES_ID,y_(No(e).templateDirectives)),b(L),$&&"commonStyles"in $&&o.setDefaultCommonStyles(e,$.commonStyles===void 0?void 0:$.commonStyles);const{didReset:de}=await x(z,$)});return{setOptions:h.decorate(async A=>{const{config:L={},project:z,user:B,advancedConfigs:$,handleReadLocale:de,handleLimitUsage:pe,handleTranslate:H,storageProvider:Z}=A;e.inject(g.STORAGE_PROVIDER_ID,Z),a.setListener(de),r.setListener(pe),d.setListener(H),await O({config:L,project:z,user:B,advancedConfigs:$},A).catch(De=>{}),await k(),N&&N.dispose(),N=new g.Disposable}),instance:{setConfig:h.decorate(async A=>{const L=A,{commonStyles:z,...B}=L;"commonStyles"in L&&o.setDefaultCommonStyles(e,z===void 0?void 0:z),await J({advancedConfigs:Fr(e).advancedConfigs,serverSide:await m(),user:B}),await k()}),getConfig:()=>js(e),updateConfig:h.decorate(async A=>{const L=A,{commonStyles:z,...B}=L;"commonStyles"in L&&o.setDefaultCommonStyles(e,z===void 0?void 0:z),await J({advancedConfigs:Fr(e).advancedConfigs,serverSide:await m(),user:{...Fr(e).user,...B}}),await k()}),handleReadLocale:i,handleLimitUsage:n,handleTranslate:c}}}),Do;function Br(){return Do===void 0&&(Do=(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/d2342090.js")),void 0,{}.url).catch(e=>{throw Do=void 0,e})),Do}var Ls;function b_(){return Ls??=(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/370f04c3.js")).then(e=>zt.__toESM(e.require_core())),void 0,{}.url),Ls}function v_(e){const t=[0],n=[];let r=0;for(;r<e.length;){const i=e.charCodeAt(r);i===10||i===13?(n.push(r-t[t.length-1]),r+=i===13&&e.charCodeAt(r+1)===10?2:1,t.push(r)):r+=1}return n.push(e.length-t[t.length-1]),{starts:t,lengths:n}}function Os({starts:e,lengths:t},n,r){const i=Math.min(Math.max(n,1),e.length)-1;return e[i]+Math.min(Math.max(r,1),t[i]+1)-1}var E_={error:8,warning:4,info:2};function S_(e,t){const n=e.evidence!==""?e.col+e.evidence.length:t.lengths[e.line-1]??e.col+1;return{severity:E_[e.type]??8,message:e.message,startLineNumber:e.line,startColumn:e.col,endLineNumber:e.line,endColumn:n,startOffset:Os(t,e.line,e.col),endOffset:Os(t,e.line,n)}}async function w_(e){const{HTMLHint:t}=await b_(),n=v_(e);return t.verify(e,o.EMAIL_CODE_RULESET).map(r=>S_(r,n))}var k_=class extends g.Disposable{_container;_dataSources;_currentEmail;_blockMetaWrites=Promise.resolve();constructor(e){super(),this._container=e,this._dataSources=o.getDataSources(e),this.addDisposable(g.getEvent(e,g.events.ON_EMAIL_CHANGED_ID)(t=>{this._currentEmail=t}))}async getBlocks(){const e=await this._readProjectBlocks();return await this._blockMetaWrites,(await this._dataSources.blocks.cache.values()).filter(t=>t.project===e).map(t=>$h(t,this._container))}async _readProjectBlocks(){const e=await o.getBlocksProject(this._container);return await this._dataSources.blocks.byForeignKey("project").get(e),e}async getComments(){const{cache:e}=this._dataSources.comments,t=await this.getEmailSnapshot();return(await e.values()).filter(n=>n.post===t.id).map(n=>zh(n,this._container))}async getEmailRevisions(){const{cache:e}=this._dataSources.emailRevisions,t=await this.getEmailSnapshot();return(await e.values()).filter(n=>n.parent===t.id).map(n=>Gh(n,this._container))}async getEmailSnapshot(){return Km(o.getOpenEmail(this._container,this._currentEmail),this._container)}async getEmail(e=!0){return this.compile(e)}async compileEmail(e=!0){return this.compile(e)}async compile(e){const{compileEmail:t}=await Br();return t(await this.getEmailSnapshot(),e,rn(this._container).keepWrappedOnOutput)}setEmailMeta(e){const t=o.getOpenDocument(this._container);if(!t)return;const n=t.get().attributes.meta;o.writeEmailAttributes(t,{meta:o.applyMetaPatch({meta:n},e).meta});const r=t.get().serverId;r!=null&&this._dataSources.emails.cache.addOrUpdate(r,i=>i&&o.applyMetaPatch(i,e))}setBlockMeta(e,t){const n=async()=>{await this._readProjectBlocks();const{cache:r}=this._dataSources.blocks;await r.getIfPresent(e)&&await r.addOrUpdate(e,i=>i&&o.applyMetaPatch(i,t))};this._blockMetaWrites=this._blockMetaWrites.then(n).catch(()=>{})}getCodeErrors(){const e=o.getCodeErrors(this._container);return e.length>0?e:void 0}validateCode(){return Promise.resolve(w_(o.getOpenEmail(this._container,this._currentEmail).html??""))}};function Ms(){Br().catch(()=>{})}function C_(e){const t=o.provideHeadlessMode(e).watch(n=>{n&&Ms()});e.getInstance(g.DISPOSABLE_ID)?.addDisposable(t),Ht(e).whenVisible(()=>{Xt(Ms)})}var T_=g.createIdentifier$1("EmailOperationsController");function Ns(e){return e.getOrCreateInstance(T_,()=>{const t=new k_(e);return e.getInstance(g.DISPOSABLE_ID)?.addDisposable(t),t})}function I_(e){Ns(e),C_(e)}function A_(e){const t=Ns(e);return{getEmailSnapshot:()=>t.getEmailSnapshot(),getEmail:()=>t.getEmail(),async compileEmail(n,r=!0){if(!n)return t.compileEmail(r);const{compileEmail:i}=await Br();return i(n,r,rn(e).keepWrappedOnOutput)},validateCode:()=>t.validateCode(),getCodeErrors:()=>t.getCodeErrors(),getBlocks:()=>t.getBlocks(),getComments:()=>t.getComments(),getEmailRevisions:()=>t.getEmailRevisions(),setEmailMeta:n=>t.setEmailMeta(n),setBlockMeta:(n,r)=>t.setBlockMeta(n,r)}}var x_=g.defineMixin(e=>{const t=e.getInstance(g.DISPOSABLE_ID),n=g.getEvent(e,g.events.UPLOAD_EVENT_ID),r=g.getEvent(e,g.events.FILE_PROXY_EVENT_ID),i=g.getEmitter(e,g.events.PROXY_URL_EVENT_ID).event,a=Ct(n),c=Ct(i),d=Ct(r),u=t.addDisposable(new kt(a)),m=t.addDisposable(new kt(d)),f=t.addDisposable(new kt(c));return{setOptions(h){u.setListener(h.handleLoadImage),m.setListener(h.handleFileProxy),f.setListener(h.handleUrlProxy)},instance:{handleLoadImage:a,handleFileProxy:d,handleUrlProxy:c}}}),P_=g.defineMixin(e=>{const t=e.getInstance(g.DISPOSABLE_ID),n=g.getEvent(e,g.events.AI_TEXT_REQUEST_ID),r=g.getEvent(e,g.events.AI_IMAGE_REQUEST_ID),i=Ct(n),a=Ct(r),c=t.addDisposable(new kt(i)),d=t.addDisposable(new kt(a));return{setOptions(u){c.setListener(u.handleAITextRequest),d.setListener(u.handleAIImageRequest)},instance:{handleAITextRequest:i,handleAIImageRequest:a}}}),R_=class extends Error{cycle;constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),this.cycle=e}};function j_(e){const t=new Map;for(const n of e)for(const r of n.provides??[]){const i=t.get(r)??[];i.push(n),t.set(r,i)}return t}function L_(e,t){const n=[];for(const r of e.awaits?.services??[])for(const i of t.get(r)??[])i!==e&&n.push(i);return n}function O_(e){const t=j_(e),n=[],r=new Set,i=[],a=new Set,c=d=>{if(!r.has(d)){if(a.has(d)){const u=i.indexOf(d);throw new R_([...i.slice(u),d].map(m=>m.name))}a.add(d),i.push(d);for(const u of L_(d,t))c(u);i.pop(),a.delete(d),r.add(d),n.push(d)}};for(const d of e)c(d);return n}var M_="author,slug,date,modified,title,acf.html,id,parent,date_gmt",N_="author,slug,date,modified,modified_gmt,title,acf.html,id,parent",D_=20,Ur=[g.WpEblockApi];function Ds(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}function F_(e){return{async readRevisions(t,n=1){const r=await g.getApi(e,Ur).eblock_revisions_list({parent:t,per_page:D_,page:n},{extraQuery:{_fields:M_}}),i=(r?.data??[]).map(c=>o.WpBlockRevisionToBlockRevision(c)),a=Number(r?.headers?.get("X-WP-TotalPages"));return{revisions:i,page:n,hasMore:Number.isFinite(a)&&n<a}},async readAutosave(t){const n=g.getApi(e,Ur),[r,i]=await Promise.all([n.eblock_autosaves_list({id:t},{extraQuery:{_fields:N_}}),n.eblock_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),a=(r?.data??[]).map(d=>{const u=d,m=o.WpBlockRevisionToBlockRevision(u),f=Ds(u.modified_gmt);return f?{...m,modified:f}:m}),c=Date.parse(Ds(i?.data?.modified_gmt)??"");return o.autosaveStateFromSlots(a,Number.isFinite(c)?c:void 0)},async saveAutosave(t,n){const r=n,i=r.global_block&&r.html?o.injectEmBlockIdIntoBlockHtml(r.html,t):r.html??"";o.writePendingData(t,{sentAt:Date.now(),html:i,common_styles:""});const a=await g.getApi(e,Ur).eblock_autosaves_create({id:t},o.BlockAutoSaveToWpBlockAutoSave({title:r.title,html:i,project:r.project,excerpt:new Date().toISOString()}),{type:g.ContentType.FormData});return o.WpBlockRevisionToBlockRevision(a?.data)}}}var B_="author,slug,date,modified,title,meta,acf.html,acf.common_styles,id,parent,date_gmt",U_="author,slug,date,modified,modified_gmt,title,meta,acf.html,acf.common_styles,id,parent";function Fs(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}var $_=20,$r=[g.WpEmailApi];function z_(e){return{async readRevisions(t,n=1){const r=await g.getApi(e,$r).email_revisions_list({parent:t,per_page:$_,page:n},{extraQuery:{_fields:B_}}),i=(r?.data??[]).map(c=>o.WpEmailRevisionToEmailRevision(c)),a=Number(r?.headers?.get("X-WP-TotalPages"));return{revisions:i,page:n,hasMore:Number.isFinite(a)&&n<a}},async readAutosave(t){const n=g.getApi(e,$r),[r,i]=await Promise.all([n.email_autosaves_list({id:t},{extraQuery:{_fields:U_}}),n.email_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),a=(r?.data??[]).map(d=>{const u=d,m=o.WpEmailRevisionToEmailRevision(u),f=Fs(u.modified_gmt);return f?{...m,modified:f}:m}),c=Date.parse(Fs(i?.data?.modified_gmt)??"");return o.autosaveStateFromSlots(a,Number.isFinite(c)?c:void 0)},async saveAutosave(t,n){const r=await g.getApi(e,$r).email_autosaves_create({id:t},o.EmailAutoSaveToWpEmailAutoSave({...n,excerpt:new Date().toISOString()}),{type:g.ContentType.FormData});return o.WpEmailRevisionToEmailRevision(r?.data)}}}var Bs=["_embedded","id","author","title","meta","emailtags","folder","group","modified","date","type","parent","date_gmt","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"].join(","),zr=[g.WpEmailApi],Us=e=>o.EmailToWpEmail(e);function G_(e){return{async readEmail(t){const n=await g.getApi(e,zr).email_detail({id:o.toNumberSafe(t)},{extraQuery:{_embed:"wp:term",_fields:Bs}});if(!n)throw new o.EmailOpenFailedError("unavailable");if(n.ok===!1)throw o.openFailureFromResponse(n);return n.data?o.WpEmailToEmail(n.data):null},async createEmail(t){const n={status:"publish",...Us(t)},r=await g.getApi(e,zr).email_create(n,{type:g.ContentType.Json});return o.WpEmailToEmail(r?.data)},async updateEmail(t,n){const r=await g.getApi(e,zr).email_partial_update({id:t},Us(n),{type:g.ContentType.Json,extraQuery:{_embed:"wp:term",_fields:Bs}});return o.WpEmailToEmail(r?.data)}}}function W_(e){o.injectRestEmailPortFactories(e,{email:G_,history:z_,blockHistory:F_})}var Gr=20,H_=({source:e,emailtags:t,group:n,tags:r,...i})=>i;function q_({revisions:e,revisionsByBlock:t}){const n=async(r,i)=>(t.clear(),await t.get(r,{page:i}),(await e.cache.values()??[]).filter(a=>String(a?.parent)===String(r)));return{async readRevisions(r,i=1){const a=await n(r,i);return{revisions:a.slice(Gr*(i-1),Gr*i),page:i,hasMore:a.length>Gr*i}},async readAutosave(r){return o.autosaveStateFromRevisions(await n(r,1))},async saveAutosave(r,i){const a=H_(i);return await e.create({...a,parent:r,modified:new Date().toString()})}}}var $s=g.createIdentifier$1("blockDocuments.provided");function V_(e){if(e.getInstance($s))return;e.inject($s,!0);const t=o.blockRevisionsDataSourceProvider(e);o.injectBlockHistoryPort(e,q_({revisions:t,revisionsByBlock:t.byForeignKey("parent")}))}var Y_=zt.__commonJSMin(((e,t)=>{(function(n){if(typeof window>"u")return;var r=0,i,a=!1,c=!1,d=7,u="[iFrameSizer]",m=u.length,f=null,h=window.requestAnimationFrame,_=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),p={},E=null,k=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){L("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function b(C,T,R){C.addEventListener(T,R,!1)}function x(C,T,R){C.removeEventListener(T,R,!1)}function P(){for(var C=["moz","webkit","o","ms"],T=0;T<C.length&&!h;T+=1)h=window[C[T]+"RequestAnimationFrame"];h?h=h.bind(window):O("setup","RequestAnimationFrame not supported")}function Y(C){var T="Host page: "+C;return window.top!==window.self&&(T=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+C:"Nested host page: "+C),T}function J(C){return u+"["+Y(C)+"]"}function N(C){return p[C]?p[C].log:a}function O(C,T){z("log",C,T,N(C))}function A(C,T){z("info",C,T,N(C))}function L(C,T){z("warn",C,T,!0)}function z(C,T,R,D){D===!0&&window.console}function B(C){function T(){function U(){et(re),Z(ee),Ge("onResized",re)}S("Height"),S("Width"),ve(U,re,"init")}function R(){var U=Xe.slice(m).split(":"),le=U[1]?parseInt(U[1],10):0,xe=p[U[0]]&&p[U[0]].iframe,Se=getComputedStyle(xe);return{iframe:xe,id:U[0],height:le+D(Se)+I(Se),width:U[2],type:U[3]}}function D(U){return U.boxSizing!=="border-box"?0:(U.paddingTop?parseInt(U.paddingTop,10):0)+(U.paddingBottom?parseInt(U.paddingBottom,10):0)}function I(U){return U.boxSizing!=="border-box"?0:(U.borderTopWidth?parseInt(U.borderTopWidth,10):0)+(U.borderBottomWidth?parseInt(U.borderBottomWidth,10):0)}function S(U){var le=Number(p[ee]["max"+U]),xe=Number(p[ee]["min"+U]),Se=U.toLowerCase(),Me=Number(re[Se]);O(ee,"Checking "+Se+" is in range "+xe+"-"+le),Me<xe&&(Me=xe,O(ee,"Set "+Se+" to min value")),Me>le&&(Me=le,O(ee,"Set "+Se+" to max value")),re[Se]=""+Me}function se(){function U(){function Se(){var We=0,Be=!1;for(O(ee,"Checking connection is from allowed list of origins: "+xe);We<xe.length;We++)if(xe[We]===le){Be=!0;break}return Be}function Me(){var We=p[ee]&&p[ee].remoteHost;return O(ee,"Checking connection is from: "+We),le===We}return xe.constructor===Array?Se():Me()}var le=C.origin,xe=p[ee]&&p[ee].checkOrigin;if(xe&&""+le!="null"&&!U())throw new Error("Unexpected message received from: "+le+" for "+re.iframe.id+". Message was: "+C.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function we(){return u===(""+Xe).slice(0,m)&&Xe.slice(m).split(":")[0]in p}function Ke(){var U=re.type in{true:1,false:1,undefined:1};return U&&O(ee,"Ignoring init message from meta parent page"),U}function Qe(U){return Xe.slice(Xe.indexOf(":")+d+U)}function ze(U){O(ee,"onMessage passed: {iframe: "+re.iframe.id+", message: "+U+"}"),Ge("onMessage",{iframe:re.iframe,message:JSON.parse(U)}),O(ee,"--")}function Ze(){var U=document.body.getBoundingClientRect(),le=re.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:le.height,iframeWidth:le.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(le.top-U.top,10),offsetLeft:parseInt(le.left-U.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function mt(U,le){function xe(){fe("Send Page Info","pageInfo:"+Ze(),U,le)}Te(xe,32,le)}function vt(){function U(Me,We){function Be(){p[Se]?mt(p[Se].iframe,Se):le()}["scroll","resize"].forEach(function(rt){O(Se,Me+rt+" listener for sendPageInfo"),We(window,rt,Be)})}function le(){U("Remove ",x)}function xe(){U("Add ",b)}var Se=ee;xe(),p[Se]&&(p[Se].stopPageInfo=le)}function ft(){p[ee]&&p[ee].stopPageInfo&&(p[ee].stopPageInfo(),delete p[ee].stopPageInfo)}function lt(){var U=!0;return re.iframe===null&&(L(ee,"IFrame ("+re.id+") not found"),U=!1),U}function G(U){var le=U.getBoundingClientRect();return H(ee),{x:Math.floor(Number(le.left)+Number(f.x)),y:Math.floor(Number(le.top)+Number(f.y))}}function V(U){function le(){f=We,te(),O(ee,"--")}function xe(){return{x:Number(re.width)+Me.x,y:Number(re.height)+Me.y}}function Se(){window.parentIFrame?window.parentIFrame["scrollTo"+(U?"Offset":"")](We.x,We.y):L(ee,"Unable to scroll to requested position, window.parentIFrame not found")}var Me=U?G(re.iframe):{x:0,y:0},We=xe();O(ee,"Reposition requested from iFrame (offset x:"+Me.x+" y:"+Me.y+")"),window.top===window.self?le():Se()}function te(){Ge("onScroll",f)===!1?De():Z(ee)}function ue(U){function le(){var Be=G(We);O(ee,"Moving to in page link (#"+Se+") at x: "+Be.x+" y: "+Be.y),f={x:Be.x,y:Be.y},te(),O(ee,"--")}function xe(){window.parentIFrame?window.parentIFrame.moveToAnchor(Se):O(ee,"In page link #"+Se+" not found and window.parentIFrame not found")}var Se=U.split("#")[1]||"",Me=decodeURIComponent(Se),We=document.getElementById(Me)||document.getElementsByName(Me)[0];We?le():window.top===window.self?O(ee,"In page link #"+Se+" not found"):xe()}function ge(U){var le={};if(Number(re.width)===0&&Number(re.height)===0){var xe=Qe(9).split(":");le={x:xe[1],y:xe[0]}}else le={x:re.width,y:re.height};Ge(U,{iframe:re.iframe,screenX:Number(le.x),screenY:Number(le.y),type:re.type})}function Ge(U,le){return $(ee,U,le)}function qe(){switch(p[ee]&&p[ee].firstRun&&Oe(),re.type){case"close":pe(re.iframe);break;case"message":ze(Qe(6));break;case"mouseenter":ge("onMouseEnter");break;case"mouseleave":ge("onMouseLeave");break;case"autoResize":p[ee].autoResize=JSON.parse(Qe(9));break;case"scrollTo":V(!1);break;case"scrollToOffset":V(!0);break;case"pageInfo":mt(p[ee]&&p[ee].iframe,ee),vt();break;case"pageInfoStop":ft();break;case"inPageLink":ue(Qe(9));break;case"reset":be(re);break;case"init":T(),Ge("onInit",re.iframe);break;default:Number(re.width)===0&&Number(re.height)===0?L("Unsupported message received ("+re.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):T()}}function at(U){var le=!0;return p[U]||(le=!1,L(re.type+" No settings for "+U+". Message was: "+Xe)),le}function Bt(){for(var U in p)fe("iFrame requested init",K(U),p[U].iframe,U)}function Oe(){p[ee]&&(p[ee].firstRun=!1)}var Xe=C.data,re={},ee=null;Xe==="[iFrameResizerChild]Ready"?Bt():we()?(re=R(),ee=re.id,p[ee]&&(p[ee].loaded=!0),!Ke()&&at(ee)&&(O(ee,"Received: "+Xe),lt()&&se()&&qe())):A(ee,"Ignored: "+Xe)}function $(C,T,R){var D=null,I=null;if(p[C])if(D=p[C][T],typeof D=="function")I=D(R);else throw new TypeError(T+" on iFrame["+C+"] is not a function");return I}function de(C){var T=C.id;delete p[T]}function pe(C){var T=C.id;if($(T,"onClose",T)===!1){O(T,"Close iframe cancelled by onClose event");return}O(T,"Removing iFrame: "+T);try{C.parentNode&&C.parentNode.removeChild(C)}catch(R){L(R)}$(T,"onClosed",T),O(T,"--"),de(C),i&&(i.disconnect(),i=null)}function H(C){f===null&&(f={x:window.pageXOffset===n?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===n?document.documentElement.scrollTop:window.pageYOffset},O(C,"Get page position: "+f.x+","+f.y))}function Z(C){f!==null&&(window.scrollTo(f.x,f.y),O(C,"Set page position: "+f.x+","+f.y),De())}function De(){f=null}function be(C){function T(){et(C),fe("reset","reset",C.iframe,C.id)}O(C.id,"Size reset requested by "+(C.type==="init"?"host page":"iFrame")),H(C.id),ve(T,C,"reset")}function et(C){function T(S){if(!C.id){O("undefined","messageData id not set");return}C.iframe.style[S]=C[S]+"px",O(C.id,"IFrame ("+I+") "+S+" set to "+C[S]+"px")}function R(S){!c&&C[S]==="0"&&(c=!0,O(I,"Hidden iFrame detected, creating visibility listener"),Fe())}function D(S){T(S),R(S)}var I=C.iframe.id;p[I]&&(p[I].sizeHeight&&D("height"),p[I].sizeWidth&&D("width"))}function ve(C,T,R){R!==T.type&&h&&!window.jasmine?(O(T.id,"Requesting animation frame"),h(C)):C()}function fe(C,T,R,D,I){function S(){var ze=p[D]&&p[D].targetOrigin;O(D,"["+C+"] Sending msg to iframe["+D+"] ("+T+") targetOrigin: "+ze),R.contentWindow.postMessage(u+T,ze)}function se(){L(D,"["+C+"] IFrame("+D+") not found")}function we(){R&&"contentWindow"in R&&R.contentWindow!==null?S():se()}function Ke(){function ze(){p[D]&&!p[D].loaded&&!Qe&&(Qe=!0,L(D,"IFrame has not responded within "+p[D].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}I&&p[D]&&p[D].warningTimeout&&(p[D].msgTimeout=setTimeout(ze,p[D].warningTimeout))}var Qe=!1;D=D||R.id,p[D]&&(we(),Ke())}function K(C){return C+":"+p[C].bodyMarginV1+":"+p[C].sizeWidth+":"+p[C].log+":"+p[C].interval+":"+p[C].enablePublicMethods+":"+p[C].autoResize+":"+p[C].bodyMargin+":"+p[C].heightCalculationMethod+":"+p[C].bodyBackground+":"+p[C].bodyPadding+":"+p[C].tolerance+":"+p[C].inPageLinks+":"+p[C].resizeFrom+":"+p[C].widthCalculationMethod+":"+p[C].mouseEvents}function me(C){return typeof C=="number"}function ie(C,T){function R(){function V(ue){var ge=p[G][ue];ge!==1/0&&ge!==0&&(C.style[ue]=me(ge)?ge+"px":ge,O(G,"Set "+ue+" = "+C.style[ue]))}function te(ue){if(p[G]["min"+ue]>p[G]["max"+ue])throw new Error("Value for min"+ue+" can not be greater than max"+ue)}te("Height"),te("Width"),V("maxHeight"),V("minHeight"),V("maxWidth"),V("minWidth")}function D(){var V=T&&T.id||k.id+r++;return document.getElementById(V)!==null&&(V+=r++),V}function I(V){if(typeof V!="string")throw new TypeError("Invaild id for iFrame. Expected String");return V===""&&(C.id=V=D(),a=(T||{}).log,O(V,"Added missing iframe ID: "+V+" ("+C.src+")")),V}function S(){switch(O(G,"IFrame scrolling "+(p[G]&&p[G].scrolling?"enabled":"disabled")+" for "+G),C.style.overflow=(p[G]&&p[G].scrolling)===!1?"hidden":"auto",p[G]&&p[G].scrolling){case"omit":break;case!0:C.scrolling="yes";break;case!1:C.scrolling="no";break;default:C.scrolling=p[G]?p[G].scrolling:"no"}}function se(){(typeof(p[G]&&p[G].bodyMargin)=="number"||(p[G]&&p[G].bodyMargin)==="0")&&(p[G].bodyMarginV1=p[G].bodyMargin,p[G].bodyMargin=""+p[G].bodyMargin+"px")}function we(){var V=p[G]&&p[G].firstRun,te=p[G]&&p[G].heightCalculationMethod in _;!V&&te&&be({iframe:C,height:0,width:0,type:"init"})}function Ke(){p[G]&&(p[G].iframe.iFrameResizer={close:pe.bind(null,p[G].iframe),removeListeners:de.bind(null,p[G].iframe),resize:fe.bind(null,"Window resize","resize",p[G].iframe),moveToAnchor:function(V){fe("Move to anchor","moveToAnchor:"+V,p[G].iframe,G)},sendMessage:function(V){V=JSON.stringify(V),fe("Send Message","message:"+V,p[G].iframe,G)}})}function Qe(V){function te(){fe("iFrame.onload",V,C,n,!0),we()}function ue(Ge){if(!C.parentNode)return null;var qe=new Ge(function(at){at.forEach(function(Bt){Array.prototype.slice.call(Bt.removedNodes).forEach(function(Oe){Oe===C&&pe(C)})})});return qe.observe(C.parentNode,{childList:!0}),qe}var ge=w();ge&&(i=ue(ge)),b(C,"load",te),fe("init",V,C,n,!0)}function ze(V){if(typeof V!="object")throw new TypeError("Options is not an object")}function Ze(V){for(var te in k)Object.prototype.hasOwnProperty.call(k,te)&&(p[G][te]=Object.prototype.hasOwnProperty.call(V,te)?V[te]:k[te])}function mt(V){return V===""||V.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":V}function vt(V){var te=V.split("Callback");if(te.length===2){var ue="on"+te[0].charAt(0).toUpperCase()+te[0].slice(1);this[ue]=this[V],delete this[V],L(G,"Deprecated: '"+V+"' has been renamed '"+ue+"'. The old method will be removed in the next major version.")}}function ft(V){V=V||{},p[G]=Object.create(null),p[G].iframe=C,p[G].firstRun=!0,p[G].remoteHost=C.src&&C.src.split("/").slice(0,3).join("/"),ze(V),Object.keys(V).forEach(vt,V),Ze(V),p[G]&&(p[G].targetOrigin=p[G].checkOrigin===!0?mt(p[G].remoteHost):"*")}function lt(){return G in p&&"iFrameResizer"in C}var G=I(C.id);lt()?L(G,"Ignored iFrame, already setup."):(ft(T),S(),R(),se(),Qe(K(G)),Ke())}function ae(C,T){E===null&&(E=setTimeout(function(){E=null,C()},T))}var Ae={};function Te(C,T,R){Ae[R]||(Ae[R]=setTimeout(function(){Ae[R]=null,C()},T))}function Fe(){function C(){function I(S){function se(Ke){return(p[S]&&p[S].iframe.style[Ke])==="0px"}function we(Ke){return Ke.offsetParent!==null}p[S]&&we(p[S].iframe)&&(se("height")||se("width"))&&fe("Visibility change","resize",p[S].iframe,S)}Object.keys(p).forEach(function(S){I(S)})}function T(I){O("window","Mutation observed: "+I[0].target+" "+I[0].type),ae(C,16)}function R(){var I=document.querySelector("body");new D(T).observe(I,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0})}var D=w();D&&R()}function X(C){function T(){Ie("Window "+C,"resize")}O("window","Trigger event: "+C),ae(T,16)}function Ee(){function C(){Ie("Tab Visible","resize")}document.visibilityState!=="hidden"&&(O("document","Trigger event: Visibility change"),ae(C,16))}function Ie(C,T){function R(D){return p[D]&&p[D].resizeFrom==="parent"&&p[D].autoResize&&!p[D].firstRun}Object.keys(p).forEach(function(D){R(D)&&fe(C,T,p[D].iframe,D)})}function he(){b(window,"message",B),b(window,"resize",function(){X("resize")}),b(document,"visibilitychange",Ee),b(document,"-webkit-visibilitychange",Ee)}function Re(){function C(D,I){function S(){if(I.tagName){if(I.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+I.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}I&&(S(),ie(I,D),R.push(I))}function T(D){D&&D.enablePublicMethods&&L("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var R;return P(),he(),function(I,S){switch(R=[],T(I),typeof S){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(S||"iframe"),C.bind(n,I));break;case"object":C(I,S);break;default:throw new TypeError("Unexpected data type ("+typeof S+")")}return R}}function $e(C){C.fn?C.fn.iFrameResize||(C.fn.iFrameResize=function(R){function D(I,S){ie(S,R)}return this.filter("iframe").each(D).end()}):A("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==n&&$e(window.jQuery),typeof define=="function"&&define.amd?define([],Re):typeof t=="object"&&typeof t.exports=="object"&&(t.exports=Re()),window.iFrameResize=window.iFrameResize||Re()})()})),K_=zt.__toESM(Y_()),Q_={checkOrigin:!1,minHeight:600,scrolling:!1};function X_(e){const t=()=>e.iFrameResizer;return(0,K_.default)(Q_,e),{resize:()=>t()?.resize?.(),dispose:()=>t()?.removeListeners?.()}}function J_(e){e.inject(Di,X_)}function Z_(e){const t=o.getMessageService(e),n=e.getInstance(o.LOCALE_SERVICE_ID);if(!n)return;let r="";const i=()=>{const d=n.snapshot(),u=d.id??"";if(!t.isInited()||u===r)return;const m=o.createI18n(d.catalog),f=_=>m.__(_),h=o.SANDBOX_TRANSLATIONS_MAP(f);r=u,t.send(o.EVENT_TYPES.SANDBOX_TRANSLATIONS,{name:u,data:h})},a=t.onInit(()=>{r="",i()}),c=n.state.watch(i);e.getInstance(g.DISPOSABLE_ID)?.addDispose(()=>{a.dispose(),c.dispose()})}function eb(e){const t=e?.content?.templateId;return t==null||t===""?void 0:String(t)}function tb(e){e.getInstance(g.OPTIONS_SOURCE_ID)?.watch(t=>{const n=eb(t);n!==void 0&&qh(e,n)})}var Wr={en_US:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/e9fd7972.js")),void 0,{}.url),ru_RU:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/8ca96066.js")).then(e=>e.ru_RU_exports),void 0,{}.url),uk_UA:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/1655f40f.js")),void 0,{}.url),es_ES:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/fabc717f.js")),void 0,{}.url),pt_BR:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/b9758690.js")),void 0,{}.url),de_DE:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/7b7c0c8c.js")),void 0,{}.url),fr_FR:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/5c7e24b5.js")),void 0,{}.url),it_IT:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/de611927.js")),void 0,{}.url),pl_PL:()=>(0,Ve.__vitePreload)(()=>Promise.resolve().then(()=>_e("./static/core/f4a519b0.js")),void 0,{}.url)};async function nb(e){const t=Wr[e];if(!t){const n=Wr.en_US;return n?(await n()).default:void 0}return(await t()).default}var P0=Object.keys(Wr),ob=e=>e==="uk"?"uk_UA":e;function rb(e){e.getInstance(o.LOCALE_SERVICE_ID)?.useAntdLoader(t=>nb(ob(t)))}var zs={id:"ru_RU",time:1790589483,hash:"12de8d6a5e2f68343bd8b4f78da589e3b0af7c67ec27bfe1cc93b975c014c332",catalog:JSON.parse(`{"":{"domain":"default","lang":"ru_RU","plural_forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10 >= 2 && n%10<=4 &&(n%100<10||n%100 >= 20)? 1 : 2);"}," Add section":["Добавить раздел"]," email was":["письмо","письма","писем"]," from the project successfully.":["из проекта."]," successfully imported.":["импортировано."],"\\" email?":["»?"],"\\" was successfully created.":["\\" создано."],"\\" was successfully removed.":["» удалён."],"%d day":["%d день","%d дня","%d дней"],"%d day left":["%d день остался","%d дня осталось","%d дней осталось"],"%s plan":["Тариф %s"],"+0:00 London, Lisbon, Dublin":["+0:00 Лондон, Лиссабон, Дублин"],"+10:00 Sydney, Melbourne, Port Moresby":["+10:00 Сидней, Мельбурн, Порт-Морсби"],"+11:00 Honiara, Nuku'alofa, Apia":["+11:00 Хониара, Нукуалофа, Апиа"],"+1:00 Paris, Berlin, Rome":["+1:00 Париж, Берлин, Рим"],"+2:00 Athens, Kiev, Istanbul":["+2:00 Афины, Киев, Стамбул"],"+3:00 Istanbul, Doha, Baghdad":["+3:00 Москва, Санкт-Петербург, Киев"],"+4:00 Baku, Dubai, Tbilisi":["+4:00 Баку, Дубай, Тбилиси"],"+5:00 Karachi, Tashkent, Islamabad":["+5:00 Екатеринбург, Ташкент, Исламабад"],"+6:00 Almaty, Dhaka, Bishkek":["+6:00 Алматы, Дакка, Омск"],"+7:00 Bangkok, Ho Chi Minh City, Jakarta":["+7:00 Бангкок, Хошимин, Джакарта"],"+8:00 Beijing, Hong Kong, Singapore":["+8:00 Пекин, Гонконг, Сингапур"],"+9:00 Tokyo, Seoul, Jayapura":["+9:00 Токио, Сеул, Якутск"],"-10:00 Honolulu, Anchorage":["-10:00 Гонолулу, Анкоридж"],"-11:00 Pago Pago, Midway Atoll":["- 11:00 Паго-Паго, атолл Мидуэй"],"-12:00 Apia":["-12:00 Апиа"],"-1:00 Azores, Cape Verde":["-1:00 Азорские острова, Кабо-Верде"],"-2:00 South Georgia, Saint Helena":["-2:00 Южная Джорджия, остров Святой Елены"],"-3:00 Buenos Aires, Santiago, Montevideo":["-3:00 Буэнос-Айрес, Сантьяго, Монтевидео"],"-4:00 Caracas, Santo Domingo":["-4:00 Каракас, Санто-Доминго"],"-5:00 New York, Toronto, Havana":["-5:00 Нью-Йорк, Торонто, Гавана"],"-6:00 Mexico City, Guadalajara":["-6:00 Мехико, Гвадалахара"],"-7:00 Denver, Phoenix":["-7:00 Денвер, Феникс"],"-8:00 Los Angeles, Vancouver":["-8:00 Лос-Анджелес, Ванкувер"],"-9:00 Anchorage, Yukon":["-9:00 Анкоридж, Юкон"],"/ month":["/ месяц"],"1000+":["1000+"],"11–50":["11–50"],"12 hours":["12 часов"],"123456, City, 1 Example St.":["123456, Город, ул. Пример, 1"],"14 days free":["14 дней бесплатно"],"1–10":["1–10"],"20 s":["20 s"],"201–500":["201–500"],"24 hours":["24 часа"],"40 s":["40 s"],"501–1000":["501–1000"],"51–200":["51–200"],"60 s":["60 s"],"<1>Upload your own templates</1> or use <2>ready-made ones</2> to create emails from blocks.":["<1>Загружайте свои шаблоны</1> или используйте <2>готовые</2> для создания писем из блоков."],"A browser extension (for example, Urban VPN Proxy or similar ad blockers/VPN tools) is injecting code into the email preview. This can corrupt your template when saving.":["Расширение браузера (например, Urban VPN Proxy или аналогичные блокировщики рекламы/VPN-сервисы) вставляет код в окно предварительного просмотра письма. Это может привести к повреждению шаблона при сохранении."],"A flexible plan tailored to your needs":["Гибкий план, разработанный с учетом ваших потребностей"],"A shareable link to this page has been copied to the clipboard.":["Ссылка на страницу предпросмотра скопирована в буфер обмена."],"A test email can be sent to a maximum of 10 addresses.":["Тестовое письмо можно отправить максимум на 10 адресов."],"A-Z":["А-Я"],"AI":["AI"],"AI Assistant":["AI Ассистент"],"AI assistant":["AI Ассистент"],"AI email generation":["AI генерация письма"],"AI image":["AI картинка"],"AI image generation":["AI генерация изображений"],"AI requests":["Запросы к ИИ"],"AMP":["AMP"],"AMP visibility":["Видимость в AMP"],"API Key":["Ключ API"],"API Token":["Токен API"],"API URL":["URL API"],"Above":["Сверху"],"Accepted formats: PNG, JPG, WEBP, SVG or GIF.":["Доступные форматы: PNG, JPG, SVG или GIF."],"Access Key ID":["Идентификатор ключа доступа"],"Access keys and integration":["Ключи доступа и интеграция"],"Accessibility":["Доступность"],"Accessibility text":["Текст для людей с ограниченными возможностями"],"Accordion":["Аккордеон"],"Account Login":["Логин"],"Account settings":["Настройки аккаунта"],"Actions with the chosen text":["Действия с выбранным текстом"],"Active date background color":["Цвет фона активной даты"],"Active date font":["Шрифт активной даты"],"Add a common block":["Добавить общий блок"],"Add a font file or a link to the font.":["Добавьте файл шрифта или ссылку на него."],"Add a new folder":["Добавить новую папку"],"Add a new group":["Добавить группу"],"Add a new project":["Создать проект"],"Add a note":["Добавить метку"],"Add a saved block":["Добавить сохранённый блок"],"Add a template block":["Добавить шаблонный блок"],"Add an empty block":["Добавить пустой блок"],"Add block":["Добавить блок"],"Add button":["Добавить кнопку"],"Add card":["Добавить карточку"],"Add color":["Добавить цвет"],"Add column":["Добавить колонку"],"Add first color":["Добавить первый цвет"],"Add first link":["Добавить первую ссылку"],"Add group":["Добавить группу"],"Add image":["Изображение"],"Add inline image":["Вставить картинку"],"Add paragraph":["Добавить абзац"],"Add slide":["Добавить слайд"],"Add social network":["Добавить соцсеть"],"Add social network links to use in your email templates.":["Добавьте ссылки на соцсети, чтобы использовать их в шаблонах писем."],"Add some tags":["Укажите несколько тегов"],"Add up to 10 recipients":["Добавьте до 10 получателей"],"Add value":["Добавить значение"],"Add your brand palette and reuse it in the email editor.":["Добавьте палитру бренда и используйте её в редакторе писем."],"Add your first block to the folder...":["Добавьте свой первый блок в папку..."],"Added Drawing":["Добавление рисунка"],"Added Frame":["Добавление рамки"],"Added Image":["Добавление изображения"],"Added Shape":["Добавление фигуры"],"Added Sticker":["Добавление стикера"],"Added Text":["Добавление текста"],"Address of any S3-compatible storage, for example https://storage.example.com":["Адрес любого S3-совместимого хранилища, например https://storage.example.com"],"Adds VML markup so the background image is visible in Outlook.":["Добавляет разметку VML, чтобы фоновое изображение отображалось в Outlook."],"Adds bulletproof VML markup so the button keeps rounded corners in Outlook.":["Добавляет разметку VML, благодаря чему кнопка сохраняет закругленные углы в Outlook."],"Administrator":["Администратор"],"Align bottom":["По нижнему краю"],"Align center":["По центру"],"Align left":["Влево"],"Align middle":["Посередине"],"Align right":["Вправо"],"Align top":["По верхнему краю"],"Alignments":["Выравнивание"],"All":["Все"],"All EmailMaker features are available for 14 days":["Все функции EmailMaker доступны в течение 14 дней."],"All blocks saved at this point can be found in the “Saved Blocks” section in the sidebar.":["Все сохраненные на данный момент блоки можно найти в разделе «Сохраненные блоки» на боковой панели."],"All blocks saved successfully.":["Все блоки сохранены."],"All emails sent to this address will be added to your project as a template.":["Все письма, которые придут на этот адрес, будут добавлены в ваш проект в виде шаблона"],"All folders":["Все папки"],"All roles":["Все роли"],"Allow multiple selection":["Разрешить множественный выбор"],"Allowed protocols":["Допустимые протоколы"],"Already imported":["Уже импортировано"],"Altcraft":["Altcraft"],"Alternative text":["Альтернативный текст"],"Always":["Всегда"],"Amount":["Сумма"],"An unexpected error has occurred. Our team has already been notified. Please try reloading the page.":["Произошла непредвиденная ошибка. Наша команда уже получила уведомление. Попробуйте перезагрузить страницу."],"Anchor":["Якорь"],"Anchor links do not work in Outlook, Gmail, and several other email clients.":["Якорные ссылки не работают в Outlook, Gmail и ряде других почтовых клиентов."],"Anchor name":["Имя якоря"],"Animate":["Анимация"],"Annotation type":["Тип аннотации"],"Annotations":["Аннотации"],"Any additional details":["Любые дополнительные сведения"],"Appearance":["Внешний вид"],"Appearance on mobile devices":["Внешний вид на мобильных устройствах"],"Applied Filters":["Применение фильтров"],"Apply":["Применить"],"Apply horizontal padding to height":["Применить горизонтальный отступ к высоте"],"Approaching usage limit. Remaining":["Приближается предел использования. Остаток"],"Apps":["Приложения"],"Are you sure you want to delete project ":["Вы уверены, что хотите удалить проект "],"Are you sure you want to disable this integration?":["Вы уверены, что хотите отключить эту интеграцию?"],"Are you sure you want to leave the project ":["Вы уверены, что хотите покинуть проект "],"Are you sure?":["Вы уверены"],"Around":["Вокруг"],"Arrow":["Стрелка"],"Arrow color":["Цвет стрелки"],"Article":["Статьи"],"At least 8 characters in both cases, including letters, numbers, and special characters.":["Минимум 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least 8 characters, including a combination of uppercase and lowercase letters, numbers, and special characters.":["Не менее 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least one card needs an image and a link starting with https://":["Нужна хотя бы одна карточка с изображением и ссылкой, начинающейся с https://"],"Author":["Автор"],"Authorization error via Yandex":["Ошибка авторизации через Яндекс"],"Authorization keys":["Ключи авторизации"],"Auto":["Авто"],"Auto-payment enabled":["Автоплатёж включён"],"Auto-payment will be available once the subscription is linked in the payment system.":["Автоматическая оплата станет доступна после привязки подписки в платежной системе."],"Auto-prepend protocol on blur":["Автоматически добавлять протокол при потере фокуса"],"Autoplay":["Автозапуск"],"Autosave in editor":["Автосохранение в редакторе"],"Available formats: HTML, EML, ZIP":["Доступные форматы: HTML, EML, ZIP"],"Available until:":["Оплачен до:"],"BIK (bank ID)":["БИК"],"BIK must be 9 digits":["БИК должен состоять из 9 цифр"],"Back":["Назад"],"Back Home":["Вернуться"],"Back To Project":["Вернуться в проект"],"Back To Projects":["Вернуться к проектам"],"Back to Log In":["Вернуться к авторизации"],"Back to integrations":["К интеграциям"],"Background":["Фон"],"Background color":["Цвет фона"],"Background color of the contrast blocks":["Цвет фона контрастных блоков"],"Background image":["Фоновое изображение"],"Background image in Outlook (VML)":["Фоновое изображение в Outlook (VML)"],"Background image link/route":["Ссылка на фоновое изображение"],"Background image repeat":["Повтор фона"],"Background image size":["Размер фона"],"Bank account (RUB)":["Банковский счет (рубли)"],"Bank name":["Название банка"],"Banners":["Баннеры"],"Base URL for public access to files":["Базовый адрес для публичного доступа к файлам"],"Base background color":["Базовый цвет фона"],"Base colors":["Базовые цвета"],"Base path for uploading files":["Базовый путь для загрузки файлов"],"Base text color":["Базовый цвет текста"],"Beach":["Пляж"],"Before exporting the project, make sure to provide the URL where the webhook request will be sent":["Перед экспортом проекта необходимо заполнить url, на который будет отправляться запрос webHook"],"Below":["Снизу"],"Between bullets and text":["Между буллетами и текстом"],"Between list items":["Между пунктами списка"],"Billing":["Тарифы и оплата"],"Billing period":["Расчетный период"],"Black":["Чёрный"],"Black and White":["Чёрно-белые"],"Black circle":["Чёрный круг"],"Black circle outlined":["Чёрный круг обводка"],"Blank template":["Пустой шаблон"],"Block":["Блок"],"Block name":["Название блока"],"Block not yet loaded or global container not found.":["Код блока не загружен или глобальный контейнер не найден."],"Block styles":["Стили блока"],"Blocks":["Блоки"],"Blocks background color":["Цвет фона блоков"],"Blocks not found":["Блоки не найдены."],"Blocks search":["Поиск блоков"],"Blocks storage":["Хранилище Blocks"],"Blue":["Синий"],"Blur radius":["Размытие"],"Body":["Сообщение"],"Border":["Рамка"],"Border color":["Цвет рамки"],"Border radius":["Скругление"],"Borders":["Рамка"],"Both":["Всегда"],"Bottom":["Снизу"],"Bottom Code panel":["Панель кода снизу"],"Bottom left corner":["Нижний левый угол"],"Bottom margin":["Отступ снизу"],"Bottom padding":["Отступ снизу"],"Bottom padding of the general text":["Нижний отступ у текста"],"Bottom right corner":["Нижний правый угол"],"Box shadow":["Тень"],"Broadcast successfully created!":["Выпуск успешно создан!"],"Browser extension detected":["Обнаружено расширение для браузера"],"Browser page translation (for example, Google Translate) is active. It can break the editor and cause errors when saving.":["Включена функция перевода страницы в браузере (например, Google Translate). Это может привести к сбоям в работе редактора и вызывать ошибки при сохранении."],"Browser translation detected":["Обнаружен перевод с помощью браузера"],"Brush Color":["Цвет кисти"],"Brush Size":["Размер кисти"],"Brush Type":["Тип кисти"],"Bubbles":["Пузыри"],"Bucket name":["Имя бакета"],"Build newsletters from scratch with <1>structures and elements</1>.":["Собирайте рассылки с нуля с помощью <1>структур и элементов</1>."],"Bulk saving of blocks":["Массовое сохранение блоков"],"Bullet":["Буллет"],"Bullets color":["Цвет буллетов"],"Bullets font":["Шрифт буллетов"],"Bullets size":["Размер буллетов"],"Bullets type":["Тип буллетов"],"Button":["Кнопка"],"Button background color in contrasting blocks":["Цвет фона кнопок в контрастных блоках"],"Button size":["Размер кнопки"],"Button text color in contrasting blocks":["Цвет текста кнопок в контрастных блоках"],"Buttons":["Кнопки"],"Buttons background color":["Цвет фона кнопки"],"Buttons font":["Шрифт кнопки"],"Buttons font size":["Размер текста кнопки"],"Buttons letter spacing":["Межбуквенный интервал кнопки"],"Buttons text color":["Цвет текста кнопки"],"Buy":["Купить"],"Buy generations":["Купить генерации"],"Buy image check package":["Купить пакет проверки изображений"],"Buy link check package":["Купить пакет проверки ссылок"],"Buy optimization package":["Купить пакет оптимизации"],"Buy package":["Купить пакет"],"Buy spam check package":["Купить пакет проверки на спам"],"Buy test sends package":["Купить пакет тестов"],"By card":["Картой"],"Calendar":["Календарь"],"Call to Action":["Призыв к действию"],"Campaign created. Dotdigital used your account default sender because this From email is not registered as a custom from address. Add the address in Dotdigital and export again to use it.":["Кампания создана. Dotdigital использовал отправителя по умолчанию вашей учетной записи, поскольку этот адрес электронной почты в поле «От» не зарегистрирован в качестве настраиваемого адреса отправителя. Добавьте адрес в Dotdigital и повторно экспортируйте данные, чтобы использовать его."],"Campaign successfully created!":["Кампания успешно создана!"],"Cancel":["Отмена"],"Cannot disable recurring payments":["Не удается отключить автоплатёж"],"Cannot enable recurring payments":["Не удается включить автоплатёж"],"Captcha required":["Требуется ввести капчу"],"Captcha verification failed":["Ошибка при проверке капчи"],"Caption next to checkbox":["Подпись рядом с чекбоксом"],"Caption next to options":["Подпись рядом с пунктами"],"Card":["Карточка"],"Card payment is not available for this change.":["Для данной операции оплата картой недоступна."],"Card payment is not available for this change. Use an invoice for a legal entity.":["Для данного изменения оплата картой недоступна. Для юридического лица воспользуйтесь счётом-фактурой."],"Card payment is not available for this plan change. Please contact support.":["Оплата картой недоступна при изменении тарифного плана. Пожалуйста, обратитесь в службу поддержки."],"Card payment is not available for this plan change. Use an invoice for a legal entity or contact support.":["Для данного изменения тарифного плана оплата картой недоступна. Для юридических лиц воспользуйтесь счетом-фактурой или обратитесь в службу поддержки."],"Cards":["Карточки"],"Cards view":["Карточки"],"Carousel":["Карусель"],"Case Change":["Изменение ситуации"],"Cell":["Ячейка"],"Center horizontally":["По центру"],"Center vertically":["По центру"],"Change":["Изменить"],"Change Stripo key":["Сменить ключ Stripo"],"Change folder name":["Переименовать папку"],"Change group name":["Переименовать группу"],"Change image":["Сменить изображение"],"Change name":["Переименовать"],"Change plan":["Изменить тариф"],"Change role":["Изменить роль"],"Change role to Administrator":["Изменить роль на Администратор"],"Change tariff":["Сменить тариф"],"Changed Style":["Изменение стиля"],"Changes loaded":["Изменения загружены"],"Character limit":["Ограничение по количеству символов"],"Characters":["Символы"],"Chat support":["Чат поддержки"],"Check how your email appears across various devices and email clients.":["Проверьте, как будет выглядеть ваше письмо на разных устройствах и в разных почтовых клиентах."],"Check who and when made changes to the email template and, if necessary, restore one of the previous versions.":["Проверьте, кто и когда вносил изменения в шаблон, и при необходимости восстановите одну из предыдущих версий."],"Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.":["Проверьте письмо на наличие неработающих ссылок, отсутствующих alt-текстов, тяжелых изображений и других препятствий, которые могут помешать вашим письмам попасть в почтовые ящики."],"Check your network connection and try again.":["Проверьте подключение к сети и попробуйте ещё раз."],"Checkbox":["Чекбокс"],"Checked":["Отмечено"],"Checked fill color":["Цвет заливки отмеченного"],"Checked icon URL":["URL иконки отмеченного"],"Choose":["Выбрать"],"Choose a payment method":["Выберите способ оплаты"],"Choose a plan":["Выбрать тариф"],"Choose allowed protocols":["Выберите разрешенные протоколы"],"Choose block type":["Выберите тип блока"],"Choose complexity rules":["Выберите правила сложности"],"Choose input type":["Выберите тип ввода"],"Choose plan":["Выберите тариф"],"CircleBrush":["Круги"],"Clear":["Очистить"],"Clear all":["Очистить"],"Clear border":["Очистить рамку"],"Clear chat":["Очистить чат"],"Clear chat history?":["Очистить чат?"],"Clear selection":["Очистить выбор"],"Click or drag a block":["Нажмите или перетащите блок"],"Click the Add a new project button to add your first project.":["Нажмите кнопку «Добавить проект», чтобы создать свой первый проект."],"Click to select, paste from the clipboard, or drag and drop":["Перетащите изображения сюда или вставьте из буфера"],"Client ID":["Client ID"],"Client ID copied to clipboard.":["Client ID скопирован."],"Client Secret":["Client Secret"],"Client secret copied to clipboard.":["Client Secret скопирован."],"Client secret rotated successfully.":["Client Secret перевыпущен."],"Clipboard":["Буфер обмена"],"Clone":["Дублировать"],"Clone block":["Клонировать блок"],"Clone element":["Клонировать элемент"],"Clone group":["Клонировать группу"],"Close":["Закрыть"],"Closed field background":["Фон закрытого поля"],"Code":["Код"],"Code Size Warning":["Предупреждение о размере кода"],"Code editor":["Редактор кода"],"Code mode":["Режим кода"],"Code size":["Размер кода"],"Code that will replace the image \`src\`":["Код, который заменит путь к изображению"],"Collapse section":["Свернуть раздел"],"Collection of all HTTP requests used by the plugin (Postman Collection v2.1 format).":["Коллекция всех HTTP-запросов, которые использует плагин (формат Postman Collection v2.1)."],"Color":["Цвет"],"Color of the general text":["Цвет текста"],"Color settings":["Настройки цвета"],"Colors":["Цвета"],"Column":["Колонка"],"Column gap":["Отступ между колонками"],"Columns":["Колонки"],"Come up with a hint":["Придумайте подсказку"],"Coming soon":["В разработке"],"Comment":["Комментарий"],"Comment was removed.":["Комментарий удалён."],"Common blocks":["Общие блоки"],"Company size":["Размер компании"],"Complexity rules":["Правила сложности"],"Configure":["Настроить"],"Configure %s":["Настройка %s"],"Configure integration":["Настроить интеграцию"],"Configure social network link":["Настройка ссылки на соцсеть"],"Confirmation":["Подтверждение"],"Confirmation email has been sent to {confirmedEmail}.":["На адрес {confirmedEmail} отправлено письмо с подтверждением."],"Confirmation email was sent to":["Подтверждение было отправлено на"],"Connect":["Подключить"],"Connect plugin":["Подключить плагин"],"Connected":["Подключено"],"Connection established":["Соединение установлено"],"Connection test failed.":["Не удалось проверить соединение."],"Contact":["Связаться"],"Contact List ID":["ID списка контактов"],"Contact Us":["Связаться с нами"],"Contact person (full name)":["Контактное лицо (полное имя)"],"Contact sync, content personalization, and real-time campaign results tracking.":["Синхронизация контактов, персонализация содержимого и отслеживание результатов кампаний в реальном времени."],"Contacts":["Контакты"],"Contain":["Contain"],"Container":["Контейнер"],"Container width":["Ширина блока"],"Content":["Контент"],"Content styles":["Стили контента"],"Continue":["Продолжить"],"Continue (%d)":["Продолжить (%d)"],"Continue without saving":["Продолжить без сохранения"],"Contract":["Договор"],"Contract / invoice / public offer":["Договор / счёт-фактура / публичная оферта"],"Contract date":["Дата заключения договора"],"Contract number":["Номер договора"],"Contrast block":["Контрастный блок"],"Contrast block header color":["Цвет заголовка контрастного блока"],"Contrast block text color":["Цвет текста контрастного блока"],"Contrasting background color":["Контрастный цвет фона"],"Contrasting colors":["Контрастные цвета"],"Contrasting text color":["Контрастный цвет текста"],"Conversion failed":["Конвертация не удалась"],"Convert":["Конвертировать"],"Convert into an image":["Преобразовать в изображение"],"Converting layout…":["Конвертация шаблона..."],"Copy":["Копировать"],"Copy block to clipboard":["Скопировать блок в буфер обмена"],"Copy client ID":["Скопировать Client ID"],"Copy client secret":["Скопировать Client Secret"],"Copy code":["Скопировать код"],"Copy column":["Скопировать колонку"],"Copy hex":["Копировать HEX"],"Copy to clipboard":["Скопировать в буфер обмена"],"Copywriter":["Писатель"],"Corner radius":["Скругление"],"Corners":["Углы"],"Correspondent account":["Корреспондентский счёт"],"Could not activate the trial. Please try again later or contact support.":["Не удалось активировать пробную версию. Попробуйте позже или обратитесь в службу поддержки."],"Could not move files from old storage":["Не удалось переместить файлы со старого хранилища"],"Could not reach the server. Please try again later.":["Не удалось установить соединение с сервером. Пожалуйста, попробуйте позже."],"Could not save the email":["Не удалось сохранить письмо"],"Couldn\`t determine the email width":["Не удалось определить ширину письма."],"Countdown":["Таймер"],"Countdown font settings":["Шрифт таймера"],"Country selector (flag+code)":["Выбор страны (флаг + код)"],"Cover":["Cover"],"Create":["Создать"],"Create a new email":["Создать письмо"],"Create a password":["Создайте пароль"],"Create email":["Создать письмо"],"Create folder":["Создать папку"],"Create group":["Создать группу"],"Create new block":["Создать новый блок"],"Create new email":["Создать письмо"],"Create project":["Создать проект"],"Creating an email on request":["Создание письма по запросу"],"Creation date":["Дата создания"],"Crop":["Обрезать"],"Cropped Image":["Обрезка картинки"],"Cross":["Крест"],"Current password":["Текущий пароль"],"Custom":["Пользовательский"],"Custom icon":["Пользовательская иконка"],"Customized solutions for large-scale operations with high productivity":["Индивидуальные решения для крупных компаний с высокой производительностью"],"Dark":["Тёмная"],"Dark theme":["Тёмная тема"],"Dash":["Тире"],"Dashed":["Пунктир"],"Date":["Дата"],"Date format":["Формат даты"],"Days":["Дни"],"Deal Annotation":["Аннотация акции"],"Deal Card":["Карточка акции"],"Default or bound value for the field":["Значение по умолчанию или заданное значение для поля"],"Default value":["Значение по умолчанию"],"Delete":["Удалить"],"Delete column":["Удалить колонку"],"Delete from palette":["Удалить из палитры"],"Delete from styles":["Удалить из стилей"],"Delete permanently":["Удалить навсегда"],"Delete this color from the palette?":["Удалить этот цвет из палитры?"],"Delete this font from styles?":["Удалить этот шрифт из стилей?"],"Delete this social network?":["Удалить эту соцсеть?"],"Deleted":["Удалённые"],"Deleted object":["Удаление объекта"],"Describe your project":["Опишите свой проект"],"Description":["Описание"],"Description is used in other sections of the service.":["Описание используется в других разделах сервиса."],"Description must be at most 500 characters.":["Описание не длиннее 500 символов."],"Desktop":["Десктоп"],"Desktop view":["Десктопный вид"],"Details":["Подробнее"],"Developer files":["Файлы для разработчика"],"Diamond":["Ромб"],"DiamondBrush":["Алмаз"],"Didn't receive an email?":["Не получили письмо?"],"Digits (0-9)":["Цифры (0–9)"],"Disable":["Отключить"],"Disable integration":["Отключить интеграцию"],"Disabled":["Отключенный"],"Disconnect Stripo":["Отключить Stripo"],"Discount code":["Промокод"],"Discount description":["Описание скидки"],"Discount description is required":["Нужно описание скидки"],"Discount value":["Размер скидки"],"Discount with promo code: ":["Скидка по промокоду: "],"Discuss":["Обсуждение"],"Display control":["Видимость"],"Display control & Direction":["Видимость и направление"],"Display the minimap.":["Показывать миникарту кода."],"Divider":["Разделитель"],"Do not repeat background (no-repeat)":["Не повторять фон (no-repeat)"],"Domain that serves this folder: it goes into image links in emails":["Домен, который отдаёт эту папку: он попадает в ссылки на изображения в письмах"],"Don't suggest again":["Больше не предлагать"],"Done":["Готово"],"Doodles":["Цветные"],"Dot color":["Цвет точки"],"Dotted":["Точки"],"Double arrow":["Двойная стрелка"],"Double quotation":["Двойная кавычка"],"Download":["Скачать"],"Download as is":["Скачать как есть"],"Draft Name":["Имя черновика"],"Draft campaign created! Open it to review and schedule.":["Проект кампании создан! Откройте его для проверки и планирования."],"Draft successfully created!":["Черновик создан!"],"Drag file here or upload from device":["Перетащите файл сюда или загрузите с устройства"],"Drag to reorder":["Можно перемещать"],"Draw":["Рисунок"],"Drop here":["Вставить сюда"],"Dropdown list":["Выпадающий список"],"Duration":["Длительность"],"During export, the element is converted into an image.":["При экспорте элемент преобразуется в изображение."],"E-Commerce":["Электронная коммерция"],"E-mail":["E-mail"],"Edit":["Редактировать"],"Edit block":["Свойства блока"],"Edit element":["Редактировать элемент"],"Edit group":["Свойства группы"],"Edit icon":["Редактировать иконку"],"Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!":["Редактируйте HTML-версию шаблона письма в режиме кода и наблюдайте за изменениями в реальном времени. В EmailMaker нет ограничений на код: вы можете создавать шаблоны любой сложности!"],"Editing comments":["Редактирование комментариев"],"Education":["Образование"],"Element":["Элемент"],"Elements":["Элементы"],"Email":["Email"],"Email Subject":["Тема письма"],"Email background color":["Цвет фона письма"],"Email builder for your teamwork":["Редактор писем для совместной работы"],"Email confirmation required":["Требуется подтверждение email"],"Email generation":["Генерация писем"],"Email generator":["Генератор Email"],"Email layout width":["Ширина письма"],"Email name":["Название письма"],"Email not yet loaded or global container not found.":["Код письма не загружен или глобальный контейнер не найден."],"Email optimization":["Оптимизация шаблона"],"Email platforms":["Платформы"],"Email successfully copied to clipboard.":["Адрес скопирован в буфер обмена."],"Email successfully created!":["Письмо создано!"],"Email synced with the server":["Email синхронизирован с сервером"],"Email testing":["Тестирование шаблона"],"EmailMaker storage":["Хранилище EmailMaker"],"Emails":["Письма"],"Emails not found":["По данному запросу ничего не найдено."],"Embed images in the file?":["Включить изображения в файл?"],"Emoticons":["Смайлики"],"Empty blocks":["Пустые блоки"],"Enable auto-payment":["Включить автоплатёж"],"Enabled":["Включено"],"End date":["Дата окончания"],"End time":["Время окончания"],"Endpoint":["Адрес хранилища"],"Ends":["Окончание"],"Ends in":["Заканчивается через"],"Enter Altcraft API token":["Введите токен API Altcraft"],"Enter Mailganer API key":["Введите ключ API Mailganer"],"Enter Sendsay API key":["Введите ключ API Sendsay"],"Enter URL":["Введите адрес"],"Enter Unisender API key":["Введите ключ API Unisender"],"Enter a URL starting with http:// or https://":["Адрес должен начинаться с http:// или https://"],"Enter a direct link to a font file (.woff2, .woff, .ttf, .otf) or a Google Fonts stylesheet.":["Укажите прямую ссылку на файл шрифта (.woff2, .woff, .ttf, .otf) или на стили Google Fonts."],"Enter a font name.":["Введите название шрифта."],"Enter a port between 1 and 65535":["Укажите порт от 1 до 65535"],"Enter a valid HEX color (e.g. #1F1F1F).":["Введите корректный HEX-цвет (например, #1F1F1F)."],"Enter a valid HEX color.":["Введите корректный HEX-цвет."],"Enter a valid URL (https://example.com or example.com).":["Введите корректный адрес (https://example.com или example.com)."],"Enter block name":["Укажите название блока"],"Enter color name":["Введите название цвета"],"Enter enKod API key":["Введите ключ API enKod"],"Enter font name":["Введите название шрифта"],"Enter heading":["Введите заголовок"],"Enter link":["Введите ссылку"],"Enter name":["Введите название"],"Enter path":["Введите путь"],"Enter preheader here":["Введите прехедер"],"Enter promo code":["Введите промокод"],"Enter subject line here":["Введите тему письма"],"Enter the access key":["Введите ключ доступа"],"Enter the block name":["Введите название блока"],"Enter the bucket name":["Введите имя бакета"],"Enter the confirmation code from the email and set a new password.":["Введите код подтверждения из письма и установите новый пароль."],"Enter the connection login":["Введите логин для подключения"],"Enter the connection password":["Введите пароль для подключения"],"Enter the email name":["Введите название письма"],"Enter the folder name":["Введите имя папки"],"Enter the group name":["Введите имя группы"],"Enter the project name":["Введите название проекта"],"Enter the secret key":["Введите секретный ключ"],"Enter the server host":["Введите имя хоста"],"Enter the storage endpoint":["Введите адрес хранилища"],"Enter the title of the image":["Введите название изображения"],"Enter value":["Введите значение"],"Enter your contact details":["Укажите свои контакты"],"Enter your current password":["Введите текущий пароль"],"Enter your email":["Укажите ваш email"],"Enter your email address and we will send you password reset instructions.":["Введите свой адрес электронной почты, и мы вышлем вам инструкции по сбросу пароля."],"Enter your first name":["Укажите ваше имя"],"Enter your last name":["Укажите вашу фамилию"],"Enter your new password":["Введите новый пароль"],"Enter your password":["Введите ваш пароль"],"Enter your phone or email":["Введите телефон или email"],"Equalize":["Сравнять"],"Error":["Ошибка"],"Error when initializing file manager":["Ошибка инициализации файлового менеджера"],"Error when receiving data. Try again (reload page) or contact support.":["Ошибка при получении данных. Попробуйте еще раз (перезагрузите страницу) или обратитесь в службу поддержки."],"Errors":["Ошибки"],"Evaluating the task":["Обдумываю задачу"],"Example:":["Например:"],"Expand only one section":["Раскрывать только один раздел"],"Expand section":["Развернуть раздел"],"Expires":["Действует до"],"Export":["Экспорт"],"Export emails as draft campaigns to ActiveCampaign":["Экспорт писем в ActiveCampaign в виде черновиков кампаний"],"Export emails to Altcraft":["Экспорт писем в Altcraft"],"Export emails to Bento":["Экспорт писем в Bento"],"Export emails to Brevo":["Экспорт писем в Brevo"],"Export emails to Campaign Monitor":["Экспорт писем в Campaign Monitor"],"Export emails to Constant Contact":["Экспорт писем в Constant Contact"],"Export emails to Dotdigital":["Экспорт писем в Dotdigital"],"Export emails to GetResponse":["Экспорт писем в GetResponse"],"Export emails to HubSpot":["Экспорт писем в HubSpot"],"Export emails to Klaviyo":["Экспорт писем в Klaviyo"],"Export emails to Mailchimp":["Экспорт писем в Mailchimp"],"Export emails to Mailganer":["Экспорт писем в Mailganer"],"Export emails to Salesforce":["Экспорт писем в Salesforce"],"Export emails to Sendsay":["Экспорт писем в Sendsay"],"Export emails to Unisender":["Экспорт писем в Unisender"],"Export emails to enKod":["Экспорт писем в enKod"],"Export settings":["Настройки экспорта"],"Extend plan":["Продлить тариф"],"Extra limit package":["Расширенный пакет"],"Extra package is not configured for this limit.":["Для этого ограничения дополнительный пакет не настроен."],"Extra packages are only available with CloudPayments at the moment.":["На данный момент дополнительные пакеты доступны только в CloudPayments."],"Eyedropper":["Пипетка"],"Failed to clean trash":["Не удалось очистить корзину"],"Failed to complete Yandex authorization":["Не удалось пройти авторизацию в «Яндексе»"],"Failed to copy.":["Не удалось скопировать."],"Failed to create broadcast":["Не удалось создать выпуск"],"Failed to create campaign":["Не удалось создать кампанию"],"Failed to create draft":["Не удалось создать черновик"],"Failed to create email":["Не удалось создать письмо"],"Failed to create mailing":["Не удалось создать рассылку"],"Failed to create newsletter":["Не удалось создать рассылку"],"Failed to create template":["Не удалось создать шаблон"],"Failed to download file.":["Не удалось скачать файл."],"Failed to download image from URL.":["Не удалось загрузить изображение по URL-адресу."],"Failed to export the email as images. Please try again.":["Не удалось экспортировать письмо в виде изображений. Попробуйте ещё раз."],"Failed to get file: %s":["Не удалось получить файл: %s"],"Failed to load":["Не удалось загрузить"],"Failed to load GIFs":["Не удалось загрузить GIF-файлы"],"Failed to load GIFs through the configured proxy chain.":["Не удалось загрузить GIF-файлы через настроенную цепочку прокси-серверов."],"Failed to load YaSendSuggestToken script":["Не удалось загрузить скрипт YaSendSuggestToken"],"Failed to load Yandex authorization script":["Не удалось загрузить скрипт авторизации Яндекс"],"Failed to load integrations.":["Не удалось загрузить интеграции."],"Failed to load payments.":["Не удалось загрузить платежи."],"Failed to load plugin analytics.":["Не удалось загрузить аналитику плагина."],"Failed to load plugin settings.":["Не удалось загрузить настройки плагина."],"Failed to load plugin usage.":["Не удалось загрузить статистику использования плагина."],"Failed to load project styles.":["Не удалось загрузить стили проекта."],"Failed to load stock images":["Не удалось загрузить стоковые изображения"],"Failed to load stock images through the configured proxy chain.":["Не удалось загрузить стоковые изображения через настроенную цепочку прокси-серверов."],"Failed to load storage settings.":["Не удалось загрузить настройки хранилища."],"Failed to process image URL.":["Не удалось обработать URL-адрес изображения."],"Failed to rotate client secret.":["Не удалось перевыпустить Client Secret."],"Failed to save blocks.":["Не удалось сохранить блоки."],"Failed to save integration settings.":["Не удалось сохранить настройки интеграции."],"Failed to save project settings.":["Не удалось сохранить настройки проекта."],"Failed to save project styles.":["Не удалось сохранить стили проекта."],"Failed to save storage settings.":["Не удалось сохранить настройки хранилища."],"Failed to save the image. Check the file storage settings.":["Не удалось сохранить изображение. Проверьте настройки хранилища файлов."],"Failed to update the global block.":["Не удалось обновить глобальный блок."],"Failed to update the inbox.":["Не удалось обновить папку «Входящие»."],"Features":["Возможности"],"Fewer settings":["Меньше настроек"],"Field heading":["Заголовок поля"],"Field required":["Обязательное поле"],"Field state appearance":["Внешний вид поля"],"File":["Файл"],"File upload failed":["Не удалось загрузить файл"],"Files ready: %s":["Файлы готовы: %s"],"Fill in at least one offer field":["Заполните хотя бы одно поле акции"],"Filter":["Фильтр"],"Filter by type":["Фильтр по типу"],"Finance & Banking":["Финансы и банки"],"First name":["Имя"],"Float block width":["Ширина плавающего блока"],"Folder (Prefix)":["Папка (префикс)"],"Folder name is required":["Имя папки обязательно"],"Folder path":["Путь к папке"],"Folders":["Папки"],"Font":["Шрифт"],"Font Size":["Размер шрифта"],"Font family":["Шрифт"],"Font file":["Файл шрифта"],"Font of the general text":["Шрифта текста"],"Font settings":["Настройки шрифта"],"Font size":["Размер текста"],"Font size of the general text":["Размер текста"],"Fonts":["Шрифты"],"Footers":["Подвалы"],"For basic tasks in business or personal projects":["Для выполнения основных задач в рамках деловых или личных проектов"],"Forgot the password?":["Забыли пароль?"],"Forgot your password?":["Забыли пароль?"],"Form":["Форма"],"Found so far: %s":["Найдено на данный момент: %s"],"Frame":["Рамка"],"Free trial":["Пробная версия"],"From scratch":["С чистого листа"],"Full legal company name":["Полное юридическое название компании"],"GIF":["GIF"],"General settings":["Общие настройки"],"General text":["Текст"],"Generate":["Сгенерировать"],"Generate Email":["Создать письмо"],"Generate image":["Сгенерировать изображение"],"Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.":["С легкостью создавайте потрясающие визуальные эффекты. Мы обучили нашу модель искусственного интеллекта, чтобы обеспечить высочайшее качество изображений."],"Generate with AI":["Генерация с помощью ИИ"],"Generated images":["Генерация картинок"],"Get a discount":["получить со скидкой"],"Get started":["Начать работу"],"Give your users the ability to build beautiful emails without development costs":["Дайте пользователям возможность собирать красивые письма без затрат на разработку"],"Global block":["Глобальный блок"],"Global styles":["Стили письма"],"Gmail annotation was successfully applied to the template code.":["Аннотация Gmail добавлена в код письма."],"Gmail annotations":["аннотаций в Gmail"],"Gmail annotations were removed from the template code.":["Аннотации Gmail удалены из кода письма."],"Go to project settings?":["Перейти в настройки проекта?"],"Go to projects":["Перейти к проектам"],"Google Fonts":["Шрифты Google"],"Got it":["Понятно"],"Gradient":["Градиент"],"Green":["Зелёный"],"Grid":["Сетка"],"Group":["Группа"],"HLineBrush":["Н-образная"],"HTML":["HTML"],"HTML URL is required. Save the email first, or paste a custom URL to your hosted HTML.":["Требуется URL-адрес HTML-страницы. Сначала сохраните письмо или вставьте собственный URL-адрес размещенной у вас HTML-страницы."],"Half year":["Полгода"],"Header":["Заголовок"],"Header text":["Текст заголовка"],"Headers":["Шапки"],"Heading":["Заголовок"],"Heading color":["Цвет заголовка"],"Heading font":["Шрифт заголовка"],"Heading font size":["Размер заголовка"],"Heading letter spacing":["Межбуквенный интервал заголовка"],"Heading line height":["Высота строки заголовка"],"Headings":["Заголовки"],"Headline":["Заголовок"],"Healthcare":["Здравоохранение"],"Height":["Высота"],"Hello":["Привет"],"Help":["Справка"],"Help menu":["Помощь"],"Helper text":["Подсказка"],"Helper text / tooltip":["Подсказка / всплывающая подсказка"],"Hide payment history":["Скрыть историю платежей"],"High contrast mode":["Режим высокой контрастности"],"Hint text":["Подсказка"],"History":["История"],"Horizontal":["Горизонтальный"],"Horizontal alignment":["Горизонтальное выравнивание"],"Horizontal offset":["Гориз. смещение"],"Horizontal padding":["Горизонтальный отступ"],"Horizontal position":["Гориз. смещение"],"Horizontal position of the background image":["Горизонтальное смещение фонового изображения"],"Hospitality & Travel":["Гостиничный бизнес и туризм"],"Host":["Имя хоста"],"Hostname or server IP address":["Имя хоста или IP-адрес сервера"],"How to get an API key?":["Как получить ключ API?"],"Hyperlink URL":["Адрес ссылки"],"I agree to the":["Я согласен с"],"I would like to receive updates from Blocks.":["Я хочу получать новости от Blocks"],"I would like to receive updates from EmailMaker.":["Я хочу получать новости от EmailMaker."],"I'd be happy to create an email for you! ":["Я с удовольствием создам для вас электронное письмо! "],"Icon":["Иконка"],"Icon URL":["URL иконки"],"Icon description":["Описание иконки"],"Identifies search terms. For example: utm_term=running+shoes":["Определяет условия поиска. Например: utm_term=running+shoes"],"Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc":["Определяет, какой тип ссылки использовался, например, цена за клик или электронная почта. Например: utm_medium=cpc"],"If \\"Yes\\", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If \\"No\\", images will be loaded from external links.":["Если «Да», изображения будут включены в сам файл. Это полезно для просмотра без интернета или если внешние изображения заблокированы, но увеличивает размер файла. Если «Нет», изображения будут загружаться по внешним ссылкам."],"If different from the legal address":["Если отличается от юридического адреса"],"If you do not pay, you will be switched to the free plan automatically.":["Если вы не оплатите, вы будете автоматически переведены на бесплатный тарифный план."],"If you have problems connecting the plugin — contact us, our specialists will definitely help you.":["Если возникли сложности с подключением плагина — напишите нам, наши специалисты обязательно помогут."],"If you turn the switch off, lines of code will not wrap. If you turn the switch on, lines of code will wrap at the viewport.":["Если параметр отключен, строки никогда не будут переноситься. Если параметр включен, строки будут переноситься по ширине области просмотра."],"Image":["Картинка"],"Image Center":["Центр изображений"],"Image checks":["Проверка картинок"],"Image editor":["Редактор изображений"],"Image path":["Путь к изображению"],"Image replacer":["Замена картинки"],"Image src":["Картинка"],"Images validation":["Проверка изображений"],"Images validation was successfully completed":["Проверка изображений завершена"],"Import":["Импорт"],"Import email":["Импортировать письмо"],"Import finished":["Импорт завершён"],"Import first %d":["Импортировать первые %d"],"Import from Stripo":["Импорт из Stripo"],"Import problems":["Проблемы импорта"],"Import templates and emails from your Stripo project.":["Импорт шаблонов и писем из вашего проекта Stripo."],"Imported":["Импортировано"],"Imported %1$d of %2$d":["Импортировано %1$d из %2$d"],"Imported: %1$d, failed: %2$d.":["Импортировано: %1$d, не удалось: %2$d."],"Importing from Stripo":["Импорт из Stripo"],"Improves visibility by automatically tuning the form for accessibility. Turn off to restore the previous look.":["Улучшает читаемость за счет автоматической настройки формы с учетом требований доступности. Отключите эту функцию, чтобы вернуть прежний вид."],"Inactive date background color":["Цвет фона неактивной даты"],"Inactive date font":["Шрифт неактивной даты"],"Indent":["Отступ"],"Indent between columns":["Горизонтальный отступ"],"Indent height":["Высота"],"Indent in mobile":["Вертикальный отступ"],"Indexing files…":["Индексация файлов…"],"Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale":["Определяет продвижение конкретного продукта или стратегическую кампанию. Например: utm_campaign=spring_sale"],"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":["Определяет, что именно было нажато, чтобы привести пользователя на сайт, например, рекламный баннер или текстовая ссылка. Он часто используется для A/B-тестирования и рекламы, ориентированной на контент. Например: utm_content=logolink или utm_content=textlink."],"Individual corner radii":["Радиусы отдельных углов"],"Individual padding":["Отдельные отступы"],"Industry":["Отрасль"],"Initial":["Начальный"],"Input":["Поле ввода"],"Input field text":["Текст поля ввода"],"Insert column after":["Вставить столбец справа"],"Insert column before":["Вставить столбец слева"],"Insert row after":["Вставить строку после"],"Insert row before":["Вставить строку перед"],"Insert spaces":["Отступы пробелами"],"Inside":["Внутри"],"Integration settings saved.":["Настройки интеграции сохранены."],"Integrations":["Интеграции"],"Integrations are set up in the project settings. Unsaved changes in the email may be lost.":["Интеграции настраиваются в настройках проекта. Несохранённые изменения в письме могут потеряться."],"Internal padding":["Внутренний отступ"],"Invalid file data":["Неверные данные файла"],"Invite members":["Пригласить участников"],"Invited %s":["Приглашён %s"],"Invoice":["Счёт-фактура"],"Invoice for legal entity":["Счёт для юр. лица"],"Invoice request for a legal entity":["Запрос на выставление счета для юридического лица"],"Is a template":["Шаблон"],"It looks like the email was not created in our service, so the content styles won\`t work. Read more about content styles in the help.":["Похоже, письмо создано не в нашем сервисе, поэтому стили контента работать не будут. Подробнее о стилях содержимого читайте в справке."],"It\`s done!":["Готово!"],"Italic":["Курсив"],"Italic ( Ctrl+I )":["Курсив ( Ctrl+I )"],"Italic ( ⌘I )":["Курсив ( ⌘I )"],"Items to import: %d.":["Элементов к импорту: %d."],"Ivan Ivanov":["Иван Иванов"],"Joined the project":["Присоединился к проекту"],"Just now":["Только что"],"KB":["KB"],"KPP":["КПП"],"KPP must be 9 digits":["КПП должен состоять из 9 цифр"],"LLC \\"Example\\"":["ООО «Пример»"],"Label next to checkbox":["Надпись рядом с чекбоксом"],"Label text style":["Стиль текста подписи"],"Landmarks":["Достопримечательности"],"Landscape":["Горизонтальная"],"Language":["Язык"],"Large emails may have delivery issues and load slowly. We recommend minimizing code before exporting.":["Большие электронные письма могут иметь проблемы с доставкой и медленно загружаться. Мы рекомендуем минимизировать код перед экспортом."],"Last login":["Последний вход"],"Last name":["Фамилия"],"Last update: ":["Обновлено:"],"Layout conversion failed":["Ошибка при преобразовании шаблона"],"Layout converted to Blocks format":["Шаблон преобразован в формат Blocks"],"Layout converted to EmailMaker format":["Шаблон преобразован в формат EmailMaker"],"Learn more about %s":["Подробнее о работе %s"],"Leave":["Уйти"],"Leave your comment":["Оставьте ваш комментарий"],"Left":["Слева"],"Left Code panel":["Панель кода слева"],"Left padding":["Отступ слева"],"Left to right":["Слева направо"],"Legal address":["Юридический адрес"],"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!":["Позвольте нашему помощнику с ИИ улучшить ваше письмо! От создания темы и прехедеров на основе письма до генерации всего письма с учетом особенностей вашего сайта!"],"Letter spacing":["Межбуквенный интервал"],"Light":["Светлая"],"Light theme":["Светлая тема"],"Line break on mobile devices":["Переносить колонки друг под друга"],"Line height":["Высота строки"],"Line height of the general text":["Высота строки текста"],"Line wrap":["Перенос строк"],"Link":["Ссылка"],"Link checks":["Проверка ссылок"],"Link color":["Цвет ссылки"],"Link color in contrasting blocks":["Цвет ссылок в контрастных блоках"],"Link for all slides":["Общая ссылка"],"Link to web version of the font":["Ссылка на веб-версию шрифта"],"Links":["Ссылки"],"Links validation":["Проверка ссылок"],"Links validation was successfully completed":["Проверка ссылок завершена"],"List OL":["Список OL"],"List UL":["Список UL"],"List item appearance":["Внешний вид элемента списка"],"List of projects":["Список проектов"],"List panel background":["Фон панели списка"],"List settings":["Настройки списка"],"List text style":["Стиль текста списка"],"Lists":["Списки"],"Live preview":["Тест в почтовиках"],"Loaded State":["Загрузка состояния"],"Loading Canvas":["Загрузка"],"Loading Image":["Загрузка"],"Loading State":["Загрузка"],"Loading latest changes...":["Загрузка последних изменений..."],"Locally saved version applied":["Применена локально сохраненная версия"],"Lock":["Заблокировать"],"Login for connection":["Логин для подключения"],"Logo must be 2 MB or smaller.":["Логотип должен быть не больше 2 МБ."],"Loop":["Зациклить"],"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.":["С другой стороны, разбавленное изрядной долей эмпатии, рациональное мышление выявляет срочную потребность как самодостаточных, так и внешне зависимых концептуальных решений."],"Lower scores are better. Aim for a score less than ":["Чем ниже балл, тем лучше. Старайтесь набрать как можно меньше."],"Lowercase":["Строчные"],"Lowercase letters (a-z)":["Строчные буквы (a–z)"],"MB":["MB"],"Magenta":["Пурпурный"],"Mailganer":["Mailganer"],"Mailing Name":["Имя рассылки"],"Mailing address":["Почтовый адрес"],"Mailing automation, audience segmentation, and email personalization.":["Автоматизация рассылок, сегментация аудитории и персонализация писем."],"Mailing successfully created!":["Письмо создано!"],"Maintain aspect ratio":["Сохранить соотношение сторон"],"Make columns the same width.":["Сделать колонки одинаковой ширины."],"Managed in billing settings":["Управляется в настройках оплаты"],"Mandatory. Indicates the traffic source. Example: utm_source=google":["Указывает, какой сайт отправил трафик, и является обязательным параметром. Например: utm_source=google"],"Manufacturing":["Производство"],"Margins":["Отступы"],"Markdown":["Markdown"],"Marker shape":["Форма маркера"],"Marketer":["Маркетолог"],"Mass mailing automation, audience segmentation, and campaign performance analytics.":["Автоматизация массовых рассылок, сегментация аудитории и аналитика по кампаниям."],"Max width":["Ширина изображения"],"Maximum 10 tags available.":["Максимум доступно 10 тегов."],"Maximum 64 characters.":["Не длиннее 64 символов."],"Maximum length":["Максимальная длина"],"Maximum width":["Макс. ширина"],"Maximum {0} colors in the palette.":["В палитре не больше {0} цветов."],"Maximum {0} fonts in the project.":["В проекте не больше {0} шрифтов."],"Maximum {0} social networks.":["Не больше {0} соцсетей."],"Media & Marketing":["Медиа и маркетинг"],"Members":["Участники"],"Menus":["Меню"],"Merchant homepage URL":["Ссылка на сайт магазина"],"Merge":["Объединение"],"Merge bottom cell":["Объединить нижнюю ячейку"],"Merge left cell":["Объединить левую ячейку"],"Merge right cell":["Объединить правую ячейку"],"Merge tags":["Переменные"],"Merge top cell":["Объединить верхнюю ячейку"],"Merge with the chosen block":["Объединить с выделенным блоком"],"Merged Objects":["Объединение объектов"],"Message when validation fails":["Сообщение в случае сбоя проверки"],"Minimap":["Миникарта"],"Minimize code":["Минимизировать код"],"Minimum length 8 characters":["Минимальная длина — 8 символов"],"Minimum width":["Мин. ширина"],"Minus":["Минус"],"Mobile":["На мобильном"],"Mobile L – 425px":["Смартфон L – 425px"],"Mobile M – 375px":["Смартфон M – 375px"],"Mobile S – 320px":["Смартфон S – 320px"],"Mobile view":["Мобильный вид"],"Month":["Месяц"],"More editing features":["Больше возможностей редактирования"],"More options":["Больше настроек"],"More settings":["Больше настроек"],"Move %1$d block to folder “%2$s”?":["Переместить %1$d блок в папку «%2$s»?","Переместить %1$d блока в папку «%2$s»?","Переместить %1$d блоков в папку «%2$s»?"],"Move %1$d template to folder “%2$s”?":["Переместить %1$d шаблон в папку «%2$s»?","Переместить %1$d шаблона в папку «%2$s»?","Переместить %1$d шаблонов в папку «%2$s»?"],"Move block “%1$s” to folder “%2$s”?":["Переместить блок «%1$s» в папку «%2$s»?"],"Move down":["Переместить вниз"],"Move stopped":["Перемещение остановлено"],"Move template “%1$s” to folder “%2$s”?":["Переместить шаблон «%1$s» в папку «%2$s»?"],"Move up":["Переместить вверх"],"Moving files from old storage…":["Перенос файлов со старого хранилища…"],"Multi-channel campaigns automation (email, SMS, push, WhatsApp, and more).":["Автоматизация мультиканальных кампаний (email, SMS, push, WhatsApp и другие)."],"Name":["Имя"],"Name must be at most 64 characters.":["Название не длиннее 64 символов."],"Need more?":["Нужно больше?"],"New Text":["Новая надпись"],"New block title":["Название нового блока"],"New blocks":["Новые блоки"],"New email title":["Новое письмо"],"New emails":["Новые письма"],"New file name is required":["Требуется новое имя файла"],"New folder":["Новая папка"],"New folder name is required":["Требуется название новой папки"],"New password":["Новый пароль"],"New project":["Новый проект"],"Newest first":["Сначала новые"],"Newsletter Subscription":["Подписка на новости"],"Newsletter successfully created!":["Рассылка успешно создана!"],"No":["Нет"],"No access to edit the letter.":["Нет доступа к редактированию письма."],"No analytics data for the selected period.":["За выбранный период данных нет."],"No brand colors yet":["Пока нет цветов бренда"],"No card required: we ask for no payment or personal details.":["Карту привязывать не нужно: ни платёжных, ни персональных данных мы не спросим."],"No emails match the search.":["По запросу не найдено ни одного письма."],"No history records available.":["Записи истории отсутствуют."],"No images found.":["Нет изображений."],"No internet connection":["Нет подключения к Интернету"],"No links found.":["Нет ссылок."],"No logo":["Без логотипа"],"No mailing address found. Add one in ActiveCampaign: ":["Почтовый адрес не найден. Добавьте его в ActiveCampaign: "],"No name":["Без названия"],"No one found":["Никого не нашлось"],"No payments yet.":["Платежей пока нет."],"No problems found.":["Проблем не найдено."],"No project fonts yet":["Пока нет шрифтов проекта"],"No projects match the search.":["По запросу не найдено ни одного проекта."],"No properties to edit.":["Нет свойств для редактирования."],"No related blocks found.":["У этого письма нет привязанных шаблонов."],"No social networks yet":["Пока нет соцсетей"],"Non-profit":["Некоммерческая организация"],"None":["Нет"],"Not available for the current payment settings":["Недоступно при текущих настройках оплаты"],"Not available in this context":["Недоступно в данном контексте"],"Not connected":["Не подключено"],"Not defined":["Не определено"],"Not found in Stripo":["Не найдено в Stripo"],"Not imported":["Не импортировано"],"Not now":["Не сейчас"],"Not set":["Не указано"],"Nothing found in Stripo":["В Stripo ничего не найдено"],"Now":["Сейчас"],"Now create an email":["Теперь создайте письмо"],"OGRN / PSRN":["ОГРН / ПСРН"],"OGRN/PSRN must be 13 or 15 digits":["ОГРН / ПСРН должно состоять из 13 или 15 цифр"],"Objects":["Объект"],"Offer page URL":["Ссылка на страницу акции"],"Offer page or merchant homepage link starting with https:// is required":["Нужна ссылка на страницу акции или на сайт магазина, начинающаяся с https://"],"Ok. I'll be waiting":["Хорошо. Я подожду"],"Okay. I'll log in.":["Хорошо, я авторизуюсь."],"Oldest first":["Сначала старые"],"On request":["По запросу"],"On the left":["Слева"],"On the right":["Справа"],"Onboarding":["Тур по редактору"],"Only a-z, 0-9, hyphen, dot":["Только a-z, 0-9, дефис, точка"],"Oops! Something went wrong":["Ой! Что-то пошло не так"],"Opacity":["Прозрачность"],"Open draft campaign":["Открыть черновик кампании "],"Open in Bento":["Открыть в Bento"],"Open in Brevo":["Открыть в Brevo"],"Open in Campaign Monitor":["Открыть в Campaign Monitor"],"Open in Constant Contact":["Открыть в Constant Contact"],"Open in Dotdigital":["Открыть в Dotdigital"],"Open in GetResponse":["Открыть в GetResponse"],"Open in HubSpot":["Открыть в HubSpot"],"Open in Klaviyo":["Открыть в Klaviyo"],"Open in Mailchimp":["Открыть в Mailchimp"],"Open in Mailganer":["Открыть в Mailganer"],"Open in Marketing Cloud":["Открыть в Marketing Cloud"],"Open in Sendsay":["Открыть в Sendsay"],"Open in Unisender":["Открыть в Unisender"],"Open in enKod":["Открыть в enKod"],"Optimize":["Оптимизация"],"Optional fields":["Необязательные поля"],"Orange":["Оранжевый"],"Ordered list":["Нумерованный список"],"Organization logo":["Логотип компании"],"Other":["Другое"],"Others":["Другие"],"Outline":["Контур"],"Outline Color":["Цвет контура"],"Outlook":["Outlook"],"Outside":["Снаружи"],"PDF":["PDF"],"PJSC Sberbank":["ПАО «Сбербанк»"],"PNG":["PNG"],"Padding":["Внутренний отступ"],"Paid until: ":["Оплачен до: "],"Palette":["Палитра"],"Password":["Пароль"],"Password for connection":["Пароль для подключения"],"Paste block from clipboard":["Вставить блок из буфера обмена"],"Paste image URL here":["Вставьте URL изображения"],"Pay":["Оплата"],"Payment":["Оплата"],"Payment basis":["Условия оплаты"],"Payment history":["История платежей"],"Payment was successful. Limits will update in a few seconds.":["Оплата прошла успешно. Лимиты обновятся через несколько секунд."],"Payment was successful. New AI generations are now available.":["Оплата прошла успешно. Теперь доступны новые генерации с помощью ИИ."],"Payment was successful. Your plan features are now available.":["Оплата прошла успешно. Теперь вы можете пользоваться всеми возможностями вашего тарифного плана."],"PencilBrush":["Карандаш"],"Phone":["Телефон"],"Phone must be 3 to 40 characters and contain digits and separators only.":["Телефон — от 3 до 40 символов, только цифры и разделители."],"Phone number":["Телефон"],"Phone or email":["Телефон или email"],"Pick a color.":["Выберите цвет."],"Picture":["Изображение"],"Placeholder":["Плейсхолдер"],"Placeholder text":["Текст плейсхолдера"],"Plain text":["Простой текст"],"Plan":["Тариф"],"Plan usage statistics":["Статистика использования тарифа"],"Play button":["Кнопка воспроизведения"],"Please accept the agreement":["Пожалуйста, примите соглашение"],"Please add a comment to your request":["Введите комментарий к запросу"],"Please choose":["Пожалуйста, выберите"],"Please choose block type":["Пожалуйста, выберите тип блока"],"Please choose the block type":["Пожалуйста, укажите тип блока"],"Please complete payment on the Billing page.":["Пожалуйста, произведите оплату на странице «Тарифы и оплата»."],"Please complete the captcha":["Пожалуйста, пройдите капчу"],"Please complete the captcha to continue.":["Пожалуйста, пройдите капчу, чтобы продолжить."],"Please enter a URL.":["Пожалуйста, введите адрес."],"Please enter a color name.":["Пожалуйста, введите название цвета."],"Please enter a name.":["Пожалуйста, введите название."],"Please enter a valid email address.":["Введите действительный адрес электронной почты."],"Please enter a valid email.":["Пожалуйста, введите корректный email."],"Please enter the URL.":["Пожалуйста, введите адрес"],"Please enter the block name":["Введите название блока"],"Please enter the correct URL.":["Пожалуйста, введите правильный адрес."],"Please enter the correct email address.":["Пожалуйста, введите корректный адрес почты."],"Please enter the correct email.":["Пожалуйста, введите корректную эл. почту"],"Please enter the description":["Введите описание"],"Please enter the email name":["Введите имя письма"],"Please enter the folder name":["Введите имя папки "],"Please enter the group name":["Введите название группы"],"Please enter the project name":["Пожалуйста, введите название проекта"],"Please enter valid email":["Введите действительный адрес электронной почты"],"Please enter your email address":["Пожалуйста, укажите свой адрес эл. почты"],"Please enter your password":["Пожалуйста, введите свой пароль"],"Please input block name":["Пожалуйста укажите название блока"],"Please input container width":["Пожалуйста, укажите ширину блока"],"Please input tags!":["Пожалуйста, введите теги!"],"Please input type!":["Пожалуйста, введите тип!"],"Please log in":["Необходим вход в систему"],"Please select":["Пожалуйста, выберите"],"Please set the 'Type' field in the Settings section.":["Пожалуйста, заполните поле «Тип» в настройках блока."],"Please set the background color":["Пожалуйста, установите цвет фона"],"Please set the font color":["Установите цвет текста"],"Please type correct emails":["Пожалуйста, введите верные адреса получателей"],"Please type emails":["Пожалуйста, введите адреса получателей"],"Please type subject":["Укажите тему письма"],"Please type the project name.":["Пожалуйста, укажите название проекта."],"Please type the webhook URL.":["Пожалуйста, введите адрес вебхука."],"Please type your email address.":["Пожалуйста, укажите свой адрес электронной почты."],"Please type your password confirmation code.":["Пожалуйста, укажите код подтверждения."],"Please type your password.":["Пожалуйста, введите свой пароль."],"Please upgrade your plan.":["Пожалуйста, обновите тарифный план.\\n"],"Please upload a JPG, PNG, or WebP image.":["Загрузите изображение в формате JPG, PNG или WebP."],"Plugin":["Плагин"],"Plugin connected":["Плагин подключён"],"Plugin connection request":["Заявка на подключение плагина"],"Plugin is not connected":["Плагин не подключён"],"Plus":["Плюс"],"Pointer":["Треугольник"],"Polls":["Опросы"],"Port":["Порт"],"Portrait":["Вертикальная"],"Position in cell":["Положение в ячейке"],"Prefer spaces over tabs.":["Делать табуляцию пробелами."],"Prefix path inside the bucket for project files":["Префикс — путь внутри бакета для файлов проекта"],"Preheader":["Прехедер"],"Preheader copied to email settings":["Прехедер скопирован в настройки письма"],"Preparing countdown preview…":["Готовим превью таймера..."],"Preparing video preview…":["Готовим превью видео..."],"Preview":["Предпросмотр"],"Preview mode":["Предпросмотр"],"Price":["Цена"],"Price currency":["Валюта"],"Price currency must be a three-letter ISO 4217 code, for example USD":["Валюта указывается трёхбуквенным кодом ISO 4217, например USD"],"Privacy Policy.":["Политикой конфиденциальности."],"Processing Image":["Загрузка"],"Product carousel":["Карусель товаров"],"Profile":["Профиль"],"Project":["Проект"],"Project files are stored on the built-in Blocks CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN Blocks. Дополнительно настраивать подключение не нужно."],"Project files are stored on the built-in EmailMaker CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN EmailMaker. Дополнительно настраивать подключение не нужно."],"Project information":["Информация о проекте"],"Project name":["Название проекта"],"Project name must be at most 100 characters.":["Название проекта не длиннее 100 символов."],"Project not found.":["Проект не найден."],"Project settings":["Настройки проекта"],"Project styles":["Стили проекта"],"Project styles saved.":["Стили проекта сохранены."],"Project switched to the built-in storage.":["Проект переключён на встроенное хранилище."],"Projects":["Проекты"],"Promo code applied.":["Промокод применен."],"Promocodes":["Промокоды"],"Promotion cards":["Промокарточки"],"Proofreader":["Корректор "],"Psychologist":["Психолог"],"Public URL":["Публичный адрес"],"Public access key":["Публичный ключ доступа"],"Public offer":["Публичная оферта"],"Purple":["Фиолетовый"],"Push block update to all templates":["Применить обновление блока ко всем шаблонам"],"Quality":["Качество"],"Quarter":["Квартал"],"Radio button":["Радиокнопка"],"Radius":["Радиус"],"Ready-made HTML template for testing the plugin locally.":["Готовый HTML-шаблон, чтобы проверить плагин локально."],"Real Estate":["Недвижимость"],"Real-time notifications about email-related events.":["Уведомления о событиях с письмами в реальном времени."],"Receipt":["Чек"],"Recipients":["Получатели"],"Recommended":["Рекомендуемые"],"Recover":["Восстановить"],"Recover password":["Восстановить пароль"],"Recurring payments disabled":["Автоплатёж отключён"],"Recurring payments enabled":["Автоплатёж включён"],"Red":["Красный"],"Redo (Ctrl+Shift+Z)":["Повторить (Ctrl+Shift+Z)"],"Refresh":["Обновить"],"Refresh inbox":["Обновить почтовый ящик"],"Reload page":["Перезагрузить страницу"],"Remaining:":["Осталось:"],"Remember me":["Запомнить меня"],"Remove":["Удалить"],"Remove annotations":["Удалить аннотации"],"Remove block":["Удалить блок"],"Remove column":["Удалить столбец"],"Remove element":["Удалить элемент"],"Remove element by Delete Key":["Удалить элемент (Delete)"],"Remove file":["Удалить файл"],"Remove group":["Удалить группу"],"Remove logo":["Удалить логотип"],"Remove member":["Удалить участника"],"Remove row":["Удалить строку"],"Remove slide":["Удалить слайд"],"Rename":["Переименовать"],"Rename block":["Переименовать блок"],"Rename email":["Переименовать письмо"],"Reorder block":["Переместить блок"],"Reorder element":["Переместить элемент"],"Reorder group":["Переместить группу"],"Repeat background (repeat)":["Повторять фон (repeat)"],"Repeat background horizontally (repeat-x)":["Горизонтальное повторение фона (repeat-x)"],"Repeat background vertically (repeat-y)":["Вертикальное повторение фона (repeat-y)"],"Repeat the new password":["Повторите новый пароль"],"Replace Image":["Заменить изображение"],"Replace the preheader":["Вставить в прехедер письма"],"Replace the title":["Вставить в заголовок письма"],"Replaced Background Image":["Удаление фонового изображения"],"Reply":["Ответить"],"Reply to the comment":["Ответить на комментарий"],"Request for changing the pricing plan":["Запрос на смену тарифа"],"Request sent successfully.":["Запрос отправлен."],"Requests JSON":["JSON с запросами"],"Required field":["Обязательное поле"],"Resend":["Отправить повторно"],"Resize":["Размер"],"Resized Image":["Изменение размера"],"Responsive email":["Адаптировать письмо в моб. устройствах"],"Restore %1$d block to folder “%2$s”?":["Восстановить %1$d блок в папку «%2$s»?","Восстановить %1$d блока в папку «%2$s»?","Восстановить %1$d блоков в папку «%2$s»?"],"Restore %1$d template to folder “%2$s”?":["Восстановить %1$d шаблон в папку «%2$s»?","Восстановить %1$d шаблона в папку «%2$s»?","Восстановить %1$d шаблонов в папку «%2$s»?"],"Restore block “%1$s” to folder “%2$s”?":["Восстановить блок «%1$s» в папку «%2$s»?"],"Restore template “%1$s” to folder “%2$s”?":["Восстановить шаблон «%1$s» в папку «%2$s»?"],"Resume":["Резюме"],"Retail & E-commerce":["Розница и e-commerce"],"Retry":["Повторить"],"Retry failed":["Повторить неудавшиеся"],"Reverse order on desktop":["Изменить порядок в десктопе"],"Revoke the invite":["Отозвать приглашение"],"Right":["Справа"],"Right Code panel":["Панель кода справа"],"Right padding":["Отступ справа"],"Right to left":["Справа налево"],"Role":["Роль"],"Rotate":["Перевыпустить"],"Rotate client secret?":["Перевыпустить Client Secret?"],"Rotate secret":["Перевыпустить секрет"],"Round":["Круглый"],"Rounded Corner":["Загругление углов"],"Rounded corners in Outlook (VML)":["Закругленные углы в Outlook (VML)"],"SMS":["СМС"],"Safe Fonts":["Безопасные шрифты"],"Sandbox HTML file":["HTML-файл песочницы"],"Sans Serif":["Sans Serif"],"Save":["Сохранить"],"Save %d block":["Сохранить %d блок","Сохранить %d блока","Сохранить %d блоков"],"Save all blocks":["Сохранить все блоки"],"Save and continue":["Сохранить и продолжить"],"Save block":["Сохранить блок"],"Save by Ctrl+S":["Ctrl+S"],"Save by ⌘S":["Сохранить ( ⌘S )"],"Save email first.":["Сначала сохраните письмо."],"Save the block before commenting.":["Сохраните блок перед комментированием."],"Save the email before commenting.":["Сохраните письмо перед комментированием."],"Save to Blocks":["Сохранить в Блоки"],"Save to Blocks button.":["Сохранить в Блоки"],"Saved blocks":["Сохранённые блоки"],"Saving changes in the block":["Сохранение изменений в блоке"],"Search":["Поиск"],"Search GIFs":["Поиск GIF"],"Search a block":["Найти блок"],"Search by name":["Поиск по названию"],"Search by title":["Поиск по названию"],"Search image":["Поиск изображения"],"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.":["В обширной галерее стоковых фотографий и GIF-файлов вы найдете изображения для любого случая. Вы можете отфильтровать результаты по ориентации изображения, цветовой гамме и т. д."],"Secret Access Key":["Секретный ключ доступа"],"Secret access key":["Секретный ключ доступа"],"Secret is masked. Use Rotate to get a new secret once.":["Секрет скрыт. Нажмите «Перевыпустить», чтобы один раз увидеть новый."],"Section":["Раздел"],"Section ":["Раздел"],"Section title":["Заголовок раздела"],"Security":["Безопасность"],"Select a font family":["Выберите шрифт"],"Select a theme":["Выберите тему"],"Select all %d":["Выбрать все: %d"],"Select company size":["Выберите размер компании"],"Select email template":["Выберите шаблон письма"],"Select industry":["Выберите отрасль"],"Select period":["Выберите период"],"Select plan":["Выбрать тариф"],"Select the block type to find any block on the list faster.":["Выберите тип блока, чтобы быстрее найти любой блок в списке."],"Select the time zone":["Выберите часовой пояс"],"Selected %1$d, your plan allows %2$d more emails.":["Выбрано: %1$d, по тарифу можно создать ещё писем: %2$d."],"Send":["Отправить"],"Send a test email":["Отправить тест"],"Send again":["Повторить"],"Sender Email":["Email отправителя"],"Sender Name":["Имя отправителя"],"Sendsay":["Sendsay"],"Separators":["Разделители"],"Serif":["Serif"],"Server is unavailable":["Сервер недоступен"],"Set":["Установить"],"Set new password":["Установить новый пароль"],"Set the type":["Укажите тип"],"Settings":["Настройки"],"Shadow":["Тень"],"Shadow Color":["Цвет тени"],"Shadow inside or outside of the element":["Если включено, то тень будет внутри элемента."],"Shapes":["Фигуры"],"Share":["Поделиться"],"Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.":["Поделитесь проектом со своей командой и сотрудничайте в режиме реального времени. Добавляйте комментарии к отдельным блокам писем и обсуждайте необходимые правки прямо в конструкторе."],"Short company name":["Краткое название компании"],"Show eye icon":["Показать иконку глаза"],"Show more":["Показать ещё"],"Shuffle options":["Параметры перемешивания"],"Sign In":["Войти"],"Sign Up":["Зарегистрироваться"],"Sign in to your account to activate the trial period.":["Войдите в свою учетную запись, чтобы активировать пробный период."],"Sign in with eLama":["Войти через eLama"],"Sign out":["Выйти"],"Single image preview":["Одно изображение"],"Single quotation":["Кавычка"],"Site":["Сайт"],"Size":["Размер"],"Small desktop – 768px":["Небольшой десктоп – 768px"],"Social buttons":["Кнопки соцсетей"],"Social media":["Соцсети"],"Social network name":["Название соцсети"],"Social network settings":["Настройки соцсети"],"Social networks":["Соцсети"],"Solid":["Сплошная"],"Some blocks were not saved successfully.":["Некоторые блоки не были сохранены."],"Some images were left as links to Stripo":["Часть картинок осталась ссылками на Stripo"],"Something went wrong":["Ошибка редактирования. Обратитесь в техподдержку."],"Something went wrong during layout conversion. You can try running the conversion again.":["При конвертации шаблона произошла ошибка. Вы можете повторить конвертацию."],"Something went wrong, please try again":["Что-то пошло не так. Попробуйте ещё раз."],"Something went wrong.":["Что-то пошло не так."],"Something went wrong. Try again later.":["Что-то пошло не так. Попробуйте позже."],"Soon":["Скоро"],"Sorry, the page you visited does not exist.":["Извините, страница, которую вы посетили, не существует."],"Source code validation":["Проверка кода"],"Spacer":["Отступ"],"Spacing":["Интервал"],"Spam checks":["Проверка на спам"],"Spam validation was successfully completed":["Проверка на спам завершена"],"SpamAssassin":["SpamAssassin"],"Special characters":["Специальные символы"],"Specifies the block width.":["Задаёт ширину блока."],"Split blocks":["Разделить блоки"],"Split cell":["Разделить ячейку"],"SprayBrush":["Спрей"],"Spread radius":["Распространение"],"Square":["Квадрат"],"SquareBrush":["Квадрат"],"Squarish":["Квадратная"],"Star":["Звезда"],"Start Trial":["Начать Триал"],"Start date":["Дата начала"],"Start from scratch":["Начать с чистого листа"],"Start the trial":["Включить пробный период"],"Start typing the title":["Начните писать название"],"Start with a detailed description of your email.":["Начните с подробного описания вашего письма."],"Starts":["Начало"],"Status":["Статус"],"Stay":["Остаться"],"Stickers":["Стикеры"],"Stock":["Фотосток"],"Stock photos and GIFs":["Стоковые изображения"],"Stopping…":["Остановка…"],"Storage settings":["Настройки хранилища"],"Storage type":["Тип хранилища"],"Stored or bound value for this field":["Сохраненное или заданное значение для этого поля"],"Stored or bound value for this option":["Сохраненное или заданное значение для этого параметра"],"Strikethrough ( Alt+Shift+5 )":["Зачёркнутый ( Alt+Shift+5 )"],"Strikethrough ( ⌘+Shift+X )":["Зачёркнутый ( ⌘+Shift+X )"],"Stripo API key":["API-ключ Stripo"],"Stripo did not accept this key. Check that it is the REST API key of your Stripo project.":["Stripo не принял этот ключ. Проверьте, что это ключ REST API вашего проекта Stripo."],"Stripo did not respond":["Stripo не ответил"],"Stripo is not responding. Try again later.":["Stripo не отвечает. Попробуйте позже."],"Stripo stopped accepting the API key. Update the key and repeat the import.":["Stripo перестал принимать API-ключ. Обновите ключ и повторите импорт."],"Stripo templates become project templates, emails become emails. Folders are recreated, images are copied to the project storage. Items already imported are skipped when you select all.":["Шаблоны Stripo станут шаблонами проекта, письма — письмами. Папки будут воссозданы, картинки скопированы в хранилище проекта. При выборе всех уже импортированные элементы пропускаются."],"Stroke color":["Цвет контура"],"Strong":["Полужирный"],"Strong ( Ctrl+B )":["Полужирный ( Ctrl+B )"],"Strong ( ⌘B )":["Полужирный ( ⌘B )"],"Subject":["Тема"],"Subject line & preheader generator":["Генератор темы и прехедера"],"Subscription ID is missing":["Отсутствует идентификатор подписки"],"Subscription summary":["Сведения о подписке"],"Success":["Готово"],"Success!":["Готово!"],"Supported formats: .woff, .woff2, .ttf, .otf. Maximum file size is 5 MB.":["Поддерживаемые форматы: .woff, .woff2, .ttf, .otf. Файл не больше 5 МБ."],"Supported: .woff, .woff2, .ttf, .otf — up to {0} MB.":["Поддерживаются .woff, .woff2, .ttf, .otf — до {0} МБ."],"Swap columns":["Поменять местами"],"Switch to a different plan to save more emails.":["Перейдите на другой тариф, чтобы иметь возможность сохранять новые шаблоны."],"Syncing with the server in the background...":["Происходит синхронизация с сервером в фоновом режиме..."],"System":["Системная"],"System theme":["Системная тема"],"TIN (INN)":["ИНН"],"TIN (INN) must be 10 or 12 digits":["ИНН должен состоять из 10 или 12 цифр"],"Tab size":["Величина отступа"],"Table":["Таблица"],"Table view":["Таблица"],"Table width":["Ширина таблицы"],"Tags":["Теги"],"Tags help you find the block in the list.":["Теги помогают найти блок в списке."],"Tariff and payment":["Тариф и оплата"],"Teal":["Бирюзовый"],"Team collaboration":["Командная работа"],"Technical support":["Техническая поддержка"],"Technology & Software":["Технологии и ПО"],"Template":[" Шаблон"],"Template Name":["Название шаблона"],"Template blocks":["Блоки шаблона"],"Template conversion":["Конвертация шаблона"],"Template from another editor":["Шаблон из другого редактора"],"Template is not mobile-friendly":["Шаблон может некорректно отображаться в телефоне"],"Template successfully created!":["Шаблон создан!"],"Templates":["Шаблоны"],"Terms":["Условиями использования"],"Test sends":["Тесты отображения"],"Text":["Текст"],"Text & background":["Текст и фон"],"Text align center":["Текст по центру"],"Text align center ( Ctrl+Shift+E )":["По центру ( Ctrl+Shift+E )"],"Text align center ( ⌘+Shift+E )":["По центру ( ⌘+Shift+E )"],"Text align justify":["Текст по ширине"],"Text align justify ( Ctrl+Shift+J )":["По ширине ( Ctrl+Shift+J )"],"Text align justify ( ⌘+Shift+J )":["По ширине ( ⌘+Shift+J )"],"Text align left":["Текст слева"],"Text align left ( Ctrl+Shift+L )":["По левому краю ( Ctrl+Shift+L )"],"Text align left ( ⌘+Shift+L )":["По левому краю ( ⌘+Shift+L )"],"Text align right":["Текст справа"],"Text align right ( Ctrl+Shift+R )":["По правому краю ( Ctrl+Shift+R )"],"Text align right ( ⌘+Shift+R )":["По правому краю ( ⌘+Shift+R )"],"Text background":["Фон текста"],"Text beside the box":["Текст рядом с полем"],"Text color":["Цвет текста"],"Text copied to clipboard":["Скопировано в буфер обмена"],"Text font":["Шрифт текста"],"Text replacer":["Замена текста"],"Text size":["Размер текста"],"Text subscript":["Подстрочный текст"],"Text superscript":["Надстрочный текст"],"Text visible at the start":["Текст, отображаемый в начале"],"Texture":["Текстура"],"That\`s all we could find.":["Это все, что мы смогли найти."],"The ":[" "],"The Pro plan is not available.":["Тариф «Pro» недоступен."],"The URL that the hyperlink directs to.":["URL, на который указывает ссылка."],"The account number must be 20 digits":["Номер счета должен состоять из 20 цифр"],"The align attribute sets the horizontal alignment of the table.":["Атрибут align устанавливает горизонтальное выравнивание таблицы."],"The block \\"":["Блок «"],"The block was successfully renamed.":["Блок переименован."],"The block was successfully saved.":["Блок сохранен."],"The block will change its colors to contrasting colors. You can change them in the Content Styles section.":["Блок изменит свои цвета на контрастные. Вы можете изменить их в разделе «Стили контента»."],"The block “":["Блок «"],"The captcha is invalid or expired. Please try again.":["Капча неверна или срок её действия истек. Пожалуйста, попробуйте ещё раз."],"The code size exceeds the recommended value 90kB":["Размер кода превышает рекомендуемое значение 90 кБ."],"The code that will replace this text":["Код, который заменит этот текст"],"The copies were successfully created.":["Копии созданы."],"The copy of block “":["Копия блока «"],"The copy of email \\"":["Копия письма \\""],"The current code size is":["Текущий размер кода составляет"],"The current template will be changed to the generated one, are you sure about this?":["Текущий шаблон будет заменен на сгенерированный, вы уверены в этом?"],"The draft of the block has been deleted.":["Черновик блока удалён."],"The draft of the email has been deleted.":["Черновик письма удалён."],"The email \\"":["Письмо \\""],"The email has been copied to the clipboard.":["Код письма скопирован в буфер обмена."],"The email limit of your plan has been reached.":["Лимит писем вашего тарифа исчерпан."],"The email was successfully renamed.":["Письмо переименованно."],"The email was successfully saved.":["Письмо сохранено."],"The email “":["Письмо «"],"The feature is under development.":["Функционал находится в разработке."],"The folder \\"":["Папка «"],"The folder “":["Папка «"],"The font-size CSS property sets the size of the font.":["Свойство font-size устанавливает размер шрифта."],"The global block was updated.":["Глобальный блок был обновлён."],"The group “":["Группа «"],"The image could not be uploaded.":["Не удалось загрузить изображение."],"The image was successfully uploaded.":["Изображение загружено."],"The import failed. Try again later.":["Импорт не удался. Попробуйте позже."],"The inbox has been updated.":["Почтовый ящик обновлён."],"The invitation has been sent":["Приглашение отправлено"],"The maximum number of requests for the current subscription period has been reached.\\nSelect the appropriate plan to fulfil more requests":["Максимальное количество запросов для текущего периода подписки достигнуто.\\nВыберите соответствующий тариф для выполнения большего количества запросов."],"The password does not meet the requirements:":["Пароль не соответствует требованиям безопасности:"],"The password is too simple.":["Слишком простой пароль."],"The payment widget failed to load. Refresh the page and try again.":["Не удалось загрузить виджет оплаты. Обновите страницу и попробуйте ещё раз."],"The previous secret will stop working immediately.":["Прежний секрет перестанет работать сразу."],"The project \\"":["Проект «"],"The saved key no longer works. Enter a new one.":["Сохранённый ключ больше не работает. Введите новый."],"The selected element is in the block that supports a multicolumn structure. To add a new column, click the \\"Add a column\\" button.":["Выделенный элемент находится в блоке, в котором можно организовать многоколоночную структуру. Для добавления новой колонки нажмите кнопку «Добавить колонку»."],"The server returned an unexpected response. Please try again or contact support.":["Сервер вернул неожиданный ответ. Попробуйте ещё раз или обратитесь в службу поддержки."],"The specified parameters will be added to all links when exporting the email.":["Специальные параметры будут добавлены во все ссылки при экспорте."],"The test email will be sent to the specified addresses.":["Тестовое письмо будет отправлено на указанные адреса."],"The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it.":["Название отображается в списке шаблонов и зачастую совпадает с темой письма, но вы можете его изменить."],"The trash is empty.":["Корзина пуста."],"The trial has ended. You are on the Free plan.":["Пробный период закончился. Вы пользуетесь тарифом «Free»."],"The two passwords that you entered do not match!":["Два введенных вами пароля не совпадают!"],"The usage limit has been exceeded":["Превышен лимит использования"],"The whole email":["Всё письмо"],"Theme":["Тема"],"There are no blocks for this request.":["По данному запросу ничего не найдено."],"There are no members yet":["Участников пока нет"],"There's no such comment.":["Нет такого комментария."],"There's no such element in the email.":["В письме нет такой метки."],"These global blocks have a newer saved version. Select the ones to update in the template.":["Для этих глобальных блоков имеется более новая сохраненная версия. Выберите в шаблоне те из них, которые необходимо обновить."],"This action cannot be undone.":["Это действие нельзя отменить."],"This and other features are available for you on a higher plan.":["Эти и другие функции доступны для вас на более старшем тарифном плане."],"This can be the name of your company, department, website, project, marketing campaign, or other activity.":["Это может быть название вашей компании, отдела, веб-сайта, проекта или сферы деятельности, для которой вы планируете создать рассылку."],"This element":["Этот элемент"],"This email must be verified in Mailganer":["Адрес необходимо подтвердить в Mailganer"],"This email must be verified in Sendsay":["Адрес необходимо подтвердить в Sendsay"],"This email must be verified in Unisender":["Адрес необходимо подтвердить в Unisender"],"This field is required":["Это обязательное поле"],"This field sets the width of the email.":["Это поле выставляет ширину письма."],"This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.":["Это глобальный блок. Вы можете создать новый блок, чтобы изменения вступили в силу только в этом письме, или обновить текущий — в этом случае изменения будут применены везде, где используется этот блок."],"This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.":["Этот шаблон не был создан в нашем редакторе. Преобразуйте его, чтобы получить доступ ко всем возможностям редактирования: легко изменяйте тексты, заменяйте изображения и управляйте блоками."],"This link cannot be used as a font source.":["Эту ссылку нельзя использовать как источник шрифта."],"This may take several minutes. Please keep this tab open.":["Это может занять несколько минут. Пожалуйста, не закрывайте эту вкладку."],"This promo code is already applied.":["Промокод уже применен."],"This section will be implemented in a separate task.":["Раздел пока в разработке."],"This template was created in another editor. Rebuild it from our components to get stable rendering, error-free editing, and full design control.":["Этот шаблон создан в другом редакторе. Пересоберите его из наших компонентов и получите стабильное отображение, редактирование без ошибок и полный контроль над дизайном."],"Time":["Время"],"Time units font settings":["Шрифт единиц времени"],"Time zone":["Часовой пояс"],"Title":["Название"],"Title copied to email settings":["Заголовок скопирован в настройки письма"],"Title should not be empty":["Заголовок не должен быть пустым"],"Title shown above the control":["Название, отображаемое над элементом управления"],"To add a block from the dashboard click the":["Чтобы добавить блок, нажмите в визуальном редакторе письма кнопку"],"To avoid this issue, disable translation for this site in your browser settings or turn off auto-translate.":["Чтобы избежать этой проблемы, отключите перевод данного сайта в настройках браузера или отключите функцию автоматического перевода."],"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.":["Для изменения внешнего вида элемента в мобильном устройстве, внесите правки в поля ниже. Если поле пустое, то в мобильной версии применятся стили для десктопа."],"To create a copy, you need to save the block.":["Чтобы создать копию, вы должны сохранить блок."],"To create a copy, you need to save the email.":["Чтобы создать копию, вы должны сохранить письмо."],"To emails":["В письма"],"To fully address all necessary tasks in any field":["Чтобы в полной мере решить все необходимые задачи в любой области"],"To get started quickly":["Чтобы быстро приступить к работе"],"To import from Stripo, add the REST API key of your Stripo project: <1>open the project settings in Stripo</1>, find “Access the REST API” and generate a key.":["Чтобы импортировать из Stripo, добавьте ключ REST API вашего проекта Stripo: <1>откройте настройки проекта в Stripo</1>, найдите «Access the REST API» и сгенерируйте ключ."],"To leave comments you must be logged into Blocks and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To leave comments you must be logged into EmailMaker and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To preview and edit the uploaded image":["Предварительный просмотр и редактирование загруженного изображения"],"To send a test email, you need to confirm your email address. If you haven’t received the confirmation link, contact support in the chat or email {supportEmail}.":["Чтобы отправить тестовое письмо, вам необходимо подтвердить свой адрес электронной почты. Если вы не получили ссылку для подтверждения, обратитесь в службу поддержки через чат или по электронной почте {supportEmail}."],"Today":["Сегодня"],"Too many items selected. One import takes up to 1000 items.":["Выбрано слишком много. Один импорт берёт до 1000 элементов."],"Tooltip or hint text":["Всплывающая подсказка или текст подсказки"],"Tooltip text":["Текст всплывающей подсказки"],"Top":["Сверху"],"Top left corner":["Верхний левый угол"],"Top margin":["Отступ сверху"],"Top padding":["Отступ сверху"],"Top right corner":["Верхний правый угол"],"Top up balance":["Пополнить баланс"],"Transfer to folder":["Переместить"],"Translator":["Переводчик"],"Transparency":["Прозрачность"],"Transportation":["Транспорт"],"Trial":["Триал"],"Trial activated":["Пробная версия активирована"],"Trial active":["Пробная версия активна"],"Trial period activated.":["Пробный период активирован."],"Try again":["Попробовать ещё раз"],"Try every editor feature — free":["Попробуйте все возможности редактора — бесплатно"],"Try for free":["Попробуйте бесплатно"],"Try reloading the page.":["Попробуйте перезагрузить страницу."],"Try sign in with your new password.":["Попробуйте войти с новым паролем."],"Turn on a 14-day trial and the whole editor opens up:":["Включим пробный период на 14 дней — и редактор откроется целиком:"],"Type":["Тип"],"Type category here":["Укажите категорию"],"Type in the project's webhook":["Введите проект webHook"],"Type subject":["Укажите тему письма"],"Type the output parameters of your platform. E.g., ":["Указывайте символы вывода параметра вашей платформы. Например, "],"Type title here":["Введите название"],"Type your description here":["Введите описание"],"Type your request":["Введите ваш запрос"],"Type your tags here":["Укажите теги"],"Typing...":["Ввод текста..."],"Typograf":["Типограф"],"Typography":["Типограф"],"URL":["URL"],"URL must start with https://":["Адрес должен начинаться с https://"],"URL of the video clip.":["URL-адрес видеоклипа."],"USD":["USD"],"UTM parameters":["UTM-метки"],"Unavailable":["Недоступно"],"Underline":["Подчёркнутый"],"Underline ( Ctrl+U )":["Подчёркнутый ( Ctrl+U )"],"Underline ( ⌘U )":["Подчёркнутый ( ⌘U )"],"Undo (Ctrl+Z)":["Отменить (Ctrl+Z)"],"Unisender":["Unisender"],"Unknown error":["Неизвестная ошибка"],"Unknown integration":["Неизвестная интеграция"],"Unlimited possibilities with the PRO plan":["Безграничные возможности с тарифом PRO"],"Unlock":["Разблокировать"],"Unordered list":["Ненумерованный список"],"Unsaved changes":["Несохранённые изменения"],"Up to parent element":["Перейти к контейнеру"],"Update":["Обновить"],"Update current block":["Обновить текущий блок"],"Update date":["Дата обновления"],"Update global blocks":["Обновить глобальные блоки"],"Updated":["Обновлено"],"Upload":["Загрузить"],"Upload .woff, .woff2, .ttf or .otf files for use in the email editor.":["Загрузите файлы .woff, .woff2, .ttf или .otf, чтобы использовать их в редакторе писем."],"Upload Image":["Загрузить изображение"],"Upload failed":["Загрузка не удалась"],"Upload first font":["Загрузить первый шрифт"],"Upload font":["Загрузить шрифт"],"Upload logo":["Загрузить логотип"],"Upload your email":["Загрузить своё письмо"],"Uppercase":["Заглавные"],"Uppercase letters (A-Z)":["Заглавные буквы (A–Z)"],"Usage analytics":["Аналитика использования"],"Use custom icon for checked state":["Использовать пользовательскую иконку для отмеченного состояния"],"Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.":["Используйте наш визуальный редактор, чтобы настроить каждый элемент под свои нужды: изменить рамки и их радиус, тени, отступы, фон и многое другое."],"Use this email as a template for creating future emails.":["Используйте это письмо в качестве шаблона для создания будущих писем."],"Use this one":["Использовать эту"],"Use your own styles instead of defaults for states such as error, focus, and success.":["Используйте собственные стили вместо стандартных для таких состояний, как «ошибка», «фокус» и «успех»."],"Used":["Используемые"],"User":["Пользователь"],"Username":["Логин"],"VAT":["НДС"],"VLineBrush":["V-образная"],"Valid":["Верно"],"Valid until":["Оплачен до"],"Validation error message":["Сообщение об ошибке проверки"],"Value":["Значение"],"Variable value":["Значение переменной"],"Version history":["Контроль версий"],"Version of":["Версия от"],"Vertical":["Вертикальный"],"Vertical alignment":["Верт. выравнивание"],"Vertical offset":["Верт. смещение"],"Vertical padding":["Вертикальный отступ"],"Vertical position":["Верт. смещение"],"Vertical position of the background image":["Вертикальное смещение фонового изображения"],"Video":["Видео"],"Video URL":["URL-адрес видео"],"View only — you cannot edit settings in this section.":["Только просмотр — настройки в этом разделе менять нельзя."],"Vimeo":["Vimeo"],"Visibility":["Видимость"],"Visibility in AMP":["Видимость в AMP"],"Visit site":["Перейти на сайт"],"Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.":["Хотите изменить размер изображения, добавить текст или применить фильтр? Не нужно покидать EmailMaker! Все основные изменения вы можете сделать в нашем редакторе изображений."],"Warning":["Предупреждение"],"Warnings":["Предупреждения"],"We are always in touch":["Мы всегда на связи"],"We removed the injected code automatically. To avoid this issue, disable the extension for this site or use the editor in an incognito window without extensions.":["Мы автоматически удалили внедренный код. Чтобы избежать этой проблемы, отключите расширение для этого сайта или воспользуйтесь редактором в окне инкогнито без расширений."],"Web version":["Веб-версия"],"Webhook":["WebHook"],"Webhook URL":["Вебхук"],"Webhook settings":["Настройки вебхука"],"Webhook successfully sent!":["WebHook отправлен!"],"Website link":["Ссылка на сайт"],"Week":["Неделя"],"What's new":["Что нового"],"When the trial ends, the service switches to the free plan.":["Когда триал закончится, сервис перейдёт в бесплатный режим."],"When the trial ends, you will return to the Free plan.":["По окончании пробного периода вы вернётесь к тарифу «Free»."],"When you need more letters, additional projects and participants":["Если вам понадобится больше писем, дополнительных проектов и участников"],"While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices.":["Похоже, при редактировании шаблона, некоторые элементы перестали помещаться в экран мобильного устройства. Попробуйте уменьшить их ширину."],"White":["Белый"],"White circle":["Белый круг"],"White circle outlined":["Белый круг обводка"],"Width":["Ширина"],"With VAT":["С НДС"],"With VAT / without VAT":["С НДС / без НДС"],"With warnings":["С предупреждениями"],"Without VAT":["Без НДС"],"Without background color":["Без цвета фона"],"Without background image":["Без фоновой картинки"],"Without button":["Без кнопки"],"Without folder":["Без папки"],"Without shadow":["Без тени"],"Work with the HTML code":["Работа с HTML-кодом"],"Work with your markup":["Работайте со своей вёрсткой"],"Year":["Год"],"Yes":["Да"],"You are buying a set of AI generation requests:":["Вы приобретаете набор запросов на генерацию с помощью ИИ:"],"You are buying an extra email generation package:":["Вы приобретаете дополнительный пакет для создания писем:"],"You are buying an extra image check package:":["Вы приобретаете дополнительный пакет проверки изображений:"],"You are buying an extra image generation package:":["Вы приобретаете дополнительный пакет для генерации изображений:"],"You are buying an extra link check package:":["Вы приобретаете дополнительный пакет проверки ссылок:"],"You are buying an extra optimization package:":["Вы приобретаете дополнительный пакет оптимизации:"],"You are buying an extra preview/test sends package:":["Вы приобретаете дополнительный пакет тестов:"],"You are buying an extra spam check package:":["Вы приобретаете дополнительный пакет проверки на спам:"],"You are paying for the plan:":["Вы оплачиваете тарифный план:"],"You are running out of AI tool usage.":["Ваш лимит использования инструментов ИИ подходит к концу."],"You can activate a 2-week trial version that includes access to all features.":["Вы можете активировать 2-недельную пробную версию, которая включает доступ ко всем функциям."],"You can add more generations right now; they are billed separately from the generations included in your plan.":["Вы можете добавить дополнительные генерации прямо сейчас; их стоимость оплачивается отдельно от генераций, включенных в ваш тарифный план."],"You can also save all blocks at once. The AI assistant will automatically determine the type and create a name for each block when saving.":["Вы также можете сохранить все блоки сразу. ИИ ассистент автоматически определит тип и создаст имя для каждого блока при сохранении."],"You can close this window: the import continues in the background.":["Окно можно закрыть: импорт продолжится в фоне."],"You can get more emails and access to all features.":["Вы сможете создавать больше писем и получить доступ ко всем функциям."],"You can increase the limit by changing your plan or buying an extra package.":["Вы можете увеличить лимит, сменив тарифный план."],"You can increase the number of emails right now.":["Вы можете увеличить количество писем прямо сейчас."],"You can save blocks from the email template.":["Вы можете сохранить блоки из шаблона письма."],"You cannot switch plans because a limit has been exceeded.":["Вы не можете сменить тарифный план, так как превышен лимит."],"You changed the role of ":["Вы поменяли роль "],"You deleted ":["Вы исключили пользователя "],"You deleted yourself from the project successfully.":["Вы исключили себя из проекта."],"You do not have permission to edit project styles.":["У вас нет прав на редактирование стилей проекта."],"You do not have permission to view this section.":["У вас нет прав на просмотр этого раздела."],"You don't have any blocks in this folder.":["У вас нет блоков в этой папке."],"You don't have any blocks yet.":["У вас еще нет сохранённых блоков."],"You don't have any emails in this folder.":["В папке пока нет писем."],"You don't have any emails yet.":["У вас еще нет сохранённых писем."],"You don't have any projects yet.":["У вас пока нет проектов."],"You don\`t have any saved blocks yet.":["У вас ещё нет сохранённых блоков."],"You have reached the limit of AI chat usage.":["Вы достигли предела использования чата ИИ.\\n"],"You have reached the limit of AI generator usage.":["Вы достигли предела использования генератора ИИ.\\n"],"You have unsaved changes. Leave this page without saving?":["У вас есть несохранённые изменения. Покинуть страницу без сохранения?"],"You have used up the number of emails you can create on your current plan":["Вы исчерпали лимит на количество писем, которое можно создать в рамках вашего текущего тарифа"],"You have used up your AI generations":["Вы исчерпали лимит генераций ИИ"],"You have used up your image check limit":["Вы исчерпали лимит проверки изображений"],"You have used up your image generation limit":["Вы исчерпали лимит на генерацию изображений"],"You have used up your link check limit":["Вы исчерпали лимит проверок ссылок"],"You have used up your optimisation limit":["Вы исчерпали лимит оптимизаций"],"You have used up your preview (test send) limit":["Вы исчерпали лимит на просмотр в почтовиках"],"You have used up your spam check limit":["Вы исчерпали лимит проверок на спам"],"You reached the plan limit":["Достигнут лимит тарифа"],"You revoke invite for ":["Вы отзываете приглашение для "],"Your Altcraft Platform URL (Cloud: ru.altkraft.com or your On-Premises URL)":["URL вашей платформы Altcraft (облачная версия: ru.altkraft.com или URL вашей локальной версии)"],"Your Sendsay account login (not email). For sublogin use format: account/sublogin":["Ваш логин в Sendsay (не email). Для ввода дополнительного логина используйте формат: account/sublogin"],"Your company":["Ваша компания"],"Your current plan":["Ваш текущий тариф"],"Your email doesn't look like spam.":["Ваше письмо не похоже на спам."],"Your generations are running out soon":["Генерации с помощью ИИ скоро закончатся"],"Your letter contains %d block that can be saved for future use.":["Ваше письмо содержит %d блок, который можно сохранить для использования в будущем.","Ваше письмо содержит %d блока, которые можно сохранить для использования в будущем.","Ваше письмо содержит %d блоков, которые можно сохранить для использования в будущем."],"Your package is activated":["Пакет активирован"],"Your password successfully reset.":["Ваш пароль успешно сброшен."],"Your password was successfully changed.":["Ваш пароль успешно изменен."],"Your plan is activated":["Тариф активирован"],"Your plan will expire soon":["Ваш тариф скоро закончится"],"Your profile was successfully updated.":["Настройки сохранены."],"Your project has incoming email":["У вашего проекта есть входящая почта"],"Your templates and emails":["Ваши шаблоны и письма"],"Youtube Black":["Youtube Чёрный"],"Youtube Red":["Youtube Красный"],"Youtube White":["Youtube Белый"],"Z-A":["Я-А"],"ZIP":["ZIP-архив"],"accordion":["аккордеон"],"and":["и"],"before %s":["до %s"],"block":["Блок","",""],"block\\u0004\\" was successfully removed.":["» удалён."],"block\\u0004Are you sure to delete selected blocks?":["Вы уверены, что хотите удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete selected blocks?":["Вы уверены, что хотите безвозвратно удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete the “":["Вы уверены, что хотите удалить «"],"block\\u0004Are you sure you want to delete the “":["Вы уверены, что хотите удалить блок «"],"block\\u0004locked.":["заблокирован."],"block\\u0004unlocked.":["разблокирован."],"block\\u0004” was successfully created.":["» создана."],"block\\u0004” was successfully removed.":["» удалён."],"border\\u0004Width":["Толщина"],"button":["кнопка"],"carousel":["карусель"],"cell":["ячейка"],"column":["колонка"],"confirmation code":["код подтверждения"],"container":["контейнер"],"copy\\u0004\\" was successfully created.":["» создана."],"corners":["углы"],"countdown":["таймер"],"cpc":["cpc"],"day":["день","дня","дней"],"e.g., 123456":["Например, 123456"],"e.g., Newsletter June 2026":["Например, дайджест за июнь"],"e.g., Special offer for you!":["Например: Специальное предложение!"],"e.g., Your Company":["Например, Ваша компания"],"e.g., https://ru.altkraft.com":["Например, https://ru.altkraft.com"],"e.g., myaccount or myaccount/sublogin":["Например, myaccount или myaccount/sublogin"],"element":["элемент"],"email":["эл. почта"],"email\\u0004\\" was successfully removed.":["\\" удалено."],"email\\u0004Are you sure to delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to delete selected emails?":["Вы уверены, что хотите удалить выбранные письма?"],"email\\u0004Are you sure to irrevocably delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to irrevocably delete selected emails?":["Вы уверены, что хотите безвозвратно удалить выбранные письма?"],"email\\u0004locked.":["заблокировано."],"email\\u0004unlocked.":["разблокировано."],"empty link":["пустая ссылка"],"empty src":["нет картинки"],"enKod":["enKod"],"expanded":["Раскрыт"],"filter":["фильтр"],"folder\\u0004\\" was successfully created.":["» создана."],"folder\\u0004Are you sure to delete “":["Вы уверены, что хотите удалить папку «"],"folder\\u0004” was successfully changed to “":["» переименована в «"],"google":["google"],"group":["группа"],"group\\u0004All":["Все"],"group\\u0004Are you sure to delete “":["Вы уверенны, что хотите удалить группу «"],"group\\u0004Project":["Проектные"],"group\\u0004Standard":["Стандартные"],"group\\u0004” was successfully changed to “":["» переименована в «"],"height":["высота"],"hour":["час","часа","часов"],"https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png":["https://emcdn.ru/384263/241017_18_K3O0sad.png"],"https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png":["https://emcdn.ru/644755/241021_5149_MtX8mBz.png"],"https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png":["https://emcdn.ru/384263/241017_18_fsshqsL.png"],"https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png":["https://emcdn.ru/384263/241017_18_I98a6kp.png"],"https://cdn.useblocks.io/1351/241017_18_NDYloAO.png":["https://emcdn.ru/384263/241017_18_QFBYtv0.png"],"https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png":["https://emcdn.ru/384263/241017_18_HFSbGb5.png"],"https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png":["https://emcdn.ru/384263/241017_18_Uu6iuFF.png"],"https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png":["https://emcdn.ru/384263/241017_18_lkaw2P4.png"],"https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png":["https://emcdn.ru/384263/241017_18_ykdbX19.png"],"https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png":["https://emcdn.ru/384263/241017_18_HMNSbZd.png"],"https://cdn.useblocks.io/1351/241031_18_JoH0f3E.png":["https://emcdn.ru/719787/241031_976_jyIsWjj.png"],"https://cdn.useblocks.io/1351/241031_18_OQEyMEF.png":["https://emcdn.ru/719787/241031_976_lgYswn9.png"],"https://cdn.useblocks.io/1351/241031_18_aJAY1Xz.png":["https://emcdn.ru/719787/241031_976_XfDnnmK.png"],"images":["Изображения"],"indent":["отступ"],"kB":["kB"],"letter\\u0004Email":["Письмо"],"letter\\u0004email":["Письмо"],"link":["ссылка"],"loading more":["загрузить ещё"],"mail generator":["генератор писем"],"main heading":["основной заголовок"],"max 10":["максимум 10"],"member\\u0004 to ":[" на "],"member\\u0004Administrator":["Администратор"],"member\\u0004Invited":["Приглашённый"],"member\\u0004Owner":["Владелец"],"messeges":["сообщения"],"minute":["минута","минуты","минут"],"ms":["мс"],"new password":["новый пароль"],"not valid":["не верно"],"of":["из"],"or":["или"],"password":["пароль"],"picture":["изображение"],"project\\u0004 across all your projects?":[" во всех ваших проектах?"],"project\\u0004 from project ":[" из проекта "],"project\\u0004 in project ":["в проекте"],"project\\u0004Actions":["Действия"],"project\\u0004Add members":["Добавить участников"],"project\\u0004Are you sure you want to change permissions for user ":["Вы уверены, что хотите изменить права доступа для пользователя "],"project\\u0004Are you sure you want to invite user ":["Вы уверены, что хотите пригласить этого пользователя "],"project\\u0004Are you sure you want to remove user ":["Вы уверены, что хотите удалить пользователя "],"project\\u0004Are you sure you want to revoke the invitation for ":["Вы уверены, что хотите отозвать приглашение для "],"project\\u0004Change in all projects":["Изменить во всех проектах"],"project\\u0004Confirm":["Подтвердить"],"project\\u0004Could not load the project list":["Не удалось загрузить список проектов"],"project\\u0004Could not undo exclusion":["Не удалось отменить исключение"],"project\\u0004Delete":["Удалить"],"project\\u0004Delete project":["Удалить проект"],"project\\u0004Edit member list":["Изменить список участников"],"project\\u0004Email address":["Email"],"project\\u0004Exclude":["Удалить"],"project\\u0004Failed to send invitation":["Не удалось отправить приглашение"],"project\\u0004Failed to send invitations":["Не удалось отправить приглашения"],"project\\u0004Failed to update permissions":["Не удалось обновить права доступа"],"project\\u0004In all projects":["Во всех проектах"],"project\\u0004Invite":["Пригласить"],"project\\u0004Invite participants":["Пригласить участников"],"project\\u0004Invite to all projects":["Пригласить во все проекты"],"project\\u0004Name":["Имя"],"project\\u0004No matching memberships to update in your other projects":["В других ваших проектах нет подходящих участников для обновления"],"project\\u0004Permissions updated":["Права доступа обновлены"],"project\\u0004Project participants":["Участники проекта"],"project\\u0004Project settings":["Настройки проекта"],"project\\u0004Remove from project":["Удалить из проекта"],"project\\u0004Revoke":["Отозвать"],"project\\u0004Revoke invite":["Отозвать приглашение"],"project\\u0004Role in project":["Роль в проекте"],"project\\u0004The invitation was restored":["Приглашение было восстановлено"],"project\\u0004The invitation was sent to all your projects":["Приглашение было отправлено во все ваши проекты"],"project\\u0004The invitation was sent to some of your projects":["Приглашение было отправлено некоторым из ваших проектов"],"project\\u0004The participant was restored to the project":["Участник был восстановлен в проекте"],"project\\u0004Undo":["Отменить"],"project\\u0004You":["Вы"],"project\\u0004You are not the owner of any project":["Вы не являетесь владельцем какого-либо проекта"],"project\\u0004You excluded user ":["Вы заблокировали пользователя "],"recovery\\u0004\\" was successfully recovered.":["» восстановлен."],"recovery\\u0004” was successfully deleted.":["» удалено."],"recovery\\u0004” was successfully recovered.":["» завершено."],"resize":["размер"],"running+shoes":["running+shoes"],"s":["с"],"secure":["безопасно"],"selected":["выбрано"],"selling blue":["продающий синий"],"sender@example.com":["sender@example.com"],"spring_sale":["spring_sale"],"square":["квадрат"],"tab\\u0004AI assistant":["AI Ассистент"],"tab\\u0004Build":["Контент"],"tab\\u0004Calendar":["Календарь"],"tab\\u0004Checkbox":["Чекбокс"],"tab\\u0004Discuss":["Обсуждение"],"tab\\u0004Dropdown list":["Выпадающий список"],"tab\\u0004Input":["Поле ввода"],"tab\\u0004Optimize":["Оптимизация"],"tab\\u0004Radio button":["Радиокнопка"],"tab\\u0004Settings":["Настройки"],"tab\\u0004Styles":["Стили"],"table":["таблица"],"test":["тест","теста","тестов"],"text":["текст"],"textlink":["textlink"],"time to load":["время загрузки"],"total size":["общий размер"],"user":["Пользователь"],"utm_campaign":["utm_campaign"],"utm_content":["utm_content"],"utm_medium":["utm_medium"],"utm_source":["utm_source"],"utm_term":["utm_term"],"variable":["переменная"],"verb\\u0004Import":["Импортировать"],"video":["видео"],"was successfully":[" успешно"],"was used":["был использован","было использовано","было использовано"],"which exceeds the recommended 90 KB limit.":["что превышает рекомендуемый предел в 90 КБ."],"width":["ширина"],"–":["–"],"—":["—"],"“":["«"],"”":["»"],"” block?":["»?"],"” folder?":["»?"],"” group and all nested groups?":["» вместе со всеми вложениями?"],"” was successfully created.":["» создан."],"” was successfully imported.":["» импортировано."],"” was successfully sent.":["» отправлено."],"”.":["»."],"🎉 Welcome! Pro plan is activated":["🎉 Привет! Тариф Pro активирован"]}`)};function ib(e){if(!zs)return;const{id:t,catalog:n,time:r,hash:i}=zs;e.getInstance(o.LOCALE_SERVICE_ID)?.prime(t,n,{time:r,hash:i})}function Gs(e,t,n){let r=!1;const i=e.watch(a=>{r||!t(a)||(r=!0,n())});r&&i.dispose()}function ab(e,t){const n=e.getInstance(g.CONFIG_SOURCE_ID);n&&Gs(n,r=>!!r?.codeEnabled||!!r?.codeSideEnabled,()=>{cb(e,()=>{db(e,()=>{lb(e,()=>{Ht(e).whenVisible(()=>{Xt(()=>{sb(t).catch(()=>{})})})})})})})}async function sb(e){await e()}function lb(e,t){const n=e.getInstance(Fa);if(!n){Xt(t);return}const r=()=>{if(n.pipeline.filledGeneration()!==void 0){t();return}Xt(r)};Xt(r)}function cb(e,t){const n=e.getInstance(o.EMAIL_DOCUMENTS_ID);if(!n)return;if(n.current()){t();return}let r=!1;const i=n.subscribe(()=>{r||!n.current()||(r=!0,t())});r&&i()}function db(e,t){const n=e.getInstance(g.OPTIONS_SOURCE_ID);n&&Gs(n,r=>!!r?.element,t)}function ub(e){ab(e,cu)}var Ws=g.createIdentifier$1("NotificationService");function Hs(e,t="success"){return typeof e=="string"&&(e={message:e}),o.filterUndefined({type:e.type||t,data:e.data,innerException:e.innerException,title:e.message,description:e.description,actions:e.btn,onClose:e.onClose,duration:e.duration,icon:e.icon,placement:e.placement,style:e.style,closeIcon:e.closeIcon,props:e.props,role:e.role})}var mb="bottomRight";function Hr(e,t){return typeof e=="string"||typeof e=="object"?Hs(e,t):e}var pb=class extends g.Disposable{send;onNotify;onError;onSuccess;constructor(e,t,n){super(),this.send=n,this.onNotify=Ct(t,c=>c,c=>Hr(c)),this.onError=Ct(g.filter(t,c=>c.type==="error"),c=>c,c=>Hr(c,"error")),this.onSuccess=Ct(g.filter(t,c=>c.type==="success"),c=>c,c=>Hr(c));const r=this.addDisposable(new kt(this.onNotify)),i=this.addDisposable(new kt(this.onError)),a=this.addDisposable(new kt(this.onSuccess));this.addDisposable(e.watch(({handleNotify:c,handleError:d,handleSuccess:u})=>{r.setListener(c),i.setListener(d),a.setListener(u)}))}notify(e){this.send({placement:mb,...Hs(e)})}};function fb(e){e.injectFactory(Ws,()=>{const t=new pb(e.getInstance(g.OPTIONS_SOURCE_ID),g.getEvent(e,g.events.ON_NOTIFICATION),n=>{o.executeCommand(e,o.NOTIFY_COMMAND_ID,n)});return e.getInstance(g.DISPOSABLE_ID)?.addDisposable(t),t},!0)}function hb(e){const t=o.getEmailDocuments(e),n=i=>{e.getInstance(g.STORE_ID)?.dispatch(o.taxonomiesApi.util.invalidateTags([{type:"folder",id:i}]))},r=t.onSaved(i=>{i.created&&n("folder")});e.getInstance(g.DISPOSABLE_ID)?.addDispose(r)}function R0(e){return e}var gb=[{name:"rest.legacySections",provides:[g.REST_CLIENT_ID],setup:g.provideLegacyRestSections},{name:"canvas.resizer",provides:[Di],setup:J_},{name:"canvas.sandboxLocale",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:Z_},{name:"locale.brandCatalog",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:ib},{name:"email.restPorts",provides:[o.REST_EMAIL_PORTS_ID],setup:W_},{name:"block.historyPort",setup:V_},{name:"email.templatePrefetch",setup:tb},{name:"locale.antd",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:rb},{name:"save.listsFollow",setup:hb},{name:"monaco.prewarm",awaits:{services:[g.CONFIG_SOURCE_ID]},setup:ub},{name:"notifications",provides:[Ws],setup:fb},{name:"email.operations",setup:I_}],yb=g.defineMixin(e=>{for(const t of O_(gb))t.setup(e);return{instance:A_(e)}}),_b=g.combineMixins([yb,Fy,p_,__,x_,P_,Uh,f_,za,Ga]);async function bb(e){const t=new Map;typeof e=="object"&&(e=e.code);const{amp2html:n,html2amp:r}=await(0,Ve.__vitePreload)(async()=>{const{amp2html:c,html2amp:d}=await Promise.resolve().then(()=>_e("./static/core/f0fb869f.js"));return{amp2html:c,html2amp:d}},void 0,{}.url),i=await _t.changeHtml(e,async c=>{await _t.replaceImagesInDocument(c.document,d=>o.mapper.getEscapedText(d)!==d?d:o.toAbsoluteUrl(d),t);for(const d of c.document.querySelectorAll(".em-amp-show-disabled"))d.remove();c.handleRender(async({contentDocument:d,managedNodeController:u})=>{await r(d,{mappedTags:{script:"___script"},commit:()=>u.commit()})})},[800]),a=await _t.changeHtml(e,async c=>{await _t.replaceImagesInDocument(c.document,d=>o.mapper.getEscapedText(d)!==d?d:o.toAbsoluteUrl(d),t);for(const d of c.document.querySelectorAll(".em-amp-show-only"))d.remove();await n(c.document,{mappedTags:{script:"___script"}})},[800]);return{code:e,html:a,ampHtml:i}}async function vb(){const{installDiagnostics:e}=await(0,Ve.__vitePreload)(async()=>{const{installDiagnostics:t}=await Promise.resolve().then(()=>_e("./static/core/ebeee027.js"));return{installDiagnostics:t}},void 0,{}.url);return e()}async function Eb(e,t){const{initDevTools:n}=await(0,Ve.__vitePreload)(async()=>{const{initDevTools:r}=await Promise.resolve().then(()=>_e("./static/core/28631044.js"));return{initDevTools:r}},void 0,{}.url);n(e,t)}var Sb="1.1.85-dev.4";nn.asyncMixins=_b,nn.initDevTools=Eb,nn.installDiagnostics=vb,nn.parseAMP=bb,nn.version=Sb});
|