@emailmaker/emailmaker 1.0.16 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README_eng.md +1 -1
- package/asset-manifest.json +15 -15
- package/css.worker.js +1 -1
- package/editor.worker.js +1 -1
- package/emailmaker-esm.js +1 -1
- package/emailmaker.d.ts +2 -0
- package/emailmaker.js +1 -1
- package/html.worker.js +1 -1
- package/iframe/{iframe-eblock.3b4185f90393c93eee15.html → iframe-eblock.60f94ceecdad1be3fab1.html} +1 -1
- package/iframe/{iframe.3b4185f90393c93eee15.html → iframe.60f94ceecdad1be3fab1.html} +1 -1
- package/iframe/js/cssbeautify.js +1 -1
- package/iframe/sandbox-eblock.js +1 -1
- package/iframe/sandbox.js +1 -1
- package/json.worker.js +1 -1
- package/package.json +1 -1
- package/plugin.html +1 -1
- package/plugin_blocks_test.html +1 -1
- package/plugin_default.html +1 -1
- package/plugin_s.html +1 -1
- package/static/js/1431.12c0c15c.js +1 -0
- package/static/js/2627.4ccf2fb4.js +1 -0
- package/static/js/3144.6a0f3523.js +1 -0
- package/static/js/{3651.1f1503f1.js → 3651.03e24d07.js} +1 -1
- package/static/js/{5632.0239c3da.js → 5632.43d97ea3.js} +1 -1
- package/static/js/{5957.c0deb61f.js → 5957.cabf933b.js} +2 -2
- package/static/js/{698.b4c20ad0.js → 698.f62dd3ac.js} +1 -1
- package/static/js/{8786.3e0f4337.js → 8786.3c46fe7c.js} +1 -1
- package/translations.pot +75 -63
- package/ts.worker.js +1 -1
- package/static/js/1431.df5b0f20.js +0 -1
- package/static/js/2627.a522e4dd.js +0 -1
- package/static/js/3144.3b3007a0.js +0 -1
- /package/static/js/{5957.c0deb61f.js.LICENSE.txt → 5957.cabf933b.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
package/plugin.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><script id="plugin-script" src="emailmaker.js?
|
|
1
|
+
<!doctype html><html lang="en"><head><script id="plugin-script" src="emailmaker.js?b65c206bba9c5d152539"></script></head><body><button id="change_theme" style="width: 150px; height: 30px">Click Me</button><div style="background: white; width: 100%; height: 50px; display: flex; justify-content: center; align-items: center"></div><div id="test" style="padding: 0px; background: #fff; height: 100vh;"></div><script async defer="defer">// import { init } from "./emailmaker-esm.js?b65c206bba9c5d152539";
|
|
2
2
|
const auth_jwt = {
|
|
3
3
|
username: "****",
|
|
4
4
|
password: "****"
|
package/plugin_blocks_test.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><script id="plugin-script" src="emailmaker.js?
|
|
1
|
+
<!doctype html><html lang="en"><head><script id="plugin-script" src="emailmaker.js?b65c206bba9c5d152539"></script></head><body><div id="test" style="padding: 0px; background: #fff; height: 100vh;"></div><script async defer="defer">const getAuthToken = async () => {
|
|
2
2
|
|
|
3
3
|
var requestOptions = {
|
|
4
4
|
method: 'POST',
|
package/plugin_default.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><script id="plugin-script" src="emailmaker.js?
|
|
1
|
+
<!doctype html><html lang="en"><head><script id="plugin-script" src="emailmaker.js?b65c206bba9c5d152539"></script></head><body><div id="test" style="padding: 0px; background: #fff; height: 100vh;"></div><script async defer="defer">// import { init } from "./emailmaker-esm.js?b65c206bba9c5d152539";
|
|
2
2
|
const auth_jwt = {
|
|
3
3
|
username: "****",
|
|
4
4
|
password: "****"
|
package/plugin_s.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><script id="plugin-script" src="emailmaker.js?
|
|
1
|
+
<!doctype html><html lang="en"><head><script id="plugin-script" src="emailmaker.js?b65c206bba9c5d152539"></script></head><body><div id="test" style="padding: 0px; background: #fff; height: 100vh;"></div><script async defer="defer">const getAuthToken = async () => {
|
|
2
2
|
|
|
3
3
|
var requestOptions = {
|
|
4
4
|
method: 'POST',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[1431],{84612:(e,t,a)=>{a.d(t,{EQ:()=>u,YG:()=>d,Zs:()=>n,gb:()=>l});var r=a(33298),o=a(14315),i=a(44141);const s="Ai",n=(0,r.xP)({reducerPath:"AiApi",tagTypes:[s],baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({sendMessage:e.mutation({queryFn:({body:e},t)=>(0,i.KU)(t).saveFile.ai_create(e,{type:o.cM.FormData})}),getDialog:e.query({queryFn:({entity_id:e,connection:t="chat"},a)=>(0,i.KU)(a).saveFile.ai_status_list({connection:t,entity_id:e}),providesTags:({documents:e})=>e?[...e.map((({id:e})=>({type:s,id:e}))),{type:s,id:"LIST"}]:[{type:s,id:"LIST"}]})})}),{useSendMessageMutation:u,useGetDialogQuery:l,useLazyGetDialogQuery:d}=n},58819:(e,t,a)=>{a.d(t,{Ll:()=>u,MN:()=>d,Uu:()=>i,y4:()=>l});var r=a(33298),o=a(44141);const i=(0,r.xP)({reducerPath:"AiApiGenerator",baseQuery:(0,o.hI)({baseUrl:"https://ai-mail.emcdn.ru"}),endpoints:e=>({generateIdForTask:e.mutation({queryFn:(e,t)=>(0,o.u$)(t).tasks.tasksControllerCreateTask(e).then((e=>e))}),clearAiChat:e.query({queryFn:(e,t)=>(0,o.KU)(t).aiGenerator.clear_history_list(e).then((e=>e))}),getGeneratedContent:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({id:e,setError:t},{updateCachedData:a,cacheDataLoaded:r,cacheEntryRemoved:o}){const i=new EventSource(`https://ai-mail.emcdn.ru/tasks/${e}`);i.onmessage=e=>{const t=JSON.parse(e.data);a((e=>{e.push(t)}))},i.onerror=e=>{t("Error connecting to EventSource"),i.close()},await o,i.close()}}),getAiGenerateStatus:e.mutation({query:e=>({url:"https://app.emailmaker.ru/api/wp-json/constructor/v1/ai-save-task",method:"POST",body:e})})})}),{useGenerateIdForTaskMutation:s,useGetGeneratedContentQuery:n,useLazyClearAiChatQuery:u,useLazyGetGeneratedContentQuery:l,useGetAiGenerateStatusMutation:d}=i},53200:(e,t,a)=>{a.d(t,{B:()=>s,N:()=>n});var r=a(33298),o=a(14315),i=a(44141);const s=(0,r.xP)({reducerPath:"addUserToProjectApi",baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/user_to_project/v1/add_user"}),endpoints:e=>({addUserToProject:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).userToProject.add_user_create(e,{type:o.cM.FormData})})})}),{useAddUserToProjectMutation:n}=s},39990:(e,t,a)=>{a.d(t,{Q2:()=>d,b9:()=>y,Lj:()=>h,CR:()=>c,W5:()=>g,i2:()=>f,on:()=>m,hZ:()=>_});var r=a(33298),o=a(14315),i=a(31770);function s({title:{rendered:e}={rendered:""},acf:{limits:t,price:a},...r}){return{...r,title:e,limits:t,price:a}}function n({acf:{autosaves:e,hide_mergetags:t,theme:a,newsletter_consent:r,code_editor:o,counters:i,subscription:s,subscription_end:n,recurring_payments:u,subscription_id:l,promocode:d,subscription_amount:p,enterprise_users_limit:c,enterprise_price:m,enterprise_12_price:y,privacy_policy_agreement:_,last_used_project:g,email_confirmation:f},...h}){return{...h,autosaves:e,hide_mergetags:t,theme:a,newsletter_consent:r,code_editor:o,counters:Object.keys(i).reduce(((e,t)=>(e[t]=Number(i[t]),e)),{}),subscription:s,subscription_end:n,recurring_payments:u,subscription_id:l,promocode:d,subscription_amount:p,enterprise_users_limit:c,enterprise_price:m,enterprise_12_price:y,privacy_policy_agreement:_,last_used_project:g,email_confirmation:f}}var u=a(814),l=a(44141);const d=(0,r.xP)({reducerPath:"authorizationApi",baseQuery:(0,l.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({userRegistration:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp.users_register_create({body:e,type:o.cM.Json})}),emailUserRegistration:e.mutation({query:e=>({url:"https://app.emailmaker.ru/api//wp-json/auth/v1/users/register",method:"POST",body:e})}),getMailConfirmation:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.confirmation_list({...e})}),getSchema:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.users_me_list(void 0,{method:"OPTIONS",extraQuery:{_fields:"schema"}})}),getMe:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.users_me_list(null).then((0,i.SC)((e=>e instanceof Array?e[0]:e))).then((0,i.SC)(n))}),getUser:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.users_detail({id:e}).then((0,i.SC)(n))}),editMe:e.mutation({queryFn(e,t){const a=(0,l.KU)(t),r=(0,u.TB)(function({autosaves:e,theme:t,newsletter_consent:a,code_editor:r,counters:o,subscription:i,subscription_end:s,recurring_payments:n,subscription_id:u,promocode:l,subscription_amount:d,enterprise_users_limit:p,enterprise_price:c,enterprise_12_price:m,privacy_policy_agreement:y,locale:_,last_used_project:g,email_confirmation:f,...h}){return{...h,locale:_,acf:{autosaves:e,theme:t,newsletter_consent:a,code_editor:r,counters:o,subscription:i,subscription_end:s,recurring_payments:n,subscription_id:u,promocode:l,subscription_amount:d,enterprise_users_limit:p,enterprise_price:c,enterprise_12_price:m,privacy_policy_agreement:y,last_used_project:g,email_confirmation:f}}}(e),!0);return a.wp.users_me_create(r,{type:o.cM.Json}).then((0,i.SC)(n))}}),getSubscriptions:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.subscription_list(void 0).then((0,i.Ih)(s))})})}),{useUserRegistrationMutation:p,useGetMeQuery:c,useLazyGetMeQuery:m,useEditMeMutation:y,useLazyGetSchemaQuery:_,useGetSubscriptionsQuery:g,useLazyGetMailConfirmationQuery:f,useEmailUserRegistrationMutation:h}=d},87701:(e,t,a)=>{a.d(t,{VM:()=>y,pP:()=>P,Gr:()=>q,yW:()=>A,OZ:()=>k,J4:()=>h,bg:()=>g,SB:()=>_,h1:()=>v,OD:()=>T,kz:()=>E,lx:()=>b,R2:()=>f});var r=a(33298),o=a(14315),i=a(31770),s=a(54438),n=a(814);function u({id:e,title:{rendered:t}={rendered:""},acf:{html:a},excerpt:r,parent:o,...i}){return{...i,id:(0,n.WY)(e),parent:(0,n.WY)(o),title:t,html:a,excerpt:(0,n.pT)(r)?r.rendered:r}}var l=a(44141),d=a(30725),p=a(57227),c=a(85163);const m=(0,d.T)(p.E),y=(0,r.xP)({reducerPath:"blocksApi",tagTypes:["Blocks","TemplatesBlocks","ParentsBlocks","Block"],baseQuery:(0,l.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getBlocks:e.query({queryFn(e,t){var a,r;const o=(0,l.KU)(t),n={order:"desc",orderby:"modified"},u={};if(e.notEmbed||(u._embed=""),e.projectId&&(u._embed="author",u._fields="id,title,blocktags,blockfolder,group,modified,date,type,acf.lock,acf.project.ID,acf.type,author,acf.is_template,acf.html",n["filter[meta_key]"]="project",n["filter[meta_value]"]=e.projectId),e.fields&&(u._fields=e.fields),e.page&&(n.page=e.page),e.order&&(n.order=e.order),e.orderby&&(n.orderby=e.orderby),e.folderTag&&e.folderTag!==c.y2?(n["filter[tax_query][relation]"]="AND",n["filter[tax_query][0][taxonomy]"]="blockfolder",n["filter[tax_query][0][field]"]="id",n["filter[tax_query][0][terms]"]=e.folderTag):!e.hasOwnProperty("folderTag")||e.folderTag===c.y2&&("object"!==typeof e.folderTag||null!==e.folderTag)||null!==(a=e.tags)&&void 0!==a&&a.length||"trash"===e.status||(n["filter[tax_query][0][taxonomy]"]="blockfolder",n["filter[tax_query][0][operator]"]="NOT EXISTS"),(null===(r=e.tags)||void 0===r?void 0:r.length)>0&&"trash"!==e.status){n["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];n[`filter[tax_query][${t+1}][taxonomy]`]="blocktags",n[`filter[tax_query][${t+1}][field]`]="id",n[`filter[tax_query][${t+1}][terms]`]=a}}return e.type&&(n["filter[meta_query][2][key]"]="type",n["filter[meta_query][2][value]"]=e.type),e.name&&(n.search=e.name),e.pageSize&&(n.per_page=e.pageSize),"trash"===e.status&&(u.status="trash"),o.wp.eblock_list(n,{extraQuery:u}).then((0,i.Ih)(s.Y))},providesTags:(e,t,a,r)=>{var o,i;const s=null===r||void 0===r?void 0:r.response,n=(null===s||void 0===s?void 0:s.headers.get("X-WP-Total"))||0;return e?[...e.map((({id:e})=>{var t;return{type:"Blocks",id:`${a.folderTag||(null===(t=a.tags)||void 0===t?void 0:t[0])||a.projectId}_${a.page}_${a.status}_${n}`}})),{type:"Blocks",id:`${a.folderTag||(null===(o=a.tags)||void 0===o?void 0:o[0])||a.projectId}_${a.page}_${a.status}_${n}`}]:[{type:"Blocks",id:`${a.folderTag||(null===(i=a.tags)||void 0===i?void 0:i[0])||a.projectId}_${a.page}_${a.status}_${n}`}]},keepUnusedDataFor:0}),getBlocksSchema:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.eblock_list(void 0,{method:"OPTIONS",extraQuery:{_fields:"schema.properties.acf"}})}),getParentEmailBlocks:e.query({queryFn(e,t){var a;const r=(0,l.KU)(t),o={"filter[meta_query][0][compare]":"LIKE"},n={};if(e.notEmbed||(n._embed=""),e.emailId&&(o["filter[meta_query][0][key]"]="related_email",o["filter[meta_query][0][value]"]=e.emailId),e.fields&&(n._fields=e.fields),e.page&&(o.page=e.page),(null===(a=e.tags)||void 0===a?void 0:a.length)>0){o["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];o[`filter[tax_query][${t}][taxonomy]`]="blocktags",o[`filter[tax_query][${t}][field]`]="id",o[`filter[tax_query][${t}][terms]`]=a}}return e.type&&(o["filter[meta_query][2][key]"]="type",o["filter[meta_query][2][value]"]=e.type),e.name&&(o.search=e.name),e.pageSize&&(o.per_page=e.pageSize),r.wp.eblock_list(o,{extraQuery:n}).then((0,i.Ih)(s.Y))},providesTags:e=>e?[...e.map((({id:e})=>({type:"ParentsBlocks",id:e}))),{type:"ParentsBlocks",id:"LIST"}]:[{type:"ParentsBlocks",id:"LIST"}],keepUnusedDataFor:0}),getTemplateBlocks:e.query({queryFn:(e,t)=>{var a;const r=(0,l.KU)(t),o={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1",orderby:"modified",order:"desc"},n={};if(e.notEmbed||(n._embed=""),e.fields&&(n._fields=e.fields),e.page&&(o.page=e.page),(null===(a=e.tags)||void 0===a?void 0:a.length)>0){o["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];o[`filter[tax_query][${t}][taxonomy]`]="blocktags",o[`filter[tax_query][${t}][field]`]="id",o[`filter[tax_query][${t}][terms]`]=a}}return e.type&&(o["filter[meta_query][2][key]"]="type",o["filter[meta_query][2][value]"]=e.type),e.name&&(o.search=e.name),e.pageSize&&(o.per_page=e.pageSize),r.wp.eblock_list(o,{extraQuery:n}).then((0,i.Ih)(s.Y))},providesTags:e=>e?[...e.map((({id:e})=>({type:"TemplatesBlocks",id:e}))),{type:"TemplatesBlocks",id:"LIST"}]:[{type:"TemplatesBlocks",id:"LIST"}],keepUnusedDataFor:0}),getBlock:e.query({queryFn:m((({restApi:e})=>t=>e.getBlock(t))),providesTags:(e,t,a)=>[{type:"Block",id:a}],keepUnusedDataFor:0}),getBlockHistory:e.query({queryFn:({blockId:e,page:t=1},a)=>(0,l.KU)(a).wp.eblock_revisions_detail({parent:e,per_page:20,page:t},{extraQuery:{_fields:"author,slug,date,modified,title,acf.html,acf.common_styles,id"}}).then((a=>(0,i.SA)(a,((a,r)=>({data:a.filter((e=>e.acf.html)).map((e=>({...e,acf:{...e.acf,html:e.acf.html}}))).map(u),totalPages:+r.response.headers.get("X-WP-TotalPages"),args:{blockId:e,page:t}}))))),keepUnusedDataFor:0}),addBlock:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp.eblock_create({...(0,s.F)(e),status:"publish"},{type:o.cM.Json}).then((0,i.SC)(s.Y)),invalidatesTags:[{type:"Blocks",id:"LIST"}]}),editBlock:e.mutation({queryFn:(0,d.p)((e=>({blockId:t,source:a,...r},u)=>{const d=(0,l.KU)(e),p=(0,n.TB)((0,s.F)(r));return d.wp.eblock_partial_update(t,p,{type:o.cM.Json,extraQuery:{_embed:"wp:term"}}).then((0,i.SC)(s.Y))}))}),deleteBlock:e.mutation({queryFn(e,t){const a=(0,l.KU)(t);let r,o;return"object"===typeof e?(r=e.id,o=e.force):(r=e,o=!1),a.wp.eblock_delete(r,{force:o}).then((0,i.PI)(s.Y))},invalidatesTags:(e,t,a)=>[{type:"Blocks",id:a}]}),addTag:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp.blocktags_create({...e},{type:o.cM.Json})}),getDeletableTag:e.query({queryFn:([e,t],a)=>(0,l.KU)(a).wp.eblock_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":e,blocktags:[t]},{extraQuery:{"_fields[]":"blocktags"}}).then((0,i.Ih)(s.Y))}),autoSaveBlock:e.mutation({queryFn({blockId:e,body:t},a){const r=(0,l.KU)(a),s=function({parent:e,title:t,html:a,project:r,...o}){return{...o,parent:(0,n.mQ)(e),title:t,"acf[html]":a,"acf[project]":r}}(t);return r.wp.eblock_autosaves_create(e,s,{type:o.cM.Json}).then((0,i.SC)(u))}})})}),{useGetBlocksQuery:_,useGetBlockQuery:g,useLazyGetBlockQuery:f,useGetBlockHistoryQuery:h,useLazyGetBlockHistoryQuery:b,useGetBlocksSchemaQuery:v,useGetParentEmailBlocksQuery:T,useAddBlockMutation:P,useEditBlockMutation:k,useAddTagMutation:q,useAutoSaveBlockMutation:A,useGetTemplateBlocksQuery:E}=y},18777:(e,t,a)=>{a.d(t,{Jg:()=>d,z2:()=>c,HI:()=>m,vn:()=>_,kk:()=>y,Cf:()=>p});var r=a(33298),o=a(14315),i=a(31770),s=a(814);function n({id:e,post:t,parent:a,content:{rendered:r},acf:{status:o,target_id:i},...n}){return{...n,id:(0,s.WY)(e),post:(0,s.WY)(t),parent:(0,s.WY)(a),content:r,target_id:i,comment_status:o}}var u=a(44141);const l="Comments",d=(0,r.xP)({reducerPath:"commentsApi",tagTypes:[l],baseQuery:(0,u.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getComments:e.query({queryFn:function(e,t){return(0,u.KU)(t).wp.comments_list({post:[(0,s.mQ)(e)],per_page:50,order:"asc"}).then((0,i.Ih)(n))},providesTags:e=>e?[...e.map((({id:e})=>({type:l,id:e}))),{type:l,id:"LIST"}]:[{type:l,id:"LIST"}]}),addComment:e.mutation({queryFn({subjectId:e,author:t,parent:a,content:r,author_name:l,author_email:d,targetId:p},c){const m=(0,u.KU)(c),y={post:(0,s.mQ)(e),author:t,author_name:l,author_email:d},_={};return r&&(y.content=r),a&&(y.parent=(0,s.mQ)(a)),p&&(_["acf[target_id]"]=p),m.wp.comments_create(y,{type:o.cM.UrlEncoded,extraQuery:_}).then((0,i.SC)(n))},invalidatesTags:[{type:l,id:"LIST"}]}),deleteComment:e.mutation({queryFn:(e,t)=>(0,u.KU)(t).wp.comments_delete(e,{}).then((0,i.PI)(n)),invalidatesTags:[{type:l,id:"LIST"}]}),editComment:e.mutation({queryFn({commentId:e,content:t,status:a,targetId:r},s){const l=(0,u.KU)(s),d={},p={};return t&&(d.content=t),a&&(p["acf[status]"]=a),r&&(p["acf[targetId]"]=r),l.wp.comments_update(e,d,{type:o.cM.UrlEncoded,extraQuery:p}).then((0,i.SC)(n))},invalidatesTags:[{type:l,id:"LIST"}]}),deleteTarget:e.mutation({queryFn:(e,t)=>(0,u.KU)(t).wp.comments_delete(e,{},{extraQuery:{"acf[target_id]":""}}).then((0,i.PI)(n)),invalidatesTags:[{type:l,id:"LIST"}]})})}),{useGetCommentsQuery:p,useAddCommentMutation:c,useDeleteCommentMutation:m,useEditCommentMutation:y,useDeleteTargetMutation:_}=d},56920:(e,t,a)=>{a.d(t,{C:()=>s,F:()=>i});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"confirmationMailApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:e,email:t})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${e}&user_email=${t}`)}`})})})}),{useLazyGetConfirmationMailQuery:s}=i},21981:(e,t,a)=>{a.d(t,{m4:()=>m});var r=a(33298),o=a(14315),i=a(31770),s=a(91967),n=a(5446),u=a(814),l=a(60317),d=a(44141),p=a(30725),c=a(85163);const m=(0,r.xP)({reducerPath:"elementsApi",tagTypes:["Elements","Element","ElementAutosaves"],baseQuery:(0,d.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getElements:e.query({queryFn(e,t){var a,r;const o=(0,d.KU)(t),n={order:"desc",orderby:"modified"},u={};if(e.notEmbed||(u._embed=""),e.projectId&&(u._embed="author",u._fields="id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template",n["filter[meta_key]"]="project",n["filter[meta_value]"]=e.projectId),e.fields&&(u._fields=e.fields),e.page&&(n.page=e.page),e.order&&(n.order=e.order),e.orderby&&(n.orderby=e.orderby),e.folderTag&&e.folderTag!==c.y2?(n["filter[tax_query][relation]"]="AND",n["filter[tax_query][0][taxonomy]"]="folder",n["filter[tax_query][0][field]"]="id",n["filter[tax_query][0][terms]"]=e.folderTag):e.folderTag===c.y2&&("object"!==typeof e.folderTag||null!==e.folderTag)||null!==(a=e.tags)&&void 0!==a&&a.length||"trash"===e.status||(n["filter[tax_query][0][taxonomy]"]="folder",n["filter[tax_query][0][operator]"]="NOT EXISTS"),(null===(r=e.tags)||void 0===r?void 0:r.length)>0&&"trash"!==e.status){n["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];n[`filter[tax_query][${t+1}][taxonomy]`]="emailtags",n[`filter[tax_query][${t+1}][field]`]="id",n[`filter[tax_query][${t+1}][terms]`]=a}}return e.name&&(n.search=e.name),e.pageSize&&(n.per_page=e.pageSize),"trash"===e.status&&(u.status="trash"),o.wp.email_list(n,{extraQuery:u}).then((0,i.Ih)(s.V))},providesTags:(e,t,a,{response:r})=>{var o,i;const s=(null===r||void 0===r?void 0:r.headers.get("X-WP-Total"))||0;return e?[...e.map((({id:e})=>{var t;return{type:"Elements",id:`${a.folderTag||(null===(t=a.tags)||void 0===t?void 0:t[0])||a.projectId}_${a.page}_${a.status}_${s}`}})),{type:"Elements",id:`${a.folderTag||(null===(o=a.tags)||void 0===o?void 0:o[0])||a.projectId}_${a.page}_${a.status}_${s}`}]:[{type:"Elements",id:`${a.folderTag||(null===(i=a.tags)||void 0===i?void 0:i[0])||a.projectId}_${a.page}_${a.status}_${s}`}]},keepUnusedDataFor:0}),getTemplateElements:e.query({queryFn(e,t){var a;const r=(0,d.KU)(t),o={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1","filter[meta_query][0][compare]":"LIKE",orderby:"modified",order:"desc"},n={_embed:"wp:term",_fields:"_embedded,id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID"};if(e.emailId&&(o["filter[meta_query][0][key]"]="parent_email",o["filter[meta_query][0][value]"]=e.emailId),e.fields&&(n._fields=e.fields),e.page&&(o.page=e.page),(null===(a=e.tags)||void 0===a?void 0:a.length)>0){o["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];o[`filter[tax_query][${t}][taxonomy]`]="emailtags",o[`filter[tax_query][${t}][field]`]="id",o[`filter[tax_query][${t}][terms]`]=a}}return e.type&&(o["filter[meta_query][2][key]"]="type",o["filter[meta_query][2][value]"]=e.type),e.name&&(o.search="name"),e.pageSize&&(o.per_page=e.pageSize),r.wp.email_list(o,{extraQuery:n}).then((0,i.Ih)(s.V))},keepUnusedDataFor:0}),getElement:e.query({queryFn:(e,t)=>(0,d.KU)(t).wp.email_detail({id:(0,u.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,i.SC)(s.V)),providesTags:(e,t,a)=>[{type:"Email",id:a}],keepUnusedDataFor:0}),getElementHistory:e.query({queryFn:({emailId:e,page:t=1},a)=>(0,d.KU)(a).wp.email_revisions_detail({parent:e,per_page:20,page:t},{extraQuery:{_fields:"author,slug,date,modified,title,acf.html,acf.common_styles,id"}}).then((a=>(0,i.SA)(a,((a,r)=>({data:a.filter((e=>e.acf.html)).map((e=>({...e,acf:{...e.acf,html:e.acf.html}}))).map(n.F),totalPages:+r.response.headers.get("X-WP-TotalPages"),args:{emailId:e,page:t}}))))),providesTags:e=>e?[...e.data.map((({id:e})=>({type:"EmailAutosaves",id:e}))),{type:"EmailAutosaves",id:"LIST"}]:[{type:"EmailAutosaves",id:"LIST"}],keepUnusedDataFor:0}),addElement:e.mutation({queryFn:(0,p.p)((e=>({source:t,...a})=>(0,d.KU)(e).wp.email_create({status:"publish",...(0,s.v)(a)},{type:o.cM.Json}).then((0,i.SC)(s.V)))),invalidatesTags:[{type:"Elements",id:"LIST"}]}),editElement:e.mutation({queryFn:(0,p.p)((e=>({emailId:t,source:a,...r})=>{const n=(0,d.KU)(e),l=(0,u.TB)((0,s.v)(r));return n.wp.email_partial_update(t,l,{type:o.cM.Json,extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,acf.description,acf.html,acf.common_styles,acf.is_template,acf.lock,acf.parent_email,acf.project,acf.secret_hash,acf.subject,acf.utm_parameters"}}).then((0,i.SC)(s.V))}))}),deleteElement:e.mutation({queryFn(e,t){const a=(0,d.KU)(t);let r,o;return"object"===typeof e?(r=e.id,o=e.force):(r=e,o=!1),a.wp.email_delete(r,{force:o}).then((0,i.PI)(s.V))},invalidatesTags:(e,t,a)=>[{type:"Elements",id:a}]}),addTag:e.mutation({queryFn:(e,t)=>(0,d.KU)(t).wp.emailtags_create({...e},{type:o.cM.Json})}),getDeletableTag:e.query({queryFn:([e,t],a)=>(0,d.KU)(a).wp.email_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":e,emailtags:[t]},{extraQuery:{"_fields[]":"emailtags"}}).then((0,i.Ih)(s.V))}),autoSaveElement:e.mutation({queryFn({emailId:e,body:t},a){const r=(0,d.KU)(a),s=(0,l.B)(t);return r.wp.email_autosaves_create(e,s,{type:o.cM.FormData}).then((0,i.SC)(n.F))}})})}),{useGetElementsQuery:y,useGetTemplateElementsQuery:_,useGetElementQuery:g,useLazyGetElementQuery:f,useGetElementHistoryQuery:h,useLazyGetElementHistoryQuery:b,useAddElementMutation:v,useEditElementMutation:T,useDeleteElementMutation:P,useGetDeletableTagQuery:k,useAddTagMutation:q,useAutoSaveElementMutation:A}=m},47036:(e,t,a)=>{a.d(t,{c:()=>d,f:()=>l});var r=a(33298),o=a(31052),i=a(31770),s=a(91967),n=a(39217);const u="EmailRaw",l=(0,r.xP)({reducerPath:"emailRawApi",tagTypes:[u],baseQuery:(0,o.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmailRaw:e.query({queryFn:function({emailId:e,secret_hash:t},a){return(0,n.mg)(a).wp.email_detail({id:e},{extraQuery:{secret_hash:t}}).then((0,i.SC)(s.V))},providesTags:(e,t,a)=>[{type:u,id:a}]})})}),{useGetEmailRawQuery:d}=l},17581:(e,t,a)=>{a.d(t,{GY:()=>m,Gr:()=>q,Kh:()=>v,LX:()=>A,PX:()=>_,Xw:()=>y,YE:()=>b,YV:()=>h,_3:()=>f,dN:()=>T,sl:()=>g});var r=a(33298),o=a(14315),i=a(31770),s=a(91967),n=a(5446),u=a(814),l=a(60317),d=a(44141),p=a(30725),c=a(85163);const m=(0,r.xP)({reducerPath:"emailsApi",tagTypes:["Emails","Email","EmailAutosaves"],baseQuery:(0,d.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmails:e.query({queryFn(e,t){var a,r;const o=(0,d.KU)(t),n={order:"desc",orderby:"modified"},u={};if(e.notEmbed||(u._embed=""),e.projectId&&(u._embed="author",u._fields="id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template",n["filter[meta_key]"]="project",n["filter[meta_value]"]=e.projectId),e.fields&&(u._fields=e.fields),e.page&&(n.page=e.page),e.order&&(n.order=e.order),e.orderby&&(n.orderby=e.orderby),e.folderTag&&e.folderTag!==c.y2?(n["filter[tax_query][relation]"]="AND",n["filter[tax_query][0][taxonomy]"]="folder",n["filter[tax_query][0][field]"]="id",n["filter[tax_query][0][terms]"]=e.folderTag):e.folderTag===c.y2&&("object"!==typeof e.folderTag||null!==e.folderTag)||null!==(a=e.tags)&&void 0!==a&&a.length||"trash"===e.status||(n["filter[tax_query][0][taxonomy]"]="folder",n["filter[tax_query][0][operator]"]="NOT EXISTS"),(null===(r=e.tags)||void 0===r?void 0:r.length)>0&&"trash"!==e.status){n["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];n[`filter[tax_query][${t+1}][taxonomy]`]="emailtags",n[`filter[tax_query][${t+1}][field]`]="id",n[`filter[tax_query][${t+1}][terms]`]=a}}return e.name&&(n.search=e.name),e.pageSize&&(n.per_page=e.pageSize),"trash"===e.status&&(u.status="trash"),o.wp.email_list(n,{extraQuery:u}).then((0,i.Ih)(s.V))},providesTags:(e,t,a,{response:r})=>{var o,i;const s=(null===r||void 0===r?void 0:r.headers.get("X-WP-Total"))||0;return e?[...e.map((({id:e})=>{var t;return{type:"Emails",id:`${a.folderTag||(null===(t=a.tags)||void 0===t?void 0:t[0])||a.projectId}_${a.page}_${a.status}_${s}`}})),{type:"Emails",id:`${a.folderTag||(null===(o=a.tags)||void 0===o?void 0:o[0])||a.projectId}_${a.page}_${a.status}_${s}`}]:[{type:"Emails",id:`${a.folderTag||(null===(i=a.tags)||void 0===i?void 0:i[0])||a.projectId}_${a.page}_${a.status}_${s}`}]},keepUnusedDataFor:0}),getTemplateEmails:e.query({queryFn(e,t){var a;const r=(0,d.KU)(t),o={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1","filter[meta_query][0][compare]":"LIKE",orderby:"modified",order:"desc"},n={_embed:"wp:term",_fields:"_embedded,id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID"};if(e.emailId&&(o["filter[meta_query][0][key]"]="parent_email",o["filter[meta_query][0][value]"]=e.emailId),e.fields&&(n._fields=e.fields),e.page&&(o.page=e.page),(null===(a=e.tags)||void 0===a?void 0:a.length)>0){o["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];o[`filter[tax_query][${t}][taxonomy]`]="emailtags",o[`filter[tax_query][${t}][field]`]="id",o[`filter[tax_query][${t}][terms]`]=a}}return e.type&&(o["filter[meta_query][2][key]"]="type",o["filter[meta_query][2][value]"]=e.type),e.name&&(o.search="name"),e.pageSize&&(o.per_page=e.pageSize),r.wp.email_list(o,{extraQuery:n}).then((0,i.Ih)(s.V))},keepUnusedDataFor:0}),getEmail:e.query({queryFn:(e,t)=>(0,d.KU)(t).wp.email_detail({id:(0,u.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,i.SC)(s.V)),providesTags:(e,t,a)=>[{type:"Email",id:a}],keepUnusedDataFor:0}),getEmailHistory:e.query({queryFn:({emailId:e,page:t=1},a)=>(0,d.KU)(a).wp.email_revisions_detail({parent:e,per_page:20,page:t},{extraQuery:{_fields:"author,slug,date,modified,title,acf.html,acf.common_styles,id"}}).then((a=>(0,i.SA)(a,((a,r)=>({data:a.filter((e=>e.acf.html)).map((e=>({...e,acf:{...e.acf,html:e.acf.html}}))).map(n.F),totalPages:+r.response.headers.get("X-WP-TotalPages"),args:{emailId:e,page:t}}))))),providesTags:e=>e?[...e.data.map((({id:e})=>({type:"EmailAutosaves",id:e}))),{type:"EmailAutosaves",id:"LIST"}]:[{type:"EmailAutosaves",id:"LIST"}],keepUnusedDataFor:0}),addEmail:e.mutation({queryFn:(0,p.p)((e=>({source:t,...a})=>(0,d.KU)(e).wp.email_create({status:"publish",...(0,s.v)(a)},{type:o.cM.Json}).then((0,i.SC)(s.V)))),invalidatesTags:[{type:"Emails",id:"LIST"}]}),editEmail:e.mutation({queryFn:(0,p.p)((e=>({emailId:t,source:a,...r})=>{const n=(0,d.KU)(e),l=(0,u.TB)((0,s.v)(r));return n.wp.email_partial_update(t,l,{type:o.cM.Json,extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,acf.description,acf.html,acf.common_styles,acf.is_template,acf.lock,acf.parent_email,acf.project,acf.secret_hash,acf.subject,acf.utm_parameters"}}).then((0,i.SC)(s.V))}))}),deleteEmail:e.mutation({queryFn(e,t){const a=(0,d.KU)(t);let r,o;return"object"===typeof e?(r=e.id,o=e.force):(r=e,o=!1),a.wp.email_delete(r,{force:o}).then((0,i.PI)(s.V))},invalidatesTags:(e,t,a)=>[{type:"Emails",id:a}]}),addTag:e.mutation({queryFn:(e,t)=>(0,d.KU)(t).wp.emailtags_create({...e},{type:o.cM.Json})}),getDeletableTag:e.query({queryFn:([e,t],a)=>(0,d.KU)(a).wp.email_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":e,emailtags:[t]},{extraQuery:{"_fields[]":"emailtags"}}).then((0,i.Ih)(s.V))}),autoSaveEmail:e.mutation({queryFn({emailId:e,body:t},a){const r=(0,d.KU)(a),s=(0,l.B)(t);return r.wp.email_autosaves_create(e,s,{type:o.cM.FormData}).then((0,i.SC)(n.F))}})})}),{useGetEmailsQuery:y,useGetTemplateEmailsQuery:_,useGetEmailQuery:g,useLazyGetEmailQuery:f,useGetEmailHistoryQuery:h,useLazyGetEmailHistoryQuery:b,useAddEmailMutation:v,useEditEmailMutation:T,useDeleteEmailMutation:P,useGetDeletableTagQuery:k,useAddTagMutation:q,useAutoSaveEmailMutation:A}=m},62677:(e,t,a)=>{a.d(t,{C:()=>i,N:()=>s});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"webHookApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({postDataByWebHook:e.mutation({query:({url:e,body:t})=>({url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t})})})}),{usePostDataByWebHookMutation:s}=i},57227:(e,t,a)=>{a.d(t,{E:()=>n});var r=a(31770),o=a(54438),i=a(814),s=a(44141);function n(e){return{getBlock:async t=>(0,s.KU)(e).wp.eblock_detail({id:(0,i.mQ)(t)},{extraQuery:{_embed:""}}).then((0,r.SC)(o.Y))}}},35317:(e,t,a)=>{a.d(t,{O:()=>s,y:()=>i});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"getCheckoutUrlApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({GetCheckoutUrl:e.mutation({query:e=>({url:`?proxy_url=${encodeURIComponent({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_WP_API_URL:"https://app.emailmaker.ru/api/wp-json/wp/v2/",REACT_APP_WP_SAVE_FILE_V1_URL:"https://app.emailmaker.ru/api/wp-json/save-file/v1/",REACT_APP_WP_JWT_AUTH_API_URL:"https://app.emailmaker.ru/api/wp-json/jwt-auth/v1/",REACT_APP_WP_JWT_AUTH_YANDEX_API_URL:"https://api.emailmaker.ru/wp-json/auth/v1/",REACT_APP_WP_ADD_USER_TO_PROJECT:"https://app.emailmaker.ru/api/wp-json/user_to_project/v1/add_user",REACT_APP_WP_RECOVER_PASSWORD_API_URL:"https://app.emailmaker.ru/api/wp-json/bdpwr/v1/",REACT_APP_IMAGE_INFO_TOOL:"https://scr.emcdn.ru/imageinfo",REACT_APP_IFRAME_EMAIL_SRC:"https://app.emailmaker.ru/api/resources/iframe.html?2",REACT_APP_IFRAME_EBLOCK_SRC:"https://app.emailmaker.ru/api/resources/iframe-eblock.html",REACT_APP_PROXY:"https://px0.emailmaker.ru/",REACT_APP_PIPEDREAM_EMAIL_CONFIRMATION_SRC:"https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276",REACT_APP_PIPEDREAM_REQUEST_PLANE_SRC:"https://webhook.latenode.com/5868/prod/9e7a6445-2244-4dd5-bda4-5bca82997bf8",REACT_APP_PIPEDREAM_RECURRENCE_SUBSCRIPTION_ON_SRC:"https://webhook.latenode.com/5868/prod/e1dd37b1-c3d4-4441-b329-d6b3aa51bfe7",REACT_APP_PIPEDREAM_RECURRENCE_SUBSCRIPTION_OFF_SRC:"https://webhook.latenode.com/5868/prod/07ae4159-132b-4a00-998b-bc47c20365ba",REACT_APP_PAYMENT_GATEWAY:"cloudpayment",REACT_APP_CLOUDPAYMENT_PUBLIC_ID:"pk_e8c7c303759283dc35cf4ad7b396c",REACT_APP_WP_LOCALES_URL:"https://app.emailmaker.ru/api/wp-json/translations/v1",REACT_APP_DEFAULT_LOCALE:"ru_RU",REACT_APP_BASE_DOMAIN:"https://emailmaker.ru",REACT_APP_COOKIE_DOMAIN:"emailmaker.ru",REACT_APP_NAME:"emailmaker",REACT_APP_BACKEND_DOMAIN:"api.emailmaker.ru",REACT_APP_SENTRY_DSN:"https://cd3784c85293aedfd32fd245760d129d@sentry.emcdn.ru/2",REACT_APP_PROXY_URL:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get",REACT_APP_AI_API_URL:"https://ai-portal.crmgroup.ru",REACT_APP_UNSPLASH_KEY:"S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o",REACT_APP_UNSPLASH_UTM_APP_NAME:"blocks",REACT_APP_GIPHY_KEY:"Nh77eBlPeMn1ed9MBAvL542NUGeNO26F",REACT_APP_OPENAPI_BASE_URL:"https://app.emailmaker.ru/api/",REACT_APP_DEVTOOLS_BLOCKED:"on",REACT_APP_GOOGLE_AUTH_CLIENT_ID:"123557245300-l2gsjen8oueqfg0jp31iuptap852981n.apps.googleusercontent.com",REACT_APP_YANDEX_AUTH_CLIENT_ID:"6456dd7eb0db47bcbcb2329c614723b5",REACT_APP_COVER_GENERATOR_URL_MAKER:"https://ai-mail.emcdn.ru",REACT_APP_COVER_GENERATOR_URL_BLOCKS:"https://ai-mail.useblocks.io",REACT_APP_OPTIIMSE_API_URL:"optimization/v1/validate",REACT_APP_ENVIRONMENT_VAR:"EmailmakerEnvironment",REACT_APP_WP_PROMO_URL:"https://app.emailmaker.ru/api/wp-json/promo/v1/",REACT_APP_DEVTOOLS_PASSWORD_HASH:"5822d294d0c06a806d50d49685b16af69f53c531485dbe20bb6bbe84b67cb6fb"}.REACT_APP_PIPEDREAM_GET_CHECKOUT_URL)}`,method:"POST",body:e})})})}),{useGetCheckoutUrlMutation:s}=i},141:(e,t,a)=>{a.d(t,{k:()=>i,x:()=>s});var r=a(33298),o=a(44141);const i=(0,r.xP)({reducerPath:"googleAuthApi",baseQuery:(0,o.hI)({baseUrl:"https://app.emailmaker.ru/api//wp-json/auth/v1/google/callback"}),endpoints:e=>({validateGoogleToken:e.mutation({query:e=>({url:"",method:"POST",body:e})})})}),{useValidateGoogleTokenMutation:s}=i},95679:(e,t,a)=>{a.d(t,{CL:()=>s,FQ:()=>n,Jg:()=>g,Mv:()=>c,eo:()=>h,gg:()=>v,h4:()=>d});var r=a(33298),o=a(14315),i=a(44141);const s=(0,r.xP)({reducerPath:"imageApi",baseQuery:void 0,endpoints:e=>({getImageInfo:e.query({queryFn:async function(e,t){try{var a,r;const o=(null===(a=t.getState().configSlice)||void 0===a||null===(r=a.config)||void 0===r?void 0:r.imageInfoToolUrl)||"https://scr.emcdn.ru/imageinfo",i=await fetch(`${o}?url=${encodeURIComponent(e)}`);return{data:await i.json()}}catch(o){console.log(o)}}}),getSearchImage:e.query({queryFn:async function({query:e,page:t}){const a=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let r=`https://api.unsplash.com/search/photos?client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o&lang=ru&per_page=18&query=${a}&page=${t}`;""!==e.color&&(r+=`&color=${e.color}`),""!==e.orientation&&(r+=`&orientation=${e.orientation}`);const o=await fetch(r);return{data:await o.json()}}catch(r){console.log(r)}}}),getUnsplashImage:e.query({queryFn:async function(e){try{const t=await fetch(`${e}&client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o`);return{data:await t.json()}}catch(t){console.log(t)}}}),sendAiImageRequest:e.query({queryFn:async function({body:e},t){try{const a=(0,i.KU)(t);return await a.saveFile.ai_create(e,{type:o.cM.FormData})}catch(a){console.log(a)}}}),getAiImage:e.query({queryFn:async function(e,t){try{const a=(0,i.KU)(t);return await a.saveFile.ai_status_list(e)}catch(a){console.log(a)}}}),getAiImageSSE:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({task_id:e,entity_id:t},{updateCachedData:a,cacheDataLoaded:r,cacheEntryRemoved:o}){const i=new EventSource(` https://app.emailmaker.ru/api/wp-json/ai-generator/v1/ai-status?entity_id=${t}&stream=1&task_id=${e}`);i.onmessage=e=>{const t=JSON.parse(e.data);a((e=>{e.push(t)}))},i.onerror=e=>{i.close()},await o,i.close()}}),getSearchGif:e.query({queryFn:async function({query:e,page:t}){const a=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let e=`https://api.giphy.com/v1/gifs/search?api_key=Nh77eBlPeMn1ed9MBAvL542NUGeNO26F&q=${a}&limit=25&offset=${t}&lang=en`;const r=await fetch(e);return{data:await r.json()}}catch(r){console.log(r)}}})})}),{useLazyGetImageInfoQuery:n,useGetImageInfoQuery:u,useGetSearchImageQuery:l,useLazyGetSearchImageQuery:d,useSendAiImageRequestQuery:p,useLazySendAiImageRequestQuery:c,useGetAiImageQuery:m,useLazyGetAiImageQuery:y,useGetUnsplashImageQuery:_,useLazyGetUnsplashImageQuery:g,useGetSearchGifQuery:f,useLazyGetSearchGifQuery:h,useGetAiImageSSEQuery:b,useLazyGetAiImageSSEQuery:v}=s},94381:(e,t,a)=>{a.d(t,{Ad:()=>n,Yj:()=>d,h_:()=>u});var r=a(33298),o=a(31052),i=a(44141);const s="LOCALES",n=(0,r.xP)({reducerPath:"localesApi",tagTypes:[s],baseQuery:(0,o.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/translations/v1"}),endpoints:e=>({getLocale:e.query({async queryFn({id:e},t){const a=(0,i.KU)(t);try{return await a.translations.get_translations3(e,"react_app")}catch(r){return console.log(r),a.translations.get_translations3("en_US","react_app")}},providesTags:(e,t,a)=>[{type:s,id:a}]}),getLocales:e.query({queryFn:function(e,t){return(0,i.KU)(t).translations.get_translations2("react_app")},providesTags:(e,t,a)=>[{type:s,id:a}]})})}),{useGetLocalesQuery:u,useGetLocaleQuery:l,useLazyGetLocaleQuery:d,useLazyGetLocalesQuery:p}=n},54438:(e,t,a)=>{a.d(t,{F:()=>s,Y:()=>i});var r=a(814),o=a(71210);function i({id:e,type:t,title:{rendered:a}={rendered:""},excerpt:i,acf:{subject:s,description:n,html:u,project:l,related_email:d,tags:p,type:c,is_template:m,lock:y},..._}){return{..._,id:String(e),renderGuid:(0,o.l)(),description:n,html:u,excerpt:null===i||void 0===i?void 0:i.rendered,project:(0,r.pT)(l)?l.ID:l,project_author:(0,r.pT)(l)?l.post_author:void 0,project_title:(0,r.pT)(l)?l.post_title:void 0,tags:p,is_template:m,type:c,related_email:(0,r.WY)((0,r.pT)(d)?d.ID:d),title:a,lock:y}}function s({title:e,subject:t,description:a,renderGuid:o,html:i,project:s,tags:n,type:u,related_email:l,is_template:d,lock:p,...c}){return{...c,title:e,acf:{description:a,related_email:(0,r.mQ)(l),html:i,project:s,tags:n,type:u,is_template:d,lock:p}}}},91967:(e,t,a)=>{a.d(t,{V:()=>i,v:()=>s});var r=a(814),o=a(71210);function i({id:e,title:{rendered:t}={rendered:""},type:a,guid:i,acf:{lock:s,subject:n,description:u,html:l,project:d,tags:p,utm_parameters:c,parent_email:m,common_styles:y,is_template:_},...g}){return{...g,id:(0,r.WY)(e),title:t,lock:s,renderGuid:(0,o.l)(),description:u,html:l,project:(0,r.pT)(d)?d.ID:d,project_author:(0,r.pT)(d)?d.post_author:void 0,project_title:(0,r.pT)(d)?d.post_title:void 0,tags:p,utm_parameters:c,parent_email:(0,r.WY)(m instanceof Array&&m[0]?m[0].ID:m),common_styles:y,is_template:_}}function s({title:e,lock:t,subject:a,description:o,html:i,project:s,tags:n,renderGuid:u,utm_parameters:l,parent_email:d,common_styles:p,is_template:c,...m}){return{...m,title:e,acf:{lock:t,description:o,html:i,project:s,tags:n,utm_parameters:l,parent_email:(0,r.mQ)(d),common_styles:p,is_template:c}}}},60317:(e,t,a)=>{a.d(t,{B:()=>o});var r=a(814);function o({parent:e,title:t,html:a,project:o,subject:i,preheader:s,common_styles:n,...u}){return{...u,title:t,parent:(0,r.mQ)(e),"acf[html]":a,"acf[project]":o}}},5446:(e,t,a)=>{a.d(t,{F:()=>o});var r=a(814);function o({id:e,title:{rendered:t}={rendered:""},acf:{html:a},parent:o,excerpt:i,...s}){return{...s,id:(0,r.WY)(e),parent:(0,r.WY)(o),title:t,html:a,excerpt:(0,r.pT)(i)?i.rendered:i}}},814:(e,t,a)=>{function r(e,t=!1){const a={};for(const o of Object.keys(e)){let i=e[o];void 0===i||"number"===typeof i&&Number.isNaN(i)||(t&&"object"===typeof i&&null!==i&&(i=r(i)),a[o]=i)}return a}function o(e){return"object"===typeof e&&e}function i(e){const t=Number(e);return isNaN(t)?e:t}function s(e){return"number"===typeof e?String(e):e}a.d(t,{TB:()=>r,WY:()=>s,mQ:()=>i,pT:()=>o})},62689:(e,t,a)=>{a.d(t,{vx:()=>l,I9:()=>d,bw:()=>p});var r=a(33298),o=a(14315),i=a(31770);function s({title:e,acf:{seen:t,type:a},...r}){return{...r,seen:t,type:a,title:e.rendered}}var n=a(44141);const u="Notifications",l=(0,r.xP)({reducerPath:"notificationsApi",tagTypes:[u],baseQuery:(0,n.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getNotifications:e.query({queryFn:(e,t)=>(0,n.KU)(t).wp.notification_list({author:[e]}).then((0,i.Ih)(s)),providesTags:e=>e?[...e.map((({id:e})=>({type:u,id:e}))),{type:u,id:"LIST"}]:[{type:u,id:"LIST"}]}),notificationShown:e.mutation({queryFn:({id:e,datetime:t},a)=>(0,n.KU)(a).wp.notification_create2(e,{},{type:o.cM.Json,extraQuery:{"acf[seen]":t}}).then((0,i.SC)(s)),invalidatesTags:[{type:u,id:"LIST"}]})})}),{useGetNotificationsQuery:d,useNotificationShownMutation:p}=l},88528:(e,t,a)=>{a.d(t,{Ju:()=>u,Sr:()=>l,ku:()=>n,tO:()=>s});var r=a(33298),o=a(44141);const i="Optimise",s=(0,r.xP)({reducerPath:"optimiseApi",tagTypes:[i],baseQuery:async(e,t,a)=>{const r=(0,o.KU)(t).baseUrl.replaceAll(/[\\/]$/g,""),i=(0,o.hI)({baseUrl:`${r}/optimization/v1/validate`});let s=await i(e,t,a);if(s.error){let e=s.error;if("function"===typeof e.json)try{e=await e.json()}catch{e=await e,console.log("error",e)}return{error:e}}return s},endpoints:e=>({editLinks:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/links",body:e}),invalidatesTags:[i]}),editImages:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/images",body:e})}),editSpam:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/spamassasin",body:e})})})}),{useEditLinksMutation:n,useEditImagesMutation:u,useEditSpamMutation:l}=s},84568:(e,t,a)=>{a.d(t,{Nq:()=>p,lD:()=>y,OD:()=>_,fo:()=>m,su:()=>c});var r=a(33298),o=a(14315),i=a(31770);function s({title:{rendered:e}={rendered:""},acf:{members:t,projects_test_emails:a,ftp_settings:r,webhook:o,emails:i,blocks:s},...n}){return{...n,title:e,members:t,projects_test_emails:a,ftp_settings:r,webhook:o,emails:i,blocks:s}}function n({title:e,members:t,projects_test_emails:a,ftp_settings:r,webhook:o,emails:i,blocks:s,...n}){return{...n,title:e,acf:{webhook:o,members:t,projects_test_emails:a,ftp_settings:r,emails:i,blocks:s}}}var u=a(814),l=a(44141);const d="Projects",p=(0,r.xP)({reducerPath:"projectsApi",tagTypes:[d,"project"],baseQuery:(0,l.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getProjects:e.query({queryFn(e={page:1},t){const a=(0,l.KU)(t),r={status:["private"]};return e.page&&(r.page=e.page),e.order&&(r.order=e.order),e.orderby&&(r.orderby=e.order),a.wp.project_list(r).then((0,i.Ih)(s))},providesTags:e=>e?[...e.map((({id:e})=>({type:d,id:e}))),{type:d,id:"LIST"}]:[{type:d,id:"LIST"}]}),getProject:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.project_detail({id:e},{extraQuery:{_embed:"wp:term"}}).then((0,i.SC)(s)),providesTags:(e,t,a)=>[{type:"project",id:a}]}),addProject:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp.project_create({status:"private",...n(e)},{type:o.cM.Json}).then((0,i.SC)(s)),invalidatesTags:[{type:d,id:"LIST"}]}),editProject:e.mutation({queryFn({projectId:e,...t},a){const r=(0,l.KU)(a),d=(0,u.TB)(n(t),!0);return r.wp.project_partial_update(e,d,{type:o.cM.Json}).then((0,i.SC)(s))},invalidatesTags:(e,t,{projectId:a})=>[{type:d,id:a}]}),deleteProject:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp.project_delete(e,{}).then((0,i.PI)(s)),invalidatesTags:(e,t,a)=>[{type:d,id:a}]})})}),{useGetProjectsQuery:c,useGetProjectQuery:m,useAddProjectMutation:y,useEditProjectMutation:_}=p},15865:(e,t,a)=>{a.d(t,{So:()=>i});var r=a(33298),o=a(44141);const i=(0,r.xP)({reducerPath:"promoApi",baseQuery:(0,o.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:e,type:t},a)=>(0,o.KU)(a).promo.set_code_create({code:e,type:t})}),getPromoInfo:e.query({queryFn:({code:e},t)=>(0,o.KU)(t).promo.get_code_info_list({code:e})})})}),{useCheckPromoMutation:s,useGetPromoInfoQuery:n}=i},46312:(e,t,a)=>{a.d(t,{Z8:()=>i,mI:()=>n});var r=a(33298),o=a(44141);const i=(0,r.xP)({reducerPath:"proxyApi",tagTypes:["Proxy"],baseQuery:(0,o.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get"}),endpoints:e=>({getFile:e.query({queryFn({url:e,tryFetch:t=!0,type:a},r){const i=(0,o.KU)(r),s=t?fetch(e):Promise.reject(),n=e=>(e=>{switch(a){case"json":return e.json();case"text":return e.text();default:return e.blob()}})(e).then((e=>({data:e})));return s.then((e=>n(e))).catch((()=>i.corsProxy.get_list({format:"blob",extraQuery:{url:encodeURIComponent(e)}})))}})})}),{useGetFileQuery:s,useLazyGetFileQuery:n}=i},65119:(e,t,a)=>{a.d(t,{Lv:()=>u,kg:()=>l,yR:()=>n});var r=a(33298),o=a(31052),i=a(14315),s=a(39217);const n=(0,r.xP)({reducerPath:"recoverPasswordApi",baseQuery:(0,o.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/bdpwr/v1/"}),endpoints:e=>({resetPassword:e.mutation({queryFn:(e,t)=>(0,s.mg)(t).bdpwr.reset_password_create({body:e,type:i.cM.Json})}),setPassword:e.mutation({queryFn:(e,t)=>(0,s.mg)(t).bdpwr.set_password_create({body:e,type:i.cM.Json})}),validateRecoverPasswordCode:e.mutation({queryFn:(e,t)=>(0,s.mg)(t).bdpwr.validate_code_create({body:e,type:i.cM.Json})})})}),{useResetPasswordMutation:u,useSetPasswordMutation:l,useValidateRecoverPasswordCodeMutation:d}=n},76793:(e,t,a)=>{a.d(t,{Cl:()=>s,KA:()=>i});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"recurrenceSubscriptionsOffApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getCanselRecurrence:e.query({query:e=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/07ae4159-132b-4a00-998b-bc47c20365ba?subscription_id=${e.sid}&user_id=${e.uid}`)}`})})})}),{useLazyGetCanselRecurrenceQuery:s,useGetCanselRecurrenceQuery:n}=i},843:(e,t,a)=>{a.d(t,{IJ:()=>s,Sd:()=>i});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"recurrenceSubscriptionsOnApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRecurrence:e.query({query:e=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/e1dd37b1-c3d4-4441-b329-d6b3aa51bfe7?subscription_id=${e.sid}&user_id=${e.uid}`)}`})})})}),{useLazyGetRecurrenceQuery:s,useGetRecurrenceQuery:n}=i},40869:(e,t,a)=>{a.d(t,{E:()=>s,M:()=>i});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"requestPlaneApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRequest:e.mutation({query:e=>({url:`?proxy_url=${encodeURIComponent("https://webhook.latenode.com/5868/prod/9e7a6445-2244-4dd5-bda4-5bca82997bf8")}`,method:"POST",body:e})})})}),{useGetRequestMutation:s}=i},63531:(e,t,a)=>{a.d(t,{Zf:()=>l,dS:()=>n,lg:()=>u,tb:()=>d,yH:()=>s});var r=a(33298),o=a(14315),i=a(44141);const s=(0,r.xP)({reducerPath:"saveFileApi",tagTypes:["Images"],baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({uploadImage:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.upload_create(e,{type:o.cM.FormData})}),sendTestEmail:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.send_email_create(e,{type:o.cM.FormData})}),sendLivePreview:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.get_link_create(e,{type:o.cM.FormData})}),sendShortLink:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.shortener_create(e,{type:o.cM.FormData})})})}),{useUploadImageMutation:n,useSendTestEmailMutation:u,useSendLivePreviewMutation:l,useSendShortLinkMutation:d}=s},93563:(e,t,a)=>{a.d(t,{$s:()=>p,Jz:()=>n,Yb:()=>d,f1:()=>l,kE:()=>s});var r=a(33298),o=a(44141);const i=()=>window.location.toString().includes("/blocks")?"block":"",s=(0,r.xP)({reducerPath:"taxonomiesApi",tagTypes:["Taxonomies","folder","block_folder"],baseQuery:(0,o.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({addFolder:e.mutation({queryFn:(e,t)=>(0,o.KU)(t).wp[i()+"folder_create"](e).then((e=>e))}),editFolder:e.mutation({queryFn:({id:e,data:t},a)=>(0,o.KU)(a).wp[i()+"folder_partial_update"](e,t).then((e=>e))}),deleteFolder:e.mutation({queryFn:(e,t)=>(0,o.KU)(t).wp[i()+"folder_delete"](e,{force:!0}).then((e=>e))}),getFolders:e.query({queryFn:(e,t)=>(0,o.KU)(t).wp[i()+"folder_list"]({per_page:100,...e}).then((e=>e)),providesTags:(e,t,a)=>[{type:"folder",id:a}]}),addEmailsTag:e.mutation({queryFn:(e,t)=>(0,o.KU)(t).wp.emailtags_create(e).then((e=>e))}),editEmailsTag:e.mutation({queryFn:({id:e,...t},a)=>(0,o.KU)(a).wp.emailtags_partial_update(e,t).then((e=>e))}),deleteEmailsTag:e.mutation({queryFn:(e,t)=>(0,o.KU)(t).wp.emailtags_delete(e,{force:!0}).then((e=>e))}),getTags:e.query({queryFn:(e,t)=>(0,o.KU)(t).wp[(window.location.toString().includes("/blocks")?"block":"email")+"tags_list"]({per_page:100,...e}).then((e=>e))})})}),{useGetFoldersQuery:n,useGetTagsQuery:u,useLazyGetFoldersQuery:l,useAddFolderMutation:d,useEditFolderMutation:p}=s},83351:(e,t,a)=>{a.d(t,{OV:()=>s,UH:()=>u,uX:()=>n});var r=a(33298),o=a(14315),i=a(44141);const s=(0,r.xP)({reducerPath:"tokenApi",baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/jwt-auth/v1/"}),endpoints:e=>({tokenCreate:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).jwtAuth.token_create({body:e,type:o.cM.Json})}),tokenValidate:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).jwtAuth.token_validate_create({type:o.cM.Json})})})}),{useTokenCreateMutation:n,useTokenValidateMutation:u}=s},1779:(e,t,a)=>{a.d(t,{S:()=>i,p:()=>s});var r=a(33298),o=a(44141);const i=(0,r.xP)({reducerPath:"yandexAuthApi",baseQuery:(0,o.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/auth/v1/yandex/callback"}),endpoints:e=>({validateYandexToken:e.mutation({query:e=>({url:"",method:"POST",body:e})})})}),{useValidateYandexTokenMutation:s}=i}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[2627],{79381:(e,t,s)=>{s.d(t,{A:()=>se});var i=s(92810),r=s(64617),n=s(41919),a=s(95838),l=s(71157),o=s(98915),c=s(17590),d=s(21195),m=s(45934),u=s(38883),p=s.n(u),h=s(43005),_=s(24696),g=s(94822),v=s(23287),j=s(3824),x=s(75111),f=s(81325),y=s(74919),A=s(39475),b=s(8375),w=s(32293),N=s(9588),S=s(68631),k=s(84501),I=s(85025),C=s(94219),T=s(81577),E=s(64936),L=s(36404),z=s(86286),D=s(39990),O=s(32269),M=s(90070),R=s(85163),B=s(70082);const F=({isMenuCollapsed:e,setIsMenuCollapsed:t,isLocked:s})=>{var n;const{__:a}=(0,v.s9)();let l=(0,m.wA)(),o=(0,r.Zp)();const{projectId:c}=(0,r.g)(),{pathname:d}=(0,r.zy)(),[u,F]=(0,i.useState)(""),P=(0,m.d4)(L.yN),H=(0,m.d4)(z.C1),q=(0,M.p6)(),$=(0,i.useCallback)((()=>{d.includes("blocks")?F("Blocks"):d.includes("emails")?F("Emails"):d.includes("members")&&F("Members"),!s&&t(!0)}),[d,t,s]);(0,i.useEffect)((()=>{$()}),[$]);let W=[],V=[];const U=(null===P||void 0===P?void 0:P.title)||"";let X=[{label:(0,B.jsx)("a",{href:"https://emailmaker.ru/help/",target:"_blank",rel:"noopener noreferrer",children:a("Help")}),key:"Help center",icon:(0,B.jsx)(j.A,{style:{fontSize:"16px"}}),className:"help-center"},{label:a("Chat support"),key:"Support chat",icon:(0,B.jsx)(x.A,{style:{fontSize:"16px"}}),className:"open-support-chat",onClick:()=>{try{window.carrotquest.open()}catch(e){console.log(e)}}}],Y=[{label:a("Account settings"),key:"Account settings",icon:(0,B.jsx)(f.A,{style:{fontSize:"16px"}}),className:"em-analytics__account-settings",onClick:()=>{l((0,E.qf)(R.lx.EDIT_PROFILE_MODAL)),!s&&t(!0)}},{label:(0,B.jsx)(g.N_,{to:"/billing",children:a("Billing")}),key:"Billing",icon:(0,B.jsx)(y.A,{style:{fontSize:"16px"}}),className:"em-analytics__billing"},{label:a("Sign out"),icon:(0,B.jsx)(A.A,{style:{fontSize:"16px"}}),key:"Sign out",className:"em-analytics__sign-out",onClick:()=>{(0,O.Id)(q),l(D.Q2.util.resetApiState()),o("/auth",{replace:!0})}}];const J="/projects"+(c?"/"+c+"/emails?page=1":""),Z=[{label:(0,B.jsx)(g.N_,{style:{fontSize:16},to:J,children:U}),key:"Project",popupOffset:[0,16],style:{fontWeight:500},icon:c?(0,B.jsx)(g.N_,{to:J,className:"project-menu__block",style:{fontSize:"18px",zIndex:99},children:(0,B.jsx)(h.Ay,{type:"primary",className:"project-menu__block-button",children:null===U||void 0===U?void 0:U.split(" ").slice(0,2).map((e=>Array.from(e)[0]))})}):(0,B.jsxs)(g.N_,{to:J,rel:"noopener noreferrer",className:"project-menu__block",style:{fontSize:"28px"},children:[(0,B.jsxs)("b",{children:[(0,B.jsx)("span",{className:"letters",children:"E"}),(!e||s)&&(0,B.jsx)("span",{className:"hidden-text",children:"mail"})]}),(0,B.jsx)("span",{className:"letters",children:"M"}),(!e||s)&&(0,B.jsx)("span",{className:"hidden-text",children:"aker"})]}),className:p()("project-menu__list-item project-menu__list-item_project project-menu__list-item_project",{"project-menu__list-item_logo":!c,"project-menu__list-item_project":c}),children:c&&[{label:a("Project settings"),key:"Project settings",className:"em-analytics__account-settings",icon:(0,B.jsx)(b.A,{style:{fontSize:"16px"}}),onClick:()=>{l((0,E.qf)(R.lx.EDIT_PROJECT_MODAL)),!s&&t(!0)}},{label:(0,B.jsx)(g.N_,{to:"/projects",children:a("List of projects")}),key:"List of projects",icon:(0,B.jsx)(w.A,{style:{fontSize:"16px"}}),className:"em-analytics__sign-out"}]},{type:"divider"}];return W.push({icon:(0,B.jsx)(N.A,{style:{fontSize:20}}),label:(0,B.jsx)(g.N_,{to:`/projects/${c}/emails`,rel:"noopener noreferrer",children:a("Emails")}),key:"Emails",className:"project-menu__list-item em-analytics__project-menu-emails"},{icon:(0,B.jsx)(S.A,{style:{fontSize:20}}),label:(0,B.jsx)(g.N_,{to:`/projects/${c}/blocks`,rel:"noopener noreferrer",children:a("Blocks")}),key:"Blocks",className:"project-menu__list-item em-analytics__project-menu-blocks"},{icon:(0,B.jsx)(k.A,{style:{fontSize:20}}),label:(0,B.jsx)(g.N_,{to:`/projects/${c}/members`,rel:"noopener noreferrer",children:a("Members")}),key:"Members",className:"project-menu__list-item em-analytics__project-menu-members"}),"community"===H.subscription.post_name&&c&&H.counters.emails_counter>2&&V.push({icon:(0,B.jsx)(I.A,{style:{fontSize:20,lineHeight:"44px"}}),label:(0,B.jsx)(g.N_,{to:"/billing",rel:"noopener noreferrer",style:{fontSize:16,color:"white"},children:a("Upgrade")}),key:"Emails",className:"project-menu__list-item"}),V.push({icon:(0,B.jsx)(C.A,{style:{fontSize:18}}),label:a("Help menu"),key:"Help menu",className:"project-menu__list-item support-center-menu",children:X},{icon:(0,B.jsx)(T.A,{style:{fontSize:18}}),label:a("What's new"),key:"What's new",className:"project-menu__list-item ducalis-changelog-widget em-analytics__project-menu-ducalis"},{icon:(0,B.jsx)("span",{style:{width:"20px",height:"20px",fontSize:"20px"},className:"user-profile__avatar anticon",children:null!==H&&void 0!==H&&null!==(n=H.avatar_urls)&&void 0!==n&&n[24]?[(0,B.jsx)("img",{style:{width:"100%"},src:null===H||void 0===H?void 0:H.avatar_urls[24],alt:null!==H&&void 0!==H&&H.name?`${null===H||void 0===H?void 0:H.name} avatar`:"User avatar",className:"user-profile__avatar-img"},"img"),(0,B.jsx)(f.A,{style:{position:"absolute",fontSize:20,borderRadius:100,overflow:"hidden",height:20,width:20,lineHeight:0,zIndex:-1}},"UserOutlined")]:(0,B.jsx)(f.A,{style:{color:"white"}})}),label:(null===H||void 0===H?void 0:H.name)||null,key:"User profile",className:"project-menu__list-item user-profile",children:Y}),(0,B.jsx)(B.Fragment,{children:(0,B.jsxs)("div",{className:"project-menu",children:[(0,B.jsxs)("div",{children:[(0,B.jsx)(_.A,{disabledOverflow:!0,className:"project-menu__list project-menu__list_top",style:{fontSize:16},items:Z,triggerSubMenuAction:"hover",subMenuOpenDelay:.3,subMenuCloseDelay:.6,selectable:!1}),c&&(0,B.jsx)(_.A,{disabledOverflow:!0,selectable:!0,selectedKeys:[u],className:"project-menu__list project-menu__list_second",style:{fontSize:16,marginTop:30},items:W,triggerSubMenuAction:"hover"})]}),(0,B.jsx)(_.A,{disabledOverflow:!0,selectable:!0,selectedKeys:["Emails"],forceSubMenuRender:"true",className:"project-menu__list project-menu__list_bottom",style:{fontSize:14,marginBottom:6},subMenuOpenDelay:.3,subMenuCloseDelay:.6,items:V,triggerSubMenuAction:"hover"})]})})};var P=s(35285),H=s(65052),q=s(70656),$=s(62689),W=s(65983),V=s(7760),U=s(19366),X=s(3289),Y=s(78451),J=s(32411),Z=s(69156),K=s(13329),G=s(56991),Q=s(28316);const{Sider:ee}=n.A,{useToken:te}=a.A,se=()=>{const{token:e}=te();let t=(0,r.zy)();const s=(0,m.wA)(),a=(0,r.Zp)(),{emailId:u,blockId:h}=(0,r.g)(),_=(0,m.d4)(z.C1),g=(0,m.d4)(E.cL),v=(0,i.useRef)(),[j]=(0,$.bw)(),x=(0,l.hN)();v.current||(v.current=(0,J.$Z)()),(0,i.useEffect)((()=>{(0,Z.FN)(e)}),[e]);const{data:f=[],isSuccess:y}=(0,$.I9)(_.id,{pollingInterval:3e4,skip:g});(0,i.useEffect)((()=>{const e=f.filter((e=>""===e.seen||null===e.seen));setTimeout((()=>{e.length&&y&&e.forEach((e=>{x[e.type]({message:(0,B.jsx)("div",{dangerouslySetInnerHTML:{__html:e.title}}),description:(0,B.jsx)("div",{dangerouslySetInnerHTML:{__html:e.content}}),placement:"bottomRight"});const t=(new Date).toLocaleString();j({id:e.id,datetime:t}).unwrap()}))}),5e3)}),[y,j,f,x]),(0,U.A)(),(0,X.A)(),(0,Y.A)(),(0,i.useEffect)((()=>{h||s((0,V.nJ)()),u||s((0,W.ss)())}),[h,u,s,t.pathname]);let A=null;(u||h||t.pathname.endsWith("/new"))&&(A=v.current);const b=JSON.parse(localStorage.getItem(R.V0.em_menu_is_locked)),[w,N]=(0,i.useState)((null===b||void 0===b?void 0:b.isLocked)||!1),[S,k]=(0,i.useState)(!0);return(0,i.useEffect)((()=>{const e=()=>localStorage.setItem(R.V0.em_menu_is_locked,JSON.stringify({isLocked:w}));return e(),e()}),[w]),(0,K.D3)(Q._1,(0,i.useCallback)((e=>{const t=(0,G.Mu)(e);a(t)}),[a])),(0,B.jsx)("div",{className:"main",children:(0,B.jsx)(J.kx.Provider,{value:A,children:(0,B.jsx)("div",{className:"main__pane main__pane_main",children:(0,B.jsx)("div",{className:"main__pane-content",id:"pane-content-iframe",children:(0,B.jsxs)(n.A,{className:"main__pane-layout",hasSider:!0,children:[!R.EW.isPlugin&&(0,B.jsx)(ee,{theme:"light",style:{borderColor:e.colorBorder,position:"fixed"},collapsible:!0,collapsed:!w&&S,defaultCollapsed:!0,reverseArrow:!w&&!S||w&&!S,trigger:(0,B.jsxs)("div",{className:"main__pane-trigger",children:[w?(0,B.jsx)(d.A,{style:{fontSize:18}}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(o.A,{style:{fontSize:18}}),(0,B.jsx)(c.A,{style:{fontSize:18}})]}),(0,B.jsx)(q.A,{})]}),className:p()("main__menu",{main__menu_lock:w}),width:260,onCollapse:(e,t)=>{e?!w&&k(!0):k(!e),N(!w)},onMouseEnter:()=>!w&&k(!1),onMouseLeave:()=>!w&&k(!0),children:(0,B.jsx)(F,{isMenuCollapsed:S,setIsMenuCollapsed:k,isLocked:w})}),(0,B.jsx)(P.A,{isModalVisible:g===R.lx.EDIT_PROJECT_MODAL}),(0,B.jsx)(H.A,{isModalVisible:g===R.lx.EDIT_PROFILE_MODAL}),(0,B.jsx)(r.sv,{})]})})})})})}},24495:(e,t,s)=>{s.d(t,{A:()=>E});var i=s(92810),r=s(76662),n=s(41919),a=s(43005),l=s(71157),o=s(20258),c=s(64617),d=s(12280),m=s(55039),u=s(45934),p=s(23287),h=s(4800),_=s(21349),g=s(8114),v=s(85163);const j=(e,t,s,i,r,n)=>{var a,l;const o=n("Owner","member"),c=n("Administrator","member"),d=r("The invitation has been sent");let m=[];e.role===d?m.push({label:r("Revoke the invite"),key:v.JE,className:"em-analytics__revoke-invite",onClick:({key:t})=>i(t,e)}):(e.role!==o&&m.push({label:r("Assign the project owner"),key:v.gY,className:"em-analytics__members-owner",onClick:({key:t})=>i(t,e)}),e.role!==c&&m.push({label:r("Change role to Administrator"),key:v.Qz,className:"em-analytics__members-admin",onClick:({key:t})=>i(t,e)}),e.role===c&&m.push({label:r("Change role to User"),key:v.aO,className:"em-analytics__members-user",onClick:({key:t})=>i(t,e)}),m.push({label:r("Remove member"),key:v.eA,onClick:({key:t})=>i(t,e)}));let u=[];(null===(a=e.ID)||void 0===a?void 0:a.toString())===(null===(l=s.id)||void 0===l?void 0:l.toString())&&u.push({label:r("Change role to User"),key:v.aO,className:"em-analytics__members-user",onClick:({key:t})=>i(t,e)}),e.role===v.m3&&u.push({label:r("Change role to Administrator"),key:v.Qz,className:"em-analytics__members-admin",onClick:({key:t})=>i(t,e)}),e.role===v.G$?u.push({label:r("Revoke the invite"),key:v.JE,className:"em-analytics__revoke-invite",onClick:({key:t})=>i(t,e)}):u.push({label:r("Remove member"),key:v.eA,className:"em-analytics__members-remove",onClick:({key:t})=>{i(t,e)}});let p=[{label:r("Remove member"),key:v.eA,className:"em-analytics__members-remove",onClick:({key:t})=>i(t,e)}];switch(t){case v.yo:return m;case v.St:return u;case v.m3:return p;default:return null}};j.propTypes={};const x=j;var f=s(86286),y=s(84568),A=s(31844),b=s(32269),w=s(70082);const N=()=>{const{__:e,_x:t}=(0,p.s9)(),s=(0,u.d4)(f.C1),{owner:r,admin:n}=(0,A.A)();let a=(0,c.Zp)();const o=(0,l.hN)(),[d,m]=(0,i.useState)(""),j=t("Owner","member"),N=t("Administrator","member"),S=e("user"),k=e("The invitation has been sent");(0,i.useEffect)((()=>{r||n||m(v.m3),r&&m(v.yo),n&&m(v.St)}),[r,n,s]);const{data:I,isFetching:C,refetch:T}=(0,c.KC)(),[E,L]=(0,i.useState)([]);(0,i.useEffect)((()=>{const{owner:s,admins:i,users:r,invited_users:n}=I.members||{};L([s&&{...s,role:t("Owner","member")},i&&Array.isArray(i)&&i.map((e=>({...e,role:t("Administrator","member")}))),r&&Array.isArray(r)&&r.map((t=>({...t,role:e("user")}))),n&&Array.isArray(n)&&n.filter((e=>null===e||void 0===e?void 0:e.invited_user_email)).map((t=>({role:e("The invitation has been sent"),user_email:t.invited_user_email,user_firstname:" ",user_lastname:" "})))].filter((e=>e)).flat(1))}),[I.members,e,t]);const[z,D]=(0,y.OD)(),O=(i,{role:r,...n})=>{var l,c;let d,m;switch(i){case v.gY:if(r===N){const e=I.members.admins,t=I.members.owner;d={members:{admins:e&&Array.isArray(e)&&e.length>0?[...e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)),t.ID]:0,owner:n.ID}}}if(r===S){const e=I.members.users,t=I.members.owner;d={members:{users:e&&Array.isArray(e)&&e.length>0?[...e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)),t.ID]:0,owner:n.ID}}}m=e("You changed the role of ")+n.display_name+t(" to ","member")+e("owner")+".";break;case v.Qz:if(r===S){const s=I.members.users,i=I.members.admins;d={members:{users:s&&Array.isArray(s)&&s.length>1?s.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0,admins:i&&Array.isArray(i)&&i.length>0?[...i.map((e=>e.ID)),n.ID]:[n.ID]}},m=e("You changed the role of ")+n.display_name+t(" to ","member")+e("Administrator")+"."}break;case v.aO:if(r===N){const s=I.members.admins,i=I.members.users;d={members:{admins:s&&Array.isArray(s)&&s.length>1?s.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0,users:i&&Array.isArray(i)&&i.length>0?[...i.map((e=>e.ID)),n.ID]:[n.ID]}},m=e("You changed the role of ")+n.display_name+t(" to ","member")+e("user")+"."}break;case v.eA:if(r===N){const e=I.members.admins;d={members:{admins:e&&Array.isArray(e)&&e.length>1?e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0}}}if(r===S){const e=I.members.users;d={members:{users:e&&Array.isArray(e)&&e.length>1?e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0}}}m=(null===(l=s.id)||void 0===l?void 0:l.toString())===(null===(c=n.ID)||void 0===c?void 0:c.toString())?e("You deleted yourself from the project successfully."):e("You deleted ")+n.display_name+" "+e(" from the project successfully.");break;case v.JE:const i=I.members.invited_users;d={members:{invited_users:!!(i&&Array.isArray(i)&&i.length>0)&&i.filter((e=>e.invited_user_email&&e.invited_user_email!==n.user_email))}},m=e("You revoke invite for ")+n.user_email+" "+e(" from the project successfully.");break;default:return}z({projectId:I.id,...d}).then((e=>{var t,i;if(e.error)return(null===(t=s.id)||void 0===t?void 0:t.toString())===(null===(i=n.ID)||void 0===i?void 0:i.toString())?((0,b.wB)(m,o),void a("/projects")):void(0,b.p6)(e,o);T(),(0,b.wB)(m,o)}))},M=[{width:"25%",title:e("Email"),dataIndex:["user_email"]},{width:"25%",title:e("Name"),dataIndex:["user_firstname"],render:(e,{user_lastname:t})=>(0,w.jsx)(w.Fragment,{children:e||t?`${e} ${t}`:"-"})},{width:"25%",title:e("Role"),dataIndex:["role"],render:(e,t,s)=>e},{width:"3%",title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(i,a)=>{const l=x(a,d,s,O,e,t);return a.role===j||!r&&!n&&a.role===N||n&&a.role===N&&s.id!==a.ID||!r&&!n&&a.role===S&&s.id!==a.ID||!r&&!n&&a.role===k?null:(0,w.jsx)(h.A,{arrow:"true",placement:"bottomRight",menu:{items:l},trigger:["hover"],children:(0,w.jsx)("span",{className:"members-table__actions",children:(0,w.jsx)(g.A,{})})})}}];return(0,w.jsx)("div",{children:(0,w.jsx)(_.A,{bordered:!0,className:"members-table",rowClassName:e=>e.role===k?"members-table__invite_member_row":"",rowKey:e=>`${e.role}_${e.ID||e.user_email}`,dataSource:E,columns:M,loading:D.isLoading||C,showSizeChanger:!1,pagination:{showSizeChanger:!1,hideOnSinglePage:!0,position:["bottomLeft"]}})})};var S=s(20757),k=s(53200),I=s(22197);const{Paragraph:C}=r.A,{Content:T}=n.A,E=()=>{const{__:e}=(0,p.s9)(),t=(0,u.wA)(),{owner:s,admin:r}=(0,A.A)(),[h]=d.A.useForm(),_=(0,l.hN)(),[g,v]=(0,k.N)(),{data:j,refetch:x}=(0,c.KC)();(0,I.A)(e("Members")),(0,i.useEffect)((()=>{document.body.classList.remove("editor")}));const f=(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(C,{className:"ant-page-header-heading-title",children:e("Members")})}),E=(0,w.jsx)(w.Fragment,{children:s||r?[(0,w.jsxs)(d.A,{form:h,name:"search-members-form",initialValues:{remember:!0},onFinish:({email:e})=>{g({email:e,project_id:j.id}).then((e=>{var s,i,r;e.isError?(0,b.p6)(e,_):(null===(s=e.data)||void 0===s||null===(i=s.data)||void 0===i?void 0:i.status)<400?(h.resetFields(),x(),(0,b.wB)(null===e||void 0===e||null===(r=e.data)||void 0===r?void 0:r.message,_),t(y.Nq.util.invalidateTags([{type:"Projects",id:j.id}]))):_.error({message:(0,w.jsx)("div",{dangerouslySetInnerHTML:{__html:e.data.code}}),description:(0,w.jsx)("div",{dangerouslySetInnerHTML:{__html:e.data.message}}),placement:"bottomRight"})}))},autoComplete:"off",layout:"inline",validateTrigger:"onSubmit",onValuesChange:()=>{h.setFields([{errors:[],name:["email"]}])},className:"members-page__search-form",children:[(0,w.jsx)(d.A.Item,{className:"members-page__search-form-item members-page__search-form-item_input-item",name:"email",rules:[{required:!0,message:e("Please enter the correct email address."),type:"email"}],children:(0,w.jsx)(m.A,{placeholder:e("Email of a new member"),disabled:v.isLoading})}),(0,w.jsx)(d.A.Item,{className:"members-page__search-form-item",children:(0,w.jsx)(a.Ay,{type:"primary",className:"em-analytics__members-add",htmlType:"submit",disabled:v.isLoading,icon:(0,w.jsx)(o.A,{}),children:e("Add a member")})})]},"search-members-form")]:[]});return(0,w.jsxs)(n.A,{className:"members-page",children:[(0,w.jsx)(S.A,{leftBlock:f,rightBlock:E}),(0,w.jsx)(T,{className:"members-page__container",children:(0,w.jsx)("div",{className:"members-page__content container",children:(0,w.jsx)(N,{})})})]})}},40836:(e,t,s)=>{s.d(t,{A:()=>f});var i=s(92810),r=s(71503),n=s(45934),a=s(887),l=s(45695),o=s(44396),c=s(86286),d=s(65983),m=s(7760),u=s(53204),p=s(64037),h=s(71070),_=s(85163),g=s(58075),v=s(32411),j=s(56991),x=s(70082);r.wG.config({monaco:h}),(0,o.Q)(),(0,g.Gr)(h),(0,g.Wz)(h,["html"]);const f=({email:e,readOnly:t})=>{const s=(0,v.fn)(),o=(0,l.XW)(),g=(0,n.d4)(d.Up),f=(0,n.d4)(m.Up),y=(0,n.d4)(d.VZ),A=null!==e&&void 0!==e&&e.hasOwnProperty("type")?f:g,b=(0,n.d4)(c.hZ),w=(0,n.wA)(),N=(0,i.useRef)(null),S=(0,i.useRef)(null),k=(0,j.rD)(),I=(0,i.useCallback)((()=>{w((0,c.ku)(!1))}),[w]);(0,i.useEffect)((()=>I()),[I]),(0,i.useEffect)((()=>{if(y){const{current:e}=N;e&&(e.revealRangeInCenterIfOutsideViewport(y),e.setSelection(y))}}),[y]);(0,i.useEffect)((()=>{N.current&&N.current.updateOptions(b)}),[b,N]),(0,i.useEffect)((()=>{matchMedia(_.F3).addEventListener("change",(t=>{const s=window.localStorage.getItem(_.V0.em_color_scheme),i=t.matches?_.nd:_.T;e.hasOwnProperty("type")?w(s?(0,m.eX)(s===_.nd?`vs-${s}`:_.T):(0,m.eX)(i===_.nd?`vs-${i}`:_.T)):w(s?(0,d.eX)(s===_.nd?`vs-${s}`:_.T):(0,d.eX)(i===_.nd?`vs-${i}`:_.T))}))}),[w,e]),(0,i.useEffect)((()=>{const t=window.localStorage.getItem(_.V0.em_color_scheme),s=matchMedia(_.F3).matches?_.nd:_.T;null!==e&&void 0!==e&&e.hasOwnProperty("type")?w(t?(0,m.eX)(t===_.nd?`vs-${t}`:_.T):(0,m.eX)(s===_.nd?`vs-${s}`:_.T)):w(t?(0,d.eX)(t===_.nd?`vs-${t}`:_.T):(0,d.eX)(s===_.nd?`vs-${s}`:_.T))}),[w,e]);(0,p.A)((e=>{const t=e.data.operation,s=e.data;S.current=t,t===_.Ru.UPDATE_EDITOR_POSITION_FROM_IFRAME&&(e=>{const{current:t}=N;if(t&&!t.hasTextFocus()){const s=t.getModel(),i=s.getPositionAt(e.start),r=s.getPositionAt(e.end),n={startColumn:i.column,startLineNumber:i.lineNumber,endColumn:r.column,endLineNumber:r.lineNumber};t.revealRangeInCenterIfOutsideViewport(n),t.setSelection(n)}})(s.data)}));const C=(0,i.useMemo)((()=>({...b,domReadOnly:t,readOnly:t,unusualLineTerminators:"off",mouseWheelZoom:!0,wordWrap:k.onlyCodeModeInMobile?"off":b.wordWrap})),[b,k.onlyCodeModeInMobile,t]);return(null===s||void 0===s?void 0:s.uri)&&(0,x.jsx)(r.Ay,{theme:A,className:"monaco-editor",defaultLanguage:"html",onMount:(e,t)=>{N.current=e;const s=e.getContribution("editor.linkDetector").openerService,i=s.open.bind(s),r=document.createElement("div");new a.Ay(e,h,{"doctype-html5":!1,"html-lang-require":!1,"head-script-disabled":!1,"style-disabled":!1,"script-disabled":!1,"attr-lowercase":!1,"attr-value-single-quotes":!1,"attr-value-not-empty":!1,"attr-sorted":!1,"attr-whitespace":!1,"input-requires-label":!1,"tag-self-close":!1,"tagname-lowercase":!1,"href-abs-or-rel":!1,"inline-style-disabled":!1,"space-tab-mixed-disabled":!1,"attr-no-unnecessary-whitespace":!0,"tags-check":{img:{selfclosing:!1,attrsRequired:["src","alt"]},a:{selfclosing:!1,attrsRequired:["href"]}},"empty-tag-not-self-closed":!1,"attr-value-double-quotes":!0,"doctype-first":!0,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0,"title-require":!0,"alt-require":!0,"inline-script-disabled":!0,"id-class-value":!1,"id-class-ad-disabled":!0,"attr-unsafe-chars":!0,csslint:{"display-property-grouping":!0,"known-properties":!0}}).watch(),e.getContribution("editor.linkDetector").openerService.open=e=>(r.innerHTML=e,i(r.textContent)),w((0,c.ku)(!0)),e.onMouseUp((()=>{const t=e.getSelection();t.startColumn===t.endColumn&&t.startLineNumber===t.endLineNumber&&(async e=>{const{current:t}=N;if(t){const s=t.getModel();o({operation:_.Ru.UPDATE_EDITOR_POSITION_FROM_EDITOR,data:s.getOffsetAt(e)})}})(e.getPosition())})),e.onDidBlurEditorWidget((()=>{o({operation:_.Ru.EDITOR_CHANGE_FOCUS,data:!1}),w((0,u.YT)(!1))})),e.onDidFocusEditorWidget((()=>{o({operation:_.Ru.EDITOR_CHANGE_FOCUS,data:!0}),w((0,u.YT)(!0))}))},options:C,keepCurrentModel:!0,path:s.uri.toString(),onValidate:function(e){var t;"Doctype must be declared first."!==(null===(t=e[0])||void 0===t?void 0:t.message)&&w((0,d.Bj)(e))}})}},21999:(e,t,s)=>{s.d(t,{A:()=>n});s(92810);var i=s(64617),r=s(70082);const n=({lastProjectId:e})=>{const{pathname:t,search:s}=(0,i.zy)();return!1===e?(0,r.jsx)(i.C5,{to:"/projects"}):e&&(0,r.jsx)(i.C5,{to:`/projects/${e+t+s}`})}},32983:(e,t,s)=>{s.d(t,{A:()=>n});s(92810);var i=s(64617),r=s(70082);const n=({to:e})=>(0,r.jsx)(i.C5,{to:e})},24239:(e,t,s)=>{s.d(t,{A:()=>m});s(92810);var i=s(41919),r=s(25072),n=s(43005),a=s(64617),l=s(23287),o=s(32269),c=s(70082);const{Content:d}=i.A,m=()=>{const{__:e}=(0,l.s9)();let t=(0,a.Zp)();return(0,c.jsx)(i.A,{children:(0,c.jsx)(d,{className:"container",children:(0,c.jsx)(r.Ay,{status:"500",title:"404",subTitle:e("Sorry, the page you visited does not exist."),extra:(0,c.jsx)(n.Ay,{type:"primary",onClick:()=>(0,o.XZ)(t,"/projects"),children:e("Back Home")})})})})}},26201:(e,t,s)=>{s.d(t,{A:()=>X});var i=s(92810),r=s(45934),n=s(64617),a=s(94822),l=s(76662),o=s(81e3),c=s(66522),d=s(43005),m=s(71086),u=s(2018),p=s(7744),h=s(29234),_=s(57806),g=s(67661),v=s(66726),j=s(31022),x=s(3329),f=s(13932),y=s(69825),A=s(58133),b=s(38883),w=s.n(b),N=s(88528),S=s(65983),k=s(84568),I=s(32269),C=s(71157),T=s(45695),E=s(23287),L=s(32411),z=s(85163),D=s(70082);const{Text:O,Link:M,Title:R}=l.A,B="Links",F="Images",P="Spam assassin",H="Problems",q="valid",$="warnings",W="errors",V=[q,W,$],U=({summary:e,__:t,selectedTags:s,setSelectedTags:i})=>(0,D.jsx)(R,{level:5,style:{margin:0,fontSize:"14px"},children:(0,D.jsx)(o.A,{style:{flexWrap:"wrap"},gap:"6",children:V.map(((r,n)=>(0,D.jsxs)(c.A.CheckableTag,{checked:null===s||void 0===s?void 0:s.includes(r),onChange:e=>((e,t)=>{const r=t?2===s.length?[]:[...s,e]:s.filter((t=>t!==e));i(r)})(r,e),className:w()(`${r} optimise__button`,{[`${r}_active`]:s.includes(r)}),children:[t(r===q?"Valid":r===$?"Warnings":"Errors"),":"," ",(null===e||void 0===e?void 0:e[r])||0]},r+n)))})}),X=()=>{var e,t,s,l,o;const{__:c,_n:b}=(0,E.s9)(),V=(0,r.wA)(),{emailId:X,projectId:Y}=(0,n.g)(),J=(0,C.hN)(),Z=(0,T.QC)(),K=(0,L.fn)(),G=(0,r.d4)(S.rd),[Q,ee]=(0,N.ku)(),[te,se]=(0,N.Ju)(),[ie,re]=(0,N.Sr)(),{data:ne,isSuccess:ae,refetch:le}=(0,k.fo)(+Y,{skip:!!z.EW.isPlugin||!+Y}),{limits:oe}=ne&&!z.EW.isPlugin?ne:{limits:{optimization_limit:0}},{optimization_limit:ce}=oe,de=ce>0,[me,ue]=(0,i.useState)([]),[pe,he]=(0,i.useState)([]),[_e,ge]=(0,i.useState)([]),[ve,je]=(0,i.useState)([]),[xe,fe]=(0,i.useState)([]),[ye,Ae]=(0,i.useState)([]),[be,we]=(0,i.useState)(),[Ne,Se]=(0,i.useState)(0);(0,i.useEffect)((()=>{var e;ae&&(null===ne||void 0===ne||null===(e=ne.counters)||void 0===e?void 0:e.optimization_counter)&&Se(ne.counters.optimization_counter)}),[ae,ne]),(0,i.useEffect)((()=>{var e,t;be===B&&me.links&&fe(ve.length>0?null===(e=me.links)||void 0===e?void 0:e.filter((e=>ve.includes(e.status))):me.links);be===F&&pe.images&&Ae(ve.length>0?null===(t=pe.images)||void 0===t?void 0:t.filter((e=>ve.includes(e.status))):pe.images)}),[me.links,pe.images,ve,be]);const ke=()=>{if(!X)return void J.error({message:(0,D.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});let e;const t=K.getValue(),s=(new DOMParser).parseFromString(t,"text/html"),i={},r={};s.querySelectorAll("a[href]").forEach(((e,t)=>{i[`link_${t}`]=e.getAttribute("href"),r[`link_${t}`]=e.innerText})),Z.send({operation:"sandbox_set_attr_to_links"}),Q({entity_id:X,data:i}).then((({data:t,error:s})=>{if(s)(0,I.p6)({error:s},J);else if(null!==t&&void 0!==t&&t.result){let s=[...t.result];null===s||void 0===s||s.sort(((e,t)=>e.linkId-t.linkId));const i=e=>{var t,s,i,r;return(null!==e.statusCode?e.statusCode<300&&(null===(t=null===(s=e.page)||void 0===s?void 0:s.secure)||void 0===t||t):"invalid"!==e.type)?q:(e.statusCode&&e.statusCode<400||200===e.statusCode&&(null===(i=null===(r=e.page)||void 0===r?void 0:r.secure)||void 0===i||i))&&"invalid"!==e.type?$:W};e={links:s.map((e=>({...e,text:r[e.linkId],status:i(e)}))),summary:{valid:s.filter((e=>i(e)===q)).length||0,warnings:s.filter((e=>i(e)===$)).length||0,errors:s.filter((e=>i(e)===W)).length||0}},ue(e),(0,I.wB)(c("Links validation was successfully completed"),J),!z.EW.isPlugin&&le()}else t.statusCode>300||!t.success?(0,I.p6)({error:{data:t}},J):J.error({message:(0,D.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),!me.links&&Te("")})).catch((e=>{(0,I.p6)({error:e},J)}))},Ie=()=>{if(!X)return void J.error({message:(0,D.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});const e=K.getValue(),t=(new DOMParser).parseFromString(e,"text/html");let s={};t.querySelectorAll("img").forEach(((e,t)=>s[`image_${t}`]=e.src)),Z.send({operation:"sandbox_set_attr_to_images"}),te({entity_id:X,data:s}).then((({data:e,error:t})=>{let s;if(t)(0,I.p6)({error:t},J);else if(null!==e&&void 0!==e&&e.result){let t=Object.values(e.result);t.sort(((e,t)=>e.imageId-t.imageId));let i=t.reduce(((e,t)=>e+Math.round(t.image.bytes/1024)),0);const r=e=>null!==e.statusCode&&e.statusCode<300?q:e.statusCode<400&&e.statusCode>=300||200===e.statusCode&&!e.valid?$:W;s={images:t.map((e=>({...e,status:r(e)})))||[],summary:{valid:t.filter((e=>r(e)===q)).length||0,warnings:t.filter((e=>r(e)===$)).length||0,errors:t.filter((e=>r(e)===W)).length||0},summaryTime:{value:(i>1200?i/1e3:i).toFixed(1),name:c(i>1200?"MB":"KB")}},s&&he(s),(0,I.wB)(c("Images validation was successfully completed"),J),!z.EW.isPlugin&&le()}else{var i;e.statusCode>300||!e.success?(0,I.p6)({error:{data:e}},J):J.error({message:(0,D.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),(null===pe||void 0===pe||null===(i=pe.images)||void 0===i||!i.length)&&Te("")}})).catch((e=>{(0,I.p6)({error:e},J)}))},Ce=()=>{X?ie({entity_id:X,data:{html:K.getValue()}}).then((({data:e,error:t})=>{if(t)(0,I.p6)({error:t},J);else if(e&&e.success){const t=!!e.result.report&&Object.values(e.result.report);t&&(t.sort(((e,t)=>e.score-t.score)),ge({...e.result,report:t})),(0,I.wB)(c("Spam validation was successfully completed"),J),!z.EW.isPlugin&&le()}else e.statusCode>300||!e.success?(0,I.p6)({error:{data:e}},J):J.error({message:(0,D.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430."}}),placement:"bottomRight"}),(null===_e||void 0===_e||!_e.length)&&Te("")})).catch((e=>{(0,I.p6)({error:e},J)})):J.error({message:(0,D.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"})},Te=e=>{we(e!==be?e:""),je([])};let Ee=null;return(0,i.useEffect)((()=>{de&&Ne>=+ce&&J.error({message:c("The usage limit has been exceeded"),description:c("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"})}),[Ne,ce,c,J,de]),(0,D.jsxs)("div",{className:"optimise selected_form-props-wrapper selected_form-props-wrapper_optimize",children:[(0,D.jsxs)("div",{className:"optimise__couter-wrapper",children:[!z.EW.isPlugin&&(0,D.jsx)(d.Ay,{className:w()("optimise__counter-bar",{"optimise__counter-bar_full":de&&Ne>=+ce}),size:"small",children:Ne+" "+c("of")+" "+(de?ce:"\u221e")+" "+b("test","tests",ce)+c(" were used")}),de&&(0,D.jsx)(a.N_,{style:{fontSize:14,textDecoration:"underline"},to:"/billing",children:c("Need more?")})]}),(0,D.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,D.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,D.jsx)(p.A,{span:20,children:(0,D.jsx)("div",{className:"form-group-title",children:c("Links validation")})}),(0,D.jsx)(p.A,{span:4,align:"right",children:(0,D.jsx)(d.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;Te(B),null!==me&&void 0!==me&&null!==(e=me.links)&&void 0!==e&&e.length||be===B||ke()},loading:ee.isLoading,children:!ee.isLoading&&(be===B?(0,D.jsx)(j.A,{}):(0,D.jsx)(x.A,{}))})})]}),be===B&&!(null===me||void 0===me||!me.links)&&(0===(null===me||void 0===me||null===(e=me.links)||void 0===e?void 0:e.length)?(0,D.jsx)(u.A,{style:{marginBottom:24},children:(0,D.jsx)(h.A,{message:c("No links found."),type:"info"})}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(u.A,{style:{marginBottom:14},children:(0,D.jsxs)("div",{className:"optimise__title-wrapper",children:[(0,D.jsx)(U,{__:c,summary:me.summary,setSelectedTags:je,selectedTags:ve}),(0,D.jsx)(d.Ay,{loading:ee.isLoading,onClick:ke,icon:(0,D.jsx)(f.A,{}),children:c("Refresh")})]})}),(0,D.jsx)(u.A,{style:{marginBottom:24},children:(0,D.jsx)(p.A,{span:24,children:(0,D.jsx)(_.A,{itemLayout:"horizontal",dataSource:xe,renderItem:(e,t)=>{var s;return(0,D.jsx)(_.A.Item,{style:{border:"none"},children:(0,D.jsx)(_.A.Item.Meta,{avatar:e.status===q?(0,D.jsx)(y.A,{className:q}):e.status===$?(0,D.jsx)(y.A,{className:$}):(0,D.jsx)(A.A,{className:W}),title:(0,D.jsx)(M,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.linkId,s=600>e.statusCode>399||!e.statusCode,void Z.send({operation:z.Ru.SANDBOX_SET_POSITION_TO_LINK,settings:{elementId:t,isError:s}});var t,s},children:""===e.url?c("empty link"):e.url}),description:(0,D.jsxs)(D.Fragment,{children:[!(null===(s=e.text)||void 0===s||!s.length)&&(0,D.jsx)(D.Fragment,{children:(0,D.jsx)(O,{type:"secondary",children:e.text})}),e.page.title&&e.page.title,e.page.secure&&e.status===q&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("span",{className:"image-size-splitter",children:"\xa0\u2022\xa0"}),(0,D.jsx)("span",{className:q,children:c("secure")})]}),!e.resolvedUrl&&!e.statusCode&&"url"===e.type&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("span",{className:"image-size-splitter",children:"\xa0\u2022\xa0"}),(0,D.jsx)(O,{type:"secondary",children:c("Failed to load")})]})]})})},t+"_"+e.id)}})})})]})),(0,D.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,D.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,D.jsx)(p.A,{span:20,children:(0,D.jsx)("div",{className:"form-group-title",children:c("Images validation")})}),(0,D.jsx)(p.A,{span:4,align:"right",children:(0,D.jsx)(d.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;Te(F),null!==pe&&void 0!==pe&&null!==(e=pe.images)&&void 0!==e&&e.length||be===F||Ie()},loading:se.isLoading,children:!se.isLoading&&(be===F?(0,D.jsx)(j.A,{}):(0,D.jsx)(x.A,{}))})})]}),be===F&&!(null===pe||void 0===pe||!pe.images)&&(0===(null===pe||void 0===pe||null===(t=pe.images)||void 0===t?void 0:t.length)?(0,D.jsx)(u.A,{style:{marginBottom:24},children:(0,D.jsx)(h.A,{message:c("No images found."),type:"info"})}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(u.A,{style:{marginBottom:16},children:(0,D.jsx)(h.A,{style:{padding:14,paddingBottom:10,width:"100%"},message:(0,D.jsxs)("div",{className:"optimise__summary",children:[(0,D.jsxs)("div",{children:[(0,D.jsxs)(R,{level:4,style:{marginBottom:"0"},children:[pe.images.length," "]}),(0,D.jsx)("span",{style:{fontSize:"12px"},children:c("images")})]}),(0,D.jsxs)("div",{children:[(0,D.jsxs)(R,{level:4,style:{marginBottom:"0"},children:[null===(s=pe.summaryTime)||void 0===s?void 0:s.value,null===(l=pe.summaryTime)||void 0===l?void 0:l.name]}),(0,D.jsx)("span",{style:{fontSize:"12px"},children:c("total size")})]}),(0,D.jsxs)("div",{children:[(0,D.jsx)(R,{level:4,style:{marginBottom:"0"},children:(Math.max(...pe.images.map((e=>e.image.responseTime)))/1e3).toFixed(2)+c("s")}),(0,D.jsx)("span",{style:{fontSize:"12px"},children:c("time to load")})]})]}),type:"warning"})}),(0,D.jsx)(u.A,{style:{marginBottom:12},children:(0,D.jsxs)("div",{className:"optimise__title-wrapper",children:[(0,D.jsx)(U,{__:c,summary:pe.summary,setSelectedTags:je,selectedTags:ve}),(0,D.jsx)(d.Ay,{loading:se.isLoading,onClick:()=>Ie(),icon:(0,D.jsx)(f.A,{}),children:c("Refresh")})]})}),(0,D.jsx)(u.A,{style:{marginBottom:12},children:(0,D.jsx)(p.A,{span:24,children:(0,D.jsx)(_.A,{className:"optimise__result-list",itemLayout:"horizontal",dataSource:ye,renderItem:(e,t)=>(0,D.jsx)(_.A.Item,{className:"optimise__image-item image-item",style:{border:"none"},children:(0,D.jsx)(_.A.Item.Meta,{className:w()("image-item__meta",{"image-item__meta_fail":!e.resolvedUrl&&!e.statusCode}),avatar:(0,D.jsx)(g.A,{className:w()("image-item__image",{"image-item__image_fail":!e.resolvedUrl||!e.valid}),width:92,height:"auto",style:{height:"auto"},src:e.resolvedUrl||"",preview:!1,onMouseEnter:()=>{var t;return((e,t)=>{clearTimeout(Ee);let s=document.querySelector(".img-preview")?document.querySelector(".img-preview"):null,i=document.querySelector(".img-preview-content")?document.querySelector(".img-preview-content"):null;document.querySelector(".img-preview")||(s=document.createElement("div"),s.classList.add("img-preview"),i=document.createElement("div"),i.classList.add("img-preview-content"),s.append(i),document.querySelector(".email-pane__col_settings-inner").append(s)),i.innerHTML=`<table cellspacing="0" cellpadding="0" border="0" width="100%"><img height="auto" width=${t+"px"} alt="" style="max-width: 100%; object-fit: contain" src=${e}></table>`,"1"!==s.style.opacity&&setTimeout((function(){s.style.opacity="1",s.style.transform="translateX(-100%)"}),10)})(e.url,null===(t=e.image.dimensions)||void 0===t?void 0:t.width)},onMouseLeave:()=>(()=>{let e=document.querySelector(".img-preview");e&&(Ee=setTimeout((()=>{e.style.opacity="0",e.style.transform="translateX(-99%)",setTimeout((function(){e.remove()}),300)}),300))})()}),title:e.url?(0,D.jsx)(v.A,{placement:"top",title:e.message,children:(0,D.jsx)(M,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.imageId,s=600>e.statusCode>399||!e.statusCode,void Z.send({operation:z.Ru.SANDBOX_SET_POSITION_TO_IMG,settings:{elementId:t,isError:s}});var t,s},children:""===(null===e||void 0===e?void 0:e.url)?c("empty src"):e.url})}):e.message,description:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("div",{className:"image-size",children:[e.image.dimensions&&(0,D.jsxs)(D.Fragment,{children:[e.image.dimensions.width+" \xd7 "+e.image.dimensions.height,(0,D.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,D.jsxs)("span",{children:[Math.round(e.image.bytes/1024),c("kB")]}),(0,D.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,D.jsxs)("span",{children:[e.image.responseTime,c("ms")]}),(0,D.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,D.jsx)("span",{className:"image-size-format",children:e.image.contentType})]}),e.image.secure&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,D.jsx)("span",{className:q,children:c("secure")})]}),e.resolvedUrl&&!e.valid&&(0,D.jsx)(O,{type:"danger",children:c("not valid")})]})," ",!e.resolvedUrl&&!e.statusCode&&(0,D.jsx)(O,{type:"danger",children:c("Failed to load")})]})})},t)})})})]})),(0,D.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,D.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,D.jsx)(p.A,{span:20,children:(0,D.jsx)("div",{className:"form-group-title",children:c("SpamAssassin")})}),(0,D.jsx)(p.A,{span:4,align:"right",children:(0,D.jsx)(d.Ay,{className:"selected-td-form__button ghost-button",type:"text",loading:re.isLoading,onClick:()=>{var e;Te(P),null!==(e=_e.report)&&void 0!==e&&e.length||Ce()},children:!re.isLoading&&(be===P?(0,D.jsx)(j.A,{}):(0,D.jsx)(x.A,{}))})})]}),be===P&&!(null===(o=_e.report)||void 0===o||!o.length)&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(u.A,{style:{marginBottom:8},children:[(0,D.jsxs)("div",{className:"optimise__title-wrapper optimise__title-wrapper_spam",children:[(0,D.jsxs)(R,{level:1,style:{margin:0},type:_e.spamScore<2||!_e.spamScore||_e.spamScore<=_e.baseSpamScore-1?"success":_e.spamScore<_e.baseSpamScore-1?"warning":"danger",children:[(0,D.jsx)("span",{style:{marginRight:"12px"},children:_e.spamScore||0}),(0,D.jsx)(O,{style:{marginRight:"12px",fontSize:"20px"},children:"Score"})]}),(0,D.jsx)(d.Ay,{icon:(0,D.jsx)(f.A,{}),loading:re.isLoading,onClick:Ce,children:c("Refresh")})]}),_e.spamScore>_e.baseSpamScore-1&&(0,D.jsx)(O,{children:c("Lower scores are better. Aim for a score less than ")+(_e.baseSpamScore-1)+"."})]}),(0,D.jsx)(u.A,{style:{marginBottom:8},children:(0,D.jsx)(p.A,{span:24,children:(0,D.jsx)(_.A,{itemLayout:"horizontal",dataSource:_e.report,renderItem:e=>(0,D.jsx)(_.A.Item,{style:{border:"none"},children:(0,D.jsx)(_.A.Item.Meta,{title:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(O,{style:{fontSize:"20px"},children:e.score}),(0,D.jsx)("span",{style:{marginLeft:"12px"},children:e.description})]})})})})})})]}),(0,D.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,D.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,D.jsx)(p.A,{span:20,children:(0,D.jsx)("div",{className:"form-group-title",children:c("Source code validation")})}),(0,D.jsx)(p.A,{span:4,align:"right",children:(0,D.jsx)(d.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>Te(H),children:be===H?(0,D.jsx)(j.A,{}):(0,D.jsx)(x.A,{})})})]}),be===H&&(0,D.jsx)(D.Fragment,{children:null!==G&&void 0!==G&&G.length?(0,D.jsx)(D.Fragment,{children:(0,D.jsx)(u.A,{style:{marginBottom:8},children:(0,D.jsx)(p.A,{span:24,children:(0,D.jsx)(_.A,{itemLayout:"horizontal",dataSource:G,renderItem:e=>(0,D.jsx)(_.A.Item,{style:{border:"none"},children:(0,D.jsx)(_.A.Item.Meta,{avatar:e.severity<6?(0,D.jsx)(A.A,{className:$}):(0,D.jsx)(A.A,{className:W}),title:(0,D.jsx)(D.Fragment,{children:(0,D.jsxs)(O,{onClick:()=>(e=>{const t={startColumn:e.startColumn,startLineNumber:e.startLineNumber,endColumn:e.endColumn,endLineNumber:e.endLineNumber};V((0,S.ps)(t))})(e),style:{cursor:"pointer"},className:e.severity<6?"warning":"error",children:["Line: ",e.startLineNumber," ",e.startLineNumber!==e.endLineNumber&&" \u2013 "+e.endLineNumber]})}),description:(0,D.jsx)(O,{children:e.message})})})})})})}):(0,D.jsx)(u.A,{style:{marginBottom:24},children:(0,D.jsx)(h.A,{message:c("No problems found."),type:"info"})})})]})}},72981:(e,t,s)=>{s.d(t,{A:()=>l});s(92810);var i=s(81e3),r=s(24293),n=s(79716),a=s(70082);const l=({small:e=!1,style:t,wrap:s=!1})=>{const l={width:e?"100%":"100vw",height:"80vh",display:"flex",justifyContent:"center",alignItems:"center",...t},o=(0,a.jsx)(n.A,{style:{fontSize:48},spin:!0});return(0,a.jsx)(i.A,{size:"large",style:l,wrap:s,children:(0,a.jsx)(r.A,{indicator:o})})}},53765:(e,t,s)=>{s.d(t,{A:()=>te});var i=s(92810),r=s(64617),n=s(29218),a=s(76662),l=s(66726),o=s(29234),c=s(81e3),d=s(43005),m=s(2018),u=s(7744),p=s(86889),h=s(73035),_=s(85677),g=s(38587),v=s(45934),j=s(23287),x=s(38883),f=s.n(x),y=s(40836),A=s(79060),b=s(4800),w=s(79304),N=s(94822),S=s(8375),k=s(32293),I=s(35285),C=s(64936),T=s(36404),E=s(85163),L=s(70082);const z=({title:e})=>{const{__:t}=(0,j.s9)();let s=(0,v.wA)();const{projectId:n}=(0,r.g)(),a=(0,v.d4)(C.cL),l=(0,v.d4)(T.yN);let o=[{label:t("Project settings"),key:"Project settings",className:"em-analytics__account-settings",icon:(0,L.jsx)(S.A,{style:{fontSize:"16px"}}),onClick:()=>{s((0,C.qf)(E.lx.EDIT_PROJECT_MODAL))}},{label:(0,L.jsx)(N.N_,{to:"/projects",children:t("List of projects")}),key:"List of projects",icon:(0,L.jsx)(k.A,{style:{fontSize:"16px"}}),className:"em-analytics__sign-out"}];const c=(null===l||void 0===l?void 0:l.title)||e;return(0,i.useEffect)((()=>{if(n){const e=document.querySelector(".header__project");null===e||void 0===e||e.setAttribute("data-project-id",n)}}),[n]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(b.A,{menu:{items:o},arrow:"true",overlayStyle:{minWidth:0},getPopupContainer:()=>document.querySelector("header"),children:(0,L.jsxs)(N.N_,{to:"/projects/"+n+"/emails?page=1",className:"header__project",children:[(0,L.jsxs)(w.A,{size:28,style:{backgroundColor:"#777",marginRight:8,fontWeight:700,fontSize:18,textTransform:"uppercase"},children:[null===c||void 0===c?void 0:c[0],null!==c&&void 0!==c&&c.split(" ")[1]?c.split(" ")[1][0]:""]}),c]})}),(0,L.jsx)(I.A,{isModalVisible:a===E.lx.EDIT_PROJECT_MODAL})]})};var D=s(97562),O=s(57918),M=s(47358),R=s(7760),B=s(8493),F=s(64037),P=s(18777),H=s(17581),q=s(32269),$=s(45695),W=s(69106);const V=[50,50],U=[420,420],X=[45,10,45],Y=[0,100,0],J=[50,420,50],Z="all 0.5s ease 0s",{Paragraph:K}=a.A,G="code",Q="view",ee=({email:e,viewMode:t="view",isLoggedIn:s})=>{const{__:a,_x:x}=(0,j.s9)(),b=(0,v.wA)(),w=(0,v.d4)(M.Fv),{emailId:N,blockId:S}=(0,r.g)(),k=(0,$.QC)(),[I,C]=(0,i.useState)(t),[T,ee]=(0,i.useState)(I===Q?Y:V),[te,se]=(0,i.useState)(I===Q?J:U),[ie,re]=(0,i.useState)([]),[ne,ae]=(0,i.useState)(!1),[le,oe]=(0,i.useState)(!1),ce=(0,i.useRef)(null),de=(0,i.useRef)(),me=(0,i.useRef)(),ue=(0,i.useRef)(),pe=N||S,{data:he=[],refetch:_e}=(0,P.Cf)(pe);(0,i.useEffect)((()=>{pe&&_e(pe)}),[I,pe,_e]),(0,W.f)(e);(0,F.A)((e=>{const t=e.data.operation,s=document.querySelector(".preview-mode__pane_editor")?document.getElementById("pane-content-iframe"):document.querySelector(".preview-mode__row > .preview-mode__col_preview");t===E.Ru.APPLICATION_SCROLL_TO&&setTimeout((()=>{s.scrollTo({top:e.data.settings.value,behavior:"smooth"})}),100),t===E.Ru.APPLICATION_IFRAME_SET_HEIGHT&&(document.querySelector(".preview-mode__iframe").style.height=e.data.settings.height+"px")}));const ge=e=>{e.target.classList.contains("preview-mode__resizer")&&(de.current&&(de.current.style.transition="none"),me.current&&(me.current.style.transition="none"),ue.current&&(ue.current.style.transition="none"))},ve=()=>{const e=I===Q?Z:"none";de.current.style.transition!==Z&&(de.current&&(de.current.style.transition=e),me.current&&(me.current.style.transition=e),ue.current&&(ue.current.style.transition=e))};(0,i.useEffect)((()=>(document.addEventListener("mousedown",ge),document.addEventListener("mouseup",ve),()=>{document.removeEventListener("mousedown",ge),document.removeEventListener("mouseup",ve)}))),(0,i.useEffect)((()=>{const e=k.onInit((()=>{k.send({operation:E.Ru.SANDBOX_LOCK_EDIT,data:t===Q}),k.send({operation:E.Ru.SANDBOX_LOCK_DISCUSS,value:ne})}));return()=>e.dispose()}),[t,I,ne,k]),(0,i.useEffect)((()=>{ee(I===Q?Y:V),se(I===Q?J:U)}),[I]);const je=({key:e,domEvent:t})=>{switch(t.preventDefault(),de.current.style.transition=Z,me.current.style.transition=Z,ue.current.style.transition=Z,ce.current.resize(),e){case"Desktop":default:ee(I===Q?Y:V);break;case"Mobile":ee(X)}setTimeout((()=>{k.send({operation:E.Ru.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:de.current.getBoundingClientRect().width}}),ce.current.resize()}),550)};(0,i.useEffect)((()=>{const e=new q.jG;if(ie.length<2){var t,s;const i=null===(t=de.current)||void 0===t?void 0:t.getBoundingClientRect(),r=null===(s=document.getElementById("pane-content-iframe"))||void 0===s?void 0:s.getBoundingClientRect(),n=setInterval(l,50);re((e=>[...e,n]));const a=t=>{e.addDisposable(k.onInit((()=>{k.send({operation:E.Ru.SANDBOX_WINDOW_CHARACTERISTIC,settings:t})})))};function l(){a({iframeOffsetTop:i.top-r.top,scrollTop:r.top?-r.top:0,innerHeight:window.innerHeight,previewHeight:document.querySelector(".preview-mode__pane-content").getBoundingClientRect().height,mode:G})}}return e.addDispose((()=>clearInterval(ie[ie.length-1]))),()=>e.dispose()}),[ie,k]),(0,i.useEffect)((()=>{if(I===G){const e=window.localStorage.getItem(E.V0.em_code_mode_pane_sizes);e&&ee(JSON.parse(e))}}),[I]);const xe=e=>{if(I===G&&window.localStorage.setItem(E.V0.em_code_mode_pane_sizes,JSON.stringify(e)),I===Q){const t=(e[2]+e[0])/2;ee([t,e[1],t])}else ee(e);k.send({operation:E.Ru.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:de.current.getBoundingClientRect().width}}),ce.current.resize()},fe=()=>{ce.current.resize()},ye=(0,i.useCallback)((()=>{e.hasOwnProperty("type")?b((0,R.vs)()):b((0,M.vs)())}),[b,e]);let Ae;const be=()=>{var e,t;const s=null===(e=de.current)||void 0===e?void 0:e.getBoundingClientRect(),i=null===(t=document.getElementById("pane-content-iframe"))||void 0===t?void 0:t.getBoundingClientRect();Ae&&window.clearTimeout(Ae),Ae=window.setTimeout((function(){k.send({operation:E.Ru.SANDBOX_WINDOW_CHARACTERISTIC,settings:{iframeOffsetTop:s.top-i.top,scrollTop:document.getElementById("pane-content-iframe").scrollTop,innerHeight:window.innerHeight,previewHeight:document.querySelector(".preview-mode__pane-content").getBoundingClientRect().height,CODE:G}})}),100)};(0,i.useEffect)((()=>(document.addEventListener("scroll",be,!0),()=>{document.removeEventListener("scroll",be,!0)})));const we=()=>{ae((e=>!e)),k.send({operation:E.Ru.SANDBOX_LOCK_DISCUSS,value:!ne})},Ne=()=>{C(le?Q:G),oe((e=>!e))};let Se=[{key:E.yI,children:(0,L.jsx)("div",{className:"preview-mode__collapse-wrapper"})},{label:(0,L.jsxs)(l.A,{placement:"right",title:x("Discuss","tab"),children:[(0,L.jsx)(h.A,{}),!!he.length&&(0,L.jsx)("span",{className:"email-pane__comment-counter",children:he.filter((e=>"deleted"!==e.comment_status)).length})]}),key:E.hc,className:"preview-mode__tab-discuss em-analytics__email-tab-discuss",style:{overflow:"hidden"},children:(0,L.jsx)("div",{className:"email-pane__collapse-wrapper",children:pe?(0,L.jsx)("div",{className:"ant-tabs-content discuss-wrapper",children:(0,L.jsx)(D.A,{email:e,comments:he,subjectId:pe,isLoggedIn:!0})}):(0,L.jsx)("div",{className:"aside-content-wrapper",children:e.hasOwnProperty("type")?(0,L.jsx)(o.A,{description:a("Save the block before commenting."),type:"info",showIcon:!0}):(0,L.jsx)(o.A,{description:a("Save the email before commenting."),type:"info",showIcon:!0})})})}];return(0,L.jsxs)("div",{className:f()("preview-mode",{"preview-mode_view":I===Q}),children:[(0,L.jsx)("div",{style:{display:"none"},children:(0,L.jsx)(y.A,{email:e,readOnly:t===Q})}),(0,L.jsxs)("div",{className:"preview-mode__header",children:[(0,L.jsxs)("div",{className:"preview-mode__header__title",children:[(0,L.jsx)(z,{style:{float:"left",cursor:"none"},title:null===e||void 0===e?void 0:e.project_title}),(0,L.jsx)(K,{editable:w&&{icon:(0,L.jsx)(_.A,{className:"email-page-header__icon-edit"}),onChange:t=>{e.isNew?b((0,B.BQ)(t)):b(H.GY.util.updateQueryData("getEmail",e.id,(e=>{Object.assign(e,{title:t})})))}},children:null===e.title?a("New email title"):e.title})]}),(0,L.jsx)("div",{children:(0,L.jsx)("div",{className:"preview-mode__buttons",children:(0,L.jsx)(c.A,{size:10,children:(s||w)&&(0,L.jsx)(l.A,{placement:"bottom",title:a("Close"),children:(0,L.jsx)(d.Ay,{className:"preview-mode__close-btn",onClick:w?ye:()=>{window.close(),window.location.href="/"},children:(0,L.jsx)(g.A,{})})})})})})]}),t!==G&&(0,L.jsx)("div",{className:"preview-mode__wrapper",children:(0,L.jsxs)(m.A,{className:"preview-mode__row",children:[(0,L.jsx)(u.A,{xl:{span:ne?6:0},lg:{span:ne?6:0},md:{span:ne?10:0},sm:{span:0},xs:{span:0},className:f()("preview-mode__col preview-mode__col_settings comment-block",{"preview-mode__col_settings-collapsed":!ne,"preview-mode__col_code-mode":I===G}),children:ne&&(0,L.jsx)(p.A,{className:"preview-mode__col_settings-inner",size:"middle",animated:{inkBar:!1,tabPane:!0},activeKey:E.hc,onTabClick:we,renderTabBar:(e,t)=>(0,L.jsx)(t,{className:"preview-mode__tab-bar",...e}),tabPosition:"left",items:Se})}),I===G&&(0,L.jsxs)(u.A,{xl:{span:ne?18:24},lg:{span:ne?18:24},md:{span:ne?14:24},sm:{span:24},xs:{span:24},className:f()("preview-mode__col preview-mode__col_preview preview-mode__code-mode",{"preview-mode__col_preview-collapsed":!ne}),children:[!ne&&(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu",children:(0,L.jsx)("div",{className:"preview-mode__comments-icon-wrapper",onClick:we,children:(0,L.jsxs)(l.A,{placement:"right",title:x("Discuss","tab"),children:[(0,L.jsx)(h.A,{style:{fontSize:"20px"}}),!!he.length&&(0,L.jsx)("span",{className:"preview-mode__comment-counter",children:he.filter((e=>"deleted"!==e.comment_status)).length})]})})}),(0,L.jsxs)(n.A,{className:"preview-mode__panes",direction:"horizontal",gutterSize:0,snapOffset:0,sizes:T,minSize:te,gutter:()=>(0,q.Dx)("preview-mode__panes-resizer"),onDragEnd:xe,onDrag:fe,children:[(0,L.jsx)("div",{className:"preview-mode__pane preview-mode__pane_editor",children:(0,L.jsx)("div",{className:"preview-mode__pane-content",children:(0,L.jsx)(y.A,{email:e,readOnly:t===Q})})}),(0,L.jsx)("div",{className:"preview-mode__pane preview-mode__pane_main",ref:de,children:(0,L.jsxs)("div",{className:"preview-mode__pane-content",id:"pane-content-iframe",children:[(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-top",id:"iframe-scroll-top"}),(0,L.jsx)(A.A,{ref:ce,email:e}),(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-bottom",id:"iframe-scroll-bottom"})]})})]}),(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu preview-mode__content-col_menu-right",children:(0,L.jsx)(O.A,{setSizes:je,sizes:[T[1]],codeModeShow:Ne,codeModeIsVisible:le,email:e})})]}),I===Q&&(0,L.jsx)(u.A,{xl:{span:ne?18:24},lg:{span:ne?18:24},md:{span:ne?14:24},sm:{span:24},xs:{span:24},className:f()("preview-mode__col preview-mode__col_preview",{"preview-mode__col_preview-collapsed":!ne}),children:(0,L.jsxs)(n.A,{className:"preview-mode__content",sizes:T,minSize:J,snapOffset:0,gutter:()=>(0,q.Dx)("preview-mode__resizer"),onDragEnd:xe,onDrag:fe,expandToMin:!0,gutterAlign:"center",dragInterval:1,children:[(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu",ref:me,children:!ne&&(0,L.jsx)("div",{className:"element-preview-menu",style:{width:"100%"},children:(0,L.jsx)("div",{className:"preview-mode__comments-icon-wrapper",onClick:we,children:(0,L.jsxs)(l.A,{placement:"right",title:x("Discuss","tab"),children:[(0,L.jsx)(h.A,{style:{fontSize:"20px"}}),!!he.length&&(0,L.jsx)("span",{className:"preview-mode__comment-counter",children:he.filter((e=>"deleted"!==e.comment_status)).length})]})})})}),(0,L.jsxs)("div",{className:"preview-mode__content-col preview-mode__pane-content preview-mode__content-col_main",ref:de,id:"pane-content-iframe",children:[(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-top",id:"iframe-scroll-top"}),(0,L.jsx)(A.A,{ref:ce,className:"preview-mode__iframe",email:e,handlerSendPosition:be}),(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-bottom",id:"iframe-scroll-bottom"})]}),(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu preview-mode__content-col_menu-right",ref:ue,children:(0,L.jsx)(O.A,{setSizes:je,sizes:[T[1]],codeModeShow:Ne,codeModeIsVisible:le,email:e})})]})})]})}),(0,L.jsx)("div",{className:"preview-mode__footer"})]})};ee.defaultProps={viewMode:G,sendOptionsHandler:()=>{}};const te=ee},19817:(e,t,s)=>{s.d(t,{A:()=>h});var i=s(92810),r=s(71157),n=s(64617),a=s(94822),l=s(39990),o=s(32269),c=s(90070),d=s(47381),m=s(85163),u=s(70082);const p="emailmaker.ru",h=({children:e})=>{const t=(0,n.zy)(),s=(0,r.hN)(),h=(0,c.p6)(),[_,g]=(0,a.ok)(),[v,{isError:j,isSuccess:x,error:f,data:y}]=(0,l.i2)(),{isError:A,isUninitialized:b,isLoading:w,isSuccess:N,error:S,data:k,refetch:I}=(0,l.CR)("",{skip:m.EW.isPlugin||!h.get(m.A9.em_token)}),C=(0,i.useMemo)((()=>({email:_.get("email"),hash:_.get("hash"),event:"confirmation"===_.get("event")})),[_]);if((0,i.useEffect)((()=>{j?(0,o.p6)({error:f},s):x&&((0,d.d)({event:"email_confirmation",user_email:null===y||void 0===y?void 0:y.email}),(0,o.wB)(y.message,s),k&&I())}),[y,f,j,x,s,k,I]),(0,i.useEffect)((()=>{!(C.email&&C.hash&&C.event)||!1!==(null===k||void 0===k?void 0:k.email_confirmation)&&h.get(m.A9.em_token)||y||v({hash:C.hash,email:C.email,event:C.event}).catch((e=>{console.warn("e",e)})).finally((()=>g("")))}),[C,v,k,h,g,y]),(0,i.useEffect)((()=>{A&&S&&((0,o.p6)({error:S},s),(0,o.Id)(h))}),[k,A,S,s,h]),m.EW.isPlugin)return e;if(!m.EW.isPlugin&&!h.get(m.A9.em_token)&&!t.pathname.includes("auth"))return(0,u.jsx)(n.C5,{to:"/auth",state:{from:t}});if((b||w)&&!t.pathname.includes("auth"))return(0,u.jsx)(u.Fragment,{});if(A&&!t.pathname.includes("auth"))return(0,u.jsx)(n.C5,{to:"/auth",state:{from:t}});if(N){const{id:s,email:i,name:r,locale:a,carrotquest_hash:l,ducalis_hash:o,email_subscription_consent:c,last_used_project:d}=k;return h.set(m.A9.em_id,s,{domain:p}),h.set(m.A9.em_email,i,{domain:p}),h.set(m.A9.em_name,r,{domain:p}),h.set(m.A9.em_locale,a,{domain:p}),h.set(m.A9.em_carrotquest_hash,l,{domain:p}),h.set(m.A9.em_ducalis_hash,o,{domain:p}),h.set(m.A9.em_email_subscription_consent,c,{domain:p}),d&&"/"===t.pathname?(0,u.jsx)(n.C5,{to:`/projects/${d}/emails`,replace:!0}):e}return t.pathname.includes("auth")?e:void 0}},19263:(e,t,s)=>{s.d(t,{A:()=>k});var i=s(92810),r=s(41919),n=s(37005),a=s(66726),l=s(32085),o=s(32293),c=s(64617),d=s(94822),m=s(45934),u=s(23287),p=s(29067),h=s(30961),_=s(20757),g=s(32398),v=s(34524),j=s(7760),x=s(85163),f=s(22197),y=s(90070),A=s(32269),b=s(93563),w=s(64936),N=s(70082);const{Content:S}=r.A,k=()=>{var e,t,s;const{__:k}=(0,u.s9)(),I=(0,m.wA)(),C=(0,y.p6)(),T=C.get(x.A9.em_elements_view),{data:E}=(0,c.KC)(),[L]=(0,d.ok)(),z=(0,m.d4)(j.b9),D=(0,m.d4)(w.o8),O=L.get("folder"),M=+L.get("tag"),R=(0,A.HT)(E,x.YY),[B,F]=(0,i.useState)(O||(M?null:x.y2)),[P,H]=(0,i.useState)(M||null),[q,$]=(0,i.useState)(T||x.Y$),{data:W,refetch:V}=(0,b.Jz)({parent:null===(e=E.blockfolder)||void 0===e?void 0:e[0]},{skip:!(null!==(t=E.blockfolder)&&void 0!==t&&t[0])});(0,i.useEffect)((()=>{I((0,w.sB)(W||[]))}),[I,W]);const U=(e=!1,t=null)=>{H(t),F(e),I((0,j.om)({...z,tags:t?[t]:[],folderTag:e}))};(0,i.useEffect)((()=>{var e;M&&null!==R&&void 0!==R&&R.find((e=>e.id===M))&&(null===z||void 0===z||null===(e=z.tags)||void 0===e?void 0:e[0])!==P&&I((0,j.om)({...z,tags:[M],folderTag:B}))}),[R,M,P,I,z,B]);(0,f.A)(k("Blocks")+" "+E.title),(0,i.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const X=(0,N.jsx)(h.A,{isBlocks:!0}),Y=(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(n.A,{defaultValue:q,onChange:e=>{$(e),I((0,v.NK)(e)),C.set(x.A9.em_elements_view,e)},value:q,options:[{value:x.Y$,label:(0,N.jsx)(a.A,{title:k("Cards view"),placement:"top",children:(0,N.jsx)(l.A,{})})},{value:x.rl,label:(0,N.jsx)(a.A,{title:k("Table view"),placement:"top",children:(0,N.jsx)(o.A,{})})}]},"Switch radio")});return(0,N.jsxs)(r.A,{className:"project-blocks-page",children:[(0,N.jsx)(_.A,{leftBlock:X,rightBlock:Y}),(0,N.jsx)(S,{className:"project-blocks-page__container",children:(0,N.jsxs)("div",{className:"project-blocks-page__content container",children:[(0,N.jsx)("div",{className:"project-blocks-page__menu-wrapper",children:(0,N.jsx)(g.A,{currentFolderId:B,setCurrentFolderId:F,activeTagId:P,setActiveTagHandler:U,projectTags:R,folderTaxonomy:"blockfolder"})}),(0,N.jsx)(p.A,{projectId:E.id,projectEmailsCounter:+(null===E||void 0===E||null===(s=E.counters)||void 0===s?void 0:s.blocks_counter),emailsView:q,currentFolderId:B,foldersList:D,refetchProjectFolders:D.length?V:()=>{},projectTags:R,activeTagId:P,setActiveTagHandler:U})]})})]})}},6099:(e,t,s)=>{s.d(t,{A:()=>g});var i=s(92810),r=s(64617),n=s(45934),a=s(41919),l=s(25072),o=s(43005),c=s(23287),d=s(84568),m=s(36404),u=s(72981),p=s(32269),h=s(70082);const{Content:_}=a.A,g=()=>{var e;const{__:t}=(0,c.s9)(),{projectId:s}=(0,r.g)();let g=(0,r.Zp)(),v=(0,r.zy)();const j=(0,n.wA)(),x=(0,d.fo)(+s,{skip:!s}),{isLoading:f,isError:y,error:A,isSuccess:b,data:w}=x;return(0,i.useEffect)((()=>{b&&(null===w||void 0===w?void 0:w.id)!==s&&j((0,m.od)(w))}),[b,w,j,s]),(0,i.useEffect)((()=>{b&&s&&v.pathname.endsWith(s)&&g(`${v.pathname}/emails`)}),[b,v,g,s]),(0,h.jsxs)(h.Fragment,{children:[f&&(0,h.jsx)(u.A,{}),y&&A&&(0,h.jsx)(a.A,{className:"project-outlet",children:(0,h.jsx)(_,{className:"project-outlet__container container",children:(0,h.jsx)(l.Ay,{status:A.status,title:A.status,subTitle:null===(e=A.data)||void 0===e?void 0:e.message,extra:(0,h.jsx)(o.Ay,{type:"primary",onClick:()=>(0,p.XZ)(g,"/projects"),children:t("Back To Projects")})})})}),b&&(0,h.jsx)(r.sv,{context:{...x}})]})}},44338:(e,t,s)=>{s.d(t,{A:()=>W});var i=s(92810),r=s(41919),n=s(37005),a=s(66726),l=s(43005),o=s(71157),c=s(32085),d=s(32293),m=s(3625),u=s(52360),p=s(64617),h=s(94822),_=s(45934),g=s(23287),v=s(44335),j=s(98655),x=s(30961),f=s(28288),y=s(72981),A=s(32398),b=s(20757),w=s(47358),N=s(94925),S=s(86286),k=s(64936),I=s(65983),C=s(39990),T=s(46312),E=s(17581),L=s(63531),z=s(93563),D=s(85163),O=s(22197),M=s(14598),R=s(58689),B=s(47381),F=s(32269),P=s(90070),H=s(7205),q=s(70082);const{Content:$}=r.A,W=()=>{var e;const{__:t,_n:s}=(0,g.s9)(),W=(0,_.wA)(),V=(0,p.Zp)(),U=(0,P.p6)(),X=(0,o.hN)();let Y=(0,p.zy)();const J=(0,_.d4)(I.CT),Z=(0,_.d4)(S.C1),K=(0,_.d4)(w.cL),G=(0,_.d4)(k.o8),Q=(0,_.d4)(k.uM),[ee]=(0,C.on)(),[te]=(0,E.Kh)(),[se]=(0,L.dS)(),[ie]=(0,T.mI)(),[re]=(0,h.ok)(),{data:ne}=(0,p.KC)(),[ae,le]=(0,i.useState)(!1),oe=re.get("folder"),ce=(0,F.HT)(ne,D.zh),{data:de,refetch:me}=(0,z.Jz)({parent:ne.folder[0]},{skip:!ne.folder[0]}),[ue,pe]=(0,i.useState)(oe||(Q?null:D.y2));(0,i.useEffect)((()=>{W((0,k.sB)(de||[]))}),[W,de]);const[he,_e]=(0,i.useState)(U.get(D.A9.em_elements_view)||D.Y$);(0,O.A)(t("Emails")+" "+ne.title),(0,i.useEffect)((()=>{(null===Z||void 0===Z?void 0:Z.last_used_project)!==ne.id&&W(C.Q2.endpoints.editMe.initiate({last_used_project:ne.id}))}),[W,ne.id,null===Z||void 0===Z?void 0:Z.last_used_project]);const[ge,ve]=(0,i.useState)(null);const je=async e=>{if(1===e.length){const t=e[0];try{le(!0);const e=await(0,M.q2)(t,(async(e,t)=>{let s;if("string"===typeof e)try{var i;e=(0,H.A)(e),s=null===(i=await ie({url:e}))||void 0===i?void 0:i.data}catch(c){return e}else s=e;if(t.split(".").length<2){const e=v.extension(s.type);e&&(t=`${t}.${e}`)}const r=new File([s],t.toLowerCase()),n=await se({user_id:Z.id,folder:ne.id,file:r});var a,l,o;if(!n.error&&400!==(null===(a=n.data.data)||void 0===a?void 0:a.status))return null===(l=n.data)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.file_url;return"string"===typeof e?e:""})),[s]=(0,R.Ay)(t.name),i=(0,F.ez)(e)||s||"";return te({title:i,project:ne.id,subject:i,description:"",html:e,parent_email:D.iU,folder:oe!==D.y2?[+oe]:[]}).then((e=>{e&&(e.error?X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.code}}),description:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.message}}),placement:"bottomRight"}):(de&&me(),V(`/projects/${ne.id}/emails/${e.data.id}`),(0,B.d)({event:"upload_file",action:"import_email"})))})).finally((()=>le(!1)))}catch(i){le(!1);const e=i instanceof Error?i.message:i;X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}),placement:"bottomRight"})}}else{const r=[];le(!0);for(let s=0;s<e.length;s++){let n=e[s];const a=await(0,M.q2)(n,(async(e,t)=>{let s;if("string"===typeof e)try{var r;e=(0,H.A)(e),s=null===(r=await ie({url:e}))||void 0===r?void 0:r.data}catch(i){return e}else s=e;if(t.split(".").length<2){const e=v.extension(s.type);e&&(t=`${t}.${e}`)}const n=new File([s],t.toLowerCase()),a=await se({user_id:Z.id,folder:ne.id,file:n});var l,o,c;if(!a.error&&400!==(null===(l=a.data.data)||void 0===l?void 0:l.status))return null===(o=a.data)||void 0===o||null===(c=o[0])||void 0===c?void 0:c.file_url;return"string"===typeof e?e:""})),[l]=(0,R.Ay)(n.name),o=(0,F.ez)(a)||l||"",c=te({title:o,project:ne.id,subject:o,description:"",html:a,parent_email:D.iU,folder:oe!==D.y2?[+oe]:[]}).then((e=>{if(e)return e.error?(X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.code}}),description:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.message}}),placement:"bottomRight"}),null):(X.success({message:t("The email \u201c")+e.data.title+t("\u201d was successfully imported."),placement:"bottomRight"}),e.data)})).catch((e=>{const t=e instanceof Error?e.message:e;return X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:t}}),placement:"bottomRight"}),null}));r.push(c)}let n=await Promise.all(r);le(!1),n=n.filter((e=>!!e)),n.length&&X.success({message:n.length+s(" email was"," emails were",n.length)+t(" successfully imported."),placement:"bottomRight"}),ge&&ge.refetch()}},[xe,fe]=(0,i.useState)(!1);(0,i.useEffect)((()=>{!xe&&Z.counters.emails_counter<3&&(ee(),fe(!0))}),[ee,Z.counters.emails_counter,xe]),(0,i.useEffect)((()=>{document.body.classList.remove("editor"),U.remove(D.A9.em_folder)}),[W,U]);const ye=(e=!1,t=null)=>{W((0,k.Cj)(t)),pe(e),W((0,I.om)({...J,tags:t?[t]:[],folderTag:e}))},Ae=(0,q.jsx)(x.A,{isBlocks:!1}),be=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(n.A,{defaultValue:he,onChange:e=>{U.set(D.A9.em_elements_view,e),_e(e),W((0,N.NK)(e))},value:he,options:[{value:D.Y$,label:(0,q.jsx)(a.A,{title:t("Cards view"),placement:"top",children:(0,q.jsx)(c.A,{})})},{value:D.rl,label:(0,q.jsx)(a.A,{title:t("Table view"),placement:"top",children:(0,q.jsx)(d.A,{})})}]},"Switch radio"),(0,q.jsx)(a.A,{title:t("Available formats: HTML, EML, ZIP"),placement:"top",children:(0,q.jsx)(l.Ay,{className:"em-analytics__project-page__import",type:"default",icon:(0,q.jsx)(m.A,{}),onClick:()=>{(0,B.d)({event:"click",action:"import_email"}),(0,M.QM)("application/zip, message/rfc822, text/html",je)},children:t("Import email")},"Import email from file")},"Import email from file tooltip"),(0,q.jsx)(l.Ay,{className:"em-analytics__email-create",type:"primary",icon:(0,q.jsx)(u.A,{}),onClick:()=>{W((0,I.om)({tags:[]})),U.set(D.A9.em_folder,"deleted"===oe?D.y2:oe),(0,F.XZ)(V,`${Y.pathname}/create/`),(0,B.d)({event:"click",action:"create_new_email",description:"Go to the email template selection"})},children:t("Create a new email")},"Create new email")]});return(0,q.jsxs)(r.A,{className:"project-page",children:[(0,q.jsx)(b.A,{leftBlock:Ae,rightBlock:be}),(0,q.jsx)($,{className:"project-page__container",children:(0,q.jsxs)("div",{className:"project-page__content container",children:[(0,q.jsx)("div",{className:"project-page__menu-wrapper",children:(0,q.jsx)(A.A,{currentFolderId:ue,setCurrentFolderId:pe,activeTagId:Q,setActiveTagHandler:ye,projectTags:ce,folderTaxonomy:"folder"})}),(0,q.jsx)(j.A,{projectId:ne.id,projectEmailsCounter:+(null===ne||void 0===ne||null===(e=ne.counters)||void 0===e?void 0:e.emails_counter),emailsView:he,currentFolderId:ue,foldersList:G,refetchProjectFolders:G.length?me:()=>{},projectTags:ce,activeTagId:Q,setActiveTagHandler:ye,registerFunction:ve})]})}),ae&&(0,q.jsx)(y.A,{wrap:!0,style:{position:"fixed",width:"100%",height:"100%",top:0,left:0}}),(0,q.jsx)(f.A,{isModalVisible:K===D.lx.ADD_NEW_EMAIL_MODAL})]})}},24420:(e,t,s)=>{s.d(t,{A:()=>M});var i=s(92810),r=s(41919),n=s(43005),a=s(45934),l=s(23287),o=s(68919),c=s(33206),d=s(4800),m=s(49246),u=s(29234),p=s(21349),h=s(71157),_=s(9452),g=s(22339),v=s(8375),j=s(45130),x=s(8114),f=s(74267),y=s(64617),A=s(94822),b=s(35285),w=s(84568),N=s(64936),S=s(32269),k=s(85163),I=s(70082);const C=(e,t)=>`${e.pathname.replace(/\/+$/,"")}/${t.id}/emails?page=1`,T=(e,t)=>`${e.pathname.replace(/\/+$/,"")}/${t.id}/members`,E=()=>{const{__:e,_x:t}=(0,l.s9)();let s=(0,a.d4)(N.vW),r=(0,y.zy)(),n=(0,a.wA)(),o=(0,a.d4)(N.cL);const{modal:E}=c.A.useApp(),L=(0,h.hN)(),{confirm:z}=E,D=(0,a.Pj)(),O=s=>{z({maskClosable:!0,centered:!0,title:t("Are you sure to delete \u201c","project")+s.title+e("\u201d project?"),icon:(0,I.jsx)(_.A,{}),okText:e("Yes"),cancelText:e("No"),onOk:()=>(t=>D.dispatch(w.Nq.endpoints.deleteProject.initiate(t.id)).then((t=>{t.error?(0,S.p6)(t,L):t.data&&(0,S.wB)(e("The project \u201c")+t.data.title+e("\u201d was successfully removed."),L)})))(s)})},[M,R]=(0,i.useState)({page:1}),{isLoading:B,isSuccess:F,isError:P,isFetching:H,data:q=[]}=(0,w.su)(M),[$,W]=(0,i.useState)(null),V=[{width:"35%",title:e("Project"),dataIndex:"title",render:(e,t,s)=>(0,I.jsx)(A.N_,{to:C(r,t),children:e})},{width:"16%",title:e("Owner"),dataIndex:["members","owner","nickname"],render:(e,t,s)=>e||t.members.owner.user_email},{width:"12%",title:t("Created","block"),dataIndex:"date",render:(t,s,i)=>(0,S.Yq)((0,f.A)(t),e),sorter:!0,sortOrder:(0,S.Np)(M.order)},{width:"10%",title:e("Emails"),dataIndex:"emails",sorter:!0,render:(e,t,s)=>null!==e&&void 0!==e&&e.length?null===e||void 0===e?void 0:e.length:"\u2013"},{width:"10%",title:e("Blocks"),dataIndex:"blocks",render:(e,t,s)=>null!==e&&void 0!==e&&e.length?null===e||void 0===e?void 0:e.length:"\u2013"},{width:"3%",title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(t,s)=>{let i=[];return i.push({label:(0,I.jsx)(A.N_,{to:C(r,s),children:e("Open")}),key:"Enter",icon:(0,I.jsx)(g.A,{style:{fontSize:"16px"}}),className:"em-analytics__open"},{label:e("Settings"),key:"Edit",icon:(0,I.jsx)(v.A,{style:{fontSize:"16px"}}),className:"em-analytics__edit",onClick:()=>(W(s),void n((0,N.qf)(k.lx.EDIT_PROJECT_MODAL)))},{label:(0,I.jsx)(A.N_,{to:T(r,s),children:e("Members")}),key:"Members",icon:(0,I.jsx)(j.A,{style:{fontSize:"16px"}}),className:"em-analytics__members"},{label:e("Remove"),key:"Remove",icon:(0,I.jsx)(_.A,{style:{fontSize:"16px"}}),className:"em-analytics__remove",style:{color:"#ff4d4f"},onClick:()=>O(s)}),(0,I.jsx)(d.A,{arrow:"true",placement:"bottom",menu:{items:i},trigger:["hover"],children:(0,I.jsx)("span",{className:"projects-table__actions",children:(0,I.jsx)(x.A,{})})})}}];return(0,I.jsxs)("div",{className:"container",children:[B&&(0,I.jsx)(m.A,{active:!0}),P&&(0,I.jsx)(u.A,{message:e("Error"),description:e("Error when receiving data. Try again (reload page) or contact support."),type:"error",showIcon:!0}),F&&0===q.length&&(0,I.jsx)(u.A,{message:e("You don't have any projects yet."),description:e("Click the Add a new project button to add your first project."),type:"info",showIcon:!0}),F&&q.length>0&&(0,I.jsx)(p.A,{rowKey:e=>e.id,dataSource:q,bordered:!0,columns:V,loading:H,onChange:(e,t,{order:s,field:i},{action:r})=>{"sort"===r&&R(s?{page:1,order:(0,S.gq)(s),orderby:i}:{page:1})},showSizeChanger:!1,pagination:{showSizeChanger:!1,hideOnSinglePage:!0,position:["bottomCenter"],current:M.page,total:s,onChange:(e,t)=>{R({page:e})}},className:"projects-table"}),(0,I.jsx)(b.A,{isModalVisible:o===k.lx.EDIT_PROJECT_MODAL,selectedProject:$})]})};var L=s(20757),z=s(47381),D=s(22197);const{Content:O}=r.A,M=()=>{const{__:e}=(0,l.s9)(),t=(0,a.d4)(N.cL),s=(0,a.wA)();(0,D.A)(e("Projects")),(0,i.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const c=(0,I.jsx)("div",{className:"ant-page-header-heading-title",children:e("Projects")}),d=(0,I.jsx)(n.Ay,{className:"em-analytics__add-project",type:"primary",onClick:()=>{(0,z.d)({event:"open_modal",action:"create_new_project"}),s((0,N.qf)(k.lx.ADD_NEW_PROJECT_MODAL))},children:e("Add a new project")},"Add a new project");return(0,I.jsxs)(r.A,{className:"projects-page",children:[(0,I.jsx)(L.A,{leftBlock:c,rightBlock:d}),(0,I.jsxs)(O,{className:"projects-page__container",children:[(0,I.jsx)(E,{}),(0,I.jsx)(o.A,{isModalVisible:t===k.lx.ADD_NEW_PROJECT_MODAL})]})]})}},36852:(e,t,s)=>{s.d(t,{A:()=>N});var i=s(92810),r=s(59297),n=s(76662),a=s(12280),l=s(55039),o=s(43005),c=s(71157),d=s(9588),m=s(82013),u=s(48236),p=s(64617),h=s(94822),_=s(38883),g=s.n(_),v=s(23287),j=s(65119),x=s(85163),f=s(47381),y=s(70082);const{Title:A,Text:b}=n.A,w=({className:e})=>{const{__:t}=(0,v.s9)();let s=(0,p.Zp)();const r=(0,c.hN)(),[n,_]=(0,i.useState)(!1),w={name:"email",rules:[{required:!0,message:t("Please type your email address."),type:"email"}],placeholder:t("email"),prefix:(0,y.jsx)(d.A,{style:{color:x.VG}})},N={name:"password",rules:[{required:!0,message:t("Please type your password.")},()=>({validator:(e,s)=>s.length>=8&&/[0-9]/.test(s)&&/[a-z]/.test(s)&&/[A-Z]/.test(s)&&/\W+|_/g.test(s)?Promise.resolve():Promise.reject(new Error(t("The password is too simple.")))})],placeholder:t("password"),prefix:(0,y.jsx)(m.A,{style:{color:x.VG}})},S={name:"code",rules:[{required:!0,message:t("Please type your password confirmation code.")}],placeholder:t("confirmation code"),prefix:(0,y.jsx)(u.A,{style:{color:x.VG}})},[k,I]=(0,j.Lv)(),[C,T]=(0,j.kg)(),[E,L]=(0,i.useState)("");(0,i.useEffect)((()=>{I.isError&&r.error({message:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:I.error.data.code}}),description:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:I.error.data.message}}),placement:"bottomRight"})}),[I,r]),(0,i.useEffect)((()=>{T.isError&&r.error({message:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:T.error.data.code}}),description:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:T.error.data.message}}),placement:"bottomRight"}),T.isSuccess&&(r.success({message:t("Your password successfully reset."),description:t("Try sign in with your new password."),placement:"bottomRight"}),s("/auth",{replace:!0}))}),[T,s,t,r]);return(0,y.jsxs)("div",{className:g()("recover-password-form",{[e]:e}),children:[!I.isSuccess&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"recover-password-form__heading",children:[(0,y.jsx)(A,{level:2,style:{fontWeight:500,fontSize:24},children:t("Forgot the password?")}),(0,y.jsx)(b,{className:"recover-password-form__sub-title",children:t("Enter your email address and we will send you password reset instructions.")})]}),(0,y.jsxs)(a.A,{name:"recover_password_form",initialValues:{remember:!0},onFinish:e=>{L(e.email),(0,f.d)({event:"submit_form",action:"password_recovery",label:e.email}),k({email:e.email})},onFinishFailed:()=>{},autoComplete:"off",children:[(0,y.jsx)(a.A.Item,{name:w.name,rules:w.rules,children:(0,y.jsx)(l.A,{size:"large",disabled:I.isLoading,placeholder:w.name,prefix:w.prefix})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(o.Ay,{size:"large",loading:I.isLoading,block:!0,type:"primary",htmlType:"submit",className:"em-analytics__password-reset",children:t("Send")})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(h.N_,{to:"/auth",children:t("Back to Log In")})})]})]}),I.isSuccess&&!T.isSuccess&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"recover-password-form__heading",children:[(0,y.jsx)(A,{level:2,style:{fontWeight:500,fontSize:24},children:t("Set new password")}),(0,y.jsx)(b,{className:"recover-password-form__sub-title",children:t("Enter the confirmation code from the email and set a new password.")})]}),(0,y.jsxs)(a.A,{name:"set_new_password_form",initialValues:{remember:!0},onFinish:e=>{C({email:E,password:e.password,code:e.code})},onFinishFailed:()=>{},autoComplete:"off",children:[(0,y.jsx)(a.A.Item,{name:N.name,rules:N.rules,extra:t("At least 8 characters, including a combination of uppercase and lowercase letters, numbers, and special characters."),children:(0,y.jsx)(l.A.Password,{readOnly:!n,onFocus:()=>_(!0),size:"large",type:"password",disabled:T.isLoading,placeholder:t("new password"),prefix:N.prefix})}),(0,y.jsx)(a.A.Item,{name:S.name,rules:S.rules,children:(0,y.jsx)(l.A,{size:"large",disabled:T.isLoading,placeholder:S.placeholder,prefix:S.prefix})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(o.Ay,{size:"large",loading:T.isLoading,block:!0,type:"primary",htmlType:"submit",children:t("Recover password")})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(h.N_,{to:"/auth",children:t("Back to Log In")})})]})]})]})},N=()=>(0,y.jsx)(r.A,{className:"recover-password-page",children:(0,y.jsx)(w,{className:"recover-password-page__form"})})},70431:(e,t,s)=>{s.d(t,{A:()=>_});var i=s(92810),r=s(12280),n=s(14852),a=s(43005),l=s(55039),o=s(71157),c=s(45934),d=s(23287),m=s(93563),u=s(64936),p=s(85163),h=s(70082);const _=({folder:e,refetch:t})=>{const{__:s,_x:_}=(0,d.s9)(),g=(0,c.wA)(),[v]=r.A.useForm(),j=(0,i.useRef)(null),x=(0,c.d4)(u.cL)===p.lx.EDIT_FOLDER_NAME_MODAL,f=(0,o.hN)(),{folderId:y=null,folderName:A=""}=e,b=()=>g((0,u.Oo)()),[w,N]=(0,m.$s)();(0,i.useEffect)((()=>{x&&v.setFieldsValue({name:A})}),[x,A,v]);const S=()=>{v.validateFields().then((({name:e})=>{w({id:y,data:{name:e}}).then((({data:e,error:i})=>{i?(f.error({message:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:i.data.code}}),description:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:i.data.message}}),placement:"bottomRight"}),v.setFieldValue("name",A)):(t().then((({data:e})=>{if(e){var t,s,i;const r=null===(t=e[0])||void 0===t||null===(s=t.children)||void 0===s||null===(i=s.find((e=>e.id===y)))||void 0===i?void 0:i.name;v.setFieldValue("name",r)}})),b(),f.success({message:s("The folder \u201c")+A+_("\u201d was successfully changed to \u201c","folder")+e.name+s("\u201d."),placement:"bottomRight"}))}))}))};return(0,h.jsx)(n.A,{title:s("Change folder name"),open:x,onOk:S,onCancel:b,className:"new-folder-name-modal",centered:!0,footer:[(0,h.jsx)(a.Ay,{type:"primary",size:"large",loading:N.isLoading,onClick:S,children:s("Change name")},"submit")],children:(0,h.jsx)(r.A,{form:v,layout:"vertical",name:"rename_folder_form",onFinish:S,initialValues:{remember:!1,name:A},autoComplete:"off",style:{paddingTop:10},children:(0,h.jsx)(r.A.Item,{name:"name",rules:[{required:!0,message:s("Please enter the folder name")}],children:(0,h.jsx)(l.A,{disabled:N.isLoading,size:"large",placeholder:s("Enter the folder name"),ref:j,style:{marginBottom:5}})})})})}},33284:(e,t,s)=>{s.d(t,{A:()=>p});var i=s(92810),r=s(43005),n=s(45934),a=s(33206),l=s(56920),o=s(86286),c=s(62303),d=s(32269),m=s(23287),u=s(70082);const p=()=>{const{__:e}=(0,m.s9)(),{notification:t}=a.A.useApp(),s=(0,n.d4)(o.C1),[p]=(0,l.C)(),[h,_]=(0,i.useState)(!1);(0,i.useEffect)((()=>{s.hasOwnProperty("email_confirmation")&&_(s.email_confirmation)}),[s,h]);return null!==s&&void 0!==s&&s.email_confirmation||null===s||void 0===s||!s.privacy_policy_agreement?null:(0,u.jsx)("div",{className:"main__ribbon",children:(0,u.jsxs)("span",{children:[(0,u.jsx)(c.A,{icon:"EmailConfirmation",style:{fontSize:20,position:"relative",top:2}})," ",e("Confirmation email was sent to"),"\xa0",(0,u.jsx)("em",{children:s.email}),".\xa0",e("Didn't receive an email?"),"\xa0",(0,u.jsxs)(r.Ay,{type:"primary",size:"small",style:{fontSize:16,lineHeight:1},onClick:()=>{p({userId:s.id,email:s.email}).then((({data:i,error:r})=>{i?(0,d.wB)(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",s.email),t):r&&(0,d.p6)(r,t)}))},children:[e("Resend")," ",(0,u.jsx)(c.A,{icon:"SendOutlined",style:{verticalAlign:"middle"}})]})]})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[3144],{56991:(e,t,n)=>{n.d(t,{bD:()=>s,Mu:()=>a,cM:()=>c,rD:()=>d});var i=n(45934),o=n(33481),r=n(71210);function s(e,t){if(e!==t){if(!e||!t||"object"!==typeof e||"object"!==typeof t)return!1;const n=t instanceof Array;if(e instanceof Array){if(!n)return!1;const i=e.length;if(t.length!==i)return!1;for(let n=0;n<i;n++)if(!s(e[n],t[n]))return!1}else if(n)return!1;const i=Object.keys(e),o=Object.keys(t),r=i.length;if(r!==o.length)return!1;for(let a=0;a<r;a++){const n=i[a];if(!t.hasOwnProperty(n)||!s(e[n],t[n]))return!1}}return!0}function a(e){if(e){const{type:t,project:n,isNew:i,id:o}=e;return`/projects/${n}/${"block"===t?"blocks":"emails"}/${i?`new?template=${o}`:o}`}return""}function d(){return(0,i.d4)(o.zg)}function c(e,t,n){return null!==e&&void 0!==e&&e.length?e.map(((e,i)=>function(e){return e.hasOwnProperty("children")}(e)?{key:(0,r.l)(),value:e.value,label:e.label,children:c(e.children,t,n),type:e.type}:{key:(0,r.l)(),label:e.label,value:e.value,onClick:t=>{n(e.value,t.domEvent)}})):void 0}},33288:(e,t,n)=>{n.d(t,{di:()=>s});var i=n(95152),o=n(41664),r=n(23580);const s={getContainer:r.My,createIdentifier:o.Q,reducer:r.Ff,reducerPath:r.IP,getInstance:function(e,t){return(e instanceof i.m?e:(0,r.My)(e)).getInstance(t)},getInstanceAsync:function(e,t){return(e instanceof i.m?e:(0,r.My)(e)).getInstanceAsync(t)},getOrCreateInstance:function(e,t,n){return(e instanceof i.m?e:(0,r.My)(e)).getOrCreateInstance(t,n)},inject:function(e,t,n,i){return(0,r.My)(e).inject(t,n)},addService:function(e,t,n){return(0,r.My)(e).addService(t,n)},getServices:function(e,t){return(0,r.My)(e).getServices(t)},useInject:r.lg,useInstance:r.Nj,useInstanceAsync:r.rl,useServices:r.A$}},41664:(e,t,n)=>{n.d(t,{Q:()=>o});var i=n(71210);function o(e=(0,i.l)()){return e}},82375:(e,t,n)=>{n.d(t,{Q:()=>i});const i=new(n(95152).m)},30725:(e,t,n)=>{n.d(t,{T:()=>r,p:()=>o});var i=n(23580);function o(e){return(t,n,o,r)=>{const s=(0,i.My)(n);return e(s)(t,n,o,r)}}function r(e){return t=>(n,o,r,s)=>{const a=(0,i.My)(o),d=e(a);return t({restApi:d,container:a})(n,o,r,s)}}},77509:(e,t,n)=>{n.d(t,{j:()=>i});class i{constructor(e=[]){this._inner=e,this._isDisposed=!1}addDisposable(e){return this._inner.push(e),e instanceof i&&e.addDispose((()=>{this.removeDisposable(e)})),e}addDispose(e){this.addDisposable({dispose:e})}removeDisposable(e){const t=this._inner.indexOf(e);t>=0&&this._inner.splice(t,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const e of this._inner)e.dispose()}}}},45695:(e,t,n)=>{n.d(t,{K9:()=>f,QC:()=>l,XW:()=>u,ur:()=>c});var i=n(19378),o=n(33288),r=n(45934),s=n(41664),a=n(92810);const d=(0,s.Q)("MESSAGE_SERVICE");function c(){const e=l();return(0,a.useCallback)((t=>{e.setTarget(t instanceof Element?t.contentWindow:t)}),[e])}function l(){const e=(0,r.Pj)();return(0,a.useMemo)((()=>function(e){return o.di.getOrCreateInstance(e,d,(()=>new i.bg))}(e)),[e])}function u(){const e=l();return(0,a.useCallback)((function(t){e.send(t)}),[e])}function f(){const e=l();return(0,a.useCallback)((function(t,n){e.send(t,n)}),[e])}},47381:(e,t,n)=>{n.d(t,{d:()=>i});const i=(e,t)=>{const n=()=>{try{const t={...e,appLabel:"blocks_app"};window.dataLayer&&"function"===typeof window.dataLayer.push?window.dataLayer.push(t):console.log("Attempting to add to the dataLayer:",e)}catch(t){console.error("\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 GTM:",t)}};t?setTimeout(n,t):n()}},71210:(e,t,n)=>{function i(){var e=(new Date).getTime(),t="undefined"!==typeof performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(n){var i=16*Math.random();return e>0?(i=(e+i)%16|0,e=Math.floor(e/16)):(i=(t+i)%16|0,t=Math.floor(t/16)),("x"===n?i:3&i|8).toString(16)}))}n.d(t,{l:()=>i})},89698:(e,t,n)=>{n.d(t,{V:()=>c});var i=n(85163),o=n(45695),r=n(23287),s=n(92810),a=n(45934),d=n(86286);function c(){const e=(0,o.QC)(),t=(0,a.d4)(d.C1),{__:n}=(0,r.s9)(),[c,l]=(0,s.useState)("");(0,s.useEffect)((()=>{if(t.locale!==c){const o=(0,i.QV)(n),r=e.onInit((()=>{e.send(i.Ru.SANDBOX_TRANSLATIONS,{name:t.locale,data:o}),l(t.locale)}));return()=>r.dispose()}}),[t.locale,c,l,n,e]),(0,s.useEffect)((()=>{const t=e.addListener(i.Ru.RELOAD,(()=>{l("")}));return()=>t.dispose()}),[l,e])}},37969:(e,t,n)=>{n.d(t,{y:()=>d});var i=n(85163),o=n(45695),r=n(92810),s=n(70082);const a=Symbol("isIframeEvent");function d({children:e}){const[t,n]=(0,r.useState)(),[d,c]=(0,r.useState)(),[l,u]=(0,r.useState)(!1),f=(0,o.QC)();return(0,r.useEffect)((()=>{if(t){const e=f.addListener(i.Ru.APPLICATION_IFRAME_DRAG_EVENT,(e=>{if("drageleave"!==e.type&&"dragenter"!==e.type){const n=t.getBoundingClientRect(),i=e.clientX+n.x+window.scrollX,o=e.clientY+n.y+window.scrollY,r=document.elementFromPoint(i,o);if(r){const t=new DataTransfer,n=new DragEvent(e.type,{clientX:i,clientY:o,cancelable:!0,bubbles:!0,dataTransfer:t});n[a]=!0,r.dispatchEvent(n)}}}));return()=>e.dispose()}}),[f,t]),(0,r.useEffect)((()=>{const e=e=>{e[a]||u(!0)},t=e=>{e[a]||u(!1)};return window.addEventListener("dragstart",e),window.addEventListener("dragend",t),()=>{window.removeEventListener("dragstart",e),window.removeEventListener("dragend",t)}}),[d]),(0,r.useEffect)((()=>{const e=e=>{if(!e[a]){var t;const n=d.getBoundingClientRect();f.send(i.Ru.SANDBOX_DRAG_EVENT,{value:(null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("Text"))||"",type:e.type,clientX:e.pageX-n.x-window.scrollX,clientY:e.pageY-n.y-window.scrollY})}};if(d)return d.addEventListener("dragenter",e),d.addEventListener("dragover",e),d.addEventListener("dragleave",e),d.addEventListener("drop",e),d.addEventListener("dragend",e),()=>{d.removeEventListener("dragenter",e),d.removeEventListener("dragover",e),d.removeEventListener("dragleave",e),d.removeEventListener("drop",e),d.removeEventListener("dragend",e)}}),[d,f]),(0,s.jsxs)("div",{ref:n,children:[l&&(0,s.jsx)("div",{ref:c,className:"iframe-provider"}),e]})}},43672:(e,t,n)=>{n.d(t,{w:()=>c});var i=n(95838),o=n(85163),r=n(56991),s=n(45695),a=n(92810);const{useToken:d}=i.A;function c(){const e=(0,s.QC)(),{token:t}=d(),[n,i]=(0,a.useState)();(0,a.useEffect)((()=>{if(!(0,r.bD)(n,t)){const n=e.onInit((()=>{e.send(o.Ru.SANDBOX_SET_THEME_VARIABLES,t),i(t)}));return()=>n.dispose()}}),[t,n,i,e]),(0,a.useEffect)((()=>{const t=e.addListener(o.Ru.RELOAD,(()=>{i(void 0)}));return()=>t.dispose()}),[i,e])}},38920:(e,t,n)=>{n.d(t,{r:()=>_});var i=n(85163),o=n(59287),r=n(92810),s=n(45934),a=n(64617),d=n(17581),c=n(53204),l=n(47358),u=n(65983),f=n(39738),v=n(86286),m=n(56991),p=n(32411),y=n(83863),h=n(71157),g=n(42068),E=n(47381);function _(e){const{emailId:t,projectId:n}=(0,a.g)(),_=(0,h.hN)(),b=(0,m.rD)(),A=(0,s.d4)(c.M),w=(0,p.fn)(),S=(0,r.useRef)(0),T=(0,s.d4)(f.p1),C=(0,s.d4)(l.Wm),D=(0,s.d4)(l.B),I=(0,s.d4)(v.C1),[N,x]=(0,d.LX)(),R=(0,s.wA)(),{isSuccess:k,isLoading:O}=(0,d.YV)({emailId:t},{skip:!t}),[L,j]=(0,r.useState)(null);(0,r.useEffect)((()=>{if(k&&!O&&null!==T&&void 0!==T&&T.length){const n=T[0];var t;if(L!==(null===e||void 0===e?void 0:e.id))null!==(t=n.slug)&&void 0!==t&&t.includes("autosave")&&w&&R((0,u.no)(n)),j(null===e||void 0===e?void 0:e.id)}}),[R,T,k,O,null===e||void 0===e?void 0:e.id,L,w,t]);const M=(0,r.useCallback)((()=>{if(e){const t={title:e.title,project:e.project,html:(null===w||void 0===w?void 0:w.getValue())||"",excerpt:e.date_gmt,subject:e.subject,preheader:e.preheader,common_styles:e.common_styles};N({emailId:e.id,body:t}).then((r=>{if((0,E.d)({event:"save",action:"auto_save_email",email_id:e.id,project_id:n}),!function(e){return e.hasOwnProperty("data")}(r))throw r.error;var s,a;fetch((0,o.W)(i.Tm,n,null===(s=r.data)||void 0===s?void 0:s.id,null===(a=r.data)||void 0===a?void 0:a.modified),{mode:"no-cors"}),_.success({id:"EMAIL_AUTOSAVE_SUCCESS",data:t,message:""},!0)})).catch((e=>{_.fromError("EMAIL_AUTOSAVE_ERROR",t,e,!0),console.log(e)}))}}),[N,e,w,n,_]),[G,P]=(0,r.useState)(!1),V=(0,r.useCallback)((()=>{if((null===T||void 0===T?void 0:T.length)>0){const e=[...T].sort(((e,t)=>Date.parse(null===t||void 0===t?void 0:t.modified)-Date.parse(null===e||void 0===e?void 0:e.modified)))[0];Date.parse((new Date).toString())-Date.parse(null===e||void 0===e?void 0:e.modified)>1.5*((null===b||void 0===b?void 0:b.autosaveTimeout)||1e4)&&C&&!A&&"Discuss"!==D&&M()}else C&&!A&&"Discuss"!==D&&M()}),[T,A,C,D,M,null===b||void 0===b?void 0:b.autosaveTimeout]);(0,g.Z)((([e])=>{G&&!e&&(V(),P(!1))}),[G,V,P]);const X=null===I||void 0===I?void 0:I.autosaves,[U,B]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{U&&!A&&(clearTimeout(S.current),S.current=setTimeout((()=>P(!0)),(null===b||void 0===b?void 0:b.autosaveTimeout)||1e4),B(!1))}),[U,A,null===b||void 0===b?void 0:b.autosaveTimeout,P,B]),(0,r.useEffect)((()=>{if(X&&k&&void 0!==(null===e||void 0===e?void 0:e.id)){const t=(0,y.Og)(w,(()=>{C&&null!==e&&void 0!==e&&e.is_inited&&B(!0)}));return()=>{t.dispose()}}}),[w,B,X,k,null===e||void 0===e?void 0:e.id,C,null===e||void 0===e?void 0:e.is_inited]),(0,g.Z)((([t,n])=>{k&&void 0!==(null===e||void 0===e?void 0:e.id)&&C&&null!==e&&void 0!==e&&e.is_inited&&(t===(null===e||void 0===e?void 0:e.title)&&n===(null===e||void 0===e?void 0:e.common_styles)||B(!0))}),[null===e||void 0===e?void 0:e.title,null===e||void 0===e?void 0:e.common_styles,C,k,B,null===e||void 0===e?void 0:e.id,null===e||void 0===e?void 0:e.is_inited]),(0,r.useEffect)((()=>()=>{clearTimeout(S.current)}),[I,null===e||void 0===e?void 0:e.renderGuid]),(0,r.useEffect)((()=>{clearTimeout(S.current)}),[null===e||void 0===e?void 0:e.modified]),x}},9653:(e,t,n)=>{n.d(t,{U:()=>c});var i=n(85163),o=n(45695),r=n(32411),s=n(83863),a=n(42068),d=n(92810);const c=e=>{const t=(0,r.fn)(),n=(0,o.QC)(),c=(null===e||void 0===e?void 0:e.html)||"",l=(0,d.useRef)();l.current=e;const u=(0,d.useCallback)((e=>{const t=l.current;if(e===(null===t||void 0===t?void 0:t.renderGuid))return n.sendAsync(i.Ru.SANDBOX_INITED,{guid:t.renderGuid})}),[n]),f=(0,d.useCallback)((e=>{const t=l.current;if(e===(null===t||void 0===t?void 0:t.renderGuid))return n.sendAsync(i.Ru.SANDBOX_INIT_START,{guid:t.renderGuid})}),[n]),v=(0,d.useCallback)((async e=>{const o=l.current;if((null===o||void 0===o?void 0:o.renderGuid)===e){const e=null===c||void 0===c?void 0:c.replaceAll("\r\n","\n");try{(0,s.po)(t),t.setValue(e)}finally{(0,s.SF)(t)}const r=t.getValue();await n.sendAsync(i.Ru.SANDBOX_SET_ENTITY,{html:r,guid:null===o||void 0===o?void 0:o.renderGuid})}}),[c,t,n]);(0,a.Z)((async([t])=>{const n=null===e||void 0===e?void 0:e.renderGuid;n&&n!==t&&(await f(n),await v(n),await u(n))}),[null===e||void 0===e?void 0:e.renderGuid,null===e||void 0===e?void 0:e.id,v])}},69106:(e,t,n)=>{n.d(t,{f:()=>m});var i=n(85163),o=n(13522),r=n(45695),s=n(93982),a=n(32411),d=n(83863),c=n(42068),l=n(92810),u=n(65983),f=n(8493),v=n(45934);const m=(e,t)=>{const n=(0,v.wA)(),m=(0,a.fn)(),p=(0,r.QC)(),y=(0,s.ml)(o.A.WILL_EMAIL_INIT_ID),h=(0,s.ml)(o.A.ON_EMAIL_INIT_ID),g=(0,s.ml)(o.A.ON_CONTENT_CHANGED_ID),E=(0,s.ml)(o.A.ON_EMAIL_CHANGED_ID),_=(0,s.ml)(o.A.ON_MODEL_CHANGE),b=(0,l.useRef)(!1),A=(0,l.useRef)();A.current=e,(0,l.useEffect)((()=>{const n=A.current;if(i.EW.isPlugin&&!b.current&&(null===e||void 0===e?void 0:e.renderGuid)===(null===n||void 0===n?void 0:n.renderGuid)&&n){const e=m.getValue();E.fire({...n,id:t||n.isNew?void 0:n.id,html:e})}}),[m,e,E,t]),(0,c.Z)((([e])=>{e!==m&&_.fire(m)}),[m,_]),(0,l.useEffect)((()=>{if(i.EW.isPlugin){const n=m.onDidChangeContent((()=>{const n=A.current;if(!b.current&&(null===e||void 0===e?void 0:e.renderGuid)===(null===n||void 0===n?void 0:n.renderGuid)&&n){const e=m.getValue();g.fire(e),E.fire({...n,id:t||n.isNew?void 0:n.id,html:e})}}));return()=>n.dispose()}}),[m,g,E,e,t]);const w=(0,l.useCallback)((async()=>{const e=A.current;try{var t;(0,d.po)(m),m.setValue((null===e||void 0===e||null===(t=e.html)||void 0===t?void 0:t.replaceAll("\r\n","\n"))||"")}finally{(0,d.SF)(m)}const n=m.getValue();await p.sendAsync(i.Ru.SANDBOX_SET_ENTITY,{html:n,guid:e.renderGuid})}),[m,p]),S=(0,l.useCallback)((async()=>{const e=A.current;await p.sendAsync(i.Ru.SANDBOX_SET_ENTITY,{html:m.getValue(),guid:e.renderGuid})}),[m,p]),T=(0,l.useCallback)((async()=>{const e=A.current;void 0!==e.preheader&&await p.sendAsync(i.Ru.SANDBOX_PREHEADER_UPDATE,{value:e.preheader,guid:e.renderGuid,force:!0})}),[p]),C=(0,l.useCallback)((async()=>{const e=A.current;void 0!==e.subject&&await p.sendAsync(i.Ru.SANDBOX_SUBJECT_UPDATE,{value:e.subject,guid:e.renderGuid,force:!0})}),[p]),D=(0,l.useCallback)((()=>{const e=A.current;return p.sendAsync(i.Ru.SANDBOX_INITED,{guid:e.renderGuid})}),[p]),I=(0,l.useCallback)((()=>{const e=A.current;return n(void 0===e.id?(0,f.Uh)(!0):(0,u.Wm)(!0)),h.fire({...e,id:t||e.isNew?void 0:e.id,html:m.getValue()})}),[n,h,m,t]),N=(0,l.useCallback)((()=>{const e=A.current;return p.sendAsync(i.Ru.SANDBOX_INIT_START,{guid:e.renderGuid})}),[p]),x=(0,l.useCallback)((()=>{const e=A.current;return y.fire({...e,id:t||e.isNew?void 0:e.id,html:m.getValue()})}),[m,y,t]),[R]=(0,c.c)((async function*(){try{b.current=!0,yield N(),yield x(),yield w(),yield T(),yield C(),yield D(),yield I()}finally{b.current=!1}}),[w,T,C,I,x,N,D]),[k]=(0,c.c)((async function*(){try{yield await N(),yield await x(),yield await S(),yield await T(),yield await C(),yield await D(),yield await I()}finally{}}),[w,T,C,I,x,N,D]);(0,c.Z)((async([t])=>{const n=null===e||void 0===e?void 0:e.renderGuid;n&&n!==t&&R()}),[null===e||void 0===e?void 0:e.renderGuid,R]),(0,l.useEffect)((()=>{const e=p.addListenerAsync(i.Ru.RELOAD,(async()=>{await k()}));return()=>e.dispose()}),[p,k])}},14598:(e,t,n)=>{n.d(t,{QM:()=>a,q2:()=>u});var i=n(60564),o=n.n(i),r=n(58689),s=n(81158);function a(e,t){const n=document.createElement("input");n.type="file",n.accept=e,n.multiple=!0,n.onchange=()=>{var e;null!==(e=n.files)&&void 0!==e&&e.length&&t(n.files)},n.click()}const d="index.html";function c(e,t){return e.find((function(e){return e.name.toLowerCase().endsWith(t)}))}async function l(e,t,n){return await(0,r.bc)(e,(async e=>{e=e.replace("\\","/");const n=(0,r.$l)(e);return t(e,n)}),n)}async function u(e,t,n){if(e){switch(function(e){const t=e.split(".");return t[t.length-1].toLowerCase()}(e.name)){case"zip":return async function(e,t,n){var i=new(o());const{files:s}=await i.loadAsync(e),a=Object.keys(s).map((e=>s[e])),l=s[d]||c(a,d)||c(a,".html")||c(a,".htm");if(l){const e=l.name.split("/"),i=document.location.pathname.split("/"),o=document.location.origin+i.slice(0,i.length-e.length).join("/")+"/",a=await l.async("text");return await(0,r.bc)(a,(async e=>{(e=e.replace("\\","/")).startsWith(".")&&(e=e.substring(1)),e.startsWith("/")&&(e=e.substring(1)),e.startsWith(o)&&(e=e.substring(o.length));const n=s[e];if(n){const e=n.name,i=await n.async("blob");return t(i,e)}const i=(0,r.$l)(e);return t(e,i)}),n)}}(e,t,n);case"eml":{const i=await e.text(),o=(0,s.bZ)(i);if(o instanceof Error)throw o;const r="string"===typeof o?o:o.html;if("undefined"===typeof r)throw new Error("Eml not contains text/html");return l(r,t,n)}default:return l(await e.text(),t,n)}}}},44396:(e,t,n)=>{n.d(t,{Q:()=>a});var i=n(12231),o=n(70609);const r=100;class s extends i.m{constructor(e,t,n,i){super(e,t,n,i),this._onScrollDisposable=null,this._editor=e}updateColorDecorators(e){if(this._onScrollDisposable&&(this._onScrollDisposable.dispose(),this._onScrollDisposable=null),e.length>=500){const t=this._editor;let[n,i]=[Number.MAX_VALUE,Number.MIN_VALUE];const o=()=>{const o=t.getVisibleRanges(),[s,a]=o.reduce(((e,{startLineNumber:t,endLineNumber:n})=>[Math.min(t,e[0]),Math.max(n,e[1])]),[Number.MAX_VALUE,Number.MIN_VALUE]);if(n-s>r||a-i>r){let t=e.filter((({colorInfo:e})=>{const{startLineNumber:t,endLineNumber:n}=e.range;return s-t<r&&n-a<r}));super.updateColorDecorators(t)}};this._onScrollDisposable=t.onDidScrollChange(o),o()}else super.updateColorDecorators(e)}dispose(){var e;null===(e=this._onScrollDisposable)||void 0===e||e.dispose(),super.dispose()}}function a(){(0,o.D0)(s.ID,(()=>s))}},36671:(e,t,n)=>{n.d(t,{h:()=>_});var i=n(92810),o=n(70609),r=n(85163),s=n(32411),a=n(64037),d=n(71157),c=n(45934),l=n(86286),u=n(23287),f=n(39217),v=n(45695),m=n(77509),p=n(83863);const y=1e3,h=1e3,g=10,E="iframe_errors";function _(e,t){const{__:n}=(0,u.s9)(),_=(0,v.QC)(),b=(0,s.aD)(e),{error:A}=(0,d.hN)(),w=(0,i.useRef)(0),S=(0,i.useRef)(!1),T=(0,c.d4)(l.C1),C=(0,i.useCallback)((e=>new Promise(((t,n)=>{const i=_.addListener(r.Ru.SANDBOX_READY,(()=>{i.dispose(),t()}));e&&setTimeout((()=>{i.dispose(),n("timeout")}))}))),[_]),D=(0,i.useCallback)((i=>{C(h).catch((e=>console.log(e))).finally((()=>{Promise.resolve().then((()=>{if(!S.current){w.current++;for(let e=0;e<w.current;e++)b.canUndo()?b.undo():S.current=!0;setTimeout((()=>{if(0===--w.current){const o={past:b.getPast().slice(0,g),future:b.getFuture(),errorResolved:!S.current,text:e.getValue(),message:i.message,stack:i.stack,userId:null===T||void 0===T?void 0:T.id,entityId:null===t||void 0===t?void 0:t.id,entityType:document.location.pathname.indexOf("emails")>0?"email":"block"};console.log(o),A({id:"IFRAME_ERROR",data:o,message:n("Something went wrong")}),f.CJ.post(E,o).catch((e=>console.log(e))),S.current=!1}}),h)}}))}))}),[b,e,A,null===T||void 0===T?void 0:T.id,null===t||void 0===t?void 0:t.id,n,C]);(0,a.A)(r.Ru.APPLICATION_DOMPARSER_ERROR,D),(0,i.useEffect)((()=>{let n=null,i=0;function s(e){const t=[];for(const{rangeOffset:n,rangeLength:i,text:o}of e.changes)t.push({range:{start:n,end:n+i},text:o});return t}let a=!1;const d=new m.j;return d.addDisposable((0,p.Og)(e,(e=>(async e=>{if(a)await _.sendAsync(r.Ru.SANDBOX_UPDATE_ENTITY,{edits:[s(e)],guid:t.renderGuid});else if(n)n.push(e);else{n=[e];do{const e=n.splice(0,n.length);await _.sendAsync(r.Ru.SANDBOX_UPDATE_ENTITY,{edits:e.map(s),guid:t.renderGuid})}while(n.length);n=null}})(e).catch((e=>console.log(e)))))),d.addDisposable(_.addListener(r.Ru.APPLICATION_UPDATE_ENTITY,(function({guid:n,edits:r,pushUndoStop:s}){if(e&&n===t.renderGuid)try{a=!0;const t=(0,o.yc)();let n=t.canUndo(e.uri),d=t.canRedo(e.uri);const c=r.map((({text:t,range:n})=>{const i=e.getPositionAt(n.start),o=e.getPositionAt(n.end);return{text:t,range:{startColumn:i.column,startLineNumber:i.lineNumber,endColumn:o.column,endLineNumber:o.lineNumber}}}));s||n||d?e.pushEditOperations([],c,(()=>null)):e.applyEdits(c),!1!==s&&(i&&clearTimeout(i),i=setTimeout((()=>{e.pushStackElement(),i=0}),y))}finally{a=!1}}))),()=>{d.dispose(),i&&clearTimeout(i)}}),[e,_,t.renderGuid])}},32411:(e,t,n)=>{n.d(t,{$Z:()=>l,TW:()=>d,aD:()=>c,fn:()=>u,kx:()=>a});var i=n(70609),o=n(92810),r=n(71070),s=n(11305);const a=(0,o.createContext)(null);function d(e){const t=(0,i.yc)(),[n,r]=(0,o.useState)({canUndo:t.canUndo(e.uri),canRedo:t.canRedo(e.uri)});return(0,o.useEffect)((()=>{const n=e.onDidChangeContent((()=>{setTimeout((()=>r({canUndo:t.canUndo(e.uri),canRedo:t.canRedo(e.uri)})))}));return()=>{n.dispose()}}),[e,t]),n}function c(e){function t(e){var t;const n=(null===e||void 0===e||null===(t=e.actual)||void 0===t?void 0:t._data)||new s.Ov;return n instanceof s.Ov?n:s.Ov.deserialize(n)}const n=(0,i.yc)();return{undo:()=>n.undo(e.uri),redo:()=>n.redo(e.uri),clear:()=>n.removeElements(e.uri),getPast:()=>{var i,o;return(null===(i=n._editStacks.get(e.uri.toString()))||void 0===i||null===(o=i._past)||void 0===o?void 0:o.map(t))||[]},getFuture:()=>{var i,o;return(null===(i=n._editStacks.get(e.uri.toString()))||void 0===i||null===(o=i._future)||void 0===o?void 0:o.map(t))||[]},canUndo:()=>n.canUndo(e.uri),canRedo:()=>n.canRedo(e.uri)}}function l(e="",t="html"){const n=r.editor.createModel(e,t);return n.setEOL(r.editor.EndOfLineSequence.LF),n}function u(){return(0,o.useContext)(a)}},83863:(e,t,n)=>{n.d(t,{Og:()=>s,SF:()=>r,po:()=>o});const i=new Set;function o(e){return i.add(e),{dispose(){r(e)}}}function r(e){i.delete(e)}function s(e,t){let n=e.getVersionId(),o=[];const r=e.onDidChangeContent((r=>{if(r.versionId>n+1){let s=e.onDidChangeContent((a=>{if(r.versionId===n+1)try{i.has(e)||t(r)}catch(d){console.log(d)}finally{n=r.versionId;let e=o.indexOf(s);e>=0&&o.splice(e,1),s.dispose()}}));o.push(s)}else try{i.has(e)||t(r)}catch(s){console.log(s)}finally{n=r.versionId}}));return{dispose:()=>{r.dispose(),o.forEach((e=>e.dispose()))}}}},70609:(e,t,n)=>{n.d(t,{D0:()=>s,yc:()=>a});var i=n(50051),o=n(75793),r=n(24554);function s(e,t){const n=i.dS.getEditorContributions().find((t=>t.id===e));if(!n)throw new Error(`No contribution ${e}`);n.ctor=t(n)}function a(){return e=r.$D,o.QE.get(e);var e}},71157:(e,t,n)=>{n.d(t,{Gy:()=>f,O5:()=>p,hN:()=>m,x_:()=>v});var i=n(13522),o=n(93982),r=n(92810),s=n(33206),a=n(13329),d=n(28316),c=n(814),l=n(70082);const u="bottomRight";function f(e){return{id:e.id,code:e.html,title:e.title,subject:e.subject,preheader:e.preheader}}function v(e){return{id:e.id,code:e.html,title:e.title}}function m(){const e=(0,o.ml)(i.A.ON_NOTIFICATION),{notification:t}=s.A.useApp(),n=(0,r.useCallback)(((n,i)=>{n.type||(n={...n,type:"info"}),e.fire((0,c.TB)({id:n.id,type:n.type,data:n.data,innerException:n.innerException})).then((e=>{if(e.every((e=>!1!==e))){n={...n};for(const t of e)"object"===typeof t&&Object.assign(n,t,t.style?{style:{...t.style,...n.style}}:{},t.props?{props:{...t.props,...n.props}}:{},t.className?{className:n.className?`${n.className} ${t.className}`:t.className}:{});i||((n=Object.assign(n,...e.filter((e=>"object"===typeof e)))).placement||(n.placement=u),t[n.type](n))}}))}),[t,e]),a=(0,r.useCallback)(((e,t)=>n({...e,type:"error"},t)),[n]),d=(0,r.useCallback)(((e,t)=>n({...e,type:"success"},t)),[n]),f=(0,r.useCallback)(((e,t)=>n({...e,type:"warning"},t)),[n]),v=(0,r.useCallback)(((e,t,n,i,o=u)=>{var r,s;n&&a({id:e,data:t,message:n.data instanceof Error?"":(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(r=n.data)||void 0===r?void 0:r.code)||n.status||n}}),description:(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(s=n.data)||void 0===s?void 0:s.message)||n.error}}),placement:o,innerException:(null===n||void 0===n?void 0:n.data)instanceof Error?n.data:n},i)}),[a]);return(0,r.useMemo)((()=>({notify:n,success:d,error:a,warning:f,fromError:v})),[n,d,a,f,v])}function p(){const{notify:e}=m();(0,a.D3)(d.Sb,e)}},23287:(e,t,n)=>{n.d(t,{CY:()=>a,s9:()=>d});var i=n(92810),o=n(42108);function r(e){return{__:e.__.bind(e),_x:e._x.bind(e),_n:e._n.bind(e),_nx:e._nx.bind(e),sprintf:o.nv,isRTL:e.isRTL.bind(e),hasTranslation:e.hasTranslation.bind(e)}}const s=(0,i.createContext)(r(o.y3));function a(e){const{children:t,i18n:n=o.y3}=e,[,a]=(0,i.useReducer)((()=>[]),[]);(0,i.useEffect)((()=>n.subscribe(a)),[n]);const d=(0,i.useMemo)((()=>r(n)),[n]);return(0,i.createElement)(s.Provider,{value:d},t)}const d=()=>(0,i.useContext)(s)},42068:(e,t,n)=>{n.d(t,{Z:()=>o,c:()=>r});var i=n(92810);const o=(e,t)=>{const n=(0,i.useRef)();n.current=e;const o=(0,i.useRef)(void 0);(0,i.useEffect)((()=>{null!==o.current&&n.current(o.current||[]),o.current=t}),t)};function r(e,t){const n=(0,i.useRef)(),o=(0,i.useRef)(),[r,s]=(0,i.useState)(0),a=(0,i.useCallback)((()=>{n.current&&(n.current=void 0,o.current=void 0,s(0))}),[s]);(0,i.useEffect)((()=>()=>a()),[a]);const d=(0,i.useCallback)(e,t);(0,i.useEffect)((()=>{if(r>0){const e=n.current;e&&e.next().then((e=>{e.done?(o.current.resolve(e.value),a()):s(r+1)}),(e=>{o.current.reject(e),a()}))}}),[r,s,a]);return[(0,i.useCallback)(((...e)=>(a(),n.current=d(...e),s(1),new Promise(((e,t)=>{o.current={resolve:e,reject:t}})))),[a,d,s]),a]}},69156:(e,t,n)=>{n.d(t,{A5:()=>l,FN:()=>c,Hk:()=>d,c8:()=>u});var i=n(92810),o=n(85163),r=n(45695);const s=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=dark]"),a=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=light]"),d=e=>{let t,n;e===o.IJ?(t=o.vd,n=o.F3):(t=e===o.T?o.y2:o.CJ,n=e===o.nd?o.y2:o.CJ),[...a].forEach((e=>{e.media=t})),[...s].forEach((e=>{e.media=n}))},c=(e={})=>{const t=document.querySelector("head"),n=document.createElement("style");if(n.type="text/css",n.dataset.themeVaribalse=!0,Object.entries(e).length){let i="";Object.entries(e).forEach((([e,t])=>{"object"!==typeof t&&(i+=`\t--${e}: ${t};\n`)})),i=`.blocks-body, .blocks-app, .ant-modal-root, .ant-tooltip, .ant-notification {\n${i}}`,n.appendChild(document.createTextNode(i));const o=t.querySelector('[data-theme-varibalse="true"]');o?t.replaceChild(n,o):t.insertBefore(n,t.firstChild)}},l=e=>{const t=document.body;t.classList.contains(e)||setTimeout((()=>{t.classList.remove(e===o.nd?o.T:o.nd),t.classList.add(e)}),200)},u=()=>{const e=(0,r.XW)();return(0,i.useCallback)((()=>{const t=window.localStorage.getItem(o.V0.em_color_scheme),n=matchMedia(o.F3).matches?o.nd:o.T,i=t||n;e({operation:o.Ru.UPDATE_PREVIEW,theme:i})}),[e])}},31770:(e,t,n)=>{function i(e){return e}function o({data:e,...t},n){return t.error?t:{data:n(e,t.meta),...t}}function r(e){return t=>o(t,e)}function s(e){return t=>o(t,((t,n)=>t.hasOwnProperty("previous")?e(t.previous,n):e(t,n)))}function a(e){return t=>function({data:e,...t},n){return t.error?t:{data:e.map((e=>n(e,t.meta))),...t}}(t,e)}n.d(t,{Ih:()=>a,PI:()=>s,SA:()=>o,SC:()=>r,ur:()=>i})},84869:(e,t,n)=>{function i(e,t){if("object"===typeof e&&e){t(e);for(const n of Object.values(e))i(n,t)}}function o(e=".blocks-app"){e=`${e} &`;const t=new WeakSet;return{visit:n=>{if(!t.has(n)){const o={};let r;for(const s of Object.keys(n)){const a=n[s];"object"===typeof a&&a?(a._keyframe&&i(a,(e=>t.add(e))),o[s]=a):(r||(r=o[e]={},t.add(r)),r[s]=a)}return o}return n}}}n.d(t,{A:()=>o})},44824:(e,t,n)=>{n.d(t,{e:()=>o});var i=n(85974);async function o(e,t){if("amp"===t){for(const t of e.querySelectorAll(".em-amp-show-disabled"))t.remove();await(0,i.Sc)(e,{mappedTags:{script:"___script"}})}else if("html"===t){for(const t of e.querySelectorAll(".em-amp-show-only"))t.remove();(0,i.Km)(e,{mappedTags:{script:"___script"}})}}},78451:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(92810),o=n(45934),r=n(64617),s=n(17581),a=n(65983);const d=()=>{const e=(0,o.wA)(),t=(0,o.d4)(a.zn);let n=(0,r.zy)();(0,i.useEffect)((()=>{/emails\/[0-9]+$/.test(n.pathname)||t&&e(s.GY.util.invalidateTags([{type:"Emails",id:+t}]))}),[n,e,t])}},64037:(e,t,n)=>{n.d(t,{A:()=>r});var i=n(92810),o=n(45695);function r(e,t){const n=(0,o.QC)();(0,i.useEffect)((()=>{const i=n.addListener(e,t);return()=>{i.dispose()}}),[n,e,t])}},31844:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(92810),o=n(64617),r=n(45934),s=n(86286),a=n(84568);const d=e=>{const t=(0,r.d4)(s.C1),[n,d]=(0,i.useState)({owner:!1,admin:!1}),c=(0,o.KC)(),{data:l}=(0,a.fo)(e,{skip:!e||!t.id||!(null!==c&&void 0!==c&&c.isUninitialized)}),u=(null===c||void 0===c?void 0:c.data)||l;return(0,i.useEffect)((()=>{if(u){var e,n;const{owner:i,admins:o,users:r}=u.members,s=o?o.map((e=>e.ID)):o,a=r?r.map((e=>e.ID)):r;d({owner:(null===(e=i.ID)||void 0===e?void 0:e.toString())===(null===(n=t.id)||void 0===n?void 0:n.toString()),admin:s&&s.includes(t.id),user:a&&a.includes(t.id)})}}),[u,t.id]),n}},3289:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(92810),o=n(45934),r=n(64617),s=n(87790),a=n(85163),d=n(90070);const c=()=>{const e=(0,o.wA)(),t=(0,d.p6)(),n=(0,o.d4)(s.Sl);let c=(0,r.zy)();(0,i.useEffect)((()=>{c.pathname.endsWith("/new")||n&&(e((0,s.X8)()),t.remove(a.A9.em_new_block))}),[c,n,e,t])}},19366:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(92810),o=n(45934),r=n(64617),s=n(8493),a=n(85163),d=n(90070);const c=()=>{const e=(0,d.p6)(),t=(0,o.wA)(),n=(0,o.d4)(s.$S);let c=(0,r.zy)();(0,i.useEffect)((()=>{c.pathname.endsWith("/new")||(e.remove(a.A9.em_new_email),e.remove(a.A9.em_template_email),n&&t((0,s.Et)()))}),[c,n,t,e])}},22197:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(85163);const o=e=>{if(!i.EW.isPlugin){let t="";t="EmailMaker",document.title=e+" - "+t}}},54416:(e,t,n)=>{e.exports=n.p+"static/media/frame_dark.318d7ed5.png"},98578:(e,t,n)=>{e.exports=n.p+"static/media/frame_light.22a9b4ec.png"},68777:(e,t,n)=>{e.exports=n.p+"static/media/frame_template_gallery.85693b39.png"},58889:e=>{e.exports=JSON.parse('{"yG":"iframe.60f94ceecdad1be3fab1.html","l5":"iframe-eblock.60f94ceecdad1be3fab1.html"}')}}]);
|