@emailmaker/emailmaker 1.0.63 → 1.0.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/asset-manifest.json +24 -24
- package/emailmaker-esm.js +1 -1
- package/emailmaker.js +1 -1
- package/iframe/{iframe-eblock.14f8a673f34d72ec88de.html → iframe-eblock.65025a3a3b961397985d.html} +1 -1
- package/iframe/{iframe.14f8a673f34d72ec88de.html → iframe.65025a3a3b961397985d.html} +1 -1
- package/iframe/js/cssbeautify.js +1 -1
- package/iframe/sandbox-eblock.js +1 -1
- package/iframe/sandbox.js +1 -1
- package/package.json +1 -1
- package/plugin.html +1 -1
- package/plugin_blocks_test.html +1 -1
- package/plugin_default.html +1 -1
- package/plugin_idigital.html +1 -1
- package/plugin_s.html +1 -1
- package/static/css/4529.35cacca2.css +1 -0
- package/static/css/5211.ee9091cb.css +1 -0
- package/static/css/{8995.641d0157.css → 8995.e03861fc.css} +1 -1
- package/static/js/1399.9b89879e.js +1 -0
- package/static/js/2574.b19cf539.js +1 -0
- package/static/js/{4529.2bb46065.js → 4529.c018e479.js} +1 -1
- package/static/js/5211.f95f3f6a.js +1 -0
- package/static/js/{7291.d2241d85.js → 7291.811d0dc1.js} +1 -1
- package/static/js/{7967.5136da11.js → 7967.249c928a.js} +1 -1
- package/static/js/{8689.aa776e90.chunk.js → 8689.d58c90cd.chunk.js} +1 -1
- package/static/js/{8995.54a7ed6e.js → 8995.cf63e259.js} +1 -1
- package/static/js/{emailmaker_core.6e2a56e1.js → emailmaker_core.f6105663.js} +1 -1
- package/translations.pot +63 -63
- package/static/css/4529.8008d20d.css +0 -1
- package/static/css/5211.61fd92f8.css +0 -1
- package/static/js/1399.162f8a92.js +0 -1
- package/static/js/2574.c0f56526.js +0 -1
- package/static/js/5211.d27a1e14.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[4529],{66047:(e,t,i)=>{i.r(t),i.d(t,{CancellationTokenSource:()=>n.CancellationTokenSource,Emitter:()=>n.Emitter,KeyCode:()=>n.KeyCode,KeyMod:()=>n.KeyMod,MarkerSeverity:()=>n.MarkerSeverity,MarkerTag:()=>n.MarkerTag,Position:()=>n.Position,Range:()=>n.Range,Selection:()=>n.Selection,SelectionDirection:()=>n.SelectionDirection,Token:()=>n.Token,Uri:()=>n.Uri,__esModule:()=>n.__esModule,editor:()=>n.editor,languages:()=>n.languages});i(12132),i(25401),i(58185),i(91426),i(71075),i(89879),i(68251),i(74028),i(23777),i(94951),i(21109),i(39455),i(10156),i(28902),i(901);var n=i(6295)},28316:(e,t,i)=>{i.d(t,{Kp:()=>n,Sb:()=>s,_1:()=>o});const n="SAVE",o="SHOW",s="NOTIFY"},85163:(e,t,i)=>{i.d(t,{A9:()=>l,BD:()=>me,Bv:()=>B,CJ:()=>m,EW:()=>a,F3:()=>A,F5:()=>o,G$:()=>W,IE:()=>q,IJ:()=>g,JE:()=>Z,Jy:()=>G,KI:()=>ne,N7:()=>F,ND:()=>le,QV:()=>pe,Qz:()=>Q,Rn:()=>Ee,Ru:()=>D,St:()=>V,T:()=>p,Tm:()=>J,UW:()=>_,Ug:()=>ue,V0:()=>d,VG:()=>f,Vp:()=>ce,Vv:()=>N,WU:()=>w,Y$:()=>ee,YY:()=>_e,_P:()=>c,aO:()=>$,bV:()=>S,e3:()=>ge,eA:()=>Y,eG:()=>ie,ff:()=>s,gY:()=>z,hc:()=>j,iU:()=>se,iV:()=>K,iW:()=>P,jg:()=>he,lx:()=>v,m3:()=>X,mU:()=>re,mX:()=>b,nA:()=>x,nd:()=>h,oy:()=>r,p5:()=>oe,rW:()=>T,rY:()=>U,rb:()=>M,rl:()=>te,ti:()=>I,vd:()=>E,wF:()=>ae,xz:()=>C,y2:()=>u,yI:()=>L,yo:()=>H,yy:()=>y,z$:()=>k,zh:()=>de,zx:()=>R});var n=i(19378);const o="LOADING",s="ERROR",r="useblocks",a={isPlugin:!1},c={isEditor:!1},l={em_token:"em_token",em_elements_view:"em_elements_view",em_new_block:"em_new_block",em_new_email:"em_new_email",em_id:"em_id",em_name:"em_name",em_email:"em_email",em_locale:"em_locale",em_carrotquest_hash:"em_carrotquest_hash",em_ducalis_hash:"em_ducalis_hash",em_email_subscription_consent:"em_email_subscription_consent",em_folder:"em_folder",promocode:"promocode",em_active_tab:"em_active_tab"},d={em_color_scheme:"em_color_scheme",em_code_mode_pane_sizes:"em_code_mode_pane_sizes",em_preview_pane_sizes:"em_preview_pane_sizes",em_default_sizes:"em_default_sizes",em_pane_sizes:"em_pane_sizes",em_test_emails:"em_test_emails",em_menu_is_locked:"em_menu_is_locked",em_code_mode_settings:"em_code_mode_settings",em_folder_is_open:"em_folder_is_open",em_active_tab:"em_active_tab",em_ai_settings:"em_ai_settings"},_="deleted",u="all",m="not all",p="light",h="dark",g="system",E="(prefers-color-scheme: light)",A="(prefers-color-scheme: dark)",f="#1890ff",v={ADD_NEW_PROJECT_MODAL:"ADD_NEW_PROJECT_MODAL",EDIT_PROJECT_MODAL:"EDIT_PROJECT_MODAL",BLOCKS_MODAL:"BLOCKS_MODAL",EDIT_PROFILE_MODAL:"EDIT_PROFILE_MODAL",SEND_TEST_EMAIL:"SEND_TEST_EMAIL",ADD_NEW_EBLOCK_MODAL:"ADD_NEW_EBLOCK_MODAL",ADD_NEW_EMAIL_MODAL:"ADD_NEW_EMAIL_MODAL",ADD_NEW_AI_EMAIL:"ADD_NEW_AI_EMAIL",SWITCH_TO_PLAN_MODAL:"SWITCH_TO_PLAN_MODAL",IMAGE_EDITOR_MODAL:"IMAGE_EDITOR_MODAL",ADD_NEW_FOLDER_MODAL:"ADD_NEW_FOLDER_MODAL",EDIT_FOLDER_NAME_MODAL:"EDIT_FOLDER_NAME_MODAL",ADD_NEW_GROUP_MODAL:"ADD_NEW_GROUP_MODAL",EDIT_GROUP_NAME_MODAL:"EDIT_GROUP_NAME_MODAL",UPLOAD_IMAGE_MODAL:"UPLOAD_IMAGE_MODAL",UPLOAD_BACKGROUND_MODAL:"UPLOAD_BACKGROUND_MODAL",UPLOAD_IMAGE_MODAL_AI:"UPLOAD_IMAGE_MODAL_AI",UPLOAD_BACKGROUND_MODAL_AI:"UPLOAD_BACKGROUND_MODAL_AI",UPLOAD_IMAGE_MODAL_STOCK:"UPLOAD_IMAGE_MODAL_STOCK",UPLOAD_BACKGROUND_MODAL_STOCK:"UPLOAD_BACKGROUND_MODAL_STOCK",UPLOAD_IMAGE_MODAL_GIF:"UPLOAD_IMAGE_MODAL_GIF",UPLOAD_BACKGROUND_MODAL_GIF:"UPLOAD_BACKGROUND_MODAL_GIF",UPLOAD_IMAGE_MODAL_EDIT:"UPLOAD_IMAGE_MODAL_EDIT",UPLOAD_BACKGROUND_MODAL_EDIT:"UPLOAD_BACKGROUND_MODAL_EDIT",UPLOAD_IMAGE_MODAL_UPLOAD:"UPLOAD_IMAGE_MODAL_UPLOAD",UPLOAD_BACKGROUND_MODAL_UPLOAD:"UPLOAD_BACKGROUND_MODAL_UPLOAD"};let O;!function(e){e[e.Amp=0]="Amp",e[e.HTML=1]="HTML",e[e.Everywhere=2]="Everywhere"}(O||(O={}));const D={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_PREVIEW:"update_preview",UPDATE_EDITOR:"update_editor",UPDATE_EDITOR_POSITION:"update_editor_position",UPDATE_SIDE_MENU_EDITOR:"update_side_menu_editor",SAVE_EMAIL:"saveEmail",SANDBOX_ELEMENT_SETTINGS_SET:"sandbox_element_settings_set",SANDBOX_EMAIL_SETTINGS_SET:"sandbox_email_settings_set",SANDBOX_BLOCK_SETTINGS_SET:"sandbox_block_settings_set",SANDBOX_ELEMENT_PARENT_GET:"sandbox_element_parent_get",SANDBOX_ELEMENT_PARENT_TABLE_GET:"sandbox_element_parent_table_get",SANDBOX_ELEMENT_PREV_GET:"sandbox_element_prev_get",SANDBOX_ELEMENT_NEXT_GET:"sandbox_element_next_get",SANDBOX_ELEMENT_REMOVE:"sandbox_element_remove",SANDBOX_ELEMENT_ACTIVE_RESET:"sandbox_element_active_reset",SANDBOX_ELEMENT_ACTIVE_SET:"sandbox_element_active_set",SANDBOX_ELEMENT_HOVER_SET:"sandbox_element_hover_set",SANDBOX_ELEMENT_IMG_LINK:"sandbox_element_img_link",SANDBOX_ELEMENT_TEXT:"sandbox_element_text",SANDBOX_EMAIL_CONTENT_GET:"sandbox_email_content_get",SANDBOX_SET_POSITION_TO_IMG:"sandbox_set_position_to_img",SANDBOX_SET_POSITION_TO_LINK:"sandbox_set_position_to_link",SANDBOX_ACCORDION_ADD_SECTION:"sandbox_accordion_add_section",SANDBOX_ACCORDION_REMOVE_SECTION:"sandbox_accordion_remove_section",APPLICATION_FOCUS_IN_IFRAME:"application_focus_in_iframe",APPLICATION_EMAIL_SETTINGS_SET:"application_email_settings_set",APPLICATION_BLOCK_SETTINGS_SET:"application_block_settings_set",APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",APPLICATION_ELEMENT_SETTINGS_CLOSE:"application_element_settings_close",APPLICATION_ACTION:"application_action",APPLICATION_EBLOCK_ADD:"application_eblock_add",APPLICATION_SCROLL_TO:"application_scroll-to",APPLICATION_SCROLL_BLOCK_SHOW:"application_scroll-block-show",APPLICATION_SCROLL_BLOCK_HIDE:"application_scroll-block-hide",APPLICATION_DISCUSS_SET_ID:"application_discuss_set_id",APPLICATION_DISCUSS_GET_COMMENT:"application_discuss_get_comment",APPLICATION_DISCUSS_NO_COMMENT:"application_discuss_no_comment",APPLICATION_DISCUSS_SAVE_TARGET:"application_discuss_save_target",APPLICATION_IFRAME_SET_HEIGHT:"application_iframe_set_height",APPLICATION_COMMON_STYLES_UPDATE:"application_commonStyles_update",APPLICATION_EMAIL_CONTENT_GET:"application_email_content_get",APPLICATION_OPEN_IMAGE_AI_POPUP:"application_open-image-ai-popup",APPLICATION_OPEN_IMAGE_UPLOAD_POPUP:"application_open-image-upload-popup",APPLICATION_OPEN_IMAGE_EDIT_POPUP:"application_open-image-edit-popup",APPLICATION_OPEN_IMAGE_GIF_POPUP:"application_open-image-gif-popup",APPLICATION_OPEN_IMAGE_STOCK_POPUP:"application_open-image-stock-popup",APPLICATION_CLOSE_IMAGE_EDIT_POPUP:"application_close-image-edit-popup",APPLICATION_SUBJECT_UPDATE:(0,n.Qm)("application_subject_update"),APPLICATION_PREHEADER_UPDATE:(0,n.Qm)("application_preheader_update"),APPLICATION_DOMPARSER_ERROR:(0,n.Qm)("application_domparser_error"),APPLICATION_UPDATE_ENTITY:(0,n.Qm)("application_update_entity"),APPLICATION_IFRAME_DRAG_EVENT:(0,n.Qm)("application_iframe_drag_event"),APPLICATION_HAS_AMP:(0,n.Qm)("application_has_amp"),SANDBOX_WINDOW_CHARACTERISTIC:"sandbox_window-characteristic",SANDBOX_IFRAME_SETSIZE:"sandbox_iframe-setsize",SANDBOX_BLOCK_INSERT:"sandbox_block-insert",SANDBOX_ATOM_INSERT:"sandbox_atom-insert",SANDBOX_DRAG_CANCEL:"sandbox_drag-cancel",UPDATE_EDITOR_POSITION_FROM_EDITOR:"update_position_from_editor",UPDATE_EDITOR_POSITION_FROM_IFRAME:"update_position_from_iframe",SANDBOX_CHANGE_PREVIEW:"sandbox_change_preview",APPLICATION_CHANGE_PREVIEW:"application_change_preview",SANDBOX_LOCK_EDIT:"sandbox_lock_edit",SANDBOX_FLOATBLOCK_ADD:"sandbox_floatBlock_add",SANDBOX_FLOATBLOCK_REMOVE:"sandbox_floatBlock_remove",EDITOR_CHANGE_FOCUS:"editor_change_focus",SANDBOX_RESIZED:"sandbox_resized",SANDBOX_LOCK_DISCUSS:"sandbox_lock_discuss",SANDBOX_DISCUSS_SET_TARGET:"sandbox_discuss_set_target",SANDBOX_DISCUSS_REMOVE_TARGET:"sandbox_discuss_remove_target",SANDBOX_DISCUSS_RESET:"sandbox_discuss_reset",SANDBOX_DISCUSS_GET_TARGET:"sandbox_discuss_get_target",SANDBOX_READY:(0,n.Qm)("SANDBOX_READY"),SANDBOX_FLOATBLOCK_WRAP:"sandbox_floatblock_wrap",SANDBOX_FLOATBLOCK_DIR:"sandbox_floatblock_dir",SANDBOX_SUBJECT_UPDATE:(0,n.Qm)("sandbox_subject_update"),SANDBOX_PREHEADER_UPDATE:(0,n.Qm)("sandbox_preheader_update"),SANDBOX_DRAG_EVENT:(0,n.Qm)("sandbox_drag_event"),SANDBOX_ADD_MERGETAG:(0,n.Qm)("sandbox_add_mergetag"),SANDBOX_TRANSLATIONS:(0,n.Qm)("sandbox_send_translations"),SANDBOX_SET_THEME_VARIABLES:(0,n.Qm)("sandbox_send_theme_variables"),SANDBOX_SET_ENTITY:(0,n.Qm)("sandbox_set_entity"),SANDBOX_INIT_START:(0,n.Qm)("sandbox_init_start"),SANDBOX_INITED:(0,n.Qm)("sandbox_inited"),SANDBOX_UPDATE_ENTITY:(0,n.Qm)("sandbox_update_entity"),RELOAD:(0,n.Qm)("reload"),SANDBOX_IS_EMAIL_EMPTY:(0,n.Qm)("sandbox_is_email_empty")},T={language:"html",detectIndentation:!1,wordWrap:"on",wrappingIndent:"same",smoothScrolling:!0,automaticLayout:!0,tabSize:2,indentSize:2};let S;!function(e){e.IMG="img",e.TEXT="text",e.LINK="a",e.TABLE="table",e.VINDENT="vindent",e.TD="td",e.STRUCTURE="structure",e.GROUP="group",e.BUTTON="button",e.DIV="div",e.FLOAT_BLOCK="floatBlock",e.VAR="var",e.EMPTY_TABLE="emptyTable",e.EMPTY_TD="emptyTd",e.COUNTDOWN="countdown",e.VIDEO="video",e.COLUMN="column",e.CAROUSEL="carousel",e.ACCORDION="accordion"}(S||(S={}));const I={ALL:"All",STANDARD:"Standard",PROJECT:"Project"},C="Appearance",b="Structure",y="Settings",L="Properties",N="History",M="Disabled_tab",w="Edit selected element",P="UTM parameters",R="Edit",k="AiChat",B="Build",U="Styles",j="Discuss",x="Blocks",G="Atoms",F="Optimise",K={top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}},H="Owner",V="Administrator",X="User",W="The invitation has been sent",z="Assign the project owner",Q="Change role to Administrator",$="Change role to User",Y="Remove member",Z="Revoke the invite",q="block",J="email",ee="cards",te="list",ie="pending",ne="d41d8",oe="1865",se=127017,re=24,ae={borderRadiusAll:"all",borderRadiusTopLeft:"topLeft",borderRadiusBottomLeft:"bottomLeft",borderRadiusTopRight:"topRight",borderRadiusBottomRight:"bottomRight"},ce="desktop",le="mobile",de="emailtags",_e="blocktags",ue="all_folders",me={text:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",lineHeight:21,lineHeightDim:"px",color:"#5a5a5a",contrastColor:"#FFFFFF",textAlign:"left",paddingBottom:10,paddingBottomDim:"px"},headings:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:24,fontSizeDim:"px",lineHeight:32,lineHeightDim:"px",color:"#333333",contrastColor:"#FFFFFF",textAlign:"left",paddingTop:20,paddingTopDim:"px",paddingBottom:20,paddingBottomDim:"px",letterSpacing:0,letterSpacingDim:"px",bold:!0,italic:!1},links:{color:"#1C52DC",contrastColor:"#FFFFFF",underline:!0},buttons:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",letterSpacing:0,letterSpacingDim:"px",color:"#FFFFFF",contrastColor:"#1C52DC",bold:!1,italic:!1,backgroundColor:"#1C52DC",contrastBackgroundColor:"#FFFFFF",marginTop:10,marginTopDim:"px",marginBottom:10,marginBottomDim:"px",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},textAlign:"center",padding:{all:null,top:null,right:null,bottom:null,left:null}},block:{backgroundColor:"#FFFFFF",contrastBackgroundColor:"#1C52DC",padding:{all:null,top:null,right:null,bottom:null,left:null}},cards:{contrastBackgroundColor:"#1C52DC",contrastTextColor:"#FFFFFF",baseBackgroundColor:"#F8F8F8",baseTextColor:"#333333",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null}}},pe=e=>({REORDER_ATOM:e("Reorder element"),CLONE_ATOM:e("Clone element"),REMOVE_ATOM:e("Remove element"),EDIT_ATOM:e("Edit element"),CHANGE_IMAGE:e("Change image"),REORDER_BLOCK:e("Reorder block"),REORDER_BLOCK_UP:e("Move up"),REORDER_BLOCK_DOWN:e("Move down"),EDIT_BLOCK:e("Edit block"),CLONE_BLOCK:e("Clone block"),MERGE_BLOCK:e("Merge with the chosen block"),UNMERGE_BLOCK:e("Split blocks"),COPY_BLOCK_TO_CLIPBOARD:e("Copy block to clipboard"),PASTE_BLOCK_FROM_CLIPBOARD:e("Paste block from clipboard"),REMOVE_BLOCK:e("Remove block"),SAVE_TO_BLOCKS:e("Save to Blocks"),ADD_BLOCK:e("Add block"),ADD_EMPTY_BLOCK:e("Add an empty block"),ADD_SAVED_BLOCK:e("Add a saved block"),ADD_COMMON_BLOCK:e("Add a common block"),ADD_TEMPLATE_BLOCK:e("Add a template block"),ADD_SEARCH_BLOCK:e("Search a block"),REORDER_GROUP:e("Reorder group"),EDIT_GROUP:e("Edit group"),CLONE_GROUP:e("Clone group"),REMOVE_GROUP:e("Remove group"),ADD_GROUP:e("Add group"),LINK:e("link"),TABLE_COLUMN:e("cell"),TABLE:e("table"),FLOAT_BLOCK:e("column"),CONTAINER:e("container"),PICTURE:e("picture"),CAROUSEL:e("carousel"),ACCORDION:e("accordion"),VERTICAL_INDENT:e("indent"),TEXT:e("text"),BUTTON:e("button"),VAR:e("variable"),STRUCTURE:e("block"),EMAIL:e("email"),GROUP:e("group"),TYPOGRAF:e("Typograf"),COUNTDOWN:e("countdown"),ELEMENT:e("element"),VIDEO:e("video"),ELEMENT_PATH_LINK:e("Link"),ELEMENT_PATH_BLOCK:e("Block"),ELEMENT_PATH_ATOM:e("Element"),ELEMENT_PATH_TD:e("Cell"),ELEMENT_PATH_TABLE:e("Table"),ELEMENT_PATH_FLOATBLOCK:e("Column"),ELEMENT_PATH_TEXT:e("Text"),ELEMENT_PATH_DIV:e("Container"),ELEMENT_PATH_GROUP:e("Group"),ELEMENT_PATH_EMAIL:e("Email"),ELEMENT_PATH_IMG:e("Picture"),ELEMENT_PATH_VINDENT:e("Indent"),ELEMENT_PATH_BUTTON:e("Button"),ELEMENT_PATH_CAROUSEL:e("Carousel"),ELEMENT_PATH_ACCORDION:e("Accordion"),ELEMENT_PATH_SECTION:e("Section"),TINYMCE_CHANGECASE:e("Case Change"),TINYMCE_UPPERCASE:e("Uppercase"),TINYMCE_LOWERCASE:e("Lowercase"),PASTE_HERE:e("Drop here")}),he={Applications:"Apps",Articles:"Article",Banners:"Banners",Buttons:"Buttons","Call to Action":"Call to Action",Contacts:"Contacts",Content:"Content","E-Commerce":"E-Commerce",Feature:"Features",Footer:"Footers",Header:"Headers",Lists:"Lists",Menu:"Menus",Other:"Others",Polls:"Polls",Promocodes:"Promocodes",Separators:"Separators"},ge={maker:"https://ai-mail.emcdn.ru",blocks:"https://ai-mail.useblocks.io"},Ee={maker:"https://app.emailmaker.ru/api",blocks:"https://app.useblocks.io/api"}},19378:(e,t,i)=>{function n(e){return e}i.d(t,{Qm:()=>n,bg:()=>c});const o="INIT_MESSAGE";function s(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}class r{constructor(){this._children=[],this._isDisposed=!1}isDisposed(){return this._isDisposed}addDisposable(e){return this._children.push(e),e.hasOwnProperty("addDisposable")&&e.addDisposable({dispose:()=>{const t=this._children.indexOf(e);t>=0&&this._children.splice(t,1)}}),e}removeDisposable(e){const t=this._children.indexOf(e);t>=0&&this._children.splice(t,1)}dispose(){this._isDisposed=!0;for(const e of this._children)e.dispose()}}class a extends r{constructor(...e){super(...e),this._listeners=Object.create(null),this.addListenerAsync=(e,t,i=0,n)=>{const o=this._listeners[e]||(this._listeners[e]=[]);n&&"function"===typeof t&&(t=t.bind(n));const s=o.findIndex((([e,t])=>i<=t)),r=[t,i];return this.isDisposed()||o.splice(s>=0?s:o.length,0,r),{dispose(){const e=o.indexOf(r);e>=0&&o.splice(e,1)}}},this.fireAsync=(e,t)=>{if(!this.isDisposed()){const i=this._listeners[e]||(this._listeners[e]=[]);let n;for(let e=0;e<i.length;e++){let t=i[e][0],o=n;n=e=>t(e,o)}if(n)return n(t)}},this.addListener=(e,t,i=0)=>this.addListenerAsync(e,((e,i)=>{try{t(e)}catch(n){console.log(n)}return i&&i(e)}),i)}}class c extends r{constructor(e,t){super(),this._singleton=t,this._target=void 0,this._guid=s(),this._targetGuid="",this._emitter=this.addDisposable(new a),this._onReceiveMessage=e=>{const t=e.data;if(i=t,n=this._guid,i&&"object"===typeof i&&i.guid===n||this._singleton&&function(e,t){return e&&"object"===typeof e&&e.operationId===t}(t,o)){const i=this._emitter.fireAsync(t.operationId||"",void 0===t.operationId?e:t.data),n=t.result,o=t.error;n&&o&&Promise.resolve(i).then((e=>this._sendMessage(n,e)),(e=>this._sendMessage(o,e)))}var i,n},window.addEventListener("message",this._onReceiveMessage),this.addListener(o,(e=>{this._targetGuid!==e&&(this._targetGuid=e,this.send(o,this._guid))})),e&&this.setTarget(e)}setTarget(e){this._target!==e&&(this._target=e,this._targetGuid="",e&&e.postMessage({operationId:o,data:this._guid},"*"))}getTarget(){return this._target}get target(){return this._target}_sendMessage(e,t,i=!0){if(!i&&!this.isInited())return;const n=this.addDisposable(this.onInit(((i,o)=>{const s=e?{operationId:e,data:t}:t;i.postMessage({...s,guid:o},"*"),n.dispose()})))}send(e,t,i){return"string"===typeof e?this._sendMessage(e,t,i):this._sendMessage("",e,t)}sendAsync(e,t,i=!0){if(!i&&!this.isInited())return Promise.resolve();const n=s(),o=s();return new Promise(((i,s)=>{const a=this.addDisposable(new r);a.addDisposable(this.onInit(((r,c)=>{r.postMessage({operationId:e,data:t,guid:c,result:n,error:o},"*"),a.addDisposable(this._onMessage(n,(e=>{i(e),a.dispose()}))),a.addDisposable(this._onMessage(o,(e=>{s(e),a.dispose()})))})))}))}_onMessage(e,t,i=0){return this._emitter.addListener(e,t,i)}addListener(e,t,i){return t?this._onMessage(e,t,i):this._onMessage("",e)}addListenerAsyncPipe(e,t,i=0){return this._emitter.addListenerAsync(e,t,i)}addListenerAsync(e,t,i=0){return this._emitter.addListenerAsync(e,(async(e,i)=>{const n=await t(e);return i?i(e):n}),i)}isInited(){return!!this._targetGuid}get inited(){return!!this._targetGuid}onInit(e,t=!0,i=0){const n=this.addDisposable(new r);return this._targetGuid&&this._target?t&&Promise.resolve().then((()=>{this._targetGuid&&this._target?e(this._target,this._targetGuid):n.addDisposable(this.onInit(e,t,i))})):n.addDisposable(this._onMessage(o,(()=>{e(this._target,this._targetGuid)}),i)),n}dispose(){window.removeEventListener("message",this._onReceiveMessage),super.dispose()}}},13329:(e,t,i)=>{i.d(t,{D3:()=>_,RS:()=>d});var n=i(45934),o=i(92810),s=i(41664),r=i(23397),a=i(23580),c=i(95152);const l=(0,s.Q)();function d(e,t,i){e instanceof c.m||(e=(0,a.My)(e));e.getOrCreateInstance(l,(()=>new r.v)).fire({id:t,payload:i})}const _=(e,t)=>{const i=function(e){return(0,a.My)(e).getOrCreateInstance(l,(()=>new r.v)).addEventListener}((0,n.Pj)());(0,o.useEffect)((()=>{const n=i((({id:i,payload:n})=>{i===e&&t(n)}));return()=>n.dispose()}),[i,e,t])}},95152:(e,t,i)=>{i.d(t,{m:()=>r});var n=i(23397),o=i(77509);function s(e){return`service_container_${e}`}class r extends o.j{constructor(e){super(),this._parent=e,this._injections=Object.create(null),this._emitter=this.addDisposable(new n.v)}inject(e,t,i){if("function"===typeof t){let n=this._injections[e],o="function"===typeof n?n():n;const s=this._injections[e]=()=>(o=t(this,o),o);i&&s()}else this._injections[e]=()=>t;this._emitter.fire(e)}_find(e){var t;return this._injections[e]||(null===(t=this._parent)||void 0===t?void 0:t._find(e))}_onInject(e,t,i=new o.j){return i.addDisposable(this._emitter.addEventListener((n=>{e===n&&(i.dispose(),t(this.getInstance(n)))}))),this._parent&&i.addDisposable(this._parent._onInject(e,t,i)),this.addDisposable(i),i}getInstance(e){const t=this._find(e);if("function"===typeof t)return t()}getOrCreateInstance(e,t){const i=this._find(e);if("function"===typeof i)return i();{const i=t(this);return this.inject(e,i),i}}getInstanceAsync(e){const t=this._find(e);return"function"===typeof t?Promise.resolve(t()):new Promise((t=>this._onInject(e,(()=>t(this.getInstance(e))))))}addService(e,t){const i=s(e);this.inject(i,((e,i=[])=>i.indexOf(t)<0?[...i,t]:i));const n=new o.j;return n.addDispose((()=>{this.inject(i,((e,i=[])=>i.filter((e=>e!==t))))})),n}getServices(e){var t;const i=s(e);return[...this.getInstance(i)||[],...(null===(t=this._parent)||void 0===t?void 0:t.getServices(e))||[]]}createChild(){return new r(this)}dispose(){this._injections=Object.create(null)}}},45695:(e,t,i)=>{i.d(t,{K9:()=>u,QC:()=>d,XW:()=>_,ur:()=>l});var n=i(19378),o=i(33288),s=i(45934),r=i(41664),a=i(92810);const c=(0,r.Q)("MESSAGE_SERVICE");function l(){const e=d();return(0,a.useCallback)((t=>{e.setTarget(t instanceof Element?t.contentWindow:t)}),[e])}function d(){const e=(0,s.Pj)();return(0,a.useMemo)((()=>function(e){return o.di.getOrCreateInstance(e,c,(()=>new n.bg))}(e)),[e])}function _(){const e=d();return(0,a.useCallback)((function(t){e.send(t)}),[e])}function u(){const e=d();return(0,a.useCallback)((function(t,i){e.send(t,i)}),[e])}},23397:(e,t,i)=>{i.d(t,{v:()=>o});var n=i(77509);class o extends n.j{constructor(e){super(),this._options=e,this._listeners=[],this.fire=e=>{if(!this.isDisposed()){let t;const i=[...this._listeners];for(const n of i){if(!1===t)return!1;t=t instanceof Promise?t.then((e=>!1!==e&&!this.isDisposed()&&n(e))).catch((e=>console.log(e))):n(e)}return t}},this.addEventListener=e=>{const t=this._listeners;var i;(t.push(e),1===t.length)&&((null===(i=this._options)||void 0===i?void 0:i.onFirstListenerAdd)&&this._options.onFirstListenerAdd());return{dispose:()=>{const i=t.indexOf(e);var n;i>=0&&(t.splice(i),t.length||(null===(n=this._options)||void 0===n?void 0:n.onFirstListenerAdd)&&this._options.onLastListenerRemove())}}},this.event=this.addEventListener}}let s;!function(e){function t(e){let t;const i=new o({onFirstListenerAdd(){t=e(i.fire)},onLastListenerRemove(){t.dispose()}});return i.event}e.snapshot=t,e.filter=function(e,i){return t((t=>e((e=>i(e)&&t(e)))))},e.map=function(e,i){return t((t=>e((e=>t(i(e))))))}}(s||(s={}))},32269:(e,t,i)=>{i.d(t,{Cb:()=>V,Cl:()=>p,DI:()=>P,Dx:()=>M,EU:()=>R,HT:()=>W,Hy:()=>z,Id:()=>m,Np:()=>N,Qi:()=>G,Tr:()=>Q,X7:()=>K,XZ:()=>j,Yq:()=>h,Z1:()=>H,_9:()=>x,_q:()=>X,au:()=>w,d_:()=>k,el:()=>O,ez:()=>D,fq:()=>g,gq:()=>L,i0:()=>B,iV:()=>U,jG:()=>l.j,ln:()=>$,p6:()=>S,sh:()=>F,vl:()=>d.v,wB:()=>I});var n=i(74267),o=i(92810),s=i(85163),r=i(1741),a=i.n(r),c=i(45695),l=i(77509),d=i(23397),_=i(71210),u=i(70082);const m=e=>{Object.keys(s.A9).forEach((t=>{"onboarding_success"!==e.get(s.A9[t])&&e.remove(s.A9[t])}))};function p(e){const t=(0,n.A)(e);return isNaN(t)?new Date(e):t}const h=(e,t,i=!1)=>{Date;const n=new Date,o=e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear();if(i&&o){const i=Math.floor((n-e)/1e3),o=Math.floor(i/60),s=Math.floor(o/60);if(i<60)return t("Just now");if(s>0){const e=o%60;return`${s} ${t("hour","hours",s)} ${e} ${t("minute","minutes",e)}`}return`${o} ${t("minute","minutes",o)}`}{const t=new Intl.DateTimeFormat(navigator.language,{dateStyle:"short"}),i=new Intl.DateTimeFormat(navigator.language,{timeStyle:"short"});return t.format(e)+" "+i.format(e)}},g=e=>{const t=e.match(/(\(copy\))( \d+)?$/),i=null===t||void 0===t?void 0:t[1],n=null===t||void 0===t?void 0:t[2];return i?n?`${e.slice(0,-n.length)} ${+n.slice(1)+1}`:`${e} 2`:`${e} (copy)`};function E(e,t,i){const n=new Map,o=new RegExp(`(${t})(.*?)(${i})`,"gis");return e=e.replaceAll(o,((e,t,i,o)=>{const s=(0,_.l)();return n.set(s,i),t+s+o})),{escapes:n,html:e}}function A(e,t){let i=[];for(const[n,o]of t){const{escapes:t,html:s}=E(e,n,o);e=s,i.push([n,o,t])}return{escapes:i,html:e}}function f(e,t,i,n){const o=new RegExp(`(${t})(.*?)(${i})`,"gis");return e.replaceAll(o,((e,t,i,o)=>{const s=n.get(i);return"string"===typeof s?t+s+o:e}))}const v=/<title>(.*)<\/title>/gm,O=(e,t)=>{let{escapes:i,html:n}=A(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","--\x3e"]]);return n=n.replaceAll(v,((e,i)=>i===t?`<title>${g(i)}</title>`:e)),function(e,t){for(const[i,n,o]of t)e=f(e,i,n,o);return e}(n,i.reverse())};function D(e){let{html:t}=A(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","--\x3e"]]);return[...t.matchAll(v)].map((e=>e[1])).find((e=>!!e))}const T="bottomRight",S=(e,t,i=T)=>{var n,o,s,r;t.error({innerException:e.error instanceof Error?e.error:void 0,message:(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(n=e.error)||void 0===n||null===(o=n.data)||void 0===o?void 0:o.code)||(null===(s=e.error)||void 0===s?void 0:s.status)||e.error}}),description:(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(r=e.error.data)||void 0===r?void 0:r.message)||e.error.error}}),placement:i})},I=(e,t,i=T)=>{t.success({message:e,placement:i})},C="ascend",b="descend",y="desc",L=e=>{switch(e){case C:return"asc";case b:return y;default:return""}},N=e=>{switch(e){case"asc":return C;case y:return b;default:return""}},M=e=>{const t=document.createElement("div");return t.className=e||"resizer",t},w=/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/,P=e=>new Promise(((t,i)=>{let n=new Image;n.src=e,n.addEventListener("load",(()=>{t("success")})),n.addEventListener("error",(()=>{i("error")})),n=null})),R=(e,t)=>{for(const i of t)"object"===typeof e.properties&&(e=e.properties[i]);return e},k=e=>e instanceof Array?e.map((e=>({label:e,value:e}))):Object.keys(e).map((t=>({label:e[t],value:t}))),B=(e,t,i=!0)=>{const n=Object.keys(t);for(const o of n){const n=t[o];void 0!==n&&null!==n&&(e[o]=i&&"object"===typeof n?B(e[o]||{},n,!0):n)}return e},U=e=>new Promise(((t,i)=>{a().load({google:{families:[e]},classes:!1,active:t,inactive:i})})),j=(e,t)=>{t&&e(t)},x=()=>{const e=(0,c.XW)();return(0,o.useCallback)(((t,i,n)=>{document.querySelectorAll(".block-search__preview").forEach((e=>e.remove()));const o=document.getElementById("iframe-scroll-top"),r=document.getElementById("iframe-scroll-bottom"),a=document.getElementById("email_iframe"),c=document.body.getBoundingClientRect().height,l=a.getClientRects()[0];l.top<0&&(o.style.display="block"),l.top+l.height>c&&(r.style.display="block");const d={operation:s.Ru.SANDBOX_BLOCK_INSERT,settings:{blockHTML:i||null,targetBlock:null,project:"emailmaker",type:n}};t.dataTransfer.setData("Text",JSON.stringify(d)),e(d)}),[e])},G=()=>{const e=(0,c.XW)();return(0,o.useCallback)(((t,i,n)=>{const o=document.getElementById("iframe-scroll-top"),r=document.getElementById("iframe-scroll-bottom"),a=document.getElementById("email_iframe"),c=document.body.getBoundingClientRect().height,l=a.getClientRects()[0];l.top<0&&(o.style.display="block"),l.top+l.height>c&&(r.style.display="block");const d={operation:s.Ru.SANDBOX_ATOM_INSERT,settings:{atomHTML:i.html||null,targetBlock:null}};n(i)&&t.dataTransfer.setData("Text",JSON.stringify(d)),e(d)}),[e])},F=()=>{const e=(0,c.XW)();return(0,o.useCallback)(((t,i)=>{e({operation:s.Ru.SANDBOX_BLOCK_INSERT,action:"insert",settings:{blockHTML:i}})}),[e])},K=()=>{const e=(0,c.XW)();return(0,o.useCallback)(((t,i)=>{e({operation:s.Ru.SANDBOX_ATOM_INSERT,action:"insert",settings:{atomHTML:i}})}),[e])},H=(e,t)=>{t.success({maskClosable:!0,centered:!0,title:e("Coming soon"),content:e("The feature is under development."),okText:e("Ok. I'll be waiting"),onOk:()=>{}})},V=()=>{const e=(0,c.XW)();return(t,i)=>{e({operation:s.Ru.SANDBOX_ELEMENT_SETTINGS_SET,settings:t,type:i})}},X=(e,t="")=>{var i,n;const o=[];return null===(i=e._embedded)||void 0===i||null===(n=i["wp:term"])||void 0===n||n.filter((e=>{var i;return!!e.length&&(!t||(null===(i=e[0])||void 0===i?void 0:i.taxonomy)===t)})).forEach((e=>{const t=e[0].taxonomy;o[t]||(o[t]=[]),o[t]=e.map((e=>({id:e.id,name:e.name,children:e.children}))),o[o.length]=o[t]})),""!==t&&o.length?o[t]:o},W=(e,t="")=>{var i,n,o,s,r;return(null===(i=e._embedded)||void 0===i||null===(n=i["wp:term"])||void 0===n||null===(o=n.find((e=>{var i;return!!e.length&&(!t||(null===(i=e[0])||void 0===i?void 0:i.taxonomy)===t)})))||void 0===o||null===(s=o.find((e=>{var t;return null===e||void 0===e||null===(t=e.name)||void 0===t?void 0:t.startsWith("project_")})))||void 0===s||null===(r=s.children)||void 0===r?void 0:r.map((e=>({id:e.id,name:e.name,count:e.count}))))||null},z=(e,t)=>{const i=e.target,n=t.getBoundingClientRect().height,o=i.getBoundingClientRect().height-n,s=e.clientY-t.getBoundingClientRect().top-30,r=-o*(Math.min(Math.max(s,0),n-60)/(n-60));i.style.transform=`translateY(${r}px)`},Q=({target:e})=>{e.style.transform="translateY(0)"};function $(e){const t=document.createElement("div");return t.innerHTML=e,t.textContent||t.innerText||""}},20116:(e,t,i)=>{i.d(t,{B:()=>l,l:()=>c});var n=i(33288),o=i(77509),s=i(91366);function r(e){return t=>{const i=t.queryFn||((e,i,n,o)=>{if(!t.query)throw new Error("query not found EndpointDefinition");return o(t.query(e))});i&&(t.query=void 0,t.queryFn=async(t,o,s,r)=>{try{let a;const c=n.di.getServices(o,e);for(let e=c.length-1;e>=0;e--){const i=c[e];if(a=a?await a((async(...e)=>await i.execute(e))):await i.execute(t),"function"!==typeof a)return{data:a,error:null}}return a=a?await a((async(e,t=o,n=s,a=r)=>{const c=await i(e,t,n,a);if(c.error)throw c.error;return c.data})):await i(t,o,s,r),{data:a,error:null}}catch(a){return{error:a}}})}}const a=new Set;function c(e){return(t,i)=>{const c=Object.create(null),l=Object.keys(i),d=new o.j;for(const o of l){const s=`api_listeners_flag_${t.reducerPath}/${o.toString()}`,l=n.di.createIdentifier(`api_listeners_${t.reducerPath}/${o.toString()}`);a.has(s)||(c[o]=r(l),a.add(s)),d.addDisposable(n.di.addService(e,l,{execute:i[o]}))}return Object.keys(c).length&&t.enhanceEndpoints({endpoints:c}),(0,s.PL)(e).addDisposable(d),d}}function l(e,t){for(const n of Object.keys(t))try{t[n](e)}catch(i){console.error(`Error while initialize mock ${n}:`,i)}}},32411:(e,t,i)=>{i.d(t,{$Z:()=>p,TW:()=>d,VA:()=>u,aD:()=>m,fn:()=>h,kx:()=>a});var n=i(70609),o=i(92810),s=i(60382),r=i(33695);const a=(0,o.createContext)(null),c={editorWorkerService:"editor.worker.js",html:"html.worker.js",css:"css.worker.js",typescript:"ts.worker.js",json:"json.worker.js",javascript:"ts.worker.js",less:"css.worker.js",scss:"css.worker.js",handlebars:"html.worker.js",razor:"html.worker.js"};function l(e,t){/^(\/\/)/.test(e)&&(e=window.location.protocol+e);const i=new Blob(["/*"+t+'*/importScripts("'+e+'");'],{type:"application/javascript"});return URL.createObjectURL(i)}function d(e){const t=(0,n.yc)(),[i,s]=(0,o.useState)({canUndo:t.canUndo(e.uri),canRedo:t.canRedo(e.uri)});return(0,o.useEffect)((()=>{const i=e.onDidChangeContent((()=>{setTimeout((()=>s({canUndo:t.canUndo(e.uri),canRedo:t.canRedo(e.uri)})))}));return()=>{i.dispose()}}),[e,t]),i}function _(e){var t;const i=(null===e||void 0===e||null===(t=e.actual)||void 0===t?void 0:t._data)||new r.Ov;return i instanceof r.Ov?i:r.Ov.deserialize(i)}function u(e){const t=(0,n.yc)();return{undo:()=>t.undo(e.uri),redo:()=>t.redo(e.uri),clear:()=>t.removeElements(e.uri),getPast:()=>{var i,n;return(null===(i=t._editStacks.get(e.uri.toString()))||void 0===i||null===(n=i._past)||void 0===n?void 0:n.map(_))||[]},getFuture:()=>{var i,n;return(null===(i=t._editStacks.get(e.uri.toString()))||void 0===i||null===(n=i._future)||void 0===n?void 0:n.map(_))||[]},canUndo:()=>t.canUndo(e.uri),canRedo:()=>t.canRedo(e.uri),createSnapshot:()=>t.createSnapshot(e.uri),restoreSnapshot:e=>t.restoreSnapshot(e)}}function m(e){return(0,o.useMemo)((()=>u(e)),[e])}function p(e="",t="html"){const i=s.editor.createModel(e,t);return i.setEOL(s.editor.EndOfLineSequence.LF),i}function h(){return(0,o.useContext)(a)}emailmakerMonacoEnvironment.getWorkerUrl=(e,t)=>{const n=i.p,o=(n?n.replace(/\/$/,"")+"/":"")+c[t];const s=new URL(o,window.location.origin),r=s.protocol;if("http:"===r||"https:"===r){if(s.protocol!==window.location.protocol||s.hostname!==window.location.hostname)return l(o,t);if("localhost"===s.hostname&&(s.port||"80")!==(window.location.port||"80"))return l(o,t)}else if("file:"===r)return l(o,t);return o}},98589:(e,t,i)=>{function n(e,t){if(e===t)return!0;if("object"===typeof e&&e&&"object"===typeof t&&t){const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(const s of i)if(!n(e[s],t[s]))return!1;return!0}return!1}function o(e,t){if(!e)return t;const i={};for(const o of Object.keys(t))n(t[o],e[o])||(i[o]=t[o]);return i}i.d(t,{g:()=>o})},88896:(e,t,i)=>{i.d(t,{X:()=>o});const n=Symbol("Error");function o(e){return Promise.all(e.map((e=>e instanceof Promise?e.catch((e=>(console.log(e),n))):e))).then((e=>e.filter((e=>e!==n))))}},91738:(e,t,i)=>{i.d(t,{AU:()=>d});var n=i(90854),o=i(58689),s=i(44824),r=i(26453),a=i(91391);const c=e=>function(e){var t;return function(e){return"___SCRIPT"===e.tagName}(e)&&(null===(t=e.src)||void 0===t?void 0:t.startsWith(a.gP))}(e)||(0,r.Nh)(e)||(0,n.BF)(e),l=e=>{if(c(e))return!0;if((0,n.vq)(e)||(0,n.wz)(e))for(const t of e.querySelectorAll("*"))if(c(t))return!0;return!1};async function d(e,t){"string"===typeof e&&(e={code:e});const i=e.code?await(0,o.PJ)(e.code||"",[o.qy],e.utm_parameters,(async e=>{void 0===t&&(t=l(e)),t&&await(0,s.e)(e,"html")})):"",n=e.code&&t?await(0,o.PJ)(e.code||"",[o.qy],e.utm_parameters,(async e=>{await(0,s.e)(e,"amp")})):"";return{...e,compiled:{html:i,ampHtml:n}}}},91366:(e,t,i)=>{i.d(t,{Qq:()=>g,PL:()=>A,KA:()=>E,wz:()=>f});var n=i(33288),o=i(41664),s=i(15230),r=i(32269),a=i(55654);class c extends a.IO{async execute([e],t){for(const i of t){const t=await i(e);t&&(void 0===t.id&&(t.id=e.value.id),e.value=t)}return e.value}}var l=i(98589);class d extends a.lt{}var _=i(56991);class u extends r.jG{constructor(...e){super(...e),this._items=new Map,this._onChangeEmitter=new a.HN,this.onChange=this._onChangeEmitter.event}async _getOrCreate(e,t){const i=this._items;let n;if(i.has(e))try{n=await i.get(e)}catch{t&&(n=await t())}else t&&(n=await t(),n&&this._onChangeEmitter.fire());return n}async _addOrUpdate(e,t){let i;const n=this._items;if(n.has(e))try{i=await n.get(e)}catch{}const o=await t(i);return(0,_.bD)(i,o)||this._onChangeEmitter.fire(),o}entries(){return Promise.all([...this._items.entries()].map((([e,t])=>t.then((t=>[e,t]))))).then((e=>e.filter((([e,t])=>!!t))))}values(){return Promise.all([...this._items.values()].map((e=>e)).filter((e=>!!e)))}getOrCreate(e,t){let i=this._getOrCreate(e,(()=>t(e)));return this._items.set(e,i),i}addOrUpdate(e,t){let i=this._addOrUpdate(e,t);return this._items.set(e,i),i}add(e,t){const i=Promise.resolve(t);return this._items.set(e,i),i}remove(e){if(this._items.has(e)){const t=this._items.get(e);return this._items.delete(e),this._onChangeEmitter.fire(),t}return Promise.resolve(void 0)}async setAll(e){try{this.suspendChange();const t=[],i=new Set(Array.from(e).map((([e,t])=>e))),n=(await this.entries()).filter((([e,t])=>!i.has(e)));for(const[o,s]of e)t.push(this.addOrUpdate(o,(()=>s))),i.add(o);for(const[e]of n)t.push(this.remove(e));return await Promise.all(t),n}finally{this.resumeChange()}}clear(){this._items.clear(),this._onChangeEmitter.fire()}suspendChange(){this._onChangeEmitter.suspend()}resumeChange(){this._onChangeEmitter.resume()}}var m=i(71210);class p extends r.jG{constructor(...e){super(...e),this._cache=new u,this._readEmitter=new a.lt,this._saveEmitter=this.addDisposable(new c),this._removeEmitter=this.addDisposable(new d),this._foreignCache=Object.create(null),this.handlerRead=this._readEmitter.event,this.onSave=this._saveEmitter.event,this.onRemove=this._removeEmitter.event,this.onChange=this._cache.onChange}async get(e){return this._cache.getOrCreate(e,(async t=>Object.assign({id:e},...(await this._readEmitter.fire(e)).filter((e=>!!e)))))}get cache(){return this._cache}byForeignKey(e){let t=this._foreignCache[e];if(!t){const i=this.addDisposable(new r.jG);i.addDispose((()=>delete this._foreignCache[e]));const n=i.addDisposable(new u),o=i.addDisposable(new a.lt);t=this._foreignCache[e]={get:async(t,i={})=>(await n.getOrCreate(t,(async()=>{try{const i=function(e=[]){if((e=e.filter((e=>e))).length<=1)return e[0];let t=new Map;for(const i of e)for(const e of i)if(void 0!==e.id){let i=t.get(e.id)||{};t.set(e.id,{...i,...e})}return[...t].map((([e,t])=>t))}(await o.fire(t))||[];for(const n of i)n[e]=t,await this._cache.add(n.id,n);return i}catch{return[]}})),function(e,{filter:t,order:i="asc",orderBy:n,page:o,pageSize:s=20}={}){const r=e.length;let a=e.length;if(void 0!==t){const i=Object.keys(t);a=(e=e.filter((e=>{for(const n of i){const i=e[n],o=t[n];return"id"===n||"string"!==typeof i?i===o:"string"===typeof o&&i.startsWith(o)}return!0}))).length}return n&&(e=e.sort(((e,t)=>(e[n]>t[n]?1:t[n]>e[n]?-1:0)*("asc"===i?1:-1)))),void 0!==o&&(e=e.slice(s*(o-1),s*o-1)),{data:e,filteredTotal:a,total:r,totalPages:Math.floor(r/s)}}(await this._cache.values()||[],i)),first:(e,i={})=>t.get(e,{...i,page:1,pageSize:1}).then((e=>e[0])),handleRead:o.event,clear(){n.clear()},dispose(){i.dispose()}}}return t}async create(e,{source:t="",silent:i}={}){let n=e;return i||(n=await this._saveEmitter.fire({prev:void 0,patch:e,value:n,source:t})),void 0===n.id&&(n.id=(0,m.l)()),await this._cache.addOrUpdate(n.id,(()=>n))}async update(e,t,{source:i="",silent:n}={}){return this._cache.addOrUpdate(e,(async e=>{let o=e?{...e,...t}:t;if(!n)return t=e?(0,l.g)(e,t):t,await this._saveEmitter.fire({prev:e,patch:t,value:o,source:i})}))}async remove(e,{source:t="",silent:i}={}){const n=await this._cache.remove(e);return i||await this._removeEmitter.fire({value:n,source:t}),n}refresh(){this._cache.clear();for(const e of Object.values(this._foreignCache))e.clear()}suspendChange(){this._cache.suspendChange()}resumeChange(){this._cache.resumeChange()}}i(18398);var h=i(39990);function g(){const e=(0,o.Q)();return t=>n.di.getOrCreateInstance(t,e,(()=>new p))}function E(e){const t=n.di.getInstance(e,s.ax);if(!t)throw new Error("Failed");return t}function A(e){const t=n.di.getInstance(e,s.Lz);if(!t)throw new Error("Failed");return t}async function f(e){const t=E(e),i=await t.dispatch(h.Q2.endpoints.getMe.initiate({},{forceRefetch:!0}));return Promise.resolve(i.data)}},13437:(e,t,i)=>{i.d(t,{A:()=>r,i:()=>s});var n=i(71210),o=i(814);function s({code:e,...t},i){var o,s;const r=i.getState();return{...t,...e?{html:e}:{},renderGuid:(0,n.l)(),project:null===(o=r.projectSlice)||void 0===o||null===(s=o.project)||void 0===s?void 0:s.id}}function r({html:e,renderGuid:t,...i},n){const s=n.getState(),{project:r}=s.configSlice;return(0,o.TB)({...i,code:e,project:void 0===r?i.project:r,guid:void 0,link:void 0,status:void 0,slug:void 0,password:void 0,comment_status:void 0,template:void 0,blocktags:void 0,project_title:void 0,ping_status:void 0,lock:void 0,tag:void 0,is_template:void 0})}},25181:(e,t,i)=>{function n(e,t){var i;return{severity:Number(t.severity),message:t.message,source:t.source,startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn,get startOffset(){return e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn})},get endOffset(){return e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn})},tags:null===(i=t.tags)||void 0===i?void 0:i.map((e=>Number(e)))}}i.d(t,{B:()=>n})},91253:(e,t,i)=>{i.d(t,{I:()=>s,y:()=>o});var n=i(814);function o(e,t,i){const n=t.getState();var o,s;void 0===i&&(i=void 0===e.post?null===(o=n.emailSlice)||void 0===o||null===(s=o.email)||void 0===s?void 0:s.id:e.post);return{...e,content:e.content?`<p>${e.content}</p>`:"",post:i}}function s(e,t){return(0,n.TB)({...e,link:void 0,comment_status:void 0})}},81304:(e,t,i)=>{i.d(t,{E:()=>r,I:()=>s});var n=i(71210),o=i(814);function s({code:e,...t},i){var o,s;const r=i.getState();return{...t,...e?{html:e}:{},renderGuid:(0,n.l)(),project:null===(o=r.projectSlice)||void 0===o||null===(s=o.project)||void 0===s?void 0:s.id,utm_parameters:t.utm_parameters||{},_embedded:void 0}}function r({html:e,renderGuid:t,...i},n){const s=n.getState(),{project:r,config:a}=s.configSlice;return(0,o.TB)({...i,code:e,project:void 0===r?i.project:r,utm_parameters:a.UTMEnabled?i.utm_parameters:void 0,tags:void 0,template:void 0,guid:void 0,emailtags:void 0,project_title:void 0,project_author:void 0,is_template:void 0,is_inited:void 0})}},4453:(e,t,i)=>{i.d(t,{E:()=>s,_:()=>o});var n=i(814);function o({code:e,...t},i,n){const o=i.getState();var s,r;void 0===n&&(n=void 0===t.parent?null===(s=o.emailSlice)||void 0===s||null===(r=s.email)||void 0===r?void 0:r.id:t.parent);return{...t,...e?{html:e}:{},parent:n}}function s({html:e,...t},i){return(0,n.TB)({...t,code:e,guid:void 0,compiled:(0,n.TB)({html:e,ampHtml:e&&""})})}},23036:(e,t,i)=>{i.d(t,{Wk:()=>l,Xy:()=>a,bg:()=>_,ll:()=>d,yc:()=>c});var n=i(55701),o=i(91366),s=i(93982),r=i(20116);const a=(0,o.Qq)(),c=(0,o.Qq)(),l=(0,s.cZ)(),d=(0,s.cZ)();function _(e){const t=(0,r.l)(e),i=a(e),_=i.byForeignKey("project"),u=c(e),m=u.byForeignKey("parent"),{dispatch:p,getState:h}=(0,o.KA)(e),g=(0,o.PL)(e);g.addDisposable(i.onChange((()=>p(n.VM.util.invalidateTags(["Blocks"]))))),g.addDisposable(i.onSave((({prev:e,patch:t,value:i})=>{(e=e?{...e,...t}:t)&&i.html===e.html&&i.title===e.title&&(i.renderGuid=e.renderGuid)}),Number.MIN_VALUE));const E=(0,s.dB)(e,d),A=(0,s.dB)(e,l);t(n.VM,{async getBlocks(e){const t={};e.name&&(t.title=e.name),e.type&&(t.type=e.type);return await _.get(e.projectId,{filter:t,page:e.page,pageSize:e.pageSize,order:e.order,orderBy:e.orderby}).then((({data:e})=>e))},getBlocksSchema:()=>e=>e({}),getParentEmailBlocks:e=>async t=>{try{const t=h().configSlice.project||"",i=(await A.fire({project:t,emailId:e.emailId||""})).filter((e=>e));if(i.length)return i.flat()}catch(i){console.log(i)}return t(e)},getTemplateBlocks:e=>async t=>{try{const t=h().configSlice.project||"",i=(await E.fire({project:t,emailId:e.emailId||""})).filter((e=>e));if(i.length)return i.flat()}catch(i){console.log(i)}return t(e)},async getBlock(e){const t=h().projectSlice.project.id;return _.first(t,{filter:{id:e}})},getBlockHistory:async({blockId:e,page:t=1})=>({...await m.get(e,{page:t}),args:{blockId:e,page:t}}),addBlock:e=>async t=>{const n=await i.create(e);return h().configSlice.config.preventSendDataToEM||t(n).catch((e=>{})),n},editBlock:({blockId:e,...t})=>i.update(e,t),deleteBlock:e=>i.remove("object"===typeof e?e.id:e),addTag:e=>e,getDeletableTag:([e,t])=>[],autoSaveBlock:({blockId:e,body:t})=>u.create({...t,parent:e})})}},72788:(e,t,i)=>{i.d(t,{B:()=>c,D:()=>a});var n=i(18777),o=i(91366),s=i(68415),r=i(20116);const a=(0,o.Qq)();function c(e){const t=(0,r.l)(e),i=a(e),c=i.byForeignKey("post"),{dispatch:l}=(0,o.KA)(e);(0,o.PL)(e).addDisposable(i.onChange((()=>l(n.Jg.util.invalidateTags(["Comments"]))))),t(n.Jg,{getComments:e=>c.get(e).then((({data:e})=>e)),addComment({subjectId:e,author:t,parent:n,content:o,author_name:r,author_email:a,targetId:c}){const l={post:e,author:t,author_name:r,author_email:a,content:o,parent:n,target_id:c,date:(0,s.A)(new Date),author_avatar_urls:{}};return i.create(l)},deleteComment:e=>i.remove(e),editComment:({commentId:e,...t})=>i.update(e,t),deleteTarget:e=>i.update(e,{target_id:""})})}},87265:(e,t,i)=>{i.d(t,{Av:()=>a,jw:()=>c,sE:()=>l});var n=i(86739),o=i(91366),s=i(71210),r=i(20116);const a=(0,o.Qq)(),c=(0,o.Qq)();function l(e){const t=a(e),i=c(e),l=i.byForeignKey("parent"),{dispatch:d,getState:_}=(0,o.KA)(e),u=(0,o.PL)(e),m=(0,r.l)(e);u.addDisposable(t.onChange((async()=>{d(n.GY.util.invalidateTags(["Email"]))}))),u.addDisposable(i.onChange((()=>{d(n.GY.util.invalidateTags(["EmailAutosaves"]))}))),u.addDisposable(t.onSave((({prev:e,patch:t,value:i})=>{(e=e?{...e,...t}:t)&&i.subject===e.subject&&i.html===e.html&&i.preheader===e.preheader&&i.title===e.title&&(i.renderGuid=e.renderGuid)}),Number.MIN_VALUE)),m(n.GY,{getEmails:e=>[],getTemplateEmails:e=>t=>t(e),getEmail:async e=>await t.get(e),getEmailHistory:({emailId:e,page:t=1})=>(l.clear(),async n=>{if(_().configSlice.config.revisionService){const o=await n({emailId:e,page:t});for(const e of o.data)i.cache.add(e.id,e);return o}return{...await l.get(e,{page:t}),args:{emailId:e,page:t}}}),async addEmail({source:e,...i}){const n=await t.create(i,{source:e});return n.renderGuid||(n.renderGuid=(0,s.l)()),n},editEmail:e=>async i=>{const{emailId:n,source:o,...s}=e;return _().configSlice.config.revisionService&&await i(e),t.update(n,s,{source:o})},deleteEmail:e=>t.remove("object"===typeof e?e.id:e),addTag:e=>e,getDeletableTag:([e,t])=>[],autoSaveEmail:({emailId:e,body:t})=>async n=>(_().configSlice.config.revisionService&&await n({emailId:e,body:t}),await i.create({...t,parent:e,modified:(new Date).toString()}))})}},55084:(e,t,i)=>{i.d(t,{A:()=>S});var n=i(20116),o=i(53200);var s=i(84612);var r=i(91366),a=i(39990);var c=i(15230),l=i(47036);var d=i(95679);var _=i(62689);var u=i(84568);var m=i(46312),p=i(93982),h=i(13522);var g=i(65119);var E=i(63531),A=i(33288);A.di.createIdentifier();var f=i(83351);var v=i(23036),O=i(72788),D=i(94381);var T=i(87265);const S={addUserToProjectApiMock:function(e){(0,n.l)(e)(o.B,{addUserToProject:()=>{}})},AiApiMock:function(e){(0,n.l)(e)(s.Zs,{sendMessage:({body:e})=>t=>t({body:e}).catch((()=>new Promise((e=>setTimeout(e,1e3))))),getDialog:e=>t=>t(e)})},authorizationApiMock:function(e){let t={id:"0",username:"",email:"",password:"",code_editor:{},theme:"light",locale:(0,r.KA)(e).getState().userSlice.currentUser.locale,counters:{},avatar_urls:{},autosaves:!0};(0,n.l)(e)(a.Q2,{userRegistration:()=>{},getSchema:()=>e=>e({}),getMe:()=>t,editMe:e=>t={...t,...e},getSubscriptions:()=>[]})},blocksApiMock:v.bg,commentsApiMock:O.B,emailsApiMock:T.sE,emailRawApiMock:function(e){(0,n.l)(e)(l.f,{getEmailRaw({emailId:e,secret_hash:t}){throw new Error(c.f5)}})},imageApiMock:function(e){(0,n.l)(e)(d.CL,{sendAiImageRequest:function({body:e}){return t=>t({body:e})},getAiImage:e=>t=>t(e)})},localesApiMock:function(e){(0,n.l)(e)(D.Ad,{getLocale:async({id:e})=>t=>t({id:e}),getLocales:()=>async e=>e({})})},notificationsApiMock:function(e){(0,n.l)(e)(_.vx,{getNotifications:e=>[],notificationShown({id:e,datetime:t}){throw new Error(c.f5)}})},projectsApiMock:function(e){let t;(0,n.l)(e)(u.Nq,{getProjects:(e={page:1})=>[],getProject:e=>i=>t||(t=i(e).then((t=>({...t,id:e})))),addProject(e){throw new Error},editProject:({projectId:e,...i})=>t=t.then((t=>({...t,...i,id:e}))),deleteProject(e){throw new Error}})},proxyApiMock:function(e){const t=(0,n.l)(e),i=(0,p.dB)(e,h.A.FILE_PROXY_EVENT_ID);t(m.Z8,{getFile:async({url:t,tryFetch:n=!0,type:o})=>async s=>{const r=e.getState(),{project:a}=r.configSlice,c=(await i.fire({url:t,project:a})).filter((e=>e instanceof Blob))[0];if(!c)return s({url:t,tryFetch:n,type:o});switch(o){case"json":return JSON.parse(await c.text());case"text":return c.text();default:return c}}})},recoverPasswordApiMock:function(e){(0,n.l)(e)(g.yR,{resetPassword(e){throw new Error(c.f5)},setPassword(e){throw new Error(c.f5)},validateRecoverPasswordCode(e){throw new Error(c.f5)}})},saveFileApiMock:function(e){const t=(0,n.l)(e);if(!A.di.getInstance(e,c.Lz))throw new Error("Something was wrong");const i=(0,p.dB)(e,h.A.UPLOAD_EVENT_ID),o=(0,p.dB)(e,h.A.ON_SEND_TESTEMAIL_ID),s=(0,p.dB)(e,h.A.ON_SEND_LIVEPREVIEW_ID);t(E.yH,{uploadImage:t=>async n=>{const o=e.getState(),{project:s}=o.configSlice,r="tmp"===t.folder?null:await i.fire({file:t.file,project:s}),a=r?r.find((e=>e)):null;return a?[{file_url:a,project:s}]:n({...t,user_id:String((await A.di.getInstanceAsync(e,c.sZ)).app_id)})},sendTestEmail:t=>async i=>{const n=e.getState(),{project:s}=n.configSlice;(await o.fire({project:s,email_id:t.email_id,subject:t.subject,email:t.email,html:t.html,from_name:t.from_name})).some((e=>!1===e))&&await i({...t,user_id:String((await A.di.getInstanceAsync(e,c.sZ)).app_id)})},async sendLivePreview(t){const i=e.getState(),{project:n}=i.configSlice;(await s.fire({project:n,id:t.email,subject:t.subject,html:t.content})).some((e=>!1===e))},sendShortLink:e=>t=>t(e)})},tokenApiMock:function(e){(0,n.l)(e)(f.OV,{tokenCreate:e=>t=>t(e),tokenValidate:()=>e=>e({})})}}},62410:(e,t,i)=>{i.d(t,{r:()=>f});var n=i(33288),o=i(14386),s=i(18398),r=i(47358),a=i(86286),c=i(39990),l=i(68548),d=i(15230),_=i(13652);function u(e){var t;return{fontSize:e.fontSize,fontFamily:e.fontFamily,tabSize:e.tabSize,wordWrap:"off"!==e.wordWrap,minimap:null===(t=e.minimap)||void 0===t?void 0:t.enabled,insertSpaces:e.insertSpaces}}var m=i(39217),p=i(32269),h=i(91366),g=i(93982),E=i(13522),A=i(48802);const f=(0,o.l)((e=>{const t=(0,h.PL)(e),i=(0,A.m)((0,g.Zc)(e,E.A.ON_LIMIT_ID)),o=t.addDisposable(new A.U(i)),f=(0,A.m)((0,g.Zc)(e,E.A.READ_LOCALE)),v=t.addDisposable(new A.U(f)),O=e.dispatch,D=n.di.getInstanceAsync(e,d.sZ).then((e=>(null===e||void 0===e?void 0:e.app_config)||{}),(e=>(console.log(e),{}))),T=(0,_.y)(),S=async(...t)=>{const i=Object.assign({},...t),n=Object.assign({},...t.map((e=>e.editor))),{locale:o="ru_RU",theme:a,codeModeDirection:l,...d}=i;void 0!==l&&("none"===l?O((0,r.N6)(!1)):(O((0,r.N6)(!0)),O((0,r.Uf)(l))));const _=await(0,h.wz)(e);var u;await O(c.Q2.endpoints.editMe.initiate({..._,code_editor:n?(u=n,{font_size:u.fontSize,font_family:u.fontFamily,tab_size:u.tabSize,word_wrap:u.wordWrap,minimap:u.minimap,insert_spaces:u.insertSpaces}):_.code_editor,locale:"string"===typeof o?o:_.locale,theme:"string"===typeof a?a:_.theme})),O((0,s._R)(d))};let I;return{setOptions:T.decorate((async({config:i={},project:r,user:a,advancedConfigs:d,handleReadLocale:_,handleLimitUsage:u})=>{var g;v.setListener(_),o.setListener(u);let E=await D,A=d||E.advancedConfigs,f=localStorage.getItem("configSwither"),T=A&&A[(null===i||void 0===i?void 0:i.mode)||f||"pro"]||(null===(g=(0,l.$)((null===i||void 0===i?void 0:i.mode)||f||"pro"))||void 0===g?void 0:g.config);if(T={...T,configSwither:i.configSwither||!1},await S(T,E,i),O((0,s.bn)(String(r))),O((0,s.ee)(A)),I&&I.dispose(),I=new p.jG,a){let i={...await(0,h.wz)(e),email:"",password:"",...a,id:"number"===typeof a.id?String(a.id):a.id};void 0===a.id&&delete i.id,O(c.Q2.endpoints.editMe.initiate(i)),a.id&&t.addDisposable(n.di.addService(e,m.jY,{execute(e){e.headers.append("user_id",i.id)}}))}r&&t.addDisposable(n.di.addService(e,m.jY,{execute(e){e.headers.append("project_id",String(r))}}))})),instance:{setConfig:T.decorate((async e=>{var t;let i=null===(t=(0,l.$)((null===e||void 0===e?void 0:e.mode)||"pro"))||void 0===t?void 0:t.config;await S(i,await D,e)})),getConfig:()=>function(e){var t,i;const n=e.getState(),o=n[a.Ay.name],c=n[s.Ay.name],l=n[r.Ay.name];return{...c.config,theme:null===(t=o.currentUser)||void 0===t?void 0:t.theme,locale:null===(i=o.currentUser)||void 0===i?void 0:i.locale,codeModeDirection:l.isCodeMode?l.codeModeDirection:"none",editor:u(o.monacoOptions)}}(e),updateConfig:T.decorate((e=>S(e))),handleReadLocale:f,handleLimitUsage:i}}}))},33746:(e,t,i)=>{i.d(t,{F:()=>c});var n=i(44141),o=i(33288),s=i(15230),r=i(14386),a=i(39217);const c=(0,r.l)((e=>{let t=!0;return{setOptions(i){if(i.hasOwnProperty("baseUrl")){const n=o.di.getInstance(e,a.eT),s=n.getOptions(),r=(0,a.qT)(i.baseUrl);s.baseUrl!==r&&(n.setOptions({baseUrl:r}),t=!0)}if(t){const i=o.di.getInstance(e,n.Pz);o.di.inject(e,s.sZ,(async(e,t)=>t||i.app.app_init_create({}).then((({data:e})=>e))),!0),t=!0}}}}))},19209:(e,t,i)=>{i.d(t,{F:()=>u});var n=i(14386),o=i(14315),s=i(33288),r=i(41664),a=i(39217),c=i(13652),l=i(85163);const d=(0,r.Q)(),_=(0,r.Q)(),u=(0,n.l)((e=>({setOptions(t){const i=(0,c.y)(),n=(0,a.mg)(e);s.di.addService(e,a.jY,{execute:i.decorate((async i=>{if(t.jwtAuth){let r=s.di.getInstance(e,d),a=s.di.getInstance(e,_);if(!a&&!r){const i=await n.jwtAuth.token_create({body:t.jwtAuth,type:o.cM.Json});if(i.error)throw a=l.ff,s.di.inject(e,_,l.ff),new Error(l.ff);r=i.data.token,s.di.inject(e,d,r)}a||i.headers.append("authorization",`Bearer ${r}`)}}))})}})))},1383:(e,t,i)=>{i.d(t,{Y:()=>l,h:()=>d});var n=i(14386),o=i(41664),s=i(33288),r=i(39217),a=i(47271),c=i(12264);const l=(0,o.Q)(),d=(0,n.l)((e=>{let t;return s.di.addService(e,r.jY,{execute:async i=>{if(t){const t=await s.di.getInstanceAsync(e,l);t&&i.headers.append("authorization",`Bearer ${t}`)}}}),{setOptions(i){t!==i.getAuthToken&&(t=i.getAuthToken,s.di.inject(e,l,void 0),s.di.inject(e,l,(async(e,i)=>{try{let e=await i;var n;return t?e&&1e3*(null===(n=(0,a.iU)(e))||void 0===n?void 0:n.exp)>(0,c.N)()?e:await t(e):""}catch(o){return console.log(o),""}}),!0))}}}))},14386:(e,t,i)=>{function n(e){return async function(t){return{setOptions:()=>{},instance:{},dispose:()=>{},...await e(t)||{}}}}function o(e){return async t=>{const i={},n=[];for(const o of e)n.push(await o(t));for(const e of n)Object.assign(i,e.instance);return{instance:i,setOptions:e=>{const t=n.map((t=>t.setOptions(e)));return t.some((e=>e instanceof Promise))?Promise.all(t).then((()=>{})):void 0},dispose:()=>{for(const e of n)e.dispose()}}}}i.d(t,{E:()=>o,l:()=>n})},893:(e,t,i)=>{i.d(t,{m:()=>c});var n=i(17126),o=i(92810),s=i(45934),r=i(18398),a=i(70082);const c=({children:e})=>{const[t,i]=(0,o.useState)(),c=(0,s.d4)(r.p5);return(0,a.jsxs)("div",{className:"App blocks-app blocks-plugin",children:[c&&(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:c}}),(0,a.jsx)(n.fh.Provider,{value:t,children:e}),(0,a.jsx)("div",{ref:i,className:"blocks-modal-container"})]})}},97001:(e,t,i)=>{i.d(t,{P:()=>I});var n=i(32269),o=i(93556),s=i(23580),r=i(71210),a=i(56991),c=i(13329),l=i(28316),d=i(18398),_=i(13437),u=i(81304),m=i(4453),p=i(91253),h=i(33288),g=i(15230),E=i(13652),A=i(13522),f=i(93982),v=i(91738),O=i(86739),D=i(39217),T=i(25181);const S="EXTERNAL";class I extends n.jG{constructor(e){super(),this._store=e,this._emailTemplateCache=Object.create(null),this._prevCommand=void 0,this._prevContent=void 0,this._dataSources=void 0,this._eventLock=void 0,this._queue=(0,E.y)(),this._model=void 0,this._currentEmail=void 0,this.show=this._queue.decorate(this._show,this),this.save=this._queue.decorate(this._save,this);const t=(0,s.My)(e);this._dataSources=(0,o.zC)(t),this._eventLock=(0,o.QQ)(t);const i=(0,f.Zc)(e,A.A.ON_MODEL_CHANGE),n=(0,f.Zc)(e,A.A.ON_EMAIL_CHANGED_ID);this.addDisposable(i((e=>{this._model=e}))),this.addDisposable(n((e=>{this._currentEmail=e}))),this.addDisposable(h.di.addService(e,D.jY,{execute:e=>{var t;null!==(t=this._currentEmail)&&void 0!==t&&t.id&&!this._currentEmail.isNew&&e.headers.append("email_id",this._currentEmail.id)}}))}async getProject(){const e=await h.di.getInstanceAsync(this._store,g.sZ);return null===e||void 0===e?void 0:e.project}async getTemplateEmail(e){e=String(e);let t=this._emailTemplateCache[e];if(!t){const i=await this._store.dispatch(O.GY.endpoints.getTemplateEmail.initiate(e));i.error?console.log(i.error):(t={...i.data,lock:!1,parent_email:e},delete t.id)}return t}async getBlocks(){const{cache:e}=this._dataSources.blocks,t=await this.getProject();return(await e.values()).filter((e=>e.project===t)).map((e=>(0,_.A)(e,this._store)))}async getComments(){const{cache:e}=this._dataSources.comments,t=await this.getEmail();return(await e.values()).filter((e=>e.post===t.id)).map((e=>(0,p.I)(e,this._store)))}async getEmailRevisions(){const{cache:e}=this._dataSources.emailRevisions,t=await this.getEmail();return(await e.values()).filter((e=>e.parent===t.id)).map((e=>(0,m.E)(e,this._store)))}async setBlocks(e=[]){const{cache:t}=this._dataSources.blocks;await t.setAll(e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,_.i)(e,this._store)])))}async setEmailRevisions(e=[],t){const{cache:i}=this._dataSources.emailRevisions,n=e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,m._)(e,this._store,t)]));await i.setAll(n)}async setComments(e=[],t){const{cache:i}=this._dataSources.comments,n=e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,p.y)(e,this._store,t)]));await i.setAll(n)}async getEmail(){const e=this._store.getState(),t=e.emailSlice.email.id?e.emailSlice.email:e.newEmailSlice.email,i=(0,u.E)({...t,html:this._model?this._model.getValue():t.html},this._store);return(0,v.AU)(i,t.isAmp)}async compileEmail(){const e=this._store.getState(),t=e.emailSlice.email.id?e.emailSlice.email:e.newEmailSlice.email,i=(0,u.E)({...t,html:this._model?this._model.getValue():t.html},this._store);return(0,v.AU)(i,t.isAmp)}async setEmail(e,t,i=!1){const n=this._dataSources.emails,o=n.cache,s=await this.getProject();e="string"===typeof e?{code:e}:{...e};let a=(0,u.I)(e,this._store);const c=a.id;let l=c;if(void 0!==c?a={...await n.get(c),...a,project:s}:(a={...a,project:s},l=(0,r.l)(),delete a.project),t){const e=await this.getTemplateEmail(String(t));e&&(a={...e,id:String(t),...a})}await o.setAll([[l,a]]),i&&this._runShowCommand({isNew:void 0===c,id:l,project:s})}_runShowCommand(e){const t={...e,type:"email"};this._prevCommand&&!(0,a.bD)(this._prevCommand,e)?(0,c.RS)(this._store,l._1,t):this._store.dispatch((0,d.Ir)(t)),this._prevCommand=e}async _show(e){try{if(!e)return;if(this._eventLock.suspendChange(),e!==this._prevContent){this._prevContent=e;const{email:t,blocks:i,autosaves:n,comments:s,templateId:r}=(0,o.Uw)(e),a=[];a.push(this.setBlocks(i)),void 0!==t.id&&(a.push(this.setComments(s)),a.push(this.setEmailRevisions(n))),a.push(this.setEmail(t,Number(r),!0)),await Promise.all(a)}}catch(t){console.log(t)}finally{this._eventLock.resumeChange()}return new Promise((e=>{(0,f.Zc)(this._store,A.A.ON_EMAIL_INIT_ID)((()=>e()))}))}_save(){return new Promise((async e=>{const t=this._dataSources.emails,i=this.addDisposable(t.onSave((({value:t,source:n})=>{n===S&&(i.dispose(),e((0,u.E)(t,this._store)))}),Number.MIN_VALUE));(0,c.RS)(this._store,l.Kp,S)}))}getCodeErrors(){var e;const t=this._store.getState(),i=this._model;return i?null===(e=t.emailSlice.problemsList)||void 0===e?void 0:e.map((e=>(0,T.B)(i,e))):void 0}}},44376:(e,t,i)=>{i.d(t,{y:()=>A});var n=i(23580),o=i(93556),s=i(81304),r=i(13437),a=i(91253),c=i(4453),l=i(32269),d=i(48802),_=i(13522),u=i(93982),m=i(18398),p=i(98589),h=i(55654),g=i(25181),E=i(23036);class A extends l.jG{constructor(e){super(),this._store=e,this._events=void 0,this._model=void 0,this._listenersUpdaters=void 0;const t=(0,u.Zc)(e,_.A.ON_MODEL_CHANGE);this.addDisposable(t((e=>{this._model=e})))}_get(){const e=this._store,t=(0,n.My)(e),{blocks:i,emails:l,comments:A,emailRevisions:f}=(0,o.zC)(t),v=(0,u.Zc)(e,E.Wk),O=(0,u.Zc)(e,E.ll),D=(0,u.Zc)(e,_.A.ON_SAVEBUTTON_CLICK_ID),T=(0,u.Zc)(e,_.A.ON_PREVIOUSBUTTON_CLICK_ID),S=(0,u.Zc)(e,_.A.ON_NEXTBUTTON_CLICK_ID),I=(0,u.Zc)(e,_.A.ON_EMAIL_INIT_ID),C=(0,u.Zc)(e,_.A.ON_EMAIL_CHANGED_ID),b=(0,u.Zc)(e,_.A.ON_CONTENT_CHANGED_ID),y=(0,u.Zc)(e,_.A.ON_SEND_TESTEMAIL_ID),L=(0,u.Zc)(e,_.A.ON_SEND_EMAIL_MODAL_ID),N=(0,u.Zc)(e,_.A.ON_EMAIL_CLONE_ID),M=(0,u.Zc)(e,_.A.ON_SHARE_ID),w=(0,u.Zc)(e,_.A.ON_SHOW_PREVIEW_ID),P=(0,u.Zc)(e,_.A.ON_SEND_LIVEPREVIEW_ID),R=(0,u.Zc)(e,_.A.ON_CODE_VALIDATE_ID);return{handleValidate:(0,d.m)(R,(e=>this._model?e.map((e=>(0,g.B)(this._model,e))):[])),handleReadEmail:(0,d.m)(l.handlerRead,(e=>e),(t=>t&&(0,s.I)(t,e))),handleSaveEmail:(0,d.m)(l.onSave,(function({prev:t,patch:i,value:n,source:o}){const r=t?(0,s.E)(t,e):void 0;return{prev:r,patch:(0,p.g)(r,(0,s.E)(i,e)),value:(0,s.E)(n,e),source:o}}),(t=>t?(0,s.I)(t,e):void 0)),handleRemoveEmail:(0,d.m)(l.onRemove,(({value:t,source:i})=>({value:(0,s.E)(t,e),source:i})),(()=>{})),handleReadCommonBlocks:(0,d.m)(O,(e=>e.project),(t=>null===t||void 0===t?void 0:t.map((t=>(0,r.i)(t,e))))),handleReadTemplateBlocks:(0,d.m)(v,(e=>e),(t=>null===t||void 0===t?void 0:t.map((t=>(0,r.i)(t,e))))),handleReadBlocks:(0,d.m)(i.byForeignKey("project").handleRead,(t=>(0,m.jY)(e.getState())||String(t)),(t=>null===t||void 0===t?void 0:t.map((t=>(0,r.i)(t,e))))),handleSaveBlock:(0,d.m)(i.onSave,(function({prev:t,patch:i,value:n,source:o}){const s=t?(0,r.A)(t,e):void 0;return{prev:s,patch:(0,p.g)(s,(0,r.A)(i,e)),value:(0,r.A)(n,e),source:o}}),(t=>t?(0,r.i)(t,e):void 0)),handleRemoveBlock:(0,d.m)(i.onRemove,(({value:t,source:i})=>({value:(0,r.A)(t,e),source:i})),(()=>{})),handleReadComments:(0,d.m)(A.byForeignKey("post").handleRead,(e=>e),(t=>null===t||void 0===t?void 0:t.map((t=>(0,a.y)(t,e))))),handleSaveComment:(0,d.m)(A.onSave,(function({prev:t,patch:i,value:n,source:o}){const s=t?(0,a.I)(t,e):void 0;return{prev:s,patch:(0,p.g)(s,(0,a.I)(i,e)),value:(0,a.I)(n,e),source:o}}),(t=>t?(0,a.y)(t,e):void 0)),handleRemoveComment:(0,d.m)(A.onRemove,(({value:t,source:i})=>({value:(0,a.I)(t,e),source:i})),(()=>{})),handleReadEmailRevisions:(0,d.m)(f.byForeignKey("parent").handleRead,(e=>e),(t=>null===t||void 0===t?void 0:t.map((t=>(0,c._)(t,e))))),handleEmailAutosave:(0,d.m)(f.onSave,(function({prev:t,patch:i,value:n,source:o}){return{value:(0,c.E)(n,e),source:o}}),(t=>t?(0,c._)(t,e):void 0)),handleRemoveEmailAutoSave:(0,d.m)(f.onRemove,(({value:t,source:i})=>({value:(0,c.E)(t,e),source:i})),(()=>{})),handleEmailChanged:(0,d.m)((0,h.sg)(C,100),(t=>(0,s.E)(t,e))),handleEmailInit:(0,d.m)(I,(t=>(0,s.E)(t,e))),handlePreviousButtonClick:(0,d.m)(T,(t=>(0,s.E)(t,e))),handleNextButtonClick:(0,d.m)(S,(t=>(0,s.E)(t,e))),handleSaveButtonClick:(0,d.m)(D,(t=>(0,s.E)(t,e))),handleHtmlChanged:(0,d.m)((0,h.sg)(b,100)),handleTestEmailSend:(0,d.m)(y,(({html:e,...t})=>({...t,code:e,compiled:{html:e,ampHtml:""}}))),handleTestEmailModal:(0,d.m)(L,(t=>(0,s.E)(t,e))),handleCloneEmail:(0,d.m)(N,(t=>(0,s.E)(t,e))),handleShareEmail:(0,d.m)(M),handlePreviewEmail:(0,d.m)(w),handleLivePreviewEmail:(0,d.m)(P)}}get(){return this._events||(this._events=this._get())}setOptions(e={}){const t=this.get();let i=this._listenersUpdaters;if(!i){i=this._listenersUpdaters={};for(const e of Object.keys(t))i[e]=this.addDisposable(new d.U(t[e]))}for(const n of Object.keys(t))i[n].setListener(e[n])}}},93556:(e,t,i)=>{i.d(t,{QQ:()=>a,Uw:()=>c,zC:()=>r});var n=i(23036),o=i(72788),s=i(87265);function r(e){return{emails:(0,s.Av)(e),blocks:(0,n.Xy)(e),emailRevisions:(0,s.jw)(e),blocksRevision:(0,n.yc)(e),comments:(0,o.D)(e)}}function a(e){const t=Object.values(r(e));return{suspendChange(){t.forEach((e=>e.suspendChange()))},resumeChange(){t.forEach((e=>e.resumeChange()))}}}function c(e){return"string"===typeof e?{email:{code:e}}:function(e){return!e.hasOwnProperty("email")&&!e.hasOwnProperty("block")&&!e.hasOwnProperty("templateId")}(e)?{email:e}:{...e,email:"string"===typeof e.email?{code:e.email}:e.email||{}}}},8671:(e,t,i)=>{i.d(t,{e:()=>c});var n=i(14386),o=i(33288),s=i(15230),r=i(32269),a=i(48802);const c=(0,n.l)((e=>{const t=o.di.getInstance(e,s.Lz),i=t.addDisposable(new r.vl),n=(0,a.m)(i.event),c=t.addDisposable(new a.U(n));return{setOptions({handleDestroy:e}){c.setListener(e)},instance:{handleDestroy:n,destroy:()=>t.dispose()}}}))},63772:(e,t,i)=>{i.d(t,{Z:()=>l});var n=i(14386),o=i(33288),s=i(48802),r=i(15230),a=i(93982),c=i(13522);const l=(0,n.l)((e=>{const t=o.di.getInstance(e,r.Lz),i=(0,a.Zc)(e,c.A.UPLOAD_EVENT_ID),n=(0,a.Zc)(e,c.A.FILE_PROXY_EVENT_ID),l=(0,s.m)(i),d=(0,s.m)(n),_=t.addDisposable(new s.U(l)),u=t.addDisposable(new s.U(d));return{setOptions(e){_.setListener(e.handleLoadImage),u.setListener(e.handleFileProxy)},instance:{handleLoadImage:l,handleFileProxy:d}}}))},55853:(e,t,i)=>{i.d(t,{E:()=>c});var n=i(14386),o=i(33288),s=i(15230),r=i(55654),a=i(48802);const c=(0,n.l)((e=>{const t=o.di.getInstance(e,s.Lz),i=t.addDisposable(new r.vl),n=o.di.getInstanceAsync(e,s.Cd);n.then((({instance:e})=>i.fire(e)));const c=(0,a.m)(i.event),l=t.addDisposable(new a.U(c));return{setOptions({handleLoad:e}){l.setListener(e)},instance:{handleLoad:c,reset:e=>n.then((({instance:t,setOptions:i})=>Promise.resolve(i(e)).then((()=>t))))},destroy:()=>t.dispose()}}))},1281:(e,t,i)=>{i.d(t,{Z:()=>g});var n=i(14386),o=i(33288),s=i(15230),r=i(48802),a=i(13329),c=i(28316),l=(i(92810),i(814)),d=i(70082);function _(e){return"string"===typeof e?e:e?(0,d.jsx)("div",{ref:t=>null===t||void 0===t?void 0:t.replaceWith(e)}):void 0}function u(e,t="success"){return"string"===typeof e&&(e={message:e}),(0,l.TB)({type:e.type||t,data:e.data,innerException:e.innerException,message:_(e.message),description:_(e.description),btn:_(e.btn),onClose:e.onClose,duration:e.duration,icon:_(e.icon),placement:e.placement,style:e.style,closeIcon:"boolean"===typeof e.closeIcon||"undefined"===typeof e.closeIcon?e.closeIcon:_(e.closeIcon),props:e.props,role:e.role})}var m=i(13522),p=i(55654),h=i(93982);const g=(0,n.l)((e=>{const t=o.di.getInstance(e,s.Lz),i=(0,h.Zc)(e,m.A.ON_NOTIFICATION),n=(0,p.pb)(i,(e=>"error"===e.type)),l=(0,p.pb)(i,(e=>"success"===e.type)),d=(0,r.m)(i,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e):e)),_=(0,r.m)(n,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e,"error"):e)),g=(0,r.m)(l,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e):e)),E=t.addDisposable(new r.U(d)),A=t.addDisposable(new r.U(_)),f=t.addDisposable(new r.U(g));return{setOptions({handleNotify:e,handleSuccess:t,handleError:i}){E.setListener(e),A.setListener(i),f.setListener(t)},instance:{notify(t){(0,a.RS)(e,c.Sb,{placement:"bottomRight",...u(t)})},handleNotify:d,handleError:_,handleSuccess:g}}}))},92268:(e,t,i)=>{i.d(t,{w:()=>c});var n=i(14386),o=i(91366),s=i(93982),r=i(13522),a=i(32411);const c=(0,n.l)((e=>{let t;const i=(0,o.PL)(e),n=(0,s.Zc)(e,r.A.ON_MODEL_CHANGE);return i.addDisposable(n((e=>{t=(0,a.VA)(e)}))),{instance:{undoRedoService:{undo:()=>t.undo(),redo:()=>t.redo(),clear:()=>t.clear(),getPast:()=>t.getPast(),getFuture:()=>t.getFuture(),canUndo:()=>t.canUndo(),canRedo:()=>t.canRedo(),createSnapshot:()=>t.createSnapshot(),restoreSnapshot:e=>t.restoreSnapshot(e)}}}}))},89949:(e,t,i)=>{i.d(t,{R:()=>r});var n=i(92810),o=i(45934),s=i(39990);const r=({onLoad:e,children:t})=>{(0,n.useEffect)((()=>{e&&e()}),[e]);const i=(0,o.wA)();return(0,n.useMemo)((()=>i(s.Q2.endpoints.getMe.initiate({}))),[i]),t}},55654:(e,t,i)=>{i.d(t,{HN:()=>d,IO:()=>s,P9:()=>r,lt:()=>u,pb:()=>c,sg:()=>l,vl:()=>_});var n=i(32269);class o extends n.jG{constructor(...e){super(...e),this._listeners=[],this.event=this._addListener.bind(this)}getListeners(e){return this._listeners.flatMap((([t])=>"function"===typeof t?t:t.getListeners(e)))}hasListeners(){return this._listeners.length>0}_addListener(e,t=0,i){if(!this.isDisposed()){const n=this._listeners;i&&"function"===typeof e&&(e=e.bind(i));const o=n.findIndex((([e,i])=>t<i)),s=[e,t];return n.splice(o>=0?o:n.length,0,s),{dispose(){const e=n.indexOf(s);e>=0&&n.splice(e,1)}}}}dispose(){this._listeners.splice(0,this._listeners.length),super.dispose()}}class s extends o{constructor(...e){super(...e),this.fire=this._fire.bind(this)}execute(e,t){for(const n of t)try{n(...e)}catch(i){console.log(i)}}_fire(...e){if(!this.isDisposed())return this.execute(e,this.getListeners(e))||void 0}}function r(e,t=0){const i=new o;return i.addDisposable(e(i,t)),i.event}class a extends o{constructor(e){super(),this._filter=e}getListeners(e){return this._filter(...e)?super.getListeners(e):[]}}function c(e,t,i=0){const n=new a(t);return n.addDisposable(e(n,i)),n.event}function l(e,t=0,i=0){const n=new s;let o,r=0;return n.addDisposable(e(((...e)=>{o=e,r||(r=setTimeout((()=>{n.fire(...o),r=0}),t))}),i)),n.event}class d extends s{constructor(...e){super(...e),this._suspendCounter=0,this._wasFired=!1}proccessResult(){}execute([e],t){if(this._suspendCounter)this._wasFired=!0;else for(const n of t)try{n(e)}catch(i){console.log(i)}}suspend(){this._suspendCounter++}resume(){0===--this._suspendCounter&&(this._wasFired&&this.fire(),this._wasFired=!1)}}class _ extends s{execute([e],t){for(const n of t)try{n(e)}catch(i){console.log(i)}}}class u extends s{async execute([e],t){const i=[];for(const n of t){const t=await n(e);i.push(t)}return i}}},48802:(e,t,i)=>{i.d(t,{U:()=>s,m:()=>r});var n=i(32269),o=i(55654);class s extends n.jG{constructor(e){super(),this._event=e,this._listener=void 0,this._disposeEvent=void 0}setListener(e){this._listener!==e&&(this._listener=e,this._disposeEvent&&this._disposeEvent(),this._disposeEvent=e?this._event(e):void 0)}dispose(){this._disposeEvent&&this._disposeEvent(),super.dispose()}}function r(e,t,i){const n=(0,o.P9)(e);return(e,o,s)=>{const r=n((async n=>{const o=t?t(n):n;s&&e.bind(s);const r=await e(o);return i?i(r):r}),o,s);return()=>r.dispose()}}},13652:(e,t,i)=>{i.d(t,{y:()=>n});const n=e=>{let t={current:Promise.resolve(),state:e,decorate:(e,i)=>(i&&(e=e.bind(i)),function(...i){const n=t.current.then((()=>e(...i)));return t.current=n.then((e=>{t.state=e}),(e=>{console.log(e)})),n})};return t}},18398:(e,t,i)=>{i.d(t,{Ay:()=>T,EV:()=>O,GH:()=>p,Ir:()=>h,Kj:()=>D,RP:()=>_,_R:()=>E,bn:()=>A,ee:()=>f,jY:()=>m,p5:()=>u,s0:()=>l,zg:()=>d});var n=i(90536),o=i(31770),s=i(68548);const r="configSlice",a=(0,o.ur)((0,s.$)("pro")),c=(0,n.createSlice)({name:r,initialState:{...a,initialMergeTags:void 0},reducers:{setPage:(e,t)=>{e.page=t.payload},setConfig:(e,t)=>{e.config={...a.config,...t.payload}},changeConfigMode:(e,t)=>{var i,n,o;const r=null!==(i=null===e||void 0===e||null===(n=e.advancedConfigs)||void 0===n?void 0:n[t.payload])&&void 0!==i?i:null===(o=(0,s.$)(t.payload))||void 0===o?void 0:o.config;if("simple"!==e.config.mode&&"simple"!==t.payload){const t={...e.config,...Object.fromEntries(Object.entries(r).filter((([e])=>s.i.includes(e))))};e.config=t}else e.config={...e.config,...(0,s.$)(t.payload).config}},setInitialMergeTags:(e,t)=>{e.initialMergeTags=t.payload},setMergeTags:(e,t)=>{e.config.mergeTags=t.payload},updateConfig:(e,t)=>{e.config={...e.config,...t.payload}},setProject:(e,t)=>{e.project=t.payload},setAdvancedConfigs:(e,t)=>{e.advancedConfigs=t.payload}},extraReducers:e=>{}}),l=e=>e[r].page,d=e=>e[r].config,_=e=>e[r].config.themes,u=e=>e[r].config.styles,m=e=>e[r].project,p=e=>e[r].config.mergeTags||e[r].initialMergeTags,{setPage:h,setConfig:g,updateConfig:E,setProject:A,setAdvancedConfigs:f,setMergeTags:v,changeConfigMode:O,setInitialMergeTags:D}=c.actions,T=c},47358:(e,t,i)=>{i.d(t,{Ay:()=>j,B:()=>y,Bp:()=>S,CS:()=>w,Ct:()=>M,Fk:()=>h,Fv:()=>R,M7:()=>C,N6:()=>D,NQ:()=>N,Oo:()=>m,PM:()=>p,Tn:()=>k,Uf:()=>f,V$:()=>B,Wm:()=>L,cL:()=>b,mi:()=>g,oG:()=>U,qf:()=>u,sy:()=>I,vc:()=>E,vs:()=>A,wW:()=>v,wr:()=>O,yy:()=>P});var n=i(90536),o=i(85163),s=i(31770),r=i(55701);const a=window.localStorage.getItem(o.V0.em_code_mode_settings),c=a&&JSON.parse(a),l=(0,s.ur)({activeModal:"",lastActiveSettingsTab:o.Bv,activeSettingsTab:o.Bv,isPanelHistoryCollapsed:!0,monacoHeight:0,isCodeMode:(null===c||void 0===c?void 0:c.isCodeMode)||o.EW.isPlugin,codeModeDirection:(null===c||void 0===c?void 0:c.codeModeDirection)||"left",emailWidth:"100%",emailViewType:o.Vp,mobileViewActive:{shutdown:!0,styles:!0},emailMaxWidthSize:425,propertiesPanelKey:o.WU,parentBlocks:[],isGlobalLoading:!1}),d="emailPageSlice",_=(0,n.createSlice)({name:d,initialState:l,reducers:{openModal:(e,t)=>{e.activeModal=t.payload},closeModal:e=>{e.activeModal=""},setActiveSettingsTab:(e,t)=>{e.lastActiveSettingsTab=e.activeSettingsTab,e.activeSettingsTab=t.payload,t.payload!==o.Vv&&(e.isPanelHistoryCollapsed=!0)},resetToLastActiveSettingsTab:e=>{"Properties"===e.lastActiveSettingsTab?e.activeSettingsTab="Build":e.activeSettingsTab=e.lastActiveSettingsTab,e.lastActiveSettingsTab!==o.Vv&&(e.isPanelHistoryCollapsed=!0)},switchIsPanelHistoryCollapsed:(e,t)=>{e.isPanelHistoryCollapsed=t.payload||!e.isPanelHistoryCollapsed},setEmailWidth:(e,{payload:t})=>{e.emailWidth=t,e.emailViewType=t>e.emailMaxWidthSize||"100%"===t?o.Vp:o.ND,window.localStorage.setItem(o.V0.em_default_sizes,JSON.stringify(t))},setEmailMaxWidthSize:(e,{payload:t})=>{e.emailMaxWidthSize=t},setEmailViewType:(e,t)=>{e.emailViewType=t.payload},switchCodeMode:e=>{const t=!e.isCodeMode;e.isCodeMode=t,window.localStorage.setItem(o.V0.em_code_mode_settings,JSON.stringify({codeModeDirection:e.codeModeDirection,isCodeMode:t}))},setCodeMode:(e,t)=>{const i=t.payload;e.isCodeMode!==i&&(e.isCodeMode=i,window.localStorage.setItem(o.V0.em_code_mode_settings,JSON.stringify({codeModeDirection:e.codeModeDirection,isCodeMode:i})))},switchCodeModeDirection:(e,t)=>{e.codeModeDirection=t.payload,window.localStorage.setItem(o.V0.em_code_mode_settings,JSON.stringify({isCodeMode:e.isCodeMode,codeModeDirection:t.payload}))},setMobileViewActive:(e,t)=>{e.mobileViewActive=t.payload},setPropertiesPanelKey:(e,t)=>{e.propertiesPanelKey=t.payload},resetParentBlocks:e=>{e.parentBlocks=[]},setParentBlocks:(e,t)=>{e.parentBlocks=t.payload},setIsGlobalLoading:(e,t)=>{e.isGlobalLoading=t.payload}},extraReducers:e=>{e.addMatcher(r.VM.endpoints.getParentEmailBlocks.matchFulfilled,((e,t)=>{e.parentBlocks=t.payload}))}}),{openModal:u,closeModal:m,setActiveSettingsTab:p,resetToLastActiveSettingsTab:h,switchIsPanelHistoryCollapsed:g,setEmailWidth:E,switchCodeMode:A,switchCodeModeDirection:f,setMobileViewActive:v,setEmailViewType:O,setCodeMode:D,setEmailMaxWidthSize:T,setPropertiesPanelKey:S,resetParentBlocks:I,setIsGlobalLoading:C}=_.actions,b=e=>e[d].activeModal,y=e=>e[d].activeSettingsTab,L=e=>e[d].isPanelHistoryCollapsed,N=e=>e[d].emailWidth,M=e=>e[d].emailViewType,w=e=>e[d].mobileViewActive,P=e=>e[d].codeModeDirection,R=e=>e[d].isCodeMode,k=e=>e[d].propertiesPanelKey,B=e=>e[d].parentBlocks,U=e=>e[d].isGlobalLoading,j=_},95713:(e,t,i)=>{i.d(t,{DX:()=>D,E_:()=>C,Fl:()=>b,HW:()=>N,PF:()=>S,aU:()=>P,dS:()=>n,fE:()=>v,gW:()=>y,ih:()=>R,ke:()=>I,ks:()=>T,tc:()=>k,uB:()=>f,xX:()=>L});var n,o=i(84978),s=i(34235),r=i(39946),a=i(63102),c=i(61883),l=i(11615),d=i(52692),_=i(93308),u=i(75664),m=i(3660),p=i(7492),h=i(97980),g=i(35152),E=i(86448),A=i(92798);class f{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let e=t.kbExpr;this.precondition&&(e=e?u.M$.and(e,this.precondition):this.precondition);const i={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};p.f.registerKeybindingRule(i)}}_.wb.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){d.ZG.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class v extends f{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i){return this._implementations.push({priority:e,name:t,implementation:i}),this._implementations.sort(((e,t)=>t.priority-e.priority)),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e].implementation===i)return void this._implementations.splice(e,1)}}}runCommand(e,t){const i=e.get(A.rr);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const n of this._implementations){const o=n.implementation(e,t);if(o){if(i.trace(`Command '${this.id}' was handled by '${n.name}'.`),"boolean"===typeof o)return;return o}}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class O extends f{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class D extends f{static bindToContribution(e){return class extends D{constructor(e){super(e),this._callback=e.handler}runEditorCommand(t,i,n){const o=e(i);o&&this._callback(o,n)}}}runCommand(e,t){const i=e.get(r.T),n=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(n)return n.invokeWithinContext((e=>{if(e.get(u.fN).contextMatchesRules((0,E.UH)(this.precondition)))return this.runEditorCommand(e,n,t)}))}}class T extends D{constructor(e){super(T.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=d.D8.EditorContext),t.title||(t.title=e.label),t.when=u.M$.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(g.k).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class S extends T{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort(((e,t)=>t[0]-e[0])),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e][1]===t)return void this._implementations.splice(e,1)}}}run(e,t,i){for(const n of this._implementations){const o=n[1](e,t,i);if(o){if("boolean"===typeof o)return;return o}}}}function I(e,t){_.wb.registerCommand(e,(function(e,...i){const n=e.get(m._Y),[o,r]=i;(0,E.j)(s.r.isUri(o)),(0,E.j)(a.y.isIPosition(r));const d=e.get(c.S).getModel(o);if(d){const e=a.y.lift(r);return n.invokeFunction(t,d,e,...i.slice(2))}return e.get(l.b).createModelReference(o).then((e=>new Promise(((o,s)=>{try{o(n.invokeFunction(t,e.object.textEditorModel,a.y.lift(r),i.slice(2)))}catch(c){s(c)}})).finally((()=>{e.dispose()}))))}))}function C(e){return M.INSTANCE.registerEditorCommand(e),e}function b(e){const t=new e;return M.INSTANCE.registerEditorAction(t),t}function y(e){return M.INSTANCE.registerEditorAction(e),e}function L(e){M.INSTANCE.registerEditorAction(e)}function N(e,t){M.INSTANCE.registerEditorContribution(e,t)}!function(e){e.getEditorCommand=function(e){return M.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return M.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return M.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return M.INSTANCE.getEditorContributions().filter((t=>e.indexOf(t.id)>=0))},e.getDiffEditorContributions=function(){return M.INSTANCE.getDiffEditorContributions()}}(n||(n={}));class M{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t){this.editorContributions.push({id:e,ctor:t})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions.slice(0)}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function w(e){return e.register(),e}M.INSTANCE=new M,h.O.add("editor.contributions",M.INSTANCE);const P=w(new v({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:d.D8.MenubarEditMenu,group:"1_do",title:o.kg({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:d.D8.CommandPalette,group:"",title:o.kg("undo","Undo"),order:1}]}));w(new O(P,{id:"default:undo",precondition:void 0}));const R=w(new v({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:d.D8.MenubarEditMenu,group:"1_do",title:o.kg({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:d.D8.CommandPalette,group:"",title:o.kg("redo","Redo"),order:1}]}));w(new O(R,{id:"default:redo",precondition:void 0}));const k=w(new v({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:d.D8.MenubarSelectionMenu,group:"1_basic",title:o.kg({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:d.D8.CommandPalette,group:"",title:o.kg("selectAll","Select All"),order:1}]}))},57964:()=>{}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[4529],{66047:(e,t,i)=>{i.r(t),i.d(t,{CancellationTokenSource:()=>n.CancellationTokenSource,Emitter:()=>n.Emitter,KeyCode:()=>n.KeyCode,KeyMod:()=>n.KeyMod,MarkerSeverity:()=>n.MarkerSeverity,MarkerTag:()=>n.MarkerTag,Position:()=>n.Position,Range:()=>n.Range,Selection:()=>n.Selection,SelectionDirection:()=>n.SelectionDirection,Token:()=>n.Token,Uri:()=>n.Uri,__esModule:()=>n.__esModule,editor:()=>n.editor,languages:()=>n.languages});i(12132),i(25401),i(58185),i(91426),i(71075),i(89879),i(68251),i(74028),i(23777),i(94951),i(21109),i(39455),i(10156),i(28902),i(901);var n=i(6295)},28316:(e,t,i)=>{i.d(t,{Kp:()=>n,Sb:()=>s,_1:()=>o});const n="SAVE",o="SHOW",s="NOTIFY"},85163:(e,t,i)=>{i.d(t,{A9:()=>l,BD:()=>me,Bv:()=>B,CJ:()=>m,EW:()=>a,F3:()=>f,F5:()=>o,G$:()=>W,IE:()=>q,IJ:()=>g,JE:()=>Z,Jy:()=>G,KI:()=>ne,N7:()=>F,ND:()=>le,QV:()=>pe,Qz:()=>Q,Rn:()=>Ee,Ru:()=>D,St:()=>V,T:()=>p,Tm:()=>J,UW:()=>_,Ug:()=>ue,V0:()=>d,VG:()=>A,Vp:()=>ce,Vv:()=>N,WU:()=>w,Y$:()=>ee,YY:()=>_e,_P:()=>c,aO:()=>$,bV:()=>S,e3:()=>ge,eA:()=>Y,eG:()=>ie,ff:()=>s,gY:()=>z,hc:()=>j,iU:()=>se,iV:()=>K,iW:()=>P,jg:()=>he,lx:()=>v,m3:()=>X,mU:()=>re,mX:()=>b,nA:()=>x,nd:()=>h,oy:()=>r,p5:()=>oe,rW:()=>T,rY:()=>U,rb:()=>M,rl:()=>te,ti:()=>I,vd:()=>E,wF:()=>ae,xz:()=>C,y2:()=>u,yI:()=>L,yo:()=>H,yy:()=>y,z$:()=>k,zh:()=>de,zx:()=>R});var n=i(19378);const o="LOADING",s="ERROR",r="useblocks",a={isPlugin:!1},c={isEditor:!1},l={em_token:"em_token",em_elements_view:"em_elements_view",em_new_block:"em_new_block",em_new_email:"em_new_email",em_id:"em_id",em_name:"em_name",em_email:"em_email",em_locale:"em_locale",em_carrotquest_hash:"em_carrotquest_hash",em_ducalis_hash:"em_ducalis_hash",em_email_subscription_consent:"em_email_subscription_consent",em_folder:"em_folder",promocode:"promocode",em_active_tab:"em_active_tab"},d={em_color_scheme:"em_color_scheme",em_code_mode_pane_sizes:"em_code_mode_pane_sizes",em_preview_pane_sizes:"em_preview_pane_sizes",em_default_sizes:"em_default_sizes",em_pane_sizes:"em_pane_sizes",em_test_emails:"em_test_emails",em_menu_is_locked:"em_menu_is_locked",em_code_mode_settings:"em_code_mode_settings",em_folder_is_open:"em_folder_is_open",em_active_tab:"em_active_tab",em_ai_settings:"em_ai_settings"},_="deleted",u="all",m="not all",p="light",h="dark",g="system",E="(prefers-color-scheme: light)",f="(prefers-color-scheme: dark)",A="#1890ff",v={ADD_NEW_PROJECT_MODAL:"ADD_NEW_PROJECT_MODAL",EDIT_PROJECT_MODAL:"EDIT_PROJECT_MODAL",BLOCKS_MODAL:"BLOCKS_MODAL",EDIT_PROFILE_MODAL:"EDIT_PROFILE_MODAL",SEND_TEST_EMAIL:"SEND_TEST_EMAIL",ADD_NEW_EBLOCK_MODAL:"ADD_NEW_EBLOCK_MODAL",ADD_NEW_EMAIL_MODAL:"ADD_NEW_EMAIL_MODAL",ADD_NEW_AI_EMAIL:"ADD_NEW_AI_EMAIL",SWITCH_TO_PLAN_MODAL:"SWITCH_TO_PLAN_MODAL",IMAGE_EDITOR_MODAL:"IMAGE_EDITOR_MODAL",ADD_NEW_FOLDER_MODAL:"ADD_NEW_FOLDER_MODAL",EDIT_FOLDER_NAME_MODAL:"EDIT_FOLDER_NAME_MODAL",ADD_NEW_GROUP_MODAL:"ADD_NEW_GROUP_MODAL",EDIT_GROUP_NAME_MODAL:"EDIT_GROUP_NAME_MODAL",UPLOAD_IMAGE_MODAL:"UPLOAD_IMAGE_MODAL",UPLOAD_BACKGROUND_MODAL:"UPLOAD_BACKGROUND_MODAL",UPLOAD_IMAGE_MODAL_AI:"UPLOAD_IMAGE_MODAL_AI",UPLOAD_BACKGROUND_MODAL_AI:"UPLOAD_BACKGROUND_MODAL_AI",UPLOAD_IMAGE_MODAL_STOCK:"UPLOAD_IMAGE_MODAL_STOCK",UPLOAD_BACKGROUND_MODAL_STOCK:"UPLOAD_BACKGROUND_MODAL_STOCK",UPLOAD_IMAGE_MODAL_GIF:"UPLOAD_IMAGE_MODAL_GIF",UPLOAD_BACKGROUND_MODAL_GIF:"UPLOAD_BACKGROUND_MODAL_GIF",UPLOAD_IMAGE_MODAL_EDIT:"UPLOAD_IMAGE_MODAL_EDIT",UPLOAD_BACKGROUND_MODAL_EDIT:"UPLOAD_BACKGROUND_MODAL_EDIT",UPLOAD_IMAGE_MODAL_UPLOAD:"UPLOAD_IMAGE_MODAL_UPLOAD",UPLOAD_BACKGROUND_MODAL_UPLOAD:"UPLOAD_BACKGROUND_MODAL_UPLOAD"};let O;!function(e){e[e.Amp=0]="Amp",e[e.HTML=1]="HTML",e[e.Everywhere=2]="Everywhere"}(O||(O={}));const D={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_PREVIEW:"update_preview",UPDATE_EDITOR:"update_editor",UPDATE_EDITOR_POSITION:"update_editor_position",UPDATE_SIDE_MENU_EDITOR:"update_side_menu_editor",SAVE_EMAIL:"saveEmail",SANDBOX_ELEMENT_SETTINGS_SET:"sandbox_element_settings_set",SANDBOX_EMAIL_SETTINGS_SET:"sandbox_email_settings_set",SANDBOX_BLOCK_SETTINGS_SET:"sandbox_block_settings_set",SANDBOX_ELEMENT_PARENT_GET:"sandbox_element_parent_get",SANDBOX_ELEMENT_PARENT_TABLE_GET:"sandbox_element_parent_table_get",SANDBOX_ELEMENT_PREV_GET:"sandbox_element_prev_get",SANDBOX_ELEMENT_NEXT_GET:"sandbox_element_next_get",SANDBOX_ELEMENT_REMOVE:"sandbox_element_remove",SANDBOX_ELEMENT_ACTIVE_RESET:"sandbox_element_active_reset",SANDBOX_ELEMENT_ACTIVE_SET:"sandbox_element_active_set",SANDBOX_ELEMENT_HOVER_SET:"sandbox_element_hover_set",SANDBOX_ELEMENT_IMG_LINK:"sandbox_element_img_link",SANDBOX_ELEMENT_TEXT:"sandbox_element_text",SANDBOX_EMAIL_CONTENT_GET:"sandbox_email_content_get",SANDBOX_SET_POSITION_TO_IMG:"sandbox_set_position_to_img",SANDBOX_SET_POSITION_TO_LINK:"sandbox_set_position_to_link",SANDBOX_ACCORDION_ADD_SECTION:"sandbox_accordion_add_section",SANDBOX_ACCORDION_REMOVE_SECTION:"sandbox_accordion_remove_section",APPLICATION_FOCUS_IN_IFRAME:"application_focus_in_iframe",APPLICATION_EMAIL_SETTINGS_SET:"application_email_settings_set",APPLICATION_BLOCK_SETTINGS_SET:"application_block_settings_set",APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",APPLICATION_ELEMENT_SETTINGS_CLOSE:"application_element_settings_close",APPLICATION_ACTION:"application_action",APPLICATION_EBLOCK_ADD:"application_eblock_add",APPLICATION_SCROLL_TO:"application_scroll-to",APPLICATION_SCROLL_BLOCK_SHOW:"application_scroll-block-show",APPLICATION_SCROLL_BLOCK_HIDE:"application_scroll-block-hide",APPLICATION_DISCUSS_SET_ID:"application_discuss_set_id",APPLICATION_DISCUSS_GET_COMMENT:"application_discuss_get_comment",APPLICATION_DISCUSS_NO_COMMENT:"application_discuss_no_comment",APPLICATION_DISCUSS_SAVE_TARGET:"application_discuss_save_target",APPLICATION_IFRAME_SET_HEIGHT:"application_iframe_set_height",APPLICATION_COMMON_STYLES_UPDATE:"application_commonStyles_update",APPLICATION_EMAIL_CONTENT_GET:"application_email_content_get",APPLICATION_OPEN_IMAGE_AI_POPUP:"application_open-image-ai-popup",APPLICATION_OPEN_IMAGE_UPLOAD_POPUP:"application_open-image-upload-popup",APPLICATION_OPEN_IMAGE_EDIT_POPUP:"application_open-image-edit-popup",APPLICATION_OPEN_IMAGE_GIF_POPUP:"application_open-image-gif-popup",APPLICATION_OPEN_IMAGE_STOCK_POPUP:"application_open-image-stock-popup",APPLICATION_CLOSE_IMAGE_EDIT_POPUP:"application_close-image-edit-popup",APPLICATION_SUBJECT_UPDATE:(0,n.Qm)("application_subject_update"),APPLICATION_PREHEADER_UPDATE:(0,n.Qm)("application_preheader_update"),APPLICATION_DOMPARSER_ERROR:(0,n.Qm)("application_domparser_error"),APPLICATION_UPDATE_ENTITY:(0,n.Qm)("application_update_entity"),APPLICATION_IFRAME_DRAG_EVENT:(0,n.Qm)("application_iframe_drag_event"),APPLICATION_HAS_AMP:(0,n.Qm)("application_has_amp"),SANDBOX_WINDOW_CHARACTERISTIC:"sandbox_window-characteristic",SANDBOX_IFRAME_SETSIZE:"sandbox_iframe-setsize",SANDBOX_BLOCK_INSERT:"sandbox_block-insert",SANDBOX_ATOM_INSERT:"sandbox_atom-insert",SANDBOX_DRAG_CANCEL:"sandbox_drag-cancel",UPDATE_EDITOR_POSITION_FROM_EDITOR:"update_position_from_editor",UPDATE_EDITOR_POSITION_FROM_IFRAME:"update_position_from_iframe",SANDBOX_CHANGE_PREVIEW:"sandbox_change_preview",APPLICATION_CHANGE_PREVIEW:"application_change_preview",SANDBOX_LOCK_EDIT:"sandbox_lock_edit",SANDBOX_FLOATBLOCK_ADD:"sandbox_floatBlock_add",SANDBOX_FLOATBLOCK_REMOVE:"sandbox_floatBlock_remove",EDITOR_CHANGE_FOCUS:"editor_change_focus",SANDBOX_RESIZED:"sandbox_resized",SANDBOX_LOCK_DISCUSS:"sandbox_lock_discuss",SANDBOX_DISCUSS_SET_TARGET:"sandbox_discuss_set_target",SANDBOX_DISCUSS_REMOVE_TARGET:"sandbox_discuss_remove_target",SANDBOX_DISCUSS_RESET:"sandbox_discuss_reset",SANDBOX_DISCUSS_GET_TARGET:"sandbox_discuss_get_target",SANDBOX_READY:(0,n.Qm)("SANDBOX_READY"),SANDBOX_FLOATBLOCK_WRAP:"sandbox_floatblock_wrap",SANDBOX_FLOATBLOCK_DIR:"sandbox_floatblock_dir",SANDBOX_SUBJECT_UPDATE:(0,n.Qm)("sandbox_subject_update"),SANDBOX_PREHEADER_UPDATE:(0,n.Qm)("sandbox_preheader_update"),SANDBOX_DRAG_EVENT:(0,n.Qm)("sandbox_drag_event"),SANDBOX_ADD_MERGETAG:(0,n.Qm)("sandbox_add_mergetag"),SANDBOX_TRANSLATIONS:(0,n.Qm)("sandbox_send_translations"),SANDBOX_SET_THEME_VARIABLES:(0,n.Qm)("sandbox_send_theme_variables"),SANDBOX_SET_ENTITY:(0,n.Qm)("sandbox_set_entity"),SANDBOX_INIT_START:(0,n.Qm)("sandbox_init_start"),SANDBOX_INITED:(0,n.Qm)("sandbox_inited"),SANDBOX_UPDATE_ENTITY:(0,n.Qm)("sandbox_update_entity"),RELOAD:(0,n.Qm)("reload"),SANDBOX_IS_EMAIL_EMPTY:(0,n.Qm)("sandbox_is_email_empty")},T={language:"html",detectIndentation:!1,wordWrap:"on",wrappingIndent:"same",smoothScrolling:!0,automaticLayout:!0,tabSize:2,indentSize:2};let S;!function(e){e.IMG="img",e.TEXT="text",e.LINK="a",e.TABLE="table",e.VINDENT="vindent",e.TD="td",e.STRUCTURE="structure",e.GROUP="group",e.BUTTON="button",e.DIV="div",e.FLOAT_BLOCK="floatBlock",e.VAR="var",e.EMPTY_TABLE="emptyTable",e.EMPTY_TD="emptyTd",e.COUNTDOWN="countdown",e.VIDEO="video",e.COLUMN="column",e.CAROUSEL="carousel",e.ACCORDION="accordion"}(S||(S={}));const I={ALL:"All",STANDARD:"Standard",PROJECT:"Project"},C="Appearance",b="Structure",y="Settings",L="Properties",N="History",M="Disabled_tab",w="Edit selected element",P="UTM parameters",R="Edit",k="AiChat",B="Build",U="Styles",j="Discuss",x="Blocks",G="Atoms",F="Optimise",K={top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}},H="Owner",V="Administrator",X="User",W="The invitation has been sent",z="Assign the project owner",Q="Change role to Administrator",$="Change role to User",Y="Remove member",Z="Revoke the invite",q="block",J="email",ee="cards",te="list",ie="pending",ne="d41d8",oe="1865",se=127017,re=24,ae={borderRadiusAll:"all",borderRadiusTopLeft:"topLeft",borderRadiusBottomLeft:"bottomLeft",borderRadiusTopRight:"topRight",borderRadiusBottomRight:"bottomRight"},ce="desktop",le="mobile",de="emailtags",_e="blocktags",ue="all_folders",me={text:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",lineHeight:21,lineHeightDim:"px",color:"#5a5a5a",contrastColor:"#FFFFFF",textAlign:"left",paddingBottom:10,paddingBottomDim:"px"},headings:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:24,fontSizeDim:"px",lineHeight:32,lineHeightDim:"px",color:"#333333",contrastColor:"#FFFFFF",textAlign:"left",paddingTop:20,paddingTopDim:"px",paddingBottom:20,paddingBottomDim:"px",letterSpacing:0,letterSpacingDim:"px",bold:!0,italic:!1},links:{color:"#1C52DC",contrastColor:"#FFFFFF",underline:!0},buttons:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",letterSpacing:0,letterSpacingDim:"px",color:"#FFFFFF",contrastColor:"#1C52DC",bold:!1,italic:!1,backgroundColor:"#1C52DC",contrastBackgroundColor:"#FFFFFF",marginTop:10,marginTopDim:"px",marginBottom:10,marginBottomDim:"px",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},textAlign:"center",padding:{all:null,top:null,right:null,bottom:null,left:null}},block:{backgroundColor:"#FFFFFF",contrastBackgroundColor:"#1C52DC",padding:{all:null,top:null,right:null,bottom:null,left:null}},cards:{contrastBackgroundColor:"#1C52DC",contrastTextColor:"#FFFFFF",baseBackgroundColor:"#F8F8F8",baseTextColor:"#333333",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null}}},pe=e=>({REORDER_ATOM:e("Reorder element"),CLONE_ATOM:e("Clone element"),REMOVE_ATOM:e("Remove element"),EDIT_ATOM:e("Edit element"),CHANGE_IMAGE:e("Change image"),REORDER_BLOCK:e("Reorder block"),REORDER_BLOCK_UP:e("Move up"),REORDER_BLOCK_DOWN:e("Move down"),EDIT_BLOCK:e("Edit block"),CLONE_BLOCK:e("Clone block"),MERGE_BLOCK:e("Merge with the chosen block"),UNMERGE_BLOCK:e("Split blocks"),COPY_BLOCK_TO_CLIPBOARD:e("Copy block to clipboard"),PASTE_BLOCK_FROM_CLIPBOARD:e("Paste block from clipboard"),REMOVE_BLOCK:e("Remove block"),SAVE_TO_BLOCKS:e("Save to Blocks"),ADD_BLOCK:e("Add block"),ADD_EMPTY_BLOCK:e("Add an empty block"),ADD_SAVED_BLOCK:e("Add a saved block"),ADD_COMMON_BLOCK:e("Add a common block"),ADD_TEMPLATE_BLOCK:e("Add a template block"),ADD_SEARCH_BLOCK:e("Search a block"),REORDER_GROUP:e("Reorder group"),EDIT_GROUP:e("Edit group"),CLONE_GROUP:e("Clone group"),REMOVE_GROUP:e("Remove group"),ADD_GROUP:e("Add group"),LINK:e("link"),TABLE_COLUMN:e("cell"),TABLE:e("table"),FLOAT_BLOCK:e("column"),CONTAINER:e("container"),PICTURE:e("picture"),CAROUSEL:e("carousel"),ACCORDION:e("accordion"),VERTICAL_INDENT:e("indent"),TEXT:e("text"),BUTTON:e("button"),VAR:e("variable"),STRUCTURE:e("block"),EMAIL:e("email"),GROUP:e("group"),TYPOGRAF:e("Typograf"),COUNTDOWN:e("countdown"),ELEMENT:e("element"),VIDEO:e("video"),ELEMENT_PATH_LINK:e("Link"),ELEMENT_PATH_BLOCK:e("Block"),ELEMENT_PATH_ATOM:e("Element"),ELEMENT_PATH_TD:e("Cell"),ELEMENT_PATH_TABLE:e("Table"),ELEMENT_PATH_FLOATBLOCK:e("Column"),ELEMENT_PATH_TEXT:e("Text"),ELEMENT_PATH_DIV:e("Container"),ELEMENT_PATH_GROUP:e("Group"),ELEMENT_PATH_EMAIL:e("Email"),ELEMENT_PATH_IMG:e("Picture"),ELEMENT_PATH_VINDENT:e("Indent"),ELEMENT_PATH_BUTTON:e("Button"),ELEMENT_PATH_CAROUSEL:e("Carousel"),ELEMENT_PATH_ACCORDION:e("Accordion"),ELEMENT_PATH_SECTION:e("Section"),TINYMCE_CHANGECASE:e("Case Change"),TINYMCE_UPPERCASE:e("Uppercase"),TINYMCE_LOWERCASE:e("Lowercase"),PASTE_HERE:e("Drop here")}),he={Applications:"Apps",Articles:"Article",Banners:"Banners",Buttons:"Buttons","Call to Action":"Call to Action",Contacts:"Contacts",Content:"Content","E-Commerce":"E-Commerce",Feature:"Features",Footer:"Footers",Header:"Headers",Lists:"Lists",Menu:"Menus",Other:"Others",Polls:"Polls",Promocodes:"Promocodes",Separators:"Separators"},ge={maker:"https://ai-mail.emcdn.ru",blocks:"https://ai-mail.useblocks.io"},Ee={maker:"https://app.emailmaker.ru/api",blocks:"https://app.useblocks.io/api"}},19378:(e,t,i)=>{function n(e){return e}i.d(t,{Qm:()=>n,bg:()=>c});const o="INIT_MESSAGE";function s(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}class r{constructor(){this._children=[],this._isDisposed=!1}isDisposed(){return this._isDisposed}addDisposable(e){return this._children.push(e),e.hasOwnProperty("addDisposable")&&e.addDisposable({dispose:()=>{const t=this._children.indexOf(e);t>=0&&this._children.splice(t,1)}}),e}removeDisposable(e){const t=this._children.indexOf(e);t>=0&&this._children.splice(t,1)}dispose(){this._isDisposed=!0;for(const e of this._children)e.dispose()}}class a extends r{constructor(...e){super(...e),this._listeners=Object.create(null),this.addListenerAsync=(e,t,i=0,n)=>{const o=this._listeners[e]||(this._listeners[e]=[]);n&&"function"===typeof t&&(t=t.bind(n));const s=o.findIndex((([e,t])=>i<=t)),r=[t,i];return this.isDisposed()||o.splice(s>=0?s:o.length,0,r),{dispose(){const e=o.indexOf(r);e>=0&&o.splice(e,1)}}},this.fireAsync=(e,t)=>{if(!this.isDisposed()){const i=this._listeners[e]||(this._listeners[e]=[]);let n;for(let e=0;e<i.length;e++){let t=i[e][0],o=n;n=e=>t(e,o)}if(n)return n(t)}},this.addListener=(e,t,i=0)=>this.addListenerAsync(e,((e,i)=>{try{t(e)}catch(n){console.log(n)}return i&&i(e)}),i)}}class c extends r{constructor(e,t){super(),this._singleton=t,this._target=void 0,this._guid=s(),this._targetGuid="",this._emitter=this.addDisposable(new a),this._onReceiveMessage=e=>{const t=e.data;if(i=t,n=this._guid,i&&"object"===typeof i&&i.guid===n||this._singleton&&function(e,t){return e&&"object"===typeof e&&e.operationId===t}(t,o)){const i=this._emitter.fireAsync(t.operationId||"",void 0===t.operationId?e:t.data),n=t.result,o=t.error;n&&o&&Promise.resolve(i).then((e=>this._sendMessage(n,e)),(e=>this._sendMessage(o,e)))}var i,n},window.addEventListener("message",this._onReceiveMessage),this.addListener(o,(e=>{this._targetGuid!==e&&(this._targetGuid=e,this.send(o,this._guid))})),e&&this.setTarget(e)}setTarget(e){this._target!==e&&(this._target=e,this._targetGuid="",e&&e.postMessage({operationId:o,data:this._guid},"*"))}getTarget(){return this._target}get target(){return this._target}_sendMessage(e,t,i=!0){if(!i&&!this.isInited())return;const n=this.addDisposable(this.onInit(((i,o)=>{const s=e?{operationId:e,data:t}:t;i.postMessage({...s,guid:o},"*"),n.dispose()})))}send(e,t,i){return"string"===typeof e?this._sendMessage(e,t,i):this._sendMessage("",e,t)}sendAsync(e,t,i=!0){if(!i&&!this.isInited())return Promise.resolve();const n=s(),o=s();return new Promise(((i,s)=>{const a=this.addDisposable(new r);a.addDisposable(this.onInit(((r,c)=>{r.postMessage({operationId:e,data:t,guid:c,result:n,error:o},"*"),a.addDisposable(this._onMessage(n,(e=>{i(e),a.dispose()}))),a.addDisposable(this._onMessage(o,(e=>{s(e),a.dispose()})))})))}))}_onMessage(e,t,i=0){return this._emitter.addListener(e,t,i)}addListener(e,t,i){return t?this._onMessage(e,t,i):this._onMessage("",e)}addListenerAsyncPipe(e,t,i=0){return this._emitter.addListenerAsync(e,t,i)}addListenerAsync(e,t,i=0){return this._emitter.addListenerAsync(e,(async(e,i)=>{const n=await t(e);return i?i(e):n}),i)}isInited(){return!!this._targetGuid}get inited(){return!!this._targetGuid}onInit(e,t=!0,i=0){const n=this.addDisposable(new r);return this._targetGuid&&this._target?t&&Promise.resolve().then((()=>{this._targetGuid&&this._target?e(this._target,this._targetGuid):n.addDisposable(this.onInit(e,t,i))})):n.addDisposable(this._onMessage(o,(()=>{e(this._target,this._targetGuid)}),i)),n}dispose(){window.removeEventListener("message",this._onReceiveMessage),super.dispose()}}},13329:(e,t,i)=>{i.d(t,{D3:()=>_,RS:()=>d});var n=i(45934),o=i(92810),s=i(41664),r=i(23397),a=i(23580),c=i(95152);const l=(0,s.Q)();function d(e,t,i){e instanceof c.m||(e=(0,a.My)(e));e.getOrCreateInstance(l,(()=>new r.v)).fire({id:t,payload:i})}const _=(e,t)=>{const i=function(e){return(0,a.My)(e).getOrCreateInstance(l,(()=>new r.v)).addEventListener}((0,n.Pj)());(0,o.useEffect)((()=>{const n=i((({id:i,payload:n})=>{i===e&&t(n)}));return()=>n.dispose()}),[i,e,t])}},95152:(e,t,i)=>{i.d(t,{m:()=>r});var n=i(23397),o=i(77509);function s(e){return`service_container_${e}`}class r extends o.j{constructor(e){super(),this._parent=e,this._injections=Object.create(null),this._emitter=this.addDisposable(new n.v)}inject(e,t,i){if("function"===typeof t){let n=this._injections[e],o="function"===typeof n?n():n;const s=this._injections[e]=()=>(o=t(this,o),o);i&&s()}else this._injections[e]=()=>t;this._emitter.fire(e)}_find(e){var t;return this._injections[e]||(null===(t=this._parent)||void 0===t?void 0:t._find(e))}_onInject(e,t,i=new o.j){return i.addDisposable(this._emitter.addEventListener((n=>{e===n&&(i.dispose(),t(this.getInstance(n)))}))),this._parent&&i.addDisposable(this._parent._onInject(e,t,i)),this.addDisposable(i),i}getInstance(e){const t=this._find(e);if("function"===typeof t)return t()}getOrCreateInstance(e,t){const i=this._find(e);if("function"===typeof i)return i();{const i=t(this);return this.inject(e,i),i}}getInstanceAsync(e){const t=this._find(e);return"function"===typeof t?Promise.resolve(t()):new Promise((t=>this._onInject(e,(()=>t(this.getInstance(e))))))}addService(e,t){const i=s(e);this.inject(i,((e,i=[])=>i.indexOf(t)<0?[...i,t]:i));const n=new o.j;return n.addDispose((()=>{this.inject(i,((e,i=[])=>i.filter((e=>e!==t))))})),n}getServices(e){var t;const i=s(e);return[...this.getInstance(i)||[],...(null===(t=this._parent)||void 0===t?void 0:t.getServices(e))||[]]}createChild(){return new r(this)}dispose(){this._injections=Object.create(null)}}},45695:(e,t,i)=>{i.d(t,{K9:()=>u,QC:()=>d,XW:()=>_,ur:()=>l});var n=i(19378),o=i(33288),s=i(45934),r=i(41664),a=i(92810);const c=(0,r.Q)("MESSAGE_SERVICE");function l(){const e=d();return(0,a.useCallback)((t=>{e.setTarget(t instanceof Element?t.contentWindow:t)}),[e])}function d(){const e=(0,s.Pj)();return(0,a.useMemo)((()=>function(e){return o.di.getOrCreateInstance(e,c,(()=>new n.bg))}(e)),[e])}function _(){const e=d();return(0,a.useCallback)((function(t){e.send(t)}),[e])}function u(){const e=d();return(0,a.useCallback)((function(t,i){e.send(t,i)}),[e])}},23397:(e,t,i)=>{i.d(t,{v:()=>o});var n=i(77509);class o extends n.j{constructor(e){super(),this._options=e,this._listeners=[],this.fire=e=>{if(!this.isDisposed()){let t;const i=[...this._listeners];for(const n of i){if(!1===t)return!1;t=t instanceof Promise?t.then((e=>!1!==e&&!this.isDisposed()&&n(e))).catch((e=>console.log(e))):n(e)}return t}},this.addEventListener=e=>{const t=this._listeners;var i;(t.push(e),1===t.length)&&((null===(i=this._options)||void 0===i?void 0:i.onFirstListenerAdd)&&this._options.onFirstListenerAdd());return{dispose:()=>{const i=t.indexOf(e);var n;i>=0&&(t.splice(i),t.length||(null===(n=this._options)||void 0===n?void 0:n.onFirstListenerAdd)&&this._options.onLastListenerRemove())}}},this.event=this.addEventListener}}let s;!function(e){function t(e){let t;const i=new o({onFirstListenerAdd(){t=e(i.fire)},onLastListenerRemove(){t.dispose()}});return i.event}e.snapshot=t,e.filter=function(e,i){return t((t=>e((e=>i(e)&&t(e)))))},e.map=function(e,i){return t((t=>e((e=>t(i(e))))))}}(s||(s={}))},32269:(e,t,i)=>{i.d(t,{Cb:()=>V,Cl:()=>p,DI:()=>P,Dx:()=>M,EU:()=>R,HT:()=>W,Hy:()=>z,Id:()=>m,Np:()=>N,Qi:()=>G,Tr:()=>Q,X7:()=>K,XZ:()=>j,Yq:()=>h,Z1:()=>H,_9:()=>x,_q:()=>X,au:()=>w,d_:()=>k,el:()=>O,ez:()=>D,fq:()=>g,gq:()=>L,i0:()=>B,iV:()=>U,jG:()=>l.j,ln:()=>$,p6:()=>S,sh:()=>F,vl:()=>d.v,wB:()=>I});var n=i(74267),o=i(92810),s=i(85163),r=i(1741),a=i.n(r),c=i(45695),l=i(77509),d=i(23397),_=i(71210),u=i(70082);const m=e=>{Object.keys(s.A9).forEach((t=>{"onboarding_success"!==e.get(s.A9[t])&&e.remove(s.A9[t])}))};function p(e){const t=(0,n.A)(e);return isNaN(t)?new Date(e):t}const h=(e,t,i=!1)=>{Date;const n=new Date,o=e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear();if(i&&o){const i=Math.floor((n-e)/1e3),o=Math.floor(i/60),s=Math.floor(o/60);if(i<60)return t("Just now");if(s>0){const e=o%60;return`${s} ${t("hour","hours",s)} ${e} ${t("minute","minutes",e)}`}return`${o} ${t("minute","minutes",o)}`}{const t=new Intl.DateTimeFormat(navigator.language,{dateStyle:"short"}),i=new Intl.DateTimeFormat(navigator.language,{timeStyle:"short"});return t.format(e)+" "+i.format(e)}},g=e=>{const t=e.match(/(\(copy\))( \d+)?$/),i=null===t||void 0===t?void 0:t[1],n=null===t||void 0===t?void 0:t[2];return i?n?`${e.slice(0,-n.length)} ${+n.slice(1)+1}`:`${e} 2`:`${e} (copy)`};function E(e,t,i){const n=new Map,o=new RegExp(`(${t})(.*?)(${i})`,"gis");return e=e.replaceAll(o,((e,t,i,o)=>{const s=(0,_.l)();return n.set(s,i),t+s+o})),{escapes:n,html:e}}function f(e,t){let i=[];for(const[n,o]of t){const{escapes:t,html:s}=E(e,n,o);e=s,i.push([n,o,t])}return{escapes:i,html:e}}function A(e,t,i,n){const o=new RegExp(`(${t})(.*?)(${i})`,"gis");return e.replaceAll(o,((e,t,i,o)=>{const s=n.get(i);return"string"===typeof s?t+s+o:e}))}const v=/<title>(.*)<\/title>/gm,O=(e,t)=>{let{escapes:i,html:n}=f(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","--\x3e"]]);return n=n.replaceAll(v,((e,i)=>i===t?`<title>${g(i)}</title>`:e)),function(e,t){for(const[i,n,o]of t)e=A(e,i,n,o);return e}(n,i.reverse())};function D(e){let{html:t}=f(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","--\x3e"]]);return[...t.matchAll(v)].map((e=>e[1])).find((e=>!!e))}const T="bottomRight",S=(e,t,i=T)=>{var n,o,s,r;t.error({innerException:e.error instanceof Error?e.error:void 0,message:(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(n=e.error)||void 0===n||null===(o=n.data)||void 0===o?void 0:o.code)||(null===(s=e.error)||void 0===s?void 0:s.status)||e.error}}),description:(0,u.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(r=e.error.data)||void 0===r?void 0:r.message)||e.error.error}}),placement:i})},I=(e,t,i=T)=>{t.success({message:e,placement:i})},C="ascend",b="descend",y="desc",L=e=>{switch(e){case C:return"asc";case b:return y;default:return""}},N=e=>{switch(e){case"asc":return C;case y:return b;default:return""}},M=e=>{const t=document.createElement("div");return t.className=e||"resizer",t},w=/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/,P=e=>new Promise(((t,i)=>{let n=new Image;n.src=e,n.addEventListener("load",(()=>{t("success")})),n.addEventListener("error",(()=>{i("error")})),n=null})),R=(e,t)=>{for(const i of t)"object"===typeof e.properties&&(e=e.properties[i]);return e},k=e=>e instanceof Array?e.map((e=>({label:e,value:e}))):Object.keys(e).map((t=>({label:e[t],value:t}))),B=(e,t,i=!0)=>{const n=Object.keys(t);for(const o of n){const n=t[o];void 0!==n&&null!==n&&(e[o]=i&&"object"===typeof n?B(e[o]||{},n,!0):n)}return e},U=e=>new Promise(((t,i)=>{a().load({google:{families:[e]},classes:!1,active:t,inactive:i})})),j=(e,t)=>{t&&e(t)},x=()=>{const e=(0,c.XW)();return(0,o.useCallback)(((t,i,n)=>{document.querySelectorAll(".block-search__preview").forEach((e=>e.remove()));const o=document.getElementById("iframe-scroll-top"),r=document.getElementById("iframe-scroll-bottom"),a=document.getElementById("email_iframe"),c=document.body.getBoundingClientRect().height,l=a.getClientRects()[0];l.top<0&&(o.style.display="block"),l.top+l.height>c&&(r.style.display="block");const d={operation:s.Ru.SANDBOX_BLOCK_INSERT,settings:{blockHTML:i||null,targetBlock:null,project:"emailmaker",type:n}};t.dataTransfer.setData("Text",JSON.stringify(d)),e(d)}),[e])},G=()=>{const e=(0,c.XW)();return(0,o.useCallback)(((t,i,n)=>{const o=document.getElementById("iframe-scroll-top"),r=document.getElementById("iframe-scroll-bottom"),a=document.getElementById("email_iframe"),c=document.body.getBoundingClientRect().height,l=a.getClientRects()[0];l.top<0&&(o.style.display="block"),l.top+l.height>c&&(r.style.display="block");const d={operation:s.Ru.SANDBOX_ATOM_INSERT,settings:{atomHTML:i.html||null,targetBlock:null}};n(i)&&t.dataTransfer.setData("Text",JSON.stringify(d)),e(d)}),[e])},F=()=>{const e=(0,c.XW)();return(0,o.useCallback)(((t,i)=>{e({operation:s.Ru.SANDBOX_BLOCK_INSERT,action:"insert",settings:{blockHTML:i}})}),[e])},K=()=>{const e=(0,c.XW)();return(0,o.useCallback)(((t,i)=>{e({operation:s.Ru.SANDBOX_ATOM_INSERT,action:"insert",settings:{atomHTML:i}})}),[e])},H=(e,t)=>{t.success({maskClosable:!0,centered:!0,title:e("Coming soon"),content:e("The feature is under development."),okText:e("Ok. I'll be waiting"),onOk:()=>{}})},V=()=>{const e=(0,c.XW)();return(t,i)=>{e({operation:s.Ru.SANDBOX_ELEMENT_SETTINGS_SET,settings:t,type:i})}},X=(e,t="")=>{var i,n;const o=[];return null===(i=e._embedded)||void 0===i||null===(n=i["wp:term"])||void 0===n||n.filter((e=>{var i;return!!e.length&&(!t||(null===(i=e[0])||void 0===i?void 0:i.taxonomy)===t)})).forEach((e=>{const t=e[0].taxonomy;o[t]||(o[t]=[]),o[t]=e.map((e=>({id:e.id,name:e.name,children:e.children}))),o[o.length]=o[t]})),""!==t&&o.length?o[t]:o},W=(e,t="")=>{var i,n,o,s,r;return(null===(i=e._embedded)||void 0===i||null===(n=i["wp:term"])||void 0===n||null===(o=n.find((e=>{var i;return!!e.length&&(!t||(null===(i=e[0])||void 0===i?void 0:i.taxonomy)===t)})))||void 0===o||null===(s=o.find((e=>{var t;return null===e||void 0===e||null===(t=e.name)||void 0===t?void 0:t.startsWith("project_")})))||void 0===s||null===(r=s.children)||void 0===r?void 0:r.map((e=>({id:e.id,name:e.name,count:e.count}))))||null},z=(e,t)=>{const i=e.target,n=t.getBoundingClientRect().height,o=i.getBoundingClientRect().height-n,s=e.clientY-t.getBoundingClientRect().top-30,r=-o*(Math.min(Math.max(s,0),n-60)/(n-60));i.style.transform=`translateY(${r}px)`},Q=({target:e})=>{e.style.transform="translateY(0)"};function $(e){const t=document.createElement("div");return t.innerHTML=e,t.textContent||t.innerText||""}},20116:(e,t,i)=>{i.d(t,{B:()=>l,l:()=>c});var n=i(33288),o=i(77509),s=i(91366);function r(e){return t=>{const i=t.queryFn||((e,i,n,o)=>{if(!t.query)throw new Error("query not found EndpointDefinition");return o(t.query(e))});i&&(t.query=void 0,t.queryFn=async(t,o,s,r)=>{try{let a;const c=n.di.getServices(o,e);for(let e=c.length-1;e>=0;e--){const i=c[e];if(a=a?await a((async(...e)=>await i.execute(e))):await i.execute(t),"function"!==typeof a)return{data:a,error:null}}return a=a?await a((async(e,t=o,n=s,a=r)=>{const c=await i(e,t,n,a);if(c.error)throw c.error;return c.data})):await i(t,o,s,r),{data:a,error:null}}catch(a){return{error:a}}})}}const a=new Set;function c(e){return(t,i)=>{const c=Object.create(null),l=Object.keys(i),d=new o.j;for(const o of l){const s=`api_listeners_flag_${t.reducerPath}/${o.toString()}`,l=n.di.createIdentifier(`api_listeners_${t.reducerPath}/${o.toString()}`);a.has(s)||(c[o]=r(l),a.add(s)),d.addDisposable(n.di.addService(e,l,{execute:i[o]}))}return Object.keys(c).length&&t.enhanceEndpoints({endpoints:c}),(0,s.PL)(e).addDisposable(d),d}}function l(e,t){for(const n of Object.keys(t))try{t[n](e)}catch(i){console.error(`Error while initialize mock ${n}:`,i)}}},32411:(e,t,i)=>{i.d(t,{$Z:()=>p,TW:()=>d,VA:()=>u,aD:()=>m,fn:()=>h,kx:()=>a});var n=i(70609),o=i(92810),s=i(60382),r=i(33695);const a=(0,o.createContext)(null),c={editorWorkerService:"editor.worker.js",html:"html.worker.js",css:"css.worker.js",typescript:"ts.worker.js",json:"json.worker.js",javascript:"ts.worker.js",less:"css.worker.js",scss:"css.worker.js",handlebars:"html.worker.js",razor:"html.worker.js"};function l(e,t){/^(\/\/)/.test(e)&&(e=window.location.protocol+e);const i=new Blob(["/*"+t+'*/importScripts("'+e+'");'],{type:"application/javascript"});return URL.createObjectURL(i)}function d(e){const t=(0,n.yc)(),[i,s]=(0,o.useState)({canUndo:t.canUndo(e.uri),canRedo:t.canRedo(e.uri)});return(0,o.useEffect)((()=>{const i=e.onDidChangeContent((()=>{setTimeout((()=>s({canUndo:t.canUndo(e.uri),canRedo:t.canRedo(e.uri)})))}));return()=>{i.dispose()}}),[e,t]),i}function _(e){var t;const i=(null===e||void 0===e||null===(t=e.actual)||void 0===t?void 0:t._data)||new r.Ov;return i instanceof r.Ov?i:r.Ov.deserialize(i)}function u(e){const t=(0,n.yc)();return{undo:()=>t.undo(e.uri),redo:()=>t.redo(e.uri),clear:()=>t.removeElements(e.uri),getPast:()=>{var i,n;return(null===(i=t._editStacks.get(e.uri.toString()))||void 0===i||null===(n=i._past)||void 0===n?void 0:n.map(_))||[]},getFuture:()=>{var i,n;return(null===(i=t._editStacks.get(e.uri.toString()))||void 0===i||null===(n=i._future)||void 0===n?void 0:n.map(_))||[]},canUndo:()=>t.canUndo(e.uri),canRedo:()=>t.canRedo(e.uri),createSnapshot:()=>t.createSnapshot(e.uri),restoreSnapshot:e=>t.restoreSnapshot(e)}}function m(e){return(0,o.useMemo)((()=>u(e)),[e])}function p(e="",t="html"){const i=s.editor.createModel(e,t);return i.setEOL(s.editor.EndOfLineSequence.LF),i}function h(){return(0,o.useContext)(a)}emailmakerMonacoEnvironment.getWorkerUrl=(e,t)=>{const n=i.p,o=(n?n.replace(/\/$/,"")+"/":"")+c[t];const s=new URL(o,window.location.origin),r=s.protocol;if("http:"===r||"https:"===r){if(s.protocol!==window.location.protocol||s.hostname!==window.location.hostname)return l(o,t);if("localhost"===s.hostname&&(s.port||"80")!==(window.location.port||"80"))return l(o,t)}else if("file:"===r)return l(o,t);return o}},98589:(e,t,i)=>{function n(e,t){if(e===t)return!0;if("object"===typeof e&&e&&"object"===typeof t&&t){const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(const s of i)if(!n(e[s],t[s]))return!1;return!0}return!1}function o(e,t){if(!e)return t;const i={};for(const o of Object.keys(t))n(t[o],e[o])||(i[o]=t[o]);return i}i.d(t,{g:()=>o})},88896:(e,t,i)=>{i.d(t,{X:()=>o});const n=Symbol("Error");function o(e){return Promise.all(e.map((e=>e instanceof Promise?e.catch((e=>(console.log(e),n))):e))).then((e=>e.filter((e=>e!==n))))}},91738:(e,t,i)=>{i.d(t,{AU:()=>d});var n=i(90854),o=i(58689),s=i(44824),r=i(26453),a=i(91391);const c=e=>function(e){var t;return function(e){return"___SCRIPT"===e.tagName}(e)&&(null===(t=e.src)||void 0===t?void 0:t.startsWith(a.gP))}(e)||(0,r.Nh)(e)||(0,n.BF)(e),l=e=>{if(c(e))return!0;if((0,n.vq)(e)||(0,n.wz)(e))for(const t of e.querySelectorAll("*"))if(c(t))return!0;return!1};async function d(e,t){"string"===typeof e&&(e={code:e});const i=e.code?await(0,o.PJ)(e.code||"",[o.qy],e.utm_parameters,(async e=>{void 0===t&&(t=l(e)),t&&await(0,s.e)(e,"html")})):"",n=e.code&&t?await(0,o.PJ)(e.code||"",[o.qy],e.utm_parameters,(async e=>{await(0,s.e)(e,"amp")})):"";return{...e,compiled:{html:i,ampHtml:n}}}},91366:(e,t,i)=>{i.d(t,{Qq:()=>g,PL:()=>f,KA:()=>E,wz:()=>A});var n=i(33288),o=i(41664),s=i(15230),r=i(32269),a=i(55654);class c extends a.IO{async execute([e],t){for(const i of t){const t=await i(e);t&&(void 0===t.id&&(t.id=e.value.id),e.value=t)}return e.value}}var l=i(98589);class d extends a.lt{}var _=i(56991);class u extends r.jG{constructor(...e){super(...e),this._items=new Map,this._onChangeEmitter=new a.HN,this.onChange=this._onChangeEmitter.event}async _getOrCreate(e,t){const i=this._items;let n;if(i.has(e))try{n=await i.get(e)}catch{t&&(n=await t())}else t&&(n=await t(),n&&this._onChangeEmitter.fire());return n}async _addOrUpdate(e,t){let i;const n=this._items;if(n.has(e))try{i=await n.get(e)}catch{}const o=await t(i);return(0,_.bD)(i,o)||this._onChangeEmitter.fire(),o}entries(){return Promise.all([...this._items.entries()].map((([e,t])=>t.then((t=>[e,t]))))).then((e=>e.filter((([e,t])=>!!t))))}values(){return Promise.all([...this._items.values()].map((e=>e)).filter((e=>!!e)))}getOrCreate(e,t){let i=this._getOrCreate(e,(()=>t(e)));return this._items.set(e,i),i}addOrUpdate(e,t){let i=this._addOrUpdate(e,t);return this._items.set(e,i),i}add(e,t){const i=Promise.resolve(t);return this._items.set(e,i),i}remove(e){if(this._items.has(e)){const t=this._items.get(e);return this._items.delete(e),this._onChangeEmitter.fire(),t}return Promise.resolve(void 0)}async setAll(e){try{this.suspendChange();const t=[],i=new Set(Array.from(e).map((([e,t])=>e))),n=(await this.entries()).filter((([e,t])=>!i.has(e)));for(const[o,s]of e)t.push(this.addOrUpdate(o,(()=>s))),i.add(o);for(const[e]of n)t.push(this.remove(e));return await Promise.all(t),n}finally{this.resumeChange()}}clear(){this._items.clear(),this._onChangeEmitter.fire()}suspendChange(){this._onChangeEmitter.suspend()}resumeChange(){this._onChangeEmitter.resume()}}var m=i(71210);class p extends r.jG{constructor(...e){super(...e),this._cache=new u,this._readEmitter=new a.lt,this._saveEmitter=this.addDisposable(new c),this._removeEmitter=this.addDisposable(new d),this._foreignCache=Object.create(null),this.handlerRead=this._readEmitter.event,this.onSave=this._saveEmitter.event,this.onRemove=this._removeEmitter.event,this.onChange=this._cache.onChange}async get(e){return this._cache.getOrCreate(e,(async t=>Object.assign({id:e},...(await this._readEmitter.fire(e)).filter((e=>!!e)))))}get cache(){return this._cache}byForeignKey(e){let t=this._foreignCache[e];if(!t){const i=this.addDisposable(new r.jG);i.addDispose((()=>delete this._foreignCache[e]));const n=i.addDisposable(new u),o=i.addDisposable(new a.lt);t=this._foreignCache[e]={get:async(t,i={})=>(await n.getOrCreate(t,(async()=>{try{const i=function(e=[]){if((e=e.filter((e=>e))).length<=1)return e[0];let t=new Map;for(const i of e)for(const e of i)if(void 0!==e.id){let i=t.get(e.id)||{};t.set(e.id,{...i,...e})}return[...t].map((([e,t])=>t))}(await o.fire(t))||[];for(const n of i)n[e]=t,await this._cache.add(n.id,n);return i}catch{return[]}})),function(e,{filter:t,order:i="asc",orderBy:n,page:o,pageSize:s=20}={}){const r=e.length;let a=e.length;if(void 0!==t){const i=Object.keys(t);a=(e=e.filter((e=>{for(const n of i){const i=e[n],o=t[n];return"id"===n||"string"!==typeof i?i===o:"string"===typeof o&&i.startsWith(o)}return!0}))).length}return n&&(e=e.sort(((e,t)=>(e[n]>t[n]?1:t[n]>e[n]?-1:0)*("asc"===i?1:-1)))),void 0!==o&&(e=e.slice(s*(o-1),s*o-1)),{data:e,filteredTotal:a,total:r,totalPages:Math.floor(r/s)}}(await this._cache.values()||[],i)),first:(e,i={})=>t.get(e,{...i,page:1,pageSize:1}).then((e=>e[0])),handleRead:o.event,clear(){n.clear()},dispose(){i.dispose()}}}return t}async create(e,{source:t="",silent:i}={}){let n=e;return i||(n=await this._saveEmitter.fire({prev:void 0,patch:e,value:n,source:t})),void 0===n.id&&(n.id=(0,m.l)()),await this._cache.addOrUpdate(n.id,(()=>n))}async update(e,t,{source:i="",silent:n}={}){return this._cache.addOrUpdate(e,(async e=>{let o=e?{...e,...t}:t;if(!n)return t=e?(0,l.g)(e,t):t,await this._saveEmitter.fire({prev:e,patch:t,value:o,source:i})}))}async remove(e,{source:t="",silent:i}={}){const n=await this._cache.remove(e);return i||await this._removeEmitter.fire({value:n,source:t}),n}refresh(){this._cache.clear();for(const e of Object.values(this._foreignCache))e.clear()}suspendChange(){this._cache.suspendChange()}resumeChange(){this._cache.resumeChange()}}i(18398);var h=i(39990);function g(){const e=(0,o.Q)();return t=>n.di.getOrCreateInstance(t,e,(()=>new p))}function E(e){const t=n.di.getInstance(e,s.ax);if(!t)throw new Error("Failed");return t}function f(e){const t=n.di.getInstance(e,s.Lz);if(!t)throw new Error("Failed");return t}async function A(e){const t=E(e),i=await t.dispatch(h.Q2.endpoints.getMe.initiate({},{forceRefetch:!0}));return Promise.resolve(i.data)}},13437:(e,t,i)=>{i.d(t,{A:()=>r,i:()=>s});var n=i(71210),o=i(814);function s({code:e,...t},i){var o,s;const r=i.getState();return{...t,...e?{html:e}:{},renderGuid:(0,n.l)(),project:null===(o=r.projectSlice)||void 0===o||null===(s=o.project)||void 0===s?void 0:s.id}}function r({html:e,renderGuid:t,...i},n){const s=n.getState(),{project:r}=s.configSlice;return(0,o.TB)({...i,code:e,project:void 0===r?i.project:r,guid:void 0,link:void 0,status:void 0,slug:void 0,password:void 0,comment_status:void 0,template:void 0,blocktags:void 0,project_title:void 0,ping_status:void 0,lock:void 0,tag:void 0,is_template:void 0})}},25181:(e,t,i)=>{function n(e,t){var i;return{severity:Number(t.severity),message:t.message,source:t.source,startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn,get startOffset(){return e.getOffsetAt({lineNumber:t.startLineNumber,column:t.startColumn})},get endOffset(){return e.getOffsetAt({lineNumber:t.endLineNumber,column:t.endColumn})},tags:null===(i=t.tags)||void 0===i?void 0:i.map((e=>Number(e)))}}i.d(t,{B:()=>n})},91253:(e,t,i)=>{i.d(t,{I:()=>s,y:()=>o});var n=i(814);function o(e,t,i){const n=t.getState();var o,s;void 0===i&&(i=void 0===e.post?null===(o=n.emailSlice)||void 0===o||null===(s=o.email)||void 0===s?void 0:s.id:e.post);return{...e,content:e.content?`<p>${e.content}</p>`:"",post:i}}function s(e,t){return(0,n.TB)({...e,link:void 0,comment_status:void 0})}},81304:(e,t,i)=>{i.d(t,{E:()=>r,I:()=>s});var n=i(71210),o=i(814);function s({code:e,...t},i){var o,s;const r=i.getState();return{...t,...e?{html:e}:{},renderGuid:(0,n.l)(),project:null===(o=r.projectSlice)||void 0===o||null===(s=o.project)||void 0===s?void 0:s.id,utm_parameters:t.utm_parameters||{},_embedded:void 0}}function r({html:e,renderGuid:t,...i},n){const s=n.getState(),{project:r,config:a}=s.configSlice;return(0,o.TB)({...i,code:e,project:void 0===r?i.project:r,utm_parameters:a.UTMEnabled?i.utm_parameters:void 0,tags:void 0,template:void 0,guid:void 0,emailtags:void 0,project_title:void 0,project_author:void 0,is_template:void 0,is_inited:void 0})}},4453:(e,t,i)=>{i.d(t,{E:()=>s,_:()=>o});var n=i(814);function o({code:e,...t},i,n){const o=i.getState();var s,r;void 0===n&&(n=void 0===t.parent?null===(s=o.emailSlice)||void 0===s||null===(r=s.email)||void 0===r?void 0:r.id:t.parent);return{...t,...e?{html:e}:{},parent:n}}function s({html:e,...t},i){return(0,n.TB)({...t,code:e,guid:void 0,compiled:(0,n.TB)({html:e,ampHtml:e&&""})})}},23036:(e,t,i)=>{i.d(t,{Wk:()=>l,Xy:()=>a,bg:()=>_,ll:()=>d,yc:()=>c});var n=i(55701),o=i(91366),s=i(93982),r=i(20116);const a=(0,o.Qq)(),c=(0,o.Qq)(),l=(0,s.cZ)(),d=(0,s.cZ)();function _(e){const t=(0,r.l)(e),i=a(e),_=i.byForeignKey("project"),u=c(e),m=u.byForeignKey("parent"),{dispatch:p,getState:h}=(0,o.KA)(e),g=(0,o.PL)(e);g.addDisposable(i.onChange((()=>p(n.VM.util.invalidateTags(["Blocks"]))))),g.addDisposable(i.onSave((({prev:e,patch:t,value:i})=>{(e=e?{...e,...t}:t)&&i.html===e.html&&i.title===e.title&&(i.renderGuid=e.renderGuid)}),Number.MIN_VALUE));const E=(0,s.dB)(e,d),f=(0,s.dB)(e,l);t(n.VM,{async getBlocks(e){const t={};e.name&&(t.title=e.name),e.type&&(t.type=e.type);return await _.get(e.projectId,{filter:t,page:e.page,pageSize:e.pageSize,order:e.order,orderBy:e.orderby}).then((({data:e})=>e))},getBlocksSchema:()=>e=>e({}),getParentEmailBlocks:e=>async t=>{try{const t=h().configSlice.project||"",i=(await f.fire({project:t,emailId:e.emailId||""})).filter((e=>e));if(i.length)return i.flat()}catch(i){console.log(i)}return t(e)},getTemplateBlocks:e=>async t=>{try{const t=h().configSlice.project||"",i=(await E.fire({project:t,emailId:e.emailId||""})).filter((e=>e));if(i.length)return i.flat()}catch(i){console.log(i)}return t(e)},async getBlock(e){const t=h().projectSlice.project.id;return _.first(t,{filter:{id:e}})},getBlockHistory:async({blockId:e,page:t=1})=>({...await m.get(e,{page:t}),args:{blockId:e,page:t}}),addBlock:e=>async t=>{const n=await i.create(e);return h().configSlice.config.preventSendDataToEM||t(n).catch((e=>{})),n},editBlock:({blockId:e,...t})=>i.update(e,t),deleteBlock:e=>i.remove("object"===typeof e?e.id:e),addTag:e=>e,getDeletableTag:([e,t])=>[],autoSaveBlock:({blockId:e,body:t})=>u.create({...t,parent:e})})}},72788:(e,t,i)=>{i.d(t,{B:()=>c,D:()=>a});var n=i(18777),o=i(91366),s=i(68415),r=i(20116);const a=(0,o.Qq)();function c(e){const t=(0,r.l)(e),i=a(e),c=i.byForeignKey("post"),{dispatch:l}=(0,o.KA)(e);(0,o.PL)(e).addDisposable(i.onChange((()=>l(n.Jg.util.invalidateTags(["Comments"]))))),t(n.Jg,{getComments:e=>c.get(e).then((({data:e})=>e)),addComment({subjectId:e,author:t,parent:n,content:o,author_name:r,author_email:a,targetId:c}){const l={post:e,author:t,author_name:r,author_email:a,content:o,parent:n,target_id:c,date:(0,s.A)(new Date),author_avatar_urls:{}};return i.create(l)},deleteComment:e=>i.remove(e),editComment:({commentId:e,...t})=>i.update(e,t),deleteTarget:e=>i.update(e,{target_id:""})})}},87265:(e,t,i)=>{i.d(t,{Av:()=>a,jw:()=>c,sE:()=>l});var n=i(86739),o=i(91366),s=i(71210),r=i(20116);const a=(0,o.Qq)(),c=(0,o.Qq)();function l(e){const t=a(e),i=c(e),l=i.byForeignKey("parent"),{dispatch:d,getState:_}=(0,o.KA)(e),u=(0,o.PL)(e),m=(0,r.l)(e);u.addDisposable(t.onChange((async()=>{d(n.GY.util.invalidateTags(["Email"]))}))),u.addDisposable(i.onChange((()=>{d(n.GY.util.invalidateTags(["EmailAutosaves"]))}))),u.addDisposable(t.onSave((({prev:e,patch:t,value:i})=>{(e=e?{...e,...t}:t)&&i.subject===e.subject&&i.html===e.html&&i.preheader===e.preheader&&i.title===e.title&&(i.renderGuid=e.renderGuid)}),Number.MIN_VALUE)),m(n.GY,{getEmails:e=>[],getTemplateEmails:e=>t=>t(e),getEmail:async e=>await t.get(e),getEmailHistory:({emailId:e,page:t=1})=>(l.clear(),async n=>{if(_().configSlice.config.revisionService){const o=await n({emailId:e,page:t});for(const e of o.data)i.cache.add(e.id,e);return o}return{...await l.get(e,{page:t}),args:{emailId:e,page:t}}}),async addEmail({source:e,...i}){const n=await t.create(i,{source:e});return n.renderGuid||(n.renderGuid=(0,s.l)()),n},editEmail:e=>async i=>{const{emailId:n,source:o,...s}=e;return _().configSlice.config.revisionService&&await i(e),t.update(n,s,{source:o})},deleteEmail:e=>t.remove("object"===typeof e?e.id:e),addTag:e=>e,getDeletableTag:([e,t])=>[],autoSaveEmail:({emailId:e,body:t})=>async n=>(_().configSlice.config.revisionService&&await n({emailId:e,body:t}),await i.create({...t,parent:e,modified:(new Date).toString()}))})}},55084:(e,t,i)=>{i.d(t,{A:()=>S});var n=i(20116),o=i(53200);var s=i(84612);var r=i(91366),a=i(39990);var c=i(15230),l=i(47036);var d=i(95679);var _=i(62689);var u=i(84568);var m=i(46312),p=i(93982),h=i(13522);var g=i(65119);var E=i(63531),f=i(33288);f.di.createIdentifier();var A=i(83351);var v=i(23036),O=i(72788),D=i(94381);var T=i(87265);const S={addUserToProjectApiMock:function(e){(0,n.l)(e)(o.B,{addUserToProject:()=>{}})},AiApiMock:function(e){(0,n.l)(e)(s.Zs,{sendMessage:({body:e})=>t=>t({body:e}).catch((()=>new Promise((e=>setTimeout(e,1e3))))),getDialog:e=>t=>t(e)})},authorizationApiMock:function(e){let t={id:"0",username:"",email:"",password:"",code_editor:{},theme:"light",locale:(0,r.KA)(e).getState().userSlice.currentUser.locale,counters:{},avatar_urls:{},autosaves:!0};(0,n.l)(e)(a.Q2,{userRegistration:()=>{},getSchema:()=>e=>e({}),getMe:()=>t,editMe:e=>t={...t,...e},getSubscriptions:()=>[]})},blocksApiMock:v.bg,commentsApiMock:O.B,emailsApiMock:T.sE,emailRawApiMock:function(e){(0,n.l)(e)(l.f,{getEmailRaw({emailId:e,secret_hash:t}){throw new Error(c.f5)}})},imageApiMock:function(e){(0,n.l)(e)(d.CL,{sendAiImageRequest:function({body:e}){return t=>t({body:e})},getAiImage:e=>t=>t(e)})},localesApiMock:function(e){(0,n.l)(e)(D.Ad,{getLocale:async({id:e})=>t=>t({id:e}),getLocales:()=>async e=>e({})})},notificationsApiMock:function(e){(0,n.l)(e)(_.vx,{getNotifications:e=>[],notificationShown({id:e,datetime:t}){throw new Error(c.f5)}})},projectsApiMock:function(e){let t;(0,n.l)(e)(u.Nq,{getProjects:(e={page:1})=>[],getProject:e=>i=>t||(t=i(e).then((t=>({...t,id:e})))),addProject(e){throw new Error},editProject:({projectId:e,...i})=>t=t.then((t=>({...t,...i,id:e}))),deleteProject(e){throw new Error}})},proxyApiMock:function(e){const t=(0,n.l)(e),i=(0,p.dB)(e,h.A.FILE_PROXY_EVENT_ID);t(m.Z8,{getFile:async({url:t,tryFetch:n=!0,type:o})=>async s=>{const r=e.getState(),{project:a}=r.configSlice,c=(await i.fire({url:t,project:a})).filter((e=>e instanceof Blob))[0];if(!c)return s({url:t,tryFetch:n,type:o});switch(o){case"json":return JSON.parse(await c.text());case"text":return c.text();default:return c}}})},recoverPasswordApiMock:function(e){(0,n.l)(e)(g.yR,{resetPassword(e){throw new Error(c.f5)},setPassword(e){throw new Error(c.f5)},validateRecoverPasswordCode(e){throw new Error(c.f5)}})},saveFileApiMock:function(e){const t=(0,n.l)(e);if(!f.di.getInstance(e,c.Lz))throw new Error("Something was wrong");const i=(0,p.dB)(e,h.A.UPLOAD_EVENT_ID),o=(0,p.dB)(e,h.A.ON_SEND_TESTEMAIL_ID),s=(0,p.dB)(e,h.A.ON_SEND_LIVEPREVIEW_ID);t(E.yH,{uploadImage:t=>async n=>{const o=e.getState(),{project:s}=o.configSlice,r="tmp"===t.folder?null:await i.fire({file:t.file,project:s}),a=r?r.find((e=>e)):null;return a?[{file_url:a,project:s}]:n({...t,user_id:String((await f.di.getInstanceAsync(e,c.sZ)).app_id)})},sendTestEmail:t=>async i=>{const n=e.getState(),{project:s}=n.configSlice;(await o.fire({project:s,email_id:t.email_id,subject:t.subject,email:t.email,html:t.html,from_name:t.from_name})).some((e=>!1===e))&&await i({...t,user_id:String((await f.di.getInstanceAsync(e,c.sZ)).app_id)})},async sendLivePreview(t){const i=e.getState(),{project:n}=i.configSlice;(await s.fire({project:n,id:t.email,subject:t.subject,html:t.content})).some((e=>!1===e))},sendShortLink:e=>t=>t(e)})},tokenApiMock:function(e){(0,n.l)(e)(A.OV,{tokenCreate:e=>t=>t(e),tokenValidate:()=>e=>e({})})}}},62410:(e,t,i)=>{i.d(t,{r:()=>A});var n=i(33288),o=i(14386),s=i(18398),r=i(47358),a=i(86286),c=i(39990),l=i(68548),d=i(15230),_=i(13652);function u(e){var t;return{fontSize:e.fontSize,fontFamily:e.fontFamily,tabSize:e.tabSize,wordWrap:"off"!==e.wordWrap,minimap:null===(t=e.minimap)||void 0===t?void 0:t.enabled,insertSpaces:e.insertSpaces}}var m=i(39217),p=i(32269),h=i(91366),g=i(93982),E=i(13522),f=i(48802);const A=(0,o.l)((e=>{const t=(0,h.PL)(e),i=(0,f.m)((0,g.Zc)(e,E.A.ON_LIMIT_ID)),o=t.addDisposable(new f.U(i)),A=(0,f.m)((0,g.Zc)(e,E.A.READ_LOCALE)),v=t.addDisposable(new f.U(A)),O=e.dispatch,D=n.di.getInstanceAsync(e,d.sZ).then((e=>(null===e||void 0===e?void 0:e.app_config)||{}),(e=>(console.log(e),{}))),T=(0,_.y)(),S=async(...t)=>{const i=Object.assign({},...t),n=Object.assign({},...t.map((e=>e.editor))),{locale:o="ru_RU",theme:a,codeModeDirection:l,...d}=i;void 0!==l&&("none"===l?O((0,r.N6)(!1)):(O((0,r.N6)(!0)),O((0,r.Uf)(l))));const _=await(0,h.wz)(e);var u;await O(c.Q2.endpoints.editMe.initiate({..._,code_editor:n?(u=n,{font_size:u.fontSize,font_family:u.fontFamily,tab_size:u.tabSize,word_wrap:u.wordWrap,minimap:u.minimap,insert_spaces:u.insertSpaces}):_.code_editor,locale:"string"===typeof o?o:_.locale,theme:"string"===typeof a?a:_.theme})),O((0,s._R)(d))};let I;return{setOptions:T.decorate((async({config:i={},project:r,user:a,advancedConfigs:d,handleReadLocale:_,handleLimitUsage:u})=>{var g;v.setListener(_),o.setListener(u);let E=await D,f=d||E.advancedConfigs,A=localStorage.getItem("configSwither"),T=f&&f[(null===i||void 0===i?void 0:i.mode)||A||"pro"]||(null===(g=(0,l.$)((null===i||void 0===i?void 0:i.mode)||A||"pro"))||void 0===g?void 0:g.config);if(T={...T,configSwither:i.configSwither||!1},await S(T,E,i),O((0,s.bn)(String(r))),O((0,s.ee)(f)),I&&I.dispose(),I=new p.jG,a){let i={...await(0,h.wz)(e),email:"",password:"",...a,id:"number"===typeof a.id?String(a.id):a.id};void 0===a.id&&delete i.id,O(c.Q2.endpoints.editMe.initiate(i)),a.id&&t.addDisposable(n.di.addService(e,m.jY,{execute(e){e.headers.append("user_id",i.id)}}))}r&&t.addDisposable(n.di.addService(e,m.jY,{execute(e){e.headers.append("project_id",String(r))}}))})),instance:{setConfig:T.decorate((async e=>{var t;let i=null===(t=(0,l.$)((null===e||void 0===e?void 0:e.mode)||"pro"))||void 0===t?void 0:t.config;await S(i,await D,e)})),getConfig:()=>function(e){var t,i;const n=e.getState(),o=n[a.Ay.name],c=n[s.Ay.name],l=n[r.Ay.name];return{...c.config,theme:null===(t=o.currentUser)||void 0===t?void 0:t.theme,locale:null===(i=o.currentUser)||void 0===i?void 0:i.locale,codeModeDirection:l.isCodeMode?l.codeModeDirection:"none",editor:u(o.monacoOptions)}}(e),updateConfig:T.decorate((e=>S(e))),handleReadLocale:A,handleLimitUsage:i}}}))},33746:(e,t,i)=>{i.d(t,{F:()=>c});var n=i(44141),o=i(33288),s=i(15230),r=i(14386),a=i(39217);const c=(0,r.l)((e=>{let t=!0;return{setOptions(i){if(i.hasOwnProperty("baseUrl")){const n=o.di.getInstance(e,a.eT),s=n.getOptions(),r=(0,a.qT)(i.baseUrl);s.baseUrl!==r&&(n.setOptions({baseUrl:r}),t=!0)}if(t){const i=o.di.getInstance(e,n.Pz);o.di.inject(e,s.sZ,(async(e,t)=>t||i.app.app_init_create({}).then((({data:e})=>e))),!0),t=!0}}}}))},19209:(e,t,i)=>{i.d(t,{F:()=>u});var n=i(14386),o=i(14315),s=i(33288),r=i(41664),a=i(39217),c=i(13652),l=i(85163);const d=(0,r.Q)(),_=(0,r.Q)(),u=(0,n.l)((e=>({setOptions(t){const i=(0,c.y)(),n=(0,a.mg)(e);s.di.addService(e,a.jY,{execute:i.decorate((async i=>{if(t.jwtAuth){let r=s.di.getInstance(e,d),a=s.di.getInstance(e,_);if(!a&&!r){const i=await n.jwtAuth.token_create({body:t.jwtAuth,type:o.cM.Json});if(i.error)throw a=l.ff,s.di.inject(e,_,l.ff),new Error(l.ff);r=i.data.token,s.di.inject(e,d,r)}a||i.headers.append("authorization",`Bearer ${r}`)}}))})}})))},1383:(e,t,i)=>{i.d(t,{Y:()=>l,h:()=>d});var n=i(14386),o=i(41664),s=i(33288),r=i(39217),a=i(47271),c=i(12264);const l=(0,o.Q)(),d=(0,n.l)((e=>{let t;return s.di.addService(e,r.jY,{execute:async i=>{if(t){const t=await s.di.getInstanceAsync(e,l);t&&i.headers.append("authorization",`Bearer ${t}`)}}}),{setOptions(i){t!==i.getAuthToken&&(t=i.getAuthToken,s.di.inject(e,l,void 0),s.di.inject(e,l,(async(e,i)=>{try{let e=await i;var n;return t?e&&1e3*(null===(n=(0,a.iU)(e))||void 0===n?void 0:n.exp)>(0,c.N)()?e:await t(e):""}catch(o){return console.log(o),""}}),!0))}}}))},14386:(e,t,i)=>{function n(e){return async function(t){return{setOptions:()=>{},instance:{},dispose:()=>{},...await e(t)||{}}}}function o(e){return async t=>{const i={},n=[];for(const o of e)n.push(await o(t));for(const e of n)Object.assign(i,e.instance);return{instance:i,setOptions:e=>{const t=n.map((t=>t.setOptions(e)));return t.some((e=>e instanceof Promise))?Promise.all(t).then((()=>{})):void 0},dispose:()=>{for(const e of n)e.dispose()}}}}i.d(t,{E:()=>o,l:()=>n})},893:(e,t,i)=>{i.d(t,{m:()=>c});var n=i(17126),o=i(92810),s=i(45934),r=i(18398),a=i(70082);const c=({children:e})=>{const[t,i]=(0,o.useState)(),c=(0,s.d4)(r.p5);return(0,a.jsxs)("div",{className:"App blocks-app blocks-plugin",children:[c&&(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:c}}),(0,a.jsx)(n.fh.Provider,{value:t,children:e}),(0,a.jsx)("div",{ref:i,className:"blocks-modal-container"})]})}},97001:(e,t,i)=>{i.d(t,{P:()=>I});var n=i(32269),o=i(93556),s=i(23580),r=i(71210),a=i(56991),c=i(13329),l=i(28316),d=i(18398),_=i(13437),u=i(81304),m=i(4453),p=i(91253),h=i(33288),g=i(15230),E=i(13652),f=i(13522),A=i(93982),v=i(91738),O=i(86739),D=i(39217),T=i(25181);const S="EXTERNAL";class I extends n.jG{constructor(e){super(),this._store=e,this._emailTemplateCache=Object.create(null),this._prevCommand=void 0,this._prevContent=void 0,this._dataSources=void 0,this._eventLock=void 0,this._queue=(0,E.y)(),this._model=void 0,this._currentEmail=void 0,this.show=this._queue.decorate(this._show,this),this.save=this._queue.decorate(this._save,this);const t=(0,s.My)(e);this._dataSources=(0,o.zC)(t),this._eventLock=(0,o.QQ)(t);const i=(0,A.Zc)(e,f.A.ON_MODEL_CHANGE),n=(0,A.Zc)(e,f.A.ON_EMAIL_CHANGED_ID);this.addDisposable(i((e=>{this._model=e}))),this.addDisposable(n((e=>{this._currentEmail=e}))),this.addDisposable(h.di.addService(e,D.jY,{execute:e=>{var t;null!==(t=this._currentEmail)&&void 0!==t&&t.id&&!this._currentEmail.isNew&&e.headers.append("email_id",this._currentEmail.id)}}))}async getProject(){const e=await h.di.getInstanceAsync(this._store,g.sZ);return null===e||void 0===e?void 0:e.project}async getTemplateEmail(e){e=String(e);let t=this._emailTemplateCache[e];if(!t){const i=await this._store.dispatch(O.GY.endpoints.getTemplateEmail.initiate(e));i.error?console.log(i.error):(t={...i.data,lock:!1,parent_email:e},delete t.id)}return t}async getBlocks(){const{cache:e}=this._dataSources.blocks,t=await this.getProject();return(await e.values()).filter((e=>e.project===t)).map((e=>(0,_.A)(e,this._store)))}async getComments(){const{cache:e}=this._dataSources.comments,t=await this.getEmail();return(await e.values()).filter((e=>e.post===t.id)).map((e=>(0,p.I)(e,this._store)))}async getEmailRevisions(){const{cache:e}=this._dataSources.emailRevisions,t=await this.getEmail();return(await e.values()).filter((e=>e.parent===t.id)).map((e=>(0,m.E)(e,this._store)))}async setBlocks(e=[]){const{cache:t}=this._dataSources.blocks;await t.setAll(e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,_.i)(e,this._store)])))}async setEmailRevisions(e=[],t){const{cache:i}=this._dataSources.emailRevisions,n=e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,m._)(e,this._store,t)]));await i.setAll(n)}async setComments(e=[],t){const{cache:i}=this._dataSources.comments,n=e.filter((e=>void 0!==e.id)).map((e=>[e.id,(0,p.y)(e,this._store,t)]));await i.setAll(n)}async getEmail(){const e=this._store.getState(),t=e.emailSlice.email.id?e.emailSlice.email:e.newEmailSlice.email,i=(0,u.E)({...t,html:this._model?this._model.getValue():t.html},this._store);return(0,v.AU)(i)}async compileEmail(){const e=this._store.getState(),t=e.emailSlice.email.id?e.emailSlice.email:e.newEmailSlice.email,i=(0,u.E)({...t,html:this._model?this._model.getValue():t.html},this._store);return(0,v.AU)(i)}async setEmail(e,t,i=!1){const n=this._dataSources.emails,o=n.cache,s=await this.getProject();e="string"===typeof e?{code:e}:{...e};let a=(0,u.I)(e,this._store);const c=a.id;let l=c;if(void 0!==c?a={...await n.get(c),...a,project:s}:(a={...a,project:s},l=(0,r.l)(),delete a.project),t){const e=await this.getTemplateEmail(String(t));e&&(a={...e,id:String(t),...a})}await o.setAll([[l,a]]),i&&this._runShowCommand({isNew:void 0===c,id:l,project:s})}_runShowCommand(e){const t={...e,type:"email"};this._prevCommand&&!(0,a.bD)(this._prevCommand,e)?(0,c.RS)(this._store,l._1,t):this._store.dispatch((0,d.Ir)(t)),this._prevCommand=e}async _show(e){try{if(!e)return;if(this._eventLock.suspendChange(),e!==this._prevContent){this._prevContent=e;const{email:t,blocks:i,autosaves:n,comments:s,templateId:r}=(0,o.Uw)(e),a=[];a.push(this.setBlocks(i)),void 0!==t.id&&(a.push(this.setComments(s)),a.push(this.setEmailRevisions(n))),a.push(this.setEmail(t,Number(r),!0)),await Promise.all(a)}}catch(t){console.log(t)}finally{this._eventLock.resumeChange()}return new Promise((e=>{const t=(0,A.Zc)(this._store,f.A.ON_EMAIL_INIT_ID)((()=>{t.dispose(),e()}))}))}_save(){return new Promise((async e=>{const t=this._dataSources.emails,i=this.addDisposable(t.onSave((({value:t,source:n})=>{n===S&&(i.dispose(),e((0,u.E)(t,this._store)))}),Number.MIN_VALUE));(0,c.RS)(this._store,l.Kp,S)}))}getCodeErrors(){var e;const t=this._store.getState(),i=this._model;return i?null===(e=t.emailSlice.problemsList)||void 0===e?void 0:e.map((e=>(0,T.B)(i,e))):void 0}}},44376:(e,t,i)=>{i.d(t,{y:()=>f});var n=i(23580),o=i(93556),s=i(81304),r=i(13437),a=i(91253),c=i(4453),l=i(32269),d=i(48802),_=i(13522),u=i(93982),m=i(18398),p=i(98589),h=i(55654),g=i(25181),E=i(23036);class f extends l.jG{constructor(e){super(),this._store=e,this._events=void 0,this._model=void 0,this._listenersUpdaters=void 0;const t=(0,u.Zc)(e,_.A.ON_MODEL_CHANGE);this.addDisposable(t((e=>{this._model=e})))}_get(){const e=this._store,t=(0,n.My)(e),{blocks:i,emails:l,comments:f,emailRevisions:A}=(0,o.zC)(t),v=(0,u.Zc)(e,E.Wk),O=(0,u.Zc)(e,E.ll),D=(0,u.Zc)(e,_.A.ON_SAVEBUTTON_CLICK_ID),T=(0,u.Zc)(e,_.A.ON_PREVIOUSBUTTON_CLICK_ID),S=(0,u.Zc)(e,_.A.ON_NEXTBUTTON_CLICK_ID),I=(0,h.pb)((0,u.Zc)(e,_.A.ON_EMAIL_INIT_ID),(e=>!e.reset)),C=(0,u.Zc)(e,_.A.ON_EMAIL_CHANGED_ID),b=(0,u.Zc)(e,_.A.ON_CONTENT_CHANGED_ID),y=(0,u.Zc)(e,_.A.ON_SEND_TESTEMAIL_ID),L=(0,u.Zc)(e,_.A.ON_SEND_EMAIL_MODAL_ID),N=(0,u.Zc)(e,_.A.ON_EMAIL_CLONE_ID),M=(0,u.Zc)(e,_.A.ON_SHARE_ID),w=(0,u.Zc)(e,_.A.ON_SHOW_PREVIEW_ID),P=(0,u.Zc)(e,_.A.ON_SEND_LIVEPREVIEW_ID),R=(0,u.Zc)(e,_.A.ON_CODE_VALIDATE_ID);return{handleValidate:(0,d.m)(R,(e=>this._model?e.map((e=>(0,g.B)(this._model,e))):[])),handleReadEmail:(0,d.m)(l.handlerRead,(e=>e),(t=>t&&(0,s.I)(t,e))),handleSaveEmail:(0,d.m)(l.onSave,(function({prev:t,patch:i,value:n,source:o}){const r=t?(0,s.E)(t,e):void 0;return{prev:r,patch:(0,p.g)(r,(0,s.E)(i,e)),value:(0,s.E)(n,e),source:o}}),(t=>t?(0,s.I)(t,e):void 0)),handleRemoveEmail:(0,d.m)(l.onRemove,(({value:t,source:i})=>({value:(0,s.E)(t,e),source:i})),(()=>{})),handleReadCommonBlocks:(0,d.m)(O,(e=>e.project),(t=>null===t||void 0===t?void 0:t.map((t=>(0,r.i)(t,e))))),handleReadTemplateBlocks:(0,d.m)(v,(e=>e),(t=>null===t||void 0===t?void 0:t.map((t=>(0,r.i)(t,e))))),handleReadBlocks:(0,d.m)(i.byForeignKey("project").handleRead,(t=>(0,m.jY)(e.getState())||String(t)),(t=>null===t||void 0===t?void 0:t.map((t=>(0,r.i)(t,e))))),handleSaveBlock:(0,d.m)(i.onSave,(function({prev:t,patch:i,value:n,source:o}){const s=t?(0,r.A)(t,e):void 0;return{prev:s,patch:(0,p.g)(s,(0,r.A)(i,e)),value:(0,r.A)(n,e),source:o}}),(t=>t?(0,r.i)(t,e):void 0)),handleRemoveBlock:(0,d.m)(i.onRemove,(({value:t,source:i})=>({value:(0,r.A)(t,e),source:i})),(()=>{})),handleReadComments:(0,d.m)(f.byForeignKey("post").handleRead,(e=>e),(t=>null===t||void 0===t?void 0:t.map((t=>(0,a.y)(t,e))))),handleSaveComment:(0,d.m)(f.onSave,(function({prev:t,patch:i,value:n,source:o}){const s=t?(0,a.I)(t,e):void 0;return{prev:s,patch:(0,p.g)(s,(0,a.I)(i,e)),value:(0,a.I)(n,e),source:o}}),(t=>t?(0,a.y)(t,e):void 0)),handleRemoveComment:(0,d.m)(f.onRemove,(({value:t,source:i})=>({value:(0,a.I)(t,e),source:i})),(()=>{})),handleReadEmailRevisions:(0,d.m)(A.byForeignKey("parent").handleRead,(e=>e),(t=>null===t||void 0===t?void 0:t.map((t=>(0,c._)(t,e))))),handleEmailAutosave:(0,d.m)(A.onSave,(function({prev:t,patch:i,value:n,source:o}){return{value:(0,c.E)(n,e),source:o}}),(t=>t?(0,c._)(t,e):void 0)),handleRemoveEmailAutoSave:(0,d.m)(A.onRemove,(({value:t,source:i})=>({value:(0,c.E)(t,e),source:i})),(()=>{})),handleEmailChanged:(0,d.m)((0,h.sg)(C,100),(t=>(0,s.E)(t,e))),handleEmailInit:(0,d.m)(I,(t=>(0,s.E)(t,e))),handlePreviousButtonClick:(0,d.m)(T,(t=>(0,s.E)(t,e))),handleNextButtonClick:(0,d.m)(S,(t=>(0,s.E)(t,e))),handleSaveButtonClick:(0,d.m)(D,(t=>(0,s.E)(t,e))),handleHtmlChanged:(0,d.m)((0,h.sg)(b,100)),handleTestEmailSend:(0,d.m)(y,(({html:e,...t})=>({...t,code:e,compiled:{html:e,ampHtml:""}}))),handleTestEmailModal:(0,d.m)(L,(t=>(0,s.E)(t,e))),handleCloneEmail:(0,d.m)(N,(t=>(0,s.E)(t,e))),handleShareEmail:(0,d.m)(M),handlePreviewEmail:(0,d.m)(w),handleLivePreviewEmail:(0,d.m)(P)}}get(){return this._events||(this._events=this._get())}setOptions(e={}){const t=this.get();let i=this._listenersUpdaters;if(!i){i=this._listenersUpdaters={};for(const e of Object.keys(t))i[e]=this.addDisposable(new d.U(t[e]))}for(const n of Object.keys(t))i[n].setListener(e[n])}}},93556:(e,t,i)=>{i.d(t,{QQ:()=>a,Uw:()=>c,zC:()=>r});var n=i(23036),o=i(72788),s=i(87265);function r(e){return{emails:(0,s.Av)(e),blocks:(0,n.Xy)(e),emailRevisions:(0,s.jw)(e),blocksRevision:(0,n.yc)(e),comments:(0,o.D)(e)}}function a(e){const t=Object.values(r(e));return{suspendChange(){t.forEach((e=>e.suspendChange()))},resumeChange(){t.forEach((e=>e.resumeChange()))}}}function c(e){return"string"===typeof e?{email:{code:e}}:function(e){return!e.hasOwnProperty("email")&&!e.hasOwnProperty("block")&&!e.hasOwnProperty("templateId")}(e)?{email:e}:{...e,email:"string"===typeof e.email?{code:e.email}:e.email||{}}}},8671:(e,t,i)=>{i.d(t,{e:()=>c});var n=i(14386),o=i(33288),s=i(15230),r=i(32269),a=i(48802);const c=(0,n.l)((e=>{const t=o.di.getInstance(e,s.Lz),i=t.addDisposable(new r.vl),n=(0,a.m)(i.event),c=t.addDisposable(new a.U(n));return{setOptions({handleDestroy:e}){c.setListener(e)},instance:{handleDestroy:n,destroy:()=>t.dispose()}}}))},63772:(e,t,i)=>{i.d(t,{Z:()=>l});var n=i(14386),o=i(33288),s=i(48802),r=i(15230),a=i(93982),c=i(13522);const l=(0,n.l)((e=>{const t=o.di.getInstance(e,r.Lz),i=(0,a.Zc)(e,c.A.UPLOAD_EVENT_ID),n=(0,a.Zc)(e,c.A.FILE_PROXY_EVENT_ID),l=(0,s.m)(i),d=(0,s.m)(n),_=t.addDisposable(new s.U(l)),u=t.addDisposable(new s.U(d));return{setOptions(e){_.setListener(e.handleLoadImage),u.setListener(e.handleFileProxy)},instance:{handleLoadImage:l,handleFileProxy:d}}}))},55853:(e,t,i)=>{i.d(t,{E:()=>c});var n=i(14386),o=i(33288),s=i(15230),r=i(55654),a=i(48802);const c=(0,n.l)((e=>{const t=o.di.getInstance(e,s.Lz),i=t.addDisposable(new r.vl),n=o.di.getInstanceAsync(e,s.Cd);n.then((({instance:e})=>i.fire(e)));const c=(0,a.m)(i.event),l=t.addDisposable(new a.U(c));return{setOptions({handleLoad:e}){l.setListener(e)},instance:{handleLoad:c,reset:e=>n.then((({instance:t,setOptions:i})=>Promise.resolve(i(e)).then((()=>t))))},destroy:()=>t.dispose()}}))},1281:(e,t,i)=>{i.d(t,{Z:()=>g});var n=i(14386),o=i(33288),s=i(15230),r=i(48802),a=i(13329),c=i(28316),l=(i(92810),i(814)),d=i(70082);function _(e){return"string"===typeof e?e:e?(0,d.jsx)("div",{ref:t=>null===t||void 0===t?void 0:t.replaceWith(e)}):void 0}function u(e,t="success"){return"string"===typeof e&&(e={message:e}),(0,l.TB)({type:e.type||t,data:e.data,innerException:e.innerException,message:_(e.message),description:_(e.description),btn:_(e.btn),onClose:e.onClose,duration:e.duration,icon:_(e.icon),placement:e.placement,style:e.style,closeIcon:"boolean"===typeof e.closeIcon||"undefined"===typeof e.closeIcon?e.closeIcon:_(e.closeIcon),props:e.props,role:e.role})}var m=i(13522),p=i(55654),h=i(93982);const g=(0,n.l)((e=>{const t=o.di.getInstance(e,s.Lz),i=(0,h.Zc)(e,m.A.ON_NOTIFICATION),n=(0,p.pb)(i,(e=>"error"===e.type)),l=(0,p.pb)(i,(e=>"success"===e.type)),d=(0,r.m)(i,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e):e)),_=(0,r.m)(n,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e,"error"):e)),g=(0,r.m)(l,(e=>e),(e=>"string"===typeof e||"object"===typeof e?u(e):e)),E=t.addDisposable(new r.U(d)),f=t.addDisposable(new r.U(_)),A=t.addDisposable(new r.U(g));return{setOptions({handleNotify:e,handleSuccess:t,handleError:i}){E.setListener(e),f.setListener(i),A.setListener(t)},instance:{notify(t){(0,a.RS)(e,c.Sb,{placement:"bottomRight",...u(t)})},handleNotify:d,handleError:_,handleSuccess:g}}}))},92268:(e,t,i)=>{i.d(t,{w:()=>c});var n=i(14386),o=i(91366),s=i(93982),r=i(13522),a=i(32411);const c=(0,n.l)((e=>{let t;const i=(0,o.PL)(e),n=(0,s.Zc)(e,r.A.ON_MODEL_CHANGE);return i.addDisposable(n((e=>{t=(0,a.VA)(e)}))),{instance:{undoRedoService:{undo:()=>t.undo(),redo:()=>t.redo(),clear:()=>t.clear(),getPast:()=>t.getPast(),getFuture:()=>t.getFuture(),canUndo:()=>t.canUndo(),canRedo:()=>t.canRedo(),createSnapshot:()=>t.createSnapshot(),restoreSnapshot:e=>t.restoreSnapshot(e)}}}}))},89949:(e,t,i)=>{i.d(t,{R:()=>r});var n=i(92810),o=i(45934),s=i(39990);const r=({onLoad:e,children:t})=>{(0,n.useEffect)((()=>{e&&e()}),[e]);const i=(0,o.wA)();return(0,n.useMemo)((()=>i(s.Q2.endpoints.getMe.initiate({}))),[i]),t}},55654:(e,t,i)=>{i.d(t,{HN:()=>d,IO:()=>s,P9:()=>r,lt:()=>u,pb:()=>c,sg:()=>l,vl:()=>_});var n=i(32269);class o extends n.jG{constructor(...e){super(...e),this._listeners=[],this.event=this._addListener.bind(this)}getListeners(e){return this._listeners.flatMap((([t])=>"function"===typeof t?t:t.getListeners(e)))}hasListeners(){return this._listeners.length>0}_addListener(e,t=0,i){if(!this.isDisposed()){const n=this._listeners;i&&"function"===typeof e&&(e=e.bind(i));const o=n.findIndex((([e,i])=>t<i)),s=[e,t];return n.splice(o>=0?o:n.length,0,s),{dispose(){const e=n.indexOf(s);e>=0&&n.splice(e,1)}}}}dispose(){this._listeners.splice(0,this._listeners.length),super.dispose()}}class s extends o{constructor(...e){super(...e),this.fire=this._fire.bind(this)}execute(e,t){for(const n of t)try{n(...e)}catch(i){console.log(i)}}_fire(...e){if(!this.isDisposed())return this.execute(e,this.getListeners(e))||void 0}}function r(e,t=0){const i=new o;return i.addDisposable(e(i,t)),i.event}class a extends o{constructor(e){super(),this._filter=e}getListeners(e){return this._filter(...e)?super.getListeners(e):[]}}function c(e,t,i=0){const n=new a(t);return n.addDisposable(e(n,i)),n.event}function l(e,t=0,i=0){const n=new s;let o,r=0;return n.addDisposable(e(((...e)=>{o=e,r||(r=setTimeout((()=>{n.fire(...o),r=0}),t))}),i)),n.event}class d extends s{constructor(...e){super(...e),this._suspendCounter=0,this._wasFired=!1}proccessResult(){}execute([e],t){if(this._suspendCounter)this._wasFired=!0;else for(const n of t)try{n(e)}catch(i){console.log(i)}}suspend(){this._suspendCounter++}resume(){0===--this._suspendCounter&&(this._wasFired&&this.fire(),this._wasFired=!1)}}class _ extends s{execute([e],t){for(const n of t)try{n(e)}catch(i){console.log(i)}}}class u extends s{async execute([e],t){const i=[];for(const n of t){const t=await n(e);i.push(t)}return i}}},48802:(e,t,i)=>{i.d(t,{U:()=>s,m:()=>r});var n=i(32269),o=i(55654);class s extends n.jG{constructor(e){super(),this._event=e,this._listener=void 0,this._disposeEvent=void 0}setListener(e){this._listener!==e&&(this._listener=e,this._disposeEvent&&this._disposeEvent(),this._disposeEvent=e?this._event(e):void 0)}dispose(){this._disposeEvent&&this._disposeEvent(),super.dispose()}}function r(e,t,i){const n=(0,o.P9)(e);return(e,o,s)=>{const r=n((async n=>{const o=t?t(n):n;s&&e.bind(s);const r=await e(o);return i?i(r):r}),o,s);return()=>r.dispose()}}},13652:(e,t,i)=>{i.d(t,{y:()=>n});const n=e=>{let t={current:Promise.resolve(),state:e,decorate:(e,i)=>(i&&(e=e.bind(i)),function(...i){const n=t.current.then((()=>e(...i)));return t.current=n.then((e=>{t.state=e}),(e=>{console.log(e)})),n})};return t}},18398:(e,t,i)=>{i.d(t,{Ay:()=>T,EV:()=>O,GH:()=>p,Ir:()=>h,Kj:()=>D,RP:()=>_,_R:()=>E,bn:()=>f,ee:()=>A,jY:()=>m,p5:()=>u,s0:()=>l,zg:()=>d});var n=i(90536),o=i(31770),s=i(68548);const r="configSlice",a=(0,o.ur)((0,s.$)("pro")),c=(0,n.createSlice)({name:r,initialState:{...a,initialMergeTags:void 0},reducers:{setPage:(e,t)=>{e.page=t.payload},setConfig:(e,t)=>{e.config={...a.config,...t.payload}},changeConfigMode:(e,t)=>{var i,n,o;const r=null!==(i=null===e||void 0===e||null===(n=e.advancedConfigs)||void 0===n?void 0:n[t.payload])&&void 0!==i?i:null===(o=(0,s.$)(t.payload))||void 0===o?void 0:o.config;if("simple"!==e.config.mode&&"simple"!==t.payload){const t={...e.config,...Object.fromEntries(Object.entries(r).filter((([e])=>s.i.includes(e))))};e.config=t}else e.config={...e.config,...(0,s.$)(t.payload).config}},setInitialMergeTags:(e,t)=>{e.initialMergeTags=t.payload},setMergeTags:(e,t)=>{e.config.mergeTags=t.payload},updateConfig:(e,t)=>{e.config={...e.config,...t.payload}},setProject:(e,t)=>{e.project=t.payload},setAdvancedConfigs:(e,t)=>{e.advancedConfigs=t.payload}},extraReducers:e=>{}}),l=e=>e[r].page,d=e=>e[r].config,_=e=>e[r].config.themes,u=e=>e[r].config.styles,m=e=>e[r].project,p=e=>e[r].config.mergeTags||e[r].initialMergeTags,{setPage:h,setConfig:g,updateConfig:E,setProject:f,setAdvancedConfigs:A,setMergeTags:v,changeConfigMode:O,setInitialMergeTags:D}=c.actions,T=c},47358:(e,t,i)=>{i.d(t,{Ay:()=>j,B:()=>y,Bp:()=>S,CS:()=>w,Ct:()=>M,Fk:()=>h,Fv:()=>R,M7:()=>C,N6:()=>D,NQ:()=>N,Oo:()=>m,PM:()=>p,Tn:()=>k,Uf:()=>A,V$:()=>B,Wm:()=>L,cL:()=>b,mi:()=>g,oG:()=>U,qf:()=>u,sy:()=>I,vc:()=>E,vs:()=>f,wW:()=>v,wr:()=>O,yy:()=>P});var n=i(90536),o=i(85163),s=i(31770),r=i(55701);const a=window.localStorage.getItem(o.V0.em_code_mode_settings),c=a&&JSON.parse(a),l=(0,s.ur)({activeModal:"",lastActiveSettingsTab:o.Bv,activeSettingsTab:o.Bv,isPanelHistoryCollapsed:!0,monacoHeight:0,isCodeMode:(null===c||void 0===c?void 0:c.isCodeMode)||o.EW.isPlugin,codeModeDirection:(null===c||void 0===c?void 0:c.codeModeDirection)||"left",emailWidth:"100%",emailViewType:o.Vp,mobileViewActive:{shutdown:!0,styles:!0},emailMaxWidthSize:425,propertiesPanelKey:o.WU,parentBlocks:[],isGlobalLoading:!1}),d="emailPageSlice",_=(0,n.createSlice)({name:d,initialState:l,reducers:{openModal:(e,t)=>{e.activeModal=t.payload},closeModal:e=>{e.activeModal=""},setActiveSettingsTab:(e,t)=>{e.lastActiveSettingsTab=e.activeSettingsTab,e.activeSettingsTab=t.payload,t.payload!==o.Vv&&(e.isPanelHistoryCollapsed=!0)},resetToLastActiveSettingsTab:e=>{"Properties"===e.lastActiveSettingsTab?e.activeSettingsTab="Build":e.activeSettingsTab=e.lastActiveSettingsTab,e.lastActiveSettingsTab!==o.Vv&&(e.isPanelHistoryCollapsed=!0)},switchIsPanelHistoryCollapsed:(e,t)=>{e.isPanelHistoryCollapsed=t.payload||!e.isPanelHistoryCollapsed},setEmailWidth:(e,{payload:t})=>{e.emailWidth=t,e.emailViewType=t>e.emailMaxWidthSize||"100%"===t?o.Vp:o.ND,window.localStorage.setItem(o.V0.em_default_sizes,JSON.stringify(t))},setEmailMaxWidthSize:(e,{payload:t})=>{e.emailMaxWidthSize=t},setEmailViewType:(e,t)=>{e.emailViewType=t.payload},switchCodeMode:e=>{const t=!e.isCodeMode;e.isCodeMode=t,window.localStorage.setItem(o.V0.em_code_mode_settings,JSON.stringify({codeModeDirection:e.codeModeDirection,isCodeMode:t}))},setCodeMode:(e,t)=>{const i=t.payload;e.isCodeMode!==i&&(e.isCodeMode=i,window.localStorage.setItem(o.V0.em_code_mode_settings,JSON.stringify({codeModeDirection:e.codeModeDirection,isCodeMode:i})))},switchCodeModeDirection:(e,t)=>{e.codeModeDirection=t.payload,window.localStorage.setItem(o.V0.em_code_mode_settings,JSON.stringify({isCodeMode:e.isCodeMode,codeModeDirection:t.payload}))},setMobileViewActive:(e,t)=>{e.mobileViewActive=t.payload},setPropertiesPanelKey:(e,t)=>{e.propertiesPanelKey=t.payload},resetParentBlocks:e=>{e.parentBlocks=[]},setParentBlocks:(e,t)=>{e.parentBlocks=t.payload},setIsGlobalLoading:(e,t)=>{e.isGlobalLoading=t.payload}},extraReducers:e=>{e.addMatcher(r.VM.endpoints.getParentEmailBlocks.matchFulfilled,((e,t)=>{e.parentBlocks=t.payload}))}}),{openModal:u,closeModal:m,setActiveSettingsTab:p,resetToLastActiveSettingsTab:h,switchIsPanelHistoryCollapsed:g,setEmailWidth:E,switchCodeMode:f,switchCodeModeDirection:A,setMobileViewActive:v,setEmailViewType:O,setCodeMode:D,setEmailMaxWidthSize:T,setPropertiesPanelKey:S,resetParentBlocks:I,setIsGlobalLoading:C}=_.actions,b=e=>e[d].activeModal,y=e=>e[d].activeSettingsTab,L=e=>e[d].isPanelHistoryCollapsed,N=e=>e[d].emailWidth,M=e=>e[d].emailViewType,w=e=>e[d].mobileViewActive,P=e=>e[d].codeModeDirection,R=e=>e[d].isCodeMode,k=e=>e[d].propertiesPanelKey,B=e=>e[d].parentBlocks,U=e=>e[d].isGlobalLoading,j=_},95713:(e,t,i)=>{i.d(t,{DX:()=>D,E_:()=>C,Fl:()=>b,HW:()=>N,PF:()=>S,aU:()=>P,dS:()=>n,fE:()=>v,gW:()=>y,ih:()=>R,ke:()=>I,ks:()=>T,tc:()=>k,uB:()=>A,xX:()=>L});var n,o=i(84978),s=i(34235),r=i(39946),a=i(63102),c=i(61883),l=i(11615),d=i(52692),_=i(93308),u=i(75664),m=i(3660),p=i(7492),h=i(97980),g=i(35152),E=i(86448),f=i(92798);class A{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let e=t.kbExpr;this.precondition&&(e=e?u.M$.and(e,this.precondition):this.precondition);const i={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};p.f.registerKeybindingRule(i)}}_.wb.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){d.ZG.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class v extends A{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i){return this._implementations.push({priority:e,name:t,implementation:i}),this._implementations.sort(((e,t)=>t.priority-e.priority)),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e].implementation===i)return void this._implementations.splice(e,1)}}}runCommand(e,t){const i=e.get(f.rr);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const n of this._implementations){const o=n.implementation(e,t);if(o){if(i.trace(`Command '${this.id}' was handled by '${n.name}'.`),"boolean"===typeof o)return;return o}}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class O extends A{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class D extends A{static bindToContribution(e){return class extends D{constructor(e){super(e),this._callback=e.handler}runEditorCommand(t,i,n){const o=e(i);o&&this._callback(o,n)}}}runCommand(e,t){const i=e.get(r.T),n=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(n)return n.invokeWithinContext((e=>{if(e.get(u.fN).contextMatchesRules((0,E.UH)(this.precondition)))return this.runEditorCommand(e,n,t)}))}}class T extends D{constructor(e){super(T.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=d.D8.EditorContext),t.title||(t.title=e.label),t.when=u.M$.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(g.k).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class S extends T{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort(((e,t)=>t[0]-e[0])),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e][1]===t)return void this._implementations.splice(e,1)}}}run(e,t,i){for(const n of this._implementations){const o=n[1](e,t,i);if(o){if("boolean"===typeof o)return;return o}}}}function I(e,t){_.wb.registerCommand(e,(function(e,...i){const n=e.get(m._Y),[o,r]=i;(0,E.j)(s.r.isUri(o)),(0,E.j)(a.y.isIPosition(r));const d=e.get(c.S).getModel(o);if(d){const e=a.y.lift(r);return n.invokeFunction(t,d,e,...i.slice(2))}return e.get(l.b).createModelReference(o).then((e=>new Promise(((o,s)=>{try{o(n.invokeFunction(t,e.object.textEditorModel,a.y.lift(r),i.slice(2)))}catch(c){s(c)}})).finally((()=>{e.dispose()}))))}))}function C(e){return M.INSTANCE.registerEditorCommand(e),e}function b(e){const t=new e;return M.INSTANCE.registerEditorAction(t),t}function y(e){return M.INSTANCE.registerEditorAction(e),e}function L(e){M.INSTANCE.registerEditorAction(e)}function N(e,t){M.INSTANCE.registerEditorContribution(e,t)}!function(e){e.getEditorCommand=function(e){return M.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return M.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return M.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return M.INSTANCE.getEditorContributions().filter((t=>e.indexOf(t.id)>=0))},e.getDiffEditorContributions=function(){return M.INSTANCE.getDiffEditorContributions()}}(n||(n={}));class M{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t){this.editorContributions.push({id:e,ctor:t})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions.slice(0)}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function w(e){return e.register(),e}M.INSTANCE=new M,h.O.add("editor.contributions",M.INSTANCE);const P=w(new v({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:d.D8.MenubarEditMenu,group:"1_do",title:o.kg({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:d.D8.CommandPalette,group:"",title:o.kg("undo","Undo"),order:1}]}));w(new O(P,{id:"default:undo",precondition:void 0}));const R=w(new v({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:d.D8.MenubarEditMenu,group:"1_do",title:o.kg({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:d.D8.CommandPalette,group:"",title:o.kg("redo","Redo"),order:1}]}));w(new O(R,{id:"default:redo",precondition:void 0}));const k=w(new v({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:d.D8.MenubarSelectionMenu,group:"1_basic",title:o.kg({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:d.D8.CommandPalette,group:"",title:o.kg("selectAll","Select All"),order:1}]}))},57964:()=>{}}]);
|