useblocks 1.3.4 → 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 +60 -0
- package/README.md +21 -0
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/css/sandbox-dark.css +2 -9
- package/iframe/css/sandbox-light.css +2 -9
- package/iframe/css/sandbox.css +13 -23
- package/iframe/{iframe-eblock.6067f806.html → iframe-eblock.a0b8903e.html} +2 -2
- package/iframe/{iframe.6067f806.html → iframe.a0b8903e.html} +2 -2
- package/iframe/js/elMarkupHelper.C1NUEUOF.js +279 -0
- package/iframe/js/{iframe-eblock.body.6067f806.js → iframe-eblock.body.a0b8903e.js} +1 -1
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.a0b8903e.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/{ea7c2c44.js → 1b6e3017.js} +1 -1
- package/static/core/2ca6f0ad.js +19 -0
- package/static/core/{3e34d695.js → 2d458997.js} +1 -1
- package/static/core/{398809e7.js → 31aad6a0.js} +1 -1
- package/static/core/3339abc3.js +1 -0
- package/static/core/3d73b614.js +1 -0
- package/static/core/{0f33f820.js → 3e55fbd4.js} +1 -1
- package/static/core/3fc88c79.js +1 -0
- package/static/core/{2135fa81.js → 4a69114d.js} +1 -1
- package/static/core/4e869a27.js +1 -0
- package/static/core/{28a3c758.js → 4f9f6515.js} +1 -1
- package/static/core/55a6e3bc.js +163 -0
- package/static/core/{d3a3d35f.js → 58b98b23.js} +2 -2
- package/static/core/{4f3c76a3.js → 5bf0cc25.js} +1 -1
- package/static/core/{17083884.js → 64a5118e.js} +1 -1
- package/static/core/{18ab364c.js → 6584ba9a.js} +1 -1
- package/static/core/74b30e13.js +1 -0
- package/static/core/{19740098.js → 75b3d05d.js} +2 -2
- package/static/core/7a1ca179.js +1 -0
- package/static/core/{13b95c98.js → 80f29ed0.js} +1 -1
- package/static/core/{f8eeeaf9.js → 851da4d1.js} +1 -1
- package/static/core/{8b7571c7.js → 88ed7988.js} +1 -1
- package/static/core/91a91433.js +1 -0
- package/static/core/9f12c233.js +1 -0
- package/static/core/{401a0cfb.js → a2fb7ae9.js} +1 -1
- package/static/core/a7e83e25.js +10 -0
- package/static/core/{5519258a.js → addbb53c.js} +1 -1
- package/static/core/{66619f08.js → b1edf5c5.js} +6 -6
- package/static/core/{78d9a411.js → b79eddad.js} +1 -1
- package/static/core/bd188fca.js +1 -0
- package/static/core/{a598ff39.js → c015f53f.js} +1 -1
- package/static/core/c0f26c01.js +1 -0
- package/static/core/{840b1cdc.js → cad7dc27.js} +1 -1
- package/static/core/d4aa63e7.js +1 -0
- package/static/core/d5774798.js +1 -0
- package/static/core/d5cd129a.js +1 -0
- package/static/core/d67c9b4e.js +2 -0
- package/static/core/{b060be67.js → d7ccd97b.js} +1 -1
- package/static/core/{807a1f00.js → e4ebcc13.js} +1 -1
- package/static/core/e6079a68.js +1 -0
- package/static/core/{e7a5e467.js → e85778fc.js} +1 -1
- package/static/core/ec23adac.js +1 -0
- package/static/core/{760dd956.js → f06286dd.js} +1 -1
- package/static/core/{7bf0fabd.js → f370243f.js} +1 -1
- package/static/core/{eb02ff3a.js → ffabcd69.js} +3 -3
- package/static/esm/{3ce60f99.js → b6a1b54a.js} +1 -1
- package/static/umd-runtime/{runtime.BqqI2xz2.js → runtime.B77pxBrU.js} +1 -1
- package/useblocks-core.a0b8903e.js +874 -0
- package/useblocks-esm.js +53 -39
- package/{useblocks-po.6067f806.js → useblocks-po.a0b8903e.js} +1 -1
- package/useblocks.d.ts +95 -5
- package/useblocks.js +54 -40
- package/vendor/useblocks-ui-kit/package.json +1 -1
- package/iframe/js/elMarkupHelper.CnysQPQn.js +0 -278
- package/iframe/js/iframe.body.6067f806.js +0 -129
- package/static/core/20f8e2cc.js +0 -1
- package/static/core/94ba164b.js +0 -28
- package/useblocks-core.6067f806.js +0 -859
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__useblocks__.define("js/iframe-eblock.js",["require","exports","module","js/elMarkupHelper.
|
|
1
|
+
__useblocks__.define("js/iframe-eblock.js",["require","exports","module","js/elMarkupHelper.C1NUEUOF.js"],function(h,w,M){const t=h("./elMarkupHelper.C1NUEUOF.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.__useblocks__||(window.__useblocks__={});(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
|
-
__useblocks__.require.config({ paths: {"js/iframe-eblock.js":"js/iframe-eblock.body.
|
|
3
|
+
__useblocks__.require.config({ paths: {"js/iframe-eblock.js":"js/iframe-eblock.body.a0b8903e.js"} });
|
|
4
4
|
|
|
5
|
-
__useblocks__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.
|
|
5
|
+
__useblocks__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.C1NUEUOF.js"],"js/iframe.js":["js/elMarkupHelper.C1NUEUOF.js"],"js/darkreader.CyLMh7_H.js":[],"js/elMarkupHelper.C1NUEUOF.js":[],"js/rules.CL_BitCE.js":[],"js/typograf.all.CGEpDoct.js":[]}});
|
|
6
6
|
|
|
7
7
|
__useblocks__.require("js/iframe-eblock.js");
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
__useblocks__.define("js/iframe.js",["require","exports","module","js/elMarkupHelper.C1NUEUOF.js"],function($,Ke,Ze){const s=$("./elMarkupHelper.C1NUEUOF.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.__useblocks__||(window.__useblocks__={});(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
|
-
__useblocks__.require.config({ paths: {"js/iframe.js":"js/iframe.body.
|
|
3
|
+
__useblocks__.require.config({ paths: {"js/iframe.js":"js/iframe.body.a0b8903e.js"} });
|
|
4
4
|
|
|
5
|
-
__useblocks__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.
|
|
5
|
+
__useblocks__.require.config({"graph":{"js/iframe-eblock.js":["js/elMarkupHelper.C1NUEUOF.js"],"js/iframe.js":["js/elMarkupHelper.C1NUEUOF.js"],"js/darkreader.CyLMh7_H.js":[],"js/elMarkupHelper.C1NUEUOF.js":[],"js/rules.CL_BitCE.js":[],"js/typograf.all.CGEpDoct.js":[]}});
|
|
6
6
|
|
|
7
7
|
__useblocks__.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 i=e&&e.default?e.default:e,{Activity:n,Children:o,Component:c,Fragment:m,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:b,cloneElement:g,createContext:N,createElement:_,createRef:A,forwardRef:O,isValidElement:k,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"),t=globalThis[u];t||(t=[],globalThis[u]=t);for(var r=!1,s=0;s<t.length;s++){var a=t[s];a&&a.react===e&&a.package==="useblocks"&&a.version==="1.3.
|
|
1
|
+
import e from"../../vendor/react/index.js";var i=e&&e.default?e.default:e,{Activity:n,Children:o,Component:c,Fragment:m,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:b,cloneElement:g,createContext:N,createElement:_,createRef:A,forwardRef:O,isValidElement:k,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"),t=globalThis[u];t||(t=[],globalThis[u]=t);for(var r=!1,s=0;s<t.length;s++){var a=t[s];a&&a.react===e&&a.package==="useblocks"&&a.version==="1.3.8"&&(r=!0)}r||t.push({package:"useblocks",version:"1.3.8",react:e})}catch{}export{n as Activity,o as Children,c as Component,m 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,b as cacheSignal,g as cloneElement,N as createContext,_ as createElement,A as createRef,i as default,O as forwardRef,k 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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/1b6e3017.js",["require","exports","module","static/core/2ff39ddf.js","static/core/a71d1c3a.js"],function(i,d,P){const h=i("./2ff39ddf.js"),p=i("./a71d1c3a.js");var u={items_per_page:"/ pagina",jump_to:"vai a",jump_to_confirm:"Conferma",page:"Pagina",prev_page:"Pagina precedente",next_page:"Pagina successiva",prev_5:"Precedente 5 pagine",next_5:"Prossime 5 pagine",prev_3:"Precedente 3 pagine",next_3:"Prossime 3 pagine",page_size:"dimensioni della pagina"};function o(a){"@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(a)}function l(a,e){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(S){return Object.getOwnPropertyDescriptor(a,S).enumerable})),r.push.apply(r,n)}return r}function c(a){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?l(Object(r),!0).forEach(function(n){g(a,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(r,n))})}return a}function g(a,e,r){return e=f(e),e in a?Object.defineProperty(a,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[e]=r,a}function f(a){var e=b(a,"string");return o(e)=="symbol"?e:String(e)}function b(a,e){if(o(a)!="object"||!a)return a;var r=a[Symbol.toPrimitive];if(r!==void 0){var n=r.call(a,e||"default");if(o(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var v=c(c({},p.commonLocale),{},{locale:"it_IT",today:"Oggi",now:"Adesso",backToToday:"Torna ad oggi",ok:"OK",clear:"Cancella",week:"Settimana",month:"Mese",year:"Anno",timeSelect:"Seleziona l'ora",dateSelect:"Seleziona la data",monthSelect:"Seleziona il mese",yearSelect:"Seleziona l'anno",decadeSelect:"Seleziona il decennio",previousMonth:"Il mese scorso (PageUp)",nextMonth:"Il prossimo mese (PageDown)",previousYear:"L'anno scorso (Control + sinistra)",nextYear:"L'anno prossimo (Control + destra)",previousDecade:"Ultimo decennio",nextDecade:"Prossimo decennio",previousCentury:"Secolo precedente",nextCentury:"Prossimo secolo",shortWeekDays:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],shortMonths:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"]}),s={placeholder:"Selezionare l'orario",rangePlaceholder:["Inizio orario","Fine orario"]},m={lang:{placeholder:"Selezionare la data",rangePlaceholder:["Data d'inizio","Data di fine"],...v},timePickerLocale:{...s}},y=m,t=" ${label} non è un ${type} valido",$={locale:"it",Pagination:u,DatePicker:m,TimePicker:s,Calendar:y,global:{placeholder:"Selezionare",close:"Chiudi",show:"Mostra",hide:"Nascondi"},Table:{filterTitle:"Menù Filtro",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"Senza filtri",filterCheckAll:"Seleziona tutti",filterSearchPlaceholder:"Cerca nei filtri",emptyText:"Senza dati",selectAll:"Seleziona pagina corrente",selectInvert:"Inverti selezione nella pagina corrente",selectNone:"Deseleziona tutto",selectionAll:"Seleziona tutto",sortTitle:"Ordina",expand:"Espandi riga",collapse:"Comprimi riga ",triggerDesc:"Clicca per ordinare in modo discendente",triggerAsc:"Clicca per ordinare in modo ascendente",cancelSort:"Clicca per eliminare l'ordinamento"},Tour:{Next:"Successivo",Previous:"Precedente",Finish:"Termina"},Modal:{okText:"OK",cancelText:"Annulla",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Annulla"},Transfer:{titles:["",""],searchPlaceholder:"Cerca qui",itemUnit:"elemento",itemsUnit:"elementi",remove:"Elimina",selectCurrent:"Seleziona la pagina corrente",removeCurrent:"Rimuovi la pagina corrente",selectAll:"Seleziona tutti i dati",removeAll:"Rimuovi tutti i dati",selectInvert:"Inverti la pagina corrente"},Upload:{uploading:"Caricamento...",removeFile:"Rimuovi il file",uploadError:"Errore di caricamento",previewFile:"Anteprima file",downloadFile:"Scarica file"},Empty:{description:"Nessun dato"},Icon:{icon:"icona"},Text:{edit:"modifica",copy:"copia",copied:"copia effettuata",expand:"espandi"},Form:{optional:"(opzionale)",defaultValidateMessages:{default:"Errore di convalida del campo ${label}",required:"Si prega di inserire ${label}",enum:"${label} deve essere uno di [${enum}]",whitespace:"${label} non può essere un carattere vuoto",date:{format:"Il formato della data ${label} non è valido",parse:"${label} non può essere convertito in una data",invalid:"${label} non è una data valida"},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} deve avere ${len} caratteri",min:"${label} deve contenere almeno ${min} caratteri",max:"${label} deve contenere fino a ${max} caratteri",range:"${label} deve contenere tra ${min}-${max} caratteri"},number:{len:"${label} deve essere uguale a ${len}",min:"${label} valore minimo è ${min}",max:"${label} valor e massimo è ${max}",range:"${label} deve essere compreso tra ${min}-${max}"},array:{len:"Deve essere ${len} ${label}",min:"Almeno ${min} ${label}",max:"Massimo ${max} ${label}",range:"Il totale di ${label} deve essere compreso tra ${min}-${max}"},pattern:{mismatch:"${label} non corrisponde al modello ${pattern}"}}},QRCode:{expired:"Codice QR scaduto",refresh:"Ricarica",scanned:"Scansionato"},ColorPicker:{presetEmpty:"Vuoto",transparent:"Trasparente",singleColor:"Tinta unita",gradientColor:"Gradiente"}};d.default=$});
|