@emailmaker/emailmaker 1.3.5 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +20 -0
- package/emailmaker-core.091c986b.js +874 -0
- package/emailmaker-esm.js +53 -39
- package/{emailmaker-po.33f5584d.js → emailmaker-po.091c986b.js} +1 -1
- package/emailmaker.d.ts +95 -5
- package/emailmaker.js +54 -40
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/css/sandbox.css +6 -0
- package/iframe/{iframe-eblock.33f5584d.html → iframe-eblock.091c986b.html} +2 -2
- package/iframe/{iframe.33f5584d.html → iframe.091c986b.html} +2 -2
- package/iframe/js/elMarkupHelper.DoIAMao4.js +279 -0
- package/iframe/js/{iframe-eblock.body.33f5584d.js → iframe-eblock.body.091c986b.js} +1 -1
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.091c986b.js +129 -0
- package/iframe/js/iframe.js +2 -2
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/166a67bd.js +1 -0
- package/static/core/1a65ef0f.js +1 -0
- package/static/core/{99be02b7.js → 1c67ab93.js} +1 -1
- package/static/core/{2cee0217.js → 1d004581.js} +1 -1
- package/static/core/{64c425bf.js → 220d7d31.js} +1 -1
- package/static/core/{5150fae0.js → 2da7d310.js} +2 -2
- package/static/core/322d3e9f.js +1 -0
- package/static/core/{a74cc07c.js → 34756b09.js} +1 -1
- package/static/core/36f3f772.js +1 -0
- package/static/core/3b9931cd.js +1 -0
- package/static/core/{e21f8693.js → 3bff2ae6.js} +1 -1
- package/static/core/{4a259bd9.js → 454350da.js} +1 -1
- package/static/core/{4797d4f7.js → 4852c0de.js} +6 -6
- package/static/core/{423efc66.js → 5272f5b2.js} +1 -1
- package/static/core/{97ab9fc2.js → 5f176d0a.js} +1 -1
- package/static/core/674e22a5.js +1 -0
- package/static/core/{89df46ff.js → 6ce85877.js} +1 -1
- package/static/core/7b8fbc31.js +1 -0
- package/static/core/{4ee64f35.js → 867b1e0a.js} +1 -1
- package/static/core/89b1052c.js +1 -0
- package/static/core/{d7e61b4c.js → 8b8c93f4.js} +1 -1
- package/static/core/8e97c82c.js +163 -0
- package/static/core/8eea6488.js +1 -0
- package/static/core/9a4cfb0a.js +1 -0
- package/static/core/{65db94be.js → 9d388494.js} +1 -1
- package/static/core/{d4b8f1e0.js → 9e1370a6.js} +1 -1
- package/static/core/{90aedd7b.js → a59d579e.js} +1 -1
- package/static/core/{4fd85bc9.js → a6abc393.js} +2 -2
- package/static/core/aa33047a.js +1 -0
- package/static/core/abde5a43.js +2 -0
- package/static/core/{294defd8.js → b69579c4.js} +1 -1
- package/static/core/{5913ff80.js → bcc4db3e.js} +1 -1
- package/static/core/{19f19adb.js → c0b0ceff.js} +3 -3
- package/static/core/c5edcfc7.js +1 -0
- package/static/core/{3320a3fd.js → c9d5118c.js} +1 -1
- package/static/core/{239be344.js → caf9f1a6.js} +1 -1
- package/static/core/{3a0fc0cb.js → d241119a.js} +1 -1
- package/static/core/d4c10a7e.js +10 -0
- package/static/core/d517188a.js +1 -0
- package/static/core/db92581b.js +19 -0
- package/static/core/{78663aeb.js → de0d3c9a.js} +1 -1
- package/static/core/{2fbd0ef8.js → e995a70d.js} +1 -1
- package/static/core/ee26ef3d.js +1 -0
- package/static/core/f399000c.js +1 -0
- package/static/core/{42f18479.js → f875f388.js} +1 -1
- package/static/esm/{9610f2de.js → 95cbf920.js} +1 -1
- package/static/umd-runtime/{runtime.ylG9Pc4W.js → runtime.CV4WRxRc.js} +1 -1
- package/vendor/@emailmaker/ui-kit/package.json +1 -1
- package/emailmaker-core.33f5584d.js +0 -859
- package/iframe/js/elMarkupHelper.B6dyF9UI.js +0 -278
- package/iframe/js/iframe.body.33f5584d.js +0 -129
- package/static/core/c2fc9f27.js +0 -1
- package/static/core/f52ad95a.js +0 -28
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__emailmaker__.define("js/iframe-eblock.js",["require","exports","module","js/elMarkupHelper.
|
|
1
|
+
__emailmaker__.define("js/iframe-eblock.js",["require","exports","module","js/elMarkupHelper.DoIAMao4.js"],function(h,w,M){const t=h("./elMarkupHelper.DoIAMao4.js");var R=t.require_iframeResizer_contentWindow_min();function k(o){const s=new Map,e=[],c=[],l=[];for(const n of o)if(n instanceof HTMLLinkElement)n.getAttribute("em-class")?.startsWith("em-font-")&&c.push(n);else if(n instanceof HTMLStyleElement){const r=n.getAttribute("em")||"",d=s.get(r);d?d.push(n):s.set(r,[n])}else if(n instanceof Element)if(n.getAttribute("em")==="block")e.push(n);else{const r=n.querySelector("[em='block']");r&&e.push(r)}else n.textContent===`
|
|
2
2
|
`&&l.push(n);const a=[];for(const n of c)a.push(n);for(const[n,r]of s)if(r.length>1){let d=t.minifyStylesheet(r.map(m=>m.innerHTML).join(`
|
|
3
3
|
`),{restructure:!0,forceMediaMerge:!0}).css;if(d=cssbeautify(d,{indent:" ",autosemicolon:!0}),d){const m=document.createElement("style");m.innerHTML=`
|
|
4
4
|
${d}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var e=window.__emailmaker__||(window.__emailmaker__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=null,s={},c={},l=0;function u(e,t){l+=1;try{return e.factory.apply(null,t)}finally{--l}}var d=`./`,f={},p=60,m=`emailmaker:diagnostics`,h=[],g;function _(){if(g!==void 0)return g;g=!1;try{var e=/[?&]diagnostics(?:=([^&]*))?/.exec(window.location.search||``);if(e)return g=e[1]!==`0`,g;if(typeof window.__DIAGNOSTICS__==`boolean`)return g=!!window.__DIAGNOSTICS__,g;g=window.localStorage.getItem(m)===`1`}catch{g=!1}return g}function v(e,t){if(_()){var n={phase:e,at:performance.timeOrigin+performance.now(),kind:`wait`};t&&(n.parent=String(t)),h.push(n)}}function y(e){if(!e||e.__amdLogged)return e;try{Object.defineProperty(e,"__amdLogged",{value:!0,enumerable:!1})}catch{try{e.__amdLogged=!0}catch{}}try{var t=e&&e.message||`loader error`;console.error(`[AMD] `+(t.indexOf(`[AMD]`)===0?t.slice(6):t),e)}catch{}return e}function b(){try{if(e!==void 0&&e&&e.publicPath)return String(e.publicPath)}catch{}return`(not set)`}function x(){var e=b();return String(e).indexOf(`file:`)===0?` The page appears to be opened as a local file (file://) or publicPath was not configured. Serve the host app over HTTP(S) and set publicPath to the origin that serves editor assets (host bundler plugin or __amdEnv.setPublicPath). Current runtime publicPath=`+e+`.`:` Host bundler publicPath may be misconfigured (Vite/Webpack host plugin). In dev, set publicPath to the absolute origin that serves editor assets (for example http://localhost:3001/<outputFolder>/). Current runtime publicPath=`+e+`.`}function S(e){if(typeof fetch!=`function`)return Promise.resolve(``);function t(e){var t=(e.headers.get(`content-type`)||``).toLowerCase();try{e.body&&typeof e.body.cancel==`function`&&e.body.cancel()}catch{}return t.indexOf(`text/html`)>=0?` The URL returned HTML (Content-Type: text/html), not JavaScript — often a SPA fallback when asset paths are wrong.`:e.ok?``:` HTTP status `+e.status+` — the asset URL may be wrong or blocked by the server.`}return fetch(e,{method:`HEAD`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(function(n){return n.status===405||n.status===501?fetch(e,{method:`GET`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(t):t(n)}).catch(function(){return fetch(e,{method:`GET`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(t).catch(function(){return``})})}function C(e,t){var n=Error(`[AMD] Failed to load module "`+e+`"`+(t?`: `+t.message:``));return n.moduleId=e,n.cause=t,n}function w(e,t,n){var r=Error(`[AMD] Failed to resolve dependency "`+t+`" for module "`+e+`"`+(n?`: `+n.message:``));return r.moduleId=e,r.dependencyId=t,r.cause=n,r}function T(e){for(var t=String(e||``).split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];if(i&&i!==`.`){if(i===`..`){n.length>0&&n.pop();continue}n.push(i)}}return n.join(`/`)}function E(e){var t=String(e||``).replace(/\\/g,`/`),n=String(d||`./`).replace(/\\/g,`/`);return n=n.replace(/^\.\/+/,``),n=n.replace(/^\/+/,``),n&&n.slice(-1)!==`/`&&(n+=`/`),n&&t.indexOf(n)===0&&(t=t.slice(n.length)),t.indexOf(`./`)===0&&(t=t.slice(2)),t}function D(e){return{then:function(t,n){return e.then(t,n)},catch:function(t){return e.catch(t)},finally:function(t){return e.finally(t)}}}function O(e,t){var n=String(e||``);if(!n)return n;if(n.indexOf(`./`)!==0&&n.indexOf(`../`)!==0)return E(T(n));var r=t||``;if(Object.prototype.hasOwnProperty.call(f,r)){var i=String(f[r]||``);i&&!k(i)&&i.charAt(0)!==`/`&&(r=i)}var a=T(r),o=a?a.split(`/`):[];o.length>0&&o.pop();for(var s=n.split(`/`),c=0;c<s.length;c++){var l=s[c];if(l&&l!==`.`){if(l===`..`){o.length>0&&o.pop();continue}o.push(l)}}return E(o.join(`/`))}function k(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function A(e){var t=String(e||``);if(!t||k(t))return t;try{var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return t}}function j(){var t=String(d||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),k(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,A(e.publicPath)).href}catch{}return A(t)}function M(e,t){var n=O(e,t),r=j(),i=Object.prototype.hasOwnProperty.call(f,n)?String(f[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function N(){if(typeof document>`u`)return``;var e=document.currentScript;if(e){var t=e.getAttribute(`data-amd-module-id`);if(t)return t}return``}function P(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=N()):typeof e==`function`?(r=e,n=[],e=N()):typeof n==`function`&&(r=n,n=[]),!e)throw Error(`[AMD] Anonymous define() could not be associated with a module id`);e in t||(t[e]={deps:n||[],factory:r})}P.amd={async:!0};function F(e){var t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}P(`vite/preload-helper`,[`exports`],function(e){e.__vitePreload=function(e){return Promise.resolve().then(function(){return e().catch(F)})}});function I(){return function(){}}function L(e,t){return{id:e,exports:t,uri:M(e)}}function R(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return V(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return V(e,r)}function z(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=O(e,o);if(s in a)throw y(a[s]);if(s in n)return n[s];if(s in r||s in i)throw y(C(s,Error(`Module is still loading asynchronously`)));if(!(s in t))throw y(C(s,Error(`Module is not available for syncRequire`)));return U(s)}function B(e,i){if(o&&e in o){var s={},c=[e];for(s[e]=!0;c.length>0;){var l=o[c.shift()];if(l)for(var u=0;u<l.length;u++){var d=l[u];s[d]||(s[d]=!0,c.push(d),!(d in n||d in a||d in r)&&(d in o?d in t||K(d,i).catch(function(){}):d in t&&V(d).catch(function(){})))}}}}function V(e,i){var o=O(e,i);if(o in a)return Promise.reject(y(a[o]));if(o in n)return Promise.resolve(n[o]);if(o in r)return r[o];if(v(`core:module:`+o+`:ask`,i),o in t)r[o]=H(o);else{var s=M(o);r[o]=K(o).then(function(){return v(`core:module:`+o+`:loaded`,i),o in t?H(o):S(s).then(function(e){var t=C(o,Error(`Module not defined after script load from "`+s+`".`+e+x()));throw a[o]=t,y(t)})}).catch(function(e){delete r[o];var t=e&&e.moduleId===o?e:C(o,e);throw a[o]=t,y(t)})}return B(o),r[o]}function H(e){var i=t[e],o=W(e),s=I(),l=L(e,s);c[e]=s;function d(t){return n[e]=t,delete r[e],delete c[e],n[e]}return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?l:V(t,e).catch(function(n){throw w(e,t,n)})})).then(function(t){v(`core:module:`+e+`:deps`);var n=u(i,t);return n&&typeof n.then==`function`?n.then(function(t){return v(`core:module:`+e+`:ready`),d(t===void 0?l.exports:t)}):(v(`core:module:`+e+`:ready`),d(n===void 0?l.exports:n))}).catch(function(t){throw delete r[e],delete c[e],a[e]=t,y(t)})}function U(e){var r=t[e],i=W(e),o=I(),s=L(e,o);try{var c=u(r,r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return z(t,e)}catch(n){throw w(e,t,n)}}));if(c&&typeof c.then==`function`)throw C(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=c===void 0?s.exports:c,n[e]}catch(t){throw a[e]=t,y(t)}}function W(e){var o=function(o,s,u){if(Array.isArray(o))return R(o,s,u,e);var d=O(o,e);if(d in a)throw y(a[d]);return d in n?n[d]:d in c&&l>0?c[d]:d in r||d in i?D(V(o,e)):d in t?z(o,e):D(V(o,e))};return o.resolve=function(t){return O(t,e)},o.toUrl=function(t){return M(t,e)},o.sync=function(t){return z(t,e)},o}function G(t,n){var r=e!==void 0&&e?e.moduleTransport:null;if(typeof r!=`function`||e.blobBlocked)return null;try{var i=r(t,n);return i&&typeof i.then==`function`?i:null}catch{return null}}function K(t,n){if(t in i)return i[t];if(s[t]&&s[t]!==t)return i[t]=K(s[t],n),i[t];var r=M(t);if(document.querySelector(`script[src="`+r+`"]`))return i[t]=Promise.resolve(),i[t];var a=performance.now();function o(e){return J(t,r,!1,n).then(function(n){return q(t,e,a),n})}var c=G(r,t);return c?(i[t]=c.then(function(r){return r?J(t,URL.createObjectURL(r),!0,n).then(function(e){return q(t,`transport`,a),e},function(){return e.blobBlocked=!0,o(`network-after-blob`)}):o(`network-fallback`)},function(){return o(`network-after-transport-error`)}),i[t]):(i[t]=o(`network`),i[t])}function q(t,n,r){_()&&((e.loaderTimings||=[]).push({id:t,via:n,ms:Math.round((performance.now()-r)*10)/10}),typeof e.onLoaderTiming==`function`&&e.onLoaderTiming())}function J(e,t,n,r){return new Promise(function(a,o){var s=!1,c=document.createElement(`script`);c.src=t,c.setAttribute(`data-amd-module-id`,e),c.async=!0,r===`low`&&(c.fetchPriority=`low`);var l=p>0?p*1e3:0,u=null;function d(){u!=null&&(clearTimeout(u),u=null),c.onload=null,c.onerror=null,n&&typeof URL<`u`&&URL.revokeObjectURL&&URL.revokeObjectURL(t)}function f(e){s||(s=!0,d(),e())}l>0&&(u=setTimeout(function(){f(function(){delete i[e],o(y(C(e,Error(`Timed out after `+l+`ms loading script: `+t+`.`+x()))))})},l)),c.onload=function(){f(function(){a()})},c.onerror=function(){f(function(){delete i[e],o(y(C(e,Error(`Failed to load script: `+t+`.`+x()))))})},document.head.appendChild(c)})}R.config=function(e){if(e.baseUrl&&(d=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(f[t]=e.paths[t]);if(e.bundles){for(var n in e.bundles)if(Object.prototype.hasOwnProperty.call(e.bundles,n))for(var r=0;r<e.bundles[n].length;r++)s[e.bundles[n][r]]=n}if(e.graph)for(var i in o||={},e.graph)Object.prototype.hasOwnProperty.call(e.graph,i)&&(o[i]=e.graph[i]);typeof e.waitSeconds==`number`&&e.waitSeconds>=0&&(p=e.waitSeconds)},R.warm=function(e,r){var i=r&&r.priority;return Promise.all((e||[]).map(function(e){var r=O(e);if(r in a)return Promise.reject(a[r]);var o=r in t||r in n?Promise.resolve():K(r,i);return B(r,i),o})).then(function(){})},R.modules=t,R.resolved=n,R.errors=a,R.toUrl=M,R.sync=z,e.define=P,e.require=R,e.syncRequire=z,e.diagnosticsBuffer=h})(),e.require.config({baseUrl:`./`});
|
|
2
2
|
|
|
3
|
-
__emailmaker__.require.config({ paths: {"js/iframe-eblock.js":"js/iframe-eblock.body.
|
|
3
|
+
__emailmaker__.require.config({ paths: {"js/iframe-eblock.js":"js/iframe-eblock.body.091c986b.js"} });
|
|
4
4
|
|
|
5
|
-
__emailmaker__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.
|
|
5
|
+
__emailmaker__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.DoIAMao4.js"],"js/iframe.js":["js/elMarkupHelper.DoIAMao4.js"],"js/darkreader.CLd5EML2.js":[],"js/elMarkupHelper.DoIAMao4.js":[],"js/rules.CnnzdMsj.js":[],"js/typograf.all.Mun9CrLC.js":[]}});
|
|
6
6
|
|
|
7
7
|
__emailmaker__.require("js/iframe-eblock.js");
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
__emailmaker__.define("js/iframe.js",["require","exports","module","js/elMarkupHelper.DoIAMao4.js"],function($,Ke,Ze){const s=$("./elMarkupHelper.DoIAMao4.js");var z="confetti:open-settings",U="confetti:start",j="confetti:stop",G="confetti:complete",Y=class{constructor(e){s._defineProperty(this,"_app",void 0),s._defineProperty(this,"_state","idle"),s._defineProperty(this,"_activeEffects",new Map),s._defineProperty(this,"_onDocumentClick",r=>{const i=r.target;if(!i)return;const n=i.closest(".confetti-placeholder");if(!n)return;const l=n.getAttribute("data-confetti-preset")||void 0;this._app.use("MessageService").send(z,{preset:l})}),this._app=e}init(){const e=this._app.use("MessageService");e.addListener(U,r=>this._handleStart(r.id,r.options)),e.addListener(j,r=>this._handleStop(r.id)),document.addEventListener("click",this._onDocumentClick,!0)}_handleStart(e,r){const i={id:e,options:r,startTime:Date.now()};this._activeEffects.set(e,i),this._state="running",this.onEffectStart(e,r),this.renderConfetti(e,r);const n=r.duration||3e3;setTimeout(()=>{this._completeEffect(e)},n)}_handleStop(e){if(this._state="stopping",e==="all")for(const r of this._activeEffects.keys())this._completeEffect(r,!0);else this._completeEffect(e,!0)}_completeEffect(e,r=!1){this._activeEffects.get(e)&&(this._activeEffects.delete(e),this.clearConfetti(e,r),this.onEffectComplete(e),this._activeEffects.size===0&&(this._state="idle"),this._app.use("MessageService").send(G,{id:e}))}onEffectStart(e,r){}onEffectComplete(e){}getState(){return this._state}isRunning(){return this._state==="running"}dispose(){document.removeEventListener("click",this._onDocumentClick,!0),this._handleStop("all"),this._activeEffects.clear()}},X=class extends Y{constructor(e){super(e),s._defineProperty(this,"_containers",new Map)}renderConfetti(e,r){const i=this._getRenderBounds(),n=document.createElement("div");n.id=`confetti-${e}`,n.setAttribute("data-confetti-overlay","true"),n.style.cssText=`
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: ${i.top}px;
|
|
4
|
+
left: ${i.left}px;
|
|
5
|
+
width: ${i.width}px;
|
|
6
|
+
height: ${i.height}px;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
z-index: 2147483647;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
display: block;
|
|
11
|
+
line-height: 0;
|
|
12
|
+
font-size: 0;
|
|
13
|
+
`,n.innerHTML=this._generateStaticSvg(r,i.width,i.height),document.body.appendChild(n),this._containers.set(e,n)}clearConfetti(e,r){const i=this._containers.get(e);i&&(i.remove(),this._containers.delete(e))}_generateStaticSvg(e,r,i){const{particleCount:n=100,angle:l=90,spread:o=45,colors:t=["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff"],originX:a=.5,originY:d=.5}=e,c=Math.max(r,320),u=Math.max(i,220),f=Math.max(Math.min(c,u)*.48,140),p=(Math.max(e.duration||3e3,1800)/1e3).toFixed(2),h=a===.5?.22:a,y=d===.5?.62:d,m=c*h,b=u*y,T=[],R=[];for(let M=0;M<n;M++){const W=(l-o/2+Math.random()*o)*(Math.PI/180),I=30+Math.random()*f,Ge=m+Math.cos(W)*I,Ye=b-Math.sin(W)*I,w=Ge-m,B=Ye-b,H=t[Math.floor(Math.random()*t.length)],S=6+Math.random()*10,L=Math.random()*360,D=90+Math.random()*180,C=.78+Math.random()*.22,k=(1.6+Math.random()*1.8).toFixed(2),E=(Math.random()*.35).toFixed(2);if(Math.random()>.5?T.push(`
|
|
14
|
+
<g transform="translate(${m} ${b})">
|
|
15
|
+
<circle cx="0" cy="0" r="${S/2}" fill="${H}" opacity="${C}">
|
|
16
|
+
<animateTransform attributeName="transform" type="translate" values="0 0; ${w*.72} ${B*.72}; ${w} ${B}" dur="${k}s" begin="${E}s" repeatCount="indefinite" />
|
|
17
|
+
<animate attributeName="opacity" values="0; ${C}; ${C}; 0" dur="${k}s" begin="${E}s" repeatCount="indefinite" />
|
|
18
|
+
<animate attributeName="r" values="${Math.max(S*.28,2)}; ${S/2}; ${Math.max(S*.18,1.5)}" dur="${k}s" begin="${E}s" repeatCount="indefinite" />
|
|
19
|
+
</circle>
|
|
20
|
+
</g>
|
|
21
|
+
`):T.push(`
|
|
22
|
+
<g transform="translate(${m} ${b}) rotate(${L})">
|
|
23
|
+
<rect x="${-S/2}" y="${-Math.max(S/4,2)}" width="${S}" height="${Math.max(S/2,4)}" fill="${H}" opacity="${C}" rx="2" ry="2">
|
|
24
|
+
<animateTransform attributeName="transform" type="translate" values="0 0; ${w*.74} ${B*.74}; ${w} ${B}" dur="${k}s" begin="${E}s" repeatCount="indefinite" additive="sum" />
|
|
25
|
+
<animateTransform attributeName="transform" type="rotate" values="${L}; ${L+D}; ${L+D*1.7}" dur="${k}s" begin="${E}s" repeatCount="indefinite" additive="sum" />
|
|
26
|
+
<animate attributeName="opacity" values="0; ${C}; ${C}; 0" dur="${k}s" begin="${E}s" repeatCount="indefinite" />
|
|
27
|
+
</rect>
|
|
28
|
+
</g>
|
|
29
|
+
`),M<Math.max(8,Math.floor(n/6))){const g=10+Math.random()*10,Xe=m+w*(.35+Math.random()*.45),Ve=b+B*(.2+Math.random()*.5),O=(Math.random()*.6).toFixed(2);R.push(`
|
|
30
|
+
<g transform="translate(${Xe} ${Ve})">
|
|
31
|
+
<path
|
|
32
|
+
d="M0 ${-g/2} L${g/6} ${-g/6} L${g/2} 0 L${g/6} ${g/6} L0 ${g/2} L${-g/6} ${g/6} L${-g/2} 0 L${-g/6} ${-g/6} Z"
|
|
33
|
+
fill="rgba(255,255,255,0.9)"
|
|
34
|
+
opacity="0"
|
|
35
|
+
filter="url(#confettiGlow)"
|
|
36
|
+
>
|
|
37
|
+
<animate attributeName="opacity" values="0;0.9;0" dur="1.4s" begin="${O}s" repeatCount="indefinite" />
|
|
38
|
+
<animateTransform attributeName="transform" type="scale" values="0.6;1;0.6" dur="1.4s" begin="${O}s" repeatCount="indefinite" />
|
|
39
|
+
</path>
|
|
40
|
+
</g>
|
|
41
|
+
`)}}return`
|
|
42
|
+
<svg
|
|
43
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
44
|
+
viewBox="0 0 ${c} ${u}"
|
|
45
|
+
width="${c}"
|
|
46
|
+
height="${u}"
|
|
47
|
+
preserveAspectRatio="none"
|
|
48
|
+
style="display:block;width:100%;height:100%;pointer-events:none"
|
|
49
|
+
>
|
|
50
|
+
<defs>
|
|
51
|
+
<filter id="confettiGlow" x="-50%" y="-50%" width="200%" height="200%">
|
|
52
|
+
<feGaussianBlur stdDeviation="2.5" result="blur" />
|
|
53
|
+
<feMerge>
|
|
54
|
+
<feMergeNode in="blur" />
|
|
55
|
+
<feMergeNode in="SourceGraphic" />
|
|
56
|
+
</feMerge>
|
|
57
|
+
</filter>
|
|
58
|
+
<radialGradient id="confettiAura" cx="50%" cy="50%" r="50%">
|
|
59
|
+
<stop offset="0%" stop-color="rgba(255,255,255,0.95)" />
|
|
60
|
+
<stop offset="45%" stop-color="rgba(255,255,255,0.32)" />
|
|
61
|
+
<stop offset="100%" stop-color="rgba(255,255,255,0)" />
|
|
62
|
+
</radialGradient>
|
|
63
|
+
<linearGradient id="confettiTrail" x1="0" y1="0" x2="1" y2="1">
|
|
64
|
+
<stop offset="0%" stop-color="rgba(255,255,255,0.9)" />
|
|
65
|
+
<stop offset="100%" stop-color="rgba(255,255,255,0)" />
|
|
66
|
+
</linearGradient>
|
|
67
|
+
</defs>
|
|
68
|
+
<rect width="100%" height="100%" fill="transparent" />
|
|
69
|
+
<g transform="translate(${m} ${b})">
|
|
70
|
+
<circle cx="0" cy="0" r="18" fill="url(#confettiAura)" opacity="0.7">
|
|
71
|
+
<animate attributeName="r" values="12;34;18" dur="${p}s" repeatCount="indefinite" />
|
|
72
|
+
<animate attributeName="opacity" values="0.75;0.18;0.55" dur="${p}s" repeatCount="indefinite" />
|
|
73
|
+
</circle>
|
|
74
|
+
<circle cx="0" cy="0" r="4" fill="#ffffff" opacity="0.95" filter="url(#confettiGlow)">
|
|
75
|
+
<animate attributeName="r" values="3;7;3" dur="1.6s" repeatCount="indefinite" />
|
|
76
|
+
<animate attributeName="opacity" values="0.7;1;0.55" dur="1.6s" repeatCount="indefinite" />
|
|
77
|
+
</circle>
|
|
78
|
+
<path d="M0 0 L58 -14" stroke="url(#confettiTrail)" stroke-width="5" stroke-linecap="round" opacity="0.65">
|
|
79
|
+
<animate attributeName="opacity" values="0.1;0.7;0.1" dur="1.8s" repeatCount="indefinite" />
|
|
80
|
+
</path>
|
|
81
|
+
</g>
|
|
82
|
+
${R.join("")}
|
|
83
|
+
${T.join("")}
|
|
84
|
+
</svg>
|
|
85
|
+
`}_getRenderBounds(){const e=this._getPlaceholderElement();if(e){const n=e.getBoundingClientRect(),l=320,o=220,t=Math.max(document.documentElement.clientWidth,window.innerWidth||0),a=Math.max(document.documentElement.clientHeight,window.innerHeight||0),d=n.right+12,c=n.left-l-12,u=d+l<=t?d:Math.max(8,c);return{top:Math.min(Math.max(8,n.top+n.height/2-o/2),Math.max(8,a-o-8))+window.scrollY,left:u+window.scrollX,width:l,height:o}}const r=this._getRenderRoot();if(!r)return{top:window.scrollY,left:window.scrollX,width:Math.max(window.innerWidth,800),height:Math.max(window.innerHeight,600)};const i=r.getBoundingClientRect();return{top:i.top+window.scrollY,left:i.left+window.scrollX,width:Math.max(Math.ceil(r.scrollWidth||i.width),Math.ceil(i.width),320),height:Math.max(Math.ceil(r.scrollHeight||i.height),Math.ceil(i.height),240)}}_getRenderRoot(){for(const e of['[em="block-contaner"]',".es-wrapper-color",".es-content-body",".es-content","body > table","body > div"]){const r=document.querySelector(e);if(r instanceof HTMLElement)return r}return document.body}_getPlaceholderElement(){const e=document.querySelector(".confetti-placeholder");return e instanceof HTMLElement?e:null}onEffectStart(e,r){}onEffectComplete(e){}dispose(){for(const e of this._containers.values())e.remove();this._containers.clear(),super.dispose()}},V=[X];function K(e){const r=e.find(t=>t instanceof DocumentType),i=document.documentElement;let n=e.find(t=>t instanceof HTMLHtmlElement);if(!n){n=i||document.createElement("html");let t=e.find(d=>d instanceof HTMLHeadElement);if(t&&t.parentNode!==n){const d=document.head;if(d){n.replaceChild(t,d);for(const c of d.childNodes)t.appendChild(c)}else n.insertBefore(t,n.firstChild)}let a=e.find(d=>d instanceof HTMLBodyElement);if(!a){a=document.body||document.createElement("body");const d=e.filter(c=>c!==t&&c!==r).reverse();if(d.length){let c=null;for(const u of d)(u.parentNode!==a||u.nextSibling!==c)&&a.insertBefore(u,c),c=u}}if(a.parentNode!==n){const d=document.body;if(d){n.replaceChild(a,d);for(const c of d.childNodes)a.appendChild(c)}else n.appendChild(a)}}const l=[...n.childNodes];if(!l.find(t=>t instanceof HTMLHeadElement)){const t=e.find(a=>a instanceof HTMLHeadElement)||document.createElement("head");n.insertBefore(t,n.firstChild)}if(!l.find(t=>t instanceof HTMLBodyElement)){const t=e.find(a=>a instanceof HTMLBodyElement)||document.createElement("body");n.appendChild(t)}const o=document.doctype;return o!==r&&(o?r?document.replaceChild(r,o):document.removeChild(o):r&&document.insertBefore(r,document.firstChild)),i!==n&&(i?n?document.replaceChild(n,i):document.removeChild(i):n&&document.appendChild(n)),e}var Z='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',Q={name:"email",mapHTMLRoots:K,createRoot:(e,r)=>{const n=r.length;let l=e.find(c=>c.tag==="html"),o=e.find(c=>c.type===s.NodeType.DOCTYPE);if(!l){e=e.filter(c=>c!==o),l=new s.Node(0,n,e),l.createdBy="createRoot",l.tag="html",l.children=e;for(const c of e)c.parent=l;l.startTagEnd=0,l.endTagStart=n,e=[l]}let t=l.children.find(c=>c.tag==="body"),a=l.children.find(c=>c.tag==="head");if(!t){const c=l.children.filter(u=>u!==a);t=new s.Node(a?a.end:l.startTagEnd||l.start,l.endTagStart||l.end,c,l),t.createdBy="createRoot",t.startTagEnd=t.start,t.endTagStart=t.end;for(const u of c)u.parent=t;t.tag="body",l.children=a?[a,t]:[t]}a||(a=new s.Node(l.startTagEnd||l.start,l.startTagEnd||l.start,[],l),a.createdBy="createRoot",a.startTagEnd=a.start,a.endTagStart=a.start,a.tag="head",l.children.unshift(a)),o||(o=new s.Node(0,0,[]),o.createdBy="createRoot",o.startTagEnd=0,o.endTagStart=0,o.type=s.NodeType.DOCTYPE,o.content=Z,e.unshift(o));const d=new s.Node(0,n,e);d.type=s.NodeType.ROOT;for(const c of e)c.parent=d,c.type===s.NodeType.ELEMENT&&c.tag!=="html"?(c.type=s.NodeType.COMMENT,c.content=r.substring(c.start,c.end),c.children=[]):c.type===s.NodeType.HTML&&(c.type=s.NodeType.COMMENT,c.content=c.content||"");return d}},Qe=s.require_iframeResizer_contentWindow_min();function J(){return s.messageService.addListenerAsync(s.EVENT_TYPES.SANDBOX_IS_EMAIL_EMPTY,e=>{const r=document.querySelector(".em-narrow-table");return r?!(r.querySelectorAll("tr").length>0):!0})}function ee(e){return{blocks:e.querySelectorAll('[em="block"]').length,textLength:(e.body?.textContent??"").replace(/\s+/g," ").trim().length}}function te(){return s.messageService.addListenerAsync(s.EVENT_TYPES.SANDBOX_CANVAS_HEALTH,()=>ee(document))}function oe(e){if(!e)return{backgroundColor:void 0,backgroundImage:void 0,backgroundPositionX:void 0,backgroundPositionY:void 0,backgroundRepeat:void 0,backgroundSize:void 0};const r={};if(e.style.backgroundColor?r.backgroundColor=e.style.backgroundColor:e.getAttribute("bgcolor")&&(r.backgroundColor=e.getAttribute("bgcolor")||void 0),e.style.backgroundImage){const i=e.style.backgroundImage;r.backgroundImage=[{type:"url",value:i?i.substring(5,i.length-2):""}]}else e.getAttribute("background")&&(r.backgroundImage=[{type:"url",value:e.getAttribute("background")||""}]);return r.backgroundPositionX=e.style.backgroundPositionX||void 0,r.backgroundPositionY=e.style.backgroundPositionY||void 0,r.backgroundRepeat=e.style.backgroundRepeat||void 0,r.backgroundSize=e.style.backgroundSize||void 0,r}function re(e){if(e){if(document.querySelector(".es-header")||document.querySelector(".es-content")||document.querySelector(".es-footer")){const r=e.querySelector(".es-content"),i=e.querySelector(".es-content-body");return parseFloat(r?.style.width||"")||parseFloat(i?.style.width||"")||void 0}if(document.querySelector(".nl-container")&&document.querySelector(".row")){const r=document.querySelector(".row-content");return parseFloat(r?.style.width||"")||parseFloat(r?.getAttribute("width")||"")||void 0}if(document.querySelector(".nl-container")&&!document.querySelector(".row")){const r=e.querySelector('[style*="max-width"]');return parseFloat(r?.style.maxWidth||"")||void 0}if(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]")){const r=e.querySelector("table:first-child");if(r?.style.maxWidth)return parseFloat(r.style.maxWidth)||void 0}if(document.querySelector(".container-div")){const r=e.querySelector("div:first-child");if(r?.style.maxWidth)return parseFloat(r.style.maxWidth)||void 0}if(document.querySelector(".email-container")){const r=document.querySelector(".email-container");return parseFloat(r?.getAttribute("width")||"")||void 0}return ie(e)}}function ie(e){const r=e.querySelector("table:first-child");if(!r)return;const i=parseFloat(r.getAttribute("width")||""),n=parseFloat(r.style.maxWidth||"");if(i>700||n>700){const o=e.querySelector('table:first-child [em="block"] > td > table');if(o){const t=o.getAttribute("width");return t&&t.indexOf("%")===-1?parseFloat(t):o.style.maxWidth?parseFloat(o.style.maxWidth):e.querySelector('table:first-child [em="block"]')?.clientWidth||660}return 660}const l=r.getAttribute("width");if(l&&l.indexOf("%")===-1)return parseFloat(l);if(r.style.maxWidth)return parseFloat(r.style.maxWidth)}function ne(e,r){const i={shutdown:void 0,styles:!0};if(!e||!r)return i;const n=e.querySelector("table:first-child");if(!n)return i;const l=n.getAttribute("width"),o=parseFloat(n.style.minWidth||"");return l&&l.indexOf("%")===-1&&o===parseFloat(l)||e.querySelector(".noresp-em-narrow-table")?{shutdown:!1,styles:!1}:{shutdown:!0,styles:!0}}var le=2;function ae(e,r){!e||!r||document.querySelector(".noresp-em-narrow-table, .em-narrow-table")&&(e.getBoundingClientRect().width<=r||document.querySelectorAll("img").forEach(i=>{const n=i.closest("td")?.getBoundingClientRect().width;n&&parseFloat(i.getAttribute("width")||"")>n+le&&n>10&&i.style.display!=="none"&&(i.setAttribute("width",String(Math.ceil(n))),i.style.maxWidth=Math.ceil(n)+"px")}))}function se(e){const r=e.findGlobalHolder();e.setGlobalHolder(r);const i={operation:"application_email_settings_set",settings:{subject:e.getSubject(),preheader:e.getPreheader(),responsive:{shutdown:void 0,styles:!0},structuresMedia:!(document.querySelector('[em="block"] div[style*="display: inline-block"]')&&!document.querySelector('[em="block"] .em-mob-wrap, [em="block"] .noresp-em-mob-wrap')),usedColors:e.getUsedColors(),noBlocks:!1,width:{value:void 0,dim:"px"},backgroundColor:void 0,backgroundImage:void 0,backgroundPositionX:void 0,backgroundPositionY:void 0,backgroundRepeat:void 0,backgroundSize:void 0,backgroundColorContent:void 0}};if(r){const a=oe(r);a.backgroundColor&&a.backgroundColor.startsWith("rgb")&&(a.backgroundColor=e.rgbToHex(a.backgroundColor)),Object.assign(i.settings,a)}e.elMarkupHelper(),document.querySelector('[em="block"]')||(i.settings.noBlocks=!0);const n=re(r),l=e.state.get("emailWidth"),o=e.getEmailWidth(),t=typeof l=="number"&&l>=320?l:typeof o=="number"&&o>=320?o:n;i.settings.width.value=t,r&&(i.settings.responsive=ne(r,t),typeof t=="number"&&e.state.set("emailWidth",t)),e.messageService.send(i),ae(r,e.getEmailWidth())}function de(e,r=!1){e.closeEditorInit(),document.body&&(e.removeHiddenClasses(document),se(e),e.commit(!1))}function A(e,r){r[1]==="Sans Serif"?e.style.fontFamily="Helvetica, Arial, sans-serif":r[1]==="Serif"?e.style.fontFamily='"Times New Roman", Times, serif':r[1]==="Project Fonts"&&s.applyProjectFontInlineFallback(e,r[2])}function ce(e,r){const i=e?.toLowerCase();return i==="#ffffff"&&i!==r?.toLowerCase()}function ue(e,r){const{lockEditor:i,commonStyles:n,globalHolder:l}=r;if(i)return;const o=document.querySelectorAll('div[style*="font-family"]');me(e,o,r),fe(e,o,r),ye(e,r),he(e,r),ve(e,r),Ce(e,r);const t={operation:"application_commonStyles_update",settings:{commonStyles:n}};r.messageService.send(t)}function me(e,r,i){const{commonStyles:n,rgbToHex:l}=i;if(e.textFontFamily!==void 0){let o=[];r.forEach(t=>{const a=t;let d;!a.style.display&&parseFloat(a.style.fontSize)<=20&&(o=e.textFontFamily,o[0]==="Safe Fonts"?(a.style.fontFamily=o[1],(d=[...a.classList].filter(c=>c.startsWith("em-font-"))[0])&&(a.classList.remove(d),n.text.fontFamily?.[2]&&i.clearLinkTags({elem:document.documentElement,fontFamilyClassName:s.buildEmFontClassName(n.text.fontFamily[2],n.text.fontFamily[3])}),i.clearProjectFontFaces())):o[0]==="Google Fonts"&&(A(a,o),i.removeClassesByPrefix(a,"em-font"),a.classList.add(i.createFontClassName(o)),s.markProjectFontClass(a,o)))}),o.length>0&&o[0]==="Google Fonts"&&i.addFontFamilyClass({fontFamilyArray:o}),i.clearProjectFontFaces(),n.text.fontFamily=e.textFontFamily}e.textFontSize!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)<=20&&parseFloat(t.style.fontSize)>14&&(t.style.fontSize=e.textFontSize+"px")}),n.text.fontSize=e.textFontSize),e.textLineHeight!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)<=20&&parseFloat(t.style.fontSize)>14&&(t.style.lineHeight=e.textLineHeight+"px")}),n.text.lineHeight=e.textLineHeight),e.textColor!==void 0&&(r.forEach(o=>{const t=o;!t.closest(".em-contrast-block")&&!t.style.display&&parseFloat(t.style.fontSize)<=20&&!ce(l(t.style.color),l(n.text.color))&&(t.style.color=e.textColor)}),n.text.color=e.textColor),e.textContrastColor!==void 0&&(r.forEach(o=>{const t=o;t.closest(".em-contrast-block")&&!t.style.display&&parseFloat(t.style.fontSize)<=20&&(t.style.color=e.textContrastColor)}),n.text.contrastColor=e.textContrastColor),e.textPaddingBottom!==void 0&&(r.forEach(o=>{const t=o;if(t.closest('[em="atom"]')){if(!t.style.display&&parseFloat(t.style.fontSize)<=20&&t.closest("table")?.getAttribute("em")=="atom"){const a=t.closest('[em="atom"]')?.querySelector(":scope > tr > td, :scope > tbody > tr > td");a&&(a.style.paddingBottom=e.textPaddingBottom+"px",a.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}}else if(t.nextElementSibling){const a=t.nextElementSibling;if(!t.style.display&&parseFloat(t.style.fontSize)<=20&&t.parentElement?.getAttribute("em")=="atom"&&a&&a.tagName=="TABLE"&&(a.classList.contains("em-vindent-table")||a.querySelector("td")?.innerHTML=="")){a.querySelector("td")?.setAttribute("height",e.textPaddingBottom);const d=a.querySelector(".em-element-vindent-value");d&&(d.innerHTML=e.textPaddingBottom+"px",e.textPaddingBottom<30?a.querySelector(".em-vindent")?.classList.add("em-vindent_low"):a.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.text.paddingBottom=e.textPaddingBottom)}function fe(e,r,i){const{commonStyles:n,rgbToHex:l}=i;if(e.headingFontFamily!==void 0){let o=[];r.forEach(t=>{const a=t;let d;!a.style.display&&parseFloat(a.style.fontSize)>20&&l(a.style.color).toLowerCase()!=="#eb3737"&&(o=e.headingFontFamily,o[0]==="Safe Fonts"?(a.style.fontFamily=o[1],(d=[...a.classList].filter(c=>c.startsWith("em-font-"))[0])&&(a.classList.remove(d),n.headings.fontFamily?.[2]&&i.clearLinkTags({elem:document.documentElement,fontFamilyClassName:s.buildEmFontClassName(n.headings.fontFamily[2],n.headings.fontFamily[3])}),i.clearProjectFontFaces())):o[0]==="Google Fonts"&&(A(a,o),i.removeClassesByPrefix(a,"em-font"),a.classList.add(i.createFontClassName(o)),s.markProjectFontClass(a,o)))}),o.length>0&&o[0]==="Google Fonts"&&i.addFontFamilyClass({fontFamilyArray:o}),i.clearProjectFontFaces(),n.headings.fontFamily=e.headingFontFamily}e.headingFontSize!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)>=20&&l(t.style.color).toLowerCase()!=="#eb3737"&&parseFloat(t.style.fontSize)<=40&&(t.style.fontSize=e.headingFontSize+"px")}),n.headings.fontSize=e.headingFontSize),e.headingLineHeight!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&parseFloat(t.style.fontSize)<=40&&(t.style.lineHeight=e.headingLineHeight+"px")}),n.headings.lineHeight=e.headingLineHeight),e.headingLetterSpacing!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&(e.headingLetterSpacing>0?t.style.letterSpacing=e.headingLetterSpacing+"px":t.style.removeProperty("letter-spacing"))}),n.headings.letterSpacing=e.headingLetterSpacing),e.headingBold!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&(e.headingBold?t.querySelector("b")?t.querySelector("b").replaceWith(...t.querySelector("b").childNodes):t.querySelector("strong")||(t.innerHTML="<strong>"+t.innerHTML+"</strong>"):t.querySelector("strong")?t.querySelector("strong").replaceWith(...t.querySelector("strong").childNodes):t.querySelector("b")&&t.querySelector("b").replaceWith(...t.querySelector("b").childNodes),t.style.fontWeight&&t.style.removeProperty("font-weight"))}),n.headings.bold=e.headingBold),e.headingItalic!==void 0&&(r.forEach(o=>{const t=o;!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&(e.headingItalic?t.querySelector("i")?t.querySelector("i").replaceWith(...t.querySelector("i").childNodes):t.querySelector("em")||(t.innerHTML="<em>"+t.innerHTML+"</em>"):t.querySelector("em")?t.querySelector("em").replaceWith(...t.querySelector("em").childNodes):t.querySelector("i")&&t.querySelector("i").replaceWith(...t.querySelector("i").childNodes),t.style.fontStyle&&t.style.removeProperty("font-style"))}),n.headings.italic=e.headingItalic),e.headingColor!==void 0&&(r.forEach(o=>{const t=o;!t.closest(".em-contrast-block")&&!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&(t.style.color=e.headingColor)}),n.headings.color=e.headingColor),e.headingContrastColor!==void 0&&(r.forEach(o=>{const t=o;t.closest(".em-contrast-block")&&!t.style.display&&parseFloat(t.style.fontSize)>20&&(t.style.color=e.headingContrastColor)}),n.headings.contrastColor=e.headingContrastColor),pe(e,r,i),e.blockDarkBackgroundColor!==void 0&&(n.block.darkBackgroundColor=e.blockDarkBackgroundColor)}function pe(e,r,i){const{commonStyles:n,rgbToHex:l}=i;e.headingPaddingTop!==void 0&&(r.forEach(o=>{const t=o;if(t.closest('[em="atom"]')){if(!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&t.closest("table")?.getAttribute("em")=="atom"){const a=t.closest('[em="atom"]')?.querySelector(":scope > tr > td, :scope > tbody > tr > td");a&&(a.style.paddingTop=e.headingPaddingTop+"px",a.querySelector(":scope > .em-vindent-paddingTop")?.remove())}}else if(t.previousElementSibling){const a=t.previousElementSibling;if(!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&t.parentElement?.getAttribute("em")=="atom"&&a&&a.tagName=="TABLE"&&(a.classList.contains("em-vindent-table")||a.querySelector("td")?.innerHTML=="")){a.querySelector("td")?.setAttribute("height",e.headingPaddingTop);const d=a.querySelector(".em-element-vindent-value");d&&(d.innerHTML=e.headingPaddingTop+"px",e.headingPaddingTop<30?a.querySelector(".em-vindent")?.classList.add("em-vindent_low"):a.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.headings.paddingTop=e.headingPaddingTop),e.headingPaddingBottom!==void 0&&(document.querySelectorAll('div[style*="font-family"]').forEach(o=>{const t=o,a=t.closest('[em="atom"]');if(a){const d=a.querySelector(":scope > tr > td, :scope > tbody > tr > td");d?.style.paddingBottom&&!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&t.closest("table")?.getAttribute("em")=="atom"&&(d.style.paddingBottom=e.headingPaddingBottom+"px",d.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}else if(t.nextElementSibling){const d=t.nextElementSibling;if(!t.style.display&&parseFloat(t.style.fontSize)>20&&l(t.style.color).toLowerCase()!=="#eb3737"&&t.parentElement?.getAttribute("em")=="atom"&&d&&d.tagName=="TABLE"&&(d.classList.contains("em-vindent-table")||d.querySelector("td")?.innerHTML=="")){d.querySelector("td")?.setAttribute("height",e.headingPaddingBottom);const c=d.querySelector(".em-element-vindent-value");c&&(c.innerHTML=e.headingPaddingBottom+"px",e.headingPaddingBottom<30?d.querySelector(".em-vindent")?.classList.add("em-vindent_low"):d.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.headings.paddingBottom=e.headingPaddingBottom)}function ye(e,r){const{commonStyles:i}=r,n=document.querySelectorAll('a[style*="color"]');e.linkColor!==void 0&&(n.forEach(l=>{const o=l;!o.closest(".em-contrast-block")&&!o.style.display&&(o.style.color=e.linkColor)}),i.links.color=e.linkColor),e.linkContrastColor!==void 0&&(n.forEach(l=>{const o=l;o.closest(".em-contrast-block")&&!o.style.display&&(o.style.color=e.linkContrastColor)}),i.links.contrastColor=e.linkContrastColor),e.linkUnderline!==void 0&&(n.forEach(l=>{const o=l;if(!o.style.display){o.style.textDecoration=e.linkUnderline?"underline":"none";const t=o.parentElement;t&&t.tagName=="SPAN"&&t.style.textDecoration=="underline"&&t.replaceWith(...t.childNodes)}}),i.links.underline=e.linkUnderline)}function he(e,r){const{commonStyles:i}=r,n=document.querySelectorAll('a[style*="font-family"]');if(e.buttonsFontFamily!==void 0){let l=[];n.forEach(o=>{const t=o;let a;t.style.display&&t.style.display=="block"&&(l=e.buttonsFontFamily,l[0]==="Safe Fonts"?(t.style.fontFamily=l[1],(a=[...t.classList].filter(d=>d.startsWith("em-font-"))[0])&&(t.classList.remove(a),i.buttons.fontFamily?.[2]&&r.clearLinkTags({elem:document.documentElement,fontFamilyClassName:s.buildEmFontClassName(i.buttons.fontFamily[2],i.buttons.fontFamily[3])}),r.clearProjectFontFaces())):l[0]==="Google Fonts"&&(A(t,l),r.removeClassesByPrefix(t,"em-font"),t.classList.add(r.createFontClassName(l)),s.markProjectFontClass(t,l)))}),l.length>0&&l[0]==="Google Fonts"&&r.addFontFamilyClass({fontFamilyArray:l}),r.clearProjectFontFaces(),i.buttons.fontFamily=e.buttonsFontFamily}e.buttonsFontSize!==void 0&&(n.forEach(l=>{const o=l;o.style.display&&o.style.display=="block"&&(o.style.fontSize=e.buttonsFontSize+"px")}),i.buttons.fontSize=e.buttonsFontSize),e.buttonsLetterSpacing!==void 0&&(n.forEach(l=>{const o=l;o.style.display&&o.style.display=="block"&&(e.buttonsLetterSpacing>0?o.style.letterSpacing=e.buttonsLetterSpacing+"px":o.style.removeProperty("letter-spacing"))}),i.buttons.letterSpacing=e.buttonsLetterSpacing),be(e,n,r),ge(e,n,r),Se(e,n,r)}function be(e,r,i){const{commonStyles:n}=i;e.buttonsColor!==void 0&&(r.forEach(l=>{const o=l;!o.closest(".em-contrast-block")&&o.style.display&&o.style.display=="block"&&(o.style.color=e.buttonsColor)}),n.buttons.color=e.buttonsColor),e.buttonsContrastColor!==void 0&&(r.forEach(l=>{const o=l;o.closest(".em-contrast-block")&&o.style.display&&o.style.display=="block"&&(o.style.color=e.buttonsContrastColor)}),n.buttons.contrastColor=e.buttonsContrastColor),e.buttonsBold!==void 0&&(r.forEach(l=>{const o=l;o.style.display&&o.style.display=="block"&&(e.buttonsBold?o.querySelector("b")?o.querySelector("b").replaceWith(...o.querySelector("b").childNodes):o.querySelector("strong")||(o.innerHTML="<strong>"+o.innerHTML+"</strong>"):o.querySelector("strong")?o.querySelector("strong").replaceWith(...o.querySelector("strong").childNodes):o.querySelector("b")&&o.querySelector("b").replaceWith(...o.querySelector("b").childNodes),o.style.fontWeight&&o.style.removeProperty("font-weight"))}),n.buttons.bold=e.buttonsBold),e.buttonsItalic!==void 0&&(r.forEach(l=>{const o=l;o.style.display&&o.style.display=="block"&&(e.buttonsItalic?o.querySelector("i")?o.querySelector("i").replaceWith(...o.querySelector("i").childNodes):o.querySelector("em")||(o.innerHTML="<em>"+o.innerHTML+"</em>"):o.querySelector("em")?o.querySelector("em").replaceWith(...o.querySelector("em").childNodes):o.querySelector("i")&&o.querySelector("i").replaceWith(...o.querySelector("i").childNodes),o.style.fontStyle&&o.style.removeProperty("font-style"))}),n.buttons.italic=e.buttonsItalic),e.buttonsBackgroundColor!==void 0&&(r.forEach(l=>{const o=l;if(!o.closest(".em-contrast-block")&&o.style.display&&o.style.display=="block"){const t=o.closest("td");t&&(t.getAttribute("bgcolor")&&(e.buttonsBackgroundColor?t.setAttribute("bgcolor",e.buttonsBackgroundColor):t.removeAttribute("bgcolor")),e.buttonsBackgroundColor?t.style.backgroundColor=e.buttonsBackgroundColor:t.style.removeProperty("background-color"))}}),n.buttons.backgroundColor=e.buttonsBackgroundColor),e.buttonsContrastBackgroundColor!==void 0&&(r.forEach(l=>{const o=l;if(o.closest(".em-contrast-block")&&o.style.display&&o.style.display=="block"){const t=o.closest("td");t&&(t.getAttribute("bgcolor")&&(e.buttonsContrastBackgroundColor?t.setAttribute("bgcolor",e.buttonsContrastBackgroundColor):t.removeAttribute("bgcolor")),e.buttonsContrastBackgroundColor?t.style.backgroundColor=e.buttonsContrastBackgroundColor:t.style.removeProperty("background-color"))}}),n.buttons.contrastBackgroundColor=e.buttonsContrastBackgroundColor),e.buttonsAlign!==void 0&&(r.forEach(l=>{const o=l;o.style.display&&o.style.display=="block"&&o.closest("td")?.setAttribute("align",e.buttonsAlign)}),n.buttons.textAlign=e.buttonsAlign)}function ge(e,r,i){const{commonStyles:n}=i;e.buttonsMarginTop!==void 0&&(r.forEach(l=>{const o=l,t=o.closest('[em="atom"]');if(t){const a=t.querySelector(":scope > tr > td, :scope > tbody > tr > td");a?.style.paddingTop&&o.style.display&&o.style.display=="block"&&(a.style.paddingTop=e.buttonsMarginTop+"px",a.querySelector(":scope > .em-vindent-paddingTop")?.remove())}else{const a=o.closest("table");if(a?.previousElementSibling){const d=a.previousElementSibling,c=o.closest("div");if(o.style.display&&o.style.display=="block"&&c&&c.getAttribute("em")=="atom"&&d&&d.tagName=="TABLE"&&(d.classList.contains("em-vindent-table")||d.querySelector("td")?.innerHTML=="")){d.querySelector("td")?.setAttribute("height",e.buttonsMarginTop);const u=d.querySelector(".em-element-vindent-value");u&&(u.innerHTML=e.buttonsMarginTop+"px",e.buttonsMarginTop<30?d.querySelector(".em-vindent")?.classList.add("em-vindent_low"):d.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}}),n.buttons.marginTop=e.buttonsMarginTop),e.buttonsMarginBottom!==void 0&&(r.forEach(l=>{const o=l,t=o.closest('[em="atom"]');if(t){const a=t.querySelector(":scope > tr > td, :scope > tbody > tr > td");a?.style.paddingBottom&&o.style.display&&o.style.display=="block"&&(a.style.paddingBottom=e.buttonsMarginBottom+"px",a.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}else{const a=o.closest("table");if(a?.previousElementSibling){const d=a.nextElementSibling,c=o.closest("div");if(o.style.display&&o.style.display=="block"&&c&&c.getAttribute("em")=="atom"&&d&&d.tagName=="TABLE"&&(d.classList.contains("em-vindent-table")||d.querySelector("td")?.innerHTML=="")){d.querySelector("td")?.setAttribute("height",e.buttonsMarginBottom);const u=d.querySelector(".em-element-vindent-value");u&&(u.innerHTML=e.buttonsMarginBottom+"px",e.buttonsMarginBottom<30?d.querySelector(".em-vindent")?.classList.add("em-vindent_low"):d.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}}),n.buttons.marginBottom=e.buttonsMarginBottom)}function Se(e,r,i){const{commonStyles:n,setElementBorder:l,setElementBorderRadius:o}=i;e.buttonsBorder!==void 0&&(r.forEach(t=>{const a=t;if(a.style.display&&a.style.display=="block"){const d=a.closest("td");d&&l({settings:{border:e.buttonsBorder},elem:d})}}),e.buttonsBorder.all!==void 0&&(n.buttons.border.all=e.buttonsBorder.all),e.buttonsBorder.top!==void 0&&(n.buttons.border.top=e.buttonsBorder.top),e.buttonsBorder.right!==void 0&&(n.buttons.border.right=e.buttonsBorder.right),e.buttonsBorder.bottom!==void 0&&(n.buttons.border.bottom=e.buttonsBorder.bottom),e.buttonsBorder.left!==void 0&&(n.buttons.border.left=e.buttonsBorder.left)),e.buttonsBorderRadius!==void 0&&(r.forEach(t=>{const a=t;if(a.style.display&&a.style.display=="block"){const d=a.closest("td");d&&o({settings:{borderRadius:e.buttonsBorderRadius},elem:d})}}),e.buttonsBorderRadius.all!==void 0&&(n.buttons.borderRadius.all=e.buttonsBorderRadius.all),e.buttonsBorderRadius.topLeft!==void 0&&(n.buttons.borderRadius.topLeft=e.buttonsBorderRadius.topLeft),e.buttonsBorderRadius.topRight!==void 0&&(n.buttons.borderRadius.topRight=e.buttonsBorderRadius.topRight),e.buttonsBorderRadius.bottomRight!==void 0&&(n.buttons.borderRadius.bottomRight=e.buttonsBorderRadius.bottomRight),e.buttonsBorderRadius.bottomLeft!==void 0&&(n.buttons.borderRadius.bottomLeft=e.buttonsBorderRadius.bottomLeft)),e.buttonsPadding!==void 0&&(r.forEach(t=>{const a=t;a.style.display&&a.style.display=="block"&&(e.buttonsPadding.all!==void 0?(a.style.paddingTop=e.buttonsPadding.all+"px",a.style.paddingRight=e.buttonsPadding.all+"px",a.style.paddingBottom=e.buttonsPadding.all+"px",a.style.paddingLeft=e.buttonsPadding.all+"px"):((e.buttonsPadding.top!==void 0||e.buttonsPadding.top==0)&&(a.style.paddingTop=e.buttonsPadding.top+"px"),(e.buttonsPadding.right!==void 0||e.buttonsPadding.right==0)&&(a.style.paddingRight=e.buttonsPadding.right+"px"),(e.buttonsPadding.bottom!==void 0||e.buttonsPadding.bottom==0)&&(a.style.paddingBottom=e.buttonsPadding.bottom+"px"),(e.buttonsPadding.left!==void 0||e.buttonsPadding.left==0)&&(a.style.paddingLeft=e.buttonsPadding.left+"px")))}),e.buttonsPadding.all!==void 0&&(n.buttons.padding={all:e.buttonsPadding.all}),e.buttonsPadding.top!==void 0&&(n.buttons.padding={top:e.buttonsPadding.top}),e.buttonsPadding.right!==void 0&&(n.buttons.padding={right:e.buttonsPadding.right}),e.buttonsPadding.bottom!==void 0&&(n.buttons.padding={bottom:e.buttonsPadding.bottom}),e.buttonsPadding.left!==void 0&&(n.buttons.padding={left:e.buttonsPadding.left}))}function ve(e,r){const{commonStyles:i,setElementBorder:n,setElementBorderRadius:l}=r;i.cards||(i.cards={});const o=document.querySelectorAll(".em-contrast-card");e.cardsContrastBackgroundColor!==void 0&&(o.forEach(d=>{const c=d;c.getAttribute("bgcolor")&&(e.cardsContrastBackgroundColor?c.setAttribute("bgcolor",e.cardsContrastBackgroundColor):c.removeAttribute("bgcolor")),e.cardsContrastBackgroundColor?c.style.backgroundColor=e.cardsContrastBackgroundColor:c.style.removeProperty("background-color")}),i.cards.contrastBackgroundColor=e.cardsContrastBackgroundColor),e.cardsContrastTextColor!==void 0&&(o.forEach(d=>{d.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(c=>{c.style.color=e.cardsContrastTextColor})}),i.cards.contrastTextColor=e.cardsContrastTextColor);const t=document.querySelectorAll(".em-card");e.cardsBaseBackgroundColor!==void 0&&(t.forEach(d=>{const c=d;c.getAttribute("bgcolor")&&(e.cardsBaseBackgroundColor?c.setAttribute("bgcolor",e.cardsBaseBackgroundColor):c.removeAttribute("bgcolor")),e.cardsBaseBackgroundColor?c.style.backgroundColor=e.cardsBaseBackgroundColor:c.style.removeProperty("background-color")}),i.cards.baseBackgroundColor=e.cardsBaseBackgroundColor),e.cardsBaseTextColor!==void 0&&(t.forEach(d=>{d.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(c=>{c.style.color=e.cardsBaseTextColor})}),i.cards.baseTextColor=e.cardsBaseTextColor);const a=document.querySelectorAll(".em-card, .em-contrast-card");e.cardsBorderRadius!==void 0&&(i.cards.borderRadius||(i.cards.borderRadius={}),a.forEach(d=>{l({settings:{borderRadius:e.cardsBorderRadius},elem:d})}),e.cardsBorderRadius.all!==void 0&&(i.cards.borderRadius.all=e.cardsBorderRadius.all),e.cardsBorderRadius.topLeft!==void 0&&(i.cards.borderRadius.topLeft=e.cardsBorderRadius.topLeft),e.cardsBorderRadius.topRight!==void 0&&(i.cards.borderRadius.topRight=e.cardsBorderRadius.topRight),e.cardsBorderRadius.bottomRight!==void 0&&(i.cards.borderRadius.bottomRight=e.cardsBorderRadius.bottomRight),e.cardsBorderRadius.bottomLeft!==void 0&&(i.cards.borderRadius.bottomLeft=e.cardsBorderRadius.bottomLeft)),e.cardsBorder!==void 0&&(i.cards.border||(i.cards.border={}),a.forEach(d=>{n({settings:{border:e.cardsBorder},elem:d})}),e.cardsBorder.all&&(i.cards.border.all=e.cardsBorder.all),e.cardsBorder.top&&(i.cards.border.top=e.cardsBorder.top),e.cardsBorder.right&&(i.cards.border.right=e.cardsBorder.right),e.cardsBorder.bottom&&(i.cards.border.bottom=e.cardsBorder.bottom),e.cardsBorder.left&&(i.cards.border.left=e.cardsBorder.left))}function Ce(e,r){const{commonStyles:i,globalHolder:n}=r;if(!n)return;const l=n.classList.contains("full-wrap")?n.querySelector("td"):n;if(!l)return;(e.blockBackgroundColor!==void 0||e.blockBackgroundColor==="")&&F(e.blockBackgroundColor,l,!1,i),(e.blockContrastBackgroundColor!==void 0||e.blockContrastBackgroundColor==="")&&F(e.blockContrastBackgroundColor,l,!0,i);const o=document.querySelectorAll('[em="block"] > td');if(e.blockPadding!==void 0){const t=e.blockPadding;i.block||(i.block={}),i.block.padding||(i.block.padding={});const a=t.left!==void 0||t.right!==void 0;o.forEach(d=>{const c=d;t.top!==void 0&&(c.style.paddingTop=`${t.top}px`),t.right!==void 0&&(c.style.paddingRight=`${t.right}px`),t.bottom!==void 0&&(c.style.paddingBottom=`${t.bottom}px`),t.left!==void 0&&(c.style.paddingLeft=`${t.left}px`)}),["top","right","bottom","left"].forEach(d=>{t[d]!==void 0&&(i.block.padding[d]=t[d])}),a&&o.forEach(d=>{const c=d,u=c.querySelector(".em-mob-wrap"),f=c.parentElement?.getAttribute("em")==="block";u&&f&&c.querySelectorAll(":scope > table").forEach(p=>{r.setStructureBlocksWidth(p)})})}}function F(e,r,i,n){const l=r.querySelector(".em-narrow-table"),o=i?'[em="block"].em-contrast-block > td':'[em="block"]:not(.em-contrast-block) > td',t=i?'[em="block"] > td > table > tr > [bgcolor]':'[em="block"]:not(.em-contrast-block) > td > table > tr > [bgcolor]',a=i?'[em="block"] > td > table > tr > [style*="background-color"]':'[em="block"]:not(.em-contrast-block) > td > table > tr > [style*="background-color"]';l?e===""?r.querySelectorAll(o).forEach(d=>{const c=d;c.removeAttribute("bgcolor"),c.style.removeProperty("background-color")}):r.querySelectorAll(o).forEach(d=>{const c=d;c.setAttribute("bgcolor",e),c.style.backgroundColor=e}):e===""?r.querySelector(t)?r.querySelectorAll(t).forEach(d=>{const c=d;c.removeAttribute("bgcolor"),c.style.removeProperty("background-color")}):r.querySelector(a)&&r.querySelectorAll(a).forEach(d=>{const c=d;c.removeAttribute("bgcolor"),c.style.removeProperty("background-color")}):r.querySelector(t)?r.querySelectorAll(t).forEach(d=>{const c=d;c.style.backgroundColor=e,c.setAttribute("bgcolor",e)}):r.querySelector(a)&&r.querySelectorAll(a).forEach(d=>{const c=d;c.style.backgroundColor=e,c.setAttribute("bgcolor",e)}),i?n.block.contrastBackgroundColor=e:n.block.backgroundColor=e}var ke=320;function _(e){if(e==null||e==="")return null;if(typeof e=="number"&&!Number.isNaN(e))return e;if(typeof e=="object"&&e!==null&&"value"in e){const r=Number(e.value);return Number.isNaN(r)?null:r}return null}function q(){for(const e of document.body.children)if(e.tagName==="DIV"||e.tagName==="CENTER"){const r=e;if(r.style.background||r.style.backgroundColor)return e;for(const i of e.children)if(i.tagName==="DIV"){if(r.style.background||r.style.backgroundColor)return e;for(const n of i.children){const l=n;if(l.getAttribute("width")==="100%"||l.style.width==="100%")return n}}else{const n=i;if(n.getAttribute("width")==="100%"||n.style.width==="100%")return i}}else{const r=e;if(r.getAttribute("width")==="100%"||r.style.width==="100%")return e}return null}function Ee(e,r){const{globalHolder:i,emailWidth:n,state:l,findParentTr:o}=r,t=_(e.width);if(t==null||t<ke||!i)return!1;function a(d){if(d.elem.nodeName==="#comment"&&d.elem.textContent?.indexOf("mso")!==-1)d.elem.textContent=d.elem.textContent.replace(/width=".*"/gi,`width="${d.width}"`);else{const c=d.elem.previousSibling;c&&a({elem:c,width:d.width})}}return i.querySelector(".em-narrow-table")||i.querySelector(".noresp-em-narrow-table")?(Te(i,t,n,a),we(i,e,n,o,a)):Ae(i,t,n,a),n>500&&i.querySelectorAll(`[width="${n}"]`).forEach(d=>{d.setAttribute("width",String(t))}),xe(t),l.set("emailWidth",t),!0}function Te(e,r,i,n){e.querySelectorAll('[style*="width"]').forEach(l=>{const o=l;o.style.verticalAlign||(o.style.width&&parseFloat(o.style.width)===i&&(o.style.width=r+"px"),o.style.maxWidth&&parseFloat(o.style.maxWidth)===i&&(o.style.maxWidth=r+"px"),o.style.minWidth&&parseFloat(o.style.minWidth)===i&&(o.style.minWidth=r+"px"),n({elem:o,width:r}))})}function we(e,r,i,n,l){const o=[];e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(a=>{const d=n(a);d&&!o.includes(d)&&o.push(d)});const t=r.project==="useblocks"?640:660;o.forEach(a=>{const d=a.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(!d)return;const c=d.parentElement?.closest("td"),u=parseFloat(c?.style.paddingLeft||"0")||0,f=parseFloat(c?.style.paddingRight||"0")||0,p=d.closest("table")?.parentElement?.getBoundingClientRect().width||0,h=a.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:t;if(a.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length>1)Be(a)&&Le(a,p,u,f,h);else if(d.getAttribute("width")&&!d.classList.contains("em-insert-ignore")){const y=Math.round(p-u-f);d.setAttribute("width",String(y))}})}function Be(e){const r=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let i=0;i<r.length;i++){const n=r[i];if(n.classList.contains("em-insert-ignore"))continue;const l=n.getAttribute("width");if(l!=null&&l!=="")return!0}return!1}function Le(e,r,i,n,l){const o=e.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),t=o?parseFloat(o.getAttribute("width")||"0"):0,a=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),d=a.length;let c=0,u=0;a.forEach(h=>{const y=h;if(y.getAttribute("width")&&!y.classList.contains("em-insert-ignore")){const m=parseFloat(y.getAttribute("width")||"0")/l,b=Math.round(r*m-t/(d*2));y.setAttribute("width",String(b)),c+=b}});const f=r-(i+n+t*(d-1)+c);a.forEach(h=>{const y=h;if(y.getAttribute("width")&&!y.classList.contains("em-insert-ignore")){const m=parseFloat(y.getAttribute("width")||"0")+Math.round(f/d);u+=m,y.setAttribute("width",String(m)),y.querySelectorAll("img").forEach(b=>{parseFloat(b.getAttribute("width")||"0")>m&&(b.setAttribute("width",String(m)),b.style.maxWidth=m+"px")})}}),u=u+t*(d-1)+i+n;const p=r-u;if(p!==0&&c>0){const h=e.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(h&&!h.classList.contains("em-insert-ignore")){const y=parseFloat(h.getAttribute("width")||"0");h.setAttribute("width",String(y+p))}else{const y=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let m=y.length-1;m>=0;m--){const b=y[m];if(b.classList.contains("em-insert-ignore"))continue;const T=parseFloat(b.getAttribute("width")||"0");b.setAttribute("width",String(T+p));break}}}}function Ae(e,r,i,n){e.querySelectorAll('div[style*="inline-block"]').forEach(l=>{const o=l;if(!o.getAttribute("em-floatblock-width")){const t=o.parentElement?.getBoundingClientRect().width||1;o.setAttribute("em-floatblock-width",String(o.getBoundingClientRect().width/t))}}),e.querySelectorAll('[style*="width"]').forEach(l=>{const o=l;o.style.verticalAlign||(o.style.width&&parseFloat(o.style.width)===i&&(o.style.width=r+"px"),o.style.maxWidth&&parseFloat(o.style.maxWidth)===i&&(o.style.maxWidth=r+"px"),o.style.minWidth&&parseFloat(o.style.minWidth)===i&&(o.style.minWidth=r+"px"),n({elem:o,width:r}))}),e.querySelectorAll('div[style*="inline-block"]').forEach(l=>{const o=l,t=o.parentElement?.getBoundingClientRect().width||0,a=parseFloat(o.getAttribute("em-floatblock-width")||"0"),d=o.getBoundingClientRect().width-(o.firstElementChild?.getBoundingClientRect().width||0),c=o.getBoundingClientRect().width-d;let u=0;o.style.maxWidth?(o.style.maxWidth=Math.floor(t*a)+"px",u=o.getBoundingClientRect().width-d,o.firstElementChild&&(o.firstElementChild.setAttribute("width",String(Math.round(u))),o.firstElementChild.style.maxWidth=Math.round(u)+"px")):o.style.width&&(o.style.width=Math.floor(t*a)+"px",u=o.getBoundingClientRect().width-d,o.firstElementChild?.setAttribute("width",String(u))),n({elem:o,width:Math.floor(t*a)}),o.removeAttribute("em-floatblock-width"),o.querySelectorAll("img").forEach(f=>{const p=parseFloat(f.getAttribute("width")||"0");(p>=u||p===c)&&(f.setAttribute("width",String(u)),f.style.maxWidth=u+"px")})})}function xe(e){for(const r of document.head.querySelectorAll("style"))if(r.innerHTML.match(/@media.*?max((.|\n|\r)*?){/)){r.innerHTML=r.innerHTML.replace(/max-device-width:\d+px/gi,`max-device-width:${e}px`),r.innerHTML=r.innerHTML.replace(/max-width:\d+px/gi,`max-width:${e}px`);break}}function Me(e,r){e.querySelectorAll("img, amp-img").forEach(i=>{const n=i;if(r){const l=n.getAttribute("width");if(l)if(n.style.width="100%",l.includes("%"))n.style.maxWidth=l;else{const o=parseFloat(l);Number.isNaN(o)||(n.style.maxWidth=`${o}px`)}}else n.style.removeProperty("width"),n.style.removeProperty("max-width")})}function Fe(e,r){if(e.responsive===void 0||!r)return;const i=_(e.width);if(e.responsive.shutdown){const n=r.querySelector(".noresp-em-narrow-table");if(n)n.className=n.className.replace(/noresp-em-narrow/gi,"em-narrow");else{const l=r.querySelector("table:first-child");l&&(l.setAttribute("width","100%"),l.style.width="100%",i!=null&&(l.style.maxWidth=i+"px"),l.style.minWidth="320px")}document.querySelectorAll('[class*="noresp-em-mob"]').forEach(l=>{l.className=l.className.replace(/noresp-em-mob/gi,"em-mob")}),document.documentElement.removeAttribute("style")}else{const n=r.querySelector(".em-narrow-table");if(n)n.className=n.className.replace(/em-narrow/gi,"noresp-em-narrow");else{const l=r.querySelector("table:first-child");l&&i!=null&&(l.setAttribute("width",String(i)),l.style.width=i+"px",l.style.maxWidth=i+"px",l.style.minWidth=i+"px")}document.querySelectorAll('[class*="em-mob"]:not([class*="noresp-em-mob"])').forEach(l=>{l.className=l.className.replace(/em-mob/gi,"noresp-em-mob")})}Me(r,!!e.responsive.shutdown)}function _e(e,r){if(!e||!e.length)return;let i=document.head.querySelector('style[em="styles"]'),n="";i?n=r.getInnerHtml(i):(i=document.createElement("style"),i.setAttribute("em","styles"),i=document.head.insertAdjacentElement("beforeend",i));const l=document.createElement("div");l.insertAdjacentHTML("afterbegin",e.join(`
|
|
86
|
+
`));let o=s.minifyStylesheet(n+`
|
|
87
|
+
`+[...l.querySelectorAll("style")].map(t=>t.innerHTML).join(`
|
|
88
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;o=cssbeautify(o,{indent:" ",autosemicolon:!0}),i&&(i.textContent=`
|
|
89
|
+
`+o+`
|
|
90
|
+
`)}var P=`<style em="styles">
|
|
91
|
+
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
92
|
+
.em-mob-width-100perc {
|
|
93
|
+
width: 100%!important;
|
|
94
|
+
max-width: 100%!important;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
98
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding-bottom: 10px;">
|
|
99
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
|
|
100
|
+
</td></tr></table>`,qe=`<style>
|
|
101
|
+
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
102
|
+
.em-mob-wrap {
|
|
103
|
+
display: block!important;
|
|
104
|
+
}
|
|
105
|
+
.em-mob-width-100perc {
|
|
106
|
+
width: 100%!important;
|
|
107
|
+
max-width: 100%!important;
|
|
108
|
+
}
|
|
109
|
+
.em-mob-padding_right-20 {
|
|
110
|
+
padding-right: 20px!important;
|
|
111
|
+
}
|
|
112
|
+
.em-mob-padding_left-20 {
|
|
113
|
+
padding-left: 20px!important;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
</style>
|
|
117
|
+
<tr em="block" class="em-structure">
|
|
118
|
+
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20" bgcolor="#ffffff">
|
|
119
|
+
<table align="center" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
120
|
+
<tr>
|
|
121
|
+
<td width="600" valign="top" class="em-mob-wrap em-mob-width-100perc">
|
|
122
|
+
{{ATOM_HTML}}
|
|
123
|
+
</td>
|
|
124
|
+
</tr>
|
|
125
|
+
</table>
|
|
126
|
+
</td>
|
|
127
|
+
</tr>`;function Pe(e,r){if(!(e&&(s.isEmptyTable(e)||!e.innerHTML.trim()))||r.getLockEditor())return!1;const i=P.match(/<style((.|\n|\r)*?)<\/style>/g);r.applyStylesToDocument(i||[]);let n=P.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();n=r.commonStylesApply({html:n});let l=qe.replace("{{ATOM_HTML}}",n);const o=l.match(/<style((.|\n|\r)*?)<\/style>/g);r.applyStylesToDocument(o||[]),l=r.commonStylesApplyToBlock({html:l}),(l.indexOf("empty-structure")>-1||l.indexOf("em-structure")>-1)&&(l=r.setFloatBlocksWidth({blockHTML:l,targetBlock:e,project:r.appName})),s.insertAdjacentHTML(s.rowsHost(e),"beforeend",`
|
|
128
|
+
`+l+`
|
|
129
|
+
`);const t=e.querySelector('[em="block"]:last-child [em="atom"]');if(t){const a=t.querySelector("div");let d=null;a&&(a.innerHTML="",a.appendChild(document.createTextNode("")),r.wrapEditor(a,!0),a.classList.add("em-just-inserted"),setTimeout(()=>{const c=a.closest("editor")||a,u=c?.querySelector("div")||a,f=u||c||a,p=f.getBoundingClientRect();["mouseover","mousedown","mouseup","click"].forEach(m=>{const b=new MouseEvent(m,{bubbles:!0,cancelable:!0,view:window,clientX:p.left+Math.min(1,Math.max(0,p.width/2)),clientY:p.top+Math.min(1,Math.max(0,p.height/2)),button:0});s.withForeignListenersPaused(()=>f.dispatchEvent(b))});let h=u.firstChild;h||(h=document.createTextNode(""),u.appendChild(h)),s.withForeignListenersPaused(()=>c?.focus?.());const y=window.getSelection();if(y&&h){const m=document.createRange();m.setStart(h,0),m.collapse(!0),y.removeAllRanges(),s.withForeignListenersPaused(()=>y.addRange(m))}r.setCursorPosition(c||a),r.commit()},0),d=a.closest("editor")||a),a&&r.setCursorPosition(d||a)}return r.messageService.send("application_atom_inserted","text"),r.commit(),!0}function Ne({getGlobalHolder:e,view:r=window}){let i=0;const n=()=>{i=0,s.state.get("previewPage")&&s.fitEmailToWidth(e(),r)},l=()=>{!i&&s.state.get("previewPage")&&(i=r.requestAnimationFrame(n))},o=s.state.subscribeToKey("previewPage",t=>{t?l():s.applyRootScale(r.document.documentElement,1)&&r.parentIFrame?.size?.()});return r.addEventListener("resize",l),l(),{refit:l,dispose:()=>{o(),r.removeEventListener("resize",l),i&&(r.cancelAnimationFrame(i),i=0)}}}var v=s.createIdentifier("SandboxEmailGlobalHolder"),x=s.createIdentifier("SandboxPreviewFit");function Re(){s.setBlockGroupControlsPosition({scrollTop:s.state.get("scrollTop")})}var We=s.defineUnit({name:"sandbox.emailInitialState",setup(){s.editLock.reset(),s.state.update({activeCell:[],globalHolder:null,applicationTheme:"light",iframeOffsetTop:0,scrollTop:0,previewHeight:0,applicationMode:"default",emailWidth:0,elementPath:[],copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,elementAIimageEnabled:!0,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,blocksAddPanelEnabled:!0,codeMode:!0,appName:"",commonStyles:{},isProgrammaticSelection:!1}),s.implementPolyfills()}}),Ie=s.defineUnit({name:"sandbox.emailGlobalHolder",provides:[v],setup(e){let r=null;s.state.subscribe(i=>{"globalHolder"in i&&(r=i.globalHolder??null)}),e.inject(v,{get:()=>r,set:i=>{r=i}})}}),He=s.defineUnit({name:"sandbox.emailPreview",provides:[s.INIT_PREVIEW_ID,x],awaits:{services:[v,s.SYNC_COMMIT_ID,s.EDIT_LOCK_ID]},setup(e){const r=s.requireService(e,v),i=s.commitOf(e),n=s.requireService(e,s.EDIT_LOCK_ID),l=Ne({getGlobalHolder:()=>r.get()});e.inject(x,l),e.inject(s.INIT_PREVIEW_ID,(o=!1)=>{de({state:s.state,getEmailWidth:()=>s.state.get("emailWidth"),closeEditorInit:()=>n.closeEditorInit(),messageService:s.messageService,removeHiddenClasses:s.removeHiddenClasses,findGlobalHolder:q,elMarkupHelper:()=>s.elMarkupHelper(r.get()),rgbToHex:s.rgbToHex,getSubject:s.getSubject,getPreheader:s.getPreheader,getUsedColors:s.getUsedColors,commit:i,setGlobalHolder:t=>r.set(t)},o),l.refit()})}}),De=s.defineUnit({name:"sandbox.emailInsertPolicy",provides:[s.INSERT_POLICY_ID],setup:e=>e.inject(s.INSERT_POLICY_ID,{})});function N(e){const r=s.requireService(e,s.HTML_DOCUMENT_ID),i=s.commitOf(e);return{commit:i,htmlDocument:r,applyStylesToDocument:n=>_e(n,r),setFloatBlocksWidth:n=>s.setFloatBlocksWidth(n,r),setBlockMaxWidth:n=>s.setBlockMaxWidth(n,r),commonStylesApply:n=>s.commonStylesApply(n,i)}}var Oe=s.defineUnit({name:"sandbox.emailNarrowTable",provides:[s.NARROW_TABLE_TEXT_ATOM_ID],awaits:{services:[s.HTML_DOCUMENT_ID,s.SYNC_COMMIT_ID,s.WRAP_EDITOR_ID,s.SET_CURSOR_ID,s.EDIT_LOCK_ID]},setup(e){const r=N(e),i=s.requireService(e,s.EDIT_LOCK_ID),n=s.requireService(e,s.WRAP_EDITOR_ID).now,l=s.requireService(e,s.SET_CURSOR_ID);e.inject(s.NARROW_TABLE_TEXT_ATOM_ID,o=>Pe(o,{getLockEditor:()=>i.isIntegratorLocked(),applyStylesToDocument:r.applyStylesToDocument,commonStylesApply:r.commonStylesApply,commonStylesApplyToBlock:s.commonStylesApplyToBlock,setFloatBlocksWidth:t=>r.setFloatBlocksWidth({...t,targetBlock:t.targetBlock}),appName:s.state.get("appName"),wrapEditor:n,setCursorPosition:l,messageService:s.messageService,commit:()=>r.commit()}))}}),$e=s.defineUnit({name:"sandbox.emailDocumentServices",awaits:{services:[s.HTML_DOCUMENT_ID,s.FOCUS_ID]},setup(e){const r=s.requireService(e,s.HTML_DOCUMENT_ID),{controller:i}=s.requireService(e,s.FOCUS_ID);J(),te(),s.registerPreheaderService(r,i),s.registerSubjectService(r,i)}}),ze=s.defineUnit({name:"sandbox.emailOperations",awaits:{services:[v,s.HTML_DOCUMENT_ID,s.SYNC_COMMIT_ID,s.SELECTION_LOCK_ID,s.EDIT_LOCK_ID]},setup(e){const r=s.requireService(e,v),i=s.requireService(e,s.SYNC_COMMIT_ID),n=s.requireService(e,s.SELECTION_LOCK_ID),l=s.requireService(e,s.EDIT_LOCK_ID),o=N(e),{commit:t,htmlDocument:a}=o,d=()=>({state:s.state,previewHeight:s.state.get("previewHeight"),iframeOffsetTop:s.state.get("iframeOffsetTop"),scrollTop:s.state.get("scrollTop"),globalHolder:r.get(),setBlockGroupControlsPosition:Re,messageService:s.messageService});s.messageService.addListener(function(c){const u=c.data??{};if(u.operation===s.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET){const f=u.settings??{};r.set(q());const p=r.get();if(p){const m=p.classList.contains("full-wrap")?p.querySelector("td"):p;m&&s.setEmailBackgroundSettings(m,f,s.getPreheaderElem())}f.subject!==void 0&&(document.title=f.subject);const h=Ee(f,{globalHolder:p,emailWidth:s.state.get("emailWidth"),state:s.state,findParentTr:s.findParentTr});Fe(f,p),ue(f,{globalHolder:p,commonStyles:s.state.get("commonStyles"),lockEditor:l.isIntegratorLocked(),removeClassesByPrefix:s.removeClassesByPrefix,createFontClassName:s.createFontClassName,addFontFamilyClass:m=>s.addFontFamilyClass(m,t),clearLinkTags:m=>s.clearLinkTags(m,t),clearProjectFontFaces:()=>s.clearProjectFontFaces(m=>t(m)),rgbToHex:s.rgbToHex,setElementBorder:s.setElementBorder,setElementBorderRadius:s.setElementBorderRadius,setStructureBlocksWidth:s.setStructureBlocksWidth,messageService:s.messageService});const y=Object.keys(f).filter(m=>f[m]!==void 0);(h||!(y.length===1&&y[0]==="width"))&&i.commitLockedAsync()}u.operation===s.EVENT_TYPES.SANDBOX_IFRAME_SETSIZE&&(s.state.get("previewPage")?e.getInstance(x)?.refit():s.iframeSetSize(u.settings,d()))}),s.messageService.addListenerAsync(s.EVENT_TYPES.SANDBOX_GLOBAL_BLOCK_REPLACE,c=>{const u=c??{};return s.globalBlockReplace({emBlockId:u.emBlockId,blockHTML:u.blockHTML,type:u.type,project:u.project,name:u.name},{selectionLock:n,commit:t,lockEditor:l.isIntegratorLocked(),emailWidth:s.state.get("emailWidth"),iframeOffsetTop:s.state.get("iframeOffsetTop"),previewHeight:s.state.get("previewHeight"),parseFromString:f=>s.parseFromString(f),getOuterHtml:s.getOuterHtml,HTMLDocument:a,minify:s.minifyStylesheet,cssbeautify,insertAdjacentHTML:(f,p,h)=>s.insertNewHTML(f,p,h),messageService:s.messageService,setDocumentStyles:f=>s.setDocumentStyles(f,{minify:s.minifyStylesheet,cssbeautify,HTMLDocument:a}),setImageWidth:s.setImageWidth,commonStylesApply:o.commonStylesApply,commonStylesApplyToBlock:s.commonStylesApplyToBlock,insertCountdown:f=>s.insertCountdown(f,t),uptimeCountdown:s.uptimeCountdown,setBlockMaxWidth:o.setBlockMaxWidth,setFloatBlocksWidth:o.setFloatBlocksWidth,fitImagesToColumns:s.fitImagesToColumns,checkBlockAdaptivity:s.checkBlockAdaptivity})})}}),Ue=[Ie,He,De,Oe,$e,ze],je=s.defineSurface({name:"email",profile:Q,units:[s.diagnosticsAgentUnit,We,...s.CANVAS_CORE_UNITS,s.ampUnit,...s.EMAIL_LAYOUT_UNITS,...Ue,s.extensionsUnit(V),s.paintGateUnit,s.wheelBridgeUnit,s.deviceWidthMediaGuardUnit]});s.startSandbox(je)});
|
package/iframe/js/iframe.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var e=window.__emailmaker__||(window.__emailmaker__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=null,s={},c={},l=0;function u(e,t){l+=1;try{return e.factory.apply(null,t)}finally{--l}}var d=`./`,f={},p=60,m=`emailmaker:diagnostics`,h=[],g;function _(){if(g!==void 0)return g;g=!1;try{var e=/[?&]diagnostics(?:=([^&]*))?/.exec(window.location.search||``);if(e)return g=e[1]!==`0`,g;if(typeof window.__DIAGNOSTICS__==`boolean`)return g=!!window.__DIAGNOSTICS__,g;g=window.localStorage.getItem(m)===`1`}catch{g=!1}return g}function v(e,t){if(_()){var n={phase:e,at:performance.timeOrigin+performance.now(),kind:`wait`};t&&(n.parent=String(t)),h.push(n)}}function y(e){if(!e||e.__amdLogged)return e;try{Object.defineProperty(e,"__amdLogged",{value:!0,enumerable:!1})}catch{try{e.__amdLogged=!0}catch{}}try{var t=e&&e.message||`loader error`;console.error(`[AMD] `+(t.indexOf(`[AMD]`)===0?t.slice(6):t),e)}catch{}return e}function b(){try{if(e!==void 0&&e&&e.publicPath)return String(e.publicPath)}catch{}return`(not set)`}function x(){var e=b();return String(e).indexOf(`file:`)===0?` The page appears to be opened as a local file (file://) or publicPath was not configured. Serve the host app over HTTP(S) and set publicPath to the origin that serves editor assets (host bundler plugin or __amdEnv.setPublicPath). Current runtime publicPath=`+e+`.`:` Host bundler publicPath may be misconfigured (Vite/Webpack host plugin). In dev, set publicPath to the absolute origin that serves editor assets (for example http://localhost:3001/<outputFolder>/). Current runtime publicPath=`+e+`.`}function S(e){if(typeof fetch!=`function`)return Promise.resolve(``);function t(e){var t=(e.headers.get(`content-type`)||``).toLowerCase();try{e.body&&typeof e.body.cancel==`function`&&e.body.cancel()}catch{}return t.indexOf(`text/html`)>=0?` The URL returned HTML (Content-Type: text/html), not JavaScript — often a SPA fallback when asset paths are wrong.`:e.ok?``:` HTTP status `+e.status+` — the asset URL may be wrong or blocked by the server.`}return fetch(e,{method:`HEAD`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(function(n){return n.status===405||n.status===501?fetch(e,{method:`GET`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(t):t(n)}).catch(function(){return fetch(e,{method:`GET`,credentials:`omit`,headers:{Accept:`application/javascript,*/*`}}).then(t).catch(function(){return``})})}function C(e,t){var n=Error(`[AMD] Failed to load module "`+e+`"`+(t?`: `+t.message:``));return n.moduleId=e,n.cause=t,n}function w(e,t,n){var r=Error(`[AMD] Failed to resolve dependency "`+t+`" for module "`+e+`"`+(n?`: `+n.message:``));return r.moduleId=e,r.dependencyId=t,r.cause=n,r}function T(e){for(var t=String(e||``).split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];if(i&&i!==`.`){if(i===`..`){n.length>0&&n.pop();continue}n.push(i)}}return n.join(`/`)}function E(e){var t=String(e||``).replace(/\\/g,`/`),n=String(d||`./`).replace(/\\/g,`/`);return n=n.replace(/^\.\/+/,``),n=n.replace(/^\/+/,``),n&&n.slice(-1)!==`/`&&(n+=`/`),n&&t.indexOf(n)===0&&(t=t.slice(n.length)),t.indexOf(`./`)===0&&(t=t.slice(2)),t}function D(e){return{then:function(t,n){return e.then(t,n)},catch:function(t){return e.catch(t)},finally:function(t){return e.finally(t)}}}function O(e,t){var n=String(e||``);if(!n)return n;if(n.indexOf(`./`)!==0&&n.indexOf(`../`)!==0)return E(T(n));var r=t||``;if(Object.prototype.hasOwnProperty.call(f,r)){var i=String(f[r]||``);i&&!k(i)&&i.charAt(0)!==`/`&&(r=i)}var a=T(r),o=a?a.split(`/`):[];o.length>0&&o.pop();for(var s=n.split(`/`),c=0;c<s.length;c++){var l=s[c];if(l&&l!==`.`){if(l===`..`){o.length>0&&o.pop();continue}o.push(l)}}return E(o.join(`/`))}function k(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function A(e){var t=String(e||``);if(!t||k(t))return t;try{var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return t}}function j(){var t=String(d||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),k(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,A(e.publicPath)).href}catch{}return A(t)}function M(e,t){var n=O(e,t),r=j(),i=Object.prototype.hasOwnProperty.call(f,n)?String(f[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function N(){if(typeof document>`u`)return``;var e=document.currentScript;if(e){var t=e.getAttribute(`data-amd-module-id`);if(t)return t}return``}function P(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=N()):typeof e==`function`?(r=e,n=[],e=N()):typeof n==`function`&&(r=n,n=[]),!e)throw Error(`[AMD] Anonymous define() could not be associated with a module id`);e in t||(t[e]={deps:n||[],factory:r})}P.amd={async:!0};function F(e){var t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}P(`vite/preload-helper`,[`exports`],function(e){e.__vitePreload=function(e){return Promise.resolve().then(function(){return e().catch(F)})}});function I(){return function(){}}function L(e,t){return{id:e,exports:t,uri:M(e)}}function R(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return V(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return V(e,r)}function z(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=O(e,o);if(s in a)throw y(a[s]);if(s in n)return n[s];if(s in r||s in i)throw y(C(s,Error(`Module is still loading asynchronously`)));if(!(s in t))throw y(C(s,Error(`Module is not available for syncRequire`)));return U(s)}function B(e,i){if(o&&e in o){var s={},c=[e];for(s[e]=!0;c.length>0;){var l=o[c.shift()];if(l)for(var u=0;u<l.length;u++){var d=l[u];s[d]||(s[d]=!0,c.push(d),!(d in n||d in a||d in r)&&(d in o?d in t||K(d,i).catch(function(){}):d in t&&V(d).catch(function(){})))}}}}function V(e,i){var o=O(e,i);if(o in a)return Promise.reject(y(a[o]));if(o in n)return Promise.resolve(n[o]);if(o in r)return r[o];if(v(`core:module:`+o+`:ask`,i),o in t)r[o]=H(o);else{var s=M(o);r[o]=K(o).then(function(){return v(`core:module:`+o+`:loaded`,i),o in t?H(o):S(s).then(function(e){var t=C(o,Error(`Module not defined after script load from "`+s+`".`+e+x()));throw a[o]=t,y(t)})}).catch(function(e){delete r[o];var t=e&&e.moduleId===o?e:C(o,e);throw a[o]=t,y(t)})}return B(o),r[o]}function H(e){var i=t[e],o=W(e),s=I(),l=L(e,s);c[e]=s;function d(t){return n[e]=t,delete r[e],delete c[e],n[e]}return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?l:V(t,e).catch(function(n){throw w(e,t,n)})})).then(function(t){v(`core:module:`+e+`:deps`);var n=u(i,t);return n&&typeof n.then==`function`?n.then(function(t){return v(`core:module:`+e+`:ready`),d(t===void 0?l.exports:t)}):(v(`core:module:`+e+`:ready`),d(n===void 0?l.exports:n))}).catch(function(t){throw delete r[e],delete c[e],a[e]=t,y(t)})}function U(e){var r=t[e],i=W(e),o=I(),s=L(e,o);try{var c=u(r,r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return z(t,e)}catch(n){throw w(e,t,n)}}));if(c&&typeof c.then==`function`)throw C(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=c===void 0?s.exports:c,n[e]}catch(t){throw a[e]=t,y(t)}}function W(e){var o=function(o,s,u){if(Array.isArray(o))return R(o,s,u,e);var d=O(o,e);if(d in a)throw y(a[d]);return d in n?n[d]:d in c&&l>0?c[d]:d in r||d in i?D(V(o,e)):d in t?z(o,e):D(V(o,e))};return o.resolve=function(t){return O(t,e)},o.toUrl=function(t){return M(t,e)},o.sync=function(t){return z(t,e)},o}function G(t,n){var r=e!==void 0&&e?e.moduleTransport:null;if(typeof r!=`function`||e.blobBlocked)return null;try{var i=r(t,n);return i&&typeof i.then==`function`?i:null}catch{return null}}function K(t,n){if(t in i)return i[t];if(s[t]&&s[t]!==t)return i[t]=K(s[t],n),i[t];var r=M(t);if(document.querySelector(`script[src="`+r+`"]`))return i[t]=Promise.resolve(),i[t];var a=performance.now();function o(e){return J(t,r,!1,n).then(function(n){return q(t,e,a),n})}var c=G(r,t);return c?(i[t]=c.then(function(r){return r?J(t,URL.createObjectURL(r),!0,n).then(function(e){return q(t,`transport`,a),e},function(){return e.blobBlocked=!0,o(`network-after-blob`)}):o(`network-fallback`)},function(){return o(`network-after-transport-error`)}),i[t]):(i[t]=o(`network`),i[t])}function q(t,n,r){_()&&((e.loaderTimings||=[]).push({id:t,via:n,ms:Math.round((performance.now()-r)*10)/10}),typeof e.onLoaderTiming==`function`&&e.onLoaderTiming())}function J(e,t,n,r){return new Promise(function(a,o){var s=!1,c=document.createElement(`script`);c.src=t,c.setAttribute(`data-amd-module-id`,e),c.async=!0,r===`low`&&(c.fetchPriority=`low`);var l=p>0?p*1e3:0,u=null;function d(){u!=null&&(clearTimeout(u),u=null),c.onload=null,c.onerror=null,n&&typeof URL<`u`&&URL.revokeObjectURL&&URL.revokeObjectURL(t)}function f(e){s||(s=!0,d(),e())}l>0&&(u=setTimeout(function(){f(function(){delete i[e],o(y(C(e,Error(`Timed out after `+l+`ms loading script: `+t+`.`+x()))))})},l)),c.onload=function(){f(function(){a()})},c.onerror=function(){f(function(){delete i[e],o(y(C(e,Error(`Failed to load script: `+t+`.`+x()))))})},document.head.appendChild(c)})}R.config=function(e){if(e.baseUrl&&(d=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(f[t]=e.paths[t]);if(e.bundles){for(var n in e.bundles)if(Object.prototype.hasOwnProperty.call(e.bundles,n))for(var r=0;r<e.bundles[n].length;r++)s[e.bundles[n][r]]=n}if(e.graph)for(var i in o||={},e.graph)Object.prototype.hasOwnProperty.call(e.graph,i)&&(o[i]=e.graph[i]);typeof e.waitSeconds==`number`&&e.waitSeconds>=0&&(p=e.waitSeconds)},R.warm=function(e,r){var i=r&&r.priority;return Promise.all((e||[]).map(function(e){var r=O(e);if(r in a)return Promise.reject(a[r]);var o=r in t||r in n?Promise.resolve():K(r,i);return B(r,i),o})).then(function(){})},R.modules=t,R.resolved=n,R.errors=a,R.toUrl=M,R.sync=z,e.define=P,e.require=R,e.syncRequire=z,e.diagnosticsBuffer=h})(),e.require.config({baseUrl:`./`});
|
|
2
2
|
|
|
3
|
-
__emailmaker__.require.config({ paths: {"js/iframe.js":"js/iframe.body.
|
|
3
|
+
__emailmaker__.require.config({ paths: {"js/iframe.js":"js/iframe.body.091c986b.js"} });
|
|
4
4
|
|
|
5
|
-
__emailmaker__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.
|
|
5
|
+
__emailmaker__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.DoIAMao4.js"],"js/iframe.js":["js/elMarkupHelper.DoIAMao4.js"],"js/darkreader.CLd5EML2.js":[],"js/elMarkupHelper.DoIAMao4.js":[],"js/rules.CnnzdMsj.js":[],"js/typograf.all.Mun9CrLC.js":[]}});
|
|
6
6
|
|
|
7
7
|
__emailmaker__.require("js/iframe.js");
|
package/package.json
CHANGED
package/runtime/react/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../vendor/react/index.js";var f=e&&e.default?e.default:e,{Activity:m,Children:n,Component:o,Fragment:c,Profiler:E,PureComponent:v,StrictMode:d,Suspense:R,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:S,__COMPILER_RUNTIME:h,cache:T,cacheSignal:g,cloneElement:N,createContext:k,createElement:_,createRef:b,forwardRef:A,isValidElement:O,lazy:I,memo:D,startTransition:L,unstable_useCacheRefresh:M,use:P,useActionState:U,useCallback:V,useContext:x,useDebugValue:H,useDeferredValue:z,useEffect:F,useEffectEvent:G,useId:W,useImperativeHandle:Y,useInsertionEffect:j,useLayoutEffect:p,useMemo:q,useOptimistic:w,useReducer:B,useRef:J,useState:Q,useSyncExternalStore:X,useTransition:Z,version:$}=e;try{var u=Symbol.for("editor-runtime.react.copies"),a=globalThis[u];a||(a=[],globalThis[u]=a);for(var s=!1,r=0;r<a.length;r++){var t=a[r];t&&t.react===e&&t.package==="@emailmaker/emailmaker"&&t.version==="1.3.
|
|
1
|
+
import e from"../../vendor/react/index.js";var f=e&&e.default?e.default:e,{Activity:m,Children:n,Component:o,Fragment:c,Profiler:E,PureComponent:v,StrictMode:d,Suspense:R,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:S,__COMPILER_RUNTIME:h,cache:T,cacheSignal:g,cloneElement:N,createContext:k,createElement:_,createRef:b,forwardRef:A,isValidElement:O,lazy:I,memo:D,startTransition:L,unstable_useCacheRefresh:M,use:P,useActionState:U,useCallback:V,useContext:x,useDebugValue:H,useDeferredValue:z,useEffect:F,useEffectEvent:G,useId:W,useImperativeHandle:Y,useInsertionEffect:j,useLayoutEffect:p,useMemo:q,useOptimistic:w,useReducer:B,useRef:J,useState:Q,useSyncExternalStore:X,useTransition:Z,version:$}=e;try{var u=Symbol.for("editor-runtime.react.copies"),a=globalThis[u];a||(a=[],globalThis[u]=a);for(var s=!1,r=0;r<a.length;r++){var t=a[r];t&&t.react===e&&t.package==="@emailmaker/emailmaker"&&t.version==="1.3.8"&&(s=!0)}s||a.push({package:"@emailmaker/emailmaker",version:"1.3.8",react:e})}catch{}export{m as Activity,n as Children,o as Component,c as Fragment,E as Profiler,v as PureComponent,d as StrictMode,R as Suspense,S as __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,h as __COMPILER_RUNTIME,T as cache,g as cacheSignal,N as cloneElement,k as createContext,_ as createElement,b as createRef,f as default,A as forwardRef,O as isValidElement,I as lazy,D as memo,L as startTransition,M as unstable_useCacheRefresh,P as use,U as useActionState,V as useCallback,x as useContext,H as useDebugValue,z as useDeferredValue,F as useEffect,G as useEffectEvent,W as useId,Y as useImperativeHandle,j as useInsertionEffect,p as useLayoutEffect,q as useMemo,w as useOptimistic,B as useReducer,J as useRef,Q as useState,X as useSyncExternalStore,Z as useTransition,$ as version};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__emailmaker__.define("static/core/166a67bd.js",["require","exports","module","static/core/5dc34752.js","static/core/c948c45f.js","static/core/1a65ef0f.js"],function(o,l,m){const u=o("./5dc34752.js"),e=o("./c948c45f.js"),s=o("./1a65ef0f.js");var a=["text","header","image","button","spacer","divider","list-ul","list-ol","video"],h=["1","2","3","4","1:2","2:1"],c=["productCarousel","singleImagePreview","dealAnnotation","dealCard"],t=e.Arg.element(),r="Pass a reference from element.getTree.",n=e.Arg.optional(e.Arg.string()),i="During your answer or a batch it is refused with `undoConflict`: the edits are not closed yet, and undo becomes available after the answer, so tell the user about it.",d={"document.getHtml":{description:'Returns the HTML of the open document. `output: "editor"` (default) is the markup the editor keeps, with its service attributes; `output: "email"` is the compiled email as recipients get it, closed by the plan when it has no HTML export.',args:e.Arg.object({output:e.Arg.optional(e.Arg.enum("editor","email"))})},"document.getText":{description:"Returns the plain-text version of the email as recipients get it, without markup. Closed by the plan when it has no HTML export."},"document.setHeaders":{description:"Sets the subject, the preheader (preview text after the subject) and the title of the email; omitted fields stay. The title follows the subject while they are equal. The plan can close the subject and the preheader, not the title. On the open canvas `history.undo` brings the subject and the preheader back together with the markup, but do not count on it: these fields come back for sure only when the user takes back the whole answer.",args:e.Arg.object({subject:e.Arg.optional(e.Arg.string()),preheader:e.Arg.optional(e.Arg.string()),title:e.Arg.optional(e.Arg.string())})},"document.getSettings":{description:"Returns the layout settings of the whole email: background, width, responsiveness."},"document.setSettings":{description:'Changes layout settings of the whole email; pass only the fields to change, in the form `document.getSettings` returns (for example `{ "backgroundColor": "#ffffff", "width": { "value": 600, "dim": "px" } }`). Other fields are refused: common styles go to `document.setContentStyles`. A background address that is executable or holds "<" or "-->" is refused with `invalidArgs`. Needs the open canvas and an email, not a block; `history.undo` reverts it as one step. `canvasPending: true` in the answer means the settings are written, but the canvas has not confirmed them yet.',args:e.Arg.object({settings:e.Arg.object({})})},"document.getContentStyles":{description:"Returns the common styles of the email content: text, headings, links, buttons, block, cards."},"document.setContentStyles":{description:'Changes the common styles of the email content; pass only the groups and fields to change, in the form `document.getContentStyles` returns (for example `{ "text": { "fontSize": 16 } }`). Another group, a group that is not an object or a font name with one of < > " { } ; \\ or a stray single quote is refused with `invalidArgs`; fields and Google fonts closed by the plan with `lockedByPlan`. `history.undo` does not revert it: it comes back only when the user takes back the whole answer.',args:e.Arg.object({styles:e.Arg.object({})})},"document.replaceHtml":{description:"Replaces the whole document with new HTML in one undo step. Prefer element commands for local changes: this one rewrites everything. Start from `document.getHtml` and keep its service attributes. `html` with no text, pictures or other visible elements is refused with `invalidArgs`. Closed when the plan has no code editing: use element commands then.",args:e.Arg.object({html:e.Arg.string()})},"history.undo":{description:`Undoes the last step of document edits. Fields of the email outside the undo history are not its job: common styles and UTM marks stay, and the subject and the preheader come back only on the open canvas, with the markup; all of them come back when the user takes back the whole answer. ${i}`},"history.redo":{description:`Redoes the last undone step of document edits. ${i}`},"history.listRevisions":{description:"Lists saved revisions of the open document, newest first, one page at a time: id, date, author, subject, title and `isAutosave`, without the content. Rows with `isAutosave: true` are automatic snapshots. Pass an id to `history.restoreRevision` to go back to that version. Closed by the plan when it has no revision history.",args:e.Arg.object({page:e.Arg.optional(e.Arg.number())})},"check.code":{description:"Checks the HTML of the open document and lists the problems: unclosed tags, wrong nesting, bad attributes."},"check.codeSize":{description:"Returns the code size of the email, as the editor's code size badge shows it; Gmail clips emails over 90 KB."},"block.list":{description:"Lists blocks that can be inserted into the email with block.insert. `source` picks where they come from: `project` (default) are the blocks saved in this project, in the look of the user: look there first. `gallery` are the shared ready-made blocks of the editor: use them when the project has nothing that fits. "+s.BLOCK_LIST_HINT,args:e.Arg.object(s.BLOCK_LIST_ARGS)},"check.links":{description:"Checks every link of the open email as it is now over the network and lists them with a status (valid, warnings, errors) and the HTTP code. A new email must be saved first. Paid: each call uses the plan limit."},"check.images":{description:"Checks every image of the open email as it is now over the network and lists them with a status, the HTTP code, size in kilobytes and dimensions. A new email must be saved first. Paid: each call uses the plan limit."},"check.spam":{description:"Scores the open email as it is now with SpamAssassin and lists the rules that matched, lowest weight first; a higher score means more likely spam. A new email must be saved first. Paid: each call uses the plan limit. An editor without a server has no spam check: the answer is `unavailable`."},"element.getTree":{description:"Returns the elements of the open document as a tree: each node has a reference, a kind (row, column, cell, text, image, button, link, spacer, ...) and the start of its text. Use the references in other element commands. References die when the element is deleted, the host rewrites it (undo, code editor) or the document changes; read the tree again then. `truncated: true` means part of the tree is cut: read it with `root` and a larger `depth`.",args:e.Arg.object({root:e.Arg.optional(t),depth:e.Arg.optional(e.Arg.number())})},"element.find":{description:"Finds elements in the whole document (or inside `inside`) without selecting them. All given conditions must match: `kind` (image, button, link, text, row, ...), `textContains`, and `where` on image src and alt or link href: an empty string matches a missing or empty value, other strings match by case-insensitive substring. Returns references with kind, text start and src/alt/href, at most `limit` (50 by default, up to 200), and `total`. To change many found elements in one call, pass element.setProps calls to agent.batch.",args:e.Arg.object({kind:e.Arg.optional(e.Arg.string()),textContains:e.Arg.optional(e.Arg.string()),where:e.Arg.optional(e.Arg.object({alt:e.Arg.optional(e.Arg.string()),src:e.Arg.optional(e.Arg.string()),href:e.Arg.optional(e.Arg.string())})),inside:e.Arg.optional(t),limit:e.Arg.optional(e.Arg.number())})},"text.replace":{description:'Replaces every occurrence of a phrase in the visible text of the document (or inside `inside`) in one undo step; links, image addresses, variables and code are not touched, and neither are the subject, preheader and image alt. Finds whole words by default, in any alphabet: "cat" does not touch "concat", even when part of it is bold; pass `wholeWord: false` to match inside words. Case-insensitive unless `matchCase`. A phrase split by formatting (part of it bold) is not found. Returns `replaced`, the number of replacements, and up to 5 `examples` of `{ before, after }` with some text around.',args:e.Arg.object({find:e.Arg.string(),replace:e.Arg.string(),matchCase:e.Arg.optional(e.Arg.boolean()),wholeWord:e.Arg.optional(e.Arg.boolean()),inside:e.Arg.optional(t)})},"element.get":{description:`Selects the element like a user click and returns what the inspector shows: kind, caption and settings. element.setProps takes the same setting names. ${r}`,args:e.Arg.object({element:t})},"element.select":{description:`Selects the element like a user click: the inspector opens its settings. ${r}`,args:e.Arg.object({element:t})},"ui.highlight":{description:"Outlines the element on the canvas for a while (1.5 s by default, up to 10 s) to show the user what you mean. Neither selects nor changes anything.",args:e.Arg.object({element:t,durationMs:e.Arg.optional(e.Arg.number())})},"element.setProps":{description:'Changes inspector settings of the element in one undo step: link, image source and alt, sizes, paddings, colors, fonts, visibility. Pass only the fields you change, named as element.get returns them; do not send back an address already in the email that holds a template directive: "<" in it is refused. Returns a fresh reference: the element may be rebuilt. `unchanged: true` in the answer means the document did not change: check the setting names with element.get; the value may also be the same already. A field or a new Google font closed by the plan is refused with `lockedByPlan`. An address that is executable or holds "<" or "-->", a font that is not a string or an array of strings and a font name with one of < > " { } ; \\ or a stray single quote are refused with `invalidArgs`.',args:e.Arg.object({element:t,props:e.Arg.object({})})},"element.setText":{description:"Replaces the whole text of a text, header, button or link element in one undo step, keeping its look (font, color, bold header). Plain text only: markup characters stay text, a line break becomes a new line. A cell with one text element inside takes its text too. Refused for text with a list, a picture or a variable: use text.replace. The preheader is refused with `readOnly`: it goes through document.setHeaders.",args:e.Arg.object({element:t,text:e.Arg.string()})},"row.insert":{description:'Inserts an empty row of the palette with columns before or after a row, or at the end of the document without `at`, in one undo step: "1" one column, "2" two equal, "1:2" narrow and wide, "2:1" wide and narrow, "3", "4". Returns the row and its column references; fill the columns with element.insert and place "inside". Prefer a saved block of the project (block.list, block.insert) when one fits.',args:e.Arg.object({columns:e.Arg.enum(...h),at:e.Arg.optional(e.Arg.object({element:t,place:e.Arg.enum("before","after")}))})},"document.getMarkupRules":{description:'Returns the markup rules of email rows (em="block" rows, layout tables, columns, em="atom" atoms, buttons, mobile classes). Read them once before writing rows for row.insertHtml.'},"row.insertHtml":{description:'Inserts rows you wrote in the editor markup (document.getMarkupRules): an optional <link em-class="em-font-..."> of a font on https: and <style em="styles">, then one or more <tr em="block">. Without `at` the rows go after the last row, in the given order, in one undo step. Rows are checked first: `invalidMarkup` lists the broken rules, nothing is inserted; fix and send again. Scripts, other style sheets, event handlers and executable addresses, also inside conditional comments and CSS, are cut. An <em-replace> variable is refused with `lockedByPlan` when the plan has no variables; one with "<" or ">" in `text` is a broken rule: add it with element.insertVariable. A .preheader node is refused with `lockedByPlan` when the plan closes the preheader. Returns the references of the new rows. If the open email changes meanwhile, the answer is `unavailable`. If a row after the first fails, the answer is `partialInsert`: its message names the rows that went in and the reason, the rows stay in the document as one undo step. Prefer a saved block of the project (block.list) when one fits.',args:e.Arg.object({html:e.Arg.string(),at:e.Arg.optional(e.Arg.object({element:t,place:e.Arg.enum("before","after")}))})},"element.insert":{description:`Inserts a new element of the palette (${a.join(", ")}) before or after an element, or at the end inside a row or a column, in one undo step. Returns the reference of the new element; change it with element.setProps.`,args:e.Arg.object({kind:e.Arg.enum(...a),at:e.Arg.object({element:t,place:e.Arg.enum("before","after","inside")})})},"block.insert":{description:"Inserts a block (an id from block.list, with the same `source`: `project` by default, `gallery` for a shared block) before or after a row, in one undo step; without `at` the block goes where a click on the block panel puts it. A gallery block keeps its own colors and fonts: it is not recolored to the common styles of the email. A block with a .preheader node is refused with `lockedByPlan` when the plan closes the preheader. `unavailable` means the open email changed meanwhile. Returns the reference of the new row.",args:e.Arg.object({block:e.Arg.string(),source:s.BLOCK_SOURCE_ARG,at:e.Arg.optional(e.Arg.object({element:t,place:e.Arg.enum("before","after")}))})},"element.delete":{description:`Deletes the element or the row in one undo step. Refused with \`readOnly\` when the element or something inside it is locked by the integrator, and for the preheader or a row with it: it goes through document.setHeaders. ${r}`,args:e.Arg.object({element:t})},"element.clone":{description:"Duplicates the element or the row right after it in one undo step and returns the reference of the copy.",args:e.Arg.object({element:t})},"element.move":{description:"Moves the row one place up or down in one undo step; `cannotMove` when it is already first or last.",args:e.Arg.object({element:t,direction:e.Arg.enum("up","down")})},"agent.batch":{description:'Runs up to 100 tool calls in order in one request, with all their edits in one undo step, for example element.setProps for each element found by element.find, each with its own props. Each call is checked as if called alone. Before the first call the user is asked once about all calls that need consent: if the user declines, no call runs and the answer is `declined`; a yes covers the whole batch. A call refused by a check before that window comes back in `failed` with `completed: 0`, nothing run. After that the batch stops at the first failed call: the answer is still a success, `failed` names the call and the calls before it stay done, so check `failed`. Returns the result of each finished call. To use a result in a later call of the same batch, pass `{ "$result": "0.element" }` as the value: the number of the call, then an own field of its result. A call that needs consent cannot take such a reference, because the window has to show the data: the batch is refused with `invalidArgs` in `failed`, nothing run; run the earlier calls first and write the value out in a separate batch. Tools of ui.* wait for the user and are not allowed in a batch, except ui.highlight.',args:e.Arg.object({calls:e.Arg.array(e.Arg.object({tool:e.Arg.string(),args:e.Arg.optional(e.Arg.object({}))}))})},"image.search":{description:"Searches free stock photos by keywords (the Stock tab of the image window) and returns up to 10 of them with an id, a description, the author and the size. There are no URLs: pass the chosen id to `image.pick`. An editor without a server has no stock photos: the answer is `unavailable`.",args:e.Arg.object({keywords:e.Arg.string(),orientation:e.Arg.optional(e.Arg.enum("landscape","portrait","squarish")),page:e.Arg.optional(e.Arg.number())})},"image.pick":{description:"Takes a photo found by `image.search` and returns its `url` for an image element. Reports the use to the photo service, as the image window does. Closed by the plan like `image.search`.",args:e.Arg.object({id:e.Arg.string()})},"file.upload":{description:"Downloads an image (JPG, PNG, WEBP, GIF or SVG) from a URL and stores it in the project storage the way the image window does; returns the stored image `url`. Use it for images that are not yet in the project storage.",args:e.Arg.object({url:e.Arg.string()})},"gallery.listTemplates":{description:"Lists the email templates of the gallery, one page at a time (page 1 by default; an empty list means no more pages). Use an id with document.applyTemplate. Not available in the plugin.",args:e.Arg.object({page:e.Arg.optional(e.Arg.number())})},"document.applyTemplate":{description:"Replaces the whole content of the open email with a gallery template (an id from gallery.listTemplates) in one undo step. Only the markup is taken: subject, preheader and common styles of the email stay. Not available in the plugin or for a block.",args:e.Arg.object({template:e.Arg.string()})},"project.getStyles":{description:"Returns the brand styles of the project: palette colors, fonts and social links. Use them for colors and fonts of new content. Not available in the plugin."},"document.getUtm":{description:"Returns the UTM marks added to all links when the email is exported; empty ones are empty strings."},"document.setUtm":{description:"Sets UTM marks that are added to all links when the email is exported; omitted marks stay, an empty string clears a mark. Returns all five marks after the change. `history.undo` does not revert them: they come back only when the user takes back the whole answer.",args:e.Arg.object({params:e.Arg.object({utm_source:n,utm_medium:n,utm_campaign:n,utm_term:n,utm_content:n})})},"document.setAnnotations":{description:"Writes Gmail annotations (promotions tab markup) into the email, replacing the existing ones. `annotationType` is `productCarousel` or `singleImagePreview` (needs `cards` with an image and an https link; a discount is given in percent in `discountPercent` and needs a numeric `price`), `dealAnnotation` (needs one of `description`, `discountCode`, dates) or `dealCard` (needs `description` and `offerPageUrl` or `merchantHomepageUrl`). Dates are ISO 8601 strings. Returns `changed: false` when the email already has exactly this markup.",args:e.Arg.object({annotationType:e.Arg.enum(...c),logo:n,description:n,discountCode:n,availabilityStarts:n,availabilityEnds:n,offerPageUrl:n,merchantHomepageUrl:n,cards:e.Arg.optional(e.Arg.array(e.Arg.object({image:n,url:n,headline:n,price:n,priceCurrency:n,discountPercent:n})))})},"document.removeAnnotations":{description:"Cuts the Gmail annotations markup out of the email in one undo step. Returns `changed: false` when there was none."},"history.restoreRevision":{description:'Goes back to an earlier saved version: replaces the email with a revision (markup, subject, preheader, styles). `history.undo` brings back the markup, and on the open canvas the subject and the preheader with it; styles stay from the revision. All of them come back for sure only when the user takes back the whole answer. Use it for "restore the previous version"; to take back the last edit of this session use `history.undo` instead. Take `revision` from `history.listRevisions`: the first row is normally the saved state of the email, so going back one version means the first row below it without `isAutosave`. Returns the restored `revision` with its `date` and `subject` when known and `unsaved: true`: the document stays unsaved until it is saved. Closed by the plan when it has no revision history.',args:e.Arg.object({revision:e.Arg.string()})},"variable.list":{description:"Lists the merge variables of this editor: `name` is the menu path shown to the user, `value` is the ready text with the delimiters of the sending service. Pass a `value` to element.insertVariable."},"element.insertVariable":{description:"Appends a merge variable (a `value` from variable.list) to the end of a text, header, button or link element in one undo step. It goes after the existing content: write the text first with element.setText, then add the variable; a space before it is part of that text. Refused for an element with a list or a table. Returns a reference to the element.",args:e.Arg.object({element:t,variable:e.Arg.string()})},"element.applyTypograf":{description:"Cleans typography of the text in one undo step: non-breaking spaces after short words and numbers, proper dashes and quotes. Without `element` it runs over the whole email; with the reference of a text element it runs over the whole cell of that text, like the button of the editor, so other text in the same cell changes too. Selects the element like a user click. Buttons, links and images are refused with that reference. Text locked by the integrator and the preheader stay as they are.",args:e.Arg.object({element:e.Arg.optional(t)})},"column.add":{description:'Adds an empty column at the end of a row (up to 8 columns) in one undo step; the other columns get narrower. Pass a row reference (kind "row") or any of its columns (kind "column" or "floatingBlock"). Returns the row reference and `columns`, the references of all its columns in order; fill the new one with element.insert and place "inside".',args:e.Arg.object({element:t})},"column.remove":{description:'Removes a column of a row together with its content in one undo step; the other columns get wider. Pass the column reference (kind "column" or "floatingBlock"). A row keeps at least one column. Refused with `readOnly` when the column or something inside it is locked by the integrator. Returns the row reference and `columns`.',args:e.Arg.object({element:t})},"column.swap":{description:'Swaps two columns of the same row in one undo step: content and width move together. Pass both column references (kind "column" or "floatingBlock"). Returns the row reference and `columns` in the new order.',args:e.Arg.object({element:t,with:t})},"accordion.addSection":{description:'Adds a section at the end of an accordion (kind "accordion", AMP emails) in one undo step, as a copy of its first section with the given plain `title` and `text` (markup characters stay text, a line break becomes a new line). Returns a fresh reference to the accordion, which is rebuilt, and `sections`, their count.',args:e.Arg.object({element:t,title:e.Arg.string(),text:e.Arg.optional(e.Arg.string())})},"accordion.removeSection":{description:"Removes a section of an accordion by its number (counted from 0) with its content in one undo step. An accordion keeps at least one section. Refused with `readOnly` when something inside the section is locked by the integrator. Returns a fresh reference to the accordion and `sections`, their count.",args:e.Arg.object({element:t,index:e.Arg.number()})},"export.download":{description:"Downloads the email in a format of the Export menu, as a click on it: the browser saves the file for the user. html — the code, zip — code with images, text — plain text, markdown, outlook — an .oft/.eml for Outlook, pdf, png — a picture. For an AMP email `variant` picks the AMP or the HTML version of code and text. The editor may first ask the user about a large code size. Returns when the export has started.",args:e.Arg.object({format:e.Arg.enum(...e.EXPORT_FORMATS),variant:e.Arg.optional(e.Arg.enum("html","amp"))})},"document.import":{description:"Replaces the whole open email with an imported one, as the Import menu item does with a chosen file: an .html, .htm, .eml or .zip by `url`, or `html` you pass with something to show: text, a picture or another visible element. Any other file and empty `html` are refused with `invalidArgs`: an extension in the address decides, whatever type the server answers with, and the type counts only for an address without one. A file without an email inside is refused with `importFailed`. Images of the file are uploaded to the project. One undo step.",args:e.Arg.object({url:e.Arg.optional(e.Arg.string()),html:e.Arg.optional(e.Arg.string())})},"send.testEmail":{description:"Sends the open email as it is now to up to 10 addresses, as the Send a test email window does. Without `subject` it goes with the subject of the email. Asks the user first and spends the test-send limit. An editor without a server has no test emails: the answer is `unavailable`.",args:e.Arg.object({recipients:e.Arg.array(e.Arg.string()),subject:e.Arg.optional(e.Arg.string())})}};l.AGENT_COMMAND_DETAILS=d});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__emailmaker__.define("static/core/1a65ef0f.js",["require","exports","module","static/core/c948c45f.js"],function(s,t,O){const e=s("./c948c45f.js");var n=50,o=200,_=["project","gallery"],a=e.Arg.optional(e.Arg.enum(..._)),d={source:a,type:e.Arg.optional(e.Arg.string()),search:e.Arg.optional(e.Arg.string()),limit:e.Arg.optional(e.Arg.number())},g=`Pass \`type\` (for example "header" or "footer") to list one kind only. \`search\` keeps blocks whose title contains it, in any case. Returns \`blocks\`, at most \`limit\` (${n} by default, up to ${o}), and \`total\`; \`truncated: true\` means more blocks matched than were returned.`;function m(L,{type:i,search:f,limit:b}){const u=f?.toLowerCase(),r=L.filter(l=>(i===void 0||l.type===i)&&(!u||(l.title??"").toLowerCase().includes(u))),c=Math.min(Math.max(Math.round(b??n),1),o);return{blocks:r.slice(0,c),total:r.length,...r.length>c?{truncated:!0}:{}}}Object.defineProperty(t,"BLOCK_LIST_ARGS",{enumerable:!0,get:function(){return d}}),Object.defineProperty(t,"BLOCK_LIST_HINT",{enumerable:!0,get:function(){return g}}),Object.defineProperty(t,"BLOCK_SOURCE_ARG",{enumerable:!0,get:function(){return a}}),Object.defineProperty(t,"blockListPage",{enumerable:!0,get:function(){return m}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__emailmaker__.define("static/core/
|
|
1
|
+
__emailmaker__.define("static/core/1c67ab93.js",["require","exports","module","static/core/5dc34752.js","static/core/c948c45f.js","static/core/e4c1aab3.js","static/core/34756b09.js","static/core/e995a70d.js","static/core/220d7d31.js"],function(c,i,x){const v=c("./5dc34752.js"),s=c("./c948c45f.js"),m=c("./e4c1aab3.js"),_=c("./34756b09.js"),j=c("./e995a70d.js"),d=c("./220d7d31.js");function n(t){return t?.tagName===s.SCRIPT_STAND_IN.toUpperCase()}function p(t){return n(t)&&t.src?.startsWith("https://cdn.ampproject.org/v0")}var u=t=>p(t)||_.isAmpElement(t)||s.isForm(t),h=t=>{if(u(t))return!0;if(s.isElement(t)||s.isDocument(t)){for(const r of t.querySelectorAll("*"))if(u(r))return!0}return!1};async function y(t,r={amp:!0,text:!1},l){const A=r===!0||typeof r=="object"&&r.amp,E=r===!0||typeof r=="object"&&r.text;typeof t=="string"&&(t={code:t});let a;const o={html:"",ampHtml:"",text:""};try{o.html=t.code?await m.prepareHTML(t.code||"",[800],t.utm_parameters,async e=>{a=h(e.document),a&&await s.processAmp(e,"html")},l):""}catch(e){throw new Error("[emailmaker] compileEmail: не удалось собрать html письма",{cause:e})}try{o.ampHtml=A&&t.code&&a?await m.prepareHTML(t.code||"",[800],t.utm_parameters,e=>{s.processAmp(e,"amp")},l):""}catch{}try{o.text=E&&t.code?await m.prepareHTML(t.code||"",[800],t.utm_parameters,async e=>{e.handleReadHtml(f=>{f.html=j.convert(f.contentDocument,d.EmailTextPlainConvertOptions)})}):""}catch{}return{...t,compiled:o}}i.compileEmail=y,i.isAmpScript=p,i.isScriptElement=n});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__emailmaker__.define("static/core/
|
|
1
|
+
__emailmaker__.define("static/core/1d004581.js",["require","exports","module","static/core/5dc34752.js","static/core/c948c45f.js"],function(i,u,S){const x=i("./5dc34752.js"),m=i("./c948c45f.js");var d={items_per_page:"/ página",jump_to:"Ir a",jump_to_confirm:"confirmar",page:"Página",prev_page:"Página anterior",next_page:"Página siguiente",prev_5:"5 páginas previas",next_5:"5 páginas siguientes",prev_3:"3 páginas previas",next_3:"3 páginas siguientes",page_size:"tamaño de página"};function o(r){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(r)}function l(r,e){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function($){return Object.getOwnPropertyDescriptor(r,$).enumerable})),a.push.apply(a,n)}return a}function c(r){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?l(Object(a),!0).forEach(function(n){b(r,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(a,n))})}return r}function b(r,e,a){return e=g(e),e in r?Object.defineProperty(r,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[e]=a,r}function g(r){var e=f(r,"string");return o(e)=="symbol"?e:String(e)}function f(r,e){if(o(r)!="object"||!r)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var n=a.call(r,e||"default");if(o(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var v=c(c({},m.commonLocale),{},{locale:"es_ES",today:"Hoy",now:"Ahora",backToToday:"Volver a hoy",ok:"Aceptar",clear:"Limpiar",week:"Semana",month:"Mes",year:"Año",timeSelect:"Seleccionar hora",dateSelect:"Seleccionar fecha",monthSelect:"Elegir un mes",yearSelect:"Elegir un año",decadeSelect:"Elegir una década",previousMonth:"Mes anterior (PageUp)",nextMonth:"Mes siguiente (PageDown)",previousYear:"Año anterior (Control + left)",nextYear:"Año siguiente (Control + right)",previousDecade:"Década anterior",nextDecade:"Década siguiente",previousCentury:"Siglo anterior",nextCentury:"Siglo siguiente"}),s={placeholder:"Seleccionar hora",rangePlaceholder:["Hora de inicio","Hora de fin"]},p={lang:{placeholder:"Seleccionar fecha",rangePlaceholder:["Fecha inicial","Fecha final"],shortWeekDays:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],shortMonths:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],...v},timePickerLocale:{...s}},y=p,t="${label} no es un ${type} válido",h={locale:"es",Pagination:d,DatePicker:p,TimePicker:s,Calendar:y,global:{placeholder:"Seleccione",close:"Cerrar",show:"Mostrar",hide:"Ocultar"},Table:{filterTitle:"Filtrar menú",filterConfirm:"Aceptar",filterReset:"Reiniciar",filterEmptyText:"Sin filtros",filterCheckAll:"Seleccionar todo",filterSearchPlaceholder:"Buscar en filtros",emptyText:"Sin datos",selectAll:"Seleccionar todo",selectInvert:"Invertir selección",selectNone:"Vacíe todo",selectionAll:"Seleccionar todos los datos",sortTitle:"Ordenar",expand:"Expandir fila",collapse:"Colapsar fila",triggerDesc:"Click para ordenar en orden descendente",triggerAsc:"Click para ordenar en orden ascendente",cancelSort:"Click para cancelar ordenamiento"},Tour:{Next:"Siguiente",Previous:"Anterior",Finish:"Finalizar"},Modal:{okText:"Aceptar",cancelText:"Cancelar",justOkText:"Aceptar"},Popconfirm:{okText:"Aceptar",cancelText:"Cancelar"},Transfer:{titles:["",""],searchPlaceholder:"Buscar aquí",itemUnit:"elemento",itemsUnit:"elementos",remove:"Eliminar",selectCurrent:"Seleccionar página actual",removeCurrent:"Eliminar página actual",selectAll:"Seleccionar todos los datos",removeAll:"Eliminar todos los datos",selectInvert:"Invertir página actual"},Upload:{uploading:"Subiendo...",removeFile:"Eliminar archivo",uploadError:"Error al subir el archivo",previewFile:"Vista previa",downloadFile:"Descargar archivo"},Empty:{description:"No hay datos"},Icon:{icon:"ícono"},Text:{edit:"Editar",copy:"Copiar",copied:"Copiado",expand:"Expandir"},Form:{optional:"(opcional)",defaultValidateMessages:{default:"Error de validación del campo ${label}",required:"Por favor, rellena ${label}",enum:"${label} debe ser uno de [${enum}]",whitespace:"${label} no puede ser un carácter en blanco",date:{format:"El formato de fecha de ${label} es inválido",parse:"${label} no se puede convertir a una fecha",invalid:"${label} es una fecha inválida"},types:{string:t,method:t,array:t,object:t,number:t,date:t,boolean:t,integer:t,float:t,regexp:t,email:t,url:t,hex:t},string:{len:"${label} debe tener ${len} caracteres",min:"${label} debe tener al menos ${min} caracteres",max:"${label} debe tener hasta ${max} caracteres",range:"${label} debe tener entre ${min}-${max} caracteres"},number:{len:"${label} debe ser igual a ${len}",min:"${label} valor mínimo es ${min}",max:"${label} valor máximo es ${max}",range:"${label} debe ser entre ${min}-${max}"},array:{len:"Debe ser ${len} ${label}",min:"Al menos ${min} ${label}",max:"Como máximo ${max} ${label}",range:"El valor de ${label} debe estar entre ${min}-${max}"},pattern:{mismatch:"${label} no coincide con el patrón ${pattern}"}}}};u.default=h});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__emailmaker__.define("static/core/
|
|
1
|
+
__emailmaker__.define("static/core/220d7d31.js",["require","exports","module","static/core/5dc34752.js","static/core/e995a70d.js"],function(e,t,r){const l=e("./5dc34752.js");var o={wordwrap:200,tables:!0,selectors:[...e("./e995a70d.js").DEFAULT_OPTIONS.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:!1,longWordSplit:{forceWrapOnLimit:!1}};t.EmailTextPlainConvertOptions=o});
|