@emailmaker/emailmaker 1.0.99 → 1.0.100

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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/asset-manifest.json +7 -7
  3. package/emailmaker-esm.js +1 -1
  4. package/emailmaker.js +1 -1
  5. package/iframe/429.js +1 -1
  6. package/iframe/766.js +1 -1
  7. package/iframe/iframe-eblock.e88ae8a9ae883be1118b.html +1 -0
  8. package/iframe/iframe.e88ae8a9ae883be1118b.html +1 -0
  9. package/iframe/js/330.4622fd92.js +1 -0
  10. package/iframe/sandbox-eblock.js +1 -1
  11. package/iframe/sandbox.js +1 -1
  12. package/package.json +1 -1
  13. package/plugin.html +1 -1
  14. package/plugin_blocks_test.html +1 -1
  15. package/plugin_default.html +1 -1
  16. package/plugin_idigital.html +1 -1
  17. package/plugin_nota.html +1 -1
  18. package/plugin_s.html +1 -1
  19. package/static/js/1538.68b12a82.chunk.js +2 -0
  20. package/static/js/6798.65ecf642.chunk.js +2 -0
  21. package/static/js/9981.4c03120e.js +1 -0
  22. package/static/js/emailmaker_core.c2851865.js +2 -0
  23. package/translations.pot +56 -56
  24. package/iframe/iframe-eblock.441a4dbc4384f20fcf1e.html +0 -1
  25. package/iframe/iframe.441a4dbc4384f20fcf1e.html +0 -1
  26. package/iframe/js/330.66aee569.js +0 -1
  27. package/static/js/1538.21a548bd.chunk.js +0 -2
  28. package/static/js/6798.dafe22c0.chunk.js +0 -2
  29. package/static/js/9981.0f3d1218.js +0 -1
  30. package/static/js/emailmaker_core.8a6332f2.js +0 -2
  31. /package/iframe/js/{330.66aee569.js.LICENSE.txt → 330.4622fd92.js.LICENSE.txt} +0 -0
  32. /package/static/js/{1538.21a548bd.chunk.js.LICENSE.txt → 1538.68b12a82.chunk.js.LICENSE.txt} +0 -0
  33. /package/static/js/{6798.dafe22c0.chunk.js.LICENSE.txt → 6798.65ecf642.chunk.js.LICENSE.txt} +0 -0
  34. /package/static/js/{emailmaker_core.8a6332f2.js.LICENSE.txt → emailmaker_core.c2851865.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[9981],{634:(e,t,l)=>{"use strict";l.d(t,{lp:()=>_e,G9:()=>ke});var o={};l.r(o),l.d(o,{block:()=>G,blockHtml:()=>Y,blockString:()=>z,blockTag:()=>$,inline:()=>H,inlineHtml:()=>Z,inlineString:()=>j,inlineSurround:()=>K,inlineTag:()=>X,skip:()=>W});var a={};l.r(a),l.d(a,{anchor:()=>ge,blockquote:()=>ce,dataTable:()=>ve,heading:()=>de,horizontalLine:()=>ne,image:()=>pe,lineBreak:()=>ae,orderedList:()=>fe,paragraph:()=>ie,pre:()=>se,table:()=>Ee,unorderedList:()=>be,wbr:()=>re});var r=l(23915);function n(e){return new r.LC(i(e))}function i(e){const t=e.map(s);return(e,...l)=>t.flatMap(t=>t(e,...l))}function s(e){switch(e.type){case"terminal":return()=>[e.valueContainer];case"tagName":return function(e){const t={};for(const l of e.variants)t[l.value.toLowerCase()]=i(l.cont);return(e,...l)=>{var o;const a=null===(o=e.tagName)||void 0===o?void 0:o.toLowerCase(),r=a&&t[a];return r?r(e,...l):[]}}(e);case"attrValue":return function(e){const t=[];for(const o of e.matchers){const e=o.predicate,l=i(o.cont);t.push((t,o,...a)=>e(t)?l(o,...a):[])}const l=e.name;return(e,...o)=>{const a=e.getAttribute(l);return null!==a?t.flatMap(t=>t(a,e,...o)):[]}}(e);case"attrPresence":return function(e){const t=e.name,l=i(e.cont);return(e,...o)=>e.hasAttribute(t)?l(e,...o):[]}(e);case"pushElement":return function(e){const t=i(e.cont),l="+"===e.combinator?d:c;return(e,...o)=>{const a=l(e);return a?t(a,e,...o):[]}}(e);case"popElement":return function(e){const t=i(e.cont);return(e,l,...o)=>t(l,...o)}(e);default:return()=>[]}}function d(e){let t=e.previousSibling;for(;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.previousSibling;return t}function c(e){return e.parentElement}var m=l(28907),u=l.n(m);function p(e,t,l=()=>{}){if(void 0===e){const e=function(...l){return t(e,...l)};return e}return e>=0?function(...o){return t(p(e-1,t,l),...o)}:l}function g(e,t){let l=0,o=e.length;for(;l<o&&e[l]===t;)++l;for(;o>l&&e[o-1]===t;)--o;return l>0||o<e.length?e.substring(l,o):e}function h(e,t){const l=new Map;for(let o=e.length;o-- >0;){const a=e[o],r=t(a);l.set(r,l.has(r)?u()(a,l.get(r),{arrayMerge:b}):a)}return[...l.values()].reverse()}const b=(e,t,l)=>[...t];function f(e,t){for(const l of t){if(!e)return;e=e[l]}return e}function E(e,t="a",l=26){const o=[];do{e-=1,o.push(e%l),e=e/l|0}while(e>0);const a=t.charCodeAt(0);return o.reverse().map(e=>String.fromCharCode(a+e)).join("")}const v=["I","X","C","M"],_=["V","L","D"];function y(e){return[...e+""].map(e=>+e).reverse().map((e,t)=>e%5<4?(e<5?"":_[t])+v[t].repeat(e%5):v[t]+(e<5?_[t]:v[t+1])).reverse().join("")}class A{constructor(e,t=void 0){this.lines=[],this.nextLineWords=[],this.maxLineLength=t||e.wordwrap||Number.MAX_VALUE,this.nextLineAvailableChars=this.maxLineLength,this.wrapCharacters=f(e,["longWordSplit","wrapCharacters"])||[],this.forceWrapOnLimit=f(e,["longWordSplit","forceWrapOnLimit"])||!1,this.stashedSpace=!1,this.wordBreakOpportunity=!1}pushWord(e,t=!1){this.nextLineAvailableChars<=0&&!t&&this.startNewLine();const l=0===this.nextLineWords.length,o=e.length+(l?0:1);if(o<=this.nextLineAvailableChars||t)this.nextLineWords.push(e),this.nextLineAvailableChars-=o;else{const[t,...o]=this.splitLongWord(e);l||this.startNewLine(),this.nextLineWords.push(t),this.nextLineAvailableChars-=t.length;for(const e of o)this.startNewLine(),this.nextLineWords.push(e),this.nextLineAvailableChars-=e.length}}popWord(){const e=this.nextLineWords.pop();if(void 0!==e){const t=0===this.nextLineWords.length,l=e.length+(t?0:1);this.nextLineAvailableChars+=l}return e}concatWord(e,t=!1){if(this.wordBreakOpportunity&&e.length>this.nextLineAvailableChars)this.pushWord(e,t),this.wordBreakOpportunity=!1;else{const l=this.popWord();this.pushWord(l?l.concat(e):e,t)}}startNewLine(e=1){this.lines.push(this.nextLineWords),e>1&&this.lines.push(...Array.from({length:e-1},()=>[])),this.nextLineWords=[],this.nextLineAvailableChars=this.maxLineLength}isEmpty(){return 0===this.lines.length&&0===this.nextLineWords.length}clear(){this.lines.length=0,this.nextLineWords.length=0,this.nextLineAvailableChars=this.maxLineLength}toString(){return[...this.lines,this.nextLineWords].map(e=>e.join(" ")).join("\n")}splitLongWord(e){const t=[];let l=0;for(;e.length>this.maxLineLength;){const o=e.substring(0,this.maxLineLength),a=e.substring(this.maxLineLength),r=o.lastIndexOf(this.wrapCharacters[l]);if(r>-1)e=o.substring(r+1)+a,t.push(o.substring(0,r+1));else{if(l++,!(l<this.wrapCharacters.length)){if(this.forceWrapOnLimit){if(t.push(o),(e=a).length>this.maxLineLength)continue}else e=o+a;break}e=o+a}}return t.push(e),t}}class S{constructor(e=null){this.next=e}getRoot(){return this.next?this.next:this}}class k extends S{constructor(e,t=null,l=1,o=void 0){super(t),this.leadingLineBreaks=l,this.inlineTextBuilder=new A(e,o),this.rawText="",this.stashedLineBreaks=0,this.isPre=t&&t.isPre,this.isNoWrap=t&&t.isNoWrap}}class w extends k{constructor(e,t=null,{interRowLineBreaks:l=1,leadingLineBreaks:o=2,maxLineLength:a,maxPrefixLength:r=0,prefixAlign:n="left"}={}){super(e,t,o,a),this.maxPrefixLength=r,this.prefixAlign=n,this.interRowLineBreaks=l}}class C extends k{constructor(e,t=null,{leadingLineBreaks:l=1,maxLineLength:o,prefix:a=""}={}){super(e,t,l,o),this.prefix=a}}class B extends S{constructor(e=null){super(e),this.rows=[],this.isPre=e&&e.isPre,this.isNoWrap=e&&e.isNoWrap}}class x extends S{constructor(e=null){super(e),this.cells=[],this.isPre=e&&e.isPre,this.isNoWrap=e&&e.isNoWrap}}class T extends S{constructor(e,t=null,l=void 0){super(t),this.inlineTextBuilder=new A(e,l),this.rawText="",this.stashedLineBreaks=0,this.isPre=t&&t.isPre,this.isNoWrap=t&&t.isNoWrap}}class R extends S{constructor(e=null,t){super(e),this.transform=t}}class N{constructor(e){this.whitespaceChars=e.preserveNewlines?e.whitespaceCharacters.replace(/\n/g,""):e.whitespaceCharacters;const t=(l=this.whitespaceChars,[...l].map(e=>"\\u"+e.charCodeAt(0).toString(16).padStart(4,"0")).join(""));var l;if(this.leadingWhitespaceRe=new RegExp(`^[${t}]`),this.trailingWhitespaceRe=new RegExp(`[${t}]$`),this.allWhitespaceOrEmptyRe=new RegExp(`^[${t}]*$`),this.newlineOrNonWhitespaceRe=new RegExp(`(\\n|[^\\n${t}])`,"g"),this.newlineOrNonNewlineStringRe=new RegExp("(\\n|[^\\n]+)","g"),e.preserveNewlines){const e=new RegExp(`\\n|[^\\n${t}]+`,"gm");this.shrinkWrapAdd=function(t,l,o=e=>e,a=!1){if(!t)return;const r=l.stashedSpace;let n=!1,i=e.exec(t);if(i)for(n=!0,"\n"===i[0]?l.startNewLine():r||this.testLeadingWhitespace(t)?l.pushWord(o(i[0]),a):l.concatWord(o(i[0]),a);null!==(i=e.exec(t));)"\n"===i[0]?l.startNewLine():l.pushWord(o(i[0]),a);l.stashedSpace=r&&!n||this.testTrailingWhitespace(t)}}else{const e=new RegExp(`[^${t}]+`,"g");this.shrinkWrapAdd=function(t,l,o=e=>e,a=!1){if(!t)return;const r=l.stashedSpace;let n=!1,i=e.exec(t);if(i)for(n=!0,r||this.testLeadingWhitespace(t)?l.pushWord(o(i[0]),a):l.concatWord(o(i[0]),a);null!==(i=e.exec(t));)l.pushWord(o(i[0]),a);l.stashedSpace=r&&!n||this.testTrailingWhitespace(t)}}}addLiteral(e,t,l=!0){if(!e)return;const o=t.stashedSpace;let a=!1,r=this.newlineOrNonNewlineStringRe.exec(e);if(r)for(a=!0,"\n"===r[0]?t.startNewLine():o?t.pushWord(r[0],l):t.concatWord(r[0],l);null!==(r=this.newlineOrNonNewlineStringRe.exec(e));)"\n"===r[0]?t.startNewLine():t.pushWord(r[0],l);t.stashedSpace=o&&!a}testLeadingWhitespace(e){return this.leadingWhitespaceRe.test(e)}testTrailingWhitespace(e){return this.trailingWhitespaceRe.test(e)}testContainsWords(e){return!this.allWhitespaceOrEmptyRe.test(e)}countNewlinesNoWords(e){this.newlineOrNonWhitespaceRe.lastIndex=0;let t,l=0;for(;null!==(t=this.newlineOrNonWhitespaceRe.exec(e));){if("\n"!==t[0])return 0;l++}return l}}class L{constructor(e,t,l=void 0){this.options=e,this.picker=t,this.metadata=l,this.whitespaceProcessor=new N(e),this._stackItem=new k(e),this._wordTransformer=void 0}pushWordTransform(e){this._wordTransformer=new R(this._wordTransformer,e)}popWordTransform(){if(!this._wordTransformer)return;const e=this._wordTransformer.transform;return this._wordTransformer=this._wordTransformer.next,e}startNoWrap(){this._stackItem.isNoWrap=!0}stopNoWrap(){this._stackItem.isNoWrap=!1}_getCombinedWordTransformer(){const e=this._wordTransformer?e=>O(e,this._wordTransformer):void 0,t=this.options.encodeCharacters;return e?t?l=>t(e(l)):e:t}_popStackItem(){const e=this._stackItem;return this._stackItem=e.next,e}addLineBreak(){(this._stackItem instanceof k||this._stackItem instanceof C||this._stackItem instanceof T)&&(this._stackItem.isPre?this._stackItem.rawText+="\n":this._stackItem.inlineTextBuilder.startNewLine())}addWordBreakOpportunity(){(this._stackItem instanceof k||this._stackItem instanceof C||this._stackItem instanceof T)&&(this._stackItem.inlineTextBuilder.wordBreakOpportunity=!0)}addInline(e,{noWordTransform:t=!1}={}){if(this._stackItem instanceof k||this._stackItem instanceof C||this._stackItem instanceof T)if(this._stackItem.isPre)this._stackItem.rawText+=e;else if(0!==e.length&&(!this._stackItem.stashedLineBreaks||this.whitespaceProcessor.testContainsWords(e))){if(this.options.preserveNewlines){const t=this.whitespaceProcessor.countNewlinesNoWords(e);if(t>0)return void this._stackItem.inlineTextBuilder.startNewLine(t)}this._stackItem.stashedLineBreaks&&this._stackItem.inlineTextBuilder.startNewLine(this._stackItem.stashedLineBreaks),this.whitespaceProcessor.shrinkWrapAdd(e,this._stackItem.inlineTextBuilder,t?void 0:this._getCombinedWordTransformer(),this._stackItem.isNoWrap),this._stackItem.stashedLineBreaks=0}}addLiteral(e){(this._stackItem instanceof k||this._stackItem instanceof C||this._stackItem instanceof T)&&0!==e.length&&(this._stackItem.isPre?this._stackItem.rawText+=e:(this._stackItem.stashedLineBreaks&&this._stackItem.inlineTextBuilder.startNewLine(this._stackItem.stashedLineBreaks),this.whitespaceProcessor.addLiteral(e,this._stackItem.inlineTextBuilder,this._stackItem.isNoWrap),this._stackItem.stashedLineBreaks=0))}openBlock({leadingLineBreaks:e=1,reservedLineLength:t=0,isPre:l=!1}={}){const o=Math.max(20,this._stackItem.inlineTextBuilder.maxLineLength-t);this._stackItem=new k(this.options,this._stackItem,e,o),l&&(this._stackItem.isPre=!0)}closeBlock({trailingLineBreaks:e=1,blockTransform:t}={}){const l=this._popStackItem(),o=t?t(I(l)):I(l);P(this._stackItem,o,l.leadingLineBreaks,Math.max(l.stashedLineBreaks,e))}openList({maxPrefixLength:e=0,prefixAlign:t="left",interRowLineBreaks:l=1,leadingLineBreaks:o=2}={}){this._stackItem=new w(this.options,this._stackItem,{interRowLineBreaks:l,leadingLineBreaks:o,maxLineLength:this._stackItem.inlineTextBuilder.maxLineLength,maxPrefixLength:e,prefixAlign:t})}openListItem({prefix:e=""}={}){if(!(this._stackItem instanceof w))throw new Error("Can't add a list item to something that is not a list! Check the formatter.");const t=this._stackItem,l=Math.max(e.length,t.maxPrefixLength),o=Math.max(20,t.inlineTextBuilder.maxLineLength-l);this._stackItem=new C(this.options,t,{prefix:e,maxLineLength:o,leadingLineBreaks:t.interRowLineBreaks})}closeListItem(){const e=this._popStackItem(),t=e.next,l=Math.max(e.prefix.length,t.maxPrefixLength),o="\n"+" ".repeat(l);P(t,("right"===t.prefixAlign?e.prefix.padStart(l):e.prefix.padEnd(l))+I(e).replace(/\n/g,o),e.leadingLineBreaks,Math.max(e.stashedLineBreaks,t.interRowLineBreaks))}closeList({trailingLineBreaks:e=2}={}){const t=this._popStackItem(),l=I(t);l&&P(this._stackItem,l,t.leadingLineBreaks,e)}openTable(){this._stackItem=new B(this._stackItem)}openTableRow(){if(!(this._stackItem instanceof B))throw new Error("Can't add a table row to something that is not a table! Check the formatter.");this._stackItem=new x(this._stackItem)}openTableCell({maxColumnWidth:e}={}){if(!(this._stackItem instanceof x))throw new Error("Can't add a table cell to something that is not a table row! Check the formatter.");this._stackItem=new T(this.options,this._stackItem,e)}closeTableCell({colspan:e=1,rowspan:t=1}={}){const l=this._popStackItem(),o=g(I(l),"\n");l.next.cells.push({colspan:e,rowspan:t,text:o})}closeTableRow(){const e=this._popStackItem();e.next.rows.push(e.cells)}closeTable({tableToString:e,leadingLineBreaks:t=2,trailingLineBreaks:l=2}){const o=e(this._popStackItem().rows);o&&P(this._stackItem,o,t,l)}toString(){return I(this._stackItem.getRoot())}}function I(e){if(!(e instanceof k||e instanceof C||e instanceof T))throw new Error("Only blocks, list items and table cells can be requested for text contents.");return e.inlineTextBuilder.isEmpty()?e.rawText:e.rawText+e.inlineTextBuilder.toString()}function P(e,t,l,o){if(!(e instanceof k||e instanceof C||e instanceof T))throw new Error("Only blocks, list items and table cells can contain text.");const a=I(e),r=Math.max(e.stashedLineBreaks,l);e.inlineTextBuilder.clear(),a?e.rawText=a+"\n".repeat(r)+t:(e.rawText=t,e.leadingLineBreaks=r),e.stashedLineBreaks=o}function O(e,t){return t?O(t.transform(e),t.next):e}var F=l(72510);function M(e={}){const t=e.selectors.filter(e=>!e.format);if(t.length)throw new Error("Following selectors have no specified format: "+t.map(e=>`\`${e.selector}\``).join(", "));const l=new r.bA(e.selectors.map(e=>[e.selector,e])).build(n);"function"!==typeof e.encodeCharacters&&(e.encodeCharacters=function(e){if(!e||0===Object.keys(e).length)return;const t=Object.entries(e).filter(([,e])=>!1!==e),l=new RegExp(t.map(([e])=>{return`(${t=[...e][0],t.replace(/[\s\S]/g,e=>"\\u"+e.charCodeAt().toString(16).padStart(4,"0"))})`;var t}).join("|"),"g"),o=t.map(([,e])=>e),a=(e,...t)=>o[t.findIndex(e=>e)];return e=>e.replace(l,a)}(e.encodeCharacters));const o=new r.bA(e.baseElements.selectors.map((e,t)=>[e,t+1])).build(n);function a(t){return function(e,t,l){const o=[];function a(e,a){a=[...a].slice(0,t.limits.maxChildNodes);for(const r of a){if(!(0,F.vq)(r))continue;const a=l.pick1(r);if(a>0?o.push({selectorIndex:a,element:r}):r.childNodes&&e([...r.childNodes]),o.length>=t.limits.maxBaseElements)return}}const r=p(t.limits.maxDepth,a);r(e),"occurrence"!==t.baseElements.orderBy&&o.sort((e,t)=>e.selectorIndex-t.selectorIndex);return t.baseElements.returnDomByDefault&&0===o.length?e:o.map(e=>e.element)}(t,e,o)}const i=p(e.limits.maxDepth,D,function(t,l){l.addInline(e.limits.ellipsis||"")});return function(t,o=void 0){return function(e,t,l,o,a,r){const n=a([...e.childNodes]),i=new L(l,o,t);return r(n,i),i.toString()}(t,o,e,l,a,i)}}function D(e,t,l){if(!t)return;const o=l.options;t.length>o.limits.maxChildNodes&&(t=t.slice(0,o.limits.maxChildNodes)).push(document.createTextNode(o.limits.ellipsis||""));for(const a of t)switch(a.nodeType){case a.TEXT_NODE:l.addInline(a.data);break;case a.ELEMENT_NODE:{const t=l.picker.pick1(a),r=o.formatters[t.format];r&&r(a,e,l,t.options||{});break}}}var V=l(35574);function W(e,t,l,o){}function j(e,t,l,o){l.addLiteral(o.string||"")}function z(e,t,l,o){l.openBlock({leadingLineBreaks:o.leadingLineBreaks||2}),l.addLiteral(o.string||""),l.closeBlock({trailingLineBreaks:o.trailingLineBreaks||2})}function H(e,t,l,o){t([...e.childNodes],l)}function G(e,t,l,o){l.openBlock({leadingLineBreaks:o.leadingLineBreaks||2}),t([...e.childNodes],l),l.closeBlock({trailingLineBreaks:o.trailingLineBreaks||2})}function U(e){return(0,V.Ll)(e)}function q(e){return`</${e.tagName.toLoserCase()}>`}function X(e,t,l,o){l.startNoWrap(),l.addLiteral(U(e)),l.stopNoWrap(),t([...e.childNodes],l),l.startNoWrap(),l.addLiteral(q(e)),l.stopNoWrap()}function $(e,t,l,o){l.openBlock({leadingLineBreaks:o.leadingLineBreaks||2}),l.startNoWrap(),l.addLiteral(U(e)),l.stopNoWrap(),t([...e.childNodes],l),l.startNoWrap(),l.addLiteral(q(e)),l.stopNoWrap(),l.closeBlock({trailingLineBreaks:o.trailingLineBreaks||2})}function Z(e,t,l,o){l.startNoWrap(),l.addLiteral((0,F.b6)(e)),l.stopNoWrap()}function Y(e,t,l,o){l.openBlock({leadingLineBreaks:o.leadingLineBreaks||2}),l.startNoWrap(),l.addLiteral((0,F.b6)(e)),l.stopNoWrap(),l.closeBlock({trailingLineBreaks:o.trailingLineBreaks||2})}function K(e,t,l,o){l.addLiteral(o.prefix||""),t([...e.childNodes],l),l.addLiteral(o.suffix||"")}function Q(e,t){return e[t]||(e[t]=[]),e[t]}function J(e,t=0){for(;e[t];)t++;return t}function ee(e,t,l,o){for(let a=0;a<e.rowspan;a++){const r=Q(t,l+a);for(let t=0;t<e.colspan;t++)r[o+t]=e}}function te(e,t){return void 0===e[t]&&(e[t]=0===t?0:1+te(e,t-1)),e[t]}function le(e,t,l,o){e[t+l]=Math.max(te(e,t+l),te(e,t)+o)}function oe(e,t,l){const o=[];let a=0;const r=e.length,n=[0];for(let d=0;d<r;d++){const l=Q(o,d),r=e[d];let i=0;for(let e=0;e<r.length;e++){const a=r[e];i=J(l,i),ee(a,o,d,i),i+=a.colspan,a.lines=a.text.split("\n");const s=a.lines.length;le(n,d,a.rowspan,s+t)}a=l.length>a?l.length:a}!function(e,t){for(let l=0;l<t;l++){const t=Q(e,l);for(let o=0;o<l;o++){const a=Q(e,o);if(t[o]||a[l]){const e=t[o];t[o]=a[l],a[l]=e}}}}(o,r>a?r:a);const i=[],s=[0];for(let d=0;d<a;d++){let e,t=0;const a=Math.min(r,o[d].length);for(;t<a;)if(e=o[d][t],e){if(!e.rendered){let o=0;for(let l=0;l<e.lines.length;l++){const a=e.lines[l],r=n[t]+l;i[r]=(i[r]||"").padEnd(s[d])+a,o=a.length>o?a.length:o}le(s,d,e.colspan,o+l),e.rendered=!0}t+=e.rowspan}else{const e=n[t];i[e]=i[e]||"",t++}}return i.join("\n")}function ae(e,t,l,o){l.addLineBreak()}function re(e,t,l,o){l.addWordBreakOpportunity()}function ne(e,t,l,o){l.openBlock({leadingLineBreaks:o.leadingLineBreaks||2}),l.addInline("-".repeat(o.length||l.options.wordwrap||40)),l.closeBlock({trailingLineBreaks:o.trailingLineBreaks||2})}function ie(e,t,l,o){l.openBlock({leadingLineBreaks:o.leadingLineBreaks||2}),t([...e.childNodes],l),l.closeBlock({trailingLineBreaks:o.trailingLineBreaks||2})}function se(e,t,l,o){l.openBlock({isPre:!0,leadingLineBreaks:o.leadingLineBreaks||2}),t([...e.childNodes],l),l.closeBlock({trailingLineBreaks:o.trailingLineBreaks||2})}function de(e,t,l,o){l.openBlock({leadingLineBreaks:o.leadingLineBreaks||2}),!1!==o.uppercase?(l.pushWordTransform(e=>e.toUpperCase()),t([...e.childNodes],l),l.popWordTransform()):t([...e.childNodes],l),l.closeBlock({trailingLineBreaks:o.trailingLineBreaks||2})}function ce(e,t,l,o){l.openBlock({leadingLineBreaks:o.leadingLineBreaks||2,reservedLineLength:2}),t([...e.childNodes],l),l.closeBlock({trailingLineBreaks:o.trailingLineBreaks||2,blockTransform:e=>(!1!==o.trimEmptyLines?g(e,"\n"):e).split("\n").map(e=>"> "+e).join("\n")})}function me(e,t){if(!t)return e;return("string"===typeof t[0]?t[0]:"[")+e+("string"===typeof t[1]?t[1]:"]")}function ue(e,t,l,o,a){const r="function"===typeof t?t(e,o,a):e;return"/"===r[0]&&l?function(e,t){let l=e.length;for(;l>0&&e[l-1]===t;)--l;return l<e.length?e.substring(0,l):e}(l,"/")+r:r}function pe(e,t,l,o){const a=e.getAttribute("alt")||"",r=e.getAttribute("src")?ue(e.getAttribute("src"),o.pathRewrite,o.baseUrl,l.metadata,e):"",n=r?a?a+" "+me(r,o.linkBrackets):me(r,o.linkBrackets):a;l.addInline(n,{noWordTransform:!0})}function ge(e,t,l,o){const a=function(){if(o.ignoreHref)return"";if(!e.getAttribute("href"))return"";let t=e.getAttribute("href").replace(/^mailto:/,"");return o.noAnchorUrl&&"#"===t[0]?"":(t=ue(t,o.pathRewrite,o.baseUrl,l.metadata,e),t)}();if(a){let r="";l.pushWordTransform(e=>(e&&(r+=e),e)),t([...e.childNodes],l),l.popWordTransform();o.hideLinkHrefIfSameAsText&&a===r||l.addInline(r?" "+me(a,o.linkBrackets):a,{noWordTransform:!0})}else t([...e.childNodes],l)}function he(e,t,l,o,a){const r="li"===f(e,["parent","name"]);let n=0;const i=([...e.childNodes]||[]).filter(e=>!(0,F.ir)(e)||!/^\s*$/.test(e.data)).map(function(e){var t;if("li"!==(null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase()))return{node:e,prefix:""};const l=r?a().trimStart():a();return l.length>n&&(n=l.length),{node:e,prefix:l}});if(i.length){l.openList({interRowLineBreaks:1,leadingLineBreaks:r?1:o.leadingLineBreaks||2,maxPrefixLength:n,prefixAlign:"left"});for(const{node:e,prefix:o}of i)l.openListItem({prefix:o}),t([e],l),l.closeListItem();l.closeList({trailingLineBreaks:r?1:o.trailingLineBreaks||2})}}function be(e,t,l,o){const a=o.itemPrefix||" * ";return he(e,t,l,o,()=>a)}function fe(e,t,l,o){var a,r;let n=Number((null===(a=e.getAttribute)||void 0===a?void 0:a.call(e,"start"))||"1");const i=function(e="1"){switch(e){case"a":return e=>E(e,"a");case"A":return e=>E(e,"A");case"i":return e=>y(e).toLowerCase();case"I":return e=>y(e);default:return e=>e.toString()}}(null===(r=e.getAttribute)||void 0===r?void 0:r.call(e,"type"));return he(e,t,l,o,()=>" "+i(n++)+". ")}function Ee(e,t,l,o){return function(e,t){if(!0===t)return!0;if(!e)return!1;const{classes:l,ids:o}=function(e){const t=[],l=[];for(const o of e)o.startsWith(".")?t.push(o.substring(1)):o.startsWith("#")&&l.push(o.substring(1));return{classes:t,ids:l}}(t),a=(e.getAttribute("class")||"").split(" "),r=(e.getAttribute("id")||"").split(" ");return a.some(e=>l.includes(e))||r.some(e=>o.includes(e))}(e,l.options.tables)?ve(e,t,l,o):function(e,t,l,o){l.openBlock({leadingLineBreaks:o.leadingLineBreaks}),t([...e.childNodes],l),l.closeBlock({trailingLineBreaks:o.trailingLineBreaks})}(e,t,l,o)}function ve(e,t,l,o){function a(e){const a=e.getAttribute("colspan")||1,r=e.getAttribute("rowspan")||1;l.openTableCell({maxColumnWidth:o.maxColumnWidth}),t([...e.childNodes],l),l.closeTableCell({colspan:a,rowspan:r})}l.openTable(),[...e.childNodes].forEach(function e(t){var r;if(!(0,F.vq)(t))return;const n=!1!==o.uppercaseHeaderCells?e=>{l.pushWordTransform(e=>e.toUpperCase()),a(e),l.popWordTransform()}:a;switch(null===(r=t.tagName)||void 0===r?void 0:r.toLowerCase()){case"thead":case"tbody":case"tfoot":case"center":return void[...t.childNodes].forEach(e);case"tr":l.openTableRow();for(const e of[...t.childNodes])if((0,F.vq)(e))switch(e.tagName.toLowerCase()){case"th":n(e);break;case"td":a(e)}l.closeTableRow()}}),l.closeTable({tableToString:e=>{var t,l;return oe(e,null!==(t=o.rowSpacing)&&void 0!==t?t:0,null!==(l=o.colSpacing)&&void 0!==l?l:3)},leadingLineBreaks:o.leadingLineBreaks,trailingLineBreaks:o.trailingLineBreaks})}const _e={baseElements:{selectors:["body"],orderBy:"selectors",returnDomByDefault:!0},decodeEntities:!0,encodeCharacters:{},formatters:{},limits:{ellipsis:"...",maxBaseElements:void 0,maxChildNodes:void 0,maxDepth:void 0,maxInputLength:1<<24},longWordSplit:{forceWrapOnLimit:!1,wrapCharacters:[]},preserveNewlines:!1,selectors:[{selector:"*",format:"inline"},{selector:"a",format:"anchor",options:{baseUrl:null,hideLinkHrefIfSameAsText:!1,ignoreHref:!1,linkBrackets:["[","]"],noAnchorUrl:!0}},{selector:"article",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"aside",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"blockquote",format:"blockquote",options:{leadingLineBreaks:2,trailingLineBreaks:2,trimEmptyLines:!0}},{selector:"br",format:"lineBreak"},{selector:"div",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"footer",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"form",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"h1",format:"heading",options:{leadingLineBreaks:3,trailingLineBreaks:2,uppercase:!0}},{selector:"h2",format:"heading",options:{leadingLineBreaks:3,trailingLineBreaks:2,uppercase:!0}},{selector:"h3",format:"heading",options:{leadingLineBreaks:3,trailingLineBreaks:2,uppercase:!0}},{selector:"h4",format:"heading",options:{leadingLineBreaks:2,trailingLineBreaks:2,uppercase:!0}},{selector:"h5",format:"heading",options:{leadingLineBreaks:2,trailingLineBreaks:2,uppercase:!0}},{selector:"h6",format:"heading",options:{leadingLineBreaks:2,trailingLineBreaks:2,uppercase:!0}},{selector:"header",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"hr",format:"horizontalLine",options:{leadingLineBreaks:2,length:void 0,trailingLineBreaks:2}},{selector:"img",format:"image",options:{baseUrl:null,linkBrackets:["[","]"]}},{selector:"main",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"nav",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"ol",format:"orderedList",options:{leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"p",format:"paragraph",options:{leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"pre",format:"pre",options:{leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"section",format:"block",options:{leadingLineBreaks:1,trailingLineBreaks:1}},{selector:"table",format:"table",options:{colSpacing:3,leadingLineBreaks:2,maxColumnWidth:60,rowSpacing:0,trailingLineBreaks:2,uppercaseHeaderCells:!0}},{selector:"ul",format:"unorderedList",options:{itemPrefix:" * ",leadingLineBreaks:2,trailingLineBreaks:2}},{selector:"wbr",format:"wbr"}],tables:[],whitespaceCharacters:" \t\r\n\f\u200b"},ye=(e,t,l)=>[...t],Ae=(e,t,l)=>e.some(e=>"object"===typeof e)?((e,t)=>[...e,...t])(e,t):ye(e,t,l);function Se(e={}){return(e=u()(_e,e,{arrayMerge:ye,customMerge:e=>"selectors"===e?Ae:void 0})).formatters=Object.assign({},o,a,e.formatters),e.selectors=h(e.selectors,e=>e.selector),function(e){if(e.tags){const t=Object.entries(e.tags).map(([e,t])=>({...t,selector:e||"*"}));e.selectors.push(...t),e.selectors=h(e.selectors,e=>e.selector)}function t(e,t,l){const o=t.pop();for(const a of t){let t=e[a];t||(t={},e[a]=t),e=t}e[o]=l}if(e.baseElement){const l=e.baseElement;t(e,["baseElements","selectors"],Array.isArray(l)?l:[l])}void 0!==e.returnDomByDefault&&t(e,["baseElements","returnDomByDefault"],e.returnDomByDefault);for(const l of e.selectors)"anchor"===l.format&&f(l,["options","noLinkBrackets"])&&t(l,["options","linkBrackets"],!1)}(e),M(e)}function ke(e,t={},l=void 0){return Se(t)(e,l)}},705:(e,t,l)=>{"use strict";l.d(t,{vx:()=>c,I9:()=>m,bw:()=>u});var o=l(14721),a=l(39539),r=l(93778),n=l(31926);function i({title:e,content:t,acf:{seen:l,type:o,event:a,data:r},...i}){return{...i,seen:l,type:o,event:a,data:r,title:(0,n.vf)(e),content:t}}var s=l(58521);const d="Notifications",c=(0,o.xP)({reducerPath:"notificationsApi",tagTypes:[d],baseQuery:(0,s.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getNotifications:e.query({queryFn:(e,t)=>(0,s.KU)(t).wp.notification_list({author:[Number(e)]}).then((0,r.Ih)(i)),providesTags:e=>e?[...e.map(({id:e})=>({type:d,id:e})),{type:d,id:"LIST"}]:[{type:d,id:"LIST"}]}),notificationShown:e.mutation({queryFn:({id:e,datetime:t},l)=>(0,s.KU)(l).wp.notification_create2(e,{},{type:a.cM.Json,extraQuery:{"acf[seen]":t}}).then((0,r.SC)(i)),invalidatesTags:[{type:d,id:"LIST"}]})})}),{useGetNotificationsQuery:m,useNotificationShownMutation:u}=c},871:(e,t,l)=>{"use strict";l.d(t,{CL:()=>u,FQ:()=>p,Jg:()=>A,Mv:()=>E,eo:()=>k,gg:()=>C,h4:()=>b});var o=l(14721),a=l(79596),r=l(39539),n=l(58521),i=l(18987),s=l(32947),d=l(12352),c=l(76233),m=l(3792);const u=(0,o.xP)({reducerPath:"imageApi",baseQuery:void 0,endpoints:e=>({getImageInfo:e.query({queryFn:async function(e,t){try{var l,o;const a=(null===(l=t.getState().configSlice)||void 0===l||null===(o=l.config)||void 0===o?void 0:o.imageInfoToolUrl)||"https://scr.emcdn.ru/imageinfo",r=await fetch(`${a}?url=${encodeURIComponent(e)}`);return{data:await r.json()}}catch(a){}}}),getSearchImage:e.query({queryFn:async function({query:e,page:t}){const l=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let o=`https://px0.useblocks.io/photos?client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o&lang=ru&per_page=18&query=${l}&page=${t}&proxy_url=https://api.unsplash.com/search`;""!==e.color&&(o+=`&color=${e.color}`),""!==e.orientation&&(o+=`&orientation=${e.orientation}`);const a=await fetch(o);return{data:await a.json()}}catch(o){}}}),getUnsplashImage:e.query({queryFn:async function(e){try{const t=await fetch(`${e}&client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o`);return{data:await t.json()}}catch(t){}}}),sendAiImageRequest:e.query({queryFn:async function({body:e},t){try{const l=(0,n.KU)(t);return await l.saveFile.ai_create(e,{type:r.cM.FormData})}catch(l){throw new Error(l)}}}),getAiImage:e.query({queryFn:async function(e,t){try{const l=(0,n.KU)(t);return await l.saveFile.ai_status_list(e)}catch(l){}}}),getAiImageSSE:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({task_id:e,entity_id:t,setError:l},o){const{updateCachedData:r,cacheEntryRemoved:u}=o,p=(0,n.KU)(o);let g;g=p.baseUrl.indexOf("dev-")>=0?p.baseUrl:p.baseUrl.indexOf("emailmaker")>=0?(0,c.qT)(s.Rn.maker):(0,c.qT)(s.Rn.blocks);const h=s.EW.isPlugin?await m.di.getInstance(o,d.Y):i.A.get(s.A9.em_token),b=h?{Authorization:`Bearer ${h}`}:{},f=new a.EventSourcePolyfill(` ${g}/ai-generator/v1/ai-status?entity_id=${t}&stream=1&task_id=${e}`,{headers:b});f.onmessage=e=>{const t=JSON.parse(e.data);r(e=>{e.push(t)}),100===t.progress&&f.close()},f.onerror=e=>{f.close()},await u,f.close()}}),getSearchGif:e.query({queryFn:async function({query:e,page:t}){const l=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let e=`https://api.giphy.com/v1/gifs/search?api_key=Nh77eBlPeMn1ed9MBAvL542NUGeNO26F&q=${l}&limit=25&offset=${t}&lang=en`;const o=await fetch(e);return{data:await o.json()}}catch(o){}}})})}),{useLazyGetImageInfoQuery:p,useGetImageInfoQuery:g,useGetSearchImageQuery:h,useLazyGetSearchImageQuery:b,useSendAiImageRequestQuery:f,useLazySendAiImageRequestQuery:E,useGetAiImageQuery:v,useLazyGetAiImageQuery:_,useGetUnsplashImageQuery:y,useLazyGetUnsplashImageQuery:A,useGetSearchGifQuery:S,useLazyGetSearchGifQuery:k,useGetAiImageSSEQuery:w,useLazyGetAiImageSSEQuery:C}=u},1047:(e,t,l)=>{"use strict";l.d(t,{A9:()=>p,AJ:()=>v,Ay:()=>H,Bj:()=>w,Bu:()=>B,CT:()=>O,G_:()=>u,HO:()=>f,Hs:()=>F,M7:()=>g,RC:()=>T,S_:()=>x,UI:()=>W,Up:()=>N,VK:()=>y,VO:()=>k,VZ:()=>D,Wm:()=>S,dH:()=>j,eX:()=>m,iy:()=>P,mD:()=>z,no:()=>A,om:()=>h,pl:()=>E,ps:()=>C,qX:()=>I,rY:()=>V,rd:()=>M,ry:()=>b,ss:()=>_,uJ:()=>L,zn:()=>R});var o=l(1029),a=l(93778),r=l(98845),n=l(83027),i=l(65716);const s=(0,a.ur)({invalidateEmailId:null,editorThemeColor:"light",isSettingsDisabled:!1,settings:{backgroundColor:"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",textStrong:!1,textItalic:!1,textUnderline:!1},elementSettings:{},searchFilters:{},emailCommonStyles:"",saveTime:null,mobileViewActive:{shutdown:!0,styles:!0},email:{id:void 0,is_inited:!1,isNew:!1,subject:void 0,preheader:void 0,description:"",html:"",project:void 0,project_author:"",project_title:"",tags:[],utm_parameters:{utm_source:"",utm_medium:"",utm_campaign:"",utm_term:"",utm_content:""},parent_email:null,common_styles:"{}",title:null,emailtags:[],group:[],isAmp:!1},emailIsEdit:!1,isCodeMode:!1,codeModeDirection:void 0,emailViewType:void 0,changeKey:null,problemsList:[],activeProblemRange:null,emailGroups:{},parentGroupOfProject:null,projectGroups:[],isNeedUpdateAppearance:!1,isNeedUpdateContentAppearance:!1}),d="emailSlice",c=(0,o.createSlice)({name:d,initialState:s,reducers:{setEditorThemeColor:(e,t)=>{e.editorThemeColor=t.payload},setEmailFromHistory:(e,{payload:t})=>{const l=e.email,o=void 0===(null===t||void 0===t?void 0:t.preheader),a=void 0===(null===t||void 0===t?void 0:t.subject);e.email={...l,html:null===t||void 0===t?void 0:t.html,preheader:o?l.preheader:null===t||void 0===t?void 0:t.preheader,subject:a?l.subject:null===t||void 0===t?void 0:t.subject,common_styles:"string"===typeof(null===t||void 0===t?void 0:t.common_styles)&&null!==t&&void 0!==t&&t.common_styles.startsWith("{")?null===t||void 0===t?void 0:t.common_styles:l.common_styles||"{}"},e.isNeedUpdateAppearance=!0,e.isNeedUpdateContentAppearance=!0},setEmailSettings:(e,{payload:t})=>{Object.assign(e,{...e,settings:{...t},isSettingsDisabled:!1})},setEmailSettingsDisable:(e,t)=>{e.isSettingsDisabled=t.payload},setElementSettings:(e,{payload:t})=>{e.elementSettings=t},setSearchFilters:(e,t)=>{e.searchFilters=t.payload},updateSearchFilters:(e,t)=>{const l=e.searchFilters;e.searchFilters={...l,...t.payload}},setEmailHTML:(e,t)=>{e.email.html=t.payload},setEmailSubject:(e,t)=>{e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=t.payload),e.email.subject=t.payload},setEmailPreheader:(e,t)=>{e.email.preheader=t.payload},resetEmailSlice:()=>s,setEmailTitle:(e,t)=>{e.email.title=t.payload},setIsInited:(e,t)=>{e.email.is_inited=t.payload},setEmailIsAmp:(e,t)=>{e.email.isAmp=t.payload},setProblemsList:(e,t)=>{e.problemsList=t.payload},setActiveProblemRange:(e,t)=>{e.activeProblemRange=t.payload},setIsNeedUpdateContentAppearance:(e,t)=>{e.isNeedUpdateContentAppearance=t.payload},setIsNeedUpdateAppearance:(e,t)=>{e.isNeedUpdateAppearance=t.payload},setEmailGroups:(e,{payload:t})=>{const l=Object.keys(t)[0],o=e.emailGroups,a=e.parentGroupOfProject,r=e.projectGroups,n={};var i;a&&r.length&&(null===(i=t[l])||void 0===i||i.forEach(e=>{const t=r.find(e=>e.id===+l),o=null===t||void 0===t?void 0:t.children.find(t=>t.id===+e);o?(n.hasOwnProperty(t.id)||(n[t.id]=[]),n[t.id].push({label:o.name,value:o.id})):(n.hasOwnProperty(l)||(n[l]=[]),n[l].push({label:e,value:null}))}),0===t[l].length&&(n[l]=[]));e.emailGroups={...o,...n}}},extraReducers:e=>{e.addMatcher(e=>"emailsApi/queries/queryResultPatched"===e.type,(e,t)=>{var l,o;const a=t.payload.queryCacheKey.match(/\("([0-9]+)"\)/),r=null===(l=t.payload)||void 0===l?void 0:l.patches[0];null!==r&&void 0!==r&&null!==(o=r.path)&&void 0!==o&&o[0]&&(e.email[null===r||void 0===r?void 0:r.path[0]]=r.value),null!==a&&void 0!==a&&a[1]&&(e.invalidateEmailId=a[1]),e.emailIsEdit=!0}),e.addMatcher(e=>"emailsApi/invalidateTags"===e.type,(e,t)=>{if(t.payload[0].id===+e.invalidateEmailId)return s}),e.addMatcher(r.GY.endpoints.editEmail.matchFulfilled,(e,{payload:t})=>{e.invalidateEmailId=null,e.email={...e.email,...t,renderGuid:e.email.renderGuid}}),e.addMatcher(r.GY.endpoints.autoSaveEmail.matchFulfilled,(e,t)=>{var l,o;(null===(l=e.email.id)||void 0===l?void 0:l.toString())===(null===(o=t.payload.id)||void 0===o?void 0:o.toString())&&(e.email.html=t.payload.html)}),e.addMatcher(r.GY.endpoints.getEmail.matchFulfilled,(e,{payload:t})=>{var l,o;e.email={...s.email,...t,is_inited:t.is_inited||(t.id===(null===(l=e.email)||void 0===l?void 0:l.id)?null===(o=e.email)||void 0===o?void 0:o.is_inited:s.email.is_inited),common_styles:"string"===typeof(null===t||void 0===t?void 0:t.common_styles)&&null!==t&&void 0!==t&&t.common_styles.startsWith("{")?null===t||void 0===t?void 0:t.common_styles:"{}"},e.emailIsEdit=!1}),e.addMatcher(n.kE.endpoints.getGroups.matchFulfilled,(e,{meta:t,payload:l})=>{const o=e.email.group,a=t.arg.originalArgs.parent,r=l;a&&(e.parentGroupOfProject=a,r.length>0&&(e.projectGroups=r));const n={};a&&o.length&&r.length&&(null===o||void 0===o||o.forEach(e=>{null===r||void 0===r||r.forEach(t=>{const l=t.children.find(t=>t.id===e);l&&(n.hasOwnProperty(t.id)||(n[t.id]=[]),n[t.id].push({label:l.name,value:l.id}))})})),e.emailGroups=n}),e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,(e,{meta:t,payload:l})=>{var o;e.parentGroupOfProject=(null===(o=l.group)||void 0===o?void 0:o[0])||null})}}),{setEditorThemeColor:m,setEmailSettings:u,setElementSettings:p,setEmailSettingsDisable:g,setSearchFilters:h,updateSearchFilters:b,setEmailSubject:f,setEmailPreheader:E,setEmailHTML:v,resetEmailSlice:_,setEmailTitle:y,setEmailFromHistory:A,setIsInited:S,setEmailIsAmp:k,setProblemsList:w,setActiveProblemRange:C,setEmailGroups:B,setIsNeedUpdateAppearance:x,setIsNeedUpdateContentAppearance:T}=c.actions,R=e=>e[d].invalidateEmailId,N=e=>e[d].editorThemeColor,L=e=>e[d].settings,I=e=>e[d].elementSettings,P=e=>e[d].isSettingsDisabled,O=e=>e[d].searchFilters,F=e=>e[d].email,M=e=>e[d].problemsList,D=e=>e[d].activeProblemRange,V=e=>e[d].emailGroups,W=e=>e[d].projectGroups,j=e=>e[d].isNeedUpdateContentAppearance,z=e=>e[d].isNeedUpdateAppearance,H=c},1511:(e,t,l)=>{"use strict";l.d(t,{Vq:()=>r,gP:()=>o,zq:()=>a});const o="https://cdn.ampproject.org/v0",a=`${o}.js`,r=`script[src='${a}']`},1753:(e,t,l)=>{"use strict";l.d(t,{A:()=>c});var o=l(98173),a=l(49856),r=l(98447),n=l(38826);const i=o.createElement(n.A,{style:{fontSize:48},spin:!0}),s=(0,o.lazy)(()=>Promise.all([l.e(6819),l.e(1880),l.e(6801),l.e(84)]).then(l.bind(l,47824))),d={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"};function c(e){return o.createElement(o.Suspense,{fallback:o.createElement(a.A,{size:"large",style:d},o.createElement(r.A,{indicator:i}))},o.createElement(s,e))}},2952:(e,t,l)=>{"use strict";l.d(t,{Ju:()=>s,Sr:()=>d,ku:()=>i,tO:()=>n});var o=l(14721),a=l(58521);const r="Optimise",n=(0,o.xP)({reducerPath:"optimiseApi",tagTypes:[r],baseQuery:async(e,t,l)=>{const o=(0,a.KU)(t).baseUrl.replaceAll(/[\\/]$/g,""),r=(0,a.hI)({baseUrl:`${o}/optimization/v1/validate`});let n=await r(e,t,l);if(n.error){let e=n.error;if("function"===typeof e.json)try{e=await e.json()}catch{e=await e}return{error:e}}return n},endpoints:e=>({editLinks:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/links",body:e}),invalidatesTags:[r]}),editImages:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/images",body:e})}),editSpam:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/spamassasin",body:e})})})}),{useEditLinksMutation:i,useEditImagesMutation:s,useEditSpamMutation:d}=n},3326:(e,t,l)=>{"use strict";l.d(t,{LG:()=>i,ZU:()=>d,cR:()=>r,fh:()=>n,or:()=>a,r4:()=>s});var o=l(98173);const a=(0,o.createContext)({element:void 0}),r=()=>{var e;return null===(e=(0,o.useContext)(a))||void 0===e?void 0:e.element},n=(0,o.createContext)(void 0),i=()=>(0,o.useContext)(n),s=(0,o.createContext)(!1),d=()=>(0,o.useContext)(s)},3372:(e,t,l)=>{var o={"./en_US.ts":[53640,2466],"./ru_RU.ts":[48755,6859]};function a(e){if(!l.o(o,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=o[e],a=t[0];return l.e(t[1]).then(()=>l(a))}a.keys=()=>Object.keys(o),a.id=3372,e.exports=a},3792:(e,t,l)=>{"use strict";l.d(t,{di:()=>n});var o=l(74568),a=l(88296),r=l(80148);const n={getContainer:r.My,createIdentifier:a.Q,reducer:r.Ff,reducerPath:r.IP,getInstance:function(e,t){return(e instanceof o.m?e:(0,r.My)(e)).getInstance(t)},getInstanceAsync:function(e,t){return(e instanceof o.m?e:(0,r.My)(e)).getInstanceAsync(t)},getOrCreateInstance:function(e,t,l){return(e instanceof o.m?e:(0,r.My)(e)).getOrCreateInstance(t,l)},inject:function(e,t,l,o){return(0,r.My)(e).inject(t,l)},addService:function(e,t,l){return(0,r.My)(e).addService(t,l)},getServices:function(e,t){return(0,r.My)(e).getServices(t)},useInject:r.lg,useInstance:r.Nj,useInstanceAsync:r.rl,useServices:r.A$}},5291:(e,t,l)=>{"use strict";l.d(t,{A:()=>vt});var o,a=l(98173),r=l(47555),n=l(35491),i=l(72570),s=l(37969),d=l(30150),c=l(79245),m=l(2604),u=l(3326),p=l(61631),g=l(56605),h=l(10486),b=l(68984),f=l(65716),E=l(5558),v=l(69550),_=l(48753),y=l(201),A=l(66964),S=l(8218),k=l(49823),w=l(94780);function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var o in l)({}).hasOwnProperty.call(l,o)&&(e[o]=l[o])}return e},C.apply(null,arguments)}function B({title:e,titleId:t,...l},r){return a.createElement("svg",C({fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",ref:r,"aria-labelledby":t},l),e?a.createElement("title",{id:t},e):null,o||(o=a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.39 3.12h7.383c.242 0 .438.195.438.437v3.719a.437.437 0 0 1-.438.437H9.547v3.227a.437.437 0 0 1-.438.437H1.727a.437.437 0 0 1-.438-.437V7.22c0-.241.196-.437.438-.437h3.226V3.557c0-.242.196-.438.438-.438Zm.493 7.327h2.734V7.713H5.883v2.734Zm3.664-3.664h2.734V4.05H9.547v2.734Z",fill:"inherit"})))}const x=a.forwardRef(B);l.p;var T=l(54838),R=l(40277),N=l(12543),L=l(27941);const I=()=>{document.querySelector(".blocks-search__blocks-wrapper")&&(document.querySelector(".blocks-search__blocks-wrapper").style.removeProperty("transition"),document.querySelector(".blocks-search__blocks-wrapper").style.opacity=0,document.querySelectorAll(".blocks-search__result-body").forEach(e=>e.style.removeProperty("height")),setTimeout(()=>{document.querySelectorAll(".blocks-search__result-body").forEach(e=>{e.style.height=207*e.offsetHeight/660+"px"}),document.querySelector(".blocks-search__blocks-wrapper").style.transition="opacity 0.2s",document.querySelectorAll(".blocks-search__blocks-wrapper").forEach(e=>e.style.opacity=1)},1500))};var P=l(32947);const O=async({blockTags:e,projectData:t,projectId:l,addTag:o,editProject:a,notification:r,__:n})=>{const i=`project_${l}`,s=(0,R._q)(t,P.YY),d=s.find(e=>e.name===i),c=s||[];let m;if(d)m=d.id;else{const e=await o({name:i});if(e.error)throw r.fromError("FOLDER_CREATING_ERROR",i,e.error),new Error("\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0442\u0435\u0433\u0430");{const t=await a({projectId:l,blocktags:e.data.id});if(t.error)throw r.fromError("BLOCK_CLONING_ERROR",(0,E.x_)(e.data),t.error),new Error("\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043d\u043e\u0432\u044b\u043c \u0442\u0435\u0433\u043e\u043c");m=t.data.blocktags&&t.data.blocktags[0]}}const u=await(async({blockTags:e,projectTagsArray:t,addTag:l,parent:o,notification:a})=>{if(!e||0===e.length)return[];const r=e.map(e=>{const r=t.find(t=>t.name===e);return r?Promise.resolve(r.id):l({name:e,parent:o}).then(({error:t,data:l})=>400===(null===t||void 0===t?void 0:t.status)?t.data.data.term_id:l?l.id:t?(a.fromError("TAG_CREATING_ERROR",e,t),null):void 0)});return(await Promise.all(r)).filter(e=>null!==e&&void 0!==e)})({blockTags:e,projectTagsArray:c,addTag:o,parent:m,notification:r});return{tagIds:u,projectTagsArray:c}},F=async({form:e,notification:t,__:l})=>{let o=!0;const a=await e.validateFields(),r=a.tags;return(null===r||void 0===r?void 0:r.length)>10&&(t.error({id:"BLOCK_TOO_MANY_TAGS_ERROR",data:(0,E.x_)(a),message:l("Maximum 10 tags available.")}),o=!1),{valid:o,values:a,blockTags:r}},M=async({block:e,form:t,projectId:l,htmlContent:o,values:a,tagIds:r,addBlock:n,editProject:i,notification:s,refetch:d,refetchBlocks:c,reloadBlockScreens:m,projectTagsArray:u,__:p,handleCloseModal:g})=>{const h=e?{title:e.blockTitle,project:e.projectId,html:e.htmlContent,type:e.blockType||"Other"}:{title:a.title,project:l,html:o||"",type:a.type||"Other"},b=await n({...h,blocktags:r.join(",")});if(b.error)throw s.error({id:"BLOCK_CREATING_ERROR",data:{title:h.title,html:h.html},innerException:b.error,message:b.error.data.code,description:b.error.data.message}),t.resetFields(),g(),new Error("\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043b\u043e\u043a\u0430");e||(t.resetFields(),g());const f=u.map(e=>e.id),v=new Set([...f,...r]);!e&&d&&d();const _=await i({projectId:l,blocktags:[...v].join(",")});return _.error?s.error({code:_.error.data.code,message:_.error.data.message}):!e&&c&&(s.success({id:"BLOCK_CREATING_SUCCESS",data:(0,E.x_)(b.data),message:p("The block \u201c")+b.data.title+p("\u201d was successfully created.")}),c()),!e&&m&&m(),b.data},D=({isModalVisible:e,htmlContent:t,projectId:l,setIsShowAddAllBlocksModal:o,setIsShowAddAllBlocksModalForNewEmail:r})=>{const{__:n}=(0,N.s9)(),i=(0,m.wA)(),[c]=v.A.useForm(),[u,p]=(0,a.useState)([]),[g,h]=(0,b.pP)(),{data:C}=(0,b.h1)(),B=(0,E.hN)(),D=(0,L.rD)(),[V,W]=(0,a.useState)([]),{data:j,refetch:z}=(0,d.KC)(),{refetch:H}=(0,b.SB)({projectId:l,pageSize:1e3,page:1,tags:null,name:null,type:null,notEmbed:!0,order:"asc",orderby:"title"}),[G,U]=(0,b.Gr)(),[q,X]=(0,f.OD)();(0,a.useEffect)(()=>{W((0,R._q)(j,P.YY).map(e=>({value:e.name})))},[j]),(0,a.useEffect)(()=>{if(C){const e=C.schema.properties.acf.properties.type.items.enum;let t=[];for(let l in e)t.push({label:n(P.jg[e[l]]),value:e[l]});p(t)}},[C,n]);const $=()=>{i((0,T.Oo)())},Z=()=>{o(!0),r(!1),$()},Y=async()=>{await(async e=>{const{block:t,form:l,projectData:o,projectId:a,addBlock:r,editProject:n,addTag:i,notification:s,__:d,handleCloseModal:c,htmlContent:m,refetch:u,refetchBlocks:p,reloadBlockScreens:g}=e;try{const{valid:e,values:h,blockTags:b}=await F({form:l,notification:s,__:d});if(!e)return;const{tagIds:f,projectTagsArray:E}=await O({blockTags:b,projectData:o,projectId:a,addTag:i,editProject:n,notification:s,__:d});await M({block:t,form:l,projectId:a,htmlContent:m,values:h,tagIds:f,addBlock:r,editProject:n,notification:s,refetch:u,refetchBlocks:p,reloadBlockScreens:g,projectTagsArray:E,__:d,handleCloseModal:c})}catch(h){}})({form:c,projectData:j,projectId:l,addBlock:g,editProject:q,addTag:G,notification:B,__:n,handleCloseModal:$,htmlContent:t,refetch:z,refetchBlocks:H,reloadBlockScreens:I})};return a.createElement(_.A,{title:a.createElement("div",{className:"ant-modal-title"},n("Save block")),className:"blocks-modal",open:e,onOk:()=>Z(),onCancel:$,centered:!0,footer:a.createElement("div",{style:{display:"flex",justifyContent:"space-between",padding:"8px 0"}},a.createElement(s.Ay,{key:"create-all-blocks",size:"large",onClick:Z},n("Save all blocks")),a.createElement(s.Ay,{key:"submit",size:"large",type:"primary",loading:h.isLoading,onClick:Y},a.createElement(x,{className:"modal-new-block__icon-create"}),n("Save block")))},a.createElement(v.A,{form:c,layout:"vertical",name:"add_new_block_form",onFinish:Y,initialValues:{title:"",type:"",tags:[]},autoComplete:"off"},a.createElement(y.A,{gutter:16},a.createElement(A.A,{span:12},a.createElement(v.A.Item,{label:n("Block name"),name:"title",rules:[{required:!0,message:n("Please input block name")}],style:{marginBottom:15}},a.createElement(S.A,{disabled:h.isLoading||U.isLoading||X.isLoading,size:"large",placeholder:n("Enter block name"),spellCheck:"false"}))),a.createElement(A.A,{span:12},a.createElement(v.A.Item,{label:n("Type"),name:"type",rules:[{required:!0,message:n("Please choose block type")}],style:{marginBottom:15}},a.createElement(k.A,{disabled:h.isLoading||U.isLoading||X.isLoading,size:"large",placeholder:n("Choose block type"),options:u})))),D.tagsEnabled&&a.createElement(v.A.Item,{label:n("Tags"),name:"tags"},a.createElement(k.A,{size:"large",mode:"tags",placeholder:n("Add some tags"),tooltip:{title:n("Tags help you find the block in the list."),icon:a.createElement(w.A,null)},disabled:h.isLoading||U.isLoading||X.isLoading,options:V}))))};var V=l(40120),W=l(49856),j=l(13785),z=l(59010),H=l(94674),G=l(85591),U=l.n(G),q=l(79966),X=l(38927),$=l(25488),Z=l(47638),Y=l(40186),K=l(33747),Q=l(92419),J=l(39415),ee=l(61657),te=l(31220),le=l(15804),oe=l(53939),ae=l(99208),re=l(72510),ne=l(52218),ie=l.n(ne),se=l(98845),de=l(83027),ce=l(62093),me=l(12741),ue=l(1047),pe=l(89613),ge=l(86095),he=l(90121),be=l(90614),fe=l(96734),Ee=l(8807),ve=l(15626),_e=l(13668),ye=l(16390);const Ae="NEXT_BUTTON",Se="KEYBOARD",ke=(e,t,l,o,a=!0,r=.8,n)=>`${window.location.host.indexOf("localhost"),"https://scr.emcdn.ru"}/screenshot?delay=1000&width=800${n?"":"&fullPage=true"}&deviceScaleFactor=${r}&format=jpg&clearCache=${a}${o?`&cacheControl=true&cache-hash=${ie()(o)}`:""}&url=${encodeURIComponent(`https://app.emailmaker.ru/get${e}/${l}?secret_hash=${ie()(`${t}${l}${P.KI}`)}&raw=true`)}${n?`&selector=${n}`:""}`,we=(e,t,l=!0,o=.8,a)=>{let r=`https://racs.rest/v3/file/${e}?resource=exportPngApi`;return`${window.location.host.indexOf("localhost"),"https://scr.emcdn.ru"}/screenshot?delay=1000&width=800${a?"":"&fullPage=true"}&deviceScaleFactor=${o}&format=jpg&clearCache=${l}${t?`&cacheControl=true&cache-hash=${ie()(t)}`:""}&url=${encodeURIComponent(`${r}`,`${r}`)}${a?`&selector=${a}`:""}`},Ce=({email:e=null,isEditableRights:t=null,autoSaveEmailResult:l,disabled:o})=>{var r,n;let i=(0,m.wA)(),c=(0,d.Zp)();const{__:u,_x:p}=(0,N.s9)(),{projectId:g,emailId:h}=(0,d.g)(),b=(0,fe.p)(),v=(0,E.hN)(),_=(0,L.rD)(),y=(0,ge.fn)(),A=(0,m.Pj)(),S=(0,m.d4)(ue.rY),k=(0,m.d4)(ue.UI),[w,C]=(0,a.useState)(!1),[B,x]=(0,a.useState)(null);(0,a.useEffect)(()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&x(!0)},[]);const{data:T,refetch:I}=(0,f.fo)(+g,{skip:!+g}),{data:O,refetch:F}=(0,de.Jz)({parent:null===T||void 0===T||null===(r=T.folder)||void 0===r?void 0:r[0]},{skip:!P.EW.isPlugin||!(null!==T&&void 0!==T&&null!==(n=T.folder)&&void 0!==n&&n[0])}),[M]=(0,se.Gr)(),[D]=(0,de.JI)(),[V,z]=(0,se.dN)(),[H,G]=(0,se.Kh)(),[U]=(0,f.OD)(),[q,X]=(0,a.useState)(!1),[$,Z]=(0,a.useState)(""),Y=`project_${g}`,K=T&&(0,R._q)(T,P.zh).find(e=>e.name===Y),Q=T&&(0,R.HT)(T,P.zh),J=(0,be.ml)(ve.AZ.BEFORE_SAVE_EMAIL),ee=(0,pe.u)(),te=(0,a.useCallback)(l=>{var o,a;if(!t&&e.lock&&$)return void v.error({id:"EMAIL_ACCESS_TO_LOCKED_ERROR",data:(0,E.Gy)(e),message:u("No access to edit the letter.")});if(((null===e||void 0===e||null===(o=e.tags)||void 0===o?void 0:o.length)||(null===(a=e.emailtags)||void 0===a?void 0:a.length))>10&&$)return void v.error({id:"EMAIL_TOO_MANY_TAGS_ERROR",data:(0,E.Gy)(e),message:u("Maximum 10 tags available.")});const r=async t=>{var o;const a=Object.entries(S).flatMap(([e,t])=>t.map(({value:t,label:l})=>({id:+t,name:l,parent:+e.split("_")[0]})));let r=[];k.length&&k.forEach(e=>{r.push(...null===e||void 0===e?void 0:e.children.map(e=>({id:e.id,parentId:e.parent})))});const n=(null===(o=e.tags)||void 0===o?void 0:o.map(e=>{const l=null===Q||void 0===Q?void 0:Q.find(t=>t.name===e);return l?l.id:M({name:e,parent:t}).then(({error:t,data:l})=>{var o,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.term_id:l?l.id:void(t&&(v.fromError("TAG_CREATING_ERROR",e,t),X(!1)))})}))||[],s=(null===a||void 0===a?void 0:a.map(e=>{const t=null===r||void 0===r?void 0:r.find(t=>t.id===e.id);return t?t.id:D({name:e.name,parent:e.parent}).then(({error:t,data:l})=>{var o,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.term_id:l?l.id:void(t&&(v.fromError("GROUP_CREATING_ERROR",e,t),X(!1)))})}))||[],d=(e,o=null,a=null,r=[])=>{var n,s;const d=(null===(n=e.title)||void 0===n?void 0:n.trim())||(null===(s=e.subject)||void 0===s?void 0:s.trim())||u("Untitled email."),c=l=>{A.dispatch(de.kE.endpoints.getTags.initiate({parent:t})),!P.EW.isPlugin&&I&&I(),$&&(v.success({id:"EMAIL_SAVING_SUCCESS",message:u("The email was successfully saved."),data:(0,E.Gy)(e)}),X(!1),!P.EW.isPlugin&&O&&F()),P.EW.isPlugin||fetch(ke(P.Tm,g,l.id,l.modified),{mode:"no-cors"}).then(()=>{})},m=(0,R._q)(e,P.zh).filter(t=>(o||e.emailtags).includes(t.id)).map(e=>e.name);var p,h,f,_,S;if(e.isNew){if(G.status!==P.eG){const t=b.get(P.A9.em_folder);H({title:d,source:l,project:e.project,subject:e.subject,preheader:e.preheader,description:e.description,utm_parameters:{utm_source:e.utm_parameters.utm_source,utm_medium:e.utm_parameters.utm_medium,utm_campaign:e.utm_parameters.utm_campaign,utm_term:e.utm_parameters.utm_term,utm_content:e.utm_parameters.utm_content},html:(null===y||void 0===y?void 0:y.getValue())||"",parent_email:e.parent_email||P.iU,common_styles:e.common_styles||"",emailtags:o?o.join(","):e.emailtags,tags:m,group:a||e.group,is_template:e.is_template||!1,is_inited:e.is_inited,renderGuid:e.renderGuid,folder:t!==P.y2&&t}).then(({data:t,error:o})=>{xe.current=!1,o?(l===Ae&&Te(!1),$&&v.fromError("EMAIL_CREATING_ERROR",{title:e.title,code:(null===y||void 0===y?void 0:y.getValue())||""},o),X(!1)):(i((0,me.aY)(null)),c(t),b.remove(P.A9.em_folder))})}}else z.status!==P.eG&&V({emailId:e.id,source:l,title:d,project:e.project,preheader:e.preheader,subject:e.subject,utm_parameters:{utm_source:null===(p=e.utm_parameters)||void 0===p?void 0:p.utm_source,utm_medium:null===(h=e.utm_parameters)||void 0===h?void 0:h.utm_medium,utm_campaign:null===(f=e.utm_parameters)||void 0===f?void 0:f.utm_campaign,utm_term:null===(_=e.utm_parameters)||void 0===_?void 0:_.utm_term,utm_content:null===(S=e.utm_parameters)||void 0===S?void 0:S.utm_content},description:e.description,html:(null===y||void 0===y?void 0:y.getValue())||"",common_styles:e.common_styles||"",emailtags:o||e.emailtags,tags:m,group:a||e.group,is_template:e.is_template||!1}).then(({error:t})=>{xe.current=!1,t?(l===Ae&&Te(!1),$&&v.fromError("EMAIL_EDITING_ERROR",(0,E.Gy)(e),t),X(!1)):c(e)});ee({event:"save",action:l?"save_email":"auto_save_email",email_id:e.id,project_id:g})},c={...e};J.fire(c).finally(()=>{n.length||s.length?Promise.all(n).then(e=>{Promise.all(s).then(t=>{d(c,e,t,[])})}):d(c,null,null,[])})};X(!0),K?r(K.id):M({name:Y}).then(async({data:t,error:l})=>{if(l)v.fromError("FOLDER_CREATING_ERROR",Y,l),X(!1);else{const{data:l,error:o}=await U({projectId:g,emailtags:t.id});o?(v.fromError("EMAIL_CLONING_ERROR",(0,E.Gy)(e),o),X(!1)):l&&r(l.emailtags&&l.emailtags[0])}}).catch(e=>{})},[G.status,H,z.status,V,e,t,M,i,U,g,T,u,p,$,y,Q,J]);(0,he.D3)(_e.Kp,(0,a.useCallback)(e=>te(e||"EXTERNAL"),[te]));const le=(0,be.ml)(ve.AZ.ON_NEXTBUTTON_CLICK_ID),oe=(0,be.ml)(ve.AZ.ON_SAVEBUTTON_CLICK_ID);(0,a.useEffect)(()=>{$&&(setTimeout(()=>te($)),Z(""))},[$]);const ae=(0,a.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),Z(Se))},[te]);(0,a.useEffect)(()=>(document.addEventListener("keydown",ae),()=>{document.removeEventListener("keydown",ae)}),[ae]);const re=(0,a.useCallback)(e=>{const t=e.data.operation,l=e.data.action;t===P.Ru.APPLICATION_ACTION&&"save_email"===l&&Z(Se)},[te]);(0,ce.A)(re),(0,a.useEffect)(()=>{e.isNew&&G.isSuccess&&(X(!0),i(se.GY.util.upsertQueryData("getEmail",G.data.id,{...G.data,lock:e.lock,isAmp:e.isAmp,subject:e.subject,preheader:e.preheader,description:e.description,html:(null===y||void 0===y?void 0:y.getValue())||"",project:e.project,tags:e.tags,utm_parameters:e.utm_parameters,parent_email:e.parent_email,common_styles:e.common_styles,renderGuid:e.renderGuid,is_inited:e.is_inited,isNew:!1})).then(()=>{c(`/projects/${G.data.project}/emails/${G.data.id}`),X(!1),$&&v.success({id:"EMAIL_SAVING_SUCCESS",message:u("The email was successfully saved."),data:(0,E.Gy)(e)})}))},[c,i,G,e.isNew,u,p,$,y]);const ne=(0,be._q)(ve.AZ.ON_EMAIL_INIT_ID);(0,a.useEffect)(()=>{let e=0;const t=ne(()=>{e=setTimeout(()=>C(!0),1e4)});return()=>{e&&clearTimeout(e),t.dispose()}},[C,ne]),(0,a.useEffect)(()=>{e.isNew&&!h&&w&&(te(),C(!1))},[w,e,te,h]);const ie=z.isLoading||(null===U||void 0===U?void 0:U.isLoading)||G.isLoading||q||l&&l.isLoading,we=_.saveButtonEnabled&&a.createElement(j.A,{key:"save-button",title:u(B?"Save by \u2318S":"Save by Ctrl+S"),placement:"bottom"},a.createElement(s.Ay,{disabled:o,type:_.nextButtonEnabled?"default":"primary",block:"false",className:"em-analytics__email-save",loading:ie,icon:a.createElement(Ee.A,{icon:"SaveOutlined",size:16,strokeWidth:_.iconStrokeWidth}),onClick:async()=>{const t={...e,html:y.getValue()};try{!1!==await oe.fire(t)&&Z("SAVE_BUTTON")}catch(l){v.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",(0,E.Gy)(t),l,!0)}}},_.saveButtonText||u("Save"))),Ce=!1!==_.disableDoubleClickNextButton,Be=!1===_.activeNextButton,xe=(0,a.useRef)(!1),Te=e=>{i((0,ye.wj)(!e))},Re=_.nextButtonEnabled&&a.createElement(s.Ay,{disabled:o||Be,key:"next-button",type:"primary",block:"false",className:"em-analytics__email-save",icon:_.primaryCommandButtonIcon,loading:ie,onClick:async()=>{if(xe.current)return;xe.current=!0;const t={...e,html:y.getValue()};try{Ce&&Te(!0),(await le.fire(t)).every(e=>!1!==e)?Z(Ae):(Te(!1),xe.current=!1)}catch(l){v.fromError("NEXT_BUTTON_CLICK_EVENT_ERROR",(0,E.Gy)(t),l,!0),Te(!1),xe.current=!1}}},_.nextButtonText||u("Continue"));return a.createElement(a.Fragment,null,_.saveButtonEnabled&&_.nextButtonEnabled?a.createElement(W.A,null,[we,Re]):[we,Re])};var Be=l(40409),xe=l(45271),Te=l(47014),Re=l(84572),Ne=l(23424),Le=l(38251),Ie=l(30397),Pe=l(64706),Oe=l(92960),Fe=l(40835),Me=l(80223),De=l(99152),Ve=l(71854),We=l(22560),je=l(634),ze=l(47904);const He=({email:e,autoSaveEmailResult:t,autoSaveBlockResult:l})=>{var o,r,i,c,u,p,g,h;const{__:b,_x:f}=(0,N.s9)(),v=(0,m.wA)(),[_]=(0,Oe.mI)(),[y]=(0,Fe.dS)();let A=(0,d.Zp)();const{owner:S,admin:k}=(0,Me.A)(),w=(0,m.d4)(Te.C1),C=(0,m.d4)(Re.yN),{modal:B}=n.A.useApp(),x=(0,E.hN)(),{confirm:I}=B,O=(0,m.Pj)(),F=(0,fe.p)(),M=(0,L.rD)(),{projectId:D}=(0,d.g)(),V=(0,be.ml)(ve.AZ.ON_EMAIL_CLONE_ID),[z]=(0,Ie.N)(),H=(0,pe.u)(),[G,U]=(0,a.useState)(!0),[q]=se.GY.useDeleteEmailMutation(),[ne,ie]=(0,se.Kh)(),[ce]=(0,Le.ri)(),[me]=(0,Le.cA)(),[he]=(0,Pe.m)(),{data:_e}=(0,d.KC)(),{data:ye,refetch:Ae}=(0,de.Jz)({parent:null===_e||void 0===_e||null===(o=_e.folder)||void 0===o?void 0:o[0]},{skip:!(null!==_e&&void 0!==_e&&null!==(r=_e.folder)&&void 0!==r&&r[0])}),Se=(0,m.d4)(T.Wv);(0,a.useEffect)(()=>{Se.switched&&U(!1)},[Se]);const ke=()=>null===e.title?b("New email title"):e.title,He=(0,ge.fn)(),Ge=(0,be._q)(ve.AZ.ON_EMAIL_INIT_ID);(0,a.useEffect)(()=>{const e=Ge(()=>{U(!1)});return()=>e.dispose()},[Ge]);const Ue=async(t,l=(null===He||void 0===He?void 0:He.getValue())||"")=>{const o=document.querySelector(".email-preview"),a=getComputedStyle(o);return l=await(0,De.PJ)(l,[a.width],e.utm_parameters,async e=>{$e(e)}),ce({file:l,title:ke(),notification:x}).unwrap().then(e=>{const l={id:e._id,...e};return t(l,()=>me({id:l.id,notification:x}))}).catch(e=>{var t,l;x.error({message:null===(t=e.data)||void 0===t?void 0:t.code,description:null===(l=e.data)||void 0===l?void 0:l.message})})},qe=(e=1)=>((e=1)=>Ue((t,l)=>({href:we(t.id,void 0,!1,e),dispose:l})))(e).then(({href:e,dispose:t})=>(0,De.SR)(e).finally(t)),Xe=async e=>{const t=e.document.querySelectorAll("[em-operation=exportAsPicture]"),l=new Map;for(let o=0,a=t.length;o<a;o++){const e=t[o];e.setAttribute("em-export-id",String(o)),l.set(`[em-export-id='${o}']`,e)}l.size&&e.handleRender(async({contentDocument:e,managedNodeController:t})=>{try{const{data:a,dispose:r}=await((e,t,l=2)=>Ue((t,o)=>({data:e.map(e=>({selector:e,href:we(t.id,void 0,!1,l,e)})),dispose:o}),t))([...l.keys()],(0,re.b6)(e),2);try{const e=a.map(async({href:e,selector:o},a)=>{const r=l.get(o);if("TD"===r.tagName){r.removeAttribute("style");for(const e of[...r.classList])e.startsWith("em-mob-")&&r.classList.remove(e)}t.commit();const n=await(async(e,t)=>{var l;const o="string"===typeof e?null===(l=await _({url:e}))||void 0===l?void 0:l.data:e;if(t.split(".").length<2){const e=Z.extension(o.type);e&&(t=`${t}.${e}`)}const a=new File([o],t.toLowerCase());try{var r;const e=null===(r=(await y({user_id:w.id,folder:String(_e.id),file:a}).unwrap()).data)||void 0===r?void 0:r[0];if(e&&400!==e.status)return e.file_url}catch(n){}return"string"===typeof e?e:""})(e,`${a}-${r.tagName.toLowerCase()}.png`),i=parseInt(getComputedStyle(r).width);let s=new Image(i);s.setAttribute("border","0"),s.setAttribute("style",`display: block; width: 100%; max-width: ${i}px;`),s.alt="",s.src=n;const d=r.querySelector("a");if(d){const e=document.createElement("a");e.setAttribute("target","_blank"),e.setAttribute("href",d.getAttribute("href")),e.appendChild(s),s=e}if("TD"===r.tagName){const e=r.cloneNode();e.removeAttribute("em-operation"),e.appendChild(s),s=e}r.replaceWith(s),t.commit()});await Promise.all(e)}catch(o){}finally{r()}}catch(o){}})},$e=t=>{var l,o;const a=t.document;if("0"===(null===_e||void 0===_e||null===(l=_e.limits)||void 0===l?void 0:l.preview_limit)&&D&&(null===w||void 0===w||null===(o=w.counters)||void 0===o?void 0:o.emails_counter)>2&&!a.querySelector(".em-powered-logo")){const t="https://emcdn.ru/emailmaker/powered.png",l="https%3A%2F%2Femailmaker.ru",o=`<a href="${`https://racs.rest/v3/link?app=emailmaker&project=${D}&email=${e.id}&link=${l}`}" target="_blank"><img src="https://racs.rest/v3/pixel/123.png?image=${t}&project=${D}&email=${e.id}" width="150" height="50" border="0" alt="" style="display: inline-block; width: 100%; max-width: 150px;"></a>`;a.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child")&&a.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child").insertAdjacentHTML("afterend",`<tr em="block" class="em-powered-logo">\n <td align="center" bgcolor="#FFFFFF">${o}</td>\n </tr>`)}},Ze=t=>{H({event:"click",action:"export_email",export_type:"HTML"});const l=document.querySelector(".email-preview"),o=getComputedStyle(l);(0,De.PJ)(null===He||void 0===He?void 0:He.getValue(),[o.width],e.utm_parameters,async e=>{await Xe(e),$e(e),await(0,We.e)(e,t)}).then(e=>{const t=new Blob([e],{type:"text/html;charset=utf-8"});(0,ae.saveAs)(t,`${ke()}.html`)}).catch(e=>{})},Ye=t=>{H({event:"click",action:"export_email",export_type:"TEXT"});const l=document.querySelector(".email-preview"),o=getComputedStyle(l);(0,De.PJ)(null===He||void 0===He?void 0:He.getValue(),[o.width],e.utm_parameters,async e=>{await Xe(e),$e(e),await(0,We.e)(e,t),e.handleReadHtml(e=>{e.html=(0,je.G9)(e.contentDocument,ze.l)})}).then(e=>{const t=new Blob([e],{type:"text/plain;charset=utf-8"});(0,ae.saveAs)(t,`${ke()}.txt`)}).catch(e=>{})},Ke=t=>{H({event:"click",action:"export_email",export_type:"Clipboard"});const l=document.querySelector(".email-preview"),o=getComputedStyle(l);(0,De.PJ)(null===He||void 0===He?void 0:He.getValue(),[o.width],e.utm_parameters,async e=>{await Xe(e),$e(e),await(0,We.e)(e,t)}).then(e=>navigator.clipboard.writeText(e).then(function(){x.success(b("The email has been copied to the clipboard."))})).catch(e=>{})},Qe=t=>{if(C.webhook){H({event:"click",action:"export_email",export_type:"webhook"});const l=document.querySelector(".email-preview"),o=getComputedStyle(l);(0,De.PJ)(null===He||void 0===He?void 0:He.getValue(),[o.width],e.utm_parameters,async e=>{await Xe(e),$e(e),await(0,We.e)(e,t)}).then(t=>{z({url:C.webhook,body:(0,$.E)({...e,code:t},O)}).unwrap().then(e=>{x.success({message:b("Success!"),description:b("Webhook successfully sent!")})}).catch(e=>{200===e.originalStatus?x.success({message:b("Success!"),description:b("Webhook successfully sent!")}):x.error({message:e.status,description:e.error})})})}else v((0,Ne.YF)("webhooksettings")),v((0,Ne.qf)(P.lx.EDIT_PROJECT_MODAL))},Je=e=>new Promise((t,l)=>{fetch(e).then(e=>t(e.blob()),()=>(e=>{const t=F.get(P.A9.em_token);return fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(e)}`,{headers:{authorization:`Bearer ${t}`}}).then(e=>e.blob())})(e).then(t,l)).catch(()=>{})}),et=()=>{e.isNew?(P.EW.isPlugin||A(`/projects/${_e.id}/emails`),x.success(b("The draft of the email has been deleted."))):tt(e,A)},tt=(e,t)=>{I({maskClosable:!0,centered:!0,title:f("Are you sure to delete \u201c","email")+e.title+b("\u201d email?"),icon:a.createElement(Y.A,{style:{color:"#ff4d4f"}}),okText:b("Yes"),cancelText:b("No"),onOk:()=>(async(e,t)=>{try{const l=await q(e.id).unwrap();e.project&&!P.EW.isPlugin&&t(`/projects/${e.project}/emails`),x.success(b("The email \u201c")+l.title+f("\u201d was successfully removed.","email"))}catch(l){x.error(l)}})(e,t)})},lt=()=>{(0,Ve.QM)("application/zip, message/rfc822, text/html",ot)},ot=async e=>{const t=e[0];try{v((0,T.M7)(!0));const e=(0,Ve.xi)(_,y,w,_e),l=(0,Ve.oF)(t),o=await(0,Ve.q2)(t,e,l),[a]=(0,De.Ay)(t.name.replaceAll("&nbsp;"," ")),r=a||(0,R.ez)(o)||"";He.pushEditOperations([],[{range:He.getFullModelRange(),text:o}],()=>null),v((0,ue.VK)(r)),v((0,T.M7)(!1))}catch(l){v((0,T.M7)(!1));const e=l instanceof Error?l.message:l;x.error({message:e})}H({event:"upload_file",action:"import_email"})};let at=[];M.emailDropdownMenuClone&&at.push({label:b("Clone"),icon:a.createElement(Ee.A,{icon:"CopyOutlined",size:16,strokeWidth:M.iconStrokeWidth}),key:"Clone",className:"em-analytics__email-clone",disabled:ie.isLoading,onClick:async()=>{if(e.isNew)x.warning({message:b("To create a copy, you need to save the email.")});else{var t,l,o,a,r;if((await V.fire(e)).some(e=>!1===e))return;ne({title:(0,R.fq)(e.title),project:null===_e||void 0===_e?void 0:_e.id,description:e.description,html:(0,R.el)((null===He||void 0===He?void 0:He.getValue())||"",e.title),parent_email:e.parent_email||P.iU,common_styles:e.common_styles||"",utm_parameters:{utm_source:null===(t=e.utm_parameters)||void 0===t?void 0:t.utm_source,utm_medium:null===(l=e.utm_parameters)||void 0===l?void 0:l.utm_medium,utm_campaign:null===(o=e.utm_parameters)||void 0===o?void 0:o.utm_campaign,utm_term:null===(a=e.utm_parameters)||void 0===a?void 0:a.utm_term,utm_content:null===(r=e.utm_parameters)||void 0===r?void 0:r.utm_content},emailtags:e.emailtags,folder:e.folder}).unwrap().then(t=>{A(`/projects/${_e.id}/emails/${t.id}`),x.success({message:b("The copy of email \u201c")+e.title+b("\u201d was successfully created.")}),ye&&Ae()}).catch(e=>{x.error({message:e.data.code,description:e.data.message})})}}}),M.emailDropdownMenuImport&&at.push({label:f("Import","verb"),icon:a.createElement(Ee.A,{icon:"CloudUploadOutlined",size:16,strokeWidth:M.iconStrokeWidth}),key:"Import",className:"em-analytics__editor-page__import",onClick:()=>{H({event:"click",action:"import_email"}),lt()}}),(S||k||(null===(i=w.id)||void 0===i?void 0:i.toString())===(null===(c=e.author)||void 0===c?void 0:c.toString()))&&(M.emailDropdownMenuLock&&at.push({label:a.createElement(xe.A,{key:"Lock",element:e}),icon:e.lock?a.createElement(Ee.A,{icon:"UnLock",size:16,strokeWidth:M.iconStrokeWidth}):a.createElement(Ee.A,{icon:"Lock",size:16,strokeWidth:M.iconStrokeWidth}),disabled:e.isNew}),M.emailDropdownMenuRemove&&at.push({label:b("Remove"),icon:a.createElement(Ee.A,{icon:"DeleteOutlined",size:16,strokeWidth:M.iconStrokeWidth}),key:"Remove",className:"em-analytics__email-remove",style:{color:"#ff4d4f"},onClick:et}));const rt=e.isAmp;let nt=[];return M.exportHtmlEnabled&&nt.push({key:"html",label:b("Code"),icon:a.createElement(K.A,{style:{fontSize:"16px"}}),...rt?{children:[{key:"\u0441ode_html",label:b("AMP"),onClick:()=>Ze("amp")},{key:"html_amp",label:b("HTML"),onClick:()=>Ze("html")}]}:{onClick:()=>Ze()}}),M.exportZipEnabled&&nt.push({key:"zip",label:b("ZIP"),icon:a.createElement(Q.A,{style:{fontSize:"16px"}}),onClick:()=>(async()=>{H({event:"click",action:"export_email",export_type:"ZIP"});const t=document.querySelector(".email-preview"),l=getComputedStyle(t),o=null===He||void 0===He?void 0:He.getValue(),a=await(0,De.Ce)(o,[l.width,void 0],e.utm_parameters,Je,async e=>{await Xe(e),$e(e),rt&&await(0,We.e)(e,"html")});rt&&(a["amp.html"]=await(0,De.PJ)(o,[l.width],e.utm_parameters,async e=>{await Xe(e),$e(e),await(0,We.e)(e,"amp")}));const r=await(0,De.hs)(a);(0,ae.saveAs)(r,`${ke()}.zip`)})().catch(e=>{})}),M.exportClipboardEnabled&&nt.push({key:"clipboard",label:b("Clipboard"),icon:a.createElement(J.A,{style:{fontSize:"16px"}}),...rt?{children:[{key:"clipboard_html",label:b("AMP"),onClick:()=>Ke("amp")},{key:"clipboard_amp",label:b("HTML"),onClick:()=>Ke("html")}]}:{onClick:()=>Ke()}}),M.exportTextEnabled&&nt.push({key:"text",label:b("Text"),icon:a.createElement(ee.A,{style:{fontSize:"16px"}}),...rt?{children:[{key:"\u0441ode_txt",label:b("AMP"),onClick:()=>Ye("amp")},{key:"html_txt",label:b("HTML"),onClick:()=>Ye("html")}]}:{onClick:()=>Ye()}}),!P.EW.isPlugin&&M.exportWebHookEnabled&&nt.push({key:"webhook",icon:a.createElement(Ee.A,{icon:"WebHook",style:{fontSize:"16px"}}),label:b("Webhook"),...rt?{children:[{key:"webhook_html",label:b("AMP"),onClick:()=>Qe("amp")},{key:"webhook_amp",label:b("HTML"),onClick:()=>Qe("html")}]}:{onClick:()=>Qe()}}),M.exportOutlookEnabled&&nt.push({key:"outlook",icon:a.createElement(te.A,{style:{fontSize:"16px"}}),label:b("Outlook"),onClick:()=>(t=>{H({event:"click",action:"export_email",export_type:"Outlook"});const l=document.querySelector(".email-preview"),o=getComputedStyle(l),a=async(e,t)=>{e.document,(0,We.e)(e,t),await Xe(e),$e(e)};(0,De.pH)(e.title,null===He||void 0===He?void 0:He.getValue(),[o.width,o.height],e.utm_parameters,t?e=>a(e,"html"):e=>a(e)).then(e=>{const t=new Blob([e],{type:"text/html;charset=utf-8"});(0,ae.saveAs)(t,`${ke()}.eml`)}).catch(e=>{})})(rt)}),M.exportPdfEnabled&&nt.push({key:"pdf",icon:a.createElement(le.A,{style:{fontSize:"16px"}}),label:b("PDF"),onClick:async()=>{try{const t=document.querySelector(".email-preview"),l=getComputedStyle(t),o=await(0,De.PJ)(He.getValue(),[l.width],e.utm_parameters,async e=>{$e(e)}),a=await he({htmlContent:o,notification:x}).unwrap(),r=window.URL.createObjectURL(new Blob([a],{type:"application/pdf"})),n=document.createElement("a");n.href=r,n.setAttribute("download",`${ke()}.pdf`),document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(r)}catch(t){}}}),M.exportPngEnabled&&nt.push({key:"img",icon:a.createElement(oe.A,{style:{fontSize:"16px"}}),label:b("PNG"),onClick:()=>qe(1).then(De.gZ).then(e=>(0,ae.saveAs)(e,`${ke()}.png`)).then(()=>H({event:"click",action:"export_email",export_type:"Image"}))}),a.createElement(W.A,null,M.emailDropdownMenuEnabled?a.createElement(X.A,{key:"Actions",arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:at}},a.createElement(s.Ay,{type:"default",block:!1,className:"email-page-header__btn email-page-header__btn_extra",onClick:()=>{}},a.createElement(Ee.A,{icon:"DotsHoriz",size:18,strokeWidth:M.iconStrokeWidth}))):M.emailDropdownMenuImport&&a.createElement(j.A,{title:f("Import","verb"),placement:"bottom"},M.emailDropdownMenuImportButton?a.createElement(s.Ay,{className:"em-analytics__editor-page__import",icon:a.createElement(Ee.A,{icon:"CloudUploadOutlined",size:16,strokeWidth:M.iconStrokeWidth}),onClick:()=>{H({event:"click",action:"import_email"}),lt()}},b("Import")):a.createElement(s.Ay,{className:"em-analytics__editor-page__import",type:"text",icon:a.createElement(Ee.A,{icon:"CloudUploadOutlined",size:22,strokeWidth:M.iconStrokeWidth}),onClick:()=>{H({event:"click",action:"import_email"}),lt()}})),M.emailExportEnabled&&a.createElement(X.A,{key:"Export",arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:nt}},a.createElement(s.Ay,{key:"Export",className:"em-analytics__email-page__export",type:"default",icon:a.createElement(Ee.A,{icon:"CloudDownloadOutlined",size:16,strokeWidth:M.iconStrokeWidth})},b("Export"))),!e.hasOwnProperty("type")&&a.createElement(Ce,{disabled:G,autoSaveEmailResult:t,key:"Save",email:e,isEditableRights:S||k||(null===(u=w.id)||void 0===u?void 0:u.toString())===(null===(p=e.author)||void 0===p?void 0:p.toString())}),!!e.hasOwnProperty("type")&&a.createElement(Be.A,{disabled:G,rightCol:void 0,key:"Save",block:e,isEditableRights:S||k||(null===(g=w.id)||void 0===g?void 0:g.toString())===(null===(h=e.author)||void 0===h?void 0:h.toString()),autoSaveBlockResult:l}))};var Ge=l(35895),Ue=l(54125),qe=l(52919),Xe=l(22536),$e=l(73180);const{useToken:Ze}=V.A,Ye=({email:e,autoSaveEmailResult:t,isCollaborationEditor:l})=>{var o,r;const[n]=v.A.useForm(),{__:i}=(0,N.s9)();let c=(0,m.wA)(),u=(0,d.Zp)();const p=(0,m.d4)(Te.C1),g=(0,qe.QC)(),h=(0,d.KC)(),b=null===h||void 0===h?void 0:h.data,{owner:f,admin:E}=(0,Me.A)(),{token:_}=Ze(),y=(0,L.rD)(),A=(0,a.useRef)(),k=(0,a.useRef)(),w=(0,a.useRef)(),C=(0,be.ml)(ve.AZ.ON_PREVIOUSBUTTON_CLICK_ID),B=(0,be.ml)(ve.AZ.ON_PREHEADER_CHANGED_ID),x=(0,be.ml)(ve.AZ.ON_SUBJECT_CHANGED_ID),I=(0,m.d4)(T.yy),O=e.hasOwnProperty("type")?P.IE:P.Tm,F=(0,m.d4)(ue.qX),M=(0,m.d4)(Xe.qX),D=O===P.Tm?F:M,V=(0,m.d4)(T.Fv),[G,X]=(0,a.useState)(!1);(0,a.useEffect)(()=>{const e=!(null===D||void 0===D||!D.type)&&((null===D||void 0===D?void 0:D.type)===P.bV.TEXT||(null===D||void 0===D?void 0:D.type)===P.bV.LINK||D.type===P.bV.BUTTON)&&V&&"bottom"!==I;X(e),c((0,T.oF)(e))},[D,I,V]);const $=(0,a.useCallback)(()=>{var t;P.EW.isPlugin?C.fire(e):u(`/projects/${b.id}/emails?page=1&folder=${(null===(t=e.folder)||void 0===t?void 0:t[0])||P.y2}`)},[u,C,e,null===b||void 0===b?void 0:b.id]),[Z,Y]=(0,a.useState)(),K=(0,be._q)(ve.AZ.WILL_EMAIL_INIT_ID),Q=(0,be._q)(ve.AZ.ON_EMAIL_INIT_ID);(0,$e.ZC)(([t])=>{Z&&t!==e.subject&&x.fire(e.subject)},[e.subject,Z]);const J=(0,a.useCallback)(e=>{const t=e.target.value;x.fire(t)},[x]),ee=(0,a.useCallback)(e=>{const t=e.target.value;B.fire(t)},[B]);(0,$e.ZC)(([t])=>{Z&&t!==e.preheader&&B.fire(e.preheader)},[e.preheader,Z]),(0,a.useEffect)(()=>{const e=new R.jG;return e.addDisposable(K(()=>Y(!1))),e.addDisposable(Q(e=>{Y(!0);const t=n.getFieldValue("subject");e.subject&&e.subject!==t&&n.setFieldValue("subject",e.subject);const l=n.getFieldValue("preheader");e.preheader&&e.preheader!==l&&n.setFieldValue("preheader",e.preheader)})),()=>e.dispose()},[Y,K,Q,n]);const te=(0,a.useCallback)(t=>{const l=t.target.value.trim();e.isNew?c((0,me.TU)(l)):c((0,ue.HO)(l)),g.send(P.Ru.SANDBOX_SUBJECT_UPDATE,{value:l,guid:e.renderGuid})},[g,e.renderGuid,c,e.isNew]),le=(0,be._q)(ve.AZ.BEFORE_SAVE_EMAIL),oe=(0,a.useCallback)(async e=>{var t,l;const o=null===(t=k.current)||void 0===t?void 0:t.input;if(document.activeElement===o){const t=o.value.trim();t!==e.subject&&(e.subject=t,e.isNew?c((0,me.TU)(t)):c((0,ue.HO)(t)),await g.sendAsync(P.Ru.SANDBOX_SUBJECT_UPDATE,{value:t,guid:e.renderGuid}))}const a=null===(l=w.current)||void 0===l?void 0:l.input;if(document.activeElement===a){const t=a.value.trim();t!==e.preheader&&(e.preheader=t,e.isNew?c((0,me.x3)(t)):c((0,ue.pl)(t)),await g.sendAsync(P.Ru.SANDBOX_PREHEADER_UPDATE,{value:t,guid:e.renderGuid}))}},[g,c]);(0,a.useEffect)(()=>{const e=le(oe);return()=>e.dispose()},[le,oe]);const ae=(0,a.useCallback)(t=>{const l=t.target.value.trim();e.isNew?c((0,me.x3)(l)):c((0,ue.pl)(l)),g.send(P.Ru.SANDBOX_PREHEADER_UPDATE,{value:l,guid:e.renderGuid})},[g,e.renderGuid,c,e.isNew]),re=e.isNew;(0,a.useEffect)(()=>{const t=new R.jG;return t.addDisposable(g.addListenerAsync(P.Ru.APPLICATION_SUBJECT_UPDATE,({guid:t,value:l})=>{t===e.renderGuid&&(n.setFieldValue("subject",l),c(re?(0,me.TU)(l):(0,ue.HO)(l)))})),t.addDisposable(g.addListenerAsync(P.Ru.APPLICATION_PREHEADER_UPDATE,({guid:t,value:l})=>{t===e.renderGuid&&(n.setFieldValue("preheader",l),c(re?(0,me.x3)(l):(0,ue.pl)(l)))})),()=>t.dispose()},[g,c,re,n,e.renderGuid]),(0,Ue.A)(null===e.title?i("New email title"):e.title);const ne=(0,a.useCallback)(()=>{c((0,T.PM)(P.z$)),setTimeout(()=>{const e=document.querySelector('li.ai-response-change-context[role="theme-and-preheader-generator"]');e&&e.click()},100)},[c]),ie=a.createElement(a.Fragment,null,a.createElement(W.A,{ref:A,size:10},y.headerArrowBackVisible&&a.createElement(j.A,{title:i("Back"),placement:"left"},a.createElement(s.Ay,{type:"text",icon:a.createElement(Ee.A,{icon:"ArrowLeftOutlined",size:22,strokeWidth:y.iconStrokeWidth}),onClick:$,shape:"circle"})),a.createElement("div",null,(y.headerTitleVisible||y.headerPreheaderVisible)&&a.createElement(v.A,{form:n,layout:"vertical",name:"subject_preheader_form",autoComplete:"off",initialValues:{subject:"",preheader:""}},y.headerTitleVisible&&a.createElement("div",{style:{marginTop:Z?-3:0}},a.createElement(W.A,{style:{width:"100%"},align:"baseline",size:12},a.createElement("div",{className:"subject_preheader_form__title"},i("Subject")),Z?a.createElement("div",{className:"ant-page-header-heading"},a.createElement(v.A.Item,{name:"subject",style:{marginBottom:0}},a.createElement(S.A,{className:"ant-page-header-heading-title",ref:k,placeholder:i("Enter subject line here"),variant:"borderless",onChange:J,onPressEnter:te,onBlur:e=>{te(e),document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.add("focus")},disabled:y.lockPreheaderAndTitle})),a.createElement(Ee.A,{icon:"AI",size:12,strokeWidth:y.iconStrokeWidth,onClick:ne,style:{cursor:"pointer"}})):a.createElement(z.A.Input,{active:!0,size:16,style:{width:"40%",marginTop:3}}))),y.headerPreheaderVisible&&a.createElement("div",null,a.createElement(W.A,{style:{width:"100%"},align:"baseline",size:12},a.createElement("div",{className:"subject_preheader_form__title"},i("Preheader")),Z?a.createElement("div",{className:"ant-page-header-heading ant-page-header-heading_preheader"},a.createElement(v.A.Item,{name:"preheader",style:{marginBottom:0}},a.createElement(S.A,{className:"ant-page-header-heading-preheader",ref:w,placeholder:i("Enter preheader here"),variant:"borderless",onChange:ee,onPressEnter:ae,onBlur:e=>{ae(e),document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.add("focus")},disabled:y.lockPreheaderAndTitle})),a.createElement(Ee.A,{icon:"AI",size:12,strokeWidth:y.iconStrokeWidth,onClick:ne,style:{cursor:"pointer"}})):a.createElement(z.A.Input,{active:!0,size:16,style:{width:"80%",marginTop:2}}))))))),se=a.createElement(a.Fragment,null,y.emailIdShow&&!!e.id&&a.createElement(a.Fragment,null,a.createElement("div",{className:"email-page-header__email-id"},"ID"+e.id),a.createElement(H.A,{type:"vertical"})),a.createElement(q.A,{emailElement:e,isCollaborationEditor:l}),y.commandButtonsEnabled&&a.createElement(a.Fragment,null,e.lock?a.createElement(Ee.A,{icon:"Lock",size:18,strokeWidth:y.iconStrokeWidth,key:"Lock",className:U()("lock-icon",{"lock-icon__disabled":!(f||E||(null===(o=p.id)||void 0===o?void 0:o.toString())===(null===(r=e.author)||void 0===r?void 0:r.toString()))}),style:{color:_.colorPrimary,verticalAlign:"sub"}}):null,a.createElement(He,{key:"Buttons",email:e,autoSaveEmailResult:t,isHeaderCodeMenuOpen:G})));return a.createElement(Ge.A,{className:"email-pane__header",leftBlock:ie,rightBlock:se,isHeaderCodeMenuOpen:G})};var Ke=l(98447),Qe=l(38826),Je=l(18987),et=l(12352);const tt=["Menu","Header","Content","Banners","Lists","Buttons","Promocodes","Feature","Call to Action","E-Commerce","Articles","Polls","Applications","Separators","Contacts","Footer","Other"];async function lt(e,t,l,o,a){const r={blocks:o,types:tt,locale:t};l.current=r;try{const e=await async function(e){return P.EW.isPlugin?await e.getInstance(et.Y):Je.A.get(P.A9.em_token)||null}(a),t=await fetch("https://app.emailmaker.ru/api/wp-json/ai-generator/v1/identificate_blocks",{method:"POST",headers:{"Content-Type":"application/json",...e?{Authorization:`Bearer ${e}`}:{}},body:JSON.stringify(r)});if(!t.ok||200!==t.status)throw new Error(`${t.statusText}`);return await t.json()}catch(n){throw n}}const ot=(e,t="block",l=!1)=>{if(null===e||void 0===e||!e.html)return[];const{document:o,blockElements:a,styleElement:r,linksElements:n}=((e,t="block")=>{const l=new DOMParser,o=l.parseFromString(e,"text/html"),a=o.querySelectorAll(`[em="${t}"]`),r=o.querySelectorAll("link"),n=o.querySelector('[em="styles"]');return{parser:l,document:o,blockElements:a,styleElement:n,linksElements:r}})(e.html,t),i=function(e){return Array.from(e).map(e=>e.outerHTML).join("")}(n);if(!(a instanceof NodeList))return[];const s=o.querySelector("head"),d=s?s.innerHTML:"";return Array.from(a).map((t,o)=>{if(!(t instanceof Element)||!t.outerHTML)return null;const a=r?r.outerHTML:"";return{id:`${e.id}-${o}`,html:l?`<!DOCTYPE html>\n <html>\n <head>${d}</head>\n <body>\n <table>${t.outerHTML}</table>\n </body>\n </html>`:(n=`${i}${a}${t.outerHTML.replace(/class="em-structure"/,'class=""')}`,n.replace(/\s+/g," ").replace(/> </g,"><").replace(/\s+>/g,">").replace(/<\!--[\s\S]*?-->/g,"").trim())};var n}).filter(Boolean)};const at=e=>e.replace(/<div\s+[^>]*style="font-family:[^>]*>(.*?)<\/div>/gs,e=>e.replace(/>(.*?)<\/div>/s,"></div>")),rt=e=>e.replace(/src="[^"]*"/g,'src=""'),nt=e=>/<div\s+[^>]*style="font-family:/i.test(e),it=async e=>{const{block:t,form:l,projectData:o,projectId:a,addBlock:r,editProject:n,addTag:i,notification:s,__:d,handleCloseModal:c,htmlContent:m,refetch:u,refetchBlocks:p,reloadBlockScreens:g,values:h,tagIds:b,projectTagsArray:f}=e;try{await M({block:t,form:l,projectId:a,htmlContent:m,values:h,tagIds:b,addBlock:r,editProject:n,notification:s,refetch:u,refetchBlocks:p,reloadBlockScreens:g,projectTagsArray:f,__:d,handleCloseModal:c})}catch(E){throw E}};var st=l(80148);const dt=({isModalVisible:e,currentEmail:t,setIsShowAddAllBlocksModal:l,setTriggerOpenSavedBlocksTab:o,projectId:r})=>{const{__:n,_x:i,_n:c}=(0,N.s9)(),u=(0,st.NF)(),{data:p,refetch:g}=(0,d.KC)(),[h,y]=(0,a.useState)(!1),[A]=v.A.useForm(),[S,w]=(0,a.useState)([]),[C,B]=(0,a.useState)([]),x=(0,a.useRef)({}),[T]=(0,b.Gr)(),[L]=(0,f.OD)(),[M,D]=(0,b.pP)(),V=(0,m.d4)(Te.B)||(P.EW.isPlugin?void 0:"ru_RU"),W=(e=>{const t=new Set,l=[];for(const o of e)if(nt(o.html)){const e=rt(at(o.html));t.has(e)||(t.add(e),l.push(o))}else l.push(o);return l})(ot(t)).map(e=>e),j=W.length,z=(0,E.hN)(),H=()=>{h||U||l(!1)},{bulkSave:G,confirmSavingBlocksLoading:U}=(({projectData:e,addTag:t,addBlock:l,editProject:o,refetch:r,reloadBlockScreens:n,notification:i,__:s,handleCloseModal:d,setTriggerOpenSavedBlocksTab:c,setTagsOptions:m,form:u,projectId:p})=>{const[g,h]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{m((0,R._q)(e,P.YY).map(e=>({value:e.name})))},[e]),{bulkSave:async(a,m,g,b)=>{h(!0);try{if(!m)return;const{tagIds:h,projectTagsArray:E}=await O({blockTags:b,projectData:e,projectId:p,addTag:t,editProject:o,notification:i,__:s});let v=!0,_=0;for(const r of a)try{await it({block:r,form:u,projectData:e,projectId:p,addBlock:l,editProject:o,addTag:t,notification:i,__:s,handleCloseModal:d,values:g,tagIds:h,projectTagsArray:E})}catch(f){v=!1,_++}if(v&&i.success({id:"BULK_SAVE_SUCCESS",message:s("All blocks saved successfully."),placement:"bottomRight"}),!v){if(_===a.length)throw new Error;i.warning({id:"BULK_SAVE_PARTIAL_SUCCESS",message:s("Some blocks were not saved successfully."),placement:"bottomRight"})}c(!0),r(),n()}catch(f){throw f}finally{h(!1),u.resetFields(),d()}},confirmSavingBlocksLoading:g}})({projectData:p,addTag:T,addBlock:M,editProject:L,refetch:g,reloadBlockScreens:I,notification:z,__:n,handleCloseModal:H,setTriggerOpenSavedBlocksTab:o,setTagsOptions:B,form:A,projectId:r}),q=async()=>{try{const{valid:e,values:l,blockTags:a}=await F({form:A,notification:z,__:n});o(!1),y(!0);const r=function(e,t,l){const{images:o}=e,{blocks:a}=t;return null===o||void 0===o?void 0:o.map(e=>{const t=a.find(t=>t.id===e.block_id);return{blockType:e.classification,blockTitle:e.name,htmlContent:(null===t||void 0===t?void 0:t.html)||"",projectId:l}})}(await lt(0,V,x,W,u),x.current,t.project.toString());y(!1),await G(r,e,l,a)}catch(e){y(!1),l(!1),z.error({message:n("Failed to save blocks."),placement:"bottomRight"})}};return a.createElement(_.A,{title:a.createElement("div",{className:"ant-modal-title"},n("Bulk saving of blocks")),className:"blocks-modal",open:e,onOk:q,onCancel:H,centered:!0,footer:a.createElement("div",{className:"modal-footer"},!(h||U)&&a.createElement(s.Ay,{key:"submit",size:"large",type:"primary",disabled:h||U,onClick:q},i("Save","block")+" "+j+" "+c("block","blocks",j)))},h||U?a.createElement("div",null,n("All blocks saved at this point can be found in the \u201cSaved Blocks\u201d section in the sidebar.")):a.createElement("div",null,n("Your letter contains")+" "+j+" "+c("block","blocks",j)+" "+n("that can be saved for future use.")),!(h||U)&&a.createElement(v.A,{form:A,name:"add_all_blocks_form",layout:"vertical",onFinish:q,style:{paddingTop:24}},a.createElement(v.A.Item,{label:n("Tags"),name:"tags",labelCol:{span:24},wrapperCol:{span:24},style:{display:"block",marginBottom:0}},a.createElement(k.A,{size:"large",mode:"tags",placeholder:n("Add some tags"),style:{width:"100%"},value:S,onChange:w,disabled:D.isLoading,options:C}))),(U||h)&&a.createElement("div",{className:"modal-spinner"},a.createElement(Ke.A,{size:"large",indicator:a.createElement(Qe.A,{style:{fontSize:48},spin:!0})})))};var ct=l(78915),mt=l(38540),ut=l(79253),pt=l(38677),gt=l(27264),ht=l(72762),bt=l(70687);var ft=l(14038);const{Content:Et}=r.A,vt=()=>{const{__:e}=(0,N.s9)(),t=(0,qe.QC)(),{emailId:l,projectId:o,preview:b}=(0,d.g)(),f=(0,m.wA)(),v=(0,m.d4)(T.Fv),_=(0,d.Zp)(),y=(0,m.d4)(T.cL),A=(0,m.d4)(me.YG),S=(0,m.d4)(ue.Hs),k=(0,m.d4)(T.oG),[w,C]=(0,c.ok)(),[B]=(0,ct.on)(),x=(0,m.d4)(Te.C1),{isSuccess:R,data:I}=(0,ct.W5)(),{owner:O}=(0,Me.A)(),F=(0,ge.fn)(),{modal:M}=n.A.useApp(),V=(0,fe.p)(),W=(0,L.rD)(),[j,z]=(0,a.useState)(!1),H=(0,u.cR)(),[G,U]=(0,a.useState)(!1),[q,X]=(0,a.useState)(!1),[$,Z]=(0,a.useState)(!1),{confirm:Y}=M,[K,Q]=(0,a.useState)(!1),J=w.get("template")||!K&&!l&&V.get(P.A9.em_new_email),ee=V.get(P.A9.em_template_email);(0,a.useEffect)(()=>{!K&&S.id&&Q(!0)},[Q,K,S.id]);const{isSuccess:te,isLoading:le,isError:oe,error:ae,data:re}=(0,se.sl)(J,{skip:!J||!!l}),{isLoading:ne,isSuccess:ie,isError:de,error:he}=(0,se.sl)(l,{skip:!l});(0,a.useEffect)(()=>{J&&te&&(f((0,me.MZ)(re)),Q(!0),C({}))},[J,te,f,re,ee,C]),(0,a.useEffect)(()=>(f((0,T.mi)(!0)),()=>f((0,T.mi)(!0))),[f]);const be=J?re:l?S:A;(0,ht.f)(be,void 0===l);const Ee=function(e){const{emailId:t,projectId:l}=(0,d.g)(),o=(0,E.hN)(),r=(0,L.rD)(),n=(0,m.d4)(mt.M),i=(0,ge.fn)(),s=(0,a.useRef)(0),c=(0,m.d4)(pt.p1),u=(0,m.d4)(T.Wm),p=(0,m.d4)(T.B),g=(0,m.d4)(Te.C1),h=(0,pe.u)(),[b,f]=(0,se.LX)(),v=(0,m.wA)(),{isSuccess:_,isLoading:y}=(0,se.YV)({emailId:t},{skip:!t}),[A,S]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(_&&!y&&null!==c&&void 0!==c&&c.length){const l=c[0];var t;l&&A!==(null===e||void 0===e?void 0:e.id)&&(null!==(t=l.slug)&&void 0!==t&&t.includes("autosave")&&i&&v((0,ue.no)(l)),S(null===e||void 0===e?void 0:e.id))}},[v,c,_,y,null===e||void 0===e?void 0:e.id,A,i,t]);const k=(0,a.useCallback)(({parent:t})=>{if(e){const a={parent:t,title:e.title,author:e.author,project:e.project,html:(null===i||void 0===i?void 0:i.getValue())||"",excerpt:e.date_gmt,subject:e.subject,preheader:e.preheader,common_styles:e.common_styles,parent_email:e.parent_email};b({emailId:e.id,body:a}).then(t=>{if(h({event:"save",action:"auto_save_email",email_id:e.id,project_id:l}),!function(e){return e.hasOwnProperty("data")}(t))throw t.error;var r,n;P.EW.isPlugin||fetch(ke(P.Tm,l,null===(r=t.data)||void 0===r?void 0:r.id,null===(n=t.data)||void 0===n?void 0:n.modified),{mode:"no-cors"}),o.success({id:"EMAIL_AUTOSAVE_SUCCESS",data:a,message:""},!0)}).catch(e=>{o.fromError("EMAIL_AUTOSAVE_ERROR",a,e,!0)})}},[b,e,i,l,o,h]),[w,C]=(0,a.useState)(!1),B=(0,a.useCallback)(()=>{if((null===c||void 0===c?void 0:c.length)>0){const e=[...c].sort((e,t)=>Date.parse(null===t||void 0===t?void 0:t.modified)-Date.parse(null===e||void 0===e?void 0:e.modified))[0];Date.parse((new Date).toString())-Date.parse(null===e||void 0===e?void 0:e.modified)>1.5*((null===r||void 0===r?void 0:r.autosaveTimeout)||1e4)&&u&&!n&&"Discuss"!==p&&k({parent:e.id})}else u&&!n&&"Discuss"!==p&&k({parent:null})},[c,n,u,p,k,null===r||void 0===r?void 0:r.autosaveTimeout]);(0,$e.ZC)(([e])=>{w&&!e&&(B(),C(!1))},[w,B,C]);const x=null===g||void 0===g?void 0:g.autosaves,R=(0,a.useCallback)(()=>{n||(clearTimeout(s.current),s.current=setTimeout(()=>C(!0),(null===r||void 0===r?void 0:r.autosaveTimeout)||1e4))},[n,null===r||void 0===r?void 0:r.autosaveTimeout,C]);return(0,a.useEffect)(()=>{if(x&&_&&void 0!==(null===e||void 0===e?void 0:e.id)){const t=(0,bt.Og)(i,()=>{u&&null!==e&&void 0!==e&&e.is_inited&&R()});return()=>{t.dispose()}}},[i,R,x,_,null===e||void 0===e?void 0:e.id,u,null===e||void 0===e?void 0:e.is_inited]),(0,$e.ZC)(([t,l])=>{x&&_&&void 0!==(null===e||void 0===e?void 0:e.id)&&u&&null!==e&&void 0!==e&&e.is_inited&&(t===(null===e||void 0===e?void 0:e.title)&&l===(null===e||void 0===e?void 0:e.common_styles)||R())},[null===e||void 0===e?void 0:e.title,null===e||void 0===e?void 0:e.common_styles,u,_,R,null===e||void 0===e?void 0:e.id,null===e||void 0===e?void 0:e.is_inited]),(0,a.useEffect)(()=>()=>{clearTimeout(s.current)},[g,null===e||void 0===e?void 0:e.renderGuid]),(0,a.useEffect)(()=>{clearTimeout(s.current)},[null===e||void 0===e?void 0:e.modified]),f}(be),{counters:ve,subscription:_e}=x,ye=null===ve||void 0===ve?void 0:ve.emails_counter,Ae=(0,a.useCallback)(()=>{f((0,T.vs)()),f((0,mt.rI)())},[f]);(0,a.useEffect)(()=>{b&&!v&&Ae()},[v,b,Ae]),(0,a.useEffect)(()=>{f((0,ut.ff)()),document.body.classList.add("editor"),f((0,T.PM)(P.Bv))},[f]);const[Se,we]=(0,a.useState)(!1);(0,a.useEffect)(()=>{!Se&&ye<3&&(B(),we(!0))},[B,ye,Se]);const Ce=J?te:ie,Be=J?le:ne,xe=J?oe:de,Re=J?ae:he,Ne=(0,ge.aD)(F),Le=(0,a.useCallback)(()=>{Ne.undo()},[Ne]),Ie=(0,a.useCallback)(()=>{Ne.redo()},[Ne]),Pe=(0,a.useRef)();(0,a.useEffect)(()=>{Pe.current!==(null===be||void 0===be?void 0:be.id)&&(Ne.clear(),Pe.current=null===be||void 0===be?void 0:be.id)},[be,Ne]);const Oe=(0,a.useCallback)(e=>{(window.navigator.appVersion.indexOf("Mac")&&e.metaKey||e.ctrlKey)&&"KeyZ"===e.code&&(e.preventDefault(),e.shiftKey?Ie():Le())},[Le,Ie]);(0,a.useEffect)(()=>()=>{f((0,mt.rI)()),f((0,pt.qX)())},[f]),(0,a.useEffect)(()=>{const e=t.addListener(P.Ru.APPLICATION_HAS_AMP,e=>{f(null!==be&&void 0!==be&&be.id?(0,ue.VO)(e):(0,me.lg)(e))});return()=>e.dispose()},[t,f,null===be||void 0===be?void 0:be.id]);const[Fe,De]=(0,a.useState)(),Ve=(0,a.useCallback)(e=>{const t=e.data.operation,l=e.data,o=e.data.action,a=H.querySelector("#iframe-scroll-top"),r=H.querySelector("#iframe-scroll-bottom");if(t===P.Ru.APPLICATION_EBLOCK_ADD&&(De(l.data),f((0,T.qf)(P.lx.ADD_NEW_EBLOCK_MODAL))),t===P.Ru.APPLICATION_ACTION&&("undo"===o?Le():"redo"===o&&Ie()),t===P.Ru.APPLICATION_SCROLL_BLOCK_SHOW){const e=H.querySelector("#email_iframe"),t=document.body.getBoundingClientRect().height,l=e.getClientRects()[0];l.top<0&&(a.style.display="block"),l.top+l.height>t&&(r.style.display="block")}t===P.Ru.APPLICATION_SCROLL_BLOCK_HIDE&&(a.style.display="none",r.style.display="none")},[f,Le,Ie,H]);(0,ce.A)(Ve);const We=e=>{e.preventDefault(),e.target&&t.send({operation:P.Ru.SANDBOX_DRAG_CANCEL}),H.querySelectorAll(".em-dragging-element").forEach(e=>{e.classList.remove("em-dragging-element")})};(0,a.useEffect)(()=>{const e=new p.j;return e.addDisposable((0,ft.a)(H,"drop",We)),e.addDisposable((0,ft.a)(H,"dragover",je)),e.addDisposable((0,ft.a)(H,"dragstart",He)),e.addDisposable((0,ft.a)(H,"dragend",ze)),()=>{e.dispose()}},[H]),(0,a.useEffect)(()=>{const e=e=>{e.preventDefault()};return window.addEventListener("keydown",Oe),window.addEventListener("dragenter dragleave",e),()=>{window.removeEventListener("keydown",Oe),window.removeEventListener("dragenter dragleave",e)}});const je=e=>{e.preventDefault();const t=H.querySelector("#iframe-scroll-top"),l=H.querySelector("#iframe-scroll-bottom"),o=W.sidePanelFloating?H.querySelector("#pane-content-wrapper"):H.querySelector(".email-pane__col_preview"),a=H.querySelector("#email_iframe"),{height:r,top:n}=a.getBoundingClientRect(),i=o.getBoundingClientRect().height;n>96?"block"===t.style.display&&(t.style.display="none"):"none"!==t.style.display&&""!==t.style.display||(t.style.display="block"),r-i+n<44?"block"===l.style.display&&(l.style.display="none"):"none"===l.style.display&&(l.style.display="block"),e.target===t&&o.scrollBy(0,-15),e.target===l&&o.scrollBy(0,15)},ze=()=>{const e=H.querySelector("#iframe-scroll-top"),t=H.querySelector("#iframe-scroll-bottom");e&&t&&(e.style.display="none",t.style.display="none"),H.querySelectorAll(".em-dragging-element").forEach(e=>{e.classList.remove("em-dragging-element")})},He=e=>{e.target.parentElement.classList.add("em-dragging-element");var t=e.target.closest(".blocks-search__result-wrapper")?e.target.querySelector(".blocks-search__result-html").cloneNode(!0):e.target.cloneNode(!0);t.classList.add("em-ghost-element"),t.style.height=e.target.closest(".blocks-search__result-wrapper")?"auto":"70px",t.style.width=e.target.closest(".blocks-search__result-wrapper")?"600px":"109px",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.zIndex="-1",e.target.appendChild(t),e.dataTransfer.setDragImage(t,0,0),window.setTimeout(function(){t.parentNode.removeChild(t)},1e3)},Ge=(0,a.useCallback)(()=>{Y({title:e("You reached the plan limit"),icon:a.createElement(gt.A,null),content:a.createElement("div",{style:{maxWidth:"330px"}},e("Switch to a different plan to save more emails.")),centered:!0,okText:e("Choose a plan"),cancelText:e("Continue without saving"),width:"unset",onOk(){_("/billing")},onCancel(){}})},[_,e,Y]),[Ue,Xe]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(R&&I){var e,t;const o=null===I||void 0===I||null===(e=I.find(e=>{var t,l;return(null===(t=e.id)||void 0===t?void 0:t.toString())===(null===_e||void 0===_e||null===(l=_e.ID)||void 0===l?void 0:l.toString())}))||void 0===e||null===(t=e.limits)||void 0===t?void 0:t.emails_limit;o&&ye>=o&&!Ue&&!l&&O&&(Ge(),Xe(!0))}},[I,R,_e,ye,Ue,Ge,l,O]),(0,a.useEffect)(()=>{const e=t.onInit(()=>{t.send({operation:P.Ru.SANDBOX_LOCK_EDIT,data:!1})});return()=>e.dispose()},[t]),a.createElement(r.A,{className:"email-page"},Be&&a.createElement(g.A,null),xe&&Re&&a.createElement(Et,{style:{paddingTop:"40px"}},a.createElement("div",{className:"container"},a.createElement(i.Ay,{status:Re.status,title:Re.status,subTitle:Re.data.message,extra:a.createElement(s.Ay,{type:"primary",onClick:()=>{_(`/projects/${o}/emails`)}},e("Back To Project"))}))),(!l&&!J&&K||ie&&be)&&!Be&&a.createElement(r.A,{className:"email-pane"},k&&a.createElement("div",{className:"email-pane__loader"},a.createElement(g.A,{small:!0})),a.createElement(Ye,{email:be,autoSaveEmailResult:Ee,isCollaborationEditor:j}),a.createElement(h.A,{emailElement:be,isSuccess:Ce,setIsCollaborationEditor:z,setIsShowAddAllBlocksModal:U,triggerOpenSavedBlocksTab:$})),a.createElement(D,{isModalVisible:y===P.lx.ADD_NEW_EBLOCK_MODAL,htmlContent:Fe,projectId:o,setIsShowAddAllBlocksModal:U,setIsShowAddAllBlocksModalForNewEmail:X,currentEmail:be}),a.createElement(dt,{isModalVisible:G,currentEmail:be,setIsShowAddAllBlocksModal:U,setTriggerOpenSavedBlocksTab:Z,autoStart:!q,projectId:o}))}},5558:(e,t,l)=>{"use strict";l.d(t,{Gy:()=>m,O5:()=>b,hN:()=>h,x_:()=>u});var o=l(15626),a=l(90614),r=l(98173),n=l(35491),i=l(90121),s=l(13668),d=l(31926);const c="bottomRight";function m(e){return{id:e.id,code:e.html,title:e.title,subject:e.subject,preheader:e.preheader}}function u(e){return{id:e.id,code:e.html,title:e.title}}const p=e=>{var t,l,o,a;return e.message||(null===(t=e.error)||void 0===t||null===(l=t.data)||void 0===l?void 0:l.code)||(null===(o=e.error)||void 0===o?void 0:o.status)||e.error||(null===(a=e.data)||void 0===a?void 0:a.code)||e.status||e||"Unknown error"},g=e=>{var t,l,o,a;return e.description||(null===(t=e.error)||void 0===t||null===(l=t.data)||void 0===l?void 0:l.message)||(null===(o=e.error)||void 0===o?void 0:o.error)||(null===(a=e.data)||void 0===a?void 0:a.message)||e.error||"Unknown error"};function h(){const e=(0,a.ml)(o.AZ.ON_NOTIFICATION),{notification:t}=n.A.useApp(),l=(0,r.useCallback)((l,o)=>{l.type||(l={...l,type:"info"}),e.fire((0,d.TB)({id:l.id,type:l.type,data:l.data,innerException:l.innerException})).then(e=>{if(e.every(e=>!1!==e)){l={...l,placement:c};for(const t of e)"object"===typeof t&&Object.assign(l,t,t.style?{style:{...t.style,...l.style}}:{},t.props?{props:{...t.props,...l.props}}:{},t.className?{className:l.className?`${l.className} ${t.className}`:t.className}:{});o||(l=Object.assign(l,...e.filter(e=>"object"===typeof e)),t[l.type]?t[l.type](l):l.message)}})},[t,e]),i=(0,r.useCallback)((e,t)=>{const o={...e,message:r.createElement("div",{dangerouslySetInnerHTML:{__html:p(e)}}),description:r.createElement("div",{dangerouslySetInnerHTML:{__html:g(e)}})};l({...o,type:"error"},t)},[l]),s=(0,r.useCallback)((e="Success",t)=>{l({..."string"===typeof e?{message:e}:e,type:"success"},t)},[l]),m=(0,r.useCallback)((e,t)=>l({...e,type:"warning"},t),[l]),u=(0,r.useCallback)((e,t)=>l({...e,type:"info"},t),[l]),h=(0,r.useCallback)((e,t,l,o,a=c)=>{l&&i({id:e,data:t,message:l.data instanceof Error?"":p(l),description:g(l),placement:a,innerException:(null===l||void 0===l?void 0:l.data)instanceof Error?l.data:l},o)},[i]);return(0,r.useMemo)(()=>({notify:l,success:s,error:i,warning:m,fromError:h,info:u}),[l,s,i,m,h,u])}function b(){const{notify:e}=h();(0,i.D3)(s.Sb,e)}},6573:e=>{e.exports='<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n\n .em-mob-wrap {\n display: block!important;\n }\n\n .em-mob-padding_right-20 {\n padding-right: 20px!important;\n }\n \n .em-mob-padding_left-20 {\n padding-left: 20px!important;\n }\n\n .em-mob-height-20px {\n height: 20px!important;\n }\n }\n</style>\n<tr em="block" class="em-structure">\n <td align="center" dir="rtl" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">\n <table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">\n <tr>\n <td width="180" dir="ltr" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n <td width="20" class="em-mob-wrap em-mob-height-20px"></td>\n <td width="380" dir="ltr" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n </tr>\n </table>\n </td>\n</tr>'},7549:e=>{e.exports='<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n\n .em-mob-wrap {\n display: block!important;\n }\n\n .em-mob-padding_right-20 {\n padding-right: 20px!important;\n }\n \n .em-mob-padding_left-20 {\n padding-left: 20px!important;\n }\n }\n</style>\n<tr em="block" class="em-structure">\n <td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">\n <table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">\n <tr>\n <td width="580" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n </tr>\n </table>\n </td>\n</tr>'},8111:(e,t,l)=>{"use strict";l.d(t,{Jg:()=>c,z2:()=>u,HI:()=>p,vn:()=>h,kk:()=>g,Cf:()=>m});var o=l(14721),a=l(39539),r=l(93778),n=l(31926);function i({id:e,post:t,parent:l,author:o,content:a,acf:{status:r,target_id:i},...s}){return{...s,id:(0,n.WY)(e),post:(0,n.WY)(t),parent:(0,n.WY)(l),author:(0,n.WY)(o),content:(0,n.vf)(a),target_id:i,comment_status:r}}var s=l(58521);const d="Comments",c=(0,o.xP)({reducerPath:"commentsApi",tagTypes:[d],baseQuery:(0,s.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getComments:e.query({queryFn:function(e,t){return(0,s.KU)(t).wp.comments_list({post:[(0,n.mQ)(e)],per_page:50,order:"asc"}).then((0,r.Ih)(i))},providesTags:e=>e?[...e.map(({id:e})=>({type:d,id:e})),{type:d,id:"LIST"}]:[{type:d,id:"LIST"}]}),addComment:e.mutation({queryFn({subjectId:e,author:t,parent:l,content:o,author_name:d,author_email:c,targetId:m},u){const p=(0,s.KU)(u),g={post:(0,n.mQ)(e),author:(0,n.mQ)(t),author_name:d,author_email:c},h={};return o&&(g.content=o),l&&(g.parent=(0,n.mQ)(l)),m&&(h["acf[target_id]"]=m),p.wp.comments_create(g,{type:a.cM.UrlEncoded,extraQuery:h}).then((0,r.SC)(i))},invalidatesTags:[{type:d,id:"LIST"}]}),deleteComment:e.mutation({queryFn:(e,t)=>(0,s.KU)(t).wp.comments_delete(e,{}).then((0,r.PI)(i)),invalidatesTags:[{type:d,id:"LIST"}]}),editComment:e.mutation({queryFn({commentId:e,content:t,status:l,targetId:o},n){const d=(0,s.KU)(n),c={},m={};return t&&(c.content=t),l&&(m["acf[status]"]=l),o&&(m["acf[targetId]"]=o),d.wp.comments_update(e,c,{type:a.cM.UrlEncoded,extraQuery:m}).then((0,r.SC)(i))},invalidatesTags:[{type:d,id:"LIST"}]}),deleteTarget:e.mutation({queryFn:(e,t)=>(0,s.KU)(t).wp.comments_delete(e,{},{extraQuery:{"acf[target_id]":""}}).then((0,r.PI)(i)),invalidatesTags:[{type:d,id:"LIST"}]})})}),{useGetCommentsQuery:m,useAddCommentMutation:u,useDeleteCommentMutation:p,useEditCommentMutation:g,useDeleteTargetMutation:h}=c},8807:(e,t,l)=>{"use strict";l.d(t,{A:()=>Yo});var o=l(98173),a=l(83177),r=l(3861),n=l(82510),i=l(58309),s=l(1631),d=l(64523),c=l(4738),m=l(44404),u=l(71677),p=l(81988),g=l(19065),h=l(66163),b=l(89795),f=l(71253),E=l(3359),v=l(82111),_=l(39693),y=l(40661),A=l(7607),S=l(66602),k=l(61848),w=l(52468),C=l(12669),B=l(6004),x=l(70599),T=l(46156),R=l(35225),N=l(58022),L=l(76776),I=l(48845),P=l(83093),O=l(15246),F=l(91497),M=l(92076),D=l(77301),V=l(4729),W=l(46041),j=l(40398),z=l(35061),H=l(29392),G=l(70365),U=l(16985),q=l(92946),X=l(51294),$=l(5233),Z=l(94535),Y=l(90189),K=l(59163),Q=l(793),J=l(69272),ee=l(70114),te=l(79063),le=l(4838),oe=l(55469),ae=l(23604),re=l(6799),ne=l(88780),ie=l(59443),se=l(94548),de=l(56916),ce=l(88585),me=l(50222),ue=l(85436),pe=l(3778),ge=l(44999),he=l(38392),be=l(22732),fe=l(99717),Ee=l(70549),ve=l(92021),_e=l(11824),ye=l(72058),Ae=l(27941);const Se=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"chat-gpt",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M11.1396 4.91121C11.2741 4.50723 11.3208 4.07922 11.2764 3.65577C11.2321 3.23232 11.0979 2.82323 10.8827 2.45587C10.5636 1.90021 10.0763 1.46028 9.49105 1.19955C8.90578 0.938823 8.2528 0.870777 7.62631 1.00523C7.34374 0.68679 6.99643 0.432375 6.60757 0.259023C6.21871 0.0856726 5.79733 -0.00261924 5.3716 5.91632e-05C4.7311 -0.00148674 4.10665 0.200409 3.58828 0.576642C3.06991 0.952872 2.68442 1.484 2.48737 2.09345C2.07011 2.17886 1.67592 2.35242 1.33117 2.60252C0.98642 2.85261 0.699078 3.17346 0.488376 3.5436C0.166798 4.09773 0.02953 4.73964 0.0963679 5.37684C0.163206 6.01401 0.430694 6.61347 0.860259 7.08879C0.725757 7.49277 0.679098 7.92078 0.723405 8.34423C0.767712 8.76768 0.901962 9.17676 1.11717 9.54414C1.43623 10.0998 1.92355 10.5397 2.50882 10.8004C3.09409 11.0611 3.74707 11.1292 4.37353 10.9948C4.6561 11.3132 5.00344 11.5676 5.39227 11.741C5.78113 11.9143 6.20251 12.0026 6.62824 11.9999C7.26907 12.0016 7.89385 11.7996 8.4124 11.4232C8.93098 11.0467 9.31654 10.5152 9.51343 9.90537C9.93067 9.81996 10.3249 9.64641 10.6696 9.3963C11.0144 9.14622 11.3017 8.82534 11.5124 8.4552C11.8336 7.90113 11.9705 7.25937 11.9035 6.62244C11.8365 5.98551 11.569 5.38632 11.1396 4.91121ZM6.6292 11.2155C6.10315 11.2162 5.59363 11.032 5.18968 10.695C5.20789 10.6851 5.23984 10.6676 5.26066 10.6548L7.64998 9.27468C7.70995 9.24057 7.75975 9.1911 7.79425 9.13134C7.82878 9.07158 7.84675 9.00372 7.84633 8.93475V5.56626L8.85625 6.1494C8.86153 6.15204 8.86609 6.15594 8.86954 6.16077C8.87296 6.1656 8.87512 6.17121 8.87587 6.17706V8.96667C8.87512 9.5625 8.63824 10.1337 8.21713 10.5552C7.79602 10.9768 7.225 11.2142 6.6292 11.2155ZM1.79754 9.15192C1.53405 8.69664 1.43908 8.16321 1.52927 7.64496C1.54701 7.65561 1.578 7.67454 1.60024 7.68732L3.98956 9.06744C4.04911 9.10224 4.11685 9.1206 4.18582 9.1206C4.25476 9.1206 4.3225 9.10224 4.38205 9.06744L7.29916 7.38309V8.54937C7.29949 8.55531 7.29835 8.56128 7.29583 8.56668C7.29331 8.57208 7.2895 8.57679 7.28473 8.58036L4.86937 9.97491C4.35274 10.2725 3.73915 10.3529 3.16327 10.1986C2.58738 10.0443 2.09621 9.66789 1.79754 9.15192ZM1.16898 3.93582C1.43133 3.47994 1.8457 3.13092 2.33951 2.94981C2.33951 2.97039 2.33833 3.00684 2.33833 3.03213V5.7924C2.33791 5.86134 2.35586 5.92914 2.39033 5.98887C2.42479 6.04857 2.47454 6.09801 2.53445 6.13212L5.45155 7.81626L4.44166 8.39937C4.43668 8.40267 4.43095 8.40465 4.42501 8.40519C4.41907 8.40573 4.41307 8.4048 4.40758 8.40246L1.992 7.00671C1.47626 6.70803 1.10001 6.21705 0.945726 5.64138C0.791445 5.06574 0.871731 4.45239 1.16898 3.93582ZM9.46636 5.86668L6.54922 4.18233L7.55914 3.59943C7.56412 3.59616 7.56985 3.59415 7.57579 3.59361C7.58173 3.59307 7.5877 3.59403 7.59319 3.59637L10.0088 4.99092C10.3789 5.2047 10.6804 5.51946 10.878 5.89839C11.0757 6.27732 11.1613 6.7047 11.1248 7.13052C11.0884 7.55634 10.9313 7.96296 10.6721 8.30277C10.4129 8.64258 10.0623 8.90151 9.66127 9.04923C9.66127 9.02841 9.66127 8.99199 9.66127 8.96667V6.2064C9.66184 6.13758 9.64408 6.06984 9.60982 6.01014C9.57556 5.95044 9.52606 5.90094 9.46636 5.86668ZM10.4715 4.35384C10.4538 4.34295 10.4228 4.32426 10.4006 4.31151L8.01121 2.93136C7.95166 2.89662 7.88395 2.87829 7.81498 2.87829C7.74604 2.87829 7.6783 2.89662 7.61875 2.93136L4.70164 4.61574V3.44946C4.70131 3.44349 4.70245 3.43755 4.70497 3.43215C4.70749 3.42675 4.7113 3.42204 4.71607 3.41847L7.13143 2.02508C7.50145 1.81171 7.9246 1.70813 8.35135 1.72645C8.7781 1.74477 9.19078 1.88423 9.54118 2.12852C9.89155 2.37282 10.1651 2.71184 10.3299 3.10593C10.4946 3.50001 10.5438 3.93285 10.4715 4.35384ZM4.15258 6.43257L3.14242 5.84943C3.13714 5.84679 3.13255 5.84289 3.12913 5.83806C3.12571 5.83323 3.12352 5.82762 3.1228 5.82174V3.03213C3.12307 2.60489 3.24505 2.18654 3.47443 1.82609C3.70384 1.46563 4.03117 1.17798 4.41811 0.996792C4.80505 0.815607 5.23558 0.748392 5.65933 0.80301C6.08311 0.857628 6.48253 1.03182 6.81088 1.3052C6.79267 1.31514 6.76096 1.33265 6.7399 1.34542L4.35058 2.72555C4.29061 2.75963 4.24084 2.80907 4.20631 2.86878C4.17181 2.92848 4.15384 2.99631 4.15423 3.06525L4.15258 6.43257ZM4.70116 5.24973L6.0004 4.49934L7.29961 5.24925V6.74955L6.0004 7.49949L4.70116 6.74955V5.24973Z"})),ke=({props:e})=>o.createElement(a.A,Object.assign({component:Se},e)),we=({props:e})=>o.createElement(h.M,e),Ce=({props:e})=>o.createElement(b.O,e),Be=({props:e})=>o.createElement(ye.X,e),xe=({props:e})=>o.createElement(c.T,e),Te=({props:e})=>o.createElement(n.x,e),Re=({props:e})=>o.createElement(u.G,e),Ne=({props:e})=>o.createElement(z.e,e),Le=({props:e})=>o.createElement(I.s,e),Ie=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"drop-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M6 0L5.61832 0.458015C5.61832 0.458015 4.64123 1.6355 3.64886 3.09924C3.15268 3.83206 2.64123 4.63168 2.25955 5.40458C1.87787 6.17748 1.60306 6.91794 1.60306 7.60305C1.60306 10.0191 3.58397 12 6 12C8.41603 12 10.397 10.0191 10.397 7.60305C10.397 6.91794 10.1221 6.17748 9.74046 5.40458C9.35878 4.63168 8.84733 3.83206 8.35115 3.09924C7.35878 1.6355 6.38168 0.458015 6.38168 0.458015L6 0ZM6 1.57252C6.27291 1.91031 6.78436 2.50954 7.55726 3.64885C8.03817 4.35687 8.50382 5.1374 8.85497 5.84733C9.20611 6.55725 9.41985 7.21374 9.41985 7.60305C9.41985 9.48664 7.88359 11.0229 6 11.0229C4.11642 11.0229 2.58016 9.48664 2.58016 7.60305C2.58016 7.21374 2.7939 6.55725 3.14504 5.84733C3.49619 5.1374 3.96184 4.35687 4.44275 3.64885C5.21565 2.50954 5.7271 1.91031 6 1.57252ZM3.55726 7.60305C3.55726 8.94466 4.6584 10.0458 6 10.0458V9.0687C5.19084 9.0687 4.53436 8.41221 4.53436 7.60305H3.55726Z"})),Pe=({props:e})=>o.createElement(a.A,Object.assign({component:Ie},e)),Oe=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"dark-white",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M0 6C0 2.68629 2.68629 0 6 0C9.31339 0 12 2.68661 12 6C12 9.31339 9.31339 12 6 12C2.68629 12 0 9.31371 0 6ZM6 10.9821C8.75089 10.9821 10.9821 8.75089 10.9821 6C10.9821 3.24911 8.75089 1.01786 6 1.01786V10.9821Z"})),Fe=({props:e})=>o.createElement(a.A,Object.assign({component:Oe},e)),Me=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"min-width-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M1.35714 1.07143H0.607143C0.548214 1.07143 0.5 1.11964 0.5 1.17857V1.92857C0.5 1.9875 0.548214 2.03571 0.607143 2.03571H1.35714C1.41607 2.03571 1.46429 1.9875 1.46429 1.92857V1.17857C1.46429 1.11964 1.41607 1.07143 1.35714 1.07143ZM1.35714 3.29464H0.607143C0.548214 3.29464 0.5 3.34286 0.5 3.40178V4.15178C0.5 4.21071 0.548214 4.25893 0.607143 4.25893H1.35714C1.41607 4.25893 1.46429 4.21071 1.46429 4.15178V3.40178C1.46429 3.34286 1.41607 3.29464 1.35714 3.29464ZM1.35714 7.74107H0.607143C0.548214 7.74107 0.5 7.78928 0.5 7.84821V8.59821C0.5 8.65714 0.548214 8.70536 0.607143 8.70536H1.35714C1.41607 8.70536 1.46429 8.65714 1.46429 8.59821V7.84821C1.46429 7.78928 1.41607 7.74107 1.35714 7.74107ZM1.35714 9.96428H0.607143C0.548214 9.96428 0.5 10.0125 0.5 10.0714V10.8214C0.5 10.8804 0.548214 10.9286 0.607143 10.9286H1.35714C1.41607 10.9286 1.46429 10.8804 1.46429 10.8214V10.0714C1.46429 10.0125 1.41607 9.96428 1.35714 9.96428ZM1.35714 5.51786H0.607143C0.548214 5.51786 0.5 5.56607 0.5 5.625V6.375C0.5 6.43393 0.548214 6.48214 0.607143 6.48214H1.35714C1.41607 6.48214 1.46429 6.43393 1.46429 6.375V5.625C1.46429 5.56607 1.41607 5.51786 1.35714 5.51786Z"}),o.createElement("path",{d:"M11.3571 1.07143H10.6071C10.5482 1.07143 10.5 1.11964 10.5 1.17857V1.92857C10.5 1.9875 10.5482 2.03571 10.6071 2.03571H11.3571C11.4161 2.03571 11.4643 1.9875 11.4643 1.92857V1.17857C11.4643 1.11964 11.4161 1.07143 11.3571 1.07143ZM11.3571 3.29464H10.6071C10.5482 3.29464 10.5 3.34286 10.5 3.40178V4.15178C10.5 4.21071 10.5482 4.25893 10.6071 4.25893H11.3571C11.4161 4.25893 11.4643 4.21071 11.4643 4.15178V3.40178C11.4643 3.34286 11.4161 3.29464 11.3571 3.29464ZM11.3571 7.74107H10.6071C10.5482 7.74107 10.5 7.78928 10.5 7.84821V8.59821C10.5 8.65714 10.5482 8.70536 10.6071 8.70536H11.3571C11.4161 8.70536 11.4643 8.65714 11.4643 8.59821V7.84821C11.4643 7.78928 11.4161 7.74107 11.3571 7.74107ZM11.3571 9.96428H10.6071C10.5482 9.96428 10.5 10.0125 10.5 10.0714V10.8214C10.5 10.8804 10.5482 10.9286 10.6071 10.9286H11.3571C11.4161 10.9286 11.4643 10.8804 11.4643 10.8214V10.0714C11.4643 10.0125 11.4161 9.96428 11.3571 9.96428ZM11.3571 5.51786H10.6071C10.5482 5.51786 10.5 5.56607 10.5 5.625V6.375C10.5 6.43393 10.5482 6.48214 10.6071 6.48214H11.3571C11.4161 6.48214 11.4643 6.43393 11.4643 6.375V5.625C11.4643 5.56607 11.4161 5.51786 11.3571 5.51786Z"}),o.createElement("path",{d:"M11 5.51786H8.20535V4.67679C8.20535 4.59644 8.1116 4.5509 8.04865 4.60045L6.33973 5.95045C6.32816 5.95939 6.3188 5.97086 6.31236 5.98397C6.30592 5.99709 6.30257 6.01151 6.30257 6.02612C6.30257 6.04074 6.30592 6.05516 6.31236 6.06827C6.3188 6.08139 6.32816 6.09286 6.33973 6.10179L8.04732 7.45179C8.11026 7.50135 8.20401 7.45715 8.20401 7.37545V6.48215H11V5.51786Z"}),o.createElement("path",{d:"M1 5.51786H3.79465V4.67679C3.79465 4.59644 3.8884 4.5509 3.95135 4.60045L5.66027 5.95045C5.67184 5.95939 5.6812 5.97086 5.68764 5.98397C5.69408 5.99709 5.69743 6.01151 5.69743 6.02612C5.69743 6.04074 5.69408 6.05516 5.68764 6.06827C5.6812 6.08139 5.67184 6.09286 5.66027 6.10179L3.95268 7.45179C3.88974 7.50135 3.79599 7.45715 3.79599 7.37545V6.48215H1V5.51786Z"})),De=({props:e})=>o.createElement(a.A,Object.assign({component:Me},e)),Ve=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"max-width-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M1.35714 1.07143H0.607143C0.548214 1.07143 0.5 1.11964 0.5 1.17857V1.92857C0.5 1.9875 0.548214 2.03571 0.607143 2.03571H1.35714C1.41607 2.03571 1.46429 1.9875 1.46429 1.92857V1.17857C1.46429 1.11964 1.41607 1.07143 1.35714 1.07143ZM1.35714 3.29464H0.607143C0.548214 3.29464 0.5 3.34286 0.5 3.40178V4.15178C0.5 4.21071 0.548214 4.25893 0.607143 4.25893H1.35714C1.41607 4.25893 1.46429 4.21071 1.46429 4.15178V3.40178C1.46429 3.34286 1.41607 3.29464 1.35714 3.29464ZM1.35714 7.74107H0.607143C0.548214 7.74107 0.5 7.78928 0.5 7.84821V8.59821C0.5 8.65714 0.548214 8.70536 0.607143 8.70536H1.35714C1.41607 8.70536 1.46429 8.65714 1.46429 8.59821V7.84821C1.46429 7.78928 1.41607 7.74107 1.35714 7.74107ZM1.35714 9.96428H0.607143C0.548214 9.96428 0.5 10.0125 0.5 10.0714V10.8214C0.5 10.8804 0.548214 10.9286 0.607143 10.9286H1.35714C1.41607 10.9286 1.46429 10.8804 1.46429 10.8214V10.0714C1.46429 10.0125 1.41607 9.96428 1.35714 9.96428ZM1.35714 5.51786H0.607143C0.548214 5.51786 0.5 5.56607 0.5 5.625V6.375C0.5 6.43393 0.548214 6.48214 0.607143 6.48214H1.35714C1.41607 6.48214 1.46429 6.43393 1.46429 6.375V5.625C1.46429 5.56607 1.41607 5.51786 1.35714 5.51786Z"}),o.createElement("path",{d:"M11.3571 1.07143H10.6071C10.5482 1.07143 10.5 1.11964 10.5 1.17857V1.92857C10.5 1.9875 10.5482 2.03571 10.6071 2.03571H11.3571C11.4161 2.03571 11.4643 1.9875 11.4643 1.92857V1.17857C11.4643 1.11964 11.4161 1.07143 11.3571 1.07143ZM11.3571 3.29464H10.6071C10.5482 3.29464 10.5 3.34286 10.5 3.40178V4.15178C10.5 4.21071 10.5482 4.25893 10.6071 4.25893H11.3571C11.4161 4.25893 11.4643 4.21071 11.4643 4.15178V3.40178C11.4643 3.34286 11.4161 3.29464 11.3571 3.29464ZM11.3571 7.74107H10.6071C10.5482 7.74107 10.5 7.78928 10.5 7.84821V8.59821C10.5 8.65714 10.5482 8.70536 10.6071 8.70536H11.3571C11.4161 8.70536 11.4643 8.65714 11.4643 8.59821V7.84821C11.4643 7.78928 11.4161 7.74107 11.3571 7.74107ZM11.3571 9.96428H10.6071C10.5482 9.96428 10.5 10.0125 10.5 10.0714V10.8214C10.5 10.8804 10.5482 10.9286 10.6071 10.9286H11.3571C11.4161 10.9286 11.4643 10.8804 11.4643 10.8214V10.0714C11.4643 10.0125 11.4161 9.96428 11.3571 9.96428ZM11.3571 5.51786H10.6071C10.5482 5.51786 10.5 5.56607 10.5 5.625V6.375C10.5 6.43393 10.5482 6.48214 10.6071 6.48214H11.3571C11.4161 6.48214 11.4643 6.43393 11.4643 6.375V5.625C11.4643 5.56607 11.4161 5.51786 11.3571 5.51786Z"}),o.createElement("path",{d:"M7.95133 4.54822L9.66026 5.89688C9.70848 5.93572 9.70848 6.01072 9.65758 6.04956L7.94999 7.39956C7.88705 7.44911 7.7933 7.40358 7.7933 7.32322V6.48215H4.20401V7.37545C4.20401 7.45715 4.11026 7.50135 4.04732 7.45179L2.33973 6.10179C2.32816 6.09286 2.3188 6.08139 2.31236 6.06827C2.30592 6.05516 2.30257 6.04074 2.30257 6.02612C2.30257 6.01151 2.30592 5.99709 2.31236 5.98397C2.3188 5.97085 2.32816 5.95939 2.33973 5.95045L4.04865 4.60045C4.1116 4.5509 4.20535 4.59644 4.20535 4.67679V5.51786H7.79464V4.62456C7.79459 4.60637 7.79967 4.58853 7.8093 4.57309C7.81892 4.55766 7.8327 4.54524 7.84906 4.53728C7.86541 4.52931 7.88368 4.52611 7.90177 4.52805C7.91986 4.52998 7.93703 4.53697 7.95133 4.54822Z"})),We=({props:e})=>o.createElement(a.A,Object.assign({component:Ve},e)),je=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"bg-position-horizontal",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("g",null,o.createElement("path",{opacity:"0.3",d:"M10.9286 0.85734H1.07142C0.834371 0.85734 0.642853 1.04886 0.642853 1.28591V11.1431C0.642853 11.3801 0.834371 11.5716 1.07142 11.5716H2.5958C2.65473 11.5716 2.70295 11.5234 2.70295 11.4645V10.7145C2.70295 10.6556 2.65473 10.6073 2.5958 10.6073H1.60714V1.82163H10.3929V5.10734C10.3929 5.16627 10.4411 5.21448 10.5 5.21448H11.25C11.3089 5.21448 11.3571 5.16627 11.3571 5.10734V1.28591C11.3571 1.04886 11.1656 0.85734 10.9286 0.85734Z"}),o.createElement("path",{d:"M10.9286 5.95536H3.85715C3.62009 5.95536 3.42857 6.14688 3.42857 6.38393V10.9286C3.42857 11.1656 3.62009 11.3571 3.85715 11.3571H10.9286C11.1656 11.3571 11.3571 11.1656 11.3571 10.9286V6.38393C11.3571 6.14688 11.1656 5.95536 10.9286 5.95536ZM10.3393 10.3393H4.44643V6.97322H10.3393V10.3393Z"}),o.createElement("path",{d:"M3.15129 3.31274H6.94594V2.47167C6.94594 2.39132 7.03969 2.34578 7.10264 2.39533L8.81157 3.74533C8.82313 3.75427 8.83249 3.76574 8.83893 3.77885C8.84537 3.79197 8.84872 3.80639 8.84872 3.821C8.84872 3.83562 8.84537 3.85004 8.83893 3.86315C8.83249 3.87627 8.82313 3.88774 8.81157 3.89667L7.10398 5.24667C7.04103 5.29623 6.94728 5.25203 6.94728 5.17033V4.27703H3.15129V3.31274Z"}))),ze=({props:e})=>o.createElement(a.A,Object.assign({component:je},e)),He=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"bg-position-vertical",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("g",null,o.createElement("path",{opacity:"0.3",d:"M0.642854 11.143L0.642854 1.2859C0.642854 1.04885 0.834372 0.85733 1.07143 0.85733L10.9286 0.857331C11.1656 0.857331 11.3571 1.04885 11.3571 1.2859L11.3571 2.81028C11.3571 2.86921 11.3089 2.91742 11.25 2.91742L10.5 2.91742C10.4411 2.91742 10.3929 2.86921 10.3929 2.81028L10.3929 1.82162L1.60714 1.82162L1.60714 10.6073L4.89285 10.6073C4.95178 10.6073 5 10.6555 5 10.7145L5 11.4645C5 11.5234 4.95178 11.5716 4.89285 11.5716L1.07143 11.5716C0.834372 11.5716 0.642854 11.3801 0.642854 11.143Z"}),o.createElement("path",{d:"M5.74087 11.1431L5.74088 4.07162C5.74088 3.83457 5.93239 3.64305 6.16945 3.64305L10.7141 3.64305C10.9511 3.64305 11.1427 3.83457 11.1427 4.07162L11.1427 11.1431C11.1427 11.3801 10.9511 11.5716 10.7141 11.5716L6.16945 11.5716C5.93239 11.5716 5.74087 11.3801 5.74087 11.1431ZM10.1248 10.5538L10.1248 4.66091L6.75873 4.66091L6.75873 10.5538L10.1248 10.5538Z"}),o.createElement("path",{d:"M3.09827 3.36576L3.09827 7.1604L2.2572 7.1604C2.17684 7.1604 2.1313 7.25415 2.18086 7.3171L3.53086 9.02603C3.53979 9.03759 3.55126 9.04695 3.56438 9.0534C3.57749 9.05984 3.59191 9.06319 3.60653 9.06319C3.62114 9.06319 3.63556 9.05984 3.64868 9.0534C3.66179 9.04695 3.67326 9.03759 3.6822 9.02603L5.0322 7.31844C5.08175 7.25549 5.03755 7.16174 4.95586 7.16174L4.06255 7.16174L4.06255 3.36576L3.09827 3.36576Z"}))),Ge=({props:e})=>o.createElement(a.A,Object.assign({component:He},e)),Ue=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"up-to-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("g",null,o.createElement("path",{d:"M11.3571 1.07142L11.3571 10.9286C11.3571 11.1656 11.1656 11.3571 10.9286 11.3571H1.07142C0.834364 11.3571 0.642846 11.1656 0.642846 10.9286V6.10714C0.642846 6.04821 0.69106 6 0.749989 6H1.49999C1.55892 6 1.60713 6.04821 1.60713 6.10714V10.3929H10.3928L10.3928 1.60714L6.10713 1.60714C6.0482 1.60714 5.99999 1.55892 5.99999 1.5V0.749995C5.99999 0.691067 6.0482 0.642853 6.10713 0.642853L10.9286 0.642853C11.1656 0.642853 11.3571 0.834371 11.3571 1.07142Z"}),o.createElement("path",{d:"M1.80978 2.53298L1.11067 3.23209C1.09644 3.24625 1.07852 3.25614 1.05895 3.26062C1.03938 3.2651 1.01894 3.264 0.999964 3.25744C0.980987 3.25088 0.964231 3.23913 0.951603 3.22352C0.938975 3.20791 0.93098 3.18907 0.928529 3.16914L0.647279 0.766466C0.639243 0.698162 0.696833 0.639233 0.766476 0.647269L3.16916 0.928519C3.25755 0.939233 3.29505 1.04772 3.2321 1.11066L2.53032 1.81245L5.96156 5.2437C6.00308 5.28522 6.00308 5.35352 5.96156 5.39504L5.39371 5.96289C5.35219 6.00441 5.28389 6.00441 5.24237 5.96289L1.80978 2.53298Z"}))),qe=({props:e})=>o.createElement(a.A,Object.assign({component:Ue},e)),Xe=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"vertical-offset-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M4.92856 10.4987L4.92856 1.17859C4.92856 1.11966 4.88034 1.07144 4.82141 1.07144L4.01784 1.07144C3.95891 1.07144 3.9107 1.11966 3.9107 1.17859L3.9107 9.28394L1.45981 7.35135C1.39016 7.29644 1.2857 7.346 1.2857 7.43573L1.2857 8.40671C1.2857 8.47234 1.31516 8.53394 1.3674 8.57546L4.23481 10.8362C4.51606 11.0572 4.92856 10.8576 4.92856 10.4987ZM8.08927 10.8214L8.08927 2.71609L10.5402 4.64868C10.6098 4.70359 10.7143 4.65403 10.7143 4.5643L10.7143 3.59332C10.7143 3.52769 10.6848 3.46609 10.6326 3.42457L7.76516 1.16385C7.48391 0.942871 7.07141 1.14243 7.07141 1.50001L7.07141 10.8214C7.07141 10.8804 7.11963 10.9286 7.17856 10.9286L7.98213 10.9286C8.04106 10.9286 8.08927 10.8804 8.08927 10.8214Z"})),$e=({props:e})=>o.createElement(a.A,Object.assign({component:Xe},e)),Ze=({props:e})=>o.createElement(d.k,e),Ye=({props:e})=>o.createElement(i.U,e),Ke=({props:e})=>o.createElement(m.R,e),Qe=({props:e})=>o.createElement(p.D,e),Je=({props:e})=>o.createElement(g.Q,e),et=({props:e})=>o.createElement(r.e,e),tt=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"mixed-view-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M12.0357 11.6071L12.0357 4.42857C12.0357 4.19152 11.8442 4 11.6071 4L7.42857 4C7.19151 4 7 4.19152 7 4.42857L7 11.6071C7 11.8442 7.19151 12.0357 7.42857 12.0357L11.6071 12.0357C11.8442 12.0357 12.0357 11.8442 12.0357 11.6071ZM8.01785 11.0179L8.01785 5.01786L11.0178 5.01786L11.0178 11.0179L8.01785 11.0179Z"}),o.createElement("path",{d:"M6.03571 11.6071L6.0357 6.42857C6.0357 6.19152 5.84419 6 5.60713 6L0.428567 6C0.191514 6 -4.29991e-06 6.19152 -4.31027e-06 6.42857L-4.05979e-06 11.6071C-4.07016e-06 11.8442 0.191514 12.0357 0.428568 12.0357L5.60713 12.0357C5.84419 12.0357 6.03571 11.8442 6.03571 11.6071ZM1.01785 11.0179L1.01785 7.01786L5.01785 7.01786L5.01785 11.0179L1.01785 11.0179Z"}),o.createElement("path",{d:"M5.99999 5.03571L0.428572 5.03571C0.191518 5.03571 0 4.84419 0 4.60714L2.45825e-06 0.428573C2.43753e-06 0.191519 0.191521 0 0.428574 0H7.60714C7.84419 0 8.03571 0.191518 8.03571 0.428572L8.03571 3H7.01785L7.01786 1.01786L1.01786 1.01786L1.01786 4.01785L5.99999 4.01785V5.03571Z"})),lt=({props:e})=>o.createElement(a.A,Object.assign({component:tt},e)),ot=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"landscape-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M0.392859 10.0357L11.5714 10.0357C11.8085 10.0357 12 9.84419 12 9.60714L12 2.42858C12 2.19152 11.8085 2 11.5714 2L0.392862 2C0.155808 2 -0.0357096 2.19152 -0.0357097 2.42857L-0.0357132 9.60714C-0.0357132 9.84419 0.155805 10.0357 0.392859 10.0357ZM0.982149 3.01786L10.9821 3.01786L10.9821 9.01786L0.982145 9.01786L0.982149 3.01786Z"})),at=({props:e})=>o.createElement(a.A,Object.assign({component:ot},e)),rt=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"portrait-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M10 11.6071L10 0.428574C10 0.191521 9.80848 2.46721e-06 9.57143 2.45684e-06L2.39286 -3.32519e-07C2.15581 -3.42881e-07 1.96429 0.191518 1.96429 0.428571L1.96429 11.6071C1.96429 11.8442 2.15581 12.0357 2.39286 12.0357L9.57143 12.0357C9.80848 12.0357 10 11.8442 10 11.6071ZM2.98215 11.0179L2.98215 1.01786L8.98214 1.01786L8.98214 11.0179L2.98215 11.0179Z"})),nt=({props:e})=>o.createElement(a.A,Object.assign({component:rt},e)),it=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"square-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M1 1.42857L1 10.5893C1 10.8263 1.19152 11.0179 1.42857 11.0179L10.5605 11.0179C10.7976 11.0179 10.9891 10.8263 10.9891 10.5893L10.9891 1.42857C10.9891 1.19151 10.7976 0.999997 10.5605 0.999997L1.42857 0.999997C1.19152 0.999997 1 1.19151 1 1.42857ZM9.97123 2.01785L9.97123 10L2.01786 10L2.01786 2.01785L9.97123 2.01785Z"})),st=({props:e})=>o.createElement(a.A,Object.assign({component:it},e)),dt=({props:e})=>o.createElement(D.Y,e),ct=({props:e})=>o.createElement(N.F,e),mt=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"crescent-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M6 1C6.112 1 6.22266 1.00383 6.332 1.0115C6.11066 1.48817 6 1.98433 6 2.5C6 2.974 6.0925 3.42717 6.2775 3.8595C6.4625 4.29183 6.71116 4.66417 7.0235 4.9765C7.33583 5.28883 7.70816 5.5375 8.1405 5.7225C8.57283 5.9075 9.026 6 9.5 6C10.0157 6 10.5118 5.88933 10.9885 5.668C10.9962 5.77733 11 5.888 11 6C11 6.453 10.9402 6.89567 10.8205 7.328C10.7008 7.76033 10.5335 8.1595 10.3185 8.5255C10.1035 8.8915 9.8425 9.22816 9.5355 9.5355C9.2285 9.84283 8.89183 10.1038 8.5255 10.3185C8.15916 10.5332 7.76 10.7005 7.328 10.8205C6.896 10.9405 6.45333 11.0003 6 11C5.54666 10.9997 5.104 10.9398 4.672 10.8205C4.24 10.7012 3.84083 10.5338 3.4745 10.3185C3.10817 10.1032 2.7715 9.84216 2.4645 9.5355C2.1575 9.22883 1.8965 8.89216 1.6815 8.5255C1.4665 8.15883 1.29917 7.75967 1.1795 7.328C1.05983 6.89633 1 6.45366 1 6C1 5.54633 1.05983 5.10367 1.1795 4.672C1.29917 4.24033 1.4665 3.84117 1.6815 3.4745C1.8965 3.10783 2.1575 2.77117 2.4645 2.4645C2.7715 2.15783 3.10817 1.89683 3.4745 1.6815C3.84083 1.46617 4.24 1.29883 4.672 1.1795C5.104 1.06017 5.54666 1.00033 6 1ZM5.0155 2.121C4.58583 2.23033 4.1855 2.40733 3.8145 2.652C3.4435 2.89667 3.1245 3.187 2.8575 3.523C2.5905 3.859 2.38083 4.24117 2.2285 4.6695C2.07617 5.09783 2 5.54117 2 5.9995C2 6.54116 2.1055 7.05866 2.3165 7.552C2.5275 8.04533 2.812 8.47116 3.17 8.8295C3.528 9.18783 3.95383 9.47233 4.4475 9.683C4.94116 9.89366 5.45866 9.99916 6 9.9995C6.45833 9.9995 6.90166 9.92333 7.33 9.771C7.75833 9.61866 8.1405 9.409 8.4765 9.142C8.8125 8.875 9.10283 8.556 9.3475 8.185C9.59216 7.814 9.76916 7.41366 9.8785 6.984C9.7665 6.99433 9.64016 6.9995 9.4995 6.9995C8.89016 6.9995 8.30816 6.88033 7.7535 6.642C7.19883 6.40366 6.72033 6.08333 6.318 5.681C5.91566 5.27867 5.59533 4.80017 5.357 4.2455C5.11867 3.69083 4.9995 3.10883 4.9995 2.4995C4.9995 2.35883 5.00516 2.233 5.0155 2.121Z"})),ut=({props:e})=>o.createElement(a.A,Object.assign({component:mt},e)),pt=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"vimeo-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M10.9952 3.66719C10.9513 4.59967 10.2888 5.87689 9.00665 7.49794C7.68113 9.19101 6.55939 10.0376 5.64191 10.0376C5.07348 10.0376 4.59281 9.52102 4.19988 8.48818L3.41305 5.64743C3.12152 4.61411 2.80855 4.09732 2.47363 4.09732C2.40051 4.09732 2.14554 4.24829 1.70874 4.54983L1.25 3.96878C1.73068 3.55248 2.20404 3.13609 2.6701 2.72027C3.31116 2.1748 3.79184 1.88809 4.11213 1.85928C4.86971 1.78774 5.33576 2.29679 5.51077 3.38725C5.69992 4.56414 5.83106 5.29554 5.90419 5.58268C6.12259 6.55838 6.36293 7.04614 6.6252 7.04614C6.82898 7.04614 7.13513 6.73064 7.54268 6.09922C7.95072 5.46781 8.16913 4.98707 8.19838 4.65719C8.25639 4.11172 8.03799 3.83953 7.54268 3.83953C7.30966 3.83953 7.06932 3.88961 6.82167 3.98997C7.30235 2.45487 8.22031 1.70847 9.57508 1.75169C10.5798 1.7805 11.0537 2.41875 10.9952 3.66719Z"})),gt=({props:e})=>o.createElement(a.A,Object.assign({component:pt},e)),ht=({props:e})=>o.createElement(j.p,e),bt=({props:e})=>o.createElement(be.$,e),ft=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"blur-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M0.326321 7.56842C0.235089 7.56842 0.157895 7.53684 0.0947368 7.47368C0.0315789 7.41052 0 7.33333 0 7.24211C0 7.15088 0.0315789 7.07368 0.0947368 7.01053C0.157895 6.94737 0.235089 6.91579 0.326321 6.91579C0.417542 6.91579 0.494731 6.94737 0.557889 7.01053C0.621047 7.07368 0.652626 7.15088 0.652626 7.24211C0.652626 7.33333 0.621047 7.41052 0.557889 7.47368C0.494731 7.53684 0.417542 7.56842 0.326321 7.56842ZM0.326321 5.08421C0.235089 5.08421 0.157895 5.05263 0.0947368 4.98947C0.0315789 4.92632 0 4.84912 0 4.75789C0 4.66667 0.0315789 4.58948 0.0947368 4.52632C0.157895 4.46316 0.235089 4.43158 0.326321 4.43158C0.417542 4.43158 0.494731 4.46316 0.557889 4.52632C0.621047 4.58948 0.652626 4.66667 0.652626 4.75789C0.652626 4.84912 0.621047 4.92632 0.557889 4.98947C0.494731 5.05263 0.417542 5.08421 0.326321 5.08421ZM2.21163 10.4C2.03897 10.4 1.89386 10.3416 1.77632 10.2248C1.65877 10.108 1.59999 9.96325 1.59999 9.79058C1.59999 9.61792 1.6584 9.47281 1.77521 9.35526C1.89201 9.23772 2.03675 9.17894 2.20942 9.17894C2.38208 9.17894 2.52719 9.23735 2.64474 9.35416C2.76228 9.47096 2.82106 9.61569 2.82106 9.78837C2.82106 9.96103 2.76265 10.1061 2.64584 10.2237C2.52904 10.3412 2.38431 10.4 2.21163 10.4ZM2.21163 7.85263C2.03897 7.85263 1.89386 7.79423 1.77632 7.67743C1.65877 7.56062 1.59999 7.41588 1.59999 7.24322C1.59999 7.07054 1.6584 6.92544 1.77521 6.8079C1.89201 6.69035 2.03675 6.63158 2.20942 6.63158C2.38208 6.63158 2.52719 6.68998 2.64474 6.80678C2.76228 6.92359 2.82106 7.06833 2.82106 7.24099C2.82106 7.41366 2.76265 7.55877 2.64584 7.67632C2.52904 7.79386 2.38431 7.85263 2.21163 7.85263ZM2.21163 5.36842C2.03897 5.36842 1.89386 5.31002 1.77632 5.19322C1.65877 5.07641 1.59999 4.93167 1.59999 4.75901C1.59999 4.58634 1.6584 4.44123 1.77521 4.32368C1.89201 4.20614 2.03675 4.14737 2.20942 4.14737C2.38208 4.14737 2.52719 4.20577 2.64474 4.32257C2.76228 4.43938 2.82106 4.58412 2.82106 4.75678C2.82106 4.92946 2.76265 5.07456 2.64584 5.1921C2.52904 5.30965 2.38431 5.36842 2.21163 5.36842ZM2.21163 2.82106C2.03897 2.82106 1.89386 2.76265 1.77632 2.64584C1.65877 2.52904 1.59999 2.38431 1.59999 2.21163C1.59999 2.03897 1.6584 1.89386 1.77521 1.77632C1.89201 1.65877 2.03675 1.59999 2.20942 1.59999C2.38208 1.59999 2.52719 1.6584 2.64474 1.77521C2.76228 1.89201 2.82106 2.03675 2.82106 2.20942C2.82106 2.38208 2.76265 2.52719 2.64584 2.64474C2.52904 2.76228 2.38431 2.82106 2.21163 2.82106ZM4.75789 8.12632C4.51228 8.12632 4.30351 8.04035 4.13158 7.86842C3.95965 7.69649 3.87368 7.48772 3.87368 7.24211C3.87368 6.99649 3.95965 6.78772 4.13158 6.61579C4.30351 6.44386 4.51228 6.3579 4.75789 6.3579C5.00351 6.3579 5.21228 6.44386 5.38421 6.61579C5.55614 6.78772 5.6421 6.99649 5.6421 7.24211C5.6421 7.48772 5.55614 7.69649 5.38421 7.86842C5.21228 8.04035 5.00351 8.12632 4.75789 8.12632ZM4.75789 5.6421C4.51228 5.6421 4.30351 5.55614 4.13158 5.38421C3.95965 5.21228 3.87368 5.00351 3.87368 4.75789C3.87368 4.51228 3.95965 4.30351 4.13158 4.13158C4.30351 3.95965 4.51228 3.87368 4.75789 3.87368C5.00351 3.87368 5.21228 3.95965 5.38421 4.13158C5.55614 4.30351 5.6421 4.51228 5.6421 4.75789C5.6421 5.00351 5.55614 5.21228 5.38421 5.38421C5.21228 5.55614 5.00351 5.6421 4.75789 5.6421ZM4.75901 10.4C4.58634 10.4 4.44123 10.3416 4.32368 10.2248C4.20614 10.108 4.14737 9.96325 4.14737 9.79058C4.14737 9.61792 4.20577 9.47281 4.32257 9.35526C4.43938 9.23772 4.58412 9.17894 4.75678 9.17894C4.92946 9.17894 5.07456 9.23735 5.1921 9.35416C5.30965 9.47096 5.36842 9.61569 5.36842 9.78837C5.36842 9.96103 5.31002 10.1061 5.19322 10.2237C5.07641 10.3412 4.93167 10.4 4.75901 10.4ZM4.75901 2.82106C4.58634 2.82106 4.44123 2.76265 4.32368 2.64584C4.20614 2.52904 4.14737 2.38431 4.14737 2.21163C4.14737 2.03897 4.20577 1.89386 4.32257 1.77632C4.43938 1.65877 4.58412 1.59999 4.75678 1.59999C4.92946 1.59999 5.07456 1.6584 5.1921 1.77521C5.30965 1.89201 5.36842 2.03675 5.36842 2.20942C5.36842 2.38208 5.31002 2.52719 5.19322 2.64474C5.07641 2.76228 4.93167 2.82106 4.75901 2.82106ZM4.75789 12C4.66667 12 4.58948 11.9684 4.52632 11.9053C4.46316 11.8421 4.43158 11.7649 4.43158 11.6737C4.43158 11.5825 4.46316 11.5053 4.52632 11.4421C4.58948 11.379 4.66667 11.3474 4.75789 11.3474C4.84912 11.3474 4.92632 11.379 4.98947 11.4421C5.05263 11.5053 5.08421 11.5825 5.08421 11.6737C5.08421 11.7649 5.05263 11.8421 4.98947 11.9053C4.92632 11.9684 4.84912 12 4.75789 12ZM4.75789 0.652626C4.66667 0.652626 4.58948 0.621047 4.52632 0.55789C4.46316 0.494732 4.43158 0.417542 4.43158 0.326321C4.43158 0.235089 4.46316 0.157895 4.52632 0.0947368C4.58948 0.0315789 4.66667 0 4.75789 0C4.84912 0 4.92632 0.0315789 4.98947 0.0947368C5.05263 0.157895 5.08421 0.235089 5.08421 0.326321C5.08421 0.417542 5.05263 0.494732 4.98947 0.55789C4.92632 0.621047 4.84912 0.652626 4.75789 0.652626ZM7.24211 8.12632C6.99649 8.12632 6.78772 8.04035 6.61579 7.86842C6.44386 7.69649 6.3579 7.48772 6.3579 7.24211C6.3579 6.99649 6.44386 6.78772 6.61579 6.61579C6.78772 6.44386 6.99649 6.3579 7.24211 6.3579C7.48772 6.3579 7.69649 6.44386 7.86842 6.61579C8.04035 6.78772 8.12632 6.99649 8.12632 7.24211C8.12632 7.48772 8.04035 7.69649 7.86842 7.86842C7.69649 8.04035 7.48772 8.12632 7.24211 8.12632ZM7.24211 5.6421C6.99649 5.6421 6.78772 5.55614 6.61579 5.38421C6.44386 5.21228 6.3579 5.00351 6.3579 4.75789C6.3579 4.51228 6.44386 4.30351 6.61579 4.13158C6.78772 3.95965 6.99649 3.87368 7.24211 3.87368C7.48772 3.87368 7.69649 3.95965 7.86842 4.13158C8.04035 4.30351 8.12632 4.51228 8.12632 4.75789C8.12632 5.00351 8.04035 5.21228 7.86842 5.38421C7.69649 5.55614 7.48772 5.6421 7.24211 5.6421ZM7.24322 10.4C7.07054 10.4 6.92544 10.3416 6.8079 10.2248C6.69035 10.108 6.63158 9.96325 6.63158 9.79058C6.63158 9.61792 6.68998 9.47281 6.80678 9.35526C6.92359 9.23772 7.06833 9.17894 7.24099 9.17894C7.41366 9.17894 7.55877 9.23735 7.67632 9.35416C7.79386 9.47096 7.85263 9.61569 7.85263 9.78837C7.85263 9.96103 7.79423 10.1061 7.67743 10.2237C7.56062 10.3412 7.41588 10.4 7.24322 10.4ZM7.24322 2.82106C7.07054 2.82106 6.92544 2.76265 6.8079 2.64584C6.69035 2.52904 6.63158 2.38431 6.63158 2.21163C6.63158 2.03897 6.68998 1.89386 6.80678 1.77632C6.92359 1.65877 7.06833 1.59999 7.24099 1.59999C7.41366 1.59999 7.55877 1.6584 7.67632 1.77521C7.79386 1.89201 7.85263 2.03675 7.85263 2.20942C7.85263 2.38208 7.79423 2.52719 7.67743 2.64474C7.56062 2.76228 7.41588 2.82106 7.24322 2.82106ZM7.30527 12C7.21404 12 7.13684 11.9684 7.07368 11.9053C7.01053 11.8421 6.97895 11.7649 6.97895 11.6737C6.97895 11.5825 7.01053 11.5053 7.07368 11.4421C7.13684 11.379 7.21404 11.3474 7.30527 11.3474C7.39649 11.3474 7.47368 11.379 7.53684 11.4421C7.59999 11.5053 7.63157 11.5825 7.63157 11.6737C7.63157 11.7649 7.59999 11.8421 7.53684 11.9053C7.47368 11.9684 7.39649 12 7.30527 12ZM7.24211 0.652626C7.15088 0.652626 7.07368 0.621047 7.01053 0.55789C6.94737 0.494732 6.91579 0.417542 6.91579 0.326321C6.91579 0.235089 6.94737 0.157895 7.01053 0.0947368C7.07368 0.0315789 7.15088 0 7.24211 0C7.33333 0 7.41052 0.0315789 7.47368 0.0947368C7.53684 0.157895 7.56842 0.235089 7.56842 0.326321C7.56842 0.417542 7.53684 0.494732 7.47368 0.55789C7.41052 0.621047 7.33333 0.652626 7.24211 0.652626ZM9.79058 10.4C9.61792 10.4 9.47281 10.3416 9.35526 10.2248C9.23772 10.108 9.17894 9.96325 9.17894 9.79058C9.17894 9.61792 9.23735 9.47281 9.35416 9.35526C9.47096 9.23772 9.61569 9.17894 9.78837 9.17894C9.96103 9.17894 10.1061 9.23735 10.2237 9.35416C10.3412 9.47096 10.4 9.61569 10.4 9.78837C10.4 9.96103 10.3416 10.1061 10.2248 10.2237C10.108 10.3412 9.96325 10.4 9.79058 10.4ZM9.79058 7.85263C9.61792 7.85263 9.47281 7.79423 9.35526 7.67743C9.23772 7.56062 9.17894 7.41588 9.17894 7.24322C9.17894 7.07054 9.23735 6.92544 9.35416 6.8079C9.47096 6.69035 9.61569 6.63158 9.78837 6.63158C9.96103 6.63158 10.1061 6.68998 10.2237 6.80678C10.3412 6.92359 10.4 7.06833 10.4 7.24099C10.4 7.41366 10.3416 7.55877 10.2248 7.67632C10.108 7.79386 9.96325 7.85263 9.79058 7.85263ZM9.79058 5.36842C9.61792 5.36842 9.47281 5.31002 9.35526 5.19322C9.23772 5.07641 9.17894 4.93167 9.17894 4.75901C9.17894 4.58634 9.23735 4.44123 9.35416 4.32368C9.47096 4.20614 9.61569 4.14737 9.78837 4.14737C9.96103 4.14737 10.1061 4.20577 10.2237 4.32257C10.3412 4.43938 10.4 4.58412 10.4 4.75678C10.4 4.92946 10.3416 5.07456 10.2248 5.1921C10.108 5.30965 9.96325 5.36842 9.79058 5.36842ZM9.79058 2.82106C9.61792 2.82106 9.47281 2.76265 9.35526 2.64584C9.23772 2.52904 9.17894 2.38431 9.17894 2.21163C9.17894 2.03897 9.23735 1.89386 9.35416 1.77632C9.47096 1.65877 9.61569 1.59999 9.78837 1.59999C9.96103 1.59999 10.1061 1.6584 10.2237 1.77521C10.3412 1.89201 10.4 2.03675 10.4 2.20942C10.4 2.38208 10.3416 2.52719 10.2248 2.64474C10.108 2.76228 9.96325 2.82106 9.79058 2.82106ZM11.6737 7.56842C11.5825 7.56842 11.5053 7.53684 11.4421 7.47368C11.379 7.41052 11.3474 7.33333 11.3474 7.24211C11.3474 7.15088 11.379 7.07368 11.4421 7.01053C11.5053 6.94737 11.5825 6.91579 11.6737 6.91579C11.7649 6.91579 11.8421 6.94737 11.9053 7.01053C11.9684 7.07368 12 7.15088 12 7.24211C12 7.33333 11.9684 7.41052 11.9053 7.47368C11.8421 7.53684 11.7649 7.56842 11.6737 7.56842ZM11.6737 5.08421C11.5825 5.08421 11.5053 5.05263 11.4421 4.98947C11.379 4.92632 11.3474 4.84912 11.3474 4.75789C11.3474 4.66667 11.379 4.58948 11.4421 4.52632C11.5053 4.46316 11.5825 4.43158 11.6737 4.43158C11.7649 4.43158 11.8421 4.46316 11.9053 4.52632C11.9684 4.58948 12 4.66667 12 4.75789C12 4.84912 11.9684 4.92632 11.9053 4.98947C11.8421 5.05263 11.7649 5.08421 11.6737 5.08421Z"})),Et=({props:e})=>o.createElement(a.A,Object.assign({component:ft},e)),vt=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"zoom-out-map",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M0.650002 11.35V7.88241H1.64073V9.65585L3.7213 7.57528L4.42472 8.2787L2.34415 10.3593H4.11759V11.35H0.650002ZM7.88241 11.35V10.3593H9.65585L7.58519 8.28861L8.28861 7.58519L10.3593 9.65585V7.88241H11.35V11.35H7.88241ZM3.71139 4.41481L1.64073 2.34415V4.11759H0.650002V0.65H4.11759V1.64073H2.34415L4.41481 3.71139L3.71139 4.41481ZM8.28861 4.41481L7.58519 3.71139L9.65585 1.64073H7.88241V0.65H11.35V4.11759H10.3593V2.34415L8.28861 4.41481Z"})),_t=({props:e})=>o.createElement(a.A,Object.assign({component:vt},e)),yt=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"paragraph-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M5.01104 12V7.61696H4.94805C4.12998 7.61696 3.43412 7.29507 2.86047 6.65128C2.28682 6.00748 2 5.22655 2 4.30848C2 3.39041 2.28682 2.60947 2.86047 1.96568C3.43412 1.32189 4.12998 1 4.94805 1H10V2.10281H8.68975V12H7.70709V2.10281H5.99371V12H5.01104Z"})),At=({props:e})=>o.createElement(a.A,Object.assign({component:yt},e)),St=({props:e})=>o.createElement(j.p,e),kt=({props:e})=>o.createElement(pe.B,e),wt=({props:e})=>o.createElement(c.T,e),Ct=({props:e})=>o.createElement(W.M,e),Bt=({props:e})=>o.createElement(x.Y,e),xt=({props:e})=>o.createElement(ce.y,e),Tt=({props:e})=>o.createElement(q.B,e),Rt=()=>o.createElement("svg",{viewBox:"0 0 30 30",focusable:"false","data-icon":"element-list-ol",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M4.375 26.8749V25.3846H7.5V24.0624H5.625V22.5721H7.5V21.2499H4.375V19.7596H7.93269C8.23238 19.7596 8.48357 19.8609 8.68628 20.0637C8.88901 20.2664 8.99038 20.5176 8.99038 20.8173V22.3077C8.99038 22.6073 8.88901 22.8585 8.68628 23.0613C8.48357 23.264 8.23238 23.3653 7.93269 23.3653C8.23238 23.3653 8.48357 23.4667 8.68628 23.6694C8.88901 23.8721 8.99038 24.1233 8.99038 24.423V25.8173C8.99038 26.1169 8.88901 26.3681 8.68628 26.5708C8.48357 26.7736 8.23238 26.8749 7.93269 26.8749H4.375ZM4.375 18.5577V15.3125C4.375 15.0128 4.47636 14.7616 4.67909 14.5589C4.88182 14.3561 5.13302 14.2548 5.43269 14.2548H7.5V12.9327H4.375V11.4423H7.93269C8.23238 11.4423 8.48357 11.5436 8.68628 11.7464C8.88901 11.9491 8.99038 12.2003 8.99038 12.5V14.6875C8.99038 14.9871 8.88901 15.2383 8.68628 15.4411C8.48357 15.6438 8.23238 15.7452 7.93269 15.7452H5.86537V17.0673H8.99038V18.5577H4.375ZM6.25 10.2404V4.61538H4.375V3.125H7.74038V10.2404H6.25ZM11.6346 23.4374V21.5625H25.6249V23.4374H11.6346ZM11.6346 15.9374V14.0625H25.6249V15.9374H11.6346ZM11.6346 8.43744V6.5625H25.6249V8.43744H11.6346Z"})),Nt=({props:e})=>o.createElement(a.A,Object.assign({component:Rt},e)),Lt=({props:e})=>o.createElement(R.c,e),It=({props:e})=>o.createElement(de.h,e),Pt=({props:e})=>o.createElement(U.W,e),Ot=({props:e})=>o.createElement(y.M,e),Ft=({props:e})=>o.createElement(F.u,e),Mt=()=>o.createElement("svg",{viewBox:"0 0 30 30",focusable:"false","data-icon":"element-text-ai",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M4.375 22.0865V20.2115H18.1249V22.0865H4.375ZM4.375 15.9807V14.1058H25.6249V15.9807H4.375ZM4.375 9.87497V8H11V9.87497H4.375Z"}),o.createElement("path",{d:"M17 13C17 13 16.6521 11.5906 16.0308 10.9692C15.4094 10.3479 14 10 14 10C14 10 15.4094 9.65215 16.0308 9.03077C16.6521 8.40939 17 7 17 7C17 7 17.3479 8.40939 17.9692 9.03077C18.5906 9.65215 20 10 20 10C20 10 18.5906 10.3479 17.9692 10.9692C17.3479 11.5906 17 13 17 13Z"}),o.createElement("path",{d:"M22.5 11C22.5 11 21.8623 8.41612 20.7231 7.27692C19.5839 6.13773 17 5.5 17 5.5C17 5.5 19.5839 4.86227 20.7231 3.72308C21.8623 2.58388 22.5 0 22.5 0C22.5 0 23.1377 2.58388 24.2769 3.72308C25.4161 4.86227 28 5.5 28 5.5C28 5.5 25.4161 6.13773 24.2769 7.27692C23.1377 8.41612 22.5 11 22.5 11Z"}),o.createElement("path",{d:"M15 5C15 5 14.7681 4.06041 14.3538 3.64615C13.9396 3.2319 13 3 13 3C13 3 13.9396 2.7681 14.3538 2.35385C14.7681 1.93959 15 1 15 1C15 1 15.2319 1.93959 15.6462 2.35385C16.0604 2.7681 17 3 17 3C17 3 16.0604 3.2319 15.6462 3.64615C15.2319 4.06041 15 5 15 5Z"}),o.createElement("path",{d:"M27 13C27 13 26.7681 12.0604 26.3538 11.6462C25.9396 11.2319 25 11 25 11C25 11 25.9396 10.7681 26.3538 10.3538C26.7681 9.93959 27 9 27 9C27 9 27.2319 9.93959 27.6462 10.3538C28.0604 10.7681 29 11 29 11C29 11 28.0604 11.2319 27.6462 11.6462C27.2319 12.0604 27 13 27 13Z"})),Dt=({props:e})=>o.createElement(a.A,Object.assign({component:Mt},e)),Vt=({props:e})=>o.createElement(fe.k,e),Wt=({props:e})=>o.createElement(ue.T,e),jt=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"typorgaf-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M6.65333 7.21508H5.1671L3.00719 4.63822L5.1671 2H6.65333L4.44481 4.63822L6.65333 7.21508ZM3.64614 7.21508H2.17379L0 4.63822L2.17379 2H3.63919L1.43762 4.63822L3.64614 7.21508Z"}),o.createElement("path",{d:"M12 6.43338L11.1167 9.98246H9.94694L11.069 6.43338H12ZM9.58089 6.43338L8.72148 9.98246H7.52784L8.6419 6.43338H9.58089Z"})),zt=({props:e})=>o.createElement(a.A,Object.assign({component:jt},e)),Ht=()=>o.createElement("svg",{width:"42",height:"43",viewBox:"0 0 42 43",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{x:"0.00830078",y:"0.173828",width:"42",height:"42",rx:"21",fill:"#4597F7"}),o.createElement("g",{clipPath:"url(#clip0_2193_1178)"},o.createElement("path",{d:"M14.0083 30.1739C13.4583 30.1739 12.9875 29.9781 12.5958 29.5864C12.2041 29.1948 12.0083 28.7239 12.0083 28.1739V14.1739C12.0083 13.6239 12.2041 13.1531 12.5958 12.7614C12.9875 12.3698 13.4583 12.1739 14.0083 12.1739H22.9333L20.9333 14.1739H14.0083V28.1739H28.0083V21.2239L30.0083 19.2239V28.1739C30.0083 28.7239 29.8125 29.1948 29.4208 29.5864C29.0291 29.9781 28.5583 30.1739 28.0083 30.1739H14.0083ZM18.0083 24.1739V19.9239L27.1833 10.7489C27.3833 10.5489 27.6083 10.3989 27.8583 10.2989C28.1083 10.1989 28.3583 10.1489 28.6083 10.1489C28.875 10.1489 29.1291 10.1989 29.3708 10.2989C29.6125 10.3989 29.8333 10.5489 30.0333 10.7489L31.4333 12.1739C31.6166 12.3739 31.7583 12.5948 31.8583 12.8364C31.9583 13.0781 32.0083 13.3239 32.0083 13.5739C32.0083 13.8239 31.9625 14.0698 31.8708 14.3114C31.7791 14.5531 31.6333 14.7739 31.4333 14.9739L22.2583 24.1739H18.0083ZM20.0083 22.1739H21.4083L27.2083 16.3739L26.5083 15.6739L25.7833 14.9739L20.0083 20.7489V22.1739Z",fill:"white"}),o.createElement("path",{d:"M14.0083 30.1739C13.4583 30.1739 12.9875 29.9781 12.5958 29.5864C12.2041 29.1948 12.0083 28.7239 12.0083 28.1739V14.1739C12.0083 13.6239 12.2041 13.1531 12.5958 12.7614C12.9875 12.3698 13.4583 12.1739 14.0083 12.1739H22.9333L20.9333 14.1739H14.0083V28.1739H28.0083V21.2239L30.0083 19.2239V28.1739C30.0083 28.7239 29.8125 29.1948 29.4208 29.5864C29.0291 29.9781 28.5583 30.1739 28.0083 30.1739H14.0083ZM18.0083 24.1739V19.9239L27.1833 10.7489C27.3833 10.5489 27.6083 10.3989 27.8583 10.2989C28.1083 10.1989 28.3583 10.1489 28.6083 10.1489C28.875 10.1489 29.1291 10.1989 29.3708 10.2989C29.6125 10.3989 29.8333 10.5489 30.0333 10.7489L31.4333 12.1739C31.6166 12.3739 31.7583 12.5948 31.8583 12.8364C31.9583 13.0781 32.0083 13.3239 32.0083 13.5739C32.0083 13.8239 31.9625 14.0698 31.8708 14.3114C31.7791 14.5531 31.6333 14.7739 31.4333 14.9739L22.2583 24.1739H18.0083ZM20.0083 22.1739H21.4083L27.2083 16.3739L26.5083 15.6739L25.7833 14.9739L20.0083 20.7489V22.1739Z",fill:"white"})),o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_2193_1178"},o.createElement("rect",{width:"24",height:"24",fill:"white",transform:"translate(9.0083 9.17383)"})))),Gt=({props:e})=>o.createElement(a.A,Object.assign({component:Ht},e)),Ut=()=>o.createElement("svg",{width:"42",height:"43",viewBox:"0 0 42 43",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{x:"0.00830078",y:"0.173828",width:"42",height:"42",rx:"21",fill:"#6A32C9"}),o.createElement("path",{d:"M12.0083 14.0129C12.0083 13.5629 12.1736 13.1726 12.5041 12.8419C12.8347 12.5114 13.225 12.3462 13.6751 12.3462L18.5083 12.3462L18.5083 14.0129L13.6751 14.0129L13.6751 28.6794L28.3416 28.6794L28.3416 14.0129L23.5083 14.0129L23.5083 12.3462L28.3416 12.3462C28.7916 12.3462 29.1819 12.5114 29.5126 12.8419C29.8431 13.1726 30.0083 13.5629 30.0083 14.0129L30.0083 28.6794C30.0083 29.1294 29.843 29.5198 29.5125 29.8504C29.1819 30.1809 28.7916 30.3462 28.3416 30.3462L13.675 30.3462C13.225 30.3462 12.8347 30.1809 12.5041 29.8504C12.1736 29.5198 12.0083 29.1294 12.0083 28.6794L12.0083 14.0129ZM16.1251 19.7294L17.3583 18.5129L20.1751 21.3294L20.1751 12.3462L21.8416 12.3462L21.8416 21.3294L24.6583 18.5129L25.8916 19.7294L21.0083 24.6129L16.1251 19.7294Z",fill:"white"})),qt=({props:e})=>o.createElement(a.A,Object.assign({component:Ut},e)),Xt=()=>o.createElement("svg",{width:"42",height:"43",viewBox:"0 0 42 43",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{x:"0.00830078",y:"0.173828",width:"42",height:"42",rx:"21",fill:"#72C240"}),o.createElement("path",{d:"M15.0669 30.9687C15.0669 30.9687 14.59 28.8216 13.738 27.875C12.886 26.9284 10.9536 26.3984 10.9536 26.3984C10.9536 26.3984 12.886 25.8684 13.738 24.9218C14.59 23.9752 15.0669 21.8281 15.0669 21.8281C15.0669 21.8281 15.5438 23.9752 16.3958 24.9218C17.2478 25.8684 19.1802 26.3984 19.1802 26.3984C19.1802 26.3984 17.2478 26.9284 16.3958 27.875C15.5438 28.8216 15.0669 30.9687 15.0669 30.9687Z",fill:"white"}),o.createElement("path",{d:"M23.7505 26.0037C23.7505 26.0037 22.9026 22.5682 21.388 21.0536C19.8734 19.539 16.438 18.6912 16.438 18.6912C16.438 18.6912 19.8734 17.8433 21.388 16.3287C22.9026 14.8141 23.7505 11.3787 23.7505 11.3787C23.7505 11.3787 24.5984 14.8141 26.113 16.3287C27.6276 17.8433 31.063 18.6912 31.063 18.6912C31.063 18.6912 27.6276 19.539 26.113 21.0536C24.5984 22.5682 23.7505 26.0037 23.7505 26.0037Z",fill:"white"}),o.createElement("path",{d:"M13.6958 17.7771C13.6958 17.7771 13.3778 16.2741 12.8099 15.6115C12.2419 14.9488 10.9536 14.5779 10.9536 14.5779C10.9536 14.5779 12.2419 14.2069 12.8099 13.5443C13.3778 12.8816 13.6958 11.3787 13.6958 11.3787C13.6958 11.3787 14.0138 12.8816 14.5817 13.5443C15.1497 14.2069 16.438 14.5779 16.438 14.5779C16.438 14.5779 15.1497 14.9488 14.5817 15.6115C14.0138 16.2741 13.6958 17.7771 13.6958 17.7771Z",fill:"white"}),o.createElement("path",{d:"M28.7144 30.2357C28.7144 30.2357 28.4494 29.1622 27.9761 28.6889C27.5028 28.2156 26.4293 27.9506 26.4293 27.9506C26.4293 27.9506 27.5028 27.6856 27.9761 27.2123C28.4494 26.739 28.7144 25.6654 28.7144 25.6654C28.7144 25.6654 28.9794 26.739 29.4527 27.2123C29.926 27.6856 30.9996 27.9506 30.9996 27.9506C30.9996 27.9506 29.926 28.2156 29.4527 28.6889C28.9794 29.1622 28.7144 30.2357 28.7144 30.2357Z",fill:"white"})),$t=({props:e})=>o.createElement(a.A,Object.assign({component:Xt},e)),Zt=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"padding-top-bottom-icon",width:"1em",height:"1em","aria-hidden":"true",fill:"currentColor"},o.createElement("path",{d:"M7.43866e-05 1.03733V0L12 0.0407197V1.07805L7.43866e-05 1.03733ZM0 11.9593V10.922L12 10.9627V12L0 11.9593Z"}),o.createElement("rect",{x:"3.5",y:"3.5",width:"5",height:"5",fill:"none",stroke:"currentColor"})),Yt=({props:e})=>o.createElement(a.A,Object.assign({component:Zt},e)),Kt=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"padding-left-right-icon",width:"1em",height:"1em","aria-hidden":"true",fill:"currentColor"},o.createElement("path",{d:"M10.9626 7.43413e-05L11.9999 7.43866e-05L11.9592 12L10.9218 12L10.9626 7.43413e-05ZM0.0405974 -5.22757e-07L1.07792 -4.77414e-07L1.0372 12L-0.00012271 12L0.0405974 -5.22757e-07Z"}),o.createElement("rect",{x:"8.5",y:"3.5",width:"5",height:"5",transform:"rotate(90 8.5 3.5)",fill:"none",stroke:"currentColor"})),Qt=({props:e})=>o.createElement(a.A,Object.assign({component:Kt},e)),Jt=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"padding-switcher",fill:"currentColor",width:"1em",height:"1em","aria-hidden":"true"},o.createElement("path",{d:"M10.959 2.00007L11.9999 2.00007L11.959 10L10.9181 10L10.959 2.00007ZM-0.00012207 2L1.04074 2L0.999842 10L-0.041016 10L-0.00012207 2Z"}),o.createElement("path",{d:"M9.99993 10.9797L9.99993 12.0205L1.99995 11.9796L1.99995 10.9387L9.99993 10.9797ZM10 0.0205078L10 1.06137L1.99995 1.02043L1.99995 -0.0204332L10 0.0205078Z"})),el=({props:e})=>o.createElement(a.A,Object.assign({component:Jt},e)),tl=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"padding-top-icon",width:"1em",height:"1em","aria-hidden":"true",fill:"currentColor"},o.createElement("path",{d:"M0 1.04086V0L11.9999 0.0408583V1.08172L0 1.04086Z"}),o.createElement("rect",{x:"3.5",y:"3.5",width:"5",height:"5",fill:"none",stroke:"currentColor"})),ll=({props:e})=>o.createElement(a.A,Object.assign({component:tl},e)),ol=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"padding-bottom-icon",width:"1em",height:"1em","aria-hidden":"true",fill:"currentColor"},o.createElement("path",{d:"M0 10.9591V12L11.9999 11.9591V10.9183L0 10.9591Z"}),o.createElement("rect",{x:"0.5",y:"-0.5",width:"5",height:"5",transform:"matrix(1 0 0 -1 3 8)",fill:"none",stroke:"currentColor"})),al=({props:e})=>o.createElement(a.A,Object.assign({component:ol},e)),rl=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"padding-left-icon",width:"1em",height:"1em","aria-hidden":"true",fill:"currentColor"},o.createElement("path",{d:"M-8.67844e-05 -4.54974e-08L1.04077 0L0.999913 12L-0.0409456 12L-8.67844e-05 -4.54974e-08Z"}),o.createElement("rect",{x:"8.5",y:"3.5",width:"5",height:"5",transform:"rotate(90 8.5 3.5)",fill:"none",stroke:"currentColor"})),nl=({props:e})=>o.createElement(a.A,Object.assign({component:rl},e)),il=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"padding-righr-icon",width:"1em",height:"1em","aria-hidden":"true",fill:"currentColor"},o.createElement("path",{d:"M12.0001 -4.54974e-08L10.9592 0L11.0001 12L12.0409 12L12.0001 -4.54974e-08Z"}),o.createElement("rect",{x:"0.5",y:"0.5",width:"5",height:"5",transform:"matrix(4.37114e-08 1 1 -4.37114e-08 3 3)",fill:"none",stroke:"currentColor"})),sl=({props:e})=>o.createElement(a.A,Object.assign({component:il},e)),dl=({props:e})=>o.createElement(A.a,e),cl=({props:e})=>o.createElement(C.A,e),ml=({props:e})=>o.createElement(oe.u,e),ul=({props:e})=>o.createElement(ae.p,e),pl=({props:e})=>o.createElement(_.Q,e),gl=({props:e})=>o.createElement(P.k,e),hl=({props:e})=>o.createElement(ie.E,e),bl=()=>o.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}),o.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})),fl=({props:e})=>o.createElement(a.A,Object.assign({component:bl},e)),El=({props:e})=>o.createElement(f.C,e),vl=({props:e})=>o.createElement(de.h,e),_l=({props:e})=>o.createElement(te.G,e),yl=({props:e})=>o.createElement(Q.I,e),Al=({props:e})=>o.createElement(le.f,e),Sl=({props:e})=>o.createElement(K.w,e),kl=({props:e})=>o.createElement(se.T,e),wl=({props:e})=>o.createElement(E.y,e),Cl=({props:e})=>o.createElement(v.c,e),Bl=({props:e})=>o.createElement(re.w,e),xl=()=>o.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"border-outer",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM484 366h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM302 548h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm364 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-182 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm0 182h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8z"})),Tl=({props:e})=>o.createElement(a.A,Object.assign({component:xl},e)),Rl=()=>o.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"appstore-add",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("defs",null,o.createElement("style",null)),o.createElement("path",{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"})),Nl=({props:e})=>o.createElement(a.A,Object.assign({component:Rl},e)),Ll=()=>o.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"appstore",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"})),Il=({props:e})=>o.createElement(a.A,Object.assign({component:Ll},e)),Pl=()=>o.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"build",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M916 210H376c-17.7 0-32 14.3-32 32v236H108c-17.7 0-32 14.3-32 32v272c0 17.7 14.3 32 32 32h540c17.7 0 32-14.3 32-32V546h236c17.7 0 32-14.3 32-32V242c0-17.7-14.3-32-32-32zm-504 68h200v200H412V278zm-68 468H144V546h200v200zm268 0H412V546h200v200zm268-268H680V278h200v200z"})),Ol=({props:e})=>o.createElement(a.A,Object.assign({component:Pl},e)),Fl=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"search-outlined",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M10.7667 11.5L6.80463 7.53797C6.49908 7.79599 6.14443 7.99799 5.74069 8.14398C5.33696 8.28997 4.90735 8.36297 4.45186 8.36297C3.34736 8.36297 2.4126 7.98017 1.64756 7.21458C0.88252 6.449 0.5 5.52131 0.5 4.43149C0.5 3.34168 0.882795 2.41397 1.64838 1.64838C2.41396 0.882795 3.34336 0.5 4.43658 0.5C5.52979 0.5 6.45748 0.882795 7.21967 1.64838C7.98187 2.41397 8.36297 3.34219 8.36297 4.43302C8.36297 4.87336 8.29167 5.29553 8.14908 5.69955C8.00649 6.10355 7.79939 6.47531 7.52778 6.81482L11.5 10.7667L10.7667 11.5ZM4.44167 7.34446C5.248 7.34446 5.93337 7.06012 6.4978 6.49144C7.06223 5.92277 7.34444 5.23612 7.34444 4.43149C7.34444 3.62685 7.06223 2.9402 6.4978 2.37153C5.93337 1.80286 5.248 1.51852 4.44167 1.51852C3.62968 1.51852 2.93949 1.80286 2.3711 2.37153C1.80271 2.9402 1.51851 3.62685 1.51851 4.43149C1.51851 5.23612 1.80271 5.92277 2.3711 6.49144C2.93949 7.06012 3.62968 7.34446 4.44167 7.34446Z"})),Ml=({props:e})=>o.createElement(a.A,Object.assign({component:Fl},e)),Dl=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"close-outlined",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M1.84745 11L1 10.1526L5.15255 6L1 1.84745L1.84745 1L6 5.15255L10.1526 1L11 1.84745L6.84745 6L11 10.1526L10.1526 11L6 6.84745L1.84745 11Z"})),Vl=({props:e})=>o.createElement(a.A,Object.assign({component:Dl},e)),Wl=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"add-image",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M1.11007 11.9944C0.804799 11.9944 0.543469 11.8858 0.326081 11.6684C0.108694 11.451 0 11.1896 0 10.8844V1.11563C0 0.810353 0.108694 0.549023 0.326081 0.331636C0.543469 0.114248 0.804799 0.0055542 1.11007 0.0055542H7.64848V1.11563H1.11007V10.8844H10.8788V4.35707H11.9889V10.8844C11.9889 11.1896 11.8802 11.451 11.6628 11.6684C11.4454 11.8858 11.1841 11.9944 10.8788 11.9944H1.11007ZM9.54672 3.80204V2.45883H8.20352V1.34876H9.54672V0.0055542H10.6568V1.34876H12V2.45883H10.6568V3.80204H9.54672ZM1.99815 9.30805H9.99074L7.55966 6.06661L5.4838 8.80852L3.9408 6.76596L1.99815 9.30805Z"})),jl=({props:e})=>o.createElement(a.A,Object.assign({component:Wl},e)),zl=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"merge-tags",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M7.2 10.8V9.60001H9C9.17 9.60001 9.3125 9.54251 9.4275 9.42751C9.5425 9.31251 9.6 9.17 9.6 9V7.8C9.6 7.42 9.71 7.07501 9.93 6.76501C10.15 6.45501 10.44 6.235 10.8 6.105V5.895C10.44 5.765 10.15 5.545 9.93 5.235C9.71 4.925 9.6 4.58 9.6 4.2V3C9.6 2.83 9.5425 2.6875 9.4275 2.5725C9.3125 2.4575 9.17 2.4 9 2.4H7.2V1.2H9C9.5 1.2 9.925 1.375 10.275 1.725C10.625 2.075 10.8 2.5 10.8 3V4.2C10.8 4.37 10.8575 4.5125 10.9725 4.6275C11.0875 4.7425 11.23 4.8 11.4 4.8H12V7.2H11.4C11.23 7.2 11.0875 7.25751 10.9725 7.37251C10.8575 7.48751 10.8 7.63 10.8 7.8V9C10.8 9.5 10.625 9.92501 10.275 10.275C9.925 10.625 9.5 10.8 9 10.8H7.2ZM3 10.8C2.5 10.8 2.075 10.625 1.725 10.275C1.375 9.92501 1.2 9.5 1.2 9V7.8C1.2 7.63 1.1425 7.48751 1.0275 7.37251C0.9125 7.25751 0.77 7.2 0.6 7.2H0V4.8H0.6C0.77 4.8 0.9125 4.7425 1.0275 4.6275C1.1425 4.5125 1.2 4.37 1.2 4.2V3C1.2 2.5 1.375 2.075 1.725 1.725C2.075 1.375 2.5 1.2 3 1.2H4.8V2.4H3C2.83 2.4 2.6875 2.4575 2.5725 2.5725C2.4575 2.6875 2.4 2.83 2.4 3V4.2C2.4 4.58 2.29 4.925 2.07 5.235C1.85 5.545 1.56 5.765 1.2 5.895V6.105C1.56 6.235 1.85 6.45501 2.07 6.76501C2.29 7.07501 2.4 7.42 2.4 7.8V9C2.4 9.17 2.4575 9.31251 2.5725 9.42751C2.6875 9.54251 2.83 9.60001 3 9.60001H4.8V10.8H3Z"})),Hl=({props:e})=>o.createElement(a.A,Object.assign({component:zl},e)),Gl=({props:e})=>o.createElement(he.b,e),Ul=({props:e})=>o.createElement(J.Z,e),ql=({props:e})=>o.createElement(ge.U,e),Xl=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"email-confirmation",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M8.00198 11.3105L5.85436 9.16288L6.47419 8.54304L8.00198 10.0708L11.1186 6.95415L11.7385 7.574L8.00198 11.3105ZM5.95912 5.48748L10.2718 2.75493H1.64641L5.95912 5.48748ZM5.95912 6.36049L1.61149 3.59303V9.2851H4.74564L5.61864 10.1581H1.61149C1.37577 10.1581 1.17134 10.0715 0.998197 9.8984C0.825052 9.72525 0.73848 9.52081 0.73848 9.2851V2.75493C0.73848 2.51922 0.825052 2.31479 0.998197 2.14165C1.17134 1.9685 1.37577 1.88193 1.61149 1.88193H10.3155C10.5512 1.88193 10.7556 1.9685 10.9288 2.14165C11.1019 2.31479 11.1885 2.51922 11.1885 2.75493V5.64463L10.3155 6.51766V3.59303L5.95912 6.36049Z"})),$l=({props:e})=>o.createElement(a.A,Object.assign({component:Xl},e)),Zl=({props:e})=>o.createElement(ee.l,e),Yl=({props:e})=>o.createElement(S.x,e),Kl=({props:e})=>o.createElement(B.H,e),Ql=({props:e})=>o.createElement(k.L,e),Jl=()=>o.createElement("svg",{viewBox:"0 -960 960 960",focusable:"false","data-icon":"button",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M186.666-280q-27 0-46.833-19.833T120-346.666v-266.668q0-27 19.833-46.833T186.666-680h586.668q27 0 46.833 19.833T840-613.334v266.668q0 27-19.833 46.833T773.334-280H186.666Zm0-66.666h586.668v-266.668H186.666v266.668Zm0 0v-266.668 266.668Z"})),eo=({props:e})=>o.createElement(a.A,Object.assign({component:Jl},e)),to=()=>o.createElement("svg",{viewBox:"0 -960 960 960",focusable:"false","data-icon":"button",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M186.666-120q-27 0-46.833-19.833T120-186.666v-586.668q0-27 19.833-46.833T186.666-840h586.668q27 0 46.833 19.833T840-773.334v586.668q0 27-19.833 46.833T773.334-120H186.666Zm0-66.666h151.001v-151.001H186.666v151.001Zm217.667 0h151.334v-151.001H404.333v151.001Zm218 0h151.001v-151.001H622.333v151.001ZM186.666-404.333h151.001v-151.334H186.666v151.334Zm217.667 0h151.334v-151.334H404.333v151.334Zm218 0h151.001v-151.334H622.333v151.334Zm-435.667-218h151.001v-151.001H186.666v151.001Zm217.667 0h151.334v-151.001H404.333v151.001Zm218 0h151.001v-151.001H622.333v151.001Z"})),lo=({props:e})=>o.createElement(a.A,Object.assign({component:to},e)),oo=({props:e})=>o.createElement(Y.M,e),ao=()=>o.createElement("svg",{viewBox:"0 -960 960 960",focusable:"false","data-icon":"button",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M120-120v-175.333L490.667-666l-67.334-66.667 46.667-46L556.667-692l136-136q5-5 11.5-8t13.167-3q6.666 0 13 3 6.333 3 12.333 8L828-742.667q5 6 8 12.333 3 6.334 3 13 0 6.667-3 13.167t-8 11.5L692.333-557 779-469.666l-46.333 46.333L666-490.667 295.333-120H120Zm66.666-66.666h84L618-534.667 534.667-618 186.666-270.666v84Zm457.667-416.667L759-718l-41-41-114.667 114.667 41 41Zm0 0-41-41 41 41Z"})),ro=({props:e})=>o.createElement(a.A,Object.assign({component:ao},e)),no=({svgString:e,...t})=>o.createElement("span",Object.assign({role:"img",className:"anticon",dangerouslySetInnerHTML:{__html:e}},t)),io=({props:e})=>o.createElement(_e.F,e),so=({props:e})=>o.createElement(O.T,e),co=({props:e})=>o.createElement(H.r,e),mo=({props:e})=>o.createElement(Q.I,e),uo=({props:e})=>o.createElement(Z.W,e),po=({props:e})=>o.createElement(s.m,e),go=({props:e})=>o.createElement(me.d,e),ho=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"replacer",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M8.08337 10V9.16663H9.58337C9.74721 9.16663 9.88538 9.11075 9.99788 8.999C10.1104 8.88717 10.1666 8.74863 10.1666 8.58338V7.41663C10.1666 7.10554 10.2597 6.82637 10.4459 6.57912C10.632 6.33196 10.8722 6.15975 11.1666 6.0625V5.9375C10.8722 5.84583 10.632 5.675 10.4459 5.425C10.2597 5.175 10.1666 4.89446 10.1666 4.58337V3.41663C10.1666 3.25138 10.1108 3.11283 9.999 3.001C9.88717 2.88925 9.74862 2.83337 9.58337 2.83337H8.08337V2H9.58337C9.97779 2 10.3125 2.13775 10.5875 2.41325C10.8625 2.68867 11 3.02313 11 3.41663V4.58337C11 4.74862 11.0559 4.88717 11.1678 4.999C11.2795 5.11075 11.418 5.16663 11.5834 5.16663H12V6.83338H11.5834C11.418 6.83338 11.2795 6.88925 11.1678 7.001C11.0559 7.11283 11 7.25138 11 7.41663V8.58338C11 8.97688 10.8623 9.31133 10.5868 9.58675C10.3113 9.86225 9.97687 10 9.58337 10H8.08337ZM2.41662 10C2.02221 10 1.6875 9.86225 1.4125 9.58675C1.1375 9.31133 1 8.97688 1 8.58338V7.41663C1 7.25138 0.944083 7.11283 0.83225 7.001C0.7205 6.88925 0.581958 6.83338 0.416625 6.83338H0V5.16663H0.416625C0.581958 5.16663 0.7205 5.11075 0.83225 4.999C0.944083 4.88717 1 4.74862 1 4.58337V3.41663C1 3.02313 1.13775 2.68867 1.41325 2.41325C1.68867 2.13775 2.02312 2 2.41662 2H3.91662V2.83337H2.41662C2.25279 2.83337 2.11463 2.88925 2.00213 3.001C1.88963 3.11283 1.83337 3.25138 1.83337 3.41663V4.58337C1.83337 4.89446 1.74029 5.175 1.55413 5.425C1.36804 5.675 1.12779 5.84583 0.833375 5.9375V6.0625C1.12779 6.15975 1.36804 6.33196 1.55413 6.57912C1.74029 6.82637 1.83337 7.10554 1.83337 7.41663V8.58338C1.83337 8.74863 1.88925 8.88717 2.001 8.999C2.11283 9.11075 2.25137 9.16663 2.41662 9.16663H3.91662V10H2.41662Z"}),o.createElement("path",{d:"M6.48214 7.88473V7.13473C6.48214 7.0758 6.43393 7.02759 6.375 7.02759H5.625C5.56607 7.02759 5.51786 7.0758 5.51786 7.13473V7.88473C5.51786 7.94366 5.56607 7.99187 5.625 7.99187H6.375C6.43393 7.99187 6.48214 7.94366 6.48214 7.88473ZM4.25893 7.88473V7.13473C4.25893 7.0758 4.21072 7.02759 4.15179 7.02759H3.40179C3.34286 7.02759 3.29464 7.0758 3.29464 7.13473V7.88473C3.29464 7.94366 3.34286 7.99187 3.40179 7.99187H4.15179C4.21072 7.99187 4.25893 7.94366 4.25893 7.88473ZM8.70536 7.88473V7.13473C8.70536 7.0758 8.65715 7.02759 8.59822 7.02759H7.84822C7.78929 7.02759 7.74107 7.0758 7.74107 7.13473V7.88473C7.74107 7.94366 7.78929 7.99187 7.84822 7.99187H8.59822C8.65715 7.99187 8.70536 7.94366 8.70536 7.88473Z"})),bo=({props:e})=>o.createElement(a.A,Object.assign({component:ho},e)),fo=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"editor-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M1 7.14578V6.10422H5.07403V7.14578H1ZM1 4.59375V3.55203H7.38889V4.59375H1ZM1 2.04172V1H7.38889V2.04172H1ZM6 11V9.07812L9.06944 5.64062C9.15278 5.54688 9.24537 5.47917 9.34722 5.4375C9.44907 5.39583 9.55093 5.375 9.65278 5.375C9.76389 5.375 9.87037 5.39844 9.97222 5.44531C10.0741 5.49219 10.1667 5.5625 10.25 5.65625L10.7639 6.23438C10.8442 6.32812 10.9036 6.43229 10.9421 6.54688C10.9807 6.66146 11 6.77604 11 6.89062C11 7.00521 10.98 7.1224 10.9399 7.24219C10.8997 7.36198 10.8382 7.46875 10.7554 7.5625L7.70833 11H6ZM6.83333 10.0625H7.36111L9.04167 8.15625L8.79167 7.85938L8.52778 7.57812L6.83333 9.46875V10.0625ZM8.79167 7.85938L8.52778 7.57812L9.04167 8.15625L8.79167 7.85938Z"})),Eo=({props:e})=>o.createElement(a.A,Object.assign({component:fo},e)),vo=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"designer-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M6 12C5.18 12 4.405 11.8425 3.675 11.5275C2.945 11.2125 2.3075 10.7825 1.7625 10.2375C1.2175 9.6925 0.7875 9.055 0.4725 8.325C0.1575 7.595 0 6.82 0 6C0 5.1567 0.16085 4.37005 0.48255 3.64005C0.80415 2.91005 1.24245 2.27505 1.79745 1.73505C2.35245 1.19505 3.00165 0.77085 3.74505 0.46245C4.48835 0.15415 5.28335 0 6.13005 0C6.92335 0 7.675 0.13415 8.385 0.40245C9.095 0.67085 9.7175 1.04255 10.2525 1.51755C10.7875 1.99255 11.2125 2.55585 11.5275 3.20745C11.8425 3.85915 12 4.57 12 5.34C12 6.4433 11.6733 7.3058 11.02 7.9275C10.3666 8.5492 9.52665 8.86005 8.50005 8.86005H7.38C7.23 8.86005 7.10585 8.91505 7.00755 9.02505C6.90915 9.13505 6.85995 9.2567 6.85995 9.39C6.85995 9.61 6.9333 9.82085 7.08 10.0225C7.2267 10.2241 7.30005 10.4566 7.30005 10.72C7.30005 11.14 7.1842 11.4584 6.9525 11.6749C6.7208 11.8916 6.4033 12 6 12ZM2.56995 6.46005C2.78995 6.46005 2.9783 6.3817 3.135 6.225C3.2917 6.0683 3.37005 5.87995 3.37005 5.65995C3.37005 5.43995 3.2917 5.25165 3.135 5.09505C2.9783 4.93835 2.78995 4.86 2.56995 4.86C2.34995 4.86 2.16165 4.93835 2.00505 5.09505C1.84835 5.25165 1.77 5.43995 1.77 5.65995C1.77 5.87995 1.84835 6.0683 2.00505 6.225C2.16165 6.3817 2.34995 6.46005 2.56995 6.46005ZM4.42995 3.96C4.64995 3.96 4.8383 3.88165 4.995 3.72495C5.1517 3.56835 5.23005 3.38005 5.23005 3.16005C5.23005 2.94005 5.1517 2.7517 4.995 2.595C4.8383 2.4383 4.64995 2.35995 4.42995 2.35995C4.20995 2.35995 4.02165 2.4383 3.86505 2.595C3.70835 2.7517 3.63 2.94005 3.63 3.16005C3.63 3.38005 3.70835 3.56835 3.86505 3.72495C4.02165 3.88165 4.20995 3.96 4.42995 3.96ZM7.57005 3.96C7.79005 3.96 7.97835 3.88165 8.13495 3.72495C8.29165 3.56835 8.37 3.38005 8.37 3.16005C8.37 2.94005 8.29165 2.7517 8.13495 2.595C7.97835 2.4383 7.79005 2.35995 7.57005 2.35995C7.35005 2.35995 7.1617 2.4383 7.005 2.595C6.8483 2.7517 6.76995 2.94005 6.76995 3.16005C6.76995 3.38005 6.8483 3.56835 7.005 3.72495C7.1617 3.88165 7.35005 3.96 7.57005 3.96ZM9.48 6.46005C9.7 6.46005 9.88835 6.3817 10.045 6.225C10.2016 6.0683 10.28 5.87995 10.28 5.65995C10.28 5.43995 10.2016 5.25165 10.045 5.09505C9.88835 4.93835 9.7 4.86 9.48 4.86C9.26 4.86 9.07165 4.93835 8.91495 5.09505C8.75835 5.25165 8.68005 5.43995 8.68005 5.65995C8.68005 5.87995 8.75835 6.0683 8.91495 6.225C9.07165 6.3817 9.26 6.46005 9.48 6.46005ZM6 11C6.1033 11 6.17915 10.9766 6.22755 10.93C6.27585 10.8833 6.3 10.8133 6.3 10.72C6.3 10.58 6.22665 10.4384 6.07995 10.295C5.93335 10.1517 5.86005 9.88 5.86005 9.48C5.86005 9.0333 6.00835 8.65165 6.30495 8.33505C6.60165 8.01835 6.97335 7.86 7.42005 7.86H8.50005C9.22665 7.86 9.82495 7.6475 10.295 7.2225C10.765 6.7975 11 6.17 11 5.34C11 4.0567 10.5125 3.01255 9.53745 2.20755C8.56245 1.40255 7.42665 1.00005 6.13005 1.00005C4.70335 1.00005 3.49165 1.48335 2.49495 2.44995C1.49835 3.41665 1.00005 4.6 1.00005 6C1.00005 7.3833 1.48755 8.56245 2.46255 9.53745C3.43755 10.5125 4.6167 11 6 11Z"})),_o=({props:e})=>o.createElement(a.A,Object.assign({component:vo},e)),yo=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"clear-chat",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M0 9.5V8.33327H9.33333V9.5H0ZM1.33333 6.58327V5.41672H10.6667V6.58327H1.33333ZM2.66667 3.66672V2.5H12V3.66672H2.66667Z"})),Ao=({props:e})=>o.createElement(a.A,Object.assign({component:yo},e)),So=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"webhook",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M2.89995 11.7C2.10335 11.7 1.42085 11.4159 0.85245 10.8476C0.28415 10.2792 0 9.59665 0 8.80005C0 8.11005 0.20585 7.50755 0.61755 6.99255C1.02915 6.47755 1.55665 6.14335 2.20005 5.98995V7.035C1.85005 7.1683 1.56255 7.39495 1.33755 7.71495C1.11255 8.03495 1.00005 8.39665 1.00005 8.80005C1.00005 9.32665 1.18505 9.77495 1.55505 10.145C1.92505 10.515 2.37335 10.7 2.89995 10.7C3.42665 10.7 3.875 10.515 4.245 10.145C4.615 9.77495 4.8 9.32665 4.8 8.80005V8.29995H8.46495C8.54495 8.20995 8.6408 8.13745 8.7525 8.08245C8.8642 8.02745 8.98005 7.99995 9.10005 7.99995C9.32335 7.99995 9.5125 8.07745 9.6675 8.23245C9.8225 8.38745 9.9 8.57665 9.9 8.80005C9.9 9.01665 9.8225 9.20415 9.6675 9.36255C9.5125 9.52085 9.32335 9.6 9.10005 9.6C8.98005 9.6 8.8642 9.5725 8.7525 9.5175C8.6408 9.4625 8.54495 9.39 8.46495 9.3H5.76C5.62 9.99 5.28415 10.5625 4.75245 11.0175C4.22085 11.4725 3.60335 11.7 2.89995 11.7ZM9.10005 11.7C8.59335 11.7 8.12915 11.5809 7.70745 11.3426C7.28585 11.1042 6.94505 10.79 6.68505 10.4H8.08005C8.22665 10.5 8.38665 10.575 8.56005 10.625C8.73335 10.675 8.91335 10.7 9.10005 10.7C9.62665 10.7 10.075 10.515 10.445 10.145C10.815 9.77495 11 9.32665 11 8.80005C11 8.27335 10.815 7.825 10.445 7.455C10.075 7.085 9.62665 6.9 9.10005 6.9C8.90665 6.9 8.7283 6.92415 8.565 6.97245C8.4017 7.02085 8.24505 7.09335 8.09505 7.18995L6.195 3.99495C5.9917 3.95495 5.82505 3.8633 5.69505 3.72C5.56505 3.5767 5.50005 3.40335 5.50005 3.19995C5.50005 2.97665 5.5792 2.7875 5.7375 2.6325C5.8958 2.4775 6.0833 2.4 6.3 2.4C6.5233 2.4 6.71245 2.4775 6.86745 2.6325C7.02245 2.7875 7.09995 2.97665 7.09995 3.19995C7.09995 3.24335 7.0983 3.28255 7.095 3.31755C7.0917 3.35255 7.08005 3.4017 7.06005 3.465L8.52495 5.955C8.62495 5.935 8.72495 5.92085 8.82495 5.91255C8.92495 5.90415 9.01665 5.89995 9.10005 5.89995C9.90335 5.89995 10.5875 6.18245 11.1525 6.74745C11.7175 7.31245 12 7.99665 12 8.80005C12 9.59665 11.7175 10.2792 11.1525 10.8476C10.5875 11.4159 9.90335 11.7 9.10005 11.7ZM2.89995 9.6C2.68335 9.6 2.49585 9.52085 2.33745 9.36255C2.17915 9.20415 2.1 9.01665 2.1 8.80005C2.1 8.60665 2.165 8.4383 2.295 8.295C2.425 8.1517 2.58665 8.05505 2.77995 8.00505L4.36005 5.355C4.06335 5.0717 3.82915 4.74585 3.65745 4.37745C3.48585 4.00915 3.40005 3.61665 3.40005 3.19995C3.40005 2.39665 3.6842 1.7125 4.2525 1.1475C4.8208 0.582503 5.5033 0.300003 6.3 0.300003C7.0833 0.300003 7.7558 0.572503 8.3175 1.1175C8.8792 1.6625 9.17335 2.32335 9.19995 3.10005H8.20005C8.18005 2.59335 7.9867 2.16665 7.62 1.81995C7.2533 1.47335 6.8133 1.30005 6.3 1.30005C5.7733 1.30005 5.32495 1.48505 4.95495 1.85505C4.58495 2.22505 4.39995 2.67335 4.39995 3.19995C4.39995 3.62335 4.52495 4.00085 4.77495 4.33245C5.02495 4.66415 5.3433 4.89165 5.73 5.01495L3.645 8.52C3.665 8.5767 3.67915 8.6267 3.68745 8.67C3.69585 8.7133 3.70005 8.75665 3.70005 8.80005C3.70005 9.01665 3.62255 9.20415 3.46755 9.36255C3.31255 9.52085 3.12335 9.6 2.89995 9.6Z"})),ko=({props:e})=>o.createElement(a.A,Object.assign({component:So},e)),wo=({props:e})=>o.createElement(X.R,e),Co=({props:e})=>o.createElement($.k,e),Bo=({props:e})=>o.createElement(V.m,e),xo=({props:e})=>o.createElement(ve.C,e),To=({props:e})=>o.createElement(L.P,e),Ro=({props:e})=>o.createElement(ne.p,e),No=({props:e})=>o.createElement(w.N,e),Lo=({props:e})=>o.createElement(Ee._,e),Io=({props:e})=>o.createElement(T.f,e),Po=({props:e})=>o.createElement(G.G,e),Oo=()=>o.createElement("svg",{viewBox:"0 0 30 30",focusable:"false","data-icon":"reload",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M15.0625 24.6874C12.359 24.6874 10.0581 23.7467 8.1599 21.8653C6.26167 19.9839 5.31255 17.6955 5.31255 15V14.0239L3.00002 16.3365L1.68274 15.0192L6.25002 10.4519L10.8173 15.0192L9.50002 16.3365L7.18749 14.0239V15C7.18749 17.1714 7.95192 19.0164 9.48077 20.5348C11.0096 22.0533 12.8702 22.8125 15.0625 22.8125C15.5801 22.8125 16.0974 22.756 16.6142 22.643C17.131 22.5301 17.6354 22.3606 18.1274 22.1346L19.5336 23.5408C18.8301 23.919 18.1038 24.2047 17.3546 24.3978C16.6054 24.5909 15.8414 24.6874 15.0625 24.6874ZM23.75 19.548L19.1827 14.9808L20.5 13.6635L22.8126 15.976V15C22.8126 12.8285 22.0481 10.9835 20.5193 9.46509C18.9904 7.94666 17.1298 7.18744 14.9375 7.18744C14.4199 7.18744 13.9027 7.24393 13.3858 7.35691C12.869 7.46989 12.3646 7.63935 11.8726 7.86531L10.4664 6.45913C11.1699 6.08092 11.8963 5.79526 12.6455 5.60216C13.3947 5.40905 14.1587 5.3125 14.9375 5.3125C17.641 5.3125 19.9419 6.2532 21.8401 8.13459C23.7384 10.016 24.6875 12.3045 24.6875 15V15.976L27 13.6635L28.3173 14.9808L23.75 19.548Z"})),Fo=({props:e})=>o.createElement(a.A,Object.assign({component:Oo},e)),Mo=()=>o.createElement("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"add-slide",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o.createElement("path",{d:"M6.49995 7.42005H7.5V5.50005H9.42V4.5H7.5V2.58H6.49995V4.5H4.57995V5.50005H6.49995V7.42005ZM3 10C2.73 10 2.49585 9.90085 2.29755 9.70245C2.09915 9.50415 1.99995 9.27 1.99995 9V1.00005C1.99995 0.73005 2.09915 0.49585 2.29755 0.29745C2.49585 0.0991503 2.73 0 3 0H11C11.27 0 11.5041 0.0991503 11.7025 0.29745C11.9008 0.49585 12 0.73005 12 1.00005V9C12 9.27 11.9008 9.50415 11.7025 9.70245C11.5041 9.90085 11.27 10 11 10H3ZM3 9H11V1.00005H3V9ZM1.00005 12C0.73005 12 0.49585 11.9008 0.29745 11.7025C0.09915 11.5041 0 11.27 0 11V1.99995H1.00005V11H10V12H1.00005Z"})),Do=({props:e})=>o.createElement(a.A,Object.assign({component:Mo},e)),Vo=({props:e})=>o.createElement(M.H,e),Wo=()=>o.createElement("svg",{width:"18",height:"19",viewBox:"0 0 18 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{x:"0.371338",y:"0.878906",width:"17.29",height:"17.29",rx:"8.645",fill:"white"}),o.createElement("path",{d:"M5.30034 14.1689L4.37134 13.2399L8.08734 9.52391L4.37134 5.80791L5.30034 4.87891L9.01634 8.59491L12.7323 4.87891L13.6613 5.80791L9.94534 9.52391L13.6613 13.2399L12.7323 14.1689L9.01634 10.4529L5.30034 14.1689Z",fill:"#1677FF"})),jo=({props:e})=>o.createElement(a.A,Object.assign({component:Wo},e)),zo=()=>o.createElement("svg",{width:"18",height:"19",viewBox:"0 0 18 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{x:"0.371338",y:"0.878906",width:"17.29",height:"17.29",rx:"8.645",fill:"#1F1F1F"}),o.createElement("path",{d:"M5.30034 14.1689L4.37134 13.2399L8.08734 9.52391L4.37134 5.80791L5.30034 4.87891L9.01634 8.59491L12.7323 4.87891L13.6613 5.80791L9.94534 9.52391L13.6613 13.2399L12.7323 14.1689L9.01634 10.4529L5.30034 14.1689Z",fill:"white"})),Ho=({props:e})=>o.createElement(a.A,Object.assign({component:zo},e)),Go=()=>o.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M5.04156 6.58339L0.208313 1.75014L1.39156 0.566895L7.40831 6.58339L1.39156 12.6001L0.208313 11.4169L5.04156 6.58339Z",fill:"#545456"})),Uo=({props:e})=>o.createElement(a.A,Object.assign({component:Go},e)),qo=()=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20px",viewBox:"0 -960 960 960",width:"19px",fill:"#545456"},o.createElement("path",{d:"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"})),Xo=({props:e})=>o.createElement(a.A,Object.assign({component:qo},e)),$o=()=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20px",viewBox:"0 -960 960 960",width:"19px",fill:"#545456"},o.createElement("path",{d:"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"})),Zo=({props:e})=>o.createElement(a.A,Object.assign({component:$o},e)),Yo=({icon:e,...t})=>{const l=(0,Ae.rD)();if(l.icons&&l.icons[e]){const a=l.icons[e].replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"").replace(/<\/?(?:script|embed|object|frameset|frame|iframe|applet|meta)[^>]*>/gi,"").replace(/ on\w+="[^"]*"/g,"").replace(/ on\w+='[^']*'/g,"");return o.createElement(no,Object.assign({svgString:a},t))}switch(e){case"AddSlide":return o.createElement(Do,{props:t});case"AMP":return o.createElement(Vo,{props:t});case"ElementAccordion":return o.createElement(Io,{props:t});case"Reload":return o.createElement(Fo,{props:t});case"Web":return o.createElement(Bo,{props:t});case"Lock":return o.createElement(wo,{props:t});case"UnLock":return o.createElement(Co,{props:t});case"DesignerMode":return o.createElement(_o,{props:t});case"EditorMode":return o.createElement(Eo,{props:t});case"ClearChat":return o.createElement(Ao,{props:t});case"Speed":return o.createElement(go,{props:t});case"Justify":return o.createElement(po,{props:t});case"Colorize":return o.createElement(ro,{props:t});case"Email":return o.createElement(oo,{props:t});case"Table":return o.createElement(lo,{props:t});case"Button":return o.createElement(eo,{props:t});case"Group":return o.createElement(Ql,{props:t});case"Block":return o.createElement(Kl,{props:t});case"Column":return o.createElement(Yl,{props:t});case"Atom":return o.createElement(Zl,{props:t});case"Styles":return o.createElement(Ce,{props:t});case"Close":return o.createElement(Be,{props:t});case"Drop":return o.createElement(Pe,{props:t});case"DarkWhite":return o.createElement(Fe,{props:t});case"MinWidth":return o.createElement(De,{props:t});case"MaxWidth":return o.createElement(We,{props:t});case"BgPositionHorizontal":return o.createElement(ze,{props:t});case"BgPositionVertical":return o.createElement(Ge,{props:t});case"UpTo":return o.createElement(qe,{props:t});case"VerticalOffset":return o.createElement($e,{props:t});case"AlignHorizontalLeft":return o.createElement(Ze,{props:t});case"AlignHorizontalCenter":return o.createElement(Ye,{props:t});case"AlignHorizontalRight":return o.createElement(Ke,{props:t});case"AlignVerticalTop":return o.createElement(Qe,{props:t});case"AlignVerticalCenter":return o.createElement(Je,{props:t});case"AlignVerticalBottom":return o.createElement(et,{props:t});case"MixedView":return o.createElement(lt,{props:t});case"LandscapeView":return o.createElement(at,{props:t});case"PortraitView":return o.createElement(nt,{props:t});case"SquareView":return o.createElement(st,{props:t});case"PanelLeft":return o.createElement(dt,{props:t});case"Sun":return o.createElement(he.b,{props:t});case"Crescent":return o.createElement(ut,{props:t});case"Vimeo":return o.createElement(gt,{props:t});case"Image":return o.createElement(ht,{props:t});case"Blur":return o.createElement(Et,{props:t});case"ZoomOutMap":return o.createElement(_t,{props:t});case"Paragraph":return o.createElement(At,{props:t});case"ElementImage":return o.createElement(St,{props:t});case"ElementImageAI":return o.createElement(kt,{props:t});case"ElementText":return o.createElement(wt,{props:t});case"ElementTitle":return o.createElement(Ct,{props:t});case"ElementButton":return o.createElement(Bt,{props:t});case"ElementSpacer":return o.createElement(xt,{props:t});case"ElementListUL":return o.createElement(Tt,{props:t});case"ElementListOL":return o.createElement(Nt,{props:t});case"ElementDivider":return o.createElement(Lt,{props:t});case"ElementSocial":return o.createElement(It,{props:t});case"ElementTable":return o.createElement(Pt,{props:t});case"ElementCountdown":return o.createElement(Ot,{props:t});case"ElementVideo":return o.createElement(Ft,{props:t});case"ElementTextAI":return o.createElement(Dt,{props:t});case"ElementCarousel":return o.createElement(Po,{props:t});case"ElementForm":return o.createElement(Vt,{props:t});case"AI":return o.createElement(Wt,{props:t});case"Typograf":return o.createElement(zt,{props:t});case"NewEmail":return o.createElement(Gt,{props:t});case"Import":return o.createElement(qt,{props:t});case"generationAI":return o.createElement($t,{props:t});case"PaddingTopBottom":return o.createElement(Yt,{props:t});case"PaddingLeftRight":return o.createElement(Qt,{props:t});case"PaddingSwitcher":return o.createElement(el,{props:t});case"PaddingTop":return o.createElement(ll,{props:t});case"PaddingBottom":return o.createElement(al,{props:t});case"PaddingLeft":return o.createElement(nl,{props:t});case"PaddingRight":return o.createElement(sl,{props:t});case"Code":return o.createElement(dl,{props:t});case"GoToParent":return o.createElement(cl,{props:t});case"UndoOutlined":return o.createElement(ml,{props:t});case"RedoOutlined":return o.createElement(ul,{props:t});case"HistoryOutlined":return o.createElement(pl,{props:t});case"EyeOutlined":return o.createElement(gl,{props:t});case"SendOutlined":return o.createElement(hl,{props:t});case"CheckCircleOutlined":return o.createElement(fl,{props:t});case"CheckCircleVerified":return o.createElement(El,{props:t});case"ShareAltOutlined":return o.createElement(vl,{props:t});case"MobileOutlined":return o.createElement(_l,{props:t});case"DesktopOutlined":return o.createElement(yl,{props:t});case"PlusCircleOutlined":return o.createElement(Al,{props:t});case"CommentOutlined":return o.createElement(Sl,{props:t});case"SettingOutlined":return o.createElement(kl,{props:t});case"BorderOuterOutlined":return o.createElement(Tl,{props:t});case"AppstoreAddOutlined":return o.createElement(Nl,{props:t});case"AppstoreOutlined":return o.createElement(Il,{props:t});case"BuildOutlined":return o.createElement(Ol,{props:t});case"SearchOutlined":return o.createElement(Ml,{props:t});case"CloseOutlined":return o.createElement(Vl,{props:t});case"AddImage":return o.createElement(jl,{props:t});case"MergeTags":return o.createElement(Hl,{props:t});case"ArrowLeftOutlined":return o.createElement(we,{props:t});case"ChatGpt":return o.createElement(ke,{props:t});case"LightMode":return o.createElement(Gl,{props:t});case"DarkMode":return o.createElement(Ul,{props:t});case"AutoMode":return o.createElement(ql,{props:t});case"EmailConfirmation":return o.createElement($l,{props:t});case"SliderGroup":return o.createElement(io,{props:t});case"SliderTemplates":return o.createElement(so,{props:t});case"SliderBlocks":return o.createElement(co,{props:t});case"SliderAdaptive":return o.createElement(mo,{props:t});case"SliderMagic":return o.createElement(uo,{props:t});case"Replacer":return o.createElement(bo,{props:t});case"WebHook":return o.createElement(ko,{props:t});case"CloseAll":return o.createElement(Ho,{props:t});case"CloseTag":return o.createElement(jo,{props:t});case"GroupArrow":return o.createElement(Uo,{props:t});case"Subscript":return o.createElement(Xo,{props:t});case"Superscript":return o.createElement(Zo,{props:t});case"DotsHoriz":return o.createElement(ct,{props:t});case"CloudUploadOutlined":return o.createElement(xo,{props:t});case"CloudDownloadOutlined":return o.createElement(To,{props:t});case"SaveOutlined":return o.createElement(Ro,{props:t});case"CopyOutlined":return o.createElement(No,{props:t});case"DeleteOutlined":return o.createElement(Lo,{props:t});case"Target":return o.createElement(bt,{props:t});case"DownOutlined":return o.createElement(wl,{props:t});case"RightOutlined":return o.createElement(Cl,{props:t});case"SyncOutlined":return o.createElement(Bl,{props:t});case"AlignLeftOutlined":return o.createElement(xe,{props:t});case"AlignCenterOutlined":return o.createElement(Te,{props:t});case"AlignRightOutlined":return o.createElement(Re,{props:t});case"ImageAdd":return o.createElement(Ne,{props:t});case"Edit":return o.createElement(Le,{props:t});default:return null}}},9008:(e,t,l)=>{"use strict";let o;async function a(){return o||(o=await l.e(1729).then(l.t.bind(l,1729,19)).then(e=>e.default))}l.d(t,{F:()=>a})},10486:(e,t,l)=>{"use strict";l.d(t,{A:()=>$n});var o=l(98173),a=l(47555),r=l(40120),n=l(35491),i=l(13785),s=l(49856),d=l(62913),c=l(94674),m=l(93511),u=l(99291),p=l(53361),g=l(37969),h=l(201),b=l(66964),f=l(29123),E=l(48753),v=l(2604),_=l(30150),y=l(12543),A=l(5558),S=l(85591),k=l.n(S),w=l(76487),C=l(69550),B=l(8218),x=l(49823),T=l(67034),R=l(94780),N=l(59010),L=l(38927),I=l(40186),P=l(35076),O=l(71879),F=l(65716),M=l(83027),D=l(23424),V=l(32947);const W=({taxonomy:e})=>{var t;const{__:l,_x:a}=(0,y.s9)(),r=(0,v.wA)(),[n]=C.A.useForm(),i=(0,o.useRef)(null),s=(0,v.d4)(D.cL)===V.lx.ADD_NEW_GROUP_MODAL,d=(0,A.hN)();let c;({data:c}=(0,_.KC)());const m=`project_${c.id}`,u=null===(t=c[V.bV.GROUP])||void 0===t?void 0:t[0],[p]=(0,F.OD)(),[h]=(0,M.y$)(),b=(0,o.useCallback)(()=>{n.resetFields(),setTimeout(()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.focus({cursor:"start"})},0)},[n]);(0,o.useEffect)(()=>{s&&b()},[s,b]);const f=()=>r((0,D.Oo)()),[S,k]=(0,M.JI)(),[w,x]=(0,o.useState)(!1),[T,R]=(0,o.useState)(u),N=()=>{const t=(t,o)=>p({projectId:c.id,[e]:o||T}).then(async o=>{if("error"in o)d.error(o);else if("data"in o){const r=o.data,n=await S({name:t,parent:r[e][0]});if(!("error"in n))return d.success({message:l("The group \u201c")+n.data.name+a("\u201d was successfully created.",e)}),R(r[e][0]),h({parent:r[e][0]}).then(({data:e,error:t})=>{e?f():t&&d.error({error:t})});d.error({res_1:n})}});n.validateFields().then(({name:o})=>(x(!0),T?S({name:o,parent:T}).then(t=>{"error"in t?d.error(t):(d.success({message:l("The group \u201c")+t.data.name+a("\u201d was successfully created.",e)}),f(),h({parent:T}))}):S({name:m}).then(e=>{if(!("error"in e))return t(o,e.data.id);{const{data:l}=e.error;if("term_exists"===l.code&&l.data.term_id)return t(o,l.data.term_id);d.error(e)}}).catch(e=>{}).finally(()=>x(!1)))).catch(e=>{}).finally(()=>x(!1))};return o.createElement(E.A,{title:l("Add a new group"),open:s,onOk:N,onCancel:f,className:"new-group-modal",centered:!0,footer:[o.createElement(g.Ay,{key:"submit",type:"primary",size:"large",loading:k.isLoading||w,onClick:N},l("Create group"))]},o.createElement(C.A,{form:n,layout:"vertical",name:"add_new_group_form",onFinish:N,initialValues:{remember:!1,name:""},autoComplete:"off",style:{paddingTop:10}},o.createElement(C.A.Item,{name:"name",rules:[{required:!0,message:l("Please enter the group name")}]},o.createElement(B.A,{disabled:k.isLoading,size:"large",placeholder:l("Enter the group name"),ref:i,style:{marginBottom:5}}))))},j=({group:e,refetch:t})=>{const{__:l,_x:a}=(0,y.s9)(),r=(0,v.wA)(),[n]=C.A.useForm(),i=(0,o.useRef)(null),s=(0,v.d4)(D.cL)===V.lx.EDIT_GROUP_NAME_MODAL,d=(0,A.hN)(),{id:c=null,name:m=""}=e,u=()=>r((0,D.Oo)()),[p,h]=(0,M.CE)();(0,o.useEffect)(()=>{s&&n.setFieldsValue({name:m})},[s,m,n]);const b=()=>{n.validateFields().then(({name:e})=>{p({id:c,data:{name:e}}).then(({data:o,error:r})=>{r?(d.error({message:r.data.code,description:r.data.message}),n.setFieldValue("name",e)):(t().then(({data:e})=>{if(e){var t,l,o;const a=null===(t=e[0])||void 0===t||null===(l=t.children)||void 0===l||null===(o=l.find(e=>e.id===c))||void 0===o?void 0:o.name;n.setFieldValue("name",a)}}),u(),d.success({message:l("The group \u201c")+e+a("\u201d was successfully changed to \u201c","group")+o.name+l("\u201d.")}))})})};return o.createElement(E.A,{title:l("Change group name"),open:s,onOk:b,onCancel:u,className:"new-group-name-modal",centered:!0,footer:[o.createElement(g.Ay,{key:"submit",type:"primary",size:"large",loading:h.isLoading,onClick:b},l("Change name"))]},o.createElement(C.A,{form:n,layout:"vertical",name:"rename_group_form",onFinish:b,initialValues:{remember:!1,name:m},autoComplete:"off",style:{paddingTop:10}},o.createElement(C.A.Item,{name:"name",rules:[{required:!0,message:l("Please enter the group name")}]},o.createElement(B.A,{disabled:h.isLoading,size:"large",placeholder:l("Enter the group name"),ref:i,style:{marginBottom:5}}))))};var z=l(8807),H=l(1047);const{useToken:G}=r.A,U=({className:e,refetchProjectGroups:t,isLoading:l})=>{const{__:a,_x:r}=(0,y.s9)(),i=(0,v.wA)(),s=(0,A.hN)(),{modal:d}=n.A.useApp(),{confirm:c}=d,{token:m}=G(),u=(0,v.d4)(H.UI),[p]=(0,M.Lh)(),f=(e,l)=>{c({maskClosable:!0,centered:!0,title:r("Are you sure to delete \u201c","group")+l+a("\u201d group and all nested groups?"),icon:o.createElement(I.A,{style:{color:"#ff4d4f"}}),okText:a("Yes"),cancelText:a("No"),onOk:()=>(e=>{p(e).unwrap().then(e=>{null!==e&&void 0!==e&&e.deleted&&(s.success({message:a("The group \u201c")+e.previous.name+r("\u201d was successfully deleted.","recovery")}),t())}).catch(e=>{s.error({message:e.data.code,description:e.data.message})})})(String(e))})},E=e=>[{label:a("Rename"),key:"Rename",icon:o.createElement(P.A,{style:{fontSize:"16px"}}),onClick:()=>{return t=e.id,l=e.name,i((0,D.qf)(V.lx.EDIT_GROUP_NAME_MODAL)),void S({id:t,name:l});var t,l}},{label:a("Remove"),icon:o.createElement(I.A,{style:{fontSize:"16px"}}),key:"Remove",style:{color:"#ff4d4f"},onClick:()=>f(e.id,e.name)}],[_,S]=(0,o.useState)({id:null,name:""});return o.createElement("div",{className:k()("groups-management",{[e]:e})},l?o.createElement(N.A,{active:!0}):o.createElement(h.A,null,!(null===u||void 0===u||!u.length)&&(null===u||void 0===u?void 0:u.map((e,t)=>{var l;return o.createElement(b.A,{key:e.id,span:24},o.createElement(C.A.Item,{name:`group_${e.id}`,style:{marginBottom:m.formItemMarginBottomMD},label:o.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%",alignItems:"center"}},o.createElement("span",null,e.name),o.createElement(g.Ay,{type:"text",className:"groups-management__group_menu","data-group-id":e.id,size:"large"},o.createElement(L.A,{className:"groups-management__group_menu-inner",placement:"bottomLeft",menu:{items:E(e)},trigger:["hover"]},o.createElement("span",{className:"groups-management__actions"},o.createElement(O.A,null))))),className:"groups-management__group-select",rules:[{message:"Please input category name!",type:"array"}]},o.createElement(x.A,{mode:"tags",style:{width:"100%"},placeholder:a("Type category here"),options:null===(l=e.children)||void 0===l?void 0:l.map(e=>({label:e.name,value:String(e.id)})),tagRender:e=>{const{label:t,closable:l,onClose:a}=e;return o.createElement(T.A,{color:m.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:l,onClose:a,style:{borderRadius:6}},t)},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})))})),o.createElement(b.A,{span:24},o.createElement(C.A.Item,{style:{marginBottom:m.formItemMarginBottomMD}},o.createElement(g.Ay,{id:"add_group_button",icon:o.createElement(z.A,{icon:"AddSlide"}),style:{width:"100%"},onClick:()=>i((0,D.qf)(V.lx.ADD_NEW_GROUP_MODAL))},a("Add group"))))),o.createElement(W,{taxonomy:V.bV.GROUP}),o.createElement(j,{group:_,refetch:t}))};var q=l(68984),X=l(98845),$=l(12741),Z=l(39206),Y=l(27941),K=l(40277);const{useToken:Q}=r.A,{title:J,description:ee,tags:te,type:le,is_template:oe,group:ae}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template",group:"group"},re={[J]:"",[ee]:"",[te]:[],[oe]:!1},ne={[ee]:"",[te]:[],[le]:""};const ie=({className:e="",element:t})=>{var l,a;const{__:r}=(0,y.s9)(),{projectId:n}=(0,_.g)(),d=(0,v.wA)(),[m]=C.A.useForm(),{token:u}=Q(),p=(0,Y.rD)(),g=(0,v.Pj)(),h=(0,v.d4)(H.UI),{data:b}=(0,q.h1)(),{data:E}=(0,_.KC)(),A=t.hasOwnProperty("type")?V.IE:V.Tm,S=t.hasOwnProperty("type")?V.YY:V.zh,{refetch:w,isLoading:N,isFetching:L,isUninitialized:I,isSuccess:P}=(0,M.Oo)({parent:null===(l=E.group)||void 0===l?void 0:l[0]},{skip:!(null!==(a=E.group)&&void 0!==a&&a[0])});(0,o.useEffect)(()=>{!I&&w()},[I,w]);const[O,D]=(0,o.useState)([]),[W,j]=(0,o.useState)([]),[z,G]=(0,o.useState)(t.is_template||!1),{data:oe}=F.Nq.endpoints.getProject.select(+n)(g.getState());(0,o.useEffect)(()=>{!I&&w()},[t.group,w,I]),(0,o.useEffect)(()=>{if(P&&t.is_template&&t.group.length){const e=t.group;let l={};e.length&&h.length&&(null===e||void 0===e||e.forEach(e=>{null===h||void 0===h||h.forEach(t=>{let o=t.children.find(t=>t.id===e);o&&(l.hasOwnProperty(t.id)||(l[t.id]=[]),l[t.id].push({label:o.name,value:o.id}))})}));let o={};for(let t in l)l.hasOwnProperty(+t)&&(o[`group_${t}`]=l[t].map(e=>({...e,value:String(e.value)})));m.setFieldsValue(o)}},[m,h,t.is_template,t.group,P]),(0,o.useEffect)(()=>{var e;j(null===(e=function(e){const t=new Set;return null===e||void 0===e?void 0:e.filter(e=>!t.has(e.name)&&(t.add(e.name),!0))}((0,K.HT)(oe,S)))||void 0===e?void 0:e.map(e=>({value:e.name,key:e.id})))},[oe,S]),(0,o.useEffect)(()=>{if(t){var e,l;const o=null===(e=(0,K._q)(t,S))||void 0===e?void 0:e.map(e=>e.name),a=t.emailtags||t.blocktags,r=null===(l=(0,K._q)(t,S))||void 0===l?void 0:l.filter(e=>a.includes(e.id)).map(e=>e.name);m.setFieldsValue({title:t.title,description:t.description,tags:t.tags||r||o,type:t.type})}},[m,t,S]);(0,o.useEffect)(()=>{if(b){const e=b.schema.properties.acf.properties.type.items.enum;let t=[];const l={Applications:r("Apps"),Articles:r("Article"),Banners:r("Banners"),Buttons:r("Buttons"),"Call to Action":r("Call to Action"),Contacts:r("Contacts"),Content:r("Content"),"E-Commerce":r("E-Commerce"),Feature:r("Features"),Footer:r("Footers"),Header:r("Headers"),Lists:r("Lists"),Menu:r("Menus"),Other:r("Others"),Polls:r("Polls"),Promocodes:r("Promocodes"),Separators:r("Separators")};for(let o in e)t.push({label:l[e[o]],value:e[o]});D(t)}},[b,r]);return o.createElement("div",{className:k()("settings-panel",{[e]:e})},o.createElement(C.A,{form:m,layout:"vertical",name:"settings_panel_form",initialValues:A===V.Tm?{EmailInitialValues:re}:ne,onValuesChange:e=>{const l=Object.keys(e)[0];switch(l.split("_")[0]){case J:t.isNew?d((0,$.BQ)(e[l])):d((0,H.VK)(e[l]));break;case ae:d((0,H.Bu)({[l.split("_")[1]]:e[l]}));break;case ee:A===V.Tm?t.isNew?d((0,$.Zs)(e[l])):d(X.GY.util.updateQueryData("getEmail",t.id,t=>{Object.assign(t,{description:e[l]})})):t.isNew?d((0,Z.AS)(e[l])):d(q.VM.util.updateQueryData("getBlock",t.id,t=>{Object.assign(t,{description:e[l]})}));break;case"is":t.isNew?d((0,$.TC)(e[l])):d(X.GY.util.updateQueryData("getEmail",t.id,t=>{Object.assign(t,{is_template:e[l]})}));break;case te:{const o=e[l].map(e=>e.trim());A===V.Tm?t.isNew?d((0,$.yY)(o)):d(X.GY.util.updateQueryData("getEmail",t.id,e=>{Object.assign(e,{tags:o})})):t.isNew?d((0,Z.TB)(o)):d(q.VM.util.updateQueryData("getBlock",t.id,e=>{Object.assign(e,{tags:o})}));break}case le:d(q.VM.util.updateQueryData("getBlock",t.id,t=>{Object.assign(t,{type:e[l]})}));break;default:return}},autoComplete:"off"},p.subjectEnabled&&A===V.Tm&&o.createElement(C.A.Item,{label:r("Title"),name:J,tooltip:{title:r("The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it."),icon:o.createElement(R.A,null)}},o.createElement(B.A.TextArea,{placeholder:r("Type title here"),autoSize:{minRows:1}})),p.descriptionEnabled&&o.createElement(C.A.Item,{label:r("Description"),name:ee,tooltip:{title:r("Description is used in other sections of the service."),icon:o.createElement(R.A,null)}},o.createElement(B.A.TextArea,{placeholder:r("Type your description here"),autoSize:{minRows:2}})),p.tagsEnabled&&o.createElement(C.A.Item,{label:r("Tags"),name:te,tooltip:{title:r("Tags help you find the block in the list."),icon:o.createElement(R.A,null)},rules:[{message:"Please input your username!",type:"array"}]},o.createElement(x.A,{mode:"tags",style:{width:"100%"},placeholder:r("Type your tags here"),options:W,tagRender:e=>{const{label:t,closable:l,onClose:a}=e;return o.createElement(T.A,{color:u.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:l,onClose:a,style:{borderRadius:6}},t)},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})),A===V.Tm&&p.isTemplateEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:16}}),o.createElement(i.A,{title:t.isNew?r("Save email first."):r("Use this email as a template for creating future emails."),key:"isTemplate"},o.createElement(s.A,{size:10,align:"baseline"},o.createElement(C.A.Item,{name:"is_template",valuePropName:"checked",initialValue:z},o.createElement(f.A,{size:"small",id:"setIsTemplate",onChange:e=>{G(e)},disabled:t.isNew})),o.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2,fontSize:14,color:u.colorText}},o.createElement("label",{htmlFor:"setIsTemplate"},r("Is a template")))))),z&&o.createElement(U,{element:t,refetchProjectGroups:w,isLoading:N||L}),A===V.IE&&o.createElement(C.A.Item,{name:le,label:r("Type"),tooltip:{title:r("Select the block type to find any block on the list faster."),icon:o.createElement(R.A,null)},rules:[{message:"Please input type!"}]},o.createElement(x.A,{placeholder:r("Choose block type"),options:O,getPopupContainer:()=>document.querySelector(".email-settings__collapse")}))))};ie.defaultProps={email:void 0};const se=ie,{utm_source:de,utm_medium:ce,utm_campaign:me,utm_term:ue,utm_content:pe}={utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content"},ge={[de]:"",[ce]:"",[me]:"",[ue]:"",[pe]:""},he=({className:e="",email:t})=>{const{__:l}=(0,y.s9)(),a=(0,v.wA)(),[r]=C.A.useForm();(0,o.useEffect)(()=>{var e,l,o,a,n;t&&r.setFieldsValue({utm_source:(null===(e=t.utm_parameters)||void 0===e?void 0:e.utm_source)||"",utm_medium:(null===(l=t.utm_parameters)||void 0===l?void 0:l.utm_medium)||"",utm_campaign:(null===(o=t.utm_parameters)||void 0===o?void 0:o.utm_campaign)||"",utm_term:(null===(a=t.utm_parameters)||void 0===a?void 0:a.utm_term)||"",utm_content:(null===(n=t.utm_parameters)||void 0===n?void 0:n.utm_content)||""})},[r,t]);return o.createElement("div",{className:k()("settings-panel",{[e]:e})},o.createElement(C.A,{form:r,layout:"vertical",name:"settings_panel_form_utm",initialValues:ge,onValuesChange:e=>{const l=Object.keys(e)[0];switch(l){case de:t.isNew?a((0,$.K3)(e[l])):a(X.GY.util.updateQueryData("getEmail",t.id,t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_source:e[l]}})}));break;case ce:t.isNew?a((0,$.ol)(e[l])):a(X.GY.util.updateQueryData("getEmail",t.id,t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_medium:e[l]}})}));break;case me:t.isNew?a((0,$.P3)(e[l])):a(X.GY.util.updateQueryData("getEmail",t.id,t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_campaign:e[l]}})}));break;case ue:t.isNew?a((0,$.zH)(e[l])):a(X.GY.util.updateQueryData("getEmail",t.id,t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_term:e[l]}})}));break;case pe:t.isNew?a((0,$.mk)(e[l])):a(X.GY.util.updateQueryData("getEmail",t.id,t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_content:e[l]}})}));break;default:return}},autoComplete:"off"},o.createElement(u.A,{message:l("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),o.createElement(C.A.Item,{label:l("utm_source"),name:de,tooltip:{title:l("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:o.createElement(R.A,null)}},o.createElement(B.A,{placeholder:l("google")})),o.createElement(C.A.Item,{label:l("utm_medium"),name:ce,tooltip:{title:l("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:o.createElement(R.A,null)}},o.createElement(B.A,{placeholder:l("cpc")})),o.createElement(C.A.Item,{label:l("utm_campaign"),name:me,tooltip:{title:l("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:o.createElement(R.A,null)}},o.createElement(B.A,{placeholder:l("spring_sale")})),o.createElement(C.A.Item,{label:l("utm_term"),name:ue,tooltip:{title:l("Identifies search terms. For example: utm_term=running+shoes"),icon:o.createElement(R.A,null)}},o.createElement(B.A,{placeholder:l("running+shoes")})),o.createElement(C.A.Item,{label:l("utm_content"),name:pe,tooltip:{title:l("Indicates what user clicked to get to the site: a banner or a text link. It is often used for A/B testing and ad campaigns. Example: utm_content=logolink or utm_content=textlink"),icon:o.createElement(R.A,null)}},o.createElement(B.A,{placeholder:l("textlink")}))))},be=({email:e})=>{const{__:t}=(0,y.s9)(),l=e.hasOwnProperty("type")?V.IE:V.Tm,[a,r]=(0,o.useState)(V.yy),n=(0,Y.rD)();let i=[{label:o.createElement(o.Fragment,null,t("Settings")),key:V.yy,forceRender:!0,className:"email-settings__collapse-panel",children:o.createElement(se,{className:"email-settings__collapse-panel-content",element:e})}];return n.UTMEnabled&&l===V.Tm&&i.push({label:o.createElement(o.Fragment,null,t("UTM parameters")),key:V.iW,forceRender:!0,className:"email-settings__collapse-panel",children:o.createElement(he,{className:"email-settings__collapse-panel-content",email:e})}),o.createElement(o.Fragment,null,o.createElement(m.A,{className:"secondary-tabs email-settings__collapse",size:"large",animated:{inkBar:!1,tabPane:!1},activeKey:a,onChange:e=>r(e||""),items:i}))};var fe=l(42490),Ee=l(5795),ve=l(6056);l(69039);const _e=({id:e,onChange:t,value:l,externalValue:a,alignRight:r,placeholder:n,isDisabled:i=!1,usedColors:s=[],codeMode:d=!1})=>{const{__:m}=(0,y.s9)(),u=(0,v.d4)(H.iy),[p,f]=(0,o.useState)(!0),E=(0,o.useRef)(null),_=(0,o.useRef)(null),A=(0,o.useRef)(t),S=e=>{const t=e.toHexString().toUpperCase();A.current&&A.current(t),E.current&&(E.current.style.backgroundColor=t),_.current&&(_.current.input.value=t)};(0,o.useEffect)(()=>{"undefined"===typeof EyeDropper&&f(!1)},[l]),(0,o.useEffect)(()=>{void 0!==a&&a!==l&&S({toHexString:()=>a})},[a]);const w=async()=>{try{if("undefined"===typeof EyeDropper)return void alert("Your browser does not support the EyeDropper API.");const e=new EyeDropper,t=(await e.open()).sRGBHex.toUpperCase();A.current&&A.current(t),E.current&&(E.current.style.backgroundColor=t),_.current&&(_.current.input.value=t)}catch(e){}};return o.createElement("div",{className:"color-picker-input"},o.createElement("div",{className:k()("color-picker-input__control-wrap",{"color-picker-input__empty":!l})},o.createElement(ve.A,{disabledAlpha:!0,format:"hex",defaultFormat:"hex",getPopupContainer:e=>e.closest(d?".selected_text_common_form_mobile":".email-pane__collapse-wrapper"),className:"color-picker-input__btn-wrap",rootClassName:"verticalColorpicker",value:""===l||null===l?void 0:l,onChange:S,panelRender:(e,{components:{Picker:t,Presets:l}})=>o.createElement(h.A,{justify:"space-between",wrap:!1},o.createElement(b.A,{flex:"auto"},o.createElement(t,null),p&&o.createElement(g.Ay,{onClick:w,size:"small",style:{position:"absolute",top:215,left:179,height:28,width:28,padding:0,zIndex:2,minWidth:"auto",fontSize:18}},o.createElement(z.A,{icon:"Colorize",style:{position:"relative",top:-2}}))),o.createElement(c.A,{type:"vertical",style:{height:"auto"}}),o.createElement(b.A,{span:8},o.createElement(l,null))),disabled:u||i,presets:[{label:m("Used"),colors:s},{label:m("Recommended"),colors:["#000000","#595959","#BFBFBF","#E5E5E5","#F5F5F5","#F5222D","#FA8C16","#FADB14","#8BBB11","#52C41A","#13A8A8","#1677FF","#2F54EB"]}]}),""===l&&o.createElement("div",{className:"color-picker-input__empty-bg"}),o.createElement(B.A,{allowClear:!0,id:e,disabled:u||i,className:"color-picker-input__control",placeholder:n||m("Select color"),value:l,ref:_,onChange:t})))};var ye=l(63719),Ae=l(80772),Se=l(48956),ke=l(871),we=l(47014),Ce=l(84572);const{Text:Be}=ye.A,xe=({onChange:e,value:t,validateStatus:l,placeholder:a,disabled:r,name:n,elementSettings:s,imageInfo:d})=>{var c,m;const u=(0,v.d4)(we.C1),p=(0,v.d4)(we.B$),h=(0,v.d4)(Ce.yN),b=(0,Y.rD)(),{__:f}=(0,y.s9)(),[E,_]=(0,o.useState)({width:"",height:"",size:""}),[A,S]=(0,o.useState)(!1),[w,C]=(0,o.useState)(0);let x=(0,v.wA)();const T=(0,v.d4)(Ae.js),R=(0,v.d4)(Ae.Uf),N=(0,v.d4)(Ae.Ac),I=(0,v.d4)(D.cL),[P]=(0,ke.FQ)();let O=!p&&(null===(c=u.id)||void 0===c?void 0:c.toString())===(null===h||void 0===h||null===(m=h.members)||void 0===m?void 0:m.owner.ID)&&!0;(0,o.useEffect)(()=>{t&&P(t).then(({data:e})=>{e&&_({width:null===e||void 0===e?void 0:e.width,height:null===e||void 0===e?void 0:e.height,size:((null===e||void 0===e?void 0:e.fileSize)/1024).toFixed(0),format:null===e||void 0===e?void 0:e.format})})},[t,P]),(0,o.useEffect)(()=>{r||(n.startsWith("src")&&T&&((null===s||void 0===s?void 0:s.type)!==V.bV.CAROUSEL||R===n&&!I)?(e(T),x((0,Ae.BK)())):"backgroundImage"===n&&N&&((null===s||void 0===s?void 0:s.type)!==V.bV.CAROUSEL||R===n&&!I)&&(e(N),x((0,Ae.BK)())),I&&(null===s||void 0===s?void 0:s.type)===V.bV.CAROUSEL||!R||x((0,Ae.BK)()))},[T,R,N,e,n,r,null===s||void 0===s?void 0:s.type,x,I]);const F=(e=null)=>{n.startsWith("src")?(x((0,Ae.Yw)(n)),x((0,Ae.tm)(t)),x((0,D.qf)(e||V.lx.UPLOAD_IMAGE_MODAL))):n.startsWith("backgroundImage")&&(x((0,Ae.Yw)(n)),x((0,Ae.e_)(t)),x((0,D.qf)(e||V.lx.UPLOAD_BACKGROUND_MODAL)))},M=[{label:f("Upload"),key:"Upload",onClick:()=>F(n.startsWith("src")?V.lx.UPLOAD_IMAGE_MODAL_UPLOAD:V.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}];b.imageCenterStockEnabled&&M.push({label:f("Stock"),key:"Stock",onClick:()=>F(n.startsWith("src")?V.lx.UPLOAD_IMAGE_MODAL_STOCK:V.lx.UPLOAD_BACKGROUND_MODAL_STOCK)}),b.imageCenterGifEnabled&&M.push({label:f("GIF"),key:"GIF",onClick:()=>F(n.startsWith("src")?V.lx.UPLOAD_IMAGE_MODAL_GIF:V.lx.UPLOAD_BACKGROUND_MODAL_GIF)}),b.elementAIimageEnabled&&M.push({label:f("AI"),key:"AI",onClick:()=>F(n.startsWith("src")?V.lx.UPLOAD_IMAGE_MODAL_AI:V.lx.UPLOAD_BACKGROUND_MODAL_AI)});return o.createElement("div",{className:k()("upload-bg-image",{"upload-bg-image_disabled":r})},!t||t&&"error"===l?o.createElement(g.Ay,{type:"default",block:!0,onClick:()=>F(n.startsWith("src")?V.lx.UPLOAD_IMAGE_MODAL_UPLOAD:V.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD),icon:o.createElement(z.A,{icon:"Image",size:16,strokeWidth:b.iconStrokeWidth})},f("Add image")):o.createElement("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:e=>{var t,l,o,a;null!==(t=e.target)&&void 0!==t&&t.closest(".upload-bg-image__edit")||null!==(l=e.target)&&void 0!==l&&l.closest(".upload-bg-image__edit-menu")||null!==(o=e.target)&&void 0!==o&&o.closest(".upload-bg-image__menu")||null!==(a=e.target)&&void 0!==a&&a.closest(".inputGroup")||F(n.startsWith("src")?V.lx.UPLOAD_IMAGE_MODAL_UPLOAD:V.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}},o.createElement(L.A,{arrow:!0,dropdownRender:()=>b.imagePathDropdownEnabled?o.createElement("div",{className:"inputGroup"},o.createElement(B.A,{prefix:o.createElement(z.A,{icon:"Image",size:20,strokeWidth:b.iconStrokeWidth,style:{verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:t,placeholder:a,name:n,disabled:r,className:"upload-bg-image__input"})):o.createElement(o.Fragment,null),overlayClassName:"upload-bg-image__dropdown-overlay",overlayStyle:{top:32,marginTop:"8px",width:347,left:0},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".upload-bg-image__inner-wrap")},o.createElement("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"}},o.createElement("div",{className:"upload-bg-image__uploader"},o.createElement("div",{className:"upload-bg-image__uploader-content"},o.createElement("div",{className:"upload-bg-image__uploader-content-inner"},o.createElement("div",{className:"upload-bg-image__uploader-img-wrap"},o.createElement("img",{className:"upload-bg-image__uploader-img",src:t,alt:""})),o.createElement("div",{className:"upload-bg-image__uploader-icons-wrap"},o.createElement("div",{className:"upload-bg-image__uploader-content"}))))),E.width&&E.height?o.createElement("div",{className:"image-size"},E.width," \xd7 ",E.height,!!s&&(s.type===V.bV.IMG||s.type===V.bV.CAROUSEL)&&" \u2192 "+d.renderedWidth+" \xd7 "+d.renderedHeight,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",null,E.size," ",f("kB")),E.format&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",{className:"image-size-format"},E.format))):o.createElement(Be,{type:"secondary",className:"image-empty-text"},a))),o.createElement("div",{style:{flexGrow:1}}),"gif"!==E.format&&b.imageCenterEditorEnabled&&o.createElement(i.A,{title:f("Edit")},o.createElement(Be,{type:"link",className:"upload-bg-image__edit"},o.createElement(z.A,{icon:"Edit",size:16,strokeWidth:b.iconStrokeWidth,onClick:e=>{O?(S(!0),C(5)):(F(),x((0,D.Wz)(V.lx.IMAGE_EDITOR_MODAL)))}}))),o.createElement(L.A,{key:"Actions",arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:M},overlayClassName:"upload-bg-image__menu"},o.createElement(Be,{type:"link",className:"upload-bg-image__edit-menu image-change"},!t||t&&"error"===l?f("Upload"):o.createElement(z.A,{size:16,strokeWidth:b.iconStrokeWidth,icon:"SyncOutlined",onClick:()=>F(n.startsWith("src")?V.lx.UPLOAD_IMAGE_MODAL_UPLOAD:V.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)})))),o.createElement(Se.A,{open:A,onCancel:()=>{S(!1)},initialSlide:w}))};var Te=l(87396);const{useToken:Re}=r.A,Ne=({form:e,label:t,name:l,disabled:a,elementSettings:r})=>{var n;const i=(0,Te.FH)((null===r||void 0===r?void 0:r.type)===V.bV.CAROUSEL?["images",l]:[l],e),[s,d]=(0,o.useState)("success"),{token:c}=Re();return(0,o.useEffect)(()=>{i?(0,K.DI)(i).then(e=>{d(e)}).catch(e=>{d(e)}):d("")},[i]),o.createElement(C.A.Item,{name:l,validateStatus:s,style:{marginBottom:c.formItemMarginBottomXS}},o.createElement(xe,{validateStatus:s,placeholder:t,name:l,disabled:a,elementSettings:r,imageInfo:(null===r||void 0===r?void 0:r.type)===V.bV.CAROUSEL?null===r||void 0===r||null===(n=r.carouselImages)||void 0===n?void 0:n[l.split("_")[1]]:r}))};Ne.defaulProps={disabled:!1};const Le=Ne;var Ie=l(54838),Pe=l(52919);const{backgroundColor:Oe,backgroundImage:Fe,backgroundPositionX:Me,backgroundPositionY:De,backgroundRepeat:Ve,backgroundSize:We,responsive:je,backgroundColorContent:ze,width:He}={backgroundColor:"backgroundColor",backgroundImage:"backgroundImage",backgroundPositionX:"backgroundPositionX",backgroundPositionY:"backgroundPositionY",backgroundRepeat:"backgroundRepeat",backgroundSize:"backgroundSize",responsive:"responsive",backgroundColorContent:"backgroundColorContent",width:"width"},Ge={[Oe]:"",[Fe]:"",[Me]:"",[De]:"",[Ve]:"checked",[We]:"",[ze]:"",[He]:""},{useToken:Ue}=r.A,qe=({className:e="",email:t})=>{var l,a,r;const{__:n}=(0,y.s9)(),{token:d}=Ue(),m=(0,v.wA)(),p=(0,Y.rD)(),[g]=C.A.useForm(),E=(0,Pe.XW)(),_=(0,v.d4)(H.uJ),A=(0,v.d4)(H.iy),S=(0,v.d4)(Ie.B),w=(0,v.d4)(H.mD),[T,R]=(0,o.useState)(!0),N=n("Email not yet loaded or global container not found.");(0,o.useEffect)(()=>{w&&(m((0,H.S_)(!1)),E({operation:V.Ru.INIT_PREVIEW}))},[g,w,m,E,t.common_styles]);const L=[{label:n("Not defined"),value:"none"},{label:n("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:n("Repeat background (repeat)"),value:"repeat"},{label:n("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:n("Repeat background vertically (repeat-y)"),value:"repeat-y"}],I=[{label:n("Not defined"),value:""},{label:n("Contain"),value:"contain"},{label:n("Cover"),value:"cover"}];(0,o.useEffect)(()=>{var e,t,l,o;g.setFieldsValue({..._,width:null===(e=_.width)||void 0===e?void 0:e.value,widthDim:null===(t=_.width)||void 0===t?void 0:t.dim,backgroundImage:_.backgroundImage?null===(l=_.backgroundImage[0])||void 0===l?void 0:l.value:"",backgroundRepeat:""===_[Ve]?"repeat":_[Ve],backgroundSize:_[We],responsive:null===(o=_.responsive)||void 0===o?void 0:o.shutdown}),R(!_.backgroundImage)},[_,g]);return o.createElement("div",{className:k()("appearance-panel",{[e]:e})},o.createElement(C.A,{form:g,layout:"vertical",name:"appearance_panel_form",initialValues:{remember:!1,...Ge},onValuesChange:e=>{var t;const l=g.getFieldsValue(!0),o=Object.keys(e)[0];switch(o){case Me:case De:E({operation:V.Ru.SANDBOX_EMAIL_SETTINGS_SET,settings:{[o]:""===e[o]?"none":e[o]}});break;case Fe:R(""===e[o]),E({operation:V.Ru.SANDBOX_EMAIL_SETTINGS_SET,settings:{[o]:[{...null===_||void 0===_||null===(t=_.backgroundImage)||void 0===t?void 0:t[0],type:"url",value:e[o]}],backgroundSize:"cover"}});break;case je:E({operation:V.Ru.SANDBOX_EMAIL_SETTINGS_SET,settings:{responsive:{shutdown:e[o],styles:e[o]},width:l.width}});break;default:E({operation:V.Ru.SANDBOX_EMAIL_SETTINGS_SET,settings:e})}},autoComplete:"off",className:"element-controls"},A?o.createElement(u.A,{style:{marginBottom:"24px"},message:N,type:"error"}):null,o.createElement("div",{className:"form-group-title",style:{paddingTop:0}},n("Email layout width")),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:null!==(l=_.width)&&void 0!==l&&l.value?n("This field sets the width of the email."):n("Couldn`t determine the email width"),placement:"right"},o.createElement(C.A.Item,{name:"width",style:{marginBottom:d.formItemMarginBottomXS}},o.createElement(fe.A,{min:0,placeholder:n("Width"),prefix:o.createElement(Ee.A,null),disabled:!(null!==(a=_.width)&&void 0!==a&&a.value),addonAfter:"px"}))))),p.emailResponsiveControlEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:20},o.createElement(b.A,{span:24},o.createElement(s.A,{size:8,align:"baseline"},o.createElement(C.A.Item,{name:"responsive",valuePropName:"checked"},o.createElement(f.A,{size:"small",name:"responsive",id:"responsive",disabled:void 0===(null===(r=_.responsive)||void 0===r?void 0:r.shutdown),onChange:e=>{m((0,Ie.wW)({shutdown:e,styles:e})),E({operation:V.Ru.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:document.querySelector(".email-pane__iframe").getBoundingClientRect().width}})}})),o.createElement("div",{className:"ant-form-item-switch-label"},o.createElement("label",{htmlFor:"responsive",style:{verticalAlign:"middle"}},n("Responsive email")))))),o.createElement(c.A,{className:"selected-td-form__divider"})),o.createElement("div",{className:"form-group-title"},n("Email background color")),o.createElement(h.A,{gutter:10,style:{paddingBottom:T?16:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:n("Background color"),placement:"bottom"},o.createElement(C.A.Item,{name:Oe,style:{marginBottom:d.formItemMarginBottomXS},rules:[{message:n("Please set the background color")}]},o.createElement(_e,{placeholder:n("Background color"),usedColors:_.usedColors})))),o.createElement(b.A,{span:T?12:24},p.formEmailFieldBackgroundImageEnabled&&o.createElement(o.Fragment,null,o.createElement(Le,{form:g,label:n("Background image"),name:Fe,tooltipTitle:n("Background image"),disabled:A||"Styles"!==S,elementSettings:_}),!T&&o.createElement(o.Fragment,null,o.createElement(C.A.Item,{style:{marginBottom:"0"}},o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:n("Horizontal position"),placement:"bottom"},o.createElement(C.A.Item,{name:Me,style:{marginBottom:d.formItemMarginBottomXS}},o.createElement(B.A,{placeholder:n("Horizontal position"),prefix:o.createElement(z.A,{icon:"BgPositionHorizontal"})})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:n("Vertical position"),placement:"bottom"},o.createElement(C.A.Item,{name:De,style:{marginBottom:d.formItemMarginBottomXS}},o.createElement(B.A,{placeholder:n("Vertical position"),prefix:o.createElement(z.A,{icon:"BgPositionVertical"})})))))),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:n("Background image repeat"),placement:"bottom"},o.createElement(C.A.Item,{name:Ve},o.createElement(x.A,{placeholder:n("Please select"),disabled:A,options:L,getPopupContainer:e=>e.parentNode})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:n("Background image size"),placement:"top"},o.createElement(C.A.Item,{name:We},o.createElement(x.A,{placeholder:n("Please select"),disabled:A,options:I,getPopupContainer:e=>e.parentNode})))))))))))};var Xe=l(22536);const{Option:$e}=x.A,{width:Ze,widthDim:Ye}={width:"width",widthDim:"widthDim"},Ke={[Ze]:"",[Ye]:""},Qe=({className:e=""})=>{const{__:t}=(0,y.s9)(),l=(0,v.d4)(Xe.JV),a=(0,v.d4)(Xe.iy),[r]=C.A.useForm(),n=(0,Pe.XW)(),i=t("Block not yet loaded or global container not found.");(0,o.useEffect)(()=>{r.setFieldsValue({width:l.width.value,widthDim:l.width.dim})},[l,r]);return o.createElement("div",{className:k()("block-appearance-panel",{[e]:e})},o.createElement(C.A,{form:r,layout:"vertical",name:"block_appearance_panel_form",initialValues:{remember:!1,...Ke},onValuesChange:e=>{const t=r.getFieldsValue(!0),l=Object.keys(e)[0];let o;switch(l){case"width":o={[l]:{value:e[l],dim:t.widthDim}};break;case"widthDim":o={width:{value:t.width,dim:e[l]}};break;default:return}n({operation:V.Ru.SANDBOX_BLOCK_SETTINGS_SET,settings:o})},autoComplete:"off"},a?o.createElement(u.A,{style:{marginBottom:"24px"},message:i,type:"error"}):null,o.createElement(C.A.Item,{label:t("Container width"),name:Ze,tooltip:{title:t("Specifies the block width."),icon:o.createElement(R.A,null)},rules:[{message:t("Please input container width")}]},o.createElement(B.A,{disabled:a,placeholder:t("Container width"),addonAfter:o.createElement(C.A.Item,{name:"widthDim",noStyle:!0},o.createElement(x.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement($e,{value:"px"},"px"),o.createElement($e,{value:"%"},"%")))}))))};var Je=l(46409),et=l(78320),tt=l(89454),lt=l(20721),ot=l(96698),at=l(73114),rt=l(98447);let nt=null,it=null;const st=[{label:"Segoe UI, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif",value:"-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif",className:"Segoe"},{label:"Helvetica, Helvetica Neue, Arial, Roboto, sans-serif",value:"Helvetica, 'Helvetica Neue', Roboto, Arial, sans-serif",className:"Helvetica"},{label:"Arial Black, Gadget, sans-serif",value:"'Arial Black', Gadget, sans-serif",className:"ArialBlack"},{label:"Comic Sans MS, cursive",value:"'Comic Sans MS', cursive",className:"ComicSans"},{label:"Courier New, Courier, monospace",value:"'Courier New', Courier, monospace",className:"CourierNew"},{label:"Georgia, serif",value:"Georgia, serif",className:"Georgia"},{label:"Impact, Charcoal, sans-serif",value:"Impact, Charcoal, sans-serif",className:"Impact"},{label:"Lucida Console, Monaco, monospace",value:"'Lucida Console', Monaco, monospace",className:"LucidaConsole"},{label:"Lucida Sans Unicode, Lucida Grande, sans-serif",value:"'Lucida Sans Unicode', 'Lucida Grande', sans-serif",className:"LucidaSans"},{label:"Palatino Linotype, Book Antiqua, Palatino, serif",value:"'Palatino Linotype', 'Book Antiqua', Palatino, serif",className:"Palatino"},{label:"Tahoma, Geneva, sans-serif",value:"Tahoma, Geneva, sans-serif",className:"Tahoma"},{label:"Times New Roman, Times, serif",value:"'Times New Roman', Times, serif",className:"TimesNewRoman"},{label:"Trebuchet MS, Helvetica, sans-serif",value:"'Trebuchet MS', Helvetica, sans-serif",className:"Trebuchet"},{label:"Verdana, Geneva, sans-serif",value:"Verdana, Geneva, sans-serif",className:"Verdana"}],dt={100:"Thin","100i":"Thin Italic",200:"ExtraLight","200i":"ExtraLight Italic",300:"Light","300i":"Light Italic",400:"Regular","400i":"Regular Italic",500:"Medium","500i":"Medium Italic",600:"SemiBold","600i":"SemiBold Italic",700:"Bold","700i":"Bold Italic",800:"ExtraBold","800i":"ExtraBold Italic",900:"Black","900i":"Black Italic"},ct=({value:e,onChange:t,textEditor:a=!1,codeMode:r=!1})=>{const{__:n}=(0,y.s9)(),[i,s]=(0,o.useState)(),[d,c]=(0,o.useState)(e),[m,u]=(0,o.useState)(null),[p,g]=(0,o.useState)(!0),h=[],b=[];if((0,o.useEffect)(()=>{(nt?Promise.resolve(nt):it||(l.p.replace(/\/$/,""),it=l.e(2642).then(l.t.bind(l,42642,19)).then(({default:e})=>(nt=e,nt)).catch(e=>{throw e}),it)).then(e=>{u(e),g(!1)}).catch(()=>g(!1))},[]),(0,o.useEffect)(()=>{if(!m)return;const t=m.familyMetadataList.filter(e=>e.subsets.includes("cyrillic")&&"Sans Serif"===e.category&&e.popularity<100),l=m.familyMetadataList.filter(e=>e.subsets.includes("cyrillic")&&"Serif"===e.category&&e.popularity<100);if(a&&e!==d)if(e)if("Sans Serif"===e[1]){var o;s(["Google Fonts","Sans Serif",null===(o=t.find(t=>(null===t||void 0===t?void 0:t.family.replace(/\s/g,""))===e[2].replace(/\s/g,"")))||void 0===o?void 0:o.family,e[3].replace(/Italic/g," Italic")])}else if("Serif"===e[1]){var r;s(["Google Fonts","Serif",null===(r=l.find(t=>(null===t||void 0===t?void 0:t.family.replace(/\s/g,""))===e[2].replace(/\s/g,"")))||void 0===r?void 0:r.family,e[3].replace(/Italic/g," Italic")])}else"Safe Fonts"!==e[0]&&void 0!==i||s(e);else s([""]);else void 0===i&&d&&s(e);a||s(e),c(e)},[e,m,a,d,i]),m){m.familyMetadataList.filter(e=>e.subsets.includes("cyrillic")&&"Sans Serif"===e.category&&e.popularity<100).forEach(e=>{h.push({label:e.family,value:e.family,children:Object.keys(e.fonts).filter(e=>dt[e]).map(e=>({label:dt[e],value:dt[e]}))})});m.familyMetadataList.filter(e=>e.subsets.includes("cyrillic")&&"Serif"===e.category&&e.popularity<100).forEach(e=>b.push({label:e.family,value:e.family,children:Object.keys(e.fonts).filter(e=>dt[e]).map(e=>({label:dt[e],value:dt[e]}))}))}return o.createElement(at.A,{allowClear:!1,showSearch:!0,value:i,placement:"bottomRight",options:p?[{label:o.createElement(rt.A,{size:"small",style:{marginLeft:8}}),value:"loading",disabled:!0}]:[{label:n("Safe Fonts"),value:"Safe Fonts",children:st},{label:n("Google Fonts"),value:"Google Fonts",children:[{label:n("Sans Serif"),value:"Sans Serif",children:h},{label:n("Serif"),value:"Serif",children:b}]}],getPopupContainer:e=>e.closest(r?".selected_text_common_form_mobile":a?".email-pane__collapse-wrapper":".email-pane__content-col"),onChange:t})};var mt=l(50483);const ut=({form:e,elementSettings:t,imgParent:l=!1,name:a="align",setAlignStateHandle:r=e=>{},withHotKeys:n=!0})=>{const{__:d}=(0,y.s9)(),c=(0,Pe.XW)(),[m,u]=(0,o.useState)(t[a]),p=(0,Y.rD)(),[g,h]=(0,o.useState)(null);(0,o.useEffect)(()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&h(!0)},[]);const b=l=>{const o=l.target.value;r(o);const n={[a]:""};o!==m?u(o):(u(""),e.setFieldsValue(n),c({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:n}))};return o.createElement(C.A.Item,{name:a},o.createElement(mt.Ay.Group,{disabled:l&&!t.parent},o.createElement(s.A,{size:8},o.createElement(i.A,{placement:"bottom",title:d(n?g?"Text align left ( \u2318+Shift+L )":"Text align left ( Ctrl+Shift+L )":"Text align left")},o.createElement(mt.Ay.Button,{value:"left",onClick:b},o.createElement(z.A,{icon:"AlignLeftOutlined",size:18,strokeWidth:p.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:d(n?g?"Text align center ( \u2318+Shift+E )":"Text align center ( Ctrl+Shift+E )":"Text align center")},o.createElement(mt.Ay.Button,{value:"center",onClick:b},o.createElement(z.A,{icon:"AlignCenterOutlined",size:18,strokeWidth:p.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:d(n?g?"Text align right ( \u2318+Shift+R )":"Text align right ( Ctrl+Shift+R )":"Text align right")},o.createElement(mt.Ay.Button,{value:"right",onClick:b},o.createElement(z.A,{icon:"AlignRightOutlined",size:18,strokeWidth:p.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:d(n?g?"Text align justify ( \u2318+Shift+J )":"Text align justify ( Ctrl+Shift+J )":"Text align justify")},o.createElement(mt.Ay.Button,{value:"justify",onClick:b},o.createElement(z.A,{icon:"Justify",size:18,strokeWidth:p.iconStrokeWidth}))))))};var pt=l(80320),gt=l(17216),ht=l(82984),bt=l(85372),ft=l(8239),Et=l(91916),vt=l(48947),_t=l(51157),yt=l(42734);const{useToken:At}=r.A,St=({form:e,namePrefix:t="",typeOfForm:l="desktop"})=>{const{__:a,_x:r}=(0,y.s9)(),{token:n}=At(),d=(0,v.d4)(H.uJ),c="mobile"===l,m=c?"mobileBorderPosition":"borderPosition",u=C.A.useWatch(t+m,e),p=e.getFieldsValue(!0),g={borderAll:t+(c?"mobileBorderAll":"borderAll"),borderTop:t+(c?"mobileBorderTop":"borderTop"),borderBottom:t+(c?"mobileBorderBottom":"borderBottom"),borderRight:t+(c?"mobileBorderRight":"borderRight"),borderLeft:t+(c?"mobileBorderLeft":"borderLeft")},f=c?{mobileBorderAll:t+"mobileBorderAll",mobileBorderTop:t+"mobileBorderTop",mobileBorderBottom:t+"mobileBorderBottom",mobileBorderRight:t+"mobileBorderRight",mobileBorderLeft:t+"mobileBorderLeft"}:{borderAll:t+"borderAll",borderTop:t+"borderTop",borderBottom:t+"borderBottom",borderRight:t+"borderRight",borderLeft:t+"borderLeft"},E=e=>(null===e||void 0===e?void 0:e.width)||(null===e||void 0===e?void 0:e.style)||(null===e||void 0===e?void 0:e.color);return o.createElement(h.A,{gutter:30},o.createElement(b.A,{span:12,className:"selected-td-form__border-col"},o.createElement(C.A.Item,{name:[f[u],"color"],className:"form-item-margin-xs"},o.createElement(_e,{placeholder:a("Color"),usedColors:d.usedColors})),o.createElement(C.A.Item,{name:[f[u],"width"],className:"form-item-margin-xs"},o.createElement(fe.A,{min:0,placeholder:r("Width","border"),addonAfter:"px"})),o.createElement(C.A.Item,{name:[f[u],"style"],className:"form-item-margin-xs"},o.createElement(mt.Ay.Group,null,o.createElement(s.A,{size:8},o.createElement(i.A,{placement:"bottom",title:a("None")},o.createElement(mt.Ay.Button,{value:""},o.createElement(pt.A,null))),o.createElement(i.A,{placement:"bottom",title:a("Solid")},o.createElement(mt.Ay.Button,{value:"solid"},o.createElement(gt.A,null))),o.createElement(i.A,{placement:"bottom",title:a("Dashed")},o.createElement(mt.Ay.Button,{value:"dashed"},o.createElement(ht.A,null))),o.createElement(i.A,{placement:"bottom",title:a("Dotted")},o.createElement(mt.Ay.Button,{value:"dotted"},o.createElement(bt.A,null))))))),o.createElement(b.A,{span:12,style:{textAlign:"center"}},o.createElement(C.A.Item,{label:"",name:m,labelCol:{span:8}},o.createElement(mt.Ay.Group,null,o.createElement(s.A,{size:n.formItemMarginBottomXS,direction:"vertical"},o.createElement(h.A,null,o.createElement(i.A,{placement:"top",title:a("Above")},o.createElement(mt.Ay.Button,{value:g.borderTop,style:{margin:"auto"},className:k()("",{"selected-td-form__border-radio":E(p[g.borderTop])})},o.createElement(ft.A,null)))),o.createElement(h.A,null,o.createElement(s.A,{size:n.formItemMarginBottomXS},o.createElement(i.A,{placement:"left",title:a("On the left")},o.createElement(mt.Ay.Button,{value:g.borderLeft,className:k()("",{"selected-td-form__border-radio":E(p[g.borderLeft])})},o.createElement(Et.A,null))),o.createElement(i.A,{placement:"top",title:a("Around")},o.createElement(mt.Ay.Button,{value:g.borderAll,className:k()("",{"selected-td-form__border-radio":E(p[g.borderAll])})},o.createElement(vt.A,null))),o.createElement(i.A,{placement:"right",title:a("On the right")},o.createElement(mt.Ay.Button,{value:g.borderRight,className:k()("",{"selected-td-form__border-radio":E(p[g.borderRight])})},o.createElement(_t.A,null))))),o.createElement(h.A,null,o.createElement(i.A,{placement:"bottom",title:a("Below")},o.createElement(mt.Ay.Button,{value:g.borderBottom,className:k()("",{"selected-td-form__border-radio":E(p[g.borderBottom])}),style:{margin:"auto"}},o.createElement(yt.A,null)))))))))};var kt,wt=l(78469),Ct=l(31573),Bt=l(39672),xt=l(70552);function Tt(){return Tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var o in l)({}).hasOwnProperty.call(l,o)&&(e[o]=l[o])}return e},Tt.apply(null,arguments)}function Rt({title:e,titleId:t,...l},a){return o.createElement("svg",Tt({fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",ref:a,"aria-labelledby":t},l),e?o.createElement("title",{id:t},e):null,kt||(kt=o.createElement("path",{d:"M6.5 1.143H5.25A4.108 4.108 0 0 0 1.143 5.25V6.5c0 .078.064.143.142.143h1a.143.143 0 0 0 .143-.143V5.25A2.82 2.82 0 0 1 5.25 2.428H6.5a.143.143 0 0 0 .143-.143v-1a.143.143 0 0 0-.143-.142ZM14.857 6.5V5.25a4.108 4.108 0 0 0-4.107-4.107H9.5a.143.143 0 0 0-.143.142v1c0 .079.064.143.143.143h1.25A2.82 2.82 0 0 1 13.57 5.25V6.5c0 .078.065.143.143.143h1a.143.143 0 0 0 .143-.143ZM9.5 14.857h1.25a4.108 4.108 0 0 0 4.107-4.107V9.5a.143.143 0 0 0-.143-.143h-1a.143.143 0 0 0-.143.143v1.25a2.82 2.82 0 0 1-2.821 2.821H9.5a.143.143 0 0 0-.143.143v1c0 .079.064.143.143.143ZM1.143 9.5v1.25a4.108 4.108 0 0 0 4.107 4.107H6.5a.143.143 0 0 0 .143-.143v-1a.143.143 0 0 0-.143-.143H5.25a2.82 2.82 0 0 1-2.822-2.821V9.5a.143.143 0 0 0-.143-.143h-1a.143.143 0 0 0-.142.143Z",fill:"inherit"})))}const Nt=o.forwardRef(Rt);l.p;var Lt=l(80877);const It={paddingTop:"top",paddingLeft:"left",paddingRight:"right",paddingBottom:"bottom",mobilePaddingTop:"top",mobilePaddingLeft:"left",mobilePaddingRight:"right",mobilePaddingBottom:"bottom"},Pt={borderRadiusAll:"all",borderRadiusTopLeft:"topLeft",borderRadiusBottomLeft:"bottomLeft",borderRadiusTopRight:"topRight",borderRadiusBottomRight:"bottomRight"},Ot={mobileBorderRadiusAll:"all",mobileBorderRadiusTopLeft:"topLeft",mobileBorderRadiusBottomLeft:"bottomLeft",mobileBorderRadiusTopRight:"topRight",mobileBorderRadiusBottomRight:"bottomRight"},Ft={all:"borderAll",top:"borderTop",right:"borderRight",bottom:"borderBottom",left:"borderLeft"},Mt={all:"mobileBorderAll",top:"mobileBorderTop",right:"mobileBorderRight",bottom:"mobileBorderBottom",left:"mobileBorderLeft"},Dt={width:null,style:null,color:null},Vt={borderAll:"all",borderTop:"top",borderRight:"right",borderBottom:"bottom",borderLeft:"left"},Wt={mobileBorderAll:"all",mobileBorderTop:"top",mobileBorderRight:"right",mobileBorderBottom:"bottom",mobileBorderLeft:"left"},jt=({form:e,oneBorderRadiusValue:t,setOneBorderRadiusValue:l,elementSettings:a,namePrefix:r="",typeOfForm:n="desktop"})=>{const{__:d}=(0,y.s9)(),c=(0,Pe.XW)(),m="mobile"===n,u=m?"mobileBorderRadius":"borderRadius",p=m?"mobileBorderRadiusAll":"borderRadiusAll",f=m?"mobileBorderRadiusTopLeft":"borderRadiusTopLeft",E=m?"mobileBorderRadiusTopRight":"borderRadiusTopRight",v=m?"mobileBorderRadiusBottomRight":"borderRadiusBottomRight",_=m?"mobileBorderRadiusBottomLeft":"borderRadiusBottomLeft",A=m?Ot:Pt;return o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(s.A,{size:10,align:"start"},o.createElement(C.A.Item,{name:r+[p]},o.createElement(Lt.A,{min:0,placeholder:d("Border radius"),prefix:o.createElement(Nt,{className:"selected-td-form__icon-radius"}),disabled:!t,addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!t}),onClick:()=>{const o=e.getFieldsValue(!0);let r;if(t)e.setFieldsValue({[f]:o[p]||null,[_]:o[p]||null,[E]:o[p]||null,[v]:o[p]||null}),r={[u]:{[A[f]]:o[p]||0,[A[_]]:o[p]||0,[A[E]]:o[p]||0,[A[v]]:o[p]||0}};else{const t=o[f]===o[_]&&o[f]===o[E]&&o[f]===o[v];t?(e.setFieldsValue({[p]:t?o[f]:null}),r={[u]:{[A[p]]:o[f]}}):(e.setFieldsValue({[f]:null,[_]:null,[E]:null,[v]:null}),r={[u]:{[A[p]]:0,[A[f]]:0,[A[_]]:0,[A[E]]:0,[A[v]]:0}})}let n=m?{mobileBorderRadius:{all:o.mobileBorderRadiusAll||null,classNamePrefix:"em-mob-border_radius_all-"}}:{[u]:{...a[u],...r[u]}};c({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:n}),l(e=>!e)}},o.createElement(Nt,{className:"selected-td-form__icon-radius"}))),o.createElement(b.A,null,o.createElement(h.A,{gutter:10,style:{marginTop:-10}},o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:d("Top left corner")},o.createElement(C.A.Item,{hidden:t,name:r+[f],className:"form-item-margin-xs"},o.createElement(Lt.A,{min:0,prefix:o.createElement(wt.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(i.A,{placement:"bottom",title:d("Bottom left corner")},o.createElement(C.A.Item,{hidden:t,name:r+[_]},o.createElement(Lt.A,{min:0,prefix:o.createElement(Ct.A,null),style:{minHeight:10},addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:d("Top right corner")},o.createElement(C.A.Item,{hidden:t,name:r+[E],className:"form-item-margin-xs"},o.createElement(Lt.A,{min:0,prefix:o.createElement(Bt.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(i.A,{placement:"bottom",title:d("Bottom right corner")},o.createElement(C.A.Item,{hidden:t,name:r+[v]},o.createElement(Lt.A,{min:0,prefix:o.createElement(xt.A,null),style:{minHeight:10},addonAfter:"px"})))))))};var zt=l(48300),Ht=l(10267),Gt=l(63346),Ut=l(89715),qt=l(61657),Xt=l(91447);const{Option:$t}=x.A,{mobileBorderRadiusAll:Zt,mobileBorderRadiusTopLeft:Yt,mobileBorderRadiusBottomLeft:Kt,mobileBorderRadiusTopRight:Qt,mobileBorderRadiusBottomRight:Jt,borderRadiusBottomRight:el,borderRadiusTopRight:tl,borderRadiusBottomLeft:ll,borderRadiusTopLeft:ol,alt:al,src:rl,title:nl,link:il,borderRadiusAll:sl,imgReplacer:dl,expanded:cl}={link:"link",borderRadiusBottomRight:"borderRadiusBottomRight",borderRadiusTopRight:"borderRadiusTopRight",borderRadiusBottomLeft:"borderRadiusBottomLeft",borderRadiusTopLeft:"borderRadiusTopLeft",mobileBorderRadiusAll:"mobileBorderRadiusAll",mobileBorderRadiusTopLeft:"mobileBorderRadiusTopLeft",mobileBorderRadiusBottomLeft:"mobileBorderRadiusBottomLeft",mobileBorderRadiusTopRight:"mobileBorderRadiusTopRight",mobileBorderRadiusBottomRight:"mobileBorderRadiusBottomRight",alt:"alt",imgReplacer:"imgReplacer",src:"src",title:"title",borderRadiusAll:"borderRadiusAll",expanded:"expanded"},ml=({linkProtocol:e})=>{switch(e){case"https://":default:return o.createElement(zt.A,null);case"mailto:":return o.createElement(Ht.A,null);case"tel:":return o.createElement(Gt.A,null);case"sms:":return o.createElement(Ut.A,null);case"ftp://":return o.createElement(qt.A,null);case"skype:":return o.createElement(Xt.A,null)}},ul=({handleLinkProtocolsChange:e,linkProtocol:t,__:l})=>{const a=o.useMemo(()=>(e=>[{value:"https://",label:e("Site")},{value:"mailto:",label:e("E-mail")},{value:"tel:",label:e("Phone")},{value:"sms:",label:e("SMS")},{value:"ftp://",label:e("File")},{value:"skype:",label:e("Skype")},{value:"viber:",label:e("Viber")},{value:"",label:e("Other")}])(l),[l]);return o.createElement(x.A,{style:{width:90,textAlign:"left"},value:t,onChange:e,getPopupContainer:e=>e.parentNode,options:a})},pl=(e,t)=>e.startsWith("mailto:")?"mailto:":e.startsWith("tel:")?"tel:":e.startsWith("sms:")?"sms:":e.startsWith("ftp://")?"ftp://":e.startsWith("skype:")?"skype:":e.startsWith("viber:")?"viber:":t,gl=e=>e||(0===e?"0":""),hl=e=>e&&"auto"!==e?e:0===e?"0":"";function bl(e){var t,l,o,a,r,n,i,s,d,c,m,u,p,g,h,b,f,E,v,_;const y={...e,link:e.link?e.link:"https://",borderRadiusAll:gl(null===(t=e.borderRadius)||void 0===t?void 0:t.all),borderRadiusTopLeft:gl(null===(l=e.borderRadius)||void 0===l?void 0:l.topLeft),borderRadiusBottomLeft:gl(null===(o=e.borderRadius)||void 0===o?void 0:o.bottomLeft),borderRadiusTopRight:gl(null===(a=e.borderRadius)||void 0===a?void 0:a.topRight),borderRadiusBottomRight:gl(null===(r=e.borderRadius)||void 0===r?void 0:r.bottomRight),mobileBorderRadiusAll:gl(null===(n=e.mobileBorderRadius)||void 0===n?void 0:n.all),mobileBorderRadiusTopLeft:gl(null!==(null===(i=e.mobileBorderRadius)||void 0===i?void 0:i.topLeft)?null===(s=e.mobileBorderRadius)||void 0===s?void 0:s.topLeft:null===(d=e.mobileBorderRadius)||void 0===d?void 0:d.all),mobileBorderRadiusBottomLeft:gl(null!==(null===(c=e.mobileBorderRadius)||void 0===c?void 0:c.bottomLeft)?null===(m=e.mobileBorderRadius)||void 0===m?void 0:m.bottomLeft:null===(u=e.mobileBorderRadius)||void 0===u?void 0:u.all),mobileBorderRadiusTopRight:gl(null!==(null===(p=e.mobileBorderRadius)||void 0===p?void 0:p.topRight)?null===(g=e.mobileBorderRadius)||void 0===g?void 0:g.topRight:null===(h=e.mobileBorderRadius)||void 0===h?void 0:h.all),mobileBorderRadiusBottomRight:gl(null!==(null===(b=e.mobileBorderRadius)||void 0===b?void 0:b.bottomRight)?null===(f=e.mobileBorderRadius)||void 0===f?void 0:f.bottomRight:null===(E=e.mobileBorderRadius)||void 0===E?void 0:E.all),show:e.show?e.show:"all",altSrc:e.src};var A,S;e.video&&(y.videoPlayButton=null!==(A=e.video.playButton)&&void 0!==A?A:"youtube_red",y.videoSource=null!==(S=e.video.source)&&void 0!==S?S:"");if((null===(v=e.carouselImages)||void 0===v?void 0:v.length)>0){var k;const t={};null===(k=e.carouselImages)||void 0===k||k.map((e,l)=>(Object.keys(e).forEach(o=>{t[o+"_"+l]=e[o]}),!0)),y.images=t}if((null===(_=e.sections)||void 0===_?void 0:_.length)>0){var w;const t=[];null===(w=e.sections)||void 0===w||w.map((e,l)=>(t.push({[`expanded_${l}`]:e.expanded}),!0)),y.sections=t}return y}function fl(e,t,l){const o=l.hasOwnProperty("images"),a=l.hasOwnProperty("sections"),r=Object.keys(o?l.images:a?l.sections:l)[0],n=o?l.images:a?l.sections:l;let i={};const s=t.getFieldsValue(!0);switch(r.split("_")[0]){case nl:case rl:case al:case dl:if(o){const t=[...e.carouselImages];t[r.split("_")[1]][r.split("_")[0]]=n[r],i={carouselImages:t}}else i=n;break;case cl:if(a){const t=[...e.sections];t[r.split("_")[1]][r.split("_")[0]]=n[r],i={sections:t}}break;case il:let l=n[r];"https://http"===l.substring(0,12)&&(l=l.substring(8,l.length)),e.type===V.bV.CAROUSEL?(i.carouselImages=e.carouselImages,o?(t.setFieldValue(["images",[il+"_"+r.split("_")[1]]],l),i.carouselImages[r.split("_")[1]].link=l,i.link="",t.setFieldValue(il,"https://")):(e.carouselImages.forEach((e,o)=>{t.setFieldValue(["images",il+"_"+o],l),i.carouselImages[o].link=l,i.link=l}),t.setFieldValue(il,l))):(t.setFieldValue(il,l),i.link=l);break;case sl:i={borderRadius:{...e.borderRadius,[Pt[ol]]:s[ol],[Pt[ll]]:s[ll],[Pt[tl]]:s[tl],[Pt[el]]:s[el],[Pt[r]]:+n[r]}};break;case ol:case ll:case tl:case el:i={borderRadius:{...e.borderRadius,[Pt[sl]]:null,[Pt[r]]:+n[r]}};break;case Zt:case Yt:case Kt:case Qt:case Jt:i={mobileBorderRadius:{...e.mobileBorderRadius,[Ot[Yt]]:s[Yt],[Ot[Kt]]:s[Kt],[Ot[Qt]]:s[Qt],[Ot[Jt]]:s[Jt],[Ot[r]]:n[r],classNamePrefix:"em-mob-border_radius_"+Ot[r]+"-"}};break;default:i=n}return{...e,...i}}const El=o.createElement(x.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement($t,{value:"px"},"px"),o.createElement($t,{value:"%"},"%")),vl=o.createElement(x.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement($t,{value:"px"},"px")),{useToken:_l}=r.A,yl=e=>{var t,l,o,a,r,n,i,s,d,c,m,u,p,g,h,b,f,E;return{textFontFamily:e.text.fontFamily,textFontSize:e.text.fontSize,textFontSizeDim:e.text.fontSizeDim,textLineHeight:e.text.lineHeight,textLineHeightDim:e.text.lineHeightDim,textColor:e.text.color,textContrastColor:e.text.contrastColor||"#FFFFFF",textAlign:e.text.textAlign,textPaddingBottom:e.text.paddingBottom,textPaddingBottomDim:e.text.paddingBottomDim,headingFontFamily:e.headings.fontFamily,headingFontSize:e.headings.fontSize,headingFontSizeDim:e.headings.fontSizeDim,headingLineHeight:e.headings.lineHeight,headingLineHeightDim:e.headings.lineHeightDim,headingColor:e.headings.color,headingContrastColor:e.headings.contrastColor||"#FFFFFF",headingAlign:e.headings.textAlign,headingPaddingTop:e.headings.paddingTop,headingPaddingTopDim:e.headings.paddingTopDim,headingPaddingBottom:e.headings.paddingBottom,headingPaddingBottomDim:e.headings.paddingBottomDim,headingLetterSpacing:e.headings.letterSpacing,headingLetterSpacingDim:e.headings.letterSpacingDim,headingBold:e.headings.bold,headingItalic:e.headings.italic,linkColor:e.links.color,linkContrastColor:e.links.contrastColor||"#FFFFFF",linkUnderline:e.links.underline,buttonsFontFamily:e.buttons.fontFamily,buttonsFontSize:e.buttons.fontSize,buttonsFontSizeDim:e.buttons.fontSizeDim,buttonsLetterSpacing:e.buttons.letterSpacing,buttonsLetterSpacingDim:e.buttons.letterSpacingDim,buttonsColor:e.buttons.color,buttonsContrastColor:e.buttons.contrastColor||"#1C52DC",buttonsBold:e.buttons.bold,buttonsItalic:e.buttons.italic,buttonsBackgroundColor:e.buttons.backgroundColor,buttonsContrastBackgroundColor:e.buttons.contrastBackgroundColor||"#FFFFFF",buttonsMarginTop:e.buttons.marginTop,buttonsMarginTopDim:e.buttons.marginTopDim,buttonsMarginBottom:e.buttons.marginBottom,buttonsMarginBottomDim:e.buttons.marginBottomDim,buttonsBorder:e.buttons.border,buttonsAlign:e.buttons.textAlign,buttonsBorderRadius:e.buttons.borderRadius,buttonsPadding:e.buttons.padding,cardsContrastBackgroundColor:(null===(t=e.cards)||void 0===t?void 0:t.contrastBackgroundColor)||"#1C52DC",cardsBaseBackgroundColor:(null===(l=e.cards)||void 0===l?void 0:l.baseBackgroundColor)||"#F8F8F8",cardsContrastTextColor:(null===(o=e.cards)||void 0===o?void 0:o.contrastTextColor)||"#FFFFFF",cardsBaseTextColor:(null===(a=e.cards)||void 0===a?void 0:a.baseTextColor)||"#5A5A5A",cardsBorder:(null===(r=e.cards)||void 0===r?void 0:r.border)||{all:null,top:null,right:null,bottom:null,left:null},cardsBorderRadius:(null===(n=e.cards)||void 0===n?void 0:n.borderRadius)||{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},blockBackgroundColor:(null===(i=e.block)||void 0===i?void 0:i.backgroundColor)||"",blockContrastBackgroundColor:(null===(s=e.block)||void 0===s?void 0:s.contrastBackgroundColor)||"#1C52DC",blockPaddingAll:null===(d=e.block)||void 0===d||null===(c=d.padding)||void 0===c?void 0:c.all,blockPaddingTop:null===(m=e.block)||void 0===m||null===(u=m.padding)||void 0===u?void 0:u.top,blockPaddingRight:null===(p=e.block)||void 0===p||null===(g=p.padding)||void 0===g?void 0:g.right,blockPaddingBottom:null===(h=e.block)||void 0===h||null===(b=h.padding)||void 0===b?void 0:b.bottom,blockPaddingLeft:null===(f=e.block)||void 0===f||null===(E=f.padding)||void 0===E?void 0:E.left}},Al={buttons_borderRadiusAll:"all",buttons_borderRadiusTopLeft:"topLeft",buttons_borderRadiusBottomLeft:"bottomLeft",buttons_borderRadiusTopRight:"topRight",buttons_borderRadiusBottomRight:"bottomRight"},Sl={cards_borderRadiusAll:"all",cards_borderRadiusTopLeft:"topLeft",cards_borderRadiusBottomLeft:"bottomLeft",cards_borderRadiusTopRight:"topRight",cards_borderRadiusBottomRight:"bottomRight"},kl=({className:e,email:t})=>{const{__:l}=(0,y.s9)(),a=(0,v.wA)(),r=(0,Pe.XW)(),[n]=C.A.useForm(),d=(0,v.d4)(H.uJ),m=(0,v.d4)(H.dH),p=(0,Y.rD)(),{token:f}=_l(),[E,_]=(0,o.useState)({}),[A,S]=(0,o.useState)({}),[w,B]=(0,o.useState)(!0),[x,T]=(0,o.useState)(!0),[R,N]=(0,o.useState)(!1),[L,I]=(0,o.useState)(!1),P={buttonsPaddingTop:"top",buttonsPaddingLeft:"left",buttonsPaddingRight:"right",buttonsPaddingBottom:"bottom"},O=t.common_styles&&"{}"!==t.common_styles?JSON.parse(t.common_styles):V.BD,[F,M]=(0,o.useState)(O.headings.bold),[D,W]=(0,o.useState)(O.headings.italic),[j,G]=(0,o.useState)(O.links.underline),[U,q]=(0,o.useState)(O.buttons.bold),[X,$]=(0,o.useState)(O.buttons.italic),[Z,K]=(0,o.useState)(null),Q=!!t.common_styles&&"{}"!==t.common_styles,J=(0,v.d4)(Ie.Wm);(0,o.useEffect)(()=>{J||K(null)},[O,K,J]),(0,o.useEffect)(()=>{J&&!Z&&K(yl(O))},[O,Z,J]),(0,o.useEffect)(()=>{m&&(a((0,H.RC)(!1)),n.setFieldsValue(yl(O)))},[n,m,a,O]);const[ee,te]=(0,o.useState)(Math.min(O.headings.fontSize-1,19)),[le,oe]=(0,o.useState)(Math.max(O.text.fontSize+1,20));(0,o.useEffect)(()=>{if(Z){var e,t,l,o,a,r,i,s,d,c,m,u,p;const g=Z.buttonsBorder;_(g);const h=Object.keys(g).find(e=>{var t,l,o;return(null===(t=g[e])||void 0===t?void 0:t.width)||(null===(l=g[e])||void 0===l?void 0:l.style)||(null===(o=g[e])||void 0===o?void 0:o.color)}),b=Z.cardsBorder;S(b);const f=Object.keys(b).find(e=>{var t,l,o;return(null===(t=b[e])||void 0===t?void 0:t.width)||(null===(l=b[e])||void 0===l?void 0:l.style)||(null===(o=b[e])||void 0===o?void 0:o.color)});n.setFieldsValue({buttons_borderPosition:h||"all",buttons_borderWidth:null!==(null===(e=g[h])||void 0===e?void 0:e.width)?null===(t=g[h])||void 0===t?void 0:t.width:"",buttons_borderColor:(null===(l=g[h])||void 0===l?void 0:l.color)||"",buttons_borderStyle:(null===(o=g[h])||void 0===o?void 0:o.style)||"",cards_borderPosition:f||"all",cards_borderWidth:null!==(null===(a=b[f])||void 0===a?void 0:a.width)?null===(r=b[f])||void 0===r?void 0:r.width:"",cards_borderColor:(null===(i=b[f])||void 0===i?void 0:i.color)||"",cards_borderStyle:(null===(s=b[f])||void 0===s?void 0:s.style)||"",buttons_borderRadiusAll:gl(Z.buttonsBorderRadius.all),buttons_borderRadiusTopLeft:gl(Z.buttonsBorderRadius.topLeft),buttons_borderRadiusBottomLeft:gl(Z.buttonsBorderRadius.bottomLeft),buttons_borderRadiusTopRight:gl(Z.buttonsBorderRadius.topRight),buttons_borderRadiusBottomRight:gl(Z.buttonsBorderRadius.bottomRight),cards_borderRadiusAll:gl(Z.cardsBorderRadius.all),cards_borderRadiusTopLeft:gl(Z.cardsBorderRadius.topLeft),cards_borderRadiusBottomLeft:gl(Z.cardsBorderRadius.bottomLeft),cards_borderRadiusTopRight:gl(Z.cardsBorderRadius.topRight),cards_borderRadiusBottomRight:gl(Z.cardsBorderRadius.bottomRight),blockPaddingAll:gl(Z.blockPaddingAll),blockPaddingTop:gl(Z.blockPaddingTop),blockPaddingRight:gl(Z.blockPaddingRight),blockPaddingBottom:gl(Z.blockPaddingBottom),blockPaddingLeft:gl(Z.blockPaddingLeft),blockPaddingLeftRight:gl(Z.blockPaddingRight)||gl(Z.blockPaddingLeft),blockPaddingTopBottom:gl(Z.blockPaddingTop)||gl(Z.blockPaddingBottom)}),gl(Z.blockPaddingAll)||!(gl(Z.blockPaddingTop)||gl(Z.blockPaddingRight)||gl(Z.blockPaddingBottom)||gl(Z.blockPaddingLeft))||Z.blockPaddingTop===Z.blockPaddingBottom&&Z.blockPaddingRight===Z.blockPaddingLeft?I(!0):I(!1),!gl(Z.buttonsBorderRadius.all)&&(gl(Z.buttonsBorderRadius.topLeft)||gl(Z.buttonsBorderRadius.bottomLeft)||gl(Z.buttonsBorderRadius.topRight)||gl(Z.buttonsBorderRadius.bottomRight))?B(!1):B(!0),Z.buttonsPadding&&!gl(Z.buttonsPadding.all)&&(gl(Z.buttonsPadding.bottom)||gl(Z.buttonsPadding.right)||gl(Z.buttonsPadding.left)||gl(Z.buttonsPadding.top))&&N(!1),!gl(null===(d=Z.cardsBorderRadius)||void 0===d?void 0:d.all)&&(gl(null===(c=Z.cardsBorderRadius)||void 0===c?void 0:c.topLeft)||gl(null===(m=Z.cardsBorderRadius)||void 0===m?void 0:m.bottomLeft)||gl(null===(u=Z.cardsBorderRadius)||void 0===u?void 0:u.topRight)||gl(null===(p=Z.cardsBorderRadius)||void 0===p?void 0:p.bottomRight))?T(!1):T(!0)}},[n,Z]);const ae=e=>{const t=e.target.closest("button"),l=t.name,o=t.classList.contains("selected-td-form__button--active");t.className=o?"ant-btn ant-btn-default":"ant-btn ant-btn-default selected-td-form__button--active",t.blur(),"headingBold"===l?M(!o):"headingItalic"===l?W(!o):"linkUnderline"===l?G(!o):"buttonsBold"===l?q(!o):"buttonsItalic"===l&&$(!o),r({operation:V.Ru.SANDBOX_EMAIL_SETTINGS_SET,settings:{[l]:!o}})};return Z&&o.createElement("div",{className:k()("appearance-panel",{[e]:e})},o.createElement(C.A,{form:n,layout:"vertical",name:"content_appearance_panel_form",initialValues:Z,onValuesChange:e=>{var t,l,o,a,i,s;const d=n.getFieldsValue(!0),c=Object.keys(e)[0];let m={};switch(c){case"headingFontSize":te(Math.min(d.headingFontSize-1,19)),m=e;break;case"textFontSize":oe(Math.max(d.textFontSize+1,20)),m=e;break;case"buttons_borderStyle":m={buttonsBorder:{[d.buttons_borderPosition]:{...E[d.buttons_borderPosition],style:e[c]}}},"all"===d.buttons_borderPosition?_(t=>({...V.iV,[d.buttons_borderPosition]:{...t[d.buttons_borderPosition],style:e[c]}})):_(t=>({...t,[d.buttons_borderPosition]:{...t[d.buttons_borderPosition],style:e[c]}}));break;case"buttons_borderColor":m={buttonsBorder:{[d.buttons_borderPosition]:{...E[d.buttonsBorderPosition],color:e[c]}}},"all"===d.buttons_borderPosition?_(t=>({...V.iV,[d.buttons_borderPosition]:{...t[d.buttons_borderPosition],color:e[c]}})):_(t=>({...t,[d.buttons_borderPosition]:{...t[d.buttons_borderPosition],color:e[c]}}));break;case"buttons_borderWidth":m={buttonsBorder:{[d.buttons_borderPosition]:{...E[d.buttons_borderPosition],width:e[c]}}},"all"===d.buttonsBorderPosition?_(t=>({...V.iV,[d.buttons_borderPosition]:{...t[d.buttons_borderPosition],width:e[c]}})):_(t=>({...t,[d.buttons_borderPosition]:{...t[d.buttons_borderPosition],width:e[c]}}));break;case"buttons_borderPosition":n.setFieldsValue({buttons_borderWidth:(null===(t=E[e[c]])||void 0===t?void 0:t.width)||"",buttons_borderColor:(null===(l=E[e[c]])||void 0===l?void 0:l.color)||"",buttons_borderStyle:(null===(o=E[e[c]])||void 0===o?void 0:o.style)||""});break;case"cards_borderStyle":m={cardsBorder:{[d.cards_borderPosition]:{...A[d.cards_borderPosition],style:e[c]}}},"all"===d.cards_borderPosition?S(t=>({...V.iV,[d.cards_borderPosition]:{...t[d.cards_borderPosition],style:e[c]}})):S(t=>({...t,[d.cards_borderPosition]:{...t[d.cards_borderPosition],style:e[c]}}));break;case"cards_borderColor":m={cardsBorder:{[d.cards_borderPosition]:{...A[d.cardsBorderPosition],color:e[c]}}},"all"===d.cards_borderPosition?S(t=>({...V.iV,[d.cards_borderPosition]:{...t[d.cards_borderPosition],color:e[c]}})):S(t=>({...t,[d.cards_borderPosition]:{...t[d.cards_borderPosition],color:e[c]}}));break;case"cards_borderWidth":m={cardsBorder:{[d.cards_borderPosition]:{...A[d.cards_borderPosition],width:e[c]}}},"all"===d.cardsBorderPosition?S(t=>({...V.iV,[d.cards_borderPosition]:{...t[d.cards_borderPosition],width:e[c]}})):S(t=>({...t,[d.cards_borderPosition]:{...t[d.cards_borderPosition],width:e[c]}}));break;case"cards_borderPosition":n.setFieldsValue({cards_borderWidth:(null===(a=A[e[c]])||void 0===a?void 0:a.width)||"",cards_borderColor:(null===(i=A[e[c]])||void 0===i?void 0:i.color)||"",cards_borderStyle:(null===(s=A[e[c]])||void 0===s?void 0:s.style)||""});break;case"buttons_borderRadiusAll":case"buttons_borderRadiusTopLeft":case"buttons_borderRadiusBottomLeft":case"buttons_borderRadiusTopRight":case"buttons_borderRadiusBottomRight":m={buttonsBorderRadius:{[Al[c]]:+e[c]}};break;case"cards_borderRadiusAll":case"cards_borderRadiusTopLeft":case"cards_borderRadiusBottomLeft":case"cards_borderRadiusTopRight":case"cards_borderRadiusBottomRight":m={cardsBorderRadius:{[Sl[c]]:+e[c]}};break;case"buttonsPaddingTop":case"buttonsPaddingLeft":case"buttonsPaddingRight":case"buttonsPaddingBottom":R?(m={padding:{all:+e[c]}},n.setFieldsValue({paddingTop:e[c],paddingLeft:e[c],paddingRight:e[c],paddingBottom:e[c]})):m={buttonsPadding:{[P[c]]:+e[c]}};break;case"blockPaddingTop":case"blockPaddingLeft":case"blockPaddingRight":case"blockPaddingBottom":m={blockPadding:{left:d.blockPaddingLeft||0,right:d.blockPaddingRight||0,top:d.blockPaddingTop||0,bottom:d.blockPaddingBottom||0,[P[c]]:+e[c]}};break;case"blockPaddingTopBottom":m={blockPadding:{left:d.blockPaddingLeft||0,right:d.blockPaddingRight||0,top:+e[c],bottom:+e[c]}},d.blockPaddingTop=d.blockPaddingBottom=+e[c];break;case"blockPaddingLeftRight":m={blockPadding:{top:d.blockPaddingTop||0,bottom:d.blockPaddingBottom||0,left:+e[c],right:+e[c]}},d.blockPaddingLeft=d.blockPaddingRight=+e[c];break;default:m=e}"buttons_borderPosition"!==c&&r({operation:V.Ru.SANDBOX_EMAIL_SETTINGS_SET,settings:m})},autoComplete:"off",className:"element-controls"},Q?null:o.createElement(u.A,{style:{marginBottom:"24px"},message:l("It looks like the email was not created in our service, so the content styles won`t work. Read more about content styles in the help."),type:"info"}),o.createElement("div",{className:"form-group-title",style:{paddingTop:0}},l("Blocks")),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Blocks background color"),placement:"bottom"},o.createElement(C.A.Item,{name:"blockBackgroundColor",style:{marginBottom:f.formItemMarginBottomMD+4},rules:[{message:l("Please set the background color")}]},o.createElement(_e,{placeholder:l("Background color"),usedColors:d.usedColors})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Background color of the contrast blocks"),placement:"bottom"},o.createElement(C.A.Item,{name:"blockContrastBackgroundColor",style:{marginBottom:f.formItemMarginBottomMD+4},rules:[{message:l("Please set the background color")}]},o.createElement(_e,{placeholder:l("Background color"),usedColors:d.usedColors}))))),o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(o.Fragment,null,o.createElement(b.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:L?"block":"none"}},o.createElement(i.A,{title:l("Horizontal padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"blockPaddingLeftRight"},o.createElement(Lt.A,{min:0,placeholder:l("Horizontal"),prefix:o.createElement(z.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:L?"none":"block"}},o.createElement(i.A,{trigger:["hover"],title:l("Left padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"blockPaddingLeft",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,placeholder:l("Left"),prefix:o.createElement(z.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(i.A,{trigger:["hover"],title:l("Right padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"blockPaddingRight"},o.createElement(Lt.A,{min:0,placeholder:l("Right"),prefix:o.createElement(z.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(b.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:L?"block":"none"}},o.createElement(i.A,{title:l("Vertical padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"blockPaddingTopBottom"},o.createElement(Lt.A,{min:0,placeholder:l("Vertical"),prefix:o.createElement(z.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:L?"none":"block"}},o.createElement(i.A,{trigger:["hover"],title:l("Top padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"blockPaddingTop",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,placeholder:l("Top"),prefix:o.createElement(z.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(i.A,{trigger:["hover"],title:l("Bottom padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"blockPaddingBottom"},o.createElement(Lt.A,{min:0,placeholder:l("Bottom"),prefix:o.createElement(z.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(b.A,{span:4,style:{width:45,flex:"auto",maxWidth:"none"}},o.createElement(i.A,{title:l("Individual padding"),placement:"bottom"},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!L}),onClick:()=>{I(e=>!e);const e=n.getFieldsValue(!0);L||(e.blockPaddingLeftRight=e.blockPaddingLeft,e.blockPaddingTopBottom=e.blockPaddingTop,e.blockPaddingRight=e.blockPaddingLeft,e.blockPaddingBottom=e.blockPaddingTop,r({operation:V.Ru.SANDBOX_EMAIL_SETTINGS_SET,settings:{blockPadding:{top:e.blockPaddingTopBottom,bottom:e.blockPaddingTopBottom,left:e.blockPaddingLeftRight,right:e.blockPaddingLeftRight}}}))}},o.createElement(z.A,{icon:"PaddingSwitcher"})))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("General text")),o.createElement(i.A,{trigger:["hover"],title:l("Font of the general text"),placement:"bottom"},o.createElement(C.A.Item,{name:"textFontFamily",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(ct,{value:Z.textFontFamily}))),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Font size of the general text"),placement:"bottom"},o.createElement(C.A.Item,{name:"textFontSize"},o.createElement(Lt.A,{min:15,max:ee,placeholder:l("Font size"),prefix:o.createElement(Je.A,null),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Line height of the general text"),placement:"bottom"},o.createElement(C.A.Item,{name:"textLineHeight"},o.createElement(Lt.A,{min:0,placeholder:l("Line height"),prefix:o.createElement(et.A,null),addonAfter:"px"}))))),o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Color of the general text"),placement:"bottom"},o.createElement(C.A.Item,{name:"textColor"},o.createElement(_e,{placeholder:l("Text color"),usedColors:d.usedColors})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Contrast block text color"),placement:"bottom"},o.createElement(C.A.Item,{name:"textContrastColor"},o.createElement(_e,{placeholder:l("Text color"),usedColors:d.usedColors}))))),o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Bottom padding of the general text"),placement:"bottom"},o.createElement(C.A.Item,{name:"textPaddingBottom"},o.createElement(Lt.A,{min:0,placeholder:l("Bottom padding"),prefix:o.createElement(z.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Headings")),o.createElement(i.A,{trigger:["hover"],title:l("Heading font"),placement:"left"},o.createElement(C.A.Item,{name:"headingFontFamily",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(ct,null))),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Heading font size"),placement:"bottom"},o.createElement(C.A.Item,{name:"headingFontSize",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(Lt.A,{min:le,max:40,placeholder:l("Font size"),prefix:o.createElement(Je.A,null),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Heading line height"),placement:"bottom"},o.createElement(C.A.Item,{name:"headingLineHeight",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,placeholder:l("Line height"),prefix:o.createElement(et.A,null),addonAfter:"px"}))))),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Heading letter spacing"),placement:"bottom"},o.createElement(C.A.Item,{name:"headingLetterSpacing"},o.createElement(Lt.A,{min:0,placeholder:l("Letter spacing"),prefix:o.createElement(Ee.A,null),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(s.A,null,o.createElement(i.A,{placement:"bottom",title:l("Strong")},o.createElement(g.Ay,{className:k()({"selected-td-form__button--active":F}),type:"default",name:"headingBold",onClick:ae},o.createElement(tt.A,null))),o.createElement(i.A,{placement:"bottom",title:l("Italic")},o.createElement(g.Ay,{className:k()({"selected-td-form__button--active":D}),type:"default",name:"headingItalic",onClick:ae},o.createElement(lt.A,null)))))),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Heading color"),placement:"bottom"},o.createElement(C.A.Item,{name:"headingColor"},o.createElement(_e,{placeholder:l("Heading color"),usedColors:d.usedColors})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Contrast block header color"),placement:"bottom"},o.createElement(C.A.Item,{name:"headingContrastColor"},o.createElement(_e,{placeholder:l("Heading color"),usedColors:d.usedColors}))))),o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Top padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"headingPaddingTop"},o.createElement(Lt.A,{min:0,placeholder:l("Top padding"),prefix:o.createElement(z.A,{icon:"PaddingTop"}),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Bottom padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"headingPaddingBottom"},o.createElement(Lt.A,{min:0,placeholder:l("Bottom padding"),prefix:o.createElement(z.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Links")),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Link color"),placement:"bottom"},o.createElement(C.A.Item,{name:"linkColor",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(_e,{placeholder:l("Link color"),usedColors:d.usedColors})))),o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:l("Underline")},o.createElement(g.Ay,{className:k()({"selected-td-form__button--active":j}),type:"default",name:"linkUnderline",onClick:ae},o.createElement(ot.A,null))))),o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Link color in contrasting blocks"),placement:"bottom"},o.createElement(C.A.Item,{name:"linkContrastColor"},o.createElement(_e,{placeholder:l("Link color"),usedColors:d.usedColors}))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Buttons")," ",o.createElement("span",{className:"form-group-title__bull"},"\u2022")," ",l("Text & background")),o.createElement(i.A,{trigger:["hover"],title:l("Buttons font"),placement:"left"},o.createElement(C.A.Item,{name:"buttonsFontFamily",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(ct,null))),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Buttons font size"),placement:"bottom"},o.createElement(C.A.Item,{name:"buttonsFontSize",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,placeholder:l("Font size"),prefix:o.createElement(Je.A,null),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Buttons letter spacing"),placement:"bottom"},o.createElement(C.A.Item,{name:"buttonsLetterSpacing",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,placeholder:l("Letter spacing"),prefix:o.createElement(Ee.A,null),addonAfter:"px"}))))),o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Buttons text color"),placement:"bottom"},o.createElement(C.A.Item,{name:"buttonsColor",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(_e,{placeholder:l("Buttons text color"),usedColors:d.usedColors})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Button text color in contrasting blocks"),placement:"bottom"},o.createElement(C.A.Item,{name:"buttonsContrastColor",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(_e,{placeholder:l("Buttons text color"),usedColors:d.usedColors})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Buttons background color"),placement:"bottom"},o.createElement(C.A.Item,{name:"buttonsBackgroundColor"},o.createElement(_e,{placeholder:l("Background color"),usedColors:d.usedColors})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Button background color in contrasting blocks"),placement:"bottom"},o.createElement(C.A.Item,{name:"buttonsContrastBackgroundColor"},o.createElement(_e,{placeholder:l("Background color"),usedColors:d.usedColors})))),p.formButtonFieldTextAlignEnabled&&o.createElement(b.A,{span:12},o.createElement(ut,{form:n,elementSettings:{textAlign:"",type:"email"},imgParent:!1,name:"buttonsAlign",withHotKeys:!1})),o.createElement(b.A,{span:12},o.createElement(s.A,null,o.createElement(i.A,{placement:"bottom",title:l("Strong")},o.createElement(g.Ay,{className:k()({"selected-td-form__button--active":U}),type:"default",name:"buttonsBold",onClick:ae},o.createElement(tt.A,null))),o.createElement(i.A,{placement:"bottom",title:l("Italic")},o.createElement(g.Ay,{className:k()({"selected-td-form__button--active":X}),type:"default",name:"buttonsItalic",onClick:ae},o.createElement(lt.A,null)))))),p.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Buttons")," ",o.createElement("span",{className:"form-group-title__bull"},"\u2022")," ",l("Borders")),o.createElement("div",{style:{paddingBottom:4}},o.createElement(St,{form:n,borders:E,namePrefix:"buttons_"}))),p.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Buttons")," ",o.createElement("span",{className:"form-group-title__bull"},"\u2022")," ",l("Border radius")),o.createElement("div",{style:{paddingBottom:4}},o.createElement(jt,{form:n,oneBorderRadiusValue:w,setOneBorderRadiusValue:B,elementSettings:Z,namePrefix:"buttons_"}))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Buttons")," ",o.createElement("span",{className:"form-group-title__bull"},"\u2022")," ",l("Margins")),o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Top margin"),placement:"bottom"},o.createElement(C.A.Item,{name:"buttonsMarginTop"},o.createElement(Lt.A,{min:0,placeholder:l("Top margin"),prefix:o.createElement(z.A,{icon:"PaddingTop"}),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Bottom margin"),placement:"bottom"},o.createElement(C.A.Item,{name:"buttonsMarginBottom"},o.createElement(Lt.A,{min:0,placeholder:l("Bottom margin"),prefix:o.createElement(z.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Cards")," ",o.createElement("span",{className:"form-group-title__bull"},"\u2022")," ",l("Colors")),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:f.formItemMarginBottomXS}},l("Base colors")),o.createElement(i.A,{trigger:["hover"],title:l("Base background color"),placement:"bottom"},o.createElement(C.A.Item,{name:"cardsBaseBackgroundColor",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(_e,{placeholder:l("Base background color"),usedColors:d.usedColors})))),o.createElement(b.A,{span:12},o.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:f.formItemMarginBottomXS}},l("Contrasting colors")),o.createElement(i.A,{trigger:["hover"],title:l("Contrasting background color"),placement:"bottom"},o.createElement(C.A.Item,{name:"cardsContrastBackgroundColor",style:{marginBottom:f.formItemMarginBottomXS}},o.createElement(_e,{placeholder:l("Contrasting background color"),usedColors:d.usedColors}))))),o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Base text color"),placement:"bottom"},o.createElement(C.A.Item,{name:"cardsBaseTextColor"},o.createElement(_e,{placeholder:l("Base text color"),usedColors:d.usedColors})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:l("Contrasting text color"),placement:"bottom"},o.createElement(C.A.Item,{name:"cardsContrastTextColor"},o.createElement(_e,{placeholder:l("Contrasting text color"),usedColors:d.usedColors}))))),p.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Cards")," ",o.createElement("span",{className:"form-group-title__bull"},"\u2022")," ",l("Borders")),o.createElement("div",{style:{paddingBottom:4}},o.createElement(St,{form:n,borders:A,namePrefix:"cards_"}))),p.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Cards")," ",o.createElement("span",{className:"form-group-title__bull"},"\u2022")," ",l("Border radius")),o.createElement("div",{style:{paddingBottom:4}},o.createElement(jt,{form:n,oneBorderRadiusValue:x,setOneBorderRadiusValue:T,elementSettings:Z,namePrefix:"cards_"})))))},wl=({email:e})=>{const{__:t}=(0,y.s9)(),l=e.hasOwnProperty("type")?V.IE:V.Tm,[a,r]=(0,o.useState)(V.xz),n=(0,Y.rD)(),i=!!e.common_styles&&"{}"!==e.common_styles;let s=[{label:o.createElement(o.Fragment,null,l===V.Tm?t("Global styles"):t("Block styles")),key:V.xz,forceRender:!0,className:"email-settings__collapse-panel",children:l===V.Tm?o.createElement(qe,{className:"email-settings__collapse-panel-content",email:e}):o.createElement(Qe,{className:"email-settings__collapse-panel-content"})}];return l===V.Tm&&i&&n.commonStylesEnabled&&s.push({label:o.createElement(o.Fragment,null,t("Content styles")),key:"contentStyles",forceRender:!0,className:"email-settings__collapse-panel",children:o.createElement(kl,{className:"email-settings__collapse-panel-content",email:e})}),o.createElement(o.Fragment,null,o.createElement(m.A,{className:"secondary-tabs email-settings__collapse appearance-panel__content-styles",size:"large",animated:{inkBar:!1,tabPane:!1},activeKey:a,onChange:e=>r(e||""),items:s}))};var Cl=l(71832),Bl=l(6969),xl=l(72510),Tl=l(36434),Rl=l(73180);const Nl=l.p+"static/media/icon-menu-block-welcome.1c534a003522feadd2e7.png";var Ll=l(3326),Il=l(15450);const Pl=e=>e=(e=(e=(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"")).replace(/<\/?(?:script|embed|object|frameset|frame|iframe|applet|meta)[^>]*>/gi,"")).replace(/ on\w+="[^"]*"/g,"")).replace(/ on\w+='[^']*'/g,""),{name:Ol,type:Fl,tags:Ml}={name:"name",type:"type",tags:"tags"},Dl={[Ol]:"",[Fl]:[],[Ml]:[]},Vl={Header:10,Menu:20,Banners:30,Content:40,Lists:50,Buttons:60,Promocodes:70,"E-Commerce":80,Transactional:80,Articles:90,Polls:100,Applications:110,Feature:120,Separators:130,Contacts:140,Footer:150},{useToken:Wl}=r.A,jl=({parentEmailId:e=V.iU,blocksTab:t,search:l,reloadBlockScreens:a,email:r,setIsShowAddAllBlocksModal:i})=>{const{projectId:s}=(0,_.g)(),d=(0,K.sh)(),m=(0,K._9)(),[p]=C.A.useForm(),{data:h}=(0,q.h1)(),{token:b}=Wl(),{__:f,_x:E}=(0,y.s9)(),S=(0,A.hN)(),{modal:w}=n.A.useApp(),{confirm:x}=w;let T=(0,_.zy)();const R=(0,v.d4)(Ie.V$),P=(0,o.useRef)(null),O=(0,o.useRef)(null),M=(0,Ll.cR)(),D="string"===typeof(null===r||void 0===r?void 0:r.common_styles)&&null!==r&&void 0!==r&&r.common_styles.startsWith("{")?JSON.parse(r.common_styles):{},W=(0,o.useRef)(null),j=(0,o.useRef)(null),z=(0,o.useRef)(null),H=(0,v.Pj)();(0,o.useEffect)(()=>{var e;null===(e=O.current)||void 0===e||e.scrollTo({top:0})},[t,l]);const{data:G}=F.Nq.endpoints.getProject.select(+s)(H.getState()),[U,X]=(0,o.useState)({projectId:s,pageSize:1e3,page:1,tags:null,name:null,type:null,notEmbed:!0,order:"asc",orderby:"title"});(0,o.useEffect)(()=>{l||(p.setFieldsValue(Dl),we({type:null,name:null}),a())},[l,p,a]),(0,o.useEffect)(()=>{if(h){const e=h.schema.properties.acf.properties.type.items.enum;let t=[];for(let l in e)t.push({label:f(V.jg[e[l]]),value:e[l]})}},[h,f]);const{isSuccess:$,isError:Z,isLoading:Y,isFetching:Q,data:J,refetch:ee,error:te}=(0,q.SB)({...U,page:1}),le=(0,o.useMemo)(()=>{if($&&J)return[...J].sort((e,t)=>Vl[e.type]-Vl[t.type])},[$,J]),[oe,ae]=(0,o.useState)([]);(0,Rl.ZC)(e=>{e!==Z&&S.fromError("BLOCK_GET_ERROR",{},te,!0)},[Z,te,S]);const[re,ne]=(0,o.useState)({emailId:e,pageSize:1e3,page:1,projectId:V.p5,notEmbed:!0,name:null,type:null}),{isSuccess:ie,isError:se,isLoading:de,isFetching:ce}=(0,q.OD)({...re,emailId:e,page:1},{skip:!e||R.length}),me=(0,o.useMemo)(()=>{if(ie||R.length)return[...R].sort((e,t)=>Vl[e.type]-Vl[t.type])},[ie,R]),[ue,pe]=(0,o.useState)([]);(0,o.useEffect)(()=>{const e=new Set;if(R.length&&me){for(const t of me)t.type&&e.add(t.type);pe(Array.from(e))}else pe([])},[R,me]);const[ge,he]=(0,o.useState)({pageSize:1e3,page:1,notEmbed:!0,name:null,type:null}),{isSuccess:be,isError:fe,isLoading:Ee,isFetching:ve,data:_e=[]}=(0,q.kz)({...ge,page:1}),ye=(0,o.useMemo)(()=>{if(_e.length)return[..._e].sort((e,t)=>Vl[e.type]-Vl[t.type])},[_e]),[Ae,Se]=(0,o.useState)([]);(0,o.useEffect)(()=>{const e=new Set;if(ye&&_e.length){for(const t of ye)t.type&&e.add(t.type);Se(Array.from(e))}},[_e.length,ye]);const ke=(0,o.useMemo)(()=>{const e=new Set;for(const t of oe)e.add(t);for(const t of ue)e.add(t);for(const t of Ae)e.add(t);return Array.from(e)},[Ae,ue,oe]),we=e=>{X(t=>({...t,...e,page:1})),ne(t=>({...t,...e,page:1})),he(t=>({...t,...e,page:1}))},Ce=(0,o.useCallback)(()=>{M.querySelector(".blocks-search__result-wrapper.is_search")&&(M.querySelector(".blocks-search__result-wrapper").style.removeProperty("transition"),M.querySelector(".blocks-search__result-wrapper").style.opacity=0,M.querySelectorAll(".blocks-search__result-body").forEach(e=>e.style.removeProperty("height")),M.querySelectorAll(".blocks-search__result-body").forEach(e=>{e.style.height=207*e.offsetHeight/660+"px"}),M.querySelector(".blocks-search__result-wrapper").style.transition="opacity 0.2s",M.querySelectorAll(".blocks-search__result-wrapper").forEach(e=>e.style.opacity=1))},[]);(0,o.useEffect)(()=>{ve||Ee||!be||"template"===t||(l?Ce():a())},[ve,Ee,be,Ce,U.name,a,l,t]),(0,o.useEffect)(()=>{const e=new Set;if($&&le){for(const t of le)t.type&&e.add(t.type);ae(Array.from(e))}},[$,le]);const Be=e=>{a(),e.target.getAttribute("data-type")?(e.target.closest(".blocks-search").querySelectorAll(".blocks-search__result").forEach(e=>e.style.display="none"),e.target.closest(".blocks-search").querySelectorAll(`[data-type="${e.target.getAttribute("data-type")}"]`).forEach(e=>e.style.display="block")):e.target.closest(".blocks-search").querySelectorAll(".blocks-search__result").forEach(e=>e.style.display="block"),e.target.parentElement.querySelector(".active").classList.remove("active"),e.target.classList.add("active")};let xe=null;const Te=e=>{clearTimeout(xe);let t=M.querySelector(".block-search__preview")?M.querySelector(".block-search__preview"):null,l=M.querySelector(".block-search__preview-title")?M.querySelector(".block-search__preview-title"):null,o=M.querySelector(".block-search__preview-content")?M.querySelector(".block-search__preview-content"):null;M.querySelector(".block-search__preview")||(t=document.createElement("div"),t.classList.add("block-search__preview"),l=document.createElement("div"),l.classList.add("block-search__preview-title"),o=document.createElement("div"),o.classList.add("block-search__preview-content"),t.append(o),t.append(l),M.querySelector(".email-pane__col_settings-inner").append(t)),l.innerHTML="",o.innerHTML="",l.innerHTML=e.title;let a=e.html.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();o.innerHTML=Pl('<table cellspacing="0" cellpadding="0" border="0" width="100%">'+a+"</table>"),"1"!==t.style.opacity&&setTimeout(function(){t.style.opacity="1",t.style.transform=document.querySelector(".email-pane__col-wrapper_reverse")?"translateX(100%)":"translateX(-100%)"},10)},Re=()=>{let e=M.querySelector(".block-search__preview");e&&(xe=setTimeout(()=>{e.style.opacity="0",e.style.transform=document.querySelector(".email-pane__col-wrapper_reverse")?"translateX(99%)":"translateX(-99%)",setTimeout(function(){e.remove()},300)},300))};(0,o.useEffect)(()=>{M.querySelectorAll(".blocks-search__result").forEach(e=>{e.style.display="block"})},[t]);const Ne=!(null!==J&&void 0!==J&&J.length)&&(!e||!(null!==R&&void 0!==R&&R.length))&&!(null!==_e&&void 0!==_e&&_e.length)&&(U.tags||U.name||U.type)&&!(Y||Q);(0,o.useEffect)(()=>{Y||Q||a()},[Y,Q,a]),(0,o.useEffect)(()=>{("common"===t||l)&&setTimeout(a,50)},[J,a,t,l]);const Le=e=>{x({maskClosable:!0,centered:!0,title:E("Are you sure you want to delete the \u201c","block")+e.title+f("\u201d block?"),icon:o.createElement(I.A,null),okText:f("Yes"),cancelText:f("No"),onOk:()=>(e=>H.dispatch(q.VM.endpoints.deleteBlock.initiate(e.id)).then(t=>{t.error&&S.fromError("BLOCK_REMOVING_ERROR",(0,A.x_)(e),t.error),S.success({id:"BLOCK_REMOVING_SUCCESS",data:(0,A.x_)(e),message:f("The block \u201c")+t.data.title+E("\u201d was successfully removed.","block")}),ee()}))(e)})},Pe=(e,t)=>`${e.pathname.split("emails")[0]}blocks/${t.id}`,Oe=e=>{let t=[{key:"Delete block",className:"blocks-search__result__menu-item",icon:o.createElement(I.A,{style:{fontSize:"16px",margin:0}}),style:{color:b.colorError},onClick:()=>Le(e)}];return!V.EW.isPlugin&&t.unshift({key:"Edit block",className:"blocks-search__result__menu-item",icon:o.createElement(Bl.A,{style:{fontSize:"16px",margin:0}}),label:o.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:Pe(T,e)}," ")}),t},Fe=e=>{let t="<tr"===e.html.substring(0,3)?document.createElement("table"):document.createElement("div");if(t.replaceChildren(...(0,Tl.$$)(e.html)),0!==Object.keys(D).length&&(t.querySelectorAll(".em-contrast-card").forEach(e=>{var t,l;null!==(t=D.cards)&&void 0!==t&&t.contrastBackgroundColor&&(e.getAttribute("bgcolor")?D.cards.contrastBackgroundColor?e.setAttribute("bgcolor",D.cards.contrastBackgroundColor):e.removeAttribute("bgcolor"):D.cards.contrastBackgroundColor?e.style.backgroundColor=D.cards.contrastBackgroundColor:e.style.removeProperty("background-color")),null!==(l=D.cards)&&void 0!==l&&l.contrastTextColor&&e.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(e=>{if("#ffffff"!==De(e.style.color).toLowerCase()){let t=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.cards.contrastTextColor};`);e.setAttribute("style",t)}})}),t.querySelectorAll(".em-card").forEach(e=>{var t,l;null!==(t=D.cards)&&void 0!==t&&t.baseBackgroundColor&&(e.getAttribute("bgcolor")?D.cards.baseBackgroundColor?e.setAttribute("bgcolor",D.cards.baseBackgroundColor):e.removeAttribute("bgcolor"):D.cards.baseBackgroundColor?e.style.backgroundColor=D.cards.baseBackgroundColor:e.style.removeProperty("background-color")),null!==(l=D.cards)&&void 0!==l&&l.baseTextColor&&e.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(e=>{if("#ffffff"!==De(e.style.color).toLowerCase()){let t=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.cards.baseTextColor};`);e.setAttribute("style",t)}})}),t.querySelectorAll(".em-card, .em-contrast-card").forEach(e=>{var t,l,o,a,r,n;null!==(t=D.cards)&&void 0!==t&&t.border&&We({settings:{border:null===(n=D.cards)||void 0===n?void 0:n.border},elem:e});if(null!==(l=D.cards)&&void 0!==l&&null!==(o=l.borderRadius)&&void 0!==o&&o.all){var i,s,d,c;if(e.style.borderBottomLeftRadius&&"0px"!==e.style.borderBottomLeftRadius)e.style.borderBottomLeftRadius=(null===(i=D.cards)||void 0===i?void 0:i.borderRadius.all)+"px";if(e.style.borderBottomRightRadius&&"0px"!==e.style.borderBottomRightRadius)e.style.borderBottomRightRadius=(null===(s=D.cards)||void 0===s?void 0:s.borderRadius.all)+"px";if(e.style.borderTopLeftRadius&&"0px"!==e.style.borderTopLeftRadius)e.style.borderTopLeftRadius=(null===(d=D.cards)||void 0===d?void 0:d.borderRadius.all)+"px";if(e.style.borderTopRightRadius&&"0px"!==e.style.borderTopRightRadius)e.style.borderTopRightRadius=(null===(c=D.cards)||void 0===c?void 0:c.borderRadius.all)+"px"}else if(""===(null===(a=D.cards)||void 0===a||null===(r=a.borderRadius)||void 0===r?void 0:r.all))e.style.removeProperty("border-radius");else{var m,u,p,g,h,b,f,E,v,_,y,A,S,k,w,C,B,x,T,R;if(null!==(m=D.cards)&&void 0!==m&&null!==(u=m.borderRadius)&&void 0!==u&&u.topLeft&&e.style.borderTopLeftRadius&&"0px"!==e.style.borderTopLeftRadius)e.style.borderTopLeftRadius=(null===(B=D.cards)||void 0===B?void 0:B.borderRadius.topLeft)+"px";else""===(null===(p=D.cards)||void 0===p||null===(g=p.borderRadius)||void 0===g?void 0:g.topLeft)&&e.style.removeProperty("border-top-left-radius");if(null!==(h=D.cards)&&void 0!==h&&null!==(b=h.borderRadius)&&void 0!==b&&b.topRight&&e.style.borderTopRightRadius&&"0px"!==e.style.borderTopRightRadius)e.style.borderTopRightRadius=(null===(x=D.cards)||void 0===x?void 0:x.borderRadius.topRight)+"px";else""===(null===(f=D.cards)||void 0===f||null===(E=f.borderRadius)||void 0===E?void 0:E.topRight)&&e.style.removeProperty("border-top-right-radius");if(null!==(v=D.cards)&&void 0!==v&&null!==(_=v.borderRadius)&&void 0!==_&&_.bottomRight&&e.style.borderBottomRightRadius&&"0px"!==e.style.borderBottomRightRadius)e.style.borderBottomRightRadius=(null===(T=D.cards)||void 0===T?void 0:T.borderRadius.bottomRight)+"px";else""===(null===(y=D.cards)||void 0===y||null===(A=y.borderRadius)||void 0===A?void 0:A.bottomRight)&&e.style.removeProperty("border-bottom-right-radius");if(null!==(S=D.cards)&&void 0!==S&&null!==(k=S.borderRadius)&&void 0!==k&&k.bottomLeft&&e.style.borderBottomLeftRadius&&"0px"!==e.style.borderBottomLeftRadius)e.style.borderBottomLeftRadius=(null===(R=D.cards)||void 0===R?void 0:R.borderRadius.bottomLeft)+"px";else""===(null===(w=D.cards)||void 0===w||null===(C=w.borderRadius)||void 0===C?void 0:C.bottomLeft)&&e.style.removeProperty("border-bottom-left-radius")}}),t.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(e=>{if(!e.style.display&&parseFloat(e.style.fontSize)<=20){let o="",a=D.text.fontFamily;if(parseFloat(e.style.fontSize)>14&&(o=e.getAttribute("style").replace(/font-size:(\s+)?.*?px/,`font-size: ${D.text.fontSize}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${D.text.lineHeight}px`),e.setAttribute("style",o)),e.closest(".em-contrast-card, .em-card")||"#ffffff"===De(e.style.color).toLowerCase()||(o=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.text.color};`),e.setAttribute("style",o)),e.closest(".em-contrast-block")&&!e.closest(".em-contrast-card, .em-card")&&(o=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.text.contrastColor};`),e.setAttribute("style",o)),"Safe Fonts"===a[0]?(e.style.fontFamily=a[1],Me({elem:t})):"Google Fonts"===a[0]&&("Sans Serif"===a[1]?e.style.fontFamily="Helvetica, Arial, sans-serif":"Serif"===a[1]&&(e.style.fontFamily='"Times New Roman", Times, serif'),e.classList.remove(...[...e.classList].filter(e=>e.startsWith("em-font"))),e.classList.add(`em-font-${a[2].replace(/\s/g,"")}-${a[3].replace(/\s/g,"")}`),Ve({elem:t,fontFamilyArray:a})),e.closest('[em="atom"] > tr > td')&&e.closest('[em="atom"] > tr > td').style.paddingBottom)e.closest('[em="atom"] > tr > td').style.paddingBottom=D.text.paddingBottom+"px";else if(e.nextElementSibling||e.closest("table")&&e.closest("table").nextElementSibling){var l;let t=null!==(l=e.nextElementSibling)&&void 0!==l?l:e.closest("table").nextElementSibling;t&&"TABLE"===t.tagName&&(t.classList.contains("em-vindent-table")||""===t.querySelector("td").innerHTML)&&t.querySelector("td").setAttribute("height",D.text.paddingBottom)}}else if(!e.style.display&&parseFloat(e.style.fontSize)>=20&&"#eb3737"!==De(e.style.color).toLowerCase()){let l="",o=D.headings.fontFamily;parseFloat(e.style.fontSize)<40&&(l=e.getAttribute("style").replace(/font-size:(\s+)?.*?px/,`font-size: ${D.headings.fontSize}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${D.headings.lineHeight}px`),e.setAttribute("style",l)),e.closest(".em-contrast-card, .em-card")||"#ffffff"===De(e.style.color).toLowerCase()||(l=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.headings.color};`),e.setAttribute("style",l)),e.closest(".em-contrast-block")&&!e.closest(".em-contrast-card, .em-card")&&(l=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.headings.contrastColor};`),e.setAttribute("style",l)),"Safe Fonts"===o[0]?(e.style.fontFamily=o[1],Me({elem:t})):"Google Fonts"===o[0]&&("Sans Serif"===o[1]?e.style.fontFamily="Helvetica, Arial, sans-serif":"Serif"===o[1]&&(e.style.fontFamily='"Times New Roman", Times, serif'),e.classList.remove(...[...e.classList].filter(e=>e.startsWith("em-font"))),e.classList.add(`em-font-${o[2].replace(/\s/g,"")}-${o[3].replace(/\s/g,"")}`),Ve({elem:t,fontFamilyArray:o}));let a="";if(a=D.headings.letterSpacing>0?e.style.letterSpacing?e.getAttribute("style").replace(/letter-spacing:(\s+)?.*?px/,`letter-spacing: ${D.headings.letterSpacing}px`):e.getAttribute("style")+` letter-spacing: ${D.headings.letterSpacing}px;`:e.getAttribute("style").replace(/(\s+)?letter-spacing:(\s+)?.*?px(;)?/,""),e.setAttribute("style",a),D.headings.bold?e.querySelector("b")?e.querySelector("b").replaceWith(...e.querySelector("b").childNodes):e.querySelector("strong")||(e.innerHTML="<strong>"+e.innerHTML+"</strong>"):e.querySelector("strong")?e.querySelector("strong").replaceWith(...e.querySelector("strong").childNodes):e.querySelector("b")&&e.querySelector("b").replaceWith(...e.querySelector("b").childNodes),e.style.fontWeight){let t=e.getAttribute("style").replace(/(\s+)?font-weight:(\s+)?(bold|[0-9]*)(;)?/,"");e.setAttribute("style",t)}if(D.headings.italic?e.querySelector("i")?e.querySelector("i").replaceWith(...e.querySelector("i").childNodes):e.querySelector("em")||(e.innerHTML="<em>"+e.innerHTML+"</em>"):e.querySelector("em")?e.querySelector("em").replaceWith(...e.querySelector("em").childNodes):e.querySelector("i")&&e.querySelector("i").replaceWith(...e.querySelector("i").childNodes),e.style.fontStyle){let t=e.getAttribute("style").replace(/(\s+)?font-style:(\s+)?.*?;/,"");e.setAttribute("style",t)}if(e.closest('[em="atom"] > tr > td')&&e.closest('[em="atom"] > tr > td').style.paddingTop)e.closest('[em="atom"] > tr > td').style.paddingTop=D.headings.paddingTop+"px";else if(e.previousElementSibling){let t=e.previousElementSibling;t&&"TABLE"===t.tagName&&(t.classList.contains("em-vindent-table")||""===t.querySelector("td").innerHTML)&&t.querySelector("td").setAttribute("height",D.headings.paddingTop)}if(e.closest('[em="atom"] > tr > td')&&e.closest('[em="atom"] > tr > td').style.paddingBottom)e.closest('[em="atom"] > tr > td').style.paddingBottom=D.headings.paddingBottom+"px";else if(e.nextElementSibling){let t=e.nextElementSibling;t&&"TABLE"===t.tagName&&(t.classList.contains("em-vindent-table")||""===t.querySelector("td").innerHTML)&&t.querySelector("td").setAttribute("height",D.headings.paddingBottom)}}}),t.querySelectorAll('a[style*="color"]').forEach(e=>{if(e.style.display){if(e.style.display&&"block"===e.style.display){let l="";if(l=e.getAttribute("style").replace(/font-size:(\s+)?.*?px/,`font-size: ${D.buttons.fontSize}px`),e.setAttribute("style",l),!e.closest("td").style.backgroundColor||e.closest("td").style.borderWidth||e.closest(".em-contrast-card"))if(e.closest("td").style.borderWidth)if(Object.values(D.buttons.border).every(e=>null===e)){if(e.closest(".em-contrast-block")){if(D.buttons.contrastBackgroundColor){let t=e.closest("td").getAttribute("style").replace(/border:\s*\d+px\s+solid\s+#[A-Fa-f0-9]{6}/,e=>e.replace(/#[A-Fa-f0-9]{6}/,`${D.buttons.contrastBackgroundColor}`));e.closest("td").setAttribute("style",t),l=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.buttons.contrastBackgroundColor};`),e.setAttribute("style",l)}}else if(D.buttons.backgroundColor){let t=e.closest("td").getAttribute("style").replace(/border:\s*\d+px\s+solid\s+#[A-Fa-f0-9]{6}/,e=>e.replace(/#[A-Fa-f0-9]{6}/,`${D.buttons.backgroundColor}`));e.closest("td").setAttribute("style",t),l=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.buttons.backgroundColor};`),e.setAttribute("style",l)}}else for(const t in D.buttons.border)D.buttons.border[t]&&void 0!==D.buttons.border[t].color&&(l=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.buttons.border[t].color};`),e.setAttribute("style",l));else e.closest(".em-contrast-block")?D.buttons.contrastBackgroundColor&&(l=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.buttons.contrastBackgroundColor};`),e.setAttribute("style",l)):D.buttons.backgroundColor&&(l=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.buttons.backgroundColor};`),e.setAttribute("style",l));else if(l=e.closest(".em-contrast-block")?e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.buttons.contrastColor};`):e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.buttons.color};`),e.setAttribute("style",l),e.closest(".em-contrast-block"))if(D.buttons.contrastBackgroundColor){let t=e.closest("td").getAttribute("style").replace(/background-color:(\s+)?.*?;/,`background-color: ${D.buttons.contrastBackgroundColor};`);e.closest("td").setAttribute("style",t)}else e.closest("td").style.removeProperty("background-color");else if(D.buttons.backgroundColor){let t=e.closest("td").getAttribute("style").replace(/background-color:(\s+)?.*?;/,`background-color: ${D.buttons.backgroundColor};`);e.closest("td").setAttribute("style",t)}else e.closest("td").style.removeProperty("background-color");let o=D.buttons.fontFamily;"Safe Fonts"===o[0]?(e.style.fontFamily=o[1],Me({elem:t})):"Google Fonts"===o[0]&&("Sans Serif"===o[1]?e.style.fontFamily="Helvetica, Arial, sans-serif":"Serif"===o[1]&&(e.style.fontFamily='"Times New Roman", Times, serif'),e.classList.remove(...[...e.classList].filter(e=>e.startsWith("em-font"))),e.classList.add(`em-font-${o[2].replace(/\s/g,"")}-${o[3].replace(/\s/g,"")}`),Ve({elem:t,fontFamilyArray:o})),e.closest("td").setAttribute("align",D.buttons.textAlign);let a="";if(a=D.buttons.letterSpacing>0?e.style.letterSpacing?e.getAttribute("style").replace(/letter-spacing:(\s+)?.*?px/,`letter-spacing: ${D.buttons.letterSpacing}px`):e.getAttribute("style")+` letter-spacing: ${D.buttons.letterSpacing}px;`:e.getAttribute("style").replace(/(\s+)?letter-spacing:(\s+)?.*?px(;)?/,""),e.setAttribute("style",a),D.buttons.bold?e.querySelector("b")?e.querySelector("b").replaceWith(...e.querySelector("b").childNodes):e.querySelector("strong")||(e.innerHTML="<strong>"+e.innerHTML+"</strong>"):e.querySelector("strong")?e.querySelector("strong").replaceWith(...e.querySelector("strong").childNodes):e.querySelector("b")&&e.querySelector("b").replaceWith(...e.querySelector("b").childNodes),e.style.fontWeight){let t=e.getAttribute("style").replace(/(\s+)?font-weight:(\s+)?(bold|[0-9]*)(;)?/,"");e.setAttribute("style",t)}if(D.buttons.italic?e.querySelector("i")?e.querySelector("i").replaceWith(...e.querySelector("i").childNodes):e.querySelector("em")||(e.innerHTML="<em>"+e.innerHTML+"</em>"):e.querySelector("em")?e.querySelector("em").replaceWith(...e.querySelector("em").childNodes):e.querySelector("i")&&e.querySelector("i").replaceWith(...e.querySelector("i").childNodes),e.style.fontStyle){let t=e.getAttribute("style").replace(/(\s+)?font-style:(\s+)?.*?;/,"");e.setAttribute("style",t)}if(e.closest('[em="atom"] > tr > td')&&e.closest('[em="atom"] > tr > td').style.paddingTop)e.closest('[em="atom"] > tr > td').style.paddingTop=D.buttons.marginTop+"px";else if(e.closest("table").previousElementSibling){let t=e.closest("table").previousElementSibling;t&&"TABLE"===t.tagName&&(t.classList.contains("em-vindent-table")||""===t.querySelector("td").innerHTML)&&t.querySelector("td").setAttribute("height",D.buttons.marginTop)}if(e.closest('[em="atom"] > tr > td')&&e.closest('[em="atom"] > tr > td').style.paddingBottom)e.closest('[em="atom"] > tr > td').style.paddingBottom=D.buttons.marginBottom+"px";else if(e.closest("table").previousElementSibling){let t=e.closest("table").nextElementSibling;t&&"TABLE"===t.tagName&&(t.classList.contains("em-vindent-table")||""===t.querySelector("td").innerHTML)&&t.querySelector("td").setAttribute("height",D.buttons.marginBottom)}D.buttons.padding.all&&(e.style.padding=D.buttons.padding.all+"px"),D.buttons.padding.top&&(e.style.paddingTop=D.buttons.padding.top+"px"),D.buttons.padding.right&&(e.style.paddingRight=D.buttons.padding.right+"px"),D.buttons.padding.bottom&&(e.style.paddingBottom=D.buttons.padding.bottom+"px"),D.buttons.padding.left&&(e.style.paddingLeft=D.buttons.padding.left+"px"),We({settings:{border:D.buttons.border},elem:e.closest("td")}),je({settings:{borderRadius:D.buttons.borderRadius},elem:e.closest("td")})}}else{let l=D.text.fontFamily;if("#1c52dc"===De(e.style.color).toLowerCase()){let t=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.links.color};`);e.setAttribute("style",t)}else{let t=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.text.color};`);e.setAttribute("style",t)}if(e.closest(".em-contrast-block")){let t=e.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${D.links.contrastColor};`);e.setAttribute("style",t)}let o="";o=D.links.underline?e.style.textDecoration?e.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: underline;"):e.getAttribute("style")+" text-decoration: underline;":e.style.textDecoration?e.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: none;"):e.getAttribute("style")+" text-decoration: none;",e.setAttribute("style",o),"Safe Fonts"===l[0]?(e.style.fontFamily=l[1],Me({elem:t})):"Google Fonts"===l[0]&&("Sans Serif"===l[1]?e.style.fontFamily="Helvetica, Arial, sans-serif":"Serif"===l[1]&&(e.style.fontFamily='"Times New Roman", Times, serif'),e.classList.remove(...[...e.classList].filter(e=>e.startsWith("em-font"))),e.classList.add(`em-font-${l[2].replace(/\s/g,"")}-${l[3].replace(/\s/g,"")}`),Ve({elem:t,fontFamilyArray:l}))}}),t.querySelector('[em="block"]'))){var l,o;const e=t.querySelectorAll('[em="block"]');null!==(l=D.block)&&void 0!==l&&l.backgroundColor&&e.forEach(e=>{e.querySelectorAll(":scope > td").forEach(e=>{e.setAttribute("bgcolor",D.block.backgroundColor)})}),null!==(o=D.block)&&void 0!==o&&o.padding&&e.forEach(e=>{e.querySelectorAll(":scope > td").forEach(e=>{e.style.paddingTop=D.block.padding.top+"px",e.style.paddingRight=D.block.padding.right+"px",e.style.paddingBottom=D.block.padding.bottom+"px",e.style.paddingLeft=D.block.padding.left+"px"})})}return"DIV"===t.tagName?(0,xl.uL)(t):(0,xl.uL)(t.querySelector("tbody"))},Me=e=>{e.elem.querySelectorAll("link[em-class]").forEach(t=>{e.elem.querySelector("."+t.getAttribute("em-class"))||t.remove()})};function De(e){if(e&&"r"===e.charAt(0)){if("a"===e.charAt(3))return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):"";{e=e.replace("rgb(","").replace(")","").split(",");let t=parseInt(e[0],10).toString(16),l=parseInt(e[1],10).toString(16),o=parseInt(e[2],10).toString(16);return t=1===t.length?"0"+t:t,l=1===l.length?"0"+l:l,o=1===o.length?"0"+o:o,"#"+t+l+o}}if(e&&"#"===e.charAt(0))return e}const Ve=e=>{var t;const l=e.elem.querySelectorAll("link"),o=`em-font-${e.fontFamilyArray[2].replace(/\s/g,"")}-${e.fontFamilyArray[3].replace(/\s/g,"")}`;if(!!(null===(t=Array.from(l))||void 0===t||!t.find(e=>e.getAttribute("em-class")===o))){let t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",`https://fonts.googleapis.com/css2?family=${e.fontFamilyArray[2]}:ital,wght@${ze[e.fontFamilyArray[3]].indexOf("i")>-1?"1":"0"},${ze[e.fontFamilyArray[3]].replaceAll("i","")}&display=swap`),t.setAttribute("em-class",o),e.elem.insertAdjacentElement("afterbegin",t)}!function(e){if(!e.elem.querySelector('style[em="styles"]')){let t=document.createElement("style");t.setAttribute("em","styles"),e.elem.append(t)}}({elem:e.elem});let a=`font-family: '${e.fontFamilyArray[2]}', ${He[e.fontFamilyArray[1]]}!important;`;a+=` font-weight: ${ze[e.fontFamilyArray[3]].replaceAll("i","")}!important;`,ze[e.fontFamilyArray[3]].indexOf("i")>-1&&(a+=" font-style: italic!important;"),e.elem.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`\n.em-font-${e.fontFamilyArray[2].replace(/\s/g,"")}-${e.fontFamilyArray[3].replace(/\s/g,"")} { ${a} }`),setTimeout(()=>Me({elem:e.elem}),0)},We=e=>{e.settings.border.all?(null!==e.settings.border.all.width?e.elem.style.borderWidth=e.settings.border.all.width+"px":e.elem.style.removeProperty("border-width"),e.elem.style.borderStyle=e.settings.border.all.style,e.elem.style.borderColor=e.settings.border.all.color):(e.settings.border.top&&(null!==e.settings.border.top.width?e.elem.style.borderTopWidth=e.settings.border.top.width+"px":e.elem.style.removeProperty("border-top-width"),e.elem.style.borderTopStyle=e.settings.border.top.style,e.elem.style.borderTopColor=e.settings.border.top.color),e.settings.border.right&&(null!==e.settings.border.right.width?e.elem.style.borderRightWidth=e.settings.border.right.width+"px":e.elem.style.removeProperty("border-right-width"),e.elem.style.borderRightStyle=e.settings.border.right.style,e.elem.style.borderRightColor=e.settings.border.right.color),e.settings.border.bottom&&(null!==e.settings.border.bottom.width?e.elem.style.borderBottomWidth=e.settings.border.bottom.width+"px":e.elem.style.removeProperty("border-bottom-width"),e.elem.style.borderBottomStyle=e.settings.border.bottom.style,e.elem.style.borderBottomColor=e.settings.border.bottom.color),e.settings.border.left&&(null!==e.settings.border.left.width?e.elem.style.borderLeftWidth=e.settings.border.left.width+"px":e.elem.style.removeProperty("border-left-width"),e.elem.style.borderLeftStyle=e.settings.border.left.style,e.elem.style.borderLeftColor=e.settings.border.left.color))},je=e=>{e.settings.borderRadius.all?e.elem.style.borderRadius=e.settings.borderRadius.all+"px":""===e.settings.borderRadius.all?e.elem.style.removeProperty("border-radius"):(e.settings.borderRadius.topLeft?e.elem.style.borderTopLeftRadius=e.settings.borderRadius.topLeft+"px":""===e.settings.borderRadius.topLeft&&e.elem.style.removeProperty("border-top-left-radius"),e.settings.borderRadius.topRight?e.elem.style.borderTopRightRadius=e.settings.borderRadius.topRight+"px":""===e.settings.borderRadius.topRight&&e.elem.style.removeProperty("border-top-right-radius"),e.settings.borderRadius.bottomRight?e.elem.style.borderBottomRightRadius=e.settings.borderRadius.bottomRight+"px":""===e.settings.borderRadius.bottomRight&&e.elem.style.removeProperty("border-bottom-right-radius"),e.settings.borderRadius.bottomLeft?e.elem.style.borderBottomLeftRadius=e.settings.borderRadius.bottomLeft+"px":""===e.settings.borderRadius.bottomLeft&&e.elem.style.removeProperty("border-bottom-left-radius"))},ze={Thin:"100","Thin Italic":"100i",ExtraLight:"200","ExtraLight Italic":"200i",Light:"300","Light Italic":"300i",Regular:"400","Regular Italic":"400i",Medium:"500","Medium Italic":"500i",SemiBold:"600","SemiBold Italic":"600i",Bold:"700","Bold Italic":"700i",ExtraBold:"800","ExtraBold Italic":"800i",Black:"900","Black Italic":"900i"},He={"Sans Serif":"sans-serif",Serif:"serif"};return o.createElement("div",{className:k()("blocks-search",{is_search:l})},o.createElement(C.A,{className:k()("blocks-search__form",{is_search:l}),form:p,layout:"vertical",name:"blocks_search_form",initialValues:{...Dl},onValuesChange:e=>{const t=Object.keys(e)[0],l=p.getFieldsValue(!0);switch(t){case Ml:const o=(0,K._q)(G,V.YY).filter(l=>e[t].includes(l.name)).map(e=>e.id)||null;we({tags:o});break;case Fl:we({type:l.type||null});break;case Ol:P.current&&window.clearTimeout(P.current),P.current=window.setTimeout(function(){we({name:l.name||null})},300)}},autoComplete:"off"},o.createElement(C.A.Item,{name:Ol},o.createElement(B.A,{placeholder:f("Search by title"),allowClear:!0,suffix:o.createElement(Il.V,{className:"cards-search__search-icon",size:18,style:{cursor:"pointer"}})}))),(Z||se||fe)&&o.createElement(u.A,{message:f("Error"),description:f("Error when receiving data. Try again (reload page) or contact support."),type:"error",showIcon:!0}),l&&!Ne&&o.createElement("div",{className:"blocks-search__type-wrapper"},o.createElement("ul",null,o.createElement("li",{key:"search_All","data-type":"",className:"active",onClick:Be},f("All")),ke.map(e=>o.createElement("li",{"data-type":e,onClick:Be,key:"search_"+e},f(V.jg[e]))))),o.createElement("div",{ref:O,className:k()("blocks-search__result-wrapper",{is_search:l})},("project"===t||l)&&o.createElement(o.Fragment,null,!!oe.length&&!l&&o.createElement("div",{className:"blocks-search__type-wrapper"},o.createElement("ul",null,o.createElement("li",{key:"blocksSections_All","data-type":"",className:"active",onClick:Be},f("All")),oe.map(e=>o.createElement("li",{key:"blocksSections_"+e,"data-type":e,onClick:Be},f(V.jg[e]))))),o.createElement("div",{className:k()("blocks-search__blocks-wrapper",{is_search:l}),ref:W},o.createElement("div",{className:"blocks-search__result-holder project"},!(Y||Q)&&(null!==le&&void 0!==le&&le.length?le.map((e,t)=>{const l=Pl('<table cellspacing="0" cellpadding="0" border="0" width="100%">'+e.html+"</table>");return o.createElement("div",{className:"blocks-search__result","data-type":e.type,key:e.id+t.toString()},o.createElement(L.A,{key:"commenMenu",placement:"leftTop",menu:{items:Oe(e)},overlayStyle:{minWidth:"auto",paddingRight:6}},o.createElement("div",{className:"ant-card-hoverable blocks-search__result-body",draggable:!0,onClick:t=>d(t,e.html,"project"),onDragStart:t=>m(t,e.html,"project"),onMouseEnter:()=>Te({html:e.html,title:e.title}),onMouseLeave:Re},o.createElement("div",{className:"blocks-search__result-html",dangerouslySetInnerHTML:{__html:l},style:{transform:"scale("+207/660+")"}}))))}):!(U.tags||U.name||U.type)&&$&&!(Y||Q)&&!l&&o.createElement("div",{style:{padding:"10px 0 20px",display:"flex",flexDirection:"row",justifyContent:"space-between"}},o.createElement("div",{style:{width:"110%"}},o.createElement("h3",{style:{lineHeight:"1.2"}},f("You don`t have any saved blocks yet.")),f("To add a block from the dashboard click the"),' "',f("Save to Blocks button."),'" ',o.createElement("svg",{style:{position:"relative",top:"2px"},xmlns:"http://www.w3.org/2000/svg",focusable:"false",viewBox:"0 0 448 512",width:"1em",height:"1em",fill:"currentColor"},o.createElement("path",{d:"M433.9 129.9l-83.9-83.9A48 48 0 0 0 316.1 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V163.9a48 48 0 0 0 -14.1-33.9zM272 80v80H144V80h128zm122 352H54a6 6 0 0 1 -6-6V86a6 6 0 0 1 6-6h42v104c0 13.3 10.7 24 24 24h176c13.3 0 24-10.7 24-24V83.9l78.2 78.2a6 6 0 0 1 1.8 4.2V426a6 6 0 0 1 -6 6zM224 232c-48.5 0-88 39.5-88 88s39.5 88 88 88 88-39.5 88-88-39.5-88-88-88zm0 128c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40z"})),o.createElement("br",null),o.createElement("br",null),f("You can also save all blocks at once. The AI assistant will automatically determine the type and create a name for each block when saving."),o.createElement("br",null),o.createElement("br",null),o.createElement(Cl.A,{justify:"left"},o.createElement(g.Ay,{type:"primary",onClick:()=>i(!0),style:{cursor:"pointer"}},f("Save all blocks")))),o.createElement("div",{style:{width:"80px",height:"200px"}},o.createElement("img",{src:Nl,style:{display:"block",width:80,position:"absolute",right:5}}))))),(Y||Q)&&o.createElement(N.A,{active:!0}))),l&&(null===J||void 0===J?void 0:J.length)>0&&(null===R||void 0===R?void 0:R.length)>0&&o.createElement(c.A,{className:"blocks-search__result-divider"}),("template"===t||l)&&o.createElement(o.Fragment,null,!!ue.length&&!l&&o.createElement("div",{className:"blocks-search__type-wrapper"},o.createElement("ul",null,o.createElement("li",{"data-type":"",className:"active",onClick:Be,key:"templateBlocksSections_All"},f("All")),ue.map(e=>o.createElement("li",{key:"templateBlocksSections_"+e,"data-type":e,onClick:Be},f(V.jg[e]))))),o.createElement("div",{className:k()("blocks-search__blocks-wrapper",{is_search:l}),ref:j},o.createElement("div",{className:"blocks-search__result-holder template"},R&&!de&&!ce&&null!==me&&void 0!==me&&me.length?o.createElement(o.Fragment,null,me.map((e,t)=>{const l=Pl('<table cellspacing="0" cellpadding="0" border="0" width="100%">'+e.html+"</table>");return o.createElement("div",{className:"blocks-search__result","data-type":e.type,key:e.id+t.toString()},o.createElement("div",{className:"ant-card-hoverable blocks-search__result-body",draggable:!0,onClick:t=>d(t,e.html,"template"),onDragStart:t=>m(t,e.html,"template"),onMouseEnter:()=>Te({html:e.html,title:e.title}),onMouseLeave:()=>Re()},o.createElement("div",{className:"blocks-search__result-html",dangerouslySetInnerHTML:{__html:l},style:{transform:"scale("+207/660+")"}})))})):!l&&!Ee&&!ce&&o.createElement("div",{className:"blocks-search__type",style:{padding:"10px 0 20px"}},f("No related blocks found."))," "),(de||ce)&&o.createElement(N.A,{active:!0}))),l&&(null===R||void 0===R?void 0:R.length)>0&&(null===_e||void 0===_e?void 0:_e.length)>0&&o.createElement(c.A,{className:"blocks-search__result-divider"}),("common"===t||l)&&o.createElement(o.Fragment,null,!(null===Ae||void 0===Ae||!Ae.length)&&!l&&o.createElement("div",{className:"blocks-search__type-wrapper"},o.createElement("ul",null,o.createElement("li",{"data-type":"",className:"active",onClick:Be,key:"commonBlocksSections_All"},f("All")),Ae.map(e=>o.createElement("li",{"data-type":e,onClick:Be,key:"commonBlocksSections_"+e},f(V.jg[e]))))),o.createElement("div",{className:k()("blocks-search__blocks-wrapper",{is_search:l}),ref:z},o.createElement("div",{className:"blocks-search__result-holder common"},be&&!(null===ye||void 0===ye||!ye.length)&&!(ve||Ee)&&o.createElement(o.Fragment,null,ye.map((e,t)=>{const l=Fe({html:Pl('<table cellspacing="0" cellpadding="0" border="0" width="100%">'+e.html+"</table>")});return o.createElement("div",{className:"blocks-search__result","data-type":e.type,key:e.id+t.toString()},o.createElement("div",{className:"ant-card-hoverable blocks-search__result-body",draggable:!0,onClick:t=>d(t,Fe({html:e.html}),"common"),onDragStart:t=>m(t,Fe({html:e.html}),"common"),onMouseEnter:()=>Te({html:Fe({html:Pl('<table cellspacing="0" cellpadding="0" border="0" width="100%">'+e.html+"</table>")}),title:e.title}),onMouseLeave:()=>Re()},o.createElement("div",{className:"blocks-search__result-html",dangerouslySetInnerHTML:{__html:l},style:{transform:"scale("+207/660+")"}})))}))," "),(Ee||ve)&&o.createElement(N.A,{active:!0}))),Ne&&o.createElement("div",{className:"blocks-search__type",style:{padding:"10px 0 20px"}},f("There are no blocks for this request."))))};var zl=l(10750),Hl=l.n(zl),Gl=l(97946),Ul=l.n(Gl),ql=l(50664),Xl=l.n(ql),$l=l(36529),Zl=l.n($l),Yl=l(22548),Kl=l.n(Yl),Ql=l(20065),Jl=l.n(Ql);const eo=[{sizeArray:[24],name:"column-one",html:Hl()},{sizeArray:[12,12],name:"column-two-50",html:Zl()},{sizeArray:[8,8,8],name:"column-three",html:Kl()},{sizeArray:[6,6,6,6],name:"column-four",html:Jl()},{sizeArray:[8,16],name:"column-two-33",html:Ul()},{sizeArray:[16,8],name:"column-two-66",html:Xl()}],to=()=>{const e=(0,K.sh)(),t=(0,K._9)();return o.createElement("div",{className:"structures blocks-search__empty-wrapper"},o.createElement("div",{className:"structures__list"},o.createElement("div",null,eo&&eo.map((l,a)=>o.createElement("div",{key:l.name},o.createElement("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,l.html),onDragStart:e=>t(e,l.html)},o.createElement(h.A,{gutter:[6,6],className:"structures__item-row"},l.sizeArray.map((e,t)=>o.createElement(b.A,{span:e,key:l.name+t},o.createElement("div",{className:"structures__item-col"}))))))))))};var lo=l(7549),oo=l.n(lo),ao=l(29539),ro=l.n(ao),no=l(6573),io=l.n(no),so=l(75424),co=l.n(so),mo=l(43643),uo=l.n(mo),po=l(96786),go=l.n(po);const ho=[{sizeArray:[24],name:"column-one",html:oo()},{sizeArray:[12,12],name:"column-two-50",html:co()},{sizeArray:[8,8,8],name:"column-three",html:uo()},{sizeArray:[6,6,6,6],name:"column-four",html:go()},{sizeArray:[8,16],name:"column-two-33",html:ro()},{sizeArray:[16,8],name:"column-two-66",html:io()}],bo=()=>{const e=(0,K.sh)(),t=(0,K._9)();return o.createElement("div",{className:"structures blocks-search__empty-wrapper"},o.createElement("div",{className:"structures__list"},o.createElement("div",null,ho&&ho.map((l,a)=>o.createElement("div",{key:l.name},o.createElement("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,l.html),onDragStart:e=>t(e,l.html)},o.createElement(h.A,{gutter:[6,6],className:"structures__item-row"},l.sizeArray.map((e,t)=>o.createElement(b.A,{span:e,key:l.name+t},o.createElement("div",{className:"structures__item-col"}))))))))))},fo=`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>\n <img src=${l.p+"static/media/empty-image.1827d6561f3c4042dfb3.png"} width="150" border="0" alt="" style="display: block; width: 100%; max-width: 150px;" />\n</td></tr></table>`,Eo=`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>\n <img class="em-ai-img em-just-inserted" src="${l.p+"static/media/ai-image.7c42c2e12001ebf31881.png"}" width="150" border="0" alt="" style="display: block; width: 100%; max-width: 150px;" />\n</td></tr></table>`;var vo=l(34021),_o=l.n(vo),yo=l(62315),Ao=l.n(yo),So=l(67558),ko=l.n(So),wo=l(75995),Co=l.n(wo),Bo=l(80465),xo=l.n(Bo),To=l(40845),Ro=l.n(To),No=l(66930),Lo=l.n(No);const Io=`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>\n <table border="0" cellspacing="0" cellpadding="0">\n <tr>${[l.p+"static/media/tg.10f004529a98df9732b9.png",l.p+"static/media/yt.4ac57e55d158b40c7fc1.png",l.p+"static/media/vk.fe41df919f4e8718e0b3.png",l.p+"static/media/yd.c40d05dde64ef695fdf2.png",l.p+"static/media/tw.823a7736ac2d82815c71.png",l.p+"static/media/ig.47a89992b4bec92d4364.png",l.p+"static/media/fb.ff10384394f8044ec889.png"].map(e=>`\n <td width="40" align="center">\n <a href="" target="_blank"><img src="${e}" width="30" border="0" alt="" style="display: block;" /></a>\n </td>`).join("")}\n </tr>\n </table>\n</td></tr></table>`;var Po=l(45848),Oo=l.n(Po);const Fo=new Date,Mo=new Date(+Fo+432e6).toISOString(),Do=-(new Date).getTimezoneOffset()/60,Vo=e=>`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td align="center"><img class="em-countdown" em-cd-settings="locale=${e.replace("_","-")}&bg=FFFFFF&tp=false&color1=000000&color2=959595&size1=72&size2=28&font1=roboto&font2=roboto&border=10&delimiter=:&spacing=10&time=${Mo}&timezone=${Do}&frames=20" src="${(e=>`https://cdt3.emcdn.ru/rndt?locale=${e.replace("_","-")}&bg=FFFFFF&tp=false&color1=000000&color2=959595&size1=72&size2=28&font1=roboto&font2=roboto&border=10&delimiter=:&spacing=10&time=${Mo}&timezone=${Do}&frames=20`)(e)}" border="0" alt="" style="display: block;" /></td></tr></table>`,Wo=`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>\n <img class="em-video" src="${l.p+"static/media/video.854adea50295d0a3f7ae.png"}" width="150" border="0" alt="" style="display: inline-block; width: 100%; max-width: 150px;" />\n</td></tr></table>`;var jo=l(74372),zo=l.n(jo),Ho=l(12133),Go=l.n(Ho);const Uo=()=>{var e,t;const l=(0,y.s9)(),{__:a}=l,r=(0,Y.rD)(),n=(0,v.d4)(Ce.yN),d=(0,v.d4)(we.B$),c=(0,v.d4)(we.C1),m=(0,v.d4)(we.B),u=(0,K.X7)(),p=(0,K.Qi)(),[g,h]=(0,o.useState)(!1),[b,f]=(0,o.useState)(0);let E=!(d||(null===(e=c.id)||void 0===e?void 0:e.toString())!==(null===n||void 0===n||null===(t=n.members)||void 0===t?void 0:t.owner.ID))&&!0;const _=[];r.elementImageEnabled&&_.push({title:a("Image"),icon:o.createElement(z.A,{icon:"ElementImage",size:24,strokeWidth:r.iconStrokeWidth}),html:fo,className:"",name:"image"}),r.elementAIimageEnabled&&_.push({title:a("AI image"),icon:o.createElement(z.A,{icon:"ElementImageAI",size:24,strokeWidth:r.iconStrokeWidth}),html:Eo,className:"ai",name:"ai-image"}),r.elementTextEnabled&&_.push({title:a("Text"),icon:o.createElement(z.A,{icon:"ElementText",size:24,strokeWidth:r.iconStrokeWidth}),html:_o()(l),className:"",name:"text"}),r.elementHeaderEnabled&&_.push({title:a("Header"),icon:o.createElement(z.A,{icon:"ElementTitle",size:24,strokeWidth:r.iconStrokeWidth}),html:Ao()(l),className:"",name:"header"}),r.elementButtonEnabled&&_.push({title:a("Button"),icon:o.createElement(z.A,{icon:"ElementButton",size:24,strokeWidth:r.iconStrokeWidth}),html:ko()(l),className:"",name:"button"}),r.elementSpacerEnabled&&_.push({title:a("Spacer"),icon:o.createElement(z.A,{icon:"ElementSpacer",size:24,strokeWidth:r.iconStrokeWidth}),html:Lo(),className:"",name:"spacer"}),r.elementListULEnabled&&_.push({title:a("List UL"),icon:o.createElement(z.A,{icon:"ElementListUL",size:24,strokeWidth:r.iconStrokeWidth}),html:Co()(l),className:"",name:"list-ul"}),r.elementListOLEnabled&&_.push({title:a("List OL"),icon:o.createElement(z.A,{icon:"ElementListOL",size:24,strokeWidth:r.iconStrokeWidth}),html:xo()(l),className:"",name:"list-ol"}),r.elementDividerEnabled&&_.push({title:a("Divider"),icon:o.createElement(z.A,{icon:"ElementDivider",size:24,strokeWidth:r.iconStrokeWidth}),html:Ro(),className:"",name:"divider"}),r.elementSocialEnabled&&_.push({title:a("Social media"),icon:o.createElement(z.A,{icon:"ElementSocial",size:24,strokeWidth:r.iconStrokeWidth}),html:Io,className:"",name:"social"}),r.elementTableEnabled&&_.push({title:a("Table"),icon:o.createElement(z.A,{icon:"ElementTable",size:24,strokeWidth:r.iconStrokeWidth}),html:Oo()(l),className:"",name:"table"}),r.elementCountdownEnabled&&_.push({title:a("Countdown"),icon:o.createElement(z.A,{icon:"ElementCountdown",size:24,strokeWidth:r.iconStrokeWidth}),html:Vo(m),className:"",name:"countdown"}),r.elementVideoEnabled&&_.push({title:a("Video"),icon:o.createElement(z.A,{icon:"ElementVideo",size:24,strokeWidth:r.iconStrokeWidth}),html:Wo,className:"",name:"video"}),r.elementCarouselEnabled&&_.push({title:a("Carousel"),icon:o.createElement(z.A,{icon:"ElementCarousel",size:24,strokeWidth:r.iconStrokeWidth}),html:zo()(l),className:"amp",name:"amp-carousel"}),r.elementAccordionEnabled&&_.push({title:a("Accordion"),icon:o.createElement(z.A,{icon:"ElementAccordion",size:24,strokeWidth:r.iconStrokeWidth}),html:Go()(l),className:"amp",name:"amp-accordion"}),r.elementFormEnabled&&_.push({title:a("Form"),icon:o.createElement(z.A,{icon:"ElementForm",size:24,strokeWidth:r.iconStrokeWidth}),html:null,className:"amp",name:"amp-form"});const A=e=>!E||"ai-image"!==e.name||(setTimeout(()=>{h(!0),f(2)},1e3),!1);return o.createElement("div",{className:"atoms"},o.createElement("div",{className:"atoms__list"},o.createElement(s.A,{wrap:!0,style:{justifyContent:"flex-start",rowGap:10}},_&&_.map((e,t)=>e.html?o.createElement("div",{className:"ant-card-hoverable atoms__item "+e.className,draggable:!0,onClick:t=>u(t,e.html),onDragStart:t=>p(t,e,A),key:e.title+t.toString(),"data-test-name":e.name},o.createElement("span",{className:"atom-image"},e.icon),o.createElement("span",{className:"atom-title"},e.title)):o.createElement(i.A,{title:a("Coming soon"),placement:"top",key:e.title+t.toString()},o.createElement("div",{className:"atoms__item atoms__item_inactive "+e.className,key:e.title+t.toString(),"data-test-name":e.name},o.createElement("span",{className:"atom-image"},e.icon),o.createElement("span",{className:"atom-title"},e.title)))))),o.createElement(Se.A,{open:g,onCancel:()=>h(!1),initialSlide:b}))};var qo=l(54880),Xo=l(84893),$o=l(54855),Zo=l(74984),Yo=l(72218),Ko=l(8122),Qo=l(86956),Jo=l.n(Qo);const ea=({form:e,elementSettings:t,imgParent:l=!1,name:a="align"})=>{const{__:r}=(0,y.s9)(),n=(0,Pe.XW)(),[d,c]=(0,o.useState)(t[a]),m=(0,Y.rD)(),u=l=>{const o=l.target.value,r={[a]:""};o!==d?c(o):(c(""),e.setFieldsValue(r),n({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:r}))};return o.createElement(C.A.Item,{name:a},o.createElement(mt.Ay.Group,{disabled:l&&!t.parent},o.createElement(s.A,{size:8},o.createElement(i.A,{placement:"bottom",title:r("Align left")},o.createElement(mt.Ay.Button,{value:"left",onClick:u},o.createElement(z.A,{icon:"AlignHorizontalLeft",size:18,strokeWidth:m.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:r("Center horizontally")},o.createElement(mt.Ay.Button,{value:"center",onClick:u},o.createElement(z.A,{icon:"AlignHorizontalCenter",size:18,strokeWidth:m.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:r("Align right ")},o.createElement(mt.Ay.Button,{value:"right",onClick:u},o.createElement(z.A,{icon:"AlignHorizontalRight",size:18,strokeWidth:m.iconStrokeWidth}))))))},ta=({form:e,elementSettings:t,tooltipTitle:l,disabled:a=!1})=>{const{__:r}=(0,y.s9)(),n=(0,Pe.XW)(),[d,c]=(0,o.useState)(t.valign),m=(0,Y.rD)(),u=l=>{const o=l.target.value,a={valign:""};o!==d?c(o):(c(""),e.setFieldsValue(a),n({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return o.createElement(C.A.Item,{name:"valign"},o.createElement(mt.Ay.Group,{disabled:a},o.createElement(s.A,{size:8},o.createElement(i.A,{placement:"bottom",title:r("Align top")},o.createElement(mt.Ay.Button,{value:"top",onClick:u},o.createElement(z.A,{icon:"AlignVerticalTop",size:18,strokeWidth:m.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:r("Center vertically")},o.createElement(mt.Ay.Button,{value:"middle",onClick:u},o.createElement(z.A,{icon:"AlignVerticalCenter",size:18,strokeWidth:m.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:r("Align bottom")},o.createElement(mt.Ay.Button,{value:"bottom",onClick:u},o.createElement(z.A,{icon:"AlignVerticalBottom",size:18,strokeWidth:m.iconStrokeWidth}))))))};var la=l(33365);const oa=({typeOfForm:e="desktop"})=>{const{__:t}=(0,y.s9)(),l=(0,v.d4)(H.uJ),a="mobile"===e,r=a?"mobileBoxShadowHOffset":"boxShadowHOffset",n=a?"mobileBoxShadowVOffset":"boxShadowVOffset",c=a?"mobileBoxShadowBlurRadius":"boxShadowBlurRadius",m=a?"mobileBoxShadowSpreadRadius":"boxShadowSpreadRadius",u=a?"mobileBoxShadowColor":"boxShadowColor",p=a?"mobileBoxShadowInset":"boxShadowInset";return o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:t("Horizontal offset")},o.createElement(C.A.Item,{name:r,className:"form-item-margin-xs"},o.createElement(Lt.A,{placeholder:t("Horizontal offset"),prefix:o.createElement(la.A,null),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:t("Vertical offset")},o.createElement(C.A.Item,{name:n,className:"form-item-margin-xs"},o.createElement(Lt.A,{placeholder:t("Vertical offset"),prefix:o.createElement(z.A,{icon:"VerticalOffset"}),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:t("Blur radius")},o.createElement(C.A.Item,{name:c,className:"form-item-margin-xs"},o.createElement(Lt.A,{min:0,placeholder:t("Blur radius"),prefix:o.createElement(z.A,{icon:"Blur",style:{fontSize:16,marginLeft:-2}}),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:t("Spread radius")},o.createElement(C.A.Item,{name:m,className:"form-item-margin-xs"},o.createElement(Lt.A,{placeholder:t("Spread radius"),prefix:o.createElement(z.A,{icon:"ZoomOutMap"}),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(s.A,{size:10,align:"start"},o.createElement(C.A.Item,{name:u},o.createElement(_e,{usedColors:l.usedColors})))),o.createElement(b.A,{span:12},o.createElement(i.A,{title:t("Shadow inside or outside of the element"),key:"inset",placement:"bottom"},o.createElement(C.A.Item,{name:p,valuePropName:"value"},o.createElement(d.A,{style:{width:"100%"},options:[{label:t("Outside"),value:!1},{label:t("Inside"),value:!0}]}))))))},{useToken:aa}=r.A,ra=({form:e,name:t,elementSettings:l,isPicture:a})=>{var r;const{__:n}=(0,y.s9)(),i=(0,Pe.XW)(),d=(0,o.useRef)(),c=(0,o.useRef)(),[m,u]=(0,o.useState)("auto"===(null===(r=l[t])||void 0===r?void 0:r.value)),{token:p}=aa(),[g,h]=(0,o.useState)("");return o.createElement(o.Fragment,null,o.createElement(C.A.Item,{name:t,style:{marginBottom:p.formItemMarginBottomXS/2}},o.createElement(Lt.A,{ref:d,min:0,max:g,placeholder:n("Width"),onChange:l=>{u(!1),h("%"===e.getFieldsValue(!0)[t+"Dim"]?100:"")},prefix:o.createElement(Ee.A,null),addonAfter:o.createElement(C.A.Item,{name:t+"Dim",noStyle:!0},El)})),!a&&o.createElement(s.A,{size:8,align:"end"},o.createElement(f.A,{ref:c,size:"small",checked:m,onChange:o=>{d.current.value=null,e.setFieldsValue({[t]:"",[t+"Dim"]:"px"}),u(e=>!e),i({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{[t]:{classNamePrefix:"em-mob-width-",value:m?null:"auto",dim:""}}})},id:"auto-width"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"auto-width"},n("Auto")))))},{useToken:na}=r.A,ia=({form:e,name:t,elementSettings:l,isPicture:a})=>{var r;const{__:n}=(0,y.s9)(),i=(0,Pe.XW)(),d=(0,o.useRef)(),c=(0,o.useRef)(),[m,u]=(0,o.useState)("auto"===(null===(r=l.mobileHeight)||void 0===r?void 0:r.value)),{token:p}=na();return o.createElement(o.Fragment,null,o.createElement(C.A.Item,{name:t,style:{marginBottom:p.formItemMarginBottomXS/2}},o.createElement(Lt.A,{ref:d,min:0,placeholder:n("Height"),onChange:e=>{u(!1)},prefix:o.createElement($o.A,null),addonAfter:"px"})),!a&&o.createElement(s.A,{size:8,align:"end"},o.createElement(f.A,{ref:c,size:"small",checked:m,onChange:t=>{d.current.value=null,e.setFieldsValue({mobileHeight:"",mobileHeightDim:"px"}),u(e=>!e),i({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{mobileHeight:{classNamePrefix:"em-mob-height-",value:m?null:"auto",dim:""}}})},id:"auto-height"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"auto-height"},n("Auto")))))},sa=({form:e,elementSettings:t,imgParent:l=!1,name:a="mobileAlign"})=>{var r;const{__:n}=(0,y.s9)(),[d,c]=(0,o.useState)(null===(r=t[a])||void 0===r?void 0:r.value),m=(0,Pe.XW)(),u=(0,Y.rD)(),p=l=>{const o=l.target.value,r={[a]:{classNamePrefix:"em-mob-text_align-",value:""}};o!==d?c(o):(c(""),e.setFieldsValue(r),m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:r}))};return o.createElement(C.A.Item,{name:a},o.createElement(mt.Ay.Group,{disabled:l&&!t.parent},o.createElement(s.A,{size:8},o.createElement(i.A,{placement:"bottom",title:n("Align left")},o.createElement(mt.Ay.Button,{value:"left",onClick:p},o.createElement(z.A,{icon:"AlignHorizontalLeft",size:18,strokeWidth:u.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:n("Center horizontally")},o.createElement(mt.Ay.Button,{value:"center",onClick:p},o.createElement(z.A,{icon:"AlignHorizontalCenter",size:18,strokeWidth:u.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:n("Align right ")},o.createElement(mt.Ay.Button,{value:"right",onClick:p},o.createElement(z.A,{icon:"AlignHorizontalRight",size:18,strokeWidth:u.iconStrokeWidth}))))))},da=({form:e,elementSettings:t,tooltipTitle:l})=>{var a;const{__:r}=(0,y.s9)(),[n,d]=(0,o.useState)(null===(a=t.mobileVerticalAlign)||void 0===a?void 0:a.value),c=(0,Pe.XW)(),m=(0,Y.rD)(),u=l=>{const o=l.target.value,a={mobileVerticalAlign:{classNamePrefix:"em-mob-vertical_align",value:""}};o!==n?d(o):(d(""),e.setFieldsValue(a),c({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return o.createElement(C.A.Item,{name:"mobileVerticalAlign"},o.createElement(mt.Ay.Group,null,o.createElement(s.A,{size:8},o.createElement(i.A,{placement:"bottom",title:r("Align top")},o.createElement(mt.Ay.Button,{value:"top",onClick:u},o.createElement(z.A,{icon:"AlignVerticalTop",size:18,strokeWidth:m.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:r("Center vertically")},o.createElement(mt.Ay.Button,{value:"middle",onClick:u},o.createElement(z.A,{icon:"AlignVerticalCenter",size:18,strokeWidth:m.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:r("Align bottom")},o.createElement(mt.Ay.Button,{value:"bottom",onClick:u},o.createElement(z.A,{icon:"AlignVerticalBottom",size:18,strokeWidth:m.iconStrokeWidth}))))))};var ca=l(7333),ma=l(83799);const ua=({form:e,elementSettings:t})=>{const{__:l}=(0,y.s9)();return o.createElement(C.A.Item,{name:"show"},o.createElement(mt.Ay.Group,null,o.createElement(s.A,{size:8},o.createElement(mt.Ay.Button,{value:"all"},l("Both")),o.createElement(i.A,{placement:"top",title:l("Desktop")},o.createElement(mt.Ay.Button,{value:"desktop"},o.createElement(ca.A,null))),o.createElement(i.A,{placement:"top",title:l("Mobile")},o.createElement(mt.Ay.Button,{value:"mobile"},o.createElement(ma.A,null))))))};var pa=l(57140);const{useToken:ga}=r.A,ha=({form:e,elementSettings:t,handleChangeValues:l})=>{const{__:a}=(0,y.s9)(),r=(0,o.useRef)(),{token:n}=ga(),[d,c]=(0,o.useState)(!1),[m,u]=(0,o.useState)(!1),[p,E]=(0,o.useState)(!1),[v,_]=(0,o.useState)(!1),[A,S]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=new URL("https://emailmaker.ru/?"+t.countdown);c(e.searchParams.get("font1").endsWith("-b")||e.searchParams.get("font1").endsWith("-bi")),u(e.searchParams.get("font1").endsWith("-i")||e.searchParams.get("font1").endsWith("-bi")),E(e.searchParams.get("font2").endsWith("-b")||e.searchParams.get("font2").endsWith("-bi")),_(e.searchParams.get("font2").endsWith("-i")||e.searchParams.get("font2").endsWith("-bi")),S("true"===e.searchParams.get("tp"))},[t]);const w=[{value:"-12",label:a("-12:00 Apia")},{value:"-11",label:a("-11:00 Pago Pago, Midway Atoll")},{value:"-10",label:a("-10:00 Honolulu, Anchorage")},{value:"-9",label:a("-9:00 Anchorage, Yukon")},{value:"-8",label:a("-8:00 Los Angeles, Vancouver")},{value:"-7",label:a("-7:00 Denver, Phoenix")},{value:"-6",label:a("-6:00 Mexico City, Guadalajara")},{value:"-5",label:a("-5:00 New York, Toronto, Havana")},{value:"-4",label:a("-4:00 Caracas, Santo Domingo")},{value:"-3",label:a("-3:00 Buenos Aires, Santiago, Montevideo")},{value:"-2",label:a("-2:00 South Georgia, Saint Helena")},{value:"-1",label:a("-1:00 Azores, Cape Verde")},{value:"0",label:a("+0:00 London, Lisbon, Dublin")},{value:"1",label:a("+1:00 Paris, Berlin, Rome")},{value:"2",label:a("+2:00 Athens, Kiev, Istanbul")},{value:"3",label:a("+3:00 Istanbul, Doha, Baghdad")},{value:"4",label:a("+4:00 Baku, Dubai, Tbilisi")},{value:"5",label:a("+5:00 Karachi, Tashkent, Islamabad")},{value:"6",label:a("+6:00 Almaty, Dhaka, Bishkek")},{value:"7",label:a("+7:00 Bangkok, Ho Chi Minh City, Jakarta")},{value:"8",label:a("+8:00 Beijing, Hong Kong, Singapore")},{value:"9",label:a("+9:00 Tokyo, Seoul, Jayapura")},{value:"10",label:a("+10:00 Sydney, Melbourne, Port Moresby")},{value:"11",label:a("+11:00 Honiara, Nuku'alofa, Apia")}],B=[{value:"20",label:a("20 s")},{value:"40",label:a("40 s")},{value:"60",label:a("60 s")}],T=[{value:"arial",label:"Arial"},{value:"courier-new",label:"Courier New"},{value:"georgia",label:"Georgia"},{value:"helvetica",label:"Helvetica"},{value:"tahoma",label:"Tahoma"},{value:"times-new-roman",label:"Times New Roman"},{value:"trebuchet-ms",label:"Trebuchet MS"},{value:"verdana",label:"Verdana"},{value:"open-sans",label:"Open Sans"},{value:"roboto",label:"Roboto"}],R=e=>{var t;e.target.closest(".ant-picker-dropdown")||(null===(t=r.current)||void 0===t||t.blur())};(0,o.useEffect)(()=>(window.addEventListener("scroll",R,!0),()=>{window.removeEventListener("scroll",R,!0)}));return o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(C.A.Item,{label:a("End time"),name:"countdownTime"},o.createElement(pa.A,{ref:r,format:"DD.MM.YYYY HH:mm",disabledDate:e=>e&&e<Jo()().endOf("day")-864e5,showTime:!0,getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),allowClear:!1,allowEmpty:!1}))),o.createElement(b.A,{span:12},o.createElement(C.A.Item,{label:a("Time zone"),name:"countdownTimeZone",style:{width:"100%"}},o.createElement(x.A,{placeholder:a("Select the time zone"),getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")},w.map(e=>o.createElement(x.A.Option,{key:e.value,value:e.value},e.label)))))),o.createElement(h.A,{gutter:20},o.createElement(b.A,{span:12},o.createElement(C.A.Item,{label:a("Background color"),name:"countdownBackgroundColor",className:"countdown-color"},o.createElement(_e,{placeholder:a("Background color"),usedColors:t.usedColors}))),o.createElement(b.A,{span:12},o.createElement(s.A,{size:10,align:"baseline",style:{paddingTop:29}},o.createElement(C.A.Item,{name:"countdownTransparency",valuePropName:"checked"},o.createElement(f.A,{size:"small",id:"countdownTransparency",onChange:e=>{S(e)}})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"countdownTransparency"},a("Transparency")))))),o.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:8}},a("Countdown font settings")),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(C.A.Item,{name:"countdownNumbersFont",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(x.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:T}))),o.createElement(b.A,{span:12},o.createElement(C.A.Item,{name:"countdownNumbersColor",className:"countdown-color",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(_e,{usedColors:t.usedColors}))),o.createElement(b.A,{span:12},o.createElement(C.A.Item,{name:"countdownNumbersFontSize"},o.createElement(fe.A,{min:12,placeholder:a("Font size"),prefix:o.createElement(Je.A,null),addonAfter:"px"}))),o.createElement(b.A,{span:3},o.createElement(i.A,{placement:"bottom",title:a("Strong")},o.createElement(C.A.Item,{name:"countdownNumbersStrong"},o.createElement(g.Ay,{className:k()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":d}),onClick:()=>{const t=!d;e.setFieldValue("countdownNumbersStrong",t),l({countdownNumbersStrong:t}),c(t)}},o.createElement(tt.A,{className:"selected-td-form__icon-radius"}))))),o.createElement(b.A,{span:3},o.createElement(i.A,{placement:"bottom",title:a("Italic")},o.createElement(C.A.Item,{name:"countdownNumbersItalic"},o.createElement(g.Ay,{className:k()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":m}),onClick:()=>{const t=!m;e.setFieldValue("countdownNumbersItalic",t),l({countdownNumbersItalic:t}),u(t)}},o.createElement(lt.A,{className:"selected-td-form__icon-radius"})))))),o.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:8}},a("Time units font settings")),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(C.A.Item,{name:"countdownLabelsFont",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(x.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:T}))),o.createElement(b.A,{span:12},o.createElement(C.A.Item,{name:"countdownLabelsColor",className:"countdown-color",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(_e,{usedColors:t.usedColors}))),o.createElement(b.A,{span:12},o.createElement(C.A.Item,{name:"countdownLabelsFontSize"},o.createElement(fe.A,{min:8,placeholder:a("Font size"),addonAfter:"px",prefix:o.createElement(Je.A,null)}))),o.createElement(b.A,{span:3},o.createElement(i.A,{placement:"bottom",title:a("Strong")},o.createElement(C.A.Item,{name:"countdownLabelsStrong"},o.createElement(g.Ay,{className:k()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":p}),onClick:()=>{const t=!p;e.setFieldValue("countdownLabelsStrong",t),l({countdownLabelsStrong:t}),E(t)}},o.createElement(tt.A,{className:"selected-td-form__icon-radius"}))))),o.createElement(b.A,{span:3},o.createElement(i.A,{placement:"bottom",title:a("Italic")},o.createElement(C.A.Item,{name:"countdownLabelsItalic"},o.createElement(g.Ay,{className:k()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":v}),onClick:()=>{const t=!v;e.setFieldValue("countdownLabelsItalic",t),l({countdownLabelsItalic:t}),_(t)}},o.createElement(lt.A,{className:"selected-td-form__icon-radius"})))))),o.createElement(h.A,{gutter:10,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(C.A.Item,{label:a("Language"),name:"countdownLanguage",style:{width:"100%"}},o.createElement(x.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:[{value:"ru_RU",label:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439"},{value:"en_US",label:"English"},{value:"uk_UA",label:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"},{value:"pt_BR",label:"Portugu\xeas"},{value:"fr-CA",label:"Fran\xe7ais"},{value:"de_DE",label:"Deutsch"},{value:"pl_PL",label:"Polski"},{value:"es_ES",label:"Espa\xf1ol"},{value:"tr_TR",label:"T\xfcrk\xe7e"},{value:"lt_LT",label:"Lietuvi\u0173 kalba"},{value:"lv_LV",label:"Latvie\u0161u valoda"},{value:"et_EE",label:"Eesti keel"},{value:"hu_HU",label:"Magyar"},{value:"el_GR",label:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"},{value:"it_IT",label:"Italiano"}]}))),o.createElement(b.A,{span:12},o.createElement(C.A.Item,{label:a("Duration"),name:"countdownDuration",style:{width:"100%"}},o.createElement(x.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:B})))))};var ba=l(9593),fa=l(30245),Ea=l(29312),va=l(53056);const{useToken:_a}=r.A,ya=({form:e,elementSettings:t})=>{const{__:l}=(0,y.s9)(),{token:a}=_a();return o.createElement(o.Fragment,null,o.createElement(i.A,{trigger:["hover"],title:l("URL of the video clip."),placement:"right"},o.createElement(C.A.Item,{name:["video","source"],className:"selected-image-form__alt"},o.createElement(B.A,{allowClear:!0,placeholder:l("Video URL"),prefix:o.createElement(ba.A,null)}))),o.createElement(C.A.Item,{label:l("Play button"),name:["video","playButton"],style:{width:"100%",marginBottom:a.formItemMarginBottomMD+4}},o.createElement(x.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")},o.createElement(x.A.Option,{value:"youtube_red"},o.createElement(fa.A,{style:{color:"#FF0000"}})," ",l("Youtube Red")),o.createElement(x.A.Option,{value:"youtube_black"},o.createElement(fa.A,null)," ",l("Youtube Black")),o.createElement(x.A.Option,{value:"youtube_white"},o.createElement(fa.A,{style:{color:"#aaa"}})," ",l("Youtube White")),o.createElement(x.A.Option,{value:"vimeo"},o.createElement(z.A,{icon:"Vimeo"})," ",l("Vimeo")),o.createElement(x.A.Option,{value:"white_circle"},o.createElement(Ea.A,{style:{color:"#aaa"}})," ",l("White circle")),o.createElement(x.A.Option,{value:"black_circle"},o.createElement(Ea.A,null)," ",l("Black circle")),o.createElement(x.A.Option,{value:"white_circle_outlined"},o.createElement(va.A,{style:{color:"#aaa"}})," ",l("White circle outlined")),o.createElement(x.A.Option,{value:"black_circle_outlined"},o.createElement(va.A,null)," ",l("Black circle outlined")),o.createElement(x.A.Option,{value:"none"}," ",l("Without button")))))},Aa=()=>{const{__:e}=(0,y.s9)();return o.createElement(C.A.Item,{name:"ampShow"},o.createElement(mt.Ay.Group,null,o.createElement(s.A,{size:8},o.createElement(mt.Ay.Button,{value:"all"},e("Both")),o.createElement(i.A,{placement:"top",title:e("AMP")},o.createElement(mt.Ay.Button,{value:"amp"},"AMP")),o.createElement(i.A,{placement:"top",title:e("HTML")},o.createElement(mt.Ay.Button,{value:"html"},"HTML")))))};var Sa=l(62093),ka=l(40835),wa=l(16390),Ca=l(14038);const{useToken:Ba}=r.A,xa=({elementSettings:e})=>{const{__:t}=(0,y.s9)(),{token:l}=Ba(),[a]=C.A.useForm();let r=(0,v.wA)();const n=(0,Y.rD)(),{projectId:d}=(0,_.g)(),m=(0,A.hN)(),p=(0,v.d4)(H.Hs),f=(0,Pe.XW)(),E=(0,Pe.K9)(),S=(0,v.d4)(Ie.Ct),w=(0,v.d4)(Ie.CS),x=(0,v.d4)(we.C1),T=(0,v.d4)(Ie.Fv),R=(0,v.d4)(Ie.yy),[N]=(0,ka.dS)(),[L,I]=(0,ka.tb)(),P=(0,o.useRef)(null),O=(0,o.useRef)(null),F=(0,o.useRef)(null),M=(0,o.useRef)(null),W=(0,o.useRef)(null),j=(0,o.useRef)(null),G=(0,o.useRef)(null),U=(0,o.useRef)(null),q=(0,o.useRef)(null),[X,$]=(0,o.useState)({}),[Z,Q]=(0,o.useState)(!0),[J,ee]=(0,o.useState)(!0),[te,le]=(0,o.useState)(""),[oe,ae]=(0,o.useState)(""),[re,ne]=(0,o.useState)(""),[ie,se]=(0,o.useState)(!1),[de,ce]=(0,o.useState)(!1),[me,ue]=(0,o.useState)(!1),[pe,ge]=(0,o.useState)(!1),[he,be]=(0,o.useState)(!1),[fe,ve]=(0,o.useState)(!1),[_e,ye]=(0,o.useState)(!1),[Se,ke]=(0,o.useState)(!1),[Ce,Be]=(0,o.useState)("https://"),[xe,Te]=(0,o.useState)(),[Re,Ne]=(0,o.useState)(!1),[Oe,Fe]=(0,o.useState)(null),[Me,De]=(0,o.useState)({start:0,end:0}),[Ve,We]=(0,o.useState)(!1),[je,ze]=(0,o.useState)(!1),He=T&&"bottom"!==R,Ge=p.hasOwnProperty("type")?V.IE:V.Tm;(0,o.useEffect)(()=>{Re&&q.current&&q.current.focus()},[Re]);const Ue=(0,v.d4)(wa.GH);(0,o.useEffect)(()=>{var e;null!==Ue&&void 0!==Ue&&null!==(e=Ue.items)&&void 0!==e&&e.length&&Te((0,Y.cM)(Ue.items,t,(e,t)=>{Ne(!1),E(V.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()}))},[Ue,Te,t,Ne,E]);const qe=(0,Ll.cR)();(0,o.useEffect)(()=>{const e=new K.jG;return e.addDisposable((0,Ca.a)(qe,"focusin",({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||Fe(e)})),e.addDisposable((0,Ca.a)(qe,"click",({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||Ne(!1)})),()=>{e.dispose()}},[qe]);const $e=({target:e})=>{if(e&&!Ve){const{selectionStart:t,selectionEnd:l}=e;De({start:t,end:l})}We(!1)},Ze=e.border,Ye=e.mobileBorder,Ke=Object.keys(Ze).find(e=>{var t,l,o;return(null===(t=Ze[e])||void 0===t?void 0:t.width)||(null===(l=Ze[e])||void 0===l?void 0:l.style)||(null===(o=Ze[e])||void 0===o?void 0:o.color)}),Qe=Object.keys(Ye).find(e=>{var t,l,o;return(null===(t=Ye[e])||void 0===t?void 0:t.width)||(null===(l=Ye[e])||void 0===l?void 0:l.style)||(null===(o=Ye[e])||void 0===o?void 0:o.color)}),Je=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)(()=>{if(e){var t,l,o,r,n,i,s,d,c,m,u,p,g,h,b,f,E,v,_,y,A,S,k,w,C,B,x,T,R,N,L,I,P,O,F,M,D,V,W,j,z,H,G,U,q,X,Z,Y,K,J,te;const oe=e.boxShadow;if($(oe),e.link&&Be(pl(e.link,"https://")),a.setFieldsValue({...e,link:e.link?e.link:"https://",width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.value,heightDim:null===(r=e.height)||void 0===r?void 0:r.dim,borderAll:gl(e.border.all),borderTop:gl(e.border.top),borderBottom:gl(e.border.bottom),borderRight:gl(e.border.right),borderLeft:gl(e.border.left),mobileBorderAll:Je(e.mobileBorder.all)||!(Je(e.mobileBorder.top)||Je(e.mobileBorder.bottom)||Je(e.mobileBorder.right)||Je(e.mobileBorder.left))&&Je(e.border.all),mobileBorderTop:Je(e.mobileBorder.top)||!Je(e.mobileBorder.all)&&Je(e.border.top),mobileBorderBottom:Je(e.mobileBorder.bottom)||!Je(e.mobileBorder.all)&&Je(e.border.bottom),mobileBorderRight:Je(e.mobileBorder.right)||!Je(e.mobileBorder.all)&&Je(e.border.right),mobileBorderLeft:Je(e.mobileBorder.left)||!Je(e.mobileBorder.all)&&Je(e.border.left),borderRadiusAll:gl(e.borderRadius.all),borderRadiusTopLeft:gl(e.borderRadius.topLeft),borderRadiusBottomLeft:gl(e.borderRadius.bottomLeft),borderRadiusTopRight:gl(e.borderRadius.topRight),borderRadiusBottomRight:gl(e.borderRadius.bottomRight),boxShadowInset:gl(null===(n=e.boxShadow)||void 0===n?void 0:n.inset)||!1,boxShadowHOffset:gl(null===(i=e.boxShadow)||void 0===i?void 0:i.hOffset),boxShadowVOffset:gl(null===(s=e.boxShadow)||void 0===s?void 0:s.vOffset),boxShadowBlurRadius:gl(null===(d=e.boxShadow)||void 0===d?void 0:d.blurRadius),boxShadowSpreadRadius:gl(null===(c=e.boxShadow)||void 0===c?void 0:c.spreadRadius),boxShadowColor:gl(null===(m=e.boxShadow)||void 0===m?void 0:m.color),mobileWidth:hl(null===(u=e.mobileWidth)||void 0===u?void 0:u.value)||(null===(p=e.width)||void 0===p?void 0:p.value),mobileWidthDim:hl(null===(g=e.mobileWidth)||void 0===g?void 0:g.value)?null===(h=e.mobileWidth)||void 0===h?void 0:h.dim:null===(b=e.width)||void 0===b?void 0:b.dim,mobileHeight:hl(null===(f=e.mobileHeight)||void 0===f?void 0:f.value)||(null===(E=e.height)||void 0===E?void 0:E.value),mobileHeightDim:hl(null===(v=e.mobileHeight)||void 0===v?void 0:v.value)?null===(_=e.mobileHeight)||void 0===_?void 0:_.dim:null===(y=e.height)||void 0===y?void 0:y.dim,mobileBorderRadiusAll:gl(e.mobileBorderRadius.all)||gl(e.borderRadius.all),mobileBorderRadiusTopLeft:gl(null===(A=e.mobileBorderRadius)||void 0===A?void 0:A.topLeft)||gl(null===(S=e.mobileBorderRadius)||void 0===S?void 0:S.all)||gl(null===(k=e.borderRadius)||void 0===k?void 0:k.topLeft)||gl(null===(w=e.borderRadius)||void 0===w?void 0:w.all),mobileBorderRadiusBottomLeft:gl(null===(C=e.mobileBorderRadius)||void 0===C?void 0:C.bottomLeft)||gl(null===(B=e.mobileBorderRadius)||void 0===B?void 0:B.all)||gl(null===(x=e.borderRadius)||void 0===x?void 0:x.bottomLeft)||gl(null===(T=e.borderRadius)||void 0===T?void 0:T.all),mobileBorderRadiusTopRight:gl(null===(R=e.mobileBorderRadius)||void 0===R?void 0:R.topRight)||gl(null===(N=e.mobileBorderRadius)||void 0===N?void 0:N.all)||gl(null===(L=e.borderRadius)||void 0===L?void 0:L.topRight)||gl(null===(I=e.borderRadius)||void 0===I?void 0:I.all),mobileBorderRadiusBottomRight:gl(null===(P=e.mobileBorderRadius)||void 0===P?void 0:P.bottomRight)||gl(null===(O=e.mobileBorderRadius)||void 0===O?void 0:O.all)||gl(null===(F=e.borderRadius)||void 0===F?void 0:F.bottomRight)||gl(null===(M=e.borderRadius)||void 0===M?void 0:M.all),mobileBoxShadowInset:null!=(null===(D=e.mobileBoxShadow)||void 0===D?void 0:D.inset)?e.mobileBoxShadow.inset:(null===(V=e.boxShadow)||void 0===V?void 0:V.inset)||!1,mobileBoxShadowHOffset:gl(null===(W=e.mobileBoxShadow)||void 0===W?void 0:W.hOffset)||gl(null===(j=e.boxShadow)||void 0===j?void 0:j.hOffset),mobileBoxShadowVOffset:gl(null===(z=e.mobileBoxShadow)||void 0===z?void 0:z.vOffset)||gl(null===(H=e.boxShadow)||void 0===H?void 0:H.vOffset),mobileBoxShadowBlurRadius:gl(null===(G=e.mobileBoxShadow)||void 0===G?void 0:G.blurRadius)||gl(null===(U=e.boxShadow)||void 0===U?void 0:U.blurRadius),mobileBoxShadowSpreadRadius:gl(null===(q=e.mobileBoxShadow)||void 0===q?void 0:q.spreadRadius)||gl(null===(X=e.boxShadow)||void 0===X?void 0:X.spreadRadius),mobileBoxShadowColor:gl((null===(Z=e.mobileBoxShadow)||void 0===Z?void 0:Z.color)||(null===(Y=e.boxShadow)||void 0===Y?void 0:Y.color)),mobileAlign:gl(null===(K=e.mobileAlign)||void 0===K?void 0:K.value)||e.align,mobileVerticalAlign:gl((null===(J=e.mobileVerticalAlign)||void 0===J?void 0:J.value)||e.valign),show:e.show?e.show:"all",altSrc:e.src}),e.countdown){let t=new URL("https://emailmaker.ru/?"+e.countdown),l=t.searchParams.get("font1"),o=!1,r=!1;l.endsWith("-b")?(l=l.substring(0,l.length-2),o=!0):l.endsWith("-i")?(l=l.substring(0,l.length-2),r=!0):l.endsWith("-bi")&&(l=l.substring(0,l.length-3),o=!0,r=!0);let n=t.searchParams.get("font2"),i=!1,s=!1;n.endsWith("-b")?(n=n.substring(0,n.length-2),i=!0):n.endsWith("-i")?(n=n.substring(0,n.length-2),s=!0):n.endsWith("-bi")&&(n=n.substring(0,n.length-3),i=!0,s=!0),a.setFieldsValue({countdownTime:Jo()(new Date(Date.parse(t.searchParams.get("time"))+36e5*t.searchParams.get("timezone")+(new Date).getTimezoneOffset()/60*36e5).toISOString()),countdownDuration:t.searchParams.get("frames")||20,countdownTimeZone:t.searchParams.get("timezone"),countdownLanguage:t.searchParams.get("locale").replace("-","_"),countdownBackgroundColor:"#"+t.searchParams.get("bg"),countdownTransparency:"true"===t.searchParams.get("tp")?"checked":"",countdownNumbersFont:l,countdownNumbersFontSize:t.searchParams.get("size1")/2,countdownNumbersFontSizeDim:"px",countdownNumbersColor:"#"+t.searchParams.get("color1"),countdownLabelsFont:n,countdownLabelsFontSize:t.searchParams.get("size2")/2,countdownLabelsFontSizeDim:"px",countdownLabelsColor:"#"+t.searchParams.get("color2"),countdownNumbersStrong:o,countdownNumbersItalic:r,countdownLabelsStrong:i,countdownLabelsItalic:s})}!gl(e.borderRadius.all)&&(gl(e.borderRadius.topLeft)||gl(e.borderRadius.bottomLeft)||gl(e.borderRadius.topRight)||gl(e.borderRadius.bottomRight))?Q(!1):Q(!0),!gl(e.mobileBorderRadius.all)&&(gl(e.mobileBorderRadius.topLeft)||gl(e.mobileBorderRadius.bottomLeft)||gl(e.mobileBorderRadius.topRight)||gl(e.mobileBorderRadius.bottomRight))||gl(e.mobileBorderRadius.all)&&(gl(e.mobileBorderRadius.topLeft)||gl(e.mobileBorderRadius.bottomLeft)||gl(e.mobileBorderRadius.topRight)||gl(e.mobileBorderRadius.bottomRight))||!gl(e.borderRadius.all)&&!gl(e.mobileBorderRadius.all)&&(gl(e.borderRadius.topLeft)||gl(e.borderRadius.bottomLeft)||gl(e.borderRadius.topRight)||gl(e.borderRadius.bottomRight))?ee(!1):ee(!0),se(!!Ke),ce(!!Ke||!!Qe),ue(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),ge(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight||!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),be(!!e.boxShadow),ve(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset||!!e.boxShadow),ye(!!e.mobileWidth.value||!!e.mobileHeight.value||!!e.width.value||!!e.height.value),le(e.link),ae(e.alt),ne(e.title),ze(null===(te=e.imgReplacer)||void 0===te?void 0:te.length)}},[a,e]);const et=async(e,t,l)=>{const o={};o.user_id=x.id,o.folder=e,t&&("image/gif"!==t.type&&(t=await(0,Ko.A)(t,{maxSizeMB:n.compressMaxSize||.45,maxWidthOrHeight:n.compressMaxWidthOrHeight||2e3})),o.file=t),l&&(o.page_url=l);const a=await N(o);var r,i,s;if(a.error)m.fromError("IMAGE_UPLOAD_ERROR",t,a.error,!0);else if(400!==(null===(r=a.data.data)||void 0===r?void 0:r.status))return null===(i=a.data)||void 0===i||null===(s=i[0])||void 0===s?void 0:s.file_url},tt=((e,t)=>{let l;return function(...o){clearTimeout(l),l=setTimeout(()=>{clearTimeout(l),e(...o)},t)}})(()=>{const t=a.getFieldsValue(!0);let l=new URL("https://cdt3.emcdn.ru/rndt?"+e.countdown),o=t.countdownNumbersFont;t.countdownNumbersStrong&&t.countdownNumbersItalic?o+="-bi":t.countdownNumbersStrong?o+="-b":t.countdownNumbersItalic&&(o+="-i");let r=t.countdownLabelsFont;t.countdownLabelsStrong&&t.countdownLabelsItalic?r+="-bi":t.countdownLabelsStrong?r+="-b":t.countdownLabelsItalic&&(r+="-i"),l.searchParams.set("time",new Date(t.countdownTime.$d-36e5*t.countdownTimeZone-(new Date).getTimezoneOffset()/60*36e5).toISOString()),l.searchParams.set("bg",t.countdownBackgroundColor.substring(1)||"#FFFFFF"),l.searchParams.set("tp",!!t.countdownTransparency),l.searchParams.set("font1",o),l.searchParams.set("size1",2*t.countdownNumbersFontSize||12),l.searchParams.set("color1",t.countdownNumbersColor.substring(1)||"#000000"),l.searchParams.set("font2",r),l.searchParams.set("size2",2*t.countdownLabelsFontSize||8),l.searchParams.set("color2",t.countdownLabelsColor.substring(1)||"#959595"),l.searchParams.set("spacing",Math.round(.4*t.countdownNumbersFontSize)||5),l.searchParams.set("locale",t.countdownLanguage.replace("_","-")),l.searchParams.set("timezone",t.countdownTimeZone),l.searchParams.set("frames",t.countdownDuration),L({link:JSON.stringify({target:l.href})}),ke(!0)},500),lt=(0,o.useCallback)(e=>{r(Ge===V.Tm?(0,H.A9)(e):(0,Xe.A9)(e))},[r,Ge]),ot=(t,...l)=>{const o=a.getFieldsValue(!0),i=Object.keys(t)[0];let s;switch(i){case"link":let e=t[i];"https://http"===e.substring(0,12)&&(e=e.substring(8,e.length),a.setFieldValue("link",e)),s={link:e};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":s={boxShadow:{hOffset:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var c,m,u;if("borderAll"===o.borderPosition)s={border:{...V.iV,all:{...Dt,...o.borderAll}}},a.setFieldsValue({borderLeft:Dt,borderRight:Dt,borderTop:Dt,borderBottom:Dt});else null!==(c=o.borderAll)&&void 0!==c&&c.width||null!==(m=o.borderAll)&&void 0!==m&&m.style||null!==(u=o.borderAll)&&void 0!==u&&u.color?(s={border:{all:null,left:o.borderAll,right:o.borderAll,top:o.borderAll,bottom:o.borderAll,[Vt[i]]:{...o[i],...t[i]}}},a.setFieldsValue({borderAll:null,borderLeft:o.borderAll,borderRight:o.borderAll,borderTop:o.borderAll,borderBottom:o.borderAll,[i]:{...o[i],...t[i]}})):(s={border:{all:null,left:o.borderLeft,right:o.borderRight,top:o.borderTop,bottom:o.borderBottom,[Vt[i]]:{...o[i],...t[i]}}},a.setFieldsValue({border:s.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var p,g,h;if("mobileBorderAll"===o.mobileBorderPosition)s={mobileBorder:{...V.iV,all:{...Dt,...o.mobileBorderAll,classNamePrefix:"em-mob-border_"+Wt[i]+"-"}}},a.setFieldsValue({borderLeft:Dt,borderRight:Dt,borderTop:Dt,borderBottom:Dt});else null!==(p=o.mobileBorder.all)&&void 0!==p&&p.width||null!==(g=o.mobileBorder.all)&&void 0!==g&&g.style||null!==(h=o.mobileBorder.all)&&void 0!==h&&h.color?(s={mobileBorder:{all:null,left:o.mobileBorderAll,right:o.mobileBorderAll,top:o.mobileBorderAll,bottom:o.mobileBorderAll,[Wt[i]]:{...o[i],...t[i],classNamePrefix:"em-mob-border_"+Wt[i]+"-"}}},a.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:o.mobileBorderAll,mobileBorderRight:o.mobileBorderAll,mobileBorderTop:o.mobileBorderAll,mobileBorderBottom:o.mobileBorderAll,[i]:{...o[i],...t[i]}})):(s={mobileBorder:{all:null,left:o.mobileBorderLeft,right:o.mobileBorderRight,top:o.mobileBorderTop,bottom:o.mobileBorderBottom,[Wt[i]]:{...o[i],...t[i],classNamePrefix:"em-mob-border_"+Wt[i]+"-"}}},a.setFieldsValue({mobileBorder:s.mobileBorder}));break;case"width":s={[i]:{value:t[i],dim:o.widthDim}};break;case"widthDim":s={width:{value:o.width,dim:t[i]}};break;case"height":s={[i]:{value:t[i],dim:o.heightDim}};break;case"heightDim":s={height:{value:o.height,dim:t[i]}};break;case"borderRadiusAll":s={borderRadius:{[Pt[i]]:+t[i]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":s={borderRadius:{topLeft:o.borderRadiusTopLeft,bottomLeft:o.borderRadiusBottomLeft,topRight:o.borderRadiusTopRight,bottomRight:o.borderRadiusBottomRight,[Pt[i]]:+t[i]}};break;case"mobileWidth":s={[i]:{classNamePrefix:"em-mob-width-",value:t[i],dim:o.mobileWidthDim}};break;case"mobileWidthDim":s={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[i]}};break;case"mobileHeight":s={[i]:{classNamePrefix:"em-mob-height-",value:t[i],dim:o.mobileHeightDim}};break;case"mobileHeightDim":s={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[i]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":s={mobileBorderRadius:{[Ot[i]]:t[i],classNamePrefix:"em-mob-border_radius_"+Ot[i]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":s={mobileBoxShadow:{hOffset:o.mobileBoxShadowHOffset,vOffset:o.mobileBoxShadowVOffset,blurRadius:o.mobileBoxShadowBlurRadius,spreadRadius:o.mobileBoxShadowSpreadRadius,color:o.mobileBoxShadowColor,inset:o.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":s={[i]:{classNamePrefix:"em-mob-text_align-",value:t[i]}};break;case"mobileVerticalAlign":s={[i]:{classNamePrefix:"em-mob-vertical_align-",value:t[i]}};break;case"countdownTime":case"countdownTimeZone":case"countdownBackgroundColor":case"countdownNumbersFont":case"countdownNumbersFontSize":case"countdownNumbersColor":case"countdownLabelsFont":case"countdownLabelsFontSize":case"countdownLabelsColor":case"countdownLanguage":case"countdownDuration":case"countdownTransparency":case"countdownNumbersStrong":case"countdownNumbersItalic":case"countdownLabelsStrong":case"countdownLabelsItalic":tt();break;case"video":(async()=>{const e=a.getFieldsValue(!0);e.video.source&&et("tmp",null,e.video.source).then(t=>{var l=document.createElement("canvas"),o=l.getContext("2d"),a=new Image,i=new Image;let s=t,c="https://useblocks.io/app/"+e.video.playButton+".png";a.crossOrigin="Anonymous",i.crossOrigin="Anonymous";let m=!1,u=!1;a.onload=function(){o.clearRect(0,0,l.width,l.height),o.drawImage(a,0,0,l.width,l.height),m=!0},a.src=s,i.onload=function(){var e=l.width/2-i.width/2,t=l.height/2-i.height/2;o.drawImage(i,e,t,i.width,i.height),u=!0},i.src=c;let p=setInterval(function(){if(m&&u){l.width=Math.max(a.width,i.width),l.height=Math.max(a.height,i.height),o.clearRect(0,0,l.width,l.height),o.drawImage(a,0,0,a.width,a.height);var e=l.width/2-i.width/2,t=l.height/2-i.height/2;o.drawImage(i,e,t,i.width,i.height),l.toBlob(async function(e){const t=await(0,Ko.A)(new File([e],"image.jpeg",{type:"image/jpeg"}),{maxSizeMB:n.compressMaxSize||.45,maxWidthOrHeight:n.compressMaxWidthOrHeight||2e3});et(d,t).then(e=>{r((0,Ae.tm)(e))})},"image/jpg",1),clearInterval(p)}},300)})})(),o.link=o.video.source,f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"video",settings:{video:{...o.video,...t.video},link:o.link}});break;default:s=t}var b;"borderPosition"!==i&&"mobileBorderPosition"!==i&&-1===i.indexOf("countdown")&&"video"!==i&&(f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:s}),"video"!==i&&-1===i.indexOf("countdown")&&"mobileBorderRadiusAll"!==i&&"mobileBorderRadiusTopLeft"!==i&&"mobileBorderRadiusTopRight"!==i&&"mobileBorderRadiusBottomLeft"!==i&&"mobileBorderRadiusBottomRight"!==i&&lt({...e,...s,mobileBorderRadius:{...e.mobileBorderRadius,...null===(b=s)||void 0===b?void 0:b.mobileBorderRadius},activateSection:null,changeKey:i}))};(0,o.useEffect)(()=>{I.isError&&(m.error(I),ke(!1))},[I]),(0,o.useEffect)(()=>{if(I.isSuccess&&Se){var t;if(400===(null===(t=I.data.data)||void 0===t?void 0:t.status))m.error({message:I.data.code,description:I.data.message});else{let t=new URL(I.data.target),l={countdown:{link:I.data.link,params:t.search.substring(1)}};f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:l})}ke(!1)}},[I,Se,e,m,f]);(0,Sa.A)(t=>{const l=t.data.operation;l===V.Ru.APPLICATION_OPEN_IMAGE_AI_POPUP?(r((0,Ae.tm)(e.src)),r((0,D.qf)(V.lx.UPLOAD_IMAGE_MODAL_AI))):l===V.Ru.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?(r((0,Ae.tm)(e.src)),r((0,D.qf)(V.lx.UPLOAD_IMAGE_MODAL_UPLOAD))):l===V.Ru.APPLICATION_OPEN_IMAGE_EDIT_POPUP?(r((0,Ae.tm)(e.src)),r((0,D.qf)(V.lx.UPLOAD_IMAGE_MODAL_EDIT))):l===V.Ru.APPLICATION_OPEN_IMAGE_GIF_POPUP?(r((0,Ae.tm)(e.src)),r((0,D.qf)(V.lx.UPLOAD_IMAGE_MODAL_GIF))):l===V.Ru.APPLICATION_OPEN_IMAGE_STOCK_POPUP?(r((0,Ae.tm)(e.src)),r((0,D.qf)(V.lx.UPLOAD_IMAGE_MODAL_STOCK))):l===V.Ru.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(r((0,D.Os)()),r((0,D.Oo)()))});const rt=()=>{te?(le(""),a.setFieldValue("link",""),f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{link:""}})):(le(P.current&&P.current.input.value?P.current.input.value:"..."),setTimeout(()=>{P.current.focus()}))},nt=e=>{""===e.target.value?le("..."):(O.current.classList.add("selected-td-form__button--active"),le(e.target.value));const t=e.target.value;"https://"===t.substring(0,8)?Be("https://"):"mailto:"===t.substring(0,7)?Be("mailto:"):"tel:"===t.substring(0,4)?Be("tel:"):"sms:"===t.substring(0,4)?Be("sms:"):"ftp://"===t.substring(0,6)?Be("ftp://"):"skype:"===t.substring(0,6)?Be("skype:"):"viber:"===t.substring(0,6)?Be("viber:"):Be("")},it=()=>{const t=a.getFieldsValue(!0);oe?(ae(""),t.alt="",f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{alt:""}})):(ae(F.current&&F.current.input.value?F.current.input.value:"..."),setTimeout(()=>{F.current.focus()}))},st=e=>{""===e.target.value?ae("..."):(M.current.classList.add("selected-td-form__button--active"),ae(e.target.value))},dt=()=>{const t=a.getFieldsValue(!0);re?(ne(""),t.title="",f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{title:""}})):(ne(W.current&&W.current.input.value?W.current.input.value:"..."),setTimeout(()=>{W.current.focus()}))},ct=e=>{""===e.target.value?ne("..."):(j.current.classList.add("selected-td-form__button--active"),ne(e.target.value))};return o.createElement(C.A,{form:a,layout:"vertical",name:"selected_image_form",initialValues:{src:"",width:"",height:"",widthDim:"",heightDim:"",alt:"",align:"left",border:"",boxShadow:"",show:"all",borderPosition:Ft[Ke]||"borderAll",mobileBorderPosition:Mt[Qe]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"left",mobileVerticalAlign:"",link:"https://",imgReplacer:"",countdownNumbersStrong:!1,countdownNumbersItalic:!1,countdownLabelsStrong:!1,countdownLabelsItalic:!1,video:{source:"",playButton:"youtube_red"}},onValuesChange:ot,autoComplete:"off",className:"element-controls"},!He&&o.createElement(i.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(u.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),S===V.ND&&w.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(h.A,{gutter:30,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(sa,{form:a,elementSettings:e,imgParent:!0})),n.formImageFieldVerticalAlignEnabled&&o.createElement(b.A,{span:12,align:"right"},o.createElement(da,{form:a,elementSettings:e}))),o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:"countdown"===e.type?15:24}}),"countdown"===e.type&&o.createElement(o.Fragment,null,o.createElement(ha,{form:a,elementSettings:e}),o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),"video"===e.type&&o.createElement(o.Fragment,null,o.createElement(ya,{form:a,elementSettings:e}),o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),("img"===e.type||"video"===e.type)&&o.createElement(C.A.Item,{style:{marginBottom:0}},o.createElement(Le,{form:a,label:t("Image path"),name:"src",placeholder:t("Image path"),elementSettings:e,tooltipTitle:""})),o.createElement(s.A,{size:8,style:{marginBottom:oe||te||re?l.formItemMarginBottomXS:l.formItemMarginBottomMD+4}},o.createElement(i.A,{title:oe||t("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!!oe}),onClick:it,ref:M},o.createElement("span",{className:"addon-text-content"},"Alt"))),n.formFieldImageTitleEnabled&&o.createElement(i.A,{title:re||t("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!!re}),onClick:dt,ref:j},o.createElement("span",{className:"addon-text-content"},"Title"))),o.createElement(i.A,{title:te||t("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!!te}),icon:o.createElement(zt.A,{className:"selected-td-form__icon-radius"}),onClick:rt,ref:O}))),(!!te||!!oe||!!re)&&o.createElement("div",{style:{marginBottom:l.formItemMarginBottomMD+4}},!!te&&o.createElement(i.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"bottom"},o.createElement(C.A.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(B.A,{ref:P,allowClear:!0,placeholder:t("Hyperlink URL"),prefix:o.createElement(zt.A,null),onChange:nt}))),!!oe&&o.createElement(i.A,{trigger:["hover"],title:t("Alternative text"),placement:"bottom"},o.createElement(C.A.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(B.A,{placeholder:t("Alternative text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Alt"),onChange:st,ref:F}))),n.formFieldImageTitleEnabled&&!!re&&o.createElement(i.A,{trigger:["hover"],title:t("Tooltip text"),placement:"bottom"},o.createElement(C.A.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(B.A,{placeholder:t("Tooltip text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Title"),onChange:ct,ref:W})))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{ye(e=>!e),_e&&(t.mobileWidth="",t.mobileHeight="",f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))})}},_e?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),_e&&o.createElement(h.A,{gutter:10,style:{paddingBottom:24}},o.createElement(b.A,{span:12},o.createElement(ra,{form:a,name:"mobileWidth",elementSettings:e,isPicture:"true"})),n.formImageFieldHeightEnabled&&o.createElement(b.A,{span:12},o.createElement(ia,{form:a,name:"mobileHeight",elementSettings:e,isPicture:"true"}))),n.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{ce(e=>!e),de?(t.mobileBorderAll=Dt,t.mobileBorderTop=Dt,t.mobileBorderBottom=Dt,t.mobileBorderRight=Dt,t.mobileBorderLeft=Dt):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})})}},de?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),de&&o.createElement("div",{style:{marginBottom:4}},o.createElement(St,{form:a,typeOfForm:"mobile"}))),n.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{ge(e=>!e),pe?(t.mobileBorderRadiusAll=null,ee(!0)):t.mobileBorderRadiusAll=5,f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})})}},pe?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),pe&&o.createElement("div",{style:{marginBottom:4}},o.createElement(jt,{form:a,oneBorderRadiusValue:J,setOneBorderRadiusValue:ee,elementSettings:e,typeOfForm:"mobile"}))),n.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{ve(e=>!e),fe?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})})}},fe?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),fe&&o.createElement("div",{style:{marginBottom:4}},o.createElement(oa,{boxShadow:X,typeOfForm:"mobile"}))),n.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(ua,{elementSettings:e,form:a})))),n.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Aa,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(h.A,{gutter:10,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(ea,{form:a,elementSettings:e,imgParent:!0})),n.formImageFieldVerticalAlignEnabled&&o.createElement(b.A,{span:12,align:"right"},o.createElement(ta,{form:a,elementSettings:e}))),o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:"countdown"===e.type?15:24}}),"countdown"===e.type&&o.createElement(o.Fragment,null,o.createElement(ha,{form:a,elementSettings:e,handleChangeValues:ot}),o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),n.mergeTagsShow&&xe&&o.createElement(b.A,{span:24,id:"merge_tags_wrapper"},o.createElement(C.A.Item,{style:{marginBottom:24}},o.createElement(g.Ay,{id:"merge_tags_button",icon:o.createElement(z.A,{icon:"MergeTags"}),style:{width:"100%",display:Re?"none":"inline-flex"},onClick:()=>Ne(!0)},t("Merge tags")),o.createElement(at.A,{ref:q,popupClassName:"merge-tags",options:xe,placeholder:t("Start typing the title"),showSearch:{filter:(e,t)=>t.some(t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1),render:(e,t)=>{const l=t.map((t,l)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return o.createElement("span",{key:t.value},0!==l&&o.createElement("span",null,"\xa0/\xa0"),a.map((t,l)=>t.toLowerCase()===e.toLowerCase()?o.createElement("span",{key:l,style:{color:"red"}},t):t))});return o.createElement("div",{title:t.map(e=>e.label).join(" / ")},l)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(t,l)=>{if(Ne(!1),t){const o=Ue.syntax.length>1?xe.findIndex(e=>e.key===l[0].key):0,r=Ue.syntax[o].replace("%value%",t[t.length-1]);"selected_image_form_title"===(null===Oe||void 0===Oe?void 0:Oe.getAttribute("id"))||"selected_image_form_alt"===(null===Oe||void 0===Oe?void 0:Oe.getAttribute("id"))||"selected_image_form_link"===(null===Oe||void 0===Oe?void 0:Oe.getAttribute("id"))||"selected_image_form_imgReplacer"===(null===Oe||void 0===Oe?void 0:Oe.getAttribute("id"))?((t,l)=>{const o=document.getElementById(l);if(o){var r,n;const i="selected_image_form_",s=l.substring(l.indexOf(i)+i.length),d=null===(r=o.value)||void 0===r?void 0:r.substring(0,Me.start),c=null===(n=o.value)||void 0===n?void 0:n.substring(Me.end);f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{...e,[s]:d+t+c}}),a.setFieldValue(s,d+t+c),o.focus(),setTimeout(()=>{o.selectionStart=Me.start,o.selectionEnd=Me.start+t.length},400),We(!0)}})(r,null===Oe||void 0===Oe?void 0:Oe.getAttribute("id")):(a.setFieldValue("imgReplacer",r),f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:r}}))}},style:{display:Re?"block":"none"},open:Re,onKeyDown:e=>{"Escape"===e.key&&Ne(!1)}}))),"video"===e.type&&o.createElement(o.Fragment,null,o.createElement(ya,{form:a,elementSettings:e}),o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),("img"===e.type||"video"===e.type)&&o.createElement(C.A.Item,{style:{marginBottom:0}},o.createElement(Le,{form:a,label:t("Image path"),name:"src",placeholder:t("Image path"),elementSettings:e,tooltipTitle:""})),o.createElement(s.A,{size:8,style:{marginBottom:oe||te||re||je?l.formItemMarginBottomXS:l.formItemMarginBottomMD+4}},o.createElement(i.A,{title:oe||t("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!!oe}),onClick:it,ref:M},o.createElement("span",{className:"addon-text-content"},"Alt"))),n.formFieldImageTitleEnabled&&o.createElement(i.A,{title:re||t("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!!re}),onClick:dt,ref:j},o.createElement("span",{className:"addon-text-content"},"Title"))),o.createElement(i.A,{title:te||t("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!!te}),icon:o.createElement(zt.A,{className:"selected-td-form__icon-radius"}),onClick:rt,ref:O})),n.formImageFieldReplacerEnabled&&o.createElement(i.A,{title:t("Image replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":je}),icon:o.createElement(z.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{ze(!je),je?(a.setFieldValue("imgReplacer",""),f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:""}})):setTimeout(()=>G.current.focus())},ref:U}))),(!!te||!!oe||!!re||!!je)&&o.createElement("div",{style:{marginBottom:l.formItemMarginBottomMD+4}},!!te&&o.createElement(i.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"bottom"},o.createElement(C.A.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(B.A,{addonBefore:o.createElement(ul,{linkProtocol:Ce,handleLinkProtocolsChange:e=>{a.setFieldValue("link","mergetag"!==e?e:""),Be(e)},__:t}),placeholder:t("Hyperlink URL"),allowClear:!0,ref:P,onChange:nt,onSelect:$e,prefix:o.createElement(ml,{linkProtocol:Ce})}))),!!oe&&o.createElement(i.A,{trigger:["hover"],title:t("Alternative text"),placement:"bottom"},o.createElement(C.A.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(B.A,{placeholder:t("Alternative text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Alt"),onChange:st,ref:F,onSelect:$e}))),n.formFieldImageTitleEnabled&&!!re&&o.createElement(i.A,{trigger:["hover"],title:t("Tooltip text"),placement:"bottom"},o.createElement(C.A.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(B.A,{placeholder:t("Enter the title of the image"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Title"),onChange:ct,ref:W,onSelect:$e}))),!!je&&o.createElement(i.A,{trigger:["hover"],title:t("Image src"),placement:"bottom"},o.createElement(C.A.Item,{name:"imgReplacer",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(B.A,{placeholder:t("\u0421ode that will replace the image `src`"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},t("Image src")),onChange:e=>{""!==e.target.value&&U.current.classList.add("selected-td-form__button--active")},ref:G,onSelect:$e})))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Size")),o.createElement(h.A,{gutter:l.marginSM,style:{marginBottom:n.formImageFieldHeightEnabled?4:24}},o.createElement(b.A,{span:12},o.createElement(i.A,{title:t("Width"),placement:"bottom"},o.createElement(C.A.Item,{name:"width",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,max:e.maxWidth,placeholder:t("Width"),prefix:o.createElement(Ee.A,null),addonAfter:"px"})))),n.formImageFieldHeightEnabled&&o.createElement(b.A,{span:12},o.createElement(i.A,{title:t("Height"),placement:"bottom"},o.createElement(C.A.Item,{name:"height"},o.createElement(Lt.A,{min:0,placeholder:t("Height"),prefix:o.createElement($o.A,null),addonAfter:"px"}))))),n.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{se(e=>!e),ie?(t.borderAll=Dt,t.borderTop=Dt,t.borderBottom=Dt,t.borderRight=Dt,t.borderLeft=Dt):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})})}},ie?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ie&&o.createElement("div",{style:{marginBottom:4}},o.createElement(St,{form:a,elementSettings:e}))),n.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{ue(e=>!e),me?(t.borderRadiusAll=0,Q(!0)):t.borderRadiusAll=5,f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})})}},me?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),me&&o.createElement("div",{style:{marginBottom:4}},o.createElement(jt,{form:a,oneBorderRadiusValue:Z,setOneBorderRadiusValue:Q,elementSettings:e}))),n.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{be(e=>!e),he?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),f({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})})}},he?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),he&&o.createElement("div",{style:{marginBottom:4}},o.createElement(oa,{boxShadow:X}))),n.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(ua,{elementSettings:e,form:a})))),n.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Aa,null)))))))},Ta=()=>{const{__:e}=(0,y.s9)();return o.createElement(i.A,{trigger:["hover"],title:e("The font-size CSS property sets the size of the font."),placement:"top"},o.createElement(C.A.Item,{name:"mobileFontSize"},o.createElement(Lt.A,{min:8,max:90,placeholder:e("Font size"),prefix:o.createElement(Je.A,null),addonAfter:"px"})))};var Ra=l(44484);const Na=({form:e,elementSettings:t,name:l,icon:a,tooltipTitle:r=null,showTooltip:n=!0})=>{const{__:s}=(0,y.s9)(),d=e.getFieldValue(l),c=(0,Pe.XW)(),[m,u]=(0,o.useState)(t[l]);(0,o.useEffect)(()=>{t[l]!==e.getFieldValue(l)&&(e.setFieldValue(l,t[l]),u(t[l]))},[t,e,l]),(0,o.useEffect)(()=>{m!==d&&u(d)},[d,m,l]);const p=()=>{const o={[l]:!m};e.setFieldValue(l,!m),c({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:o}),"textSuperscript"===l?e.setFieldValue("textSubscript",!1):"textSubscript"===l&&e.setFieldValue("textSuperscript",!1),u(e=>!e)};return o.createElement(C.A.Item,{name:l},n?o.createElement(i.A,{placement:"bottom",title:r||s(l.substring(4))},o.createElement(g.Ay,{className:k()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":m}),onClick:p},a)):o.createElement(g.Ay,{className:k()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":m}),onClick:p},a))},La=()=>{const{__:e}=(0,y.s9)();return[{symbol:"\u2022",code:"&bull;",description:e("Bullet")},{symbol:"+",code:"&plus;",description:e("Plus")},{symbol:"\xbb",code:"&raquo;",description:e("Double quotation")},{symbol:"\xd7",code:"&times;",description:e("Cross")},{symbol:"\u2013",code:"&mdash;",description:e("Dash")},{symbol:"\u203a",code:"&rsaquo;",description:e("Single quotation")},{symbol:"\u2192",code:"&rarr;",description:e("Arrow")},{symbol:"\u21d2",code:"&rArr;",description:e("Double arrow")},{symbol:"\u25ba",code:"&blacktriangleright;",description:e("Pointer")},{symbol:"\u2212",code:"&minus;",description:e("Minus")},{symbol:"\u2217",code:"&lowast;",description:e("Star")},{symbol:"\u2666",code:"&diams;",description:e("Diamond")}]},{useToken:Ia}=r.A,Pa=({form:e,elementSettings:t,showAddParagraph:l=!0,isButton:a=!1,linkProtocol:r,setLinkProtocol:n,linkTarget:s,isBulletFontColorChecked:d=!1,setIsBulletFontColorChecked:m=()=>{}})=>{var u,p,f,E,_,S,w;const{__:T}=(0,y.s9)(),{token:R}=Ia(),N=(0,A.hN)(),I=(0,Pe.XW)(),P=(0,Pe.K9)(),O=(0,Y.rD)(),F=(0,o.useRef)(),M=(0,o.useRef)(null),D=(0,o.useRef)(null),W=(0,o.useRef)(!1),[j,H]=(0,o.useState)(!1),[G,U]=(0,o.useState)(null),[q,X]=(0,o.useState)({start:0,end:0}),[$,Z]=(0,o.useState)(!1),[Q,J]=(0,o.useState)([]),[ee,te]=(0,o.useState)("#c6c3c3"),[le,oe]=(0,o.useState)(!1),ae=(0,o.useRef)(null),re=La(),ne=(0,o.useMemo)(()=>re,[]),ie=C.A.useWatch([],e);let se=null;(0,o.useEffect)(()=>{if(null!==ie&&void 0!==ie&&ie.textColor&&d){const l=e.getFieldValue("textColor");I({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{ColorBullets:l}})}},[null===ie||void 0===ie?void 0:ie.textColor]),(0,o.useEffect)(()=>{const l=e.getFieldValue("textLink");"string"===typeof t.linkHref&&oe(!0),ae&&!l&&(oe(!1),e.setFieldsValue({linkHref:null})),ae.current=l||null},[null===ie||void 0===ie?void 0:ie.textLink,null===ie||void 0===ie?void 0:ie.linkHref,t.linkHref,e]);(0,Sa.A)(e=>{e.data.operation===V.Ru.APPLICATION_FOCUS_IN_IFRAME&&U(null)});const[de,ce]=(0,o.useState)(null);(0,o.useEffect)(()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&ce(!0)},[]);const me=(0,o.useRef)(null);const ue=e=>{I({operation:V.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"}),N.success({message:T("It`s done!")})},pe=[{key:"1",label:T("This element"),onClick:()=>ue("typograf")},{key:"2",label:T("The whole email"),onClick:()=>ue("typograf_all")}],[ge,he]=(0,o.useState)(),[be,fe]=(0,o.useState)(!1);(0,o.useEffect)(()=>{const e=((e,t="#c6c3c3",l={})=>{const{symbolSize:a="25px",marginRight:r="5px",marginBottom:n="5px",textStyle:i={whiteSpace:"normal",lineHeight:"1.2"}}=l;return e.map(e=>({value:e.code,label:o.createElement("div",{style:{display:"flex",alignItems:"center"}},o.createElement("span",{style:{color:t||"#c6c3c3",marginRight:r,marginBottom:n,fontSize:a,lineHeight:"0.7",width:a,textAlign:"center",...i}},e.symbol),o.createElement("span",{style:i},e.description))}))})(ne,ee,{});J(e)},[ne,ee]),(0,o.useEffect)(()=>{var e;te(null===t||void 0===t||null===(e=t.list)||void 0===e?void 0:e.bulletsColor)},[e,t]),(0,o.useEffect)(()=>{t.linkHref&&("https://"===t.linkHref.substring(0,8)||"http://"===t.linkHref.substring(0,7)?n("https://"):"mailto:"===t.linkHref.substring(0,7)?n("mailto:"):"tel:"===t.linkHref.substring(0,4)?n("tel:"):"sms:"===t.linkHref.substring(0,4)?n("sms:"):"ftp://"===t.linkHref.substring(0,6)?n("ftp://"):"skype:"===t.linkHref.substring(0,6)?n("skype:"):"viber:"===t.linkHref.substring(0,6)?n("viber:"):n("")),e.setFieldsValue({linkHref:t.linkHref?t.linkHref:"https://"})},[e,t,n]);const ve=(0,v.d4)(wa.GH);(0,o.useEffect)(()=>{var e;null!==ve&&void 0!==ve&&null!==(e=ve.items)&&void 0!==e&&e.length&&he((0,Y.cM)(ve.items,T,(e,t)=>{fe(!1),P(V.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()}))},[ve,he,T,fe,P]);(0,o.useEffect)(()=>{be&&me.current&&me.current.focus()},[be]);const ye=(0,Ll.cR)();(0,o.useEffect)(()=>{const e=new K.jG;return e.addDisposable((0,Ca.a)(ye,"focusin",({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||U(e)})),e.addDisposable((0,Ca.a)(ye,"click",({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||fe(!1)})),()=>{e.dispose()}},[ye]),(0,o.useEffect)(()=>{const e=(null===M||void 0===M?void 0:M.current)||document,t=()=>{window.getSelection().toString().length>0&&(W.current=!0)};return e.addEventListener("dblclick",t),()=>{e.removeEventListener("dblclick",t)}},[M]);const Ae=(0,o.useCallback)(({target:e})=>{if(e&&!$){const{selectionStart:t,selectionEnd:l}=e;X({start:t,end:l})}Z(!1)},[$]);(0,o.useEffect)(()=>Ae({target:null===s||void 0===s?void 0:s.target}),[s,Ae]);const Se=(l,o)=>{const a=document.getElementById(o);if(a){var r,n;const i=null===(r=a.value)||void 0===r?void 0:r.substring(0,q.start),s=null===(n=a.value)||void 0===n?void 0:n.substring(q.end),d=o.substring(o.lastIndexOf("_")+1);I({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{[d]:i+l+s}}),e.setFieldValue(d,i+l+s),a.focus(),setTimeout(()=>{a.selectionStart=q.start,a.selectionEnd=q.start+l.length},400),Z(!0)}};(0,o.useEffect)(()=>{var e;H(!(null===(e=t.textReplacer)||void 0===e||!e.length))},[t,e]);return o.createElement(o.Fragment,null,l&&!t.showOnMobile&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:20,style:{paddingBottom:4}},o.createElement(b.A,{span:12,gutter:20},o.createElement(ut,{form:e,elementSettings:t,name:"textAlign"}))),o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:20}})),t.showOnMobile&&o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:20}}),O.formTextFieldTypografEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(C.A.Item,{name:"AddImage",style:{marginBottom:R.formItemMarginBottomXS}},o.createElement(g.Ay,{icon:o.createElement(z.A,{icon:"AddImage"}),onClick:()=>ue("add_img"),style:{width:"100%"}},T("Add image")))),o.createElement(b.A,{span:12},o.createElement(C.A.Item,{name:"Typography",style:{marginBottom:R.formItemMarginBottomXS}},o.createElement(L.A,{arrow:!0,menu:{items:pe},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected-element-panel")},o.createElement(g.Ay,{icon:o.createElement(z.A,{icon:"Typograf"}),onClick:()=>ue("typograf"),style:{width:"100%"}},T("Typography"))))),O.mergeTagsShow&&ge&&o.createElement(b.A,{span:24,id:"merge_tags_wrapper",style:{marginBottom:0}},o.createElement(g.Ay,{id:"merge_tags_button",icon:o.createElement(z.A,{icon:"MergeTags"}),style:{width:"100%",display:be?"none":"inline-flex"},onClick:()=>fe(!0)},T("Merge tags")),o.createElement(at.A,{ref:me,popupClassName:"merge-tags",options:ge,placeholder:T("Start typing the title"),showSearch:{filter:(e,t)=>t.some(t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1),render:(e,t)=>{const l=t.map((t,l)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return o.createElement("span",{key:t.value},0!==l&&o.createElement("span",null,"\xa0/\xa0"),a.map((t,l)=>t.toLowerCase()===e.toLowerCase()?o.createElement("span",{key:l,style:{color:"red"}},t):t))});return o.createElement("div",{title:t.map(e=>e.label).join(" / ")},l)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(l,o)=>{if(fe(!1),l){const a=ve.syntax.length>1?ge.findIndex(e=>e.key===o[0].key):0,r=ve.syntax[a].replace("%value%",l[l.length-1]);if("selected_button_form_href"===(null===G||void 0===G?void 0:G.getAttribute("id"))||"selected_text_form_linkHref"===(null===G||void 0===G?void 0:G.getAttribute("id"))||"selected_text_form_textReplacer"===(null===G||void 0===G?void 0:G.getAttribute("id")))Se(r,null===G||void 0===G?void 0:G.getAttribute("id"));else{e.setFieldValue("textReplacer",r);const l=Date.now();I({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:`${r}~~${l}`}})}}},style:{display:be?"block":"none",width:"100%"},open:be,onKeyDown:e=>{"Escape"===e.key&&fe(!1)}}))),o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:R.formItemMarginBottomMD,marginTop:20}})),o.createElement(i.A,{trigger:["hover"],title:T("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(C.A.Item,{name:"fontFamily",className:"form-item-margin-xs"},o.createElement(ct,{textEditor:!0}))),!t.showOnMobile&&o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:T("Font size"),placement:"bottom"},o.createElement(C.A.Item,{name:"fontSize"},o.createElement(Lt.A,{min:8,max:90,placeholder:T("Font size"),prefix:o.createElement(Je.A,null),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:T("Line height"),placement:"bottom"},o.createElement(C.A.Item,{name:"lineHeight"},o.createElement(Lt.A,{min:10,max:110,placeholder:T("Line height"),prefix:o.createElement(et.A,null),addonAfter:"px"}))))),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:3},o.createElement(Na,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:T(de?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:o.createElement(tt.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(b.A,{span:3},o.createElement(Na,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:T(de?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:o.createElement(lt.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(b.A,{span:3},o.createElement(Na,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:T(de?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:o.createElement(Ra.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(b.A,{span:3},o.createElement(Na,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:T(de?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:o.createElement(ot.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(b.A,{span:3},o.createElement(Na,{form:e,elementSettings:t,name:"textSuperscript",tooltipTitle:T("Text superscript"),icon:o.createElement(z.A,{icon:"Superscript"})})),o.createElement(b.A,{span:3},o.createElement(Na,{form:e,elementSettings:t,name:"textSubscript",tooltipTitle:T("Text subscript"),icon:o.createElement(z.A,{icon:"Subscript"})})),l&&o.createElement(b.A,{span:3},o.createElement(Na,{form:e,className:k()("selected-text-common-form__button selected-text-common-form__button_style",{"selected-text-common-form__button--active":"string"===typeof t.linkHref}),elementSettings:t,name:"textLink",tooltipTitle:T("Link"),icon:o.createElement(zt.A,{className:"selected-text-common-form__icon-radius"}),onSelect:Ae})),a&&o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:T("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(C.A.Item,{name:"textColor",rules:[{message:T("Please set the font color")}]},o.createElement(_e,{placeholder:T("Color"),usedColors:t.usedColors})))),!a&&O.formTextFieldReplacerEnabled&&o.createElement(b.A,{span:3},o.createElement(i.A,{title:T("Text replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button ant-form-item",{"selected-td-form__button--active":j}),icon:o.createElement(z.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{H(!j),j?(e.setFieldValue("textReplacer",""),I({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:""}})):setTimeout(()=>M.current.focus())},ref:D})))),l&&"string"===typeof t.linkHref&&le&&o.createElement(i.A,{trigger:["hover"],title:T("The URL that the hyperlink directs to."),placement:"bottom"},o.createElement(C.A.Item,{name:"linkHref"},o.createElement(B.A,{ref:F,addonBefore:o.createElement(ul,{linkProtocol:r,handleLinkProtocolsChange:t=>{e.setFieldValue("linkHref","mergetag"!==t?t:""),n(t)},__:T}),allowClear:!0,placeholder:T("Hyperlink URL"),autoFocus:null===t||void 0===t?void 0:t.isNewLink,onSelect:Ae,prefix:o.createElement(ml,{linkProtocol:r})}))),!a&&j&&o.createElement(i.A,{trigger:["hover"],title:T("Text"),placement:"bottom"},o.createElement(C.A.Item,{name:"textReplacer"},o.createElement(B.A,{placeholder:T("The code that will replace this text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},T("Text")),onChange:e=>{""!==e.target.value&&D.current.classList.add("selected-td-form__button--active")},onKeyDown:e=>{const l=e.target,o=l.value,a=l.selectionStart,r=function(e){const t=e.key.toLowerCase();let l=!1;return("control"!==se&&"meta"!==se||"a"!==t&&"A"!==t)&&("a"!==se&&"A"!==se||"control"!==t&&"meta"!==t)||(l=!0),se=t,"control"!==t&&"a"!==t&&"A"!==t&&"meta"!==t&&(se=null),l}(e);if(W.current&&0===a&&I({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:`${o}~`}}),W.current=r,0!==a||" "!==e.key){if(" "===e.key){if(a!==o.length)return void e.preventDefault();o.endsWith(" ")&&e.preventDefault()}}else e.preventDefault()},ref:M,onSelect:Ae}))),!a&&o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:T("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(C.A.Item,{name:"textColor",rules:[{message:T("Please set the font color")}]},o.createElement(_e,{placeholder:T("Color"),usedColors:t.usedColors})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:T("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(C.A.Item,{name:"textBackgroundColor",rules:[{message:T("Please set the background color")}]},o.createElement(_e,{placeholder:T("Background color"),usedColors:t.usedColors}))))),!a&&(null===t||void 0===t||null===(u=t.list)||void 0===u?void 0:u.isList)&&o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:2}}),!a&&(null===t||void 0===t||null===(p=t.list)||void 0===p?void 0:p.isList)&&o.createElement(h.A,{gutter:[10,10],align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},T("List settings")))),!a&&(null===t||void 0===t||null===(f=t.list)||void 0===f?void 0:f.isList)&&o.createElement(o.Fragment,null,"OL"===(null===t||void 0===t||null===(E=t.list)||void 0===E?void 0:E.listType)&&o.createElement(h.A,null,o.createElement(b.A,{span:24},o.createElement(i.A,{trigger:["hover"],title:T("Bullets font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(C.A.Item,{name:"BulletsFontFamily",className:"form-item-margin-xs"},o.createElement(ct,{textEditor:!0,style:{marginTop:"-9px"}}))))),o.createElement(h.A,{gutter:[10]},"UL"===(null===t||void 0===t||null===(_=t.list)||void 0===_?void 0:_.listType)&&o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:T("Bullets type"),placement:"bottom"},o.createElement(C.A.Item,{name:"BulletType",className:"bullet-type"},o.createElement(x.A,{size:"middle",placeholder:T("Bullets type"),onClick:e=>e.stopPropagation(),options:Q}))))),o.createElement(h.A,{gutter:[10]},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:T("Bullets color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(C.A.Item,{name:"ColorBullets"},o.createElement(_e,{placeholder:T("Bullets color"),usedColors:t.usedColors,isDisabled:d,onChange:e=>{te(e),d&&m(!1)},externalValue:d?null===ie||void 0===ie?void 0:ie.textColor:void 0})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:T("Bullets size"),placement:"bottom"},o.createElement(C.A.Item,{name:"BulletsSize"},o.createElement(Lt.A,{min:8,max:90,defaultValue:null===t||void 0===t||null===(S=t.list)||void 0===S?void 0:S.bulletFontSize,placeholder:T("Bullets size"),prefix:o.createElement(Je.A,null),addonAfter:"px"}))))),"OL"===(null===t||void 0===t||null===(w=t.list)||void 0===w?void 0:w.listType)&&o.createElement(h.A,null,o.createElement(b.A,{span:3},o.createElement(Na,{form:e,elementSettings:t,name:"BulletTextStrong",tooltipTitle:T(de?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:o.createElement(tt.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(b.A,{span:3},o.createElement(Na,{form:e,elementSettings:t,name:"BulletTextItalic",tooltipTitle:T(de?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:o.createElement(lt.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(b.A,{span:3},o.createElement(Na,{form:e,elementSettings:t,name:"BulletTextStrikethrough",tooltipTitle:T(de?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:o.createElement(Ra.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(b.A,{span:3},o.createElement(Na,{form:e,elementSettings:t,name:"BulletTextUnderline",tooltipTitle:T(de?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:o.createElement(ot.A,{className:"selected-text-common-form__icon-radius"})}))),o.createElement(h.A,{gutter:[10],style:{marginTop:"-8px"}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:T("Between list items"),placement:"bottom"},o.createElement(C.A.Item,{name:"SpacingBetweenParagraphs"},o.createElement(Lt.A,{min:5,max:100,placeholder:T("Between list items"),prefix:o.createElement($o.A,null),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:T("Between bullets and text"),placement:"bottom"},o.createElement(C.A.Item,{name:"SpacingBetweenBulletsAndText"},o.createElement(Lt.A,{min:1,max:100,placeholder:T("Between bullets and text"),prefix:o.createElement(Ee.A,null),addonAfter:"px"})))))))},Oa=({form:e,elementSettings:t,showAddParagraph:l=!0,isButton:a=!1})=>{const{__:r}=(0,y.s9)(),n=(0,Pe.XW)(),d=(0,v.wA)(),{emailId:m}=(0,_.g)(),u=(0,v.d4)(m?H.Hs:Xe.gm).hasOwnProperty("type")?V.IE:V.Tm,p=(0,Y.rD)(),[h,b]=(0,o.useState)(null);(0,o.useEffect)(()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&b(!0)},[]);const f=e=>{n({operation:V.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"})},[E,A]=(0,o.useState)(t.textAlign),[S,k]=(0,o.useState)(t.linkHref),w=e=>A(e);return(0,o.useEffect)(()=>{A(t.textAlign),k(t.linkHref)},[t]),o.createElement("div",{className:"selected_text_common_form_mobile"},o.createElement(s.A,{size:"8",split:o.createElement(c.A,{type:"vertical"})},o.createElement(s.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement("div",{style:{width:190}},o.createElement(i.A,{trigger:["hover"],title:r("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(C.A.Item,{name:"fontFamily"},o.createElement(ct,{textEditor:!0,codeMode:!0})))),o.createElement("div",{style:{width:90}},o.createElement(i.A,{trigger:["hover"],title:r("Font size"),placement:"bottom"},o.createElement(C.A.Item,{name:"fontSize"},o.createElement(Lt.A,{min:8,max:90,placeholder:r("Font size"),prefix:o.createElement(Je.A,null),addonAfter:"px"})))),o.createElement("div",{style:{width:90}},o.createElement(i.A,{trigger:["hover"],title:r("Line height"),placement:"bottom"},o.createElement(C.A.Item,{name:"lineHeight"},o.createElement(Lt.A,{min:10,max:110,placeholder:r("Line height"),prefix:o.createElement(et.A,null),addonAfter:"px"}))))),o.createElement(s.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement(Na,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:r(h?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:o.createElement(tt.A,{className:"selected-td-form__icon-radius"})}),o.createElement(Na,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:r(h?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:o.createElement(lt.A,{className:"selected-td-form__icon-radius"})}),o.createElement(Na,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:r(h?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:o.createElement(Ra.A,{className:"selected-td-form__icon-radius"})}),o.createElement(Na,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:r(h?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:o.createElement(ot.A,{className:"selected-td-form__icon-radius"})})),o.createElement(s.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement(i.A,{trigger:["hover"],title:r("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(C.A.Item,{name:"textColor",rules:[{message:r("Please set the font color")}]},o.createElement(_e,{placeholder:r("Color"),usedColors:t.usedColors,codeMode:!0}))),!a&&o.createElement(o.Fragment,null,o.createElement(i.A,{trigger:["hover"],title:r("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(C.A.Item,{name:"textBackgroundColor",rules:[{message:r("Please set the background color")}]},o.createElement(_e,{placeholder:r("Background color"),usedColors:t.usedColors}))))),l&&o.createElement(s.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement(o.Fragment,null,"string"===typeof S?o.createElement(L.A,{arrow:!0,dropdownRender:()=>o.createElement(i.A,{trigger:["hover"],title:r("The URL that the hyperlink directs to."),placement:"bottom"},o.createElement(C.A.Item,{name:"linkHref"},o.createElement(B.A,{allowClear:!0,placeholder:"href",prefix:o.createElement(zt.A,null),autoFocus:null===t||void 0===t?void 0:t.isNewLink}))),overlayClassName:"codemode-textalign-dropdown",overlayStyle:{left:520,top:52,transform:"translateX(0)",marginLeft:57},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile")},o.createElement("div",null,o.createElement(Na,{form:e,className:"selected-td-form__button selected-td-form__button_style selected-td-form__button--active",elementSettings:t,name:"textLink",icon:o.createElement(zt.A,{className:"selected-td-form__icon-radius"}),showTooltip:!1}))):o.createElement(Na,{form:e,className:"selected-td-form__button selected-td-form__button_style",elementSettings:t,name:"textLink",tooltipTitle:r("Link"),icon:o.createElement(zt.A,{className:"selected-td-form__icon-radius"})}),o.createElement(L.A,{arrow:!0,dropdownRender:()=>o.createElement(ut,{form:e,elementSettings:t,name:"textAlign",setAlignStateHandle:w}),overlayClassName:"codemode-textalign-dropdown",overlayStyle:{left:615,top:52,transform:"translateX(0)",marginLeft:57},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile")},o.createElement(g.Ay,{icon:"right"===E?o.createElement(z.A,{icon:"AlignRightOutlined",size:18,strokeWidth:p.iconStrokeWidth}):"center"===E?o.createElement(z.A,{icon:"AlignCenterOutlined",size:18,strokeWidth:p.iconStrokeWidth}):o.createElement(z.A,{icon:"AlignLeftOutlined",size:18,strokeWidth:p.iconStrokeWidth}),className:"selected-td-form__button"})))),o.createElement(s.A,{size:8,className:"selected_text_common_form_mobile__group"},l&&o.createElement(i.A,{trigger:["hover"],title:r("Add paragraph"),placement:"bottom"},o.createElement(g.Ay,{icon:o.createElement(z.A,{icon:"Paragraph"}),onClick:()=>f("add_p"),className:"selected-td-form__button"})),o.createElement(i.A,{trigger:["hover"],title:r("Add inline image"),placement:"bottom"},o.createElement(g.Ay,{icon:o.createElement(z.A,{icon:"ImageAdd",size:16,strokeWidth:p.iconStrokeWidth}),onClick:()=>f("add_img"),className:"selected-td-form__button"})),o.createElement(g.Ay,{icon:o.createElement(z.A,{icon:"Typograf"}),className:"selected-td-form__button"}),o.createElement(g.Ay,{icon:o.createElement(pt.A,null),type:"icon",style:{marginLeft:26},onClick:()=>{n({operation:V.Ru.SANDBOX_ELEMENT_ACTIVE_RESET}),d((0,Ie.Fk)()),setTimeout(()=>{u===V.IE?d((0,Xe.A9)({type:null})):d((0,H.A9)({type:null}))},300)}}))))},Fa=({form:e,elementSettings:t,imgParent:l=!1,name:a="mobileAlign"})=>{var r;const{__:n}=(0,y.s9)(),[d,c]=(0,o.useState)(null===(r=t[a])||void 0===r?void 0:r.value),m=(0,Pe.XW)(),u=(0,Y.rD)(),p=l=>{const o=l.target.value,r={[a]:{classNamePrefix:"em-mob-text_align-",value:""}};o!==d?c(o):(c(""),e.setFieldsValue(r),m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:r}))};return o.createElement(C.A.Item,{name:a},o.createElement(mt.Ay.Group,{disabled:l&&!t.parent},o.createElement(s.A,{size:8},o.createElement(i.A,{placement:"bottom",title:n("Text align left")},o.createElement(mt.Ay.Button,{value:"left",onClick:p},o.createElement(z.A,{icon:"AlignLeftOutlined",size:18,strokeWidth:u.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:n("Text align center")},o.createElement(mt.Ay.Button,{value:"center",onClick:p},o.createElement(z.A,{icon:"AlignCenterOutlined",size:18,strokeWidth:u.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:n("Text align right")},o.createElement(mt.Ay.Button,{value:"right",onClick:p},o.createElement(z.A,{icon:"AlignRightOutlined",size:18,strokeWidth:u.iconStrokeWidth}))),o.createElement(i.A,{placement:"bottom",title:n("Text align justify")},o.createElement(mt.Ay.Button,{value:"justify",onClick:p},o.createElement(z.A,{icon:"Justify",size:18,strokeWidth:u.iconStrokeWidth}))))))},Ma=({elementSettings:e})=>{const{__:t}=(0,y.s9)(),l=(0,v.wA)(),a=(0,Pe.XW)(),[r]=C.A.useForm(),n=(0,v.d4)(H.Hs),s=(0,v.d4)(Ie.Ct),d=(0,v.d4)(Ie.CS),c=(0,v.d4)(Ie.Fv),m=(0,v.d4)(Ie.yy),p=c&&"bottom"!==m,[g,f]=(0,o.useState)("https://"),[E,_]=(0,o.useState)(!1),A=La(),S=(0,o.useMemo)(()=>A,[]),k=n.hasOwnProperty("type")?V.IE:V.Tm,w=(0,o.useCallback)(e=>{l(k===V.Tm?(0,H.A9)(e):(0,Xe.A9)(e))},[l,k]);(0,o.useEffect)(()=>{var t,l,o,a,n,i,s,d,c,m,u,p,g,h,b,f;e&&r.setFieldsValue({...e,linkHref:e.linkHref?e.linkHref:"https://",mobileFontSize:gl((null===(t=e.mobileFontSize)||void 0===t?void 0:t.value)||e.fontSize),mobileFontSizeDim:(null===(l=e.mobileFontSize)||void 0===l?void 0:l.dim)||e.fontSizeDim,mobileLineHeight:gl((null===(o=e.mobileLineHeight)||void 0===o?void 0:o.value)||e.lineHeight),mobileLineHeightDim:(null===(a=e.mobileLineHeight)||void 0===a?void 0:a.dim)||e.lineHeightDim,mobileTextAlign:gl((null===(n=e.mobileTextAlign)||void 0===n?void 0:n.value)||e.textAlign),SpacingBetweenBulletsAndText:null===e||void 0===e||null===(i=e.list)||void 0===i?void 0:i.betweenRowCell,SpacingBetweenParagraphs:null===e||void 0===e||null===(s=e.list)||void 0===s?void 0:s.betweenParagraphs,BulletsSize:null===e||void 0===e||null===(d=e.list)||void 0===d?void 0:d.bulletFontSize,ColorBullets:null===e||void 0===e||null===(c=e.list)||void 0===c?void 0:c.bulletsColor,BulletTextStrong:null===e||void 0===e||null===(m=e.list)||void 0===m?void 0:m.bulletFontBold,BulletTextItalic:null===e||void 0===e||null===(u=e.list)||void 0===u?void 0:u.bulletFontItalic,CheckboxColor:E,BulletsFontFamily:null===e||void 0===e||null===(p=e.list)||void 0===p?void 0:p.bulletFontFamily,BulletTextUnderline:null===e||void 0===e||null===(g=e.list)||void 0===g?void 0:g.bulletFontUnderline,BulletTextStrikethrough:null===e||void 0===e||null===(h=e.list)||void 0===h?void 0:h.bulletFontStrikethrough,BulletType:null!==(b=null===(f=S.find(t=>{var l;return t.symbol===(null===e||void 0===e||null===(l=e.list)||void 0===l?void 0:l.bulletType)}))||void 0===f?void 0:f.code)&&void 0!==b?b:S[0].code,textSuperscript:null===e||void 0===e?void 0:e.textSuperscript,textSubscript:null===e||void 0===e?void 0:e.textSubscript})},[r,e]);return o.createElement(C.A,{form:r,layout:"vertical",name:"selected_text_form",autoComplete:"off",onValuesChange:t=>{var l,o;const n=r.getFieldsValue(!0),i=Object.keys(t)[0];let s;switch(i){case"mobileFontSize":s={[i]:{classNamePrefix:"em-mob-font_size-",value:t[i],dim:n.mobileFontSizeDim}};break;case"mobileLineHeight":s={[i]:{classNamePrefix:"em-mob-line_height-",value:t[i],dim:n.mobileLineHeightDim}};break;case"mobileTextAlign":s={[i]:{classNamePrefix:"em-mob-text_align-",value:t[i]}};break;case"linkHref":let e=t[i];"https://http"===e.substring(0,12)&&(e=e.substring(8,e.length),r.setFieldValue("linkHref",e)),s={[i]:e},"https://"===t[i].substring(0,8)||"http://"===t[i].substring(0,7)?f("https://"):"mailto:"===t[i].substring(0,7)?f("mailto:"):"tel:"===t[i].substring(0,4)?f("tel:"):"sms:"===t[i].substring(0,4)?f("sms:"):"ftp://"===t[i].substring(0,6)?f("ftp://"):"skype:"===t[i].substring(0,6)?f("skype:"):"viber:"===t[i].substring(0,6)?f("viber:"):f("");break;default:s=t}a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:s}),w({...e,list:{...e.list,bulletsColor:r.getFieldValue("ColorBullets"),bulletFontFamily:r.getFieldValue("BulletsFontFamily"),bulletFontSize:r.getFieldValue("BulletsSize"),betweenParagraphs:r.getFieldValue("SpacingBetweenParagraphs"),betweenRowCell:r.getFieldValue("SpacingBetweenBulletsAndText"),bulletType:null!==(l=null===(o=S.find(e=>e.code===r.getFieldValue("BulletType")))||void 0===o?void 0:o.symbol)&&void 0!==l?l:S[0].symbol},...s,activateSection:null,changeKey:i})},className:"element-controls",initialValues:{textAlign:"left",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textColor:"",textBackgroundColor:"",textLink:!1,textReplacer:"",SpacingBetweenBulletsAndText:0,SpacingBetweenParagraphs:0,BulletsSize:0,ColorBullets:"",BulletTextStrong:!1,BulletTextItalic:!1,CheckboxColor:!1,BulletsFontFamily:"",BulletTextUnderline:!1,BulletTextStrikethrough:!1,BulletType:"",textSuperscript:!1,textSubscript:!1}},!p&&o.createElement(i.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(u.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),!(s===V.ND&&!p&&d.styles)&&o.createElement("div",{id:"selected_element_form_desktop_props",style:{paddingRight:0}},o.createElement("div",{className:"selected_form-props-wrapper"},p?o.createElement(Oa,{form:r,elementSettings:e}):o.createElement(Pa,{form:r,elementSettings:e,linkProtocol:g,setLinkProtocol:f,isBulletFontColorChecked:E,setIsBulletFontColorChecked:_}))),!p&&o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:s===V.ND&&d.styles?"block":"none"}},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(h.A,{gutter:20},o.createElement(b.A,{span:12},o.createElement(Fa,{form:r,elementSettings:e,name:"mobileTextAlign"}))),!!e.showOnMobile&&o.createElement(Pa,{form:r,elementSettings:e,linkProtocol:g,setLinkProtocol:f}),o.createElement(h.A,{gutter:10,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Ta,null)),o.createElement(b.A,{span:12},o.createElement(C.A.Item,{name:"mobileLineHeight"},o.createElement(Lt.A,{min:0,placeholder:t("Line height"),prefix:o.createElement(et.A,null),addonAfter:"px"})))))))},Da=({form:e,oneMobileBorderRadiusValue:t,setOneMobileBorderRadiusValue:l,elementSettings:a})=>{const{__:r}=(0,y.s9)(),n=(0,Pe.XW)();return o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(s.A,{size:10,align:"start"},o.createElement(C.A.Item,{name:"mobileBorderRadiusAll"},o.createElement(Lt.A,{min:0,placeholder:r("Border radius"),prefix:o.createElement(Nt,{className:"selected-td-form__icon-radius"}),disabled:!t,addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!t}),onClick:()=>{const o=e.getFieldsValue(!0);t&&e.setFieldsValue({mobileBorderRadiusTopLeft:o.mobileBorderRadiusAll,mobileBorderRadiusBottomLeft:o.mobileBorderRadiusAll,mobileBorderRadiusTopRight:o.mobileBorderRadiusAll,mobileBorderRadiusBottomRight:o.mobileBorderRadiusAll}),n({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{mobileBorderRadius:{all:o.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}}),l(e=>!e)}},o.createElement(Nt,{className:"selected-td-form__icon-radius"}))),o.createElement(b.A,null,o.createElement(h.A,{gutter:10,style:{marginTop:-10}},o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:r("Top left corner")},o.createElement(C.A.Item,{hidden:t,name:"mobileBorderRadiusTopLeft",className:"form-item-margin-xs"},o.createElement(Lt.A,{min:0,prefix:o.createElement(wt.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(i.A,{placement:"bottom",title:r("Bottom left corner")},o.createElement(C.A.Item,{hidden:t,name:"mobileBorderRadiusBottomLeft"},o.createElement(Lt.A,{min:0,prefix:o.createElement(Ct.A,null),style:{minHeight:10},addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:r("Top right corner")},o.createElement(C.A.Item,{hidden:t,name:"mobileBorderRadiusTopRight",className:"form-item-margin-xs"},o.createElement(Lt.A,{min:0,prefix:o.createElement(Bt.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(i.A,{placement:"bottom",title:r("Bottom right corner")},o.createElement(C.A.Item,{hidden:t,name:"mobileBorderRadiusBottomRight"},o.createElement(Lt.A,{min:0,prefix:o.createElement(xt.A,null),style:{minHeight:10},addonAfter:"px"})))))))},Va=({form:e,elementSettings:t})=>{const{__:l}=(0,y.s9)(),a=(0,o.useRef)(),r=(0,v.d4)(H.uJ),[n,c]=(0,o.useState)(!t.mobileBoxShadow||0===t.mobileBoxShadow.hOffset&&0===t.mobileBoxShadow.vOffset&&0===t.mobileBoxShadow.blurRadius&&0===t.mobileBoxShadow.spreadRadius&&0===t.mobileBoxShadow.spreadRadius),m=(0,Pe.XW)(),u=e=>{c(!1)};return o.createElement(o.Fragment,null,o.createElement("div",{style:{float:"right",marginTop:-9,marginRight:50}},o.createElement(s.A,{size:8,align:"end"},o.createElement(f.A,{ref:a,size:"small",checked:n,onChange:l=>{c(e=>!e),e.setFieldsValue({mobileBoxShadowHOffset:n?"":0,mobileBoxShadowVOffset:n?"":0,mobileBoxShadowBlurRadius:n?"":0,mobileBoxShadowSpreadRadius:n?"":0,mobileBoxShadowColor:"",mobileBoxShadowInset:!1}),m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobileBoxShadow:{classNamePrefix:"em-mob-box_shadow-",hOffset:n?null:0,vOffset:n?null:0,blurRadius:n?null:0,spreadRadius:n?null:0,color:null,inset:!1}}})},id:"without-shadow"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"without-shadow"},l("Without shadow"))))),o.createElement("p",{style:{paddingBottom:"8px",margin:"-30px 0 0"}},"\xa0"),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:l("Horizontal offset")},o.createElement(C.A.Item,{name:"mobileBoxShadowHOffset",className:"form-item-margin-xs"},o.createElement(Lt.A,{min:0,placeholder:l("Horizontal offset"),prefix:o.createElement(la.A,null),addonAfter:"px",onChange:u})))),o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:l("Vertical offset")},o.createElement(C.A.Item,{name:"mobileBoxShadowVOffset",className:"form-item-margin-xs"},o.createElement(Lt.A,{min:0,placeholder:l("Vertical offset"),prefix:o.createElement(la.A,{style:{transform:"rotate(90deg)"}}),addonAfter:"px",onChange:u})))),o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:l("Blur radius")},o.createElement(C.A.Item,{name:"mobileBoxShadowBlurRadius",className:"form-item-margin-xs"},o.createElement(Lt.A,{min:0,placeholder:l("Blur radius"),prefix:o.createElement(z.A,{icon:"Blur",style:{fontSize:16,marginLeft:-2}}),addonAfter:"px",onChange:u})))),o.createElement(b.A,{span:12},o.createElement(i.A,{placement:"bottom",title:l("Spread radius")},o.createElement(C.A.Item,{name:"mobileBoxShadowSpreadRadius",className:"form-item-margin-xs"},o.createElement(Lt.A,{placeholder:l("Spread radius"),prefix:o.createElement(z.A,{icon:"ZoomOutMap"}),addonAfter:"px",onChange:u})))),o.createElement(b.A,{span:12},o.createElement(s.A,{size:10,align:"start"},o.createElement(C.A.Item,{name:"mobileBoxShadowColor"},o.createElement(_e,{usedColors:r.usedColors})))),o.createElement(b.A,{span:12},o.createElement(i.A,{title:l("Shadow inside or outside of the element"),key:"inset",placement:"bottom"},o.createElement(C.A.Item,{name:"mobileBoxShadowInset",valuePropName:"checked"},o.createElement(d.A,{style:{width:"100%"},options:[{label:l("Outside"),value:!1},{label:l("Inside"),value:!0}]}))))))},{useToken:Wa}=r.A,ja=({form:e,elementSettings:t,label:l})=>{var a;const{__:r}=(0,y.s9)(),n=(0,o.useRef)(),[d,c]=(0,o.useState)("none"===(null===(a=t.mobileBackgroundColor)||void 0===a?void 0:a.value)),{token:m}=Wa(),u=(0,Pe.XW)();return o.createElement(o.Fragment,null,o.createElement(i.A,{trigger:["hover"],title:r("Background color"),placement:"left"},o.createElement(C.A.Item,{name:"mobileBackgroundColor",style:{marginBottom:m.formItemMarginBottomXS/2}},o.createElement(_e,{onChange:e=>{c(!1)},placeholder:l,usedColors:t.usedColors})),o.createElement(s.A,{size:8,align:"end"},o.createElement(f.A,{ref:n,size:"small",checked:d,onChange:l=>{e.setFieldsValue({mobileBackgroundColor:""}),c(e=>!e),u({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:d?"":"none"}}})},id:"without-background-color"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"without-background-color"},r("Without background color"))))))},za=({form:e,placeholder:t,name:l,tooltipTitle:a,disabled:r,elementSettings:n})=>{var d;const{__:c}=(0,y.s9)(),m=(0,Pe.XW)(),u=e.getFieldValue(l),[p,g]=(0,o.useState)("success"),h=(0,o.useRef)(),[b,E]=(0,o.useState)(!(!n.mobileBackgroundImage||"none"!==n.mobileBackgroundImage[0].value));(0,o.useEffect)(()=>{u?(0,K.DI)(u).then(e=>{g(e)}).catch(e=>{g(e)}):g("")},[e,u]);return o.createElement(o.Fragment,null,o.createElement(i.A,{trigger:["hover"],title:a,placement:"left"},o.createElement(C.A.Item,{name:l,validateStatus:p,style:{marginBottom:-7}},o.createElement(xe,{validateStatus:p,placeholder:t,name:l,disabled:r,elementSettings:n,imageInfo:n.type===V.bV.CAROUSEL?null===(d=n.carouselImages)||void 0===d?void 0:d[l.split("_")[1]]:n})),o.createElement(s.A,{size:8,align:"end",style:{marginTop:-3,display:"flex"}},o.createElement(f.A,{ref:h,size:"small",checked:b,onChange:t=>{e.setFieldsValue({mobileBackgroundImage:""}),E(e=>!e),m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:n.type,settings:{mobileBackgroundImage:[{classNamePrefix:"em-mob-background_image-",value:b?"":"none",type:"url"}]}})},id:"without-background-image"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"without-background-image"},c("Without background image"))))))};za.defaulProps={disabled:!1};const Ha=(e,t)=>{const{__:l}=(0,y.s9)();return o.createElement(i.A,{title:l("During export, the element is converted into an image."),key:"exportAsPicture"},o.createElement(s.A,{size:10,align:"baseline"},o.createElement(C.A.Item,{name:"exportAsPicture",valuePropName:"checked"},o.createElement(f.A,{size:"small",id:"convern-in-image"})),o.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"convern-in-image"},l("Convert into an image")))))},{useToken:Ga}=r.A,Ua=({elementSettings:e})=>{const{__:t}=(0,y.s9)(),l=(0,Pe.XW)(),[a]=C.A.useForm(),r=(0,v.wA)(),n=(0,v.d4)(H.Hs).hasOwnProperty("type")?V.IE:V.Tm,[s,d]=(0,o.useState)({}),[m,p]=(0,o.useState)(!0),[f,E]=(0,o.useState)({}),[_,A]=(0,o.useState)(!0),S=(0,v.d4)(Ie.Ct),k=(0,v.d4)(Ie.CS),w=(0,Y.rD)(),[B,T]=(0,o.useState)(""===e.backgroundImage[0].value),{token:R}=Ga(),N=(0,v.d4)(Ie.Fv),L=(0,v.d4)(Ie.yy),I=N&&"bottom"!==L,[P,O]=(0,o.useState)(!1),[F,M]=(0,o.useState)(!1),[D,W]=(0,o.useState)(!1),[j,G]=(0,o.useState)(!1),[U,q]=(0,o.useState)(!1),[X,$]=(0,o.useState)(!1),[Z,K]=(0,o.useState)(!1),[Q,J]=(0,o.useState)(!1),[ee,te]=(0,o.useState)(!1),[le,oe]=(0,o.useState)(!1),[ae,re]=(0,o.useState)(!1),ne=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],ie=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}],se=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"",de=e.border,ce=e.mobileBorder,me=Object.keys(de).find(e=>{var t,l,o;return(null===(t=de[e])||void 0===t?void 0:t.width)||(null===(l=de[e])||void 0===l?void 0:l.style)||(null===(o=de[e])||void 0===o?void 0:o.color)}),ue=Object.keys(ce).find(e=>{var t,l,o;return(null===(t=ce[e])||void 0===t?void 0:t.width)||(null===(l=ce[e])||void 0===l?void 0:l.style)||(null===(o=ce[e])||void 0===o?void 0:o.color)});(0,o.useEffect)(()=>{if(e){var t,l,o,r,n,i,s,c,m,u,g,h,b,f,v,_,y,S,k,w,C,B,x,R,N,L,I,P,F,D;const V=e.boxShadow,j=e.mobileBoxShadow;d(V),E(j),a.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,maxWidth:null===(o=e.maxWidth)||void 0===o?void 0:o.value,maxWidthDim:null===(r=e.maxWidth)||void 0===r?void 0:r.dim,minWidth:null===(n=e.minWidth)||void 0===n?void 0:n.value,minWidthDim:null===(i=e.minWidth)||void 0===i?void 0:i.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",borderAll:gl(e.border.all),borderTop:gl(e.border.top),borderBottom:gl(e.border.bottom),borderRight:gl(e.border.right),borderLeft:gl(e.border.left),borderRadiusAll:gl(e.borderRadius.all),borderRadiusTopLeft:gl(e.borderRadius.topLeft),borderRadiusBottomLeft:gl(e.borderRadius.bottomLeft),borderRadiusTopRight:gl(e.borderRadius.topRight),borderRadiusBottomRight:gl(e.borderRadius.bottomRight),boxShadowInset:gl(null===(s=e.boxShadow)||void 0===s?void 0:s.inset)||!1,boxShadowHOffset:gl(null===(c=e.boxShadow)||void 0===c?void 0:c.hOffset),boxShadowVOffset:gl(null===(m=e.boxShadow)||void 0===m?void 0:m.vOffset),boxShadowBlurRadius:gl(null===(u=e.boxShadow)||void 0===u?void 0:u.blurRadius),boxShadowSpreadRadius:gl(null===(g=e.boxShadow)||void 0===g?void 0:g.spreadRadius),boxShadowColor:gl(null===(h=e.boxShadow)||void 0===h?void 0:h.color),mobileWidth:hl(null===(b=e.mobileWidth)||void 0===b?void 0:b.value),mobileWidthDim:null===(f=e.mobileWidth)||void 0===f?void 0:f.dim,mobileAlign:null===(v=e.mobileAlign)||void 0===v?void 0:v.value,mobileBorderAll:se(e.mobileBorder.all)||!(se(e.mobileBorder.top)||se(e.mobileBorder.bottom)||se(e.mobileBorder.right)||se(e.mobileBorder.left))&&se(e.border.all),mobileBorderTop:se(e.mobileBorder.top)||!se(e.mobileBorder.all)&&se(e.border.top),mobileBorderBottom:se(e.mobileBorder.bottom)||!se(e.mobileBorder.all)&&se(e.border.bottom),mobileBorderRight:se(e.mobileBorder.right)||!se(e.mobileBorder.all)&&se(e.border.right),mobileBorderLeft:se(e.mobileBorder.left)||!se(e.mobileBorder.all)&&se(e.border.left),mobileBorderRadiusAll:gl(e.mobileBorderRadius.all),mobileBorderRadiusTopLeft:gl(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileBorderRadiusBottomLeft:gl(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileBorderRadiusTopRight:gl(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileBorderRadiusBottomRight:gl(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:gl(null===(_=e.mobileBoxShadow)||void 0===_?void 0:_.inset)||!1,mobileBoxShadowHOffset:gl(null===(y=e.mobileBoxShadow)||void 0===y?void 0:y.hOffset),mobileBoxShadowVOffset:gl(null===(S=e.mobileBoxShadow)||void 0===S?void 0:S.vOffset),mobileBoxShadowBlurRadius:gl(null===(k=e.mobileBoxShadow)||void 0===k?void 0:k.blurRadius),mobileBoxShadowSpreadRadius:gl(null===(w=e.mobileBoxShadow)||void 0===w?void 0:w.spreadRadius),mobileBoxShadowColor:gl(null===(C=e.mobileBoxShadow)||void 0===C?void 0:C.color),mobileBackgroundColor:gl("none"!==(null===(B=e.mobileBackgroundColor)||void 0===B?void 0:B.value)?null===(x=e.mobileBackgroundColor)||void 0===x?void 0:x.value:""),mobileBackgroundImage:"none"!==e.mobileBackgroundImage[0].value?e.mobileBackgroundImage[0].value:"",mobileBackgroundPositionX:gl(null===(R=e.mobileBackgroundPositionX)||void 0===R?void 0:R.value),mobileBackgroundPositionY:gl(null===(N=e.mobileBackgroundPositionY)||void 0===N?void 0:N.value),mobileBackgroundRepeat:null!==(L=e.mobileBackgroundRepeat)&&void 0!==L&&L.value?null===(I=e.mobileBackgroundRepeat)||void 0===I?void 0:I.value:"none",exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!gl(e.borderRadius.all)&&(gl(e.borderRadius.topLeft)||gl(e.borderRadius.bottomLeft)||gl(e.borderRadius.topRight)||gl(e.borderRadius.bottomRight))?p(!1):p(!0),gl(e.mobileBorderRadius.topLeft)||gl(e.mobileBorderRadius.bottomLeft)||gl(e.mobileBorderRadius.topRight)||gl(e.mobileBorderRadius.bottomRight)?A(!1):A(!0),T(""===e.backgroundImage[0].value),O(!!me),M(!!me||!!ue),W(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),G(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),q(!!e.boxShadow),$(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),K(!(null===(P=e.width)||void 0===P||!P.value)||!(null===(F=e.minWidth)||void 0===F||!F.value)||!(null===(D=e.maxWidth)||void 0===D||!D.value)),J(!!e.mobileWidth.value),te(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),oe(!!e.mobileBackgroundColor.value),re(!!e.exportAsPicture)}},[a,e]);const pe=(0,o.useCallback)(e=>{r(n===V.Tm?(0,H.A9)(e):(0,Xe.A9)(e))},[r,n]);return o.createElement(C.A,{form:a,layout:"vertical",name:"selected_table_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,show:"all",width:{value:"",dim:""},maxWidth:{value:"",dim:""},minWidth:{value:"",dim:""},align:"",mobileAlign:"",border:"",boxShadow:"",borderPosition:Ft[me]||"borderAll",mobileBorderPosition:Mt[ue]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileBackgroundColor:"",mobileBackgroundImage:""},onValuesChange:t=>{const o=a.getFieldsValue(!0),r=Object.keys(t)[0];let n;switch(r){case"exportAsPicture":n={exportAsPicture:o.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":n={boxShadow:{hOffset:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var i,s,d;if("borderAll"===o.borderPosition)n={border:{...V.iV,all:{...Dt,...o.borderAll}}},a.setFieldsValue({borderLeft:Dt,borderRight:Dt,borderTop:Dt,borderBottom:Dt});else null!==(i=o.borderAll)&&void 0!==i&&i.width||null!==(s=o.borderAll)&&void 0!==s&&s.style||null!==(d=o.borderAll)&&void 0!==d&&d.color?(n={border:{all:null,left:o.borderAll,right:o.borderAll,top:o.borderAll,bottom:o.borderAll,[Vt[r]]:{...o[r],...t[r]}}},a.setFieldsValue({borderAll:null,borderLeft:o.borderAll,borderRight:o.borderAll,borderTop:o.borderAll,borderBottom:o.borderAll,[r]:{...o[r],...t[r]}})):(n={border:{all:null,left:o.borderLeft,right:o.borderRight,top:o.borderTop,bottom:o.borderBottom,[Vt[r]]:{...o[r],...t[r]}}},a.setFieldsValue({border:n.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var c,m,u;if("mobileBorderAll"===o.mobileBorderPosition)n={mobileBorder:{...V.iV,all:{...Dt,...o.mobileBorderAll,classNamePrefix:"em-mob-border_"+Wt[r]+"-"}}},a.setFieldsValue({borderLeft:Dt,borderRight:Dt,borderTop:Dt,borderBottom:Dt});else null!==(c=o.mobileBorder.all)&&void 0!==c&&c.width||null!==(m=o.mobileBorder.all)&&void 0!==m&&m.style||null!==(u=o.mobileBorder.all)&&void 0!==u&&u.color?(n={mobileBorder:{all:null,left:o.mobileBorderAll,right:o.mobileBorderAll,top:o.mobileBorderAll,bottom:o.mobileBorderAll,[Wt[r]]:{...o[r],...t[r],classNamePrefix:"em-mob-border_"+Wt[r]+"-"}}},a.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:o.mobileBorderAll,mobileBorderRight:o.mobileBorderAll,mobileBorderTop:o.mobileBorderAll,mobileBorderBottom:o.mobileBorderAll,[r]:{...o[r],...t[r]}})):(n={mobileBorder:{all:null,left:o.mobileBorderLeft,right:o.mobileBorderRight,top:o.mobileBorderTop,bottom:o.mobileBorderBottom,[Wt[r]]:{...o[r],...t[r],classNamePrefix:"em-mob-border_"+Wt[r]+"-"}}},a.setFieldsValue({mobileBorder:n.mobileBorder}));break;case"width":n={[r]:{value:t[r],dim:o.widthDim}};break;case"widthDim":n={width:{value:o.width,dim:t[r]}};break;case"maxWidth":n={[r]:{value:t[r],dim:o.maxWidthDim}};break;case"maxWidthDim":n={maxWidth:{value:o.maxWidth,dim:t[r]}};break;case"minWidth":n={[r]:{value:t[r],dim:o.minWidthDim}};break;case"minWidthDim":n={minWidth:{value:o.minWidth,dim:t[r]}};break;case"backgroundImage":T(""===t[r]),n={[r]:[{...e.backgroundImage[0],value:t[r]}],backgroundSize:"cover"};break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":n={borderRadius:{[Pt[r]]:+t[r]}};break;case"mobileWidth":n={[r]:{classNamePrefix:"em-mob-width-",value:t[r],dim:o.mobileWidthDim}};break;case"mobileWidthDim":n={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[r]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":n={mobileBorderRadius:{[mobileBorderRadiusPosition[r]]:t[r],classNamePrefix:"em-mob-border_radius_"+mobileBorderRadiusPosition[r]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":n={mobileBoxShadow:{hOffset:o.mobileBoxShadowHOffset,vOffset:o.mobileBoxShadowVOffset,blurRadius:o.mobileBoxShadowBlurRadius,spreadRadius:o.mobileBoxShadowSpreadRadius,color:o.mobileBoxShadowColor,inset:o.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileBackgroundColor":n={[r]:{classNamePrefix:"em-mob-background_color-",value:t[r]}};break;case"mobileBackgroundImage":n={[r]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[r]}]};break;case"mobileBackgroundPositionX":n={[r]:{classNamePrefix:"em-mob-background_position_x-",value:t[r]}};break;case"mobileBackgroundPositionY":n={[r]:{classNamePrefix:"em-mob-background_position_x-",value:t[r]}};break;case"mobileBackgroundRepeat":n={[r]:{classNamePrefix:"em-mob-background_repeat-",value:t[r]}};break;case"mobileAlign":n={[r]:{classNamePrefix:"em-mob-table_align-",value:t[r]}};break;default:n=t}var p;"borderPosition"!==r&&"mobileBorderPosition"!==r&&(l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:n}),"mobileBorderRadiusAll"!==r&&"mobileBorderRadiusTopLeft"!==r&&"mobileBorderRadiusTopRight"!==r&&"mobileBorderRadiusBottomLeft"!==r&&"mobileBorderRadiusBottomRight"!==r&&pe({...e,...n,mobileBorderRadius:{...e.mobileBorderRadius,...null===(p=n)||void 0===p?void 0:p.mobileBorderRadius},activateSection:null,changeKey:r}))},autoComplete:"off",className:"element-controls"},!I&&o.createElement(i.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(u.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),S===V.ND&&k.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement("div",{style:{paddingBottom:4}},o.createElement(sa,{form:a,elementSettings:e})),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{J(e=>!e),Q&&(t.mobileWidth="",l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"}}}))})}},Q?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),Q&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Table width"),placement:"left"},o.createElement("div",{style:{marginBottom:R.formItemMarginBottomMD+4}},o.createElement(ra,{form:a,name:"mobileWidth",elementSettings:e})))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{oe(e=>!e),t.mobileBackgroundColor=le?"":"#E5E5E5",l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})})}},le?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),le&&o.createElement("div",{style:{marginBottom:(w.formTableFieldBackgroundImageEnabled,R.formItemMarginBottomMD+4)}},o.createElement(ja,{form:a,elementSettings:e})),!1,w.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{M(e=>!e),F?(t.mobileBorderAll=Dt,t.mobileBorderTop=Dt,t.mobileBorderBottom=Dt,t.mobileBorderRight=Dt,t.mobileBorderLeft=Dt):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})})}},F?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),F&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(St,{form:a,typeOfForm:"mobile"}))),w.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{G(e=>!e),j?(t.mobileBorderRadiusAll=null,A(!0)):t.mobileBorderRadiusAll=5,l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})})}},j?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),j&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(Da,{form:a,oneMobileBorderRadiusValue:_,setOneMobileBorderRadiusValue:A,elementSettings:e}))),w.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{$(e=>!e),X?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})})}},X?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),X&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(Va,{mobileBoxShadow:f,form:a,elementSettings:e}))),w.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(h.A,{gutter:20},o.createElement(b.A,{span:12},o.createElement("div",{style:{paddingBottom:4}},o.createElement(ua,{elementSettings:e,form:a}))))),w.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Aa,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement("div",{style:{paddingBottom:4}},o.createElement(ea,{form:a,elementSettings:e,tooltipTitle:t("The align attribute sets the horizontal alignment of the table.")})),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{K(e=>!e),Z&&(t.width="",t.minWidth="",t.maxWidth="",l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{width:{value:null,dim:"px"},minWidth:{value:null,dim:"px"},maxWidth:{value:null,dim:"px"}}}))})}},Z?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),Z&&o.createElement(o.Fragment,null,o.createElement(i.A,{trigger:["hover"],title:t("Table width"),placement:"left"},o.createElement(C.A.Item,{name:"width",style:{marginBottom:R.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,placeholder:t("Width"),prefix:o.createElement(Ee.A,null),addonAfter:o.createElement(C.A.Item,{name:"widthDim",noStyle:!0},El),style:{width:"100%"}}))),o.createElement(h.A,{gutter:10,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Minimum width"),placement:"left"},o.createElement(C.A.Item,{name:"minWidth"},o.createElement(Lt.A,{min:0,placeholder:t("Table min width"),prefix:o.createElement(z.A,{icon:"MinWidth"}),addonAfter:o.createElement(C.A.Item,{name:"minWidthDim",noStyle:!0},El)})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Maximum width"),placement:"top"},o.createElement(C.A.Item,{name:"maxWidth"},o.createElement(Lt.A,{min:0,placeholder:t("Table max width"),prefix:o.createElement(z.A,{icon:"MaxWidth"}),addonAfter:o.createElement(C.A.Item,{name:"maxWidthDim",noStyle:!0},El)})))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{te(e=>!e),ee?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",T(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})})}},ee?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ee&&o.createElement(h.A,{gutter:10,style:{marginBottom:B?16:0}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(C.A.Item,{name:"backgroundColor",style:{marginBottom:w.formTableFieldBackgroundImageEnabled?R.formItemMarginBottomXS:R.formItemMarginBottomMD+4}},o.createElement(_e,{placeholder:t("Background color"),usedColors:e.usedColors})))),w.formTableFieldBackgroundImageEnabled&&o.createElement(b.A,{span:B?12:24},o.createElement("div",{style:{paddingBottom:B?4:0}},o.createElement(Le,{form:a,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"})),!B&&o.createElement(C.A.Item,{style:{marginBottom:"0"}},o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},o.createElement(C.A.Item,{name:"backgroundPositionX",style:{marginBottom:R.formItemMarginBottomXS}},o.createElement(Lt.A,{placeholder:t("Horizontal position"),prefix:o.createElement(z.A,{icon:"BgPositionHorizontal"})})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},o.createElement(C.A.Item,{name:"backgroundPositionY",style:{marginBottom:R.formItemMarginBottomXS}},o.createElement(Lt.A,{placeholder:t("Vertical position"),prefix:o.createElement(z.A,{icon:"BgPositionVertical"})}))))),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},o.createElement(C.A.Item,{name:"backgroundRepeat",style:{marginBottom:R.formItemMarginBottomMD+4}},o.createElement(x.A,{placeholder:"Please choose",options:ne,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},o.createElement(C.A.Item,{name:"backgroundSize",style:{marginBottom:R.formItemMarginBottomMD+4}},o.createElement(x.A,{placeholder:"Please choose",options:ie,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),w.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{O(e=>!e),P?(t.borderAll=Dt,t.borderTop=Dt,t.borderBottom=Dt,t.borderRight=Dt,t.borderLeft=Dt):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})})}},P?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),P&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(St,{form:a,elementSettings:e}))),w.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{W(e=>!e),D?(t.borderRadiusAll=0,p(!0)):t.borderRadiusAll=5,l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})})}},D?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),D&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(jt,{form:a,oneBorderRadiusValue:m,setOneBorderRadiusValue:p,elementSettings:e}))),w.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{q(e=>!e),U?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})})}},U?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),U&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(oa,{boxShadow:s}))),w.formFieldExportAsPictureEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Export settings"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{re(e=>!e),ae&&(t.exportAsPicture=!1,l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))})}},ae?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ae&&o.createElement(Ha,{form:a,elementSettings:e})),w.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(h.A,{gutter:20},o.createElement(b.A,{span:12},o.createElement("div",{style:{paddingBottom:4}},o.createElement(ua,{elementSettings:e,form:a}))))),w.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Aa,null)))))))};var qa=l(10206);const Xa=({elementSettings:e})=>{const{__:t}=(0,y.s9)(),l=(0,Pe.XW)(),[a]=C.A.useForm(),r=(0,Y.rD)(),n=(0,v.d4)(Ie.Fv),s=(0,v.d4)(Ie.yy),[d,m]=(0,o.useState)({});(0,o.useEffect)(()=>{e&&a.setFieldsValue(e)},[a,e]);return o.createElement(C.A,{form:a,layout:"vertical",name:"selected_link_form",initialValues:{href:"https://",target:"",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textReplacer:""},onValuesChange:t=>{l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:t})},autoComplete:"off",className:"element-controls"},n&&"bottom"!==s?o.createElement(Oa,{form:a,elementSettings:e,showAddParagraph:!1}):o.createElement(o.Fragment,null,o.createElement(i.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"left"},o.createElement(C.A.Item,{name:"href",style:{marginBottom:24,paddingRight:10}},o.createElement(B.A,{allowClear:!0,placeholder:"href",prefix:o.createElement(zt.A,null),onSelect:({target:e})=>{const{selectionStart:t,selectionEnd:l}=e;e&&m({target:e,selection:{start:t,end:l}})}}))),r.formLinkFieldInsertImageEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Actions with the chosen text")),o.createElement(C.A.Item,null,o.createElement(g.Ay,{icon:o.createElement(qa.A,null),onClick:()=>{return e="add_img",void l({operation:V.Ru.SANDBOX_ELEMENT_TEXT,action:e});var e}},t("Add inline image")))),o.createElement(Pa,{form:a,elementSettings:e,showAddParagraph:!1,linkTarget:d})))},$a=({elementSettings:e})=>{const{__:t}=(0,y.s9)(),[l]=C.A.useForm(),a=(0,v.wA)(),r=(0,v.d4)(H.Hs),n=(0,Pe.XW)(),s=(0,v.d4)(Ie.Ct),d=(0,v.d4)(Ie.CS),c=(0,v.d4)(Ie.Fv),m=(0,v.d4)(Ie.yy),p=c&&"bottom"!==m,g=r.hasOwnProperty("type")?V.IE:V.Tm;(0,o.useEffect)(()=>{var t,o,a,r,n,i;e&&l.setFieldsValue({...e,height:null===(t=e.height)||void 0===t?void 0:t.value,heightDim:null===(o=e.height)||void 0===o?void 0:o.dim,mobileHeight:hl((null===(a=e.mobileHeight)||void 0===a?void 0:a.value)||(null===(r=e.height)||void 0===r?void 0:r.value)),mobileHeightDim:(null===(n=e.mobileHeight)||void 0===n?void 0:n.dim)||(null===(i=e.height)||void 0===i?void 0:i.dim)})},[l,e]);const f=(0,o.useCallback)(e=>{a(g===V.Tm?(0,H.A9)(e):(0,Xe.A9)(e))},[a,g]);return o.createElement(C.A,{form:l,layout:"vertical",name:"selected_vindent_form",initialValues:{height:"",heightDim:"",mobileHeight:"",mobileHeightDim:""},onValuesChange:t=>{const o=l.getFieldsValue(!0),a=Object.keys(t)[0];let r;switch(a){case"height":r={[a]:{value:t[a],dim:o.heightDim}};break;case"heightDim":r={height:{value:o.height,dim:t[a]}};break;case"mobileHeight":r={[a]:{classNamePrefix:"em-mob-height-",value:t[a],dim:o.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[a]}};break;default:r=t}n({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r}),f({...e,...r,activateSection:null,changeKey:a})},autoComplete:"off"},!p&&o.createElement(i.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(u.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),s===V.ND&&d.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:s===V.ND&&d.styles?"block":"none",marginBottom:10}},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(h.A,{gutter:10,style:{marginBottom:20}},o.createElement(b.A,{span:12},o.createElement(ia,{form:l,name:"mobileHeight",elementSettings:e}))))):o.createElement("div",{id:"selected_element_form_desktop_props",style:{display:s===V.ND&&d.styles?"none":"block"}},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:14},o.createElement(C.A.Item,{name:"height"},o.createElement(Lt.A,{min:0,placeholder:t("Indent height"),prefix:o.createElement($o.A,null),addonAfter:"px"})))))))};var Za=l(50078),Ya=l(35850);const Ka=({form:e,elementSettings:t})=>{const{__:l}=(0,y.s9)(),a=(0,Pe.XW)(),[r,n]=(0,o.useState)(t.direction),d=l=>{const o=l.target.value,i={direction:""};o!==r?n(o):(n(""),e.setFieldsValue(i),a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return o.createElement(C.A.Item,{name:"direction"},o.createElement(mt.Ay.Group,null,o.createElement(s.A,{size:8},o.createElement(i.A,{placement:"top",title:l("Right to left")},o.createElement(mt.Ay.Button,{value:"rtl",onClick:d},o.createElement(Za.A,null))),o.createElement(i.A,{placement:"top",title:l("Left to right")},o.createElement(mt.Ay.Button,{value:"ltr",onClick:d},o.createElement(Ya.A,null))))))},{useToken:Qa}=r.A,Ja=({form:e,elementSettings:t,mobilePaddingsExt:l,setMobilePaddingsExt:a})=>{const{__:r}=(0,y.s9)(),{token:n}=Qa(),s=(0,Pe.XW)();return o.createElement(o.Fragment,null,o.createElement(b.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:l?"block":"none"}},o.createElement(i.A,{title:r("Horizontal padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"mobilePaddingLeftRight"},o.createElement(Lt.A,{min:0,placeholder:r("Horizontal"),prefix:o.createElement(z.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:l?"none":"block"}},o.createElement(i.A,{trigger:["hover"],title:r("Left padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"mobilePaddingLeft",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,placeholder:r("Left"),prefix:o.createElement(z.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(i.A,{trigger:["hover"],title:r("Right padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"mobilePaddingRight"},o.createElement(Lt.A,{min:0,placeholder:r("Right"),prefix:o.createElement(z.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(b.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:l?"block":"none"}},o.createElement(i.A,{title:r("Vertical padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"mobilePaddingTopBottom"},o.createElement(Lt.A,{min:0,placeholder:r("Vertical"),prefix:o.createElement(z.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:l?"none":"block"}},o.createElement(i.A,{trigger:["hover"],title:r("Top padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"mobilePaddingTop",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,placeholder:r("Top"),prefix:o.createElement(z.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(i.A,{trigger:["hover"],title:r("Bottom padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"mobilePaddingBottom"},o.createElement(Lt.A,{min:0,placeholder:r("Bottom"),prefix:o.createElement(z.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(b.A,{span:4,style:{width:45,flex:"auto",maxWidth:"none"}},o.createElement(i.A,{title:r("Individual padding"),placement:"bottom"},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!l}),onClick:()=>{a(e=>!e);const o=e.getFieldsValue(!0);l||(o.mobilePaddingLeftRight=o.mobilePaddingLeft,o.mobilePaddingTopBottom=o.mobilePaddingTop,o.mobilePaddingRight=o.mobilePaddingLeft,o.mobilePaddingBottom=o.mobilePaddingTop,s({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobilePadding:{top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,bottom:""!==o.mobilePaddingTopBottom?o.mobilePaddingTopBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,classNamePrefix:"em-mob-padding_"}}}))}},o.createElement(z.A,{icon:"PaddingSwitcher"})))))},er=({form:e,elementSettings:t})=>{var l;const{__:a}=(0,y.s9)(),[r,n]=(0,o.useState)(null===(l=t.mobileDirection)||void 0===l?void 0:l.value),d=(0,Pe.XW)(),c=l=>{const o=l.target.value,a={mobileDirection:{classNamePrefix:"em-mob-direction-",value:""}};o!==r?n(o):(n(""),e.setFieldsValue(a),d({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return o.createElement(C.A.Item,{name:"mobileDirection"},o.createElement(mt.Ay.Group,null,o.createElement(s.A,{size:8},o.createElement(i.A,{placement:"top",title:a("Right to left")},o.createElement(mt.Ay.Button,{value:"rtl",onClick:c},o.createElement(Za.A,null))),o.createElement(i.A,{placement:"top",title:a("Left to right")},o.createElement(mt.Ay.Button,{value:"ltr",onClick:c},o.createElement(Ya.A,null))))))};var tr=l(31876);const{Option:lr}=x.A,or=({options:e,position:t,setPosition:l,unit:a,setUnit:r,placeholder:n="",prefix:i="",dropdownStyle:d})=>{const c=(0,o.useCallback)(t=>{if(!t)return!0;if(p(t)){return parseFloat(t)>=0}if(e&&e.length>0){return e.map(e=>"string"===typeof e?e:e.value).some(e=>String(e).toLowerCase().includes(t.toLowerCase()))}return!0},[e]),m=(0,o.useCallback)(e=>{c(e)&&l(e)},[l,c]),u=(0,o.useCallback)(e=>{r(e)},[r]),p=e=>!!e&&(!isNaN(parseFloat(e))&&isFinite(parseFloat(e))),g={width:p(t)?"66%":"100%",height:34},h=(0,o.useCallback)((e,t)=>{var l;if(p(e)){var o;const e=String(null!==(o=null===t||void 0===t?void 0:t.value)&&void 0!==o?o:"");return p(e)&&parseFloat(e)>=0}return String(null!==(l=null===t||void 0===t?void 0:t.value)&&void 0!==l?l:"").toUpperCase().includes(e.toUpperCase())},[]),b=(0,o.useCallback)(e=>e.parentNode,[]),f=null!==e&&void 0!==e?e:[];return o.createElement(s.A.Compact,null,o.createElement(tr.A,{className:"custom-autocomplete",onChange:m,options:f,style:g,filterOption:h,getPopupContainer:b,value:t,dropdownStyle:d},o.createElement(B.A,{value:t,placeholder:n,prefix:i,onKeyDown:t=>{if(!["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Enter","Home","End"].includes(t.key)&&!/[\d.]/.test(t.key))if(e&&e.length>0){e.some(e=>{const l="string"===typeof e?e:e.value;return String(l).toLowerCase().includes(t.key.toLowerCase())})||t.preventDefault()}else t.preventDefault()}})),p(t)&&o.createElement(x.A,{className:"select-after",style:{width:"34%"},value:a,onChange:u,getPopupContainer:b},o.createElement(lr,{value:"px"},"px"),o.createElement(lr,{value:"%"},"%")))},ar={horizontal:[{value:"left",label:"left"},{value:"center",label:"center"},{value:"right",label:"right"}],vertical:[{value:"top",label:"top"},{value:"center",label:"center"},{value:"bottom",label:"bottom"}]},rr=({form:e,backgroundImageEmpty:t,appConfig:l,token:a,elementSettings:r,backgroundRepeatOptions:n,handleChangeValues:s})=>{const{__:d}=(0,y.s9)(),[c,m]=(0,o.useState)(""),[u,p]=(0,o.useState)("px"),[g,f]=(0,o.useState)(""),[E,v]=(0,o.useState)("px"),_=[{label:d("Not defined"),value:""},{label:d("Contain"),value:"contain"},{label:d("Cover"),value:"cover"}],A=e=>{if(!e||"string"!==typeof e)return{value:"",unit:"px"};const t=(e=e.trim()).match(/^(\d*\.?\d+)(%|px)$/);if(t){return{value:t[1],unit:t[2]}}return{value:e,unit:"px"}};(0,o.useEffect)(()=>{const t=e.getFieldValue("backgroundPositionX"),l=e.getFieldValue("backgroundPositionY"),o=A(t),a=A(l);m(String(o.value)),p(o.unit),f(String(a.value)),v(a.unit)},[e]);const S=(e,t)=>{m(String(e)),p(t),s&&s({backgroundPositionX:{position:e,unit:t}})},k=(e,t)=>{f(String(e)),v(t),s&&s({backgroundPositionY:{position:e,unit:t}})};return o.createElement(h.A,{gutter:10,style:{marginBottom:t?16:0}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:d("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(C.A.Item,{name:"backgroundColor",style:{marginBottom:l.formCellFieldBackgroundImageEnabled?a.formItemMarginBottomXS:a.formItemMarginBottomMD+4}},o.createElement(_e,{placeholder:d("Background color"),usedColors:r.usedColors})))),l.formCellFieldBackgroundImageEnabled&&o.createElement(b.A,{span:t?12:24},o.createElement(Le,{form:e,label:d("Background image"),name:"backgroundImage",tooltipTitle:d("Background image"),placeholder:"Background image link/route"}),!t&&o.createElement(C.A.Item,{style:{marginBottom:"0"}},o.createElement(h.A,{gutter:10,style:{marginBottom:a.formItemMarginBottomXS}},o.createElement(b.A,{span:12},o.createElement(or,{options:ar.horizontal,position:c,setPosition:e=>S(e,u),unit:u,setUnit:e=>S(c,e),placeholder:d("Horizontal position"),prefix:o.createElement(z.A,{icon:"BgPositionHorizontal"}),dropdownStyle:{bottom:"auto"}})),o.createElement(b.A,{span:12},o.createElement(or,{options:ar.vertical,position:g,setPosition:e=>k(e,E),unit:E,setUnit:e=>k(g,e),placeholder:d("Vertical position"),prefix:o.createElement(z.A,{icon:"BgPositionVertical"}),dropdownStyle:{bottom:"auto"}}))),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:d("Background image repeat"),placement:"top"},o.createElement(C.A.Item,{name:"backgroundRepeat",style:{marginBottom:a.formItemMarginBottomMD+4}},o.createElement(x.A,{placeholder:d("Please choose"),options:n,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:d("Background image size"),placement:"top"},o.createElement(C.A.Item,{name:"backgroundSize",style:{marginBottom:a.formItemMarginBottomMD+4}},o.createElement(x.A,{placeholder:d("Please choose"),options:_,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")}))))))))},{useToken:nr}=r.A,ir=({elementSettings:e})=>{const{__:t}=(0,y.s9)(),l=(0,Pe.XW)(),a=(0,v.wA)(),[r]=C.A.useForm(),[n,d]=(0,o.useState)(""),[m,p]=(0,o.useState)({}),[E,_]=(0,o.useState)(!0),[A,S]=(0,o.useState)(!0),w=(0,v.d4)(Ie.Ct),B=(0,v.d4)(Ie.CS),x=(0,v.d4)(H.Hs),T=(0,Y.rD)(),[R,N]=(0,o.useState)(""===e.backgroundImage[0].value),{token:L}=nr(),I=(0,v.d4)(Ie.Fv),P=(0,v.d4)(Ie.yy),O=I&&"bottom"!==P,[F,M]=(0,o.useState)(!1),[D,W]=(0,o.useState)(!1),[j,G]=(0,o.useState)(!1),[U,q]=(0,o.useState)(!1),[X,$]=(0,o.useState)(!1),[Z,K]=(0,o.useState)(!1),[Q,J]=(0,o.useState)(!1),[ee,te]=(0,o.useState)(!1),[le,oe]=(0,o.useState)(!1),[ae,re]=(0,o.useState)(!1),[ne,ie]=(0,o.useState)(!1),[se,de]=(0,o.useState)(!1),[ce,me]=(0,o.useState)(!1),[ue,pe]=(0,o.useState)(!1),ge=x.hasOwnProperty("type")?V.IE:V.Tm,he=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],be=e.border,fe=e.mobileBorder,ve=Object.keys(be).find(e=>{var t,l,o;return(null===(t=be[e])||void 0===t?void 0:t.width)||(null===(l=be[e])||void 0===l?void 0:l.style)||(null===(o=be[e])||void 0===o?void 0:o.color)}),_e=Object.keys(fe).find(e=>{var t,l,o;return(null===(t=fe[e])||void 0===t?void 0:t.width)||(null===(l=fe[e])||void 0===l?void 0:l.style)||(null===(o=fe[e])||void 0===o?void 0:o.color)}),ye=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)(()=>{if(e){var t,l,o,a,n,i,s,d,c,m,u,g,h,b,f,E,v,y,A,k,w,C,B,x,T,R,L,I,P,O,F,D,V,j,z,H,U,X,Z,Y,Q,ee,le,ae,ne,se,ce,ue,ge,he,be,fe,Ee,Ae,Se,ke,we,Ce,Be,xe,Te,Re,Ne,Le,Ie,Pe,Oe,Fe,Me,De,Ve,We,je,ze,He,Ge,Ue,qe,Xe,$e,Ze,Ye,Ke,Qe,Je,et,tt,lt,ot,at,rt,nt,it,st;const dt=e.boxShadow;p(dt),r.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.value,heightDim:null===(a=e.height)||void 0===a?void 0:a.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",isContrastBlock:e.isContrastBlock,borderAll:gl(e.border.all),borderTop:gl(e.border.top),borderBottom:gl(e.border.bottom),borderRight:gl(e.border.right),borderLeft:gl(e.border.left),mobileBorderAll:ye(e.mobileBorder.all)||!(ye(e.mobileBorder.top)||ye(e.mobileBorder.bottom)||ye(e.mobileBorder.right)||ye(e.mobileBorder.left))&&ye(e.border.all),mobileBorderTop:ye(e.mobileBorder.top)||!ye(e.mobileBorder.all)&&ye(e.border.top),mobileBorderBottom:ye(e.mobileBorder.bottom)||!ye(e.mobileBorder.all)&&ye(e.border.bottom),mobileBorderRight:ye(e.mobileBorder.right)||!ye(e.mobileBorder.all)&&ye(e.border.right),mobileBorderLeft:ye(e.mobileBorder.left)||!ye(e.mobileBorder.all)&&ye(e.border.left),paddingTop:gl(null===(n=e.padding)||void 0===n?void 0:n.all)||gl(null===(i=e.padding)||void 0===i?void 0:i.top),paddingLeft:gl(null===(s=e.padding)||void 0===s?void 0:s.all)||gl(null===(d=e.padding)||void 0===d?void 0:d.left),paddingRight:gl(null===(c=e.padding)||void 0===c?void 0:c.all)||gl(null===(m=e.padding)||void 0===m?void 0:m.right),paddingBottom:gl(null===(u=e.padding)||void 0===u?void 0:u.all)||gl(null===(g=e.padding)||void 0===g?void 0:g.bottom),paddingLeftRight:gl(null===(h=e.padding)||void 0===h?void 0:h.left)||gl(null===(b=e.padding)||void 0===b?void 0:b.right),paddingTopBottom:gl(null===(f=e.padding)||void 0===f?void 0:f.top)||gl(null===(E=e.padding)||void 0===E?void 0:E.bottom),borderRadiusAll:gl(e.borderRadius.all),borderRadiusTopLeft:gl(e.borderRadius.topLeft),borderRadiusBottomLeft:gl(e.borderRadius.bottomLeft),borderRadiusTopRight:gl(e.borderRadius.topRight),borderRadiusBottomRight:gl(e.borderRadius.bottomRight),boxShadowInset:gl(null===(v=e.boxShadow)||void 0===v?void 0:v.inset)||!1,boxShadowHOffset:gl(null===(y=e.boxShadow)||void 0===y?void 0:y.hOffset),boxShadowVOffset:gl(null===(A=e.boxShadow)||void 0===A?void 0:A.vOffset),boxShadowBlurRadius:gl(null===(k=e.boxShadow)||void 0===k?void 0:k.blurRadius),boxShadowSpreadRadius:gl(null===(w=e.boxShadow)||void 0===w?void 0:w.spreadRadius),boxShadowColor:gl(null===(C=e.boxShadow)||void 0===C?void 0:C.color),mobileWidth:hl(null===(B=e.mobileWidth)||void 0===B?void 0:B.value)||hl(null===(x=e.width)||void 0===x?void 0:x.value),mobileWidthDim:hl(null===(T=e.mobileWidth)||void 0===T?void 0:T.value)?null===(R=e.mobileWidth)||void 0===R?void 0:R.dim:null===(L=e.width)||void 0===L?void 0:L.dim,mobileHeight:hl(null===(I=e.mobileHeight)||void 0===I?void 0:I.value)||hl(null===(P=e.height)||void 0===P?void 0:P.value),mobileHeightDim:hl(null===(O=e.mobileHeight)||void 0===O?void 0:O.value)?null===(F=e.mobileHeight)||void 0===F?void 0:F.dim:null===(D=e.height)||void 0===D?void 0:D.dim,mobileBorderRadiusAll:gl(null===(V=e.mobileBorderRadius)||void 0===V?void 0:V.all)||gl(null===(j=e.borderRadius)||void 0===j?void 0:j.all),mobileBorderRadiusTopLeft:gl(null===(z=e.mobileBorderRadius)||void 0===z?void 0:z.topLeft)||gl(null===(H=e.mobileBorderRadius)||void 0===H?void 0:H.all)||gl(null===(U=e.borderRadius)||void 0===U?void 0:U.topLeft)||gl(null===(X=e.borderRadius)||void 0===X?void 0:X.all),mobileBorderRadiusBottomLeft:gl(null===(Z=e.mobileBorderRadius)||void 0===Z?void 0:Z.bottomLeft)||gl(null===(Y=e.mobileBorderRadius)||void 0===Y?void 0:Y.all)||gl(null===(Q=e.borderRadius)||void 0===Q?void 0:Q.bottomLeft)||gl(null===(ee=e.borderRadius)||void 0===ee?void 0:ee.all),mobileBorderRadiusTopRight:gl(null===(le=e.mobileBorderRadius)||void 0===le?void 0:le.topRight)||gl(null===(ae=e.mobileBorderRadius)||void 0===ae?void 0:ae.all)||gl(null===(ne=e.borderRadius)||void 0===ne?void 0:ne.topRight)||gl(null===(se=e.borderRadius)||void 0===se?void 0:se.all),mobileBorderRadiusBottomRight:gl(null===(ce=e.mobileBorderRadius)||void 0===ce?void 0:ce.bottomRight)||gl(null===(ue=e.mobileBorderRadius)||void 0===ue?void 0:ue.all)||gl(null===(ge=e.borderRadius)||void 0===ge?void 0:ge.bottomRight)||gl(null===(he=e.borderRadius)||void 0===he?void 0:he.all),mobileBoxShadowInset:null!=(null===(be=e.mobileBoxShadow)||void 0===be?void 0:be.inset)?e.mobileBoxShadow.inset:(null===(fe=e.boxShadow)||void 0===fe?void 0:fe.inset)||!1,mobileBoxShadowHOffset:gl(null===(Ee=e.mobileBoxShadow)||void 0===Ee?void 0:Ee.hOffset)||gl(null===(Ae=e.boxShadow)||void 0===Ae?void 0:Ae.hOffset),mobileBoxShadowVOffset:gl(null===(Se=e.mobileBoxShadow)||void 0===Se?void 0:Se.vOffset)||gl(null===(ke=e.boxShadow)||void 0===ke?void 0:ke.vOffset),mobileBoxShadowBlurRadius:gl(null===(we=e.mobileBoxShadow)||void 0===we?void 0:we.blurRadius)||gl(null===(Ce=e.boxShadow)||void 0===Ce?void 0:Ce.blurRadius),mobileBoxShadowSpreadRadius:gl(null===(Be=e.mobileBoxShadow)||void 0===Be?void 0:Be.spreadRadius)||gl(null===(xe=e.boxShadow)||void 0===xe?void 0:xe.spreadRadius),mobileBoxShadowColor:gl(null===(Te=e.mobileBoxShadow)||void 0===Te?void 0:Te.color)||gl(null===(Re=e.boxShadow)||void 0===Re?void 0:Re.color),mobileAlign:gl(null===(Ne=e.mobileAlign)||void 0===Ne?void 0:Ne.value)||e.align,mobileVerticalAlign:gl((null===(Le=e.mobileVerticalAlign)||void 0===Le?void 0:Le.value)||e.valign),mobileBackgroundColor:gl((null===(Ie=e.mobileBackgroundColor)||void 0===Ie?void 0:Ie.value)||e.backgroundColor||""),mobileBackgroundImage:"none"!==(null===(Pe=e.mobileBackgroundImage[0])||void 0===Pe?void 0:Pe.value)?null===(Oe=e.mobileBackgroundImage[0])||void 0===Oe?void 0:Oe.value:(null===(Fe=e.backgroundImage)||void 0===Fe?void 0:Fe[0].value)||"",mobileBackgroundPositionX:gl(null===(Me=e.mobileBackgroundPositionX)||void 0===Me?void 0:Me.value)||gl(null===(De=e.backgroundPositionX)||void 0===De?void 0:De.value),mobileBackgroundPositionY:gl(null===(Ve=e.mobileBackgroundPositionY)||void 0===Ve?void 0:Ve.value)||gl(null===(We=e.backgroundPositionY)||void 0===We?void 0:We.value),mobileBackgroundRepeat:!(null===(je=e.mobileBackgroundRepeat)||void 0===je||!je.value)||e.backgroundRepeat||"none",mobilePaddingTop:gl(e.mobilePadding.all)||gl(e.mobilePadding.top)||gl(null===(ze=e.padding)||void 0===ze?void 0:ze.all)||gl(null===(He=e.padding)||void 0===He?void 0:He.top),mobilePaddingLeft:gl(e.mobilePadding.all)||gl(e.mobilePadding.left)||gl(null===(Ge=e.padding)||void 0===Ge?void 0:Ge.all)||gl(null===(Ue=e.padding)||void 0===Ue?void 0:Ue.left),mobilePaddingRight:gl(e.mobilePadding.all)||gl(e.mobilePadding.right)||gl(null===(qe=e.padding)||void 0===qe?void 0:qe.all)||gl(null===(Xe=e.padding)||void 0===Xe?void 0:Xe.right),mobilePaddingBottom:gl(e.mobilePadding.all)||gl(e.mobilePadding.bottom)||gl(null===($e=e.padding)||void 0===$e?void 0:$e.all)||gl(null===(Ze=e.padding)||void 0===Ze?void 0:Ze.bottom),mobilePaddingTopBottom:gl(e.mobilePadding.top)||gl(e.mobilePadding.bottom)||gl(null===(Ye=e.padding)||void 0===Ye?void 0:Ye.top)||gl(null===(Ke=e.padding)||void 0===Ke?void 0:Ke.bottom),mobilePaddingLeftRight:gl(e.mobilePadding.left)||gl(e.mobilePadding.right)||gl(null===(Qe=e.padding)||void 0===Qe?void 0:Qe.left)||gl(null===(Je=e.padding)||void 0===Je?void 0:Je.right),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!gl(e.borderRadius.all)&&(gl(e.borderRadius.topLeft)||gl(e.borderRadius.bottomLeft)||gl(e.borderRadius.topRight)||gl(e.borderRadius.bottomRight))?_(!1):_(!0),!gl(e.mobileBorderRadius.all)&&(gl(e.mobileBorderRadius.topLeft)||gl(e.mobileBorderRadius.bottomLeft)||gl(e.mobileBorderRadius.topRight)||gl(e.mobileBorderRadius.bottomRight))||gl(e.mobileBorderRadius.all)&&(gl(e.mobileBorderRadius.topLeft)||gl(e.mobileBorderRadius.bottomLeft)||gl(e.mobileBorderRadius.topRight)||gl(e.mobileBorderRadius.bottomRight))||!gl(e.borderRadius.all)&&!gl(e.mobileBorderRadius.all)&&(gl(e.borderRadius.topLeft)||gl(e.borderRadius.bottomLeft)||gl(e.borderRadius.topRight)||gl(e.borderRadius.bottomRight))?S(!1):S(!0),N(""===e.backgroundImage[0].value),gl(e.padding.all)||!(gl(e.padding.top)||gl(e.padding.right)||gl(e.padding.bottom)||gl(e.padding.left))||e.padding.top===e.padding.bottom&&e.padding.right===e.padding.left?M(!0):M(!1),!gl(e.mobilePadding.all)&&(gl(e.mobilePadding.top)||gl(e.mobilePadding.right)||gl(e.mobilePadding.bottom)||gl(e.mobilePadding.left))&&(e.mobilePadding.top!==e.mobilePadding.bottom||e.mobilePadding.right!==e.mobilePadding.left)||!gl(null===(et=e.padding)||void 0===et?void 0:et.all)&&(gl(null===(tt=e.padding)||void 0===tt?void 0:tt.top)||gl(null===(lt=e.padding)||void 0===lt?void 0:lt.right)||gl(null===(ot=e.padding)||void 0===ot?void 0:ot.bottom)||gl(null===(at=e.padding)||void 0===at?void 0:at.left))&&((null===(rt=e.padding)||void 0===rt?void 0:rt.top)!==(null===(nt=e.padding)||void 0===nt?void 0:nt.bottom)||(null===(it=e.padding)||void 0===it?void 0:it.right)!==(null===(st=e.padding)||void 0===st?void 0:st.left))?W(!1):W(!0),G(!!ve),q(!!ve||!!_e),$(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),K(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight||!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),J(!!e.boxShadow),te(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset||!!e.boxShadow),oe(!!e.width.value&&"column"!==e.type||!!e.height.value),re(!!e.mobileWidth.value||!!e.mobileHeight.value||!!e.width.value&&"column"!==e.type||!!e.height.value),ie(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),de(!!e.mobileBackgroundColor.value||!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),me(!!e.exportAsPicture||!!e.isContrastBlock),pe(!!e.mobilePadding.all||0===e.mobilePadding.all||!!e.mobilePadding.top||0===e.mobilePadding.top||!!e.mobilePadding.bottom||0===e.mobilePadding.bottom||!!e.mobilePadding.left||0===e.mobilePadding.left||!!e.mobilePadding.right||0===e.mobilePadding.right||!!e.padding.all||0===e.padding.all||!!e.padding.top||0===e.padding.top||!!e.padding.bottom||0===e.padding.bottom||!!e.padding.left||0===e.padding.left||!!e.padding.right||0===e.padding.right)}},[r,e]);const Ae=(0,o.useCallback)(e=>{a(ge===V.Tm?(0,H.A9)(e):(0,Xe.A9)(e))},[a,ge]),Se=t=>{const o=r.getFieldsValue(!0),a=Object.keys(t)[0];let n;switch(d("%"===r.getFieldsValue(!0).widthDim?100:""),a){case"exportAsPicture":n={exportAsPicture:o.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":n={boxShadow:{hOffset:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var i,s,c;if("borderAll"===o.borderPosition)n={border:{...V.iV,all:{...Dt,...o.borderAll}}},r.setFieldsValue({borderLeft:Dt,borderRight:Dt,borderTop:Dt,borderBottom:Dt});else null!==(i=o.borderAll)&&void 0!==i&&i.width||null!==(s=o.borderAll)&&void 0!==s&&s.style||null!==(c=o.borderAll)&&void 0!==c&&c.color?(n={border:{all:null,left:o.borderAll,right:o.borderAll,top:o.borderAll,bottom:o.borderAll,[Vt[a]]:{...o[a],...t[a]}}},r.setFieldsValue({borderAll:null,borderLeft:o.borderAll,borderRight:o.borderAll,borderTop:o.borderAll,borderBottom:o.borderAll,[a]:{...o[a],...t[a]}})):(n={border:{all:null,left:o.borderLeft,right:o.borderRight,top:o.borderTop,bottom:o.borderBottom,[Vt[a]]:{...o[a],...t[a]}}},r.setFieldsValue({border:n.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var m,u,p;if("mobileBorderAll"===o.mobileBorderPosition)n={mobileBorder:{...V.iV,all:{...Dt,...o.mobileBorderAll,classNamePrefix:"em-mob-border_"+Wt[a]+"-"}}},r.setFieldsValue({borderLeft:Dt,borderRight:Dt,borderTop:Dt,borderBottom:Dt});else null!==(m=o.mobileBorder.all)&&void 0!==m&&m.width||null!==(u=o.mobileBorder.all)&&void 0!==u&&u.style||null!==(p=o.mobileBorder.all)&&void 0!==p&&p.color?(n={mobileBorder:{all:null,left:o.mobileBorderAll,right:o.mobileBorderAll,top:o.mobileBorderAll,bottom:o.mobileBorderAll,[Wt[a]]:{...o[a],...t[a],classNamePrefix:"em-mob-border_"+Wt[a]+"-"}}},r.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:o.mobileBorderAll,mobileBorderRight:o.mobileBorderAll,mobileBorderTop:o.mobileBorderAll,mobileBorderBottom:o.mobileBorderAll,[a]:{...o[a],...t[a]}})):(n={mobileBorder:{all:null,left:o.mobileBorderLeft,right:o.mobileBorderRight,top:o.mobileBorderTop,bottom:o.mobileBorderBottom,[Wt[a]]:{...o[a],...t[a],classNamePrefix:"em-mob-border_"+Wt[a]+"-"}}},r.setFieldsValue({mobileBorder:n.mobileBorder}));break;case"width":n={[a]:{value:t[a],dim:o.widthDim}};break;case"height":n={[a]:{value:t[a],dim:o.heightDim}};break;case"widthDim":n={width:{value:o.width,dim:t[a]}};break;case"heightDim":n={height:{value:o.height,dim:t[a]}};break;case"backgroundImage":N(""===t[a]),n={[a]:[{...e.backgroundImage[0],value:t[a]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":n={padding:{left:o.paddingLeft,right:o.paddingRight,top:o.paddingTop,bottom:o.paddingBottom,[It[a]]:+t[a]}};break;case"paddingTopBottom":n={padding:{left:o.paddingLeft,right:o.paddingRight,top:+t[a],bottom:+t[a]}},o.paddingTop=o.paddingBottom=+t[a];break;case"paddingLeftRight":n={padding:{top:o.paddingTop,bottom:o.paddingBottom,left:+t[a],right:+t[a]}},o.paddingLeft=o.paddingRight=+t[a];break;case"borderRadiusAll":n={borderRadius:{[Pt[a]]:+t[a]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":n={borderRadius:{topLeft:o.borderRadiusTopLeft,bottomLeft:o.borderRadiusBottomLeft,topRight:o.borderRadiusTopRight,bottomRight:o.borderRadiusBottomRight,[Pt[a]]:+t[a]}};break;case"mobileWidth":n={[a]:{classNamePrefix:"em-mob-width-",value:t[a],dim:o.mobileWidthDim}};break;case"mobileWidthDim":n={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[a]}};break;case"mobileHeight":n={[a]:{classNamePrefix:"em-mob-height-",value:t[a],dim:o.mobileHeightDim}};break;case"mobileHeightDim":n={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[a]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":n={mobileBorderRadius:{[Ot[a]]:t[a],classNamePrefix:"em-mob-border_radius_"+Ot[a]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":n={mobileBoxShadow:{hOffset:o.mobileBoxShadowHOffset,vOffset:o.mobileBoxShadowVOffset,blurRadius:o.mobileBoxShadowBlurRadius,spreadRadius:o.mobileBoxShadowSpreadRadius,color:o.mobileBoxShadowColor,inset:o.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":n={[a]:{classNamePrefix:"em-mob-text_align-",value:t[a]}};break;case"mobileVerticalAlign":n={[a]:{classNamePrefix:"em-mob-vertical_align-",value:t[a]}};break;case"mobileBackgroundColor":n={[a]:{classNamePrefix:"em-mob-background_color-",value:t[a]}};break;case"mobileBackgroundImage":n={[a]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[a]}]};break;case"mobileBackgroundPositionX":n={[a]:{classNamePrefix:"em-mob-background_position_x-",value:t[a]}};break;case"mobileBackgroundPositionY":n={[a]:{classNamePrefix:"em-mob-background_position_y-",value:t[a]}};break;case"mobileBackgroundRepeat":n={[a]:{classNamePrefix:"em-mob-background_repeat-",value:t[a]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":n={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":o.mobilePaddingTop=o.mobilePaddingBottom=t[a],n={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":o.mobilePaddingLeft=o.mobilePaddingRight=t[a],n={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"backgroundPositionX":case"backgroundPositionY":n={[a]:isNaN(parseFloat(t[a].position))?t[a].position:t[a].position+t[a].unit};break;default:n=t}var g;"borderPosition"!==a&&"mobileBorderPosition"!==a&&(l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:n}),"mobileBorderRadiusAll"!==a&&"mobileBorderRadiusTopLeft"!==a&&"mobileBorderRadiusTopRight"!==a&&"mobileBorderRadiusBottomLeft"!==a&&"mobileBorderRadiusBottomRight"!==a&&Ae({...e,...n,mobileBorderRadius:{...e.mobileBorderRadius,...null===(g=n)||void 0===g?void 0:g.mobileBorderRadius},activateSection:null,changeKey:a}))};return o.createElement(C.A,{form:r,layout:"vertical",name:"selected_td_form",initialValues:{horizontalPosition:"",horizontalUnit:"px",backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",align:"",valign:"",border:"",show:"all",borderPosition:Ft[ve]||"borderAll",mobileBorderPosition:Mt[_e]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",boxShadowInset:"",boxShadowHOffset:"",boxShadowVOffset:"",boxShadowBlurRadius:"",boxShadowSpreadRadius:"",boxShadowColor:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1},onValuesChange:Se,autoComplete:"off",className:"element-controls"},!O&&o.createElement(i.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(u.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),w===V.ND&&B.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:w===V.ND&&B.styles?"block":"none"}},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(h.A,{gutter:20},o.createElement(b.A,{span:12},o.createElement(sa,{form:r,elementSettings:e,imgParent:!0})),T.formCellFieldVerticalAlignEnabled&&"group"!==e.type&&("structure"!==e.type||"structure"===e.type&&1===e.floatBlocks.items.length)&&o.createElement(b.A,{span:12,style:{textAlign:"right"}},o.createElement(da,{form:r,elementSettings:e}))),o.createElement(c.A,{className:"selected-td-form__divider"}),T.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Padding"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{pe(e=>!e),ue&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))})}},ue?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ue&&o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(o.Fragment,null,o.createElement(Ja,{form:r,elementSettings:e,mobilePaddingsExt:D,setMobilePaddingsExt:W}))),o.createElement(c.A,{className:"selected-td-form__divider"})),"group"!==e.type&&T.formCellFieldSizeEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{re(e=>!e),ae&&(t.mobileWidth="",t.mobileHeight="",l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))})}},ae?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ae&&o.createElement(h.A,{gutter:10,style:{paddingBottom:9}},"structure"!==e.type&&o.createElement(b.A,{span:12},o.createElement("div",{style:{marginBottom:15}},o.createElement(ra,{form:r,name:"mobileWidth",elementSettings:e}))),o.createElement(b.A,{span:12},o.createElement("div",{style:{marginBottom:15}},o.createElement(ia,{form:r,name:"mobileHeight",elementSettings:e})))),o.createElement(c.A,{className:"selected-td-form__divider"})),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{de(e=>!e),t.mobileBackgroundColor=se?"":"#E5E5E5",l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})})}},se?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),se&&o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:(T.formCellFieldBackgroundImageEnabled,L.formItemMarginBottomMD+4)}},o.createElement(ja,{form:r,elementSettings:e,label:t("Background color")}))),!1,T.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{q(e=>!e),U?(t.mobileBorderAll=Dt,t.mobileBorderTop=Dt,t.mobileBorderBottom=Dt,t.mobileBorderRight=Dt,t.mobileBorderLeft=Dt):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})})}},U?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),U&&o.createElement("div",{style:{marginBottom:4}},o.createElement(St,{form:r,typeOfForm:"mobile"}))),T.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{K(e=>!e),Z?(t.mobileBorderRadiusAll=null,S(!0)):t.mobileBorderRadiusAll=5,l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})})}},Z?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),Z&&o.createElement("div",{style:{marginBottom:4}},o.createElement(jt,{form:r,oneBorderRadiusValue:A,setOneBorderRadiusValue:S,elementSettings:e,typeOfForm:"mobile"}))),T.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{te(e=>!e),ee?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})})}},ee?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ee&&o.createElement("div",{style:{marginBottom:4}},o.createElement(oa,{boxShadow:m,typeOfForm:"mobile"}))),T.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("group"!==e.type?"Display control & Direction":"Display control")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(ua,{elementSettings:e,form:r})),"group"!==e.type&&o.createElement(b.A,{span:12,style:{textAlign:"group"!==e.type?"right":"left"}},o.createElement(er,{elementSettings:e,form:r})))),T.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Aa,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(ut,{form:r,elementSettings:e})),T.formCellFieldVerticalAlignEnabled&&"group"!==e.type&&("structure"!==e.type||"structure"===e.type&&1===e.floatBlocks.items.length)&&o.createElement(b.A,{span:12,style:{textAlign:"right"}},o.createElement(ta,{form:r,elementSettings:e}))),o.createElement(c.A,{className:"selected-td-form__divider"}),T.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement("div",{className:"form-group-title"},t("Padding")),o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(o.Fragment,null,"group"!==e.type&&"column"!==e.type&&o.createElement(b.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:F?"block":"none"}},o.createElement(i.A,{title:t("Horizontal padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingLeftRight"},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Horizontal"),prefix:o.createElement(z.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:F?"none":"block"}},o.createElement(i.A,{trigger:["hover"],title:t("Left padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingLeft",style:{marginBottom:L.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Left"),prefix:o.createElement(z.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(i.A,{trigger:["hover"],title:t("Right padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingRight"},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Right"),prefix:o.createElement(z.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(b.A,{span:10,style:{width:"group"!==e.type&&"column"!==e.type?156:45,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:F?"block":"none"}},o.createElement(i.A,{title:t("Vertical padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingTopBottom"},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Vertical"),prefix:o.createElement(z.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:F?"none":"block"}},o.createElement(i.A,{trigger:["hover"],title:t("Top padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingTop",style:{marginBottom:L.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Top"),prefix:o.createElement(z.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(i.A,{trigger:["hover"],title:t("Bottom padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingBottom"},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Bottom"),prefix:o.createElement(z.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(b.A,{span:4,style:{width:45,flex:"auto",maxWidth:"12%"}},o.createElement(i.A,{title:t("Individual padding"),placement:"bottom"},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!F}),onClick:()=>{M(e=>!e);const t=r.getFieldsValue(!0);F||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},o.createElement(z.A,{icon:"PaddingSwitcher"})))))),o.createElement(c.A,{className:"selected-td-form__divider"})),"group"!==e.type&&T.formCellFieldSizeEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{oe(e=>!e),le&&(t.width="",t.height="",l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{width:{value:null,dim:"px"},height:{value:null,dim:"px"}}}))})}},le?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),le&&o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},"structure"!==e.type&&"column"!==e.type&&o.createElement(b.A,{span:12},o.createElement(i.A,{title:t("Width"),placement:"bottom"},o.createElement(C.A.Item,{name:"width",style:{marginBottom:L.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,max:n,placeholder:t("Width"),prefix:o.createElement(Ee.A,null),addonAfter:o.createElement(C.A.Item,{name:"widthDim",noStyle:!0},El)})))),o.createElement(b.A,{span:12},o.createElement(i.A,{title:t("Height"),placement:"bottom"},o.createElement(C.A.Item,{name:"height"},o.createElement(Lt.A,{min:0,placeholder:t("Height"),prefix:o.createElement($o.A,null),addonAfter:"px"}))))),o.createElement(c.A,{className:"selected-td-form__divider"})),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{ie(e=>!e),ne?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",N(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})})}},ne?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ne&&o.createElement(rr,{form:r,backgroundImageEmpty:R,appConfig:T,token:L,elementSettings:e,backgroundRepeatOptions:he,handleChangeValues:Se}),T.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{G(e=>!e),j?(t.borderAll=Dt,t.borderTop=Dt,t.borderBottom=Dt,t.borderRight=Dt,t.borderLeft=Dt):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})})}},j?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),j&&o.createElement("div",{style:{marginBottom:4}},o.createElement(St,{form:r,elementSettings:e}))),T.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{$(e=>!e),X?(t.borderRadiusAll=0,_(!0)):t.borderRadiusAll=5,l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})})}},X?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),X&&o.createElement("div",{style:{marginBottom:4}},o.createElement(jt,{form:r,oneBorderRadiusValue:E,setOneBorderRadiusValue:_,elementSettings:e}))),T.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{J(e=>!e),Q?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})})}},Q?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),Q&&o.createElement("div",{style:{marginBottom:4}},o.createElement(oa,{boxShadow:m}))),T.formFieldExportAsPictureEnabled&&"group"!==e.type&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Settings"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{me(e=>!e),ce&&(t.exportAsPicture=!1,t.isContrastBlock=!1,l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1,isContrastBlock:!1}}))})}},ce?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ce&&o.createElement(o.Fragment,null,"structure"===e.type&&o.createElement(i.A,{title:t("The block will change its colors to contrasting colors. You can change them in the Content Styles section."),key:"isContrastBlock"},o.createElement(s.A,{size:10,align:"baseline"},o.createElement(C.A.Item,{name:"isContrastBlock",valuePropName:"checked",style:{marginBottom:0}},o.createElement(f.A,{size:"small",id:"contrast-colors"})),o.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"contrast-colors"},t("Contrast block"))))),o.createElement(Ha,{form:r,elementSettings:e}))),T.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("group"!==e.type?"Display control & Direction":"Display control")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(ua,{elementSettings:e,form:r})),"group"!==e.type&&o.createElement(b.A,{span:12,style:{textAlign:"group"!==e.type?"right":"left"}},o.createElement(Ka,{elementSettings:e,form:r})))),T.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Aa,null)))))))},{useToken:sr}=r.A,dr=({elementSettings:e})=>{const{__:t}=(0,y.s9)(),l=(0,Pe.XW)(),[a]=C.A.useForm(),[r,n]=(0,o.useState)({}),[s,d]=(0,o.useState)(!0),[m,p]=(0,o.useState)({}),[f,E]=(0,o.useState)(!0),_=(0,v.d4)(Ie.Ct),A=(0,v.d4)(Ie.CS),S=(0,Y.rD)(),[w,B]=(0,o.useState)(""===e.backgroundImage[0].value),{token:x}=sr(),T=(0,v.d4)(Ie.Fv),R=(0,v.d4)(Ie.yy),N=T&&"bottom"!==R,[L,I]=(0,o.useState)(!1),[P,O]=(0,o.useState)(!1),[F,M]=(0,o.useState)(!1),[D,W]=(0,o.useState)(!1),[j,H]=(0,o.useState)(!1),[G,U]=(0,o.useState)(!1),[q,X]=(0,o.useState)(!1),[$,Z]=(0,o.useState)(!1),[K,Q]=(0,o.useState)(!1),[J,ee]=(0,o.useState)(!1),[te,le]=(0,o.useState)(!1),[oe,ae]=(0,o.useState)(!1),[re,ne]=(0,o.useState)(!1),[ie,se]=(0,o.useState)(!1),[de,ce]=(0,o.useState)(!1),[me,ue]=(0,o.useState)(""),pe=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],ge=(t("Not defined"),t("Contain"),t("Cover"),e.border),he=e.mobileBorder,be=Object.keys(ge).find(e=>{var t,l,o;return(null===(t=ge[e])||void 0===t?void 0:t.width)||(null===(l=ge[e])||void 0===l?void 0:l.style)||(null===(o=ge[e])||void 0===o?void 0:o.color)}),fe=Object.keys(he).find(e=>{var t,l,o;return(null===(t=he[e])||void 0===t?void 0:t.width)||(null===(l=he[e])||void 0===l?void 0:l.style)||(null===(o=he[e])||void 0===o?void 0:o.color)}),ve=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)(()=>{if(e){var t,l,o,r,i,s,c,m,u,g,h,b,f,v,_,y,A,S,k,w,C,x,T,R,N,L,P,F,D,V,j,z,G,q,$,Y,K,J,te,oe,re,ie;const de=e.boxShadow,me=e.mobileBoxShadow;n(de),p(me),a.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.value,heightDim:null===(r=e.height)||void 0===r?void 0:r.dim,maxWidth:null===(i=e.maxWidth)||void 0===i?void 0:i.value,maxWidthDim:null===(s=e.maxWidth)||void 0===s?void 0:s.dim,minWidth:null===(c=e.minWidth)||void 0===c?void 0:c.value,minWidthDim:null===(m=e.minWidth)||void 0===m?void 0:m.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",borderAll:gl(e.border.all),borderTop:gl(e.border.top),borderBottom:gl(e.border.bottom),borderRight:gl(e.border.right),borderLeft:gl(e.border.left),mobileBorderAll:ve(e.mobileBorder.all)||!(ve(e.mobileBorder.top)||ve(e.mobileBorder.bottom)||ve(e.mobileBorder.right)||ve(e.mobileBorder.left))&&ve(e.border.all),mobileBorderTop:ve(e.mobileBorder.top)||!ve(e.mobileBorder.all)&&ve(e.border.top),mobileBorderBottom:ve(e.mobileBorder.bottom)||!ve(e.mobileBorder.all)&&ve(e.border.bottom),mobileBorderRight:ve(e.mobileBorder.right)||!ve(e.mobileBorder.all)&&ve(e.border.right),mobileBorderLeft:ve(e.mobileBorder.left)||!ve(e.mobileBorder.all)&&ve(e.border.left),paddingTop:gl(e.padding.all)||gl(e.padding.top),paddingLeft:gl(e.padding.all)||gl(e.padding.left),paddingRight:gl(e.padding.all)||gl(e.padding.right),paddingBottom:gl(e.padding.all)||gl(e.padding.bottom),paddingLeftRight:gl(null===(u=e.padding)||void 0===u?void 0:u.left)||gl(null===(g=e.padding)||void 0===g?void 0:g.right),paddingTopBottom:gl(null===(h=e.padding)||void 0===h?void 0:h.top)||gl(null===(b=e.padding)||void 0===b?void 0:b.bottom),borderRadiusAll:gl(e.borderRadius.all),borderRadiusTopLeft:gl(e.borderRadius.topLeft),borderRadiusBottomLeft:gl(e.borderRadius.bottomLeft),borderRadiusTopRight:gl(e.borderRadius.topRight),borderRadiusBottomRight:gl(e.borderRadius.bottomRight),boxShadowInset:gl(null===(f=e.boxShadow)||void 0===f?void 0:f.inset)||!1,boxShadowHOffset:gl(null===(v=e.boxShadow)||void 0===v?void 0:v.hOffset),boxShadowVOffset:gl(null===(_=e.boxShadow)||void 0===_?void 0:_.vOffset),boxShadowBlurRadius:gl(null===(y=e.boxShadow)||void 0===y?void 0:y.blurRadius),boxShadowSpreadRadius:gl(null===(A=e.boxShadow)||void 0===A?void 0:A.spreadRadius),boxShadowColor:gl(null===(S=e.boxShadow)||void 0===S?void 0:S.color),mobileWidth:hl(null===(k=e.mobileWidth)||void 0===k?void 0:k.value),mobileWidthDim:null===(w=e.mobileWidth)||void 0===w?void 0:w.dim,mobileHeight:hl(null===(C=e.mobileHeight)||void 0===C?void 0:C.value),mobileHeightDim:null===(x=e.mobileHeight)||void 0===x?void 0:x.dim,mobileBorderRadiusAll:gl(e.mobileBorderRadius.all),mobileBorderRadiusTopLeft:gl(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileBorderRadiusBottomLeft:gl(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileBorderRadiusTopRight:gl(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileBorderRadiusBottomRight:gl(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:gl(null===(T=e.mobileBoxShadow)||void 0===T?void 0:T.inset)||!1,mobileBoxShadowHOffset:gl(null===(R=e.mobileBoxShadow)||void 0===R?void 0:R.hOffset),mobileBoxShadowVOffset:gl(null===(N=e.mobileBoxShadow)||void 0===N?void 0:N.vOffset),mobileBoxShadowBlurRadius:gl(null===(L=e.mobileBoxShadow)||void 0===L?void 0:L.blurRadius),mobileBoxShadowSpreadRadius:gl(null===(P=e.mobileBoxShadow)||void 0===P?void 0:P.spreadRadius),mobileBoxShadowColor:gl(null===(F=e.mobileBoxShadow)||void 0===F?void 0:F.color),mobileAlign:gl(null===(D=e.mobileAlign)||void 0===D?void 0:D.value),mobileVerticalAlign:gl(null===(V=e.mobileVerticalAlign)||void 0===V?void 0:V.value),mobileDirection:gl(null===(j=e.mobileDirection)||void 0===j?void 0:j.value),mobileBackgroundColor:gl("none"!==(null===(z=e.mobileBackgroundColor)||void 0===z?void 0:z.value)?null===(G=e.mobileBackgroundColor)||void 0===G?void 0:G.value:""),mobileBackgroundImage:"none"!==e.mobileBackgroundImage[0].value?e.mobileBackgroundImage[0].value:"",mobileBackgroundPositionX:gl(null===(q=e.mobileBackgroundPositionX)||void 0===q?void 0:q.value),mobileBackgroundPositionY:gl(null===($=e.mobileBackgroundPositionY)||void 0===$?void 0:$.value),mobileBackgroundRepeat:null!==(Y=e.mobileBackgroundRepeat)&&void 0!==Y&&Y.value?null===(K=e.mobileBackgroundRepeat)||void 0===K?void 0:K.value:"none",mobilePaddingTop:gl(e.mobilePadding.all)||gl(e.mobilePadding.top),mobilePaddingLeft:gl(e.mobilePadding.all)||gl(e.mobilePadding.left),mobilePaddingRight:gl(e.mobilePadding.all)||gl(e.mobilePadding.right),mobilePaddingBottom:gl(e.mobilePadding.all)||gl(e.mobilePadding.bottom),mobilePaddingTopBottom:gl(e.mobilePadding.top)||gl(e.mobilePadding.bottom),mobilePaddingLeftRight:gl(e.mobilePadding.left)||gl(e.mobilePadding.right),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!gl(e.borderRadius.all)&&(gl(e.borderRadius.topLeft)||gl(e.borderRadius.bottomLeft)||gl(e.borderRadius.topRight)||gl(e.borderRadius.bottomRight))?d(!1):d(!0),!gl(e.mobileBorderRadius.all)&&(gl(e.mobileBorderRadius.topLeft)||gl(e.mobileBorderRadius.bottomLeft)||gl(e.mobileBorderRadius.topRight)||gl(e.mobileBorderRadius.bottomRight))?E(!1):E(!0),B(""===e.backgroundImage[0].value),gl(e.padding.all)||!(gl(e.padding.top)||gl(e.padding.right)||gl(e.padding.bottom)||gl(e.padding.left))||e.padding.top===e.padding.bottom&&e.padding.right===e.padding.left?I(!0):I(!1),gl(e.mobilePadding.all)||!(gl(e.mobilePadding.top)||gl(e.mobilePadding.right)||gl(e.mobilePadding.bottom)||gl(e.mobilePadding.left))||e.mobilePadding.top===e.mobilePadding.bottom&&e.mobilePadding.right===e.mobilePadding.left?O(!0):O(!1),M(!!be),W(!!be||!!fe),H(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),U(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),X(!!e.boxShadow),Z(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),Q(!!e.width.value||!!e.height.value||!!e.minWidth.value||!!e.maxWidth.value),ee(!!e.mobileWidth.value||!!e.mobileHeight.value),le(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),ae(!!e.mobileBackgroundColor.value),ne(!!e.exportAsPicture),se(!(null===(J=e.padding)||void 0===J||!J.all)||!(null===(te=e.padding)||void 0===te||!te.top)||!(null===(oe=e.padding)||void 0===oe||!oe.bottom)||!(null===(re=e.padding)||void 0===re||!re.left)||!(null===(ie=e.padding)||void 0===ie||!ie.right)),ce(!!e.mobilePadding.all||!!e.mobilePadding.top||!!e.mobilePadding.bottom||!!e.mobilePadding.left||!!e.mobilePadding.right)}},[a,e]);const _e=t=>{const o=a.getFieldsValue(!0),r=Object.keys(t)[0];let n;switch(ue("%"===a.getFieldsValue(!0).widthDim?100:""),r){case"exportAsPicture":n={exportAsPicture:o.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":n={boxShadow:{hOffset:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var i,s,d;if("borderAll"===o.borderPosition)n={border:{...V.iV,all:{...Dt,...o.borderAll}}},a.setFieldsValue({borderLeft:Dt,borderRight:Dt,borderTop:Dt,borderBottom:Dt});else null!==(i=o.borderAll)&&void 0!==i&&i.width||null!==(s=o.borderAll)&&void 0!==s&&s.style||null!==(d=o.borderAll)&&void 0!==d&&d.color?(n={border:{all:null,left:o.borderAll,right:o.borderAll,top:o.borderAll,bottom:o.borderAll,[Vt[r]]:{...o[r],...t[r]}}},a.setFieldsValue({borderAll:null,borderLeft:o.borderAll,borderRight:o.borderAll,borderTop:o.borderAll,borderBottom:o.borderAll,[r]:{...o[r],...t[r]}})):(n={border:{all:null,left:o.borderLeft,right:o.borderRight,top:o.borderTop,bottom:o.borderBottom,[Vt[r]]:{...o[r],...t[r]}}},a.setFieldsValue({border:n.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var c,m,u;if("mobileBorderAll"===o.mobileBorderPosition)n={mobileBorder:{...V.iV,all:{...Dt,...o.mobileBorderAll,classNamePrefix:"em-mob-border_"+Wt[r]+"-"}}},a.setFieldsValue({borderLeft:Dt,borderRight:Dt,borderTop:Dt,borderBottom:Dt});else null!==(c=o.mobileBorder.all)&&void 0!==c&&c.width||null!==(m=o.mobileBorder.all)&&void 0!==m&&m.style||null!==(u=o.mobileBorder.all)&&void 0!==u&&u.color?(n={mobileBorder:{all:null,left:o.mobileBorderAll,right:o.mobileBorderAll,top:o.mobileBorderAll,bottom:o.mobileBorderAll,[Wt[r]]:{...o[r],...t[r],classNamePrefix:"em-mob-border_"+Wt[r]+"-"}}},a.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:o.mobileBorderAll,mobileBorderRight:o.mobileBorderAll,mobileBorderTop:o.mobileBorderAll,mobileBorderBottom:o.mobileBorderAll,[r]:{...o[r],...t[r]}})):(n={mobileBorder:{all:null,left:o.mobileBorderLeft,right:o.mobileBorderRight,top:o.mobileBorderTop,bottom:o.mobileBorderBottom,[Wt[r]]:{...o[r],...t[r],classNamePrefix:"em-mob-border_"+Wt[r]+"-"}}},a.setFieldsValue({mobileBorder:n.mobileBorder}));case"width":n={[r]:{value:t[r],dim:o.widthDim}};break;case"height":n={[r]:{value:t[r],dim:o.heightDim}};break;case"widthDim":n={width:{value:o.width,dim:t[r]}};break;case"heightDim":n={height:{value:o.height,dim:t[r]}};break;case"maxWidth":n={[r]:{value:t[r],dim:o.maxWidthDim}};break;case"maxWidthDim":n={maxWidth:{value:o.maxWidth,dim:t[r]}};break;case"minWidth":n={[r]:{value:t[r],dim:o.minWidthDim}};break;case"minWidthDim":n={minWidth:{value:o.minWidth,dim:t[r]}};break;case"backgroundImage":B(""===t[r]),n={[r]:[{...e.backgroundImage[0],value:t[r]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":n={padding:{[It[r]]:+t[r]}};break;case"paddingTopBottom":n={padding:{top:+t[r],bottom:+t[r]}},o.paddingTop=o.paddingBottom=+t[r];break;case"paddingLeftRight":n={padding:{left:+t[r],right:+t[r]}},o.paddingLeft=o.paddingRight=+t[r];break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":n={borderRadius:{[Pt[r]]:+t[r]}};break;case"mobileWidth":n={[r]:{classNamePrefix:"em-mob-width-",value:t[r],dim:o.mobileWidthDim}};break;case"mobileWidthDim":n={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[r]}};break;case"mobileHeight":n={[r]:{classNamePrefix:"em-mob-height-",value:t[r],dim:o.mobileHeightDim}};break;case"mobileHeightDim":n={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[r]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":n={mobileBorderRadius:{[Ot[r]]:t[r],classNamePrefix:"em-mob-border_radius_"+Ot[r]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":n={mobileBoxShadow:{hOffset:o.mobileBoxShadowHOffset,vOffset:o.mobileBoxShadowVOffset,blurRadius:o.mobileBoxShadowBlurRadius,spreadRadius:o.mobileBoxShadowSpreadRadius,color:o.mobileBoxShadowColor,inset:o.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":n={[r]:{classNamePrefix:"em-mob-text_align-",value:t[r]}};break;case"mobileVerticalAlign":n={[r]:{classNamePrefix:"em-mob-vertical_align-",value:t[r]}};break;case"mobileBackgroundColor":n={[r]:{classNamePrefix:"em-mob-background_color-",value:t[r]}};break;case"mobileBackgroundImage":n={[r]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[r]}]};break;case"mobileBackgroundPositionX":n={[r]:{classNamePrefix:"em-mob-background_position_x-",value:t[r]}};break;case"mobileBackgroundPositionY":n={[r]:{classNamePrefix:"em-mob-background_position_x-",value:t[r]}};break;case"mobileBackgroundRepeat":n={[r]:{classNamePrefix:"em-mob-background_repeat-",value:t[r]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":n={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":o.mobilePaddingTop=o.mobilePaddingBottom=t[r],n={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":o.mobilePaddingLeft=o.mobilePaddingRight=t[r],n={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobileDirection":n={[r]:{classNamePrefix:"em-mob-direction-",value:t[r]}};break;case"backgroundPositionX":case"backgroundPositionY":n={[r]:isNaN(parseFloat(t[r].position))?t[r].position:t[r].position+t[r].unit};break;default:n=t}"borderPosition"!==r&&"mobileBorderPosition"!==r&&l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:n})};return o.createElement(C.A,{form:a,layout:"vertical",name:"selected_div_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",maxWidth:{value:"",dim:""},minWidth:{value:"",dim:""},align:"",valign:"",border:"",boxShadow:"",show:"all",borderPosition:Ft[be]||"borderAll",mobileBorderPosition:Mt[fe]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileDirection:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:""},onValuesChange:_e,autoComplete:"off",className:"element-controls"},!N&&o.createElement(i.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(u.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),_===V.ND&&A.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(h.A,{gutter:20,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(Fa,{form:a,elementSettings:e,imgParent:!0})),o.createElement(b.A,{span:12,style:{textAlign:"right"}},o.createElement(da,{form:a,elementSettings:e}))),o.createElement(c.A,{className:"selected-td-form__divider"}),S.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Padding"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{ce(e=>!e),de&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))})}},de?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),de&&o.createElement(h.A,{gutter:10,style:{paddingBottom:4}},o.createElement(o.Fragment,null,o.createElement(Ja,{form:a,elementSettings:e,mobilePaddingsExt:P,setMobilePaddingsExt:O})))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout(()=>{ee(e=>!e)})}},J?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),J&&o.createElement(h.A,{gutter:10,style:{paddingBottom:8}},o.createElement(b.A,{span:12},o.createElement("div",{style:{marginBottom:2*x.formItemMarginBottomXS}},o.createElement(ra,{form:a,name:"mobileWidth",elementSettings:e}))),o.createElement(b.A,{span:12},o.createElement("div",{style:{marginBottom:x.formItemMarginBottomXS}},o.createElement(ia,{form:a,name:"mobileHeight",elementSettings:e})))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{ae(e=>!e),t.mobileBackgroundColor=oe?"":"#E5E5E5",l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})})}},oe?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),oe&&o.createElement("div",{style:{marginBottom:(S.formDivFieldBackgroundImageEnabled,x.formItemMarginBottomMD+4)}},o.createElement(ja,{form:a,elementSettings:e,label:t("Background color")})),!1,S.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{W(e=>!e),D?(t.mobileBorderAll=Dt,t.mobileBorderTop=Dt,t.mobileBorderBottom=Dt,t.mobileBorderRight=Dt,t.mobileBorderLeft=Dt):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})})}},D?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),D&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(St,{form:a,typeOfForm:"mobile"}))),S.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{U(e=>!e),G?(t.mobileBorderRadiusAll=null,E(!0)):t.mobileBorderRadiusAll=5,l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})})}},G?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),G&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(Da,{form:a,oneMobileBorderRadiusValue:f,setOneMobileBorderRadiusValue:E,elementSettings:e}))),S.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{Z(e=>!e),$?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})})}},$?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),$&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(Va,{mobileBoxShadow:m,form:a,elementSettings:e}))),S.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control & Direction")),o.createElement(h.A,{gutter:20,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(ua,{elementSettings:e,form:a})),o.createElement(b.A,{span:12,style:{textAlign:"right"}},o.createElement(er,{elementSettings:e,form:a})))),S.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Aa,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement(u.A,{className:"selected_form-desktop-props-title",message:t("Appearance on mobile devices"),type:"info"}),o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(ut,{form:a,elementSettings:e})),o.createElement(b.A,{span:12,style:{textAlign:"right"}},o.createElement(ta,{form:a,elementSettings:e}))),o.createElement(c.A,{className:"selected-td-form__divider"}),S.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Padding"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{se(e=>!e),ie&&(t.paddingLeftRight="",t.paddingLeft="",t.paddingRight="",t.paddingTopBottom="",t.paddingTop="",t.paddingBottom="",l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))})}},ie?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ie&&o.createElement(h.A,{gutter:10,style:{marginBottom:4}},o.createElement(o.Fragment,null,o.createElement(b.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:L?"block":"none"}},o.createElement(i.A,{title:t("Horizontal padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingLeftRight"},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Horizontal"),prefix:o.createElement(z.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:L?"none":"block"}},o.createElement(i.A,{trigger:["hover"],title:t("Left padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingLeft",style:{marginBottom:x.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Left"),prefix:o.createElement(z.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(i.A,{trigger:["hover"],title:t("Right padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingRight"},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Right"),prefix:o.createElement(z.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(b.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:L?"block":"none"}},o.createElement(i.A,{title:t("Vertical padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingTopBottom"},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Vertical"),prefix:o.createElement(z.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:L?"none":"block"}},o.createElement(i.A,{trigger:["hover"],title:t("Top padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingTop",style:{marginBottom:x.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Top"),prefix:o.createElement(z.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(i.A,{trigger:["hover"],title:t("Bottom padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingBottom"},o.createElement(Lt.A,{min:0,max:300,placeholder:t("Bottom"),prefix:o.createElement(z.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(b.A,{span:4,style:{width:45,flex:"auto",maxWidth:"none"}},o.createElement(i.A,{title:t("Individual padding"),placement:"bottom"},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!L}),onClick:()=>{I(e=>!e);const t=a.getFieldsValue(!0);L||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},o.createElement(z.A,{icon:"PaddingSwitcher"}))))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout(()=>{Q(e=>!e)})}},K?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),K&&o.createElement(h.A,{gutter:10,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Width"),placement:"bottom"},o.createElement(C.A.Item,{name:"width",className:"form-item-margin-xs"}," ",o.createElement(Lt.A,{min:0,max:me,placeholder:t("Width"),prefix:o.createElement(Ee.A,null),addonAfter:o.createElement(C.A.Item,{name:"widthDim",noStyle:!0},El)}))),o.createElement(i.A,{trigger:["hover"],title:t("Height"),placement:"bottom"},o.createElement(C.A.Item,{name:"height"},o.createElement(Lt.A,{min:0,placeholder:t("Height"),prefix:o.createElement($o.A,null),addonAfter:"px"})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Minimum width"),placement:"bottom"},o.createElement(C.A.Item,{name:"minWidth",className:"form-item-margin-xs"},o.createElement(Lt.A,{min:0,placeholder:t("Min width"),prefix:o.createElement(z.A,{icon:"MinWidth"}),addonAfter:o.createElement(C.A.Item,{name:"minWidthDim",noStyle:!0},El)}))),o.createElement(i.A,{trigger:["hover"],title:t("Maximum width"),placement:"bottom"},o.createElement(C.A.Item,{name:"maxWidth",className:"form-item-margin-xs"},o.createElement(Lt.A,{min:0,placeholder:t("Max width"),prefix:o.createElement(z.A,{icon:"MaxWidth"}),addonAfter:o.createElement(C.A.Item,{name:"maxWidthDim",noStyle:!0},El)}))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{le(e=>!e),te?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",B(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})})}},te?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),te&&o.createElement(rr,{form:a,backgroundImageEmpty:w,appConfig:S,token:x,elementSettings:e,backgroundRepeatOptions:pe,handleChangeValues:_e}),S.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{M(e=>!e),F?(t.borderAll=Dt,t.borderTop=Dt,t.borderBottom=Dt,t.borderRight=Dt,t.borderLeft=Dt):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})})}},F?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),F&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(St,{form:a,elementSettings:e}))),S.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{H(e=>!e),j?(t.borderRadiusAll=0,d(!0)):t.borderRadiusAll=5,l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})})}},j?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),j&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(jt,{form:a,oneBorderRadiusValue:s,setOneBorderRadiusValue:d,elementSettings:e}))),S.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{X(e=>!e),q?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})})}},q?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),q&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(oa,{boxShadow:r}))),S.formFieldExportAsPictureEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Export settings"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout(()=>{ne(e=>!e),re&&(t.exportAsPicture=!1,l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))})}},re?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),re&&o.createElement(Ha,{form:a,elementSettings:e})),S.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control & Direction")),o.createElement(h.A,{gutter:20,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(ua,{elementSettings:e,form:a})),o.createElement(b.A,{span:12,style:{textAlign:"right"}},o.createElement(Ka,{elementSettings:e,form:a})))),S.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Aa,null)))))))};var cr=l(61153);let mr=0;const ur=({elementSettings:e})=>{const{__:t}=(0,y.s9)(),l=(0,Pe.XW)(),[a]=C.A.useForm(),r=(0,v.d4)(Ie.Ct),n=(0,v.d4)(Ie.CS),s=(0,v.d4)(Ie.Fv),d=(0,v.d4)(Ie.yy),m=(0,Y.rD)(),p=s&&"bottom"!==d;(0,o.useEffect)(()=>{var t,l,o,r,n,i,s,d,c,m,u,p,g;e&&(a.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,gap:null===(o=e.gap)||void 0===o?void 0:o.value,gapDim:null===(r=e.gap)||void 0===r?void 0:r.dim,maxWidth:null===(n=e.maxWidth)||void 0===n?void 0:n.value,maxWidthDim:null===(i=e.maxWidth)||void 0===i?void 0:i.dim,minWidth:null===(s=e.minWidth)||void 0===s?void 0:s.value,minWidthDim:null===(d=e.minWidth)||void 0===d?void 0:d.dim,show:e.show?e.show:"all",mobileWidth:hl(null===(c=e.mobileWidth)||void 0===c?void 0:c.value),mobileWidthDim:null===(m=e.mobileWidth)||void 0===m?void 0:m.dim,mobileContentWidth:hl(null===(u=e.mobileContentWidth)||void 0===u?void 0:u.value),mobileContentWidthDim:null===(p=e.mobileContentWidth)||void 0===p?void 0:p.dim,mobileVerticalAlign:gl(null===(g=e.mobileVerticalAlign)||void 0===g?void 0:g.value)}),mr=e.width.value+e.gap.value)},[a,e]);return o.createElement(C.A,{form:a,layout:"vertical",name:"selected_float_block_form",initialValues:{width:{value:"",dim:""},gap:{value:"",dim:"px"},valign:"",show:"all",mobileWidth:"",mobileWidthDim:"",mobileContentWidth:"",mobileContentWidthDim:"",mobileVerticalAlign:""},onValuesChange:t=>{const o=a.getFieldsValue(!0),r=Object.keys(t)[0];let n;switch(r){case"width":mr=t[r]+o.gap,n={[r]:{value:t[r],dim:o.widthDim},gap:{value:o.gap}};break;case"widthDim":n={width:{value:o.width,dim:t[r]},gap:{value:o.gap}};break;case"gap":o.width=mr-t[r],n={[r]:{value:t[r],dim:"px"}};break;case"mobileWidth":n={[r]:{classNamePrefix:"em-mob-width-",value:t[r],dim:o.mobileWidthDim}};break;case"mobileWidthDim":n={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[r]}};break;case"mobileContentWidth":n={[r]:{classNamePrefix:"em-mob-width-",value:t[r],dim:o.mobileContentWidthDim}};break;case"mobileContentWidthDim":n={mobileContentWidth:{classNamePrefix:"em-mob-width-",value:100,dim:t[r]}};break;case"mobileVerticalAlign":n={[r]:{classNamePrefix:"em-mob-vertical_align-",value:t[r]}};break;default:n=t}l({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:n})},autoComplete:"off",className:"element-controls"},p&&o.createElement(i.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(u.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),r===V.ND&&n.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:r===V.ND&&n.styles?"block":"none"}},o.createElement(i.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(u.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(h.A,{gutter:10,style:{marginBottom:20}},o.createElement(b.A,{span:12},o.createElement(ra,{form:a,name:"mobileWidth",elementSettings:e})),o.createElement(b.A,{span:12})),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Alignments")),o.createElement(da,{form:a,elementSettings:e}),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(ua,{elementSettings:e,form:a}),m.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(Aa,null)))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(C.A.Item,{style:{marginBottom:"0"}},o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Float block width"),placement:"bottom"},o.createElement(C.A.Item,{name:"width"},o.createElement(fe.A,{min:0,placeholder:t("Float block width"),prefix:o.createElement(Ee.A,null),addonAfter:o.createElement(C.A.Item,{name:"widthDim",noStyle:!0},El)})))),o.createElement(b.A,{span:12},o.createElement(i.A,{trigger:["hover"],title:t("Column gap"),placement:"bottom"},o.createElement(C.A.Item,{name:"gap"},o.createElement(fe.A,{min:0,placeholder:t("Column gap"),prefix:o.createElement(cr.A,null),addonAfter:o.createElement(C.A.Item,{name:"widthDim",noStyle:!0},vl)})))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Vertical alignment")),o.createElement(ta,{form:a,elementSettings:e}),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(ua,{elementSettings:e,form:a}),m.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(Aa,null)))))},{useToken:pr}=r.A,gr=({elementSettings:e})=>{var t;const{__:l}=(0,y.s9)(),a=(0,Pe.XW)(),[r]=C.A.useForm(),n=(0,v.wA)(),s=(0,v.d4)(H.Hs),[d,m]=(0,o.useState)({}),[p,f]=(0,o.useState)(!0),[E,_]=(0,o.useState)(!0),A=(0,v.d4)(Ie.Ct),S=(0,v.d4)(Ie.CS),w=(0,Y.rD)(),[x,T]=(0,o.useState)(""===(null===(t=e.backgroundImage)||void 0===t?void 0:t[0].value)),R=(0,v.d4)(Ie.Fv),N=(0,v.d4)(Ie.yy),L=R&&"bottom"!==N,{token:I}=pr(),P=(0,o.useRef)(null),O=(0,o.useRef)(null),[F,M]=(0,o.useState)(!1),[D,W]=(0,o.useState)(!1),[j,G]=(0,o.useState)(!1),[U,q]=(0,o.useState)(!1),[X,$]=(0,o.useState)(!1),[Z,K]=(0,o.useState)(!1),[Q,J]=(0,o.useState)(!1),[ee,te]=(0,o.useState)(!1),[le,oe]=(0,o.useState)(!1),[ae,re]=(0,o.useState)(!1),[ne,ie]=(0,o.useState)(!1),[se,de]=(0,o.useState)(!1),[ce,me]=(0,o.useState)(!1),[ue,pe]=(0,o.useState)(!1),[ge,he]=(0,o.useState)(""),[be,fe]=(0,o.useState)("https://"),[ve,_e]=(0,o.useState)({}),[ye,Ae]=(0,o.useState)(!1),Se=s.hasOwnProperty("type")?V.IE:V.Tm,ke=[{label:l("Not defined"),value:"none"},{label:l("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:l("Repeat background (repeat)"),value:"repeat"},{label:l("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:l("Repeat background vertically (repeat-y)"),value:"repeat-y"}],we=(l("Not defined"),l("Contain"),l("Cover"),e.border),Ce=e.mobileBorder,Be=Object.keys(we).find(e=>{var t,l,o;return(null===(t=we[e])||void 0===t?void 0:t.width)||(null===(l=we[e])||void 0===l?void 0:l.style)||(null===(o=we[e])||void 0===o?void 0:o.color)}),xe=Object.keys(Ce).find(e=>{var t,l,o;return(null===(t=Ce[e])||void 0===t?void 0:t.width)||(null===(l=Ce[e])||void 0===l?void 0:l.style)||(null===(o=Ce[e])||void 0===o?void 0:o.color)}),Te=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)(()=>{if(e){var t,l,o,a,n,i,s,d,c,u,p,g,h,b,E,v,y,A,S,k,w,C,B,x,R,N,L,I,P,O,F,D,V,j,z,H,U,X,Z,Y,Q,ee,le,ae,ne,se,ce,ue,ge,he,be,Ee,ve,_e,ye,Ae,Se,ke,we,Ce,Re,Ne,Le,Ie,Pe,Oe,Fe,Me,De,Ve,We,je,ze,He,Ge,Ue,qe,Xe,$e,Ze,Ye,Ke,Qe,Je,et,tt,lt,ot,at,rt,nt,it,st,dt,ct,mt,ut,pt,gt,ht,bt,ft,Et,vt,_t,yt,At,St,kt,wt,Ct,Bt,xt,Tt,Rt,Nt,Lt,It,Pt,Ot,Ft,Mt,Dt,Vt,Wt,jt,zt,Ht,Gt,Ut,qt,Xt,$t,Zt,Yt,Kt,Qt,Jt,el,tl,ll,ol,al,rl,nl,il,sl,dl,cl,ml,ul,pl,bl,fl,El,vl,_l,yl;const Al=e.boxShadow||{},Sl=e.mobilePadding||{},kl=e.mobileAlign||{},wl=e.mobileBackgroundImage||[];m(Al),e.href&&("https://"===e.href.substring(0,8)||"http://"===e.href.substring(0,7)?fe("https://"):"mailto:"===e.href.substring(0,7)?fe("mailto:"):"tel:"===e.href.substring(0,4)?fe("tel:"):"sms:"===e.href.substring(0,4)?fe("sms:"):"ftp://"===e.href.substring(0,6)?fe("ftp://"):"skype:"===e.href.substring(0,6)?fe("skype:"):"viber:"===e.href.substring(0,6)?fe("viber:"):fe("")),r.setFieldsValue({...e,href:e.href?e.href:"https://",width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.value,heightDim:null===(a=e.height)||void 0===a?void 0:a.dim,backgroundImage:null===(n=e.backgroundImage)||void 0===n?void 0:n[0].value,show:e.show?e.show:"all",textAlign:e.textAlign,borderAll:gl(e.border.all),borderTop:gl(e.border.top),borderBottom:gl(e.border.bottom),borderRight:gl(e.border.right),borderLeft:gl(e.border.left),mobileBorderAll:Te(e.mobileBorder.all)||!(Te(e.mobileBorder.top)||Te(e.mobileBorder.bottom)||Te(e.mobileBorder.right)||Te(e.mobileBorder.left))&&Te(e.border.all),mobileBorderTop:Te(e.mobileBorder.top)||!Te(e.mobileBorder.all)&&Te(e.border.top),mobileBorderBottom:Te(e.mobileBorder.bottom)||!Te(e.mobileBorder.all)&&Te(e.border.bottom),mobileBorderRight:Te(e.mobileBorder.right)||!Te(e.mobileBorder.all)&&Te(e.border.right),mobileBorderLeft:Te(e.mobileBorder.left)||!Te(e.mobileBorder.all)&&Te(e.border.left),paddingTop:gl(null===(i=e.padding)||void 0===i?void 0:i.all)||gl(null===(s=e.padding)||void 0===s?void 0:s.top),paddingLeft:gl(null===(d=e.padding)||void 0===d?void 0:d.all)||gl(null===(c=e.padding)||void 0===c?void 0:c.left),paddingRight:gl(null===(u=e.padding)||void 0===u?void 0:u.all)||gl(null===(p=e.padding)||void 0===p?void 0:p.right),paddingBottom:gl(null===(g=e.padding)||void 0===g?void 0:g.all)||gl(null===(h=e.padding)||void 0===h?void 0:h.bottom),paddingLeftRight:gl(null===(b=e.padding)||void 0===b?void 0:b.left)||gl(null===(E=e.padding)||void 0===E?void 0:E.right),paddingTopBottom:gl(null===(v=e.padding)||void 0===v?void 0:v.top)||gl(null===(y=e.padding)||void 0===y?void 0:y.bottom),borderRadiusAll:gl(null===(A=e.borderRadius)||void 0===A?void 0:A.all),borderRadiusTopLeft:gl(null===(S=e.borderRadius)||void 0===S?void 0:S.topLeft),borderRadiusBottomLeft:gl(null===(k=e.borderRadius)||void 0===k?void 0:k.bottomLeft),borderRadiusTopRight:gl(null===(w=e.borderRadius)||void 0===w?void 0:w.topRight),borderRadiusBottomRight:gl(null===(C=e.borderRadius)||void 0===C?void 0:C.bottomRight),boxShadowInset:gl(null===(B=e.boxShadow)||void 0===B?void 0:B.inset)||!1,boxShadowHOffset:gl(null===(x=e.boxShadow)||void 0===x?void 0:x.hOffset),boxShadowVOffset:gl(null===(R=e.boxShadow)||void 0===R?void 0:R.vOffset),boxShadowBlurRadius:gl(null===(N=e.boxShadow)||void 0===N?void 0:N.blurRadius),boxShadowSpreadRadius:gl(null===(L=e.boxShadow)||void 0===L?void 0:L.spreadRadius),boxShadowColor:gl(null===(I=e.boxShadow)||void 0===I?void 0:I.color),mobileWidth:hl(null===(P=e.mobileWidth)||void 0===P?void 0:P.value)||(null===(O=e.width)||void 0===O?void 0:O.value),mobileWidthDim:hl(null===(F=e.mobileWidth)||void 0===F?void 0:F.value)?null===(D=e.mobileWidth)||void 0===D?void 0:D.dim:null===(V=e.width)||void 0===V?void 0:V.dim,mobileHeight:hl(null===(j=e.mobileHeight)||void 0===j?void 0:j.value)||(null===(z=e.height)||void 0===z?void 0:z.value),mobileHeightDim:hl(null===(H=e.mobileHeight)||void 0===H?void 0:H.value)?null===(U=e.mobileHeight)||void 0===U?void 0:U.dim:null===(X=e.height)||void 0===X?void 0:X.dim,mobileBorderRadiusAll:gl(null===(Z=e.mobileBorderRadius)||void 0===Z?void 0:Z.all)||gl(null===(Y=e.borderRadius)||void 0===Y?void 0:Y.all),mobileBorderRadiusTopLeft:gl(null===(Q=e.mobileBorderRadius)||void 0===Q?void 0:Q.topLeft)||gl(null===(ee=e.mobileBorderRadius)||void 0===ee?void 0:ee.all)||gl(null===(le=e.borderRadius)||void 0===le?void 0:le.topLeft)||gl(null===(ae=e.borderRadius)||void 0===ae?void 0:ae.all),mobileBorderRadiusBottomLeft:gl(null===(ne=e.mobileBorderRadius)||void 0===ne?void 0:ne.bottomLeft)||gl(null===(se=e.mobileBorderRadius)||void 0===se?void 0:se.all)||gl(null===(ce=e.borderRadius)||void 0===ce?void 0:ce.bottomLeft)||gl(null===(ue=e.borderRadius)||void 0===ue?void 0:ue.all),mobileBorderRadiusTopRight:gl(null===(ge=e.mobileBorderRadius)||void 0===ge?void 0:ge.topRight)||gl(null===(he=e.mobileBorderRadius)||void 0===he?void 0:he.all)||gl(null===(be=e.borderRadius)||void 0===be?void 0:be.topRight)||gl(null===(Ee=e.borderRadius)||void 0===Ee?void 0:Ee.all),mobileBorderRadiusBottomRight:gl(null===(ve=e.mobileBorderRadius)||void 0===ve?void 0:ve.bottomRight)||gl(null===(_e=e.mobileBorderRadius)||void 0===_e?void 0:_e.all)||gl(null===(ye=e.borderRadius)||void 0===ye?void 0:ye.bottomRight)||gl(null===(Ae=e.borderRadius)||void 0===Ae?void 0:Ae.all),mobileBoxShadowInset:null!=(null===(Se=e.mobileBoxShadow)||void 0===Se?void 0:Se.inset)?e.mobileBoxShadow.inset:(null===(ke=e.boxShadow)||void 0===ke?void 0:ke.inset)||!1,mobileBoxShadowHOffset:gl(null===(we=e.mobileBoxShadow)||void 0===we?void 0:we.hOffset)||gl(null===(Ce=e.boxShadow)||void 0===Ce?void 0:Ce.hOffset),mobileBoxShadowVOffset:gl(null===(Re=e.mobileBoxShadow)||void 0===Re?void 0:Re.vOffset)||gl(null===(Ne=e.boxShadow)||void 0===Ne?void 0:Ne.vOffset),mobileBoxShadowBlurRadius:gl(null===(Le=e.mobileBoxShadow)||void 0===Le?void 0:Le.blurRadius)||gl(null===(Ie=e.boxShadow)||void 0===Ie?void 0:Ie.blurRadius),mobileBoxShadowSpreadRadius:gl(null===(Pe=e.mobileBoxShadow)||void 0===Pe?void 0:Pe.spreadRadius)||gl(null===(Oe=e.boxShadow)||void 0===Oe?void 0:Oe.spreadRadius),mobileBoxShadowColor:gl(null===(Fe=e.mobileBoxShadow)||void 0===Fe?void 0:Fe.color)||gl(null===(Me=e.boxShadow)||void 0===Me?void 0:Me.color),mobileAlign:gl(null===kl||void 0===kl?void 0:kl.value)||e.align,mobileVerticalAlign:gl((null===(De=e.mobileVerticalAlign)||void 0===De?void 0:De.value)||e.valign),mobileBackgroundColor:gl((null===(Ve=e.mobileBackgroundColor)||void 0===Ve?void 0:Ve.value)||e.backgroundColor||""),mobileBackgroundImage:"none"!==(null===(We=wl[0])||void 0===We?void 0:We.value)?null===(je=wl[0])||void 0===je?void 0:je.value:(null===(ze=e.backgroundImage)||void 0===ze?void 0:ze[0].value)||"",mobileBackgroundPositionX:gl(null===(He=e.mobileBackgroundPositionX)||void 0===He?void 0:He.value)||gl(null===(Ge=e.backgroundPositionX)||void 0===Ge?void 0:Ge.value),mobileBackgroundPositionY:gl(null===(Ue=e.mobileBackgroundPositionY)||void 0===Ue?void 0:Ue.value)||gl(null===(qe=e.backgroundPositionY)||void 0===qe?void 0:qe.value),mobileBackgroundRepeat:(null===(Xe=e.mobileBackgroundRepeat)||void 0===Xe?void 0:Xe.value)||e.backgroundRepeat||"none",mobilePaddingTop:gl(Sl.all)||gl(Sl.top)||gl(null===($e=e.padding)||void 0===$e?void 0:$e.all)||gl(null===(Ze=e.padding)||void 0===Ze?void 0:Ze.top),mobilePaddingLeft:gl(Sl.all)||gl(Sl.left)||gl(null===(Ye=e.padding)||void 0===Ye?void 0:Ye.all)||gl(null===(Ke=e.padding)||void 0===Ke?void 0:Ke.left),mobilePaddingRight:gl(Sl.all)||gl(Sl.right)||gl(null===(Qe=e.padding)||void 0===Qe?void 0:Qe.all)||gl(null===(Je=e.padding)||void 0===Je?void 0:Je.right),mobilePaddingBottom:gl(Sl.all)||gl(Sl.bottom)||gl(null===(et=e.padding)||void 0===et?void 0:et.all)||gl(null===(tt=e.padding)||void 0===tt?void 0:tt.bottom),mobilePaddingTopBottom:gl(Sl.top)||gl(Sl.bottom)||gl(null===(lt=e.padding)||void 0===lt?void 0:lt.top)||gl(null===(ot=e.padding)||void 0===ot?void 0:ot.bottom),mobilePaddingLeftRight:gl(Sl.left)||gl(Sl.right)||gl(null===(at=e.padding)||void 0===at?void 0:at.left)||gl(null===(rt=e.padding)||void 0===rt?void 0:rt.right),mobileTextAlign:gl((null===(nt=e.mobileTextAlign)||void 0===nt?void 0:nt.value)||e.textAlign),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture,mobileFontSize:gl((null===(it=e.mobileFontSize)||void 0===it?void 0:it.value)||e.fontSize)}),!gl(null===(st=e.borderRadius)||void 0===st?void 0:st.all)&&(gl(null===(dt=e.borderRadius)||void 0===dt?void 0:dt.topLeft)||gl(null===(ct=e.borderRadius)||void 0===ct?void 0:ct.bottomLeft)||gl(null===(mt=e.borderRadius)||void 0===mt?void 0:mt.topRight)||gl(null===(ut=e.borderRadius)||void 0===ut?void 0:ut.bottomRight))?f(!1):f(!0),!gl(e.mobileBorderRadius.all)&&(gl(e.mobileBorderRadius.topLeft)||gl(e.mobileBorderRadius.bottomLeft)||gl(e.mobileBorderRadius.topRight)||gl(e.mobileBorderRadius.bottomRight))||gl(e.mobileBorderRadius.all)&&(gl(e.mobileBorderRadius.topLeft)||gl(e.mobileBorderRadius.bottomLeft)||gl(e.mobileBorderRadius.topRight)||gl(e.mobileBorderRadius.bottomRight))||!gl(e.borderRadius.all)&&!gl(e.mobileBorderRadius.all)&&(gl(e.borderRadius.topLeft)||gl(e.borderRadius.bottomLeft)||gl(e.borderRadius.topRight)||gl(e.borderRadius.bottomRight))?_(!1):_(!0),T(""===(null===(pt=e.backgroundImage)||void 0===pt?void 0:pt[0].value)),gl(null===(gt=e.padding)||void 0===gt?void 0:gt.all)||!(gl(null===(ht=e.padding)||void 0===ht?void 0:ht.top)||gl(null===(bt=e.padding)||void 0===bt?void 0:bt.right)||gl(null===(ft=e.padding)||void 0===ft?void 0:ft.bottom)||gl(null===(Et=e.padding)||void 0===Et?void 0:Et.left))||(null===(vt=e.padding)||void 0===vt?void 0:vt.top)===(null===(_t=e.padding)||void 0===_t?void 0:_t.bottom)&&(null===(yt=e.padding)||void 0===yt?void 0:yt.right)===(null===(At=e.padding)||void 0===At?void 0:At.left)?M(!0):M(!1),!gl(Sl.all)&&(gl(Sl.top)||gl(Sl.right)||gl(Sl.bottom)||gl(Sl.left))&&(Sl.top!==Sl.bottom||Sl.right!==Sl.left)||!gl(null===(St=e.padding)||void 0===St?void 0:St.all)&&(gl(null===(kt=e.padding)||void 0===kt?void 0:kt.top)||gl(null===(wt=e.padding)||void 0===wt?void 0:wt.right)||gl(null===(Ct=e.padding)||void 0===Ct?void 0:Ct.bottom)||gl(null===(Bt=e.padding)||void 0===Bt?void 0:Bt.left))&&((null===(xt=e.padding)||void 0===xt?void 0:xt.top)!==(null===(Tt=e.padding)||void 0===Tt?void 0:Tt.bottom)||(null===(Rt=e.padding)||void 0===Rt?void 0:Rt.right)!==(null===(Nt=e.padding)||void 0===Nt?void 0:Nt.left))?W(!1):W(!0),G(!!Be),q(!!Be||!!xe),$(!(null===(Lt=e.borderRadius)||void 0===Lt||!Lt.all)||!(null===(It=e.borderRadius)||void 0===It||!It.topLeft)||!(null===(Pt=e.borderRadius)||void 0===Pt||!Pt.bottomLeft)||!(null===(Ot=e.borderRadius)||void 0===Ot||!Ot.topRight)||!(null===(Ft=e.borderRadius)||void 0===Ft||!Ft.bottomRight)),K(!(null===(Mt=e.mobileBorderRadius)||void 0===Mt||!Mt.all)||!(null===(Dt=e.mobileBorderRadius)||void 0===Dt||!Dt.topLeft)||!(null===(Vt=e.mobileBorderRadius)||void 0===Vt||!Vt.bottomLeft)||!(null===(Wt=e.mobileBorderRadius)||void 0===Wt||!Wt.topRight)||!(null===(jt=e.mobileBorderRadius)||void 0===jt||!jt.bottomRight)||!(null===(zt=e.borderRadius)||void 0===zt||!zt.all)||!(null===(Ht=e.borderRadius)||void 0===Ht||!Ht.topLeft)||!(null===(Gt=e.borderRadius)||void 0===Gt||!Gt.bottomLeft)||!(null===(Ut=e.borderRadius)||void 0===Ut||!Ut.topRight)||!(null===(qt=e.borderRadius)||void 0===qt||!qt.bottomRight)),J(!!e.boxShadow),te(!(null===(Xt=e.mobileBoxShadow)||void 0===Xt||!Xt.blurRadius)||!(null===($t=e.mobileBoxShadow)||void 0===$t||!$t.color)||!(null===(Zt=e.mobileBoxShadow)||void 0===Zt||!Zt.hOffset)||!(null===(Yt=e.mobileBoxShadow)||void 0===Yt||!Yt.inset)||!(null===(Kt=e.mobileBoxShadow)||void 0===Kt||!Kt.spreadRadius)||!(null===(Qt=e.mobileBoxShadow)||void 0===Qt||!Qt.vOffset)||!!e.boxShadow),oe(!(null===(Jt=e.mobileWidth)||void 0===Jt||!Jt.value)||!(null===(el=e.mobileHeight)||void 0===el||!el.value)||!!e.width.value||!!e.height.value),re(!!e.backgroundColor||!(null===(tl=e.backgroundImage)||void 0===tl||!tl[0].value)||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),ie(!(null===(ll=e.mobileBackgroundColor)||void 0===ll||!ll.value)||!!e.backgroundColor||!(null===(ol=e.backgroundImage)||void 0===ol||!ol[0].value)||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),de(!(null===(al=e.mobileFontSize)||void 0===al||!al.value)||!!e.fontSize||!!e.showOnMobile),me(!(null===(rl=e.padding)||void 0===rl||!rl.all)||!(null===(nl=e.padding)||void 0===nl||!nl.top)||!(null===(il=e.padding)||void 0===il||!il.bottom)||!(null===(sl=e.padding)||void 0===sl||!sl.left)||!(null===(dl=e.padding)||void 0===dl||!dl.right)),pe(!(null===(cl=e.mobilePadding)||void 0===cl||!cl.all)||!(null===(ml=e.mobilePadding)||void 0===ml||!ml.top)||!(null===(ul=e.mobilePadding)||void 0===ul||!ul.bottom)||!(null===(pl=e.mobilePadding)||void 0===pl||!pl.left)||!(null===(bl=e.mobilePadding)||void 0===bl||!bl.right)||!(null===(fl=e.padding)||void 0===fl||!fl.all)||!(null===(El=e.padding)||void 0===El||!El.top)||!(null===(vl=e.padding)||void 0===vl||!vl.bottom)||!(null===(_l=e.padding)||void 0===_l||!_l.left)||!(null===(yl=e.padding)||void 0===yl||!yl.right))}},[r,e,L]);const Re=(0,o.useCallback)(e=>{n(Se===V.Tm?(0,H.A9)(e):(0,Xe.A9)(e))},[n,Se]),Ne=t=>{const l=r.getFieldsValue(!0),o=Object.keys(t)[0];let n;switch(he("%"===r.getFieldsValue(!0).widthDim?100:""),o){case"exportAsPicture":n={exportAsPicture:l.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":n={boxShadow:{hOffset:l.boxShadowHOffset,vOffset:l.boxShadowVOffset,blurRadius:l.boxShadowBlurRadius,spreadRadius:l.boxShadowSpreadRadius,color:l.boxShadowColor,inset:l.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var i,s,d;if("borderAll"===l.borderPosition)n={border:{...V.iV,all:{...Dt,...l.borderAll}}},r.setFieldsValue({borderLeft:Dt,borderRight:Dt,borderTop:Dt,borderBottom:Dt});else null!==(i=l.borderAll)&&void 0!==i&&i.width||null!==(s=l.borderAll)&&void 0!==s&&s.style||null!==(d=l.borderAll)&&void 0!==d&&d.color?(n={border:{all:null,left:l.borderAll,right:l.borderAll,top:l.borderAll,bottom:l.borderAll,[Vt[o]]:{...l[o],...t[o]}}},r.setFieldsValue({borderAll:null,borderLeft:l.borderAll,borderRight:l.borderAll,borderTop:l.borderAll,borderBottom:l.borderAll,[o]:{...l[o],...t[o]}})):(n={border:{all:null,left:l.borderLeft,right:l.borderRight,top:l.borderTop,bottom:l.borderBottom,[Vt[o]]:{...l[o],...t[o]}}},r.setFieldsValue({border:n.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var c,m,u;if("mobileBorderAll"===l.mobileBorderPosition)n={mobileBorder:{...V.iV,all:{...Dt,...l.mobileBorderAll,classNamePrefix:"em-mob-border_"+Wt[o]+"-"}}},r.setFieldsValue({borderLeft:Dt,borderRight:Dt,borderTop:Dt,borderBottom:Dt});else null!==(c=l.mobileBorder.all)&&void 0!==c&&c.width||null!==(m=l.mobileBorder.all)&&void 0!==m&&m.style||null!==(u=l.mobileBorder.all)&&void 0!==u&&u.color?(n={mobileBorder:{all:null,left:l.mobileBorderAll,right:l.mobileBorderAll,top:l.mobileBorderAll,bottom:l.mobileBorderAll,[Wt[o]]:{...l[o],...t[o],classNamePrefix:"em-mob-border_"+Wt[o]+"-"}}},r.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:l.mobileBorderAll,mobileBorderRight:l.mobileBorderAll,mobileBorderTop:l.mobileBorderAll,mobileBorderBottom:l.mobileBorderAll,[o]:{...l[o],...t[o]}})):(n={mobileBorder:{all:null,left:l.mobileBorderLeft,right:l.mobileBorderRight,top:l.mobileBorderTop,bottom:l.mobileBorderBottom,[Wt[o]]:{...l[o],...t[o],classNamePrefix:"em-mob-border_"+Wt[o]+"-"}}},r.setFieldsValue({mobileBorder:n.mobileBorder}));break;case"width":n={[o]:{value:t[o],dim:l.widthDim}};break;case"height":n={[o]:{value:t[o],dim:l.heightDim}};break;case"widthDim":n={width:{value:l.width,dim:t[o]}};break;case"heightDim":n={height:{value:l.height,dim:t[o]}};break;case"backgroundImage":T(""===t[o]),n={[o]:[{...e.backgroundImage[0],value:t[o]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":n={padding:{left:l.paddingLeft,right:l.paddingRight,top:l.paddingTop,bottom:l.paddingBottom,[It[o]]:+t[o]}};break;case"paddingTopBottom":n={padding:{left:l.paddingLeft,right:l.paddingRight,top:+t[o],bottom:+t[o]}},l.paddingTop=l.paddingBottom=+t[o];break;case"paddingLeftRight":n={padding:{top:l.paddingTop,bottom:l.paddingBottom,left:+t[o],right:+t[o]}},l.paddingLeft=l.paddingRight=+t[o];break;case"borderRadiusAll":n={borderRadius:{[Pt[o]]:+t[o]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":n={borderRadius:{topLeft:l.borderRadiusTopLeft,bottomLeft:l.borderRadiusBottomLeft,topRight:l.borderRadiusTopRight,bottomRight:l.borderRadiusBottomRight,[Pt[o]]:+t[o]}};break;case"mobileWidth":n={[o]:{classNamePrefix:"em-mob-width-",value:t[o],dim:l.mobileWidthDim}};break;case"mobileWidthDim":n={mobileWidth:{classNamePrefix:"em-mob-width-",value:l.mobileWidth||100,dim:t[o]}};break;case"mobileHeight":n={[o]:{classNamePrefix:"em-mob-height-",value:t[o],dim:l.mobileHeightDim},mobileLineHeight:{classNamePrefix:"em-mob-line_height-",value:t[o],dim:l.mobileHeightDim}};break;case"mobileHeightDim":n={mobileHeight:{classNamePrefix:"em-mob-height-",value:l.mobileHeight,dim:t[o]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":n={mobileBorderRadius:{[Ot[o]]:t[o],classNamePrefix:"em-mob-border_radius_"+Ot[o]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":n={mobileBoxShadow:{hOffset:l.mobileBoxShadowHOffset,vOffset:l.mobileBoxShadowVOffset,blurRadius:l.mobileBoxShadowBlurRadius,spreadRadius:l.mobileBoxShadowSpreadRadius,color:l.mobileBoxShadowColor,inset:l.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":n={[o]:{classNamePrefix:"em-mob-table_align-",value:t[o]}};break;case"mobileTextAlign":n={[o]:{classNamePrefix:"em-mob-text_align-",value:t[o]}};break;case"mobileVerticalAlign":n={[o]:{classNamePrefix:"em-mob-vertical_align-",value:t[o]}};break;case"mobileBackgroundColor":n={[o]:{classNamePrefix:"em-mob-background_color-",value:t[o]}};break;case"mobileBackgroundPositionX":n={[o]:{classNamePrefix:"em-mob-background_position_x-",value:t[o]}};break;case"mobileBackgroundPositionY":n={[o]:{classNamePrefix:"em-mob-background_position_x-",value:t[o]}};break;case"mobileBackgroundRepeat":n={[o]:{classNamePrefix:"em-mob-background_repeat-",value:t[o]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":n={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":l.mobilePaddingTop=l.mobilePaddingBottom=t[o],n={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":l.mobilePaddingLeft=l.mobilePaddingRight=t[o],n={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobileFontSize":n={[o]:{classNamePrefix:"em-mob-font_size-",value:t[o],dim:l.mobileFontSizeDim}};break;case"href":let a=t[o];"https://http"===a.substring(0,12)&&(a=a.substring(8,a.length),l.href=a),n={[o]:a},"https://"===t[o].substring(0,8)||"http://"===t[o].substring(0,7)?fe("https://"):"mailto:"===t[o].substring(0,7)?fe("mailto:"):"tel:"===t[o].substring(0,4)?fe("tel:"):"sms:"===t[o].substring(0,4)?fe("sms:"):"ftp://"===t[o].substring(0,6)?fe("ftp://"):"skype:"===t[o].substring(0,6)?fe("skype:"):"viber:"===t[o].substring(0,6)?fe("viber:"):fe("");break;case"backgroundPositionX":case"backgroundPositionY":n={[o]:isNaN(parseFloat(t[o].position))?t[o].position:t[o].position+t[o].unit};break;default:n=t}var p;"borderPosition"!==o&&"mobileBorderPosition"!==o&&(a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:n}),"mobileBorderRadiusAll"!==o&&"mobileBorderRadiusTopLeft"!==o&&"mobileBorderRadiusTopRight"!==o&&"mobileBorderRadiusBottomLeft"!==o&&"mobileBorderRadiusBottomRight"!==o&&Re({...e,...n,mobileBorderRadius:{...e.mobileBorderRadius,...null===(p=n)||void 0===p?void 0:p.mobileBorderRadius},activateSection:null,changeKey:o}))},Le=e=>{r.setFieldValue("href","mergetag"!==e?e:""),fe(e)},Oe=({target:e})=>{const{selectionStart:t,selectionEnd:l}=e;e&&_e({target:e,selection:{start:t,end:l}})};(0,o.useEffect)(()=>{var t;Ae(!(null===(t=e.textReplacer)||void 0===t||!t.length))},[e]);return o.createElement(C.A,{form:r,layout:"vertical",name:"selected_button_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",align:"",valign:"",border:"",boxShadow:"",show:"all",borderPosition:Ft[Be]||"borderAll",mobileBorderPosition:Mt[xe]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",href:"https://"},onValuesChange:Ne,autoComplete:"off",className:"element-controls"},!L&&o.createElement(i.A,{title:l("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(u.A,{className:"selected_form-mobile-props-title",message:l("Appearance on mobile devices"),type:"info"})),L?o.createElement(Oa,{form:r,elementSettings:e,showAddParagraph:!1,isButton:!0}):o.createElement(o.Fragment,null,A===V.ND&&S.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(h.A,{gutter:20,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(sa,{form:r,elementSettings:e,imgParent:!0})),w.formButtonFieldTextAlignEnabled&&o.createElement(b.A,{span:12,style:{textAlign:"right"}},o.createElement(Fa,{form:r,name:"mobileTextAlign",elementSettings:e,imgParent:!0}))),!!e.showOnMobile&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:24}}),o.createElement(i.A,{trigger:["hover"],title:l("Hyperlink URL"),placement:"bottom"},o.createElement(C.A.Item,{name:"href",style:{marginBottom:I.formItemMarginBottomMD+4}},o.createElement(B.A,{addonBefore:o.createElement(ul,{linkProtocol:be,handleLinkProtocolsChange:Le,__:l}),placeholder:l("Hyperlink URL"),allowClear:!0,prefix:o.createElement(ml,{linkProtocol:be})})))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Text"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{de(e=>!e),se&&(t.mobileFontSize="",a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileFontSize:{value:null,dim:"px",classNamePrefix:"em-mob-font_size-"}}}))})}},se?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),se&&o.createElement(o.Fragment,null,!!e.showOnMobile&&o.createElement(Pa,{form:r,elementSettings:e,setLinkProtocol:fe,linkProtocol:be,showAddParagraph:!1,isButton:!0}),o.createElement(h.A,{gutter:10,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Ta,null)))),o.createElement(c.A,{className:"selected-td-form__divider"}),w.formButtonFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Padding"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{pe(e=>!e),ue&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))})}},ue?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ue&&o.createElement(h.A,{gutter:10,style:{paddingBottom:8}},o.createElement(o.Fragment,null,o.createElement(Ja,{form:r,elementSettings:e,mobilePaddingsExt:D,setMobilePaddingsExt:W}))),o.createElement(c.A,{className:"selected-td-form__divider"})),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Size"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{oe(e=>!e),le&&(t.mobileWidth="",t.mobileHeight="",a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))})}},le?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),le&&o.createElement(h.A,{gutter:10,style:{paddingBottom:8}},o.createElement(b.A,{span:12},o.createElement("div",{style:{marginBottom:2*I.formItemMarginBottomXS}},o.createElement(i.A,{title:l("Width"),placement:"bottom"},o.createElement(ra,{form:r,name:"mobileWidth",elementSettings:e})))),o.createElement(b.A,{span:12},o.createElement("div",{style:{marginBottom:2*I.formItemMarginBottomXS}},o.createElement(i.A,{title:l("Height"),placement:"bottom"},o.createElement(ia,{form:r,name:"mobileHeight",elementSettings:e}))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Background"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{ie(e=>!e),t.mobileBackgroundColor=ne?"":e.commonStyles.buttons.backgroundColor||"#1C52DC",a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})})}},ne?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ne&&o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:(w.formButtonFieldBackgroundImageEnabled,I.formItemMarginBottomMD+4)}},o.createElement(ja,{form:r,elementSettings:e,label:l("Background color")}))),w.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Borders"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{q(e=>!e),U?(t.mobileBorderAll=Dt,t.mobileBorderTop=Dt,t.mobileBorderBottom=Dt,t.mobileBorderRight=Dt,t.mobileBorderLeft=Dt):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})})}},U?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),U&&o.createElement("div",{style:{marginBottom:4}},o.createElement(St,{form:r,typeOfForm:"mobile"}))),w.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Border radius"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{K(e=>!e),Z?(t.mobileBorderRadiusAll=null,_(!0)):t.mobileBorderRadiusAll=5,a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})})}},Z?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),Z&&o.createElement("div",{style:{marginBottom:4}},o.createElement(jt,{form:r,oneBorderRadiusValue:E,setOneBorderRadiusValue:_,elementSettings:e,typeOfForm:"mobile"}))),w.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Box shadow"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{te(e=>!e),ee?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})})}},ee?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ee&&o.createElement("div",{style:{marginBottom:4}},o.createElement(oa,{boxShadow:d,typeOfForm:"mobile"}))),w.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("AMP visibility")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Aa,null)))),w.formFieldAmpVisibilityEnabled&&e.isAmp&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("AMP visibility")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Aa,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement(u.A,{className:"selected_form-desktop-props-title",message:l("Appearance on mobile devices"),type:"info"}),o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(h.A,{gutter:20,style:{paddingBottom:4}},o.createElement(b.A,{span:12},o.createElement(ea,{form:r,elementSettings:e})),w.formButtonFieldTextAlignEnabled&&o.createElement(b.A,{span:12,style:{textAlign:"right"}},o.createElement(ut,{form:r,name:"textAlign",elementSettings:e}))),o.createElement(c.A,{className:"selected-td-form__divider",style:{marginBottom:24}}),o.createElement(i.A,{trigger:["hover"],title:l("Hyperlink URL"),placement:"bottom"},o.createElement(C.A.Item,{name:"href",style:{marginBottom:w.formButtonFieldReplacerEnabled?I.formItemMarginBottomXS:I.formItemMarginBottomMD+4}},o.createElement(B.A,{addonBefore:o.createElement(ul,{linkProtocol:be,handleLinkProtocolsChange:Le,__:l}),placeholder:l("Hyperlink URL"),allowClear:!0,onSelect:Oe,prefix:o.createElement(ml,{linkProtocol:be})}))),w.formButtonFieldReplacerEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:3},o.createElement(i.A,{title:l("Text replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button ant-form-item",{"selected-td-form__button--active":ye}),icon:o.createElement(z.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{Ae(!ye),ye?(r.setFieldValue("textReplacer",""),a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{textReplacer:""}})):setTimeout(()=>P.current.focus())},ref:O}))),o.createElement(b.A,{span:21},ye&&o.createElement(i.A,{trigger:["hover"],title:l("Text"),placement:"bottom"},o.createElement(C.A.Item,{name:"textReplacer"},o.createElement(B.A,{placeholder:l("The code that will replace this text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Text"),onChange:e=>{""!==e.target.value&&O.current.classList.add("selected-td-form__button--active")},onKeyDown:e=>{const t=e.target,l=t.value,o=t.selectionStart;if(0!==o||" "!==e.key){if(" "===e.key){if(o!==l.length)return void e.preventDefault();l.endsWith(" ")&&e.preventDefault()}}else e.preventDefault()},ref:P,onSelect:Oe})))))),o.createElement(c.A,{className:"selected-td-form__divider"}),w.formButtonFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Padding"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{me(e=>!e),ce&&(t.paddingLeftRight="",t.paddingLeft="",t.paddingRight="",t.paddingTopBottom="",t.paddingTop="",t.paddingBottom="",a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))})}},ce?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ce&&o.createElement(h.A,{gutter:I.marginSM,style:{marginBottom:4}},o.createElement(o.Fragment,null,o.createElement(b.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:F?"block":"none"}},o.createElement(i.A,{title:l("Horizontal padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingLeftRight"},o.createElement(Lt.A,{min:0,max:300,placeholder:l("Horizontal"),prefix:o.createElement(z.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:F?"none":"block"}},o.createElement(i.A,{trigger:["hover"],title:l("Left padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingLeft",style:{marginBottom:I.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,max:300,placeholder:l("Left"),prefix:o.createElement(z.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(i.A,{trigger:["hover"],title:l("Right padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingRight"},o.createElement(Lt.A,{min:0,max:300,placeholder:l("Right"),prefix:o.createElement(z.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(b.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:F?"block":"none"}},o.createElement(i.A,{title:l("Vertical padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingTopBottom"},o.createElement(Lt.A,{min:0,max:300,placeholder:l("Vertical"),prefix:o.createElement(z.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:F?"none":"block"}},o.createElement(i.A,{trigger:["hover"],title:l("Top padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingTop",style:{marginBottom:I.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,max:300,placeholder:l("Top"),prefix:o.createElement(z.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(i.A,{trigger:["hover"],title:l("Bottom padding"),placement:"bottom"},o.createElement(C.A.Item,{name:"paddingBottom"},o.createElement(Lt.A,{min:0,max:300,placeholder:l("Bottom"),prefix:o.createElement(z.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(b.A,{span:4,style:{width:45,flex:"auto",maxWidth:"12%"}},o.createElement(i.A,{title:l("Individual padding"),placement:"bottom"},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!F}),onClick:()=>{M(e=>!e);const t=r.getFieldsValue(!0);F||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},o.createElement(z.A,{icon:"PaddingSwitcher"})))))),o.createElement(c.A,{className:"selected-td-form__divider"})),o.createElement("div",{className:"form-group-title"},l("Size")),o.createElement(h.A,{gutter:I.marginSM,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(i.A,{title:l("Width"),placement:"left"},o.createElement(C.A.Item,{name:"width",style:{marginBottom:I.formItemMarginBottomXS}},o.createElement(Lt.A,{min:0,max:ge,placeholder:l("Width"),prefix:o.createElement(Ee.A,null),addonAfter:o.createElement(C.A.Item,{name:"widthDim",noStyle:!0},El)})))),o.createElement(b.A,{span:12},o.createElement(i.A,{title:l("Height"),placement:"left"},o.createElement(C.A.Item,{name:"height"},o.createElement(Lt.A,{min:0,placeholder:l("Height"),prefix:o.createElement($o.A,null),addonAfter:"px"}))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{style:{paddingTop:I.formItemMarginBottomMD+4,paddingBottom:4}},o.createElement(Pa,{form:r,elementSettings:e,showAddParagraph:!1,isButton:!0,setLinkProtocol:fe,linkProtocol:be,linkTarget:ve})),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Background"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{re(e=>!e),ae?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",T(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})})}},ae?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),ae&&o.createElement(rr,{form:r,backgroundImageEmpty:x,appConfig:w,token:I,elementSettings:e,backgroundRepeatOptions:ke,handleChangeValues:Ne}),w.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Borders"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{G(e=>!e),j?(t.borderAll=Dt,t.borderTop=Dt,t.borderBottom=Dt,t.borderRight=Dt,t.borderLeft=Dt):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})})}},j?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),j&&o.createElement("div",{style:{marginBottom:4}},o.createElement(St,{form:r,elementSettings:e}))),w.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Border radius"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{$(e=>!e),X?(t.borderRadiusAll=0,f(!0)):t.borderRadiusAll=5,a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})})}},X?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),X&&o.createElement("div",{style:{marginBottom:4}},o.createElement(jt,{form:r,oneBorderRadiusValue:p,setOneBorderRadiusValue:f,elementSettings:e}))),w.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Box shadow"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=r.getFieldsValue(!0);setTimeout(()=>{J(e=>!e),Q?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),a({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})})}},Q?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),Q&&o.createElement("div",{style:{marginBottom:4}},o.createElement(oa,{boxShadow:d}))),w.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Display control")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(ua,{elementSettings:e,form:r})))),w.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("AMP visibility")),o.createElement(h.A,{gutter:20,style:{marginBottom:4}},o.createElement(b.A,{span:12},o.createElement(Aa,null))))))))},hr=({elementSettings:e})=>{const{__:t}=(0,y.s9)(),[l]=C.A.useForm(),{TextArea:a}=B.A,r=(0,Pe.XW)();(0,o.useEffect)(()=>{e&&l.setFieldsValue({...e})},[l,e]);return o.createElement(C.A,{form:l,layout:"vertical",name:"selected_variable_form",initialValues:{value:""},onValuesChange:t=>{r({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:t})},autoComplete:"off"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(C.A.Item,{label:t("Variable value"),name:"value",tooltip:{title:t("Type the output parameters of your platform. E.g., ")+"${Recipient.FirstName}",icon:o.createElement(R.A,null)},style:{marginBottom:35}},o.createElement(a,{rows:4,placeholder:t("Variable value")}))))},{useToken:br}=r.A,fr=({elementSettings:e,setElementSettings:t,postfix:l="",form:a,handleSelect:r})=>{const{__:n}=(0,y.s9)(),{token:d}=br(),c=(0,Y.rD)(),m=(0,Pe.XW)(),u="src"+l,p="title"+l,h="alt"+l,b="link"+l,f="imgReplacer"+l,E=(0,o.useRef)(null),v=(0,o.useRef)(null),_=(0,o.useRef)(null),A=(0,o.useRef)(null),S=(0,o.useRef)(null),w=(0,o.useRef)(null),x=(0,o.useRef)(null),T=(0,o.useRef)(null),[R,N]=(0,o.useState)(""),[L,P]=(0,o.useState)(""),[O,F]=(0,o.useState)(""),[M,D]=(0,o.useState)(!1),[W,j]=(0,o.useState)("https://");(0,o.useEffect)(()=>{var t,l,o;P(null===(t=e.images)||void 0===t?void 0:t[h]),F(null===(l=e.images)||void 0===l?void 0:l[p]),N(null===(o=e.images)||void 0===o?void 0:o[b])},[e,h,p,b]);return o.createElement(o.Fragment,null,("img"===e.type||"video"===e.type||"carousel"===e.type)&&o.createElement(C.A.Item,{style:{marginBottom:0}},o.createElement(Le,{form:a,label:n("Image path"),name:u,placeholder:n("Image path"),elementSettings:e,tooltipTitle:""})),o.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},o.createElement(s.A,{size:8},o.createElement(i.A,{title:L||n("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!!L}),onClick:()=>{L?(P(""),a.setFieldValue("alt",""),m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[h]:""}})):(P(_.current&&_.current.input.value?_.current.input.value:"..."),setTimeout(()=>{_.current.focus()}))},ref:A},o.createElement("span",{className:"addon-text-content"},"Alt"))),c.formFieldImageTitleEnabled&&o.createElement(i.A,{title:O||n("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!!O}),onClick:()=>{O?(F(!1),a.setFieldValue("title",""),m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[p]:""}})):(F(S.current&&S.current.input.value?S.current.input.value:"..."),setTimeout(()=>{S.current.focus()}))},ref:w},o.createElement("span",{className:"addon-text-content"},"Title"))),o.createElement(i.A,{title:R||n("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":!!R}),icon:o.createElement(zt.A,{className:"selected-td-form__icon-radius"}),onClick:()=>{R?(N(""),a.setFieldValue(b,""),m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[b]:""}})):(N(E.current&&E.current.input.value?E.current.input.value:"..."),setTimeout(()=>{E.current.focus()}))},ref:v})),o.createElement(i.A,{title:n("Image replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(g.Ay,{className:k()("selected-td-form__button",{"selected-td-form__button--active":M}),icon:o.createElement(z.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{D(!M),M?(a.setFieldValue(f,""),m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[f]:""}})):setTimeout(()=>x.current.focus())},ref:T}))),o.createElement(s.A,{size:8},o.createElement(i.A,{title:n("Remove slide"),placement:"bottom"},o.createElement(g.Ay,{type:"text",onClick:o=>{var r;const n=a.getFieldsValue(!0),i=+l.substring(1),s=Object.keys(null===n||void 0===n?void 0:n.images).reduce((e,t)=>(t.includes(l)||(e[t]=n[t]),e),{}),d=null===(r=e.carouselImages)||void 0===r?void 0:r.filter((e,t)=>t!==i);t(e=>({...e,settings:{...e.settings,carouselImages:d}})),m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:V.bV.CAROUSEL,caption:e.caption,settings:{...e,carouselImages:d}}),a.setFieldsValue({images:s})},icon:o.createElement(I.A,null)})))),(!!R||!!L||!!O||!!M)&&o.createElement("div",null,!!R&&o.createElement(i.A,{trigger:["hover"],title:n("Hyperlink URL"),placement:"bottom"},o.createElement(C.A.Item,{name:b,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},o.createElement(B.A,{addonBefore:o.createElement(ul,{linkProtocol:W,handleLinkProtocolsChange:e=>{a.setFieldValue("LinkName","mergetag"!==e?e:""),j(e)},__:n}),placeholder:n("Hyperlink URL"),allowClear:!0,ref:E,onChange:e=>{""===e.target.value?N("..."):(v.current.classList.add("selected-td-form__button--active"),N(e.target.value));const t=e.target.value;"https://"===t.substring(0,8)?j("https://"):"mailto:"===t.substring(0,7)?j("mailto:"):"tel:"===t.substring(0,4)?j("tel:"):"sms:"===t.substring(0,4)?j("sms:"):"ftp://"===t.substring(0,6)?j("ftp://"):"skype:"===t.substring(0,6)?j("skype:"):"viber:"===t.substring(0,6)?j("viber:"):j("")},onSelect:r,prefix:o.createElement(ml,{linkProtocol:W})}))),!!L&&o.createElement(i.A,{trigger:["hover"],title:n("Alternative text"),placement:"bottom"},o.createElement(C.A.Item,{name:h,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},o.createElement(B.A,{placeholder:n("Alternative text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Alt"),onChange:e=>{""===e.target.value?P("..."):(A.current.classList.add("selected-td-form__button--active"),P(e.target.value))},ref:_,onSelect:r}))),c.formFieldImageTitleEnabled&&!!O&&o.createElement(i.A,{trigger:["hover"],title:n("Tooltip text"),placement:"bottom"},o.createElement(C.A.Item,{name:p,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},o.createElement(B.A,{placeholder:n("Enter the title of the image"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Title"),onChange:e=>{""===e.target.value?F("..."):(w.current.classList.add("selected-td-form__button--active"),F(e.target.value))},ref:S,onSelect:r}))),!!M&&o.createElement(i.A,{trigger:["hover"],title:n("Image src"),placement:"bottom"},o.createElement(C.A.Item,{name:f,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},o.createElement(B.A,{placeholder:n("\u0421ode that will replace the image `src`"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},n("Image src")),onChange:e=>{""!==e.target.value&&T.current.classList.add("selected-td-form__button--active")},ref:x,onSelect:r})))))},Er={loop:!1,autoplay:!1,borderRadiusAll:0,borderRadiusTopLeft:0,borderRadiusBottomLeft:0,borderRadiusTopRight:0,borderRadiusBottomRight:0,link:"https://",images:{},src_0:"",renderedHeight_0:0,renderedWidth_0:0,imgReplacer_0:"",title_0:"",alt_0:""},{useToken:vr}=r.A,_r=({elementSettings:e})=>{const{__:t}=(0,y.s9)(),{token:l}=vr(),[a]=C.A.useForm();let r=(0,v.wA)();const n=(0,Y.rD)(),d=(0,Pe.K9)(),m=(0,Pe.XW)(),p=(0,v.d4)(Ie.Ct),E=(0,v.d4)(Ie.CS),[_,A]=(0,o.useState)(!0),[S,k]=(0,o.useState)(!0),[w,x]=(0,o.useState)(!1),[T,R]=(0,o.useState)(!1),[N,L]=(0,o.useState)("https://"),[I,P]=(0,o.useState)(null===a||void 0===a?void 0:a.getFieldsValue(!0)),[O,F]=(0,o.useState)(e),[M,W]=(0,o.useState)(null),[j,H]=(0,o.useState)(),[G,U]=(0,o.useState)(!1),[q,X]=(0,o.useState)(!1),[$,Z]=(0,o.useState)({start:0,end:0}),Q=(0,o.useRef)(null),J=`selected_${O.type}_form_link`,ee=(0,v.d4)(Ie.Fv),te=(0,v.d4)(Ie.yy),le=ee&&"bottom"!==te;(0,o.useEffect)(()=>{G&&Q.current&&Q.current.focus()},[G]),(0,o.useEffect)(()=>{F(e)},[e]);const oe=(0,v.d4)(wa.GH);(0,o.useEffect)(()=>{var e;null!==oe&&void 0!==oe&&null!==(e=oe.items)&&void 0!==e&&e.length&&H((0,Y.cM)(oe.items,t,(e,t)=>{U(!1),d(V.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()}))},[oe,H,t,U,d]);const ae=(0,Ll.cR)();(0,o.useEffect)(()=>{const e=new K.jG;return e.addDisposable((0,Ca.a)(ae,"focusin",({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||W(e)})),e.addDisposable((0,Ca.a)(ae,"click",({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||U(!1)})),()=>{e.dispose()}},[ae]);(0,o.useEffect)(()=>{const e=null===a||void 0===a?void 0:a.getFieldsValue(!0);P(e)},[a]);const re=({target:e})=>{if(e&&!q){const{selectionStart:t,selectionEnd:l}=e;Z({start:t,end:l})}X(!1)};(0,o.useEffect)(()=>{if(O.settings){var e,t,l,o,r,n,i,s,d,c,m,u,p,g,h;const y=O.settings,S=bl(y);var b,f,E,v,_;if(null===a||void 0===a||a.setFieldsValue(S),P(S),y.link&&L(pl(y.link,"https://")),!gl(null===(e=y.borderRadius)||void 0===e?void 0:e.all))gl(null===(b=y.borderRadius)||void 0===b?void 0:b.topLeft)||gl(null===(f=y.borderRadius)||void 0===f?void 0:f.bottomLeft)||gl(null===(E=y.borderRadius)||void 0===E?void 0:E.topRight)||gl(null===(v=y.borderRadius)||void 0===v?void 0:v.bottomRight)?A(!1):gl(null===(_=y.borderRadius)||void 0===_?void 0:_.all)||A(!0);gl(null===(t=y.mobileBorderRadius)||void 0===t?void 0:t.topLeft)||gl(null===(l=y.mobileBorderRadius)||void 0===l?void 0:l.bottomLeft)||gl(null===(o=y.mobileBorderRadius)||void 0===o?void 0:o.topRight)||gl(null===(r=y.mobileBorderRadius)||void 0===r?void 0:r.bottomRight)?k(!1):k(!0),x(!(null===(n=y.borderRadius)||void 0===n||!n.all)||!(null===(i=y.borderRadius)||void 0===i||!i.topLeft)||!(null===(s=y.borderRadius)||void 0===s||!s.bottomLeft)||!(null===(d=y.borderRadius)||void 0===d||!d.topRight)||!(null===(c=y.borderRadius)||void 0===c||!c.bottomRight)),R(!(null===(m=y.mobileBorderRadius)||void 0===m||!m.all)||!(null===(u=y.mobileBorderRadius)||void 0===u||!u.topLeft)||!(null===(p=y.mobileBorderRadius)||void 0===p||!p.bottomLeft)||!(null===(g=y.mobileBorderRadius)||void 0===g||!g.topRight)||!(null===(h=y.mobileBorderRadius)||void 0===h||!h.bottomRight))}},[a,O]);(0,Sa.A)(e=>{const t=e.data.operation;t===V.Ru.APPLICATION_OPEN_IMAGE_AI_POPUP?(r((0,Ae.tm)(O.settings.src)),r((0,D.qf)(V.lx.UPLOAD_IMAGE_MODAL_AI))):t===V.Ru.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?(r((0,Ae.tm)(O.settings.src)),r((0,D.qf)(V.lx.UPLOAD_IMAGE_MODAL_UPLOAD))):t===V.Ru.APPLICATION_OPEN_IMAGE_EDIT_POPUP?(r((0,Ae.tm)(O.settings.src)),r((0,D.qf)(V.lx.UPLOAD_IMAGE_MODAL_EDIT))):t===V.Ru.APPLICATION_OPEN_IMAGE_GIF_POPUP?(r((0,Ae.tm)(O.settings.src)),r((0,D.qf)(V.lx.UPLOAD_IMAGE_MODAL_GIF))):t===V.Ru.APPLICATION_OPEN_IMAGE_STOCK_POPUP?(r((0,Ae.tm)(O.settings.src)),r((0,D.qf)(V.lx.UPLOAD_IMAGE_MODAL_STOCK))):t===V.Ru.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(r((0,D.Os)()),r((0,D.Oo)()))});return o.createElement(C.A,{form:a,layout:"vertical",name:"selected_carousel_form",initialValues:Er,onValuesChange:e=>{const t=fl(O.settings,a,e);m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:V.bV.CAROUSEL,caption:t.caption,settings:t}),F(e=>({...e,settings:{...e.settings,...t}}))},autoComplete:"off",className:"element-controls"},!le&&o.createElement(i.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},o.createElement(u.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),p===V.ND&&E.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement("p",null,t("No properties to edit.")))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(i.A,{trigger:["hover"],title:t("Link for all slides"),placement:"bottom"},o.createElement(C.A.Item,{name:"link"},o.createElement(B.A,{addonBefore:o.createElement(ul,{linkProtocol:N,handleLinkProtocolsChange:e=>{a.setFieldValue("link","mergetag"!==e?e:""),L(e)},__:t}),placeholder:t("Link for all slides"),allowClear:!0,onSelect:re,prefix:o.createElement(ml,{linkProtocol:N})}))),o.createElement(c.A,{className:"selected-td-form__divider"}),n.mergeTagsShow&&j&&o.createElement(o.Fragment,null,o.createElement(b.A,{span:24,id:"merge_tags_wrapper"},o.createElement(C.A.Item,{style:{marginBottom:l.formItemMarginBottomMD,marginTop:l.formItemMarginBottomMD}},o.createElement(g.Ay,{id:"merge_tags_button",icon:o.createElement(z.A,{icon:"MergeTags"}),style:{width:"100%",display:G?"none":"inline-flex"},onClick:()=>U(!0)},t("Merge tags")),o.createElement(at.A,{ref:Q,popupClassName:"merge-tags",options:j,placeholder:t("Start typing the title"),showSearch:{filter:(e,t)=>t.some(t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1),render:(e,t)=>{const l=t.map((t,l)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return o.createElement("span",{key:t.value},0!==l&&o.createElement("span",null,"\xa0/\xa0"),a.map((t,l)=>t.toLowerCase()===e.toLowerCase()?o.createElement("span",{key:l,style:{color:"red"}},t):t))});return o.createElement("div",{title:t.map(e=>e.label).join(" / ")},l)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(e,t)=>{if(U(!1),e){const l=oe.syntax.length>1?j.findIndex(e=>e.key===t[0].key):0,o=oe.syntax[l].replace("%value%",e[e.length-1]),r=`selected_${O.type}_form${"carousel"===O.type?"_images":""}`;["imgReplacer","title","alt","src","link"].some(e=>null===M||void 0===M?void 0:M.getAttribute("id").includes(`${r}_${e}`))||null!==M&&void 0!==M&&M.getAttribute("id").includes(J)?((e,t)=>{const l=document.getElementById(t);if(l){var o,r;const s=`selected_${O.type}_form_${t.includes("__images_")?"_images":""}_`,d=t.substring(t.indexOf(s)+s.length),c=null===(o=l.value)||void 0===o?void 0:o.substring(0,$.start),u=null===(r=l.value)||void 0===r?void 0:r.substring($.end);let p={[d]:c+e+u};var n;if(d.includes("_"))p={carouselImages:[...(null===(n=O.settings)||void 0===n?void 0:n.carouselImages)||[]]},p.carouselImages[d.split("_")[1]][d.split("_")[0]]=c+e+u;else if(O.type===V.bV.CAROUSEL&&J===t){var i;p={[d]:c+e+u,carouselImages:[...(null===(i=O.settings)||void 0===i?void 0:i.carouselImages.map(t=>({...t,link:c+e+u})))||[]]}}m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:V.bV.CAROUSEL,settings:{...O.settings,...p}}),F(e=>({...e,settings:{...e.settings,...p}})),a.setFieldValue(d,c+e+u),l.focus(),setTimeout(()=>{l.selectionStart=$.start,l.selectionEnd=$.start+e.length},400),X(!0)}})(o,null===M||void 0===M?void 0:M.getAttribute("id")):(a.setFieldValue("imgReplacer",o),m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:V.bV.CAROUSEL,settings:{...O.settings,imgReplacer:o}}),F(e=>({...e,settings:{...e.settings,imgReplacer:o}})))}},style:{display:G?"block":"none"},open:G,onKeyDown:e=>{"Escape"===e.key&&U(!1)}}))),o.createElement(c.A,{className:"selected-td-form__divider"})),o.createElement(C.A.List,{name:"images",initialValue:null===I||void 0===I?void 0:I.images},()=>{var e,t;return o.createElement("div",{style:{paddingTop:l.formItemMarginBottomMD+4}},null===O||void 0===O||null===(e=O.settings)||void 0===e||null===(t=e.carouselImages)||void 0===t?void 0:t.map((e,t)=>o.createElement("div",{className:"carousel__slide",key:t},o.createElement(fr,{elementSettings:I,setElementSettings:F,postfix:"_"+t,form:a,handleSelect:re}))))}),o.createElement(b.A,{span:24},o.createElement(C.A.Item,{style:{marginBottom:l.formItemMarginBottomMD}},o.createElement(g.Ay,{id:"add_slide_button",icon:o.createElement(z.A,{icon:"AddSlide"}),style:{width:"100%"},onClick:()=>(()=>{var e,t;const{width:l,height:o,renderedWidth:a,renderedHeight:r}=(null===O||void 0===O||null===(e=O.settings)||void 0===e?void 0:e.carouselImages[0])||{width:{value:600},height:{value:600},renderedWidth:600,renderedHeight:600},n={src:"https://emcdn.ru/1865/231031_17_BGU9Mso.png",width:{value:l.value,dim:"px"},height:{value:o.value,dim:"px"},alt:"",title:"",link:null,renderedWidth:a,renderedHeight:r,imgReplacer:"",mobileWidth:{value:null,dim:"px"},mobileHeight:{value:null,dim:"px"},mobileBorderRadius:{all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null}},i=[...null===O||void 0===O||null===(t=O.settings)||void 0===t?void 0:t.carouselImages,n];m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:V.bV.CAROUSEL,settings:{...O.settings,carouselImages:i}}),F(e=>({...e,settings:{...e.settings,carouselImages:i}}))})()},t("Add slide")))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:20,style:{marginTop:l.formItemMarginBottomMD-10}},o.createElement(b.A,{span:12},o.createElement(s.A,{size:10,align:"baseline"},o.createElement(C.A.Item,{name:"loop",valuePropName:"checked",style:{marginBottom:l.formItemMarginBottomMD-6}},o.createElement(f.A,{size:"small",id:"Loop"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"Loop"},t("Loop"))))),o.createElement(b.A,{span:12},o.createElement(s.A,{size:10,align:"baseline"},o.createElement(C.A.Item,{name:"autoplay",valuePropName:"checked",style:{marginBottom:l.formItemMarginBottomMD-6}},o.createElement(f.A,{size:"small",id:"Autoplay"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"Autoplay"},t("Autoplay")))))),o.createElement(c.A,{className:"selected-td-form__divider"}),n.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout(()=>{x(e=>!e),a.setFieldValue("borderRadiusAll",w?0:5),m({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:V.bV.CAROUSEL,settings:{...O.settings,borderRadius:{all:w?"":5}}}),F(e=>({...e,settings:{...e.settings,borderRadius:{all:w?null:5}}}))})}},w?o.createElement(Yo.A,null):o.createElement(Zo.A,null)))),w&&o.createElement("div",{style:{marginBottom:4}},o.createElement(jt,{form:a,oneBorderRadiusValue:_,setOneBorderRadiusValue:A,elementSettings:O.settings}))))))},yr={animate:!0,expandSingleSection:!0,sections:[{expanded:!1,index:0}]},{useToken:Ar}=r.A,Sr=({elementSettings:e})=>{const{__:t}=(0,y.s9)(),{token:l}=Ar(),[a]=C.A.useForm(),r=(0,Pe.XW)(),[n,i]=(0,o.useState)(e);(0,o.useEffect)(()=>{i(e)},[e]),(0,o.useEffect)(()=>{if(n.settings){const e=bl(n.settings);null===a||void 0===a||a.setFieldsValue(e)}},[a,n]);return o.createElement(C.A,{form:a,layout:"vertical",name:"selected_carousel_form",initialValues:yr,onValuesChange:e=>{const t=fl(n.settings,a,e);r({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:n.type,caption:t.caption,settings:t}),i(e=>({...e,settings:{...e.settings,...t}}))},autoComplete:"off",className:"element-controls"},o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(h.A,{gutter:20},o.createElement(b.A,{span:15},o.createElement(s.A,{size:10,align:"baseline"},o.createElement(C.A.Item,{name:"expandSingleSection",valuePropName:"checked"},o.createElement(f.A,{size:"small",id:"ExpandSingleSection"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"ExpandSingleSection"},t("Expand only one section"))))),o.createElement(b.A,{span:9},o.createElement(s.A,{size:10,align:"baseline"},o.createElement(C.A.Item,{name:"animate",valuePropName:"checked"},o.createElement(f.A,{size:"small",id:"Animate"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"Animate"},t("Animate")))))),o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(C.A.List,{name:"sections"},()=>{var e,a;return o.createElement("div",{style:{paddingTop:l.formItemMarginBottomMD+4}},null===n||void 0===n||null===(e=n.settings)||void 0===e||null===(a=e.sections)||void 0===a?void 0:a.map((e,l)=>{var a,d;return o.createElement(h.A,{gutter:24,key:`expanded_${l}`},o.createElement(b.A,{span:20},o.createElement(s.A,{size:10,align:"baseline"},o.createElement("span",{style:{position:"relative",top:2}},t("Section ")+(l+1)),o.createElement(C.A.Item,{name:`expanded_${l}`},o.createElement(f.A,{size:"small",id:`expanded_${l}`,checked:e.expanded})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:`expanded_${l}`},t("expanded"))))),o.createElement(b.A,null,(null===n||void 0===n||null===(a=n.settings)||void 0===a||null===(d=a.sections)||void 0===d?void 0:d.length)>1&&o.createElement(g.Ay,{type:"text",icon:o.createElement(I.A,null),style:{marginRight:"auto"},onClick:()=>{return e=l,i(t=>{var l;return{...t,settings:{...t.settings,sections:null===(l=n.settings.sections)||void 0===l?void 0:l.filter((t,l)=>l!==e)}}}),void r({operation:V.Ru.SANDBOX_ACCORDION_REMOVE_SECTION,settings:{index:e}});var e}})))}))}),o.createElement(h.A,{gutter:20},o.createElement(b.A,{span:24},o.createElement(C.A.Item,{style:{marginBottom:l.formItemMarginBottomMD}},o.createElement(g.Ay,{style:{width:"100%",display:"block"},icon:o.createElement(z.A,{icon:"MergeTags"}),onClick:()=>(i(e=>{var t;return{...e,sections:null===n||void 0===n||null===(t=n.settings)||void 0===t?void 0:t.sections.push({expanded:!1})}}),void r({operation:V.Ru.SANDBOX_ACCORDION_ADD_SECTION,settings:{section:t("Section title"),text:t("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}}))},t(" Add section"))))),o.createElement(c.A,{className:"selected-td-form__divider"}))))},kr=({className:e=null,formSettings:t,emailElementType:l})=>{const a=(0,v.wA)(),r=(0,K.Cb)(),n=(0,o.useRef)(),i=(0,v.d4)(Ie.B),s=(0,v.d4)(H.qX),d=(0,v.d4)(Xe.qX),c=l===V.Tm?s:d,[m,u]=(0,o.useState)(c);(0,o.useEffect)(()=>{u(c.type===V.bV.CAROUSEL||c.type===V.bV.IMG?t.settings:c)},[c,t.settings]);return(0,Sa.A)(e=>{const t=e.data.operation,l=e.data.action;if(t===V.Ru.APPLICATION_ACTION){function o(e,t=null){const l={[e]:t||!m[e]};r(l,m.type),a((0,H.G_)(l)),u(e=>({...e,...l}))}"toggle_strong"===l&&o("textStrong"),"toggle_italic"===l&&o("textItalic"),"toggle_underline"===l&&o("textUnderline"),"toggle_strikethrough"===l&&o("textStrikethrough"),"textAlign_left"===l&&o("textAlign","left"),"textAlign_right"===l&&o("textAlign","right"),"textAlign_center"===l&&o("textAlign","center")}}),o.createElement(Xo.A,{nodeRef:n,in:i===V.yI,timeout:300,classNames:"transition"},o.createElement("div",{ref:n,className:k()("selected-element-panel-content",{[e]:e})},(c.type===V.bV.IMG||c.type===V.bV.COUNTDOWN||c.type===V.bV.VIDEO)&&o.createElement(xa,{elementSettings:c}),c.type===V.bV.TEXT&&o.createElement(Ma,{elementSettings:c}),c.type===V.bV.LINK&&o.createElement(Xa,{elementSettings:c}),c.type===V.bV.TABLE&&o.createElement(Ua,{elementSettings:c}),(c.type===V.bV.TD||c.type===V.bV.STRUCTURE||c.type===V.bV.GROUP||c.type===V.bV.COLUMN)&&o.createElement(ir,{elementSettings:c}),c.type===V.bV.VAR&&o.createElement(hr,{elementSettings:c}),c.type===V.bV.BUTTON&&o.createElement(gr,{elementSettings:c}),c.type===V.bV.DIV&&o.createElement(dr,{elementSettings:c}),c.type===V.bV.VINDENT&&o.createElement($a,{elementSettings:c}),c.type===V.bV.FLOAT_BLOCK&&o.createElement(ur,{elementSettings:c}),t.type===V.bV.CAROUSEL&&o.createElement(_r,{elementSettings:t}),t.type===V.bV.ACCORDION&&o.createElement(Sr,{elementSettings:t})))},wr=({className:e=null,selectedElement:t={parent:!1},formSettings:l,emailElementType:a})=>o.createElement("div",{className:k()("selected-element-panel",{[e]:e}),style:{height:"100%"}},o.createElement(kr,{className:k()("selected-element-panel__content SelectedElementPanel",{"column-settings-show":!!t.floatBlocks&&t.floatBlocks.items.length>1}),emailElementType:a,formSettings:l}));var Cr=l(33309);const Br=({emailElementType:e,isSelectedElement:t=!1,selectedElement:l={parent:!1}})=>{var a,r,n,d,m,p,E,_,A;const{__:S}=(0,y.s9)(),k=(0,v.wA)(),w=(0,Pe.XW)(),[B]=C.A.useForm(),x=(0,o.useRef)(),T=(0,o.useRef)(),R=(0,v.d4)(H.qX),N=(0,v.d4)(Xe.qX),L=(0,Y.rD)(),P=l||(e===V.Tm?R:N),[O,F]=(0,o.useState)(null===(a=P.floatBlocks)||void 0===a?void 0:a.wrap),[M,D]=(0,o.useState)(null===(r=P.floatBlocks)||void 0===r?void 0:r.dirRevers),[W,j]=(0,o.useState)(null),[z,G]=(0,o.useState)(0),[U,q]=(0,o.useState)([]),X=(0,v.d4)(Ie.Ct),$=(0,o.useCallback)(t=>{k(e===V.Tm?(0,H.A9)(t):(0,Xe.A9)(t))},[k,e]);(0,o.useEffect)(()=>{if(P&&"{}"!==JSON.stringify(P)&&B._init){var e,t,l,o,a;if(B.resetFields(),B.setFieldsValue({gap:null===(e=P.floatBlocks)||void 0===e?void 0:e.gap,gapMobile:null===(t=P.floatBlocks)||void 0===t?void 0:t.gapMobile,gapDim:"px",valign:null===(l=P.floatBlocks)||void 0===l?void 0:l.valign}),(null===(o=P.floatBlocks)||void 0===o?void 0:o.items.length)>0){var r;const n=P.floatBlocks.items.reduce((e,t)=>e+t.width,0),i=P.floatBlocks.items.map(e=>{var t;return null===(t=(e.width||0)/n*100)||void 0===t?void 0:t.toFixed(1)});function s(e,t){if(e.length!==t.length)return!1;for(let l=0;l<e.length;l++)if(e[l]!==t[l])return!1;return!0}G(n),s(i,U)||"gap"===P.changeKey||q(i),P.floatBlocks.items.forEach((e,t)=>B.setFieldsValue({["width-"+t]:e.width||0})),P.floatBlocks.items.length>=8?document.querySelector(".selected-element-panel__columns-settings__links__add").classList.add("noactive"):null!==(r=document.querySelector(".selected-element-panel__columns-settings__links__add"))&&void 0!==r&&r.classList.contains("noactive")&&document.querySelector(".selected-element-panel__columns-settings__links__add").classList.remove("noactive")}F(null===(a=P.floatBlocks)||void 0===a?void 0:a.wrap)}},[B,P,W,U]);let Z=0;(null===(n=P.floatBlocks)||void 0===n?void 0:n.items.length)>0&&(Z=P.floatBlocks.items.length);const K=(e,t)=>{Object.keys(t).forEach(t=>{if(t.includes("width")){const l=parseInt(t.match(/\d+/));B.setFieldsValue({[t]:e.items[l]})}})},[Q,J]=(0,o.useState)(!1);(0,o.useEffect)(()=>{const e=()=>J(!0),t=()=>J(!1);return document.addEventListener("keyup",t),document.addEventListener("keydown",e),()=>{document.removeEventListener("keyup",t),document.removeEventListener("keydown",e)}},[]);const ee=e=>{const l=B.getFieldsValue(!0),o=P.floatBlocks.items.map(e=>e.width),a=P.floatBlocks.gap||20,r=e.cols-o.length;let n=[],i=o.reduce((e,t)=>e+t,0);e.cols>=o.length?i-=a*r:i+=a*Math.abs(r);const s=Math.round(i/e.cols);n=function(t,l){const o=[];for(let n=0;n<t;n++){var a,r;o.push(null!==(a=e.width)&&void 0!==a&&a[n]?Math.round(i/100*(null===(r=e.width)||void 0===r?void 0:r[n])):l)}return o}(e.cols,s);const d=i-n.reduce((e,t)=>e+t,0);if(0!==d){let e=n.map((e,t)=>[t,e]).filter(e=>e[1]>30);const t=e.length-Math.abs(d);e=e.map((e,l)=>{const o=t<=l?e[1]+(d>0?1:-1):e[1];return[e[0],o]}),e.map(e=>(n[e[0]]=e[1],e))}let c={items:n,gap:l.gap||20};const m=n.reduce((e,t)=>e+t,0);q(n.map(e=>{var t;return null===(t=e/m*100)||void 0===t?void 0:t.toFixed(1)})),w({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksPreset",settings:c,editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),$({...P,activateSection:t?void 0:"structure",floatBlocks:{...P.floatBlocks,...c,items:c.items.map((e,t)=>({width:e,current:!1}))},changeKey:"width"})},te=e=>{const l=B.getFieldsValue(!0);let o=0;document.querySelectorAll(".selected-element-panel__columns-settings__controls__column").forEach((t,l)=>{t===e.target.closest(".selected-element-panel__columns-settings__controls__column")&&(o=l)});const a=+P.floatBlocks.gap,r=+P.floatBlocks.items[o].width+a,n=P.floatBlocks.items.map(e=>+e.width),i=(n.length-1)*a,s=n.reduce((e,t)=>e+t,0)+i,d=n.length-1,c=Math.floor(r/d);let m=n.filter((e,t)=>t!==o).map(e=>e+c);const u=s-(m.reduce((e,t)=>e+t,0)+(n.length-2)*a);if(0!==u){const e=m.length-Math.abs(u);m=m.map((t,l)=>e<=l?t+(u>0?1:-1):t)}w({operation:V.Ru.SANDBOX_FLOATBLOCK_REMOVE,settings:{removedBlockIndex:o,gap:l.gap},editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),$({...P,activateSection:t?void 0:"structure",floatBlocks:{...P.floatBlocks,items:m.map((e,t)=>({width:e,current:P.floatBlocks.items.filter((e,t)=>t!==o)[t].current}))},changeKey:"width"})};return P.floatBlocks&&P.floatBlocks.items.length>0&&o.createElement(C.A,{layout:"vertical",form:B,name:"float_blocks_settings_form",autoComplete:"off",initialValues:{gap:(null===(d=P.floatBlocks)||void 0===d?void 0:d.gap)||0,gapDim:"px",gapMobile:(null===(m=P.floatBlocks)||void 0===m?void 0:m.gapMobile)||0,valign:(null===(p=P.floatBlocks)||void 0===p?void 0:p.valign)||"top",...null===(E=P.floatBlocks)||void 0===E?void 0:E.items.reduce((e,{width:t},l)=>(e[`width-${l}`]=t,e),{})},onValuesChange:e=>{T.current&&Q&&clearTimeout(T.current),T.current=setTimeout(()=>function(e){const l=B.getFieldsValue(!0),o=Object.keys(e)[0];if(j(o),o.includes("width")){if(l[o]&&l[o]>=30){let a={items:[],gap:l.gap,valign:l.valign,activateSection:t?void 0:"structure"},r=0;if(document.querySelectorAll(".selected-element-panel__columns-settings__controls__column").length>1){r=parseFloat(Object.keys(e)[0].substring(Object.keys(e)[0].length-1));const t=l["width-"+(r+1)]?r+1:0;let o=z;Object.keys(l).forEach(e=>{e.includes("width")&&-1===e.indexOf("width-"+t)&&(o-=l[e])}),l["width-"+t]=o}Object.keys(l).forEach(e=>{e.includes("width")&&a.items.push(l[e])}),w({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksWidths",settings:a}),$({...P,activateSection:t?void 0:"structure",floatBlocks:{...P.floatBlocks,...a,items:P.floatBlocks.items.map((e,t)=>({...P.floatBlocks.items[t],width:a.items[t]}))},changeKey:o})}}else if("gap"===o){const a={items:P.floatBlocks.items.map(e=>e.width),gap:P.floatBlocks.gap},r=a.items.reduce((e,t)=>e+t,0)+(a.items.length-1)*a.gap,n=l.gap,i=r-(a.items.length-1)*n;if(i>30*a.items.length||P.floatBlocks.gap-e>=0){const e=(e,t)=>Math.round(t*e/100);let s=a.items.map((t,l)=>e(U[l],i));const d=r-(s.reduce((e,t)=>e+t,0)+(a.items.length-1)*n);if(0!==d){const e=s.length-Math.abs(d);s=s.map((t,l)=>e<=l?t+(d>0?1:-1):t)}let c={items:s,gap:n||0};K(c,l),w({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksGap",settings:c,editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),$({...P,activateSection:t?void 0:"structure",floatBlocks:{...P.floatBlocks,...c,items:P.floatBlocks.items.map((e,t)=>({...e,width:c.items[t]}))},changeKey:o})}}else if("valign"===o){let e={valign:l.valign};w({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksValign",settings:e,editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),$({...P,activateSection:t?void 0:"structure",floatBlocks:{...P.floatBlocks,...e},changeKey:o})}else if("gapMobile"===o){let l={mobileHeight:{classNamePrefix:"em-mob-height-",value:e[o],dim:"px"}};w({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksGapMobile",settings:l}),$({...P,activateSection:t?void 0:"structure",floatBlocks:{...P.floatBlocks,gapMobile:l.mobileHeight.value},changeKey:o})}setTimeout(()=>(null===x||void 0===x?void 0:x.current)&&x.current.focus({cursor:"end"}),600)}(e),50)},onFieldsChange:()=>setTimeout(()=>(null===x||void 0===x?void 0:x.current)&&x.current.focus({cursor:"end"}),300),className:"element-controls"},o.createElement("div",{className:"selected-element-panel__columns-settings",style:{paddingTop:L.switchDesktopMobilePropsEnabled||L.stepToOtherElementEnabled||L.deleteButtonEnabled||"structure"===P.type?0:24}},1===P.floatBlocks.items.length&&o.createElement(u.A,{style:{marginBottom:10},message:S('The selected element is in the block that supports a multicolumn structure. To add a new column, click the "Add a column" button.'),type:"info"}),X!==V.ND&&o.createElement(o.Fragment,null,o.createElement(s.A,{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},o.createElement("div",{className:"form-group-title",style:{paddingTop:0}},S("Columns")),o.createElement("div",{className:"selected-element-panel__columns-settings__links"},o.createElement("span",{className:"selected-element-panel__columns-settings__links__add",onClick:()=>{const e=B.getFieldsValue(!0);if(Z<8){const l=P.floatBlocks.items.map(e=>e.width),o=P.floatBlocks.gap,a=l.reduce((e,t)=>e+(t>30?t:0),0),r=(a-30-o)/a,n=l.map(e=>e>30?Math.round(e*r):e).reduce((e,t)=>e+(t>30?t:0),0);let i=l.map(e=>e>30?Math.round(e*r):e);i.push(30);const s=a-n-30-o;if(0!==s){let e=i.map((e,t)=>[t,e]).filter(e=>e[1]>30);const t=e.length-Math.abs(s);e=e.map((e,l)=>{const o=t<=l?e[1]+(s>0?1:-1):e[1];return[e[0],o]}),e.map(e=>(i[e[0]]=e[1],e))}w({operation:V.Ru.SANDBOX_FLOATBLOCK_ADD,settings:{gap:e.gap,gapMobile:e.gapMobile,minWidth:30},editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),$({...P,activateSection:t?void 0:"structure",floatBlocks:{...P.floatBlocks,items:i.map((e,t)=>{var l;return{width:e,current:(null===(l=P.floatBlocks.items[t])||void 0===l?void 0:l.current)||!1}})},changeKey:"width"})}else document.querySelector(".selected-element-panel__columns-settings__links__add").classList.add("noactive")}},o.createElement(Cr.A,null)," ",S("Add column")),P.floatBlocks.items.length>1&&o.createElement("span",{onClick:()=>{const e=B.getFieldsValue(!0),l=P.floatBlocks.items.map(e=>e.width);let o={items:[],gap:e.gap};const a=l.reduce((e,t)=>e+t,0),r=l.length,n=Math.ceil(z/r)*r,i=n/r,s=a-n;if(o.items=Array(r).fill(i),0!==s){const e=l.length-Math.abs(s);o.items=o.items.map((t,l)=>e<=l?t+(s>0?1:-1):t)}K(o,e),w({operation:V.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksWidths",settings:o,editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),$({...P,activateSection:t?void 0:"structure",floatBlocks:{...P.floatBlocks,...o,items:P.floatBlocks.items.map((e,t)=>({...e,width:o.items[t]}))},changeKey:"width"})}},o.createElement(i.A,{title:S("Make columns the same width.")},o.createElement(Ee.A,null)," ",S("Equalize"))))),P.floatBlocks.items.length>1&&o.createElement(C.A.Item,{style:{marginBottom:16}},o.createElement("div",{className:"selected-element-panel__columns-settings__controls"},P.floatBlocks.items.map((e,t)=>o.createElement("div",{key:"floatblock-"+t,className:"selected-element-panel__columns-settings__controls__column "+(e.current?"current":""),style:{width:e.width/z*100+"%"}},P.floatBlocks.items.length>1&&o.createElement("span",{className:"selected-element-panel__columns-settings__controls__column__remove",onClick:te},o.createElement(I.A,{style:{color:"#ff4d4f"}})),o.createElement("div",{className:"selected-element-panel__columns-settings__controls__field"},o.createElement(C.A.Item,{label:"",name:"width-"+t},o.createElement(fe.A,{min:30,value:e.width||0,placeholder:S("Width"),ref:W==="width-"+t&&x}))))))),o.createElement(s.A,{size:7,className:"columns-presets"},o.createElement(g.Ay,{onClick:()=>{ee({cols:1})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"32",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))),o.createElement(g.Ay,{onClick:()=>{ee({cols:2})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"15",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"17",y:"7",width:"15",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))),o.createElement(g.Ay,{onClick:()=>{ee({cols:2,width:[66,34]})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"20.6667",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"22.6667",y:"7",width:"9.33333",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))),o.createElement(g.Ay,{onClick:()=>{ee({cols:2,width:[34,66]})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"9.33333",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"11.3333",y:"7",width:"20.6667",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))),o.createElement(g.Ay,{onClick:()=>{ee({cols:3})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"9.33333",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"11.3333",y:"7",width:"9.33333",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"22.6667",y:"7",width:"9.33333",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))),o.createElement(g.Ay,{onClick:()=>{ee({cols:4})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"6.5",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"8.5",y:"7",width:"6.5",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"17",y:"7",width:"6.5",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"25.5",y:"7",width:"6.5",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))))),P.floatBlocks.items.length>1&&o.createElement(o.Fragment,null,X===V.ND&&o.createElement(s.A,{style:{marginBottom:24}},o.createElement(f.A,{size:"small",disabled:void 0===(null===(_=P.floatBlocks)||void 0===_?void 0:_.wrap),checked:O,onChange:e=>{F(e),w({operation:V.Ru.SANDBOX_FLOATBLOCK_WRAP,settings:{wrap:!O}}),$({...P,activateSection:t?void 0:"structure",floatBlocks:{...P.floatBlocks,wrap:!O},changeKey:"wrap"})}}),o.createElement("div",{style:{position:"relative",top:2}},S("Line break on mobile devices"))),X!==V.ND&&o.createElement(s.A,{style:{marginBottom:24}},o.createElement(f.A,{size:"small",disabled:void 0===(null===(A=P.floatBlocks)||void 0===A?void 0:A.wrap),checked:M,onChange:e=>{D(e),w({operation:V.Ru.SANDBOX_FLOATBLOCK_DIR,settings:{dirRevert:!M}}),$({...P,activateSection:t?void 0:"structure",floatBlocks:{...P.floatBlocks,dirRevert:!M},changeKey:"dir"})}}),o.createElement("div",{style:{position:"relative",top:2}},S("Revers order on desktop")))),P.floatBlocks.items.length>1&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10},o.createElement(b.A,{span:12},o.createElement("div",{className:"form-group-title"},S("Vertical alignment")),o.createElement("div",{style:{paddingBottom:4}},o.createElement(ta,{form:B,elementSettings:{},disabled:P.floatBlocks.items.length<=1}))),o.createElement(o.Fragment,null,X!==V.ND&&o.createElement(b.A,{span:12},o.createElement("div",{className:"form-group-title"},S("Indent between columns")),o.createElement(C.A.Item,{name:"gap",style:{marginBottom:20}},o.createElement(Lt.A,{min:0,disabled:P.floatBlocks.items.length<=1,placeholder:S("Indent between columns"),prefix:o.createElement(Ee.A,null),addonAfter:"px",ref:"gap"===W&&x}))),X===V.ND&&o.createElement(b.A,{span:12},o.createElement("div",{className:"form-group-title"},S("Indent in mobile")),o.createElement(C.A.Item,{name:"gapMobile",style:{marginBottom:20}},o.createElement(Lt.A,{min:0,disabled:P.floatBlocks.items.length<=1,placeholder:S("Indent in mobile"),prefix:o.createElement($o.A,null),addonAfter:"px"}))))))))},xr=({email:e,formSettings:t})=>{var l,a;const{__:r}=(0,y.s9)(),n=(0,Ll.cR)(),d=(0,v.wA)(),c=(0,Pe.XW)(),u=e.hasOwnProperty("type")?V.IE:V.Tm,p=(0,v.d4)(H.qX),h=(0,v.d4)(Xe.qX),b=(0,v.d4)(Ie.Tn),f=Object.keys(t).length>0?t.settings:u===V.Tm?p:h,E=(0,Y.rD)();(0,o.useEffect)(()=>{const e=Object.values(V.bV);f.type&&e.includes(f.type)?"structure"!==f.activateSection?(n.querySelector(".email-pane .secondary-tabs .ant-tabs-content").scrollTop=0,d((0,Ie.Bp)(V.WU))):d((0,Ie.Bp)(V.mX)):"{}"!==JSON.stringify(f)&&d((0,Ie.Bp)(""))},[f,d,n]);let _=[{label:o.createElement("span",{style:{textTransform:"capitalize"}},f.caption?f.caption:r("Edit element")),key:V.WU,forceRender:!0,className:"email-properties__collapse-panel",children:o.createElement(wr,{className:"email-properties__collapse-panel",key:V.WU,selectedElement:f,formSettings:t,emailElementType:u,forceRender:!0})}];f.type&&!(null===(l=f.floatBlocks)||void 0===l||!l.items.length)>0&&!(null===(a=f.floatBlocks)||void 0===a||!a.items.filter(e=>!!e.width).length)>0&&_.push({label:o.createElement(o.Fragment,null,r("Structure")),key:V.mX,forceRender:!0,className:"email-properties__collapse-panel",children:o.createElement(Br,{selectedElement:f,emailElementType:u,isSelectedElement:!1})});const A=e=>{e.stopPropagation(),c({operation:V.Ru.SANDBOX_ELEMENT_PARENT_GET})};return o.createElement(o.Fragment,null,o.createElement(m.A,{className:k()("secondary-tabs email-properties__collapse",{"secondary-tabs_unset_scroll":b===V.nA||b===V.WU}),size:"large",animated:{inkBar:!1,tabPane:!1},activeKey:b,onChange:e=>d((0,Ie.Bp)(e||"")),items:_}),((e,t,l)=>(E.switchDesktopMobilePropsEnabled||E.stepToOtherElementEnabled||E.deleteButtonEnabled)&&o.createElement(o.Fragment,null,o.createElement(s.A,{className:"selected-element-panel__extra-btn-container"},o.createElement(s.A,null,o.createElement(s.A,{size:5},E.deleteButtonEnabled&&o.createElement(i.A,{title:r("Remove element by Delete Key"),placement:"bottom"},o.createElement(g.Ay,{type:"text",onClick:e=>((e,t,l)=>{e.stopPropagation(),c({operation:V.Ru.SANDBOX_ELEMENT_REMOVE}),t(l===V.Tm?(0,H.A9)({}):(0,Xe.A9)({}))})(e,t,l),icon:o.createElement(z.A,{icon:"DeleteOutlined",size:18,strokeWidth:E.iconStrokeWidth}),disabled:!f.deletable})),E.stepToOtherElementEnabled&&o.createElement(i.A,{title:r("Up to parent element"),placement:"bottom"},o.createElement(g.Ay,{type:"text",onClick:A,icon:o.createElement(z.A,{icon:"GoToParent",size:18,strokeWidth:E.iconStrokeWidth}),disabled:!f.parent})))))))(f.parent,d,u),o.createElement(g.Ay,{type:"text",className:"ant-modal-close","aria-label":"Close",icon:o.createElement(z.A,{icon:"Close",size:24,strokeWidth:E.iconStrokeWidth}),onClick:()=>{d((0,Ie.Fk)()),setTimeout(()=>{u===V.IE?d((0,Xe.A9)({type:null})):d((0,H.A9)({type:null}))},300),c({operation:V.Ru.SANDBOX_ELEMENT_ACTIVE_RESET})}}))};var Tr=l(5553),Rr=l(83612),Nr=l(25232),Lr=l(58316),Ir=l(38826),Pr=l(30753),Or=l(76047),Fr=l(33932),Mr=l(12744),Dr=l(89613),Vr=l(90614),Wr=l(86095),jr=l(99152),zr=l(15626);const Hr=e=>{const{__:t}=(0,y.s9)();return[{key:"\ud83d\udce7",label:o.createElement("div",{onClick:()=>{e("theme-and-preheader-generator")}},"\ud83d\udce7 ",t("Subject line & preheader generator"))},{key:"\ud83c\udf0e",label:o.createElement("div",{onClick:()=>{e("translator")}},"\ud83c\udf0e ",t("Translator"))},{key:"\ud83d\udcc4",label:o.createElement("div",{onClick:()=>{e("writer")}},"\ud83d\udcc4 ",t("Copywriter"))},{key:"\ud83d\udd0e",label:o.createElement("div",{onClick:()=>{e("corrector")}},"\ud83d\udd0e ",t("Proofreader"))},{key:"\ud83e\udde0",label:o.createElement("div",{onClick:()=>{e("psychologist")}},"\ud83e\udde0 ",t("Psychologist"))},{key:"\ud83d\udcc8",label:o.createElement("div",{onClick:()=>{e("marketolog")}},"\ud83d\udcc8 ",t("Marketer"))},{key:"\u2728",label:o.createElement("div",{onClick:()=>{e("email-generator")}},"\u2728 ",t("Email generator"))}]},{TextArea:Gr}=B.A,Ur=({messages:e,newEmailAiGeneratorRef:t})=>{const l=(0,Wr.fn)(),{__:a,_n:r}=(0,y.s9)(),n=(0,v.wA)(),d=(0,o.useRef)(null),c=(0,Y.rD)(),m=(0,A.hN)(),{projectId:u,emailId:p}=(0,_.g)(),h=(0,Dr.u)(),b=(0,Vr.ml)(zr.AZ.ON_LIMIT_ID),[f,S]=(0,o.useState)(null),[k,w]=(0,o.useState)(0),[B,x]=(0,o.useState)(!1),[T,R]=(0,o.useState)(""),[N,I]=(0,o.useState)([]),[P,O]=(0,o.useState)(!1),[F,M]=(0,o.useState)(!1),[D,W]=(0,o.useState)(null),[j,G]=(0,o.useState)(0),[U,q]=(0,o.useState)(null),X=(0,v.d4)(H.Hs),$=(0,v.d4)(we.C1),Z=(0,Pe.QC)(),[Q]=(0,Fr.YG)(),J=(0,Pe.XW)(),[ee,te]=(0,Fr.EQ)(),[le,{reset:oe}]=(0,Mr.MN)(),[ae,{data:re=[]}]=(0,Mr.y4)(),ne={cursor:B?"not-allowed":"default",pointerEvents:B?"none":"auto"};(0,o.useEffect)(()=>{U&&P&&(t.current=!0),P||(t.current=!1)},[U,P]);const ie=!(!c.limits||!c.counters)&&V.EW.isPlugin,{limits:se}=V.EW.isPlugin&&c.limits?c:{limits:{ai_limit:0,ai_generator_limit:0}},{ai_limit:de,ai_generator_limit:ce}=se,me=ie&&k>=de&&de>0,ue=ie&&j>=ce&&ce>0,pe=(0,o.useCallback)(()=>{b.fire({name:"AiChatCount",count:k+1})},[b,k]),ge=(0,o.useCallback)(()=>{b.fire({name:"AiGeneratorCount",count:j+1})},[b,j]);(0,o.useEffect)(()=>{var e,t;ie&&(w((null===c||void 0===c||null===(e=c.counters)||void 0===e?void 0:e.ai_counter)||0),G((null===c||void 0===c||null===(t=c.counters)||void 0===t?void 0:t.ai_generator_counter)||0))},[c,ie]),(0,o.useEffect)(()=>{q((()=>{var e;if(N.length<=0)return!1;return"email-generator"===(null===(e=N.toReversed().find(e=>{var t;return null===(t=e.data)||void 0===t?void 0:t.context}))||void 0===e?void 0:e.data.context)})())},[N]);const he=(0,o.useCallback)(async()=>await Z.sendAsync(V.Ru.SANDBOX_IS_EMAIL_EMPTY),[Z]),be=(0,o.useCallback)(()=>{var e;const t=null===(e=d.current)||void 0===e?void 0:e.closest(".ant-tabs-content.ant-tabs-content-top");setTimeout(()=>{null===t||void 0===t||t.scrollTo({top:t.scrollHeight,behavior:"smooth"})},0)},[d]),fe=(0,o.useCallback)(()=>{Q({entity_id:p}).then(e=>{I(e.data.documents),be()})},[p,Q,I,be]),Ee=(0,o.useCallback)(e=>{O(!0),x(!0),le({task_id:e||f,entity_id:p,status:"started"}).then(()=>{fe()})},[p,le,f,fe]),ve=(0,o.useCallback)(()=>{le({task_id:f,entity_id:p,status:"completed"}).then(e=>{403===e.data.status&&oe(),fe()}).catch(e=>{}),x(!1),O(!1)},[p,le,f,fe,oe]);(0,o.useEffect)(()=>{let e;if(P){var t,o;const a=null===(t=re[re.length-1])||void 0===t||null===(o=t.processing)||void 0===o?void 0:o.email;if(a){let t=re[re.length-1].status;e=setInterval(l.setValue(a),500),0===t&&ve()}D&&(clearInterval(e),n((0,H.AJ)(a)),O(!1),W(!1))}return()=>{clearInterval(e)}},[l,D,n,re,P,X,p,f,fe,le,te,ve]),(0,o.useEffect)(be,[be]),(0,o.useEffect)(()=>{(null===e||void 0===e?void 0:e.length)>0&&I(e),J({operation:V.Ru.SANDBOX_EMAIL_CONTENT_GET})},[e,J]),(0,o.useEffect)(()=>{const e=Z.onInit(()=>{Z.send({operation:V.Ru.SANDBOX_LOCK_EDIT,data:B}),Z.send({operation:V.Ru.SANDBOX_LOCK_DISCUSS,value:B})});return()=>e.dispose()},[B,Z]);const _e=()=>{if(T){const e=T.replaceAll(/\n/g,"<br>"),t={project_id:u,connection:"chat",entity_id:p,message:e,locale:$.locale.slice(0,2),subject:X.subject||"",preheader:X.preheader||"",textContent:(0,jr.T5)(l.getValue())};if(U&&ue||me){m.error({message:a(U?"You have reached the limit of AI generator usage.":"You have reached the limit of AI chat usage."),description:a("Please upgrade your plan.")});const e={data:{role:"assistant",message:a(U?"You have reached the limit of AI generator usage.":"You have reached the limit of AI chat usage.")}};I(t=>[...t,e])}else{ie&&(U&&j!==ce?(ge(),G(e=>e+1)):k!==de&&(pe(),w(e=>e+1))),h({event:"submit_form",action:"chat_whit_ai_assistant",entity_id:t.entity_id,project_id:t.project_id});const l=[{data:{role:"user",message:e,userInfo:{display_name:$.first_name+" "+$.last_name,avatar_url:$.avatar_urls[24]}}},{data:{role:"assistant",message:"\u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442",isLoading:!0}}];I(e=>[...e,...l]),ee({body:t}).then(e=>{if(401===e.data.status)throw new Error(V.ff);if(e.data.task_id){let t=e.data.task_id;S(t),ae({id:t,setError:W}),he().then(e=>{e?Ee(t):M(!0)})}fe()}).catch(e=>{var t,l;m.error({message:(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.code)||a("Error"),description:(null===e||void 0===e||null===(l=e.data)||void 0===l?void 0:l.message)||a("Something went wrong.")})})}R("")}},ye=e=>{const t={data:{role:"assistant",message:"\u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442",isLoading:!0}};I(e=>[...e,t]);const o={project_id:u,connection:"chat",entity_id:p,context:e,locale:$.locale.slice(0,2),subject:X.subject||"",preheader:X.preheader||"",textContent:(0,jr.T5)(l.getValue())};if(ie&&(U&&j!==ce?(ge(),G(e=>e+1)):k!==de&&(pe(),w(e=>e+1))),me){m.error({message:a("You have reached the limit of AI chat usage."),description:a("Please upgrade your plan.")});const e={data:{role:"assistant",message:a("You have reached the limit of AI chat usage.")}};I(t=>[...t,e])}else h({event:"select",action:"select_ai_assistant_role",context:o.context,entity_id:o.entity_id,project_id:o.project_id}),ee({body:o}).then(e=>{if(401===e.data.status)throw new Error(V.ff);fe()}).catch(e=>{var t,l;m.error({message:(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.code)||"Error",description:(null===e||void 0===e||null===(l=e.data)||void 0===l?void 0:l.message)||"Something went wrong"})})},Ae=(0,o.useCallback)(e=>{const t={data:{role:"user",message:e,userInfo:{display_name:$.first_name+" "+$.last_name,avatar_url:$.avatar_urls[24]}}},o={data:{role:"assistant",message:"\u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442",isLoading:!0}};I(e=>[...e,t,o]);const r={project_id:u,connection:"chat",entity_id:p,message:e,locale:$.locale.slice(0,2),subject:X.subject||"",preheader:X.preheader||"",textContent:(0,jr.T5)(l.getValue())};if(ue){m.error({message:a("You have reached the limit of AI generator usage."),description:a("Please upgrade your plan.")});const e={data:{role:"assistant",message:a("You have reached the limit of AI chat usage.")}};I(t=>[...t,e])}else ee({body:r}).then(e=>{if(401===e.data.status)throw new Error(V.ff);if(e.data.task_id){let t=e.data.task_id;S(t),ae({id:t,setError:W}),he().then(e=>{e?Ee(t):M(!0)})}ie&&(U&&j!==ce?(ge(),G(e=>e+1)):k!==de&&(pe(),w(e=>e+1))),fe()}).catch(e=>{var t,l;m.error({message:(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.code)||"Error",description:(null===e||void 0===e||null===(l=e.data)||void 0===l?void 0:l.message)||"Something went wrong"})})},[a,k,j,he,Ee,de,ce,$,X,p,U,ue,pe,ge,ie,l,m,u,ee,ae,fe]);(0,o.useEffect)(()=>{const e=window.localStorage.getItem(V.V0.em_ai_settings);if(1===N.length&&"assistant"===N[0].data.role&&e&&p){const t=new K.jG,l={project_id:u,connection:"chat",entity_id:p,context:"email-generator",locale:$.locale.slice(0,2)};window.localStorage.removeItem(V.V0.em_ai_settings),ee({body:l}).then(({data:l})=>{t.isDisposed()||Ae(e)})}},[N,Ae,p,$.locale,u,ee]);const Se={replace:e=>{var t,l,r,n,s,d,c,u;if(null!==(t=e.attribs)&&void 0!==t&&null!==(l=t.class)&&void 0!==l&&l.split(" ").includes("ai-response-title"))return o.createElement(i.A,{placement:"left",title:a("Replace the title")},o.createElement("div",{onClick:()=>(e=>{const t=e.children[0].data;Z.send(V.Ru.SANDBOX_SUBJECT_UPDATE,{value:e.children[0].data,guid:X.renderGuid,fromAI:!0}),m.success({id:"EMAIL_TITLE_UPDATED_FROM_AI",message:a("Title copied to email settings"),data:t})})(e)},o.createElement("span",{className:"ai-response-title"},(0,Nr.zd)(e.children,Se))));if(null!==(r=e.attribs)&&void 0!==r&&null!==(n=r.class)&&void 0!==n&&n.split(" ").includes("ai-response-preheader"))return o.createElement(i.A,{placement:"left",title:a("Replace the preheader")},o.createElement("div",{onClick:()=>(e=>{const t=e.children[0].data;Z.send(V.Ru.SANDBOX_PREHEADER_UPDATE,{value:e.children[0].data,guid:X.renderGuid,fromAI:!0}),m.success({id:"EMAIL_TITLE_UPDATED_FROM_AI",message:a("Preheader copied to email settings"),data:t,duration:300})})(e)},o.createElement("span",{className:"ai-response-preheader"},(0,Nr.zd)(e.children,Se))));if(null!==(s=e.attribs)&&void 0!==s&&null!==(d=s.class)&&void 0!==d&&d.split(" ").includes("ai-response-copy"))return o.createElement(i.A,{placement:"left",title:a("Copy to clipboard")},o.createElement("div",{onClick:()=>(e=>{const t=e.children[0].data;navigator.clipboard.writeText(t).then(()=>{m.success({id:"TEXT_COPIED_TO_CLIPBOARD",message:a("Text copied to clipboard"),data:t})}).catch(e=>{})})(e)},o.createElement("span",{className:"ai-response-copy"},(0,Nr.zd)(e.children,Se))));if(null!==(c=e.attribs)&&void 0!==c&&null!==(u=c.class)&&void 0!==u&&u.split(" ").includes("ai-response-user-message")){var p,g,h,b,f;const t=(null===(p=e.attribs)||void 0===p?void 0:p.data)||(null===(g=e.children)||void 0===g||null===(h=g[0])||void 0===h?void 0:h.data);return o.createElement("li",{className:null===(b=e.attribs)||void 0===b?void 0:b.class,data:null===(f=e.attribs)||void 0===f?void 0:f.data,onClick:()=>Ae(t)},(0,Nr.zd)(e.children,Se))}}};return o.createElement("div",{ref:d,className:"discuss-main"},N.length>0&&o.createElement(Tr.A,{onClick:e=>{"string"===typeof e.target.className&&e.target.className.includes("ai-response-change-context")&&(te.isLoading||ye(e.target.role))},className:"comment-list",itemLayout:"horizontal",dataSource:N,renderItem:e=>{var t,l,n;return o.createElement("li",{key:e._id,id:e._id},o.createElement(Or.A,{className:e.data.userInfo?"":"ai-comment",avatar:"assistant"===e.data.role?o.createElement(z.A,{icon:"ChatGpt",className:"anticon-robot",style:{color:"#ffffff",width:24,height:24,borderRadius:"50%",justifyContent:"center"}}):!e.data.userInfo||!e.data._modified&&V.EW.isPlugin?$.avatar_urls[24]||o.createElement(Lr.A,{style:{color:"#ffffff",width:24,height:24,borderRadius:"50%",justifyContent:"center"}}):e.data.userInfo.avatar_url,author:o.createElement("div",{style:ne},"user"===(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.role)?V.EW.isPlugin?(null===$||void 0===$?void 0:$.username)||a("User"):null===(l=e.data)||void 0===l||null===(n=l.userInfo)||void 0===n?void 0:n.display_name:a("AI Assistant")),datetime:e._created?o.createElement("span",{dangerouslySetInnerHTML:{__html:(0,K.Yq)((0,Rr.A)(e._created),r,!0)}}):null,content:e.data.isLoading?o.createElement("div",{className:"spin"},o.createElement(Ir.A,{style:{fontSize:24},spin:!0})):o.createElement("div",{style:ne},(0,Nr.Ay)(e.data.message,Se))}))}}),ie&&(U?o.createElement(Pr.A,{text:a("mail generator"),counter:j,limits:ce,wrapperStyles:{marginTop:-25}}):o.createElement(Pr.A,{text:a("messeges"),counter:k,limits:de,wrapperStyles:{marginTop:-25}})),o.createElement(C.A,{onFinish:_e,className:"addMode"},o.createElement(C.A.Item,{style:{marginBottom:10}},o.createElement(Gr,{disabled:B,value:T,onChange:e=>R(e.target.value),rows:4,placeholder:a("Type your request"),className:"textarea-comment",onPressEnter:e=>"Enter"===e.key&&e.ctrlKey&&_e(),spellCheck:"false"})),o.createElement(C.A.Item,null,o.createElement(s.A,{size:8},o.createElement(g.Ay,{disabled:te.isLoading||B,type:"default",style:{background:"var(--colorInfo)",color:"#ffffff"},className:"button-target"},o.createElement(L.A,{placement:"top",disabled:B,key:"Export",arrow:{pointAtCenter:!0},menu:{items:Hr(ye)}},o.createElement("div",{disabled:B,style:{margin:0,padding:0}},o.createElement(z.A,{icon:"ChatGpt",style:{marginRight:5}}),a("Role")))),o.createElement(g.Ay,{disabled:te.isLoading||B,className:"button-add",type:"primary",htmlType:"submit"},a("Send"),o.createElement(z.A,{icon:"SendOutlined",size:16,strokeWidth:c.iconStrokeWidth,style:{marginLeft:5}}))))),o.createElement(E.A,{title:a("Warning"),centered:!0,open:F,onOk:()=>{Ee(),M(!1)},onCancel:()=>{ve(),M(!1)}},o.createElement("p",null,a("The current template will be changed to the generated one, are you sure about this?"))))};var qr=l(66079),Xr=l(1753),$r=l(38677);const Zr=({emailElement:e})=>{const{__:t}=(0,y.s9)(),l=(0,Pe.XW)(),a=(0,v.wA)(),{projectId:r}=(0,_.g)(),n=(0,Wr.fn)(),i=(0,v.d4)($r.p1),s=(0,v.d4)($r.RL),d=(0,v.d4)(Ie.Wm),[c,u]=(0,o.useState)(!0),[p,h]=(0,o.useState)(!1),[b,f]=(0,o.useState)([]),[E,A]=(0,o.useState)([]),S=e=>a((0,Ie.mi)(e)),w=(0,o.useCallback)(e=>{a((0,H.no)(e)),n.setValue(null===e||void 0===e?void 0:e.html.replaceAll("\r\n","\n"))},[n,a]),{data:C}=F.Nq.useGetProjectQuery(Number(r),{skip:!r}),[B,x]=(0,o.useState)([]);(0,o.useEffect)(()=>{if(C){const{owner:e,admins:t,users:l}=null===C||void 0===C?void 0:C.members;x([e&&{...e},t&&Array.isArray(t)&&t.map(e=>({...e})),l&&Array.isArray(l)&&l.map(e=>({...e}))].filter(e=>e).flat(1).map(e=>({id:e.ID,display_name:e.display_name})))}},[C,null===C||void 0===C?void 0:C.members,t]);const[T,R]=(0,o.useState)(1),[L,I]=(0,o.useState)(!1);(0,o.useEffect)(()=>{const e=Array.isArray(i)&&i.length&&(null===i||void 0===i?void 0:i.map(e=>{var l;return{key:e.id,author:e.author,date:(0,K.Yq)((0,K.Cl)(e.date||e.modified),t),title:e.title,html:e.html,common_styles:e.common_styles,loading:!1,isAutosave:null===(l=e.slug)||void 0===l?void 0:l.includes("autosave")}}));A(e||[]),f(e),u(!1),s<2&&I(!0)},[i,s,t]);const P=c||p||L?null:o.createElement("div",{style:{textAlign:"center",marginTop:24,marginBottom:24,height:32,lineHeight:"32px"}},o.createElement(g.Ay,{onClick:()=>{h(!0),A(b.concat([...new Array(3)].map(()=>({loading:!0})))),a(X.GY.endpoints.getEmailHistory.initiate({emailId:e.id,page:T+1})).then(e=>{const{data:l,totalPages:o}=e.data,a=Array.isArray(l)&&(null===l||void 0===l?void 0:l.map(e=>({key:e.id,author:e.author,date:(0,K.Yq)((0,K.Cl)(e.date||e.modified),t),title:e.title,html:e.html,loading:!1}))),r=b.concat(a);A(r),f(r),h(!1),window.dispatchEvent(new Event("resize")),T+1>=o&&I(!0),R(T+1)})}},t("loading more"))),[O,M]=(0,o.useState)(),[D,W]=(0,o.useState)(null),j=(0,o.useRef)();return j.current=e,(0,o.useEffect)(()=>{if(!d&&!D){const e=j.current;e&&W({html:n.getValue(),preheader:e.preheader,common_styles:e.common_styles,subject:e.subject})}},[d,W,n,D]),(0,o.useEffect)(()=>{d&&D&&(w(D),W(null))},[d,D,w]),o.createElement(o.Fragment,null,o.createElement(m.A,{className:"secondary-tabs email-settings__collapse secondary-tabs_unset_scroll",size:"large",animated:{inkBar:!1,tabPane:!1},activeKey:V.Vv,items:[{label:o.createElement(o.Fragment,null,t("Version history")),key:V.Vv,forceRender:!0,className:"email-settings__collapse-panel",style:{height:"100%"},children:o.createElement(Tr.A,{className:"history-panel__list",loading:c,itemLayout:"horizontal",loadMore:P,dataSource:E,header:o.createElement("div",{className:"history-panel__list-header"},o.createElement("div",{className:"history-panel__list-date"},t("Time")),o.createElement("div",{className:"history-panel__list-author"},t("Author")),o.createElement("div",{className:"history-panel__restore"},"Set")),renderItem:(e,r)=>{var n;return o.createElement(Tr.A.Item,{onClick:()=>{r!==O&&(M(r),w(b[r])),a((0,Xe.rc)(!0))},className:k()("history-panel__item",{"history-panel__item_active":r===O})},o.createElement(N.A,{title:!1,loading:e.loading||!1,active:!0},o.createElement("div",{className:"history-panel__list-date"},e.date),o.createElement("div",{className:"history-panel__list-author"},(null===(n=B.find(t=>{var l,o;return(null===(l=t.id)||void 0===l?void 0:l.toString())===(null===(o=e.author)||void 0===o?void 0:o.toString())}))||void 0===n?void 0:n.display_name)||"\u2013"),e.isAutosave&&O!==r&&o.createElement("div",{style:{opacity:.45},className:"history-panel__list-autosave"},t("Auto")),!e.isAutosave&&o.createElement(g.Ay,{size:"small",className:"history-panel__restore",type:"link",onClick:e=>{O===r&&e.stopPropagation(),w(b[r]),M(null),W(null),l({operation:V.Ru.SANDBOX_LOCK_EDIT,data:!1}),a((0,Ie.Fk)())}},t("Set")),e.isAutosave&&O===r&&o.createElement(g.Ay,{size:"small",className:"history-panel__restore",type:"link",onClick:e=>{O===r&&e.stopPropagation(),w(b[r]),S(!0),M(null),W(null),l({operation:V.Ru.SANDBOX_LOCK_EDIT,data:!1})}},t("Set"))))}})}]}),o.createElement(g.Ay,{type:"text",className:"ant-modal-close","aria-label":"Close",onClick:()=>{a((0,Ie.Fk)()),w(D),W(null),S(!0),l({operation:V.Ru.SANDBOX_LOCK_EDIT,data:!1})}},o.createElement(z.A,{icon:"Close"})))};var Yr=l(85897);const Kr=({elementPath:e})=>{const{_x:t}=(0,y.s9)(),l=(0,v.wA)(),a=(0,Pe.QC)(),r=(0,Y.rD)(),{emailId:n,blockId:i,projectId:s}=(0,_.g)(),d=(0,v.d4)(Ce.yN),c=(0,Dr.u)(),m=(0,o.useCallback)(e=>{a.send({operation:V.Ru.SANDBOX_ELEMENT_ACTIVE_SET,index:e})},[a]),u=(0,o.useCallback)(e=>{var t,o,r,m,u,p;let g="element";null!==e&&void 0!==e&&null!==(t=e.target)&&void 0!==t&&t.closest("svg")||null!==e&&void 0!==e&&null!==(o=e.target)&&void 0!==o&&o.closest(".anticon")||null!==e&&void 0!==e&&null!==(r=e.target)&&void 0!==r&&r.closest('[class*="icon"]')?g="icon":null===e||void 0===e||null===(m=e.target)||void 0===m||!m.textContent||null!==e&&void 0!==e&&null!==(u=e.target)&&void 0!==u&&u.closest("svg")||null!==e&&void 0!==e&&null!==(p=e.target)&&void 0!==p&&p.closest(".anticon")||(g="text"),l((0,Ie.PM)(V.rY)),a.send({operation:V.Ru.SANDBOX_LOCK_EDIT,data:!1}),a.send({operation:V.Ru.SANDBOX_ELEMENT_ACTIVE_RESET}),c({event:"click",action:"click_breadcrumb_email",email_id:n||i,project_id:(null===d||void 0===d?void 0:d.id)||s,click_target:g})},[a,l,c,n,i,s,d]),p={title:o.createElement("span",{onClick:u},o.createElement(z.A,{icon:"Email",size:16,strokeWidth:r.iconStrokeWidth})," ",t("Email","letter"))},[g,h]=(0,o.useState)([p]),b=(0,o.useCallback)(e=>{a.send({operation:V.Ru.SANDBOX_ELEMENT_HOVER_SET,index:e})},[a]),f=(0,o.useCallback)((t,l)=>{return o.createElement("span",{className:t.className,onClick:t=>{var o;let a="element";t.target.closest("svg")||t.target.closest(".anticon")||t.target.closest('[class*="icon"]')?a="icon":!t.target.textContent||t.target.closest("svg")||t.target.closest(".anticon")||(a="text");const r=null===e||void 0===e?void 0:e[l],u=(null===r||void 0===r||null===(o=r.className)||void 0===o?void 0:o.replace("em-element-path-item-",""))||"unknown";c({event:"click",action:"click_breadcrumb_element",email_id:n||i,project_id:(null===d||void 0===d?void 0:d.id)||s,element_type:u,element_index:l,element_title:(null===r||void 0===r?void 0:r.title)||"",click_target:a}),m(l)},onMouseOver:()=>{b(l)}},(a=t.className).includes("em-element-path-item-text")?o.createElement(z.A,{icon:"ElementText",size:16,strokeWidth:r.iconStrokeWidth}):a.includes("em-element-path-item-image")?o.createElement(z.A,{icon:"ElementImage",size:16,strokeWidth:r.iconStrokeWidth}):a.includes("em-element-path-item-link")?o.createElement(zt.A,{size:16,strokeWidth:r.iconStrokeWidth}):a.includes("em-element-path-item-atom")?o.createElement(z.A,{icon:"Atom",size:16,strokeWidth:r.iconStrokeWidth}):a.includes("em-element-path-item-column")?o.createElement(z.A,{icon:"Column",size:16,strokeWidth:r.iconStrokeWidth}):a.includes("em-element-path-item-block")?o.createElement(z.A,{icon:"Block",size:16,strokeWidth:r.iconStrokeWidth}):a.includes("em-element-path-item-group")?o.createElement(z.A,{icon:"Group",size:16,strokeWidth:r.iconStrokeWidth}):a.includes("em-element-path-item-button")?o.createElement(z.A,{icon:"ElementButton",size:16,strokeWidth:r.iconStrokeWidth}):a.includes("em-element-path-item-table")?o.createElement(z.A,{icon:"ElementTable",size:16,strokeWidth:r.iconStrokeWidth}):a.includes("em-element-path-item-amp")?o.createElement(z.A,{icon:"AMP",size:16,strokeWidth:r.iconStrokeWidth}):void 0," ",t.title);var a},[m,b,e,c,n,i,s,d]);return(0,o.useEffect)(()=>{if(e){const l=e.map((e,t)=>({title:f(e,t)}));h([{title:o.createElement("span",{onClick:u},o.createElement(z.A,{icon:"Email",size:16,strokeWidth:r.iconStrokeWidth})," ",t("Email","letter"))},...l])}},[e,f,u,t]),o.createElement(o.Fragment,null,o.createElement(Yr.A,{items:g,type:"separator",separator:""}))};var Qr=l(69194),Jr=l(63448),en=l(42567),tn=l(2952);const{Text:ln,Link:on,Title:an}=ye.A,rn="Links",nn="Images",sn="Spam assassin",dn="Problems",cn="valid",mn="warnings",un="errors",pn=[cn,un,mn],gn=({summary:e,__:t,selectedTags:l,setSelectedTags:a})=>o.createElement(an,{level:5,style:{margin:0,fontSize:"14px"}},o.createElement(s.A,{style:{flexWrap:"wrap"},gap:"6"},pn.map((r,n)=>o.createElement(T.A.CheckableTag,{key:r+n,checked:null===l||void 0===l?void 0:l.includes(r),onChange:e=>((e,t)=>{const o=t?2===l.length?[]:[...l,e]:l.filter(t=>t!==e);a(o)})(r,e),className:k()(`${r} optimise__button`,{[`${r}_active`]:l.includes(r)})},t(r===cn?"Valid":r===mn?"Warnings":"Errors"),": ",(null===e||void 0===e?void 0:e[r])||0)))),hn=()=>{var e,t,l,a,r,n,s;const{__:d}=(0,y.s9)(),m=(0,v.wA)(),p=(0,Wr.fn)(),f=(0,Y.rD)(),E=(0,A.hN)(),{emailId:S,projectId:w}=(0,_.g)(),C=(0,Pe.QC)(),B=(0,v.d4)(H.rd),x=(0,Vr.ml)(zr.AZ.ON_LIMIT_ID),T=(0,Dr.u)(),[R,N]=(0,tn.Sr)(),[L,I]=(0,tn.ku)(),[P,O]=(0,tn.Ju)(),{data:M,isSuccess:D,refetch:W}=(0,F.fo)(+w,{skip:!!V.EW.isPlugin||!+w}),{limits:j}=V.EW.isPlugin?f.limits?f:{limits:{optimization_limit:0}}:M||{limits:{optimization_limit:0}},{optimization_limit:G}=j,[U,q]=(0,o.useState)(),[X,$]=(0,o.useState)([]),[Z,K]=(0,o.useState)([]),[Q,J]=(0,o.useState)([]),[ee,te]=(0,o.useState)([]),[le,oe]=(0,o.useState)(0),[ae,re]=(0,o.useState)([]),[ne,ie]=(0,o.useState)([]),se=le>=G&&G>0,de=!(!f.limits||!f.counters)&&V.EW.isPlugin,ce=(0,o.useCallback)(()=>{x.fire({name:"OptimizationCount",count:le+1})},[x,le]);(0,o.useEffect)(()=>{var e,t;de?oe((null===f||void 0===f||null===(e=f.counters)||void 0===e?void 0:e.optimization_counter)||0):D&&(null===M||void 0===M||null===(t=M.counters)||void 0===t?void 0:t.optimization_counter)&&oe(M.counters.optimization_counter)},[de,M,D,f]),(0,o.useEffect)(()=>{var e,t;U===rn&&ae.links&&K(X.length>0?null===(e=ae.links)||void 0===e?void 0:e.filter(e=>X.includes(e.status)):ae.links);U===nn&&ne.images&&J(X.length>0?null===(t=ne.images)||void 0===t?void 0:t.filter(e=>X.includes(e.status)):ne.images)},[ae.links,ne.images,X,U]);const me=()=>{if(!S)return void E.error({message:"Save the mail first."});let e;de&&(oe(e=>e+1),ce());const t=p.getValue(),l=(new DOMParser).parseFromString(t,"text/html"),o={},a={};l.querySelectorAll("a[href]").forEach((e,t)=>{o[`link_${t}`]=e.getAttribute("href"),a[`link_${t}`]=e.innerText}),C.send({operation:"sandbox_set_attr_to_links"}),L({entity_id:S,data:o}).then(({data:t,error:l})=>{if(l)E.error({error:l});else if(null!==t&&void 0!==t&&t.result){var o;let l=[...t.result];null===l||void 0===l||l.sort((e,t)=>e.linkId-t.linkId);const r=e=>{var t,l,o,a;return(null!==e.statusCode?e.statusCode<300&&(null===(t=null===(l=e.page)||void 0===l?void 0:l.secure)||void 0===t||t):"invalid"!==e.type)?cn:(e.statusCode&&e.statusCode<400||200===e.statusCode&&(null===(o=null===(a=e.page)||void 0===a?void 0:a.secure)||void 0===o||o))&&"invalid"!==e.type?mn:un};e={links:l.map(e=>({...e,text:a[e.linkId],status:r(e)})),summary:{valid:l.filter(e=>r(e)===cn).length||0,warnings:l.filter(e=>r(e)===mn).length||0,errors:l.filter(e=>r(e)===un).length||0}},re(e),E.success(d("Links validation was successfully completed")),T({event:"check",action:"check_email_links",email_id:S,project_id:w,links_count:(null===(o=e.links)||void 0===o?void 0:o.length)||0}),!V.EW.isPlugin&&W()}else t.statusCode>300||!t.success?E.error({error:{data:t}}):E.error({message:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}),!ae.links&&ge("")}).catch(e=>{E.error({error:e})})},ue=()=>{if(!S)return void E.error({message:"Save the mail first."});de&&(oe(e=>e+1),ce());const e=p.getValue(),t=(new DOMParser).parseFromString(e,"text/html");let l={};t.querySelectorAll("img").forEach((e,t)=>l[`image_${t}`]=e.src),C.send({operation:"sandbox_set_attr_to_images"}),P({entity_id:S,data:l}).then(({data:e,error:t})=>{let l;if(t)E.error({error:t});else if(null!==e&&void 0!==e&&e.result){var o;let t=Object.values(e.result);t.sort((e,t)=>e.imageId-t.imageId);let a=t.reduce((e,t)=>e+Math.round(t.image.bytes/1024),0);const r=e=>null!==e.statusCode&&e.statusCode<300?cn:e.statusCode<400&&e.statusCode>=300||200===e.statusCode&&!e.valid?mn:un;l={images:t.map(e=>({...e,status:r(e)}))||[],summary:{valid:t.filter(e=>r(e)===cn).length||0,warnings:t.filter(e=>r(e)===mn).length||0,errors:t.filter(e=>r(e)===un).length||0},summaryTime:{value:(a>1200?a/1e3:a).toFixed(1),name:d(a>1200?"MB":"KB")}},l&&ie(l),E.success(d("Images validation was successfully completed")),T({event:"check",action:"check_email_images",email_id:S,project_id:w,images_count:(null===(o=l.images)||void 0===o?void 0:o.length)||0}),!V.EW.isPlugin&&W()}else{var a;e.statusCode>300||!e.success?E.error({error:{data:e}}):E.error({message:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}),(null===ne||void 0===ne||null===(a=ne.images)||void 0===a||!a.length)&&ge("")}}).catch(e=>{E.error({error:e})})},pe=()=>{S?(de&&(oe(e=>e+1),ce()),R({entity_id:S,data:{html:p.getValue()}}).then(({data:e,error:t})=>{if(t)E.error({error:t});else if(e&&e.success){var l;const t=!!e.result.report&&Object.values(e.result.report);t&&(t.sort((e,t)=>e.score-t.score),te({...e.result,report:t})),E.success(d("Spam validation was successfully completed")),T({event:"check",action:"check_email_spam",email_id:S,project_id:w,spam_score:(null===(l=e.result)||void 0===l?void 0:l.spamScore)||0}),!V.EW.isPlugin&&W()}else e.statusCode>300||!e.success?E.error({error:{data:e}}):E.error({message:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430."}),(null===ee||void 0===ee||!ee.length)&&ge("")}).catch(e=>{E.error({error:e})})):E.error({message:"Save the mail first."})},ge=e=>{q(e!==U?e:""),$([]),e===dn&&(null===B||void 0===B?void 0:B.length)>0&&T({event:"check",action:"check_email_code",email_id:S,project_id:w,problems_count:(null===B||void 0===B?void 0:B.length)||0})};let he=null;return(0,o.useEffect)(()=>{G>0&&le>=+G&&E.error({message:d("The usage limit has been exceeded"),description:d("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests")})},[le,G,d,E]),o.createElement("div",{className:"optimise selected_form-props-wrapper selected_form-props-wrapper_optimize"},de&&o.createElement(Pr.A,{counter:le,limits:G}),f.optimizeLinksEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},d("Links validation"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;ge(rn),null!==ae&&void 0!==ae&&null!==(e=ae.links)&&void 0!==e&&e.length||U===rn||me()},loading:I.isLoading,disabled:se&&!(null!==ae&&void 0!==ae&&null!==(e=ae.links)&&void 0!==e&&e.length)},!I.isLoading&&(U===rn?o.createElement(z.A,{icon:"DownOutlined",size:16,strokeWidth:f.iconStrokeWidth}):o.createElement(z.A,{icon:"RightOutlined",size:16,strokeWidth:f.iconStrokeWidth}))))),U===rn&&!(null===ae||void 0===ae||!ae.links)&&(0===(null===ae||void 0===ae||null===(t=ae.links)||void 0===t?void 0:t.length)?o.createElement(h.A,{style:{marginBottom:24}},o.createElement(u.A,{message:d("No links found."),type:"info"})):o.createElement(o.Fragment,null,o.createElement(h.A,{style:{marginBottom:14}},o.createElement("div",{className:"optimise__title-wrapper"},o.createElement(gn,{__:d,summary:ae.summary,setSelectedTags:$,selectedTags:X}),o.createElement(g.Ay,{disabled:se,loading:I.isLoading,onClick:me,icon:o.createElement(z.A,{icon:"SyncOutlined",size:16,strokeWidth:f.iconStrokeWidth})},d("Refresh")))),o.createElement(h.A,{style:{marginBottom:24}},o.createElement(b.A,{span:24},o.createElement(Tr.A,{itemLayout:"horizontal",dataSource:Z,renderItem:(e,t)=>{var l;return o.createElement(Tr.A.Item,{style:{border:"none"},key:t+"_"+e.id},o.createElement(Tr.A.Item.Meta,{avatar:e.status===cn?o.createElement(Jr.A,{className:cn}):e.status===mn?o.createElement(Jr.A,{className:mn}):o.createElement(en.A,{className:un}),title:o.createElement(on,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.linkId,l=600>e.statusCode>399||!e.statusCode,void C.send({operation:V.Ru.SANDBOX_SET_POSITION_TO_LINK,settings:{elementId:t,isError:l}});var t,l}},""===e.url?d("empty link"):e.url),description:o.createElement(o.Fragment,null,!(null===(l=e.text)||void 0===l||!l.length)&&o.createElement(ln,{type:"secondary"},e.text),e.page.title&&e.page.title,e.page.secure&&e.status===cn&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"},"\xa0\u2022\xa0"),o.createElement("span",{className:cn},d("secure"))),!e.resolvedUrl&&!e.statusCode&&"url"===e.type&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"},"\xa0\u2022\xa0"),o.createElement(ln,{type:"secondary"},d("Failed to load"))))}))}})))))),f.optimizeImagesEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},d("Images validation"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;ge(nn),null!==ne&&void 0!==ne&&null!==(e=ne.images)&&void 0!==e&&e.length||U===nn||ue()},loading:O.isLoading},!O.isLoading&&(U===nn?o.createElement(z.A,{icon:"DownOutlined",size:16,strokeWidth:f.iconStrokeWidth}):o.createElement(z.A,{icon:"RightOutlined",size:16,strokeWidth:f.iconStrokeWidth}))))),U===nn&&!(null===ne||void 0===ne||!ne.images)&&(0===(null===ne||void 0===ne||null===(l=ne.images)||void 0===l?void 0:l.length)?o.createElement(h.A,{style:{marginBottom:24}},o.createElement(u.A,{message:d("No images found."),type:"info"})):o.createElement(o.Fragment,null,o.createElement(h.A,{style:{marginBottom:16}},o.createElement(u.A,{style:{padding:14,paddingBottom:10,width:"100%"},message:o.createElement("div",{className:"optimise__summary"},o.createElement("div",null,o.createElement(an,{level:4,style:{marginBottom:"0"}},ne.images.length," "),o.createElement("span",{style:{fontSize:"12px"}},d("images"))),o.createElement("div",null,o.createElement(an,{level:4,style:{marginBottom:"0"}},null===(a=ne.summaryTime)||void 0===a?void 0:a.value,null===(r=ne.summaryTime)||void 0===r?void 0:r.name),o.createElement("span",{style:{fontSize:"12px"}},d("total size"))),o.createElement("div",null,o.createElement(an,{level:4,style:{marginBottom:"0"}},(Math.max(...ne.images.map(e=>e.image.responseTime))/1e3).toFixed(2)+d("s")),o.createElement("span",{style:{fontSize:"12px"}},d("time to load")))),type:"warning"})),o.createElement(h.A,{style:{marginBottom:12}},o.createElement("div",{className:"optimise__title-wrapper"},o.createElement(gn,{__:d,summary:ne.summary,setSelectedTags:$,selectedTags:X}),o.createElement(g.Ay,{icon:o.createElement(z.A,{icon:"SyncOutlined",size:16,strokeWidth:f.iconStrokeWidth}),disabled:se,loading:O.isLoading,onClick:()=>ue()},d("Refresh")))),o.createElement(h.A,{style:{marginBottom:12}},o.createElement(b.A,{span:24},o.createElement(Tr.A,{className:"optimise__result-list",itemLayout:"horizontal",dataSource:Q,renderItem:(e,t)=>o.createElement(Tr.A.Item,{className:"optimise__image-item image-item",style:{border:"none"},key:t},o.createElement(Tr.A.Item.Meta,{className:k()("image-item__meta",{"image-item__meta_fail":!e.resolvedUrl&&!e.statusCode}),avatar:o.createElement(Qr.A,{className:k()("image-item__image",{"image-item__image_fail":!e.resolvedUrl||!e.valid}),width:92,height:"auto",style:{height:"auto"},src:e.resolvedUrl||"",preview:!1,onMouseEnter:()=>{var t;return((e,t)=>{clearTimeout(he);let l=document.querySelector(".img-preview")?document.querySelector(".img-preview"):null,o=document.querySelector(".img-preview-content")?document.querySelector(".img-preview-content"):null;document.querySelector(".img-preview")||(l=document.createElement("div"),l.classList.add("img-preview"),o=document.createElement("div"),o.classList.add("img-preview-content"),l.append(o),document.querySelector(".email-pane__col_settings-inner").append(l)),o.innerHTML=`<table cellspacing="0" cellpadding="0" border="0" width="100%"><img height="auto" width=${t+"px"} alt="" style="max-width: 100%; object-fit: contain" src=${e}></table>`,"1"!==l.style.opacity&&setTimeout(function(){l.style.opacity="1",l.style.transform="translateX(-100%)"},10)})(e.url,null===(t=e.image.dimensions)||void 0===t?void 0:t.width)},onMouseLeave:()=>(()=>{let e=document.querySelector(".img-preview");e&&(he=setTimeout(()=>{e.style.opacity="0",e.style.transform="translateX(-99%)",setTimeout(function(){e.remove()},300)},300))})()}),title:e.url?o.createElement(i.A,{placement:"top",title:e.message},o.createElement(on,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.imageId,l=600>e.statusCode>399||!e.statusCode,void C.send({operation:V.Ru.SANDBOX_SET_POSITION_TO_IMG,settings:{elementId:t,isError:l}});var t,l}},""===(null===e||void 0===e?void 0:e.url)?d("empty src"):e.url)):e.message,description:o.createElement(o.Fragment,null,o.createElement("div",{className:"image-size"},e.image.dimensions&&o.createElement(o.Fragment,null,e.image.dimensions.width+" \xd7 "+e.image.dimensions.height,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",null,Math.round(e.image.bytes/1024),d("kB")),o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",null,e.image.responseTime,d("ms")),o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",{className:"image-size-format"},e.image.contentType)),e.image.secure&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",{className:cn},d("secure"))),e.resolvedUrl&&!e.valid&&o.createElement(ln,{type:"danger"},d("not valid")))," ",!e.resolvedUrl&&!e.statusCode&&o.createElement(ln,{type:"danger"},d("Failed to load")))}))})))))),f.optimizeSpamAssassinEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},d("SpamAssassin"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",loading:N.isLoading,onClick:()=>{var e;ge(sn),null!==(e=ee.report)&&void 0!==e&&e.length||pe()},disabled:se&&!(null!==ee&&void 0!==ee&&null!==(n=ee.report)&&void 0!==n&&n.length)},!N.isLoading&&(U===sn?o.createElement(z.A,{icon:"DownOutlined",size:16,strokeWidth:f.iconStrokeWidth}):o.createElement(z.A,{icon:"RightOutlined",size:16,strokeWidth:f.iconStrokeWidth}))))),U===sn&&!(null===(s=ee.report)||void 0===s||!s.length)&&o.createElement(o.Fragment,null,o.createElement(h.A,{style:{marginBottom:8}},o.createElement("div",{className:"optimise__title-wrapper optimise__title-wrapper_spam"},o.createElement(an,{level:1,style:{margin:0},type:ee.spamScore<2||!ee.spamScore||ee.spamScore<=ee.baseSpamScore-1?"success":ee.spamScore<ee.baseSpamScore-1?"warning":"danger"},o.createElement("span",{style:{marginRight:"12px"}},ee.spamScore||0),o.createElement(ln,{style:{marginRight:"12px",fontSize:"20px"}},"Score")),o.createElement(g.Ay,{disabled:se,icon:o.createElement(z.A,{icon:"SyncOutlined",size:16,strokeWidth:f.iconStrokeWidth}),loading:N.isLoading,onClick:pe},d("Refresh"))),ee.spamScore>ee.baseSpamScore-1&&o.createElement(ln,null,d("Lower scores are better. Aim for a score less than ")+(ee.baseSpamScore-1)+".")),o.createElement(h.A,{style:{marginBottom:8}},o.createElement(b.A,{span:24},o.createElement(Tr.A,{itemLayout:"horizontal",dataSource:ee.report,renderItem:e=>o.createElement(Tr.A.Item,{style:{border:"none"}},o.createElement(Tr.A.Item.Meta,{title:o.createElement(o.Fragment,null,o.createElement(ln,{style:{fontSize:"20px"}},e.score),o.createElement("span",{style:{marginLeft:"12px"}},e.description))}))}))))),f.optimizeCheckCodeEnabled&&o.createElement(o.Fragment,null,o.createElement(c.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(h.A,{gutter:10,align:"middle"},o.createElement(b.A,{span:20},o.createElement("div",{className:"form-group-title"},d("Source code validation"))),o.createElement(b.A,{span:4,align:"right"},o.createElement(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>ge(dn)},U===dn?o.createElement(z.A,{icon:"DownOutlined",size:16,strokeWidth:f.iconStrokeWidth}):o.createElement(z.A,{icon:"RightOutlined",size:16,strokeWidth:f.iconStrokeWidth})))),U===dn&&o.createElement(o.Fragment,null,null!==B&&void 0!==B&&B.length?o.createElement(h.A,{style:{marginBottom:8}},o.createElement(b.A,{span:24},o.createElement(Tr.A,{itemLayout:"horizontal",dataSource:B,renderItem:e=>o.createElement(Tr.A.Item,{style:{border:"none"}},o.createElement(Tr.A.Item.Meta,{avatar:e.severity<6?o.createElement(en.A,{className:mn}):o.createElement(en.A,{className:un}),title:o.createElement(ln,{onClick:()=>(e=>{const t={startColumn:e.startColumn,startLineNumber:e.startLineNumber,endColumn:e.endColumn,endLineNumber:e.endLineNumber};m((0,H.ps)(t))})(e),style:{cursor:"pointer"},className:e.severity<6?"warning":"error"},"Line: ",e.startLineNumber," ",e.startLineNumber!==e.endLineNumber&&" \u2013 "+e.endLineNumber),description:o.createElement(ln,null,e.message)}))}))):o.createElement(h.A,{style:{marginBottom:24}},o.createElement(u.A,{message:d("No problems found."),type:"info"})))))};var bn,fn=l(8111),En=l(38540),vn=l(15812),_n=l(78915),yn=l(96734),An=l(37507),Sn=l(58521),kn=l(39539),wn=l(51213),Cn=l(24184),Bn=l(83339);const xn="https://emcdn.ru";function Tn(e){if(!e)return["",""];const t=e.replaceAll("\\","/").split("/").filter(Boolean),l=t.pop()||"";return[t.join("/"),l]}function Rn(e,t){if(!e)return"";const l=new RegExp(`^/?${t}/?`);return e.replace(l,"")}let Nn=(0,wn.A)(bn=class{constructor(e){this._restApi=void 0,this._projectId=void 0,this.pathMode=!0,this.trashPath="trash",this.tempPath="Edited",this.getUrl=e=>`${xn}/${this._projectId}/${e.folderId}/${e.name}`,this._restApi=e.restApi,this._projectId=e.projectId}handleError(e){var t;if(e instanceof Error)throw e;throw new Error((null===(t=e.data)||void 0===t?void 0:t.message)||"Unknown error")}async getFolders({parentId:e}){const t=await this._restApi.emFiles.folders_list({project_id:this._projectId,path_folder:e,per_page:20},{type:kn.cM.Json});return t.error&&this.handleError(t.error),await t.data.folders.map(e=>({id:Rn(e.full_path,this._projectId),name:e.name,folderId:Rn(e.parent_folder,this._projectId),childrenCount:e.files_count+e.folders_count,isFolder:!0}))}async getItems(e){if(void 0===e.limit&&(e.limit=Number.MAX_SAFE_INTEGER),"folder"===e.itemType)return{items:await this.getFolders({parentId:e.folderId})};const t=await this._restApi.emFiles.files_list({project_id:this._projectId,path_folder:e.folderId,filter_name:e.search,sort_by:e.sortBy,sort_order:e.sortOrder,per_page:e.limit,page:e.page});t.error&&this.handleError(t.error);const l=t.data;let o=((null===l||void 0===l?void 0:l.files)||[]).map(e=>({...e,id:`${Rn(e.folder,this._projectId)}/${e.name}`,size:Number(e.size),date:e.date||(new Date).toISOString(),folderId:Rn(e.folder,this._projectId),selected:!1,isFolder:e.is_folder}));return l.total===Number.MAX_SAFE_INTEGER&&(l.total=o.length),"file"===e.itemType&&(o=o.filter(e=>!e.isFolder)),{items:o,pagination:{limit:l.per_page,page:l.page,total:l.total,totalPages:l.total_pages}}}async getFile(e){const t=await fetch(`${xn}/${this._projectId}/${e}`);if(t.ok)return t.blob();throw new Error(await t.text())}async deleteItem(e,t){if(e.isFolder){const t=await this._restApi.emFiles.folders_delete({path_folder:e.id,project_id:this._projectId},{type:kn.cM.Json});var l;if(t.error)throw new Error(t.error instanceof Error?t.error.message:null===(l=t.error)||void 0===l?void 0:l.message)}else{const l=await this._restApi.emFiles.files_delete({path_folder:e.folderId,project_id:this._projectId,file_name:e.name,force:t.permanent},{type:kn.cM.Json});var o,a;if(l.error)throw new Error(l.error instanceof Error?l.error.message:null===(o=l.error)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.message)}}async createFolder(e,t){if(!e)throw new Error("Folder name is required");const l=await this._restApi.emFiles.folders_create({name:e,project_id:this._projectId,path_folder:t},{type:kn.cM.Json});return l.error&&this.handleError(l.error),{id:Rn(l.data.full_path,this._projectId),name:l.data.name,folderId:Rn(l.data.parent_folder,this._projectId),childrenCount:l.data.files_count|l.data.folders_count,isFolder:!0}}async uploadFile(e){if(!e.name||!e.data)throw new Error("Invalid file data");const t=await this._restApi.emFiles.files_create({file:e.data,path_folder:e.folderId,project_id:this._projectId},{type:kn.cM.FormData});t.error&&this.handleError(t.error);const l=t.data;return{...l,id:Rn(l.folder,this._projectId)+"/"+l.name,size:Number(l.size),folderId:Rn(l.folder,this._projectId),date:l.date||(new Date).toISOString(),selected:!1,isFolder:!1}}async renameItem(e,t){if(!t)throw new Error("New file name is required");const[l,o]=Tn(e.id),a=await this._restApi.emFiles.files_rename_partial_update({file_name:o,new_name:t,path_folder:l,project_id:this._projectId,is_folder:e.isFolder},{type:kn.cM.Json});a.error&&this.handleError(a.error);const r=a.data;return{id:Rn(r.folder,this._projectId)+"/"+r.name,name:r.name,folderId:Rn(r.folder,this._projectId)}}async moveItem(e,t){const[l,o]=Tn(e.id),a=await this._restApi.emFiles.items_move_partial_update({file_name:o,target_folder:t,is_folder:e.isFolder,path_folder:l,project_id:this._projectId},{type:kn.cM.Json});a.error&&this.handleError(a.error);return{id:[Rn(a.data.item.new_path||"",this._projectId),o].filter(e=>e).join("/")}}async copyItem(e,t){const[l,o]=Tn(e.id),a=await this._restApi.emFiles.items_move_partial_update({file_name:o,target_folder:t,is_folder:e.isFolder,path_folder:l,project_id:this._projectId,is_copy:!0},{type:kn.cM.Json});return a.error&&this.handleError(a.error),{id:[t,o].filter(e=>e).join("/")}}async uploadFileByUrl(e,t){const l=(0,Cn.o)(e);if(l.startsWith("http://localhost")||l.startsWith("https://localhost")){const e=await(await fetch(l)).blob();return this.uploadFile({name:l.split("/").pop()||"file",size:e.size,folderId:t,data:e,type:Bn.A.getType(l)||"application/octet-stream"})}const o=await this._restApi.emFiles.files_upload_by_url_create({url:l,path_folder:t,project_id:this._projectId},{type:kn.cM.Json});o.error&&this.handleError(o.error);const a=o.data;return{id:`${Rn(a.folder,this._projectId)}/${a.name}`,name:a.name,size:Number(a.size),type:a.type,folderId:Rn(a.folder,this._projectId)||null,date:a.date||(new Date).toISOString()}}async updateFile(e,t){const[l,o]=Tn(e.id),a=await this._restApi.emFiles.files_partial_update({file_name:o,project_id:this._projectId,path_folder:l,updates:{data:"string"===typeof t.data?t.data:await(r=t.data,new Promise((e,t)=>{const l=new FileReader;l.onload=()=>{const t=l.result.toString().split(",")[1];e(t)},l.onerror=t,l.readAsDataURL(r)})),name:t.name}},{type:kn.cM.Json});var r;if(!a.error){const e=a.data;return{...e,id:`${Rn(e.folder,this._projectId)}/${e.name}`,size:Number(e.size),folderId:Rn(e.folder,this._projectId),date:e.date||(new Date).toISOString(),selected:!1}}this.handleError(a.error)}})||bn;const Ln=o.createElement(Ir.A,{style:{fontSize:48},spin:!0}),In=(0,o.lazy)(()=>Promise.all([l.e(8473),l.e(57)]).then(l.bind(l,10653))),Pn=(0,o.lazy)(()=>Promise.all([l.e(3085),l.e(9960),l.e(6501)]).then(l.bind(l,36501))),On={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},Fn=()=>{const e=(0,Y.rD)(),t=(0,Sn.of)(),l=(0,v.d4)(Ce.yN),[a,r]=(0,o.useState)(null),n=(0,Sn.XB)();return(0,o.useEffect)(()=>{r(t||new Nn({projectId:String(null===l||void 0===l?void 0:l.id),restApi:n}))},[l,r,n,t]),(0,o.useEffect)(()=>{},[t]),o.createElement(o.Suspense,{fallback:o.createElement(s.A,{size:"large",style:On},o.createElement(rt.A,{indicator:Ln}))},a&&e.imageCenterFileManagerView?o.createElement(In,{storageProvider:a}):o.createElement(Pn,null))},Mn=(e,t)=>o.createElement(t,Object.assign({className:"email-pane__tab-bar"},e)),{Content:Dn}=a.A,{useToken:Vn}=r.A,Wn=(0,o.memo)(e=>o.createElement(Ur,e)),jn=(0,o.memo)(e=>o.createElement(wl,e)),zn=(0,o.memo)(e=>o.createElement(jl,e)),Hn=(0,o.memo)(e=>o.createElement(Xr.A,e)),Gn=(0,o.memo)((0,o.forwardRef)((e,t)=>o.createElement(qr.A,Object.assign({},e,{ref:t})))),Un=(0,o.memo)(e=>o.createElement(Uo,e)),qn=(0,o.memo)(e=>o.createElement(be,e)),Xn=(0,o.memo)(e=>o.createElement(Zr,e)),$n=({emailElement:e,isSuccess:t,setIsCollaborationEditor:l,isShowAddAllBlocksModal:r,triggerOpenSavedBlocksTab:S,setIsShowAddAllBlocksModal:C})=>{var B,x,T,R,N;const L=1200,{__:I,_x:P}=(0,y.s9)(),O=(0,Pe.QC)(),{emailId:F,blockId:M,projectId:W}=(0,_.g)(),j=(0,v.wA)(),{modal:G}=n.A.useApp(),U=(0,Y.rD)(),{token:q}=Vn(),X=(0,A.hN)(),$=(0,Dr.u)(),Z=(0,v.d4)(Ce.yN),Q=(0,yn.p)(),J=(0,v.d4)(Ie.B),ee=(0,v.d4)(we.C1),te=(0,v.d4)(we.B$),le=(0,v.d4)(D.cL),oe=(0,v.d4)(Ie.NQ),ae=(0,v.d4)(H.qX),re=(0,v.d4)(Xe.qX),ne=(0,v.d4)(Ie.Fv),ie=(0,v.d4)(Ie.yy),se=(0,v.d4)(vn.D2),de=(0,v.d4)(vn.jr),ce=(0,v.d4)(vn.hc),me=(0,v.d4)(Ie.Tn),[ue]=(0,Mr.Ll)(),[pe,ge]=(0,o.useState)(!1),[he,be]=(0,o.useState)(),[fe,Ee]=(0,o.useState)(U.defaultBuildPanel||"empty"),[ve,_e]=(0,o.useState)("empty"),[ye,Ae]=(0,o.useState)(!1),[ke,Be]=(0,o.useState)([]),[xe,Te]=(0,o.useState)(!1),[Re,Ne]=(0,o.useState)([]),[Le,Oe]=(0,o.useState)(!1),Fe=(0,Ll.cR)();let Me=!te&&(null===(B=ee.id)||void 0===B?void 0:B.toString())===(null===Z||void 0===Z||null===(x=Z.members)||void 0===x?void 0:x.owner.ID)&&!0;const De=!V.EW.isPlugin||((null===U||void 0===U?void 0:U.configSwither)||!1);(0,o.useEffect)(()=>{j((0,Ie.sy)())},[j]),(0,o.useEffect)(()=>{const e=window.localStorage.getItem(V.V0.em_active_tab);e&&j((0,Ie.PM)(e))},[Q,j]);const Ve=F||M,We=e.hasOwnProperty("type")?V.IE:V.Tm,je=We===V.Tm?ae:re,[ze,He]=(0,o.useState)({}),Ge=(0,o.useRef)(null),Ue=(0,o.useRef)(),qe=(0,o.useRef)(),$e=(0,o.useRef)(),Ze=(0,o.useRef)(),Ye=(0,o.useRef)(),Ke=(0,o.useRef)(null),Qe=(0,o.useRef)(!1),[Je,et]=(0,o.useState)(!1),[tt,lt]=(0,o.useState)(!1),[ot]=(0,_n.b9)(),[at,rt]=(0,o.useState)(!1),[nt,it]=(0,o.useState)(0),[st,dt]=(0,o.useState)(!1),ct=V.EW.isPlugin?!!U.configSwither&&("pro"===localStorage.getItem("configSwither")||"editor"!==localStorage.getItem("configSwither")&&"pro"===U.mode):"pro"===ee.email_builder_config||"simple"===ee.email_builder_config,mt=(0,o.useCallback)(()=>{clearTimeout(Ke.current);const e=".blocks-search__result-holder";Fe.querySelector(e)&&(se||de||ce)&&(Fe.querySelector(e).style.removeProperty("transition"),Fe.querySelector(e).style.opacity=0,Fe.querySelectorAll(".blocks-search__result-body").forEach(e=>e.style.removeProperty("height")),Ke.current=setTimeout(()=>{Fe.querySelectorAll(".blocks-search__result-body").forEach(e=>{e.style.height=207*e.getBoundingClientRect().height/660+"px"}),Fe.querySelector(e)&&(Fe.querySelector(e).style.transition="opacity 0.2s",Fe.querySelectorAll(e).forEach(e=>e.style.opacity=1))},200))},[de,se,ce]),ut=(0,o.useCallback)(e=>{const t=e.target;setTimeout(()=>{et(t.closest(".desktop_view")),lt(t.closest(".mobile_view"))},100)});(0,o.useEffect)(()=>{const e=(0,Ca.t)(Fe,"mouseover",ut);return()=>{e.dispose()}},[Fe,ut]),(0,o.useEffect)(()=>{j((0,Ie.wr)(pe?V.ND:V.Vp))},[pe,j]),(0,o.useEffect)(()=>{"function"===typeof l&&(Re.length>0?l(!0):l(!1))},[Re]);const[pt]=(0,Fr.EQ)(),{data:gt={},refetch:ht,status:bt}=(0,Fr.gb)({entity_id:Ve},{skip:!Ve}),[ft,Et]=(0,o.useState)([]),[vt,_t]=(0,o.useState)(""!==U.defaultBuildPanel?V.nA:V.Jy),[yt,At]=(0,o.useState)(null),St=(0,o.useCallback)(()=>{var e;const t=null===(e=qe.current)||void 0===e?void 0:e.getBoundingClientRect(),l=null===he||void 0===he?void 0:he.getBoundingClientRect();O.send({operation:V.Ru.SANDBOX_WINDOW_CHARACTERISTIC,settings:{iframeOffsetTop:ne&&"bottom"!==ie?0:30,scrollTop:-(null===t||void 0===t?void 0:t.top)+(null===l||void 0===l?void 0:l.top)+30,innerHeight:window.innerHeight,previewHeight:null===l||void 0===l?void 0:l.height,mode:ne&&"bottom"!==ie?"code":"default"}})},[ie,ne,he,O]),kt=t&&e,wt=(0,o.useCallback)(e=>{const t=window.navigator.platform.match("Mac");U.codeEnabled&&U.codeSideEnabled&&e.altKey&&88===e.keyCode&&(j((0,Ie.vs)()),Me&&(rt(!0),it(1))),((t?e.metaKey:e.ctrlKey)&&e.shiftKey&&76===e.keyCode||(t?e.metaKey:e.ctrlKey)&&e.shiftKey&&69===e.keyCode||(t?e.metaKey:e.ctrlKey)&&e.shiftKey&&82===e.keyCode)&&e.preventDefault()},[j,U.codeEnabled,Me,U.codeSideEnabled]),Ct=(0,o.useCallback)(t=>{document.querySelector(".easylogic-colorpicker")||Fe.querySelector(".easylogic-colorpicker")||t.target.closest(".email-pane__collapse-wrapper")||t.target.closest(".selected-element-panel__columns-settings__controls__column__remove")||t.target.closest(".email-preview__content-col_main")||t.target.closest(".email-preview-menu")||t.target.closest(".monaco-editor")||t.target.closest(".main__pane-close-btn")||t.target.closest(".main__pane-trigger")||t.target.closest(".ant-modal-wrap")||t.target.closest(".email-pane__sizes")||t.target.closest(".ant-input-clear-icon")||yt||t.target.closest(".email-preview-menu__history")||t.target.closest(".selected-element-panel-content")||t.target.closest(".toggle_view")||t.target.closest(".upload-bg-image__menu")||t.target.closest(".email-pane__paths")||t.target.closest(".ant-tabs-extra-content")||t.target.closest(".anticon-delete")||le===V.lx.UPLOAD_IMAGE_MODAL||le===V.lx.UPLOAD_IMAGE_MODAL_AI||le===V.lx.UPLOAD_IMAGE_MODAL_UPLOAD||le===V.lx.UPLOAD_IMAGE_MODAL_EDIT||le===V.lx.IMAGE_EDITOR_MODAL||le===V.lx.UPLOAD_BACKGROUND_MODAL||(J===V.yI&&(j((0,Ie.Fk)()),O.send({operation:V.Ru.SANDBOX_ELEMENT_ACTIVE_RESET}),Be([])),j((0,Ie.mi)(!0)),O.send({operation:V.Ru.SANDBOX_LOCK_EDIT,data:!1}),setTimeout(()=>{e.type?j((0,Xe.A9)({type:null})):j((0,H.A9)({type:null}))},300)),At(null)},[j,e.type,le,yt,J,O]),[Bt,xt]=(0,o.useState)(!0),{data:Tt=[],refetch:Rt}=(0,fn.Cf)(Ve,{skip:!Ve}),[Nt,Lt]=(0,o.useState)(""),[It,Pt]=(0,o.useState)("");(0,o.useEffect)(()=>{Ve&&Rt()},[J,Ve,Rt]),(0,o.useEffect)(()=>{Ve&&!Object.keys(gt).length&&"fulfilled"===bt&&ht()},[J,Ve,ht,gt,bt]),(0,o.useEffect)(()=>{var e;const t=new K.jG,l=window.localStorage.getItem(V.V0.em_active_tab);if(0===(null===gt||void 0===gt?void 0:gt.totalCount)&&"pending"!==bt){const e={project_id:W,connection:"chat",entity_id:Ve,context:"default",locale:ee.locale.slice(0,2)};l||pt({body:e}).then(()=>{t.isDisposed()||"fulfilled"===bt&&ht()})}const o={data:{role:"assistant",message:"\u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442",isLoading:!0}};var a,r;(null===gt||void 0===gt||null===(e=gt.documents)||void 0===e?void 0:e.length)>0?(window.localStorage.removeItem(V.V0.em_active_tab),Et(null===gt||void 0===gt?void 0:gt.documents),null!==gt&&void 0!==gt&&null!==(a=gt.documents[(null===gt||void 0===gt||null===(r=gt.documents)||void 0===r?void 0:r.length)-1].data)&&void 0!==a&&a.userInfo&&Et([...null===gt||void 0===gt?void 0:gt.documents,o])):l||Et([o]);return()=>t.dispose()},[Ve,ee.locale,null===gt||void 0===gt?void 0:gt.totalCount,null===gt||void 0===gt?void 0:gt.documents,W,ht,pt,bt]),(0,o.useEffect)(()=>{He({}),j(We===V.Tm?(0,H.A9)({}):(0,Xe.A9)({}))},[j,We]);const Ot=(0,o.useCallback)(e=>{j((0,H.G_)(e))},[j]),Ft=(0,o.useCallback)(e=>{j((0,Xe.Dz)(e))},[j]),Mt=(0,o.useCallback)(e=>{j(We===V.Tm?(0,H.A9)(e):(0,Xe.A9)(e))},[j,We]);(0,o.useEffect)(()=>{const e=Ze.current,t=$e.current;be(ne?t:e)},[ne,ie]);const Dt=(0,o.useCallback)(e=>{Ee(e),"search"===e?Ae(!0):(Ae(!1),_e(e)),setTimeout(mt,50)},[mt]),Vt=(0,o.useCallback)(t=>{const l=t.data.operation,o=t.data,a=t.data.action;if("application_block_inserted"===l||"application_block_inserted"===t.data.operationId){const l=t.data.operationId?t.data.data:o||{},a="project"===l.type||"template"===l.type||"common"===l.type?"block":"structure",r=l.name||l.type||("block"===a?"block":"structure");$({event:"add",action:"add_element_to_email",element_type:a,element_name:r,entity_id:(null===e||void 0===e?void 0:e.id)||F||M,project_id:(null===Z||void 0===Z?void 0:Z.id)||W})}if(l===V.Ru.APPLICATION_SCROLL_TO&&setTimeout(()=>{var e;null===(e=$e.current)||void 0===e||e.scrollTo({top:t.data.settings.value,behavior:"smooth"})},100),l===V.Ru.APPLICATION_PREVIEW_ALERT_SHOW&&Oe(o.settings.show),l===V.Ru.APPLICATION_ACTION&&"toggle_editor"===a&&j((0,Ie.vs)()),l===V.Ru.APPLICATION_IFRAME_SET_HEIGHT&&(Fe.querySelector(".email-pane__iframe").style.height=o.settings.height+"px"),l===V.Ru.APPLICATION_EMAIL_SETTINGS_SET){let e=Object.assign({},o.settings);delete e.preheader;Object.values(e).every(e=>!e)?(j((0,H.M7)(!0)),j((0,Ie.Fk)())):Ot(o.settings),o.settings.noBlocks,j((0,Ie.wW)(o.settings.responsive)),xt(e.structuresMedia)}if(l===V.Ru.APPLICATION_BLOCK_SETTINGS_SET){Object.values(o.settings).every(e=>!e)?(j((0,Xe.rc)(!0)),j((0,Ie.Fk)())):(Ft(o.settings),xt(o.settings.structuresMedia))}if(l===V.Ru.APPLICATION_ELEMENT_SETTINGS_SET){var r,n;const e=Object.values(V.bV),t=!!o.tab||!e.includes(o.type);var i;if(t&&J===V.yI&&j((0,Ie.Fk)()),o.type===V.bV.EMPTY_TABLE||o.type===V.bV.EMPTY_TD?(j((0,Ie.PM)(V.Bv)),o.type===V.bV.EMPTY_TABLE?(_t(V.nA),o.tab?Dt(o.tab):Dt("common")):o.type===V.bV.EMPTY_TD&&_t(V.Jy)):o.type&&J!==V.yI&&j((0,Ie.PM)(V.yI)),o.type===V.bV.CAROUSEL||o.type===V.bV.ACCORDION?(He({settings:{...o.settings,type:t?null:o.type,caption:o.caption,parent:t?null:o.settings.parent},type:t?null:o.type,parent:t?null:o.settings.parent,caption:o.caption}),Mt({})):(Mt({...o.settings,type:t?null:o.type,parent:t?null:o.settings.parent,caption:o.caption}),He({})),(null===(r=o.settings)||void 0===r||null===(n=r.path)||void 0===n?void 0:n.length)>0)Be(null===(i=o.settings)||void 0===i?void 0:i.path)}l===V.Ru.APPLICATION_ELEMENT_SETTINGS_CLOSE&&j((0,Ie.Fk)())},[j,Ot,Ft,Mt,J,Dt,Fe,$,e,F,M,Z]);(0,o.useEffect)(()=>{w.gV({id:null===ee||void 0===ee?void 0:ee.id,email:null===ee||void 0===ee?void 0:ee.email,username:null===ee||void 0===ee?void 0:ee.name})},[ee]),(0,o.useEffect)(()=>{ee.email_builder_config&&j((0,wa.EV)(ee.email_builder_config))},[ee.email_builder_config,j]),(0,o.useEffect)(()=>{var e,t;if(ne&&Me&&j((0,Ie.vs)()),V.EW.isPlugin){if(U.configSwither){let e=localStorage.getItem("configSwither")||U.mode||"editor";localStorage.setItem("configSwither",e),j((0,wa.EV)(e))}}else te||(null===(e=ee.id)||void 0===e?void 0:e.toString())!==(null===Z||void 0===Z||null===(t=Z.members)||void 0===t?void 0:t.owner.ID)?"simple"===U.mode&&(ot({email_builder_config:"pro"}),j((0,wa.EV)("pro"))):(ot({email_builder_config:"simple"}),j((0,wa.EV)("simple")))},[]);const Wt=t=>{var l,o;te||(null===(l=ee.id)||void 0===l||l.toString(),null===Z||void 0===Z||null===(o=Z.members)||void 0===o||o.owner.ID),setTimeout(()=>{var l,o;if(te||(null===(l=ee.id)||void 0===l?void 0:l.toString())!==(null===Z||void 0===Z||null===(o=Z.members)||void 0===o?void 0:o.owner.ID)){let l=t?"pro":"editor";ot({email_builder_config:l}),localStorage.setItem("configSwither",l),j((0,wa.EV)(l)),$({event:"change",action:"change_config_mode",config_mode:l,entity_id:(null===e||void 0===e?void 0:e.id)||F||M,project_id:(null===Z||void 0===Z?void 0:Z.id)||W})}else j((0,wa.EV)("pro")),dt(!0),rt(!0),$({event:"change",action:"change_config_mode",config_mode:"pro",entity_id:(null===e||void 0===e?void 0:e.id)||F||M,project_id:(null===Z||void 0===Z?void 0:Z.id)||W})},200)};(0,Sa.A)(Vt),(0,o.useEffect)(()=>{const t=O.addListener("application_atom_inserted",t=>{$({event:"add",action:"add_element_to_email",element_type:"atom",element_name:t||"atom",entity_id:(null===e||void 0===e?void 0:e.id)||F||M,project_id:(null===Z||void 0===Z?void 0:Z.id)||W})}),l=O.addListener("application_block_inserted",t=>{const l="project"===(null===t||void 0===t?void 0:t.type)||"template"===(null===t||void 0===t?void 0:t.type)||"common"===(null===t||void 0===t?void 0:t.type)?"block":"structure",o=(null===t||void 0===t?void 0:t.name)||(null===t||void 0===t?void 0:t.type)||("block"===l?"block":"structure");$({event:"add",action:"add_element_to_email",element_type:l,element_name:o,entity_id:(null===e||void 0===e?void 0:e.id)||F||M,project_id:(null===Z||void 0===Z?void 0:Z.id)||W})});return()=>{null===t||void 0===t||t.dispose(),null===l||void 0===l||l.dispose()}},[O,$,null===e||void 0===e?void 0:e.id,F,M,W,null===Z||void 0===Z?void 0:Z.id]);const jt=(0,o.useRef)(),[zt,Ht]=(0,o.useState)("unset"),Gt=(0,o.useCallback)(()=>{var e,t;let l;const o=null===(e=$e.current)||void 0===e?void 0:e.getBoundingClientRect();if((null===jt||void 0===jt||null===(t=jt.current)||void 0===t?void 0:t.getBoundingClientRect().top)>=0){const e=o&&Math.round(o&&(null===o||void 0===o?void 0:o.height)-30);jt.current.style.height=`${e}px`,Ht(e-30)}l&&window.clearTimeout(l),l=window.setTimeout(function(){O.isInited()&&St()},100)},[St,O]);(0,o.useEffect)(()=>(J===V.z$?Ge.current=setInterval(()=>{ht({entity_id:Ve})},5e3):clearInterval(Ge.current),clearInterval(Ge.current)),[Ve,ht,J]);const Ut=window.localStorage.getItem(V.V0.em_code_mode_pane_sizes),[qt,Xt]=(0,o.useState)(+Ut||50),$t=(0,o.useRef)(qt);(0,o.useEffect)(()=>{$t.current=qt},[qt]);const Zt=()=>{let e=Fe.querySelector(".block-search__preview");e&&(e.style.opacity="0",e.style.transform="translateX(-99%)",setTimeout(function(){e.remove()},300))};let Yt=[];U.blocksEmptyEnabled&&Yt.push({label:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},placement:"top",title:I("Empty blocks")},o.createElement("div",{style:{paddingTop:4}},o.createElement(z.A,{icon:"BorderOuterOutlined",style:{fontSize:18}}))),value:"empty"}),U.blocksSavedEnabled&&Yt.push({label:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},placement:"top",title:I("Saved blocks")},o.createElement("div",{style:{paddingTop:4}},o.createElement(z.A,{icon:"AppstoreAddOutlined",style:{fontSize:18}}))),value:"project"}),U.blocksCommonEnabled&&Yt.push({label:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},placement:"top",title:I("Common blocks")},o.createElement("div",{style:{paddingTop:4}},o.createElement(z.A,{icon:"AppstoreOutlined",style:{fontSize:18}}))),value:"common"}),U.blocksTemplateEnabled&&Yt.push({label:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},placement:"top",title:I("Template blocks")},o.createElement("div",{style:{paddingTop:4}},o.createElement(z.A,{icon:"BuildOutlined",style:{fontSize:18}}))),value:"template"}),U.blocksSearchEnabled&&Yt.push({label:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},placement:"top",title:I("Blocks search")},o.createElement("div",{style:{paddingTop:4}},o.createElement(z.A,{icon:"SearchOutlined",style:{fontSize:18}}))),value:"search"});let Kt=[{label:o.createElement("div",{className:"email-pane__tab"},I("Elements")),key:V.Jy,forceRender:!0,className:"email-pane__collapse-panel email-pane__atoms",children:o.createElement(Un,null)},{label:o.createElement("div",{className:"email-pane__tab"},I("Blocks")),key:V.nA,forceRender:!0,className:"email-pane__collapse-panel email-pane__blocks-search",style:{height:U.blocksSectionsShow?"calc(100% - 44px)":"100%"},children:o.createElement(o.Fragment,null,U.blocksSectionsShow&&o.createElement(o.Fragment,null,o.createElement(s.A.Compact,{block:!0},!ye&&o.createElement(d.A,{block:!0,style:{width:"100%",marginTop:24},onChange:Dt,value:fe,options:Yt}),ye&&o.createElement("div",{style:{width:"100%",height:36}}),ye&&o.createElement("div",{style:{width:36,textAlign:"right",marginTop:22}},o.createElement(z.A,{icon:"CloseOutlined",style:{padding:"0 2px 0",cursor:"pointer"},onClick:()=>{Ae(!1),Ee(ve)}}))),o.createElement("div",{className:"blocks-search__divider-wrapper",style:{marginTop:ye?28:12}},o.createElement(c.A,{className:"blocks-search__divider"}))),o.createElement("div",{style:{height:"100%"}},o.createElement("div",{className:"blocks-search__empty-shadow",style:{display:"empty"!==fe||ye?"none":"block"}},Bt?o.createElement(bo,null):o.createElement(to,null)),o.createElement("div",{style:{height:U.blocksSectionsShow?"calc(100% - 24px)":"100%",display:"empty"!==fe||ye?"block":"none"}},o.createElement(zn,{parentEmailId:null===e||void 0===e?void 0:e.parent_email,blocksTab:fe,search:ye,reloadBlockScreens:mt,email:e,setIsShowAddAllBlocksModal:C}))))}],Qt=[{disabled:at,key:V.yI,style:{height:U.sidePanelFloating?ne&&"bottom"===ie?zt:"calc(100% - 30px)":"100%"},className:"em-analytics__email-tab-properties",children:o.createElement(o.Fragment,null,(!(null===je||void 0===je||!je.type)||!(null===ze||void 0===ze||!ze.type))&&o.createElement("div",{className:k()("email-pane__collapse-wrapper",{"mobile-view":pe,"mobile-properties":pe&&me!==V.mX}),onMouseLeave:Zt},o.createElement(xr,{email:e,formSettings:ze})))},{disabled:at,key:V.Vv,style:{height:U.sidePanelFloating?ne&&"bottom"===ie?zt:"calc(100% - 30px)":"100%"},className:"em-analytics__email-tab-history",children:kt&&o.createElement("div",{className:"email-pane__collapse-wrapper",onMouseLeave:Zt},o.createElement(Xn,{setCollapsedHistory:()=>j((0,Ie.mi)(!0)),emailElement:kt}))},{key:V.rb,className:"em-analytics__email-tab-properties"},{disabled:at,label:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},placement:"left",title:P("Build","tab")},o.createElement(z.A,{"data-testid":"contentIcon",icon:"PlusCircleOutlined",size:24,strokeWidth:U.iconStrokeWidth})),key:V.Bv,className:"em-analytics__email-tab-build",style:{height:U.sidePanelFloating?ne&&"bottom"===ie?zt:"calc(100% - 30px)":"100%",overflow:"hidden"},children:o.createElement("div",{className:k()("email-pane__collapse-wrapper",{"email-pane__collapse-wrapper_no-topleft-radius":J===V.Bv||!J}),onMouseLeave:Zt},o.createElement(m.A,{className:k()("secondary-tabs email-pane__collapse",{"secondary-tabs_unset_scroll":vt===V.nA}),size:"large",animated:{inkBar:!1,tabPane:!1},activeKey:vt,onChange:e=>_t(e||""),items:Kt}))},{disabled:at,label:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},styles:{body:{border:"2px dot-dash red"}},placement:"left",title:P("Styles","tab")},o.createElement(z.A,{"data-testid":"stylesIcon",icon:"Styles",size:24,strokeWidth:U.iconStrokeWidth})),key:V.rY,className:"em-analytics__email-tab-styles",style:{height:U.sidePanelFloating?ne&&"bottom"===ie?zt:"calc(100% - 30px)":"100%",overflow:"hidden"},children:o.createElement("div",{className:"email-pane__collapse-wrapper"},o.createElement(jn,{email:e}))}];U.commentsEnabled&&Qt.push({disabled:at,label:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},placement:"left",title:P("Discuss","tab")},o.createElement(z.A,{"data-testid":"commentsIcon",icon:"CommentOutlined",size:24,strokeWidth:U.iconStrokeWidth}),Me&&o.createElement(z.A,{icon:"Lock",size:14,strokeWidth:U.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),!!Tt.length&&o.createElement("span",{className:"email-pane__comment-counter"},Tt.filter(e=>"deleted"!==e.comment_status).length)),key:V.hc,className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:U.sidePanelFloating?ne&&"bottom"===ie?zt:"calc(100% - 30px)":"100%",overflow:"hidden"},children:o.createElement("div",{className:"email-pane__collapse-wrapper"},o.createElement(m.A,{className:"secondary-tabs email-settings__collapse",size:"large",animated:{inkBar:!1,tabPane:!1},activeKey:V.hc,items:[{label:o.createElement(o.Fragment,null,I("Discuss")),key:V.hc,forceRender:!0,className:"email-settings__collapse-panel",children:Ve?o.createElement(qo.A,{email:e,comments:Tt,subjectId:Ve,isLoggedIn:!0,emailElementType:We}):o.createElement("div",{className:"aside-content-wrapper"},e.hasOwnProperty("type")?o.createElement(u.A,{description:I("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):o.createElement(u.A,{description:I("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}))}]}))});const Jt=()=>{ue({entity_id:Ve}).then(e=>{e.error?X.error({message:e.error.data.code,description:e.error.data.message}):e.data.success&&X.success({message:I("Success"),description:e.data.success}),ht(),Te(!1)})};U.aiAssistentEnabled&&Qt.push({disabled:at,label:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},placement:"left",title:P("AI assistant","tab")},o.createElement(z.A,{"data-testid":"aiAssistentIcon",icon:"AI",size:24,strokeWidth:U.iconStrokeWidth}),Me&&o.createElement(z.A,{icon:"Lock",size:14,strokeWidth:U.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),(null===gt||void 0===gt?void 0:gt.totalCount)>0&&Ve&&o.createElement("span",{className:"email-pane__comment-counter"},null===gt||void 0===gt?void 0:gt.totalCount)),key:V.z$,className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:U.sidePanelFloating?ne&&"bottom"===ie?zt:"calc(100% - 30px)":"100%",overflow:"hidden"},children:o.createElement(o.Fragment,null,o.createElement("div",{className:"email-pane__collapse-wrapper"},o.createElement(m.A,{className:"secondary-tabs email-settings__collapse",size:"large",animated:{inkBar:!1,tabPane:!1},activeKey:V.z$,tabBarExtraContent:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},placement:"top",title:I("Clear chat")},o.createElement(p.A,{description:"Clear chat history?",onConfirm:Jt,okText:"Yes",cancelText:"No",icon:"",placement:"leftTop",title:!1},o.createElement(g.Ay,{type:"text",icon:o.createElement(z.A,{icon:"ClearChat",style:{fontSize:16}}),style:{marginRight:16}}))),items:[{label:o.createElement(o.Fragment,null,I("AI assistant")),key:V.z$,forceRender:!0,className:"email-settings__collapse-panel",children:Ve||window.localStorage.getItem(V.V0.em_active_tab)?o.createElement(Wn,{messages:ft.length>0?ft:[{data:{role:"assistant",message:"\u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442",isLoading:!0}}],newEmailAiGeneratorRef:Qe}):o.createElement("div",{className:"aside-content-wrapper"},e.hasOwnProperty("type")?o.createElement(u.A,{description:I("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):o.createElement(u.A,{description:I("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}))}]})))}),U.optimizeEnabled&&Qt.push({disabled:at,label:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},styles:{body:{border:"2px dot-dash red"}},placement:"left",title:P("Optimize","tab")},o.createElement(z.A,{"data-testid":"optimizeIcon",icon:"Speed",size:24,strokeWidth:U.iconStrokeWidth}),Me&&o.createElement(z.A,{icon:"Lock",size:14,strokeWidth:U.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"})),key:V.N7,className:"em-analytics__email-tab-optimise",style:{height:U.sidePanelFloating?ne&&"bottom"===ie?zt:"calc(100% - 30px)":"100%",overflow:"hidden"},children:o.createElement("div",{className:"email-pane__collapse-wrapper"},o.createElement(m.A,{className:"secondary-tabs secondary-tabs_optimise email-settings__collapse",size:"large",animated:{inkBar:!1,tabPane:!1},activeKey:V.N7,items:[{label:o.createElement(o.Fragment,null,I("Optimize")),key:V.N7,forceRender:!0,className:"email-settings__collapse-panel",children:o.createElement(hn,null)}]}))}),U.settingsEnabled&&Qt.push({disabled:at,label:o.createElement(i.A,{classNames:{body:"email-pane__tooltip"},placement:"left",title:P("Settings","tab")},o.createElement("span",null,o.createElement(z.A,{"data-testid":"settingsIcon",icon:"SettingOutlined",size:24,strokeWidth:U.iconStrokeWidth}))),key:V.zx,className:"em-analytics__email-tab-edit",style:{height:U.sidePanelFloating?ne&&"bottom"===ie?zt:"calc(100% - 30px)":"100%",overflow:"hidden"},children:o.createElement("div",{className:"email-pane__collapse-wrapper"},o.createElement(qn,{email:e}))});const[el,tl]=(0,o.useState)([]),[ll,ol]=(0,o.useState)(!1),[al,rl]=(0,o.useState)(0),[nl,il]=(0,o.useState)(0),sl=(null===(T=Fe.querySelector(".email-pane__col_preview"))||void 0===T?void 0:T.getBoundingClientRect().width)-(U.sidePanelFloating?0:38),[dl,cl]=(0,o.useState)(null);(0,o.useEffect)(()=>{Ve&&Rt(Ve)},[Ve,Rt]),(0,o.useEffect)(()=>{const e=O.onInit(()=>{O.send({operation:V.Ru.SANDBOX_LOCK_EDIT,data:!1}),O.send({operation:V.Ru.SANDBOX_LOCK_DISCUSS,value:ll})});return()=>e.dispose()},[ll,O]),(0,o.useEffect)(()=>{if(el.length<2){const e=null===he||void 0===he?void 0:he.getBoundingClientRect(),t=setInterval(l,50);function l(){O.isInited()&&e&&(St(),clearInterval(t))}tl(e=>[...e,t])}return clearInterval(el[el.length-1])},[el,he,St,O]);const ml=(0,o.useCallback)((e=oe)=>{var t;O.send({operation:V.Ru.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:e+2}}),null===(t=Ue.current)||void 0===t||t.resize()},[oe,O]);(0,o.useEffect)(()=>{if(ol(J===V.hc),J!==V.rb){var e;const t=Fe.querySelector(".email-pane__row"),l=null===t||void 0===t?void 0:t.getBoundingClientRect().width;(null===qe||void 0===qe||null===(e=qe.current)||void 0===e?void 0:e.getBoundingClientRect().width)+540>l&&j((0,Ie.vc)("100%"))}},[j,J,Fe]);const ul=(0,o.useCallback)(()=>{const e=qe.current;e&&(e.style.borderWidth="1px",U.sidePanelFloating||(e.style.marginLeft="-1px",e.style.marginRight="-1px"),e.style.borderLeftColor=null,e.style.borderRightColor=null)},[U.sidePanelFloating]),pl=(0,o.useCallback)(e=>{const t=$t.current;fl(!1),dl&&(setTimeout(()=>ml(),50),cl(null)),e.target.classList.contains("email-pane__handle")||ul(),window.localStorage.setItem(V.V0.em_code_mode_pane_sizes,JSON.stringify(t))},[ml,dl,$t.current,ul]),gl=e=>t=>{t.target.classList.contains("email-pane__handle")&&(t.preventDefault(),rl(t.target.parentNode.offsetWidth),il(t.pageX),cl(e),At(e))},hl=e=>{const t=qe.current;"string"!==typeof e||dl&&dl!==e?dl||(ul(),Fe.querySelector(".email-pane__iframe").style.width="1px",Fe.querySelector(".email-pane__iframe").style.removeProperty("margin-left")):(Fe.querySelector(".email-pane__iframe").style.width="calc(100% + 1px)","right"===e?(t.style.borderRightColor=q.colorPrimary,t.style.borderRightWidth="2px"):(t.style.borderLeftColor=q.colorPrimary,t.style.borderLeftWidth="2px",Fe.querySelector(".email-pane__iframe").style.marginLeft="-1px"))},[bl,fl]=(0,o.useState)(!1),El=(0,o.useCallback)(e=>{if(!dl)return;let t=2*(e.pageX-nl),l=al+("left"===dl?-t:t);const o=Math.min(sl,L);if(l>318&&l<o){var a;const e=Math.min(l,L);j((0,Ie.vc)(e)),"number"===typeof e&&e<=425?pe||ge(!0):pe&&ge(!1),null===(a=Ue.current)||void 0===a||a.resize()}},[j,al,nl,dl,sl,pe,ge]),vl=(0,o.useCallback)(e=>{if(bl)if("bottom"===ie){const t=Ye.current.getBoundingClientRect().height,l=Ye.current.getBoundingClientRect().top,o=(e.clientY-l)/t*100;if(o<20||o>80)return;Xt(o),Gt()}else{const t=Ye.current.getBoundingClientRect().width,l=Ye.current.getBoundingClientRect().left,o=(e.clientX-l)/t*100,a=qe.current.getBoundingClientRect().width;if(U.desktopMobileSwitchPanel&&"number"===typeof a&&a<=425&&(j((0,Ie.vc)(425)),pe||ge(!0)),o<20||o>80)return;Xt(o)}},[bl,ie,Gt,pe,j,U.desktopMobileSwitchPanel,ge]);(0,o.useEffect)(()=>{Gt()},[ne,Gt]);const _l=t=>{const l="number"===typeof t?Math.min(t,L):t;j((0,Ie.vc)(l)),setTimeout(()=>ml(l),700),"number"===typeof l&&l<=425?pe||ge(!0):pe&&ge(!1);const o="number"===typeof l?l:"100%"===l?"full":l,a="number"===typeof l&&l<=425?"mobile":"desktop";$({event:"change",action:"change_email_size",email_id:(null===e||void 0===e?void 0:e.id)||F||M,project_id:(null===Z||void 0===Z?void 0:Z.id)||W,width:o,view_type:a})};(0,o.useEffect)(()=>{const e=new K.jG;return e.addDisposable((0,Ca.a)(Fe,"click",Ct)),e.addDisposable((0,Ca.a)(Fe,"mouseup",e=>pl(e,qt),!0)),()=>{e.dispose()}},[Fe,Ct]),(0,o.useEffect)(()=>(window.addEventListener("scroll",Gt,!0),window.addEventListener("mousemove",El,!0),window.addEventListener("mousemove",vl),window.addEventListener("keydown",wt),()=>{window.removeEventListener("mousemove",El,!0),window.removeEventListener("mousemove",vl),window.removeEventListener("scroll",Gt,!0),window.removeEventListener("keydown",wt)}));const[yl,Al]=(0,o.useState)(U.emailPaneDesktopSize||oe);(0,o.useEffect)(()=>{U.emailPaneDesktopSize&&j((0,Ie.vc)(U.emailPaneDesktopSize))},[j,U.emailPaneDesktopSize]),(0,o.useEffect)(()=>{Al(ne&&"bottom"!==ie&&!pe&&U.desktopMobileSwitchPanel?"100%":oe)},[j,U.emailPaneDesktopSize,ne,ie,pe,U.desktopMobileSwitchPanel,oe]);return(0,o.useEffect)(()=>{S&&(_t(V.nA),Dt("project"))},[S]),o.createElement(a.A,{className:k()("email-pane",{"email-pane_code-mode":ne,"email-pane_only_code_mode_mobile":U.onlyCodeModeInMobile,"email-pane_code-mode-bottom":ne&&"bottom"===ie,"email-pane_no-element-navigation":!U.switchDesktopMobilePropsEnabled&&!U.stepToOtherElementEnabled&&!U.deleteButtonEnabled,"email-pane_is-mobile":pe,"email-pane_path-enabled":U.pathEnabled})},o.createElement(Dn,{className:"email-pane__container",ref:Ze},((null===je||void 0===je?void 0:je.type)===V.bV.TEXT||(null===je||void 0===je?void 0:je.type)===V.bV.LINK||je.type===V.bV.IMG||je.type===V.bV.BUTTON)&&ne&&"bottom"!==ie&&o.createElement(kr,{className:k()("selected-element-panel__content selected-element-panel__content_abs",{"selected-element-panel__hidden":je.type===V.bV.IMG}),emailElementType:We,formSettings:ze}),Le&&pe&&o.createElement(u.A,{message:I("Template is not mobile-friendly"),description:I("While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices."),type:"warning",className:"email-pane__col__alert",closable:!0}),o.createElement(h.A,{ref:Ye,className:k()("email-pane__row",{"email-pane__left":ne&&"right"===ie,"email-pane__right":ne&&"left"===ie,"email-pane__bottom":ne&&"bottom"===ie,"email-pane__sizeSwitcher":U.desktopMobileSwitchPanel,"email-pane__reverse":"left"===U.menuDirection,"email-pane__pinch":!U.sidePanelFloating})},o.createElement(b.A,{style:{flexGrow:1,overflowY:U.sidePanelFloating?"scroll":"hidden",overflowX:"hidden",height:ne&&"bottom"===ie?`calc(${qt}%)`:"100%",width:`${"left"===ie?100-qt:"bottom"===ie?100:qt}%`},id:"pane-content-wrapper",ref:U.sidePanelFloating?$e:null},o.createElement("div",{className:"email-pane__iframe-scroll-top",id:"iframe-scroll-top"}),U.desktopMobileSwitchPanel&&o.createElement(s.A,{className:"email-pane__sizes-panel-wrapper",direction:"vertical",size:10},o.createElement(s.A,{className:"email-pane__sizes-panel",size:0},o.createElement(i.A,{title:I("Desktop view"),placement:"top",open:Je},o.createElement(g.Ay,{type:pe?"text":"primary",icon:o.createElement(z.A,{icon:"DesktopOutlined"}),shape:"circle",onClick:()=>_l(U.emailPaneDesktopSize||1e3),className:"toggle_view desktop_view"})),o.createElement(i.A,{title:I("Mobile view"),placement:"top",open:tt},o.createElement(g.Ay,{type:pe?"primary":"text",icon:o.createElement(z.A,{icon:"MobileOutlined",size:16,strokeWidth:U.iconStrokeWidth}),shape:"circle",onClick:()=>_l(425),className:"toggle_view mobile_view"}))),U.codeSideEnabled&&o.createElement(i.A,{title:I("Code mode"),placement:"right"},o.createElement(g.Ay,{type:ne?"primary":"default",icon:o.createElement(z.A,{icon:"Code"}),shape:"circle",onClick:()=>(t=>{const l=ne?"visual":"code",o=!ne;if(ne?j((0,Ie.vs)()):"string"===typeof t?(j((0,Ie.Uf)(t)),!ne&&j((0,Ie.vs)())):j((0,Ie.vs)()),o){const l=We===V.IE?"block":"email",o="string"===typeof t?t:ie||"toggle";$({event:"activate",action:"activate_code_mode",entity_type:l,entity_id:(null===e||void 0===e?void 0:e.id)||F||M,project_id:(null===Z||void 0===Z?void 0:Z.id)||W,code_mode_direction:o})}$({event:"change",action:"change_editor_mode",editor_mode:l,entity_id:(null===e||void 0===e?void 0:e.id)||F||M,project_id:(null===Z||void 0===Z?void 0:Z.id)||W}),j((0,Ie.Fk)()),setTimeout(()=>{We===V.IE?j((0,Xe.A9)({type:null})):j((0,H.A9)({type:null}))},300),O.send({operation:V.Ru.SANDBOX_ELEMENT_ACTIVE_RESET}),j((0,En.rI)())})("right")}))),o.createElement(h.A,{className:k()("email-pane__col-wrapper",{container:ne&&"bottom"===ie||!ne,"email-pane__col-wrapper_reverse":"left"===U.menuDirection,"email-pane__col-wrapper_pinch":!U.sidePanelFloating}),style:{flexGrow:1,maxWidth:"unset",paddingTop:U.desktopMobileSwitchPanel&&ne&&"bottom"!==ie?"60px":""}},o.createElement(b.A,{className:"email-pane__col email-pane__col_preview",style:{flexGrow:1,maxWidth:"unset"},ref:U.sidePanelFloating?null:$e},U.desktopMobileSwitchRule&&o.createElement("div",{className:`email-pane__sizes ${Nt}`},o.createElement("div",{className:"email-pane__width-selectors-wrapper"},o.createElement("div",{className:"device-width__full",style:{flexGrow:1},onMouseEnter:()=>{Lt("device-width__full-hovered"),Pt(I("Desktop"))},onMouseLeave:()=>{Lt(""),Pt("")},onClick:()=>_l(1200)}),o.createElement("div",{className:"device-width__768",style:{width:171},onMouseEnter:()=>{Lt("device-width__768-hovered"),Pt(I("Small desktop \u2013 768px"))},onMouseLeave:()=>{Lt(""),Pt("")},onClick:()=>_l(768)}),o.createElement("div",{className:"device-width__425",style:{width:25},onMouseEnter:()=>{Lt("device-width__425-hovered"),Pt(I("Mobile L \u2013 425px"))},onMouseLeave:()=>{Lt(""),Pt("")},onClick:()=>_l(425)}),o.createElement("div",{className:"device-width__375",style:{width:28},onMouseEnter:()=>{Lt("device-width__375-hovered"),Pt(I("Mobile M \u2013 375px"))},onMouseLeave:()=>{Lt(""),Pt("")},onClick:()=>_l(375)}),o.createElement("div",{className:"device-width__320",style:{width:320},onMouseEnter:()=>{Lt("device-width__320-hovered"),Pt(I("Mobile S \u2013 320px"))},onMouseLeave:()=>{Lt(""),Pt("")},onClick:()=>_l(320)},It),o.createElement("div",{className:"device-width__375",style:{width:28},onMouseEnter:()=>{Lt("device-width__375-hovered"),Pt(I("Mobile M \u2013 375px"))},onMouseLeave:()=>{Lt(""),Pt("")},onClick:()=>_l(375)}),o.createElement("div",{className:"device-width__425",style:{width:25},onMouseEnter:()=>{Lt("device-width__425-hovered"),Pt(I("Mobile L \u2013 425px"))},onMouseLeave:()=>{Lt(""),Pt("")},onClick:()=>_l(425)},o.createElement(i.A,{title:I("Mobile view"),placement:"bottom"},o.createElement(g.Ay,{type:"default",icon:o.createElement(z.A,{icon:"MobileOutlined",size:16,strokeWidth:2}),size:"small",shape:"circle",style:{right:-12,top:4,zIndex:999,padding:0,position:"absolute",onClick:()=>_l(425)}}))),o.createElement("div",{className:"device-width__768",style:{width:171},onMouseEnter:()=>{Lt("device-width__768-hovered"),Pt(I("Small desktop \u2013 768px"))},onMouseLeave:()=>{Lt(""),Pt("")},onClick:()=>_l(768)},o.createElement(i.A,{title:I("Desktop view"),placement:"bottom"},o.createElement(g.Ay,{type:"default",icon:o.createElement(z.A,{icon:"DesktopOutlined",size:16,strokeWidth:2}),size:"small",shape:"circle",style:{right:-12,top:4,zIndex:999,padding:0,position:"absolute",onClick:()=>_l(768)}}))),o.createElement("div",{className:"device-width__full",style:{flexGrow:1},onMouseEnter:()=>{Lt("device-width__full-hovered"),Pt(I("Desktop"))},onMouseLeave:()=>{Lt(""),Pt("")},onClick:()=>_l(1200)}))),o.createElement("div",{className:k()("email-pane__resizable",{"email-pane__resizable_drag":dl||bl}),style:{maxWidth:"number"===typeof yl?Math.min(yl,L):L}},o.createElement("div",{className:"email-pane__handle left",onMouseDown:gl("left"),onMouseEnter:()=>hl("left"),onMouseLeave:hl}),o.createElement("div",{className:"email-pane__handle right",onMouseDown:gl("right"),onMouseEnter:()=>hl("right"),onMouseLeave:hl}),o.createElement("div",{className:k()("email-pane__content-col email-pane__content-col_main",{"email-pane__content-col_disable":dl||bl}),ref:qe,id:"pane-content-iframe"},o.createElement(Gn,{ref:Ue,className:"email-pane__iframe",email:e,handlerSendPosition:Gt})))),o.createElement(b.A,{style:{display:ne&&"bottom"!==ie||U.disableSideMenu?"none":"initial"},ref:jt,className:k()("email-pane__content-col email-pane__content-col_menu email-pane__content-col_tabs email-pane__col email-pane__col_settings",{"email-pane__col_disabled":J===V.rb})},(!ne||"bottom"===ie)&&o.createElement(m.A,{className:k()("email-pane__col_settings-inner",{"email-pane__col_settings-inner_reverse":"left"===U.menuDirection}),size:"middle",animated:{inkBar:!1,tabPane:!1},activeKey:J,onTabClick:t=>{Fe.querySelector(".atoms__list");if(V.Bv,U.toggleSidePanel&&t===J?j((0,Ie.PM)(V.rb)):"Optimize"===t?(0,K.Z1)(I,G):t!==V.yI&&t!==V.Vv?(j((0,Ie.PM)(t)),$({event:"navigate",action:"navigate_email_pane_tab",tab_name:t===V.rb?"DISABLED_TAB":t,entity_id:(null===e||void 0===e?void 0:e.id)||F||M,project_id:(null===Z||void 0===Z?void 0:Z.id)||W}),O.send({operation:V.Ru.SANDBOX_LOCK_EDIT,data:!1}),O.send({operation:V.Ru.SANDBOX_ELEMENT_ACTIVE_RESET}),Be([])):t!==V.yI&&t!==V.Vv||$({event:"navigate",action:"navigate_email_pane_tab",tab_name:t,entity_id:(null===e||void 0===e?void 0:e.id)||F||M,project_id:(null===Z||void 0===Z?void 0:Z.id)||W}),Me&&("Discuss"===t||"Optimise"===t||"AiChat"===t))switch(rt(!0),t){case"Discuss":it(7);break;case"Optimise":it(6);break;case"AiChat":it(9);break;default:it(0)}},renderTabBar:Mn,tabPosition:"right",items:Qt,tabBarExtraContent:De&&o.createElement("div",{style:{paddingTop:15,textAlign:"center"}},te||(null===(R=ee.id)||void 0===R?void 0:R.toString())!==(null===Z||void 0===Z||null===(N=Z.members)||void 0===N?void 0:N.owner.ID)?o.createElement(f.A,{className:"ant-switch_editor-mode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:Wt,defaultChecked:ct}):o.createElement(f.A,{className:"ant-switch_editor-mode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:Wt,checked:st}))}))),o.createElement("div",{className:"email-pane__iframe-scroll-bottom",id:"iframe-scroll-bottom"})),o.createElement(b.A,{style:{width:`${"right"===ie?100-qt:"bottom"===ie?100:qt}%`,position:"relative",height:"bottom"===ie?`calc(${100-qt}%)`:"unset",display:ne?"initial":"none"}},o.createElement("div",{className:"email-pane__code-divider",onMouseDown:()=>fl(!0)}),o.createElement("div",{className:"code-mode__pane code-mode__pane_editor email-pane__pane email-pane__pane_editor"},o.createElement("div",{className:"code-mode__pane-content email-pane__pane-content"},o.createElement(Hn,{email:e,setOtherUsers:Ne,readOnly:U.lockEditor,newEmailAiGeneratorRef:Qe}))))),U.pathEnabled&&o.createElement("div",{className:"email-pane__paths"},o.createElement(Kr,{elementPath:ke})),o.createElement("div",{className:"collaborator-list"},o.createElement(An.b,{users:Re,isEditor:V._P.isEditor,isPlugin:V.EW.isPlugin,token:q}))),"img"===(null===ze||void 0===ze?void 0:ze.type)&&ne&&"bottom"!==ie&&o.createElement("div",{className:"email-pane__collapse-wrapper email-pane__collapse-wrapper_disabled"},o.createElement(xr,{email:e,formSettings:ze})),o.createElement(Fn,null),o.createElement(Se.A,{open:at,onCancel:()=>{ne&&j((0,Ie.vs)()),j((0,Ie.Fk)()),j((0,wa.EV)("simple")),dt(!1),rt(!1),$({event:"change",action:"change_config_mode",config_mode:"simple",entity_id:(null===e||void 0===e?void 0:e.id)||F||M,project_id:(null===Z||void 0===Z?void 0:Z.id)||W})},initialSlide:nt}),o.createElement(E.A,{title:I("Warning"),centered:!0,open:xe,onOk:Jt,onCancel:()=>{Te(!1)}},o.createElement("p",null,I("Clear chat history?"))))}},10750:e=>{e.exports='\n<style>\n\t@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {\n\t\t.em-mob-width-100perc {\n\t\t\twidth: 100% !important;\n\t\t\tmax-width: 100% !important;\n\t\t}\n\n\t\t.em-mob-width-91perc {\n\t\t\twidth: 91% !important;\n\t\t\tmax-width: 91% !important;\n\t\t}\n\t}\n</style>\n<tr em="block" class="em-structure">\n\t<td align="center">\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>\n\t\t<![endif]--\x3e\n\t\t<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">\n\t\t\t<tr>\n\t\t\t\t<td align="center" valign="top">\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t<table border="0" cellspacing="0" cellpadding="0">\n\t\t\t\t\t<tr><td width="660" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 100%; max-width: 660px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="602" border="0" cellspacing="0" cellpadding="0" style="width: 91%; max-width: 602px;" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t</table><![endif]--\x3e\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t</td></tr></table>\n\t\t<![endif]--\x3e\n\t</td>\n</tr>\n\n'},12005:(e,t,l)=>{"use strict";l.d(t,{Ad:()=>i,HO:()=>m,Yj:()=>c});var o=l(14721),a=l(27943),r=l(58521);const n="LOCALES",i=(0,o.xP)({reducerPath:"localesApi",tagTypes:[n],baseQuery:(0,a.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/translations/v1"}),endpoints:e=>({getLocale:e.query({async queryFn({id:e},t){const l=(0,r.KU)(t);try{return await l.translations.get_translations3(e,"react_app")}catch(o){return l.translations.get_translations3("en_US","react_app")}},providesTags:(e,t,l)=>[{type:n,id:l}]}),getLocales:e.query({queryFn:function(e,t){return(0,r.KU)(t).translations.get_translations2("react_app")},providesTags:(e,t,l)=>[{type:n,id:"react_app"}]})})}),{useGetLocalesQuery:s,useGetLocaleQuery:d,useLazyGetLocaleQuery:c,useLazyGetLocalesQuery:m}=i},12133:e=>{e.exports=({__:e})=>`<style em="styles">\n amp-accordion > section > * {\n background: none !important;\n padding: 0 !important;\n border: none !important;\n overflow: visible !important;\n }\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>\n <amp-accordion animate expand-single-section>\n <section>\n <header>\n <table cellpadding="0" cellspacing="0" border="0" width="100%">\n <tr>\n <td style="padding: 10px 0; border-bottom: 1px solid #CCCCCC;">\n <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;"><strong>${e("Section title")}</strong></div>\n </td>\n </tr>\n </table>\n </header>\n <div>\n <table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom">\n <tr>\n <td style="padding: 10px 0;">\n <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>\n </td>\n </tr>\n </table>\n </div>\n </section>\n </amp-accordion>\n</td></tr></table>`},12543:(e,t,l)=>{"use strict";l.d(t,{CY:()=>i,s9:()=>s});var o=l(98173),a=l(94043);function r(e){return{__:e.__.bind(e),_x:e._x.bind(e),_n:e._n.bind(e),_nx:e._nx.bind(e),sprintf:a.nv,isRTL:e.isRTL.bind(e),hasTranslation:e.hasTranslation.bind(e)}}const n=(0,o.createContext)(r(a.y3));function i(e){const{children:t,i18n:l=a.y3}=e,[,i]=(0,o.useReducer)(()=>[],[]);(0,o.useEffect)(()=>l.subscribe(i),[l]);const s=(0,o.useMemo)(()=>r(l),[l]);return(0,o.createElement)(n.Provider,{value:s},t)}const s=()=>(0,o.useContext)(n)},12741:(e,t,l)=>{"use strict";l.d(t,{$S:()=>I,Ay:()=>P,BQ:()=>b,Et:()=>T,K3:()=>k,MZ:()=>h,P3:()=>C,TC:()=>_,TU:()=>f,Uh:()=>R,YG:()=>L,Zs:()=>v,aY:()=>y,lg:()=>N,mk:()=>B,ol:()=>w,x3:()=>E,yY:()=>S,zH:()=>x});var o=l(1029),a=l(98845),r=l(65716),n=l(32947),i=l(31557),s=l.n(i),d=l(93778),c=l(39218),m=l(40277);const u=(0,d.ur)({emailtags:[],email:{isNew:!0,is_inited:!1,subject:void 0,preheader:void 0,description:"",html:s(),project:void 0,project_title:"",tags:[],utm_parameters:{utm_source:"",utm_medium:"",utm_campaign:"",utm_term:"",utm_content:""},parent_email:null,common_styles:"{}",title:"",emailtags:[],isAmp:!1},hasChanged:!1}),p="newEmailSlice",g=(0,o.createSlice)({name:p,initialState:u,reducers:{setNewEmailAll:(e,{payload:{id:t,subject:l,description:o="",preheader:a,html:r=s(),utm_parameters:{utm_source:i="",utm_medium:d="",utm_campaign:c="",utm_term:u="",utm_content:p=""}={},common_styles:g="{}",emailtags:h=null,renderGuid:b,title:f,_embedded:E,isAmp:v=!1}})=>{var _;e.hasChanged||(e.hasChanged=!0),e.email.isAmp=v,e.email.title=f,e.emailtags=h,e.email.subject=l,e.email.description=o,e.email.common_styles=g||JSON.stringify(n.BD),e.email.preheader=a,e.email.is_template=!1,e.email.html=r,e.email.tags=(null===(_=(0,m._q)({_embedded:E},n.zh))||void 0===_?void 0:_.map(e=>e.name))||[],e.email.renderGuid=b,e.email.parent_email=t,e.email.utm_parameters={utm_source:i,utm_medium:d,utm_campaign:c,utm_term:u,utm_content:p}},setNewEmailTitle:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.title=t.payload},setNewEmailSubject:(e,t)=>{e.hasChanged||e.email.subject===t.payload||(e.hasChanged=!0),e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=t.payload),e.email.subject=t.payload},setNewEmailPreheader:(e,t)=>{e.hasChanged||e.email.preheader===t.payload||(e.hasChanged=!0),e.email.preheader=t.payload},setNewEmailDescription:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.description=t.payload},setNewEmailIsTemplate:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.is_template=t.payload},setNewEmailHtml:(e,t)=>{e.hasChanged||(e.hasChanged=!0),t.payload&&(e.email.html=t.payload)},setNewCommonStyles:(e,t)=>{e.hasChanged||(e.hasChanged=!0),t.payload&&(e.email.common_styles=t.payload)},setNewEmailTags:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.tags=t.payload},setNewEmailUtmSource:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_source=t.payload},setNewEmailUtmMedium:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_medium=t.payload},setNewEmailUtmCampaign:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_campaign=t.payload},setNewEmailUtmTerm:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_term=t.payload},setNewEmailUtmContent:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_content=t.payload},setNewIsInited:(e,t)=>{e.email.is_inited=t.payload},setNewEmailIsAmp:(e,t)=>{e.email.isAmp=t.payload},resetNewEmailSlice:e=>({...u,email:{...u.email,guid:(0,c.l)(),project:e.email.project,project_title:e.email.project_title}})},extraReducers:e=>{e.addMatcher(r.Nq.endpoints.getProject.matchFulfilled,(e,t)=>{e.email.project=t.payload.id,e.email.project_title=t.payload.title}),e.addMatcher(a.GY.endpoints.getEmail.matchFulfilled,e=>({...u,email:{...u.email,project:e.email.project,project_title:e.email.project_title}}))}}),{setNewEmailAll:h,setNewEmailTitle:b,setNewEmailSubject:f,setNewEmailPreheader:E,setNewEmailDescription:v,setNewEmailIsTemplate:_,setNewEmailHtml:y,setNewCommonStyles:A,setNewEmailTags:S,setNewEmailUtmSource:k,setNewEmailUtmMedium:w,setNewEmailUtmCampaign:C,setNewEmailUtmContent:B,setNewEmailUtmTerm:x,resetNewEmailSlice:T,setNewIsInited:R,setNewEmailIsAmp:N}=g.actions,L=e=>e[p].email,I=e=>e[p].hasChanged,P=g},12744:(e,t,l)=>{"use strict";l.d(t,{Uu:()=>c,MN:()=>h,Ll:()=>p,y4:()=>g});var o=l(14721),a=l(58521),r=l(32947);var n=l(79596),i=l(18987),s=l(12352),d=l(3792);const c=(0,o.xP)({reducerPath:"AiApiGenerator",baseQuery:async(e,t,l)=>{const o=(0,a.KU)(t).baseUrl.replaceAll(/[\\/]$/g,""),r=(0,a.hI)({baseUrl:o});let n=await r(e,t,l);if(n.error){let e=n.error;if("function"===typeof e.json)try{e=await e.json()}catch{e=await e}return{error:e}}return n},endpoints:e=>({generateIdForTask:e.mutation({queryFn:(e,t)=>(0,a.u$)(t).tasks.tasksControllerCreateTask(e).then(e=>e)}),clearAiChat:e.query({queryFn:(e,t)=>(0,a.KU)(t).aiGenerator.clear_history_list(e).then(e=>e)}),getGeneratedContent:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({id:e,setError:t},l){const{updateCachedData:o,cacheEntryRemoved:c}=l;let m=(0,a.KU)(l).baseUrl.indexOf("emailmaker")>=0?r.e3.maker:r.e3.blocks;const u=r.EW.isPlugin?await d.di.getInstance(l,s.Y):i.A.get(r.A9.em_token),p=u?{Authorization:`Bearer ${u}`}:{},g=new n.EventSourcePolyfill(`${m}/tasks/${e}`,{headers:p});g.onmessage=e=>{const t=JSON.parse(e.data);o(e=>{e.push(t)})},g.onerror=e=>{t("Error connecting to EventSource"),g.close()},await c,g.close()}}),getAiGenerateStatus:e.mutation({query:e=>({url:"/constructor/v1/ai-save-task",method:"POST",body:e})})})}),{useGenerateIdForTaskMutation:m,useGetGeneratedContentQuery:u,useLazyClearAiChatQuery:p,useLazyGetGeneratedContentQuery:g,useGetAiGenerateStatusMutation:h}=c},13668:(e,t,l)=>{"use strict";l.d(t,{Kp:()=>o,Sb:()=>r,_1:()=>a});const o="SAVE",a="SHOW",r="NOTIFY"},14038:(e,t,l)=>{"use strict";l.d(t,{a:()=>a,t:()=>r});var o=l(72510);function a(e,t,l,a){const r=(0,o.Sb)(e),n=Symbol(`once-handler-${t}`),i=r?e=>{e[n]||(e[n]=!0,l(e))}:l;return null===r||void 0===r||r.addEventListener(t,i,a),window.addEventListener(t,i,a),{dispose:()=>{null===r||void 0===r||r.removeEventListener(t,i,a),window.removeEventListener(t,i,a)}}}function r(e,t,l,a){const r=(0,o.Sb)(e),n=Symbol(`once-handler-${t}`),i=r?e=>{e[n]||(e[n]=!0,l(e))}:l;return null===r||void 0===r||r.addEventListener(t,i,a),document.addEventListener(t,i,a),{dispose:()=>{null===r||void 0===r||r.removeEventListener(t,i,a),document.removeEventListener(t,i,a)}}}},14107:(e,t,l)=>{"use strict";l.d(t,{A:()=>b});var o=l(98173),a=l(30150),r=l(2604),n=l(37969),i=l(47555),s=l(72570),d=l(12543),c=l(65716),m=l(84572),u=l(56605),p=l(40277),g=l(32947);const{Content:h}=i.A,b=()=>{var e;const{__:t}=(0,d.s9)(),{projectId:l}=(0,a.g)();let b=(0,a.Zp)(),f=(0,a.zy)();const E=(0,r.wA)(),v=(0,c.fo)(+l,{skip:!l}),{isLoading:_,isError:y,error:A,isSuccess:S,data:k}=v;return(0,o.useEffect)(()=>{S&&(null===k||void 0===k?void 0:k.id)!==l&&E((0,m.od)(k))},[S,k,E,l]),(0,o.useEffect)(()=>{S&&l&&f.pathname.endsWith(l)&&b(`${f.pathname}/emails`)},[S,f,b,l]),o.createElement(o.Fragment,null,_&&o.createElement(u.A,null),y&&A&&o.createElement(i.A,{className:"project-outlet"},o.createElement(h,{className:"project-outlet__container container"},o.createElement(s.Ay,{status:A.status,title:A.status,subTitle:null===(e=A.data)||void 0===e?void 0:e.message,extra:o.createElement(n.Ay,{type:"primary",onClick:()=>(0,p.XZ)(b,"/projects")},t("Back To Projects"))}))),(S||g.EW.isPlugin)&&o.createElement(a.sv,{context:{...v}}))}},15422:(e,t,l)=>{"use strict";l.d(t,{F:()=>n,Y:()=>r});var o=l(31926),a=l(39218);function r({id:e,type:t,title:l,excerpt:r,author:n,acf:{subject:i,description:s,html:d,project:c,related_email:m,tags:u,type:p,is_template:g,lock:h},...b}){return{...b,id:String(e),author:String(n),renderGuid:(0,a.l)(),description:s,html:d,excerpt:(0,o.vf)(l),project:(0,o.pT)(c)?c.ID:c,project_author:(0,o.pT)(c)?c.post_author:void 0,project_title:(0,o.pT)(c)?c.post_title:void 0,tags:u,is_template:g,type:p,related_email:(0,o.WY)((0,o.pT)(m)?m.ID:m),title:(0,o.vf)(l)||"",lock:h}}function n({title:e,subject:t,description:l,renderGuid:a,html:r,project:n,tags:i,type:s,related_email:d,is_template:c,lock:m,author:u,...p}){return{...p,author:(0,o.mQ)(u),title:e,acf:{description:l,related_email:(0,o.mQ)(d),html:r,project:n,tags:i,type:s,is_template:c,lock:m}}}},16341:(e,t,l)=>{"use strict";function o(e,t,l){const o=l('script:not([type="application/ld+json"])'),a=e.querySelectorAll(o);for(const n of a){var r;null!==(r=n.getAttribute("src"))&&void 0!==r&&r.startsWith("https://cdn.ampproject.org/")||n.closest("amp-state")&&"application/json"===n.getAttribute("type")||n.remove()}}l.d(t,{y:()=>o})},16403:()=>{},16618:(e,t,l)=>{"use strict";l.d(t,{b:()=>r,d:()=>a});var o=l(31926);function a({title:e,acf:{members:t,projects_test_emails:l,ftp_settings:a,emails:r,blocks:n,webhook:i,inbox_email:s},...d}){return{...d,title:(0,o.vf)(e)||"",members:(0,o.pT)(t)?{admins:t.admins&&t.admins.map(e=>({...e,ID:(0,o.WY)(e.ID)})),users:t.users&&t.users.map(e=>({...e,ID:(0,o.WY)(e.ID)})),invited_users:t.invited_users&&t.invited_users.map(e=>({...e,ID:(0,o.WY)(e.ID)})),owner:(0,o.pT)(t.owner)?{...t.owner,ID:(0,o.WY)(t.owner.ID)}:t.owner}:void 0,projects_test_emails:l,inbox_email:s,ftp_settings:a,webhook:i,emails:r,blocks:n}}function r({title:e,members:t,projects_test_emails:l,inbox_email:a,ftp_settings:r,webhook:n,emails:i,blocks:s,...d}){const c=e=>({ID:(0,o.mQ)(e.ID||e)}),m=e=>{return(t=e,Array.isArray(t)?t:t?[t]:[]).map(c);var t};return{...d,title:e,acf:{members:t&&{admins:m(t.admins),users:m(t.users),invited_users:m(t.invited_users),owner:t.owner&&c(t.owner)},webhook:n,projects_test_emails:l,inbox_email:a,ftp_settings:r,emails:i,blocks:s}}}},17487:(e,t,l)=>{"use strict";l.d(t,{H:()=>a});var o=l(31926);function a({id:e,title:t,acf:{html:l},excerpt:a,parent:r,author:n,...i}){return{...i,id:(0,o.WY)(e),author:(0,o.WY)(n),parent:(0,o.WY)(r),title:(0,o.vf)(t)||"",html:l,excerpt:(0,o.pT)(a)?a.rendered:a}}},19581:(e,t,l)=>{"use strict";l.d(t,{A:()=>c});var o=l(99282);let a=0;const r=new Array(1e3);function n(){for(let e=0;e<a;e+=2){(0,r[e])(...r[e+1]),r[e]=void 0,r[e+1]=void 0}a=0}const i=function(){let e=0;const t=new MutationObserver(n),l=document.createTextNode("");return t.observe(l,{characterData:!0}),()=>{l.data=String(e=++e%2)}}();const s=new o.vl({onFirstListenerAdd:function e(){!function(e,...t){r[a]=e,r[a+1]=t,a+=2,2===a&&i()}(()=>{s.hasListeners()&&(s.fire(),e())})}}),d=s.once;const c=d},20065:e=>{e.exports='\n<style>\n\t@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {\n\t\t.em-mob-width-100perc {\n\t\t\twidth: 100% !important;\n\t\t\tmax-width: 100% !important;\n\t\t}\n\n\t\t.em-mob-width-91perc {\n\t\t\twidth: 91% !important;\n\t\t\tmax-width: 91% !important;\n\t\t}\n\t}\n</style>\n<tr em="block" class="em-structure">\n\t<td align="center">\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>\n\t\t<![endif]--\x3e\n\t\t<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">\n\t\t\t<tr>\n\t\t\t\t<td align="center" valign="top">\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t<table border="0" cellspacing="0" cellpadding="0">\n\t\t\t\t\t<tr><td width="310" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 310px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="290" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t\t<td width="20">&nbsp;</td>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]></td><td width="310" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 310px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="290" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t\t<td width="20">&nbsp;</td>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t</table><![endif]--\x3e\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t</td></tr></table>\n\t\t<![endif]--\x3e\n\t</td>\n</tr>\n\n'},22548:e=>{e.exports='\n<style>\n\t@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {\n\t\t.em-mob-width-100perc {\n\t\t\twidth: 100% !important;\n\t\t\tmax-width: 100% !important;\n\t\t}\n\n\t\t.em-mob-width-91perc {\n\t\t\twidth: 91% !important;\n\t\t\tmax-width: 91% !important;\n\t\t}\n\t}\n</style>\n<tr em="block" class="em-structure">\n\t<td align="center">\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>\n\t\t<![endif]--\x3e\n\t\t<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">\n\t\t\t<tr>\n\t\t\t\t<td align="center" valign="top">\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t<table border="0" cellspacing="0" cellpadding="0">\n\t\t\t\t\t<tr><td width="207" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]></td><td width="207" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]></td><td width="207" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t</table><![endif]--\x3e\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t</td></tr></table>\n\t\t<![endif]--\x3e\n\t</td>\n</tr>\n\n'},22560:(e,t,l)=>{"use strict";l.d(t,{e:()=>a});var o=l(19504);function a(e,t){if("amp"===t)e.handleRender(async({contentDocument:e,managedNodeController:t})=>{for(const l of e.querySelectorAll(".em-amp-show-disabled"))l.remove();await(0,o.Sc)(e,{mappedTags:{script:"___script"},commit:()=>t.commit()})});else if("html"===t){const t=e.document;for(const e of t.querySelectorAll(".em-amp-show-only"))e.remove();(0,o.Km)(t,{mappedTags:{script:"___script"}})}}},25484:(e,t,l)=>{var o={"./ar_EG.js":[66864,4607],"./az_AZ.js":[98980,3816],"./bg_BG.js":[20740,2844],"./bn_BD.js":[86085,6428],"./by_BY.js":[66660,9200],"./ca_ES.js":[20840,1626],"./context.js":[34962],"./cs_CZ.js":[79178,1377],"./da_DK.js":[56965,2066],"./de_DE.js":[56615,8796],"./el_GR.js":[74295,7288],"./en_GB.js":[14278,1502],"./en_US.js":[94609],"./es_ES.js":[6368,2114],"./et_EE.js":[54452,6135],"./eu_ES.js":[5153,9716],"./fa_IR.js":[39990,5322],"./fi_FI.js":[81264,6552],"./fr_BE.js":[73323,3411],"./fr_CA.js":[96235,494],"./fr_FR.js":[24113,1330],"./ga_IE.js":[32046,1872],"./gl_ES.js":[14314,3711],"./he_IL.js":[13205,7974],"./hi_IN.js":[32885,1332],"./hr_HR.js":[36886,1510],"./hu_HU.js":[1462,6764],"./hy_AM.js":[25907,737],"./id_ID.js":[76426,3624],"./index.js":[33733],"./is_IS.js":[45856,7426],"./it_IT.js":[59905,2408],"./ja_JP.js":[37148,8839],"./ka_GE.js":[46792,1454],"./kk_KZ.js":[56099,4425],"./km_KH.js":[52968,6033],"./kmr_IQ.js":[99784,9508],"./kn_IN.js":[63882,3914],"./ko_KR.js":[49656,5261],"./ku_IQ.js":[1414,5108],"./lt_LT.js":[94408,2438],"./lv_LV.js":[12173,3302],"./mk_MK.js":[81609,8466],"./ml_IN.js":[65643,290],"./mn_MN.js":[51320,6832],"./ms_MY.js":[15806,5980],"./my_MM.js":[91097,6618],"./nb_NO.js":[95370,2917],"./ne_NP.js":[71121,5827],"./nl_BE.js":[50627,5653],"./nl_NL.js":[16489,5466],"./pl_PL.js":[99842,5862],"./pt_BR.js":[93764,4702],"./pt_PT.js":[95746,8534],"./ro_RO.js":[13731,2988],"./ru_RU.js":[41735],"./si_LK.js":[57860,4823],"./sk_SK.js":[5011,6418],"./sl_SI.js":[16273,2827],"./sr_RS.js":[75748,8682],"./sv_SE.js":[51685,77],"./ta_IN.js":[39009,1640],"./th_TH.js":[62651,5902],"./tk_TK.js":[98442,5864],"./tr_TR.js":[94887,4686],"./uk_UA.js":[37224,1788],"./ur_PK.js":[68095,8590],"./useLocale.js":[68936],"./vi_VN.js":[43142,1241],"./zh_CN.js":[56721,9169],"./zh_HK.js":[29319,197],"./zh_TW.js":[85180,4813]};function a(e){if(!l.o(o,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=o[e],a=t[0];return Promise.all(t.slice(1).map(l.e)).then(()=>l(a))}a.keys=()=>Object.keys(o),a.id=25484,e.exports=a},27941:(e,t,l)=>{"use strict";l.d(t,{Mu:()=>n,ZJ:()=>d,cM:()=>s,rD:()=>i});var o=l(2604),a=l(16390),r=l(39218);function n(e){if(e){const{type:t,project:l,isNew:o,id:a}=e;return`/projects/${l}/${"block"===t?"blocks":"emails"}/${o?`new?template=${a}`:a}`}return""}function i(){return(0,o.d4)(a.zg)}function s(e,t,l){return null!==e&&void 0!==e&&e.length?e.map((e,o)=>function(e){return e.hasOwnProperty("children")}(e)?{key:(0,r.l)(),value:e.value,label:e.label,children:s(e.children,t,l),type:"group"}:{key:(0,r.l)(),label:e.label,value:e.value,onClick:t=>{l(e.value,t.domEvent)}}):void 0}function d(e,t){for(const l of e)if(l&&t in l)return l[t]}},29539:e=>{e.exports='<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n\n .em-mob-wrap {\n display: block!important;\n }\n\n .em-mob-padding_right-20 {\n padding-right: 20px!important;\n }\n \n .em-mob-padding_left-20 {\n padding-left: 20px!important;\n }\n\n .em-mob-height-20px {\n height: 20px!important;\n }\n }\n</style>\n<tr em="block" class="em-structure">\n <td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">\n <table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">\n <tr>\n <td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n <td width="20" class="em-mob-wrap em-mob-height-20px"></td>\n <td width="380" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n </tr>\n </table>\n </td>\n</tr>'},30397:(e,t,l)=>{"use strict";l.d(t,{C:()=>r,N:()=>n});var o=l(14721),a=l(27943);const r=(0,o.xP)({reducerPath:"webHookApi",baseQuery:(0,a.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({postDataByWebHook:e.mutation({query:({url:e,body:t})=>({url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t})})})}),{usePostDataByWebHookMutation:n}=r},30753:(e,t,l)=>{"use strict";l.d(t,{A:()=>c});var o=l(98173),a=l(40120),r=l(30150),n=l(67034);const i=({className:e,style:t,color:l,text:a,bordered:r,...i})=>{const s=a||"";return o.createElement(n.A,Object.assign({style:t,color:l,bordered:r,className:e},i),s)};var s=l(12543),d=l(27941);const c=({text:e,counter:t,limits:l,wrapperStyles:n})=>{const{__:c,_n:m}=(0,s.s9)(),u=(0,r.Zp)(),p=(0,d.rD)(),{token:g}=a.A.useToken(),h=+l>0,b=!h||t<+l,f=p.billingPageUrl||"/billing",E=t+" "+c("of")+" "+(h?l:"\u221e")+" "+(e||m("test","tests",l))+" "+m("was used","were used",t);return o.createElement("div",{className:"limits-couter-wrapper",style:n},o.createElement(i,{bordered:!1,text:E,className:"limit-counter",style:{color:b?g.colorText:"white"},color:b?g.colorFillSecondary:"rgb(255, 77, 79)"}),h&&o.createElement("div",{style:{fontSize:14,textDecoration:"underline"},onClick:()=>u(f)},c("Need more?")))}},31557:e=>{e.exports='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html>\n<head>\n <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <title></title>\n <style type="text/css">\n html {\n -webkit-text-size-adjust: none;\n -ms-text-size-adjust: none;\n }\n </style>\n <style em="styles">\n@media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-narrow-table {\n width: 100%!important;\n max-width: 660px!important;\n min-width: 320px!important;\n }\n}\n</style>\n</head>\n<body style="margin: 0; padding: 0;">\n <span class="preheader" style="display: none !important; visibility: hidden; opacity: 0; color: #F8F8F8; height: 0; width: 0; font-size: 1px;">&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;\u200c&nbsp;</span>\n \x3c!--[if !mso]>\x3c!--\x3e\n <div style="font-size:0px;color:transparent;opacity:0;">\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800</div>\n \x3c!--<![endif]--\x3e\n <table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-size: 1px; line-height: normal;">\n <tr em="group">\n <td align="center" bgcolor="#F8F8F8">\n \x3c!--[if (gte mso 9)|(IE)]>\n <table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>\n <![endif]--\x3e\n <table cellpadding="0" cellspacing="0" width="100%" border="0" style="max-width: 660px; min-width: 660px; width: 660px;" class="em-narrow-table"></table>\n \x3c!--[if (gte mso 9)|(IE)]>\n </td></tr></table>\n <![endif]--\x3e\n </td>\n </tr>\n </table>\n</body>\n</html>'},31926:(e,t,l)=>{"use strict";function o(e,t=!1){const l={};for(const a of Object.keys(e)){let r=e[a];void 0===r||"number"===typeof r&&Number.isNaN(r)||(t&&"object"===typeof r&&null!==r&&(r=o(r)),l[a]=r)}return l}function a(e){return"object"===typeof e&&e}function r(e){const t=Number(e);return isNaN(t)?e:t}function n(e){return"number"===typeof e?String(e):e}function i(e){return"object"===typeof e?e.rendered:e}l.d(t,{TB:()=>o,WY:()=>n,mQ:()=>r,pT:()=>a,vf:()=>i})},33932:(e,t,l)=>{"use strict";l.d(t,{EQ:()=>s,YG:()=>c,Zs:()=>i,gb:()=>d});var o=l(14721),a=l(39539),r=l(58521);const n="Ai",i=(0,o.xP)({reducerPath:"AiApi",tagTypes:[n],baseQuery:(0,r.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({sendMessage:e.mutation({queryFn:({body:e},t)=>(0,r.KU)(t).saveFile.ai_create(e,{type:a.cM.FormData})}),getDialog:e.query({queryFn:({entity_id:e,connection:t="chat"},l)=>(0,r.KU)(l).saveFile.ai_status_list({connection:t,entity_id:e}),providesTags:e=>null!==e&&void 0!==e&&e.documents?[...e.documents.map(({id:e})=>({type:n,id:e})),{type:n,id:"LIST"}]:[{type:n,id:"LIST"}]})})}),{useSendMessageMutation:s,useGetDialogQuery:d,useLazyGetDialogQuery:c}=i},34021:e=>{e.exports=({__:e})=>`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding-bottom: 10px;">\n <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>\n</td></tr></table>`},35574:(e,t,l)=>{"use strict";l.d(t,{Ll:()=>n,i8:()=>i,n1:()=>o});l(93607);const o=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);const a=Object.create(null);function r(e,t){const l=a[e]||(a[e]=Object.create(null));let o=l[t];if("boolean"!==typeof o){const a=document.createElement(e)[t.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(e,t)=>t.toUpperCase())];o=l[t]="undefined"!==typeof a&&"boolean"!==typeof a}return o}function n(e,t){if(e.start!==e.startTagEnd||t){var l;const t=(null===(l=e.tag)||void 0===l?void 0:l.toLowerCase())||"div",o=function(e){var t;const l=null===(t=e.tag)||void 0===t?void 0:t.toLowerCase();let o="";if(l){const t=e.attributes;if(t){const e=Object.keys(t);for(const a of e){const e=null===t[a]?"":t[a];"string"===typeof e&&(o+=""!==e||"em"===a||r(l,a)?` ${a}="${e.replaceAll('"',"'")}"`:` ${a}`)}}}return o}(e);return"vk-snippet-end"===t?`<${t}${o}/>`:`<${t}${o}>`}return""}function i(e,t){let l=0,o=e.length;if(0===o)return 0;for(;l<o;){let a=Math.floor((l+o)/2);t(e[a])?o=a:l=a+1}return l}},35895:(e,t,l)=>{"use strict";l.d(t,{A:()=>_});var o=l(98173),a=l(84893),r=l(85591),n=l.n(r),i=l(40120),s=l(49856),d=l(2604),c=l(94160),m=l(47014),u=l(37969),p=l(8807),g=l(5558),h=l(12543),b=l(89613);const f=()=>{const{__:e}=(0,h.s9)(),t=(0,g.hN)(),l=(0,d.d4)(m.C1),[a]=(0,c.C)(),[r,n]=(0,o.useState)(!1),i=(0,b.u)();(0,o.useEffect)(()=>{l.hasOwnProperty("email_confirmation")&&n(l.email_confirmation)},[l,r]);return null!==l&&void 0!==l&&l.email_confirmation||null===l||void 0===l||!l.privacy_policy_agreement?null:o.createElement("div",{className:"main__ribbon"},o.createElement("span",null,o.createElement(p.A,{icon:"EmailConfirmation",style:{fontSize:20,position:"relative",top:2}}),e("Confirmation email was sent to"),"\xa0",o.createElement("em",null,l.email),".\xa0",e("Didn't receive an email?"),"\xa0",o.createElement(u.Ay,{type:"primary",size:"small",style:{fontSize:16,lineHeight:1},onClick:()=>{i({event:"click",action:"click_resend_confirmation_email",user_email:l.email,user_id:l.id}),a({userId:l.id,email:l.email}).then(({data:o,error:a})=>{o?t.success(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",l.email)):a&&t.error(a)})}},e("Resend")," ",o.createElement(p.A,{icon:"SendOutlined",style:{verticalAlign:"middle"}}))))};var E=l(27941);const{useToken:v}=i.A,_=({className:e,leftBlock:t,rightBlock:l,isHeaderCodeMenuOpen:r=!1})=>{const{token:i}=v(),d=(0,o.useRef)(),c=(0,E.rD)();return o.createElement(o.Fragment,null,o.createElement(f,null),c.headerShow&&o.createElement("header",{className:n()("header",{[e]:e}),style:{borderColor:i.colorBorder}},!r&&o.createElement(a.A,{nodeRef:d,in:!r,timeout:300,classNames:"transition"},o.createElement("div",{className:"header__container container"},o.createElement("div",{className:"header__left",style:{flexGrow:1}},t),o.createElement("div",{className:"header__right"},o.createElement(s.A,{size:10},l))))))}},36529:e=>{e.exports='\n<style>\n\t@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {\n\t\t.em-mob-width-100perc {\n\t\t\twidth: 100% !important;\n\t\t\tmax-width: 100% !important;\n\t\t}\n\n\t\t.em-mob-width-91perc {\n\t\t\twidth: 91% !important;\n\t\t\tmax-width: 91% !important;\n\t\t}\n\t}\n</style>\n<tr em="block" class="em-structure">\n\t<td align="center">\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>\n\t\t<![endif]--\x3e\n\t\t<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">\n\t\t\t<tr>\n\t\t\t\t<td align="center" valign="top">\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t<table border="0" cellspacing="0" cellpadding="0">\n\t\t\t\t\t<tr><td width="311" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 311px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="291" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]></td><td width="311" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 311px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="291" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t</table><![endif]--\x3e\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t</td></tr></table>\n\t\t<![endif]--\x3e\n\t</td>\n</tr>\n\n'},37507:(e,t,l)=>{"use strict";l.d(t,{b:()=>n});var o=l(98173),a=l(13785),r=l(32947);const n=({users:e,isEditor:t,isPlugin:l,token:n})=>{const[i,s]=(0,o.useState)(!1),d=window.localStorage.getItem(r.V0.em_color_scheme),c=e=>{const t=(e=>{const{first_name:t,last_name:l,email:o}=e.user.name;return t&&l?`${t} ${l}`:t||o})(e);return o.createElement("span",null,t)};return o.createElement(o.Fragment,null,e.length>0&&t&&o.createElement("div",{className:"user-list "+(i?"open":""),style:l?{left:"60px",bottom:"10px"}:{},onMouseOver:()=>s(!0),onMouseOut:()=>s(!1)},e.map(e=>o.createElement("div",{key:e.user.color,className:"user",style:{"--user-color":e.user.color,"--border-color":null===n||void 0===n?void 0:n.colorBgContainer,"--text-color":"dark"===d?null===n||void 0===n?void 0:n.colorIconHover:null===n||void 0===n?void 0:n.colorWhite}},o.createElement(a.A,{title:c(e),placement:"topLeft",trigger:"hover",color:null===n||void 0===n?void 0:n.colorBgSpotlight},o.createElement("div",null,(e=>{const{first_name:t,last_name:l,email:o}=e.user.name;if(t)return`${t.split("")[0]}${l?`${l.split("")[0]}`:""}`;return(null===o||void 0===o?void 0:o.split("")[0].toUpperCase())||" "})(e)))))))}},38251:(e,t,l)=>{"use strict";l.d(t,{U8:()=>a,cA:()=>n,ri:()=>r});var o=l(27943);const a=(0,l(14721).xP)({reducerPath:"exportPngApi",baseQuery:async(e,t,l)=>{try{const{notification:a,...r}=e,n=await(0,o.cw)({baseUrl:"https://racs.rest/v3"})(r,t,l);if(n.error)throw new Error;return n}catch(a){return(null===e||void 0===e?void 0:e.notification).error(a),{error:a}}},endpoints:e=>({makeTemporaryMailForPng:e.mutation({query:({file:e,title:t,notification:l})=>{const o=new Blob([e],{type:"text/html"}),a=new FormData;return a.append("file",o,"base.html"),a.append("contentType","text/html"),{url:"?resource=exportPngApi",method:"POST",body:a,notification:l}}}),deleteTemporaryMail:e.mutation({query:({id:e,notification:t})=>({url:`/${e}?resource=exportPngApi`,method:"DELETE",notification:t})})})}),{useMakeTemporaryMailForPngMutation:r,useDeleteTemporaryMailMutation:n}=a},38540:(e,t,l)=>{"use strict";l.d(t,{Ay:()=>c,M:()=>d,YT:()=>s,rI:()=>i});var o=l(1029);const a=(0,l(93778).ur)({isCollapsed:!0,isMonacoFocusing:!1}),r="defaultModePanesSlice",n=(0,o.createSlice)({name:r,initialState:a,reducers:{setMonacoFocusing:(e,t)=>{e.isMonacoFocusing=t.payload},resetPanes:()=>a}}),{resetPanes:i,setMonacoFocusing:s}=n.actions,d=e=>e[r].isMonacoFocusing,c=n},38677:(e,t,l)=>{"use strict";l.d(t,{Ay:()=>p,RL:()=>u,p1:()=>m,qX:()=>d});var o=l(1029),a=l(98845),r=l(68984);const n=(0,l(93778).ur)({historyData:[],elementHistoryTotalPages:1}),i="revisionHistorySlice",s=(0,o.createSlice)({name:i,initialState:n,reducers:{resetElementHistorySlice:()=>({...n}),setElementHistory:(e,t)=>{0!==t.payload.length&&(e.historyData=t.payload)}},extraReducers:e=>{e.addMatcher(a.GY.endpoints.getEmailHistory.matchFulfilled,(e,{meta:t,payload:l})=>{var o;e.elementHistoryTotalPages=+(null===(o=t.baseQueryMeta)||void 0===o?void 0:o.response.headers.get("X-WP-TotalPages")),t.arg.originalArgs.page&&1!==t.arg.originalArgs.page||(e.historyData=l.data||[])}),e.addMatcher(r.VM.endpoints.getBlockHistory.matchFulfilled,(e,{meta:t,payload:l})=>{var o;e.elementHistoryTotalPages=+(null===(o=t.baseQueryMeta)||void 0===o?void 0:o.response.headers.get("X-WP-TotalPages")),l.args.page&&1!==l.args.page||(e.historyData=l.data||[])})}}),{resetElementHistorySlice:d}=s.actions,{setElementHistory:c}=s.actions,m=e=>e[i].historyData,u=e=>e[i].elementHistoryTotalPages,p=s},39244:(e,t,l)=>{"use strict";l.d(t,{X:()=>w});var o=l(72919);let a=function(e){return e[e.StartCommentTag=0]="StartCommentTag",e[e.Comment=1]="Comment",e[e.EndCommentTag=2]="EndCommentTag",e[e.StartTagOpen=3]="StartTagOpen",e[e.StartTagClose=4]="StartTagClose",e[e.StartTagSelfClose=5]="StartTagSelfClose",e[e.StartTag=6]="StartTag",e[e.EndTagOpen=7]="EndTagOpen",e[e.EndTagClose=8]="EndTagClose",e[e.EndTag=9]="EndTag",e[e.DelimiterAssign=10]="DelimiterAssign",e[e.AttributeName=11]="AttributeName",e[e.AttributeValue=12]="AttributeValue",e[e.StartDoctypeTag=13]="StartDoctypeTag",e[e.Doctype=14]="Doctype",e[e.EndDoctypeTag=15]="EndDoctypeTag",e[e.Content=16]="Content",e[e.Whitespace=17]="Whitespace",e[e.Unknown=18]="Unknown",e[e.Script=19]="Script",e[e.Styles=20]="Styles",e[e.EOS=21]="EOS",e[e.AdvancedStart=100]="AdvancedStart",e[e.AdvancedEnd=101]="AdvancedEnd",e}({});class r{constructor(e,t){this.source=void 0,this.len=void 0,this.position=void 0,this.source=e,this.len=e.length,this.position=t}eos(){return this.len<=this.position}getSource(){return this.source}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}goToEnd(){this.position=this.source.length}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)&&(this.position++,!0)}advanceIfChars(e){let t;if(this.position+e.length>this.source.length)return!1;for(t=0;t<e.length;t++)if(this.source.charCodeAt(this.position+t)!==e[t])return!1;return this.advance(t),!0}advanceIfRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index+t[0].length,t[0]):""}advanceUntilRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index,t[0]):(this.goToEnd(),"")}advanceUntilChar(e){for(;this.position<this.source.length;){if(this.source.charCodeAt(this.position)===e)return!0;this.advance(1)}return!1}advanceUntilChars(e){for(;this.position+e.length<=this.source.length;){let t=0;for(;t<e.length&&this.source.charCodeAt(this.position+t)===e[t];t++);if(t===e.length)return!0;this.advance(1)}return this.goToEnd(),!1}skipWhitespace(){return this.advanceWhileChar(e=>e===f||e===E||e===g||e===b||e===h)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}}const n="!".charCodeAt(0),i="-".charCodeAt(0),s="<".charCodeAt(0),d=">".charCodeAt(0),c="/".charCodeAt(0),m="=".charCodeAt(0),u='"'.charCodeAt(0),p="'".charCodeAt(0),g="\n".charCodeAt(0),h="\r".charCodeAt(0),b="\f".charCodeAt(0),f=" ".charCodeAt(0),E="\t".charCodeAt(0),v={"text/x-handlebars-template":!0,"text/html":!0};function _(e,t=0,l=o.S5.WithinContent,g=!1){const h=new r(e,t);let b,f,E,_,y,A=l,S=0,k=a.Unknown;function w(){return h.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function C(e,t,l){return k=t,S=e,b=l,t}function B(){const e=h.pos();if(h.eos())return C(e,a.EOS);let t;switch(A){case o.S5.WithinComment:return h.advanceIfChars([i,i,d])?(A=o.S5.WithinContent,C(e,a.EndCommentTag)):(h.advanceUntilChars([i,i,d]),C(e,a.Comment));case o.S5.WithinDoctype:return h.advanceIfChar(d)?(A=o.S5.WithinContent,C(e,a.EndDoctypeTag)):(h.advanceUntilChar(d),C(e,a.Doctype));case o.S5.WithinContent:if(h.advanceIfChar(s)){if(!h.eos()&&h.peekChar()===n){if(h.advanceIfChars([n,i,i]))return A=o.S5.WithinComment,C(e,a.StartCommentTag);if(h.advanceIfRegExp(/^!doctype/i))return A=o.S5.WithinDoctype,C(e,a.StartDoctypeTag)}return h.advanceIfChar(c)?(A=o.S5.AfterOpeningEndTag,C(e,a.EndTagOpen)):(A=o.S5.AfterOpeningStartTag,C(e,a.StartTagOpen))}return h.advanceUntilChar(s),C(e,a.Content);case o.S5.AfterOpeningEndTag:return w().length>0?(A=o.S5.WithinEndTag,C(e,a.EndTag)):h.skipWhitespace()?C(e,a.Whitespace,"Tag name must directly follow the open bracket."):(A=o.S5.WithinEndTag,h.advanceUntilChar(d),e<h.pos()?C(e,a.Unknown,"End tag name expected."):B());case o.S5.WithinEndTag:if(h.skipWhitespace())return C(e,a.Whitespace);if(h.advanceIfChar(d))return A=o.S5.WithinContent,C(e,a.EndTagClose);if(g&&h.peekChar()===s)return A=o.S5.WithinContent,C(e,a.EndTagClose,"Closing bracket missing.");t="Closing bracket expected.";break;case o.S5.AfterOpeningStartTag:return E=w(),y=void 0,_=void 0,E.length>0?(f=!1,A=o.S5.WithinTag,C(e,a.StartTag)):h.skipWhitespace()?C(e,a.Whitespace,"Tag name must directly follow the open bracket."):(A=o.S5.WithinTag,h.advanceUntilChar(d),e<h.pos()?C(e,a.Unknown,"Start tag name expected."):B());case o.S5.WithinTag:return h.skipWhitespace()?(f=!0,C(e,a.Whitespace)):f&&(_=h.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase(),_.length>0)?(A=o.S5.AfterAttributeName,f=!1,C(e,a.AttributeName)):h.advanceIfChars([c,d])?(A=o.S5.WithinContent,C(e,a.StartTagSelfClose)):h.advanceIfChar(d)?(A="script"===E?y&&v[y]?o.S5.WithinContent:o.S5.WithinScriptContent:"style"===E?o.S5.WithinStyleContent:o.S5.WithinContent,C(e,a.StartTagClose)):g&&h.peekChar()===s?(A=o.S5.WithinContent,C(e,a.StartTagClose,"Closing bracket missing.")):(h.advance(1),C(e,a.Unknown,"Unexpected character in tag."));case o.S5.AfterAttributeName:return h.skipWhitespace()?(f=!0,C(e,a.Whitespace)):h.advanceIfChar(m)?(A=o.S5.BeforeAttributeValue,C(e,a.DelimiterAssign)):(A=o.S5.WithinTag,B());case o.S5.BeforeAttributeValue:if(h.skipWhitespace())return C(e,a.Whitespace);let l=h.advanceIfRegExp(/^[^\s"'`=<>]+/);if(l.length>0)return h.peekChar()===d&&h.peekChar(-1)===c&&(h.goBack(1),l=l.substr(0,l.length-1)),"type"===_&&(y=l),A=o.S5.WithinTag,f=!1,C(e,a.AttributeValue);const r=h.peekChar();return r===p||r===u?(h.advance(1),h.advanceUntilChar(r)&&h.advance(1),"type"===_&&(y=h.getSource().substring(e+1,h.pos()-1)),A=o.S5.WithinTag,f=!1,C(e,a.AttributeValue)):(A=o.S5.WithinTag,f=!1,B());case o.S5.WithinScriptContent:let b=1;for(;!h.eos();){const t=h.advanceIfRegExp(/<!--|-->|<\/?script\s*\/?>?/i);if(0===t.length)return h.goToEnd(),C(e,a.Script);if("\x3c!--"===t)1===b&&(b=2);else if("--\x3e"===t)b=1;else if("/"!==t[1])2===b&&(b=3);else{if(3!==b){h.goBack(t.length);break}b=2}}return A=o.S5.WithinContent,e<h.pos()?C(e,a.Script):B();case o.S5.WithinStyleContent:return h.advanceUntilRegExp(/<\/style/i),A=o.S5.WithinContent,e<h.pos()?C(e,a.Styles):B()}return h.advance(1),A=o.S5.WithinContent,C(e,a.Unknown,t)}return{scan:function(){const e=h.pos(),t=B();return t===a.EOS||e!==h.pos()||g&&(t===a.StartTagClose||t===a.EndTagClose)?t:(h.advance(1),C(e,a.Unknown))},getTokenType:()=>k,getTokenOffset:()=>S,getTokenLength:()=>h.pos()-S,getTokenEnd:()=>h.pos(),getTokenText:()=>h.getSource().substring(S,h.pos()),getScannerState:()=>A,getTokenError:()=>b}}var y=l(80599),A=l(93607);function S(e){if("string"===typeof e){const t=e.startsWith("'")||e.startsWith('"')?1:0,l=e.endsWith("'")||e.endsWith('"')?e.length-1:e.length;return e.substring(t,l)}return e}class k{constructor(e,t){this.text=e,this.type=t,this.node=void 0,this.replaces=void 0}get hasNode(){return!!this.node}addReplace(e){var t;null===(t=this.replaces)||void 0===t||t.push(e)}start(e,t,l){if(!this.node){const o=this.node=new A.b(e,this.text.length,[],l);o.type=this.type,o.startTagEnd=t,this.replaces=[]}}finish(e,t){const l=this.replaces,o=this.node,a=e+(t||0);if(l){for(const e of l){const t=e.parent;if(!t)throw new Error("parent not defined");const l=t.children.indexOf(e);t.children.splice(l,1)}this.replaces=void 0}if(o){const l=o.parent;if(!l)throw new Error("parent not defined");l.children.push(o),o.closed=void 0!==t,o.endTagStart=e,o.end=a,o.content=this.text.substring(o.startTagEnd,e),this.node=void 0}}}class w{constructor(e){this.dataManager=e}parse(e,t=[]){var l;const o=_(e,void 0,void 0,!0),r=new A.b(0,e.length,[],void 0);r.type=A.Z.ROOT;let n,i=r,s=-1,d=null,c=o.scan();const m=()=>{if(!i.tag){const t=i.parent.children,l=t[t.length-2],o=e.substring(i.start,i.end);(null===l||void 0===l?void 0:l.type)===A.Z.HTML?(l.content=(l.content||"")+o,l.end=i.end,t.splice(t.length-1,1)):(i.type=A.Z.HTML,i.content=o,i.children=[]),i.type=A.Z.HTML}i=i.parent},u=new k(e,A.Z.COMMENT),p=new k(e,A.Z.DOCTYPE),g=e=>{i.children.push(e)};for(;c!==a.EOS;){switch(c){case a.StartDoctypeTag:p.start(o.getTokenOffset(),o.getTokenEnd(),i);break;case a.EndDoctypeTag:{const t=i.lastChild,l=p.node;if(!l)throw new Error("");const a=t?t.end:void 0!==i.startTagEnd?i.startTagEnd:i.start;if(a!==l.start){const t=e.substring(a,l.start);if(t){const e=new A.b(a,l.start,[],i);e.type=A.Z.HTML,e.content=t,g(e)}}p.finish(o.getTokenOffset(),o.getTokenLength());break}case a.StartCommentTag:u.start(o.getTokenOffset(),o.getTokenEnd(),i);break;case a.EndCommentTag:{const t=i.lastChild,l=u.node;if(!l)throw new Error("");const a=t?t.end:void 0!==i.startTagEnd?i.startTagEnd:i.start;if(a!==l.start){const t=e.substring(a,l.start);if(t){const e=new A.b(a,l.start,[],i);e.type=A.Z.HTML,e.content=t,g(e)}}u.finish(o.getTokenOffset(),o.getTokenLength());break}case a.StartTagOpen:const t=i.lastChild,l=new A.b(o.getTokenOffset(),e.length,[],i),r=t?t.end:void 0!==i.startTagEnd?i.startTagEnd:i.start;if(r!==l.start){const t=e.substring(r,l.start);if(t){const e=new A.b(r,l.start,[],i);e.type=A.Z.HTML,e.content=t,g(e)}}g(l),i=l;break;case a.StartTag:i.tag=o.getTokenText();break;case a.StartTagClose:i.parent&&(i.end=o.getTokenEnd(),o.getTokenLength()?(i.startTagEnd=o.getTokenEnd(),i.tag&&this.dataManager.isVoidElement(i.tag)&&(i.closed=!0,m())):m());break;case a.StartTagSelfClose:i.parent&&(i.closed=!0,i.end=o.getTokenEnd(),i.startTagEnd=o.getTokenEnd(),m());break;case a.EndTagOpen:s=o.getTokenOffset(),n=void 0;break;case a.EndTag:n=o.getTokenText().toLowerCase();break;case a.EndTagClose:let c=i;for(;!c.isSameTag(n)&&c.parent;)c=c.parent;if(c.parent){const t=i.lastChild,l=t?t.end:void 0===i.startTagEnd?i.start:i.startTagEnd;if(l!==s){const t=e.substring(l,s);if(t){const e=new A.b(l,s,[],i);e.type=A.Z.HTML,e.content=t,g(e)}}for(;i!==c;)i.end=s,i.closed=!1,m();i.closed=!0,i.endTagStart=s,i.end=o.getTokenEnd(),m()}break;case a.AttributeName:{d=o.getTokenText();let e=i.attributes;e||(i.attributes=e={}),e[d]=null;break}case a.AttributeValue:{const e=o.getTokenText(),t=i.attributes;t&&d&&(t[d]=S(e),d=null);break}}c=o.scan()}for(;i.parent;)i.end=e.length,i.closed=!1,m();u.hasNode,u.finish(e.length);const h=(null===(l=r.lastChild)||void 0===l?void 0:l.end)||0;if(h<e.length){const t=e.substring(h);if(t){const l=new A.b(h,e.length,[],r);l.type=A.Z.HTML,l.content=t,g(l)}}return{roots:r.children,findNodeBefore:r.findNodeBefore.bind(r),findNodeAt:r.findNodeAt.bind(r)}}}const C=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"];new w(new y.H(C))},39420:(e,t,l)=>{"use strict";l.d(t,{A5:()=>c,FN:()=>d,Hk:()=>s,c8:()=>m});var o=l(98173),a=l(32947),r=l(52919);const n=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=dark]"),i=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=light]"),s=e=>{let t,l;e===a.IJ?(t=a.vd,l=a.F3):(t=e===a.T?a.y2:a.CJ,l=e===a.nd?a.y2:a.CJ),[...i].forEach(e=>{e.media=t}),[...n].forEach(e=>{e.media=l})},d=(e={})=>{const t=document.querySelector("head"),l=document.createElement("style");if(l.type="text/css",l.dataset.themeVaribalse=!0,l.setAttribute("data-emailmaker","true"),Object.entries(e).length){let o="";Object.entries(e).forEach(([e,t])=>{"object"!==typeof t&&(o+=`\t--${e}: ${t};\n`)}),o=`.blocks-body, .blocks-app, .ant-modal-root, .ant-tooltip, .ant-notification {\n${o}}`,l.appendChild(document.createTextNode(o));const a=t.querySelector('[data-theme-varibalse="true"]');a?t.replaceChild(l,a):t.insertBefore(l,t.firstChild)}},c=e=>{const t=document.body;t.classList.contains(e)||setTimeout(()=>{t.classList.remove(e===a.nd?a.T:a.nd),t.classList.add(e)},200)},m=()=>{const e=(0,r.XW)();return(0,o.useCallback)(()=>{const t=window.localStorage.getItem(a.V0.em_color_scheme),l=matchMedia(a.F3).matches?a.nd:a.T,o=t||l;e({operation:a.Ru.UPDATE_PREVIEW,theme:o})},[e])}},40409:(e,t,l)=>{"use strict";l.d(t,{A:()=>A});var o=l(98173),a=l(80703),r=l(37969),n=l(13785),i=l(5558),s=l(30150),d=l(2604),c=l(12543),m=l(52218),u=l.n(m),p=l(68984),g=l(65716),h=l(83027),b=l(62093),f=l(22536),E=l(40277),v=l(89613),_=l(86095),y=l(32947);const A=({block:e=null,isEditableRights:t,rightCol:l,autoSaveBlockResult:m,disabled:A})=>{const{__:S}=(0,c.s9)(),{projectId:k,blockId:w}=(0,s.g)();let C=(0,d.d4)(f.Fv),B=(0,d.d4)(f.Fv),x=(0,d.wA)();const T=(0,i.hN)(),R=(0,_.fn)(),N=(0,d.Pj)(),[L,I]=(0,o.useState)(!1),[P,O]=(0,o.useState)(null),[F,M]=(0,o.useState)(!1),[D,V]=(0,o.useState)(!1),W=(0,v.u)();(0,o.useEffect)(()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&O(!0)},[]);const{data:j,refetch:z}=(0,g.fo)(+k,{skip:!+k}),[H]=(0,p.Gr)(),[G,U]=(0,p.OZ)(),[q,X]=(0,p.pP)(),[$]=(0,g.OD)(),Z=`project_${k}`,Y=j&&(0,E._q)(j,y.YY).find(e=>e.name===Z),K=j&&(0,E.HT)(j,y.YY),Q=(0,o.useCallback)(l=>{var o,a;if(M(!0),!t&&e.lock&&D)return T.error({id:"BLOCK_ACCESS_TO_LOCKED_ERROR",message:S("No access to edit the letter."),data:(0,i.x_)(e)}),void M(!1);if(((null===(o=e.tags)||void 0===o?void 0:o.length)||(null===(a=e.blocktags)||void 0===a?void 0:a.length))>10&&D)return T.error({id:"BLOCK_TOO_MANY_TAGS_ERROR",message:S("Maximum 10 tags available."),data:(0,i.x_)(e)}),void M(!1);if(""===e.type)return T.error({message:S("Set the type"),description:S("Please set the 'Type' field in the Settings section.")}),void M(!1);const r=t=>{var o;const a=null===(o=e.tags)||void 0===o?void 0:o.map(e=>{const l=null===K||void 0===K?void 0:K.find(t=>t.name===e);return l?l.id:H({name:e,parent:t}).then(({error:t,data:l})=>{var o,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.term_id:l?l.id:void(t&&(T.fromError("TAG_CREATING_ERROR",e,t),M(!1)))})}),r=(o=null)=>{const a=l=>{N.dispatch(h.kE.endpoints.getTags.initiate({parent:t})),z(),D&&(T.success({id:"BLOCK_EDITING_SUCCESS",message:S("The block was successfully saved.","block"),data:(0,i.x_)(e)}),M(!1)),fetch(((e,t,l,o)=>`https://scr.emcdn.ru/screenshot?delay=1000&width=800&fullPage=true&deviceScaleFactor=0.8&format=jpg&clearCache=true${o?`&cacheControl=true&cache-hash=${u()(o)}`:""}&url=${encodeURIComponent(`https://dev-backend-1.emailmaker.ru/get${e}/${l}?secret_hash=${u()(`${t}${l}${y.KI}`)}&raw=true`)}`)(y.IE,k,l.id,l.modified),{mode:"no-cors"}).then(()=>{})},r=(0,E._q)(e,y.zh).filter(t=>(o||e.blocktags).includes(t.id)).map(e=>e.name);e.isNew?X.status!==y.eG&&q({source:l,title:null===e.title?S("New block title"):e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===R||void 0===R?void 0:R.getValue())||"",blocktags:o?o.join(","):e.blocktags,tags:r}).then(({data:t,error:l})=>{l?(T.fromError("BLOCK_CREATING_ERROR",{title:e.title,html:(null===R||void 0===R?void 0:R.getValue())||""},l),M(!1)):a(t)}):U.status!==y.eG&&G({blockId:e.id,source:l,title:e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===R||void 0===R?void 0:R.getValue())||"",blocktags:o||e.blocktags,tags:r}).then(({data:t,error:l})=>{l&&D?(T.fromError("BLOCK_EDITING_ERROR",(0,i.x_)(e),l),M(!1)):a(t)})};a?Promise.all(a).then(e=>r(e)):r(null)};M(!0),Y?r(Y.id):H({name:Z}).then(async({data:t,error:l})=>{if(l)T.fromError("FOLDER_CREATING_ERROR",Z,l),M(!1);else{const{data:l,error:o}=await $({projectId:k,blocktags:t.id});o?(T.fromError("BLOCK_CLONING_ERROR",(0,i.x_)(e),o),M(!1)):l&&r(l.blocktags&&l.blocktags[0])}}).catch(e=>{})},[X.status,q,U.status,G,e,t,H,$,k,S,D,R,T,K,z,N,Y,Z]);(0,o.useEffect)(()=>{D&&(Q(),V(!1))},[D,Q]);const J=(0,o.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),V(!0))},[]);(0,o.useEffect)(()=>(document.addEventListener("keydown",J),()=>{document.removeEventListener("keydown",J)}),[J]);const ee=(0,o.useCallback)(e=>{const t=e.data.operation,l=e.data.action;t===y.Ru.APPLICATION_ACTION&&"save_email"===l&&V(!0)},[]);return(0,b.A)(ee),(0,o.useEffect)(()=>{X.isError&&(M(!1),T.error(X))},[x,X]),(0,o.useEffect)(()=>{const e=setTimeout(()=>{I(!0)},1e4);return()=>{clearTimeout(e)}},[]),(0,o.useEffect)(()=>{e.isNew&&!w&&L&&(Q(),I(!1))},[L,e,Q,w]),o.createElement(n.A,{title:S(P?"Save by \u2318S":"Save by Ctrl+S"),placement:l?"right":"bottomRight"},o.createElement(r.Ay,{type:"primary",block:l,className:"em-analytics__block-save",icon:o.createElement(a.A,null),onClick:()=>{W({event:"click",action:"save_block"}),V(!0)},loading:U.isLoading||$.isLoading||X.isLoading||F||m},l||C||B?"":S("Save")))}},40835:(e,t,l)=>{"use strict";l.d(t,{Zf:()=>d,dS:()=>i,lg:()=>s,tb:()=>c,yH:()=>n});var o=l(14721),a=l(39539),r=l(58521);const n=(0,o.xP)({reducerPath:"saveFileApi",tagTypes:["Images"],baseQuery:(0,r.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({uploadImage:e.mutation({queryFn:(e,t)=>(0,r.KU)(t).saveFile.upload_create(e,{type:a.cM.FormData})}),sendTestEmail:e.mutation({queryFn:(e,t)=>(0,r.KU)(t).saveFile.send_email_create(e,{type:a.cM.FormData})}),sendLivePreview:e.mutation({queryFn:(e,t)=>(0,r.KU)(t).saveFile.get_link_create(e,{type:a.cM.FormData})}),sendShortLink:e.mutation({queryFn:(e,t)=>(0,r.KU)(t).saveFile.shortener_create(e,{type:a.cM.FormData})})})}),{useUploadImageMutation:i,useSendTestEmailMutation:s,useSendLivePreviewMutation:d,useSendShortLinkMutation:c}=n},40845:e=>{e.exports='<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="0" style="padding: 20px 0 0; border-top: 1px solid #EEEEEE;">&nbsp;</td></tr></table>'},41882:(e,t,l)=>{"use strict";l.d(t,{A:()=>_});var o=l(98173),a=l(47555),r=l(63719),n=l(49856),i=l(13785),s=l(37969),d=l(30150),c=l(50078),m=l(12543),u=l(47091),p=l(79890),g=l(35895),h=l(40277),b=l(32947),f=l(96734);const{Content:E}=a.A,{Paragraph:v}=r.A,_=()=>{const{__:e}=(0,m.s9)(),{projectId:t,emailId:l}=(0,d.g)(),r=(0,f.p)();let _=(0,d.Zp)();const y=r.get(b.A9.em_template_email)||l;(0,o.useEffect)(()=>{document.body.classList.remove("editor")},[]);const A=o.createElement(o.Fragment,null,o.createElement(n.A,{size:10},o.createElement(i.A,{title:e("To emails"),placement:"left"},o.createElement(s.Ay,{type:"text",icon:o.createElement(c.A,null),onClick:()=>(0,h.XZ)(_,`/projects/${t}`),shape:"circle"})),o.createElement(v,{className:"ant-page-header-heading-title"},e("Select email template")),o.createElement(p.A,{isBlocks:!1,templateEmailId:y}))),S=o.createElement(o.Fragment,null);return o.createElement(a.A,{className:"template-page"},o.createElement(g.A,{leftBlock:A,rightBlock:S}),o.createElement(E,{className:"template-page__container"},o.createElement("div",{className:"template-page__content container"},o.createElement(u.A,{projectId:b.p5,emailsView:b.Y$,templateEmailId:y}))))}},43643:e=>{e.exports='<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n\n .em-mob-wrap {\n display: block!important;\n }\n\n .em-mob-padding_right-20 {\n padding-right: 20px!important;\n }\n \n .em-mob-padding_left-20 {\n padding-left: 20px!important;\n }\n\n .em-mob-height-20px {\n height: 20px!important;\n }\n }\n</style>\n<tr em="block" class="em-structure">\n <td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">\n <table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">\n <tr>\n <td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n <td width="20" class="em-mob-wrap em-mob-height-20px"></td>\n <td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n <td width="20" class="em-mob-wrap em-mob-height-20px"></td>\n <td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n </tr>\n </table>\n </td>\n</tr>'},44779:(e,t,l)=>{"use strict";l.d(t,{C:()=>r,R:()=>a});var o=l(90717);function a(e){const t=(0,o.xy)(e);if(!e.querySelector("style[amp4email-boilerplate]")){const l=e.createElement("style");l.setAttribute("amp4email-boilerplate",""),l.innerHTML="body{visibility:hidden}",t.prepend(l)}}function r(e){const t=e.querySelector("style[amp4email-boilerplate]");t&&t.remove()}},45271:(e,t,l)=>{"use strict";l.d(t,{A:()=>m});var o=l(98173),a=l(2407),r=l.n(a),n=l(12543),i=l(5558),s=l(98845),d=l(68984);const c=({element:e})=>{const{__:t,_x:l}=(0,n.s9)(),[a]=(0,s.dN)(),[r]=(0,d.OZ)(),c=(0,i.hN)(),m=(e,o)=>{if(e.error)return c.error(e),!1;c.success(t("The ")+(o.hasOwnProperty("type")?t("block"):l("email","letter"))+" "+t("\u201c")+e.data.title+t("\u201d")+t("was successfully")+" "+(o.lock?o.hasOwnProperty("type")?l("unlocked.","block"):l("unlocked.","email"):o.hasOwnProperty("type")?l("locked.","block"):l("locked.","email")))};return o.createElement("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:()=>{e.hasOwnProperty("type")?r({blockId:e.id,lock:!e.lock}).then(t=>{m(t,e)}):a({emailId:e.id,lock:!e.lock}).then(t=>{m(t,e)})}},e.lock?t("Unlock"):t("Lock"))};c.defaultProps={element:r().shape({lock:null,id:null})};const m=c},45848:e=>{e.exports=({__:e})=>`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom">\n <tr>\n <td align="center" valign="top">\n <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Column")} 1</div>\n </td>\n <td align="center" valign="top">\n <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Column")} 2</div>\n </td>\n <td align="center" valign="top">\n <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Column")} 3</div>\n </td>\n </tr>\n</table>`},46496:(e,t,l)=>{"use strict";l.d(t,{C:()=>a});var o=l(90717);function a(e){let t=e.querySelectorAll("meta");for(const o of t){const e=o.getAttribute("charset");if(e)return void("utf-8"!==e&&o.setAttribute("charset","utf-8"))}const l=(0,o.xy)(e),a=e.createElement("meta");a.setAttribute("charset","utf-8"),l.insertBefore(a,l.firstChild)}},46555:(e,t,l)=>{"use strict";l.d(t,{i:()=>a});var o=l(31926);function a({title:e,acf:{limits:t,price:l},...a}){return{...a,title:(0,o.vf)(e)||"",limits:t,price:l}}},46805:(e,t,l)=>{"use strict";function o(e,t){const l=e.length;for(let o=0;o<l;o++){const l=e.charCodeAt(o);if(0===l)return!1;if('"'===t&&34===l)return!1;if("'"===t&&39===l)return!1;if(""===t&&(32===l||9===l||10===l||13===l||12===l||34===l||39===l||60===l||62===l||61===l||96===l))return!1}return!0}l.d(t,{Hk:()=>m,uI:()=>g});const a=new class{constructor(){this._byKey=Object.create(null),this._byValue=Object.create(null)}getOrCreateByKey(e){let t=this._byKey[e];return void 0===t&&(t=function(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",l=new Uint8Array(e);crypto.getRandomValues(l);let o="";for(let a=0;a<e;a++){const e=l[a]%62;o+=t.charAt(e)}return o}(8),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}};function r(e,t){if(void 0!==t&&!o(e,t)){return`%|{${a.getOrCreateByKey(e)}}|%`}return e}function n(e){const t=a.getByValue(e.slice(3,e.length-3));return void 0===t?e:t}function i(e,t){if(void 0!==t){if(o(e,t))return e;return`%|{${a.getOrCreateByKey(e)}}|%`}return`\x3c!--${e}--\x3e`}function s(e){if(e.startsWith("\x3c!--")&&e.endsWith("--\x3e")){const t=e.slice(4,-3).trim();return t.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")}return e}const d=/#set\s*\(\s*.*=.*\)/gm,c=/<!--#set\s*\(\s*.*=.*\)-->/gm,m=e=>{e.escape("\x3c!--","--\x3e",e=>e,!1),e.escape("<style","</style>",e=>e,!1),e.escape("<script","<\/script>",e=>e,!1),e.unescape("%|{","}|%",n),e.escape("@{","}",i,!0).unescape("\x3c!--@{","}--\x3e",s,!0),e.unescape("\x3c!--%%%{{{","}}}%%%--\x3e",e=>e.substring(10,e.length-9),!1),e.escape("${","}",r,!0),e.escape("{{","}}",r,!0),e.escape("{%","%}",i).unescape("\x3c!--{%","%}--\x3e",s),e.escape("{#","#}",i).unescape("\x3c!--{#","#}--\x3e",s),e.escape("[%","%]",i,!0).unescape("\x3c!--[%","%]--\x3e",s,!0),e.createSyntax("getresponse").escape("[[IF","]]",i).escape("[[if","]]",i).escape("[[ELSE]]","",i).escape("[[else]]","",i).escape("[[ENDIF]]","",i).escape("[[endif]]","",i).unescape("\x3c!--[[IF","]]--\x3e",s).unescape("\x3c!--[[if","]]--\x3e",s).unescape("\x3c!--[[ELSE]]","--\x3e",s).unescape("\x3c!--[[else]]","--\x3e",s).unescape("\x3c!--[[ENDIF]]","--\x3e",s).unescape("\x3c!--[[endif]]","--\x3e",s),e.createSyntax("ExpertSender").escape("<if",">",i).escape("</if",">",i).escape("<else",">",i).escape("</else",">",i).escape("<var ",">",i,!0).unescape("\x3c!--<if ",">--\x3e",s).unescape("\x3c!--</if",">--\x3e",s).unescape("\x3c!--<else ",">--\x3e",s).unescape("\x3c!--</else",">--\x3e",s).unescape("\x3c!--<var",">--\x3e",s,!0),e.createSyntax("velocity").escape("#if",")",i).escape("#elseif",")",i).escape("#else","",i).escape("#foreach",")",i).escape("#macro",")",i).escape("#set",")",(e,t)=>!!e.match(d)&&i(e,t),!0).escape("#parse",")",i).escape("#include",")",i).escape("#evaluate",")",i).escape("#end","",i).escape("#break","",i).escape("#stop","",i).unescape("\x3c!--#macro",")--\x3e",s).unescape("\x3c!--#if",")--\x3e",s).unescape("\x3c!--#elseif",")--\x3e",s).unescape("\x3c!--#else","--\x3e",s).unescape("\x3c!--#foreach",")--\x3e",s).unescape("\x3c!--#parse",")--\x3e",s).unescape("\x3c!--#include",")--\x3e",s).unescape("\x3c!--#evaluate",")--\x3e",s).unescape("\x3c!--#end","--\x3e",s).unescape("\x3c!--#break","--\x3e",s).unescape("\x3c!--#stop","--\x3e",s).unescape("\x3c!--#set",")--\x3e",e=>!!e.match(c)&&s(e),!0),e.escape("*|","|*",i).unescape("\x3c!--*|","|*--\x3e",s),e.escape("{%","%}",i).unescape("\x3c!--{%","%}--\x3e",s)};function u(e,t,l,o){const a=[];if(l&&(t=t.filter(e=>e.isVariable)),!t.length)return a;const r=function(e,t){const l=t.reduce((e,{mapFn:t,start:l,end:o,syntax:a})=>(e[l]||(e[l]=[]),e[l].push({value:o,mapFn:t,syntax:a}),e),Object.create(null)),o=Object.keys(l).map(e=>e.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&")).join("|"),a=new RegExp(o,"g"),r=[];let n;for(;null!==(n=a.exec(e));){const e=n[0];r.push({start:n.index,startToken:e,endTokens:l[e]})}return r}(e,t);let n,i=!1,s=!1,d=!1,c=0;for(let u=0;u<r.length;u++){var m;const{start:t,startToken:l,endTokens:p}=r[u];if(o)s=!0,n='"';else for(let o=c;o<t;o++){const t=e[o];s?'"'===n||"'"===n?t===n&&(s=!1,n=void 0):d&&/[\s>]/.test(t)&&(s=!1,n=void 0,d=!1):"<"===t?i=!0:">"===t?i=!1:!i||'"'!==t&&"'"!==t?i&&/\S/.test(t)&&void 0===n&&"="===e[o-1]&&!['"',"'","`"].includes(t)&&(s=!0,n="",d=!0):(s=!0,n=t,d=!1)}c=t;const g=s?null!==(m=n)&&void 0!==m?m:"":void 0;for(const{mapFn:o,value:n}of p){let i=e.indexOf(n,t+l.length),s=t+l.length,d=0;for(;-1!==i;){const t=e.indexOf(l,s);if(-1!==t&&t<i)d++,s=t+l.length,i=e.indexOf(n,s);else{if(!(d>0))break;d--,s=i+n.length,i=e.indexOf(n,s)}}if(i>=0){const l=i+n.length,s=e.substring(t,l),d=o(s,g);!1!==d&&d!==s&&a.push({range:{start:t,end:l},text:d});const c=r.findIndex(({start:e})=>e>=l);u=c>u?c-1:r.length;break}}}return a}function p(e,t){if(!t.length)return e;const l=t.slice().sort((e,t)=>t.range.start-e.range.start);let o=e;for(const{text:a,range:r}of l)o=o.slice(0,r.start)+a+o.slice(r.end);return o}class g{constructor(e=m){this._disposables=[],this._escapes=[],this._unescapes=[];const{_escapes:t,_unescapes:l}=this;e({createSyntax(e){return{...this,syntax:e}},escape(e,l,o,a){return t.push({start:e,end:l,mapFn:o,isVariable:a,syntax:this.syntax||e}),this},unescape(e,t,o,a){return l.push({start:e,end:t,mapFn:o,isVariable:a,syntax:this.syntax||e}),this}})}getMappings(e,t,l){return u(e,this._escapes,t,l)}getRevertMappings(e,t){return u(e,this._unescapes,t)}getEscapedText(e,t){return p(e,this.getMappings(e,t))}getUnescapedText(e,t){return p(e,this.getRevertMappings(e,t))}addDisposable(e){this._disposables.push(e)}dispose(){for(const e of this._disposables)e.dispose()}}},47014:(e,t,l)=>{"use strict";l.d(t,{Ay:()=>y,B:()=>b,B$:()=>_,C1:()=>f,hZ:()=>v,ko:()=>p,ku:()=>m,ww:()=>d,yf:()=>E});var o=l(1029),a=l(78915),r=l(32947),n=l(40277);const i=(0,l(93778).ur)({currentUser:{},currentSchema:{},monacoOptions:r.rW,monacoDidMount:!1}),s="userSlice",d=(0,o.createAsyncThunk)("user/setMonacoOptions",async(e,{getState:t})=>{const l=t()[s],o="string"===typeof e.font_family?`${e.font_family}, sans-serif`:void 0,a=void 0!==e.word_wrap?e.word_wrap?"on":"off":void 0;return o&&l.monacoOptions.fontFamily!==o&&await(0,n.iV)(e.font_family),{tabSize:e.tab_size,fontFamily:o,fontSize:e.font_size,wordWrap:a,insertSpaces:e.insert_spaces,minimap:{enabled:e.minimap}}}),c=(0,o.createSlice)({name:s,initialState:i,reducers:{setMonacoDidMount:(e,{payload:t})=>{e.monacoDidMount=t},setTheme:(e,{payload:t})=>{e.currentUser.theme=t},setUserLocale:(e,{payload:t})=>{e.currentUser.locale=t},setUserAutosaves:(e,{payload:t})=>{e.currentUser.autosaves=t},setUser:(e,{payload:t})=>{e.currentUser={...e.currentUser,...t}}},extraReducers:e=>{e.addCase(d.fulfilled,(e,t)=>{const l=t.payload;e.monacoOptions=(0,n.i0)({...e.monacoOptions},l)}),e.addMatcher(a.Q2.endpoints.editMe.matchFulfilled,(e,t)=>{e.currentUser=t.payload}),e.addMatcher(a.Q2.endpoints.getMe.matchFulfilled,(e,t)=>{e.currentUser=t.payload}),e.addMatcher(a.Q2.endpoints.getSchema.matchFulfilled,(e,t)=>{e.currentSchema=t.payload.schema})}}),{setMonacoDidMount:m,setTheme:u,setUserLocale:p,setUserAutosaves:g,setUser:h}=c.actions,b=e=>{var t;return null===(t=e[s].currentUser)||void 0===t?void 0:t.locale},f=e=>e[s].currentUser,E=e=>e[s].currentSchema,v=e=>e[s].monacoOptions,_=e=>{var t;return 3891!==(null===(t=e[s].currentUser.subscription)||void 0===t?void 0:t.ID)},y=c},47091:(e,t,l)=>{"use strict";l.d(t,{A:()=>ce});var o=l(98173),a=l(40120),r=l(35491),n=l(49856),i=l(67034),s=l(38927),d=l(10423),c=l(71832),m=l(59010),u=l(99291),p=l(10582),g=l(73477),h=l(40186),b=l(78446),f=l(10267),E=l(82648),v=l(47214),_=l(6969),y=l(35076),A=l(38256),S=l(71879),k=l(83612),w=l(79245),C=l(30150),B=l(2604),x=l(85591),T=l.n(x),R=l(76487),N=l(45271),L=l(50209),I=l(37969),P=l(52218),O=l.n(P),F=l(40277),M=l(96734),D=l(89613),V=l(12543),W=l(32947);const{useToken:j}=a.A,z=({element:e,setSearchFilters:t=(e,t)=>{}})=>{var l;const{projectId:a}=(0,C.g)(),r=(0,C.Zp)(),s=(0,M.p)(),{token:c}=j(),{__:m}=(0,V.s9)(),u=e.type?W.IE:W.Tm,p=`/projects/${a}/emails/new`,g=(0,D.u)(),h=(0,o.useRef)(null);return o.createElement(d.A,{className:`element-card element-card_${u} element-card_template`,hoverable:!0,id:e.id,style:{cursor:"pointer"},"data-testid":e.id,cover:o.createElement(o.Fragment,null,o.createElement("div",{ref:h,className:"element-card__img-wrapper"},o.createElement("img",{className:"element-card__img",alt:e.title,src:((e,t=a,l)=>`https://scr.emcdn.ru/screenshot?delay=1000&width=800&fullPage=true&deviceScaleFactor=0.8&format=jpg&force=false${l?`&cacheControl=true&cache-hash=${O()(l)}`:""}&url=${encodeURIComponent(`https://app.emailmaker.ru/get${u}/${e}?secret_hash=${O()(`${t}${e}${W.KI}`)}&raw=true`)}`)(e.id,e.project,e.modified),onMouseMove:e=>(0,F.Hy)(e,h.current),onMouseLeave:F.Tr})),e.is_template&&e.project===+a&&o.createElement("div",{className:"element-card__is-template-wrapper"},m("Template")),(0,F._q)(e,W.zh).length&&o.createElement("div",{className:"element-card__tags-wrapper"},o.createElement(n.A,{wrap:!0,size:8},null===(l=(0,F._q)(e,W.zh))||void 0===l?void 0:l.map(e=>o.createElement(i.A,{bordered:!1,color:c.colorPrimary,style:{borderRadius:6},key:e.id,onClick:()=>t(null,e.id)},e.name))))),onClick:()=>{return t=e.id,g({event:"select",action:"create_new_email",template_id:t,project_id:a,template_title:(0,F.ln)(e.title),description:"Create new email from template"}),s.set(W.A9.em_new_email,t),void(0,F.XZ)(r,p);var t}},o.createElement("div",null,o.createElement(I.Ay,{type:"link",className:"element-card__title"},(0,F.ln)(e.title))))};var H=l(56605),G=l(8807),U=l(69550),q=l(48753),X=l(8218),$=l(23424);const Z="description",Y=()=>{const{__:e}=(0,V.s9)(),t=(0,B.wA)(),l=(0,D.u)(),[a]=U.A.useForm(),r=(0,o.useRef)(null),n=(0,B.d4)($.cL)===W.lx.ADD_NEW_AI_EMAIL,i=(0,M.p)(),s=(0,C.Zp)(),{projectId:d}=(0,C.g)(),c=(0,o.useCallback)(()=>{a.resetFields(),setTimeout(()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.focus()},0)},[a]);(0,o.useEffect)(()=>{n&&c()},[n,c]);const m=()=>t((0,$.Oo)()),u=()=>{const e=`/projects/${d}/emails/new`,t=String(278056);i.set(W.A9.em_new_email,t),a.validateFields().then(({description:t})=>{l({event:"submit_form",action:"ai_email_generation",project_id:d,ai_prompt:t}),window.localStorage.setItem(W.V0.em_active_tab,W.z$),window.localStorage.setItem(W.V0.em_ai_settings,t),(0,F.XZ)(s,e),m()})};return o.createElement(q.A,{title:o.createElement(o.Fragment,null,o.createElement("span",null,e("I'd be happy to create an email for you! ")),o.createElement("p",null,e("Start with a detailed description of your email."))),open:n,onOk:u,onCancel:m,className:"new-folder-modal",centered:!0,footer:[o.createElement(I.Ay,{key:"submit",type:"primary",size:"large",onClick:u},e("Generate Email"))]},o.createElement(U.A,{form:a,layout:"vertical",name:"add_new_folder_form",onFinish:u,initialValues:{[Z]:""},autoComplete:"off",style:{paddingTop:10}},o.createElement(U.A.Item,{name:Z,rules:[{required:!0,message:e("Please enter the description")}]},o.createElement(X.A,{size:"large",placeholder:e("Please enter the description"),ref:r,style:{marginBottom:5}}))))};var K=l(5558),Q=l(98845),J=l(92960),ee=l(40835),te=l(79253),le=l(1047),oe=l(84572),ae=l(47014),re=l(80223),ne=l(71854),ie=l(99152);const{useToken:se}=a.A,de=(e,t)=>`${e.pathname}/${t.id}`,ce=({projectId:e,emailsView:t,createPage:l=!1,currentFolderId:a,foldersList:x,refetchProjectFolders:I,projectTags:P=[],activeTagId:O,setActiveTagHandler:j,projectEmailsCounter:U=0,registerFunction:q=()=>{},groupType:X=null})=>{var Z,ce,me,ue,pe,ge,he,be;const{__:fe,_x:Ee}=(0,V.s9)(),ve=(0,B.wA)(),_e=(0,B.d4)(te.MY),ye=(0,B.d4)(te.aO),Ae=(0,B.d4)(oe.RP),Se=(0,B.d4)(oe.AQ),ke=(0,B.d4)(oe.qV),we=(0,B.d4)(ae.C1),Ce=(0,B.d4)(te.NP),Be=(0,B.d4)(te.qM),xe=(0,B.d4)(te.ux),Te=(0,B.d4)(le.CT),Re=(0,B.d4)(oe.GD),Ne=(0,B.d4)(oe.Rw),[Le,Ie]=(0,w.ok)(),Pe=(0,M.p)(),Oe=(0,K.hN)(),{owner:Fe,admin:Me}=(0,re.A)();let De=(0,C.zy)();const Ve=(0,C.Zp)(),{token:We}=se(),{modal:je}=r.A.useApp(),ze=(0,B.Pj)(),{confirm:He}=je,Ge=(0,D.u)(),Ue=[...Re,...Ne],[qe,Xe]=(0,o.useState)(null);(0,o.useEffect)(()=>{X===W.ti.ALL?Xe(Ae+Se):X===W.ti.PROJECT?Xe(Se):X===W.ti.STANDARD&&Xe(Ae)},[X,Ae,Se]);const $e=+Le.get("page"),Ze=Le.get("folder"),Ye=+Le.get("tag"),[Ke,Qe]=(0,Q.Kh)(),[Je]=(0,Q._3)(),[et]=(0,Q.dN)(),{refetch:tt}=(0,C.KC)(),[lt,ot]=(0,o.useState)(!1),at=`/projects/${e}/emails/new`,rt=a&&a===W.UW,nt=a===W.y2&&!Ye;(0,o.useEffect)(()=>{ve((0,te.FC)())},[ve]);const[it,st]=(0,o.useState)({projectId:e,page:nt?$e:1,pageSize:W.mU,notEmbed:!0,tags:null,folderTag:null}),{isLoading:dt,isSuccess:ct,isError:mt,isFetching:ut,refetch:pt,error:gt}=(0,Q.Xw)({...it,folderTag:null,tags:null,status:"main"},{skip:l||!(null===(Z=it.name)||void 0===Z||!Z.length)&&a!==W.y2}),[ht,bt]=(0,o.useState)({page:$e||1,pageSize:W.mU,folderTag:null,tags:[],groupType:X}),{isLoading:ft,isSuccess:Et,isError:vt,isFetching:_t,data:yt=[],refetch:At,error:St}=(0,Q.PX)({...ht,groupType:X},{skip:!l||(Math.ceil(Ae+Se/W.mU)||1)<ht.page||X===W.ti.PROJECT}),{isLoading:kt,isSuccess:wt,isError:Ct,isFetching:Bt,data:xt=[],refetch:Tt,error:Rt}=(0,Q.PX)({...ht,projectId:e,groupType:X},{skip:!l||(Math.ceil(Se/W.mU)||1)<ht.page||X===W.ti.STANDARD}),Nt=(e,t)=>X===W.ti.ALL?e||t:X===W.ti.PROJECT?t:e,Lt=Nt(ft,kt),It=Nt(Et,wt),Pt=Nt(vt,Ct),Ot=Nt(_t,Bt),Ft=Nt(At,Tt),Mt=Nt(St,Rt),[Dt,Vt]=(0,o.useState)({projectId:e,page:1,pageSize:W.mU,notEmbed:!0,tags:Ye&&[Ye],folderTag:a}),{isLoading:Wt,isSuccess:jt,isError:zt,isFetching:Ht,error:Gt,refetch:Ut}=(0,Q.Xw)({...Dt,tags:a&&Dt.folderTag?null:Dt.tags,status:"custom"},{skip:l||rt||a===W.y2||Dt.folderTag!==a||!(null===(ce=Dt.name)||void 0===ce||!ce.length)&&(rt||a===W.y2)}),[qt,Xt]=(0,o.useState)({projectId:e,page:rt?$e:1,pageSize:W.mU,notEmbed:!0,tags:Ye&&[Ye],folderTag:null,status:"trash"}),[$t,Zt]=(0,o.useState)(!1),{isLoading:Yt,isSuccess:Kt,isError:Qt,isFetching:Jt,data:el,refetch:tl,error:ll}=(0,Q.Xw)({...qt,status:"trash",folderTag:null,page:$t?qt.page:1},{skip:l||(Math.ceil(ye/W.mU)||1)<qt.page||!(null===(me=qt.name)||void 0===me||!me.length)&&!rt||!(null===(ue=qt.tags)||void 0===ue||!ue[0])&&xe>0});(0,o.useEffect)(()=>{Kt&&tl()},[null===x||void 0===x?void 0:x.length,tl,Kt]),(0,o.useEffect)(()=>{Zt(!!el||Math.ceil(ye/W.mU)>=qt.page)},[el,qt.page,ye]);let ol=[];X!==W.ti.STANDARD&&xt&&ke>=ht.page&&ol.unshift(...xt),X!==W.ti.PROJECT&&yt&&(ol.push(...yt),ol=ol.slice(0,W.mU));const al=l?ht:rt?qt:nt?it:Dt,rl=l?It:rt?Kt:nt?ct:jt,nl=l?Lt:rt?Yt:nt?dt:Wt,il=l?Pt:rt?Qt:nt?mt:zt,sl=l?Ot:rt?Jt:nt?ut:Ht,dl=l?Ft:rt?tl:nt?pt:Ut,cl=l?Mt:rt?ll:nt?gt:Gt,ml=(l?qe:rt?ye:nt?_e:null===Ce||void 0===Ce||null===(pe=Ce[a||(null===(ge=Dt.tags)||void 0===ge?void 0:ge[0])])||void 0===pe?void 0:pe.total)||0,ul=l?ol:rt?xe:nt?Be:null===Ce||void 0===Ce||null===(he=Ce[a||(null===(be=Dt.tags)||void 0===be?void 0:be[0])])||void 0===he?void 0:he.list;(0,o.useEffect)(()=>{R.gV({id:null===we||void 0===we?void 0:we.id,email:null===we||void 0===we?void 0:we.email,username:null===we||void 0===we?void 0:we.name})},[we]),(0,o.useEffect)(()=>{rl&&dl&&q(dl)},[q,dl,rl]);const pl=(0,o.useCallback)(e=>{const t={...e,folderTag:void 0===e.folderTag?null:e.folderTag};l?bt(e=>({...e,...t})):rt?Xt(t=>({...t,...e})):nt?st(t=>({...t,...e})):Vt(t=>({...t,...e}))},[l,rt,nt]);(0,o.useEffect)(()=>{var e;"rest_post_invalid_page_number"===(null===cl||void 0===cl||null===(e=cl.data)||void 0===e?void 0:e.code)&&pl({page:1})},[cl,pl]),(0,o.useEffect)(()=>{if(!l){(Ze&&Ze!==a||O&&Ye!==O)&&pl({folderTag:a,page:1});let e={page:Ze===a&&al.page?al.page:1};a&&!Ye&&(e.folder=a),O&&(e.tag=O),Ie(e,{replace:!0})}},[al.page,Ve,l,Ze,a,O,Ye,pl,Ie]);const gl=e=>{He({maskClosable:!0,centered:!0,title:Ee(rt?"Are you sure to irrevocably delete \u201c":"Are you sure to delete \u201c","email")+e.title+fe("\u201d email?"),icon:o.createElement(h.A,{style:{color:"#ff4d4f"}}),okText:fe("Yes"),cancelText:fe("No"),onOk:()=>(e=>ze.dispatch(Q.GY.endpoints.deleteEmail.initiate({id:e.id,force:rt})).then(t=>{t.error?Oe.error(t):t.data&&(Oe.success(fe('The email "')+t.data.title+Ee('" was successfully removed.',"email")),Ge({event:"delete",action:"delete_email",email_id:e.id,project_id:e.project,force:rt}),dl(),I(),tl(),rt&&tt())}))(e)})},hl=e=>{ot(!0),et({emailId:null===e||void 0===e?void 0:e.id,status:"publish"}).then(t=>{t.error?Oe.error({message:t.error.data.code,description:t.error.data.message}):(e.folder[0]?dl():pt(),I(),tl(),Oe.success({message:fe("The email \u201c")+e.title+Ee("\u201d was successfully recovered.","recovery")})),ot(!1)})},bl=e=>{ot(!0),Je(null===e||void 0===e?void 0:e.id).then(t=>{var l,o,a,r,n;const i=t.data;Ke({title:(0,F.fq)(i.title),project:i.project,subject:i.subject,description:i.description,html:(0,F.el)(i.html||"",i.title),parent_email:i.parent_email||W.iU,common_styles:i.common_styles||"",utm_parameters:{utm_source:null===(l=i.utm_parameters)||void 0===l?void 0:l.utm_source,utm_medium:null===(o=i.utm_parameters)||void 0===o?void 0:o.utm_medium,utm_campaign:null===(a=i.utm_parameters)||void 0===a?void 0:a.utm_campaign,utm_term:null===(r=i.utm_parameters)||void 0===r?void 0:r.utm_term,utm_content:null===(n=i.utm_parameters)||void 0===n?void 0:n.utm_content},emailtags:e.emailtags,folder:i.folder}).then(t=>{var l;t.error?Oe.error({message:t.error.data.code,description:t.error.data.message}):(Ge({event:"clone",action:"clone_email",email_id:e.id,cloned_email_id:t.data.id,project_id:i.project}),null!==(l=i.folder)&&void 0!==l&&l[0]?Ut():pt(),I(),Oe.success({message:fe('The copy of email "')+e.title+Ee('" was successfully created.',"copy")}));ot(!1)})})},fl=(e,t)=>{et({emailId:t.id,folder:e.key===W.y2?[]:[e.key]}).then(e=>{var l,o;(null===e||void 0===e||null===(l=e.data)||void 0===l?void 0:l.folder[0])&&ve(Q.GY.endpoints.getEmails.initiate({...al,folderTag:(null===e||void 0===e||null===(o=e.data)||void 0===o?void 0:o.folder[0])||null})),a!==W.y2&&(ve((0,te.X)({folder:a,emailId:t.id})),ve(Q.GY.endpoints.getEmails.initiate({...al,folderTag:a||null}))),pt(),I()}).catch(e=>{})},El=[{width:"40%",title:Ee("Email","letter"),dataIndex:["title"],render:(e,t,l)=>o.createElement(w.N_,{to:rt?"":de(De,t),style:{cursor:rt?"default":"pointer"}},e)},{width:"20%",title:fe("Tags"),dataIndex:["emailtags"],render:(e,t,l)=>o.createElement(n.A,{wrap:!0,size:8},e&&e.map(e=>{const t=null===P||void 0===P?void 0:P.find(t=>{var l;return(null===(l=t.id)||void 0===l?void 0:l.toString())===(null===e||void 0===e?void 0:e.toString())});return t&&o.createElement(i.A,{color:We.colorPrimary,style:{cursor:"pointer",borderRadius:6,marginRight:0},key:t.id,onClick:()=>j(null,t.id)},t.name)||null}))},{width:"3%",title:"",dataIndex:"lock",render:(e,t,l)=>{var a,r;return e&&o.createElement(b.A,{className:T()("lock-icon",{"lock-icon__disabled":!(Fe||Me||(null===(a=we.id)||void 0===a?void 0:a.toString())===(null===(r=t.author)||void 0===r?void 0:r.toString()))})})}},{width:"16%",title:fe("Creator"),dataIndex:["_embedded","author"],render:(e,t,l)=>{var o;return(null===e||void 0===e||null===(o=e[0])||void 0===o?void 0:o.name)||""}},{width:"9%",title:fe("Created"),className:"nobr",dataIndex:"date",render:(e,t,l)=>(0,F.Yq)((0,k.A)(e),fe),sorter:!0,sortOrder:(0,F.Np)(al.order)},{width:"3%",title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(e,t)=>{var l,a,r,n,i,d,c,m;const u=t.folder[0]||null,p={icon:o.createElement(f.A,{style:{fontSize:18}}),label:fe("New emails"),key:W.y2,onClick:e=>fl(e,t)},g=null===x||void 0===x?void 0:x.map(e=>({icon:o.createElement(E.A,{style:{fontSize:18}}),label:e.name,key:e.id,className:e.id,onClick:e=>fl(e,t)})),k=(null===g||void 0===g?void 0:g.filter(e=>!u||e.key!==u))||[];u&&(null===k||void 0===k||k.unshift(p));let C=[];return(Fe||Me||(null===(l=we.id)||void 0===l?void 0:l.toString())===(null===(a=t.author)||void 0===a?void 0:a.toString()))&&!rt&&C.push({label:o.createElement(N.A,{key:"Lock",element:t}),icon:t.lock?o.createElement(v.A,{style:{fontSize:"16px"}}):o.createElement(b.A,{style:{fontSize:"16px"}})}),(Fe||Me||(null===(r=we.id)||void 0===r?void 0:r.toString())===(null===(n=t.author)||void 0===n?void 0:n.toString()))&&!rt&&k.length>0&&C.push({label:fe("Transfer to folder"),icon:o.createElement(E.A,{style:{fontSize:"16px"}}),children:k}),!rt&&C.push({label:o.createElement(w.N_,{to:de(De,t)},fe("Edit")),icon:o.createElement(_.A,{style:{fontSize:"16px"}}),key:"Enter",className:"em-analytics__email-enter"},{label:fe("Clone"),key:"Clone",icon:o.createElement(y.A,{style:{fontSize:"16px"}}),className:"em-analytics__email-clone",disabled:Qe.isLoading,onClick:()=>bl(t)}),(Fe||Me||(null===(i=we.id)||void 0===i?void 0:i.toString())===(null===(d=t.author)||void 0===d?void 0:d.toString()))&&rt&&C.push({label:fe("Recover"),icon:o.createElement(A.A,{style:{fontSize:"16px"}}),key:"Recover",onClick:()=>hl(t)}),(Fe||Me||(null===(c=we.id)||void 0===c?void 0:c.toString())===(null===(m=t.author)||void 0===m?void 0:m.toString()))&&C.push({label:fe("Remove"),icon:o.createElement(h.A,{style:{fontSize:"16px"}}),key:"Remove",className:"em-analytics__email-remove",style:{color:"#ff4d4f"},onClick:()=>gl(t)}),o.createElement(s.A,{arrow:"true",placement:"bottom",menu:{items:C},trigger:["hover"]},o.createElement("span",{className:"projects-table__actions"},o.createElement(S.A,null)))}}],[vl,_l]=(0,o.useState)(!1);(0,o.useEffect)(()=>{var e,t;for(let l in Te)if(l||""===l||0===l.length){_l(!0),pl({...Te,folderTag:a,page:1});break}(null!==(e=Te.tags)&&void 0!==e&&e.length||Te.name)&&pl({...Te,folderTag:a,page:1}),null!==(t=Te.group)&&void 0!==t&&t.length&&bt({...Te,group:Te.group,page:1,pageSize:W.mU})},[Te,ve,a,rt,pl,l]);const[yl,Al]=(0,o.useState)(!1),[Sl]=(0,J.mI)(),[kl]=(0,ee.dS)(),{data:wl}=(0,C.KC)(),Cl=async e=>{const t=e[0];try{Al(!0);const e=(0,ne.xi)(Sl,kl,we,wl),l=(0,ne.oF)(t),o=await(0,ne.q2)(t,e,l),[a]=(0,ie.Ay)(t.name.replaceAll("&nbsp;"," ")),r=a||(0,F.ez)(o)||"";return Ke({title:r,project:wl.id,subject:r,description:"",html:o,parent_email:W.iU,folder:[]}).then(e=>{e&&(e.error?Oe.error({message:e.error.data.code,description:e.error.data.message}):(Ve(`/projects/${wl.id}/emails/${e.data.id}`),Ge({event:"import",action:"import_email",email_id:e.data.id,project_id:wl.id,file_name:t.name})))}).finally(()=>Al(!1))}catch(l){Al(!1);const e=l instanceof Error?l.message:l;Oe.error({message:e})}};return o.createElement("div",{className:"project-page__list"},l&&o.createElement("div",{className:"project-page__cards-grid create-buttons"},o.createElement(d.A,{className:"element-card element-card_email element-card_template element-card_template-empty",hoverable:!0,style:{cursor:"pointer"},cover:o.createElement("div",{className:"element-card__empty-template"},o.createElement(G.A,{icon:"NewEmail"}),o.createElement("div",{className:"element-card__empty-template__text"},o.createElement("div",{className:"element-card__empty-template__title"},fe("Blank template")),o.createElement("div",{className:"element-card__empty-template__description"},fe("Start from scratch")))),onClick:()=>{return e=278056,Ge({event:"select",action:"create_new_email",template_id:"0",description:"Create new email from scratch (template = 0)"}),Pe.set(W.A9.em_new_email,e),t&&(window.localStorage.setItem(W.V0.em_active_tab,t),window.localStorage.setItem(W.V0.em_ai_settings,t)),void(0,F.XZ)(Ve,at);var e,t}}),o.createElement(d.A,{className:"element-card element-card_email element-card_template element-card_template-empty",hoverable:!0,style:{cursor:"pointer"},loading:yl,cover:o.createElement("div",{className:"element-card__empty-template"},o.createElement(G.A,{icon:"Import"}),o.createElement("div",{className:"element-card__empty-template__text"},o.createElement("div",{className:"element-card__empty-template__title"},fe("Import email")),o.createElement("div",{className:"element-card__empty-template__description"},fe("Work with your markup"))," ")),onClick:()=>{Ge({event:"click",action:"import_email"}),(0,ne.QM)("application/zip, message/rfc822, text/html",Cl)}}),o.createElement(d.A,{className:"element-card element-card_email element-card_template element-card_template-empty",hoverable:!0,style:{cursor:"pointer"},cover:o.createElement("div",{className:"element-card__empty-template"},o.createElement(G.A,{icon:"generationAI"}),o.createElement("div",{className:"element-card__empty-template__text"},o.createElement("div",{className:"element-card__empty-template__title"},fe("AI email generation")),o.createElement("div",{className:"element-card__empty-template__description"},fe("Creating an email on request")," "))),onClick:()=>{Ge({event:"click",action:"ai_email_generation_open",project_id:e}),ve((0,$.qf)(W.lx.ADD_NEW_AI_EMAIL))}})),l&&(!!qe||!!Ue.length)&&o.createElement("div",{className:"element-card__group-tag-wrapper"},o.createElement(c.A,{gap:"10px",style:{marginBottom:15,marginLeft:4},wrap:!0},Ue.map(e=>o.createElement(i.A,{className:"blue-color element-card__group-tag",key:e.key,color:"#1677ff"},e.name," ",o.createElement(G.A,{onClick:()=>{const t=Ue.filter(t=>t.key!==e.key);ve(Re.length?(0,oe.es)(t):(0,oe.BN)(t)),ve((0,le.ry)({[Re.length?"group":"projectGroup"]:t,[Re.length?"projectGroup":"group"]:[]}))},icon:"CloseTag"}))),Ue.length>1&&o.createElement(i.A,{className:"blue-color element-card__group-tag element-card__group-tag_close"},fe("Clear all")," ",o.createElement(G.A,{onClick:()=>{ve((0,oe.mb)()),ve((0,le.ry)({group:[],projectGroup:[]}))},icon:"CloseAll"})))),nl&&!(null!==ul&&void 0!==ul&&ul.length)&&o.createElement(m.A,{active:!0}),il&&o.createElement(u.A,{message:fe("Error"),description:fe("Error when receiving data. Try again (reload page) or contact support."),type:"error",showIcon:!0}),!nl&&!sl&&0===(null===ul||void 0===ul?void 0:ul.length)&&(vl||U>0?o.createElement(u.A,{message:fe("Emails not found"),description:"",type:"info",showIcon:!0}):a!==W.y2?o.createElement(u.A,{message:fe("You don't have any emails in this folder."),description:fe("Add your first email to the folder..."),type:"info",showIcon:!0}):o.createElement(u.A,{message:fe("You don't have any emails yet."),description:fe("Add your first email by clicking the Create a new email button."),type:"info",showIcon:!0})),(null===ul||void 0===ul?void 0:ul.length)>0&&t===W.rl&&o.createElement(p.A,{rowKey:e=>e.id,bordered:!0,dataSource:ul,columns:El,loading:sl||lt,onChange:(e,t,{order:l,field:o},{action:a})=>{"sort"===a&&pl(l?{page:al.page||1,order:(0,F.gq)(l),orderby:o,pageSize:W.mU}:{page:al.page||1,pageSize:W.mU})},showSizeChanger:!1,pageSize:W.mU,pagination:{current:al.page||1,total:ml,hideOnSinglePage:!0,showSizeChanger:!1,pageSize:W.mU,position:["bottomLeft"],onChange:(t,l)=>pl({projectId:e,page:t,pageSize:l})}}),((null===ul||void 0===ul?void 0:ul.length)>0||rl)&&t===W.Y$&&o.createElement(o.Fragment,null,(sl||lt||yl)&&o.createElement("div",{className:"project-page__loader"},o.createElement(H.A,{small:!0})),o.createElement("div",{className:"project-page__cards-grid"},ul&&ul.map(e=>l?o.createElement(z,{key:e.id,element:e,setSearchFilters:j}):o.createElement(L.A,{key:e.id,element:e,setSearchFilters:j,isTrash:rt,foldersList:x,refetch:pt,projectTags:P,foldersHandlers:{handleRemove:gl,handleRecover:hl,handleClone:bl,handlerChangeFolder:fl}}))),o.createElement(g.A,{current:al.page||1,total:ml,hideOnSinglePage:!0,showSizeChanger:!1,pageSize:W.mU,onChange:(e,t)=>pl({page:e,pageSize:t})})),o.createElement(Y,null))}},47904:(e,t,l)=>{"use strict";l.d(t,{l:()=>o});const o={wordwrap:200,tables:!0,selectors:[...l(634).lp.selectors||[],{selector:"table",format:"dataTable"},{selector:"ul",format:"list"},{selector:"ol",format:"list"},{selector:"pre",format:"block"},{selector:"blockquote",format:"blockquote"}],baseElements:{selectors:["body","table"]},preserveNewlines:!0,longWordSplit:{forceWrapOnLimit:!0}}},47908:(e,t,l)=>{"use strict";l.d(t,{A:()=>we});var o=l(98173),a=l(30150),r=l(47555),n=l(40120),i=l(5558),s=l(86406),d=l(77073),c=l(91321),m=l(2604),u=l(85591),p=l.n(u),g=l(37969),h=l(93771),b=l(79245),f=l(12543),E=l(17434),v=l(62452),_=l(12865),y=l(65856),A=l(47157),S=l(71321),k=l(94548),w=l(92946),C=l(90189),B=l(60723),x=l(11824),T=l(72320),R=l(69341),N=l(56013),L=l(23424),I=l(84572),P=l(47014),O=l(78915),F=l(40277),M=l(96734),D=l(89613),V=l(27941),W=l(32947);const j=({isMenuCollapsed:e,setIsMenuCollapsed:t,isLocked:l})=>{var r;const{__:n}=(0,f.s9)();let i=(0,m.wA)(),s=(0,a.Zp)();const{projectId:d,emailId:c,blockId:u}=(0,a.g)(),{pathname:j}=(0,a.zy)(),[z,H]=(0,o.useState)(""),G=(0,m.d4)(I.yN),U=(0,m.d4)(P.C1),q=(0,M.p)(),X=(0,D.u)(),$=(0,V.rD)(),Z=(0,o.useCallback)(()=>{j.includes("blocks")?H("Blocks"):j.includes("emails")?H("Emails"):j.includes("members")&&H("Members"),!l&&t(!0)},[j,t,l]);(0,o.useEffect)(()=>{Z()},[Z]);let Y=[],K=[];const Q=(null===G||void 0===G?void 0:G.title)||"",J=()=>{try{X({event:"click",action:"editor_tour",project_id:(null===G||void 0===G?void 0:G.id)||d,location:"left_menu"}),window.LP_show(85420)}catch(e){}};let ee=[{label:o.createElement("a",{href:"https://emailmaker.ru/help/",target:"_blank",rel:"noopener noreferrer",onClick:()=>{X({event:"click",action:"help_center",project_id:(null===G||void 0===G?void 0:G.id)||d,location:"left_menu"})}},n("Help")),key:"Help center",icon:o.createElement(E.z,{size:18,strokeWidth:$.iconStrokeWidth}),className:"help-center"},{label:n("Chat support"),key:"Support chat",icon:o.createElement(v.$,{size:18,strokeWidth:$.iconStrokeWidth}),className:"open-support-chat",onClick:()=>{try{X({event:"click",action:"support_chat",project_id:(null===G||void 0===G?void 0:G.id)||d,location:"left_menu"}),window.carrotquest.open()}catch(e){}}}];(c||u)&&ee.push({label:n("Onboarding"),key:"Onboarding",icon:o.createElement(_.M,{size:18,strokeWidth:$.iconStrokeWidth}),className:"open-onboarding",onClick:J});let te=[{label:n("Account settings"),key:"Account settings",icon:o.createElement(y.h,{size:18,strokeWidth:$.iconStrokeWidth}),className:"em-analytics__account-settings",onClick:()=>{i((0,L.qf)(W.lx.EDIT_PROFILE_MODAL)),!l&&t(!0)}},{label:o.createElement(b.N_,{to:"/billing",state:{from:j}},n("Billing")),key:"Billing",icon:o.createElement(A.O,{size:18,strokeWidth:$.iconStrokeWidth}),className:"em-analytics__billing"},{label:n("Sign out"),icon:o.createElement(S.O,{size:18,strokeWidth:$.iconStrokeWidth}),key:"Sign out",className:"em-analytics__sign-out",onClick:()=>{X({event:"logout",action:"logout",user_id:null===U||void 0===U?void 0:U.id,user_email:null===U||void 0===U?void 0:U.email,project_id:(null===G||void 0===G?void 0:G.id)||d}),(0,F.Id)(q),i(O.Q2.util.resetApiState()),s("/auth",{replace:!0})}}];const le="/projects"+(d?"/"+d+"/emails?page=1":""),oe=[{label:o.createElement(b.N_,{style:{fontSize:16},to:le},Q),key:"Project",popupOffset:[0,16],style:{fontWeight:500},icon:d?o.createElement(b.N_,{to:le,className:"project-menu__block",style:{fontSize:"18px",zIndex:99}},o.createElement(g.Ay,{type:"primary",className:"project-menu__block-button"},null===Q||void 0===Q?void 0:Q.split(" ").slice(0,2).map(e=>Array.from(e)[0]))):o.createElement(b.N_,{to:le,rel:"noopener noreferrer",className:"project-menu__block"},!e||l?o.createElement("div",{dangerouslySetInnerHTML:{__html:W.KN}}):o.createElement("div",{dangerouslySetInnerHTML:{__html:W.DS}})),className:p()("project-menu__list-item project-menu__list-item_project project-menu__list-item_project",{"project-menu__list-item_logo":!d,"project-menu__list-item_project":d}),children:d&&[{label:n("Project settings"),key:"Project settings",className:"em-analytics__account-settings",icon:o.createElement(k.T,{size:18,strokeWidth:$.iconStrokeWidth}),onClick:()=>{i((0,L.qf)(W.lx.EDIT_PROJECT_MODAL)),!l&&t(!0)}},{label:o.createElement(b.N_,{to:"/projects"},n("List of projects")),key:"List of projects",icon:o.createElement(w.B,{size:18,strokeWidth:$.iconStrokeWidth}),className:"em-analytics__sign-out"}]},{type:"divider"}];return Y.push({icon:o.createElement(C.M,{size:22,strokeWidth:$.iconStrokeWidth}),label:o.createElement(b.N_,{to:`/projects/${d}/emails`,rel:"noopener noreferrer"},n("Emails")),key:"Emails",className:"project-menu__list-item em-analytics__project-menu-emails"},{icon:o.createElement(B.g,{size:22,strokeWidth:$.iconStrokeWidth}),label:o.createElement(b.N_,{to:`/projects/${d}/blocks`,rel:"noopener noreferrer"},n("Blocks")),key:"Blocks",className:"project-menu__list-item em-analytics__project-menu-blocks"},{icon:o.createElement(x.F,{size:22,strokeWidth:$.iconStrokeWidth}),label:o.createElement(b.N_,{to:`/projects/${d}/members`,rel:"noopener noreferrer"},n("Members")),key:"Members",className:"project-menu__list-item em-analytics__project-menu-members"}),"community"===U.subscription.post_name&&d&&U.counters.emails_counter>2&&K.push({icon:o.createElement(T.B,{size:22,strokeWidth:$.iconStrokeWidth}),label:o.createElement(b.N_,{to:"/billing",state:{from:j},rel:"noopener noreferrer",style:{fontSize:16,color:"white"}},n("Upgrade")),key:"Emails",className:"project-menu__list-item",onClick:()=>{X({event:"click",action:"upgrade_tariff"})}}),K.push({icon:o.createElement(R.y,{size:22,strokeWidth:$.iconStrokeWidth}),label:n("Help menu"),key:"Help menu",className:"project-menu__list-item support-center-menu",children:ee},{icon:o.createElement(N.U,{size:22,strokeWidth:$.iconStrokeWidth}),label:n("What's new"),key:"What's new",className:"project-menu__list-item ducalis-changelog-widget em-analytics__project-menu-ducalis",onClick:()=>{X({event:"click",action:"whats_new",project_id:(null===G||void 0===G?void 0:G.id)||d,location:"left_menu"})}},{icon:o.createElement("span",{style:{width:"22px",height:"22px",fontSize:"18px"},className:"user-profile__avatar anticon"},null!==U&&void 0!==U&&null!==(r=U.avatar_urls)&&void 0!==r&&r[48]?[o.createElement("img",{style:{width:"100%"},key:"img",src:null===U||void 0===U?void 0:U.avatar_urls[48],alt:null!==U&&void 0!==U&&U.name?`${null===U||void 0===U?void 0:U.name} avatar`:"User avatar",className:"user-profile__avatar-img"}),o.createElement(y.h,{size:22,strokeWidth:$.iconStrokeWidth,key:"UserOutlined",style:{position:"absolute",fontSize:22,borderRadius:100,overflow:"hidden",height:22,width:22,lineHeight:0,zIndex:-1}})]:o.createElement(y.h,{size:22,style:{color:"white"},strokeWidth:$.iconStrokeWidth})),label:(null===U||void 0===U?void 0:U.name)||null,key:"User profile",className:"project-menu__list-item user-profile",children:te}),o.createElement(o.Fragment,null,o.createElement("div",{className:"project-menu"},o.createElement("div",null,o.createElement(h.A,{disabledOverflow:!0,className:"project-menu__list project-menu__list_top",style:{fontSize:16},items:oe,triggerSubMenuAction:"hover",subMenuOpenDelay:.3,subMenuCloseDelay:.6,selectable:!1}),d&&o.createElement(h.A,{disabledOverflow:!0,selectable:!0,selectedKeys:[z],className:"project-menu__list project-menu__list_second",style:{fontSize:16,marginTop:30},items:Y,triggerSubMenuAction:"hover"})),o.createElement(h.A,{disabledOverflow:!0,selectable:!0,selectedKeys:["Emails"],forceSubMenuRender:"true",className:"project-menu__list project-menu__list_bottom",style:{fontSize:14,marginBottom:6},subMenuOpenDelay:.3,subMenuCloseDelay:.6,items:K,triggerSubMenuAction:"hover"})))};var z=l(63837),H=l(49823),G=l(69550),U=l(201),q=l(66964),X=l(8218),$=l(29123),Z=l(48753),Y=l(93511),K=l(27988),Q=l(975),J=l(55394),ee=l(79690),te=l(1047),le=l(80877),oe=l(39420),ae=l(52919);const{Option:re}=H.A,ne="profile",ie=({isModalVisible:e})=>{const{__:t}=(0,f.s9)(),l=(0,m.d4)(P.C1),a=(0,m.d4)(P.yf),r=(0,i.hN)(),n=(0,ae.XW)(),s=(0,m.wA)(),[d]=G.A.useForm(),c=(0,V.rD)(),[u,p]=(0,O.b9)(),[h,b]=(0,O.hZ)(),[E,v]=(0,o.useState)([]),[_,A]=(0,o.useState)([]),[S,k]=(0,o.useState)(ne),[w,C]=(0,o.useState)({currentPassword:!1,newPassword:!1,confirmPassword:!1}),[B,x]=(0,o.useState)(()=>l.locale),T=(0,o.useRef)(null),R=t("If you turn the switch off, lines of code will not wrap. If you turn the switch on, lines of code will wrap at the viewport.");(0,o.useEffect)(()=>{if(d&&e){k(ne),h(void 0,!0);const e=l.code_editor;x(l.locale),d.setFieldsValue({firstName:l.first_name,lastName:l.last_name,email:l.email,theme:l.theme,currentPassword:"",newPassword:"",confirmPassword:"",autosaves:Boolean(l.autosaves),hideMergetags:Boolean(l.hide_mergetags),language:l.locale,newsLetterConsent:Boolean(l.newsletter_consent),codeEditor:{fontSize:e.font_size||10,fontFamily:e.font_family,tabSize:e.tab_size||2,wordWrap:Boolean(e.word_wrap),minimap:Boolean(e.minimap),insertSpaces:Boolean(e.insert_spaces)}})}},[l,d,e,h,x]),(0,o.useEffect)(()=>{if(d&&e){if(b.isSuccess){var t,l,o,n;let e=null===(t=(0,F.EU)(a,["acf","theme"]))||void 0===t||null===(l=t.items)||void 0===l?void 0:l.enum;const r=null===(o=(0,F.EU)(a,["acf","code_editor","font_family"]))||void 0===o||null===(n=o.items)||void 0===n?void 0:n.enum;v((0,F.d_)(e)),A((0,F.d_)(r))}b.isError&&r.error(b)}},[b,d,e,a]);const N=()=>{const e=window.localStorage.getItem(W.V0.em_color_scheme),t=matchMedia(W.F3).matches?W.nd:W.T;n({operation:W.Ru.UPDATE_PREVIEW,theme:e||t}),d.validateFields().then(e=>{const t=e.codeEditor;e.currentPassword&&e.newPassword?u({password:e.newPassword,old_password:e.currentPassword}):u({first_name:e.firstName,last_name:e.lastName,email:e.email,locale:e.language,autosaves:e.autosaves,hide_mergetags:e.hideMergetags,theme:e.theme,newsletter_consent:e.newsLetterConsent,code_editor:t?{font_size:t.fontSize,font_family:t.fontFamily,tab_size:t.tabSize,word_wrap:t.wordWrap,minimap:t.minimap,insert_spaces:t.insertSpaces}:null})})};(0,o.useEffect)(()=>{p.isError&&r.error(p)},[p]),(0,o.useEffect)(()=>{p.isSuccess&&(r.success(t("Your profile was successfully updated.")),s((0,L.Oo)()))},[s,p,t]);const[I,M]=(0,o.useState)("");(0,o.useEffect)(()=>{const t=window.localStorage.getItem(W.V0.em_color_scheme);e&&(d.setFieldsValue({theme:null!==t?t:W.IJ}),M(null!==t?t:W.IJ))},[d,e]);const D=(0,o.useCallback)(e=>{let t;if((0,oe.Hk)(e),e===W.IJ){const e=matchMedia(W.F3).matches?W.nd:W.T;localStorage.removeItem(W.V0.em_color_scheme),t=e}else localStorage.setItem(W.V0.em_color_scheme,e),t=e;s((0,te.eX)(t===W.nd?`vs-${t}`:W.T)),(0,oe.A5)(t)},[s]),j=(0,o.useCallback)(()=>{I!==d.getFieldValue("theme")&&D(I),s((0,P.ww)(l.code_editor)),s((0,P.ko)(B)),s((0,L.Oo)())},[l.code_editor,s,d,I,D,B]),z="true"===localStorage.getItem("elama_user");let ie=[{label:o.createElement(o.Fragment,null,o.createElement(K.v,{size:18,strokeWidth:c.iconStrokeWidth}),t("Profile")),key:ne,className:"em-analytics__profile-user",children:o.createElement(o.Fragment,null,o.createElement(U.A,{gutter:16},o.createElement(q.A,{span:12},o.createElement(G.A.Item,{label:t("First name"),name:"firstName"},o.createElement(X.A,{placeholder:t("Enter your first name")}))),o.createElement(q.A,{span:12},o.createElement(G.A.Item,{label:t("Last name"),name:"lastName"},o.createElement(X.A,{placeholder:t("Enter your last name")})))),o.createElement(U.A,{gutter:16},o.createElement(q.A,{span:12},o.createElement(G.A.Item,{label:t("Email"),name:"email"},o.createElement(X.A,{disabled:!0,placeholder:t("Enter your email")}))),o.createElement(q.A,{span:12},o.createElement(G.A.Item,{label:t("Theme"),name:"theme"},o.createElement(H.A,{placeholder:t("Select a theme")},E.map(e=>{let l="";switch(e.value){case"light":l=t("Light");break;case"dark":l=t("Dark");break;default:l=t("System")}return o.createElement(re,{key:e.value,value:e.value},l)}))))),o.createElement(U.A,{gutter:16},o.createElement(q.A,{span:12},o.createElement(G.A.Item,{label:t("Newsletter Subscription"),valuePropName:"checked",name:["newsLetterConsent"]},o.createElement($.A,null))),o.createElement(q.A,{span:12},o.createElement(G.A.Item,{label:t("Autosave in editor"),valuePropName:"checked",name:["autosaves"]},o.createElement($.A,null)))))},{label:o.createElement(o.Fragment,null,o.createElement(Q.A,{size:18,strokeWidth:c.iconStrokeWidth}),t("Code editor")),key:"editor",className:"account-settings-codeiditor-tab-content em-analytics__profile-code-editor",children:o.createElement(o.Fragment,null,o.createElement(U.A,{gutter:16},o.createElement(q.A,{span:8},o.createElement(G.A.Item,{label:t("Font size"),name:["codeEditor","fontSize"]},o.createElement(le.A,{min:6,max:100}))),o.createElement(q.A,{span:8},o.createElement(G.A.Item,{label:t("Tab size"),name:["codeEditor","tabSize"]},o.createElement(le.A,{min:1,max:10}))),o.createElement(q.A,{span:8},o.createElement(G.A.Item,{label:t("Font family"),name:["codeEditor","fontFamily"]},o.createElement(H.A,{placeholder:t("Select a font family")},_.map(e=>o.createElement(re,{key:e.value,value:e.value},e.label)))))),o.createElement(U.A,{gutter:16},o.createElement(q.A,{span:8},o.createElement(G.A.Item,{label:t("Line wrap"),valuePropName:"checked",name:["codeEditor","wordWrap"],tooltip:{title:R,icon:o.createElement(J.d,{size:16})}},o.createElement($.A,null))),o.createElement(q.A,{span:8},o.createElement(G.A.Item,{label:t("Minimap"),valuePropName:"checked",name:["codeEditor","minimap"],tooltip:{title:t("Display the minimap."),icon:o.createElement(J.d,{size:16})}},o.createElement($.A,null))),o.createElement(q.A,{span:8},o.createElement(G.A.Item,{label:t("Insert spaces"),valuePropName:"checked",name:["codeEditor","insertSpaces"],tooltip:{title:t("Prefer spaces over tabs."),icon:o.createElement(J.d,{size:16})}},o.createElement($.A,null)))))}];return z||ie.push({label:o.createElement(o.Fragment,null,o.createElement(ee.L,{size:18,strokeWidth:c.iconStrokeWidth}),t("Security")),key:"security",className:"account-settings-security-tab-content em-analytics__profile-code-editor",children:o.createElement(o.Fragment,null,o.createElement(U.A,{gutter:16},o.createElement(q.A,{span:12},o.createElement(G.A.Item,{label:t("Current password"),name:"currentPassword"},o.createElement(X.A.Password,{readOnly:!w.currentPassword,onFocus:()=>C(e=>({...e,currentPassword:!0})),ref:T,placeholder:t("Enter your current password")})))),o.createElement(U.A,{gutter:16},o.createElement(q.A,{span:12},o.createElement(G.A.Item,{label:t("New password"),name:"newPassword",extra:t("At least 8 characters, including a combination of uppercase and lowercase letters, numbers, and special characters."),validateTrigger:["onSubmit"],rules:[{required:!1,message:t("Enter your new password")},({getFieldValue:e})=>({validator(l,o){if("security"===S){return e("currentPassword")?o.length>=8&&/[0-9]/.test(o)&&/[a-z]/.test(o)&&/[A-Z]/.test(o)&&/\W+|_/g.test(o)?Promise.resolve():Promise.reject(new Error(t("The password is too simple."))):Promise.reject(new Error("Enter your current password"))}return Promise.resolve()}})]},o.createElement(X.A.Password,{readOnly:!w.newPassword,onFocus:()=>C(e=>({...e,newPassword:!0})),placeholder:t("Enter your new password")}))),o.createElement(q.A,{span:12},o.createElement(G.A.Item,{label:t("Confirmation"),name:"confirmPassword",validateTrigger:["onSubmit"],rules:[{required:"security"===S,message:t("Repeat the new password")},({getFieldValue:e})=>({validator:(l,o)=>o&&e("newPassword")!==o?Promise.reject(new Error(t("The two passwords that you entered do not match!"))):Promise.resolve()})]},o.createElement(X.A.Password,{readOnly:!w.confirmPassword,onFocus:()=>C(e=>({...e,confirmPassword:!0})),placeholder:t("Repeat the new password")})))))}),o.createElement(Z.A,{width:572,className:"account-settings blocks-modal",title:o.createElement("div",null,o.createElement(y.h,{size:20,strokeWidth:2})," ",t("Account settings")),open:e,onOk:N,onCancel:j,centered:!0,footer:[o.createElement(g.Ay,{key:"Update",size:"large",className:"em-analytics__profile-save",type:"primary",loading:p.isLoading,onClick:N},t("Update"))]},o.createElement(G.A,{form:d,layout:"vertical",name:"edit_profile_form",onFinish:N,initialValues:{remember:!1,firstName:"",lastName:"",email:"",theme:"system",currentPassword:"",newPassword:"",confirmPassword:"",autosaves:!1,email_builder_config:"simple",hideMergetags:!0,newsLetterConsent:!1,code_editor:{fontSize:10,fontFamily:"Anonymous Pro",tabSize:2,wordWrap:!0,minimap:!1,insertSpaces:!1}},onValuesChange:e=>{e.theme&&D(e.theme);const t=e.codeEditor;e.language&&s((0,P.ko)(e.language)),e.codeEditor&&s((0,P.ww)({font_size:t.fontSize,font_family:t.fontFamily,tab_size:t.tabSize,word_wrap:t.wordWrap,minimap:t.minimap,insert_spaces:t.insertSpaces}))},autoComplete:"off"},o.createElement(Y.A,{activeKey:S,onChange:e=>k(e),items:ie,className:"modal-tabs"})))};var se=l(62913),de=l(13785),ce=l(8807);const me=()=>{var e;const{__:t}=(0,f.s9)(),l=(0,m.wA)(),{projectId:r}=(0,a.g)(),n=(0,m.d4)(I.yN),[i]=(0,O.b9)(),[s,d]=(0,o.useState)(null===(e=window)||void 0===e?void 0:e.localStorage.getItem(W.V0.em_color_scheme)),c=(0,ae.XW)(),u=((0,V.rD)(),(0,D.u)()),p=(0,o.useCallback)((e=null)=>{const t=e;(e=>{let t,o;if((0,oe.Hk)(e),null===e){const e=matchMedia(W.F3).matches?W.nd:W.T;localStorage.removeItem(W.V0.em_color_scheme),t=e,o="auto"}else localStorage.setItem(W.V0.em_color_scheme,e),t=e,o=e;l((0,te.eX)(t===W.nd?`vs-${t}`:W.T)),(0,oe.A5)(t),c({operation:W.Ru.UPDATE_PREVIEW,theme:t}),i({theme:e}),u({event:"change",action:"change_theme",theme_name:o,project_id:(null===n||void 0===n?void 0:n.id)||r})})(t),d(t)},[l,i,c,u,null===n||void 0===n?void 0:n.id,r]);return(0,o.useEffect)(()=>{matchMedia(W.F3).onchange=()=>p()},[p]),o.createElement("div",{onClick:e=>e.stopPropagation()},o.createElement(se.A,{className:"theme-switcher",style:{cursor:"pointer",color:"var(--colorText)"},value:s,options:[{label:o.createElement(de.A,{title:t("Light theme")},o.createElement(ce.A,{icon:"LightMode",size:18,strokeWidth:1.8})),value:W.T},{label:o.createElement(de.A,{title:t("System theme")},o.createElement(ce.A,{icon:"AutoMode",size:18,strokeWidth:1.8})),value:null},{label:o.createElement(de.A,{title:t("Dark theme")},o.createElement(ce.A,{icon:"DarkMode",size:16,strokeWidth:1.8})),value:W.nd}],onChange:e=>p(e)}))};var ue=l(705),pe=l(22536),ge=l(12741);const he=()=>{const e=(0,M.p)(),t=(0,m.wA)(),l=(0,m.d4)(ge.$S);let r=(0,a.zy)();(0,o.useEffect)(()=>{r.pathname.endsWith("/new")||(e.remove(W.A9.em_new_email),e.remove(W.A9.em_template_email),l&&t((0,ge.Et)()))},[r,l,t,e])};var be=l(39206);const fe=()=>{const e=(0,m.wA)(),t=(0,M.p)(),l=(0,m.d4)(be.Sl);let r=(0,a.zy)();(0,o.useEffect)(()=>{r.pathname.endsWith("/new")||l&&(e((0,be.X8)()),t.remove(W.A9.em_new_block))},[r,l,e,t])};var Ee=l(98845);const ve=()=>{const e=(0,m.wA)(),t=(0,m.d4)(te.zn);let l=(0,a.zy)();(0,o.useEffect)(()=>{/emails\/[0-9]+$/.test(l.pathname)||t&&e(Ee.GY.util.invalidateTags([{type:"Emails",id:+t}]))},[l,e,t])};var _e=l(86095),ye=l(90121),Ae=l(13668);const{Sider:Se}=r.A,{useToken:ke}=n.A,we=()=>{const{token:e}=ke();let t=(0,a.zy)();const l=(0,m.wA)(),n=(0,a.Zp)(),{emailId:u,blockId:g,projectId:h}=(0,a.g)(),b=(0,m.d4)(P.C1),f=(0,m.d4)(L.cL),E=(0,o.useRef)(),v=(0,D.u)(),[_]=((0,V.rD)(),(0,ue.bw)()),y=(0,i.hN)();E.current||(E.current=(0,_e.$Z)()),(0,o.useEffect)(()=>{(0,oe.FN)(e)},[e]);const{data:A=[],isSuccess:S}=(0,ue.I9)(b.id,{pollingInterval:3e4,skip:f});(0,o.useEffect)(()=>{const e=A.filter(e=>""===e.seen||null===e.seen);setTimeout(()=>{e.length&&S&&e.forEach(e=>{var t,l;"subscription_payment"===e.event&&v({event:"payment",data:e.data}),y[e.type]({message:(null===(t=e.title)||void 0===t?void 0:t.rendered)||e.title||"",description:(null===(l=e.content)||void 0===l?void 0:l.rendered)||""});const o=(new Date).toLocaleString();_({id:e.id,datetime:o}).unwrap()})},5e3)},[S,_,A,y]),he(),fe(),ve(),(0,o.useEffect)(()=>{g||l((0,pe.nJ)()),u||l((0,te.ss)())},[g,u,l,t.pathname]);let k=null;u||g||t.pathname.endsWith("/new")?k=E.current:E.current&&E.current.getValue()&&setTimeout(()=>E.current.setValue(""),1e3);const w=JSON.parse(localStorage.getItem(W.V0.em_menu_is_locked)),[C,B]=(0,o.useState)((null===w||void 0===w?void 0:w.isLocked)||!1),[x,T]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{const e=()=>localStorage.setItem(W.V0.em_menu_is_locked,JSON.stringify({isLocked:C}));return e(),e()},[C]),(0,ye.D3)(Ae._1,(0,o.useCallback)(e=>{const t=(0,V.Mu)(e);n(t)},[n])),o.createElement("div",{className:"main"},o.createElement(_e.kx.Provider,{value:k},o.createElement("div",{className:"main__pane main__pane_main"},o.createElement("div",{className:"main__pane-content",id:"pane-content-iframe"},o.createElement(r.A,{className:"main__pane-layout",hasSider:!0},!W.EW.isPlugin&&o.createElement(Se,{theme:"light",style:{borderColor:e.colorBorder,position:"fixed",overflow:"hidden"},collapsible:!0,collapsed:!C&&x,defaultCollapsed:!0,reverseArrow:!C&&!x||C&&!x,trigger:o.createElement("div",{className:"main__pane-trigger"},C?o.createElement(c.A,{style:{fontSize:18}}):o.createElement(o.Fragment,null,o.createElement(s.A,{style:{fontSize:18}}),o.createElement(d.A,{style:{fontSize:18}})),o.createElement(me,null)),className:p()("main__menu",{main__menu_lock:C}),width:260,collapsedWidth:80,zeroWidthTriggerStyle:{},onCollapse:(e,t)=>{const l=!C;e?!C&&T(!0):T(!e),B(l),v({event:"toggle",action:"toggle_side_panel_lock",is_locked:l,project_id:h,location:"left_menu"})},onMouseEnter:()=>!C&&T(!1),onMouseLeave:()=>!C&&T(!0)},o.createElement(j,{isMenuCollapsed:x,setIsMenuCollapsed:T,isLocked:C})),o.createElement(z.A,{isModalVisible:f===W.lx.EDIT_PROJECT_MODAL}),o.createElement(ie,{isModalVisible:f===W.lx.EDIT_PROFILE_MODAL}),o.createElement(a.sv,null))))))}},48956:(e,t,l)=>{"use strict";l.d(t,{A:()=>m});var o=l(98173),a=l(48753),r=l(82021),n=l(37969),i=l(12543),s=l(30150),d=l(89613),c=l(98173);const m=({open:e,sideOnOk:t,onCancel:l,initialSlide:m=0})=>{const{__:u}=(0,i.s9)(),p=(0,s.Zp)(),[g,h]=(0,o.useState)(m),b=(0,o.useRef)(null),f=(0,d.u)();(0,o.useEffect)(()=>{e&&b.current&&(b.current.goTo(m,!0),h(m))},[e,m]);const E=(0,o.useMemo)(()=>[{image:u("https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png"),backgroundColor:"var(--blue-2)",title:u("More editing features"),description:u("Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.")},{image:u("https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png"),backgroundColor:"var(--purple-2)",title:u("Work with the HTML code"),description:u("Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions \u2014 you can create templates of any complexity!")},{image:u("https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png"),backgroundColor:"var(--cyan-2)",title:u("AI image generation"),description:u("Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.")},{image:u("https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png"),backgroundColor:"var(--green-2)",title:u("Stock photos and GIFs"),description:u("Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.")},{image:u("https://cdn.useblocks.io/1351/241017_18_NDYloAO.png"),backgroundColor:"var(--magenta-2)",title:u("Version history"),description:u("Check who and when made changes to the email template and, if necessary, restore one of the previous versions.")},{image:u("https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png"),backgroundColor:"var(--red-2)",title:u("Image editor"),description:u("Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.")},{image:u("https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png"),backgroundColor:"var(--orange-2)",title:u("Email optimization"),description:u("Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.")},{image:u("https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png"),backgroundColor:"var(--volcano-2)",title:u("Team collaboration"),description:u("Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.")},{image:u("https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png"),backgroundColor:"var(--geekblue-2)",title:u("Email testing"),description:u("Check how your email appears across various devices and email clients.")},{image:u("https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png"),backgroundColor:"var(--geekblue-2)",title:u("AI assistant"),description:u("Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!")}],[u]);return(0,o.useEffect)(()=>{if(e&&b.current){b.current.goTo(m,!0),h(m);const e=E[m];f({event:"open_modal",action:"open_premium-features_modal",modal_id:"premium-features",offer_id:e.title})}},[e,E,m,f]),c.createElement(a.A,{open:e,footer:null,onCancel:l,centered:!0,closable:!1,className:"premium-features-modal",classNames:{mask:"premium-features-modal-mask"},styles:{mask:{background:"rgba(0, 0, 0, 0.65)"}},width:1100,style:{maxWidth:"80%"}},c.createElement(r.A,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:"carousel-slider",draggable:!0,autoplaySpeed:5e3,initialSlide:g,ref:b},E.map((e,t)=>c.createElement("div",{key:t},c.createElement("div",{className:"carousel-slide",style:{background:`${e.backgroundColor}`}},c.createElement("div",{className:"slide-item-image"},c.createElement("img",{src:e.image,alt:`slide-${t}`})),c.createElement("div",{className:"slide-item-content"},c.createElement("h3",{className:"slide-title"},e.title),c.createElement("p",{className:"slide-description"},e.description)))))),c.createElement("div",{className:"modal-subtitle"},u("This and other features are available for you on any paid plan.")),c.createElement("div",{className:"modal-buttons"},c.createElement(n.Ay,{size:"large",onClick:()=>l(!1)},u("Cancel")),c.createElement(n.Ay,{type:"primary",size:"large",onClick:()=>{t&&t(),p("/billing"),l(!1)},style:{padding:"0 30px"}},u("Select plan"))))}},50209:(e,t,l)=>{"use strict";l.d(t,{A:()=>M});var o=l(98173),a=l(30150),r=l(79245),n=l(40120),i=l(10423),s=l(59010),d=l(49856),c=l(67034),m=l(38927),u=l(37969),p=l(83612),g=l(2604),h=l(85591),b=l.n(h),f=l(52218),E=l.n(f),v=l(68984),_=l(98845),y=l(47014),A=l(45271),S=l(80223),k=l(40277),w=l(12543),C=l(27941),B=l(32947),x=l(90189),T=l(24766),R=l(5233),N=l(51294),L=l(52468),I=l(19056),P=l(70549),O=l(7936);const{useToken:F}=n.A,M=({element:e,setSearchFilters:t=()=>{},isTrash:l=!1,foldersList:n,projectTags:h=[],foldersHandlers:f={}})=>{var M,D,V,W,j,z,H,G,U,q,X,$,Z,Y,K;const{__:Q}=(0,w.s9)();let J=(0,a.zy)();const{projectId:ee}=(0,a.g)(),{owner:te,admin:le}=(0,S.A)(),oe=(0,g.d4)(y.C1),ae=(0,o.useRef)(null),{token:re}=F(),{handleRecover:ne,handleClone:ie,handlerChangeFolder:se,handleRemove:de}=f,ce=(0,C.rD)(),me=e.hasOwnProperty("type")?B.IE:B.Tm,ue=me===B.Tm?B.zh:B.YY,pe=me===B.Tm?Q("New emails"):Q("New blocks"),ge=(e,t)=>`${e.pathname}/${t.id}`,[he]=(0,v.pP)(),[be]=(0,_.Kh)(),fe=(e,t=ee,l)=>{let o=window.location.host.indexOf("localhost")>=0?"app.emailmaker.ru":`${window.location.host}`;const a=l?`&cacheControl=true&cache-hash=${E()(l)}`:"";return`https://scr.emcdn.ru/screenshot?${"block"===me?"":"minHeight=620&"}delay=1000&width=800&fullPage=true&deviceScaleFactor=0.755&format=jpg&force=false${a}&url=${encodeURIComponent(`https://${o}/get${me}/${e}?secret_hash=${E()(`${t}${e}${B.KI}`)}&raw=true`)}`},Ee=(null===(M=e[me===B.IE?"blockfolder":"folder"])||void 0===M?void 0:M[0])||null,ve={icon:o.createElement(x.M,{size:18,strokeWidth:ce.iconStrokeWidth}),label:pe,key:B.y2,onClick:t=>se(t,e)},_e=null===n||void 0===n?void 0:n.map(t=>({icon:o.createElement(T.v,{size:16,strokeWidth:ce.iconStrokeWidth}),label:t.name,key:t.id,className:t.id,onClick:t=>se(t,e)})),ye=(null===_e||void 0===_e?void 0:_e.filter(e=>!Ee||e.key!==Ee))||[];Ee&&(null===ye||void 0===ye||ye.unshift(ve));let Ae=[];return(te||le||(null===(D=oe.id)||void 0===D?void 0:D.toString())===(null===(V=e.author)||void 0===V?void 0:V.toString()))&&!l&&Ae.push({label:o.createElement(A.A,{key:"Lock",element:e}),icon:e.lock?o.createElement(R.k,{size:16,strokeWidth:ce.iconStrokeWidth}):o.createElement(N.R,{size:16,strokeWidth:ce.iconStrokeWidth})}),(te||le||(null===(W=oe.id)||void 0===W?void 0:W.toString())===(null===(j=e.author)||void 0===j?void 0:j.toString()))&&!l&&ye.length>0&&Ae.push({label:Q("Transfer to folder"),icon:o.createElement(T.v,{size:16,strokeWidth:ce.iconStrokeWidth}),children:ye}),!l&&Ae.push({label:Q("Clone"),icon:o.createElement(L.N,{size:16,strokeWidth:ce.iconStrokeWidth}),key:"Clone",className:me===B.IE?"em-analytics__block-clone":"em-analytics__email-clone",disabled:me===B.IE?he.isLoading:be.isLoading,onClick:()=>ie(e)}),(te||le||(null===(z=oe.id)||void 0===z?void 0:z.toString())===(null===(H=e.author)||void 0===H?void 0:H.toString()))&&l&&Ae.push({label:Q("Recover"),icon:o.createElement(I.n,{size:16,strokeWidth:ce.iconStrokeWidth}),key:"Recover",onClick:()=>ne(e)}),(te||le||(null===(G=oe.id)||void 0===G?void 0:G.toString())===(null===(U=e.author)||void 0===U?void 0:U.toString()))&&Ae.push({label:Q("Remove"),icon:o.createElement(P._,{size:16,strokeWidth:ce.iconStrokeWidth}),key:"Remove",style:{color:"#ff4d4f"},className:me===B.IE?"em-analytics__block-remove":"em-analytics__email-remove",onClick:()=>de(e)}),o.createElement(i.A,{className:`element-card element-card_${me}`,hoverable:!0,"data-testid":e.id,cover:o.createElement(o.Fragment,null,o.createElement(s.A,{loading:"true",active:!0,avatar:!0,style:{position:"absolute",width:"83%",margin:"50px 10% 0 7%"}}),o.createElement(r.N_,{ref:ae,className:"element-card__img-wrapper",to:l?"":ge(J,e),onMouseMove:e=>(0,k.Hy)(e,ae.current),style:{cursor:l?"default":"pointer"},onMouseLeave:k.Tr},fe(e.id,e.project,e.modified)&&o.createElement("img",{className:"element-card__img",alt:e.title,src:fe(e.id,e.project,e.modified)})),(e.is_template||(null===(q=e.acf)||void 0===q?void 0:q.is_template))&&o.createElement("div",{className:"element-card__is-template-wrapper"},Q("Template")),(null===(X=e[ue])||void 0===X?void 0:X.length)&&o.createElement("div",{className:"element-card__tags-wrapper"},o.createElement(d.A,{wrap:!0,size:8},e[ue].map(e=>{const l=null===h||void 0===h?void 0:h.find(t=>{var l;return(null===(l=t.id)||void 0===l?void 0:l.toString())===(null===e||void 0===e?void 0:e.toString())});return l&&o.createElement(c.A,{color:re.colorPrimary,style:{borderRadius:6},key:l.id,onClick:()=>t(null,l.id)},l.name)}))))},o.createElement("div",{className:"ant-card-body__left"},o.createElement(r.N_,{to:l?"":ge(J,e),style:{cursor:l?"default":"pointer"}},o.createElement("span",{className:"element-card__title"},e.lock&&o.createElement(N.R,{size:16,strokeWidth:ce.iconStrokeWidth,className:b()("lock-icon",{"lock-icon__disabled":!(te||le||(null===($=oe.id)||void 0===$?void 0:$.toString())===(null===(Z=e.author)||void 0===Z?void 0:Z.toString()))})}),(null===(Y=e.title)||void 0===Y?void 0:Y.trim())||(null===(K=e.subject)||void 0===K?void 0:K.trim()))),o.createElement("p",{className:"element-card__date"},Q("Last update: ")," ",(0,k.Yq)((0,p.A)(e.modified),Q))),o.createElement("div",{className:"ant-card-body__right"},o.createElement(m.A,{menu:{items:Ae},arrow:"true",placement:"bottom",trigger:["hover"]},o.createElement(u.Ay,{type:"default",className:"element-card_menu",onClick:()=>{}},o.createElement(O.t,{size:16,strokeWidth:ce.iconStrokeWidth,key:"menu-button"})))))}},50664:e=>{e.exports='\n<style>\n\t@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {\n\t\t.em-mob-width-100perc {\n\t\t\twidth: 100% !important;\n\t\t\tmax-width: 100% !important;\n\t\t}\n\n\t\t.em-mob-width-91perc {\n\t\t\twidth: 91% !important;\n\t\t\tmax-width: 91% !important;\n\t\t}\n\t}\n</style>\n<tr em="block" class="em-structure">\n\t<td align="center">\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>\n\t\t<![endif]--\x3e\n\t\t<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">\n\t\t\t<tr>\n\t\t\t\t<td align="center" valign="top">\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t<table border="0" cellspacing="0" cellpadding="0">\n\t\t\t\t\t<tr><td width="413" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 413px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="393" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]></td><td width="207" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t</table><![endif]--\x3e\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t</td></tr></table>\n\t\t<![endif]--\x3e\n\t</td>\n</tr>\n\n'},50861:(e,t,l)=>{"use strict";l.d(t,{p:()=>a});var o=l(80148);function a(e){return(t,l,a,r)=>{const n=(0,o.My)(l);return e(n)(t,l,a,r)}}},51213:(e,t,l)=>{"use strict";function o(e){return class extends e{constructor(...t){super(...t);const l=Object.getOwnPropertyNames(e.prototype);for(const o of l){const t=Object.getOwnPropertyDescriptor(e.prototype,o);"constructor"!==o&&"function"===typeof(null===t||void 0===t?void 0:t.value)&&this[o]&&(this[o]=this[o].bind(this))}}}}l.d(t,{A:()=>o})},52919:(e,t,l)=>{"use strict";l.d(t,{K9:()=>u,QC:()=>c,XW:()=>m,ur:()=>d});var o=l(35306),a=l(3792),r=l(2604),n=l(88296),i=l(98173);const s=(0,n.Q)("MESSAGE_SERVICE");function d(){const e=c();return(0,i.useCallback)(t=>{e.setTarget(t instanceof Element?t.contentWindow:t)},[e])}function c(){const e=(0,r.Pj)();return(0,i.useMemo)(()=>function(e){return a.di.getOrCreateInstance(e,s,()=>new o.bg)}(e),[e])}function m(){const e=c();return(0,i.useCallback)(function(t){e.send(t)},[e])}function u(){const e=c();return(0,i.useCallback)(function(t,l){e.send(t,l)},[e])}},52995:(e,t,l)=>{"use strict";l.d(t,{A:()=>T});var o=l(98173),a=l(2604),r=l(30150),n=l(94780),i=l(8807),s=l(37969),d=l(69550),c=l(8218),m=l(48753),u=l(49823),p=l(67034),g=l(40120),h=l(5558),b=l(23424),f=l(47014),E=l(84572),v=l(65716),_=l(40835),y=l(12543),A=l(40277),S=l(27941),k=l(32947),w=l(86095),C=l(90614),B=l(15626);const{useToken:x}=g.A,T=({isModalVisible:e=!1,email:t=null})=>{const{__:l}=(0,y.s9)(),[g]=d.A.useForm(),T=(0,a.wA)(),{emailId:R}=(0,r.g)(),N=(0,h.hN)(),L=(0,a.d4)(f.C1),I=(0,a.d4)(E.Rz),[P,O]=(0,_.lg)(),{token:F}=x(),M=(0,a.Pj)(),[D,V]=(0,o.useState)(!1),W=((0,S.rD)(),t.project),[j,z]=(0,v.OD)(),{data:H}=v.Nq.endpoints.getProject.select(+W)(M.getState()),{testEmails:G}=(0,S.rD)(),[U,q]=(0,o.useState)([]),[X,$]=(0,o.useState)(!1),Z=(0,C.ml)(B.AZ.ON_SEND_EMAIL_MODAL_ID);(0,o.useEffect)(()=>{k.EW.isPlugin&&e?Z.fire(t).then(t=>{t.some(e=>!1===e)?T((0,b.Oo)()):V(e)}):V(e)},[e,T,V,t,Z]),(0,o.useEffect)(()=>{if(H&&!k.EW.isPlugin){const{owner:e,admins:t,users:l,invited_users:o}=H.members;let a=[];const r=localStorage.getItem(k.V0.em_test_emails)?JSON.parse(localStorage.getItem(k.V0.em_test_emails)):[];if(r.length&&r[W]&&r[W].map(({prevLSEmail:e})=>a.push(e)),o&&o.map(({invited_user_email:e})=>a.push(e)),l&&l.map(({user_email:e})=>a.push(e)),e&&a.push(e.user_email),t&&t.map(({user_email:e})=>a.push(e)),H.projects_test_emails){const e=H.projects_test_emails.map(({projects_test_email:e})=>e);a.push(...e)}const n=Array.from(new Set(a));a.length&&q(n.map(e=>({value:e})))}},[H,W]),(0,o.useEffect)(()=>{k.EW.isPlugin&&q(G.map(e=>({value:e})))},[G]),(0,o.useEffect)(()=>{var e;const t=localStorage.getItem(k.V0.em_test_emails);if(t&&D&&0===(null===(e=g.getFieldValue("recipients"))||void 0===e?void 0:e.length)){const e=JSON.parse(t);null!==e&&void 0!==e&&e[W]&&g.setFieldsValue({recipients:e[W]})}},[W,D,g]),(0,o.useEffect)(()=>{g.setFieldsValue({subject:t.subject})},[g,t.subject]);const Y=(0,w.fn)();return(0,o.useEffect)(()=>{if(O.isSuccess&&X){var e;if(200!==(null===(e=O.data)||void 0===e?void 0:e.status)){var o,a;N.error({error:{data:{code:null===(o=O.data)||void 0===o?void 0:o.code,message:null===(a=O.data)||void 0===a?void 0:a.message}}})}else{const e=[...new Set([...U.map(e=>e.value),...g.getFieldValue("recipients")])].map(e=>({projects_test_email:e})),o=(e,t)=>{if(!e||!t)return e===t;if(e.length!==t.length)return!1;const l=e.map(e=>e.projects_test_email).sort(),o=t.map(e=>e.projects_test_email).sort();return l.every((e,t)=>e===o[t])};o(e,I)||j({projectId:W,projects_test_emails:e});const a=localStorage.getItem(k.V0.em_test_emails)?JSON.parse(localStorage.getItem(k.V0.em_test_emails)):[];let r=g.getFieldValue("recipients");localStorage.setItem(k.V0.em_test_emails,JSON.stringify({...a,[W]:[...new Set(r)]})),N.success(l("The email \u201c")+t.title+l("\u201d was successfully sent."))}$(!1),g.resetFields(),T((0,b.Oo)())}},[I,O,g,W,j,U,X,T,t.title,z,l]),(0,o.useEffect)(()=>{z.isError&&(N.error(z),$(!1),g.resetFields(),T((0,b.Oo)()))},[T,z,g]),(0,o.useEffect)(()=>{g.setFieldsValue({subject:t.subject||t.title})},[t,g]),o.createElement(m.A,{width:572,title:o.createElement("div",{style:{paddingBottom:8}},o.createElement(i.A,{icon:"SendOutlined",size:20,strokeWidth:2})," ",l("Send a test email")),className:"blocks-modal",open:D,onCancel:()=>{T((0,b.Oo)()),g.resetFields()},centered:!0,footer:[o.createElement(s.Ay,{key:"submit",size:"large",className:"em-analytics__email-send-test",type:"primary",htmlType:"submit",form:"Send mail",loading:z.isLoading,icon:o.createElement(i.A,{icon:"SendOutlined",size:18,strokeWidth:2,className:"email-preview-menu__list-item-icon"}),onClick:()=>{g.validateFields().then(()=>{const e={user_id:L.id,project_id:W,email_id:R,subject:g.getFieldValue("subject"),email:g.getFieldValue("recipients").join(","),html:(t=(null===Y||void 0===Y?void 0:Y.getValue())||"",t.replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[/]/g,"\\/").replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"))};var t;P(e),$(!0)}).catch(e=>{})},disabled:O.isLoading},l("Send"))],forceRender:!0},o.createElement(d.A,{form:g,layout:"vertical",name:"send_mail_form",initialValues:{subject:t.subject||t.title,recipients:[]},autoComplete:"off"},o.createElement(d.A.Item,{label:l("Subject"),name:"subject",rules:[{required:!1,message:l("Please type subject")}]},o.createElement(c.A,{size:"large",placeholder:l("Type subject")})),o.createElement(d.A.Item,{label:l("Recipients"),name:"recipients",tooltip:{title:l("The test email will be sent to the specified addresses."),icon:o.createElement(n.A,null)},rules:[{required:!0,validator:(e,t)=>t.length>10?Promise.reject(new Error(l("A test email can be sent to a maximum of 10 addresses."))):0!==t.length?t.every(e=>A.au.test(e.toLowerCase()))?Promise.resolve():Promise.reject(new Error(l("Please type correct emails"))):Promise.reject(new Error(l("Please type emails")))}]},o.createElement(u.A,{size:"large",mode:"tags",placeholder:l("Add up to 10 recipients"),tooltip:{title:"Tooltip with customize icon",icon:o.createElement(n.A,null)},options:U,tagRender:e=>{const{label:t,closable:l,onClose:a}=e;return o.createElement(p.A,{color:F.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:l,onClose:a,style:{borderRadius:6}},t)},getPopupContainer:()=>document.getElementById("send_mail_form")}))))}},53774:(e,t,l)=>{"use strict";l.d(t,{$:()=>a});const o={pro:{config:{mode:"pro",autosaveTimeout:1e4,theme:"",themes:{},mergeTagsShow:!0,styles:"",revisionService:!1,headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,webversionEnabled:!0,commonStylesEnabled:!0,emailResponsiveControlEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuImportButton:!1,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportTextEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!0,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,lockPreheaderAndTitle:!1,disableSideMenu:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!0,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!0,formFieldBorderRadiusEnabled:!0,formFieldBoxShadowEnabled:!0,formFieldVisibilityEnabled:!0,formFieldExportAsPictureEnabled:!0,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formButtonFieldReplacerEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formCellFieldSizeEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!0,formImageFieldReplacerEnabled:!0,formImageFieldHeightEnabled:!0,formTextFieldTypografEnabled:!0,formTextFieldReplacerEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!0,elementCarouselEnabled:!0,elementAccordionEnabled:!0,elementFormEnabled:!0,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterFileManagerView:!1,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!0,formFieldAmpVisibilityEnabled:!0,testEmails:[],pushToGTM:!0,activeNextButton:!0,iconStrokeWidth:1.4,fileManager:{defaultFolderName:"",enableMoveFolder:!0,enableEdit:!0,enableTrash:!0}},project:void 0,page:{isNew:!0,type:"email",project:0,id:""}},editor:{config:{mode:"editor",autosaveTimeout:1e4,theme:"",themes:{},mergeTagsShow:!1,styles:"",headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!1,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!1,webversionEnabled:!1,commonStylesEnabled:!1,emailResponsiveControlEnabled:!1,emailDropdownMenuEnabled:!1,emailDropdownMenuClone:!0,emailDropdownMenuImport:!1,emailDropdownMenuImportButton:!1,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportTextEnabled:!1,exportZipEnabled:!0,exportClipboardEnabled:!1,exportWebHookEnabled:!1,exportOutlookEnabled:!0,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!1,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,lockPreheaderAndTitle:!1,disableSideMenu:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!1,aiAssistentEnabled:!1,optimizeEnabled:!1,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!1,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!1,tagsEnabled:!0,isTemplateEnabled:!1,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!1,deleteButtonEnabled:!0,toggleSidePanel:!1,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!1,formFieldImageTitleEnabled:!1,formFieldBorderEnabled:!1,formFieldBorderRadiusEnabled:!1,formFieldBoxShadowEnabled:!1,formFieldVisibilityEnabled:!1,formFieldExportAsPictureEnabled:!1,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!1,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!1,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!1,formButtonFieldReplacerEnabled:!1,formCellFieldVerticalAlignEnabled:!1,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formCellFieldSizeEnabled:!1,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!1,formImageFieldReplacerEnabled:!1,formImageFieldHeightEnabled:!1,formTextFieldTypografEnabled:!1,formTextFieldReplacerEnabled:!1,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!1,elementCarouselEnabled:!1,elementAccordionEnabled:!1,elementFormEnabled:!1,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterFileManagerView:!1,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!1,formFieldAmpVisibilityEnabled:!1,testEmails:[],pushToGTM:!0,activeNextButton:!0,iconStrokeWidth:1.4},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}},simple:{config:{mode:"simple",autosaveTimeout:1e4,theme:"",themes:{},mergeTagsShow:!1,styles:"",headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,webversionEnabled:!1,commonStylesEnabled:!1,emailResponsiveControlEnabled:!1,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuImportButton:!1,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportTextEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!1,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,lockPreheaderAndTitle:!1,disableSideMenu:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!1,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!1,formFieldBorderRadiusEnabled:!1,formFieldBoxShadowEnabled:!1,formFieldVisibilityEnabled:!1,formFieldExportAsPictureEnabled:!1,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formButtonFieldReplacerEnabled:!1,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formCellFieldSizeEnabled:!1,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!1,formImageFieldReplacerEnabled:!1,formImageFieldHeightEnabled:!1,formTextFieldTypografEnabled:!1,formTextFieldReplacerEnabled:!1,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!1,elementVideoEnabled:!1,elementAIimageEnabled:!0,elementAItextEnabled:!1,elementCarouselEnabled:!1,elementAccordionEnabled:!1,elementFormEnabled:!1,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterFileManagerView:!1,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!1,formFieldAmpVisibilityEnabled:!1,testEmails:[],pushToGTM:!0,activeNextButton:!0,iconStrokeWidth:1.4},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}},blocks:{config:{mode:"freeUserBlocks",autosaveTimeout:1e4,theme:"",themes:{},mergeTagsShow:!0,styles:"",revisionService:!1,headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,webversionEnabled:!0,commonStylesEnabled:!0,emailResponsiveControlEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportTextEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!0,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,lockPreheaderAndTitle:!1,disableSideMenu:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!0,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!0,formFieldBorderRadiusEnabled:!0,formFieldBoxShadowEnabled:!0,formFieldVisibilityEnabled:!0,formFieldExportAsPictureEnabled:!0,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formCellFieldSizeEnabled:!0,formButtonFieldReplacerEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!0,formImageFieldReplacerEnabled:!0,formImageFieldHeightEnabled:!0,formTextFieldTypografEnabled:!0,formTextFieldReplacerEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!0,elementCarouselEnabled:!0,elementAccordionEnabled:!0,elementFormEnabled:!0,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterFileManagerView:!1,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!0,formFieldAmpVisibilityEnabled:!0,testEmails:[],pushToGTM:!0,activeNextButton:!0,iconStrokeWidth:1.4},project:void 0,page:{isNew:!0,type:"email",project:0,id:""}}},a=e=>{const t=o[e];return t||o.editor}},54125:(e,t,l)=>{"use strict";l.d(t,{A:()=>a});var o=l(32947);const a=e=>{if(!o.EW.isPlugin){let t="";t="EmailMaker",document.title=e+" - "+t}}},54880:(e,t,l)=>{"use strict";l.d(t,{A:()=>D});var o=l(98173),a=l(40120),r=l(8218),n=l(5553),i=l(99291),s=l(38927),d=l(69550),c=l(49856),m=l(53361),u=l(37969),p=l(13785),g=l(76047),h=l(2604),b=l(85086),f=l(80703),E=l(38256),v=l(6969),_=l(40186),y=l(12543),A=l(32947),S=l(47014),k=l(62093),w=l(8807),C=l(5558),B=l(8111),x=l(98845),T=l(68984),R=l(52919),N=l(40277),L=l(86095),I=l(85591),P=l.n(I),O=l(27941);const{useToken:F}=a.A,{TextArea:M}=r.A,D=({comments:e,subjectId:t,isLoggedIn:l,projectTitle:a="",emailElementType:I,email:D})=>{const{__:V,_n:W}=(0,y.s9)(),j=(0,R.XW)(),z=(0,C.hN)(),{token:H}=F(),G=(0,O.rD)(),U=(0,o.useRef)(null),[q,X]=(0,o.useState)(""),[$,Z]=(0,o.useState)("ADD"),[Y,K]=(0,o.useState)(!1),[Q,J]=(0,o.useState)(null),[ee,te]=(0,o.useState)(null),[le,oe]=(0,o.useState)(""),[ae,re]=(0,o.useState)(""),[ne,ie]=(0,o.useState)(!1),[se,de]=(0,o.useState)(""),[ce,me]=(0,B.z2)(),[ue,pe]=(0,B.HI)(),[ge,he]=(0,B.kk)(),[be,fe]=(0,B.vn)(),[Ee]=(0,x.LX)(),[ve]=(0,T.yW)(),_e=(0,h.d4)(S.C1),ye=(0,L.fn)(),Ae=()=>{const e={title:null===D||void 0===D?void 0:D.title,emailId:null===D||void 0===D?void 0:D.id,project:null===D||void 0===D?void 0:D.project,html:null===ye||void 0===ye?void 0:ye.getValue(),excerpt:null===D||void 0===D?void 0:D.date_gmt};"email"===I?Ee({emailId:null===D||void 0===D?void 0:D.id,body:e}).catch(e=>{}):ve({blockId:null===D||void 0===D?void 0:D.id,body:e}).catch(e=>{})};function Se(e){te(Q),oe(""),Z("REPLY")}const ke=()=>{z.error({maskClosable:!0,centered:!0,title:V("Please log in"),content:V("To leave comments you must be logged into EmailMaker and added to the project ")+`${a}.`,okText:V("Okay. I'll log in.")})};async function we(){l?(await ge({commentId:ee,content:ae,targetId:se}).unwrap(),Z("ADD"),re(""),te(0),ie(!1),K(!1),de(""),j({operation:A.Ru.SANDBOX_DISCUSS_RESET})):ke()}const Ce=e=>{Z("ADD"),re(""),te(0),ie(!1),K(!1),de(""),j({operation:A.Ru.SANDBOX_DISCUSS_RESET})},Be=async()=>{l?((q||le)&&await ce({subjectId:t,author:_e.id,parent:"ADD"===$?"0":ee,content:q||le,author_name:_e.name,author_email:_e.email,targetId:se}).then(e=>{e.error&&z.error({message:e.error.data.code,description:e.error.data.message})}),de(""),Z("ADD"),oe(""),X(""),te(0),ie(!1),K(!1),j({operation:A.Ru.SANDBOX_DISCUSS_RESET})):ke()};function xe(){ne?(K(!1),ie(!1),j({operation:A.Ru.SANDBOX_DISCUSS_REMOVE_TARGET,value:se})):(K(!Y),j({operation:A.Ru.SANDBOX_DISCUSS_SET_TARGET,value:!Y}),Y&&ie(!1))}(0,k.A)(e=>{const t=e.data.operation;if(t===A.Ru.APPLICATION_DISCUSS_SET_ID&&(de(e.data.settings.value),""!==e.data.settings.value?(ie(!0),K(!1)):(ie(!1),K(!0))),t===A.Ru.APPLICATION_DISCUSS_SAVE_TARGET&&Ae(),t===A.Ru.APPLICATION_DISCUSS_GET_COMMENT)if(document.querySelector('.comment-icon-target[target-id="'+e.data.settings.targetId+'"]')){let t=document.querySelector('.comment-icon-target[target-id="'+e.data.settings.targetId+'"]').closest(".ant-comment");document.querySelector(".comment-block")?document.querySelector(".comment-block").scrollTo(0,t.offsetTop):document.querySelector(".em-analytics__email-tab-discuss .ant-tabs-content").scrollTo(0,t.offsetTop),t.classList.add("active"),setTimeout(()=>{t.classList.remove("active")},2e3)}else j({operation:A.Ru.SANDBOX_DISCUSS_REMOVE_TARGET,value:e.data.settings.targetId}),z.error({message:V("There's no such comment.")});t===A.Ru.APPLICATION_DISCUSS_NO_COMMENT&&z.error({message:V("There's no such element in the email.")})});const Te=e=>{j({operation:A.Ru.SANDBOX_DISCUSS_GET_TARGET,value:e})},Re=e=>(null===e||void 0===e||e.sort((e,t)=>e.date>t.date?1:-1),o.createElement(o.Fragment,null,e&&!!e.length&&o.createElement(n.A,{className:"comment-list",itemLayout:"horizontal",dataSource:e,renderItem:e=>o.createElement(o.Fragment,null,o.createElement("li",{id:e.id},o.createElement(o.Fragment,null,"deleted"===e.status&&e.clildren&&o.createElement(g.A,{className:"deletedComment",content:o.createElement(i.A,{description:V("Comment was removed."),type:"info"}),children:Re(e.children)}),"deleted"!==e.status&&o.createElement(o.Fragment,null,o.createElement(g.A,{author_id:e.author_id,author:e.author_name,avatar:e.author_avatar_urls&&e.author_avatar_urls[48]||"",className:P()(e.target_id&&"targetted-comment-item",(!e.author_avatar_urls||!e.author_avatar_urls[48])&&"comment-item-noavatar"),content:o.createElement(s.A,{key:"commenMenu",placement:"left",onOpenChange:()=>J(e.id),menu:{items:e.author===_e.id?Ie:Pe},overlayStyle:{minWidth:"auto",paddingRight:6}},o.createElement("div",{dangerouslySetInnerHTML:{__html:e.content}})),datetime:o.createElement(o.Fragment,null,o.createElement("span",{dangerouslySetInnerHTML:{__html:e.date&&(0,N.Yq)((0,N.Cl)(e.date),W,!0)}}),e.target_id&&o.createElement("span",{className:"comment-icon-target","target-id":e.target_id,onClick:()=>Te(e.target_id)},o.createElement(b.A,{style:{color:H.colorInfo,top:-2,position:"relative"}}))),children:o.createElement(o.Fragment,null,"REPLY"===$&&ee===e.id&&Le,"EDIT"===$&&ee===e.id&&Ne,Re(e.children))})))))}))),Ne=o.createElement(d.A,{onFinish:we,className:"commentForm"},o.createElement(d.A.Item,{style:{marginBottom:10}},o.createElement(M,{className:"textarea-reply",value:ae,onChange:e=>re(e.target.value),rows:4,placeholder:V("Editing comments"),onKeyDown:e=>"Escape"===e.key&&Ce(),onPressEnter:e=>"Enter"===e.key&&e.ctrlKey&&we(),ref:U})),o.createElement(d.A.Item,{className:"buttons"},o.createElement(c.A,null,ne?o.createElement(m.A,{title:V("Are you sure?"),okText:V("Yes"),cancelText:V("No"),onConfirm:function(e){be(ee),ie(!1),de(""),j({operation:A.Ru.SANDBOX_DISCUSS_REMOVE_TARGET,value:se})}},o.createElement(u.Ay,{loading:fe.isLoading,type:Y||ne&&"EDIT"===$&&""!==se?"primary":"default",className:"button-target "+(Y&&!ne?"button-target_choose":""),style:ne&&"EDIT"===$&&""!==se?{background:H.colorInfo}:{}},o.createElement(b.A,{className:"icon-target"}))):o.createElement(u.Ay,{onClick:xe,loading:fe.isLoading,type:Y||ne&&"EDIT"===$&&""!==se?"primary":"default",className:"button-target "+(Y&&!ne?"button-target_choose":""),style:ne&&"EDIT"===$&&""!==se?{background:H.colorInfo}:{}},o.createElement(b.A,{className:"icon-target"})),o.createElement(u.Ay,{className:"button-reply",type:"primary",loading:he.isLoading,htmlType:"submit"},V("Save")," ",o.createElement(f.A,null)),o.createElement(u.Ay,{onClick:Ce,className:"button-reply"},V("Cancel"))))),Le=o.createElement(d.A,{name:"reply",className:"commentForm",onFinish:Be},o.createElement(d.A.Item,{style:{marginBottom:10}},o.createElement(M,{className:"textarea-reply",value:le,onChange:e=>oe(e.target.value),rows:4,placeholder:V("Reply to the comment"),onKeyDown:e=>"Escape"===e.key&&Ce(),onPressEnter:e=>"Enter"===e.key&&e.ctrlKey&&Be(),ref:U})),o.createElement(d.A.Item,{hidden:!0,name:"targetId"},o.createElement(r.A,{type:"hidden"})),o.createElement(d.A.Item,{className:"buttons"},o.createElement(c.A,null,o.createElement(p.A,{placement:"top",title:V("Add a note"),styles:{body:{maxWidth:"150px"}}},o.createElement(u.Ay,{onClick:xe,type:Y||ne&&"REPLY"===$&&""!==se?"primary":"default",className:"button-target "+(Y&&!ne?"button-target_choose":""),style:ne&&"REPLY"===$&&""!==se?{background:H.colorInfo}:{}},o.createElement(b.A,{className:"icon-target"}))),o.createElement(u.Ay,{className:"button-reply",type:"primary",loading:"REPLY"===$&&me.isLoading,htmlType:"submit"},V("Reply")," ",o.createElement(w.A,{icon:"SendOutlined"})),o.createElement(u.Ay,{onClick:Ce,className:"button-reply",ghost:!0,type:"primary"},V("Cancel")))));(0,o.useEffect)(()=>{"REPLY"===$&&U.current.focus({cursor:"start"}),"EDIT"===$&&U.current.focus({cursor:"end"})},[$]);let Ie=[];Ie.push({key:"Reply to comment",icon:o.createElement(E.A,{style:{fontSize:"16px"}}),label:V("Reply"),onClick:Se},{key:"Edit comment",icon:o.createElement(v.A,{style:{fontSize:"16px"}}),label:V("Edit"),onClick:function(t){var l,o,a,r,n;te(Q),ie(Boolean(null===(l=e.find(e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.toString())===Q}))||void 0===l||null===(o=l.target_id)||void 0===o?void 0:o.toString())),re(null===(a=e.find(e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.toString())===Q}))||void 0===a||null===(r=a.content)||void 0===r||null===(n=r.slice(3,-5))||void 0===n?void 0:n.toString()),Z("EDIT")}},{key:"Delete comment",icon:o.createElement(_.A,{style:{fontSize:"16px"}}),label:V("Delete"),style:{color:H.colorError},onClick:function(){var t,l;te(Q),e.filter(e=>e.parent===Q).length?ge({commentId:Q,status:"deleted"}).unwrap():ue(Q),(null===(t=document.querySelector('.discuss-main li[id="'+Q+'"] .comment-icon-target'))||void 0===t?void 0:t.getAttribute("target-id"))&&j({operation:A.Ru.SANDBOX_DISCUSS_REMOVE_TARGET,value:null===(l=document.querySelector('.discuss-main li[id="'+Q+'"] .comment-icon-target'))||void 0===l?void 0:l.getAttribute("target-id")}),Ae(),de("")}});let Pe=[];return Pe.push({key:"Reply to comment",icon:o.createElement(E.A,{style:{fontSize:"16px"}}),label:V("Reply"),onClick:Se}),o.createElement("div",{className:"discuss-main"},e.length>0&&o.createElement(n.A,{className:"comment-list",itemLayout:"horizontal",dataSource:function(e){let t=JSON.parse(JSON.stringify(e));if(!t||!t.length)return[];let l=[],o=new Map;for(let a=0,r=t.length;a<r;++a){let e=t[a],r=o.get(e.id);if(r&&!Array.isArray(r)||(r&&(e.children=r),o.set(e.id,e)),"0"===String(e.parent))l.push(e);else{let t=o.get(e.parent);if(t){(Array.isArray(t)?t:t.children=t.children||[]).push(e)}else o.set(e.parent,[e])}}return l.forEach(e=>{"deleted"!==e.status||e.children||!pe.isUninitialized&&!pe.isSuccess||ue(e.id).unwrap().catch(e=>{})}),l}(e),renderItem:e=>o.createElement("li",{id:e.id},"deleted"===e.comment_status&&o.createElement(g.A,{className:"deletedComment",content:o.createElement(i.A,{description:V("Comment was removed."),type:"info"}),children:Re(e.children)}),"deleted"!==e.comment_status&&o.createElement(o.Fragment,null,o.createElement(g.A,{author_id:e.author_id,author:e.author_name,avatar:e.author_avatar_urls&&e.author_avatar_urls[48]||"",className:P()(e.target_id&&"targetted-comment-item",(!e.author_avatar_urls||!e.author_avatar_urls[48])&&"comment-item-noavatar"),content:o.createElement(s.A,{key:"commenMenu",placement:"left",destroyPopupOnHide:!0,onOpenChange:()=>J(e.id),menu:{items:e.author===_e.id?Ie:Pe},overlayStyle:{minWidth:"auto"}},o.createElement("div",{dangerouslySetInnerHTML:{__html:e.content}})),datetime:o.createElement(o.Fragment,null,o.createElement("span",{dangerouslySetInnerHTML:{__html:e.date&&(0,N.Yq)((0,N.Cl)(e.date),W,!0)}}),e.target_id&&o.createElement("span",{className:"comment-icon-target","target-id":e.target_id,onClick:()=>Te(e.target_id)},o.createElement(b.A,{style:{color:H.colorInfo,top:-2,position:"relative"}}))),children:o.createElement(o.Fragment,null,"REPLY"===$&&ee===e.id&&Le,"EDIT"===$&&ee===e.id&&Ne,Re(e.children))})))}),o.createElement(d.A,{onFinish:Be,className:"ADD"===$?"addMode":"replyEditMode"},o.createElement(d.A.Item,{style:{marginBottom:10}},o.createElement(M,{value:q,onChange:e=>X(e.target.value),rows:4,placeholder:V("Leave your comment"),className:"textarea-comment",onPressEnter:e=>"Enter"===e.key&&e.ctrlKey&&Be()})),o.createElement(d.A.Item,null,o.createElement(c.A,{size:8},o.createElement(p.A,{placement:"top",title:V("Add a note"),styles:{body:{maxWidth:"150px"}}},o.createElement(u.Ay,{onClick:xe,type:Y||ne&&"ADD"===$&&""!==se?"primary":"default",className:"button-target "+(Y&&!ne?"button-target_choose":""),style:ne&&"ADD"===$&&""!==se?{background:H.colorInfo}:{},icon:o.createElement(w.A,{icon:"Target",size:16,strokeWidth:G.iconStrokeWidth,className:"icon-target"})})),o.createElement(u.Ay,{className:"button-add",type:"primary",loading:"ADD"===$&&me.isLoading,htmlType:"submit"},V("Send")," ",o.createElement(w.A,{icon:"SendOutlined",size:16,strokeWidth:G.iconStrokeWidth,style:{marginLeft:5}}))))))}},55760:(e,t,l)=>{"use strict";l.d(t,{A:()=>y});var o=l(98173),a=l(40120),r=l(28973),n=l(35491),i=l(2604),s=l(12602),d=l(47014),c=l(1047),m=l(32947),u=l(39420),p=l(27941),g=l(16390),h=l(25389),b=l(3326);function f(e,t){if("object"===typeof e&&e){t(e);for(const l of Object.values(e))f(l,t)}}const E=function(e=".blocks-app"){e=`${e} &`;const t=new WeakSet;return{visit:l=>{if(!t.has(l)){const o={};let a;for(const r of Object.keys(l)){const n=l[r];"object"===typeof n&&n?(n._keyframe&&f(n,e=>t.add(e)),o[r]=n):(a||(a=o[e]={},t.add(a)),a[r]=n)}return o}return l}}}(),v={hashed:!1,algorithm:a.A.defaultAlgorithm,token:{colorLink:"#1677ff",colorInfo:"#722ed1",colorTextBase:"#000000",colorBgLayout:"#f0f2f5",borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,colorDarken1:"rgba(0, 0, 0, 0.08)",colorFillSecondaryDarken:"rgba(0, 0, 0, 0.1)",formControlHeight:34,borderWidth:1,borderColorHover:"#C5C5C5",formItemMarginBottomMD:20,formItemMarginBottomXS:8,colorSecondaryH:265.03,colorSecondaryS:"63.92%",colorSecondaryL:"50%",colorSecondaryBgH:273,colorSecondaryBgS:"100%",colorSecondaryBgL:"93%",appZoom:1},components:{Progress:{colorFillSecondary:"#ffffff"},Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}},_={hashed:!1,algorithm:a.A.darkAlgorithm,token:{colorBgBase:"#1F1F1F",colorInfo:"#9254de",colorLink:"#1890ff",colorLinkHover:"#69c0ff",wireframe:!1,borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,borderWidth:1,colorDarken1:"rgba(0, 0, 0, 0.9)",colorFillSecondaryDarken:"rgba(255, 255, 255, 0.16)",formControlHeight:34,borderColorHover:"rgba(255, 255, 255, 0.3)",formItemMarginBottomMD:20,formItemMarginBottomXS:8,appZoom:1},components:{Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}};const y=function({children:e}){const t=(0,i.d4)(c.Up),l=(0,i.d4)(d.C1),a=window.localStorage.getItem(m.V0.em_color_scheme),f=matchMedia(m.F3).matches?m.nd:m.T,[y,A]=(0,o.useState)(a||f),S=(0,p.rD)(),k=(0,i.wA)(),w=(0,u.c8)();(0,o.useEffect)(()=>{const e=m.EW.isPlugin?null===l||void 0===l?void 0:l.theme:a||f;A(e),(0,u.A5)(e),k((0,c.eX)(e===m.nd?`vs-${e}`:m.T)),w()},[a,t,f,null===l||void 0===l?void 0:l.theme,S.pathEnabled,k,w]);const C=(0,o.useCallback)(e=>{e&&e!==m.IJ?((0,u.Hk)(e),localStorage.setItem(m.V0.em_color_scheme,e)):localStorage.removeItem(m.V0.em_color_scheme)},[]);(0,o.useEffect)(()=>{const e=null===l||void 0===l?void 0:l.theme,t=localStorage.getItem(m.V0.em_color_scheme);e&&e!==t&&C(e)},[l,C]);const B=(0,o.useCallback)(()=>{const e=localStorage.getItem(m.V0.em_color_scheme);C(e)},[C]);(0,o.useEffect)(()=>{B()},[B]);const x=(0,i.d4)(g.RP),[T,R]=(0,o.useState)("light"===y?v:_),[N]=(0,o.useState)(1);(0,o.useEffect)(()=>{const e="light"===y?v:_,t=x[y],l=t?(0,h.TJ)(e,t):e;R({...l,token:{...l.token,appZoom:N}})},[R,y,x,N]);const L=(0,b.LG)(),I=(0,o.useCallback)(()=>L,[L]);return o.createElement(r.Ay,{theme:T,getPopupContainer:I},o.createElement(s.N7,{transformers:[E]},o.createElement(n.A,null,e)))}},55835:(e,t,l)=>{"use strict";l.d(t,{LA:()=>i,LJ:()=>s,Pp:()=>r,Q9:()=>n,ZW:()=>o,k0:()=>d,pX:()=>a});const o="wss://yjs.emailmaker.ru",a=500,r=5e3,n=2e4,i="3769995",s="Not available for collaborative editing",d="Problem with internet connection"},56605:(e,t,l)=>{"use strict";l.d(t,{A:()=>i});var o=l(98173),a=l(49856),r=l(98447),n=l(38826);const i=({small:e=!1,style:t={},wrap:l=!1})=>{const i={width:e?"100%":"100vw",height:"80vh",display:"flex",justifyContent:"center",alignItems:"center",...t},s=o.createElement(n.A,{style:{fontSize:48},spin:!0});return o.createElement(a.A,{size:"large",style:i,wrap:l},o.createElement(r.A,{indicator:s}))}},58521:(e,t,l)=>{"use strict";l.d(t,{hI:()=>h,u$:()=>p,KU:()=>u,XB:()=>g,of:()=>b});var o=l(96651),a=l(3792),r=l(76233);let n=function(e){return e.Json="application/json",e.FormData="multipart/form-data",e.UrlEncoded="application/x-www-form-urlencoded",e.Text="text/plain",e}({});class i{constructor(e={}){this.baseUrl="",this.securityData=null,this.securityWorker=void 0,this.abortControllers=new Map,this.customFetch=(...e)=>fetch(...e),this.baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"},this.setSecurityData=e=>{this.securityData=e},this.contentFormatters={[n.Json]:e=>null===e||"object"!==typeof e&&"string"!==typeof e?e:JSON.stringify(e),[n.Text]:e=>null!==e&&"string"!==typeof e?JSON.stringify(e):e,[n.FormData]:e=>Object.keys(e||{}).reduce((t,l)=>{const o=e[l];return t.append(l,o instanceof Blob?o:"object"===typeof o&&null!==o?JSON.stringify(o):`${o}`),t},new FormData),[n.UrlEncoded]:e=>this.toQueryString(e)},this.createAbortSignal=e=>{if(this.abortControllers.has(e)){const t=this.abortControllers.get(e);return t?t.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal},this.abortRequest=e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))},this.request=async({body:e,secure:t,path:l,type:o,query:a,format:r,baseUrl:i,cancelToken:s,extraQuery:d,...c})=>{const m=("boolean"===typeof t?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},u=this.mergeRequestParams(c,m);d&&(a=a?{...a,...d}:d);const p=a&&this.toQueryString(a),g=this.contentFormatters[o||n.Json],h=r||u.format,b=new Request(`${i||this.baseUrl||""}${l}${p?`?${p}`:""}`,{...u,headers:{...u.headers||{},...o&&o!==n.FormData?{"Content-Type":o}:{}},signal:(s?this.createAbortSignal(s):u.signal)||null,body:"undefined"===typeof e||null===e?null:g(e)});return this.customFetch(b).then(async e=>{const t=e;t.data=null,t.error=null,t.meta={request:b,response:t};const l=h?await e[h]().then(e=>(t.ok?t.data=e:t.error={data:e},t)).catch(e=>(t.error=e,t)):t;return s&&this.abortControllers.delete(s),l})},Object.assign(this,e)}encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent("number"===typeof t?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map(e=>this.encodeQueryParam(t,e)).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter(e=>"undefined"!==typeof t[e]).map(e=>Array.isArray(t[e])?this.addArrayQueryParam(t,e):this.addQueryParam(t,e)).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}}class s extends i{constructor(...e){super(...e),this.unsplashTest={appControllerGetUnsplashTest:(e={})=>this.request({path:"/unsplash_test",method:"GET",...e})},this.tasks={tasksControllerCreateTask:(e,t={})=>this.request({path:"/tasks",method:"POST",body:e,type:n.Json,...t}),tasksControllerGetTask:(e,t={})=>this.request({path:`/tasks/${e}`,method:"GET",...t}),tasksControllerGetEmail:(e,t={})=>this.request({path:`/tasks/${e}/email`,method:"GET",...t}),tasksControllerGetEmailHtml:(e,t={})=>this.request({path:`/tasks/${e}/html`,method:"GET",...t})},this.parsing={manParseControllerLogoGen:(e,t={})=>this.request({path:"/parsing/logo-gen",method:"GET",query:e,...t}),manParseControllerSite:(e,t={})=>this.request({path:"/parsing/site",method:"GET",query:e,...t}),manParseControllerColor:(e,t={})=>this.request({path:"/parsing/color",method:"GET",query:e,...t}),manParseControllerStyle:(e,t={})=>this.request({path:"/parsing/style",method:"GET",query:e,...t}),manParseControllerColorScheme:(e,t={})=>this.request({path:"/parsing/color-scheme",method:"GET",query:e,...t}),manParseControllerImage:(e,t={})=>this.request({path:"/parsing/image",method:"GET",query:e,...t})},this.maintenance={maintenanceControllerReloadBlocks:(e={})=>this.request({path:"/maintenance/reload-blocks",method:"GET",...e}),maintenanceControllerReloadUnsplashTopics:(e={})=>this.request({path:"/maintenance/reload-unsplash-topics",method:"GET",...e})},this.unsplash={unsplashControllerUnsplashTest:(e={})=>this.request({path:"/unsplash/test",method:"GET",...e}),unsplashControllerSearchPhotos:(e,t={})=>this.request({path:"/unsplash/search",method:"GET",query:e,...t}),unsplashControllerGetTopics:(e={})=>this.request({path:"/unsplash/topics",method:"GET",...e}),unsplashControllerGetPhoto:(e,t={})=>this.request({path:"/unsplash/photo",method:"GET",query:e,...t})}}}var d=l(74029),c=l(2604),m=l(98173);const u=e=>a.di.getInstance(e,d.Pz),p=e=>a.di.getOrCreateInstance(e,d.Bl,()=>new s({baseUrl:"https://ai-mail.emcdn.ru"})),g=()=>{const e=(0,c.Pj)();return(0,m.useMemo)(()=>a.di.getInstance(e,d.Pz),[e])};function h(e){return(t,l,n)=>{const i=a.di.getInstance(l,r.no);return(0,o.fetchBaseQuery)({...e,fetchFn:(null===i||void 0===i?void 0:i.execute)||fetch})(t,l,n)}}const b=()=>{const e=(0,c.Pj)();return(0,m.useMemo)(()=>a.di.getInstance(e,d.M4),[e])}},59089:(e,t,l)=>{"use strict";l.d(t,{So:()=>r});var o=l(14721),a=l(58521);const r=(0,o.xP)({reducerPath:"promoApi",baseQuery:(0,a.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:e,type:t},l)=>(0,a.KU)(l).promo.set_code_create({code:e,type:t})}),getPromoInfo:e.query({queryFn:({code:e},t)=>(0,a.KU)(t).promo.get_code_info_list({code:e})})})}),{useCheckPromoMutation:n,useGetPromoInfoQuery:i}=r},61631:(e,t,l)=>{"use strict";l.d(t,{j:()=>o});class o{constructor(e=[]){this._inner=e,this._isDisposed=!1}addDisposable(e){return this._inner.push(e),e instanceof o&&e.addDispose(()=>{this.removeDisposable(e)}),e}addDispose(e){this.addDisposable({dispose:e})}removeDisposable(e){const t=this._inner.indexOf(e);t>=0&&this._inner.splice(t,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const e of[...this._inner])e.dispose()}}}},62093:(e,t,l)=>{"use strict";l.d(t,{A:()=>r});var o=l(98173),a=l(52919);function r(e,t){const l=(0,a.QC)();(0,o.useEffect)(()=>{const o=l.addListener(e,t);return()=>{o.dispose()}},[l,e,t])}},62315:e=>{e.exports=({__:e})=>`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding: 20px 0 10px;">\n <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size: 24px; line-height: 32px; color: #333333;"><strong>${e("Header text")}</strong></div>\n</td></tr></table>`},63233:(e,t,l)=>{"use strict";l.d(t,{A:()=>Y});var o=l(16791),a=l(78915),r=l(46767),n=l(52779),i=l(92485),s=l(98119),d=l(65716),c=l(83027),m=l(98845),u=l(40835),p=l(19992),g=l(73668),h=l(79965),b=l(94160),f=l(6193),E=l(47491),v=l(90925),_=l(30397),y=l(64706),A=l(38251),S=l(23424),k=l(79253),w=l(15812),C=l(1047),B=l(54838),x=l(22536),T=l(12741),R=l(39206),N=l(47014),L=l(38540),I=l(38677),P=l(68984),O=l(12005),F=l(8111),M=l(705),D=l(92960),V=l(33932),W=l(12744),j=l(59089),z=l(871),H=l(2952),G=l(80772),U=l(84572),q=l(16390),X=l(3792),$=l(80148);const Z=(0,o.HY)({[X.di.reducerPath]:X.di.reducer,[D.Z8.reducerPath]:D.Z8.reducer,[O.Ad.reducerPath]:O.Ad.reducer,[a.Q2.reducerPath]:a.Q2.reducer,[n.S.reducerPath]:n.S.reducer,[i.k.reducerPath]:i.k.reducer,[r.OV.reducerPath]:r.OV.reducer,[s.yR.reducerPath]:s.yR.reducer,[d.Nq.reducerPath]:d.Nq.reducer,[c.kE.reducerPath]:c.kE.reducer,[m.GY.reducerPath]:m.GY.reducer,[P.VM.reducerPath]:P.VM.reducer,[u.yH.reducerPath]:u.yH.reducer,[p.B.reducerPath]:p.B.reducer,[g.f.reducerPath]:g.f.reducer,[F.Jg.reducerPath]:F.Jg.reducer,[z.CL.reducerPath]:z.CL.reducer,[H.tO.reducerPath]:H.tO.reducer,[M.vx.reducerPath]:M.vx.reducer,[h.M.reducerPath]:h.M.reducer,[b.F.reducerPath]:b.F.reducer,[f.KA.reducerPath]:f.KA.reducer,[E.Sd.reducerPath]:E.Sd.reducer,[v.y.reducerPath]:v.y.reducer,[S.Ay.name]:S.Ay.reducer,[k.Ay.name]:k.Ay.reducer,[w.Ay.name]:w.Ay.reducer,[C.Ay.name]:C.Ay.reducer,[B.Ay.name]:B.Ay.reducer,[x.Ay.name]:x.Ay.reducer,[T.Ay.name]:T.Ay.reducer,[R.Ay.name]:R.Ay.reducer,[N.Ay.name]:N.Ay.reducer,[L.Ay.name]:L.Ay.reducer,[G.Ay.name]:G.Ay.reducer,[I.Ay.name]:I.Ay.reducer,[V.Zs.reducerPath]:V.Zs.reducer,[W.Uu.reducerPath]:W.Uu.reducer,[U.Ay.name]:U.Ay.reducer,[j.So.reducerPath]:j.So.reducer,[q.Ay.name]:q.Ay.reducer,[_.C.reducerPath]:_.C.reducer,[y.N.reducerPath]:y.N.reducer,[A.U8.reducerPath]:A.U8.reducer}),Y=(e,t)=>"authorizationApi/resetApiState"===t.type?Z({[$.IP]:e[$.IP],[O.Ad.reducerPath]:e[O.Ad.reducerPath]},t):Z(e,t)},63779:()=>{},63837:(e,t,l)=>{"use strict";l.d(t,{A:()=>T});var o=l(98173),a=l(37969),r=l(38),n=l(66964),i=l(69550),s=l(8218),d=l(48753),c=l(201),m=l(93511),u=l(2604),p=l(12543),g=l(62041),h=l(67756),b=l(22318),f=l(94548),E=l(20793),v=l(8807),_=l(65716),y=l(84572),A=l(23424),S=l(27941),k=l(32947),w=l(5558);const C="mainsettings",B="ftpsettings",x="webhooksettings",T=({isModalVisible:e,selectedProject:t=null})=>{const{__:l}=(0,p.s9)(),T=(0,u.wA)(),[R]=i.A.useForm(),N=(0,o.useRef)(null),L=(0,o.useRef)(null),I=(0,o.useRef)(null),P=(0,u.d4)(y.yN),O=(0,u.d4)(A.gU),F=(0,w.hN)(),M=(0,u.d4)(A.cL),[D,V]=(0,o.useState)(C),[W,j]=(0,o.useState)(!1),z=t||P,H=[B,C,x].includes(O),[G,U]=(0,_.OD)(),q=(0,S.rD)();(0,o.useEffect)(()=>{if(M===k.lx.EDIT_PROJECT_MODAL){const e={mainsettings:N,ftpsettings:L,webhooksettings:I};setTimeout(()=>{var t;return null===(t=e[D].current)||void 0===t?void 0:t.focus({cursor:"end"})},200)}},[M,D]),(0,o.useEffect)(()=>{H&&V(O)},[O,H,V,T]);let X=[{label:o.createElement(o.Fragment,null,o.createElement(E._,{size:18,strokeWidth:q.iconStrokeWidth}),l("Main settings")),key:C,className:"em-analytics__mainsettings-project",children:o.createElement(o.Fragment,null,o.createElement(c.A,{gutter:24},o.createElement(n.A,{span:24},o.createElement(i.A.Item,{label:l("Project name"),name:"name",extra:l("This can be\xa0the name of\xa0your company, department, website, project, marketing campaign, or\xa0other activity."),rules:[{required:!0,message:l("Please type the project name.")}]},o.createElement(s.A,{ref:N,placeholder:l("Type the project name"),style:{marginBottom:5}})))))},{label:o.createElement(o.Fragment,null,o.createElement(b.r,{size:18,strokeWidth:q.iconStrokeWidth}),l("FTP settings")),key:B,className:"em-analytics__ftpsettings-project",children:o.createElement(o.Fragment,null,o.createElement(c.A,{gutter:24},o.createElement(n.A,{span:12},o.createElement(i.A.Item,{label:l("Host"),name:["ftpSettings","host"]},o.createElement(s.A,{ref:L,placeholder:l("Type the FTP host"),disabled:W}))),o.createElement(n.A,{span:12},o.createElement(i.A.Item,{label:l("Port"),name:["ftpSettings","port"]},o.createElement(s.A,{placeholder:l("Type the FTP port"),disabled:W})))),o.createElement(c.A,{gutter:24},o.createElement(n.A,{span:12},o.createElement(i.A.Item,{label:l("Directory"),name:["ftpSettings","directory"]},o.createElement(s.A,{placeholder:l("Type the file directory"),disabled:W}))),o.createElement(n.A,{span:12},o.createElement(i.A.Item,{label:l("URL catalog"),name:["ftpSettings","domain"]},o.createElement(s.A,{placeholder:l("Type the URL catalog"),disabled:W})))),o.createElement(c.A,{gutter:24},o.createElement(n.A,{span:12},o.createElement(i.A.Item,{label:l("Login"),name:["ftpSettings","login"]},o.createElement(s.A,{placeholder:l("Type the FTP login"),disabled:W}))),o.createElement(n.A,{span:12},o.createElement(i.A.Item,{label:l("Password"),name:["ftpSettings","password"]},o.createElement(s.A.Password,{placeholder:l("Type the FTP password"),disabled:W,iconRender:e=>e?o.createElement(h.A,null):o.createElement(g.A,null)})))),o.createElement(c.A,{gutter:24},o.createElement(n.A,{span:24},o.createElement(i.A.Item,{noStyle:!0},o.createElement(r.A,{checked:W,onChange:e=>j(Boolean(e.target.checked))},l("Use default CDN"))))))},{label:o.createElement(o.Fragment,null,o.createElement(v.A,{icon:"WebHook",style:{fontSize:"16px",margin:0}}),l("Webhook settings")),key:x,className:"em-analytics__mainsettings-project",children:o.createElement(o.Fragment,null,o.createElement(c.A,{gutter:24},o.createElement(n.A,{span:24},o.createElement(i.A.Item,{label:l("Webhook settings"),name:"webhook",extra:l("Before exporting the project, make sure to provide the URL where the webhook request will be sent"),rules:[{type:"url",message:l("Please enter the correct URL.")},H&&{required:!0,message:l("Please type the webhook URL.")}]},o.createElement(s.A,{ref:I,placeholder:l("Type in the project's webhook"),style:{marginBottom:5}})))))}];(0,o.useEffect)(()=>{if(e&&z){const e=z.ftp_settings;j(e.use_default_cdn),R.setFieldsValue({name:z.title,webhook:z.webhook||"",ftpSettings:{host:e.host||"",port:e.port||"",directory:e.directory||"",domain:e.domain||"",login:e.login||"",password:e.password||""}})}},[R,z,e]);const $=()=>{R.validateFields().then(e=>{const t=e.ftpSettings;z&&G({projectId:z.id,title:e.name,webhook:e.webhook?e.webhook:"",ftp_settings:t?{host:t.host,port:t.port,directory:t.directory,domain:t.domain,login:t.login,password:t.password,use_default_cdn:W}:null}).then(({data:e,error:t})=>{e?e.title!==z.title?F.success({message:l("The project \u201c")+z.title+l("\u201d was successfully changed to \u201c")+e.title+l("\u201d.")}):F.success({message:l("The project settings was successfully saved.")}):t&&F.error({error:t}),T((0,A.YF)("")),T((0,A.Oo)())})})};return o.createElement(d.A,{title:o.createElement("div",null,o.createElement(f.T,{size:20,strokeWidth:2})," ",l("Project settings")),className:"blocks-modal",open:e,onOk:$,onCancel:()=>{T((0,A.YF)("")),T((0,A.Oo)())},centered:!0,footer:[o.createElement(a.Ay,{key:"submit",size:"large",className:"em-analytics__project-save",type:"primary",loading:U.isLoading,onClick:$},l("Update"))]},o.createElement(i.A,{form:R,layout:"vertical",name:`edit_project_form_${null===z||void 0===z?void 0:z.id}`,onFinish:$,initialValues:{remember:!1,name:""},autoComplete:"off"},o.createElement(m.A,{activeKey:D,onChange:V,items:X,className:"modal-tabs"})))}},64706:(e,t,l)=>{"use strict";l.d(t,{N:()=>a,m:()=>r});var o=l(27943);const a=(0,l(14721).xP)({reducerPath:"htmlToPdfPlusApi",baseQuery:async(e,t,l)=>{try{const{notification:a,...r}=e,n=await(0,o.cw)({baseUrl:"https://html2pdf.emcdn.ru/convert/html-to-pdf"})(r,t,l);if(n.error)throw new Error;return n}catch(a){return(null===e||void 0===e?void 0:e.notification).error(a),{error:a}}},endpoints:e=>({generateHtmlToPdf:e.mutation({query:({htmlContent:e,notification:t})=>({url:"",method:"POST",body:e,notification:t,responseHandler:e=>e.blob()})})})}),{useGenerateHtmlToPdfMutation:r}=a},66079:(e,t,l)=>{"use strict";l.d(t,{A:()=>N});var o=l(98173),a=l(32656),r=l(85591),n=l.n(r);const i=JSON.parse('{"l5":"iframe-eblock.e88ae8a9ae883be1118b.html","yG":"iframe.e88ae8a9ae883be1118b.html"}');var s=l(86095),d=l(2604),c=l(62093),m=l(27941),u=l(98845),p=l(32947),g=l(81843),h=l(5558),b=l(47014),f=l(12543),E=l(76233),v=l(52919),_=l(37357),y=l(70687),A=l(83171);function S(e,t){const{__:l}=(0,f.s9)(),a=(0,v.QC)(),r=(0,s.aD)(e),{error:n}=(0,h.hN)(),i=(0,o.useRef)(0),m=(0,o.useRef)(void 0),u=(0,o.useRef)(!1),S=(0,d.d4)(b.C1),k=(0,o.useCallback)(e=>new Promise((t,l)=>{const o=a.addListener(p.Ru.SANDBOX_READY,()=>{o.dispose(),t()});e&&setTimeout(()=>{o.dispose(),l("timeout")})}),[a]),w=(0,o.useCallback)(o=>{k(2e3).catch(e=>{}).finally(()=>{Promise.resolve().then(()=>{if(!u.current){if(++i.current){if(m.current){if(i.current<5){r.restoreSnapshot(m.current);for(let e=0;e<i.current;e++)r.undo()}}else m.current=r.createSnapshot();a.send(p.Ru.RELOAD)}setTimeout(()=>{if(0===--i.current){m.current=null;const a=new Error(o.message);o.stack&&(a.stack=o.stack);const i=A.Cp(a,{tags:{origin:"iframe"}}),s={past:r.getPast().slice(0,10),future:r.getFuture(),errorResolved:!u.current,text:e.getValue(),message:o.message,stack:o.stack,userId:null===S||void 0===S?void 0:S.id,entityId:null===t||void 0===t?void 0:t.id,entityType:document.location.pathname.indexOf("emails")>0?"email":"block",sentryEventId:i};n({id:"IFRAME_ERROR",data:s,message:l("Something went wrong")}),E.CJ.post("iframe_errors",s).catch(e=>{}),u.current=!1}},2e3)}})})},[r,e,n,null===S||void 0===S?void 0:S.id,null===t||void 0===t?void 0:t.id,l,k,a]);(0,c.A)(p.Ru.APPLICATION_DOMPARSER_ERROR,w),(0,o.useEffect)(()=>{let l=null,o=0;function r(e){const t=[];for(const{rangeOffset:l,rangeLength:o,text:a}of e.changes)t.push({range:{start:l,end:l+o},text:a});return t}let n=!1;const i=new _.j;return i.addDisposable((0,y.Og)(e,e=>(async e=>{if(n)await a.sendAsync(p.Ru.SANDBOX_UPDATE_ENTITY,{edits:[r(e)],guid:t.renderGuid});else if(l)l.push(e);else{l=[e];do{const e=l.splice(0,l.length);await a.sendAsync(p.Ru.SANDBOX_UPDATE_ENTITY,{edits:e.map(r),guid:t.renderGuid})}while(l.length);l=null}})(e).catch(e=>{}))),i.addDisposable(a.addListener(p.Ru.APPLICATION_UPDATE_ENTITY,function({guid:l,edits:a,pushUndoStop:r}){if(e&&l===t.renderGuid)try{n=!0;const t=(0,g.yc)(),l=t.canUndo(e.uri),i=t.canRedo(e.uri),s=a.map(({text:t,range:l})=>{const o=e.getPositionAt(l.start),a=e.getPositionAt(l.end);return{text:t,range:{startColumn:o.column,startLineNumber:o.lineNumber,endColumn:a.column,endLineNumber:a.lineNumber}}});r||l||i?e.pushEditOperations([],s,()=>null):e.applyEdits(s),!1!==r&&(o&&clearTimeout(o),o=setTimeout(()=>{e.pushStackElement(),o=0},1e3))}finally{n=!1}})),()=>{i.dispose(),o&&clearTimeout(o)}},[e,a,t.renderGuid])}const k=Symbol("isIframeEvent");function w({children:e}){const[t,l]=(0,o.useState)(),[a,r]=(0,o.useState)(),[n,i]=(0,o.useState)(!1),s=(0,v.QC)();return(0,o.useEffect)(()=>{if(t){const e=s.addListener(p.Ru.APPLICATION_IFRAME_DRAG_EVENT,e=>{if("drageleave"!==e.type&&"dragenter"!==e.type){const l=t.getBoundingClientRect(),o=e.clientX+l.x+window.scrollX,a=e.clientY+l.y+window.scrollY,r=document.elementFromPoint(o,a);if(r){const t=new DataTransfer,l=new DragEvent(e.type,{clientX:o,clientY:a,cancelable:!0,bubbles:!0,dataTransfer:t});l[k]=!0,r.dispatchEvent(l)}}});return()=>e.dispose()}},[s,t]),(0,o.useEffect)(()=>{const e=e=>{e[k]||i(!0)},t=e=>{e[k]||i(!1)};return window.addEventListener("dragstart",e),window.addEventListener("dragend",t),()=>{window.removeEventListener("dragstart",e),window.removeEventListener("dragend",t)}},[a]),(0,o.useEffect)(()=>{const e=e=>{if(!e[k]){var t;const l=a.getBoundingClientRect();s.send(p.Ru.SANDBOX_DRAG_EVENT,{value:(null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("Text"))||"",type:e.type,clientX:e.pageX-l.x-window.scrollX,clientY:e.pageY-l.y-window.scrollY})}};if(a)return a.addEventListener("dragenter",e),a.addEventListener("dragover",e),a.addEventListener("dragleave",e),a.addEventListener("drop",e),a.addEventListener("dragend",e),()=>{a.removeEventListener("dragenter",e),a.removeEventListener("dragover",e),a.removeEventListener("dragleave",e),a.removeEventListener("drop",e),a.removeEventListener("dragend",e)}},[a,s]),o.createElement("div",{ref:l},n&&o.createElement("div",{ref:r,className:"iframe-provider"}),e)}var C=l(40120),B=l(95669);const{useToken:x}=C.A;var T=l(90614),R=l(15626);const N=(0,o.forwardRef)(({className:e=null,email:t=null,handlerSendPosition:r=()=>{}},g)=>{const h=(0,d.wA)(),E=(0,s.fn)(),_=(0,m.rD)(),y=(0,v.ur)(),A=(0,v.XW)(),k=(0,v.QC)(),C=(0,T._q)(R.AZ.ON_EMAIL_INIT_ID),[N,L]=(0,o.useState)(),I=(0,o.useCallback)(e=>{const l=window.localStorage.getItem(p.V0.em_color_scheme),o=matchMedia(p.F3).matches?p.nd:p.T,a=window.localStorage.getItem(p.V0.em_code_mode_settings)?JSON.parse(window.localStorage.getItem(p.V0.em_code_mode_settings)):null,n={operation:p.Ru.UPDATE_PREVIEW,versionId:(null===E||void 0===E?void 0:E.getVersionId())||0,theme:l&&"system"!==l?l:o,commonStyles:"string"===typeof(null===t||void 0===t?void 0:t.common_styles)&&null!==t&&void 0!==t&&t.common_styles.startsWith("{")&&"{}"!==t.common_styles?JSON.parse(t.common_styles):p.BD,pathEnabled:_.pathEnabled,copyPasteEnabled:_.copyPasteEnabled,saveBlockEnabled:_.saveBlockEnabled,editImageControlEnabled:_.editImageControlEnabled,codeMode:!!a&&!(!a.isCodeMode||"left"!==a.codeModeDirection&&"right"!==a.codeModeDirection),elementAIimageEnabled:_.elementAIimageEnabled,imageCenterStockEnabled:_.imageCenterStockEnabled,imageCenterGifEnabled:_.imageCenterGifEnabled,imageCenterEditorEnabled:_.imageCenterEditorEnabled,blocksAddPanelEnabled:_.blocksAddPanelEnabled,lockEditor:_.lockEditor,appName:"emailmaker"};L(e.target),y(e.target),g.current.resize(),A(n),r()},[_,r,A,E,t.common_styles,g,L,y]);(0,o.useEffect)(()=>{k.isInited()&&A({operation:p.Ru.UPDATE_PREVIEW,lockEditor:_.lockEditor})},[k,_.lockEditor]);const P=(0,o.useCallback)(e=>{var t;e.data.operation===p.Ru.SANDBOX_RESIZED&&(null===(t=g.current)||void 0===t||t.resize())},[g]);(0,o.useEffect)(()=>{const e=C(()=>{g.current.resize()});return()=>e.dispose()},[g,C]),(0,o.useEffect)(()=>()=>{y()},[y]);const O=(0,o.useCallback)(()=>new Promise(e=>{k.setTarget(void 0);const t=()=>{I({target:N}),e(),null===N||void 0===N||N.removeEventListener("load",t)};null===N||void 0===N||N.addEventListener("load",t)}),[k,I,N]);(0,o.useEffect)(()=>{const e=k.addListenerAsync(p.Ru.RELOAD,O,Number.MAX_SAFE_INTEGER);return()=>e.dispose()},[k,O]),(0,c.A)(P),(0,c.A)(()=>{var e;null===(e=g.current)||void 0===e||e.resize()},p.Ru.SANDBOX_INITED),function(){const e=(0,v.QC)(),t=(0,d.d4)(b.C1),{__:l}=(0,f.s9)(),[a,r]=(0,o.useState)("");(0,o.useEffect)(()=>{if(t.locale!==a){const o=(0,p.QV)(l),a=e.onInit(()=>{e.send(p.Ru.SANDBOX_TRANSLATIONS,{name:t.locale,data:o}),r(t.locale)});return()=>a.dispose()}},[t.locale,a,r,l,e]),(0,o.useEffect)(()=>{const t=e.addListener(p.Ru.RELOAD,()=>{r("")});return()=>t.dispose()},[r,e])}(),function(){const e=(0,v.QC)(),{token:t}=x(),[l,a]=(0,o.useState)();(0,o.useEffect)(()=>{if(!(0,B.b)(l,t)){const l=e.onInit(()=>{e.send(p.Ru.SANDBOX_SET_THEME_VARIABLES,t),a(t)});return()=>l.dispose()}},[t,l,a,e]),(0,o.useEffect)(()=>{const t=e.addListener(p.Ru.RELOAD,()=>{a(void 0)});return()=>t.dispose()},[a,e])}(),(0,o.useEffect)(()=>{matchMedia(p.F3).addEventListener("change",e=>{const t=window.localStorage.getItem(p.V0.em_color_scheme),l=e.matches?p.nd:p.T;A({operation:p.Ru.UPDATE_PREVIEW,theme:t||l})})},[A]),S(E,t),(0,o.useEffect)(()=>{const e=E.onDidChangeContent(()=>{g.current.resize()});return()=>e.dispose()},[E,g]);const F=(0,o.useCallback)(e=>{e.data.operation===p.Ru.APPLICATION_COMMON_STYLES_UPDATE&&h(u.GY.util.updateQueryData("getEmail",t.id,t=>Object.assign(t,{common_styles:JSON.stringify(e.data.settings.commonStyles)})))},[h,t.id]);return(0,c.A)(F),o.createElement(w,null,o.createElement(a.A,{forwardRef:g,checkOrigin:!1,sandbox:"allow-top-navigation allow-scripts allow-popups allow-popups-to-escape-sandbox",className:n()("email-preview",{[e]:e}),width:"100%",minHeight:600,scrolling:"no",id:"email_iframe",allow:"clipboard-read; clipboard-write",src:(p.EW.isPlugin?`${l.p}iframe/`:"/iframe/")+(t.hasOwnProperty("type")?i.l5:i.yG),title:"Email content",onLoad:I}))})},66330:(e,t,l)=>{"use strict";l.d(t,{Y:()=>x});var o=l(98173),a=l(94043),r=l(12543),n=l(28973),i=l(12005),s=l(2604),d=l(61334),c=l.n(d),m=l(47014),u=l(32947),p=l(16390),g=l(5558),h=l(73180),b=l(90614),f=l(15626),E=l(3326);const v=l(41735).default;var _=l(80148),y=l(76550);const A="em_locale",S="em_ant_locale",k="em_mergeTags_locale",w=e=>{try{return JSON.parse(localStorage.getItem(e)||"")}catch{return null}},C=(e,t)=>{const l=w(e);return l?(localStorage.removeItem(e),localStorage.setItem(t,JSON.stringify(l)),l):null},B=()=>{var e,t;return(null===(e=w(S))||void 0===e?void 0:e.data)||(null===(t=C("ant_locale",S))||void 0===t?void 0:t.data)||v},x=({children:e})=>{const t=(0,_.NF)(),d=(0,s.wA)(),v=(0,g.hN)(),x=(0,s.d4)(m.C1),T=(0,s.d4)(m.B),[R,N]=(0,i.HO)(),[L,I]=(0,i.Yj)(),P=(0,b.ml)(f.AZ.READ_LOCALE),O=T||(u.EW.isPlugin?void 0:"ru_RU"),[F,M]=(0,o.useState)(()=>(0,a.hU)()),[D,V]=(0,o.useState)(B),[W,j]=(0,o.useState)(!0),[z,H]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{const e=w(A)||C("locale",A);if(null!==e&&void 0!==e&&e.data&&(M((0,a.hU)(e.data)),j(!1)),!u.EW.isPlugin){const e=w(k);null!==e&&void 0!==e&&e.data&&d((0,p.Kj)(e.data))}},[]),(0,o.useEffect)(()=>{O&&l(25484)(`./${"uk"===O?"uk_UA":O}.js`).then(e=>{const t=e.default;V(l=>l.locale!==t.locale?(localStorage.setItem(S,JSON.stringify(e.default)),t):l)}).catch(e=>{})},[O,null===x||void 0===x?void 0:x.id]),(0,o.useEffect)(()=>{!u.EW.isPlugin&&O&&l(3372)(`./${"uk"===O?"uk_UA":O}.ts`).then(e=>{d((0,p.Kj)(e.default)),localStorage.setItem(k,JSON.stringify(e.default))})},[O,d,null===x||void 0===x?void 0:x.id]),(0,h.ZC)(([e])=>{!e&&N.error&&v.fromError("GET_LOCALES_ERROR",void 0,N.error)},[N.error,v]),(0,h.ZC)(([e])=>{O&&e!==O&&P.fire(O).then(([e])=>{if(e){var l;const t=null===(l=c()(e,{format:"jed",fuzzy:!0,domain:"default"}))||void 0===l?void 0:l.locale_data.default;M((0,a.hU)(t)),H(!0)}else u.EW.isPlugin&&t.getInstance(y.Ef)?H(!0):N.isSuccess?L({id:O}):R()})},[O,P,null===x||void 0===x?void 0:x.id]),(0,o.useEffect)(()=>{if(N.isSuccess&&O){const e=N.data.find(([e])=>e===O);if(!e)return void H(!0);const t=w(A);(null===t||void 0===t?void 0:t.id)===O&&e[1]<=t.time?H(!0):L({id:O})}},[O,N,L,null===x||void 0===x?void 0:x.id]),(0,h.ZC)(([e])=>{!e&&I.isError&&v.fromError("GET_LOCALE_ERROR",void 0,I.isError)},[I.isError,v]),(0,o.useEffect)(()=>{if(N.isSuccess&&I.isSuccess){var e,t;if((null===(e=I.originalArgs)||void 0===e?void 0:e.id)!==O)return;const l=I.data,o=N.data.find(([e])=>e===O),r=null===(t=c()(l,{format:"jed",fuzzy:!0,domain:"default"}))||void 0===t?void 0:t.locale_data.default;localStorage.setItem(A,JSON.stringify({id:O,time:(null===o||void 0===o?void 0:o[1])||Date.now(),data:r})),M((0,a.hU)(r)),H(!0)}},[I,O,N,null===x||void 0===x?void 0:x.id]),o.createElement(r.CY,{i18n:F},o.createElement(E.r4.Provider,{value:!W||z},o.createElement(n.Ay,{locale:D},e)))}},66930:e=>{e.exports='<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>'},67007:(e,t,l)=>{"use strict";l.d(t,{A:()=>r});var o=l(98173),a=l(30150);const r=({to:e})=>o.createElement(a.C5,{to:e})},67558:e=>{e.exports=({__:e})=>`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding: 10px 0;">\n <table cellpadding="0" cellspacing="0" border="0" width="200" class="em-mob-width-100perc">\n <tr>\n <td align="center" valign="middle" height="41" style="background-color: #1C52DC; border-radius: 5px; height: 41px;">\n <a href="" target="_blank" style="display: block; font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; color: #FFFFFF; font-size: 16px; line-height: 41px; text-decoration: none; white-space: nowrap;">\n ${e("Button")}\n </a>\n </td>\n </tr>\n </table>\n</td></tr></table>`},70687:(e,t,l)=>{"use strict";l.d(t,{Og:()=>n,SF:()=>r,po:()=>a});const o=new Set;function a(e){return o.add(e),{dispose(){r(e)}}}function r(e){o.delete(e)}function n(e,t){let l=e.getVersionId();const a=[],r=e.onDidChangeContent(r=>{if(r.versionId>l+1){const n=e.onDidChangeContent(i=>{if(r.versionId===l+1)try{o.has(e)||t(r)}catch(s){}finally{l=r.versionId;const e=a.indexOf(n);e>=0&&a.splice(e,1),n.dispose()}});a.push(n)}else try{o.has(e)||t(r)}catch(n){}finally{l=r.versionId}});return{dispose:()=>{r.dispose(),a.forEach(e=>e.dispose())}}}},71676:(e,t,l)=>{"use strict";l.d(t,{F:()=>a,L:()=>r});var o=l(31926);function a({acf:{autosaves:e,hide_mergetags:t,theme:l,newsletter_consent:a,code_editor:r,counters:n,subscription:i,subscription_end:s,recurring_payments:d,subscription_id:c,promocode:m,subscription_amount:u,enterprise_users_limit:p,enterprise_price:g,enterprise_12_price:h,privacy_policy_agreement:b,last_used_project:f,email_confirmation:E,email_builder_config:v},id:_,...y}){return{...y,id:(0,o.WY)(_),username:y.username||"",email:y.email||"",password:y.password||"",autosaves:e,hide_mergetags:t,theme:l,newsletter_consent:a,code_editor:r?{...r,font_size:Number(r.font_size)}:void 0,counters:Object.keys(n).reduce((e,t)=>(e[t]=Number(n[t]),e),{}),subscription:i,subscription_end:s,recurring_payments:d,subscription_id:c,promocode:m,subscription_amount:u,enterprise_users_limit:p,enterprise_price:g,enterprise_12_price:h,privacy_policy_agreement:b,last_used_project:f,email_confirmation:E,email_builder_config:v}}function r({autosaves:e,theme:t,newsletter_consent:l,code_editor:a,counters:r,subscription:n,subscription_end:i,recurring_payments:s,subscription_id:d,promocode:c,subscription_amount:m,enterprise_users_limit:u,enterprise_price:p,enterprise_12_price:g,privacy_policy_agreement:h,locale:b,last_used_project:f,email_confirmation:E,email_builder_config:v,id:_,...y}){return{...y,id:(0,o.mQ)(_),locale:b,acf:{autosaves:e,theme:t,newsletter_consent:l,code_editor:a?{...a,font_size:String(a.font_size)}:void 0,counters:r,subscription:n,subscription_end:i,recurring_payments:s,subscription_id:d,promocode:c,subscription_amount:m,enterprise_users_limit:u,enterprise_price:p,enterprise_12_price:g,privacy_policy_agreement:h,last_used_project:f,email_confirmation:E,email_builder_config:v}}}},71854:(e,t,l)=>{"use strict";l.d(t,{QM:()=>s,oF:()=>g,q2:()=>u,xi:()=>p});var o=l(94049),a=l.n(o),r=l(99152),n=l(65053),i=l(47638);function s(e,t){const l=document.createElement("input");l.type="file",l.accept=e,l.multiple=!1,l.setAttribute("data-testid","uploadFile"),l.style.position="absolute",l.style.opacity="0",l.style.pointerEvents="none",document.body.appendChild(l),l.onchange=()=>{var e;null!==(e=l.files)&&void 0!==e&&e.length&&t(l.files),document.body.removeChild(l)},l.click()}const d="index.html";function c(e,t){return e.find(function(e){return e.name.toLowerCase().endsWith(t)})}async function m(e,t,l){return await(0,r.An)(e,async e=>{const o=e.document;await(0,r.bc)(o,async e=>{e=e.replace("\\","/");const l=(0,r.$l)(e);return t(e,l)}),l&&l(e)})}async function u(e,t,o){if(!e)return;switch(function(e){const t=e.split(".");return t[t.length-1].toLowerCase()}(e.name)){case"zip":return async function(e,t,l){const o=new(a()),{files:n}=await o.loadAsync(e),i=Object.keys(n).map(e=>n[e]),s=n[d]||c(i,d)||c(i,".html")||c(i,".htm");if(s){const e=s.name.split("/"),o=document.location.pathname.split("/"),a=document.location.origin+o.slice(0,o.length-e.length).join("/")+"/",i=await s.async("text"),d=e.slice(0,e.length-1).join("/");return await(0,r.An)(i,async e=>{const o=e.document;await(0,r.bc)(o,async e=>{(e=e.replace("\\","/")).startsWith(".")&&(e=e.substring(1)),e.startsWith("/")&&(e=e.substring(1)),e.startsWith(a)&&(e=e.substring(a.length)),d&&!e.match("^(ht|f)tp(s?)://")&&(e=`${d}/${e}`);const l=n[e];if(l){const e=l.name,o=await l.async("blob");return t(o,e)}const o=(0,r.$l)(e);return t(e,o)}),l&&l(e)})}}(e,t,o);case"eml":{const a=await e.text(),{readEml:r}=await l.e(4309).then(l.bind(l,84309)),n=r(a);if(n instanceof Error)throw n;const i="string"===typeof n?n:n.html;if("undefined"===typeof i){throw new Error("Eml does not contain text/html")}return m(i,t,o)}default:return m(await e.text(),t,o)}}const p=(e,t,l,o)=>async(a,r)=>{try{const s=await async function(e,t){if("string"!==typeof e)return e;try{const l=(0,n.Ay)(e),o=await t({url:l});return null===o||void 0===o||o.data,(null===o||void 0===o?void 0:o.data)||null}catch{return null}}(a,e);if(!s)return"string"===typeof a?a:"";const d=function(e,t,l){if(!e||"string"!==typeof e)return`default.${l.extension(t)||"bin"}`;if(e.split(".").length<2){const o=l.extension(t);if(o)return`${e}.${o}`}return e}(r,s.type,i),c=new File([s],d.toLowerCase());return function(e,t){var l,o,a,r;return!e||e.error||400===(null===(l=e.data)||void 0===l||null===(o=l.data)||void 0===o?void 0:o.status)?"string"===typeof t?t:"":null!==(a=e.data)&&void 0!==a&&null!==(r=a[0])&&void 0!==r&&r.file_url?e.data[0].file_url:"string"===typeof t?t:""}(await t({user_id:l.id,folder:o.id,file:c}),a)}catch(s){return"string"===typeof a?a:""}},g=e=>t=>{const l=t.document;l.title=(null===l||void 0===l?void 0:l.title)||(0,r.Ay)(e.name)[0]}},72717:(e,t,l)=>{"use strict";l.d(t,{R:()=>s});var o=l(99282),a=l(98792),r=l(19581),n=l(61631);class i extends o.vl{constructor(e={}){super(),this._mutationSummary=void 0,this._mutationSummary=new a.MutationSummary({...e,observeOwnChanges:!0,callback:e=>this.fire(e),queries:[{all:!0}]})}dispose(){this._mutationSummary.disconnect(),super.dispose()}trigger(e){const t=this._mutationSummary.takeSummaries();return(e||null!==t&&void 0!==t&&t.length)&&this.fire(t||[]),t}}class s extends n.j{_nextTickHandler(){(0,r.A)(()=>{this.trigger(),this._summaries.length&&(this._innerEmitter.hasListeners()?this._innerEmitter.fire(this._summaries):this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)}constructor(e={}){super(),this._mutationEmitter=void 0,this._innerEmitter=this.addDisposable(new o.vl({onFirstListenerAdd:()=>{this._nextTickHandler()}})),this._lostEmitter=this.addDisposable(new o.vl),this._paused=0,this._stopped=0,this._summaries=[],this.onMutate=this._innerEmitter.event,this.onLost=this._lostEmitter.event,this.onNativeMutate=void 0,this._mutationEmitter=this.addDisposable(new i(e)),this.onNativeMutate=this._mutationEmitter.event,this.addDisposable(this._mutationEmitter.event(e=>{this._stopped||(this._paused?this._lostEmitter.fire(e):(this._summaries.push(...e),(0,r.A)(()=>{this._summaries.length&&!this._innerEmitter.hasListeners()&&(this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)))}))}get isStoped(){return this._paused>0||this._stopped>0}stop(){this._mutationEmitter.trigger(),this._stopped++}start(){this._mutationEmitter.trigger(),this._stopped--}pause(){this._mutationEmitter.trigger(),this._paused++}resume(){this._mutationEmitter.trigger(),this._paused--}trigger(){this._mutationEmitter.trigger(!0)}}},72762:(e,t,l)=>{"use strict";l.d(t,{f:()=>h});var o=l(32947),a=l(15626),r=l(52919),n=l(90614),i=l(86095),s=l(70687),d=l(73180),c=l(98173),m=l(1047),u=l(12741),p=l(2604),g=l(4981);const h=(e,t)=>{var l,h,b,f,E;const v=(0,p.wA)(),_=(0,i.fn)(),y=(0,r.QC)(),A=(0,n.ml)(a.AZ.WILL_EMAIL_INIT_ID),S=(0,n.ml)(a.AZ.ON_EMAIL_INIT_ID),k=(0,n.ml)(a.AZ.ON_CONTENT_CHANGED_ID),w=(0,n.ml)(a.AZ.ON_EMAIL_CHANGED_ID),C=(0,n.ml)(a.AZ.ON_MODEL_CHANGE),B=(0,c.useRef)(!1),x=(0,c.useRef)(void 0);x.current=e,(0,c.useEffect)(()=>{const l=x.current;if(o.EW.isPlugin&&!B.current&&(null===e||void 0===e?void 0:e.renderGuid)===(null===l||void 0===l?void 0:l.renderGuid)&&null!==l&&void 0!==l&&l.is_inited&&l){const e=_.getValue();w.fire({...l,id:t||l.isNew?void 0:l.id,html:e})}},[_,null===e||void 0===e?void 0:e.preheader,null===e||void 0===e?void 0:e.common_styles,null===e||void 0===e?void 0:e.subject,(null===e||void 0===e||null===(l=e.utm_parameters)||void 0===l?void 0:l.utm_campaign)||"",(null===e||void 0===e||null===(h=e.utm_parameters)||void 0===h?void 0:h.utm_content)||"",(null===e||void 0===e||null===(b=e.utm_parameters)||void 0===b?void 0:b.utm_medium)||"",(null===e||void 0===e||null===(f=e.utm_parameters)||void 0===f?void 0:f.utm_source)||"",(null===e||void 0===e||null===(E=e.utm_parameters)||void 0===E?void 0:E.utm_term)||"",w,t]),(0,d.ZC)(([e])=>{e!==_&&C.fire(_)},[_,C]),(0,c.useEffect)(()=>{if(o.EW.isPlugin){const l=_.onDidChangeContent(()=>{const l=x.current;if(!B.current&&(null===e||void 0===e?void 0:e.renderGuid)===(null===l||void 0===l?void 0:l.renderGuid)&&l){const e=_.getValue();k.fire(e),w.fire({...l,id:t||l.isNew?void 0:l.id,html:e})}});return()=>l.dispose()}},[_,k,w,e,t]);const T=(0,c.useCallback)(async()=>{const e=x.current;try{var t;(0,s.po)(_),_.setValue((null===e||void 0===e||null===(t=e.html)||void 0===t?void 0:t.replaceAll("\r\n","\n"))||"")}finally{(0,s.SF)(_)}const l=_.getValue();await y.sendAsync(o.Ru.SANDBOX_SET_ENTITY,{html:l,guid:e.renderGuid})},[_,y]),R=(0,c.useCallback)(async()=>{const e=x.current;await y.sendAsync(o.Ru.SANDBOX_SET_ENTITY,{html:_.getValue(),guid:e.renderGuid})},[_,y]),N=(0,c.useCallback)(async()=>{const e=x.current;void 0!==e.preheader&&await y.sendAsync(o.Ru.SANDBOX_PREHEADER_UPDATE,{value:e.preheader,guid:e.renderGuid,force:!0})},[y]),L=(0,c.useCallback)(async()=>{const e=x.current;void 0!==e.subject&&await y.sendAsync(o.Ru.SANDBOX_SUBJECT_UPDATE,{value:e.subject,guid:e.renderGuid,force:!0})},[y]),I=(0,c.useCallback)(()=>{const e=x.current;return y.sendAsync(o.Ru.SANDBOX_INITED,{guid:e.renderGuid})},[y]),P=(0,c.useCallback)(e=>{const l=x.current;v(void 0===l.id?(0,u.Uh)(!0):(0,m.Wm)(!0));const o={...l,id:t||l.isNew?void 0:l.id,html:_.getValue()};return e&&(o.reset=!0),S.fire(o)},[v,S,_,t]),O=(0,c.useCallback)(()=>{const e=x.current;return y.sendAsync(o.Ru.SANDBOX_INIT_START,{guid:e.renderGuid})},[y]),F=(0,c.useCallback)(()=>{const e=x.current;return A.fire({...e,id:t||e.isNew?void 0:e.id,html:_.getValue()})},[A,_,t]),[M]=(0,d.cM)(function*(){try{B.current=!0,yield*(0,g.T1)(O),yield*(0,g.T1)(F),yield*(0,g.T1)(T),yield*(0,g.T1)(N),yield*(0,g.T1)(L),yield*(0,g.T1)(I),yield*(0,g.T1)(P)}finally{B.current=!1}},[T,N,L,P,F,O,I]),[D]=(0,d.cM)(function*(){try{yield*(0,g.T1)(O),yield*(0,g.T1)(F),yield*(0,g.T1)(R),yield*(0,g.T1)(N),yield*(0,g.T1)(L),yield*(0,g.T1)(I),yield*(0,g.T1)(P)}catch(e){}},[T,N,L,P,F,O,I]);(0,d.ZC)(async([t])=>{const l=null===e||void 0===e?void 0:e.renderGuid;l&&l!==t&&M()},[null===e||void 0===e?void 0:e.renderGuid,M]),(0,c.useEffect)(()=>{const e=y.addListenerAsync(o.Ru.RELOAD,async()=>{await D()});return()=>e.dispose()},[y,D])}},73180:(e,t,l)=>{"use strict";l.d(t,{ZC:()=>r,cM:()=>n,mx:()=>i});var o=l(98173),a=l(4981);const r=(e,t)=>{const l=(0,o.useRef)(void 0);l.current=e;const a=(0,o.useRef)(void 0);(0,o.useEffect)(()=>{null!==a.current&&l.current(a.current||[]),a.current=t},t)};function n(e,t){const l=(0,o.useRef)(void 0),r=(0,o.useCallback)(()=>{const e=l.current;e&&(0,a.eF)(e.halt)},[]);(0,o.useEffect)(()=>()=>r(),[r]);const n=(0,o.useCallback)(e,t);return[(0,o.useCallback)((...e)=>{r();const t=(0,a.eF)(()=>n(...e));return l.current=t,t},[r,n]),r]}function i(e,t){const[l,a]=(0,o.useState)(void 0),r=(0,o.useRef)(!0);return(0,o.useEffect)(()=>(r.current=!0,a(void 0),e().then(e=>{r.current&&a(e)}),()=>{r.current=!1}),t),l}},74372:e=>{e.exports=({__:e})=>`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>\n <amp-carousel width="800" height="600" layout="responsive" type="slides" controls>\n <amp-img src="${e("https://cdn.useblocks.io/1351/241031_18_JoH0f3E.png")}" width="800" height="600" layout="responsive" alt=""></amp-img>\n <amp-img src="${e("https://cdn.useblocks.io/1351/241031_18_aJAY1Xz.png")}" width="800" height="600" layout="responsive" alt=""></amp-img>\n <amp-img src="${e("https://cdn.useblocks.io/1351/241031_18_OQEyMEF.png")}" width="800" height="600" layout="responsive" alt=""></amp-img>\n </amp-carousel>\n</td></tr></table>`},75424:e=>{e.exports='<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n\n .em-mob-wrap {\n display: block!important;\n }\n\n .em-mob-padding_right-20 {\n padding-right: 20px!important;\n }\n \n .em-mob-padding_left-20 {\n padding-left: 20px!important;\n }\n\n .em-mob-height-20px {\n height: 20px!important;\n }\n }\n</style>\n<tr em="block" class="em-structure">\n <td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">\n <table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">\n <tr>\n <td width="280" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n <td width="20" class="em-mob-wrap em-mob-height-20px"></td>\n <td width="280" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n </tr>\n </table>\n </td>\n</tr>'},75995:e=>{e.exports=({__:e})=>`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>\n <table class="em-element-list-ul" cellpadding="0" cellspacing="0" border="0" width="100%">\n <tr>\n <td align="left" valign="top" width="20">\n <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">&bull;</div>\n </td>\n <td align="left" valign="top" style="padding-bottom: 5px; padding-left: 1px;">\n <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>\n </td>\n </tr>\n </table>\n</td></tr></table>`},77199:()=>{},79890:(e,t,l)=>{"use strict";l.d(t,{A:()=>T});var o=l(98173),a=l(40120),r=l(69550),n=l(201),i=l(8218),s=l(49823),d=l(67107),c=l(2604),m=l(30150),u=l(12543),p=l(65716),g=l(98845),h=l(68984),b=l(22536),f=l(1047),E=l(40277),v=l(27941),_=l(32947),y=l(84572),A=l(15450);const{useToken:S}=a.A,{name:k,type:w,tags:C,group:B}={name:"name",type:"type",tags:"tags",group:"group"},x={[k]:"",[w]:[],[C]:[],[B]:[]},T=({isBlocks:e=!1,templateEmailId:t=!1})=>{const{__:l}=(0,u.s9)(),{projectId:a}=(0,m.g)(),[T]=r.A.useForm(),{data:R}=(0,h.h1)(),N=(0,c.wA)(),L=(0,c.d4)(b.b9),I=(0,c.d4)(f.CT),P=(0,c.d4)(y.GD),{token:O}=S(),F=(0,c.Pj)(),M=(0,v.rD)(),D=e?L:I,{isSuccess:V,data:W}=p.Nq.endpoints.getProject.select(+a)(F.getState(),{skip:t}),{isSuccess:j,data:z}=(0,g.sl)(+t,{skip:!t}),H=(0,o.useCallback)(()=>{N(e?(0,b.om)({}):(0,f.om)({}))},[N,e]);(0,o.useEffect)(()=>{H()},[H]),(0,o.useEffect)(()=>{},[j,z,t]),(0,o.useEffect)(()=>{},[V,W,e,t]);const[G,U]=(0,o.useState)([]);let q;(0,o.useEffect)(()=>{if(R){const e=R.schema.properties.acf.properties.type.items.enum;let t=[];for(let o in e)t.push({label:l(_.jg[e[o]]),value:e[o]});U(t)}},[R,l]);const[X,$]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{const l=t?j&&(0,E._q)(z,_.zh).filter(e=>{var t;return null===D||void 0===D||null===(t=D.tags)||void 0===t?void 0:t.includes(e.id)}).map(e=>e.name)||[]:V&&(0,E._q)(W,e?_.YY:_.zh).filter(e=>{var t;return null===D||void 0===D||null===(t=D.tags)||void 0===t?void 0:t.includes(e.id)}).map(e=>e.name)||[];T.setFieldsValue({tags:l})},[V,D,e,T,W,j,z,t]),(0,o.useEffect)(()=>{T.setFieldsValue({group:P})},[T,P]),o.createElement("div",{className:"cards-search"},o.createElement(r.A,{form:T,name:"cards_search_form",initialValues:{...x},onValuesChange:l=>{const o=Object.keys(l)[0],a=T.getFieldsValue(!0);switch(o){case C:const r=t?(0,E._q)(z,_.zh).filter(e=>l[o].includes(e.name)).map(e=>e.id)||null:(0,E._q)(W,e?_.YY:_.zh).filter(e=>l[o].includes(e.name)).map(e=>e.id)||null;N(e?(0,b.om)({...D,tags:r}):(0,f.om)({...D,tags:r}));break;case w:N(e?(0,b.om)({...D,type:a.type||null}):(0,f.om)({...D,type:a.type||null}));break;case k:q&&window.clearTimeout(q),q=window.setTimeout(function(){N(e?(0,b.om)({...D,name:a.name}):(0,f.om)({...D,name:a.name}))},100);break;case B:N(e?(0,b.om)({...D,group:a.group||null}):(0,f.om)({...D,group:a.group||null}))}},autoComplete:"off"},o.createElement(n.A,{wrap:!1,gutter:0},o.createElement(r.A.Item,{className:"cards-search__by-title",name:k},o.createElement(i.A,{placeholder:l("Search by title"),allowClear:!0,variant:"borderless",size:"large",prefix:o.createElement(A.V,{size:22,strokeWidth:M.iconStrokeWidth,className:"cards-search__search-icon",style:{cursor:"pointer"}})})),e&&o.createElement(r.A.Item,{className:"cards-search__type-select",name:w,rules:[{message:l("Please choose the block type")}]},o.createElement(s.A,{placeholder:l("Filter by type"),options:G,getPopupContainer:e=>e.parentNode,suffixIcon:o.createElement(d.A,{style:{fontSize:"16px",color:O.colorText},onClick:()=>$(!X),className:"input-icon"}),allowClear:!0,open:X,onDropdownVisibleChange:e=>{$(e)}})))))}},79966:(e,t,l)=>{"use strict";l.d(t,{A:()=>z});var o=l(98173),a=l(40120),r=l(35491),n=l(49856),i=l(13785),s=l(37969),d=l(98447),c=l(38927),m=l(38826),u=l(27264),p=l(2604),g=l(30150),h=l(52218),b=l.n(h),f=l(12543),E=l(52995),v=l(8807),_=l(48956),y=l(5558),A=l(23424),S=l(47014),k=l(54838),w=l(1047),C=l(22536),B=l(84572),x=l(98845),T=l(68984),R=l(40835),N=l(32947),L=l(55835),I=l(80223),P=l(52919),O=l(86095),F=l(27941),M=l(89613),D=l(90614),V=l(15626);const W=o.createElement(m.A,{style:{fontSize:20},spin:!0}),{useToken:j}=a.A,z=({emailElement:e,isCollaborationEditor:t})=>{var l,a,h,z;const{__:H}=(0,f.s9)(),G=(0,p.wA)(),U=(0,P.XW)(),{emailId:q,blockId:X}=(0,g.g)(),$=(0,p.d4)(A.cL),[Z,Y]=(0,o.useState)(!1),[K,Q]=(0,R.Zf)(),J=(0,g.Zp)(),ee=(0,p.d4)(S.C1),[te]=(0,x.YE)(q),[le]=(0,T.lx)(X),{owner:oe}=(0,I.A)(),ae=(0,O.fn)(),re=(0,O.aD)(ae),ne=(0,O.TW)(ae),ie=(0,p.d4)(k.Wm),se=(0,p.d4)(k.Fv),de=(0,p.d4)(k.yy),{token:ce}=j(),{modal:me}=r.A.useApp(),ue=(0,y.hN)(),{confirm:pe}=me,ge=(0,F.rD)(),he=e.hasOwnProperty("type")?N.IE:N.Tm,be=(0,D.ml)(V.AZ.ON_SHARE_ID),fe=(0,D.ml)(V.AZ.ON_SHOW_PREVIEW_ID),[Ee,ve]=(0,o.useState)(!1),[_e,ye]=(0,o.useState)(0),Ae=(0,p.d4)(B.yN);let Se=!(0,p.d4)(S.B$)&&(null===(l=ee.id)||void 0===l?void 0:l.toString())===(null===Ae||void 0===Ae||null===(a=Ae.members)||void 0===a?void 0:a.owner.ID)&&!0;const ke=(0,M.u)(),we=q?"emailId":"blockId",Ce=null===e||void 0===e?void 0:e.project,Be=t=>{const l=he===N.IE?"block":"email";"string"===typeof t?(G((0,k.Uf)(t)),!se&&G((0,k.vs)())):G((0,k.vs)()),ke({event:"activate",action:"activate_code_mode",entity_type:l,entity_id:(null===e||void 0===e?void 0:e.id)||q||X,project_id:(null===e||void 0===e?void 0:e.project)||Ce}),setTimeout(()=>{he===N.IE?G((0,C.A9)({type:null})):G((0,w.A9)({type:null}))},300),U({operation:N.Ru.SANDBOX_ELEMENT_ACTIVE_RESET}),Se&&(ve(!0),ye(1))},xe=(0,o.useCallback)(()=>{pe({title:H("Available on the Personal plan and higher."),icon:o.createElement(u.A,null),content:o.createElement("div",{style:{maxWidth:"330px"}},H("Upgrade your plan to use this feature")),centered:!0,okText:H("Choose your plan"),cancelText:H("Close & continue"),width:"unset",onOk(){J("/billing")},onCancel(){}})},[J,H,pe]);(0,o.useEffect)(()=>{Q.isError&&(ue.error(Q),Y(!1))},[Q]),(0,o.useEffect)(()=>{if(Q.isSuccess&&Z){var e;if(401===(null===(e=Q.data)||void 0===e?void 0:e.status))ue.error({message:Q.data.code,description:Q.data.message});else if(Q.data){let e=document.createElement("A");e.setAttribute("target","_blank"),e.setAttribute("href",Q.data.message),e.click()}Y(!1)}},[Q,Z,ue]);const[Te,Re]=(0,o.useState)(!1),Ne=()=>{U({operation:N.Ru.SANDBOX_LOCK_EDIT,data:ie}),G((0,k.mi)(!ie))},Le=q?te:le;let Ie=[];const Pe=(0,o.useCallback)(async()=>{const e=await fe.fire({project:Ce,id:q});!1!==e.find(e=>!1===e||"string"===typeof e)&&window.open(e.find(e=>e)||`/email/${q}/raw?key=${b()(`${Ce}${q}${N.KI}`)}`)},[fe,Ce,q]),Oe=(0,o.useCallback)(async()=>{window.open(`/getemail/${q}?secret_hash=${b()(`${Ce}${q}${N.KI}`)}&raw=true`)},[Ce,q]);ge.previewModeEnabled&&Ie.push({key:"Preview_mode",icon:o.createElement(v.A,{icon:"EyeOutlined",size:18,strokeWidth:ge.iconStrokeWidth}),label:H("Preview mode"),onClick:Pe}),ge.livePreviewEnabled&&Ie.push({key:"Live_preview",icon:Z?o.createElement(m.A,{style:{fontSize:16}}):o.createElement(v.A,{icon:"CheckCircleVerified",size:18,strokeWidth:ge.iconStrokeWidth}),label:H("Live preview"),onClick:(null===(h=ee.id)||void 0===h?void 0:h.toString())===(null===(z=e.project_author)||void 0===z?void 0:z.toString())&&"community"===ee.subscription.post_name&&oe?xe:()=>{if(!Z){const t={email:q,subject:encodeURIComponent("#"+e.project+" "+e.title).replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A"),content:encodeURIComponent((null===ae||void 0===ae?void 0:ae.getValue())||"").replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A")};K(t),Y(!0)}}}),ge.webversionEnabled&&Ie.push({key:"Web version",icon:o.createElement(v.A,{icon:"Web",size:18,strokeWidth:ge.iconStrokeWidth}),label:H("Web version"),onClick:Oe}),ge.sharePreviewEnabled&&Ie.push({key:"Share",icon:o.createElement(v.A,{icon:"ShareAltOutlined",size:18,strokeWidth:ge.iconStrokeWidth}),label:H("Share"),onClick:async()=>{const e=(await be.fire({project:Ce,id:q})).find(e=>!1===e||"string"===typeof e);!1!==e&&navigator.clipboard.writeText(e||`https://app.emailmaker.ru/email/${q}/raw?key=${b()(`${Ce}${q}${N.KI}`)}`).then(()=>{ue.success(H("A shareable link to this page has been copied to the clipboard."))})},className:"em-analytics__email-share"});const Fe=[{key:"Left_mode",icon:o.createElement(v.A,{icon:"PanelLeft",size:18,strokeWidth:ge.iconStrokeWidth,style:{color:"left"===de&&se?ce.colorPrimary:"inherit"}}),label:H("Left Code panel"),onClick:()=>Be("left")},{key:"Right_mode",icon:o.createElement(v.A,{icon:"PanelLeft",size:18,strokeWidth:ge.iconStrokeWidth,style:{transform:"rotate(180deg)",color:"right"===de&&se?ce.colorPrimary:"inherit"}}),label:H("Right Code panel"),onClick:()=>Be("right")},{key:"Bottom_mode",icon:o.createElement(v.A,{icon:"PanelLeft",size:18,strokeWidth:ge.iconStrokeWidth,style:{transform:"rotate(-90deg)",color:"bottom"===de&&se?ce.colorPrimary:"inherit"}}),label:H("Bottom Code panel"),onClick:()=>Be("bottom")}];return o.createElement("div",{className:"email-preview-menu email-preview-menu_new"},o.createElement(n.A,{size:32},o.createElement(n.A,{className:"email-preview-menu__versions",size:8,style:{borderRadius:"calc(var(--borderRadius) * 1px"}},o.createElement(i.A,{title:H(t?L.LJ:"Undo (Ctrl+Z)"),placement:"bottom"},o.createElement(s.Ay,{type:"text",icon:o.createElement(v.A,{icon:"UndoOutlined",size:22,strokeWidth:ge.iconStrokeWidth}),onClick:()=>{re.undo()},disabled:!ne.canUndo})),o.createElement(i.A,{title:H(t?L.LJ:"Redo (Ctrl+Shift+Z)"),placement:"bottom"},o.createElement(s.Ay,{type:"text",icon:o.createElement(v.A,{icon:"RedoOutlined",size:22,strokeWidth:ge.iconStrokeWidth}),onClick:()=>{re.redo()},disabled:!ne.canRedo})),ge.historyEnabled&&o.createElement(i.A,{title:H("Version history"),placement:"bottom"},o.createElement(s.Ay,{type:ie?"text":"primary",ghost:!ie,onClick:()=>{ie?(Re(!0),Le({[we]:null===e||void 0===e?void 0:e.id}).then(t=>{t.isSuccess?0===t.data.data.length&&ue.error({message:H("No history records available.")}):t.isError&&ue.error(t),Ne(),G((0,k.PM)(N.Vv)),Re(!1),ke({event:"open",action:"open_version_control",entity_type:he===N.IE?"block":"email",entity_id:(null===e||void 0===e?void 0:e.id)||q||X,project_id:(null===e||void 0===e?void 0:e.project)||Ce}),Se&&(ve(!0),ye(4))})):(G((0,k.Fk)()),Ne())},disabled:e.isNew||Te,className:"email-preview-menu__history",icon:Te?o.createElement(d.A,{indicator:W}):o.createElement(o.Fragment,null,o.createElement(v.A,{icon:"HistoryOutlined",size:22,strokeWidth:ge.iconStrokeWidth,className:"email-preview-menu__list-item-icon email-preview-menu__list-item-icon_revert"}),Se&&o.createElement(v.A,{icon:"Lock",size:14,strokeWidth:ge.iconStrokeWidth,className:"free-mode-firewall-icon"}))}))),o.createElement(n.A,{size:8,style:{borderRadius:"calc(var(--borderRadius) * 1px"}},ge.codeEnabled&&o.createElement(c.A,{arrow:!0,key:"Code mode",placement:"bottom",menu:{items:Fe},trigger:"hover",mouseEnterDelay:0,className:"email-preview-menu__code"},o.createElement(s.Ay,{type:se?"primary":"text",ghost:se,icon:o.createElement(o.Fragment,null,o.createElement(v.A,{icon:"Code",size:22,strokeWidth:ge.iconStrokeWidth}),Se&&o.createElement(v.A,{icon:"Lock",size:14,strokeWidth:ge.iconStrokeWidth,className:"free-mode-firewall-icon"})),onClick:Be})),ge.previewIconEnabled&&o.createElement(c.A,{arrow:!0,key:"Preview",placement:"bottom",menu:{items:Ie},className:"email-preview-menu__preview"},o.createElement(s.Ay,{type:"text",target:"_blank",rel:"noreferrer",icon:ge.previewModeEnabled?o.createElement("span",{onClick:Pe,style:{fontSize:"18px",color:ce.colorText}},o.createElement(v.A,{icon:"EyeOutlined",size:22,strokeWidth:ge.iconStrokeWidth,className:"email-preview-menu__list-item-icon"})):o.createElement(v.A,{icon:"EyeOutlined",size:22,strokeWidth:ge.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),disabled:!ne.canUndo})),ge.sendTestEnabled&&o.createElement(i.A,{title:H("Send a test email"),placement:"bottom"},o.createElement(s.Ay,{className:"em-analytics__email-open-test email-preview-menu__test",type:"text",icon:o.createElement(v.A,{icon:"SendOutlined",size:22,strokeWidth:ge.iconStrokeWidth}),onClick:()=>{G((0,A.qf)(N.lx.SEND_TEST_EMAIL))}})))),o.createElement(E.A,{isModalVisible:$===N.lx.SEND_TEST_EMAIL,email:e}),o.createElement(_.A,{open:Ee,onCancel:()=>{ie||(Ne(),G((0,k.Fk)())),se&&G((0,k.vs)()),ve(!1)},initialSlide:_e}))}},80148:(e,t,l)=>{"use strict";l.d(t,{A$:()=>g,Ff:()=>d,IP:()=>s,My:()=>i.My,NF:()=>c,Nj:()=>u,lg:()=>m,rl:()=>p});var o=l(98173),a=l(2604),r=l(88296),n=l(74568),i=l(73942);const s=i.if,d=(e,t)=>{if(!e){const e=n.Q.createChild(),t=(0,r.Q)();return n.Q.inject(t,e),t}return e};function c(){const e=(0,a.Pj)();return(0,o.useMemo)(()=>(0,i.My)(e),[e])}function m(){const e=(0,a.Pj)(),t=(0,i.My)(e);return function(e,l){t.inject(e,l)}}function u(e){const t=(0,a.Pj)();return(0,i.My)(t).getInstance(e)}function p(e){const[t,l]=(0,o.useState)(),r=(0,a.Pj)(),n=(0,o.useRef)(Promise.resolve()),s=(0,i.My)(r);return(0,o.useEffect)(()=>{const t=n.current=n.current.then(()=>s.getInstanceAsync(e)).then(e=>{t===n.current&&l(e)},e=>{})},[l,e,r,s]),t}function g(e){const t=(0,a.Pj)();return(0,i.My)(t).getServices(e)}},80223:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var o=l(98173),a=l(30150),r=l(2604),n=l(47014),i=l(65716);const s=e=>{const t=(0,r.d4)(n.C1),[l,s]=(0,o.useState)({owner:!1,admin:!1}),d=(0,a.KC)(),{data:c}=(0,i.fo)(e,{skip:!e||!t.id||!(null!==d&&void 0!==d&&d.isUninitialized)}),m=(null===d||void 0===d?void 0:d.data)||c;return(0,o.useEffect)(()=>{if(m){var e,l;const{owner:o,admins:a,users:r}=m.members,n=a?a.map(e=>e.ID):a,i=r?r.map(e=>e.ID):r;s({owner:(null===(e=o.ID)||void 0===e?void 0:e.toString())===(null===(l=t.id)||void 0===l?void 0:l.toString()),admin:n&&n.includes(t.id),user:i&&i.includes(t.id)})}},[m,t.id]),l}},80465:e=>{e.exports=({__:e})=>`<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n }\n</style>\n<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>\n <table class="em-element-list-ol" cellpadding="0" cellspacing="0" border="0" width="100%">\n <tr>\n <td align="left" valign="top" width="20">\n <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">1.&nbsp;</div>\n </td>\n <td align="left" valign="top" style="padding-bottom: 5px; padding-left: 1px;">\n <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>\n </td>\n </tr>\n </table>\n</td></tr></table>`},80599:(e,t,l)=>{"use strict";l.d(t,{H:()=>o});class o{constructor(e){this._voidElements=void 0,this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}}},80772:(e,t,l)=>{"use strict";l.d(t,{Ac:()=>g,Ay:()=>h,BK:()=>m,Uf:()=>p,Yw:()=>d,e_:()=>c,js:()=>u,tm:()=>s});var o=l(1029),a=l(93778);const r="imageSlice",n=(0,a.ur)({currentImage:"",currentBackground:"",currentImageName:""}),i=(0,o.createSlice)({name:r,initialState:n,reducers:{setCurrentImageName(e,t){e.currentImageName=t.payload},setCurrentImage(e,t){e.currentImage=t.payload},setCurrentBackground(e,t){e.currentBackground=t.payload},clearCurrentImages(e,t){e.currentImage="",e.currentBackground="",e.currentImageName=""}}}),{setCurrentImage:s,setCurrentImageName:d,setCurrentBackground:c,clearCurrentImages:m}=i.actions,u=e=>e[r].currentImage,p=e=>e[r].currentImageName,g=e=>e[r].currentBackground,h=i},80877:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var o=l(98173),a=l(42490);const r=o.forwardRef((e,t)=>{const[l,r]=(0,o.useState)(!1),[n,i]=(0,o.useState)(0),[s,d]=(0,o.useState)(e.value||e.defaultValue),[c,m]=(0,o.useState)(e.value||e.defaultValue),u=()=>r(!1),p=(0,o.useCallback)(t=>{if(l){const l=t.clientX-n;let o=(s||0)+l*e.dragspeed;o=Math.max(0,Math.round(o)),e.max&&(o=Math.min(o,e.max)),void 0!==e.min&&(o=Math.max(o,e.min)),m(o),e.onChange&&e.onChange(o)}},[l,e,s,n]);return(0,o.useEffect)(()=>{e.value||0===e.value?m(e.value):e.defaultValue||0===e.defaultValue?m(e.defaultValue):m(null)},[e.value,e.defaultValue]),(0,o.useEffect)(()=>(document.addEventListener("mouseup",u),document.addEventListener("mousemove",p),()=>{document.removeEventListener("mouseup",u),document.removeEventListener("mousemove",p)}),[l,n,s,p]),o.createElement("div",{onMouseDown:e=>{var t,l;e.target.hasAttribute("class")&&null!==(t=e.target)&&void 0!==t&&null!==(l=t.className)&&void 0!==l&&l.includes("ant-input-number-affix-wrapper")&&(r(!0),i(e.clientX),d(c))}},o.createElement(a.A,Object.assign({},e,{ref:t,value:c,className:"input-draggable"})),l&&o.createElement("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",cursor:"ew-resize"},onMouseUp:u}))});r.defaultProps={dragspeed:1};const n=r},81551:(e,t,l)=>{"use strict";l.d(t,{Q:()=>o.Q});var o=l(74568)},81843:(e,t,l)=>{"use strict";l.d(t,{OI:()=>i,yc:()=>n});var o=l(28618),a=l(33105),r=l(83238);function n(){return o.QE.get(a.$D)}function i(){return o.QE.get(r.L)}},82899:(e,t,l)=>{"use strict";l.d(t,{f:()=>a});var o=l(72510);function a(e){for(const a of e){if(a.removed)for(const e of a.removed){const l=a.getOldParentNode(e),o=a.getOldPreviousSibling(e);if(l){var t;const a=null!==(t=null===o||void 0===o?void 0:o.nextSibling)&&void 0!==t?t:null;l.insertBefore(e,a)}}if(a.added)for(const e of a.added)e.parentNode&&e.parentNode.removeChild(e);if(a.reordered)for(const e of a.reordered){const t=a.getOldParentNode(e),o=a.getOldPreviousSibling(e);if(t){var l;const a=null!==(l=null===o||void 0===o?void 0:o.nextSibling)&&void 0!==l?l:null;t.insertBefore(e,a)}}if(a.attributeChanged)for(const e of Object.keys(a.attributeChanged))for(const t of a.attributeChanged[e]){const l=a.getOldAttribute(t,e);null==l?t.removeAttribute(e):t.setAttribute(e,l)}if(a.characterDataChanged)for(const e of a.characterDataChanged)((0,o.ir)(e)||(0,o.Cn)(e)||(0,o.Cn)(e))&&(e.data=a.getOldCharacterData(e))}}},84572:(e,t,l)=>{"use strict";l.d(t,{AQ:()=>E,Ay:()=>y,BN:()=>u,GD:()=>h,RP:()=>f,Rw:()=>b,Rz:()=>_,es:()=>m,mb:()=>p,od:()=>c,qV:()=>v,yN:()=>g});var o=l(1029),a=l(93778),r=l(65716),n=l(98845);const i=(0,a.ur)({project:null,activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),s="projectSlice",d=(0,o.createSlice)({name:s,initialState:i,reducers:{setProject:(e,{payload:t})=>{e.project=t},setActiveGroupsTags:(e,{payload:t})=>{e.activeGroupsTags=t,t.length&&(e.activeProjectGroupsTags=[])},setActiveProjectGroupsTags:(e,{payload:t})=>{e.activeProjectGroupsTags=t,t.length&&(e.activeGroupsTags=[])},resetAllTags:e=>{e.activeProjectGroupsTags=[],e.activeGroupsTags=[]}},extraReducers:e=>{e.addMatcher(r.Nq.endpoints.getProject.matchFulfilled,(e,{payload:t})=>{e.project={...i.project,...t}}),e.addMatcher(r.Nq.endpoints.editProject.matchFulfilled,(e,{payload:t})=>{e.project={...i.project,...t}}),e.addMatcher(n.GY.endpoints.getTemplateEmails.matchFulfilled,(e,{payload:t,meta:l})=>{const{projectId:o}=l.arg.originalArgs;var a,r,n;o?(e.groupsTemplateProjectTotal=+(null===(a=l.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-Total")),e.groupsTemplateProjectTotalPages=+(null===(r=l.baseQueryMeta)||void 0===r?void 0:r.response.headers.get("X-WP-TotalPages"))):e.groupsTemplateTotal=+(null===(n=l.baseQueryMeta)||void 0===n?void 0:n.response.headers.get("X-WP-Total"))})}}),{setProject:c,setActiveGroupsTags:m,setActiveProjectGroupsTags:u,resetAllTags:p}=d.actions,g=e=>e[s].project,h=e=>e[s].activeGroupsTags,b=e=>e[s].activeProjectGroupsTags,f=e=>e[s].groupsTemplateTotal,E=e=>e[s].groupsTemplateProjectTotal,v=e=>e[s].groupsTemplateProjectTotalPages,_=e=>{var t;return null===(t=e[s].project)||void 0===t?void 0:t.projects_test_emails},y=d},89613:(e,t,l)=>{"use strict";l.d(t,{u:()=>r});var o=l(98173),a=l(27941);const r=()=>{const e=(0,a.rD)();return(0,o.useCallback)((t,l)=>{!1!==e.pushToGTM&&((e,t)=>{const l=()=>{try{const t={...e,appLabel:"blocks_app"};window.dataLayer&&"function"===typeof window.dataLayer.push&&window.dataLayer.push(t);const l="string"===typeof t.event&&t.event.trim()?t.event.trim():null,o=("string"===typeof t.action&&t.action.trim()?t.action.trim():null)||("string"===typeof t.event_action&&t.event_action.trim()?t.event_action.trim():null);let a;a=l&&o?`${l}_${o}`:l||o||"event";const{event:r,action:n,...i}=t;"event_action"in i&&delete i.event_action;const s={...i,...l?{event:l}:{},...o?{action:o}:{}};"undefined"!==typeof window&&window.amplitude&&"function"===typeof window.amplitude.track&&window.amplitude.track(a,s)}catch(t){}};t?setTimeout(l,t):l()})(t,l)},[e.pushToGTM])}},89687:(e,t,l)=>{"use strict";l.d(t,{A:()=>r});var o=l(98173),a=l(30150);const r=({lastProjectId:e})=>{const{pathname:t,search:l}=(0,a.zy)();return!1===e?o.createElement(a.C5,{to:"/projects"}):e&&o.createElement(a.C5,{to:`/projects/${e+t+l}`})}},90717:(e,t,l)=>{"use strict";function o(e){let t=e.documentElement;return t||(t=e.createElement("html"),e.appendChild(t)),t}function a(e){let t=e.head;if(!t){t=e.createElement("head");let l=o(e);l.insertBefore(t,l.firstChild)}return t}function r(e){const t=Object.create(null),l=e.getAttributeNames();for(const o of l)t[o]=e.getAttribute(o);return t}function n(e){for(const t of document.querySelectorAll("iframe"))if(t.contentDocument===e.ownerDocument)return t}l.d(t,{ep:()=>o,gu:()=>r,xm:()=>n,xy:()=>a})},92048:e=>{e.exports='<tr em="block" class="empty-structure">\n\t<td align="center">\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>\n\t\t<![endif]--\x3e\n\t\t<table align="center" cellpadding="0" cellspacing="0" border="0" width="100%" style="max-width: 660px;">\n\t\t\t<tr>\n\t\t\t\t<td align="center">\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30" ></td></tr></table>\n\t\t\t\t\t<table align="center" cellpadding="0" cellspacing="0" border="0" width="91%">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30" ></td></tr></table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t</td></tr></table>\n\t\t<![endif]--\x3e\n\t</td>\n</tr>\n'},92960:(e,t,l)=>{"use strict";l.d(t,{Z8:()=>r,mI:()=>i});var o=l(14721),a=l(58521);const r=(0,o.xP)({reducerPath:"proxyApi",tagTypes:["Proxy"],baseQuery:(0,a.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get"}),endpoints:e=>({getFile:e.query({queryFn({url:e,tryFetch:t=!0,type:l},o){const r=(0,a.KU)(o),n=t?fetch(e):Promise.reject(),i=e=>(e=>{switch(l){case"json":return e.json();case"text":return e.text();default:return e.blob()}})(e).then(e=>({data:e}));return n.then(e=>i(e)).catch(()=>r.corsProxy.get_list({format:"blob",extraQuery:{url:encodeURIComponent(e)}}))}})})}),{useGetFileQuery:n,useLazyGetFileQuery:i}=r},93207:(e,t,l)=>{"use strict";l.d(t,{V:()=>r,v:()=>n});var o=l(31926),a=l(39218);function r({id:e,title:t,type:l,guid:r,acf:{lock:n,subject:i,description:s,html:d,project:c,tags:m,utm_parameters:u,parent_email:p,common_styles:g,is_template:h},author:b,...f}){return{...f,id:(0,o.WY)(e),author:(0,o.WY)(b),title:(0,o.vf)(t)||"",lock:n,renderGuid:(0,a.l)(),description:s,html:d,project:(0,o.pT)(c)?c.ID:c,project_author:(0,o.pT)(c)?c.post_author:void 0,project_title:(0,o.pT)(c)?c.post_title:void 0,tags:m,utm_parameters:u,parent_email:(0,o.WY)(p instanceof Array&&p[0]?p[0].ID:p),common_styles:g,is_template:h}}function n({title:e,lock:t,subject:l,description:a,html:r,project:n,tags:i,renderGuid:s,utm_parameters:d,parent_email:c,common_styles:m,is_template:u,author:p,...g}){return{...g,author:(0,o.mQ)(p),title:e,acf:{lock:t,description:a,html:r,project:n,tags:i,utm_parameters:d,parent_email:(0,o.mQ)(c),common_styles:m,is_template:u}}}},93607:(e,t,l)=>{"use strict";l.d(t,{Z:()=>a,b:()=>n});var o=l(35574);let a=function(e){return e[e.HTML=0]="HTML",e[e.ELEMENT=1]="ELEMENT",e[e.ROOT=2]="ROOT",e[e.COMMENT=3]="COMMENT",e[e.DOCTYPE=4]="DOCTYPE",e[e.ADVANCED=5]="ADVANCED",e}({});const r=e=>e.type===a.HTML?e.start-1:e.start;class n{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(e,t,l,o){this.start=e,this.end=t,this.children=l,this.parent=o,this.content=void 0,this.type=a.ELEMENT,this.tag=void 0,this.closed=!1,this.startTagEnd=void 0,this.endTagStart=void 0,this.attributes=void 0,this.createdBy=void 0,this.isDirty=void 0}isSameTag(e){return void 0===this.tag?void 0===e:void 0!==e&&this.tag.length===e.length&&this.tag.toLowerCase()===e}get firstChild(){return this.children[0]}get lastChild(){return this.children.length?this.children[this.children.length-1]:void 0}findNodeBefore(e){const t=(0,o.i8)(this.children,t=>e<=r(t))-1;if(t>=0){const l=this.children[t];if(e>r(l)){if(e<l.end)return l.findNodeBefore(e);const t=l.lastChild;return t&&t.end===l.end?l.findNodeBefore(e):l}}return this}findNodeAt(e){const t=(0,o.i8)(this.children,t=>e<=r(t))-1;if(t>=0){const o=this.children[t];if(e>=r(o)&&e<=((l=o).type===a.HTML?l.end+1:l.end))return o.findNodeAt(e)}var l;return this}find(e){if(e(this))return this;for(const t of this.children){let l=t.find(e);if(l)return l}}closest(e){let t=this;do{if(e(t))return t}while(t=t.parent)}parents(){return this.parent?[this.parent,...this.parent.parents()]:[]}closestFromRoot(e,t=!0){const l=t?[this,...this.parents()]:this.parents();for(let o=l.length-1;o>=0;o--){const t=l[o];if(e(t))return t}}contains(e){return Boolean(e.closest(e=>e===this))}clone(e=this.parent,t=this.start,l=!0){const o=this.start-t,a=new n(t,this.end-o,[],e);return a.children=l?this.children.map(e=>e.clone(a,e.start-o)):[],a.attributes={...this.attributes},a.closed=this.closed,a.content=this.content,a.startTagEnd=this.startTagEnd,a.endTagStart=this.endTagStart,a.tag=this.tag,a.type=this.type,a}}},93778:(e,t,l)=>{"use strict";function o(e){return e}function a({data:e,...t},l){return t.error?t:{data:l(e,t.meta),...t}}function r(e){return t=>a(t,e)}function n(e){return t=>a(t,(t,l)=>t.hasOwnProperty("previous")?e(t.previous,l):e(t,l))}function i(e){return t=>function({data:e,...t},l){return t.error?t:{data:e.map(e=>l(e,t.meta)),...t}}(t,e)}l.d(t,{Ih:()=>i,PI:()=>n,SA:()=>a,SC:()=>r,ur:()=>o})},94160:(e,t,l)=>{"use strict";l.d(t,{C:()=>n,F:()=>r});var o=l(14721),a=l(27943);const r=(0,o.xP)({reducerPath:"confirmationMailApi",baseQuery:(0,a.cw)({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:e,email:t})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${e}&user_email=${t}`)}`})})})}),{useLazyGetConfirmationMailQuery:n}=r},95669:(e,t,l)=>{"use strict";function o(e,t){if(e!==t){if(!e||!t||"object"!==typeof e||"object"!==typeof t)return!1;const l=t instanceof Array;if(e instanceof Array){if(!l)return!1;const a=e.length;if(t.length!==a)return!1;for(let l=0;l<a;l++)if(!o(e[l],t[l]))return!1}else if(l)return!1;const a=Object.keys(e),r=Object.keys(t),n=a.length;if(n!==r.length)return!1;for(let i=0;i<n;i++){const l=a[i];if(!t.hasOwnProperty(l)||!o(e[l],t[l]))return!1}}return!0}l.d(t,{b:()=>o})},96087:(e,t,l)=>{"use strict";l.d(t,{A:()=>m});var o=l(98173),a=l(37969),r=l(47555),n=l(72570),i=l(30150),s=l(12543),d=l(40277);const{Content:c}=r.A,m=()=>{const{__:e}=(0,s.s9)();let t=(0,i.Zp)();return o.createElement(r.A,null,o.createElement(c,{className:"container"},o.createElement(n.Ay,{status:"500",title:"404",subTitle:e("Sorry, the page you visited does not exist."),extra:o.createElement(a.Ay,{type:"primary",onClick:()=>(0,d.XZ)(t,"/projects")},e("Back Home"))})))}},96734:(e,t,l)=>{"use strict";l.d(t,{p:()=>r});var o=l(74029),a=l(3792);const r=()=>a.di.useInstance(o.Zw)},96786:e=>{e.exports='<style em="styles">\n @media only screen and (max-device-width:660px),only screen and (max-width:660px) {\n .em-mob-width-100perc {\n width: 100%!important;\n max-width: 100%!important;\n }\n\n .em-mob-wrap {\n display: block!important;\n }\n\n .em-mob-padding_right-20 {\n padding-right: 20px!important;\n }\n \n .em-mob-padding_left-20 {\n padding-left: 20px!important;\n }\n\n .em-mob-height-20px {\n height: 20px!important;\n }\n }\n</style>\n<tr em="block" class="em-structure">\n <td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">\n <table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">\n <tr>\n <td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n <td width="20" class="em-mob-wrap em-mob-height-20px"></td>\n <td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n <td width="20" class="em-mob-wrap em-mob-height-20px"></td>\n <td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n <td width="20" class="em-mob-wrap em-mob-height-20px"></td>\n <td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>\n </tr>\n </table>\n </td>\n</tr>'},97041:(e,t,l)=>{"use strict";l.d(t,{A:()=>p});var o=l(98173),a=l(30150),r=l(79245),n=l(5558),i=l(78915),s=l(40277),d=l(96734),c=l(89613),m=l(32947);const u="emailmaker.ru",p=({children:e})=>{const t=(0,a.zy)(),l=(0,n.hN)(),p=(0,d.p)(),[g,h]=(0,r.ok)(),b=(0,c.u)(),[f,{isError:E,isSuccess:v,error:_,data:y}]=(0,i.i2)(),{isError:A,isUninitialized:S,isLoading:k,isSuccess:w,error:C,data:B,refetch:x}=(0,i.CR)("",{skip:m.EW.isPlugin||!p.get(m.A9.em_token)}),T=(0,o.useMemo)(()=>({email:g.get("email"),hash:g.get("hash"),event:"confirmation"===g.get("event")}),[g]);if((0,o.useEffect)(()=>{E?l.error({error:_}):v&&(b({event:"confirm",action:"confirm_email",user_email:(null===y||void 0===y?void 0:y.email)||T.email,user_id:null===B||void 0===B?void 0:B.id}),l.success(y.message),B&&x())},[y,_,E,v,B,x,b]),(0,o.useEffect)(()=>{!(T.email&&T.hash&&T.event)||!1!==(null===B||void 0===B?void 0:B.email_confirmation)&&p.get(m.A9.em_token)||y||f({hash:T.hash,email:T.email,event:T.event}).catch(e=>{}).finally(()=>h(""))},[T,f,B,p,h,y]),(0,o.useEffect)(()=>{A&&C&&(l.error({error:C}),(0,s.Id)(p))},[B,A,C,p]),m.EW.isPlugin)return e;if(!m.EW.isPlugin&&!p.get(m.A9.em_token)&&!t.pathname.includes("auth"))return o.createElement(a.C5,{to:"/auth",state:{from:t}});if((S||k)&&!t.pathname.includes("auth"))return o.createElement(o.Fragment,null);if(A&&!t.pathname.includes("auth"))return o.createElement(a.C5,{to:"/auth",state:{from:t}});if(w){const{id:l,email:r,name:n,locale:i,carrotquest_hash:s,ducalis_hash:d,email_subscription_consent:c,last_used_project:g}=B;return p.set(m.A9.em_id,l,{domain:u}),p.set(m.A9.em_email,r,{domain:u}),p.set(m.A9.em_name,n,{domain:u}),p.set(m.A9.em_locale,i,{domain:u}),p.set(m.A9.em_carrotquest_hash,s,{domain:u}),p.set(m.A9.em_ducalis_hash,d,{domain:u}),p.set(m.A9.em_email_subscription_consent,c,{domain:u}),g&&"/"===t.pathname?o.createElement(a.C5,{to:`/projects/${g}/emails`,replace:!0}):e}return t.pathname.includes("auth")?e:void 0}},97946:e=>{e.exports='\n<style>\n\t@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {\n\t\t.em-mob-width-100perc {\n\t\t\twidth: 100% !important;\n\t\t\tmax-width: 100% !important;\n\t\t}\n\n\t\t.em-mob-width-91perc {\n\t\t\twidth: 91% !important;\n\t\t\tmax-width: 91% !important;\n\t\t}\n\t}\n</style>\n<tr em="block" class="em-structure">\n\t<td align="center">\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>\n\t\t<![endif]--\x3e\n\t\t<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">\n\t\t\t<tr>\n\t\t\t\t<td align="center" valign="top">\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t<table border="0" cellspacing="0" cellpadding="0">\n\t\t\t\t\t<tr><td width="207" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]></td><td width="413" valign="top" align="center"><![endif]--\x3e\n\t\t\t\t\t<div style="display: inline-block; width: 413px; vertical-align: top;" class="em-mob-width-100perc">\n\t\t\t\t\t\t<table width="393" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td align="left"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>\n\t\t\t\t\t</div>\n\t\t\t\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t</table><![endif]--\x3e\n\t\t\t\t\t<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t\x3c!--[if (gte mso 9)|(IE)]>\n\t\t</td></tr></table>\n\t\t<![endif]--\x3e\n\t</td>\n</tr>\n\n'},98664:(e,t,l)=>{"use strict";l.d(t,{n:()=>a});var o=l(31926);function a({parent:e,title:t,html:l,project:a,author:r,...n}){return{...n,author:(0,o.mQ)(r),parent:(0,o.mQ)(e),title:(0,o.vf)(t),"acf[html]":l,"acf[project]":a}}},98845:(e,t,l)=>{"use strict";l.d(t,{GY:()=>u,Kh:()=>v,Gr:()=>S,LX:()=>k,dN:()=>_,YV:()=>f,sl:()=>h,Xw:()=>p,PX:()=>g,YE:()=>E,_3:()=>b});var o=l(14721),a=l(39539),r=l(93207),n=l(31926);function i({id:e,title:t,acf:{html:l,common_styles:o},parent:a,excerpt:r,author:i,...s}){return{...s,author:(0,n.WY)(i),id:(0,n.WY)(e),parent:(0,n.WY)(a),title:(0,n.vf)(t)||"",html:l,common_styles:o,excerpt:(0,n.pT)(r)?r.rendered:r}}var s=l(58521),d=l(93778),c=l(50861),m=l(32947);const u=(0,o.xP)({reducerPath:"emailsApi",tagTypes:["Emails","Email","EmailAutosaves","TemplateEmail"],baseQuery:(0,s.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmails:e.query({queryFn(e,t){var l,o;const a=(0,s.KU)(t),n={order:"desc",orderby:"modified"},i={};if(e.notEmbed||(i._embed=""),e.projectId&&(i._embed="author",i._fields="id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template",n["filter[meta_key]"]="project",n["filter[meta_value]"]=e.projectId),e.fields&&(i._fields=e.fields),e.page&&(n.page=e.page),e.order&&(n.order=e.order),e.orderby&&(n.orderby=e.orderby),e.folderTag&&e.folderTag!==m.y2?(n["filter[tax_query][relation]"]="AND",n["filter[tax_query][0][taxonomy]"]="folder",n["filter[tax_query][0][field]"]="id",n["filter[tax_query][0][terms]"]=e.folderTag,n["filter[tax_query][0][include_children]"]="0"):e.folderTag===m.y2&&("object"!==typeof e.folderTag||null!==e.folderTag)||null!==(l=e.tags)&&void 0!==l&&l.length||!e.status||"trash"===e.status||(n["filter[tax_query][0][taxonomy]"]="folder",n["filter[tax_query][0][operator]"]="NOT EXISTS"),(null===(o=e.tags)||void 0===o?void 0:o.length)>0&&"trash"!==e.status){n["filter[tax_query][relation]"]="AND";for(let t=0,l=e.tags.length;t<l;t++){const l=e.tags[t];n[`filter[tax_query][${t+1}][taxonomy]`]="emailtags",n[`filter[tax_query][${t+1}][field]`]="id",n[`filter[tax_query][${t+1}][terms]`]=l}}return e.name&&(n.search=e.name),e.pageSize&&(n.per_page=e.pageSize),"trash"===e.status&&(i.status="trash"),a.wp.email_list(n,{extraQuery:i}).then((0,d.Ih)(r.V))},providesTags:(e,t,l,{response:o})=>{var a,r;const n=(null===o||void 0===o?void 0:o.headers.get("X-WP-Total"))||0;return e?[...e.map(({id:e})=>{var t;return{type:"Emails",id:`${l.folderTag||(null===(t=l.tags)||void 0===t?void 0:t[0])||l.projectId}_${l.page}_${l.status}_${n}`}}),{type:"Emails",id:`${l.folderTag||(null===(a=l.tags)||void 0===a?void 0:a[0])||l.projectId}_${l.page}_${l.status}_${n}`}]:[{type:"Emails",id:`${l.folderTag||(null===(r=l.tags)||void 0===r?void 0:r[0])||l.projectId}_${l.page}_${l.status}_${n}`}]},keepUnusedDataFor:0}),getTemplateEmails:e.query({queryFn(e,t){var l,o,a;const n=(0,s.KU)(t);let i={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1","filter[meta_query][0][compare]":"LIKE",orderby:"modified",order:"desc"};const c={_embed:"wp:term",_fields:"_embedded,id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,acf.is_template"};if(e.emailId&&(i["filter[meta_query][0][key]"]="parent_email",i["filter[meta_query][0][value]"]=e.emailId),e.fields&&(c._fields=e.fields),(null===(l=e.group)||void 0===l?void 0:l.length)>0||(null===(o=e.projectGroup)||void 0===o?void 0:o.length)>0){const t=[...e.group||[],...e.projectGroup||[]].reduce((e,{key:t,parentId:l})=>(e[l]||(e[l]=[]),e[l].push(String(t)),e),{}),l=Object.values(t).map(e=>e.sort());i["filter[tax_query][relation]"]="AND",l.forEach((e,t)=>{i[`filter[tax_query][${t}][relation]`]="OR",e.forEach((e,l)=>{i[`filter[tax_query][${t}][${l}][taxonomy]`]="group",i[`filter[tax_query][${t}][${l}][field]`]="id",i[`filter[tax_query][${t}][${l}][terms]`]=e})})}if((null===(a=e.tags)||void 0===a?void 0:a.length)>0){i["filter[tax_query][relation]"]="AND";for(let t=0,l=e.tags.length;t<l;t++){const l=e.tags[t];i[`filter[tax_query][${t}][taxonomy]`]="emailtags",i[`filter[tax_query][${t}][field]`]="id",i[`filter[tax_query][${t}][terms]`]=l}}if(e.type&&(i["filter[meta_query][2][key]"]="type",i["filter[meta_query][2][value]"]=e.type),e.name&&(i.search=e.name),e.pageSize&&(i.per_page=e.pageSize),e.page){var u,p;i.page=e.page;const l=t.getState(),{groupsTemplateProjectTotal:o,groupsTemplateProjectTotalPages:a}=null===l||void 0===l?void 0:l.projectSlice;if((null===(u=e.projectGroup)||void 0===u||!u.length)&&(null===(p=e.group)||void 0===p||!p.length)&&a<e.page&&e.groupType===m.ti.ALL&&o&&a&&!e.projectId){const t=m.mU-o%m.mU+(e.page-(a+1))*m.mU;t&&(i.page=1,i.offset=t)}}return e.projectId&&(i["filter[meta_key]"]="project",i["filter[meta_value]"]=e.projectId),n.wp.email_list(i,{extraQuery:c}).then((0,d.Ih)(r.V))},keepUnusedDataFor:0}),getEmail:e.query({queryFn:(e,t)=>(0,s.KU)(t).wp.email_detail({id:(0,n.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,parent,date_gmt\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,d.SC)(r.V)),providesTags:(e,t,l)=>[{type:"Email",id:l}],keepUnusedDataFor:0}),getTemplateEmail:e.query({queryFn:(e,t)=>(0,s.KU)(t).wp.email_detail({id:(0,n.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,parent,date_gmt\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,d.SC)(r.V)),providesTags:(e,t,l)=>[{type:"TemplateEmail",id:l}],keepUnusedDataFor:0}),getEmailHistory:e.query({queryFn:({emailId:e,page:t=1},l)=>(0,s.KU)(l).wp.email_revisions_list({parent:e,per_page:20,page:t},{extraQuery:{_fields:"author,slug,date,modified,title,acf.html,acf.common_styles,id,parent,date_gmt"}}).then(l=>(0,d.SA)(l,(l,o)=>({data:l.filter(e=>e.acf.html).map(e=>({...e,acf:{...e.acf,html:e.acf.html}})).map(i),totalPages:+o.response.headers.get("X-WP-TotalPages"),args:{emailId:e,page:t}}))),providesTags:e=>e?[...e.data.map(({id:e})=>({type:"EmailAutosaves",id:e})),{type:"EmailAutosaves",id:"LIST"}]:[{type:"EmailAutosaves",id:"LIST"}],keepUnusedDataFor:0}),addEmail:e.mutation({queryFn:(0,c.p)(e=>({source:t,...l})=>(0,s.KU)(e).wp.email_create({status:"publish",...(0,r.v)(l)},{type:a.cM.Json}).then((0,d.SC)(r.V))),invalidatesTags:[{type:"Emails",id:"LIST"}]}),editEmail:e.mutation({queryFn:(0,c.p)(e=>({emailId:t,source:l,...o})=>{const i=(0,s.KU)(e),c=(0,n.TB)((0,r.v)(o));return i.wp.email_partial_update(t,c,{type:a.cM.Json,extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,acf.description,acf.html,acf.common_styles,acf.is_template,acf.lock,acf.parent_email,acf.project,acf.secret_hash,acf.subject,acf.utm_parameters"}}).then((0,d.SC)(r.V))})}),deleteEmail:e.mutation({queryFn(e,t){const l=(0,s.KU)(t);let o,a;return"object"===typeof e?(o=e.id,a=e.force):(o=e,a=!1),l.wp.email_delete(o,{force:a}).then((0,d.PI)(r.V))},invalidatesTags:(e,t,l)=>[{type:"Emails",id:l}]}),addTag:e.mutation({queryFn:(e,t)=>(0,s.KU)(t).wp.emailtags_create({...e},{type:a.cM.Json})}),getDeletableTag:e.query({queryFn:([e,t],l)=>(0,s.KU)(l).wp.email_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":e,emailtags:[t]},{extraQuery:{"_fields[]":"emailtags"}}).then((0,d.Ih)(r.V))}),autoSaveEmail:e.mutation({queryFn({emailId:e,body:t},l){const o=(0,s.KU)(l),r=function({parent:e,title:t,html:l,project:o,subject:a,preheader:r,common_styles:i,author:s,parent_email:d,...c}){return{...c,author:(0,n.mQ)(s),title:t,parent:(0,n.mQ)(e),"acf[html]":l,"acf[project]":o,"acf[parent_email]":d,"acf[common_styles]":i}}(t);return o.wp.email_autosaves_create(e,r,{type:a.cM.FormData}).then((0,d.SC)(i))}})})}),{useGetEmailsQuery:p,useGetTemplateEmailsQuery:g,useGetEmailQuery:h,useLazyGetEmailQuery:b,useGetEmailHistoryQuery:f,useLazyGetEmailHistoryQuery:E,useAddEmailMutation:v,useEditEmailMutation:_,useDeleteEmailMutation:y,useGetDeletableTagQuery:A,useAddTagMutation:S,useAutoSaveEmailMutation:k}=u},99282:(e,t,l)=>{"use strict";l.d(t,{vl:()=>a});var o=l(61631);class a extends o.j{constructor(e={}){super(),this._options=e,this._listeners=[],this.on=this.addEventListener.bind(this),this.once=(e,t=0)=>{const l=this.on(t=>{const o=e(t);return l.dispose(),o},t);return l},this.un=e=>{const t=this._listeners.findIndex(([t])=>t===e);t>=0&&this._listeners.splice(t,1),0===this._listeners.length&&this._options.onLastListenerRemove&&this._options.onLastListenerRemove()},this.event=this.on}addEventListener(e,t=0){const l=this._listeners.findIndex(([e,l])=>l<t);return this._listeners.splice(l<0?this._listeners.length:l,0,[e,t]),1===this._listeners.length&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(),{dispose:()=>this.un(e)}}fire(e){if(!this.isDisposed()){const l=[...this._listeners];for(const[o]of l)try{o(e)}catch(t){}}}hasListeners(){return!!this._listeners.length}}o.j}}]);