@emailmaker/emailmaker 1.1.104 → 1.1.108

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/emailmaker-core.d5e4bde1.js +859 -0
  2. package/emailmaker-esm.js +11 -11
  3. package/{emailmaker-po.d92031f0.js → emailmaker-po.d5e4bde1.js} +1 -1
  4. package/emailmaker.d.ts +137 -13
  5. package/emailmaker.js +12 -12
  6. package/iframe/.vite/manifest.json +13 -25
  7. package/iframe/css/sandbox.css +9 -8
  8. package/iframe/{iframe-eblock.d92031f0.html → iframe-eblock.d5e4bde1.html} +2 -2
  9. package/iframe/{iframe.d92031f0.html → iframe.d5e4bde1.html} +2 -2
  10. package/iframe/js/elMarkupHelper.C66zL1zp.js +279 -0
  11. package/iframe/js/iframe-eblock.body.d5e4bde1.js +9 -0
  12. package/iframe/js/iframe-eblock.js +2 -2
  13. package/iframe/js/iframe.body.d5e4bde1.js +129 -0
  14. package/iframe/js/iframe.js +2 -2
  15. package/iframe/js/{typograf.all.B0pVhMV_.js → typograf.all.Mun9CrLC.js} +12 -12
  16. package/package.json +1 -1
  17. package/runtime/react/index.js +1 -1
  18. package/static/core/{2d570b04.js → 13b2a363.js} +3 -3
  19. package/static/core/{1cdd0eaa.js → 22140fa1.js} +1 -1
  20. package/static/core/{62b7892b.js → 2455e45e.js} +11 -11
  21. package/static/core/{c67adee2.js → 2734fa96.js} +1 -1
  22. package/static/core/3a6dbf2b.js +7 -0
  23. package/static/core/{0cb54b92.js → 4797d4f7.js} +6 -6
  24. package/static/core/{dc45a033.js → 566e8ce8.js} +1 -1
  25. package/static/core/{e76ed3bd.js → 6ba8aedc.js} +1 -1
  26. package/static/core/{4b7442c5.js → 6c52be40.js} +1 -1
  27. package/static/core/{36f15937.js → 6e8d008d.js} +1 -1
  28. package/static/core/{bd852c3b.js → 6f6a92e3.js} +1 -1
  29. package/static/core/{2a6bfcb1.js → 756e184f.js} +1 -1
  30. package/static/core/7985de17.js +28 -0
  31. package/static/core/{9596ee39.js → 7e51da74.js} +1 -1
  32. package/static/core/{448f5a93.js → 7e69b03c.js} +1 -1
  33. package/static/core/{20fae5cb.js → 8889dbc6.js} +1 -1
  34. package/static/core/8a621181.js +2 -0
  35. package/static/core/a22823f9.js +1 -0
  36. package/static/core/{1922419a.js → abcacabc.js} +1 -1
  37. package/static/core/{f173fdc6.js → b43852b9.js} +1 -1
  38. package/static/core/{9f7f5230.js → b712bb05.js} +1 -1
  39. package/static/core/{ba4d44b4.js → b916e437.js} +1 -1
  40. package/static/core/{d3f1d83d.js → d5cd2a7b.js} +1 -1
  41. package/static/core/{c100433a.js → d74c1e57.js} +1 -1
  42. package/static/core/{fff40495.js → d8800deb.js} +1 -1
  43. package/static/core/{25095aa6.js → dbc12df7.js} +2 -2
  44. package/static/core/{eee25d75.js → e1f8b6ea.js} +1 -1
  45. package/static/core/e88db487.js +1 -0
  46. package/static/core/{360afb24.js → ecaf7c36.js} +1 -1
  47. package/static/core/edf49656.js +4 -0
  48. package/static/core/f20ffa90.js +4 -0
  49. package/static/core/{432ad49d.js → f37da79c.js} +1 -1
  50. package/static/esm/73c89921.js +1 -0
  51. package/static/esm/delivery-libs.js +1 -1
  52. package/static/umd-runtime/delivery-libs.eFZaeVgo.js +1 -0
  53. package/static/umd-runtime/{runtime.Wy6_YzQx.js → runtime.BZcjM8iG.js} +1 -1
  54. package/vendor/@emailmaker/ui-kit/package.json +1 -1
  55. package/emailmaker-core.d92031f0.js +0 -859
  56. package/iframe/js/discussHandlers.cyZrdU7c.js +0 -88
  57. package/iframe/js/iframe-eblock.body.d92031f0.js +0 -233
  58. package/iframe/js/iframe.body.d92031f0.js +0 -319
  59. package/iframe/js/rolldown-runtime.qcwTIabA.js +0 -1
  60. package/static/core/123fc796.js +0 -4
  61. package/static/core/5dc1b7fa.js +0 -7
  62. package/static/core/a866296c.js +0 -4
  63. package/static/core/cd6c8848.js +0 -28
  64. package/static/core/e6f6edff.js +0 -1
  65. package/static/esm/d4338c39.js +0 -1
  66. package/static/umd-runtime/delivery-libs.Cmqsjupj.js +0 -1
@@ -0,0 +1,279 @@
1
+ __emailmaker__.define("js/elMarkupHelper.C66zL1zp.js",["require","exports","module"],function(Zl,q,aq){var lf=Object.defineProperty,Yn=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),ie=(e,t)=>{let n={};for(var r in e)lf(n,r,{get:e[r],enumerable:!0});return t||lf(n,Symbol.toStringTag,{value:"Module"}),n};function Xo(e){"@babel/helpers - typeof";return Xo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xo(e)}function TS(e,t){if(Xo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _S(e){var t=TS(e,"string");return Xo(t)=="symbol"?t:t+""}function L(e,t,n){return(t=_S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cf;cf=Symbol.toStringTag;var Ql=class{constructor(){L(this,"_valuesMap",new Map),L(this,cf,"Storage")}getItem(e){const t=String(e);return this._valuesMap.has(e)?String(this._valuesMap.get(t)):null}setItem(e,t){this._valuesMap.set(String(e),String(t))}removeItem(e){this._valuesMap.delete(e)}clear(){this._valuesMap.clear()}key(e){if(arguments.length===0)throw new TypeError("Failed to execute 'key' on 'Storage': 1 argument required, but only 0 present.");return Array.from(this._valuesMap.keys())[e]}get length(){return this._valuesMap.size}};function uf(){const e=new Ql;return new Proxy(e,{set:function(t,n,r){return typeof n=="string"&&Ql.prototype.hasOwnProperty(n)?e[n]=r:typeof n=="string"&&e.setItem(n,String(r)),!0},get:function(t,n){if(typeof n=="string"){if(Ql.prototype.hasOwnProperty(n)){const r=e[n];if(typeof r=="function"){const o=r;return(...i)=>o.apply(e,i)}return r}return e.getItem(n)}}})}function df(){const e=uf(),t=uf();Object.defineProperty(window,"localStorage",{configurable:!0,enumerable:!0,get:()=>e}),Object.defineProperty(window,"sessionStorage",{configurable:!0,enumerable:!0,get:()=>t});let n=Object.create(null);Object.defineProperty(document,"cookie",{enumerable:!1,configurable:!0,get(){const r=[];for(var o in n)r.push(o+"="+n[o]);return r.join(";")},set(r){const o=r.indexOf("=");var i=r.substr(0,o),s=r.substring(o+1);return n[i]=s,i+"="+s}}),Object.defineProperty(document,"clearCookies",{enumerable:!1,configurable:!0,value:()=>n=Object.create(null)})}df();function kS(e){return e}var LS=class extends Error{constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),L(this,"cycle",void 0),this.cycle=e}};function NS(e){const t=new Map;for(const n of e)for(const r of n.provides??[]){const o=t.get(r)??[];o.push(n),t.set(r,o)}return t}function xS(e,t){const n=[];for(const r of e.awaits?.services??[])for(const o of t.get(r)??[])o!==e&&n.push(o);return n}function MS(e){const t=NS(e),n=[],r=new Set,o=[],i=new Set,s=a=>{if(!r.has(a)){if(i.has(a)){const l=o.indexOf(a);throw new LS([...o.slice(l),a].map(c=>c.name))}i.add(a),o.push(a);for(const l of xS(a,t))s(l);o.pop(),i.delete(a),r.add(a),n.push(a)}};for(const a of e)s(a);return n}var Ee=class ES{constructor(t=[]){L(this,"_inner",void 0),L(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof ES&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(t){this.addDisposable({dispose:t})}removeDisposable(t){const n=this._inner.indexOf(t);n>=0&&this._inner.splice(n,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const t of[...this._inner])t.dispose()}}};function Jl(e){return`service_container_${e}`}var Yo=new Set,ec;function RS(){if(!ec)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,mf.prototype.getInstanceAsync),e.stack}function tc(e){Yo.delete(e)&&ec?.end(e)}var mf=class af extends Ee{_runCallbacks(t){[...this._injectCallbacks].forEach(n=>n(t))}constructor(t=null){super(),L(this,"_parent",void 0),L(this,"_injectCallbacks",[]),L(this,"_injections",Object.create(null)),L(this,"onInject",n=>(this._injectCallbacks.push(n),{dispose:()=>{const r=this._injectCallbacks.indexOf(n);r>=0&&this._injectCallbacks.splice(r,1)}})),this._parent=t,t&&this.addDisposable(t.onInject(n=>this._runCallbacks(n)))}inject(t,n){this._injections[t]=()=>n,this._runCallbacks(t)}injectFactory(t,n,r){const o=this._injections[t];let i=typeof o=="function"?o():o;const s=this._injections[t]=()=>(i=n(this,i),i);r&&s(),this._runCallbacks(t)}_find(t,n=!0){return this._injections[t]||n&&this._parent?._find(t)}_onInject(t,n,r=new Ee){return r.addDisposable(this.onInject(o=>{t===o&&!r.isDisposed()&&(r.dispose(),n(this.getInstance(o)))})),this._parent&&r.addDisposable(this._parent._onInject(t,n,r)),this.addDisposable(r),r}getInstance(t,n=!0){const r=this._find(t,n);if(typeof r=="function")return r()}getOrCreateInstance(t,n){const r=this._find(t);if(typeof r=="function")return r();const o=n(this);return this.inject(t,o),o}getInstanceAsync(t){const n=this._find(t);if(typeof n=="function")return Promise.resolve(n());const r=RS();return new Promise((o,i)=>{const s={id:String(t),startedAt:Date.now(),origin:r,container:this,reject:i};Yo.add(s),ec?.start(s),this._onInject(t,()=>{tc(s),o(this.getInstance(t))})})}failPendingWaits(t){for(const n of Array.from(Yo))n.container===this&&(tc(n),n.reject(t))}pendingWaits(){return[...Yo].filter(t=>t.container===this)}addService(t,n){const r=Jl(t);this.injectFactory(r,(i,s=[])=>s.indexOf(n)<0?[...s,n]:s);const o=new Ee;return o.addDispose(()=>{this.injectFactory(r,(i,s=[])=>s.filter(a=>a!==n))}),o}addServiceFactory(t,n,r){const o=Jl(t);let i;this.injectFactory(o,(a,l=[])=>(i=n(a,i),i===void 0?l:l.indexOf(i)<0?[...l,i]:l),r);const s=new Ee;return s.addDispose(()=>{this.injectFactory(o,(a,l=[])=>i===void 0?l:l.filter(c=>c!==i))}),s}getServices(t){const n=Jl(t);return[...this.getInstance(n,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new af(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const n=this._parent?.getOrCreateIsolatedContainer(t);return new af(n)})}remove(t){const n=this._injections;delete n[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(Yo))t.container===this&&tc(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function nc(e){return e.startsWith("__")?e:`__${e}__`}function OS(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=nc(e),n=globalThis;return n[t]??(n[t]={})}function PS(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function IS(e){if(e)return nc(e);const t="emailmaker".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return nc(t)}function rc(e){const t=IS(e),n=OS(t);if(PS(n.container))return n.container;const r=new mf(null);return n.container=r,r}function DS(){let e=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){let r=Math.random()*16;return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),(n==="x"?r:r&3|8).toString(16)})}function BS(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():DS()}function de(e=BS()){return e}function ff(){return"iframe".trim()||"unknown"}function HS(e){if(typeof globalThis>"u")return;const t=ff(),n=globalThis[e]??{};globalThis[e]=n;const r=n.__diagnostics??(n.__diagnostics={}),o=r.diModuleEval??(r.diModuleEval={evalCount:0,records:[]});o.records.push({buildSource:t,timestamp:Date.now(),stack:new Error().stack}),o.evalCount+=1}function FS(){const e="emailmaker".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function $S(e,t){if(HS(t),typeof globalThis>"u")return e;const n=ff(),r=globalThis,o=r[t]=r[t]||{},i=o.__diagnostics=o.__diagnostics||{},s=i.dependencyResolver=i.dependencyResolver||{entries:[]},a={container:e,source:"packages/runtime-core/di/index.ts",buildSource:n,timestamp:Date.now(),stack:new Error().stack};return s.entries.push(a),e}var Ns;function WS(){if(Ns)return Ns;const e=FS();return Ns=$S(rc(e),e),Ns}var lq=new Proxy({},{get(e,t,n){const r=WS(),o=Reflect.get(r,t,n);return typeof o=="function"?o.bind(r):o}}),qS=new Function("url","return import(url)");function zS(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function oc(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function pf(e){return e.type==="umd"||e.resolve==="registry"}var VS="If the plugin is built on globals, enable the compatibility layer: the `compatGlobals` option of the bundler plugin or `import '<package>/compat-globals'` before creating the editor.";function US(e){const t=Array.isArray(e)?e[0]:e;return oc(t)?t.name??t.url:typeof t=="function"?t.name||"anonymous plugin":String(t)}function jS(e,t){const n=US(e),r=oc(e)?e:void 0,o=t instanceof Error?t.message:String(t),i=r&&pf(r)&&!/compat/iu.test(o)?` ${VS}`:"",s=new Error(`Plugin "${n}" was skipped: it failed to load. ${o}${i}`);return s.cause=t,{name:n,url:r?.url,error:s}}function GS(e){return!e.filename&&!e.error&&/^Script error\.?$/.test(e.message)}function cq(e){return e}var XS=class{constructor(e,t,n={}){L(this,"_context",void 0),L(this,"_pluginRegistry",void 0),L(this,"_options",void 0),L(this,"_map",new Map),L(this,"_optionsMap",new Map),L(this,"_readyMap",new Map),L(this,"_resolveMap",new Map),L(this,"_initializingPlugins",new Map),L(this,"_creatingPlugins",new Set),L(this,"_initializedPlugins",new Set),L(this,"_creationOrder",[]),L(this,"_lifecycleListeners",new Set),L(this,"_activated",!1),this._context=e,this._pluginRegistry=t,this._options=n}activate(){return this._activated=!0,this._startPluginsBatch(Array.from(this._map.values()))}activateSync(){this._activated=!0,this._startPluginsBatch(Array.from(this._map.values()))}onLifecycle(e){return this._lifecycleListeners.add(e),{dispose:()=>this._lifecycleListeners.delete(e)}}_emitLifecycle(e){for(const t of Array.from(this._lifecycleListeners))try{t(e)}catch{}}async _resolveEntry(e){if(typeof e=="string"||typeof e=="symbol"){const t=await this._pluginRegistry.getAsync(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered.`);return{ctor:t}}if(typeof e=="function")return e.length===0?{ctor:await e()}:{ctor:e};if(Array.isArray(e)){const[t,n]=e;if(typeof t=="function")return{ctor:t,options:n};const r=await this._pluginRegistry.getAsync(t);if(!r)throw new Error(`Plugin "${String(t)}" not registered.`);return{ctor:r,options:n}}if(oc(e))return this._resolveDescriptor(e);throw new Error(`Unknown plugin entry format: ${JSON.stringify(e)}`)}async _resolveDescriptor(e){const t=e.resolve??(e.type==="umd"?"window":"module");if(pf(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const n=await qS(e.url);if(t==="module")return{ctor:n.default??n};if(t==="registry"&&e.name){const r=await this._pluginRegistry.getAsync(e.name);if(!r)throw new Error(`Plugin "${e.name}" not found in registry after ESM load`);return{ctor:r}}}if(e.type==="umd"){if(await this._loadScript(e.url),t==="window"&&e.name){const n=globalThis[e.name];if(!n)throw new Error(`Plugin "${e.name}" not found on window after script load`);return{ctor:n}}if(t==="registry"&&e.name){const n=await this._pluginRegistry.getAsync(e.name);if(!n)throw new Error(`Plugin "${e.name}" not found in registry after script load`);return{ctor:n}}}throw new Error(`Cannot resolve descriptor: type=${e.type}, resolve=${t}, name=${e.name??"none"}`)}_loadScript(e){return new Promise((t,n)=>{if(typeof document>"u"){n(new Error("Cannot load UMD script in non-browser environment"));return}const r=document.createElement("script");r.src=e,this._options.explainScriptFailure?.();let o;const i=a=>{o||(a.filename===r.src?o=this._scriptExecutionError(e,a.error??a.message):GS(a)&&(o=this._scriptExecutionError(e,this._options.explainScriptFailure?.()??a.message)))},s=()=>window.removeEventListener("error",i);window.addEventListener("error",i),r.onload=()=>{if(s(),o){n(o);return}t()},r.onerror=()=>{s(),n(new Error(`Failed to load script: ${e}`))},document.head.appendChild(r)})}_scriptExecutionError(e,t){const n=t instanceof Error?t.message:String(t),r=new Error(`Plugin script "${e}" threw while executing: ${n}`);return r.cause=t,r}initSync(e){const t=[];for(const n of e){const r=this._createOrSkip(n,void 0);r&&t.push(r)}this._activated=!0,this._startPluginsBatch(t)}async init(e){const t=[],n=new Set;for(const r of e){const o=await this._resolveOrSkip(r);if(!o)continue;const i=this._createOrSkip(o.ctor,o.options);i&&!n.has(i)&&(n.add(i),t.push(i))}this._activated=!0,await this._startPluginsBatch(t)}async setPlugins(e){const t=new Set,n=[];for(const s of e){const a=await this._resolveOrSkip(s);a&&(t.add(a.ctor),n.push(a))}const r=[];this._map.forEach((s,a)=>{t.has(a)||r.push({key:a,plugin:s})});for(let s=r.length-1;s>=0;s--){const{key:a,plugin:l}=r[s];await this._initializingPlugins.get(l),await this._disposePlugin(l,l.constructor.name),this._map.delete(a),this._optionsMap.delete(a),this._readyMap.delete(l),this._resolveMap.delete(l),this._initializingPlugins.delete(l),this._initializedPlugins.delete(l);const c=this._creationOrder.indexOf(l);c>=0&&this._creationOrder.splice(c,1)}const o=[],i=new Set;for(const{ctor:s,options:a}of n){const l=this._createOrSkip(s,a);l&&!i.has(l)&&(i.add(l),o.push(l))}this._activated&&await this._startPluginsBatch(o)}isReady(e){return this._initializedPlugins.has(e)}ready(e){return this._initializingPlugins.get(e)??this._readyMap.get(e)??Promise.resolve()}async waitFor(e,t){if(this._pluginRegistry.has(e))return this.useByKeyAsync(e);const{timeout:n}=t??{};return await new Promise((r,o)=>{let i,s=!1;const a=()=>{s||(s=!0,i&&clearTimeout(i),this._pluginRegistry.off(e,a),r())};this._pluginRegistry.on(e,a),n!==void 0&&n>0&&(i=setTimeout(()=>{s||(s=!0,this._pluginRegistry.off(e,a),o(new Error(`waitFor("${String(e)}") timed out after ${n}ms`)))},n))}),this.useByKeyAsync(e)}useByKey(e){const t=this._pluginRegistry.get(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered or not loaded yet. Use useByKeyAsync() for async plugins.`);const n=this._getOrCreate(t);return this._activated&&this._startPluginsBatch([n]),n}async useByKeyAsync(e){const t=await this._pluginRegistry.getAsync(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered.`);const n=this._getOrCreate(t);return this._activated&&await this._startPluginsBatch([n]),n}useByCtor(e,t){const n=this._getOrCreate(e,t);return this._activated&&this._startPluginsBatch([n]),n}use(e){return typeof e=="function"?this.useByCtor(e):this.useByKey(e)}async useAsync(e){const{ctor:t,options:n}=await this._resolveEntry(e),r=this._getOrCreate(t,n);return this._activated&&await this._startPluginsBatch([r]),r}_getOrCreate(e,t){const n=e;if(!this._map.has(n)){t!==void 0&&this._optionsMap.set(n,t);const r=this._optionsMap.get(n),o=this._createPluginInstance(e,r),i=o.constructor.name;this._emitLifecycle({type:"created",plugin:o,name:i}),o.required?.(),this._map.set(n,o),this._creationOrder.push(o),this._setupReadyPromise(o)}return this._map.get(n)}async _resolveOrSkip(e){try{return await this._resolveEntry(e)}catch(t){const n=jS(e,t);try{this._options.reportLoadFailure?.(n)}catch{}return}}_createOrSkip(e,t){try{return this._getOrCreate(e,t)}catch(n){const r=e.name||"anonymous plugin";this._emitLifecycle({type:"create:error",ctor:e,name:r,error:n});return}}_createPluginInstance(e,t){const n=e;if(this._creatingPlugins.has(n))throw new Error(`Cyclic dependency for plugin ${e.name}`);this._creatingPlugins.add(n);const r=this._options.openEarlyWindow?.();try{return zS(e)?new e(this._context,t):e(this._context,t)||{}}finally{r?.(),this._creatingPlugins.delete(n)}}_setupReadyPromise(e){const t=new Promise(n=>{this._resolveMap.set(e,n)});this._readyMap.set(e,t)}async _startPluginsBatch(e){const t=Array.from(new Set(e)),n=new Set,r=[];for(const o of t){if(this._initializedPlugins.has(o))continue;const i=this._initializingPlugins.get(o);if(i){n.add(i);continue}r.push(o)}if(r.length>0){const o=this._runBatchLifecycle(r);for(const i of r)this._initializingPlugins.set(i,o);n.add(o),o.finally(()=>{for(const i of r)this._initializingPlugins.get(i)===o&&this._initializingPlugins.delete(i)})}await Promise.all(n)}async _runBatchLifecycle(e){const t=[];for(const n of e){const r=n.constructor.name;this._emitLifecycle({type:"init:start",plugin:n,name:r});const o=this._options.openEarlyWindow?.();try{await n.init?.(),this._emitLifecycle({type:"init:success",plugin:n,name:r}),t.push(n)}catch(i){this._emitLifecycle({type:"init:error",plugin:n,name:r,error:i})}finally{o?.()}}for(const n of t){const r=n.constructor.name;this._emitLifecycle({type:"afterInit:start",plugin:n,name:r});try{await n.afterInit?.(),this._emitLifecycle({type:"afterInit:success",plugin:n,name:r})}catch(o){this._emitLifecycle({type:"afterInit:error",plugin:n,name:r,error:o})}}for(const n of e)this._initializedPlugins.add(n),this._resolveMap.get(n)?.(),this._resolveMap.delete(n)}async _disposePlugin(e,t){this._emitLifecycle({type:"dispose:start",plugin:e,name:t});try{await e.dispose?.(),this._emitLifecycle({type:"dispose:success",plugin:e,name:t})}catch(n){this._emitLifecycle({type:"dispose:error",plugin:e,name:t,error:n})}}async dispose(){for(let e=this._creationOrder.length-1;e>=0;e--){const t=this._creationOrder[e];await this._initializingPlugins.get(t),await this._disposePlugin(t,t.constructor.name)}this._map.clear(),this._optionsMap.clear(),this._readyMap.clear(),this._resolveMap.clear(),this._initializingPlugins.clear(),this._initializedPlugins.clear(),this._creationOrder.length=0,this._lifecycleListeners.clear()}getStatus(){return Array.from(this._map.values()).map(e=>({name:e.constructor.name,initialized:this._initializedPlugins.has(e)}))}},YS=class{constructor(){L(this,"_plugins",new Map),L(this,"_listeners",new Map)}_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){const n=this._plugins.get(e);if(n?.overrides)for(const r of n.overrides)t=r(t)||t;return t}_notifyListeners(e,t){const n=this._listeners.get(e);if(!n||n.length===0)return;for(const o of n)try{o.callback(t)}catch{}const r=n.filter(o=>!o.once);r.length>0?this._listeners.set(e,r):this._listeners.delete(e)}get(e){const t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor)}async getAsync(e){const t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor);if(t?.loading){const n=await t.loading;return this._applyOverrides(e,n)}if(t?.factory){const n=Promise.resolve(t.factory()).then(o=>(t.ctor=o,t.loading=void 0,this._notifyListeners(e,o),o));t.loading=n;const r=await n;return this._applyOverrides(e,r)}return new Promise(n=>{this.on(e,r=>n(this._applyOverrides(e,r)))})}add(e,t){const n=this._getOrCreateEntry(e);n.ctor=t,this._notifyListeners(e,t)}addAll(e){for(const t of Object.keys(e)){const n=e[t];n!==void 0&&this.add(t,n)}}addAsync(e,t){const n=this._getOrCreateEntry(e);return n.factory=t,{dispose:()=>{n.ctor||(n.factory=void 0)}}}has(e){const t=this._plugins.get(e);return!!(t?.ctor||t?.factory)}isLoaded(e){return!!this._plugins.get(e)?.ctor}override(e,t){const n=this._getOrCreateEntry(e);return n.overrides.push(t),{dispose:()=>{const r=n.overrides.indexOf(t);r>=0&&n.overrides.splice(r,1)}}}on(e,t){const n=this.get(e);n&&t(n);let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));const o={callback:t,once:!1};return r.push(o),{dispose:()=>this._removeListener(e,t)}}once(e,t){const n=this.get(e);if(n)return t(n),{dispose:()=>{}};let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));const o={callback:t,once:!0};return r.push(o),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){const n=this._listeners.get(e);if(n){const r=n.findIndex(o=>o.callback===t);r>=0&&n.splice(r,1),n.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){const e=this;return{add(t,n){e.add(t,n)}}}},KS=class{constructor(e){L(this,"resolveRegistry",void 0),this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},te=de("SandboxHtmlDocument"),mt=de("SandboxRemoteDocument"),Ko=de("SandboxTextDocument"),Zt=de("SandboxDocumentMapping"),xe=de("SandboxSyncCommit"),Zo=de("SandboxLayoutProfile"),xs=de("SandboxState"),qr=de("SandboxAttributePipeline"),ic=de("SandboxAmpService"),sc=de("SandboxImageReload"),Ms=de("SandboxImageCache"),at=de("SandboxFocus"),ac=de("SandboxLocalization"),He=de("SandboxElementSettings"),vt=de("SandboxSetCursor"),hf=de("SandboxStyleRoot"),gf=de("SandboxVmlWidthResolver"),Rs=de("SandboxPrepareHtml"),Qo=de("SandboxSurfaceName"),Os=de("SandboxDocumentSync"),zr=de("SandboxMapObj"),Vr=de("SandboxActiveElementFingerprint"),Ps=de("SandboxToggleTextStyle"),Qt=de("SandboxWrapEditor"),Ur=de("SandboxInsertServices"),Jo=de("SandboxInitPreview"),lc=de("SandboxInsertPolicy"),bf=de("SandboxNarrowTableTextAtom"),yf=de("SandboxSettingsExtras"),vf=de("SandboxViewportHandlers"),Ef=de("SandboxOperations"),Is=de("SandboxApplyElementSettings"),Kn=de("SandboxOperationEnvironment"),jr=de("SandboxHostFacts"),ZS="__sandbox__",Et=rc(ZS);function QS(e){return e}function JS(e,t=Et){t.inject(Qo,e.name),t.inject(Zo,e.profile);for(const n of MS(e.units))n.setup(t);return t}function Jt(e,t){e.remove?.(t)}function D(e,t){const n=e.getInstance(t);if(n===void 0)throw new Error(`[sandbox] служба «${String(t)}» не зарегистрирована: её фича не подключена или ещё не зарегистрирована`);return n}var Sf=class{constructor(e){L(this,"_voidElements",void 0),this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},St=(function(e){return e[e.StartCommentTag=0]="StartCommentTag",e[e.Comment=1]="Comment",e[e.EndCommentTag=2]="EndCommentTag",e[e.StartTagOpen=3]="StartTagOpen",e[e.StartTagClose=4]="StartTagClose",e[e.StartTagSelfClose=5]="StartTagSelfClose",e[e.StartTag=6]="StartTag",e[e.EndTagOpen=7]="EndTagOpen",e[e.EndTagClose=8]="EndTagClose",e[e.EndTag=9]="EndTag",e[e.DelimiterAssign=10]="DelimiterAssign",e[e.AttributeName=11]="AttributeName",e[e.AttributeValue=12]="AttributeValue",e[e.StartDoctypeTag=13]="StartDoctypeTag",e[e.Doctype=14]="Doctype",e[e.EndDoctypeTag=15]="EndDoctypeTag",e[e.Content=16]="Content",e[e.Whitespace=17]="Whitespace",e[e.Unknown=18]="Unknown",e[e.Script=19]="Script",e[e.Styles=20]="Styles",e[e.EOS=21]="EOS",e[e.AdvancedStart=100]="AdvancedStart",e[e.AdvancedEnd=101]="AdvancedEnd",e})({}),ew=class{constructor(e,t){L(this,"source",void 0),L(this,"len",void 0),L(this,"position",void 0),this.source=e,this.len=e.length,this.position=t}eos(){return this.len<=this.position}getSource(){return this.source}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}goToEnd(){this.position=this.source.length}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)?(this.position++,!0):!1}advanceIfChars(e){let t;if(this.position+e.length>this.source.length)return!1;for(t=0;t<e.length;t++)if(this.source.charCodeAt(this.position+t)!==e[t])return!1;return this.advance(t),!0}advanceIfRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index+t[0].length,t[0]):""}advanceUntilRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index,t[0]):(this.goToEnd(),"")}advanceUntilChar(e){for(;this.position<this.source.length;){if(this.source.charCodeAt(this.position)===e)return!0;this.advance(1)}return!1}advanceUntilChars(e){for(;this.position+e.length<=this.source.length;){let t=0;for(;t<e.length&&this.source.charCodeAt(this.position+t)===e[t];t++);if(t===e.length)return!0;this.advance(1)}return this.goToEnd(),!1}skipWhitespace(){return this.advanceWhileChar(e=>e===aw||e===lw||e===ow||e===sw||e===iw)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},wf=33,Gr=45,Ds=60,bn=62,cc=47,tw=61,nw=34,rw=39,ow=10,iw=13,sw=12,aw=32,lw=9,cw={"text/x-handlebars-template":!0,"text/html":!0};function uw(e,t=0,n=0,r=!1){const o=new ew(e,t);let i=n,s=0,a=18,l,c,u,d,m;function p(){return o.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function f(){return o.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function h(C,k,w){return a=k,s=C,l=w,k}function y(){const C=o.pos(),k=i,w=E();return w!==21&&C===o.pos()&&!(r&&(w===4||w===8))?(o.advance(1),h(C,18)):w}function E(){const C=o.pos();if(o.eos())return h(C,21);let k;switch(i){case 6:return o.advanceIfChars([Gr,Gr,bn])?(i=0,h(C,2)):(o.advanceUntilChars([Gr,Gr,bn]),h(C,1));case 3:return o.advanceIfChar(bn)?(i=0,h(C,15)):(o.advanceUntilChar(bn),h(C,14));case 0:if(o.advanceIfChar(Ds)){if(!o.eos()&&o.peekChar()===wf){if(o.advanceIfChars([wf,Gr,Gr]))return i=6,h(C,0);if(o.advanceIfRegExp(/^!doctype/i))return i=3,h(C,13)}return o.advanceIfChar(cc)?(i=2,h(C,7)):(i=1,h(C,3))}return o.advanceUntilChar(Ds),h(C,16);case 2:return p().length>0?(i=5,h(C,9)):o.skipWhitespace()?h(C,17,"Tag name must directly follow the open bracket."):(i=5,o.advanceUntilChar(bn),C<o.pos()?h(C,18,"End tag name expected."):E());case 5:if(o.skipWhitespace())return h(C,17);if(o.advanceIfChar(bn))return i=0,h(C,8);if(r&&o.peekChar()===Ds)return i=0,h(C,8,"Closing bracket missing.");k="Closing bracket expected.";break;case 1:return u=p(),m=void 0,d=void 0,u.length>0?(c=!1,i=4,h(C,6)):o.skipWhitespace()?h(C,17,"Tag name must directly follow the open bracket."):(i=4,o.advanceUntilChar(bn),C<o.pos()?h(C,18,"Start tag name expected."):E());case 4:return o.skipWhitespace()?(c=!0,h(C,17)):c&&(d=f(),d.length>0)?(i=9,c=!1,h(C,11)):o.advanceIfChars([cc,bn])?(i=0,h(C,5)):o.advanceIfChar(bn)?(u==="script"?m&&cw[m]?i=0:i=7:u==="style"?i=8:i=0,h(C,4)):r&&o.peekChar()===Ds?(i=0,h(C,4,"Closing bracket missing.")):(o.advance(1),h(C,18,"Unexpected character in tag."));case 9:return o.skipWhitespace()?(c=!0,h(C,17)):o.advanceIfChar(tw)?(i=10,h(C,10)):(i=4,E());case 10:if(o.skipWhitespace())return h(C,17);let w=o.advanceIfRegExp(/^[^\s"'`=<>]+/);if(w.length>0)return o.peekChar()===bn&&o.peekChar(-1)===cc&&(o.goBack(1),w=w.substr(0,w.length-1)),d==="type"&&(m=w),i=4,c=!1,h(C,12);const b=o.peekChar();return b===rw||b===nw?(o.advance(1),o.advanceUntilChar(b)&&o.advance(1),d==="type"&&(m=o.getSource().substring(C+1,o.pos()-1)),i=4,c=!1,h(C,12)):(i=4,c=!1,E());case 7:let v=1;for(;!o.eos();){const A=o.advanceIfRegExp(/<!--|-->|<\/?script\s*\/?>?/i);if(A.length===0)return o.goToEnd(),h(C,19);if(A==="<!--")v===1&&(v=2);else if(A==="-->")v=1;else if(A[1]!=="/")v===2&&(v=3);else if(v===3)v=2;else{o.goBack(A.length);break}}return i=0,C<o.pos()?h(C,19):E();case 8:return o.advanceUntilRegExp(/<\/style/i),i=0,C<o.pos()?h(C,20):E()}return o.advance(1),i=0,h(C,18,k)}return{scan:y,getTokenType:()=>a,getTokenOffset:()=>s,getTokenLength:()=>o.pos()-s,getTokenEnd:()=>o.pos(),getTokenText:()=>o.getSource().substring(s,o.pos()),getScannerState:()=>i,getTokenError:()=>l}}function dw(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function mw(e,t){const n=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+n.length,n}function fw(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function pw(e,t){const n=`<!--${e.content}-->`;return e.start=t,e.startTagEnd=t+4,e.end=t+n.length,e.endTagStart=e.end-3,n}var uc=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function hw(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}var Cf=Object.create(null);function gw(e,t){const n=Cf[e]||(Cf[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[hw(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function dc(e,t){if(e.start===e.end||t)return"";switch(e.type){case $.ELEMENT:return pc(e,t);case $.ROOT:return[...e.children].map(n=>dc(n,t)).join("");case $.DOCTYPE:return dw(e,t);case $.COMMENT:return fw(e,t);default:return e.content||""}}function mc(){return{exact:new WeakMap,collapsed:new WeakMap}}function fr(e,t=!1,n){if(e.start===e.end&&e.type!==$.ROOT)return"";const r=n&&(t?n.collapsed:n.exact),o=r?.get(e);if(o!==void 0)return o;const i=()=>e.children.map(a=>fr(a,t,n)).join("");let s;switch(e.type){case $.ELEMENT:{const a=e.tag?.toLowerCase();s=`<${a}${e.attributeNames.map(l=>` ${l}=${JSON.stringify(e.attributes?.[l]??null)}`).join("")}>${i()}</${a}>`;break}case $.ROOT:s=i();break;case $.COMMENT:s=`<!--${e.content??""}-->`;break;case $.DOCTYPE:s=`<!${e.content??""}>`;break;default:{const a=e.content??"";s=t?a.replace(/\s+/g," ").trim():a}}return r?.set(e,s),s}function fc(e,t=0){if(e.start===e.end)return"";switch(e.type){case $.ELEMENT:return yw(e,t);case $.ROOT:return Tf(e,t);case $.DOCTYPE:return mw(e,t);case $.COMMENT:return pw(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function Af(e){const t=e.tag?.toLowerCase();let n="";if(t){const r=e.attributes;if(r){const o=Object.keys(r);for(const i of o){const s=r[i]===null?"":r[i];typeof s=="string"&&(n+=s===""&&i!=="em"&&!gw(t,i)?` ${i}`:` ${i}="${s.replaceAll('"',"'")}"`)}}}return n}function bw(e,t){let n="";if(e.startTagEnd!==e.endTagStart||t)for(const r of e.children)n+=dc(r);return n}function Tf(e,t){let n="";if(e.startTagEnd!==e.endTagStart)for(const r of e.children)n+=fc(r,t+n.length);return n}function _f(e,t){if(e.start!==e.startTagEnd||t){const n=e.tag?.toLowerCase()||"div",r=Af(e);return n==="vk-snippet-end"?`<${n}${r}/>`:`<${n}${r}>`}return""}function kf(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function pc(e,t,n=!0){const r=e.tag?.toLowerCase()||"div",o=_f(e,t);if(uc.has(r))return o;{const i=kf(e,t);return`${o}${n?bw(e,t):""}${i}`}}function yw(e,t){const n=e.tag?.toLowerCase()||"div",r=_f(e);if(e.start=t,e.startTagEnd=t+r.length,uc.has(n)){e.endTagStart=e.startTagEnd,e.end=e.startTagEnd;const o=i=>{for(const s of i.children)s.start=s.startTagEnd=s.endTagStart=s.end=i.end,o(s)};return o(e),r}else{const o=Tf(e,e.startTagEnd);e.endTagStart=e.startTagEnd+o.length;const i=kf(e);return e.end=e.endTagStart+i.length,`${r}${o}${i}`}}function hc(e,t){let n=0,r=e.length;if(r===0)return 0;for(;n<r;){const o=Math.floor((n+r)/2);t(e[o])?r=o:n=o+1}return n}var $=(function(e){return e[e.HTML=0]="HTML",e[e.ELEMENT=1]="ELEMENT",e[e.ROOT=2]="ROOT",e[e.COMMENT=3]="COMMENT",e[e.DOCTYPE=4]="DOCTYPE",e[e.ADVANCED=5]="ADVANCED",e})({}),Bs=e=>e.type===0?e.start-1:e.start,vw=e=>e.type===0?e.end+1:e.end,wt=class SS{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(t,n,r,o){L(this,"start",void 0),L(this,"end",void 0),L(this,"children",void 0),L(this,"parent",void 0),L(this,"content",void 0),L(this,"type",1),L(this,"tag",void 0),L(this,"closed",!1),L(this,"startTagEnd",void 0),L(this,"endTagStart",void 0),L(this,"attributes",void 0),L(this,"createdBy",void 0),L(this,"isDirty",void 0),this.start=t,this.end=n,this.children=r,this.parent=o}isSameTag(t){return this.tag===void 0?t===void 0:t!==void 0&&this.tag.length===t.length&&this.tag.toLowerCase()===t}get firstChild(){return this.children[0]}get lastChild(){return this.children.length?this.children[this.children.length-1]:void 0}findNodeBefore(t){const n=hc(this.children,r=>t<=Bs(r))-1;if(n>=0){const r=this.children[n];if(t>Bs(r)){if(t<r.end)return r.findNodeBefore(t);const o=r.lastChild;return o&&o.end===r.end?r.findNodeBefore(t):r}}return this}findNodeAt(t){const n=hc(this.children,r=>t<=Bs(r))-1;if(n>=0){const r=this.children[n];if(t>=Bs(r)&&t<=vw(r))return r.findNodeAt(t)}return this}find(t){if(t(this))return this;for(const n of this.children){const r=n.find(t);if(r)return r}}closest(t){let n=this;do if(t(n))return n;while(n=n.parent)}parents(){return this.parent?[this.parent,...this.parent.parents()]:[]}closestFromRoot(t,n=!0){const r=n?[this,...this.parents()]:this.parents();for(let o=r.length-1;o>=0;o--){const i=r[o];if(t(i))return i}}contains(t){return!!t.closest(n=>n===this)}clone(t=this.parent,n=this.start,r=!0){const o=this.start-n,i=new SS(n,this.end-o,[],t);return i.children=r?this.children.map(s=>s.clone(i,s.start-o)):[],i.attributes={...this.attributes},i.closed=this.closed,i.content=this.content,i.startTagEnd=this.startTagEnd,i.endTagStart=this.endTagStart,i.tag=this.tag,i.type=this.type,i}};function Ew(e){if(typeof e=="string"){const t=e.startsWith("'")||e.startsWith('"')?1:0,n=e.endsWith("'")||e.endsWith('"')?e.length-1:e.length;return e.substring(t,n)}return e}var Lf=class{constructor(e,t){L(this,"text",void 0),L(this,"type",void 0),L(this,"node",void 0),L(this,"replaces",void 0),this.text=e,this.type=t}get hasNode(){return!!this.node}addReplace(e){this.replaces?.push(e)}start(e,t,n){if(!this.node){const r=this.node=new wt(e,this.text.length,[],n);r.type=this.type,r.startTagEnd=t,this.replaces=[]}}finish(e,t){const n=this.replaces,r=this.node,o=e+(t||0);if(n){for(const i of n){const s=i.parent;if(!s)throw new Error("parent not defined");const a=s.children.indexOf(i);s.children.splice(a,1)}this.replaces=void 0}if(r){const i=r.parent;if(!i)throw new Error("parent not defined");i.children.push(r),r.closed=t!==void 0,r.endTagStart=e,r.end=o,r.content=this.text.substring(r.startTagEnd,e),this.node=void 0}}},Nf=class{constructor(e){L(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const n=uw(e,void 0,void 0,!0),r=new wt(0,e.length,[],void 0);r.type=$.ROOT;let o=r,i=-1,s,a=null,l=n.scan();const c=()=>{if(!o.tag){const f=o.parent.children,h=f[f.length-2],y=e.substring(o.start,o.end);h?.type===$.HTML?(h.content=(h.content||"")+y,h.end=o.end,f.splice(f.length-1,1)):(o.type=$.HTML,o.content=y,o.children=[]),o.type=$.HTML}o=o.parent},u=new Lf(e,$.COMMENT),d=new Lf(e,$.DOCTYPE),m=f=>{o.children.push(f)};for(;l!==St.EOS;){switch(l){case St.StartDoctypeTag:d.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case St.EndDoctypeTag:{const C=o.lastChild,k=d.node;if(!k)throw new Error("");const w=C?C.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(w!==k.start){const b=e.substring(w,k.start);if(b){const v=new wt(w,k.start,[],o);v.type=$.HTML,v.content=b,m(v)}}d.finish(n.getTokenOffset(),n.getTokenLength());break}case St.StartCommentTag:u.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case St.EndCommentTag:{const C=o.lastChild,k=u.node;if(!k)throw new Error("");const w=C?C.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(w!==k.start){const b=e.substring(w,k.start);if(b){const v=new wt(w,k.start,[],o);v.type=$.HTML,v.content=b,m(v)}}u.finish(n.getTokenOffset(),n.getTokenLength());break}case St.StartTagOpen:const f=o.lastChild,h=new wt(n.getTokenOffset(),e.length,[],o),y=f?f.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(y!==h.start){const C=e.substring(y,h.start);if(C){const k=new wt(y,h.start,[],o);k.type=$.HTML,k.content=C,m(k)}}m(h),o=h;break;case St.StartTag:o.tag=n.getTokenText();break;case St.StartTagClose:o.parent&&(o.end=n.getTokenEnd(),n.getTokenLength()?(o.startTagEnd=n.getTokenEnd(),o.tag&&this.dataManager.isVoidElement(o.tag)&&(o.closed=!0,c())):c());break;case St.StartTagSelfClose:o.parent&&(o.closed=!0,o.end=n.getTokenEnd(),o.startTagEnd=n.getTokenEnd(),c());break;case St.EndTagOpen:i=n.getTokenOffset(),s=void 0;break;case St.EndTag:s=n.getTokenText().toLowerCase();break;case St.EndTagClose:let E=o;for(;!E.isSameTag(s)&&E.parent;)E=E.parent;if(E.parent){const C=o.lastChild,k=C?C.end:o.startTagEnd===void 0?o.start:o.startTagEnd;if(k!==i){const w=e.substring(k,i);if(w){const b=new wt(k,i,[],o);b.type=$.HTML,b.content=w,m(b)}}for(;o!==E;)o.end=i,o.closed=!1,c();o.closed=!0,o.endTagStart=i,o.end=n.getTokenEnd(),c()}break;case St.AttributeName:{a=n.getTokenText();let C=o.attributes;C||(o.attributes=C={}),C[a]=null;break}case St.AttributeValue:{const C=n.getTokenText(),k=o.attributes;k&&a&&(k[a]=Ew(C),a=null);break}}l=n.scan()}for(;o.parent;)o.end=e.length,o.closed=!1,c();u.hasNode,u.finish(e.length);const p=r.lastChild?.end||0;if(p<e.length){const f=e.substring(p);if(f){const h=new wt(p,e.length,[],r);h.type=$.HTML,h.content=f,m(h)}}return{roots:r.children,findNodeBefore:r.findNodeBefore.bind(r),findNodeAt:r.findNodeAt.bind(r)}}},uq=new Nf(new Sf(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),Sw=new Sf(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),ww=new Nf(Sw);function Xr(e){return ww.parse(e)}var xf=class extends Ee{constructor(e={}){super(),L(this,"_options",void 0),L(this,"_listeners",[]),L(this,"on",this._addListener.bind(this)),L(this,"event",this._addListener.bind(this)),L(this,"once",(t,n=0,r)=>{const o=this._addListener((...i)=>(o?.dispose(),r?t.call(r,...i):t(...i)),n);return o}),L(this,"un",t=>{const n=this._listeners.findIndex(([r])=>r===t);n>=0&&(this._listeners.splice(n,1),this._listeners.length===0&&this._options.onLastListenerRemove&&this._options.onLastListenerRemove())}),this._options=e}getListeners(e){return this._listeners.flatMap(([t])=>typeof t=="function"?t:t.getListeners(e))}hasListeners(){for(const[e]of this._listeners){if(typeof e=="function")return!0;const t=e;if(typeof t.hasListeners=="function"){if(t.hasListeners())return!0;continue}return!0}return!1}_addListener(e,t=0,n){if(this.isDisposed())return{dispose:()=>{}};const r=this._listeners,o=this._options;n&&typeof e=="function"&&(e=e.bind(n));const i=r.findIndex(([,a])=>a<t),s=[e,t];return r.splice(i>=0?i:r.length,0,s),r.length===1&&o.onFirstListenerAdd&&o.onFirstListenerAdd(),{dispose:()=>{const a=r.indexOf(s);a>=0&&(r.splice(a,1),!r.length&&o.onLastListenerRemove&&o.onLastListenerRemove())}}}dispose(){this._listeners.splice(0,this._listeners.length),this._options.onLastListenerRemove&&this._options.onLastListenerRemove(),super.dispose()}},Cw=class extends xf{execute(e,t){for(const n of t)try{n(...e)}catch{}}fire(...e){if(!this.isDisposed()){const t=this.execute(e,this.getListeners(e));return t===void 0?void 0:t}}},Me=class extends Cw{execute([e],t){for(const n of t)try{n(e)}catch{}}},Aw=class extends xf{fire(e){if(this.isDisposed())return;let t=!1,n=!1;const r={value:e,preventDefault(){t=!0},stopPropagation(){n=!0}},o=this.getListeners([r]);for(const i of o){if(n)break;try{i(r)}catch{}}return t?!1:void 0}};function Tw(e,t,n){let r;const o=new Me({onFirstListenerAdd(){r=o.addDisposable(new Ee),r.addDisposable(e(i=>{t(i)!==!1&&o.fire(i)}))},onLastListenerRemove(){r?.dispose(),r=void 0}});return n?.addDisposable(o),o.event}function _w(e,t=window){return{peer:e,send(n){e.postMessage(n,"*")},subscribe(n){const r=o=>{n({data:o.data,source:o.source,ports:o.ports})};return t.addEventListener("message",r),{dispose:()=>t.removeEventListener("message",r)}},close(){}}}function kw(e){let t=!1;return{peer:e,send(n){e.postMessage(n)},subscribe(n){const r=o=>{n({data:o.data,source:e})};return e.addEventListener("message",r),t||(t=!0,e.start()),{dispose:()=>e.removeEventListener("message",r)}},close(){e.close()}}}function dq(e){return e}function Lw(e){return e&&typeof e=="object"}function Mf(e,t){return e&&typeof e=="object"&&e.operationId===t}var yn="INIT_MESSAGE",Nw="em:port-ready",xw="em:window-drained",gc="";function Rf(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var Mw=class extends Ee{constructor(...e){super(...e),L(this,"_listeners",Object.create(null)),L(this,"addListenerAsync",(t,n,r=0,o)=>{const i=this._listeners[t]||(this._listeners[t]=[]);o&&typeof n=="function"&&(n=n.bind(o));const s=i.findIndex(([l,c])=>r<=c),a=[n,r];return this.isDisposed()||i.splice(s>=0?s:i.length,0,a),{dispose(){const l=i.indexOf(a);l>=0&&i.splice(l,1)}}}),L(this,"fireAsync",(t,n)=>{if(!this.isDisposed()){const r=this._listeners[t]||(this._listeners[t]=[]);let o;for(let i=0;i<r.length;i++){const s=r[i][0],a=o;o=l=>s(l,a)}if(o)return o(n)}}),L(this,"addListener",(t,n,r=0)=>this.addListenerAsync(t,(o,i)=>{try{n(o)}catch{}return i&&i(o)},r))}},Rw=class extends Ee{constructor(e,t){super(),L(this,"_singleton",void 0),L(this,"_target",void 0),L(this,"_transport",void 0),L(this,"_transportSubscription",void 0),L(this,"_ports",new Map),L(this,"_drained",new WeakSet),L(this,"_portSendHeld",new WeakSet),L(this,"_inited",!1),L(this,"_emitter",this.addDisposable(new Mw)),L(this,"_handshaken",new WeakSet),L(this,"_greeted",new WeakSet),L(this,"_outgoingFilter",void 0),L(this,"_outgoingObservers",new Set),L(this,"_offTargetListeners",new Map),L(this,"_onTransportMessage",n=>{const r=n,o=r.data,i=r.source,s=o?.port===!0?r.ports?.[0]:void 0,a=!this._isPortSource(r.source);if(a&&i&&o?.operationId==="em:window-drained"){this._ports.has(i)&&this._drained.add(i);return}if(a&&i&&this._drained.has(i))return;if(i&&i!==this._target&&this._greeted.has(i)&&Mf(o,yn)){this._greeted.delete(i),this._handshaken.add(i),this._postMessage(i,{operationId:yn,data:{}}),s&&this.usePort(s,!0,i);return}const l=r.source===this.target||this._isCurrentPort(r.source);if(l||this._notifyOffTarget(o?.operationId,r.source),Lw(o)&&l||this._singleton&&Mf(o,yn)){if(s&&l){const m=this._target;Promise.resolve().then(()=>this.usePort(s,!0,m))}const c=this._emitter.fireAsync(o.operationId||gc,o.operationId===void 0?r:o.data),u=o.result,d=o.error;u&&d&&Promise.resolve(c).then(m=>this._sendMessage(u,m),m=>this._sendMessage(d,m))}}),this._singleton=t,this._transport=_w({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(yn,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(yn))}),e&&this.setTarget(e)}setTarget(e){if(this._target!==e){if(this._target=e,!e){this._inited=!1;return}if(this._handshaken.has(e)){this._inited=!0,this._emitter.fireAsync(yn,void 0);return}this._inited=!1,this._postMessage(e,{operationId:yn,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:yn,data:{},port:!0},[t])}observeOutgoing(e){return this._outgoingObservers.add(e),{dispose:()=>{this._outgoingObservers.delete(e)}}}_notifyOutgoing(e,t){for(const n of Array.from(this._outgoingObservers))try{n(e,t)}catch{}}addOffTargetListener(e,t){let n=this._offTargetListeners.get(e);return n||(n=new Set,this._offTargetListeners.set(e,n)),n.add(t),{dispose:()=>{n.delete(t)}}}_notifyOffTarget(e,t){const n=typeof e=="string"?this._offTargetListeners.get(e):void 0,r=n?.size?this._knownPeer(t):void 0;if(!(!n||!r))for(const o of Array.from(n))try{o(r)}catch{}}_knownPeer(e){for(const[n,r]of this._ports)if(r.transport.peer===e)return n;const t=e;return typeof e=="object"&&e!==null&&(this._handshaken.has(t)||this._greeted.has(t))?t:void 0}setOutgoingFilter(e){return this._outgoingFilter=e,()=>{this._outgoingFilter===e&&(this._outgoingFilter=void 0)}}sendNow(e){const t=this._target;return!this._inited||!t?!1:(this._postMessage(t,e),!0)}greet(e){this._handshaken.has(e)||this._greeted.has(e)||this._target===e||(this._greeted.add(e),this._postMessage(e,{operationId:yn,data:{}}))}forget(e){this._handshaken.delete(e),this._greeted.delete(e),this._closePort(e),this._drained.delete(e),this._target===e&&(this._inited=!1)}usePort(e,t=!1,n=this._target){if(!n||this._ports.has(n))return;const r=kw(e),o=r.subscribe(this._onTransportMessage);this._ports.set(n,{transport:r,subscription:o}),t&&(r.send({operationId:Nw,data:{}}),this.drainWindow(n))}holdPort(e=this._target){!e||!this._ports.has(e)||(this._portSendHeld.add(e),this._drained.delete(e))}resumePort(e=this._target){e&&this._portSendHeld.delete(e)}useWindow(e=this._target){e&&(this._closePort(e),this._drained.delete(e))}get usesPort(){return this._target!==void 0&&this._ports.has(this._target)&&!this._portSendHeld.has(this._target)}hasPort(e,t){const n=this._ports.get(e);return n!==void 0&&(t===void 0||n.transport.peer===t)}_closePort(e){const t=this._ports.get(e);t&&(t.subscription.dispose(),t.transport.close(),this._ports.delete(e),this._portSendHeld.delete(e))}drainWindow(e){this._ports.has(e)&&e.postMessage({operationId:xw,data:{}},"*")}isWindowDrained(e){return this._drained.has(e)}_isPortSource(e){for(const t of this._ports.values())if(t.transport.peer===e)return!0;return!1}_isCurrentPort(e){return this._target!==void 0&&this._ports.get(this._target)?.transport.peer===e}getTarget(){return this._target}get target(){return this._target}_postMessage(e,t,n){let r=t;this._outgoingFilter&&!n?.length&&(r="data"in t?{...t,data:this._outgoingFilter(t.data)}:this._outgoingFilter(t));try{const o=this._ports.get(e);if(o&&!this._portSendHeld.has(e)){o.transport.send(r);return}if(n?.length){e.postMessage(r,"*",n);return}e.postMessage(r,"*")}catch(o){if(o?.name==="DataCloneError"){const i=typeof r?.data=="object"&&r?.data!==null?r.data:void 0}throw o}}_sendMessage(e,t,n=!0){if(!n&&!this.isInited())return;e&&this._notifyOutgoing(e,t);const r=this.addDisposable(this.onInit(o=>{const i=e?{operationId:e,data:t}:t;try{this._postMessage(o,{...i})}finally{r.dispose()}}))}send(e,t,n){return typeof e=="string"?this._sendMessage(e,t,n):this._sendMessage(gc,e,t)}sendAsync(e,t,n=!0){if(!n&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const r=Rf(),o=Rf();return new Promise((i,s)=>{const a=this.addDisposable(new Ee);a.addDisposable(this.onInit(l=>{try{this._postMessage(l,{operationId:e,data:t,result:r,error:o})}catch(c){a.dispose(),s(c);return}a.addDisposable(this._onMessage(r,c=>{i(c),a.dispose()})),a.addDisposable(this._onMessage(o,c=>{s(c),a.dispose()}))}))})}_onMessage(e,t,n=0){return this._emitter.addListener(e,t,n)}addListener(e,t,n){return t?this._onMessage(e,t,n):this._onMessage(gc,e)}addListenerAsyncPipe(e,t,n=0){return this._emitter.addListenerAsync(e,t,n)}addListenerAsync(e,t,n=0){return this._emitter.addListenerAsync(e,async(r,o)=>{const i=await t(r);return o?o(r):i},n)}isInited(){return this._inited}get inited(){return this._inited}onInit(e,t=!0,n=0){const r=this.addDisposable(new Ee);return this._inited&&this._target?t&&Promise.resolve().then(()=>{!this._inited||!this._target?r.addDisposable(this.onInit(e,t,n)):e(this._target)}):r.addDisposable(this._onMessage(yn,()=>{e(this._target)},n)),r}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}},Ow=/<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s[^<>]*)?\/?>/g;function Pw(e){return e.replace(Ow,t=>/^<br\b/i.test(t)?" ":"")}var Iw={theme:"canvas_fact_theme",flags:"canvas_fact_flags",commonStyles:"canvas_fact_common_styles",lockEditor:"canvas_fact_lock_editor",codeMode:"canvas_fact_code_mode",appName:"canvas_fact_app_name",previewPage:"canvas_fact_preview_page",viewport:"canvas_fact_viewport"},Dw="fonts.googleapis.com",Bw=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},Hw=e=>{const t=Bw(String(e??""));return t?t.hostname===Dw&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},Pe={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_EDITOR:"update_editor",UPDATE_EDITOR_POSITION:"update_editor_position",UPDATE_SIDE_MENU_EDITOR:"update_side_menu_editor",SAVE_EMAIL:"saveEmail",SANDBOX_ELEMENT_SETTINGS_SET:"sandbox_element_settings_set",SANDBOX_IMAGE_RESET:"sandbox_image_reset",SANDBOX_NATIVE_IMAGE_DROP_CLEAR:"sandbox_native-image-drop-clear",SANDBOX_EMAIL_SETTINGS_SET:"sandbox_email_settings_set",SANDBOX_BLOCK_SETTINGS_SET:"sandbox_block_settings_set",SANDBOX_ELEMENT_PARENT_GET:"sandbox_element_parent_get",SANDBOX_ELEMENT_PARENT_TABLE_GET:"sandbox_element_parent_table_get",SANDBOX_ELEMENT_PREV_GET:"sandbox_element_prev_get",SANDBOX_ELEMENT_NEXT_GET:"sandbox_element_next_get",SANDBOX_ELEMENT_REMOVE:"sandbox_element_remove",SANDBOX_ELEMENT_ACTIVE_RESET:"sandbox_element_active_reset",SANDBOX_ELEMENT_ACTIVE_SET:"sandbox_element_active_set",SANDBOX_ELEMENT_HOVER_SET:"sandbox_element_hover_set",SANDBOX_ELEMENT_IMG_LINK:"sandbox_element_img_link",SANDBOX_ELEMENT_TEXT:"sandbox_element_text",SANDBOX_EMAIL_CONTENT_GET:"sandbox_email_content_get",SANDBOX_SET_POSITION_TO_IMG:"sandbox_set_position_to_img",SANDBOX_SET_POSITION_TO_LINK:"sandbox_set_position_to_link",SANDBOX_ACCORDION_ADD_SECTION:"sandbox_accordion_add_section",SANDBOX_ACCORDION_REMOVE_SECTION:"sandbox_accordion_remove_section",APPLICATION_FOCUS_IN_IFRAME:"application_focus_in_iframe",APPLICATION_EMAIL_SETTINGS_SET:"application_email_settings_set",APPLICATION_BLOCK_SETTINGS_SET:"application_block_settings_set",APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",_APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",APPLICATION_ELEMENT_SETTINGS_CLOSE:"application_element_settings_close",APPLICATION_ACTION:"application_action",APPLICATION_EBLOCK_ADD:"application_eblock_add",SANDBOX_EBLOCK_SET_EM_BLOCK_ID:"sandbox_eblock_set_em_block_id",SANDBOX_GLOBAL_BLOCK_REPLACE:"sandbox_global_block_replace",APPLICATION_SCROLL_TO:"application_scroll-to",APPLICATION_SCROLL_BLOCK_SHOW:"application_scroll-block-show",APPLICATION_SCROLL_BLOCK_HIDE:"application_scroll-block-hide",APPLICATION_DISCUSS_SET_ID:"application_discuss_set_id",APPLICATION_DISCUSS_GET_COMMENT:"application_discuss_get_comment",APPLICATION_DISCUSS_NO_COMMENT:"application_discuss_no_comment",APPLICATION_DISCUSS_SAVE_TARGET:"application_discuss_save_target",APPLICATION_IFRAME_SET_HEIGHT:"application_iframe_set_height",APPLICATION_COMMON_STYLES_UPDATE:"application_commonStyles_update",APPLICATION_EMAIL_CONTENT_GET:"application_email_content_get",APPLICATION_OPEN_IMAGE_AI_POPUP:"application_open-image-ai-popup",APPLICATION_OPEN_IMAGE_UPLOAD_POPUP:"application_open-image-upload-popup",APPLICATION_OPEN_IMAGE_EDIT_POPUP:"application_open-image-edit-popup",APPLICATION_OPEN_IMAGE_GIF_POPUP:"application_open-image-gif-popup",APPLICATION_OPEN_IMAGE_STOCK_POPUP:"application_open-image-stock-popup",APPLICATION_CLOSE_IMAGE_EDIT_POPUP:"application_close-image-edit-popup",APPLICATION_NATIVE_IMAGE_DROP:"application_native-image-drop",APPLICATION_SUBJECT_UPDATE:"application_subject_update",APPLICATION_PREHEADER_UPDATE:"application_preheader_update",APPLICATION_DOMPARSER_ERROR:"application_domparser_error",APPLICATION_SYNC_DRIFT:"application_sync_drift",APPLICATION_UPDATE_ENTITY:"application_update_entity",APPLICATION_IFRAME_DRAG_EVENT:"application_iframe_drag_event",APPLICATION_HAS_AMP:"application_has_amp",APPLICATION_CANVAS_IMAGE_GET:"application_canvas_image_get",APPLICATION_PREVIEW_ALERT_SHOW:"application_preview_alert_show",APPLICATION_ATOM_INSERTED:"application_atom_inserted",APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW:"application_template_not_em_alert_show",SANDBOX_IFRAME_SETSIZE:"sandbox_iframe-setsize",SANDBOX_BLOCK_INSERT:"sandbox_block-insert",SANDBOX_ATOM_INSERT:"sandbox_atom-insert",SANDBOX_DRAG_CANCEL:"sandbox_drag-cancel",UPDATE_EDITOR_POSITION_FROM_EDITOR:"update_position_from_editor",UPDATE_EDITOR_POSITION_FROM_IFRAME:"update_position_from_iframe",SANDBOX_CHANGE_PREVIEW:"sandbox_change_preview",APPLICATION_CHANGE_PREVIEW:"application_change_preview",SANDBOX_LOCK_EDIT:"sandbox_lock_edit",SANDBOX_FLOATBLOCK_ADD:"sandbox_floatBlock_add",SANDBOX_FLOATBLOCK_REMOVE:"sandbox_floatBlock_remove",SANDBOX_FLOATBLOCK_COPY:"sandbox_floatBlock_copy",SANDBOX_FLOATBLOCK_SWAP:"sandbox_floatBlock_swap",EDITOR_CHANGE_FOCUS:"editor_change_focus",SANDBOX_RESIZED:"sandbox_resized",SANDBOX_LOCK_DISCUSS:"sandbox_lock_discuss",SANDBOX_DISCUSS_SET_TARGET:"sandbox_discuss_set_target",SANDBOX_DISCUSS_REMOVE_TARGET:"sandbox_discuss_remove_target",SANDBOX_DISCUSS_RESET:"sandbox_discuss_reset",SANDBOX_DISCUSS_GET_TARGET:"sandbox_discuss_get_target",SANDBOX_READY:"SANDBOX_READY",SANDBOX_FLOATBLOCK_WRAP:"sandbox_floatblock_wrap",SANDBOX_FLOATBLOCK_DIR:"sandbox_floatblock_dir",SANDBOX_SUBJECT_UPDATE:"sandbox_subject_update",SANDBOX_PREHEADER_UPDATE:"sandbox_preheader_update",SANDBOX_DRAG_EVENT:"sandbox_drag_event",SANDBOX_WHEEL:"sandbox_wheel",SANDBOX_TRANSLATIONS:"sandbox_send_translations",SANDBOX_SET_THEME_VARIABLES:"sandbox_send_theme_variables",SANDBOX_SET_PROJECT_FONTS:"sandbox_set_project_fonts",SANDBOX_CANVAS_IMAGE_CACHE_SETUP:"sandbox_canvas_image_cache_setup",SANDBOX_SET_ENTITY:"sandbox_set_entity",SANDBOX_INIT_START:"sandbox_init_start",SANDBOX_INITED:"sandbox_inited",SANDBOX_UPDATE_ENTITY:"sandbox_update_entity",RELOAD:"reload",SANDBOX_ADD_EXTENSIONS:"sandbox_add_extensions",SANDBOX_REMOVE_EXTENSIONS:"sandbox_remove_extensions",SANDBOX_ADD_SCRIPT:"sandbox_add_script",SANDBOX_IS_EMAIL_EMPTY:"sandbox_is_email_empty",SANDBOX_SWITCH_THEME:"sandbox_switch_theme",SANDBOX_CANVAS_HEALTH:"sandbox_canvas_health"},Fw=e=>({REORDER_ATOM:e("Reorder element"),CLONE_ATOM:e("Clone element"),REMOVE_ATOM:e("Remove element"),EDIT_ATOM:e("Edit element"),CHANGE_IMAGE:e("Change image"),CHANGE_IMAGE_EDIT:e("Edit"),CHANGE_IMAGE_STOCK:e("Stock"),CHANGE_IMAGE_CHANGETO:e("Upload"),CHANGE_IMAGE_GIF:e("GIF"),CHANGE_IMAGE_AI:e("Generate"),REORDER_BLOCK:e("Reorder block"),REORDER_BLOCK_UP:e("Move up"),REORDER_BLOCK_DOWN:e("Move down"),EDIT_BLOCK:e("Edit block"),CLONE_BLOCK:e("Clone block"),MERGE_BLOCK:e("Merge with the chosen block"),UNMERGE_BLOCK:e("Split blocks"),COPY_BLOCK_TO_CLIPBOARD:e("Copy block to clipboard"),PASTE_BLOCK_FROM_CLIPBOARD:e("Paste block from clipboard"),REMOVE_BLOCK:e("Remove block"),SAVE_TO_BLOCKS:e("Save to Blocks"),UPDATE_GLOBAL_BLOCK_IN_TEMPLATES:e("Push block update to all templates"),ADD_BLOCK:e("Add block"),ADD_EMPTY_BLOCK:e("Add an empty block"),ADD_SAVED_BLOCK:e("Add a saved block"),ADD_COMMON_BLOCK:e("Add a common block"),ADD_TEMPLATE_BLOCK:e("Add a template block"),ADD_SEARCH_BLOCK:e("Search a block"),REORDER_GROUP:e("Reorder group"),EDIT_GROUP:e("Edit group"),CLONE_GROUP:e("Clone group"),REMOVE_GROUP:e("Remove group"),ADD_GROUP:e("Add group"),LINK:e("link"),TABLE_COLUMN:e("cell"),TABLE:e("table"),FLOAT_BLOCK:e("column"),CONTAINER:e("container"),PICTURE:e("picture"),CAROUSEL:e("carousel"),ACCORDION:e("accordion"),SOCIAL:e("Social media"),VERTICAL_INDENT:e("indent"),TEXT:e("text"),BUTTON:e("button"),VAR:e("variable"),STRUCTURE:e("block"),EMAIL:e("email"),GROUP:e("group"),TYPOGRAF:e("Typograf"),COUNTDOWN:e("countdown"),ELEMENT:e("element"),VIDEO:e("video"),ELEMENT_PATH_LINK:e("Link"),ELEMENT_PATH_BLOCK:e("Block"),ELEMENT_PATH_ATOM:e("Element"),ELEMENT_PATH_TD:e("Cell"),ELEMENT_PATH_TABLE:e("Table"),ELEMENT_PATH_FLOATBLOCK:e("Column"),ELEMENT_PATH_TEXT:e("Text"),ELEMENT_PATH_DIV:e("Container"),ELEMENT_PATH_GROUP:e("Group"),ELEMENT_PATH_EMAIL:e("Email"),ELEMENT_PATH_IMG:e("Picture"),ELEMENT_PATH_VINDENT:e("Indent"),ELEMENT_PATH_BUTTON:e("Button"),ELEMENT_PATH_CAROUSEL:e("Carousel"),ELEMENT_PATH_ACCORDION:e("Accordion"),ELEMENT_PATH_SOCIAL:e("Social media"),ELEMENT_PATH_SECTION:e("Section"),TINYMCE_CHANGECASE:e("Case Change"),TINYMCE_UPPERCASE:e("Uppercase"),TINYMCE_LOWERCASE:e("Lowercase"),PASTE_HERE:e("Drop here"),INSERT_COLUMN_BEFORE_TABLE:e("Insert column before"),INSERT_COLUMN_AFTER_TABLE:e("Insert column after"),INSERT_ROW_BEFORE_TABLE:e("Insert row before"),INSERT_ROW_AFTER_TABLE:e("Insert row after"),MERGE_RIGHT_CELL_TABLE:e("Merge right cell"),MERGE_LEFT_CELL_TABLE:e("Merge left cell"),MERGE_TOP_CELL_TABLE:e("Merge top cell"),MERGE_BOTTOM_CELL_TABLE:e("Merge bottom cell"),SPLIT_CELL_TABLE:e("Split cell"),REMOVE_COLUMN_TABLE:e("Remove column"),REMOVE_ROW_TABLE:e("Remove row"),DROP_BLOCK_HINT:e("Click or drag a block")}),Z=new Rw(window.parent,!0),Hs,ei,Of=Math.random().toString(36).slice(2,8),$w=0,Fs;function Pf(e,t){const n=Hs;Hs=e;try{return t()}finally{Hs=n}}function $s(e,t){const n=ei;ei=e;try{return t()}finally{ei=n}}function Ww(){return ei}function qw(){try{return Hs?.()}catch{return}}function zw(){return Fs||(Fs=`${Of}:${++$w}`,Promise.resolve().then(()=>{Fs=void 0})),Fs}function nt(e,t){const n=qw();return Z.send(Pe.APPLICATION_DOMPARSER_ERROR,{message:e,stack:new Error().stack,...n?{mutation:n}:{},source:ei??"other",batch:zw(),instance:Of}),t}function bc(e,t){let n=t.children,r=e(t)||0;if(r!=0||!n)return r!==1;for(const o of n)if(bc(e,o)===!1)return!1;return!0}function If(e,t,n=[t]){for(;t=t.parent;)if(e(n=[t,...n])===!1)return!1;return!0}function Vw(e,t){return If(([n,r])=>{const{children:o}=n;if(o){for(let i=o.indexOf(r)+1,s=o.length;i<s;i++)if(bc(e,o[i])===!1)return!1}},t)}function pr(e,t,n){bc(r=>{r.start+=t,r.startTagEnd!==void 0&&(r.startTagEnd+=t),r.end+=t,r.endTagStart!==void 0&&(r.endTagStart+=t)},e),n&&(If(([r])=>{r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e),Vw(r=>{r.start+=n,r.startTagEnd!==void 0&&(r.startTagEnd+=n),r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e))}var Uw=e=>e.type===$.HTML?e.start-1:e.start,jw=e=>e.type===$.HTML?e.end+1:e.end;function Gw(e,t){const{start:n,end:r}=e;let o=t.findNodeAt(n);for(;o&&(Uw(o)>=n||jw(o)<=r||o.start===o.startTagEnd);)o=o.parent;return o}function Xw(e){return{start:e.start+(e.tag?.length||0)+1,end:(e.startTagEnd!==void 0?e.startTagEnd:e.start)-1}}function Zn(e){let t=e;do t=Yw(t);while(t&&t.type===$.HTML&&!t.content);return t}function Yw(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n<0)return nt("parent and child not sync",e);if(n<t.length-1)return t[n+1]||null}return null}var hr=class{constructor(e,t,n,r){L(this,"originalStart",void 0),L(this,"originalLength",void 0),L(this,"modifiedStart",void 0),L(this,"modifiedLength",void 0),this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}};function Df(e,t){return(t<<5)-t+e|0}function Kw(e,t){t=Df(149417,t);for(let n=0,r=e.length;n<r;n++)t=Df(e.charCodeAt(n),t);return t}var Bf=class{constructor(e){L(this,"source",void 0),this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=e.charCodeAt(n);return t}};function Hf(e,t,n){return new Zw(new Bf(e),new Bf(t)).ComputeDiff(n).changes}var Yr=class{static Assert(e,t){if(!e)throw new Error(t)}},Kr=class{static Copy(e,t,n,r,o){for(let i=0;i<o;i++)n[r+i]=e[t+i]}static Copy2(e,t,n,r,o){for(let i=0;i<o;i++)n[r+i]=e[t+i]}},Ff=class{constructor(){L(this,"m_changes",void 0),L(this,"m_originalStart",void 0),L(this,"m_modifiedStart",void 0),L(this,"m_originalCount",void 0),L(this,"m_modifiedCount",void 0),this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new hr(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}},Zw=class Go{constructor(t,n,r=null){L(this,"ContinueProcessingPredicate",void 0),L(this,"_originalSequence",void 0),L(this,"_modifiedSequence",void 0),L(this,"_hasStrings",void 0),L(this,"_originalStringElements",void 0),L(this,"_originalElementsOrHash",void 0),L(this,"_modifiedStringElements",void 0),L(this,"_modifiedElementsOrHash",void 0),L(this,"m_forwardHistory",void 0),L(this,"m_reverseHistory",void 0),this.ContinueProcessingPredicate=r,this._originalSequence=t,this._modifiedSequence=n;const[o,i,s]=Go._getElements(t),[a,l,c]=Go._getElements(n);this._hasStrings=s&&c,this._originalStringElements=o,this._originalElementsOrHash=i,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(t){return t.length>0&&typeof t[0]=="string"}static _getElements(t){const n=t.getElements();if(Go._isStringArray(n)){const r=new Int32Array(n.length);for(let o=0,i=n.length;o<i;o++)r[o]=Kw(n[o],0);return[n,r,!0]}return n instanceof Int32Array?[[],n,!1]:[[],new Int32Array(n),!1]}ElementsAreEqual(t,n){return this._originalElementsOrHash[t]!==this._modifiedElementsOrHash[n]?!1:this._hasStrings?this._originalStringElements[t]===this._modifiedStringElements[n]:!0}ElementsAreStrictEqual(t,n){return this.ElementsAreEqual(t,n)?Go._getStrictElement(this._originalSequence,t)===Go._getStrictElement(this._modifiedSequence,n):!1}static _getStrictElement(t,n){return typeof t.getStrictElement=="function"?t.getStrictElement(n):null}OriginalElementsAreEqual(t,n){return this._originalElementsOrHash[t]!==this._originalElementsOrHash[n]?!1:this._hasStrings?this._originalStringElements[t]===this._originalStringElements[n]:!0}ModifiedElementsAreEqual(t,n){return this._modifiedElementsOrHash[t]!==this._modifiedElementsOrHash[n]?!1:this._hasStrings?this._modifiedStringElements[t]===this._modifiedStringElements[n]:!0}ComputeDiff(t){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,t)}_ComputeDiff(t,n,r,o,i){const s=[!1];let a=this.ComputeDiffRecursive(t,n,r,o,s);return i&&(a=this.PrettifyChanges(a)),{quitEarly:s[0],changes:a}}ComputeDiffRecursive(t,n,r,o,i){for(i[0]=!1;t<=n&&r<=o&&this.ElementsAreEqual(t,r);)t++,r++;for(;n>=t&&o>=r&&this.ElementsAreEqual(n,o);)n--,o--;if(t>n||r>o){let c;return r<=o?(Yr.Assert(t===n+1,"originalStart should only be one more than originalEnd"),c=[new hr(t,0,r,o-r+1)]):t<=n?(Yr.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[new hr(t,n-t+1,r,0)]):(Yr.Assert(t===n+1,"originalStart should only be one more than originalEnd"),Yr.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[]),c}const s=[0],a=[0],l=this.ComputeRecursionPoint(t,n,r,o,s,a,i);return s[0],a[0],l!==null?l:[new hr(t,n-t+1,r,o-r+1)]}WALKTRACE(t,n,r,o,i,s,a,l,c,u,d,m,p,f,h,y,E,C){let k=null,w=null,b=new Ff,v=n,A=r,g=p[0]-y[0]-o,S=-1073741824,T=this.m_forwardHistory.length-1;do{const _=g+t;_===v||_<A&&c[_-1]<c[_+1]?(d=c[_+1],f=d-g-o,d<S&&b.MarkNextChange(),S=d,b.AddModifiedElement(d+1,f),g=_+1-t):(d=c[_-1]+1,f=d-g-o,d<S&&b.MarkNextChange(),S=d-1,b.AddOriginalElement(d,f+1),g=_-1-t),T>=0&&(c=this.m_forwardHistory[T],t=c[0],v=1,A=c.length-1)}while(--T>=-1);if(k=b.getReverseChanges(),C[0]){let _=p[0]+1,M=y[0]+1;if(k!==null&&k.length>0){const N=k[k.length-1];_=Math.max(_,N.getOriginalEnd()),M=Math.max(M,N.getModifiedEnd())}w=[new hr(_,m-_+1,M,h-M+1)]}else{b=new Ff,v=s,A=a,g=p[0]-y[0]-l,S=1073741824,T=E?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const _=g+i;_===v||_<A&&u[_-1]>=u[_+1]?(d=u[_+1]-1,f=d-g-l,d>S&&b.MarkNextChange(),S=d+1,b.AddOriginalElement(d+1,f+1),g=_+1-i):(d=u[_-1],f=d-g-l,d>S&&b.MarkNextChange(),S=d,b.AddModifiedElement(d+1,f+1),g=_-1-i),T>=0&&(u=this.m_reverseHistory[T],i=u[0],v=1,A=u.length-1)}while(--T>=-1);w=b.getChanges()}return this.ConcatenateChanges(k,w)}ComputeRecursionPoint(t,n,r,o,i,s,a){let l=0,c=0,u=0,d=0,m=0,p=0;t--,r--,i[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const f=n-t+(o-r),h=f+1,y=new Int32Array(h),E=new Int32Array(h),C=o-r,k=n-t,w=t-r,b=n-o,v=(k-C)%2===0;y[C]=t,E[k]=n,a[0]=!1;for(let A=1;A<=f/2+1;A++){let g=0,S=0;if(A>100)return null;u=this.ClipDiagonalBound(C-A,A,C,h),d=this.ClipDiagonalBound(C+A,A,C,h);for(let _=u;_<=d;_+=2){_===u||_<d&&y[_-1]<y[_+1]?l=y[_+1]:l=y[_-1]+1,c=l-(_-C)-w;const M=l;for(;l<n&&c<o&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(y[_]=l,l+c>g+S&&(g=l,S=c),!v&&Math.abs(_-k)<=A-1&&l>=E[_])return i[0]=l,s[0]=c,M<=E[_]&&A<=1448?this.WALKTRACE(C,u,d,w,k,m,p,b,y,E,l,n,i,c,o,s,v,a):null}const T=(g-t+(S-r)-A)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(g,T))return a[0]=!0,i[0]=g,s[0]=S,T>0&&A<=1448?this.WALKTRACE(C,u,d,w,k,m,p,b,y,E,l,n,i,c,o,s,v,a):(t++,r++,[new hr(t,n-t+1,r,o-r+1)]);m=this.ClipDiagonalBound(k-A,A,k,h),p=this.ClipDiagonalBound(k+A,A,k,h);for(let _=m;_<=p;_+=2){_===m||_<p&&E[_-1]>=E[_+1]?l=E[_+1]-1:l=E[_-1],c=l-(_-k)-b;const M=l;for(;l>t&&c>r&&this.ElementsAreEqual(l,c);)l--,c--;if(E[_]=l,v&&Math.abs(_-C)<=A&&l<=y[_])return i[0]=l,s[0]=c,M>=y[_]&&A<=1448?this.WALKTRACE(C,u,d,w,k,m,p,b,y,E,l,n,i,c,o,s,v,a):null}if(A<=1447){let _=new Int32Array(d-u+2);_[0]=C-u+1,Kr.Copy2(y,u,_,1,d-u+1),this.m_forwardHistory.push(_),_=new Int32Array(p-m+2),_[0]=k-m+1,Kr.Copy2(E,m,_,1,p-m+1),this.m_reverseHistory.push(_)}}return this.WALKTRACE(C,u,d,w,k,m,p,b,y,E,l,n,i,c,o,s,v,a)}PrettifyChanges(t){for(let n=0;n<t.length;n++){const r=t[n],o=n<t.length-1?t[n+1].originalStart:this._originalElementsOrHash.length,i=n<t.length-1?t[n+1].modifiedStart:this._modifiedElementsOrHash.length,s=r.originalLength>0,a=r.modifiedLength>0;for(;r.originalStart+r.originalLength<o&&r.modifiedStart+r.modifiedLength<i&&(!s||this.OriginalElementsAreEqual(r.originalStart,r.originalStart+r.originalLength))&&(!a||this.ModifiedElementsAreEqual(r.modifiedStart,r.modifiedStart+r.modifiedLength));){const c=this.ElementsAreStrictEqual(r.originalStart,r.modifiedStart);if(this.ElementsAreStrictEqual(r.originalStart+r.originalLength,r.modifiedStart+r.modifiedLength)&&!c)break;r.originalStart++,r.modifiedStart++}const l=[null];if(n<t.length-1&&this.ChangesOverlap(t[n],t[n+1],l)){t[n]=l[0],t.splice(n+1,1),n--;continue}}for(let n=t.length-1;n>=0;n--){const r=t[n];let o=0,i=0;if(n>0){const d=t[n-1];o=d.originalStart+d.originalLength,i=d.modifiedStart+d.modifiedLength}const s=r.originalLength>0,a=r.modifiedLength>0;let l=0,c=this._boundaryScore(r.originalStart,r.originalLength,r.modifiedStart,r.modifiedLength);for(let d=1;;d++){const m=r.originalStart-d,p=r.modifiedStart-d;if(m<o||p<i||s&&!this.OriginalElementsAreEqual(m,m+r.originalLength)||a&&!this.ModifiedElementsAreEqual(p,p+r.modifiedLength))break;const f=(m===o&&p===i?5:0)+this._boundaryScore(m,r.originalLength,p,r.modifiedLength);f>c&&(c=f,l=d)}r.originalStart-=l,r.modifiedStart-=l;const u=[null];if(n>0&&this.ChangesOverlap(t[n-1],t[n],u)){t[n-1]=u[0],t.splice(n,1),n++;continue}}if(this._hasStrings)for(let n=1,r=t.length;n<r;n++){const o=t[n-1],i=t[n],s=i.originalStart-o.originalStart-o.originalLength,a=o.originalStart,l=i.originalStart+i.originalLength,c=l-a,u=o.modifiedStart,d=i.modifiedStart+i.modifiedLength,m=d-u;if(s<5&&c<20&&m<20){const p=this._findBetterContiguousSequence(a,c,u,m,s);if(p){const[f,h]=p;(f!==o.originalStart+o.originalLength||h!==o.modifiedStart+o.modifiedLength)&&(o.originalLength=f-o.originalStart,o.modifiedLength=h-o.modifiedStart,i.originalStart=f+s,i.modifiedStart=h+s,i.originalLength=l-i.originalStart,i.modifiedLength=d-i.modifiedStart)}}}return t}_findBetterContiguousSequence(t,n,r,o,i){if(n<i||o<i)return null;const s=t+n-i+1,a=r+o-i+1;let l=0,c=0,u=0;for(let d=t;d<s;d++)for(let m=r;m<a;m++){const p=this._contiguousSequenceScore(d,m,i);p>0&&p>l&&(l=p,c=d,u=m)}return l>0?[c,u]:null}_contiguousSequenceScore(t,n,r){let o=0;for(let i=0;i<r;i++){if(!this.ElementsAreEqual(t+i,n+i))return 0;o+=this._originalStringElements[t+i].length}return o}_OriginalIsBoundary(t){return t<=0||t>=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[t])}_OriginalRegionIsBoundary(t,n){if(this._OriginalIsBoundary(t)||this._OriginalIsBoundary(t-1))return!0;if(n>0){const r=t+n;if(this._OriginalIsBoundary(r-1)||this._OriginalIsBoundary(r))return!0}return!1}_ModifiedIsBoundary(t){return t<=0||t>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[t])}_ModifiedRegionIsBoundary(t,n){if(this._ModifiedIsBoundary(t)||this._ModifiedIsBoundary(t-1))return!0;if(n>0){const r=t+n;if(this._ModifiedIsBoundary(r-1)||this._ModifiedIsBoundary(r))return!0}return!1}_boundaryScore(t,n,r,o){return(this._OriginalRegionIsBoundary(t,n)?1:0)+(this._ModifiedRegionIsBoundary(r,o)?1:0)}ConcatenateChanges(t,n){const r=[];if(t.length===0||n.length===0)return n.length>0?n:t;if(this.ChangesOverlap(t[t.length-1],n[0],r)){const o=new Array(t.length+n.length-1);return Kr.Copy(t,0,o,0,t.length-1),o[t.length-1]=r[0],Kr.Copy(n,1,o,t.length,n.length-1),o}else{const o=new Array(t.length+n.length);return Kr.Copy(t,0,o,0,t.length),Kr.Copy(n,0,o,t.length,n.length),o}}ChangesOverlap(t,n,r){if(Yr.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),Yr.Assert(t.modifiedStart<=n.modifiedStart,"Left change is not less than or equal to right change"),t.originalStart+t.originalLength>=n.originalStart||t.modifiedStart+t.modifiedLength>=n.modifiedStart){const o=t.originalStart;let i=t.originalLength;const s=t.modifiedStart;let a=t.modifiedLength;return t.originalStart+t.originalLength>=n.originalStart&&(i=n.originalStart+n.originalLength-t.originalStart),t.modifiedStart+t.modifiedLength>=n.modifiedStart&&(a=n.modifiedStart+n.modifiedLength-t.modifiedStart),r[0]=new hr(o,i,s,a),!0}else return r[0]=null,!1}ClipDiagonalBound(t,n,r,o){if(t>=0&&t<o)return t;const i=r,s=o-r-1,a=n%2===0;return t<0?a===(i%2===0)?0:1:a===(s%2===0)?o-1:o-2}};function Ws(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var zt=class{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,n,r){L(this,"oldPosition",void 0),L(this,"oldText",void 0),L(this,"newPosition",void 0),L(this,"newText",void 0),this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${Ws(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Ws(this.oldText)}")`:`(replace@${this.oldPosition} "${Ws(this.oldText)}" with "${Ws(this.newText)}")`}};function en(e,t){return e===null||e.length===0?t:new Qw(e,t).compress()}var Qw=class Xn{constructor(t,n){L(this,"_prevEdits",void 0),L(this,"_currEdits",void 0),L(this,"_result",void 0),L(this,"_resultLen",void 0),L(this,"_prevLen",void 0),L(this,"_prevDeltaOffset",void 0),L(this,"_currLen",void 0),L(this,"_currDeltaOffset",void 0),this._prevEdits=t,this._currEdits=n,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let t=0,n=0,r=this._getPrev(t),o=this._getCurr(n);for(;t<this._prevLen||n<this._currLen;){if(r===null){if(o===null)break;this._acceptCurr(o),o=this._getCurr(++n);continue}if(o===null){this._acceptPrev(r),r=this._getPrev(++t);continue}if(o.oldEnd<=r.newPosition){this._acceptCurr(o),o=this._getCurr(++n);continue}if(r.newEnd<=o.oldPosition){this._acceptPrev(r),r=this._getPrev(++t);continue}if(o.oldPosition<r.newPosition){const[l,c]=Xn._splitCurr(o,r.newPosition-o.oldPosition);this._acceptCurr(l),o=c;continue}if(r.newPosition<o.oldPosition){const[l,c]=Xn._splitPrev(r,o.oldPosition-r.newPosition);this._acceptPrev(l),r=c;continue}let s,a;if(o.oldEnd===r.newEnd)s=r,a=o,r=this._getPrev(++t),o=this._getCurr(++n);else if(o.oldEnd<r.newEnd){const[l,c]=Xn._splitPrev(r,o.oldLength);s=l,a=o,r=c,o=this._getCurr(++n)}else{const[l,c]=Xn._splitCurr(o,r.newLength);s=r,a=l,r=this._getPrev(++t),o=c}this._result[this._resultLen++]=new zt(s.oldPosition,s.oldText,a.newPosition,a.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=a.newLength-a.oldLength}const i=Xn._merge(this._result);return Xn._removeNoOps(i)}_acceptCurr(t){this._result[this._resultLen++]=Xn._rebaseCurr(this._prevDeltaOffset,t),this._currDeltaOffset+=t.newLength-t.oldLength}_getCurr(t){return t<this._currLen?this._currEdits[t]:null}_acceptPrev(t){this._result[this._resultLen++]=Xn._rebasePrev(this._currDeltaOffset,t),this._prevDeltaOffset+=t.newLength-t.oldLength}_getPrev(t){return t<this._prevLen?this._prevEdits[t]:null}static _rebaseCurr(t,n){return new zt(n.oldPosition-t,n.oldText,n.newPosition,n.newText)}static _rebasePrev(t,n){return new zt(n.oldPosition,n.oldText,n.newPosition+t,n.newText)}static _splitPrev(t,n){const r=t.newText.substr(0,n),o=t.newText.substr(n);return[new zt(t.oldPosition,t.oldText,t.newPosition,r),new zt(t.oldEnd,"",t.newPosition+n,o)]}static _splitCurr(t,n){const r=t.oldText.substr(0,n),o=t.oldText.substr(n);return[new zt(t.oldPosition,r,t.newPosition,t.newText),new zt(t.oldPosition+n,o,t.newEnd,"")]}static _merge(t){if(t.length===0)return t;const n=[];let r=0,o=t[0];for(let i=1;i<t.length;i++){const s=t[i];o.oldEnd===s.oldPosition?o=new zt(o.oldPosition,o.oldText+s.oldText,o.newPosition,o.newText+s.newText):(n[r++]=o,o=s)}return n[r++]=o,n}static _removeNoOps(t){if(t.length===0)return t;const n=[];let r=0;for(let o=0;o<t.length;o++){const i=t[o];i.oldText!==i.newText&&(n[r++]=i)}return n}};function $f(e){return new zt(e.newPosition,e.newText,e.oldPosition,e.oldText)}function Bn(e){return e.map($f)}function Jw(e,t,n){let r=0;const o=e.start===e.end;for(const i of t){const s=i.newLength-i.oldLength;if(i.oldLength===0){const a=i.oldPosition;if(o&&a===e.start)r+=n==="after"?s:0;else{if(e.start<a&&a<e.end)return null;a<=e.start&&(r+=s)}continue}if(o){if(e.start>=i.oldEnd)r+=s;else if(e.start>i.oldPosition)return null;continue}if(e.start>=i.oldEnd)r+=s;else if(e.end>i.oldPosition)return null}return{start:e.start+r,end:e.end+r}}function Wf(e,t,n){if(!t.length)return[...e];const r=[];let o=0;for(const i of e){const s=Jw({start:i.oldPosition,end:i.oldEnd},t,n);if(!s)return null;r.push(new zt(s.start,i.oldText,s.start+o,i.newText)),o+=i.newLength-i.oldLength}return r}function qf(e,t,n=0){const r=e.range;return new zt(e.range.start,typeof t=="string"?t.substring(r.start,r.end):t.getText(r),r.start+n,e.text)}function Zr(e,t){let n=0;return e.map(({text:r,range:{start:o,end:i}})=>{let s=n;return n+=r.length-(i-o),qf({text:r,range:{start:o,end:i}},t,s)})}function e0(e){return{range:{start:e.oldPosition,end:e.oldEnd},text:e.newText}}function gr(e){return e.map(t=>e0(t))}function t0(e,t=yc(e)){const n=e.getLength(),{start:r,end:o}=t;return r>n||o<0?null:{start:r,end:o}}var mq=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function n0(e,{start:t,end:n}){return{start:t,end:n+(e.newLength-e.oldLength)}}function yc(e){return{start:0,end:e.getLength()}}function r0(e,t,n){return`${e.substring(0,n.start)}${t}${e.substring(n.end)}`}function ti(e,t){const n=[e];for(let r=t.length-1;r>=0;r--){const{text:o,range:i}=t[r],s=n[0];n.splice(0,1,s.substring(0,i.start),o,s.substring(i.end))}return n.join("")}function o0(e,t){return t=qs(t).sort(({range:n},{range:r})=>n.start-r.start),ti(e,t)}function ni(e,t){return e>=t.start&&e<=t.end}function qs(e,t){e=[...e];let n=e.length;if(n<=1)return e;e=e.sort(({range:r},{range:o})=>r.start-o.start);for(let r=0;r<n;r++){let o=e[r],i=e[r].range;for(let s=r+1;s<n;s++){const a=e[s];let l=e[s].range,c;if(ni(i.start,l)&&ni(i.start,l))c=l;else if(ni(l.start,i))ni(l.end,i)?c=i:c={start:i.start,end:l.end};else if(ni(l.end,i))c={start:l.start,end:i.end};else continue;const u=o.text;let d=l.start-i.start+u.length,m=l.end-i.start+u.length;const p=r0(u,a.text,{start:d,end:m});e[r]=o={range:i=c,text:p},e.splice(s--,1),n--}}return e}function i0(e,t){if(e.length<=1)return e[0]||null;e=qs(e);const n=e.reduce((r,{range:o})=>({start:Math.min(r.start,o.start),end:Math.max(r.end,o.end)}),{start:Number.MAX_VALUE,end:Number.MIN_VALUE});return{text:ti(t.substring(n.start,n.end),e.map(({range:r,text:o})=>({text:o,range:{start:r.start-n.start,end:r.end-n.start}}))),range:n}}function s0(e,t){const n=Bn(e),r=i0(gr(n),t);if(r){const o=qf(r,t);return $f(o)}return null}function a0(e,{range:t,text:n}){const r=e.getText(t);return Hf(r,n,!0).map(o=>({range:{start:t.start+o.originalStart,end:t.start+o.originalStart+o.originalLength},text:n.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)}))}function l0({oldText:e,newText:t,oldPosition:n,newPosition:r}){return Hf(e,t,!0).map(o=>new zt(n+o.originalStart,e.substring(o.originalStart,o.originalStart+o.originalLength),r+o.modifiedStart,t.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)))}var c0=class{constructor(e,t){L(this,"index",void 0),L(this,"values",void 0),L(this,"type","insert"),this.index=e,this.values=t}},u0=class{constructor(e,t){L(this,"index",void 0),L(this,"howMany",void 0),L(this,"type","remove"),this.index=e,this.howMany=t}},d0=class{constructor(e,t,n){L(this,"from",void 0),L(this,"to",void 0),L(this,"howMany",void 0),L(this,"type","move"),this.from=e,this.to=t,this.howMany=n}};function m0(e,t){return e===t}function f0(e,t,n=m0){for(var r=e.length,o=t.length,i=[],s=Object.create(null),a=Object.create(null),l=0;l<r;l++)for(var c=e[l],u=0;u<o;u++)if(!a[u]&&n(c,t[u])){var d=l,m=u,p=0;do s[l++]=a[u++]=!0,p++;while(l<r&&u<o&&n(e[l],t[u])&&!a[u]);i.push(new d0(d,m,p)),l--;break}var f=[];for(l=0;l<r;){if(s[l]){l++;continue}for(var h=l,p=0;l<r&&!s[l++];)p++;f.push(new u0(h,p))}for(var y=[],u=0;u<o;){if(a[u]){u++;continue}for(var h=u,p=0;u<o&&!a[u++];)p++;var E=t.slice(h,h+p);y.push(new c0(h,E))}var C=y.length,k=f.length,w=i.length,b,v,A=0;for(b=0;b<k;b++){var g=f[b];for(g.index-=A,A+=g.howMany,v=0;v<w;v++){var S=i[v];S.from>=g.index&&(S.from-=g.howMany)}}for(b=C;b--;){var T=y[b],p=T.values.length;for(v=w;v--;){var S=i[v];S.to>=T.index&&(S.to-=p)}}for(b=w;b-- >1;){var S=i[b];if(S.to!==S.from)for(v=b;v--;){var _=i[v];_.to>=S.to&&(_.to-=S.howMany),_.to>=S.from&&(_.to+=S.howMany)}}var M=[];for(b=0;b<w;b++){var S=i[b];if(S.to!==S.from)for(M.push(S),v=b+1;v<w;v++){var N=i[v];N.from>=S.from&&(N.from-=S.howMany),N.from>=S.to&&(N.from+=S.howMany)}}return[...f,...M,...y]}var zf=class{constructor(){L(this,"_byKey",new Map),L(this,"_byValue",new Map)}set(e,t){this._byKey.set(e,t),this._byValue.set(t,e)}getByKey(e){return this._byKey.get(e)}getByValue(e){return this._byValue.get(e)}delete(e){const t=this._byKey.has(e);if(t){const n=this._byKey.get(e);this._byKey.delete(e),this._byValue.delete(n)}return t}deleteByValue(e){const t=this._byValue.has(e);if(t){const n=this._byValue.get(e);this._byValue.delete(e),this._byKey.delete(n)}return t}get size(){return this._byKey.size}},ue;(function(e){function t(d,m,p){return{type:"Add",node:m,nextSibling:p,parent:d}}e.add=t;function n(d){return{type:"Remove",node:d}}e.remove=n;function r(d,m,p){return{type:"Attribute",node:d,name:m,value:p}}e.attribute=r;function o(d,m,p){return p?{type:"Update",prev:d,next:m,soft:p}:{type:"Update",prev:d,next:m}}e.update=o;function i(d,m,p,f){return[{type:"Remove",node:d},{type:"Add",node:p,nextSibling:f,parent:m,replaces:d}]}e.recreate=i;function s(d,m,p){return{type:"Move",node:m,nextSibling:p,parent:d}}e.move=s;function a(d,m){return{type:"Set",node:d,data:m}}e.set=a;function l(d,m,p){return{type:"ClassList",node:d,addedClasses:m,removedClasses:p}}e.classList=l;function c(d,m){return{type:"Style",node:d,value:m}}e.style=c;function u(d,m){return{type:"Hidden",node:d,value:m}}e.hidden=u})(ue||(ue={}));function Vf(e,t){return e.push(t),{dispose:()=>{const n=e.indexOf(t);n!==-1&&e.splice(n,1)}}}var Uf=[],jf=[];function p0(e){return Vf(Uf,e)}function vc(e){return e?Uf.some(t=>t(e)):!1}function h0(e){return Vf(jf,e)}function g0(e){return jf.some(t=>t(e))}function b0(e,t){const n=e.attributes||{},r=t.attributes||{},o=e.attributeNames,i=t.attributeNames,s=o.length,a=i.length,l=[];let c=0;for(;c<s;c++){const u=o[c];if(u!==i[c]){for(let d=c;d<s;d++){const m=o[d];l.push(ue.attribute(t,m,void 0))}break}else r[u]!==n[u]&&l.push(ue.attribute(t,u,r[u]))}for(;c<a;c++){const u=i[c];l.push(ue.attribute(t,u,r[u]))}return l}function y0(e){let t=[];const n=e.children.filter(o=>o.type!==$.HTML||!!o.content);let r;for(let o=n.length-1;o>=0;o--)t.push(ue.add(e,n[o],r)),r=n[o];return t}function v0(e){return ue.remove(e)}var E0=new Set(["head","body","html"]),S0=e=>e.type===$.ROOT||e.type===$.DOCTYPE||e.type===$.ELEMENT&&e.tag&&E0.has(e.tag.toLowerCase());function Gf(e){const t=new zf,n=Object.create(null);for(const r of e){const o=String(r.type===$.ELEMENT?r.tag:r.type)+(!S0(r)&&r.start===r.end?"_hidden":"");let i="";r.type===$.ELEMENT&&r.attributes?.id?i=`id_${r.attributes.id}`:i=n[o]=(n[o]||0)+1,t.set(`${o}_${i}`,r)}return t}function Ec(e,t,n=!1,r=mc()){let o=[];const i=Gf(e.children),s=Gf(t.children);for(let d=e.children.length-1;d>=0;d--){const m=e.children[d];if(m.type===$.ELEMENT&&m.start===m.end){const p=i.getByValue(m);if(!s.getByKey(p)){let f=!1;for(let h=d+1;d<e.children.length;d++)if(e.children[h]){const y=i.getByValue(m),E=s.getByKey(y);if(E){const C=E.start,k=m.clone();t.children.splice(t.children.indexOf(E),0,k),pr(k,C-m.start),k.parent=t,s.set(p,k),f=!0;break}}if(!f){const h=t.endTagStart===void 0?t.end:t.endTagStart,y=m.clone();t.children.push(y),s.set(p,y),pr(y,h-m.start),y.parent=t}}}}const a=e.children.filter(d=>d.type!==$.HTML||!!d.content),l=t.children.filter(d=>d.type!==$.HTML||!!d.content),c=f0(a,l,(d,m)=>i.getByValue(d)===s.getByValue(m)),u=new Set;for(const d of c)switch(d.type){case"insert":{const m=d.index;let p=a[m];for(const f of d.values.reverse())a.splice(m,0,f),u.add(f),o.push(ue.add(t,f,p)),p=f;break}case"remove":{const m=a.splice(d.index,d.howMany);for(const p of m)o.push(ue.remove(p));break}case"move":{const m=a.splice(d.from,d.howMany);let p=a[d.to];a.splice(d.to,0,...m);for(const f of m.reverse()){const h=i.getByValue(f),y=s.getByKey(h);u.add(y),o=[...o,...wc(f,y,n,r)],o.push(ue.move(t,y,p)),p=f}break}}l.length!==a.length&&nt("error while sync");for(let d=l.length-1;d>=0;d--){const m=l[d];u.has(m)||(o=[...o,...wc(a[d],m,n,r)])}return o}function Sc(e){return e.type===$.ELEMENT&&vc(e.tag)}function wc(e,t,n=!1,r=mc()){if(e.type===t.type&&!(e.isDirty||t.isDirty)){if(Sc(e)&&e.tag===t.tag){if(fr(e,!1,r)===fr(t,!1,r))return[ue.update(e,t,n),...Ec(e,t,!0,r)]}else if((e.type===$.ELEMENT||e.type===$.ROOT)&&e.tag===t.tag)return[ue.update(e,t,n),...b0(e,t),...Ec(e,t,n,r)];if(e.type===$.HTML||e.type===$.COMMENT)return e.content===t.content?[ue.update(e,t,n)]:[ue.update(e,t,n),ue.set(t,t.content)]}return!e.parent||!t.parent?nt("cannot replace document",[]):Sc(e)&&e.tag===t.tag?ue.recreate(e,t.parent,t,Zn(t)||void 0):[ue.remove(e),ue.add(t.parent,t,Zn(t)||void 0)]}var Qr="FROM_DOM",Jr="FROM_REMOTE",w0=/<\/.*>/gi,C0=class extends Ee{constructor(e,t){super(),L(this,"_baseDocument",void 0),L(this,"_createRoot",void 0),L(this,"_beforeTextChangeEmitter",this.addDisposable(new Me)),L(this,"_onTextChangeEmitter",this.addDisposable(new Me)),L(this,"_onMutateEmitter",this.addDisposable(new Me)),L(this,"_beforeRefreshEmitter",this.addDisposable(new Me)),L(this,"_onRefreshEmitter",this.addDisposable(new Me)),L(this,"_root",new wt(0,0,[])),L(this,"_applyingMutation",void 0),L(this,"beforeTextChange",this._beforeTextChangeEmitter.event),L(this,"beforeRefresh",this._beforeRefreshEmitter.event),L(this,"onTextChange",this._onTextChangeEmitter.event),L(this,"onRefresh",this._onRefreshEmitter.event),L(this,"onMutate",this._onMutateEmitter.event),this._baseDocument=e,this._createRoot=t,this._baseDocument.onChanged(this._onTextChange.bind(this));const n=this._root=new wt(0,0,[]);n.type=$.ROOT}get root(){return this._root}contains(e){return e.root===this.root}isAttached(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t===this.root}get applyingMutation(){return this._applyingMutation}initialize(e,t){const n=this._root;this._beforeRefreshEmitter.fire();let{roots:r}=Xr(e),o=this._root=this._createRoot?this._createRoot(r,e):new wt(0,e.length,r);o.type=$.ROOT,this._createRoot||r.forEach(i=>i.parent=o),t||this._onRefreshEmitter.fire(n?Ec(n,o):y0(o))}_onTextChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=s0(t,this._baseDocument.getText());if(n)try{this._beforeTextChangeEmitter.fire(),$s("text",()=>this.replaceWithHtml(n,Jr))}finally{this._onTextChangeEmitter.fire()}}}insertBefore(e,t,n,r){if(t.parent){if(t.parent===e&&Zn(t)===n)return t;this.remove(t,r)}const o=this.contains(e),i=fc(t),s=e.children,a=n?s.indexOf(n):s.length;if(a<0)return nt("referenced node is not a child of parent node",t);s.splice(a,0,t);const l=n?n.start:e.endTagStart===void 0?e.end:e.endTagStart;return t.parent=e,pr(t,l-t.start,i.length),o&&(r!=="FROM_DOM"&&this._onMutateEmitter.fire([ue.add(e,t,n||void 0)]),r!=="FROM_REMOTE"&&this._baseDocument.applyEdits(r,[{text:i,range:{start:l,end:l}}])),t}getContext(e){return e.closest(t=>vc(t.tag))}replaceWithHtml(e,t){const n=this._baseDocument,r=c=>{const u=this.getContext(c);if(u)return u.isDirty=!0,Promise.resolve().then(()=>{u.isDirty=!1}),!1;if(c.type!==$.HTML){if(!c.closed)return!1}else return!c.content||!w0.test(c.content);return!0};if(!this._root)return this.initialize(n.getText());let o={start:e.oldPosition,end:e.oldEnd},i=Gw(o,this._root);if(!i)return this.initialize(n.getText());let s,a,l;do{const c=n0(e,i);s=this._baseDocument.getText(c),[a,...l]=Xr(s).roots}while((!a||l.length||!r(i)||!r(a)||a.end-a.start!==s.length)&&(i=i.parent));if(!i||!i.parent)return this.initialize(n.getText());this.replaceChild(i.parent,{node:a,text:s},i,t)}replaceChild(e,t,n,r){const{text:o,node:i}=t,s=e.children,a=s.indexOf(n);if(a<0)return nt("referenced node is not a child of parent node",i);s.splice(a,1,i);const l=o.length-(n.end-n.start);return i.parent=e,pr(i,n.start-i.start,l),this._baseDocument.getText(i)!==o?(nt("Error while sync"),i):(r!=="FROM_DOM"&&this._onMutateEmitter.fire(wc(n,i)),n.parent=void 0,i)}remove(e,t){const n=this.contains(e),r=e.parent;if(!r)return nt("node is not in tree");const o=r.children,i=o.indexOf(e);if(i<0)return nt("referenced node is not a child of parent node");const s=e.end-e.start;pr(e,0,-s),o.splice(i,1),n&&(t!=="FROM_DOM"&&this._onMutateEmitter.fire([v0(e)]),t!=="FROM_REMOTE"&&this._baseDocument.applyEdits(t,[{text:"",range:{start:e.start,end:e.end}}])),e.parent=void 0}setAttribute(e,t,n,r){const o=this.contains(e),i=e.attributes||(e.attributes=Object.create(null));if(typeof n=="string"?i[t]=n:delete i[t],e.start===e.startTagEnd)return;const s=Af(e),a=e.startTagEnd===void 0?0:e.startTagEnd-e.start-(e.tag?.length||0)-2,l=Xw(e),c=s.length-a,u=e.start;pr(e,c,c),e.start=u,o&&this._baseDocument.applyEdits(r,[{text:s,range:l}])}setContent(e,t,n){const r=this.contains(e),o=e.start,i=e.end;e.content=t;const s=e.end-e.start;if(!s)return;const a=fc(e,o),l=a.length-s;pr(e,0,l),r&&this._baseDocument.applyEdits(n,[{text:a,range:{start:o,end:i}}])}replaceWith(e,t,n){const r=e.parent;if(r){let o=Zn(e);this.remove(e,n);for(let i=t.length-1;i>=0;i--){const s=t[i];this.insertBefore(r,s,o,n),o=s}}return t}replaceWithEx(e,t,n){if(typeof t=="string"){const i=Xr(t).roots;i.length!==1&&nt("Error while replacing with string"),t=i[0]}const r=e.children;this.replaceWith(e,[t],n);let o=null;for(let i=r.length-1;i>=0;i--){let s=r[i];this.insertBefore(t,s,o,n),o=s}return t}setHidden(e,t,n){t?e.parent&&this.remove(e,n):this.replaceWith(e,[...e.children],n)}applyMutations(e){this._baseDocument.beginUpdate();try{for(const t of e)switch(this._applyingMutation=t,t.type){case"Add":this.insertBefore(t.parent||this.root,t.node,t.nextSibling||null,Qr);break;case"Remove":this.remove(t.node,Qr);break;case"Set":this.setContent(t.node,t.data,Qr);break;case"Hidden":this.setHidden(t.node,t.value,Qr);break;case"Attribute":this.setAttribute(t.node,t.name,t.value===void 0?null:t.value,Qr)}}finally{this._applyingMutation=void 0,this._baseDocument.endUpdate()}}getNodeByPosition(e){return this._root?.findNodeAt(e)}};function Cc(e){if(e){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",e),t.firstChild||document.createTextNode("")}else return document.createTextNode("")}var eo,br;function A0(e){const t=eo;return eo=e,()=>{eo===e&&(eo=t)}}function T0(e){const t=br;return br=e,()=>{br===e&&(br=t)}}function Xf(e,t,n){return eo?eo(e,t,n):n}function _0(){return br!==void 0}function Yf(e,t,n){return br?br(e,t,n):n}var Ac;function k0(){return Ac||(Ac=document.implementation.createHTMLDocument("")),Ac}function L0(e,t){let n;switch(t?.toLowerCase()){case"tr":n=e.createElement("table");break;case"td":n=e.createElement("tr");break;case"head":case"body":n=e.createElement("html");break;case"documenttype":case"html":{const r=e.implementation.createHTMLDocument();for(const o of[...r.childNodes])o.remove();return r}default:n=e.createElement("div")}return n}var N0=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),x0=new Set(["script","style","xmp"]);function M0(e,t){return!(t&&x0.has(t.toLowerCase())||N0.has(e.toLowerCase()))}var R0=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1};function Kf(e,t,n){let r=e.tagName.toLowerCase();r==="html"&&(r="div");const o=`<${r} ${t}="${n}"/>`,i=L0(k0(),r);if(i instanceof Document)return;i.innerHTML=o;const s=i.querySelector(r);if(!s)throw new Error("targetElement is not defined");const a=s.getAttributeNode(t);a&&e.setAttributeNode(a.cloneNode())}function Hn(e,t,n){try{M0(t,e.tagName)&&!R0(n)?e.setAttribute(t,n):Kf(e,t,n)}catch{Kf(e,t,n)}}function zs(e,t=!0){const n=e.content;switch(e.type){case $.ROOT:{const r=document.implementation.createHTMLDocument();for(const o of[...r.childNodes])r.removeChild(o);if(t)for(const o of e.children)r.appendChild(zs(o));return r}case $.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case $.COMMENT:return document.createComment(n||"");case $.ELEMENT:if(e.tag){const r=document.createElement(e.tag);if(Object.defineProperty(r,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const o of e.attributeNames){const i=e.attributes[o];try{const s=Xf(r,o,typeof i=="string"?i:"");s!==null&&Hn(r,o,s)}catch{}}if(t)for(const o of e.children)r.appendChild(zs(o));return r}return document.createTextNode("<");case $.HTML:return Cc(n||"");default:throw new Error("unsupported node")}}function Te(e){return Xr(e).roots.map(t=>zs(t))}function Qn(e,t){e.replaceChildren(...Te(t))}function qe(e,t,n){const r=Te(n);switch(t){case"afterend":e.after(...r);break;case"afterbegin":e.prepend(...r);break;case"beforeend":e.append(...r);break;case"beforebegin":e.before(...r)}}var O0=4,P0=3,I0=80,Zf={Add:"insertBefore",Remove:"remove",Set:"set",Hidden:"hidden",Attribute:"attribute",Update:"update",Move:"move"},D0={[$.HTML]:"text",[$.ELEMENT]:"element",[$.ROOT]:"root",[$.COMMENT]:"comment",[$.DOCTYPE]:"doctype",[$.ADVANCED]:"advanced"},B0=new Set(["head","body"]);function Tc(e){return(e??"").replace(/^(['"])(.*)\1$/s,"$2")}function Qf(e,t,n,r){const o=n.split(/\s+/).filter(Boolean).slice(0,P0);return(e+(t?`#${t}`:"")+o.map(i=>`.${i}`).join("")+(r?`[em=${r}]`:"")).slice(0,I0)}function H0(e){if(!e.tag)return`#${e.type}`;const t=e.attributes??{};return Qf(e.tag,Tc(t.id),Tc(t.class),Tc(t.em))}function Jf(e){return e instanceof Element?Qf(e.localName,e.id,e.getAttribute("class")??"",e.getAttribute("em")??""):e.nodeName.toLowerCase()}function _c(e,t,n){const r=[];let o=e;for(;o&&r.length<O0;)r.unshift(n(o)),o=t(o);return r.join(" > ")}function F0(e){let t,n=e;for(;;){const r=n.tag?.toLowerCase();if(!t&&r&&B0.has(r)?t=r:r==="html"&&(t??(t="html")),!n.parent)break;n=n.parent}return n.type!==$.ROOT?"outside":t??"top"}function kc(e,t,n){const r=t(e);return{path:_c(e,o=>o.parent,H0),inTree:n(e),inDom:!!r?.isConnected,...r?{domPath:_c(r,o=>o.parentNode,Jf)}:{},inMap:!!r,hasParent:!!e.parent,kind:D0[e.type]??String(e.type),root:F0(e)}}function ep(e,t,n){if(!e)return;const r=i=>kc(i,t,n);if(e.type==="Update")return{type:Zf.Update,node:r(e.prev),...e.next.parent?{parent:r(e.next.parent)}:{}};if(!("node"in e))return;const o={type:Zf[e.type]??e.type,node:r(e.node)};return e.type==="Add"||e.type==="Move"?(e.parent&&(o.parent=r(e.parent)),e.nextSibling&&(o.reference=r(e.nextSibling))):e.node.parent&&(o.parent=r(e.node.parent)),o}function Lc(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t.type===$.ROOT}function $0(e,t,n,r){const o=s=>kc(s,a=>r.getByNode(a),Lc),i=_c(e,s=>s.parentNode,Jf);return{type:"insertBefore",node:{path:i,inTree:!1,inDom:e.isConnected,domPath:i},parent:o(t),reference:o(n)}}function W0(e,t){const n=r=>kc(r,o=>t.getByNode(o),Lc);return{type:"remove",node:n(e),...e.parent?{parent:n(e.parent)}:{}}}function q0(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}function tp(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var np=Object.create(null);function rp(e,t){const n=np[e]||(np[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[q0(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function vn(e){return e.nodeType===Node.ELEMENT_NODE}function op(e){return vn(e)?e.tagName==="AMP-IMG"?!0:rp(e.tagName.toLowerCase(),"src"):!1}function Nc(e){return vn(e)&&!e.ownerSVGElement}function z0(e){return e.tagName==="IMG"}function V0(e){return e.tagName==="FORM"}function U0(e){return e.tagName==="SCRIPT"}function j0(e){return e.tagName==="STYLE"}function xc(e){return e.nodeType===Node.DOCUMENT_NODE}function ip(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var ri;(function(e){function t(m){return m.constructor.name==="CSSStyleRule"}e.isStyleRule=t;function n(m){return m.constructor.name==="CSSImportRule"}e.isImportRule=n;function r(m){return m.constructor.name==="CSSMediaRule"}e.isMediaRule=r;function o(m){return m.constructor.name==="CSSFontFaceRule"}e.isFontFaceRule=o;function i(m){return m.constructor.name==="CSSPageRule"}e.isPageRule=i;function s(m){return m.constructor.name==="CSSKeyframesRule"}e.isKeyframesRule=s;function a(m){return m.constructor.name==="CSSKeyframeRule"}e.isKeyframeRuleRule=a;function l(m){return m.constructor.name==="CSSNamespaceRule"}e.isNamespaceRule=l;function c(m){return m.constructor.name==="CSSCounterStyleRule"}e.isCounterStyleRule=c;function u(m){return m.constructor.name==="CSSSupportsRule"}e.isSupportsRule=u;function d(m){return m.constructor.name==="CSSFontFeatureValuesRule"}e.isFontFeatureValuesRuleRule=d})(ri||(ri={}));function Vs(e){return e.nodeType===Node.COMMENT_NODE}function oi(e){return e.nodeType===Node.TEXT_NODE}function G0(e){return e.tagName==="TABLE"}async function X0(e,t=5e3){return typeof e.complete<"u"&&!e.complete?new Promise((n,r)=>{setTimeout(n,t),e.onload=()=>n(getComputedStyle(e)),e.onerror=o=>{}}):getComputedStyle(e)}function Vt(e){if(vn(e))return sp(e);if(xc(e))return[...e.childNodes].map(n=>Vt(n)).join("");if(ip(e))return tp(e);const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function Y0(e){const t=e.tagName.toLowerCase();let n="";for(const r of e.attributes){const o=r.name,i=r.value;n+=i===""&&o!=="em"&&!rp(t,o)?` ${o}`:` ${o}="${i.replaceAll('"',"'")}"`}return n}function Ct(e){let t="";for(const n of e.childNodes)t+=Vt(n);return t}function sp(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),n=Y0(e);return uc.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${n}/>`:`<${t}${n}>`:j0(e)?`<${t}${n}>${e.innerHTML}</${t}>`:`<${t}${n}>${Ct(e)}</${t}>`}function K0(e){return typeof e=="string"?e:""}function ap(e,t,n){if(n&&e.type===$.DOCTYPE&&n?.type!==$.ROOT){const o=document.createTextNode(e.content||"");return t.set(e,o),o}const r=zs(e,!1);t.set(e,r);for(const o of e.children){const i=ap(o,t,e);r.appendChild(i)}return r}function Z0(e,t,n=Lc){let r,o;const i=new Map,s=()=>{const l=ep(r,c=>t.getByNode(c)||i.get(c),n);return l&&{...l,stage:"dom",...o?{cause:o}:{}}},a=l=>{o=l;try{nt("Element node not in tree")}finally{o=void 0}};return Pf(s,()=>Q0(e,t,i,l=>r=l,a))}function Q0(e,t,n,r,o){const i=[],s=new Map,a=c=>t.getByNode(c)||n.get(c),l=c=>{if(c){const u=c.lastChild;let d=(u?a(u)?.nextSibling:a(c)?.firstChild)||void 0;for(;d&&s.has(d);)d=d.nextSibling||void 0;return d?.parentNode===a(c)?d:void 0}};for(const c of e)switch(r(c),c.type){case"Add":{let{node:u,nextSibling:d}=c;const m=u.parent;if(m){const p=ap(u,n,m);if(m.type===$.ROOT)i.push(ue.add(null,p,d&&a(d)));else{const f=a(m);if(f){let h;for(;d;){const y=n.get(d);if(y){h=y;break}let E=t.getByNode(d);if(E&&!s.has(E)&&f.contains(E)){for(h=E;E.parentNode!==f&&E.parentNode;)E=E.parentNode,vn(E)&&E.replaceWith(...E.childNodes);break}d=Zn(d)||void 0}h||(h=l(m)),i.push(ue.add(f,p,h))}else o("parent-not-mapped")}}else o("no-parent");break}case"Move":{let{node:u,nextSibling:d}=c;const m=u.parent,p=a(u);if(m&&p)if(m.type===$.ROOT)i.push(ue.move(null,p,d&&a(d)));else{const f=a(m);if(f){let h;for(;d;){const y=n.get(d);if(y){h=y;break}let E=t.getByNode(d);if(E&&!s.has(E)&&f.contains(E)){for(;E.parentNode!==f&&E.parentNode;)E=E.parentNode;E||nt("error while calculating next sibling"),h=E;break}d=Zn(d)||void 0}h||(h=l(m)),i.push(ue.move(f,p,h))}else o("parent-not-mapped")}else o(m?"node-not-mapped":"no-parent");break}case"Remove":{const u=c.node,d=a(u);if(u.type===$.HTML&&!u.content)continue;d?(s.set(d,u),i.push(ue.remove(d))):o("node-not-mapped");break}case"Update":{const u=c.prev,d=a(u);d?n.set(c.next,d):c.soft||o("node-not-mapped");break}case"Attribute":{const u=a(c.node);u?i.push(ue.attribute(u,c.name,c.value)):o("node-not-mapped");break}case"Set":{const u=c.node,d=a(u);d?oi(d)&&u.type===$.HTML||Vs(d)&&u.type===$.HTML||ip(d)&&u.type===$.DOCTYPE?i.push(ue.set(d,c.data||"")):e.push(ue.remove(u),ue.add(u.parent||null,u,Zn(u)||void 0)):o("node-not-mapped");break}}return{mutations:i,toAdd:n,toRemove:s}}function J0({mutations:e,toAdd:t,toRemove:n},r){const o=(i,s,a)=>{if(!i)return nt("Element node not in tree");if(!(i instanceof Element))return nt("node is not HTMLEement");const l=a===void 0?void 0:Xf(i,s,K0(a));try{l!=null?Hn(i,s,l):i.removeAttribute(s)}catch{}};for(const i of e)switch(i.type){case"Add":{const{node:s,nextSibling:a,parent:l}=i;l?.insertBefore(s,a?.parentNode===l&&a||null);break}case"Move":{const{node:s,nextSibling:a,parent:l}=i;l?.insertBefore(s,a?.parentNode===l&&a||null);break}case"Remove":{const{node:s}=i;if(s instanceof Element)s.remove();else if(s instanceof Document)for(const a of[...s.childNodes])a.parentNode?.removeChild(a);else s.parentNode?.removeChild(s);break}case"Attribute":o(i.node,i.name,i.value);break;case"Set":{const{node:s,data:a}=i;s instanceof Comment?s.data=a:s instanceof Text&&(s.textContent=Cc(a).textContent);break}}for(const[i,s]of n)r.remove(s);for(const[i,s]of t){const a=r.getByElement(s);a&&r.remove(a),r.set(i,s)}}var eC=class{constructor(){L(this,"_byKey",new WeakMap),L(this,"_byValue",new WeakMap)}get(e){return this._byKey.get(e)}getByValue(e){return this._byValue.get(e)?.deref()}set(e,t){this._byKey.set(e,t),this._byValue.set(t,new WeakRef(e))}delete(e){const t=this.get(e);t&&(this._byKey.delete(e),this._byValue.delete(t))}deleteByValue(e){const t=this.getByValue(e);t&&(this._byKey.delete(t),this._byValue.delete(e))}},tC=class{constructor(){L(this,"_map",new eC)}getByNode(e){return this._map.getByValue(e)}getByElement(e){return this._map.get(e)}set(e,t){this._map.set(t,e)}remove(e,t=!0){const n=this._map.getByValue(e);if(n&&this._map.delete(n),t){const r=e.children;for(let o=0,i=r.length;o<i;o++)this.remove(r[o])}}};function lp(e,t){for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function nC(e){let t;for(let n=e;n;n=n.parent)Sc(n)&&(t=n);return t}function rC(e){return e.type==="Update"?e.prev:e.node}function oC(e,t){const n=new Map;for(const o of e){if(o.type!=="Update"||!o.soft)continue;const i=nC(o.next);if(!i?.parent||n.has(i))continue;const s=e.find(c=>c.type==="Update"&&c.next===i),a=s?.type==="Update"?t.getByNode(s.prev):void 0;if(s?.type!=="Update"||!a?.isConnected)continue;const l=t.getByNode(o.prev);(!l||!l.isConnected||!a.contains(l))&&n.set(i,s.prev)}if(!n.size)return e;const r=[];for(const o of e){const i=rC(o),s=o.type==="Update"||o.type==="Remove"?t.getByNode(i):void 0;let a=!1;for(const[l,c]of n){const u=t.getByNode(c);if(lp(i,l)||lp(i,c)||s&&u?.contains(s)){a=!0,o.type==="Update"&&o.next===l&&l.parent&&r.push(...ue.recreate(c,l.parent,l,Zn(l)||void 0));break}}a||r.push(o)}return r}var Mc;(function(e){function t(r,o,i=(s,a)=>s===a){const s=r.length;let a=s===o.length;if(a){for(let l=0;l<s;l++)if(!i(r[l],o[l])){a=!1;break}}return a}e.isEqual=t;function n(r,o,i=(s,a)=>s===a){const s=new Set,a=new Set;for(const l of r)for(const c of o)i(l,c)&&(s.add(l),a.add(c));return{added:o.filter(l=>!a.has(l)),removed:r.filter(l=>!s.has(l))}}e.compare=n})(Mc||(Mc={}));var Us=new Set;function js(e,t){Us.has(e)||(Us.size||Promise.resolve().then(()=>Us.clear()),Us.add(e),Z.send(Pe.APPLICATION_SYNC_DRIFT,{reason:e,...t()}))}var cp=new WeakMap;function iC(e){const t=[],n=new Set(e);function r(o){if(n.has(o)){const{parentNode:i,nextSibling:s}=o;i&&n.has(i)&&r(i),s&&n.has(s)&&r(s),t.push(o),n.delete(o)}}for(const o of n)r(o);return t}function sC(e,t){let n=cp.get(e);if(!n){let l=function(c){for(const u of c)o.push(u),t(u)?i.push(u):l(u.childNodes)};var r=l;let{added:o,removed:i,reparented:s=[],reordered:a=[]}=e;o=[...o],i=[...i],s&&l(s),a&&l(a),o=iC(o),n={added:o,removed:i},cp.set(e,n)}return n}var aC=new Set(["text/x-handlebars-template","text/html"]);function up(e){return e.replace(/<(?=[A-Za-z!/?])/g,"&lt;")}function dp(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e.tagName.toUpperCase();return t==="STYLE"||t==="SCRIPT"&&!aC.has(e.getAttribute("type")??"")}var mp=Object.getPrototypeOf(customElements),lC=Reflect.get(mp,"define"),Rc=new Me,Oc=new Me,cC=Rc.event,uC=Oc.event,dC=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","connectedMoveCallback","formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"];function mC(e){Rc.fire();try{return e()}finally{Oc.fire()}}mp.define=function(e,t,n){const r=t.prototype,o=class extends t{constructor(...i){Rc.fire();try{super(...i)}finally{Oc.fire()}}};Object.defineProperty(o,"name",{configurable:!0,value:t.name});for(const i of dC){const s=r[i];typeof s=="function"&&Object.defineProperty(o.prototype,i,{configurable:!0,writable:!0,value:function(...a){return mC(()=>s.call(this,...a))}})}lC.call(this,e,o,n)};function fp(e,t,n,r){const o=[...e.childNodes],i=t(e,r);for(const s of o)n(i,fp(s,t,n,i));return i}function to(e,t,n){if(t(e,n)!==!1)for(const r of[...e.childNodes])to(r,t,e)}var Fn="___em-internal";function Pc(e,t=!0,n=!1){let r=e.content;switch(e.type){case $.ROOT:{const o=document.implementation.createHTMLDocument();for(const i of[...o.childNodes])o.removeChild(i);if(t)for(const i of e.children)o.appendChild(Pc(i,t,n));return o}case $.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case $.COMMENT:return document.createComment(r||"");case $.ELEMENT:if(e.tag){if(n&&customElements.get(e.tag)){const i=document.createElement("div");return i.innerHTML=dc(e),i.firstChild}const o=document.createElement(e.tag);if(e.attributes)for(const i of e.attributeNames){const s=e.attributes[i];try{Hn(o,i,typeof s=="string"?s:"")}catch{}}if(t)for(const i of e.children)o.appendChild(Pc(i,t,n));return o}return document.createTextNode("<");case $.HTML:return Cc(r||"");default:throw new Error("unsupported node")}}function fC(e){return Xr(e).roots.map(t=>Pc(t,!0,!0))}function pp(){const e=document.implementation.createHTMLDocument();for(const t of[...e.childNodes])t.remove();return e}function pC(e){let t;switch(e){case"tr":t=document.createElement("table");break;case"td":t=document.createElement("tr");break;case"head":case"body":t=document.createElement("html");break;case"DocumentType":case"html":return pp();default:t=document.createElement("div")}return t}function hC(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}function Gs(e){if(e instanceof Element)return sp(e);if(e instanceof Document)return[...e.childNodes].map(n=>Gs(n)).join("");if(e instanceof DocumentType)return hC(e);if(e instanceof DocumentFragment)return[...e.childNodes].map(n=>Gs(n)).join("");const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function hp(e,t=e.parentNode){return dp(t)?up(e.textContent??""):Gs(e)}function gC(e,t,n){let r=1;const o=new zf,i=new Map,s=new Map,a=new Map;let l=!1;const c=fp(e,p=>{const f=String(r++);let h;if(op(p)||p instanceof Element&&p.hasAttribute("src")){const y=document.createElement(p.tagName);for(const{name:E,value:C}of p.attributes){const k=Yf(p,E,C);k!==null&&Hn(y,E==="src"?"___src":E,k)}h=y}else h=p.cloneNode(),kC(p,h);if(h)h instanceof DocumentType&&(l=!0),a.set(h,f),i.set(p,f);else return document.createDocumentFragment();return h},(p,f)=>p&&f&&p.appendChild(f));let u=l?pp():document.createDocumentFragment();u.appendChild(c),to(u,(p,f)=>{if(f){const h=a.get(p);if(f instanceof HTMLScriptElement||f instanceof HTMLStyleElement)return;if(!h)return nt("Error while mapping: not found element");p instanceof Element?p.setAttribute(Fn,h):f.insertBefore(document.createComment(`${Fn}${h}`),p)}});let d=fC(t(u)).filter(p=>!!p),m;if(!d.length)return o;if(u instanceof Document){const p=pC("html");for(const f of d)p.appendChild(f);m=p}else{m=document.createDocumentFragment();for(const p of d)m.appendChild(p)}return to(m,(p,f)=>{let h=null;if(p instanceof HTMLHtmlElement)s.set("1",p);else{if(p instanceof Element&&p.hasAttribute(Fn)){h=p.getAttribute(Fn),h&&s.set(h,p);return}const y=p.previousSibling;if(y instanceof Comment&&(!(p instanceof Comment)||p.data.indexOf(Fn)<0)){const E=y.data,C=E.indexOf(Fn);C>=0&&(h=E.substring(C+14),h&&s.set(h,p))}}}),to(m,p=>{if(p instanceof Element&&p.hasAttribute(Fn)){p.removeAttribute(Fn);return}p instanceof Comment&&p.data.indexOf(Fn)>=0&&p.remove()}),to(e,p=>{const f=i.get(p),h=s.get(f);h&&(o.set(p,h),(p instanceof HTMLScriptElement||p instanceof HTMLStyleElement)&&p.firstChild&&h.firstChild&&o.set(p.firstChild,h.firstChild))}),o}function bC(e){const t=gp(e.cloneNode()),n=pc(t),r=n.length;return t.startTagEnd=t.startTagEnd===void 0?void 0:n.indexOf(">",Math.max(n.lastIndexOf("'"),n.lastIndexOf('"')))+1,t.endTagStart=t.endTagStart===void 0?void 0:t.endTagStart+(r-t.end),t.end=r,t.type=$.ELEMENT,t}var no;(function(e){e.HiddenResult=(function(t){return t[t.none=0]="none",t[t.node=1]="node",t[t.children=2]="children",t[t.all=3]="all",t})({})})(no||(no={}));function gp(e){if(oi(e)&&dp(e.parentNode))return yC(e.data);let t=Xr(Gs(e.cloneNode())).roots[0];return t||(t=new wt(0,0,[]),t.type=$.HTML,t.content=""),t}function yC(e){const t=up(e),n=new wt(0,t.length,[]);return n.type=$.HTML,n.content=t,n}function bp(e,t=no.HiddenResult.node){if(t&no.HiddenResult.node&&(e.end=e.start=e.startTagEnd=e.endTagStart=e.end=0),t&no.HiddenResult.children)for(const n of e.children)bp(n,no.HiddenResult.all)}function vC(e,t=[],n){let r;return e instanceof Element?r=bC(e):r=gp(e),r.children=t,r.parent=void 0,n&&bp(r,n(r)),r}function Ic(e,t,n){let r=t.getByElement(e);if(r)return n?.(e)?void 0:r;for(const o of e.childNodes)if(r=Ic(o,t,n),r)return r}function yp(e,t,n,r){js("tree-node-out-of-place",()=>({mutation:n()}))}function EC(e,t,n,r,o){let i=e.parentNode,s=e.nextSibling,a;const l=(c,u)=>!o||o(c,u)?!0:(yp("insertBefore",c,()=>$0(e,u,c,t),u),!1);for(;i;){const c=t.getByElement(i)??(n&&i===n.node?n.treeNode:void 0);if(c){if(a){let u=t.getByNode(a);if(u&&i.contains(u)&&l(a,c))return{parentTreeNode:c,nextSiblingTreeNode:a};a=void 0}for(;s;){const u=Ic(s,t,r);if(u&&l(u,c))return{parentTreeNode:c,nextSiblingTreeNode:u};s=s.nextSibling}return{parentTreeNode:c}}if(!a)for(;s;){const u=Ic(s,t,r);if(u){a=u,s=s.nextSibling;break}s=s.nextSibling}s||(s=i.nextSibling),i=i.parentNode}}function SC(e,t){const n=[],r=e.attributeChanged;if(r)for(const o of Object.keys(r)){const i=r[o];for(const s of i){const a=t.getByElement(s);if(a){const l=s.getAttribute(o);n.push(ue.attribute(a,o,typeof l=="string"?l:void 0))}}}return n}function wC(e,t){const n=[],r=e.characterDataChanged;if(r)for(const o of r){const i=t.getByElement(o);i&&n.push(ue.set(i,Vs(o)?o.data:hp(o)))}return n}function CC(e){return(e instanceof Element?e:e.parentElement)?.closest(".sortable-fallback")??null}function AC(e){if(e.nodeType!==Node.TEXT_NODE)return!1;const t=e.parentElement;if(!t||t.closest(".em-element-list-ul, .em-element-list-ol")&&t.closest(".em-element-list-bullet"))return!1;const n=t.closest('[class*="em-element-"]:not(.em-element-resize-img-container)');return!(!n||[".em-element-list-ul",".em-element-list-ol",".em-element-custom-table"].some(r=>n.matches(r)))}function TC(e,t,n){const r=[],o=new Set,i=new Map,s=(a,l)=>{const c=i.get(a);return c?c===l:a.parent===l&&l.children.includes(a)};for(const a of e){const{added:l,removed:c}=sC(a,u=>!!t.getByElement(u));for(const u of c)if(!o.has(u)){const d=t.getByElement(u);if(d){const m=i.get(d)??d.parent;!m||!s(d,m)?yp("remove",d,()=>W0(d,t)):r.push(ue.remove(d)),i.delete(d),o.add(u)}}for(const u of l){if(AC(u))continue;const d=CC(u);if(d&&!t.getByElement(d))continue;const{parentTreeNode:m,nextSiblingTreeNode:p}=EC(u,t,n,f=>o.has(f),s)||{};if(m){let f=t.getByElement(u);f||(f=vC(u),t.set(f,u)),r.push(ue.add(m,f,p)),i.set(f,m),o.delete(u)}}r.push(...SC(a,t)),r.push(...wC(a,t))}return r}function _C(e,t,n){const r=[],o=t.attributes,i=n.attributes;for(const s of o){const a=s.name,l=i.getNamedItem(a==="src"?"___src":a);if(l){const c=l.value;c!==s.value&&r.push(ue.attribute(e,a,c))}else r.push(ue.attribute(e,a,void 0))}for(const s of i){const a=s.name==="___src"?"src":s.name;o.getNamedItem(a)||r.push(ue.attribute(e,a,s.value))}return r}function kC(e,t){if(!(!_0()||!(e instanceof Element)||!(t instanceof Element)))for(const{name:n,value:r}of Array.from(e.attributes)){const o=Yf(e,n,r);o===null?t.removeAttribute(n):o!==r&&Hn(t,n,o)}}function LC(e,t,n){const r=[],o=gC(e,n,t);return to(e,i=>{const s=t.getByElement(i);if(!s)return;const a=o.getByKey(i);if(a){if(a instanceof Element){if(!(i instanceof Element))return nt("CharacterData mapped to Element");r.push(..._C(s,i,a))}else if(a instanceof CharacterData){if(!(i instanceof CharacterData))return nt("Element mapped to CharacterData");a.data!==i.data&&r.push(ue.set(s,Vs(a)?a.data:hp(a,i.parentNode)))}else if(a instanceof Document&&!(i instanceof Document))return nt("Node mapped to Document")}else{const l=u=>{for(const d of u.childNodes)if(o.getByKey(d)||!l(d))return!1;return!0};let c;return l(i)?(r.push(ue.hidden(s,!0)),c=!1):r.push(ue.hidden(s,!1)),c}}),r}function NC(e,t){let n,r=e;do{if(t.getByElement(r))return n;n=r}while(r=r.parentNode);for(;e.parentNode;)e=e.parentNode}function xC(e){return[...new Set(e)]}function MC(e,t){return xC([...e.added,...e.reparented||[],...e.reordered||[],...Object.values(e.characterDataChanged||{}),...Object.values(e.attributeChanged||{})].flat().map(n=>NC(n,t)||n))}function RC(e,t){let n=[];for(const r of e){const o=MC(r,t),i=s=>{for(let a=0;a<n.length;a++){const l=n[a];if(l.contains(s)||l===s)return;if(s.contains(l)){n.splice(a,1,s);return}}n.push(s)};for(const s of o)i(s)}return n}function OC(e,t,n){return RC(e,t).flatMap(r=>LC(r,t,n))}function PC(e,t,n,r){return[...TC(e,t,r),...OC(e,t,n)]}function IC(e){const t=[],n=new Map;for(let r=e.length-1;r>=0;r--){const o=e[r];if(o.type==="Attribute"){const{node:i,name:s,value:a}=o;let l=n.get(i);l||n.set(i,l={}),l.hasOwnProperty(s)||(l[s]=a,i.attributes?.[s]!==a&&t.unshift(o))}else t.unshift(o)}return t}var DC=class{constructor(){L(this,"_map",new WeakMap)}getAttribute(e,t){return this._map.get(e)?.[t]}setAttribute(e,t,n){let r=this._map.get(e);r||this._map.set(e,r=Object.create(null)),r[t]=n}removeAttribute(e,t){let n=this._map.get(e);n&&delete n[t]}hasAttribute(e,t){return this._map.has(e)?.hasOwnProperty(t)}getAttributes(e){return this._map.get(e)}has(e){return this._map.has(e)}replaceNode(e,t){const n=this._map.get(e);n&&(this._map.delete(e),this._map.set(t,n))}},vp=class{constructor(e=10){L(this,"_max",void 0),L(this,"_cache",new Map),this._max=e}get(e){let t=this._cache.get(e);return t!==void 0&&(this._cache.delete(e),this._cache.set(e,t)),t}put(e,t){this._cache.has(e)?this._cache.delete(e):this._cache.size==this._max&&this._cache.delete(this.first()),this._cache.set(e,t)}first(){return this._cache.keys().next().value}},Ep=new vp(1e3);function ro(e){if(e=e?.trim(),e){let t=Ep.get(e);return t||(t=new Set(e.split(" ").filter(n=>!!n).map(n=>n)),Ep.put(e,t)),t}else return new Set}function Xs(e){e||(e="");const t=document.createElement("div");return t.setAttribute("style",e),t.style}var Sp=new vp(1e3);function ii(e){e||(e="");let t=Sp.get(e);return t||(t=Xs(e),Sp.put(e,t)),t}function BC(e,t,n){const r=e?e.split(" "):[],o=ro(n),i=ro(t),s=r.filter(a=>(a=a.trim(),o.has(a)?i.has(a):!0));return s.length===r.length?e:s.join(" ")}function HC(e,t,n){const r=Xs(e),o=ii(n),i=ii(t);let s=!1;for(const a of o){const l=o.getPropertyValue(a);r.getPropertyValue(a)===l&&i.getPropertyValue(a)!==l&&(s=!0,r.removeProperty(a))}return s?r.cssText:e}function wp(e,t,n,r){return typeof r!="string"?t:e==="class"?BC(t,n,r)||null:e==="style"?HC(t,n,r)||null:n!==t&&t===r?null:t}function FC(e,t){const n=ro(e),r=ro(t);for(const o of r)n.has(o)||(e=e?`${e.trimEnd()} ${o}`:o);return e}function $C(e,t){const n=Xs(e),r=ii(t);let o=!1;for(const i of r){const s=r.getPropertyValue(i);n.getPropertyValue(i)!==s&&(o=!0,n.setProperty(i,s))}return o?n.cssText:e}function WC(e,t,n){return typeof n!="string"?t:e==="class"?FC(t,n)||null:e==="style"?$C(t,n)||null:t}function qC(e,t,n){if(!t)return t;const r=ro(e),o=ro(n),i=t.split(" "),s=i.filter(a=>(a=a.trim(),!r.has(a)||o.has(a)));return s.length!==i.length?s.join(" "):t}function zC(e,t,n){if(!t)return t;const r=ii(e),o=Xs(t),i=ii(n);let s=!1;for(const a of o){const l=o.getPropertyValue(a);r.getPropertyValue(a)===l&&i.getPropertyValue(a)!==l&&(s=!0,o.removeProperty(a))}return s?o.cssText:t}function Cp(e){return e.type===$.ELEMENT&&e.start!==e.end}function Ap(e){return e.filter(t=>t.type===$.ELEMENT)}function VC(e,t,n){const r=Ap(e),o=Ap(t),i=[],s=new Set,a=new Set,l=u=>{const d=(p,f)=>{const h=new Map;for(const y of p){const E=f.has(y)?void 0:u(y);E!==void 0&&h.set(E,h.has(E)?null:y)}return h},m=d(r,s);for(const[p,f]of d(o,a)){const h=m.get(p);f&&h&&(i.push([h,f,!0]),s.add(h),a.add(f))}};l(u=>typeof u.attributes?.id=="string"?`${u.tag}#${u.attributes.id}`:void 0),l(u=>fr(u,!1,n)),l(u=>fr(u,!0,n));const c=new Set(o.map(u=>u.tag));for(const u of c){const d=f=>f.filter(h=>h.tag===u),m=d(r).filter(f=>!s.has(f)),p=d(o).filter(f=>!a.has(f));if(m.length===p.length&&d(r).length===d(o).length){const f=m.length===1&&!m[0].attributes?.id&&!p[0].attributes?.id;p.forEach((h,y)=>i.push([m[y],h,f]))}}return i}var UC=class{constructor(e,t,n,r){L(this,"element",void 0),L(this,"name",void 0),L(this,"nextValue",void 0),L(this,"prevValue",void 0),this.element=e,this.name=t,this.nextValue=n,this.prevValue=r}},jC=class{constructor(e){L(this,"_nodeMap",void 0),L(this,"_map",new DC),L(this,"_hiddenMutations",[]),L(this,"_restore",[]),this._nodeMap=e}_onHiddenMutate(){try{for(const{name:e,element:t,prevValue:n,nextValue:r}of this._hiddenMutations){const o=this._nodeMap.getByElement(t);if(o)if(e==="class"){const i=qC(n,r,this._map.getAttribute(o,e))||null;i===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,i)}else if(e==="style"){const i=zC(n,r,this._map.getAttribute(o,e))||null;i===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,i)}else r===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,r)}}finally{this._hiddenMutations=[]}}onHiddenMutate(e){const t=this._hiddenMutations;for(const n of e){const r=n.attributeChanged;if(r)for(const o of Object.keys(r)){const i=r[o];for(const s of i)t.push(new UC(s,o,s.getAttribute(o),n.getOldAttribute(s,o)))}}}beforeCommit(e){this._onHiddenMutate();const t=[];for(const n of e){if(n.type==="Attribute"){const{name:r,node:o,value:i}=n,s=wp(r,i,o.attributes?.[r]||null,this._map.getAttribute(o,r));if(s!==i){t.push(ue.attribute(o,r,s));continue}}if(t.push(n),n.type==="Add"){const{node:r}=n,o=r.attributes;if(o)for(const i of Object.keys(o)){const s=o[i],a=this._map.getAttribute(r,i);if(a){const l=wp(i,s,null,a);l!==s&&t.push(ue.attribute(r,i,l))}}}}return t}onRemoteMutate(e){this._onHiddenMutate(),this._restore=[];const t=[];for(const n of e){if(n.type==="Attribute"){const{name:r,node:o,value:i}=n,s=WC(r,i,this._map.getAttribute(o,r));if(s!==i){t.push(ue.attribute(o,r,s));continue}}else n.type==="Update"?this._map.replaceNode(n.prev,n.next):n.type==="Add"&&n.replaces&&this._carryHidden(n.replaces,n.node,!0,mc());t.push(n)}return t}_carryHidden(e,t,n,r){if(e.type!==t.type||e.tag!==t.tag)return;const o=this._map.getAttributes(e);if(n&&!vc(t.tag)&&o){const i=[];for(const[s,a]of Object.entries(o))g0(s)||(this._map.setAttribute(t,s,a),i.push([s,e.attributes?.[s]??null]));i.length&&this._restore.push({node:t,carried:i})}if(n&&fr(e,!1,r)===fr(t,!1,r)){const i=t.children.filter(Cp);e.children.filter(Cp).forEach((s,a)=>{i[a]&&this._carryHidden(s,i[a],!0,r)});return}for(const[i,s,a]of VC(e.children,t.children,r))this._carryHidden(i,s,a,r)}restoreHidden(){const e=this._restore;this._restore=[];for(const{node:t,carried:n}of e){const r=this._nodeMap.getByNode(t);if(r instanceof Element)for(const[o,i]of n){if((t.attributes?.[o]??null)!==i){this._map.removeAttribute(t,o);continue}const s=this._map.getAttribute(t,o);typeof s=="string"&&r.setAttribute(o,s)}}}},GC=class{constructor(e){L(this,"_isMapped",void 0),L(this,"_foreign",new WeakSet),L(this,"_movedTo",new WeakMap),L(this,"_removed",new WeakSet),L(this,"_hasForeign",!1),this._isMapped=e}observeLost(e){for(const t of e){for(const n of t.added)this.markForeign(n);for(const n of[...t.reparented??[],...t.reordered??[]])!this._foreign.has(n)&&n.parentNode&&this._movedTo.set(n,n.parentNode);for(const n of t.removed)this._foreign.has(n)||this._removed.add(n)}}markForeign(e){this._hasForeign=!0,this._foreign.add(e)}isMarked(e){return this._foreign.has(e)}isForeign(e){if(!this._hasForeign)return!1;for(let t=e;t;t=t.parentNode){if(this._isMapped(t))return!1;if(this._foreign.has(t))return!0}return!1}isPlacedInForeign(e){return this._hasForeign&&this.isForeign(this._isMapped(e)?e.parentNode:e)}movedTo(e){return this._movedTo.get(e)}wasRemoved(e){return this._removed.has(e)}forget(e){this._movedTo.delete(e),this._removed.delete(e)}},Tp="foreign-structure-in-commit";function XC(e,t,n){const r=[],o=(s,a)=>{t.isPlacedInForeign(s)&&r.push({kind:t.movedTo(s)?"moved-own-node":a,node:s})},i=s=>{o(s,"moved"),n(s)||s.childNodes.forEach(i)};for(const s of e)s.added.forEach(a=>o(a,"inserted")),[...s.reparented??[],...s.reordered??[]].forEach(i),new Set(Object.values(s.attributeChanged??{}).flat()).forEach(a=>t.isForeign(a)&&r.push({kind:"attribute",node:a})),(s.characterDataChanged??[]).forEach(a=>t.isForeign(a)&&r.push({kind:"text",node:a}));for(const s of e)[...s.added,...s.reparented??[],...s.reordered??[]].forEach(a=>t.forget(a));return r}function Ys(e){if(!(e instanceof Element))return{tag:e.nodeName.toLowerCase()};const t=e.getAttribute("class");return{tag:e.tagName.toLowerCase(),...t?{class:t}:{}}}var _p="implicit-tbody-in-canvas";function YC(e,t){const n=new Set;for(const r of e)for(const o of r.added)o instanceof Element&&(o.tagName==="TBODY"?[o]:Array.from(o.querySelectorAll("tbody"))).filter(i=>!t(i)).forEach(i=>n.add(i));return[...n]}function KC(e,t){if(!e.length||t.has("implicit-tbody-in-canvas"))return;const[n]=e,r={kind:"implicit-tbody",kinds:["implicit-tbody"],count:e.length,node:Ys(n),parent:n.parentNode?Ys(n.parentNode):void 0};t.add(_p),js(_p,()=>({foreign:r}))}function ZC(e,t){if(!e.length)return;const[n]=e,r=[...new Set(e.map(({kind:i})=>i))],o={kind:n.kind,kinds:r,count:e.length,node:Ys(n.node),parent:n.node.parentNode?Ys(n.node.parentNode):void 0};t.has("foreign-structure-in-commit")||(t.add(Tp),js(Tp,()=>({foreign:o})))}var QC=Yn(((e,t)=>{(function(n,r){typeof e=="object"&&typeof t<"u"?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.MutationSummary={}))})(e,(function(n){"use strict";var r=(function(){function w(){this._nodes=[],this._values=[]}return w._isIndex=function(b){return+b===b>>>0},w._nodeId=function(b){var v=b[w._ID_PROP];return v||(v=b[w._ID_PROP]=w._NEXT_ID++),v},w.prototype.set=function(b,v){var A=w._nodeId(b);this._nodes[A]=b,this._values[A]=v},w.prototype.get=function(b){var v=w._nodeId(b);return v!==void 0?this._values[v]:void 0},w.prototype.has=function(b){return w._nodeId(b)in this._nodes},w.prototype.delete=function(b){var v=w._nodeId(b);delete this._nodes[v],this._values[v]=void 0},w.prototype.keys=function(){var b=[];for(var v in this._nodes)w._isIndex(v)&&b.push(this._nodes[v]);return b},w._ID_PROP="__mutation_summary_node_map_id__",w._NEXT_ID=1,w})(),o=(function(){function w(){this.added=new r,this.removed=new r,this.maybeMoved=new r,this.oldPrevious=new r,this.moved=void 0}return w})();n.Movement=void 0,(function(w){w[w.STAYED_OUT=0]="STAYED_OUT",w[w.ENTERED=1]="ENTERED",w[w.STAYED_IN=2]="STAYED_IN",w[w.REPARENTED=3]="REPARENTED",w[w.REORDERED=4]="REORDERED",w[w.EXITED=5]="EXITED"})(n.Movement||(n.Movement={}));var i=function(w,b){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,A){v.__proto__=A}||function(v,A){for(var g in A)Object.prototype.hasOwnProperty.call(A,g)&&(v[g]=A[g])},i(w,b)};function s(w,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");i(w,b);function v(){this.constructor=w}w.prototype=b===null?Object.create(b):(v.prototype=b.prototype,new v)}var a=(function(){function w(b,v,A,g,S,T,_,M){v===void 0&&(v=!1),A===void 0&&(A=!1),g===void 0&&(g=!1),S===void 0&&(S=null),T===void 0&&(T=!1),_===void 0&&(_=null),M===void 0&&(M=null),this.node=b,this.childList=v,this.attributes=A,this.characterData=g,this.oldParentNode=S,this.added=T,this.attributeOldValues=_,this.characterDataOldValue=M,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return w.prototype.getAttributeOldValue=function(b){if(this.attributeOldValues)return this.isCaseInsensitive&&(b=b.toLowerCase()),this.attributeOldValues[b]},w.prototype.getAttributeNamesMutated=function(){var b=[];if(!this.attributeOldValues)return b;for(var v in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(v)&&b.push(v);return b},w.prototype.attributeMutated=function(b,v){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(b in this.attributeOldValues)&&(this.attributeOldValues[b]=v)},w.prototype.characterDataMutated=function(b){this.characterData||(this.characterData=!0,this.characterDataOldValue=b)},w.prototype.removedFromParent=function(b){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=b},w.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},w.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},w})(),l=(function(w){s(b,w);function b(v,A){var g=w.call(this)||this;g.rootNode=v,g.reachableCache=void 0,g.wasReachableCache=void 0,g.anyParentsChanged=!1,g.anyAttributesChanged=!1,g.anyCharacterDataChanged=!1;for(var S=0;S<A.length;S++){var T=A[S];switch(T.type){case"childList":g.anyParentsChanged=!0;for(var _=0;_<T.removedNodes.length;_++){var M=T.removedNodes[_];g.getChange(M).removedFromParent(T.target)}for(var _=0;_<T.addedNodes.length;_++){var M=T.addedNodes[_];g.getChange(M).insertedIntoParent()}break;case"attributes":g.anyAttributesChanged=!0;var N=g.getChange(T.target);N.attributeMutated(T.attributeName,T.oldValue);break;case"characterData":g.anyCharacterDataChanged=!0;var N=g.getChange(T.target);N.characterDataMutated(T.oldValue)}}return g}return b.prototype.getChange=function(v){var A=this.get(v);return A||(A=new a(v),this.set(v,A)),A},b.prototype.getOldParent=function(v){var A=this.get(v);return A?A.getOldParent():v.parentNode},b.prototype.getIsReachable=function(v){if(v===this.rootNode)return!0;if(!v)return!1;this.reachableCache=this.reachableCache||new r;var A=this.reachableCache.get(v);return A===void 0&&(A=this.getIsReachable(v.parentNode),this.reachableCache.set(v,A)),A},b.prototype.getWasReachable=function(v){if(v===this.rootNode)return!0;if(!v)return!1;this.wasReachableCache=this.wasReachableCache||new r;var A=this.wasReachableCache.get(v);return A===void 0&&(A=this.getWasReachable(this.getOldParent(v)),this.wasReachableCache.set(v,A)),A},b.prototype.reachabilityChange=function(v){return this.getIsReachable(v)?this.getWasReachable(v)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.getWasReachable(v)?n.Movement.EXITED:n.Movement.STAYED_OUT},b})(r),c=(function(){function w(b,v,A,g,S){this.rootNode=b,this.mutations=v,this.selectors=A,this.calcReordered=g,this.calcOldPreviousSibling=S,this.treeChanges=new l(b,v),this.entered=[],this.exited=[],this.stayedIn=new r,this.visited=new r,this.childListChangeMap=void 0,this.characterDataOnly=void 0,this.matchCache=void 0,this.processMutations()}return w.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var b=this.treeChanges.keys(),v=0;v<b.length;v++)this.visitNode(b[v],void 0)},w.prototype.visitNode=function(b,v){if(!this.visited.has(b)){this.visited.set(b,!0);var A=this.treeChanges.get(b),g=v;if((A&&A.childList||g==null)&&(g=this.treeChanges.reachabilityChange(b)),g!==n.Movement.STAYED_OUT){if(this.matchabilityChange(b),g===n.Movement.ENTERED)this.entered.push(b);else if(g===n.Movement.EXITED)this.exited.push(b),this.ensureHasOldPreviousSiblingIfNeeded(b);else if(g===n.Movement.STAYED_IN){var S=n.Movement.STAYED_IN;A&&A.childList&&(A.oldParentNode!==b.parentNode?(S=n.Movement.REPARENTED,this.ensureHasOldPreviousSiblingIfNeeded(b)):this.calcReordered&&this.wasReordered(b)&&(S=n.Movement.REORDERED)),this.stayedIn.set(b,S)}if(g!==n.Movement.STAYED_IN)for(var T=b.firstChild;T;T=T.nextSibling)this.visitNode(T,g)}}},w.prototype.ensureHasOldPreviousSiblingIfNeeded=function(b){if(this.calcOldPreviousSibling){this.processChildlistChanges();var v=b.parentNode,A=this.treeChanges.get(b);A&&A.oldParentNode&&(v=A.oldParentNode);var g=this.childListChangeMap.get(v);g||(g=new o,this.childListChangeMap.set(v,g)),g.oldPrevious.has(b)||g.oldPrevious.set(b,b.previousSibling)}},w.prototype.getChanged=function(b,v,A){this.selectors=v,this.characterDataOnly=A;for(var g=0;g<this.entered.length;g++){var S=this.entered[g],T=this.matchabilityChange(S);(T===n.Movement.ENTERED||T===n.Movement.STAYED_IN)&&b.added.push(S)}for(var _=this.stayedIn.keys(),g=0;g<_.length;g++){var S=_[g],T=this.matchabilityChange(S);if(T===n.Movement.ENTERED)b.added.push(S);else if(T===n.Movement.EXITED)b.removed.push(S);else if(T===n.Movement.STAYED_IN&&(b.reparented||b.reordered)){var M=this.stayedIn.get(S);b.reparented&&M===n.Movement.REPARENTED?b.reparented.push(S):b.reordered&&M===n.Movement.REORDERED&&b.reordered.push(S)}}for(var g=0;g<this.exited.length;g++){var S=this.exited[g],T=this.matchabilityChange(S);(T===n.Movement.EXITED||T===n.Movement.STAYED_IN)&&b.removed.push(S)}},w.prototype.getOldParentNode=function(b){var v=this.treeChanges.get(b);if(v&&v.childList)return v.oldParentNode?v.oldParentNode:null;var A=this.treeChanges.reachabilityChange(b);if(A===n.Movement.STAYED_OUT||A===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return b.parentNode},w.prototype.getOldPreviousSibling=function(b){var v=b.parentNode,A=this.treeChanges.get(b);A&&A.oldParentNode&&(v=A.oldParentNode);var g=this.childListChangeMap.get(v);if(!g)throw Error("getOldPreviousSibling requested on invalid node.");return g.oldPrevious.get(b)},w.prototype.getOldAttribute=function(b,v){var A=this.treeChanges.get(b);if(!A||!A.attributes)throw Error("getOldAttribute requested on invalid node.");var g=A.getAttributeOldValue(v);if(g===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return g},w.prototype.attributeChangedNodes=function(b){if(!this.treeChanges.anyAttributesChanged)return{};var v,A;if(b){v={},A={};for(var g=0;g<b.length;g++){var S=b[g];v[S]=!0,A[S.toLowerCase()]=S}}for(var T={},_=this.treeChanges.keys(),g=0;g<_.length;g++){var M=_[g],N=this.treeChanges.get(M);if(N.attributes&&!(n.Movement.STAYED_IN!==this.treeChanges.reachabilityChange(M)||n.Movement.STAYED_IN!==this.matchabilityChange(M)))for(var W=M,P=N.getAttributeNamesMutated(),R=0;R<P.length;R++){var S=P[R];v&&!v[S]&&!(N.isCaseInsensitive&&A[S])||N.getAttributeOldValue(S)!==W.getAttribute(S)&&(A&&N.isCaseInsensitive&&(S=A[S]),T[S]=T[S]||[],T[S].push(W))}}return T},w.prototype.getOldCharacterData=function(b){var v=this.treeChanges.get(b);if(!v||!v.characterData)throw Error("getOldCharacterData requested on invalid node.");return v.characterDataOldValue},w.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var b=this.treeChanges.keys(),v=[],A=0;A<b.length;A++){var g=b[A];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(g)){var S=this.treeChanges.get(g);!S.characterData||g.textContent==S.characterDataOldValue||v.push(g)}}return v},w.prototype.computeMatchabilityChange=function(b,v){this.matchCache||(this.matchCache=[]),this.matchCache[b.uid]||(this.matchCache[b.uid]=new r);var A=this.matchCache[b.uid],g=A.get(v);return g===void 0&&(g=b.matchabilityChange(v,this.treeChanges.get(v)),A.set(v,g)),g},w.prototype.matchabilityChange=function(b){var v=this;if(this.characterDataOnly)switch(b.nodeType){case Node.COMMENT_NODE:case Node.TEXT_NODE:return n.Movement.STAYED_IN;default:return n.Movement.STAYED_OUT}if(!this.selectors)return n.Movement.STAYED_IN;if(b.nodeType!==Node.ELEMENT_NODE)return n.Movement.STAYED_OUT;for(var A=b,g=this.selectors.map(function(_){return v.computeMatchabilityChange(_,A)}),S=n.Movement.STAYED_OUT,T=0;S!==n.Movement.STAYED_IN&&T<g.length;){switch(g[T]){case n.Movement.STAYED_IN:S=n.Movement.STAYED_IN;break;case n.Movement.ENTERED:S===n.Movement.EXITED?S=n.Movement.STAYED_IN:S=n.Movement.ENTERED;break;case n.Movement.EXITED:S===n.Movement.ENTERED?S=n.Movement.STAYED_IN:S=n.Movement.EXITED}T++}return S},w.prototype.getChildlistChange=function(b){var v=this.childListChangeMap.get(b);return v||(v=new o,this.childListChangeMap.set(b,v)),v},w.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r;for(var b=function(g){var S=v.mutations[g];if(S.type!="childList"||v.treeChanges.reachabilityChange(S.target)!==n.Movement.STAYED_IN&&!v.calcOldPreviousSibling)return"continue";for(var T=v.getChildlistChange(S.target),_=S.previousSibling,M=function(P,R){!P||T.oldPrevious.has(P)||T.added.has(P)||T.maybeMoved.has(P)||R&&(T.added.has(R)||T.maybeMoved.has(R))||T.oldPrevious.set(P,R)},N=0;N<S.removedNodes.length;N++){var W=S.removedNodes[N];M(W,_),T.added.has(W)?T.added.delete(W):(T.removed.set(W,!0),T.maybeMoved.delete(W)),_=W}M(S.nextSibling,_);for(var N=0;N<S.addedNodes.length;N++){var W=S.addedNodes[N];T.removed.has(W)?(T.removed.delete(W),T.maybeMoved.set(W,!0)):T.added.set(W,!0)}},v=this,A=0;A<this.mutations.length;A++)b(A)}},w.prototype.wasReordered=function(b){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var v=b.parentNode,A=this.treeChanges.get(b);A&&A.oldParentNode&&(v=A.oldParentNode);var g=this.childListChangeMap.get(v);if(!g)return!1;if(g.moved)return g.moved.get(b);g.moved=new r;var S=new r;function T(P){if(!P||!g.maybeMoved.has(P))return!1;var R=g.moved.get(P);return R!==void 0||(S.has(P)?R=!0:(S.set(P,!0),R=W(P)!==M(P)),S.has(P)?(S.delete(P),g.moved.set(P,R)):R=g.moved.get(P)),R}var _=new r;function M(P){var R=_.get(P);if(R!==void 0)return R;for(R=g.oldPrevious.get(P);R&&(g.removed.has(R)||T(R));)R=M(R);return R===void 0&&(R=P.previousSibling),_.set(P,R),R}var N=new r;function W(P){if(N.has(P))return N.get(P);for(var R=P.previousSibling;R&&(g.added.has(R)||T(R));)R=R.previousSibling;return N.set(P,R),R}return g.maybeMoved.keys().forEach(T),g.moved.get(b)},w})(),u=(function(){function w(b,v){var A=this;if(this.projection=b,this.added=[],this.removed=[],this.reparented=v.all||v.element||v.characterData?[]:void 0,this.reordered=v.all?[]:void 0,b.getChanged(this,v.elementFilter,v.characterData),v.all||v.attribute||v.attributeList){var g=v.attribute?[v.attribute]:v.attributeList,S=b.attributeChangedNodes(g);v.attribute?this.valueChanged=S[v.attribute]||[]:(this.attributeChanged=S,v.attributeList&&v.attributeList.forEach(function(_){A.attributeChanged.hasOwnProperty(_)||(A.attributeChanged[_]=[])}))}if(v.all||v.characterData){var T=b.getCharacterDataChanged();v.characterData?this.valueChanged=T:this.characterDataChanged=T}this.reordered&&(this.getOldPreviousSibling=b.getOldPreviousSibling.bind(b))}return w.prototype.getOldParentNode=function(b){return this.projection.getOldParentNode(b)},w.prototype.getOldAttribute=function(b,v){return this.projection.getOldAttribute(b,v)},w.prototype.getOldCharacterData=function(b){return this.projection.getOldCharacterData(b)},w.prototype.getOldPreviousSibling=function(b){return this.projection.getOldPreviousSibling(b)},w})(),d=(function(){function w(){}return w.prototype.matches=function(b){if(b===null)return!1;if(this.attrValue===void 0)return!0;if(!this.contains)return this.attrValue==b;for(var v=b.split(" "),A=0;A<v.length;A++)if(this.attrValue===v[A])return!0;return!1},w.prototype.toString=function(){return this.attrName==="class"&&this.contains?"."+this.attrValue:this.attrName==="id"&&!this.contains?"#"+this.attrValue:this.contains?"["+this.attrName+"~="+m(this.attrValue)+"]":"attrValue"in this?"["+this.attrName+"="+m(this.attrValue)+"]":"["+this.attrName+"]"},w})();function m(w){return'"'+w.replace(/"/,'\\"')+'"'}var p=/[a-zA-Z_]+/,f=/[a-zA-Z0-9_\-]+/,h=(function(){function w(){this.uid=w.nextUid++,this.qualifiers=[]}return Object.defineProperty(w.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),w.prototype.isMatching=function(b){return b[w.matchesSelector](this.selectorString)},w.prototype.wasMatching=function(b,v,A){if(!v||!v.attributes)return A;var g=v.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(g!=="*"&&g!==b.tagName)return!1;for(var S=[],T=!1,_=0;_<this.qualifiers.length;_++){var M=this.qualifiers[_],N=v.getAttributeOldValue(M.attrName);S.push(N),T=T||N!==void 0}if(!T)return A;for(var _=0;_<this.qualifiers.length;_++){var M=this.qualifiers[_],N=S[_];if(N===void 0&&(N=b.getAttribute(M.attrName)),!M.matches(N))return!1}return!0},w.prototype.matchabilityChange=function(b,v){var A=this.isMatching(b);return A?this.wasMatching(b,v,A)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.wasMatching(b,v,A)?n.Movement.EXITED:n.Movement.STAYED_OUT},w.parseSelectors=function(b){var v=[],A,g;function S(){A&&(g&&(A.qualifiers.push(g),g=void 0),v.push(A)),A=new w}function T(){g&&A.qualifiers.push(g),g=new d}for(var _=/\s/,M=void 0,N="Invalid or unsupported selector syntax.",W=1,P=2,R=3,Y=4,V=5,G=6,Le=7,ae=8,ne=9,we=10,j=11,z=12,Se=13,Ae=14,Q=W,Lt=0;Lt<b.length;){var U=b[Lt++];switch(Q){case W:if(U.match(p)){S(),A.tagName=U,Q=P;break}if(U=="*"){S(),A.tagName="*",Q=R;break}if(U=="."){S(),T(),A.tagName="*",g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){S(),T(),A.tagName="*",g.attrName="id",Q=Y;break}if(U=="["){S(),T(),A.tagName="*",g.attrName="",Q=G;break}if(U.match(_))break;throw Error(N);case P:if(U.match(f)){A.tagName+=U;break}if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),g.attrName="",Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case R:if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),g.attrName="",Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case Y:if(U.match(p)){g.attrValue=U,Q=V;break}throw Error(N);case V:if(U.match(f)){g.attrValue+=U;break}if(U=="."){T(),g.attrName="class",g.contains=!0,Q=Y;break}if(U=="#"){T(),g.attrName="id",Q=Y;break}if(U=="["){T(),Q=G;break}if(U.match(_)){Q=Ae;break}if(U==","){Q=W;break}throw Error(N);case G:if(U.match(p)){g.attrName=U,Q=Le;break}if(U.match(_))break;throw Error(N);case Le:if(U.match(f)){g.attrName+=U;break}if(U.match(_)){Q=ae;break}if(U=="~"){g.contains=!0,Q=ne;break}if(U=="="){g.attrValue="",Q=j;break}if(U=="]"){Q=R;break}throw Error(N);case ae:if(U=="~"){g.contains=!0,Q=ne;break}if(U=="="){g.attrValue="",Q=j;break}if(U=="]"){Q=R;break}if(U.match(_))break;throw Error(N);case ne:if(U=="="){g.attrValue="",Q=j;break}throw Error(N);case we:if(U=="]"){Q=R;break}if(U.match(_))break;throw Error(N);case j:if(U.match(_))break;if(U=='"'||U=="'"){M=U,Q=Se;break}g.attrValue+=U,Q=z;break;case z:if(U.match(_)){Q=we;break}if(U=="]"){Q=R;break}if(U=="'"||U=='"')throw Error(N);g.attrValue+=U;break;case Se:if(U==M){Q=we;break}g.attrValue+=U;break;case Ae:if(U.match(_))break;if(U==","){Q=W;break}throw Error(N)}}switch(Q){case W:case P:case R:case V:case Ae:S();break;default:throw Error(N)}if(!v.length)throw Error(N);return v},w.nextUid=1,w.matchesSelector="matches",w})(),y=(function(){function w(){}return w.createObserverOptions=function(b){var v={childList:!0,subtree:!0},A;function g(S){if(!(v.attributes&&!A)){if(v.attributes=!0,v.attributeOldValue=!0,!S){A=void 0;return}A=A||{},S.forEach(function(T){A[T]=!0,A[T.toLowerCase()]=!0})}}return b.forEach(function(S){if(S.characterData){v.characterData=!0,v.characterDataOldValue=!0;return}if(S.all){g(),v.characterData=!0,v.characterDataOldValue=!0;return}if(S.attribute){g([S.attribute.trim()]);return}var T=w._elementFilterAttributes(S.elementFilter).concat(S.attributeList||[]);T.length&&g(T)}),A&&(v.attributeFilter=Object.keys(A)),v},w.validateOptions=function(b){for(var v in b)if(!(v in w._optionKeys))throw Error("Invalid option: "+v);if(typeof b.callback!="function")throw Error("Invalid options: callback is required and must be a function");if(!b.queries||!b.queries.length)throw Error("Invalid options: queries must contain at least one query request object.");for(var A={callback:b.callback,rootNode:b.rootNode||document,observeOwnChanges:!!b.observeOwnChanges,oldPreviousSibling:!!b.oldPreviousSibling,queries:[]},g=0;g<b.queries.length;g++){var S=b.queries[g];if(S.all){if(Object.keys(S).length>1)throw Error("Invalid request option. all has no options.");A.queries.push({all:!0});continue}if("attribute"in S){var T={attribute:w._validateAttribute(S.attribute)};if(T.elementFilter=h.parseSelectors("*["+T.attribute+"]"),Object.keys(S).length>1)throw Error("Invalid request option. attribute has no options.");A.queries.push(T);continue}if("element"in S){var _=Object.keys(S).length,T={element:S.element,elementFilter:h.parseSelectors(S.element)};if(S.hasOwnProperty("elementAttributes")&&(T.attributeList=w._validateElementAttributes(S.elementAttributes),_--),_>1)throw Error("Invalid request option. element only allows elementAttributes option.");A.queries.push(T);continue}if(S.characterData){if(Object.keys(S).length>1)throw Error("Invalid request option. characterData has no options.");A.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return A},w._validateElementAttributes=function(b){if(!b.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var v={},A={},g=b.split(/\s+/),S=0;S<g.length;S++){var T=g[S];if(T){T=w._validateAttribute(T);var _=T.toLowerCase();if(v[_])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");A[T]=!0,v[_]=!0}}return Object.keys(A)},w._elementFilterAttributes=function(b){var v={};return b.forEach(function(A){A.qualifiers.forEach(function(g){v[g.attrName]=!0})}),Object.keys(v)},w._validateAttribute=function(b){if(typeof b!="string"||(b=b.trim(),!b))throw Error("Invalid request option. attribute must be a non-zero length string.");if(!b.match(w._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+b);return b},w._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,w._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},w})(),E=(function(){function w(b){var v=this;this._connected=!1,this._options=y.validateOptions(b),this._observerOptions=y.createObserverOptions(this._options.queries),this._root=this._options.rootNode,this._callback=this._options.callback,this._elementFilter=Array.prototype.concat.apply([],this._options.queries.map(function(A){return A.elementFilter?A.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(A){return A.all}),this._queryValidators=[],w.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(A){return w.createQueryValidator(v._root,A)})),this._observer=new MutationObserver(function(A){v._observerCallback(A)}),this.reconnect()}return w.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},w.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var b=this._createSummaries(this._observer.takeRecords());return this._changesToReport(b)?b:void 0},w.prototype.disconnect=function(){var b=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,b},w.prototype._observerCallback=function(b){this._options.observeOwnChanges||this._observer.disconnect();var v=this._createSummaries(b);this._runQueryValidators(v),this._options.observeOwnChanges&&this._checkpointQueryValidators(),this._changesToReport(v)&&this._callback(v),!this._options.observeOwnChanges&&this._connected&&(this._checkpointQueryValidators(),this._observer.observe(this._root,this._observerOptions))},w.prototype._createSummaries=function(b){if(!b||!b.length)return[];for(var v=new c(this._root,b,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),A=[],g=0;g<this._options.queries.length;g++)A.push(new u(v,this._options.queries[g]));return A},w.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(b){b&&b.recordPreviousState()})},w.prototype._runQueryValidators=function(b){this._queryValidators.forEach(function(v,A){v&&v.validate(b[A])})},w.prototype._changesToReport=function(b){return b.some(function(v){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(A){return v[A]&&v[A].length})||v.attributeChanged&&Object.keys(v.attributeChanged).some(function(A){return!!v.attributeChanged[A].length}))})},w})(),C=(function(){function w(b,v){this.root=b,this.delegate=v,this.idMap={}}return w.prototype.initialize=function(b,v){this.idMap[b]=this.root;for(var A=0;A<v.length;A++)this.deserializeNode(v[A],this.root)},w.prototype.applyChanged=function(b,v,A,g){var S=this;v.forEach(function(T){var _=S.deserializeNode(T);S.deserializeNode(T.parentNode),S.deserializeNode(T.previousSibling),_.parentNode&&_.parentNode.removeChild(_)}),b.forEach(function(T){var _=S.deserializeNode(T);_.parentNode&&_.parentNode.removeChild(_)}),v.forEach(function(T){var _=S.deserializeNode(T),M=S.deserializeNode(T.parentNode),N=S.deserializeNode(T.previousSibling);M.insertBefore(_,N?N.nextSibling:M.firstChild)}),A.forEach(function(T){var _=S.deserializeNode(T);Object.keys(T.attributes).forEach(function(M){var N=T.attributes[M];N===null?_.removeAttribute(M):(!S.delegate||!S.delegate.setAttribute||!S.delegate.setAttribute(_,M,N))&&_.setAttribute(M,N)})}),g.forEach(function(T){var _=S.deserializeNode(T);_.textContent=T.textContent}),b.forEach(function(T){delete S.idMap[T.id]})},w.prototype.deserializeNode=function(b,v){var A=this;if(b===null)return null;var g=this.idMap[b.id];if(g)return g;var S=this.root.ownerDocument;switch(S===null&&(S=this.root),b.nodeType){case Node.COMMENT_NODE:g=S.createComment(b.textContent);break;case Node.TEXT_NODE:g=S.createTextNode(b.textContent);break;case Node.DOCUMENT_TYPE_NODE:g=S.implementation.createDocumentType(b.name,b.publicId,b.systemId);break;case Node.ELEMENT_NODE:this.delegate&&this.delegate.createElement&&(g=this.delegate.createElement(b.tagName)),g||(g=S.createElement(b.tagName)),Object.keys(b.attributes).forEach(function(_){(!A.delegate||!A.delegate.setAttribute||!A.delegate.setAttribute(g,_,b.attributes[_]))&&g.setAttribute(_,b.attributes[_])});break;default:throw"Unsupported node type: "+b.nodeType}if(this.idMap[b.id]=g,v&&v.appendChild(g),b.childNodes)for(var T=0;T<b.childNodes.length;T++)this.deserializeNode(b.childNodes[T],g);return g},w})(),k=(function(){function w(b,v,A){var g=this;this.target=b,this.mirror=v,this.nextId=1,this.knownNodes=new r;for(var S=this.serializeNode(b).id,T=[],_=b.firstChild;_;_=_.nextSibling)T.push(this.serializeNode(_,!0));this.mirror.initialize(S,T);var M=[{all:!0}];A&&(M=M.concat(A)),this.mutationSummary=new E({rootNode:b,callback:function(N){g.applyChanged(N)},queries:M})}return w.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},w.prototype.rememberNode=function(b){var v=this.nextId++;return this.knownNodes.set(b,v),v},w.prototype.forgetNode=function(b){this.knownNodes.delete(b)},w.prototype.serializeNode=function(b,v){if(b===null)return null;var A=this.knownNodes.get(b);if(A!==void 0)return{id:A};var g={nodeType:b.nodeType,id:this.rememberNode(b)};switch(g.nodeType){case Node.DOCUMENT_TYPE_NODE:var S=b;g.name=S.name,g.publicId=S.publicId,g.systemId=S.systemId;break;case Node.COMMENT_NODE:case Node.TEXT_NODE:g.textContent=b.textContent;break;case Node.ELEMENT_NODE:var T=b;g.tagName=T.tagName,g.attributes={};for(var _=0;_<T.attributes.length;_++){var M=T.attributes[_];g.attributes[M.name]=M.value}if(v&&T.childNodes.length){g.childNodes=[];for(var N=T.firstChild;N;N=N.nextSibling)g.childNodes.push(this.serializeNode(N,!0))}}return g},w.prototype.serializeAddedAndMoved=function(b,v,A){var g=this,S=b.concat(v).concat(A),T=new r;S.forEach(function(M){var N=M.parentNode,W=T.get(N);W||(W=new r,T.set(N,W)),W.set(M,!0)});var _=[];return T.keys().forEach(function(M){for(var N=T.get(M),W=N.keys();W.length;){for(var P=W[0];P.previousSibling&&N.has(P.previousSibling);)P=P.previousSibling;for(;P&&N.has(P);){var R=g.serializeNode(P);R.previousSibling=g.serializeNode(P.previousSibling),R.parentNode=g.serializeNode(P.parentNode),_.push(R),N.delete(P),P=P.nextSibling}W=N.keys()}}),_},w.prototype.serializeAttributeChanges=function(b){var v=this,A=new r;return Object.keys(b).forEach(function(g){b[g].forEach(function(S){var T=A.get(S);T||(T=v.serializeNode(S),T.attributes={},A.set(S,T)),T.attributes[g]=S.getAttribute(g)})}),A.keys().map(function(g){return A.get(g)})},w.prototype.applyChanged=function(b){var v=this,A=b[0],g=A.removed.map(function(M){return v.serializeNode(M)}),S=this.serializeAddedAndMoved(A.added,A.reparented,A.reordered),T=this.serializeAttributeChanges(A.attributeChanged),_=A.characterDataChanged.map(function(M){var N=v.serializeNode(M);return N.textContent=M.textContent,N});this.mirror.applyChanged(g,S,T,_),A.removed.forEach(function(M){v.forgetNode(M)})},w})();if(MutationObserver===void 0)throw Error("DOM Mutation Observers are required");n.ChildListChange=o,n.MutationProjection=c,n.MutationSummary=E,n.NodeChange=a,n.NodeMap=r,n.Qualifier=d,n.Selector=h,n.Summary=u,n.TreeChanges=l,n.TreeMirror=C,n.TreeMirrorClient=k,Object.defineProperty(n,"__esModule",{value:!0})}))})),JC=QC(),oo=0,io=new Array(1e3);function eA(){for(let e=0;e<oo;e+=2){const t=io[e],n=io[e+1];t(...n),io[e]=void 0,io[e+1]=void 0}oo=0}function tA(e,...t){io[oo]=e,io[oo+1]=t,oo+=2,oo===2&&rA()}function nA(){let e=0;const t=new MutationObserver(eA),n=document.createTextNode("");return t.observe(n,{characterData:!0}),()=>{n.data=String(e=++e%2)}}var rA=nA();function kp(){tA(()=>{Dc.hasListeners()&&(Dc.fire(),kp())})}var Dc=new Me({onFirstListenerAdd:kp}),Ks=Dc.once;function oA(e,t,n){const r=new Me;let o=[];return r.addDisposable(e(i=>{Ks(()=>{r.fire(t(o)),o=[]}),o.push(i)})),n?.addDisposable(r),r.event}var iA=class extends Me{constructor(e={}){super(),L(this,"_mutationSummary",void 0),this._mutationSummary=new JC.MutationSummary({...e,observeOwnChanges:!0,callback:t=>this.fire(t),queries:[{all:!0}]})}dispose(){this._mutationSummary.disconnect(),super.dispose()}trigger(e){if(this.isDisposed())return;const t=this._mutationSummary.takeSummaries();return(e||t?.length)&&this.fire(t||[]),t}},sA=class extends Ee{_nextTickHandler(){Ks(()=>{this.trigger(),this._summaries.length&&(this._innerEmitter.hasListeners()?this._innerEmitter.fire(this._summaries):this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)}constructor(e={}){super(),L(this,"_mutationEmitter",void 0),L(this,"_innerEmitter",this.addDisposable(new Me({onFirstListenerAdd:()=>{this._nextTickHandler()}}))),L(this,"_lostEmitter",this.addDisposable(new Me)),L(this,"_paused",0),L(this,"_stopped",0),L(this,"_summaries",[]),L(this,"onMutate",this._innerEmitter.event),L(this,"onLost",this._lostEmitter.event),L(this,"onNativeMutate",void 0),this._mutationEmitter=this.addDisposable(new iA(e)),this.onNativeMutate=this._mutationEmitter.event,this.addDisposable(this._mutationEmitter.event(t=>{this._stopped||(this._paused?this._lostEmitter.fire(t):(this._summaries.push(...t),Ks(()=>{this._summaries.length&&!this._innerEmitter.hasListeners()&&(this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)))}))}get isStoped(){return this._paused>0||this._stopped>0}stop(){this._mutationEmitter.trigger(),this._stopped++}start(){this._mutationEmitter.trigger(),this._stopped--}pause(){this._mutationEmitter.trigger(),this._paused++}resume(){this._mutationEmitter.trigger(),this._paused--}trigger(){this._mutationEmitter.trigger(!0)}},aA=Ks,lA=class extends Ee{beginTextUpdate(){this._baseDocument.beginUpdate()}endTextUpdate(){this._baseDocument.endUpdate()}constructor(e,t,n){super(),L(this,"_baseDocument",void 0),L(this,"_remoteDocument",void 0),L(this,"_parsedDocument",void 0),L(this,"_nodeMap",void 0),L(this,"_beforeChangeEmitter",this.addDisposable(new Me)),L(this,"_beforeCommitEmitter",this.addDisposable(new Me)),L(this,"_onRefreshEmitter",this.addDisposable(new Me)),L(this,"_documentElement",void 0),L(this,"_docType",void 0),L(this,"_parseFn",void 0),L(this,"_mapHTMLRoots",void 0),L(this,"_roots",void 0),L(this,"_getRootsParent",void 0),L(this,"_mutationCollector",this.addDisposable(new sA)),L(this,"_attributeMapper",void 0),L(this,"ownership",void 0),L(this,"_reportedDrifts",new Set),L(this,"_commitPromise",void 0),L(this,"_pushUndoStop",!1),L(this,"_locked",!1),L(this,"_treeMutations",[]),L(this,"beforeChange",this._beforeChangeEmitter.event),L(this,"beforeCommit",this._beforeCommitEmitter.event),L(this,"onChange",Tw(oA(this._mutationCollector.onNativeMutate,o=>o.flat(),this),o=>o.length>0,this)),L(this,"onRefresh",this._onRefreshEmitter.event),this._baseDocument=e,this._remoteDocument=t,this._parseFn=n.prepareHtml,this._mapHTMLRoots=n.mapHTMLRoots,this._getRootsParent=n.rootsParent,this._roots=[...document.childNodes];const r=this._parsedDocument=new C0(e,n.createRoot);this._nodeMap=new tC,this.addDisposable(r.onRefresh(this._onRefresh.bind(this))),this.addDisposable(r.onMutate(this._onRemoteMutate.bind(this))),this._attributeMapper=new jC(this._nodeMap),this.addDisposable(cC(()=>this._mutationCollector.pause())),this.addDisposable(uC(()=>this._mutationCollector.resume())),this.addDisposable(this._mutationCollector.onLost(o=>this._attributeMapper.onHiddenMutate(o))),this.ownership=new GC(o=>!!this._nodeMap.getByElement(o)),this.addDisposable(this._mutationCollector.onLost(o=>this.ownership.observeLost(o)))}isUntracked(e){return this.ownership.isMarked(e)}markUntracked(e){this.ownership.markForeign(e)}_reportForeignStructure(e){try{const t=n=>!!this._nodeMap.getByElement(n);ZC(XC(e,this.ownership,t),this._reportedDrifts),KC(YC(e,t),this._reportedDrifts)}catch{}}commit(e=!0,t=!1){if(e&&(this._pushUndoStop=!0),t&&(this._locked=!0),!this._commitPromise){const n=()=>new Promise(r=>{try{this._beforeCommitEmitter.fire()}catch{}const o=this._mutationCollector.onMutate(i=>{i.length&&(this._reportForeignStructure(i),$s("commit",()=>{const s=PC(i,this._nodeMap,this._parseFn,this._rootsParent());this._commit(s)}))});aA(()=>{const i=()=>{this._pushUndoStop=!1,this._commitPromise=void 0,this._locked=!1,r()};t?this._remoteDocument.saveChangesAsync(this._pushUndoStop).finally(i):(this._remoteDocument.saveChanges(this._pushUndoStop),i()),o.dispose()})});this._commitPromise=n()}return this._commitPromise}whenSent(){return this._remoteDocument.whenSent()}renderOnly(e){this._mutationCollector.stop();try{return e()}finally{this._mutationCollector.start()}}applyHidden(e){this._mutationCollector.pause();try{return e()}finally{this._mutationCollector.resume()}}_rootsParent(){const e=this._getRootsParent?.();return e?{node:e,treeNode:this._parsedDocument.root}:void 0}getMappedParent(e){for(;e;){const t=this._nodeMap.getByElement(e);if(t){const n=this._parsedDocument.getContext(t);return n?this._nodeMap.getByNode(n):void 0}else e=e.parentNode}}getContext(e){return this.getMappedParent(e)||e}isInExternal(e){return this.getContext(e)!==e}isVisible(e){return!!this._nodeMap.getByElement(e)}getVisibleNode(e){let t=e;do{if(!t||this._nodeMap.getByElement(t))return t;t=t.parentNode||void 0}while(t)}_commit(e){if(e.length){e=this._attributeMapper.beforeCommit(e),e=IC(e);try{this._baseDocument.beginUpdate();const t=this._parsedDocument;Pf(()=>{const n=ep(t.applyingMutation,r=>this._nodeMap.getByNode(r),r=>t.isAttached(r));return n&&{...n,stage:"tree"}},()=>t.applyMutations(e));for(const n of e)n.type==="Hidden"&&this._nodeMap.remove(n.node,n.value)}finally{this._baseDocument.endUpdate()}}}correctNodes(e){const t=new Map;for(const n of e)if(!t.has(n)&&this._parsedDocument.contains(n)&&n.type===$.ELEMENT){const r=pc(n,!1,!1);r!==this._baseDocument.getText({start:n.start,end:n.startTagEnd===void 0?n.start:n.startTagEnd})+this._baseDocument.getText({start:n.endTagStart===void 0?n.end:n.endTagStart,end:n.end})&&t.set(n,r)}try{this._baseDocument.beginUpdate();for(const[n,r]of t)if(r!==this._baseDocument.getText({start:n.start,end:n.end})){const o=this._parsedDocument.replaceWithEx(n,r,Qr),i=this._nodeMap.getByNode(n);i&&(this._nodeMap.remove(n),this._nodeMap.set(o,i))}}finally{this._baseDocument.endUpdate()}}_onRefresh(e){try{$s("refresh",()=>this._onRemoteMutate(e,!0))}finally{this._onRefreshEmitter.fire()}}_onRemoteMutate(e,t){if(this._treeMutations.push([e,t,Ww()??"other"]),!(this._remoteDocument.hasChanges()&&!this._remoteDocument.isApplyingRemote()))for(const[n,r,o]of this._treeMutations)$s(o,()=>this._doOnRemoteMutate(n,r))}_doOnRemoteMutate(e,t){try{if(this._mutationCollector.stop(),e=oC(this._attributeMapper.onRemoteMutate(e),this._nodeMap),this._treeMutations=[],!t){const r=this._parsedDocument.root;for(const o of e)if(o.type==="Add"){if(o.parent===r){t=!0;break}}else if(o.type==="Remove"){if(o.node.parent===r){t=!0;break}}else if(o.type==="Move"&&(o.node.parent===r||o.parent===r)){t=!0;break}}const n=Z0(e,this._nodeMap,r=>this._parsedDocument.isAttached(r));if(this._beforeChangeEmitter.fire({domMutations:n.mutations,treeMutations:e}),J0(n,this._nodeMap),this._attributeMapper.restoreHidden(),t){const r=this._parsedDocument.root?.children;if(r){const o=r.map(s=>this._nodeMap.getByNode(s)).filter(s=>!!s),i=this._roots=this._mapHTMLRoots(o,this);Mc.isEqual(o,i)}}}finally{this._mutationCollector.start()}}getLinks(e){const t=this._nodeMap.getByElement(e),n=t?[[t,e]]:[];for(const r of e.childNodes)n.push(...this.getLinks(r));return n}setLinks(e){for(const[t,n]of e)this._nodeMap.set(t,n)}_clearLinks(e){for(const[t]of e)this._nodeMap.remove(t)}_removeByLinks(e,t){const n=new Set,r=[];for(const[o,i]of e)o.parent&&!n.has(o.parent)&&(this._parsedDocument.remove(o,t),r.unshift(ue.remove(i))),n.add(o);return r}getInnerHtml(e){let t=this._nodeMap.getByElement(e);return t?this._baseDocument.getText({start:t.startTagEnd===void 0?t.start:t.startTagEnd,end:t.endTagStart===void 0?t.end:t.endTagStart}):""}getOuterHtml(e){let t=this._nodeMap.getByElement(e);return t?this._baseDocument.getText({start:t.start,end:t.end}):""}setInnerHtml(e,t){if(e instanceof Element)e.innerHTML=t;else if(e instanceof Comment)e.data=t;else if(e instanceof Document){nt("not supported inner html of Document");return}else e instanceof Text&&(e.textContent=t)}getElementByPosition(e){let t=this._parsedDocument.getNodeByPosition(e);if(t){let n;do n=this._nodeMap.getByNode(t);while(!n&&(t=t?.parent));return n}}getRangeByElement(e,t=!1){if(e){let n=null;do n=this._nodeMap.getByElement(e);while(t&&!n&&(e=e.parentElement));if(n)return{start:n.start,end:n.end}}}},cA=class{constructor(){L(this,"_changes",null)}get(){return this._changes}hasChanges(){return!!this._changes?.length}add(e){const t=en(this._changes,e);this._changes=t.length?t:null}clear(){this._changes=null}replace(e){this._changes=e.length?e:null}correctOffset(e,t){const n=this._changes;if(n){let r=0;for(let o=0,i=n.length;o<i;o++){const s=n[o];if(s.oldPosition<e)r+=s.newLength-s.oldLength;else break}e=e+(t?1:-1)*r}return e}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}},Lp=60;function uA(e,t){if(e===t)return;const n=Math.min(e.length,t.length);let r=0;for(;r<n&&e[r]===t[r];)r+=1;return{offset:r,ownLength:e.length,cachedLength:t.length,own:e.substring(r,r+Lp),cached:t.substring(r,r+Lp)}}var dA=class extends Ee{constructor(...e){super(...e),L(this,"_onApplyEmitter",this.addDisposable(new Me)),L(this,"_onEmptyEmitter",this.addDisposable(new Me)),L(this,"_dispatched",[]),L(this,"onApply",this._onApplyEmitter.event),L(this,"onEmpty",this._onEmptyEmitter.event)}_emit(e){e.length&&this._onApplyEmitter.fire(e),this.hasDispatched()||this._onEmptyEmitter.fire()}hasDispatched(){return!!this._dispatched.length}append(e,t){this._dispatched.unshift({changeId:t,textChanges:e})}apply(e,t){const n=t===void 0?-1:this._dispatched.findIndex(r=>r.changeId===t);if(n>=0){this._confirmEcho(n,e);return}this._applyExternal(e)}_confirmEcho(e,t){const[n]=this._dispatched.splice(e,1);this._emit(en(Bn(n.textChanges),t))}_applyExternal(e){let t=[];for(const n of this._dispatched)t=en(t,Bn(n.textChanges));this._dispatched=[],this._emit(en(t,e))}clear(){this._dispatched=[]}},mA=class wS extends Ee{constructor(t=""){super(),L(this,"_text",void 0),this._text=t}getText(t){const n=t0(this,t);return n?this._text.substring(n.start,n.end):""}getLength(){return this._text.length}clone(){return new wS(this._text)}},Zs=class CS extends mA{constructor(t=""){super(t),L(this,"_eventQueue",void 0),L(this,"_lockCounter",0),L(this,"_onChangeEmitter",this.addDisposable(new Me)),L(this,"_onChangedEmitter",this.addDisposable(new Me)),L(this,"onChanged",this._onChangedEmitter.event)}applyEdits(t,n){if(n=n.flatMap(r=>a0(this,r)),n.length){const r=Zr(n,this);this._eventQueue&&this._eventQueue.push({source:t,changes:r}),this.change(t,n),this._eventQueue||this._onChangedEmitter.fire({source:t,changes:r})}}change(t,n){this._text=o0(this._text,n)}beginUpdate(){this._lockCounter++===0&&(this._eventQueue=[])}endUpdate(t){const n=this._eventQueue;if(--this._lockCounter===0&&n&&(this._eventQueue=void 0,n.length)){t===void 0&&(t=n[0].source);let r=null;for(const{changes:o}of n)r=en(r,o);if(r=r?.filter(o=>o.oldPosition!==o.newPosition||o.newText!==o.oldText),r?.length)return this._onChangedEmitter.fire({source:t,changes:r}),!0}return!1}clone(){return new CS(this._text)}};function Np(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function Qs(e){const t=e.indexOf("(");if(t<0)return!0;let n=0,r="",o=!1;for(let i=t;i<e.length;i++){const s=e[i];if(o){o=!1;continue}if(s==="\\"){o=!0;continue}if(r){s===r&&(r="");continue}if(s==='"'||s==="'"){r=s;continue}if(s==="("){n++;continue}if(s===")"&&(n--,n<0))return!1}return n===0}function fA(e){return(t,n,r)=>Qs(t)?e(t,n,r):!1}function pA(e){return t=>Qs(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function hA(e){return(t,n,r)=>Qs(t)?Np(t)?e(t,n,r):t:!1}function gA(e){return t=>{const n=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return Qs(n)?Np(n)?e(t):t:!1}}function bA(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function Bc(e,t){const n=e.length;for(let r=0;r<n;r++){const o=e.charCodeAt(r);if(o===0||t==='"'&&o===34||t==="'"&&o===39||t===""&&(o===32||o===9||o===10||o===13||o===12||o===34||o===39||o===60||o===62||o===61||o===96))return!1}return!0}function yA(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",r=new Uint8Array(e);crypto.getRandomValues(r);let o="";for(let i=0;i<e;i++){const s=r[i]%62;o+=t.charAt(s)}return o}var vA=8,EA=class{constructor(){L(this,"_byKey",Object.create(null)),L(this,"_byValue",Object.create(null))}getOrCreateByKey(e){let t=this._byKey[e];return t===void 0&&(t=yA(vA),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},Js=new EA;function xp(e,t){return t!==void 0&&!Bc(e,t)?`%|{${Js.getOrCreateByKey(e)}}|%`:e}function SA(e){const t=Js.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function Ye(e,t,n){return t!==void 0?Bc(e,t)?e:`%|{${Js.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function wA(e){return e.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")}function ze(e){return e.startsWith("<!--")&&e.endsWith("-->")?wA(e.slice(4,-3)):e}function CA(e){const t=/^(IF|ELSE|ELSIF|ELSEIF|END|FOREACH|WHILE|NEXT|LAST|BREAK|DO|UNLESS|CONTINUE|SET|UNSET|DEFINE|INCLUDE)\b/i,n=/\w+\s*\(/;let r=e;const o=e.match(/\[%\s*([^%]*?)\s*%\]/);o&&(r=o[1]);const i=r.trim();return t.test(i)||n.test(i)}function AA(e,t,n){return t!==void 0?Bc(e,t)?e:`%|{${Js.getOrCreateByKey(e)}}|%`:n||bA(e)||CA(e)?`<!--${e}-->`:e}var yr=fA(Ye),vr=pA(ze),TA=hA(Ye),_A=gA(ze),kA=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",SA),e.escape("@{","}",Ye,!0).unescape("<!--@{","}-->",ze,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",xp,!0),e.escape("{{","}}",xp,!0),e.createSyntax("brace-percent").escape("{%","%}",Ye).unescape("<!--{%","%}-->",ze),e.createSyntax("brace-hash").escape("{#","#}",Ye).unescape("<!--{#","#}-->",ze),e.createSyntax("proscript").escape("[%","%]",AA,!0).unescape("<!--[%","%]-->",ze,!0),e.createSyntax("getresponse").escape("[[IF","]]",Ye).escape("[[if","]]",Ye).escape("[[ELSE]]","",Ye).escape("[[else]]","",Ye).escape("[[ENDIF]]","",Ye).escape("[[endif]]","",Ye).unescape("<!--[[IF","]]-->",ze).unescape("<!--[[if","]]-->",ze).unescape("<!--[[ELSE]]","-->",ze).unescape("<!--[[else]]","-->",ze).unescape("<!--[[ENDIF]]","-->",ze).unescape("<!--[[endif]]","-->",ze),e.createSyntax("expert-sender").escape("<if",">",Ye).escape("</if",">",Ye).escape("<else",">",Ye).escape("</else",">",Ye).escape("<var ",">",Ye,!0).unescape("<!--<if ",">-->",ze).unescape("<!--</if",">-->",ze).unescape("<!--<else ",">-->",ze).unescape("<!--</else",">-->",ze).unescape("<!--<var",">-->",ze,!0),e.createSyntax("velocity").escape("#if",")",yr).escape("#elseif",")",yr).escape("#else","",Ye).escape("#foreach",")",yr).escape("#macro",")",yr).escape("#set",")",TA,!0).escape("#parse",")",yr).escape("#include",")",yr).escape("#evaluate",")",yr).escape("#end","",Ye).escape("#break","",Ye).escape("#stop","",Ye).unescape("<!--#macro","-->",vr).unescape("<!--#if","-->",vr).unescape("<!--#elseif","-->",vr).unescape("<!--#else","-->",ze).unescape("<!--#foreach","-->",vr).unescape("<!--#parse","-->",vr).unescape("<!--#include","-->",vr).unescape("<!--#evaluate","-->",vr).unescape("<!--#end","-->",ze).unescape("<!--#break","-->",ze).unescape("<!--#stop","-->",ze).unescape("<!--#set","-->",_A,!0),e.createSyntax("mailchimp").escape("*|","|*",Ye).unescape("<!--*|","|*-->",ze)},Mp="bare",Hc=new Map;function LA(e){for(const t of Object.keys(e)){const n=e[t];n&&Hc.set(t,n)}}function NA(e){return e?Hc.get(e)??Mp:Mp}function xA(){Hc.clear()}function Rp(e,t,n,r){for(let o=t;o<n;o++){const i=e[o];r.insideAttributeValue?r.attributeQuoteChar==='"'||r.attributeQuoteChar==="'"?i===r.attributeQuoteChar&&(r.insideAttributeValue=!1,r.attributeQuoteChar=void 0):r.unquotedAttr&&/[\s>]/.test(i)&&(r.insideAttributeValue=!1,r.attributeQuoteChar=void 0,r.unquotedAttr=!1):i==="<"?r.insideTag=!0:i===">"?r.insideTag=!1:r.insideTag&&(i==='"'||i==="'")?(r.insideAttributeValue=!0,r.attributeQuoteChar=i,r.unquotedAttr=!1):r.insideTag&&/\S/.test(i)&&r.attributeQuoteChar===void 0&&e[o-1]==="="&&!['"',"'","`"].includes(i)&&(r.insideAttributeValue=!0,r.attributeQuoteChar="",r.unquotedAttr=!0)}}function si(e,t){return e.start<t.end&&t.start<e.end}function Op(e,t,n,r,o=[]){if(n&&(t=t.filter(u=>u.isVariable)),!t.length)return[];const i=t.flatMap(u=>u.match(e).flatMap(d=>!Number.isInteger(d.start)||!Number.isInteger(d.end)||d.start<0||d.end>e.length||d.start>=d.end?[]:[{range:d,mapFn:u.mapFn,overrideBuiltins:u.overrideBuiltins,syntax:u.syntax,isVariable:u.isVariable}])).sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end),s=[],a=o.slice().sort((u,d)=>u.start-d.start),l={insideTag:!1,insideAttributeValue:!1,attributeQuoteChar:void 0,unquotedAttr:!1};let c=0;for(const{range:u,mapFn:d,overrideBuiltins:m,syntax:p,isVariable:f}of i){if(r?(l.insideAttributeValue=!0,l.attributeQuoteChar='"'):Rp(e,c,u.start,l),c=u.end,a.some(C=>si(C,u)))continue;const h=l.insideAttributeValue?l.attributeQuoteChar??"":void 0,y=e.substring(u.start,u.end),E=d(y,h,l.insideTag);E!==!1&&E!==y&&(s.push({range:u,text:E,overrideBuiltins:m,syntax:p,isVariable:f}),a.push(u))}return s.sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end)}function MA(e,t){const n=t.reduce((a,{mapFn:l,start:c,end:u,syntax:d,isVariable:m})=>(a[c]||(a[c]=[]),a[c].push({value:u,mapFn:l,syntax:d,isVariable:m}),a),Object.create(null)),r=Object.keys(n).map(a=>a.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&")).join("|"),o=new RegExp(r,"g"),i=[];let s;for(;(s=o.exec(e))!==null;){const a=s[0];i.push({start:s.index,startToken:a,endTokens:n[a]})}return i}function Fc(e,t,n,r,o=!1){const i=[];if(n&&(t=t.filter(c=>c.isVariable)),!t.length)return i;const s=MA(e,t),a={insideTag:!1,insideAttributeValue:!1,attributeQuoteChar:void 0,unquotedAttr:!1};let l=0;for(let c=0;c<s.length;c++){const{start:u,startToken:d,endTokens:m}=s[c];r?(a.insideAttributeValue=!0,a.attributeQuoteChar='"'):Rp(e,l,u,a),l=u;const p=a.insideAttributeValue?a.attributeQuoteChar??"":void 0;let f=!1;for(const{mapFn:h,value:y,syntax:E,isVariable:C}of m){let k=u+d.length,w=e.indexOf(y,k);for(;w!==-1;){let b=w,v=u+d.length,A=0;for(;b!==-1;){const M=e.indexOf(d,v);if(M!==-1&&M<b)A++,v=M+d.length,b=e.indexOf(y,v);else if(A>0)A--,v=b+y.length,b=e.indexOf(y,v);else break}if(b<0)break;const g=b+y.length,S=e.substring(u,g),T=h(S,p,a.insideTag);if(T===!1){k=w+Math.max(y.length,1),w=e.indexOf(y,k);continue}(o||T!==S)&&i.push({range:{start:u,end:g},text:o?S:T,syntax:E,isVariable:C});const _=s.findIndex(({start:M})=>M>=g);_>c?c=_-1:c=s.length,f=!0;break}if(f)break}}return i}function ea(e,t){if(!t.length)return e;const n=t.slice().sort((o,i)=>i.range.start-o.range.start);let r=e;for(const{text:o,range:i}of n)r=r.slice(0,i.start)+o+r.slice(i.end);return r}var Pp=class{constructor(e=kA){L(this,"_disposables",[]),L(this,"_escapes",[]),L(this,"_unescapes",[]),L(this,"_escapeMatchers",[]),L(this,"_unescapeMatchers",[]);const{_escapes:t,_unescapes:n}=this;e({createSyntax(r){return{...this,syntax:r}},escape(r,o,i,s){return t.push({start:r,end:o,mapFn:i,isVariable:s,syntax:this.syntax||r}),this},unescape(r,o,i,s){return n.push({start:r,end:o,mapFn:i,isVariable:s,syntax:this.syntax||r}),this}})}registerMatcherPair(e){const t=e.syntax||"matcher",n={syntax:t,match:e.escape.match,mapFn:e.escape.mapFn,isVariable:e.escape.isVariable,overrideBuiltins:e.escape.overrideBuiltins},r={syntax:t,match:e.unescape.match,mapFn:e.unescape.mapFn,isVariable:e.unescape.isVariable,overrideBuiltins:e.unescape.overrideBuiltins};this._escapeMatchers.push(n),this._unescapeMatchers.push(r);let o=!1;const i={dispose:()=>{o||(o=!0,this._escapeMatchers=this._escapeMatchers.filter(s=>s!==n),this._unescapeMatchers=this._unescapeMatchers.filter(s=>s!==r))}};return this.addDisposable(i),i}_collectMappings(e,t,n){const r=Fc(e,this._escapes,t,n),o=Op(e,this._escapeMatchers,t,n),i=o.filter(l=>l.overrideBuiltins).map(l=>l.range),s=r.filter(l=>!i.some(c=>si(c,l.range))),a=o.filter(l=>l.overrideBuiltins||!s.some(c=>si(l.range,c.range)));return[...s,...a].sort((l,c)=>l.range.start-c.range.start||l.range.end-c.range.end)}getMappings(e,t,n){return this._collectMappings(e,t,n)}_collectRevertMappings(e,t){const n=Fc(e,this._unescapes,t),r=Op(e,this._unescapeMatchers,t,!1),o=r.filter(a=>a.overrideBuiltins).map(a=>a.range),i=n.filter(a=>!o.some(l=>si(l,a.range))),s=r.filter(a=>a.overrideBuiltins||!i.some(l=>si(a.range,l.range)));return[...i,...s].sort((a,l)=>a.range.start-l.range.start||a.range.end-l.range.end)}getRevertMappings(e,t,n){const r=n?o=>o!==void 0&&n.has(o):o=>NA(o)==="html-comment";return this._collectRevertMappings(e,t).filter(o=>o.isVariable||!r(o.syntax))}getDetectedMappings(e,t,n){return Fc(e,this._escapes,t,n,!0)}getEscapedText(e,t){return ea(e,this.getMappings(e,t))}getUnescapedText(e,t,n){return ea(e,this.getRevertMappings(e,t,n))}normalizeToPolicy(e,t){const n=i=>i===void 0?void 0:t[i],r=Object.values(t);let o=e;return r.includes("bare")&&(o=ea(o,this._collectRevertMappings(o).filter(i=>n(i.syntax)==="bare"))),r.includes("html-comment")&&(o=ea(o,this._collectMappings(o).filter(i=>!i.isVariable&&n(i.syntax)==="html-comment"&&i.text.startsWith("<!--")&&i.text.endsWith("-->")))),o}hasDetectedMappings(e,t,n){return this.getDetectedMappings(e,t,n).length>0}addDisposable(e){this._disposables.push(e)}dispose(){for(const e of this._disposables)e.dispose()}},RA=class extends Zs{constructor(){super(),L(this,"_editStack",new cA),L(this,"_editLog",[]),L(this,"_entityId",void 0),L(this,"_versionController",this.addDisposable(new dA)),L(this,"_beforeSaveEmitter",this.addDisposable(new Aw)),L(this,"_onReadyEmitter",this.addDisposable(new Me)),L(this,"_onEntitySetEmitter",this.addDisposable(new Me)),L(this,"_onPendingSentEmitter",this.addDisposable(new Me)),L(this,"_cache",new Zs),L(this,"beforeSave",this._beforeSaveEmitter.event),L(this,"_reverting",!1),L(this,"_inited",!1),L(this,"_nextChangeId",1),L(this,"_rev",null),L(this,"_pendingSave",null),L(this,"_applyingRemote",!1),L(this,"_handleUpdateEntity",({edits:e,guid:t,changeId:n,rev:r})=>{if(t===this._entityId)return this._reportSyncDrift("update-entity"),this._onRemoteChange(e,n,r)}),L(this,"_handleSetEntity",e=>{this._reportSyncDrift("set-entity"),xA(),LA(e.templateDirectivesPolicy??{}),this._entityId=e.guid,this._onEntitySetEmitter.fire(e.guid),this._editStack.clear(),this._versionController.clear(),this._pendingSave=null,this._onPendingSentEmitter.fire();const t=[[{range:yc(this._cache),text:e.html}]];return this._onRemoteChange(t,void 0,e.rev)}),L(this,"_onRemoteChange",(e,t,n)=>new Promise((r,o)=>{const{_cache:i}=this;let s=[];for(const a of e){const l=a.reverse();s=en(s,Zr(l,i)),i.applyEdits(Jr,l)}this._rev=n??null,this._versionController.apply(s,t),this._versionController.hasDispatched()||this._flushPendingSave(),this._versionController.hasDispatched()?this.addDisposable(this._versionController.onEmpty(()=>{r()})):(this._onReadyEmitter.fire(),r())})),L(this,"onReady",this._onReadyEmitter.event),L(this,"onEntitySet",this._onEntitySetEmitter.event),this.addDisposable(Z.addListenerAsync(Pe.SANDBOX_SET_ENTITY,this._handleSetEntity)),this.addDisposable(Z.addListenerAsync(Pe.SANDBOX_UPDATE_ENTITY,this._handleUpdateEntity)),this._versionController.onApply(this._onApply.bind(this))}loadState(e){this._entityId=e.entityId;const t=[[{range:yc(this._cache),text:e.text}]];this._onRemoteChange(t)}saveState(){return{entityId:this._entityId,text:this.getText()}}_onApply(e){const t=this._editStack.get();if(!t){super.applyEdits(Jr,gr(e));return}const n=Wf(t,e,"after"),r=n&&Wf(e,t,"before");if(!n||!r){this._editStack.clear(),super.applyEdits(Jr,gr(en(Bn(t),e)));return}try{this._applyingRemote=!0,super.applyEdits(Jr,gr(r))}finally{this._applyingRemote=!1}this._editStack.replace(n)}isApplyingRemote(){return this._applyingRemote}_flushPendingSave(){if(this._pendingSave!==null){const e=this._pendingSave;this._pendingSave=null,this.saveChanges(e),this._onPendingSentEmitter.fire()}}whenSent(){return this._pendingSave===null?Promise.resolve():new Promise(e=>{const t=this._onPendingSentEmitter.event(()=>{t.dispose(),e()})})}_reportSyncDrift(e){if(this._editStack.hasChanges()||this._versionController.hasDispatched())return;const t=uA(this.getText(),this._cache.getText());if(t){const{offset:n,ownLength:r,cachedLength:o}=t;js("host-copy-drift",()=>({at:e,text:{offset:n,ownLength:r,cachedLength:o}}))}}applyEdits(e,t){if(!this._reverting){const n=Zr(t,this);this._editStack.add(n),super.applyEdits(e,t),this._editLog.push(t)}}correctOffset(e,t){return this._editStack.correctOffset(e,t)}correctRange(e,t){return this._editStack.correctRange(e,t)}saveChanges(e=!0){if(!this._reverting&&this._rev!==null&&this._versionController.hasDispatched())return this._editStack.hasChanges()&&(this._pendingSave=(this._pendingSave??!1)||e),!0;if(!this._reverting&&this._beforeSaveEmitter.fire(e)!==!1&&this._entityId){const t=this._editStack.get()?.flatMap(n=>l0(n));if(t){const n=this._nextChangeId++;this._editStack.clear(),this._versionController.append(t,n),Z.send(Pe.APPLICATION_UPDATE_ENTITY,{guid:this._entityId,pushUndoStop:e,edits:gr(t),changeId:n,...this._rev!==null?{baseRev:this._rev}:{}})}return!0}return!1}saveChangesAsync(e=!0){return new Promise(t=>{const n=setTimeout(()=>nt("error while async saving"),1e4);if(this.saveChanges(e)===!1&&clearTimeout(n),!this.hasChanges()||this._pendingSave!==null)clearTimeout(n),t();else{const r=this.onReady(()=>{r.dispose(),clearTimeout(n),t()})}})}hasChanges(){return this._editStack.hasChanges()}},OA=class extends Pp{constructor(e,t){super(),L(this,"_baseDocument",void 0),L(this,"_mappedDocument",void 0),L(this,"_mappings",[]),L(this,"_cachedMappedDocument",new Zs),this._baseDocument=e,this._mappedDocument=t,this._baseDocument.onChanged(this._onBaseChange.bind(this),Number.MAX_SAFE_INTEGER),this._mappedDocument.onChanged(this._onMappedChange.bind(this),Number.MAX_SAFE_INTEGER)}_onBaseChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=this._baseDocument.getText(),r=Zr(this.getMappings(n),this._baseDocument),o=Bn(this._mappings);if(t=en(o,t),t=en(t,r),this._mappings=r,t.length){const i=gr(t);this._mappedDocument.applyEdits(e,qs(i))}}}correctOffset(e,t){const n=t?this._mappings:Bn(this._mappings),r=hc(n,({oldPosition:i})=>i>=e),o=r>0?n[r-1]:void 0;return o&&(o.oldEnd>e?e+=o.newPosition-o.oldPosition:e+=o.newEnd-o.oldEnd),e}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}getMappedReplacementRangeAtPosition(e){const t=Bn(this._mappings).find(({oldPosition:n,oldEnd:r})=>e>=n&&e<r);return t?{start:t.oldPosition,end:t.oldEnd}:null}hasMappedReplacementRangeInRange(e){return Bn(this._mappings).some(({oldPosition:t,oldEnd:n})=>t<e.end&&n>e.start)}isMappedElementInPosition(e){return!!this._mappings.find(t=>t.newPosition<e&&t.newEnd>e)}escape(e,t){const n=this.getMappings(e,!1,t);return ti(e,n)}unescape(e){const t=this.getRevertMappings(e);return ti(e,t)}registerMatcherPair(e){const t=super.registerMatcherPair(e);this.rebuildFromBase();let n=!1;return{dispose:()=>{n||(n=!0,t.dispose(),this.rebuildFromBase())}}}rebuildFromBase(e=Jr){const t=this._baseDocument.getText(),n=this.getMappings(t),r=ti(t,n);this._mappings=Zr(n,this._baseDocument),this._mappedDocument.getText()!==r&&this._mappedDocument.applyEdits(e,[{range:{start:0,end:this._mappedDocument.getLength()},text:r}])}_onMappedChange({source:e,changes:t}){if(e!=="FROM_REMOTE"){const n=this._mappedDocument.getText(),r=Zr(this.getRevertMappings(n),this._mappedDocument),o=this._mappings;if(t=en(o,t),t=en(t,r),this._mappings=Bn(r),t.length){const i=gr(t);this._baseDocument.applyEdits(e,qs(i))}}}};function PA(e){let t=e.documentElement;return t||(t=e.createElement("html"),e.appendChild(t)),t}function ai(e){let t=e.head;if(!t){t=e.createElement("head");const n=PA(e);n.insertBefore(t,n.firstChild)}return t}function IA(e){const t=Object.create(null),n=e.getAttributeNames();for(const r of n)t[r]=e.getAttribute(r);return t}function DA(e){for(const t of document.querySelectorAll("iframe"))if(t.contentDocument===e.ownerDocument)return t}function BA(e){const t=ai(e);if(!e.querySelector("style[amp4email-boilerplate]")){const n=e.createElement("style");n.setAttribute("amp4email-boilerplate",""),n.innerHTML="body{visibility:hidden}",t.prepend(n)}}var Ip="amp-custom";function HA(e,t){return`em-${e.replaceAll("-","_")}-${t.toLowerCase()}`}function Dp(e,t,n){for(const r of t)if(ri.isStyleRule(r)){const o=r.selectorText.split(/\+>~/).flatMap(i=>i.trim().split(" "));if(o.length===1&&o[0].trim().startsWith(".em-")){for(const i of r.style)if(r.style.getPropertyPriority(i)==="important"){for(const s of e.querySelectorAll(r.selectorText))if(Nc(s)){const a=s.style;for(const l of[...a])if(l.startsWith(i)){const c=n(l,a.getPropertyValue(l)),u=s.getAttribute("class");s.setAttribute("class",u?`${c} ${u}`:c),a.removeProperty(l)}}}}}else ri.isMediaRule(r)&&Dp(e,r.cssRules,n)}function Bp(e,t){const n=t.sheet;if(n){const i=new Set;Dp(e,n.cssRules,(s,a)=>{const l=HA(s,a),c=[...n.cssRules],u=`.${l} { ${s}: ${a} }`;return!c.find(d=>ri.isStyleRule(d)&&d.selectorText===`.${l}`)&&!i.has(u)&&(i.add(u),t.innerHTML=`
2
+ .${l} { ${s}: ${a} };
3
+ ${t.innerHTML}`),l}),i.size&&(t.innerHTML=`
4
+ ${[...i].join(`
5
+ `)};
6
+ ${t.innerHTML}`)}const r=t.innerHTML,o=r.replace(/!important/g,"");r!==o&&(t.innerHTML=o)}function FA(e){const t=ai(e),n=e.querySelectorAll('link[rel="stylesheet"]'),r=[...e.querySelectorAll("style")].filter(i=>!i.hasAttribute("amp4email-boilerplate"));if(r.length===1){const i=r[0];if(i.parentElement===t&&i.getAttribute(Ip)===""){Bp(e,i);return}}const o=[];for(const i of r)o.push(i.innerHTML),i.remove();if(o.length){const i=e.createElement("style");i.innerHTML=`
7
+ ${o.join("")}
8
+ `,i.setAttribute(Ip,""),t.append(i),Bp(e,i)}for(const i of n)i.remove()}var $c="<!doctype html>";function $A(e){const t=e.doctype;if(t){if(tp(t)===$c)return;const n=new DOMParser().parseFromString($c,"text/html").doctype;e.replaceChild(n,t)}else{const n=new DOMParser().parseFromString($c,"text/html").doctype;e.insertBefore(n,e.firstChild)}}async function Hp(e,t={}){const n=document.createElement("amp-img"),r=await X0(e)||void 0,o=[];try{let i=e;for(;i&&Nc(i);)getComputedStyle(i)?.display==="none"&&(i.style.display="initial",o.push([i,i.style.display])),i=i.parentElement;const s=r?.height?`${parseInt(r.height)}`:"",a=r?.width?`${parseInt(r.width)}`:"",l=DA(e);let c=!1;if(l){const d=l.getAttribute("width");try{let m=a?`${a}px`:"";d||(l.setAttribute("width","720px"),m=getComputedStyle(e).width||""),l.setAttribute("width",!d||parseInt(d)>320?"320px":"720px"),m!==(getComputedStyle(e).width||"")&&(c=!0)}finally{d&&l.setAttribute("width",d||"")}}const u=e.src||e.srcset.split(",")[0];e.style.width==="100%"&&e.style.removeProperty("width"),e.style.maxWidth==="100%"&&e.style.removeProperty("max-width"),t={...IA(e),alt:e.alt,width:a,height:s,src:u,layout:c?"responsive":"fixed",...t};for(const d of Object.keys(t))Hn(n,d,t[d])}finally{for(const[i,s]of o)i.style.display=s}return n}async function WA(e,t){const n=[...e.querySelectorAll("img")],r=[];for(const i of n)r.push(Hp(i).then(s=>[i,s],()=>[i,void 0]));const o=[...e.querySelectorAll("picture")];for(const i of o){const s=i.querySelector("img");s?r.push(Hp(s).then(a=>[i,a],()=>[i,void 0])):r.push([i,void 0])}if(r.length){const i=await Promise.all(r);for(const[s,a]of i)a?s.replaceWith(a):s.remove();t?.()}}function qA(e){const t=e.querySelectorAll("meta");for(const o of t){const i=o.getAttribute("charset");if(i){i!=="utf-8"&&o.setAttribute("charset","utf-8");return}}const n=ai(e),r=e.createElement("meta");r.setAttribute("charset","utf-8"),n.insertBefore(r,n.firstChild)}function zA(e,t,n){const r=n('script:not([type="application/ld+json"])'),o=e.querySelectorAll(r);for(const i of o)!i.getAttribute("src")?.startsWith("https://cdn.ampproject.org/")&&!(i.closest("amp-state")&&i.getAttribute("type")==="application/json")&&i.remove()}var Fp="https://cdn.ampproject.org/v0",$p=`${Fp}.js`,VA=`script[src='${$p}']`;function UA(e,t){return`${Fp}/${e.toLowerCase()}-${t}.js`}async function jA(e,t,n){for(const{name:r,versions:o}of t){const i=n.replaceSelectors(r==="amp-mustache"?`script[async][custom-template='${r}']`:`script[async][custom-element='${r}']`);if(!e.querySelector(i)){const s=ai(e),a=n.createElementFn("script"),l=UA(r,o.findLast(c=>c!=="latest")||"v0");a.setAttribute("async",""),a.setAttribute(r==="amp-mustache"?"custom-template":"custom-element",r),a.setAttribute("src",l),s.appendChild(a),s.appendChild(e.createTextNode(`
9
+ `))}}}var fq=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),pq=function(e,t){return new URL(e,t).href},hq={},Wc=function(t,n,r){let o=Promise.resolve();if(0)var s,a;function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})},Wp=void 0;async function ta(){return Wp||(Wp=await Wc(()=>Promise.resolve().then(()=>Zl("./rules.CnnzdMsj.js")).then(e=>e.default),void 0,{}.url))}var qc=new Map;async function GA(){if(!qc.size){const e=await ta(),t=e.tags;for(let n=0;n<t.length;n++){const r=t[n],{selector:o,attrs:i,attrLists:s}=r,a=s?.flatMap(l=>e.attrLists.filter(({name:c})=>c===l).flatMap(c=>c.attrs))||[];qc.set(o,{...r,priority:n,attrs:new Map([...i,...a].map(l=>[l.name,l]))})}}return qc}var zc=new Map;async function XA(){if(!zc.size){const e=await ta();for(const t of e.declarations)zc.set(t.name,t)}return zc}var YA="$GLOBAL_ATTRS",Vc=new Map;async function KA(){if(!Vc.size){const e=(await ta()).attrLists.find(t=>t.name===YA)?.attrs;if(e)for(const t of e)Vc.set(t.name,t)}return Vc}function ZA(e){return vn(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function qp(e){return U0(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}function zp(e,t,n){if(!t)return;function r(){const i=t.compareDocumentPosition(e);if(!(i&8)){if(i&2)return t.insertBefore(e,t.firstChild),!0;if(i&4)return t.appendChild(e),!0}return!1}function o(){const i=[...e.childNodes];for(let s=i.length-1;s>=0;s--)zp(i[s],t,n)}if(vn(e))switch(e.tagName.toLowerCase()){case"body":return;case n("script"):case"style":case"meta":case"title":return;case"head":case"html":o();break;default:r()||o()}else xc(e)?o():oi(e)&&(e.textContent?.trim()||e.nextSibling?.textContent?.trim()&&oi(e.nextSibling))&&r()}async function QA(e,t){const n=new Set,r=t.commit,o=p=>t.replaceSelectors(p.toLowerCase());if(t.replaceImages&&await WA(e,r),t.injectExtensions){const p=t.replaceSelectors(VA);if(!e.querySelector(p)){const f=t.createElementFn("script");f.setAttribute("src",$p),f.setAttribute("async",""),ai(e).appendChild(f),r?.()}}t.injectRequiredTags&&(zA(e,t.createElementFn,o),$A(e),BA(e),qA(e),r?.()),t.replaceStylesAndLinks&&(FA(e),r?.());const i=await ta(),s=await GA(),a=new Set(t.removeUnsupportedTags?e.querySelectorAll("*"):[]),l=new Map;for(let[p,f]of s)if(!f.deprecation){p=o(p);let h=[...e.querySelectorAll(p)].filter(y=>!l.has(y));f.unique&&h.length&&(h=[h[0]]),t.injectRequiredTags&&f.required&&!h.length&&(h=[...h,t.createElementFn(f.name)]);for(const y of h){if(t.injectRequiredAttributes&&y.getAttribute("on")&&!y.getAttribute("tabindex")&&y.setAttribute("tabindex","0"),t.removeUnsupportedStyles){let C=!1;for(const k of[...y.classList])k.startsWith("i-amphtml")&&(C=!0,y.classList.remove(k));C&&!y.classList.length&&y.removeAttribute("class")}const E=l.get(y);E&&E.priority>f.priority||l.set(y,f)}}r?.();for(const[p,f]of l){if(t.injectExtensions&&f.requiresExtension)for(const E of f.requiresExtension)n.add(E);const h=f.requiredParent?f.requiredParent==="$ROOT"?e:e.querySelector(f.requiredParent):null;h&&(!p.parentNode||t.moveInvalidTagPosition)?h!==p.parentNode&&(f.name==="HEAD"||vn(h)&&h.tagName==="HEAD"?h.insertBefore(p,h.firstChild):h.appendChild(p)):p.parentNode||e.body.appendChild(p),t.removeUnsupportedTags&&a.delete(p),r?.();const y=await KA();if(t.removeUnsupportedAttributes||t.injectRequiredAttributes){const E=f.attrs,C=t.injectRequiredAttributes?new Set([...E].map(([w,b])=>b).filter(w=>w.required&&w.value)):void 0,k=p.getAttributeNames();for(const w of k){const b=E.get(w)||y.get(w);if(b){if(w==="id"||w==="class"||w==="style"){C?.delete(b);continue}if(t.removeUnsupportedAttributes){const v=p.getAttribute(w);if(b.value&&b.value.indexOf(v)<0){p.removeAttribute(w);continue}if(b.valueRegex&&!new RegExp(b.valueRegex).test(v)){p.removeAttribute(w);continue}if(b.disallowedValueRegex&&new RegExp(b.disallowedValueRegex).test(v)){p.removeAttribute(w);continue}const A=b.valueUrl;if(A){if(v===""){if(!A.allowEmpty){p.removeAttribute(w);continue}}else if(!(v.indexOf("<!--")>0&&v.indexOf("-->")>0)){if(!A.allowRelative)if(v.startsWith("#")||v.startsWith("/")){p.removeAttribute(w);continue}else{const g=A.protocol.length?A.protocol:["https"],S=v.substring(0,v.indexOf(":"));if(S){if(g.indexOf(S)<0){const T=g[0]+v.substring(v.indexOf(":"));if(URL.canParse(T))Hn(p,w,T);else{p.removeAttribute(w);continue}}else if(!URL.canParse(v)){p.removeAttribute(w);continue}}else{const T=g[0]+v;if(URL.canParse(T))Hn(p,w,T);else{p.removeAttribute(w);continue}}}}}}C?.delete(b)}else{if(w==="id"||w==="class"||w==="style")continue;t.removeUnsupportedAttributes&&p.removeAttribute(w)}}if(C)for(const w of C)Hn(p,w.name,w.value[0])}r?.()}t.moveInvalidTagPosition&&(zp(e,e.body,o),r?.());for(const p of a)p.remove();if(r?.(),t.removeUnsupportedStyles){let h=function(w){const b=w.cssText.replaceAll(/\".*\"/g,"").replaceAll(/\'.*\'/g,"").replaceAll(/\/\*.*\*\/|(-moz-|-ms-|-o-|-webkit-)+\w+(?=:)/g,"").match(/[a-z-]+(?=:[^before|after|hover])/gi)||[];for(const v of b){if(!v)continue;const A=w.getPropertyValue(v);w.getPropertyPriority(v)==="important"&&w.setProperty(v,A);const g=f.get(v);g?g.value?g.value.indexOf(A)<0&&w.removeProperty(v):g.valueRegex&&(new RegExp(g.valueRegex).test(A)||w.removeProperty(v)):w.removeProperty(v)}r?.()},y=function(w){return w.constructor.name==="CSSStyleRule"},E=function(w){return w.constructor.name==="CSSMediaRule"},C=function(w){const b=w.cssRules;for(let v=b.length-1;v>=0;v--){const A=b[v];y(A)?A.selectorText.indexOf("[")>=0||A.selectorText.indexOf(":")>=0?w.deleteRule(v):(h(A.style),A.style.cssText||w.deleteRule(v)):E(A)?(C(A),A.cssRules.length||w.deleteRule(v)):w.deleteRule(v)}};var c=h,u=y,d=E,m=C;const p=e.querySelectorAll("*"),f=await XA();for(const w of p)if(Nc(w)){const b=w.getAttribute("style");b&&(h(w.style),w.style.length?w.style.cssText!==b&&w.setAttribute("style",w.style.cssText):w.removeAttribute("style"))}const k=e.querySelector("style[amp-custom]");if(k){const w=k.sheet;w&&(C(w),k.innerHTML=[...w.cssRules].map(b=>b.cssText).join(`
10
+ `)),r?.()}}await jA(e,i.extensions.filter(({name:p})=>n.has(p)),t)}function JA(e,t){return Object.keys(t).reduce((n,r)=>n.replaceAll(r,t[r]),e)}function Vp(e,t={}){const{correct:n=!0,injectExtensions:r=!0,mappedTags:o={}}=t;return QA(e,{replaceImages:n,replaceStylesAndLinks:n,injectRequiredTags:n,injectExtensions:r,formsAsAmpForms:r,injectRequiredAttributes:n,moveInvalidTagPosition:n,removeUnsupportedTags:n,removeUnsupportedAttributes:n,removeUnsupportedStyles:n,createElementFn:i=>e.createElement(o[i.toLowerCase()]||i),replaceSelectors:i=>JA(i.toLowerCase(),o),commit:t.commit})}var eT=/^(chrome-extension|moz-extension|safari-extension):\/\//i,tT=/local\.adguard\.org/i,nT=/^bis_/i,rT=new Set(["data-bis-config"]),so=/<script\b(?=[^>]*(?:\bbis_use(?:=|\s)|\bdata-bis-config(?:=|\s)|\bdata-dynamic-id(?:=|\s)|local\.adguard\.org|(?:chrome-extension|moz-extension|safari-extension):\/\/))[^>]*>[\s\S]*?<\/script>/gi,oT=/\s(?:bis_[a-z0-9_-]+|data-bis-config|data-dynamic-id)=(["'])(?:(?!\1).)*\1/gi,na=/<style\b[^>]*>[\s\S]*?<\/style>/gi,Up=/display:\s*none\s*!important/gi,iT=[".socialshare,",".advertisment,",".adHolder,",".adsbygoogle-noablate","#ab_adblock","#popmechanic-snippet","filter_ads_by_classname","clever-core-ads","--gn-ov-ad-height","pub_728x90.text-ad.textAd","html-load.com/player","content-loader.com/player",".adblock","#advblock","body { overflow: visible!important; }"],jp=new Set(["em","data-theme-varibalse","data-em-localization"]);function sT(e){return Up.lastIndex=0,(e.match(Up)||[]).length}function Uc(e){const t=e.trim(),n=sT(t);if(n===0)return!1;if(t.includes(".advertisment,")&&t.includes(".adHolder,")&&(t.includes(".socialshare,")||n>=3||t.length>2e3))return!0;const r=iT.filter(o=>t.includes(o)).length;return r>=1&&(n>=3||t.length>2e3)||n>=5&&r>=1?!0:n>=20&&/\b(?:\.ad(?:s|vert|vertisment|Holder|banner|box|Container|Wrapper)?[,{]|#ad[-_]|ins\.adsbygoogle)/i.test(t)}function aT(e){if(jp.has("em")&&e.getAttribute("em")==="styles")return!1;for(const t of jp)if(e.hasAttribute(t))return!1;return Uc(e.textContent||"")}function Gp(e){return eT.test(e.src)||tT.test(e.src)?!0:e.hasAttribute("bis_use")||e.hasAttribute("data-bis-config")}function Xp(e){let t=!1;for(const n of[...e.attributes])(nT.test(n.name)||rT.has(n.name))&&(e.removeAttribute(n.name),t=!0);return t}function lT(e){na.lastIndex=0;for(const t of e.matchAll(na))if(Uc(t[0].replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,"")))return!0;return!1}function cT(e){let t=!1;return na.lastIndex=0,{html:e.replace(na,n=>Uc(n.replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,""))?(t=!0,""):n),found:t}}function Yp(e){let t=!1;return e instanceof Element&&Xp(e)&&(t=!0),e.querySelectorAll("script").forEach(n=>{Gp(n)&&(n.remove(),t=!0)}),e.querySelectorAll("style").forEach(n=>{n.tagName==="STYLE"&&aT(n)&&(n.remove(),t=!0)}),e.querySelectorAll("*").forEach(n=>{Xp(n)&&(t=!0)}),t}function uT(e){return so.lastIndex=0,so.test(e)||/\sbis_[a-z0-9_-]+\s*=/.test(e)||/\sdata-bis-config\s*=/.test(e)||lT(e)}function dT(e){if(!uT(e))return{html:e,found:!1};let t=!1,n=e;so.lastIndex=0,so.test(n)&&(so.lastIndex=0,n=n.replace(so,""),t=!0),(/\sbis_[a-z0-9_-]+\s*=/.test(n)||/\sdata-bis-config\s*=/.test(n))&&(n=n.replace(oT,""),t=!0);const r=cT(n);return n=r.html,t=t||r.found,{html:n,found:t}}function jc(){Z.send(Pe.RELOAD),window.location.reload()}function mT(e){const t=new Ee;function n(){const o=new Set;for(const i of document.querySelectorAll("script"))i instanceof HTMLScriptElement&&Gp(i)||e.getOuterHtml(i)&&(i.src||i.innerHTML).trim()&&o.add((i.src||i.innerHTML).trim());return o}let r=n();return t.addDisposable(Z.addListener(Pe.RELOAD,jc)),t.addDisposable(e.onChange(()=>{let o=n();for(const i of r)o.has(i)||jc();r=o})),t}var ra=[];function fT(e){return ra.push(e),{dispose:()=>{const t=ra.indexOf(e);t!==-1&&ra.splice(t,1)}}}function Gc(e){for(const t of ra){const n=t(e);if(n)return n}return e}function pT(){const e=document.querySelector("[em-edit]");return e?Gc(e):null}var oa=new Set(["img","image","input","video","source","em-replace"]);function Kp(e){const t=e.toLowerCase(),n=oa.has(t);return oa.add(t),{dispose:()=>{n||oa.delete(t)}}}function hT(e){return oa.has(e.toLowerCase())}var li=[];function gT(e){return li.push(e),{dispose:()=>{const t=li.indexOf(e);t!==-1&&li.splice(t,1)}}}function Zp(e){return li.some(t=>t.isPathElement?.(e))}function bT(e,t){let n;for(const r of li){const o=r.caption?.(e,t);o&&(n={...n,...o})}return n}function Qp(e){return e.tagName==="TD"&&e===e.closest("amp-accordion")?.querySelector(":scope > section header td")}var yT={isPathElement(e){return e.tagName==="AMP-ACCORDION"||e.tagName==="AMP-CAROUSEL"||Qp(e)},caption(e,t){if(e.tagName==="AMP-ACCORDION")return{title:t.ELEMENT_PATH_ACCORDION,className:"em-element-path-item-amp"};if(e.tagName==="AMP-CAROUSEL")return{title:t.ELEMENT_PATH_CAROUSEL,className:"em-element-path-item-amp"};if(Qp(e))return{title:t.ELEMENT_PATH_SECTION,className:"em-element-path-item-block"};if(e.tagName==="IMG"&&e.closest("amp-carousel"))return{title:t.ELEMENT_PATH_CAROUSEL}}},vT=class extends Ee{constructor(...e){super(...e),L(this,"hasAmp",!1)}};function ET(e,t,n=""){for(const r of e.classList)if(r.startsWith(`${t}-`))return r.replaceAll(`${t}-`,"");return n}function ST(e,t,n){const r=ET(e,t);r!==n&&(e.classList.remove(`${t}-${r}`),n&&e.classList.add(`${t}-${n}`))}function wT(){const e=new Ee;return e.addDisposable(p0(t=>t.startsWith("amp"))),e.addDisposable(h0(t=>t==="class"||t==="style")),e}function CT(e){const t=o=>qp(o)&&e.getOuterHtml(o)!==""||ZA(o)||V0(o),n=o=>{if(t(o))return!0;if(vn(o)||xc(o)){for(const i of o.querySelectorAll("*"))if(t(i))return!0}return!1},r=new vT;return r.addDisposable(fT(o=>o.closest("amp-img"))),r.addDisposable(gT(yT)),r.addDisposable(wT()),r.addDisposable(Kp("amp-img")),r.addDisposable(Kp("amp-anim")),r.addDisposable(e.onChange(o=>{let i=r.hasAmp,s=!1;for(const a of o){if(a.added.some(l=>n(l))){s=!0,i=!0;break}if(a.removed.some(l=>n(l))){i=n(document);break}}r.hasAmp!==i?(r.hasAmp=i,Z.send(Pe.APPLICATION_HAS_AMP,i),setTimeout(()=>{if(i)Vp(document,{correct:!1});else{const a=[...document.querySelectorAll("script")];for(const l of a)qp(l)&&l.remove();jc()}})):s&&setTimeout(()=>{Vp(document,{correct:!1})})})),r.addDisposable(Z.addListener(o=>{if(o.data?.operation==="sandbox_element_settings_set"){const i=document.querySelector("[em-edit]");if(i){const s=o.data?.settings?.ampShow;s!==void 0&&(ST(i,"em-amp-show",s==="amp"?"only":s==="html"?"disabled":void 0),e.commit())}}})),r}function AT(e,t){const n=CT(t);return e.inject(ic,n),{service:n,dispose(){n.dispose(),Jt(e,ic)}}}var TT={name:"sandbox.amp",provides:[ic],awaits:{services:[te]},setup(e){const{service:t}=AT(e,D(e,te));e.addService(yf,()=>({ampService:t}))}};(function(){"use strict";function e(t,n){var r,o=0,i=t.length,s,a="",l,c,u,d,m,p,f,h,y=!0,E=!1,C;r=arguments.length>1?n:{},typeof r.indent>"u"&&(r.indent=" "),typeof r.openbrace=="string"&&(y=r.openbrace==="end-of-line"),typeof r.autosemicolon=="boolean"&&(E=r.autosemicolon);function k(S){return S===" "||S===`
11
+ `||S===" "||S==="\r"||S==="\f"}function w(S){return S==="'"||S==='"'}function b(S){return l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||"-_*.:#[]".indexOf(S)>=0}function v(){for(var S=p;S>0;S-=1)a+=r.indent}function A(){a=C(a),y?a+=" {":(a+=`
12
+ `,v(),a+="{"),c!==`
13
+ `&&(a+=`
14
+ `),p+=1}function g(){var S;p-=1,a=C(a),a.length>0&&E&&(S=a.charAt(a.length-1),S!==";"&&S!=="{"&&(a+=";")),a+=`
15
+ `,v(),a+="}",s.push(a),a=""}for(String.prototype.trimRight?C=function(S){return S.trimRight()}:C=function(S){return S.replace(/\s+$/,"")},m={Start:0,AtRule:1,Block:2,Selector:3,Ruleset:4,Property:5,Separator:6,Expression:7,URL:8},p=0,d=m.Start,h=!1,s=[],t=t.replace(/\r\n/g,`
16
+ `);o<i;){if(l=t.charAt(o),c=t.charAt(o+1),o+=1,w(f)){a+=l,l===f&&(f=null),l==="\\"&&c===f&&(a+=c,o+=1);continue}if(w(l)){a+=l,f=l;continue}if(h){a+=l,l==="*"&&c==="/"&&(h=!1,a+=c,o+=1);continue}if(l==="/"&&c==="*"){h=!0,a+=l,a+=c,o+=1;continue}if(d===m.Start){if(s.length===0&&k(l)&&a.length===0)continue;if(l<=" "||l.charCodeAt(0)>=128){d=m.Start,a+=l;continue}if(b(l)||l==="@"){if(u=C(a),u.length===0)s.length>0&&(a=`
17
+
18
+ `);else if(u.charAt(u.length-1)==="}"||u.charAt(u.length-1)===";")a=u+`
19
+
20
+ `;else for(;c=a.charAt(a.length-1),!(c!==" "&&c.charCodeAt(0)!==9);)a=a.substr(0,a.length-1);a+=l,d=l==="@"?m.AtRule:m.Selector;continue}}if(d===m.AtRule){if(l===";"){a+=l,d=m.Start;continue}if(l==="{"){u=C(a),A(),d=u==="@font-face"?m.Ruleset:m.Block;continue}a+=l;continue}if(d===m.Block){if(b(l)){if(u=C(a),u.length===0)s.length>0&&(a=`
21
+
22
+ `);else if(u.charAt(u.length-1)==="}")a=u+`
23
+
24
+ `;else for(;c=a.charAt(a.length-1),!(c!==" "&&c.charCodeAt(0)!==9);)a=a.substr(0,a.length-1);v(),a+=l,d=m.Selector;continue}if(l==="}"){g(),d=m.Start;continue}a+=l;continue}if(d===m.Selector){if(l==="{"){A(),d=m.Ruleset;continue}if(l==="}"){g(),d=m.Start;continue}a+=l;continue}if(d===m.Ruleset){if(l==="}"){g(),d=m.Start,p>0&&(d=m.Block);continue}if(l===`
25
+ `){a=C(a),a+=`
26
+ `;continue}if(!k(l)){a=C(a),a+=`
27
+ `,v(),a+=l,d=m.Property;continue}a+=l;continue}if(d===m.Property){if(l===":"){a=C(a),a+=": ",d=m.Expression,k(c)&&(d=m.Separator);continue}if(l==="}"){g(),d=m.Start,p>0&&(d=m.Block);continue}a+=l;continue}if(d===m.Separator){if(!k(l)){a+=l,d=m.Expression;continue}w(c)&&(d=m.Expression);continue}if(d===m.Expression){if(l==="}"){g(),d=m.Start,p>0&&(d=m.Block);continue}if(l===";"){a=C(a),a+=`;
28
+ `,d=m.Ruleset;continue}if(a+=l,l==="("&&a.charAt(a.length-2)==="l"&&a.charAt(a.length-3)==="r"&&a.charAt(a.length-4)==="u"){d=m.URL;continue}continue}if(d===m.URL&&l===")"&&a.charAt(a.length-1!=="\\")){a+=l,d=m.Expression;continue}a+=l}return a=s.join("")+a,a}window.cssbeautify=e})();function _T(e,t,n){n.state.update({iframeOffsetTop:e.iframeOffsetTop,scrollTop:e.scrollTop,previewHeight:e.previewHeight,applicationMode:e.mode}),typeof t<"u"&&n.state.set("codeMode",e.mode==="code");const r=document.querySelector(".em-element-path");r&&(r.style.top=n.previewHeight-n.iframeOffsetTop-65+n.scrollTop+"px");const o=document.querySelector(".em-editor-wrapper");o&&o.style.display==="none"?n.setBlockGroupControlsPosition():setTimeout(()=>{n.setBlockGroupControlsPosition()},400)}var kT=["transform","transform-origin","overflow-x","height"];function LT(e,t){return!(e>0)||!(t>0)||e<=t?1:t/e}function ci(e,t){const n=t<1?`scale(${t})`:"";if(e.style.transform===n)return!1;for(const r of kT)e.style.removeProperty(r);return n?(e.style.overflowX="visible",e.style.transformOrigin="left top",e.style.transform=n):e.getAttribute("style")||e.removeAttribute("style"),!0}function NT(e,t){const n=e,r=n?.querySelector("table:first-child"),o=Math.max(n?.offsetWidth??0,r?.offsetWidth??0);return o>0?o:(ci(t,1),t.scrollWidth)}function xT(e,t=window){const n=t.document.documentElement,r=n.style.transform,o=LT(NT(e,n),t.innerWidth);return ci(n,o),n.style.transform!==r&&t.parentIFrame?.size?.(),o}function MT(e,t){ci(document.documentElement,1);const n=t.globalHolder?.querySelector("table:first-child");if(n&&n.offsetWidth>=e.iframeWidth-2&&t.globalHolder){const r=e.iframeWidth/t.globalHolder.offsetWidth;ci(document.documentElement,r),document.querySelector(".em-narrow-table")&&e.iframeWidth>370&&t.messageService.send({operation:"application_preview_alert_show",settings:{show:r<.9}})}setTimeout(()=>{t.messageService.send({operation:"application_iframe_set_height",settings:{height:document.body.getBoundingClientRect().height}})},300)}function lt(e){const t=D(e,xe);return n=>{t.commit(n)}}function Jp(){return D(Et,te)}function RT(){return D(Et,mt)}function OT(){return D(Et,Zt)}function PT(){return Et.getInstance(te)!==void 0}function Er(e){D(Et,xe).commit(e)}function Xc(e,t){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object")return!1;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){const i=e,s=t;return i.length===s.length&&i.every((a,l)=>Xc(a,s[l]))}const r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.prototype.hasOwnProperty.call(t,i)&&Xc(e[i],t[i]))}function eh(e,t){const n={watch(r){let o,i=!1;return e.watch(s=>{const a=t(s);i&&Xc(o,a)||(o=a,i=!0,r(a))})},select(r){return eh(n,r)}};return n}function th(...e){let t=e[0],n=e.length>0;const r=new Set,o={get(){return n?t:void 0},set(i){t=i,n=!0;for(const s of Array.from(r))s(i)},watch(i){return r.add(i),n&&i(t),{dispose:()=>r.delete(i)}},select(i){return eh(o,i)}};return o}var ia={lockEditorInit:!0,lockEdit:!1,lockEditor:!0,activeElementLocked:0,applicationTheme:"light",applicationMode:"default",previewHeight:0,emailWidth:0,previewPage:!1,globalHolder:null,elementPath:[],activeElementText:"",selectedElem:null,iframeOffsetTop:0,scrollTop:0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,elementAIimageEnabled:!0,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,blocksAddPanelEnabled:!0,codeMode:!0,appName:"",isLeftButtonDown:!1,isProgrammaticSelection:!1,isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1,actualTargetCount:0,activeCell:[],commonStyles:{},loadStylesTimer:!1,_pushUndoStop:!1},ui=th({...ia});function Ut(){return ui.get()}var sa=new Me,ao=new Map,x={source:ui,get(e){return Ut()[e]},getState(){return{...Ut()}},getStateRef(){return Ut()},set(e,t){if(Ut()[e]===t)return;ui.set({...Ut(),[e]:t}),sa.fire({[e]:t});const n=ao.get(e);n&&n.forEach(r=>r(t))},update(e){let t=!1;const n={};for(const r of Object.keys(e)){const o=e[r];if(Ut()[r]!==o){ui.set({...Ut(),[r]:o}),n[r]=o,t=!0;const i=ao.get(r);i&&i.forEach(s=>s(o))}}t&&sa.fire(n)},increment(e,t=1){const n=Ut()[e];typeof n=="number"&&x.set(e,n+t)},decrement(e,t=1){const n=Ut()[e];typeof n=="number"&&x.set(e,n-t)},subscribe(e){return sa.event(e)},subscribeToKey(e,t){ao.has(e)||ao.set(e,new Set);const n=ao.get(e),r=t;return n.add(r),()=>{n.delete(r),n.size===0&&ao.delete(e)}},reset(){ui.set({...ia}),sa.fire(Ut())},resetKey(e){this.set(e,ia[e])},isEditingLocked(){const e=Ut();return e.lockEdit||e.lockEditor||e.lockEditorInit},isActiveElementLocked(){return Ut().activeElementLocked>0},getInitialState(){return ia}};function nh(e){const t=()=>{document.body?.classList.toggle("mceNonEditable",e),document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable",e?"false":"true")})};PT()?Jp().applyHidden(t):t()}function aa(){return x.get("lockEdit")||x.get("lockEditor")}function IT(){return x.subscribe(e=>{"lockEditor"in e&&nh(aa())})}function DT(e){return e.beforeChange(({domMutations:t})=>{const n=t.flatMap(r=>r.type==="Add"&&r.node instanceof Element?[r.node]:[]);n.length&&queueMicrotask(()=>{if(!aa())return;const r=n.flatMap(o=>[...o.tagName==="EDITOR"?[o]:[],...Array.from(o.querySelectorAll("editor"))]);e.applyHidden(()=>{for(const o of r)o.isConnected&&o.setAttribute("contenteditable","false")})})})}function BT(e,t){const n=th(),r=e.addListener(t,o=>n.set(o));return{source:n,dispose:()=>r.dispose()}}var HT=["copyPasteEnabled","saveBlockEnabled","editImageControlEnabled","elementAIimageEnabled","imageCenterStockEnabled","imageCenterGifEnabled","imageCenterEditorEnabled","blocksAddPanelEnabled"];function FT(e){const t="d5e4bde1";let n=document.getElementsByTagName("head")[0];!n&&document.documentElement&&(n=document.createElement("head"),document.documentElement.insertBefore(n,document.documentElement.firstChild));const r=`css/sandbox-${e}.css?${t}`,o=e==="light"?"dark":"light",i=document.querySelectorAll(`[href="css/sandbox-${o}.css?${t}"]`);if(!document.querySelector(`[href="${r}"]`)){const s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("em","css"),s.setAttribute("href",r),n?.appendChild(s)}for(const s of i)s.remove()}var $T={name:"sandbox.hostFacts",provides:[jr],setup(e){const t=Object.fromEntries(Object.entries(Iw).map(([n,r])=>[n,BT(Z,r).source]));e.inject(jr,t)}},WT={name:"sandbox.hostFactsToState",awaits:{services:[jr,xe,te]},setup(e){const t=D(e,jr),n=lt(e);t.theme.watch(r=>{x.set("applicationTheme",r),FT(r),n(!1)}),t.commonStyles.watch(r=>{r&&x.set("commonStyles",r)}),t.flags.watch(r=>{for(const o of HT)typeof r[o]<"u"&&x.set(o,r[o])}),IT(),DT(D(e,te)),t.lockEditor.watch(r=>x.set("lockEditor",r)),t.codeMode.watch(r=>x.set("codeMode",r)),t.appName.watch(r=>x.set("appName",r)),t.previewPage.watch(r=>{x.set("previewPage",r),document.body?.classList.toggle("em-sandbox-preview",r)})}},qT={name:"sandbox.viewport",awaits:{services:[jr]},setup(e){D(e,jr).viewport.watch(t=>_T(t,void 0,{state:x,previewHeight:t.previewHeight,iframeOffsetTop:t.iframeOffsetTop,scrollTop:t.scrollTop,globalHolder:x.get("globalHolder"),setBlockGroupControlsPosition:()=>e.getServices(vf).forEach(n=>n()),messageService:Z}))}};function Jn(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function ft(e,t,n=!1){for(const r of e.querySelectorAll(t))n||!r.childNodes.length?r.remove():r.replaceWith(...r.childNodes)}function zT(e,t){if(e.data.value)document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable","false")}),document.body.classList.add("em-sandbox-discuss");else{const n=aa()?"false":"true";document.querySelectorAll("editor").forEach(r=>{r.setAttribute("contenteditable",n)}),document.body.classList.remove("em-sandbox-discuss","em-sandbox-discuss_set-target")}}function VT(e,t){e.data.value?document.body.classList.add("em-sandbox-discuss_set-target"):document.body.classList.remove("em-sandbox-discuss_set-target")}function UT(e,t){const n=e.data.value,r=document.querySelector(`[em-discuss-id="${n}"]`);r&&t.messageService.send({operation:"application_scroll-to",settings:{value:r.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),document.body.classList.remove("em-sandbox-discuss_set-target"),document.querySelectorAll(".em-discuss-id-new").forEach(o=>{o.removeAttribute("em-discuss-id")}),t.removeAllAttributes("em-edit"),r&&document.querySelectorAll(`[em-discuss-id="${n}"]`).forEach(o=>{o.removeAttribute("em-discuss-id")}),t.commit()}function jT(e,t){document.body.classList.remove("em-sandbox-discuss_set-target"),document.querySelectorAll(".em-discuss-id-new").forEach(n=>{n.classList.remove("em-discuss-id-new")}),t.removeAllAttributes("em-edit"),t.commit(),setTimeout(()=>{t.messageService.send({operation:"application_discuss_save_target"})},500)}function GT(e,t){const n=e.data.value,r=document.querySelector(`[em-discuss-id="${n}"]`);r?(t.messageService.send({operation:"application_scroll-to",settings:{value:r.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),r.classList.add("em-discuss-target-active"),setTimeout(()=>{r.classList.remove("em-discuss-target-active")},2e3)):t.messageService.send({operation:"application_discuss_no_comment"})}var XT={sandbox_lock_discuss:zT,sandbox_discuss_set_target:VT,sandbox_discuss_remove_target:UT,sandbox_discuss_reset:jT,sandbox_discuss_get_target:GT};function YT(e,t){x.set("lockEdit",!!e.data.data),nh(aa())}function KT(e,t){t.setEditorFocus(e.data.data)}function ZT(e,t){let n=e.data.data;if(typeof n!="number")return;n=RT().correctOffset(n,!0),n=OT().correctOffset(n,!0);let r=Jp().getElementByPosition(n);if(r&&!(r instanceof Element)&&(r=r.parentElement),!(r instanceof HTMLElement))return;const o=r.getBoundingClientRect();r.tagName!=="BODY"&&o.height&&o.width&&document.querySelector("[em-edit]")!==r&&t.applicationElementSettingsSet({elem:r});const i=r.getBoundingClientRect(),s=i.top-x.get("previewHeight")/2+i.height/2;t.messageService.send({operation:"application_scroll-to",settings:{value:x.get("applicationMode")==="default"?s+x.get("iframeOffsetTop"):s}})}var QT={sandbox_lock_edit:YT,editor_change_focus:KT,update_position_from_editor:ZT};function JT(e,t){document.querySelectorAll("[em-optimise-error]").forEach(n=>{n.removeAttribute("em-optimise-error")}),document.querySelectorAll("img").forEach((n,r)=>{n.setAttribute("em-optimise",`image_${r}`)}),t.commit()}function e_(e,t){document.querySelectorAll("[em-optimise-error]").forEach(n=>{n.removeAttribute("em-optimise-error")}),document.querySelectorAll("a[href]").forEach((n,r)=>{n.setAttribute("em-optimise",`link_${r}`)}),t.commit()}function t_(e,t){const n=document.querySelector(`[em-optimise="${e.data.settings.elementId}"]`);n&&(e.data.settings.isError&&(n.setAttribute("em-optimise-error","true"),t.commit()),t.messageService.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),t.setCursorPosition(n),t.applicationElementSettingsSet({elem:n}))}function n_(e,t){const n=document.querySelector(`[em-optimise="${e.data.settings.elementId}"]`);n&&(t.messageService.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),t.setCursorPosition(n),t.applicationElementSettingsSet({elem:n}),e.data.settings.isError&&n.setAttribute("em-optimise-error","true"),t.commit())}var r_={sandbox_set_attr_to_images:JT,sandbox_set_attr_to_links:e_,sandbox_set_position_to_img:t_,sandbox_set_position_to_link:n_},o_={brightness:100,contrast:100,sepia:0},la={DARK:"dark",LIGHT:"light"},rh=!1;function i_(e){rh||(e.setFetchMethod(t=>window.fetch(t)),rh=!0)}function s_(){let e=null,t=la.LIGHT;return{set(n){if(t=n,n===la.DARK){e??(e=Wc(()=>Promise.resolve().then(()=>Zl("./darkreader.CLd5EML2.js")),void 0,{}.url)),e.then(r=>{t===la.DARK&&(i_(r),r.enable(o_))}).catch(r=>{e=null});return}e?.then(r=>{t===la.LIGHT&&r.disable()})},clear(n){return n.replaceAll(/\s*?--darkreader.+?: .*?;/g,"")}}}var oh=s_();function a_(e,t){t.initPreview(!0)}function l_(e){const t=e.data?.data?.theme;(t==="light"||t==="dark")&&oh.set(t)}var c_={init_preview:a_,sandbox_switch_theme:l_},Yc={increment:e=>x.increment(e),decrement:e=>x.decrement(e)};function tn(e,t,n,r){return{name:`sandbox.operations.${e}`,awaits:n,setup(o){const i=r(o),s={};for(const[a,l]of Object.entries(t))l&&(s[a]=c=>l(c,i()));o.addService(Ef,{owner:e,handlers:s})}}}var u_={name:"sandbox.operationEnvironment",provides:[Kn],setup(e){const t={iframeOffsetTop:0,previewHeight:0,elementPath:[],lockEdit:!1};x.subscribe(n=>{for(const r of["iframeOffsetTop","previewHeight","elementPath","lockEdit"])r in n&&n[r]!==void 0&&Object.assign(t,{[r]:n[r]})}),e.inject(Kn,t)}},d_=tn("discuss",XT,{services:[xe,Kn]},e=>{const t=lt(e),n=D(e,Kn);return()=>({commit:t,iframeOffsetTop:n.iframeOffsetTop,previewHeight:n.previewHeight,messageService:Z,removeAllAttributes:Jn})}),m_=tn("editor",QT,{services:[He,at]},e=>{const t=D(e,He),n=D(e,at);return()=>({applicationElementSettingsSet:t,messageService:Z,setEditorFocus:r=>n.setEditorFocus(r)})}),f_=tn("images",r_,{services:[He,vt,xe,Kn]},e=>{const t=D(e,He),n=D(e,vt),r=lt(e),o=D(e,Kn);return()=>({applicationElementSettingsSet:t,commit:r,iframeOffsetTop:o.iframeOffsetTop,previewHeight:o.previewHeight,messageService:Z,setCursorPosition:i=>n(i)})}),p_=tn("preview",c_,{services:[Jo]},e=>()=>({initPreview:t=>D(e,Jo)(t)})),h_={name:"sandbox.operationsDispatcher",setup(e){Z.addListener(t=>{const n=t.data?.operation;if(!n)return;const r=e.getServices(Ef).map(o=>o.handlers[n]).filter(Boolean).pop();if(r)try{r(t)}catch{}})}},g_=[u_,d_,m_,f_,p_,h_],b_=["em-block-insert","em-block-insert_bottom-document","em-block-insert_top-document","em-block-insert_bottom","em-block-insert_top","em-blockatom-insert","em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top","em-block-insert-empty","em-atom-insert-empty","em-block-insert-body","em-atom-insert-body","em-resize-start","sortable-chosen","sortable-ghost","em-vindent-table","em-vindent_low","em-vindent","em-relative","em-display-block","em-sandbox-discuss_set-target","em-sandbox-discuss","em-element-list-bullet","remove-new-editor-element","em-just-inserted","em-native-img-uploading","em-native-img-drop-target","em-native-img-drop-loading","em-native-file-drag"],y_=["style","class","align","href"],v_=new Set([...b_,"em-element-path_img"]);function E_(e){return e.split(/\s+/).filter(t=>t&&!v_.has(t)).join(" ")}var S_=32;function w_(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function C_(e){const t=[e.tagName];for(const n of y_){const r=e.getAttribute(n),o=n==="class"&&r!==null?E_(r):r;o!==null&&o!==""&&t.push(`${n}=${o}`)}return t.join("|")}function A_(e){if(!e||!e.isConnected)return"";const t=[];let n=e,r=0;for(;n&&r<S_&&(t.push(C_(n)),!w_(n));)n=n.parentElement,r++;return t.join("||")}function T_(e){let t={text:"",ancestors:""};const n=r=>({text:r?e(r):"",ancestors:A_(r)});return{remember(r){t=n(r)},forget(){t={...t,text:""}},take:n,differs(r){return t.text!==r.text||t.ancestors!==r.ancestors},accept(r){t=r}}}function __(e){let t=x.get("activeElementLocked");x.subscribe(n=>{if(n.activeElementLocked===void 0)return;const r=t>0&&n.activeElementLocked===0;t=n.activeElementLocked,r&&Promise.resolve().then(()=>{x.get("activeElementLocked")===0&&e.remember(document.querySelector("[em-edit]"))})})}var ih=Promise.resolve(),sh=null;function k_(e,t){const{HTMLDocument:n,documentMapping:r,remoteDocument:o,messageService:i}=t;let s=n.getRangeByElement(e,!0);if(s){const a=r.getMappedReplacementRangeAtPosition(s.start)||r.getMappedReplacementRangeAtPosition(Math.max(s.end-1,s.start));a&&(s=a),s=r.correctRange(s),s=o.correctRange(s);const l={operation:"update_position_from_iframe",data:s};i.send(l)}}function L_(e,t){sh=e,ih=ih.finally(()=>{sh===e&&k_(e,t)})}function N_(e,t="unknown"){const n=Et.getInstance(at);if(!n){e();return}n.controller.whenEditorLostFocus(e,t)}function x_(e){const t=e.innerHTML.trim();return[t==="&nbsp;",t==="<div>&nbsp;</div>",/^<div[^>]*>&nbsp;<\/div>$/.test(t),/^<[^>]*>&nbsp;<\/[^>]*>$/.test(t),t.replace(/<[^>]*>/g,"").trim()==="&nbsp;",e.textContent?.trim()===" "||e.textContent?.trim().charCodeAt(0)===160].some(n=>n===!0)}function M_(e){window.getSelection();const t=e.startContainer,n=t.nodeType===Node.TEXT_NODE?t.parentElement:t instanceof Element?t:null;if(!n||!n.contains(e.commonAncestorContainer))return!1;const r=n.textContent??"",o=e.toString(),i=r.replace(/\s+/g," ").trim(),s=o.replace(/\s+/g," ").trim();return r===o||i===s}function X(e){if(R_(e))return O_(e)?e.trim():P_(e)}var ah={RGB:/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)/i,HEX:/^\s*#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})\s*$/i},R_=e=>typeof e=="string"&&e.trim()!=="",O_=e=>ah.HEX.test(e);function P_(e){const t=ah.RGB.exec(e)?.groups;if(!t)return;const n=I_(t);return B_(n)}var I_=e=>({r:Kc(e.r),g:Kc(e.g),b:Kc(e.b),a:D_(e.a)}),Kc=e=>parseInt(e||"0",10),D_=e=>parseFloat(e||"1"),B_=e=>`#${Zc(e.r)}${Zc(e.g)}${Zc(e.b)}`,Zc=e=>e.toString(16).padStart(2,"0"),ca=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function lh(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function Sr(e,t){return Array.from(e.classList).find(n=>n.includes(t))}function ch(e){return!e||!e.childNodes?!1:Array.from(e.childNodes).every(t=>t.nodeType===Node.TEXT_NODE?(t.textContent?.trim()??"")!=="":t.nodeType===Node.ELEMENT_NODE?ch(t):!1)}function I(e){const t=document.createElement(e.tag||"div");if(t.setAttribute("contentEditable","false"),e.width&&(t.style.width=e.width+"px"),e.height&&(t.style.height=e.height+"px"),e.left&&(t.style.left=e.left+"px"),e.top&&(t.style.top=e.top+"px"),e.className&&(t.className=e.className),e.style&&t.setAttribute("style",e.style),e.HTMLcontent&&(t.innerHTML=e.HTMLcontent),e.title&&t.setAttribute("title",e.title),e["data-id"]&&t.setAttribute("data-id",e["data-id"]),e.targetElement){const n=typeof e.targetElement=="string"?document.querySelector(e.targetElement):e.targetElement;if(n)switch(e.insertType){case"append":n.append(t);break;case"prepend":n.prepend(t);break;case"before":n.before(t);break;case"after":n.after(t);break;case"replaceWith":n.replaceWith(t)}}return t}function H_(e){try{return JSON.parse(e),!0}catch{return!1}}function uh(e,t,n=2){const r=e.split(""),o=t.split("");if(Math.abs(r.length-o.length)>n)return!1;let i=0;if(r.length===o.length){for(let s=0;s<r.length;s++)if(r[s]!==o[s]&&(i++,i>n))return!1}else{const s=r.length>o.length?r:o,a=r.length>o.length?o:r;let l=0,c=0;for(;l<s.length&&c<a.length;)if(s[l]!==a[c]){if(i++,i>n)return!1;l++}else l++,c++;if(l<s.length&&i++,i>1)return!1}return!0}function lo(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function F_(e){const t=e.style?.fontWeight;if(typeof t=="number")return t>=600;if(typeof t=="string"){const n=t.toLowerCase();return n.includes("bold")||n.includes("black")||parseInt(n)>=600}return!1}function ua(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0).commonAncestorContainer;return t.nodeType===1?t:t.parentElement}function Qc(e,t=null){const n=e?.innerText;for(;e!==null;){if(e.innerText===n){const r=e.parentElement;if(r===null||r.innerText!==n||r.tagName==="EDITOR"||e.tagName===t?.toUpperCase())return e.tagName===t?.toUpperCase()||!t?e:null}e=e.parentElement}return null}function di(e,t=ua()){e=ca(e)??"";const n=i=>ca(i?.textContent||"")??"",r=Array.from(t?.childNodes||[]).filter(i=>!!i&&i.nodeName!=="BR");let o=null;if(t&&t.nodeType===Node.TEXT_NODE&&n(t).includes(e)&&n(t)===e)return t;for(let i=0;i<r.length;i++){const s=r[i];if(s.nodeType===Node.TEXT_NODE&&n(s).includes(e)&&n(s)===e){o=s.parentNode;break}else if(s.nodeType===Node.ELEMENT_NODE&&(o=di(e,s),o))break}return o}function Jc(e){const t=Array.from(e),n=t.map(i=>i.clientWidth),r=n.reduce((i,s)=>i+s,0),o=n.map(i=>((i||0)/r*100).toFixed(1));t.forEach((i,s)=>{i.setAttribute("data-percent",o[s])})}function da(e){e.elem.nodeName==="#comment"&&e.elem.textContent&&e.elem.textContent.indexOf("mso")>-1?e.elem.textContent=e.elem.textContent.replace(/width=".*"/gi,`width="${e.width}"`):e.elem.previousSibling&&da({elem:e.elem.previousSibling,width:e.width})}function $_(e){let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let o=0;for(;o<e;)t+=n.charAt(Math.floor(Math.random()*62)),o+=1;return t}var W_=e=>{if(e instanceof Text)return e.textContent||"";if(e instanceof Element){if(e.tagName==="BR")return`
29
+ `;if(e.classList?.contains(".em-element-path"))return"";if(e.classList?.contains("em-code"))return"⃠";if(e.tagName==="EM-REPLACE")return"⃡"}};function dh(e,t){if(!e)return"";const n=t(e);return n===void 0?[...e.childNodes].map(r=>dh(r,t)).join(""):n}function q_(e){const t=e.firstElementChild||e;return t.tagName!=="EDITOR"?t.tagName:"div"}function z_(e,t,n,r){e.setAttribute("style",n?.getAttribute("style")||t.getAttribute("innerStyle")||t.getAttribute("style")||""),e.style.color=r(e.style.color)??"",e.style.backgroundColor=r(e.style.backgroundColor)??"";const o=t.getAttribute("innerClass");o&&(e.className=o);const i=t.getAttribute("innerHref"),s=t.getAttribute("href"),a=n.getAttribute("href");(i!==null||s!==null||a!==null)&&(t.tagName==="A"||n.tagName==="A")&&e.setAttribute("href",i??s??a??"");const l=t.getAttribute("innerTarget");l&&e.setAttribute("target",l);const c=t.getAttribute("innerAlign");c&&e.setAttribute("align",c);const u=n.hasAttribute("em-edit")?n:n.querySelector("[em-edit]");u&&e.setAttribute("em-edit",u.getAttribute("em-edit")||"")}function V_(e,t=!0){const n=document.createRange(),r=window.getSelection();r&&(n.selectNodeContents(e),n.collapse(t),r.removeAllRanges(),r.addRange(n))}function U_(e){let t=!1;return e&&e.childNodes.forEach(n=>{if(n.nodeType===Node.TEXT_NODE&&n.nodeValue?.trim()!==""){const r=n.nodeValue?.trim()||"";/[a-zA-Zа-яА-Я]/.test(r)&&(t=!0)}}),t}function j_(e){return e.trim().split(" ").slice(0,-1).join(" ")||""}function eu(){return pT()}function G_(e,t=!1){if(e.closest("EDITOR")||!e.isConnected)return!0;let n=!1;if(!t)for(const r of Array.from(e.childNodes))if(r.tagName==="EDITOR"){if(n)return!1;n=!0}else return!1;return n}function mh(e,t){if(e instanceof Text){const n=e.textContent,r=n;n!==r&&e.replaceWith(...t(r||""))}else if(e instanceof Element){const n=[...e.childNodes];if(e.tagName==="EDITOR")e.replaceWith(...n);else if(e.tagName==="SPAN"&&e.classList.contains("mce-nbsp-wrap"))return;for(const r of n)mh(r,t)}}function X_(e=document){e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}var tu="data-em-caret",gq="​",mi=e=>e();function co(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-em-caret")}function fi(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.tagName==="EM-REPLACE"&&!e.hasAttribute("src")}function wr(e){return(e??"").replaceAll("​","")}function Y_(e){return(e.nodeType===Node.TEXT_NODE||co(e))&&wr(e.textContent)===""}function fh(e,t){const n=document.createRange();n.setStart(e,t),n.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)}function ph(e){if(!e.collapsed)return null;const{startContainer:t,startOffset:n}=e,r=(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest("em-replace");if(!fi(r))return null;const o=document.createRange();if(o.selectNodeContents(r),o.setEnd(t,n),wr(o.toString())==="")return{em:r,side:"before"};const i=document.createRange();return i.selectNodeContents(r),i.setStart(t,n),wr(i.toString())===""?{em:r,side:"after"}:null}function hh(e,t){if(!e.collapsed)return null;const n=ph(e);if(n)return n.side===(t==="backward"?"after":"before")?n.em:null;const{startContainer:r,startOffset:o}=e;let i;if(r.nodeType===Node.TEXT_NODE){const s=r.data;if(wr(t==="backward"?s.slice(0,o):s.slice(o))!=="")return null;const a=r.parentNode,l=co(a)?a:r;i=t==="backward"?l.previousSibling:l.nextSibling}else{const s=r.childNodes;i=t==="backward"?s[o-1]??null:s[o]??null}for(;i&&Y_(i);)i=t==="backward"?i.previousSibling:i.nextSibling;return fi(i)?i:null}function ma(e,t,n=mi){const r=t==="after"?e.nextSibling:e.previousSibling;let o;if(co(r))o=r;else{const s=document.createElement("span");s.setAttribute(tu,""),s.appendChild(document.createTextNode("​")),n(()=>t==="after"?e.after(s):e.before(s)),o=s}let i=o.lastChild;if(!i||i.nodeType!==Node.TEXT_NODE){i=document.createTextNode("​");const s=i;n(()=>o.appendChild(s))}return fh(i,i.length),o}function nu(e,t=mi,n){const r=Array.from(e.querySelectorAll(`[${tu}]`)).filter(o=>o!==n&&wr(o.textContent)==="");r.length&&t(()=>r.forEach(o=>o.remove()))}function K_(e,t=mi){const n=wr(e.textContent);if(n==="")return null;const r=document.createTextNode(n);return e.before(r),t(()=>e.remove()),fh(r,r.length),r}function gh(e){e.querySelectorAll(`[${tu}]`).forEach(t=>{const n=wr(t.textContent);n===""?t.remove():t.replaceWith(t.ownerDocument.createTextNode(n))})}function Z_(e,t){const n=hh(e,t);if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o?.removeAllRanges(),o?.addRange(r),n}function Q_(e,t){const n=document.createRange();return n.selectNode(t),e.compareBoundaryPoints(e.START_TO_START,n)<=0&&e.compareBoundaryPoints(e.END_TO_END,n)>=0}function J_(){document.execCommand("delete")}function ek(e,t=mi,n=J_){if(e.collapsed)return!1;const r=e.commonAncestorContainer,o=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement;if(!Array.from(o?.querySelectorAll("em-replace")??[]).some(l=>fi(l)&&Q_(e,l)))return!1;n();const i=window.getSelection();if(!i?.rangeCount)return!0;const{startContainer:s,startOffset:a}=i.getRangeAt(0);if(s.nodeType===Node.ELEMENT_NODE){const l=s.childNodes[a-1]??null,c=s.childNodes[a]??null;fi(l)?ma(l,"after",t):!l&&fi(c)&&ma(c,"before",t)}return!0}function bh(){const e=window.getSelection();return e?.rangeCount?hh(e.getRangeAt(0),"backward"):null}function tk(e,t=mi){const n=e.isConnected?e:bh();n&&(n.closest('[contenteditable="true"]')?.focus({preventScroll:!0}),ma(n,"after",t))}var nk=0;function it(e){return e>=48&&e<=57}function er(e){return it(e)||e>=65&&e<=70||e>=97&&e<=102}function ru(e){return e>=65&&e<=90}function rk(e){return e>=97&&e<=122}function ok(e){return ru(e)||rk(e)}function ik(e){return e>=128}function fa(e){return ok(e)||ik(e)||e===95}function yh(e){return fa(e)||it(e)||e===45}function sk(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function pa(e){return e===10||e===13||e===12}function Cr(e){return pa(e)||e===32||e===9}function En(e,t){return!(e!==92||pa(t)||t===nk)}function ha(e,t,n){return e===45?fa(t)||t===45||En(t,n):fa(e)?!0:e===92?En(e,t):!1}function ou(e,t,n){return e===43||e===45?it(t)?2:t===46&&it(n)?3:0:e===46?it(t)?2:0:it(e)?1:0}function vh(e){return e===65279||e===65534?1:0}var iu=new Array(128),bq=128,yq=130,vq=131,Eq=132,Sq=133;for(let e=0;e<iu.length;e++)iu[e]=Cr(e)&&130||it(e)&&131||fa(e)&&132||sk(e)&&133||e||128;function su(e){return e<128?iu[e]:132}function uo(e,t){return t<e.length?e.charCodeAt(t):0}function au(e,t,n){return n===13&&uo(e,t+1)===10?2:1}function mo(e,t,n){let r=e.charCodeAt(t);return ru(r)&&(r=r|32),r===n}function pi(e,t,n,r){if(n-t!==r.length||t<0||n>e.length)return!1;for(let o=t;o<n;o++){const i=r.charCodeAt(o-t);let s=e.charCodeAt(o);if(ru(s)&&(s=s|32),s!==i)return!1}return!0}function ak(e,t){for(;t>=0&&Cr(e.charCodeAt(t));t--);return t+1}function ga(e,t){for(;t<e.length&&Cr(e.charCodeAt(t));t++);return t}function lu(e,t){for(;t<e.length&&it(e.charCodeAt(t));t++);return t}function fo(e,t){if(t+=2,er(uo(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&er(uo(e,t));t++);const n=uo(e,t);Cr(n)&&(t+=au(e,t,n))}return t}function ba(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!yh(n)){if(En(n,uo(e,t+1))){t=fo(e,t)-1;continue}break}}return t}function ya(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),it(n)&&(t=lu(e,t+1),n=e.charCodeAt(t)),n===46&&it(e.charCodeAt(t+1))&&(t+=2,t=lu(e,t)),mo(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),it(n)&&(t=lu(e,t+1+r+1))}return t}function cu(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}En(n,uo(e,t+1))&&(t=fo(e,t))}return t}function Eh(e){if(e.length===1&&!er(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var Sh=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token"],lk=16384;function va(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,lk)):e}var wh=10,ck=12,Ch=13;function Ah(e){const t=e.source,n=t.length,r=t.length>0?vh(t.charCodeAt(0)):0,o=va(e.lines,n),i=va(e.columns,n);let s=e.startLine,a=e.startColumn;for(let l=r;l<n;l++){const c=t.charCodeAt(l);o[l]=s,i[l]=a++,(c===wh||c===Ch||c===ck)&&(c===Ch&&l+1<n&&t.charCodeAt(l+1)===wh&&(l++,o[l]=s,i[l]=a),s++,a=1)}o[n]=s,i[n]=a,e.lines=o,e.columns=i,e.computed=!0}var uk=class{constructor(){this.lines=null,this.columns=null,this.computed=!1}setSource(e,t=0,n=1,r=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,t){return this.computed||Ah(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||Ah(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}},jt=16777215,tr=24,dk=new Map([[2,22],[21,22],[19,20],[23,24]]),mk=class{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",t=()=>{}){e=String(e||"");const n=e.length,r=va(this.offsetAndType,e.length+1),o=va(this.balance,e.length+1);let i=0,s=0,a=0,l=-1;for(this.offsetAndType=null,this.balance=null,t(e,(c,u,d)=>{switch(c){default:o[i]=n;break;case s:{let m=a&jt;for(a=o[m],s=a>>tr,o[i]=m,o[m++]=i;m<i;m++)o[m]===n&&(o[m]=i);break}case 21:case 2:case 19:case 23:o[i]=a,s=dk.get(c),a=s<<tr|i}r[i++]=c<<tr|d,l===-1&&(l=u)}),r[i]=0<<tr|n,o[i]=n,o[n]=n;a!==0;){const c=a&jt;a=o[c],o[c]=n}this.source=e,this.firstCharOffset=l===-1?0:l,this.tokenCount=i,this.offsetAndType=r,this.balance=o,this.reset(),this.next()}lookupType(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e]>>tr:0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&jt:this.source.length}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount?pi(this.source,this.offsetAndType[e-1]&jt,this.offsetAndType[e]&jt,t):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&jt:this.offsetAndType[this.tokenCount]&jt:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?this.lookupType(t)===9&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&jt,t=this.offsetAndType[t],this.tokenType=t>>tr,this.tokenEnd=t&jt):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>tr,this.tokenEnd=e&jt):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(e,t){let n=e,r,o;e:for(;n<this.tokenCount;n++){if(r=this.balance[n],r<e)break e;switch(o=n>0?this.offsetAndType[n-1]&jt:this.firstCharOffset,t(this.source.charCodeAt(o))){case 1:break e;case 2:n++;break e;default:this.balance[r]===n&&(n=r)}}this.skip(n-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t<this.tokenCount;t++){const r=n,o=this.offsetAndType[t],i=o&jt,s=o>>tr;n=i,e(s,r,i,t)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((t,n,r,o)=>{e[o]={idx:o,type:Sh[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}};function Ea(e,t){function n(d){return d<a?e.charCodeAt(d):0}function r(){if(c=ya(e,c),ha(n(c),n(c+1),n(c+2))){u=12,c=ba(e,c);return}if(n(c)===37){u=11,c++;return}u=10}function o(){const d=c;if(c=ba(e,c),pi(e,d,c,"url")&&n(c)===40){if(c=ga(e,c+1),n(c)===34||n(c)===39){u=2,c=d+4;return}s();return}if(n(c)===40){u=2,c++;return}u=1}function i(d){for(d||(d=n(c++)),u=5;c<e.length;c++){const m=e.charCodeAt(c);switch(su(m)){case d:c++;return;case 130:if(pa(m)){c+=au(e,c,m),u=6;return}break;case 92:if(c===e.length-1)break;const p=n(c+1);pa(p)?c+=au(e,c+1,p):En(m,p)&&(c=fo(e,c)-1)}}}function s(){for(u=7,c=ga(e,c);c<e.length;c++){const d=e.charCodeAt(c);switch(su(d)){case 41:c++;return;case 130:if(c=ga(e,c),n(c)===41||c>=e.length){c<e.length&&c++;return}c=cu(e,c),u=8;return;case 34:case 39:case 40:case 133:c=cu(e,c),u=8;return;case 92:if(En(d,n(c+1))){c=fo(e,c)-1;break}c=cu(e,c),u=8;return}}}e=String(e||"");const a=e.length;let l=vh(n(0)),c=l,u;for(;c<a;){const d=e.charCodeAt(c);switch(su(d)){case 130:u=13,c=ga(e,c+1);break;case 34:i();break;case 35:yh(n(c+1))||En(n(c+1),n(c+2))?(u=4,c=ba(e,c+1)):(u=9,c++);break;case 39:i();break;case 40:u=21,c++;break;case 41:u=22,c++;break;case 43:ou(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 44:u=18,c++;break;case 45:ou(d,n(c+1),n(c+2))?r():n(c+1)===45&&n(c+2)===62?(u=15,c=c+3):ha(d,n(c+1),n(c+2))?o():(u=9,c++);break;case 46:ou(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 47:n(c+1)===42?(u=25,c=e.indexOf("*/",c+2),c=c===-1?e.length:c+2):(u=9,c++);break;case 58:u=16,c++;break;case 59:u=17,c++;break;case 60:n(c+1)===33&&n(c+2)===45&&n(c+3)===45?(u=14,c=c+4):(u=9,c++);break;case 64:ha(n(c+1),n(c+2),n(c+3))?(u=3,c=ba(e,c+1)):(u=9,c++);break;case 91:u=19,c++;break;case 92:En(d,n(c+1))?o():(u=9,c++);break;case 93:u=20,c++;break;case 123:u=23,c++;break;case 125:u=24,c++;break;case 131:r();break;case 132:o();break;default:u=9,c++}t(u,l,l=c)}}var po=null,Ve=class gn{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return gn.createItem(t)}allocateCursor(t,n){let r;return po!==null?(r=po,po=po.cursor,r.prev=t,r.next=n,r.cursor=this.cursor):r={prev:t,next:n,cursor:this.cursor},this.cursor=r,r}releaseCursor(){const{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=po,po=t}updateCursors(t,n,r,o){let{cursor:i}=this;for(;i!==null;)i.prev===t&&(i.prev=n),i.next===r&&(i.next=o),i=i.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let n=this.head;n!==null;n=n.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let n=null;this.head=null;for(let r of t){const o=gn.createItem(r);n!==null?n.next=o:this.head=o,o.prev=n,n=o}return this.tail=n,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,n=this){const r=this.allocateCursor(null,this.head);for(;r.next!==null;){const o=r.next;r.next=o.next,t.call(n,o.data,o,this)}this.releaseCursor()}forEachRight(t,n=this){const r=this.allocateCursor(this.tail,null);for(;r.prev!==null;){const o=r.prev;r.prev=o.prev,t.call(n,o.data,o,this)}this.releaseCursor()}reduce(t,n,r=this){let o=this.allocateCursor(null,this.head),i=n,s;for(;o.next!==null;)s=o.next,o.next=s.next,i=t.call(r,i,s.data,s,this);return this.releaseCursor(),i}reduceRight(t,n,r=this){let o=this.allocateCursor(this.tail,null),i=n,s;for(;o.prev!==null;)s=o.prev,o.prev=s.prev,i=t.call(r,i,s.data,s,this);return this.releaseCursor(),i}some(t,n=this){for(let r=this.head;r!==null;r=r.next)if(t.call(n,r.data,r,this))return!0;return!1}map(t,n=this){const r=new gn;for(let o=this.head;o!==null;o=o.next)r.appendData(t.call(n,o.data,o,this));return r}filter(t,n=this){const r=new gn;for(let o=this.head;o!==null;o=o.next)t.call(n,o.data,o,this)&&r.appendData(o.data);return r}nextUntil(t,n,r=this){if(t===null)return;const o=this.allocateCursor(null,t);for(;o.next!==null;){const i=o.next;if(o.next=i.next,n.call(r,i.data,i,this))break}this.releaseCursor()}prevUntil(t,n,r=this){if(t===null)return;const o=this.allocateCursor(t,null);for(;o.prev!==null;){const i=o.prev;if(o.prev=i.prev,n.call(r,i.data,i,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const t=new gn;for(let n of this)t.appendData(n);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(gn.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(gn.createItem(t))}insert(t,n=null){if(n!==null)if(this.updateCursors(n.prev,t,n,t),n.prev===null){if(this.head!==n)throw new Error("before doesn't belong to list");this.head=t,n.prev=t,t.next=n,this.updateCursors(null,t)}else n.prev.next=t,t.prev=n.prev,n.prev=t,t.next=n;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,n){return this.insert(gn.createItem(t),n)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(gn.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(gn.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,n){return t.head===null?this:(n!=null?(this.updateCursors(n.prev,t.tail,n,t.head),n.prev!==null?(n.prev.next=t.head,t.head.prev=n.prev):this.head=t.head,n.prev=t.tail,t.tail.next=n):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,n){"head"in n?this.insertList(n,t):this.insert(n,t),this.remove(t)}};function Sa(e,t){const n=Object.create(SyntaxError.prototype),r=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(r.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
30
+ `)}})}var Th=100,fk=60,pk=" ";function _h({source:e,line:t,column:n},r){function o(u,d){return i.slice(u,d).map((m,p)=>String(u+p+1).padStart(l)+" |"+m).join(`
31
+ `)}const i=e.split(/\r\n?|\n|\f/),s=Math.max(1,t-r)-1,a=Math.min(t+r,i.length+1),l=Math.max(4,String(a).length)+1;let c=0;n+=3*(i[t-1].substr(0,n-1).match(/\t/g)||[]).length,n>Th&&(c=n-fk+3,n=58);for(let u=s;u<=a;u++)u>=0&&u<i.length&&(i[u]=i[u].replace(/\t/g,pk),i[u]=(c>0&&i[u].length>c?"…":"")+i[u].substr(c,98)+(i[u].length>c+Th-1?"…":""));return[o(s,t),new Array(n+l+2).join("-")+"^",o(t,a)].filter(Boolean).join(`
32
+ `)}function kh(e,t,n,r,o){return Object.assign(Sa("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment(i){return _h({source:t,line:r,column:o},isNaN(i)?0:i)},get formattedMessage(){return`Parse error: ${e}
33
+ `+_h({source:t,line:r,column:o},2)}})}function hk(e){const t=this.createList();let n=!1;const r={recognizer:e};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:n=!0,this.next();continue}let o=e.getNode.call(this,r);if(o===void 0)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,o,t,r),n=!1),t.push(o)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,r),t}var Lh=()=>{},gk=33,bk=35,uu=59,Nh=123,xh=0;function yk(e){return function(){return this[e]()}}function du(e){const t=Object.create(null);for(const n in e){const r=e[n],o=r.parse||r;o&&(t[n]=o)}return t}function vk(e){const t={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:du(e.atrule),pseudo:du(e.pseudo),node:du(e.node)};for(const n in e.parseContext)switch(typeof e.parseContext[n]){case"function":t.context[n]=e.parseContext[n];break;case"string":t.context[n]=yk(e.parseContext[n])}return{config:t,...t,...t.node}}function Ek(e){let t="",n="<unknown>",r=!1,o=Lh,i=!1;const s=new uk,a=Object.assign(new mk,vk(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:hk,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(c){return c===Nh?1:0},consumeUntilLeftCurlyBracketOrSemicolon(c){return c===Nh||c===uu?1:0},consumeUntilExclamationMarkOrSemicolon(c){return c===gk||c===uu?1:0},consumeUntilSemicolonIncluded(c){return c===uu?2:0},createList(){return new Ve},createSingleNodeList(c){return new Ve().appendData(c)},getFirstListNode(c){return c&&c.first},getLastListNode(c){return c&&c.last},parseWithFallback(c,u){const d=this.tokenIndex;try{return c.call(this)}catch(m){if(i)throw m;const p=u.call(this,d);return i=!0,o(m,p),i=!1,p}},lookupNonWSType(c){let u;do if(u=this.lookupType(c++),u!==13)return u;while(u!==xh);return xh},charCodeAt(c){return c>=0&&c<t.length?t.charCodeAt(c):0},substring(c,u){return t.substring(c,u)},substrToCursor(c){return this.source.substring(c,this.tokenStart)},cmpChar(c,u){return mo(t,c,u)},cmpStr(c,u,d){return pi(t,c,u,d)},consume(c){const u=this.tokenStart;return this.eat(c),this.substrToCursor(u)},consumeFunctionName(){const c=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),c},consumeNumber(c){const u=t.substring(this.tokenStart,ya(t,this.tokenStart));return this.eat(c),u},eat(c){if(this.tokenType!==c){const u=Sh[c].slice(0,-6).replace(/-/g," ").replace(/^./,p=>p.toUpperCase());let d=`${/[[\](){}]/.test(u)?`"${u}"`:u} is expected`,m=this.tokenStart;switch(c){case 1:this.tokenType===2||this.tokenType===7?(m=this.tokenEnd-1,d="Identifier is expected but function found"):d="Identifier is expected";break;case 4:this.isDelim(bk)&&(this.next(),m++,d="Name is expected");break;case 11:this.tokenType===10&&(m=this.tokenEnd,d="Percent sign is expected")}this.error(d,m)}this.next()},eatIdent(c){(this.tokenType!==1||this.lookupValue(0,c)===!1)&&this.error(`Identifier "${c}" is expected`),this.next()},eatDelim(c){this.isDelim(c)||this.error(`Delim "${String.fromCharCode(c)}" is expected`),this.next()},getLocation(c,u){return r?s.getLocationRange(c,u,n):null},getLocationFromList(c){if(r){const u=this.getFirstListNode(c),d=this.getLastListNode(c);return s.getLocationRange(u!==null?u.loc.start.offset-s.startOffset:this.tokenStart,d!==null?d.loc.end.offset-s.startOffset:this.tokenStart,n)}return null},error(c,u){const d=typeof u<"u"&&u<t.length?s.getLocation(u):this.eof?s.getLocation(ak(t,t.length-1)):s.getLocation(this.tokenStart);throw new kh(c||"Unexpected input",t,d.offset,d.line,d.column)}});return Object.assign(function(c,u){t=c,u=u||{},a.setSource(t,Ea),s.setSource(t,u.offset,u.line,u.column),n=u.filename||"<unknown>",r=!!u.positions,o=typeof u.onParseError=="function"?u.onParseError:Lh,i=!1,a.parseAtrulePrelude="parseAtrulePrelude"in u?!!u.parseAtrulePrelude:!0,a.parseRulePrelude="parseRulePrelude"in u?!!u.parseRulePrelude:!0,a.parseValue="parseValue"in u?!!u.parseValue:!0,a.parseCustomProperty="parseCustomProperty"in u?!!u.parseCustomProperty:!1;const{context:d="default",onComment:m}=u;if(!(d in a.context))throw new Error("Unknown context `"+d+"`");typeof m=="function"&&a.forEachToken((f,h,y)=>{if(f===25){const E=a.getLocation(h,y),C=pi(t,y-2,y,"*/")?t.slice(h+2,y-2):t.slice(h+2,y);m(C,E)}});const p=a.context[d].call(a,u);return a.eof||a.error(),p},{SyntaxError:kh,config:a.config})}var Sk=Yn((e=>{var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(n){if(0<=n&&n<t.length)return t[n];throw new TypeError("Must be between 0 and 63: "+n)},e.decode=function(n){var r=65,o=90,i=97,s=122,a=48,l=57,c=43,u=47,d=26,m=52;return r<=n&&n<=o?n-r:i<=n&&n<=s?n-i+d:a<=n&&n<=l?n-a+m:n==c?62:n==u?63:-1}})),wk=Yn((e=>{var t=Sk(),n=5,r=1<<n,o=r-1,i=r;function s(l){return l<0?(-l<<1)+1:(l<<1)+0}function a(l){var c=(l&1)===1,u=l>>1;return c?-u:u}e.encode=function(c){var u="",d,m=s(c);do d=m&o,m>>>=n,m>0&&(d|=i),u+=t.encode(d);while(m>0);return u},e.decode=function(c,u,d){var m=c.length,p=0,f=0,h,y;do{if(u>=m)throw new Error("Expected more digits in base 64 VLQ value.");if(y=t.decode(c.charCodeAt(u++)),y===-1)throw new Error("Invalid base64 digit: "+c.charAt(u-1));h=!!(y&i),y&=o,p=p+(y<<f),f+=n}while(h);d.value=a(p),d.rest=u}})),mu=Yn((e=>{function t(g,S,T){if(S in g)return g[S];if(arguments.length===3)return T;throw new Error('"'+S+'" is a required argument.')}e.getArg=t;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(g){var S=g.match(n);return S?{scheme:S[1],auth:S[2],host:S[3],port:S[4],path:S[5]}:null}e.urlParse=o;function i(g){var S="";return g.scheme&&(S+=g.scheme+":"),S+="//",g.auth&&(S+=g.auth+"@"),g.host&&(S+=g.host),g.port&&(S+=":"+g.port),g.path&&(S+=g.path),S}e.urlGenerate=i;var s=32;function a(g){var S=[];return function(T){for(var _=0;_<S.length;_++)if(S[_].input===T){var M=S[0];return S[0]=S[_],S[_]=M,S[0].result}var N=g(T);return S.unshift({input:T,result:N}),S.length>s&&S.pop(),N}}var l=a(function(S){var T=S,_=o(S);if(_){if(!_.path)return S;T=_.path}for(var M=e.isAbsolute(T),N=[],W=0,P=0;;)if(W=P,P=T.indexOf("/",W),P===-1){N.push(T.slice(W));break}else for(N.push(T.slice(W,P));P<T.length&&T[P]==="/";)P++;for(var R,Y=0,P=N.length-1;P>=0;P--)R=N[P],R==="."?N.splice(P,1):R===".."?Y++:Y>0&&(R===""?(N.splice(P+1,Y),Y=0):(N.splice(P,2),Y--));return T=N.join("/"),T===""&&(T=M?"/":"."),_?(_.path=T,i(_)):T});e.normalize=l;function c(g,S){g===""&&(g="."),S===""&&(S=".");var T=o(S),_=o(g);if(_&&(g=_.path||"/"),T&&!T.scheme)return _&&(T.scheme=_.scheme),i(T);if(T||S.match(r))return S;if(_&&!_.host&&!_.path)return _.host=S,i(_);var M=S.charAt(0)==="/"?S:l(g.replace(/\/+$/,"")+"/"+S);return _?(_.path=M,i(_)):M}e.join=c,e.isAbsolute=function(g){return g.charAt(0)==="/"||n.test(g)};function u(g,S){g===""&&(g="."),g=g.replace(/\/$/,"");for(var T=0;S.indexOf(g+"/")!==0;){var _=g.lastIndexOf("/");if(_<0||(g=g.slice(0,_),g.match(/^([^\/]+:\/)?\/*$/)))return S;++T}return Array(T+1).join("../")+S.substr(g.length+1)}e.relative=u;var d=(function(){return!("__proto__"in Object.create(null))})();function m(g){return g}function p(g){return h(g)?"$"+g:g}e.toSetString=d?m:p;function f(g){return h(g)?g.slice(1):g}e.fromSetString=d?m:f;function h(g){if(!g)return!1;var S=g.length;if(S<9||g.charCodeAt(S-1)!==95||g.charCodeAt(S-2)!==95||g.charCodeAt(S-3)!==111||g.charCodeAt(S-4)!==116||g.charCodeAt(S-5)!==111||g.charCodeAt(S-6)!==114||g.charCodeAt(S-7)!==112||g.charCodeAt(S-8)!==95||g.charCodeAt(S-9)!==95)return!1;for(var T=S-10;T>=0;T--)if(g.charCodeAt(T)!==36)return!1;return!0}function y(g,S,T){var _=w(g.source,S.source);return _!==0||(_=g.originalLine-S.originalLine,_!==0)||(_=g.originalColumn-S.originalColumn,_!==0||T)||(_=g.generatedColumn-S.generatedColumn,_!==0)||(_=g.generatedLine-S.generatedLine,_!==0)?_:w(g.name,S.name)}e.compareByOriginalPositions=y;function E(g,S,T){var _=g.originalLine-S.originalLine;return _!==0||(_=g.originalColumn-S.originalColumn,_!==0||T)||(_=g.generatedColumn-S.generatedColumn,_!==0)||(_=g.generatedLine-S.generatedLine,_!==0)?_:w(g.name,S.name)}e.compareByOriginalPositionsNoSource=E;function C(g,S,T){var _=g.generatedLine-S.generatedLine;return _!==0||(_=g.generatedColumn-S.generatedColumn,_!==0||T)||(_=w(g.source,S.source),_!==0)||(_=g.originalLine-S.originalLine,_!==0)||(_=g.originalColumn-S.originalColumn,_!==0)?_:w(g.name,S.name)}e.compareByGeneratedPositionsDeflated=C;function k(g,S,T){var _=g.generatedColumn-S.generatedColumn;return _!==0||T||(_=w(g.source,S.source),_!==0)||(_=g.originalLine-S.originalLine,_!==0)||(_=g.originalColumn-S.originalColumn,_!==0)?_:w(g.name,S.name)}e.compareByGeneratedPositionsDeflatedNoLine=k;function w(g,S){return g===S?0:g===null?1:S===null?-1:g>S?1:-1}function b(g,S){var T=g.generatedLine-S.generatedLine;return T!==0||(T=g.generatedColumn-S.generatedColumn,T!==0)||(T=w(g.source,S.source),T!==0)||(T=g.originalLine-S.originalLine,T!==0)||(T=g.originalColumn-S.originalColumn,T!==0)?T:w(g.name,S.name)}e.compareByGeneratedPositionsInflated=b;function v(g){return JSON.parse(g.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=v;function A(g,S,T){if(S=S||"",g&&(g[g.length-1]!=="/"&&S[0]!=="/"&&(g+="/"),S=g+S),T){var _=o(T);if(!_)throw new Error("sourceMapURL could not be parsed");if(_.path){var M=_.path.lastIndexOf("/");M>=0&&(_.path=_.path.substring(0,M+1))}S=c(i(_),S)}return l(S)}e.computeSourceURL=A})),Ck=Yn((e=>{var t=mu(),n=Object.prototype.hasOwnProperty,r=typeof Map<"u";function o(){this._array=[],this._set=r?new Map:Object.create(null)}o.fromArray=function(s,a){for(var l=new o,c=0,u=s.length;c<u;c++)l.add(s[c],a);return l},o.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},o.prototype.add=function(s,a){var l=r?s:t.toSetString(s),c=r?this.has(s):n.call(this._set,l),u=this._array.length;(!c||a)&&this._array.push(s),c||(r?this._set.set(s,u):this._set[l]=u)},o.prototype.has=function(s){if(r)return this._set.has(s);var a=t.toSetString(s);return n.call(this._set,a)},o.prototype.indexOf=function(s){if(r){var a=this._set.get(s);if(a>=0)return a}else{var l=t.toSetString(s);if(n.call(this._set,l))return this._set[l]}throw new Error('"'+s+'" is not in the set.')},o.prototype.at=function(s){if(s>=0&&s<this._array.length)return this._array[s];throw new Error("No element indexed by "+s)},o.prototype.toArray=function(){return this._array.slice()},e.ArraySet=o})),Ak=Yn((e=>{var t=mu();function n(o,i){var s=o.generatedLine,a=i.generatedLine,l=o.generatedColumn,c=i.generatedColumn;return a>s||a==s&&c>=l||t.compareByGeneratedPositionsInflated(o,i)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(i,s){this._array.forEach(i,s)},r.prototype.add=function(i){n(this._last,i)?(this._last=i,this._array.push(i)):(this._sorted=!1,this._array.push(i))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},e.MappingList=r})),Tk=Yn((e=>{var t=wk(),n=mu(),r=Ck().ArraySet,o=Ak().MappingList;function i(s){s||(s={}),this._file=n.getArg(s,"file",null),this._sourceRoot=n.getArg(s,"sourceRoot",null),this._skipValidation=n.getArg(s,"skipValidation",!1),this._ignoreInvalidMapping=n.getArg(s,"ignoreInvalidMapping",!1),this._sources=new r,this._names=new r,this._mappings=new o,this._sourcesContents=null}i.prototype._version=3,i.fromSourceMap=function(a,l){var c=a.sourceRoot,u=new i(Object.assign(l||{},{file:a.file,sourceRoot:c}));return a.eachMapping(function(d){var m={generated:{line:d.generatedLine,column:d.generatedColumn}};d.source!=null&&(m.source=d.source,c!=null&&(m.source=n.relative(c,m.source)),m.original={line:d.originalLine,column:d.originalColumn},d.name!=null&&(m.name=d.name)),u.addMapping(m)}),a.sources.forEach(function(d){var m=d;c!==null&&(m=n.relative(c,d)),u._sources.has(m)||u._sources.add(m);var p=a.sourceContentFor(d);p!=null&&u.setSourceContent(d,p)}),u},i.prototype.addMapping=function(a){var l=n.getArg(a,"generated"),c=n.getArg(a,"original",null),u=n.getArg(a,"source",null),d=n.getArg(a,"name",null);!this._skipValidation&&this._validateMapping(l,c,u,d)===!1||(u!=null&&(u=String(u),this._sources.has(u)||this._sources.add(u)),d!=null&&(d=String(d),this._names.has(d)||this._names.add(d)),this._mappings.add({generatedLine:l.line,generatedColumn:l.column,originalLine:c!=null&&c.line,originalColumn:c!=null&&c.column,source:u,name:d}))},i.prototype.setSourceContent=function(a,l){var c=a;this._sourceRoot!=null&&(c=n.relative(this._sourceRoot,c)),l!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[n.toSetString(c)]=l):this._sourcesContents&&(delete this._sourcesContents[n.toSetString(c)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},i.prototype.applySourceMap=function(a,l,c){var u=l;if(l==null){if(a.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);u=a.file}var d=this._sourceRoot;d!=null&&(u=n.relative(d,u));var m=new r,p=new r;this._mappings.unsortedForEach(function(f){if(f.source===u&&f.originalLine!=null){var h=a.originalPositionFor({line:f.originalLine,column:f.originalColumn});h.source!=null&&(f.source=h.source,c!=null&&(f.source=n.join(c,f.source)),d!=null&&(f.source=n.relative(d,f.source)),f.originalLine=h.line,f.originalColumn=h.column,h.name!=null&&(f.name=h.name))}var y=f.source;y!=null&&!m.has(y)&&m.add(y);var E=f.name;E!=null&&!p.has(E)&&p.add(E)},this),this._sources=m,this._names=p,a.sources.forEach(function(f){var h=a.sourceContentFor(f);h!=null&&(c!=null&&(f=n.join(c,f)),d!=null&&(f=n.relative(d,f)),this.setSourceContent(f,h))},this)},i.prototype._validateMapping=function(a,l,c,u){if(l&&typeof l.line!="number"&&typeof l.column!="number"){var d="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return!1;throw new Error(d)}if(!(a&&"line"in a&&"column"in a&&a.line>0&&a.column>=0&&!l&&!c&&!u)){if(a&&"line"in a&&"column"in a&&l&&"line"in l&&"column"in l&&a.line>0&&a.column>=0&&l.line>0&&l.column>=0&&c)return;var d="Invalid mapping: "+JSON.stringify({generated:a,source:c,original:l,name:u});if(this._ignoreInvalidMapping)return!1;throw new Error(d)}},i.prototype._serializeMappings=function(){for(var a=0,l=1,c=0,u=0,d=0,m=0,p="",f,h,y,E,C=this._mappings.toArray(),k=0,w=C.length;k<w;k++){if(h=C[k],f="",h.generatedLine!==l)for(a=0;h.generatedLine!==l;)f+=";",l++;else if(k>0){if(!n.compareByGeneratedPositionsInflated(h,C[k-1]))continue;f+=","}f+=t.encode(h.generatedColumn-a),a=h.generatedColumn,h.source!=null&&(E=this._sources.indexOf(h.source),f+=t.encode(E-m),m=E,f+=t.encode(h.originalLine-1-u),u=h.originalLine-1,f+=t.encode(h.originalColumn-c),c=h.originalColumn,h.name!=null&&(y=this._names.indexOf(h.name),f+=t.encode(y-d),d=y)),p+=f}return p},i.prototype._generateSourcesContent=function(a,l){return a.map(function(c){if(!this._sourcesContents)return null;l!=null&&(c=n.relative(l,c));var u=n.toSetString(c);return Object.prototype.hasOwnProperty.call(this._sourcesContents,u)?this._sourcesContents[u]:null},this)},i.prototype.toJSON=function(){var a={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(a.file=this._file),this._sourceRoot!=null&&(a.sourceRoot=this._sourceRoot),this._sourcesContents&&(a.sourcesContent=this._generateSourcesContent(a.sources,a.sourceRoot)),a},i.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=i})),_k=Tk(),Mh=new Set(["Atrule","Selector","Declaration"]);function kk(e){const t=new _k.SourceMapGenerator,n={line:1,column:0},r={line:0,column:0},o={line:1,column:0},i={generated:o};let s=1,a=0,l=!1;const c=e.node;e.node=function(m){if(m.loc&&m.loc.start&&Mh.has(m.type)){const p=m.loc.start.line,f=m.loc.start.column-1;(r.line!==p||r.column!==f)&&(r.line=p,r.column=f,n.line=s,n.column=a,l&&(l=!1,(n.line!==o.line||n.column!==o.column)&&t.addMapping(i)),l=!0,t.addMapping({source:m.loc.source,original:r,generated:n}))}c.call(this,m),l&&Mh.has(m.type)&&(o.line=s,o.column=a)};const u=e.emit;e.emit=function(m,p,f){for(let h=0;h<m.length;h++)m.charCodeAt(h)===10?(s++,a=0):a++;u(m,p,f)};const d=e.result;return e.result=function(){return l&&t.addMapping(i),{css:d(),map:t}},e}var Rh=ie({safe:()=>Ih,spec:()=>Mk}),Lk=43,Nk=45,fu=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},Oh=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],xk=Oh.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function Ph(e){const t=new Set(e.map(([n,r])=>fu(n)<<16|fu(r)));return function(n,r,o){const i=fu(r,o),s=o.charCodeAt(0);return(s===Nk&&r!==1&&r!==2&&r!==15||s===Lk?t.has(n<<16|s<<8):t.has(n<<16|i))&&this.emit(" ",13,!0),i}}var Mk=Ph(Oh),Ih=Ph(xk),Rk=92;function Ok(e,t){if(typeof t=="function"){let n=null;e.children.forEach(r=>{n!==null&&t.call(this,n),this.node(r),n=r});return}e.children.forEach(this.node,this)}function Pk(e){Ea(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}function Ik(e){const t=new Map;for(let n in e.node){const r=e.node[n];typeof(r.generate||r)=="function"&&t.set(n,r.generate||r)}return function(n,r){let o="",i=0,s={node(l){if(t.has(l.type))t.get(l.type).call(a,l);else throw new Error("Unknown node type: "+l.type)},tokenBefore:Ih,token(l,c){i=this.tokenBefore(i,l,c),this.emit(c,l,!1),l===9&&c.charCodeAt(0)===Rk&&this.emit(`
34
+ `,13,!0)},emit(l){o+=l},result(){return o}};r&&(typeof r.decorator=="function"&&(s=r.decorator(s)),r.sourceMap&&(s=kk(s)),r.mode in Rh&&(s.tokenBefore=Rh[r.mode]));const a={node:l=>s.node(l),children:Ok,token:(l,c)=>s.token(l,c),tokenize:Pk};return s.node(n),s.result()}}function Dk(e){return{fromPlainObject(t){return e(t,{enter(n){n.children&&!(n.children instanceof Ve)&&(n.children=new Ve().fromArray(n.children))}}),t},toPlainObject(t){return e(t,{leave(n){n.children&&n.children instanceof Ve&&(n.children=n.children.toArray())}}),t}}}var{hasOwnProperty:pu}=Object.prototype,hi=function(){};function Dh(e){return typeof e=="function"?e:hi}function Bh(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function Bk(e,t){const n=t.structure,r=[];for(const o in n){if(pu.call(n,o)===!1)continue;let i=n[o];const s={name:o,type:!1,nullable:!1};Array.isArray(i)||(i=[i]);for(const a of i)a===null?s.nullable=!0:typeof a=="string"?s.type="node":Array.isArray(a)&&(s.type="list");s.type&&r.push(s)}return r.length?{context:t.walkContext,fields:r}:null}function Hk(e){const t={};for(const n in e.node)if(pu.call(e.node,n)){const r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=Bk(n,r)}return t}function Hh(e,t){const n=e.fields.slice(),r=e.context,o=typeof r=="string";return t&&n.reverse(),function(i,s,a,l){let c;o&&(c=s[r],s[r]=i);for(const u of n){const d=i[u.name];if(!u.nullable||d){if(u.type==="list"){if(t?d.reduceRight(l,!1):d.reduce(l,!1))return!0}else if(a(d))return!0}}o&&(s[r]=c)}}function Fh({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}}}function Fk(e){const t=Hk(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(const c in t)pu.call(t,c)&&t[c]!==null&&(n[c]=Hh(t[c],!1),r[c]=Hh(t[c],!0));const s=Fh(n),a=Fh(r),l=function(c,u){function d(E,C,k){const w=m.call(y,E,C,k);return w===o?!0:w===i?!1:!!(f.hasOwnProperty(E.type)&&f[E.type](E,y,d,h)||p.call(y,E,C,k)===o)}let m=hi,p=hi,f=n,h=(E,C,k,w)=>E||d(C,k,w);const y={break:o,skip:i,root:c,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof u=="function")m=u;else if(u&&(m=Dh(u.enter),p=Dh(u.leave),u.reverse&&(f=r),u.visit)){if(s.hasOwnProperty(u.visit))f=u.reverse?a[u.visit]:s[u.visit];else if(!t.hasOwnProperty(u.visit))throw new Error("Bad value `"+u.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");m=Bh(m,u.visit),p=Bh(p,u.visit)}if(m===hi&&p===hi)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");d(c)};return l.break=o,l.skip=i,l.find=function(c,u){let d=null;return l(c,function(m,p,f){if(u.call(this,m,p,f))return d=m,o}),d},l.findLast=function(c,u){let d=null;return l(c,{reverse:!0,enter(m,p,f){if(u.call(this,m,p,f))return d=m,o}}),d},l.findAll=function(c,u){const d=[];return l(c,function(m,p,f){u.call(this,m,p,f)&&d.push(m)}),d},l}function $k(e){return e}function Wk(e){const{min:t,max:n,comma:r}=e;return t===0&&n===0?r?"#?":"*":t===0&&n===1?"?":t===1&&n===0?r?"#":"+":t===1&&n===1?"":(r?"#":"")+(t===n?"{"+t+"}":"{"+t+","+(n!==0?n:"")+"}")}function qk(e){if(e.type==="Range")return" ["+(e.min===null?"-∞":e.min)+","+(e.max===null?"∞":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}function zk(e,t,n,r){const o=e.combinator===" "||r?e.combinator:" "+e.combinator+" ",i=e.terms.map(s=>hu(s,t,n,r)).join(o);return e.explicit||n?(r||i[0]===","?"[":"[ ")+i+(r?"]":" ]"):i}function hu(e,t,n,r){let o;switch(e.type){case"Group":o=zk(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return hu(e.term,t,n,r)+t(Wk(e),e);case"Type":o="<"+e.name+(e.opts?t(qk(e.opts),e.opts):"")+">";break;case"Property":o="<'"+e.name+"'>";break;case"Keyword":o=e.name;break;case"AtKeyword":o="@"+e.name;break;case"Function":o=e.name+"(";break;case"String":case"Token":o=e.value;break;case"Comma":o=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(o,e)}function gu(e,t){let n=$k,r=!1,o=!1;return typeof t=="function"?n=t:t&&(r=!!t.forceBraces,o=!!t.compact,typeof t.decorate=="function"&&(n=t.decorate)),hu(e,n,r,o)}var $h={offset:0,line:1,column:1};function Vk(e,t){const n=e.tokens,r=e.longestMatch,o=r<n.length&&n[r].node||null,i=o!==t?o:null;let s=0,a=0,l=0,c="",u,d;for(let m=0;m<n.length;m++){const p=n[m].value;m===r&&(a=p.length,s=c.length),i!==null&&n[m].node===i&&(m<=r?l++:l=0),c+=p}return r===n.length||l>1?(u=wa(i||t,"end")||gi($h,c),d=gi(u)):(u=wa(i,"start")||gi(wa(t,"start")||$h,c.slice(0,s)),d=wa(i,"end")||gi(u,c.substr(s,a))),{css:c,mismatchOffset:s,mismatchLength:a,start:u,end:d}}function wa(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?gi(n):n:null}function gi({offset:e,line:t,column:n},r){const o={offset:e,line:t,column:n};if(r){const i=r.split(/\n|\r\n?|\f/);o.offset+=r.length,o.line+=i.length-1,o.column=i.length===1?o.column+r.length:i.pop().length+1}return o}var bi=function(e,t){const n=Sa("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},Uk=function(e,t,n,r){const o=Sa("SyntaxMatchError",e),{css:i,mismatchOffset:s,mismatchLength:a,start:l,end:c}=Vk(r,n);return o.rawMessage=e,o.syntax=t?gu(t):"<generic>",o.css=i,o.mismatchOffset=s,o.mismatchLength=a,o.message=e+`
35
+ syntax: `+o.syntax+`
36
+ value: `+(i||"<empty string>")+`
37
+ --------`+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,l),o.loc={source:n&&n.loc&&n.loc.source||"<unknown>",start:l,end:c},o},Ca=new Map,ho=new Map,Aa=45,nn=jk,go=Gk;function bu(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Aa&&e.charCodeAt(t+1)===Aa}function Wh(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Aa&&e.charCodeAt(t+1)!==Aa){const n=e.indexOf("-",t+2);if(n!==-1)return e.substring(t,n+1)}return""}function jk(e){if(Ca.has(e))return Ca.get(e);const t=e.toLowerCase();let n=Ca.get(t);if(n===void 0){const r=bu(t,0),o=r?"":Wh(t,0);n=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:r})}return Ca.set(e,n),n}function Gk(e){if(ho.has(e))return ho.get(e);let t=e,n=e[0];n==="/"?n=e[1]==="/"?"//":"/":n!=="_"&&n!=="*"&&n!=="$"&&n!=="#"&&n!=="+"&&n!=="&"&&(n="");const r=bu(t,n.length);if(!r&&(t=t.toLowerCase(),ho.has(t))){const a=ho.get(t);return ho.set(e,a),a}const o=r?"":Wh(t,n.length),i=t.substr(0,n.length+o.length),s=Object.freeze({basename:t.substr(i.length),name:t.substr(n.length),hack:n,vendor:o,prefix:i,custom:r});return ho.set(e,s),s}var qh=["initial","inherit","unset","revert","revert-layer"],yi=43,Sn=45,yu=110,bo=!0,Xk=!1;function vu(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function vi(e,t,n){for(;e!==null&&(e.type===13||e.type===25);)e=n(++t);return t}function nr(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(o===yi||o===Sn){if(n)return 0;t++}for(;t<e.value.length;t++)if(!it(e.value.charCodeAt(t)))return 0;return r+1}function Eu(e,t,n){let r=!1,o=vi(e,t,n);if(e=n(o),e===null)return t;if(e.type!==10)if(vu(e,yi)||vu(e,Sn)){if(r=!0,o=vi(n(++o),o,n),e=n(o),e===null||e.type!==10)return 0}else return t;if(!r){const i=e.value.charCodeAt(0);if(i!==yi&&i!==Sn)return 0}return nr(e,r?0:1,r,o)}function Yk(e,t){let n=0;if(!e)return 0;if(e.type===10)return nr(e,0,Xk,n);if(e.type===1&&e.value.charCodeAt(0)===Sn){if(!mo(e.value,1,yu))return 0;switch(e.value.length){case 2:return Eu(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==Sn?0:(n=vi(t(++n),n,t),e=t(n),nr(e,0,bo,n));default:return e.value.charCodeAt(2)!==Sn?0:nr(e,3,bo,n)}}else if(e.type===1||vu(e,yi)&&t(n+1).type===1){if(e.type!==1&&(e=t(++n)),e===null||!mo(e.value,0,yu))return 0;switch(e.value.length){case 1:return Eu(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==Sn?0:(n=vi(t(++n),n,t),e=t(n),nr(e,0,bo,n));default:return e.value.charCodeAt(1)!==Sn?0:nr(e,2,bo,n)}}else if(e.type===12){let r=e.value.charCodeAt(0),o=r===yi||r===Sn?1:0,i=o;for(;i<e.value.length&&it(e.value.charCodeAt(i));i++);return i===o||!mo(e.value,i,yu)?0:i+1===e.value.length?Eu(t(++n),n,t):e.value.charCodeAt(i+1)!==Sn?0:i+2===e.value.length?(n=vi(t(++n),n,t),e=t(n),nr(e,0,bo,n)):nr(e,i+2,bo,n)}return 0}var Kk=43,zh=45,Vh=63,Zk=117;function Su(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Qk(e,t){return e.value.charCodeAt(0)===t}function Ei(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){const i=e.value.charCodeAt(o);if(i===zh&&n&&r!==0)return Ei(e,t+r+1,!1),6;if(!er(i)||++r>6)return 0}return r}function Ta(e,t,n){if(!e)return 0;for(;Su(n(t),Vh);){if(++e>6)return 0;t++}return t}function Jk(e,t){let n=0;if(e===null||e.type!==1||!mo(e.value,0,Zk)||(e=t(++n),e===null))return 0;if(Su(e,Kk))return e=t(++n),e===null?0:e.type===1?Ta(Ei(e,0,!0),++n,t):Su(e,Vh)?Ta(1,++n,t):0;if(e.type===10){const r=Ei(e,1,!0);return r===0?0:(e=t(++n),e===null?n:e.type===12||e.type===10?!Qk(e,zh)||!Ei(e,1,!1)?0:n+1:Ta(r,n,t))}return e.type===12?Ta(Ei(e,1,!0),++n,t):0}var eL=["calc(","-moz-calc(","-webkit-calc("],wu=new Map([[2,22],[21,22],[19,20],[23,24]]),tL=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],nL=["deg","grad","rad","turn"],rL=["s","ms"],oL=["hz","khz"],iL=["dpi","dpcm","dppx","x"],sL=["fr"],aL=["db"],lL=["st"];function rn(e,t){return t<e.length?e.charCodeAt(t):0}function Uh(e,t){return pi(e,0,e.length,t)}function jh(e,t){for(let n=0;n<t.length;n++)if(Uh(e,t[n]))return!0;return!1}function Gh(e,t){return t!==e.length-2?!1:rn(e,t)===92&&it(rn(e,t+1))}function _a(e,t,n){if(e&&e.type==="Range"){const r=Number(n!==void 0&&n!==t.length?t.substr(0,n):t);if(isNaN(r)||e.min!==null&&r<e.min&&typeof e.min!="string"||e.max!==null&&r>e.max&&typeof e.max!="string")return!0}return!1}function cL(e,t){let n=0,r=[],o=0;e:do{switch(e.type){case 24:case 22:case 20:if(e.type!==n)break e;if(n=r.pop(),r.length===0){o++;break e}break;case 2:case 21:case 19:case 23:r.push(n),n=wu.get(e.type)}o++}while(e=t(o));return o}function Gt(e){return function(t,n,r){return t===null?0:t.type===2&&jh(t.value,eL)?cL(t,n):e(t,n,r)}}function Re(e){return function(t){return t===null||t.type!==e?0:1}}function uL(e){if(e===null||e.type!==1)return 0;const t=e.value.toLowerCase();return jh(t,qh)||Uh(t,"default")?0:1}function dL(e){return e===null||e.type!==1||rn(e.value,0)!==45||rn(e.value,1)!==45?0:1}function mL(e){if(e===null||e.type!==4)return 0;const t=e.value.length;if(t!==4&&t!==5&&t!==7&&t!==9)return 0;for(let n=1;n<t;n++)if(!er(rn(e.value,n)))return 0;return 1}function fL(e){return e===null||e.type!==4||!ha(rn(e.value,1),rn(e.value,2),rn(e.value,3))?0:1}function pL(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==n)break e;n=r.pop();break;case 17:if(n===0)break e;break;case 9:if(n===0&&e.value==="!")break e;break;case 2:case 21:case 19:case 23:r.push(n),n=wu.get(e.type)}o++}while(e=t(o));return o}function hL(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==n)break e;n=r.pop();break;case 2:case 21:case 19:case 23:r.push(n),n=wu.get(e.type)}o++}while(e=t(o));return o}function $n(e){return e&&(e=new Set(e)),function(t,n,r){if(t===null||t.type!==12)return 0;const o=ya(t.value,0);if(e!==null){const i=t.value.indexOf("\\",o),s=i===-1||!Gh(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(s.toLowerCase())===!1)return 0}return _a(r,t.value,o)?0:1}}function gL(e,t,n){return e===null||e.type!==11||_a(n,e.value,e.value.length-1)?0:1}function Xh(e){return typeof e!="function"&&(e=function(){return 0}),function(t,n,r){return t!==null&&t.type===10&&Number(t.value)===0?1:e(t,n,r)}}function bL(e,t,n){if(e===null)return 0;const r=ya(e.value,0);return r!==e.value.length&&!Gh(e.value,r)||_a(n,e.value,r)?0:1}function yL(e,t,n){if(e===null||e.type!==10)return 0;let r=rn(e.value,0)===43||rn(e.value,0)===45?1:0;for(;r<e.value.length;r++)if(!it(rn(e.value,r)))return 0;return _a(n,e.value,r)?0:1}var Yh={"ident-token":Re(1),"function-token":Re(2),"at-keyword-token":Re(3),"hash-token":Re(4),"string-token":Re(5),"bad-string-token":Re(6),"url-token":Re(7),"bad-url-token":Re(8),"delim-token":Re(9),"number-token":Re(10),"percentage-token":Re(11),"dimension-token":Re(12),"whitespace-token":Re(13),"CDO-token":Re(14),"CDC-token":Re(15),"colon-token":Re(16),"semicolon-token":Re(17),"comma-token":Re(18),"[-token":Re(19),"]-token":Re(20),"(-token":Re(21),")-token":Re(22),"{-token":Re(23),"}-token":Re(24),string:Re(5),ident:Re(1),"custom-ident":uL,"custom-property-name":dL,"hex-color":mL,"id-selector":fL,"an-plus-b":Yk,urange:Jk,"declaration-value":pL,"any-value":hL,dimension:Gt($n(null)),angle:Gt($n(nL)),decibel:Gt($n(aL)),frequency:Gt($n(oL)),flex:Gt($n(sL)),length:Gt(Xh($n(tL))),resolution:Gt($n(iL)),semitones:Gt($n(lL)),time:Gt($n(rL)),percentage:Gt(gL),zero:Xh(),number:Gt(bL),integer:Gt(yL)};function vL(e,t,n){return Object.assign(Sa("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+`
38
+ `+t+`
39
+ --`+new Array((n||t.length)+1).join("-")+"^"})}var EL=9,SL=10,wL=12,CL=13,AL=32,TL=class{constructor(e){this.str=e,this.pos=0}charCodeAt(e){return e<this.str.length?this.str.charCodeAt(e):0}charCode(){return this.charCodeAt(this.pos)}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(e){return this.charCodeAt(this.findWsEnd(e))}findWsEnd(e){for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(t!==CL&&t!==SL&&t!==wL&&t!==AL&&t!==EL)break}return e}substringToPos(e){return this.str.substring(this.pos,this.pos=e)}eat(e){this.charCode()!==e&&this.error("Expect `"+String.fromCharCode(e)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(e){throw new vL(e,this.str,this.pos)}},_L=9,kL=10,LL=12,NL=13,xL=32,Kh=33,Cu=35,Zh=38,ka=39,Qh=40,ML=41,Jh=42,Au=43,Tu=44,eg=45,_u=60,tg=62,ku=63,RL=64,La=91,Lu=93,Na=123,ng=124,rg=125,og=8734,Si=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),ig={" ":1,"&&":2,"||":3,"|":4};function xa(e){return e.substringToPos(e.findWsEnd(e.pos))}function yo(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n>=128||Si[n]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function Ma(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n<48||n>57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function OL(e){const t=e.str.indexOf("'",e.pos+1);return t===-1&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function sg(e){let t=null,n=null;return e.eat(Na),t=Ma(e),e.charCode()===Tu?(e.pos++,e.charCode()!==rg&&(n=Ma(e))):n=t,e.eat(rg),{min:Number(t),max:n?Number(n):0}}function PL(e){let t=null,n=!1;switch(e.charCode()){case Jh:e.pos++,t={min:0,max:0};break;case Au:e.pos++,t={min:1,max:0};break;case ku:e.pos++,t={min:0,max:1};break;case Cu:e.pos++,n=!0,e.charCode()===Na?t=sg(e):e.charCode()===ku?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case Na:t=sg(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function vo(e,t){const n=PL(e);return n!==null?(n.term=t,e.charCode()===Cu&&e.charCodeAt(e.pos-1)===Au?vo(e,n):n):t}function Nu(e){const t=e.peek();return t===""?null:{type:"Token",value:t}}function IL(e){let t;return e.eat(_u),e.eat(ka),t=yo(e),e.eat(ka),e.eat(tg),vo(e,{type:"Property",name:t})}function DL(e){let t=null,n=null,r=1;return e.eat(La),e.charCode()===eg&&(e.peek(),r=-1),r==-1&&e.charCode()===og?e.peek():(t=r*Number(Ma(e)),Si[e.charCode()]!==0&&(t+=yo(e))),xa(e),e.eat(Tu),xa(e),e.charCode()===og?e.peek():(r=1,e.charCode()===eg&&(e.peek(),r=-1),n=r*Number(Ma(e)),Si[e.charCode()]!==0&&(n+=yo(e))),e.eat(Lu),{type:"Range",min:t,max:n}}function BL(e){let t,n=null;return e.eat(_u),t=yo(e),e.charCode()===Qh&&e.nextCharCode()===ML&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===La&&(xa(e),n=DL(e)),e.eat(tg),vo(e,{type:"Type",name:t,opts:n})}function HL(e){const t=yo(e);return e.charCode()===Qh?(e.pos++,{type:"Function",name:t}):vo(e,{type:"Keyword",name:t})}function FL(e,t){function n(o,i){return{type:"Group",terms:o,combinator:i,disallowEmpty:!1,explicit:!1}}let r;for(t=Object.keys(t).sort((o,i)=>ig[o]-ig[i]);t.length>0;){r=t.shift();let o=0,i=0;for(;o<e.length;o++){const s=e[o];s.type==="Combinator"&&(s.value===r?(i===-1&&(i=o-1),e.splice(o,1),o--):(i!==-1&&o-i>1&&(e.splice(i,o-i,n(e.slice(i,o),r)),o=i+1),i=-1))}i!==-1&&t.length&&e.splice(i,o-i,n(e.slice(i,o),r))}return r}function ag(e){const t=[],n={};let r,o=null,i=e.pos;for(;r=WL(e);)r.type!=="Spaces"&&(r.type==="Combinator"?((o===null||o.type==="Combinator")&&(e.pos=i,e.error("Unexpected combinator")),n[r.value]=!0):o!==null&&o.type!=="Combinator"&&(n[" "]=!0,t.push({type:"Combinator",value:" "})),t.push(r),o=r,i=e.pos);return o!==null&&o.type==="Combinator"&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:t,combinator:FL(t,n)||" ",disallowEmpty:!1,explicit:!1}}function $L(e){let t;return e.eat(La),t=ag(e),e.eat(Lu),t.explicit=!0,e.charCode()===Kh&&(e.pos++,t.disallowEmpty=!0),t}function WL(e){let t=e.charCode();if(t<128&&Si[t]===1)return HL(e);switch(t){case Lu:break;case La:return vo(e,$L(e));case _u:return e.nextCharCode()===ka?IL(e):BL(e);case ng:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===ng?2:1))};case Zh:return e.pos++,e.eat(Zh),{type:"Combinator",value:"&&"};case Tu:return e.pos++,{type:"Comma"};case ka:return vo(e,{type:"String",value:OL(e)});case xL:case _L:case kL:case NL:case LL:return{type:"Spaces",value:xa(e)};case RL:return t=e.nextCharCode(),t<128&&Si[t]===1?(e.pos++,{type:"AtKeyword",name:yo(e)}):Nu(e);case Jh:case Au:case ku:case Cu:case Kh:break;case Na:if(t=e.nextCharCode(),t<48||t>57)return Nu(e);break;default:return Nu(e)}}function lg(e){const t=new TL(e),n=ag(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var wi=function(){};function cg(e){return typeof e=="function"?e:wi}function qL(e,t,n){function r(s){switch(o.call(n,s),s.type){case"Group":s.terms.forEach(r);break;case"Multiplier":r(s.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+s.type)}i.call(n,s)}let o=wi,i=wi;if(typeof t=="function"?o=t:t&&(o=cg(t.enter),i=cg(t.leave)),o===wi&&i===wi)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var zL={decorator(e){const t=[];let n=null;return{...e,node(r){const o=n;n=r,e.node.call(this,r),n=o},emit(r,o,i){t.push({type:o,value:r,node:i?null:n})},result(){return t}}}};function VL(e){const t=[];return Ea(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function UL(e,t){return typeof e=="string"?VL(e):t.generate(e,zL)}var ye={type:"Match"},Ce={type:"Mismatch"},xu={type:"DisallowEmpty"},jL=40,GL=41;function ut(e,t,n){return t===ye&&n===Ce||e===ye&&t===ye&&n===ye?e:(e.type==="If"&&e.else===Ce&&t===ye&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function ug(e){return e.length>2&&e.charCodeAt(e.length-2)===jL&&e.charCodeAt(e.length-1)===GL}function dg(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&ug(e.name)}function Mu(e,t,n){switch(e){case" ":{let r=ye;for(let o=t.length-1;o>=0;o--){const i=t[o];r=ut(i,r,Ce)}return r}case"|":{let r=Ce,o=null;for(let i=t.length-1;i>=0;i--){let s=t[i];if(dg(s)&&(o===null&&i>0&&dg(t[i-1])&&(o=Object.create(null),r=ut({type:"Enum",map:o},ye,r)),o!==null)){const a=(ug(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=ut(s,ye,r)}return r}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let r=Ce;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Mu(e,t.filter(function(a){return a!==i}),!1):s=ye,r=ut(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?ye:Ce;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Mu(e,t.filter(function(a){return a!==i}),!0):s=ye,r=ut(i,s,r)}return r}}}function XL(e){let t=ye,n=Ru(e.term);if(e.max===0)n=ut(n,xu,Ce),t=ut(n,null,Ce),t.then=ut(ye,ye,t),e.comma&&(t.then.else=ut({type:"Comma",syntax:e},t,Ce));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==ye&&(t=ut({type:"Comma",syntax:e},t,Ce)),t=ut(n,ut(ye,ye,t),Ce);if(e.min===0)t=ut(ye,ye,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==ye&&(t=ut({type:"Comma",syntax:e},t,Ce)),t=ut(n,t,Ce);return t}function Ru(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Mu(e.combinator,e.terms.map(Ru),!1);return e.disallowEmpty&&(t=ut(t,xu,Ce)),t}case"Multiplier":return XL(e);case"Type":case"Property":return{type:e.type,name:e.name,syntax:e};case"Keyword":return{type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return{type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return{type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return e.value.length===3?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return{type:e.type,value:e.value,syntax:e};case"Comma":return{type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}function Ou(e,t){return typeof e=="string"&&(e=lg(e)),{type:"MatchGraph",match:Ru(e),syntax:t||null,source:e}}var{hasOwnProperty:mg}=Object.prototype,YL=0,KL=1,Pu=2,fg=3,pg="Match",ZL="Mismatch",QL="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",JL=15e3,e2=0;function t2(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function Iu(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=t.charCodeAt(n);let o=e.charCodeAt(n);if(o>=65&&o<=90&&(o=o|32),o!==r)return!1}return!0}function n2(e){return e.type!==9?!1:e.value!=="?"}function hg(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||n2(e)}function gg(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function r2(e,t,n){function r(){do C++,E=C<e.length?e[C]:null;while(E!==null&&(E.type===13||E.type===25))}function o(b){const v=C+b;return v<e.length?e[v]:null}function i(b,v){return{nextState:b,matchStack:w,syntaxStack:d,thenStack:m,tokenIndex:C,prev:v}}function s(b){m={nextState:b,matchStack:w,syntaxStack:d,prev:m}}function a(b){p=i(b,p)}function l(){w={type:KL,syntax:t.syntax,token:E,prev:w},r(),f=null,C>k&&(k=C)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},w={type:Pu,syntax:t.syntax,token:w.token,prev:w}}function u(){w.type===Pu?w=w.prev:w={type:fg,syntax:d.syntax,token:w.token,prev:w},d=d.prev}let d=null,m=null,p=null,f=null,h=0,y=null,E=null,C=-1,k=0,w={type:YL,syntax:null,token:null,prev:null};for(r();y===null&&++h<JL;)switch(t.type){case"Match":if(m===null){if(E!==null&&(C!==e.length-1||E.value!=="\\0"&&E.value!=="\\9")){t=Ce;break}y=pg;break}if(t=m.nextState,t===xu)if(m.matchStack===w){t=Ce;break}else t=ye;for(;m.syntaxStack!==d;)u();m=m.prev;break;case"Mismatch":if(f!==null&&f!==!1)(p===null||C>p.tokenIndex)&&(p=f,f=!1);else if(p===null){y=ZL;break}t=p.nextState,m=p.thenStack,d=p.syntaxStack,w=p.matchStack,C=p.tokenIndex,E=C<e.length?e[C]:null,p=p.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==Ce&&a(t.else),t.then!==ye&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const A=t.syntax.terms;if(t.index===A.length){if(t.mask===0||t.syntax.all){t=Ce;break}t=ye;break}if(t.mask===(1<<A.length)-1){t=ye;break}for(;t.index<A.length;t.index++){const g=1<<t.index;if((t.mask&g)===0){a(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|g}),t=A[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(E!==null){let A=E.value.toLowerCase();if(A.indexOf("\\")!==-1&&(A=A.replace(/\\[09].*$/,"")),mg.call(t.map,A)){t=t.map[A];break}}t=Ce;break;case"Generic":{const A=d!==null?d.opts:null,g=C+Math.floor(t.fn(E,o,A));if(!isNaN(g)&&g>C){for(;C<g;)l();t=ye}else t=Ce;break}case"Type":case"Property":{const A=t.type==="Type"?"types":"properties",g=mg.call(n,A)?n[A][t.name]:null;if(!g||!g.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(f!==!1&&E!==null&&t.type==="Type"&&(t.name==="custom-ident"&&E.type===1||t.name==="length"&&E.value==="0")){f===null&&(f=i(t,p)),t=Ce;break}c(),t=g.match;break}case"Keyword":{const A=t.name;if(E!==null){let g=E.value;if(g.indexOf("\\")!==-1&&(g=g.replace(/\\[09].*$/,"")),Iu(g,A)){l(),t=ye;break}}t=Ce;break}case"AtKeyword":case"Function":if(E!==null&&Iu(E.value,t.name)){l(),t=ye;break}t=Ce;break;case"Token":if(E!==null&&E.value===t.value){l(),t=ye;break}t=Ce;break;case"Comma":E!==null&&E.type===18?hg(w.token)?t=Ce:(l(),t=gg(E)?Ce:ye):t=hg(w.token)||gg(E)?ye:Ce;break;case"String":let b="",v=C;for(;v<e.length&&b.length<t.value.length;v++)b+=e[v].value;if(Iu(b,t.value)){for(;C<v;)l();t=ye}else t=Ce;break;default:throw new Error("Unknown node type: "+t.type)}switch(e2+=h,y){case null:y=QL,w=null;break;case pg:for(;d!==null;)u();break;default:w=null}return{tokens:e,reason:y,iterations:h,match:w,longestMatch:k}}function bg(e,t,n){const r=r2(e,t,n||{});if(r.match===null)return r;let o=r.match,i=r.match={syntax:t.syntax||null,match:[]};const s=[i];for(o=t2(o).prev;o!==null;){switch(o.type){case Pu:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case fg:s.pop(),i=s[s.length-1];break;default:i.match.push({syntax:o.syntax||null,token:o.token.value,node:o.token.node})}o=o.prev}return r}var o2=ie({getTrace:()=>yg,isKeyword:()=>a2,isProperty:()=>s2,isType:()=>i2});function yg(e){function t(o){return o===null?!1:o.type==="Type"||o.type==="Property"||o.type==="Keyword"}function n(o){if(Array.isArray(o.match)){for(let i=0;i<o.match.length;i++)if(n(o.match[i]))return t(o.syntax)&&r.unshift(o.syntax),!0}else if(o.node===e)return r=t(o.syntax)?[o.syntax]:[],!0;return!1}let r=null;return this.matched!==null&&n(this.matched),r}function i2(e,t){return Du(this,e,n=>n.type==="Type"&&n.name===t)}function s2(e,t){return Du(this,e,n=>n.type==="Property"&&n.name===t)}function a2(e){return Du(this,e,t=>t.type==="Keyword")}function Du(e,t,n){const r=yg.call(e,t);return r===null?!1:r.some(n)}function vg(e){return"node"in e?e.node:vg(e.match[0])}function Eg(e){return"node"in e?e.node:Eg(e.match[e.match.length-1])}function Sg(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){const l=vg(a),c=Eg(a);e.syntax.walk(t,function(u,d,m){if(u===l){const p=new Ve;do{if(p.appendData(d.data),d.data===c)break;d=d.next}while(d!==null);s.push({parent:m,nodes:p})}})}Array.isArray(a.match)&&a.match.forEach(i)}const s=[];return n.matched!==null&&i(n.matched),s}var{hasOwnProperty:Ci}=Object.prototype;function Bu(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function wg(e){return!!e&&Bu(e.offset)&&Bu(e.line)&&Bu(e.column)}function l2(e,t){return function(r,o){if(!r||r.constructor!==Object)return o(r,"Type of node should be an Object");for(let i in r){let s=!0;if(Ci.call(r,i)!==!1){if(i==="type")r.type!==e&&o(r,"Wrong node type `"+r.type+"`, expected `"+e+"`");else if(i==="loc"){if(r.loc===null)continue;if(r.loc&&r.loc.constructor===Object)if(typeof r.loc.source!="string")i+=".source";else if(!wg(r.loc.start))i+=".start";else if(!wg(r.loc.end))i+=".end";else continue;s=!1}else if(t.hasOwnProperty(i)){s=!1;for(let a=0;!s&&a<t[i].length;a++){const l=t[i][a];switch(l){case String:s=typeof r[i]=="string";break;case Boolean:s=typeof r[i]=="boolean";break;case null:s=r[i]===null;break;default:typeof l=="string"?s=r[i]&&r[i].type===l:Array.isArray(l)&&(s=r[i]instanceof Ve)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(const i in t)Ci.call(t,i)&&Ci.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function c2(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const i in n){if(Ci.call(n,i)===!1)continue;const s=[],a=r[i]=Array.isArray(n[i])?n[i].slice():[n[i]];for(let l=0;l<a.length;l++){const c=a[l];if(c===String||c===Boolean)s.push(c.name);else if(c===null)s.push("null");else if(typeof c=="string")s.push("<"+c+">");else if(Array.isArray(c))s.push("List");else throw new Error("Wrong value `"+c+"` in `"+e+"."+i+"` structure definition")}o[i]=s.join(" | ")}return{docs:o,check:l2(e,r)}}function u2(e){const t={};if(e.node){for(const n in e.node)if(Ci.call(e.node,n)){const r=e.node[n];if(r.structure)t[n]=c2(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var d2=Ou(qh.join(" | "));function Hu(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:gu(e[o].syntax,{compact:t}));return r}function m2(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:gu(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&Hu(i.descriptors,t,n)};return r}function f2(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function on(e,t,n){return{matched:e,iterations:n,error:t,...o2}}function Eo(e,t,n,r){const o=UL(n,e.syntax);let i;return f2(o)?on(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=bg(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=bg(o,t.match,e),!i.match)?on(null,new Uk(i.reason,t.syntax,n,i),i.iterations):on(i.match,null,i.iterations))}var Cg=class{constructor(e,t,n){if(this.cssWideKeywordsSyntax=d2,this.syntax=t,this.generic=!1,this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||u2(e),e){if(e.types)for(const r in e.types)this.addType_(r,e.types[r]);if(e.generic){this.generic=!0;for(const r in Yh)this.addType_(r,Yh[r])}if(e.atrules)for(const r in e.atrules)this.addAtrule_(r,e.atrules[r]);if(e.properties)for(const r in e.properties)this.addProperty_(r,e.properties[r])}}checkStructure(e){function t(o,i){r.push({node:o,message:i})}const n=this.structure,r=[];return this.syntax.walk(e,function(o){n.hasOwnProperty(o.type)?n[o.type].check(o,t):t(o,"Unknown node type `"+o.type+"`")}),r.length?r:!1}createDescriptor(e,t,n,r=null){const o={type:t,name:n},i={type:t,name:n,parent:r,serializable:typeof e=="string"||e&&typeof e.type=="string",syntax:null,match:null};return typeof e=="function"?i.match=Ou(e,o):(typeof e=="string"?Object.defineProperty(i,"syntax",{get(){return Object.defineProperty(i,"syntax",{value:lg(e)}),i.syntax}}):i.syntax=e,Object.defineProperty(i,"match",{get(){return Object.defineProperty(i,"match",{value:Ou(i.syntax,o)}),i.match}})),i}addAtrule_(e,t){t&&(this.atrules[e]={type:"Atrule",name:e,prelude:t.prelude?this.createDescriptor(t.prelude,"AtrulePrelude",e):null,descriptors:t.descriptors?Object.keys(t.descriptors).reduce((n,r)=>(n[r]=this.createDescriptor(t.descriptors[r],"AtruleDescriptor",r,e),n),Object.create(null)):null})}addProperty_(e,t){t&&(this.properties[e]=this.createDescriptor(t,"Property",e))}addType_(e,t){t&&(this.types[e]=this.createDescriptor(t,"Type",e))}checkAtruleName(e){if(!this.getAtrule(e))return new bi("Unknown at-rule","@"+e)}checkAtrulePrelude(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e);if(!r.prelude&&t)return new SyntaxError("At-rule `@"+e+"` should not contain a prelude");if(r.prelude&&!t&&!Eo(this,r.prelude,"",!1).matched)return new SyntaxError("At-rule `@"+e+"` should contain a prelude")}checkAtruleDescriptorName(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e),o=nn(t);if(!r.descriptors)return new SyntaxError("At-rule `@"+e+"` has no known descriptors");if(!r.descriptors[o.name]&&!r.descriptors[o.basename])return new bi("Unknown at-rule descriptor",t)}checkPropertyName(e){if(!this.getProperty(e))return new bi("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return on(null,n);const r=this.getAtrule(e);return r.prelude?Eo(this,r.prelude,t||"",!1):on(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return on(null,r);const o=this.getAtrule(e),i=nn(t);return Eo(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return e.type!=="Declaration"?on(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(go(e).custom)return on(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?on(null,n):Eo(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?Eo(this,n,t,!1):on(null,new bi("Unknown type",e))}match(e,t){return typeof e!="string"&&(!e||!e.type)?on(null,new bi("Bad syntax")):((typeof e=="string"||!e.match)&&(e=this.createDescriptor(e,"Type","anonymous")),Eo(this,e,t,!1))}findValueFragments(e,t,n,r){return Sg(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return Sg(this,e.value,this.matchDeclaration(e),t,n)}findAllFragments(e,t,n){const r=[];return this.syntax.walk(e,{visit:"Declaration",enter:o=>{r.push.apply(r,this.findDeclarationValueFragments(o,t,n))}}),r}getAtrule(e,t=!0){const n=nn(e);return(n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null}getAtrulePrelude(e,t=!0){const n=this.getAtrule(e,t);return n&&n.prelude||null}getAtruleDescriptor(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null}getProperty(e,t=!0){const n=go(e);return(n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null}getType(e){return hasOwnProperty.call(this.types,e)?this.types[e]:null}validate(){function e(r,o,i,s){if(i.has(o))return i.get(o);i.set(o,!1),s.syntax!==null&&qL(s.syntax,function(a){if(a.type!=="Type"&&a.type!=="Property")return;const l=a.type==="Type"?r.types:r.properties,c=a.type==="Type"?t:n;(!hasOwnProperty.call(l,a.name)||e(r,a.name,c,l[a.name]))&&i.set(o,!0)},this)}let t=new Map,n=new Map;for(const r in this.types)e(this,r,t,this.types[r]);for(const r in this.properties)e(this,r,n,this.properties[r]);return t=[...t.keys()].filter(r=>t.get(r)),n=[...n.keys()].filter(r=>n.get(r)),t.length||n.length?{types:t,properties:n}:null}dump(e,t){return{generic:this.generic,types:Hu(this.types,!t,e),properties:Hu(this.properties,!t,e),atrules:m2(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}},{hasOwnProperty:So}=Object.prototype,p2={generic:!0,types:Fu,atrules:{prelude:kg,descriptors:kg},properties:Fu,parseContext:h2,scope:Tg,atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function Ra(e){return e&&e.constructor===Object}function Ag(e){return Ra(e)?{...e}:e}function h2(e,t){return Object.assign(e,t)}function Tg(e,t){for(const n in t)So.call(t,n)&&(Ra(e[n])?Tg(e[n],t[n]):e[n]=Ag(t[n]));return e}function _g(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function Fu(e,t){if(typeof t=="string")return _g(e,t);const n={...e};for(let r in t)So.call(t,r)&&(n[r]=_g(So.call(e,r)?e[r]:void 0,t[r]));return n}function kg(e,t){const n=Fu(e,t);return!Ra(n)||Object.keys(n).length?n:null}function Ai(e,t,n){for(const r in n)if(So.call(n,r)!==!1){if(n[r]===!0)So.call(t,r)&&(e[r]=Ag(t[r]));else if(n[r]){if(typeof n[r]=="function"){const o=n[r];e[r]=o({},e[r]),e[r]=o(e[r]||{},t[r])}else if(Ra(n[r])){const o={};for(let i in e[r])o[i]=Ai({},e[r][i],n[r]);for(let i in t[r])o[i]=Ai(o[i]||{},t[r][i],n[r]);e[r]=o}else if(Array.isArray(n[r])){const o={},i=n[r].reduce(function(s,a){return s[a]=!0,s},{});for(const[s,a]of Object.entries(e[r]||{}))o[s]={},a&&Ai(o[s],a,i);for(const s in t[r])So.call(t[r],s)&&(o[s]||(o[s]={}),t[r]&&t[r][s]&&Ai(o[s],t[r][s],i));e[r]=o}}}return e}var $u=(e,t)=>Ai(e,t,p2);function Lg(e){const t=Ek(e),n=Fk(e),r=Ik(e),{fromPlainObject:o,toPlainObject:i}=Dk(n),s={lexer:null,createLexer:a=>new Cg(a,s,s.lexer.structure),tokenize:Ea,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){const l=$u({},e);return Lg(typeof a=="function"?a(l,Object.assign):$u(l,a))}};return s.lexer=new Cg({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var g2=e=>Lg($u({},e)),b2={generic:!0,types:{"absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","alpha-value":"<number>|<percentage>","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>","angular-color-stop":"<color>&&<color-stop-angle>?","angular-color-stop-list":"[<angular-color-stop> [, <angular-color-hint>]?]# , <angular-color-stop>","animateable-feature":"scroll-position|contents|<custom-ident>",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <type-or-unit>? [, <attr-fallback>]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<circle()>|<ellipse()>|<polygon()>|<path()>","bg-image":"none|<image>","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage>|auto]{1,2}|cover|contain","blur()":"blur( <length> )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( <number-percentage> )","calc()":"calc( <calc-sum> )","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-value":"<number>|<dimension>|<percentage>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( [<shape-radius>]? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<hex-color>|<named-color>|currentcolor|<deprecated-system-color>","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"<angle-percentage>{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"[<linear-color-stop> [, <linear-color-hint>]?]# , <linear-color-stop>",combinator:"'>'|'+'|'~'|['||']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>* [<pseudo-element-selector> <pseudo-class-selector>*]*]!","compound-selector-list":"<compound-selector>#","complex-selector":"<compound-selector> [<combinator>? <compound-selector>]*","complex-selector-list":"<complex-selector>#","conic-gradient()":"conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contrast()":"contrast( [<number-percentage>] )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( <length>{2,3} <color>? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( [<shape-radius>{2}]? [at <position>]? )","ending-shape":"circle|ellipse","env()":"env( <custom-ident> , <declaration-value>? )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","fill-rule":"nonzero|evenodd","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-function-list":"[<filter-function>|<url>]+","final-bg-layer":"<'background-color'>||<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","fit-content()":"fit-content( [<length>|<percentage>] )","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|<number [1,1000]>","frequency-percentage":"<frequency>|<percentage>","general-enclosed":"[<function-token> <any-value> )]|( <ident> <any-value> )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( <number-percentage> )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )","hsla()":"hsla( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )",hue:"<number>|<angle>","hue-rotate()":"hue-rotate( <angle> )","hwb()":"hwb( [<hue>|none] [<percentage>|none] [<percentage>|none] [/ [<alpha-value>|none]]? )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length>|<percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( <number-percentage> )","keyframes-name":"<custom-ident>|<string>","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-block-list":"<keyframe-block>+","keyframe-selector":"from|to|<percentage>","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","line-names":"'[' <custom-ident>* ']'","line-name-list":"[<line-names>|<name-repeat>]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-gradient()":"linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length>|<percentage>|min-content|max-content|auto] , [<length>|<percentage>|<flex>|min-content|max-content|auto] )","name-repeat":"repeat( [<integer [1,∞]>|auto-fill] , <line-names>+ )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"<ident>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"<an-plus-b>|even|odd","opacity()":"opacity( [<number-percentage>] )","overflow-position":"unsafe|safe","outline-radius":"<length>|<percentage>","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[<page-selector>#]?","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [<fill-rule> ,]? <string> )","paint()":"paint( <ident> , <declaration-value>? )","perspective()":"perspective( <length> )","polygon()":"polygon( <fill-rule>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","repeating-linear-gradient()":"repeating-linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","repeating-radial-gradient()":"repeating-radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","rgb()":"rgb( <percentage>{3} [/ <alpha-value>]? )|rgb( <number>{3} [/ <alpha-value>]? )|rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )","rgba()":"rgba( <percentage>{3} [/ <alpha-value>]? )|rgba( <number>{3} [/ <alpha-value>]? )|rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","saturate()":"saturate( <number-percentage> )","scale()":"scale( <number> , <number>? )","scale3d()":"scale3d( <number> , <number> , <number> )","scaleX()":"scaleX( <number> )","scaleY()":"scaleY( <number> )","scaleZ()":"scaleZ( <number> )","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"<length-percentage>|closest-side|farthest-side","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sepia()":"sepia( <number-percentage> )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","single-animation":"<time>||<easing-function>||<time>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<timeline-name>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-timing-function":"step-start|step-end|steps( <integer> [, <step-position>]? )","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-decl":"( <declaration> )","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","time-percentage":"<time>|<percentage>","timeline-name":"<custom-ident>|<string>","easing-function":"linear|<cubic-bezier-timing-function>|<step-timing-function>","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( [<length>|<percentage>] )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-width":"fill-available|min-intrinsic|intrinsic|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content|-webkit-min-content|-webkit-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-webkit-mask-clip-style":"border|border-box|padding|padding-box|content|content-box|text","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )","-ms-filter":"<string>",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>","bg-clip":"<box>|border|text","border-radius":"<length-percentage>{1,2}",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","lab()":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","lch()":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )",left:"<length>|auto","mask-image":"<mask-reference>#",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke",ratio:"<number [0,∞]> [/ <number [0,∞]>]?","reversed-counter-name":"reversed( <counter-name> )",right:"<length>|auto","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto","track-group":"'(' [<string>* <track-minmax> <string>*]+ ')' ['[' <positive-integer> ']']?|<track-minmax>","track-list-v0":"[<string>* <track-group> <string>*]+|none","track-minmax":"minmax( <track-breadth> , <track-breadth> )|auto|<track-breadth>|fit-content",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,∞]>","positive-integer":"<integer [0,∞]>","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zooming":"none|zoom","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-image-region":"<shape>|auto","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<color>","-webkit-border-before-color":"<color>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<box>|border|padding|content|text]||[<box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<box>|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",all:"initial|inherit|unset|revert|revert-layer",animation:"<single-animation>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"<time>#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-timing-function":"<easing-function>#","animation-timeline":"<single-animation-timeline>#",appearance:"none|auto|textfield|menulist-button|<compat-auto>","aspect-ratio":"auto|<ratio>",azimuth:"<angle>|[[left-side|far-left|left|center-left|center|center-right|right|far-right|right-side]||behind]|leftwards|rightwards","backdrop-filter":"none|<filter-function-list>","backface-visibility":"visible|hidden",background:"[<bg-layer> ,]* <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","block-overflow":"clip|ellipsis|<string>","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-color":"<'border-top-color'>{1,2}","border-block-style":"<'border-top-style'>","border-block-width":"<'border-top-width'>","border-block-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage>{1,2}","border-bottom-right-radius":"<length-percentage>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"collapse|separate","border-color":"<color>{1,4}","border-end-end-radius":"<length-percentage>{1,2}","border-end-start-radius":"<length-percentage>{1,2}","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length>|<number>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"<number-percentage>{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage>|<number>|auto]{1,4}","border-inline":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-style":"<'border-top-style'>","border-inline-width":"<'border-top-width'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage>{1,4} [/ <length-percentage>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length> <length>?","border-start-end-radius":"<length-percentage>{1,2}","border-start-start-radius":"<length-percentage>{1,2}","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage>{1,2}","border-top-right-radius":"<length-percentage>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"<length>|<percentage>|auto","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom|block-start|block-end|inline-start|inline-end","caret-color":"auto|<color>",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none",color:"<color>","print-color-adjust":"economy|exact","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance|balance-all","column-gap":"normal|<length-percentage>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"<length>|auto",columns:"<'column-width'>||<'column-count'>",contain:"none|strict|content|[size||layout||style||paint]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>]+]?","content-visibility":"visible|auto|hidden","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","empty-cells":"show|hide",filter:"none|<filter-function-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end",font:"[[<'font-style'>||<font-variant-css21>||<'font-weight'>||<'font-stretch'>]? <'font-size'> [/ <'line-height'>]? <'font-family'>]|caption|icon|menu|message-box|small-caption|status-bar","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-variation-settings":"normal|[<string> <number>]#","font-size":"<absolute-size>|<relative-size>|<length-percentage>","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps]","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-weight":"<font-weight-absolute>|bolder|lighter","forced-color-adjust":"auto|none",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","hyphenate-character":"auto|<string>",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>","input-security":"auto|none",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>",isolation:"auto|isolate","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"<length>|<percentage>|auto","letter-spacing":"normal|<length-percentage>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"[<length>|<percentage>|auto]{1,4}","margin-block":"<'margin-left'>{1,2}","margin-block-end":"<'margin-left'>","margin-block-start":"<'margin-left'>","margin-bottom":"<length>|<percentage>|auto","margin-inline":"<'margin-left'>{1,2}","margin-inline-end":"<'margin-left'>","margin-inline-start":"<'margin-left'>","margin-left":"<length>|<percentage>|auto","margin-right":"<length>|<percentage>|auto","margin-top":"<length>|<percentage>|auto","margin-trim":"none|in-flow|all",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<geometry-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<geometry-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|<-non-standard-width>","min-block-size":"<'min-width'>","min-height":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","min-inline-size":"<'min-width'>","min-width":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|<-non-standard-width>","mix-blend-mode":"<blend-mode>|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|ray( [<angle>&&<size>&&contain?] )|<path()>|<url>|[<basic-shape>||<geometry-box>]","offset-position":"auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<alpha-value>",order:"<integer>",orphans:"<integer>",outline:"[<'outline-color'>||<'outline-style'>||<'outline-width'>]","outline-color":"<color>|invert","outline-offset":"<length>","outline-style":"auto|<'border-style'>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,∞]>","overflow-inline":"visible|hidden|clip|scroll|auto","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto","overflow-y":"visible|hidden|clip|scroll|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"[<length>|<percentage>]{1,4}","padding-block":"<'padding-left'>{1,2}","padding-block-end":"<'padding-left'>","padding-block-start":"<'padding-left'>","padding-bottom":"<length>|<percentage>","padding-inline":"<'padding-left'>{1,2}","padding-inline-end":"<'padding-left'>","padding-inline-start":"<'padding-left'>","padding-left":"<length>|<percentage>","padding-right":"<length>|<percentage>","padding-top":"<length>|<percentage>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky",quotes:"none|auto|[<string> <string>]+",resize:"none|both|horizontal|vertical|block|inline",right:"<length>|<percentage>|auto",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-position":"[alternate||[over|under]]|inter-character",scale:"none|<number>{1,3}","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","scroll-behavior":"auto|smooth","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-start":"<length>","scroll-margin-block-end":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-start":"<length>","scroll-margin-inline-end":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","shape-image-threshold":"<alpha-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"[over|under]&&[right|left]","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-transform":"none|capitalize|uppercase|lowercase|full-width|full-size-kana","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]",top:"<length>|<percentage>|auto","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|contain|all","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>",visibility:"visible|hidden|collapse","white-space":"normal|pre|nowrap|pre-wrap|pre-line|break-spaces",widows:"<integer>",width:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|fill|stretch|intrinsic|-moz-max-content|-webkit-max-content|-moz-fit-content|-webkit-fit-content","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>","z-index":"auto|<integer>",zoom:"normal|reset|<number>|<percentage>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto","-webkit-user-select":"auto|none|text|all","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical","baseline-shift":"baseline|sub|super|<svg-length>",behavior:"<url>+","clip-rule":"nonzero|evenodd",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge",fill:"<paint>","fill-opacity":"<number-zero-one>","fill-rule":"nonzero|evenodd","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision",src:"[<url> [format( <string># )]?|local( <family-name> )]#",speak:"auto|none|normal","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]",stroke:"<paint>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<number-zero-one>","stroke-width":"<svg-length>","text-anchor":"start|middle|end","unicode-range":"<urange>#","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"[auto|block|swap|fallback|optional]","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-variation-settings":"normal|[<string> <number>]#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-weight":"<font-weight-absolute>{1,2}","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]",size:"<length>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},property:{prelude:"<custom-property-name>",descriptors:{syntax:"<string>",inherits:"true|false","initial-value":"<string>"}},"scroll-timeline":{prelude:"<timeline-name>",descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},viewport:{prelude:null,descriptors:{height:"<viewport-length>{1,2}","max-height":"<viewport-length>","max-width":"<viewport-length>","max-zoom":"auto|<number>|<percentage>","min-height":"<viewport-length>","min-width":"<viewport-length>","min-zoom":"auto|<number>|<percentage>",orientation:"auto|portrait|landscape","user-zoom":"zoom|fixed","viewport-fit":"auto|contain|cover",width:"<viewport-length>{1,2}",zoom:"auto|<number>|<percentage>"}}}},y2=ie({generate:()=>w2,name:()=>E2,parse:()=>Ng,structure:()=>S2}),wn=43,Mt=45,Oa=110,Ar=!0,v2=!1;function Pa(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===wn||r===Mt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)it(this.charCodeAt(n))||this.error("Integer is expected",n)}function wo(e){return Pa.call(this,0,e)}function rr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Oa:n="N is expected";break;case Mt:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function Wu(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10)if(this.isDelim(wn,e)||this.isDelim(Mt,e)){t=this.isDelim(wn,e)?wn:Mt;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),wo.call(this,Ar))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==wn&&n!==Mt&&this.error("Number sign is expected")),wo.call(this,t!==0),t===Mt?"-"+this.consume(10):this.consume(10)}var E2="AnPlusB",S2={a:[String,null],b:[String,null]};function Ng(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===10)wo.call(this,v2),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Mt))switch(t="-1",rr.call(this,1,Oa),this.tokenEnd-this.tokenStart){case 2:this.next(),n=Wu.call(this);break;case 3:rr.call(this,2,Mt),this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10);break;default:rr.call(this,2,Mt),Pa.call(this,3,Ar),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(wn)&&this.lookupType(1)===1){let r=0;switch(t="1",this.isDelim(wn)&&(r=1,this.next()),rr.call(this,0,Oa),this.tokenEnd-this.tokenStart){case 1:this.next(),n=Wu.call(this);break;case 2:rr.call(this,1,Mt),this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10);break;default:rr.call(this,1,Mt),Pa.call(this,2,Ar),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){const r=this.charCodeAt(this.tokenStart),o=r===wn||r===Mt;let i=this.tokenStart+o;for(;i<this.tokenEnd&&it(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),rr.call(this,i-this.tokenStart,Oa),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=Wu.call(this)):(rr.call(this,i-this.tokenStart+1,Mt),i+2===this.tokenEnd?(this.next(),this.skipSC(),wo.call(this,Ar),n="-"+this.consume(10)):(Pa.call(this,i-this.tokenStart+2,Ar),this.next(),n=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===wn&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===wn&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function w2(e){if(e.a){const t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-n"||e.a+"n";if(e.b){const n=e.b[0]==="-"||e.b[0]==="+"?e.b:"+"+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}var C2=ie({generate:()=>L2,name:()=>T2,parse:()=>Mg,structure:()=>k2,walkContext:()=>_2});function xg(e){return this.Raw(e,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function A2(){for(let e=1,t;t=this.lookupType(e);e++){if(t===24)return!0;if(t===23||t===3)return!1}return!1}var T2="Atrule",_2="atrule",k2={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function Mg(){const e=this.tokenStart;let t,n,r=null,o=null;switch(this.eat(3),t=this.substrToCursor(e+1),n=t.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?r=this.parseWithFallback(this.AtrulePrelude.bind(this,t),xg):r=xg.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:hasOwnProperty.call(this.atrule,n)&&typeof this.atrule[n].block=="function"?o=this.atrule[n].block.call(this):o=this.Block(A2.call(this))}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:t,prelude:r,block:o}}function L2(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var N2=ie({generate:()=>O2,name:()=>x2,parse:()=>Rg,structure:()=>R2,walkContext:()=>M2}),x2="AtrulePrelude",M2="atrulePrelude",R2={children:[[]]};function Rg(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function O2(e){this.children(e)}var P2=ie({generate:()=>q2,name:()=>$2,parse:()=>Pg,structure:()=>W2}),I2=36,Og=42,Ia=61,D2=94,qu=124,B2=126;function H2(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(Og)?(t=!0,this.next()):this.isDelim(qu)||this.eat(1),this.isDelim(qu)?this.charCodeAt(this.tokenStart+1)!==Ia?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function F2(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==Ia&&t!==B2&&t!==D2&&t!==I2&&t!==Og&&t!==qu&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==Ia&&(this.isDelim(Ia)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var $2="AttributeSelector",W2={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function Pg(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=H2.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=F2.call(this),this.skipSC(),r=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(o=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:o}}function q2(e){this.token(9,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(1,e.flags),this.token(9,"]")}var z2=ie({generate:()=>Y2,name:()=>j2,parse:()=>Bg,structure:()=>X2,walkContext:()=>G2});function Ig(e){return this.Raw(e,null,!0)}function V2(){return this.parseWithFallback(this.Rule,Ig)}function Dg(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function U2(){if(this.tokenType===17)return Dg.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Dg);return this.tokenType===17&&this.next(),e}var j2="Block",G2="block",X2={children:[["Atrule","Rule","Declaration"]]};function Bg(e){const t=e?U2:V2,n=this.tokenStart;let r=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule,Ig));break;default:r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function Y2(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var K2=ie({generate:()=>J2,name:()=>Z2,parse:()=>Hg,structure:()=>Q2}),Z2="Brackets",Q2={children:[[]]};function Hg(e,t){const n=this.tokenStart;let r=null;return this.eat(19),r=e.call(this,t),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:r}}function J2(e){this.token(9,"["),this.children(e),this.token(9,"]")}var eN=ie({generate:()=>nN,name:()=>"CDC",parse:()=>Fg,structure:()=>tN}),wq="CDC",tN=[];function Fg(){const e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function nN(){this.token(15,"-->")}var rN=ie({generate:()=>iN,name:()=>"CDO",parse:()=>$g,structure:()=>oN}),Cq="CDO",oN=[];function $g(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function iN(){this.token(14,"<!--")}var sN=ie({generate:()=>uN,name:()=>lN,parse:()=>Wg,structure:()=>cN}),aN=46,lN="ClassSelector",cN={name:String};function Wg(){return this.eatDelim(aN),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function uN(e){this.token(9,"."),this.token(1,e.name)}var dN=ie({generate:()=>bN,name:()=>hN,parse:()=>zg,structure:()=>gN}),mN=43,qg=47,fN=62,pN=126,hN="Combinator",gN={name:String};function zg(){const e=this.tokenStart;let t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case fN:case mN:case pN:this.next();break;case qg:this.next(),this.eatIdent("deep"),this.eatDelim(qg);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function bN(e){this.tokenize(e.name)}var yN=ie({generate:()=>CN,name:()=>SN,parse:()=>Vg,structure:()=>wN}),vN=42,EN=47,SN="Comment",wN={value:String};function Vg(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===vN&&this.charCodeAt(t-1)===EN&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function CN(e){this.token(25,"/*"+e.value+"*/")}var AN=ie({generate:()=>DN,name:()=>ON,parse:()=>Gg,structure:()=>IN,walkContext:()=>PN}),Ug=33,TN=35,_N=36,kN=38,LN=42,NN=43,jg=47;function xN(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function MN(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function RN(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(Ug)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var ON="Declaration",PN="declaration",IN={important:[Boolean,String],property:String,value:["Value","Raw"]};function Gg(){const e=this.tokenStart,t=this.tokenIndex,n=BN.call(this),r=bu(n),o=r?this.parseCustomProperty:this.parseValue,i=r?MN:xN;let s=!1,a;this.skipSC(),this.eat(16);const l=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback(RN,i):a=i.call(this,this.tokenIndex),r&&a.type==="Value"&&a.children.isEmpty){for(let c=l-this.tokenIndex;c<=0;c++)if(this.lookupType(c)===13){a.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(Ug)&&(s=HN.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(t)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:s,property:n,value:a}}function DN(e){this.token(1,e.property),this.token(16,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,e.important===!0?"important":e.important))}function BN(){const e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case LN:case _N:case NN:case TN:case kN:this.next();break;case jg:this.next(),this.isDelim(jg)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function HN(){this.eat(9),this.skipSC();const e=this.consume(1);return e==="important"?!0:e}var FN=ie({generate:()=>zN,name:()=>WN,parse:()=>Xg,structure:()=>qN});function $N(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}var WN="DeclarationList",qN={children:[["Declaration"]]};function Xg(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;default:e.push(this.parseWithFallback(this.Declaration,$N))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function zN(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var VN=ie({generate:()=>GN,name:()=>UN,parse:()=>Yg,structure:()=>jN}),UN="Dimension",jN={value:String,unit:String};function Yg(){const e=this.tokenStart,t=this.consumeNumber(12);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function GN(e){this.token(12,e.value+e.unit)}var XN=ie({generate:()=>QN,name:()=>YN,parse:()=>Kg,structure:()=>ZN,walkContext:()=>KN}),YN="Function",KN="function",ZN={name:String,children:[[]]};function Kg(e,t){const n=this.tokenStart,r=this.consumeFunctionName(),o=r.toLowerCase();let i;return i=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:r,children:i}}function QN(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var JN=ie({generate:()=>nx,name:()=>ex,parse:()=>Zg,structure:()=>tx,xxx:()=>"XXX"}),Aq="XXX",ex="Hash",tx={value:String};function Zg(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function nx(e){this.token(4,"#"+e.value)}var rx=ie({generate:()=>sx,name:()=>ox,parse:()=>Qg,structure:()=>ix}),ox="Identifier",ix={name:String};function Qg(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function sx(e){this.token(1,e.name)}var ax=ie({generate:()=>ux,name:()=>lx,parse:()=>Jg,structure:()=>cx}),lx="IdSelector",cx={name:String};function Jg(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function ux(e){this.token(9,"#"+e.name)}var dx=ie({generate:()=>px,name:()=>mx,parse:()=>eb,structure:()=>fx}),mx="MediaFeature",fx={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function eb(){const e=this.tokenStart;let t,n=null;if(this.eat(21),this.skipSC(),t=this.consume(1),this.skipSC(),this.tokenType!==22){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:this.lookupNonWSType(1)===9?n=this.Ratio():n=this.Number();break;case 12:n=this.Dimension();break;case 1:n=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eat(22),{type:"MediaFeature",loc:this.getLocation(e,this.tokenStart),name:t,value:n}}function px(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var hx=ie({generate:()=>yx,name:()=>gx,parse:()=>tb,structure:()=>bx}),gx="MediaQuery",bx={children:[["Identifier","MediaFeature","WhiteSpace"]]};function tb(){const e=this.createList();let t=null;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 25:case 13:this.next();continue;case 1:t=this.Identifier();break;case 21:t=this.MediaFeature();break;default:break e}e.push(t)}return t===null&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(e),children:e}}function yx(e){this.children(e)}var vx=ie({generate:()=>wx,name:()=>Ex,parse:()=>nb,structure:()=>Sx}),Ex="MediaQueryList",Sx={children:[["MediaQuery"]]};function nb(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===18);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function wx(e){this.children(e,()=>this.token(18,","))}var Cx=ie({generate:()=>Tx,name:()=>"Nth",parse:()=>rb,structure:()=>Ax}),Tq="Nth",Ax={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function rb(){this.skipSC();const e=this.tokenStart;let t=e,n=null,r;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?r=this.Identifier():r=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),n=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:r,selector:n}}function Tx(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var _x=ie({generate:()=>Nx,name:()=>kx,parse:()=>ob,structure:()=>Lx}),kx="Number",Lx={value:String};function ob(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function Nx(e){this.token(10,e.value)}var xx=ie({generate:()=>Ox,name:()=>Mx,parse:()=>ib,structure:()=>Rx}),Mx="Operator",Rx={value:String};function ib(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Ox(e){this.tokenize(e.value)}var Px=ie({generate:()=>Bx,name:()=>Ix,parse:()=>sb,structure:()=>Dx}),Ix="Parentheses",Dx={children:[[]]};function sb(e,t){const n=this.tokenStart;let r=null;return this.eat(21),r=e.call(this,t),this.eof||this.eat(22),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:r}}function Bx(e){this.token(21,"("),this.children(e),this.token(22,")")}var Hx=ie({generate:()=>Wx,name:()=>Fx,parse:()=>ab,structure:()=>$x}),Fx="Percentage",$x={value:String};function ab(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function Wx(e){this.token(11,e.value+"%")}var qx=ie({generate:()=>jx,name:()=>zx,parse:()=>lb,structure:()=>Ux,walkContext:()=>Vx}),zx="PseudoClassSelector",Vx="function",Ux={name:String,children:[["Raw"],null]};function lb(){const e=this.tokenStart;let t=null,n,r;return this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(this.tokenIndex,null,!1))),this.eat(22)):n=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function jx(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var Gx=ie({generate:()=>Zx,name:()=>Xx,parse:()=>cb,structure:()=>Kx,walkContext:()=>Yx}),Xx="PseudoElementSelector",Yx="function",Kx={name:String,children:[["Raw"],null]};function cb(){const e=this.tokenStart;let t=null,n,r;return this.eat(16),this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(this.tokenIndex,null,!1))),this.eat(22)):n=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Zx(e){this.token(16,":"),this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var Qx=ie({generate:()=>rM,name:()=>tM,parse:()=>db,structure:()=>nM}),Jx=47,eM=46;function ub(){this.skipSC();const e=this.consume(10);for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);!it(n)&&n!==eM&&this.error("Unsigned number is expected",this.tokenStart-e.length+t)}return Number(e)===0&&this.error("Zero number is not allowed",this.tokenStart-e.length),e}var tM="Ratio",nM={left:String,right:String};function db(){const e=this.tokenStart,t=ub.call(this);let n;return this.skipSC(),this.eatDelim(Jx),n=ub.call(this),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function rM(e){this.token(10,e.left),this.token(9,"/"),this.token(10,e.right)}var oM=ie({generate:()=>aM,name:()=>"Raw",parse:()=>mb,structure:()=>sM});function iM(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var _q="Raw",sM={value:String};function mb(e,t,n){const r=this.getTokenStart(e);let o;return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),n&&this.tokenStart>r?o=iM.call(this):o=this.tokenStart,{type:"Raw",loc:this.getLocation(r,o),value:this.substring(r,o)}}function aM(e){this.tokenize(e.value)}var lM=ie({generate:()=>fM,name:()=>uM,parse:()=>pb,structure:()=>mM,walkContext:()=>dM});function fb(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function cM(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var uM="Rule",dM="rule",mM={prelude:["SelectorList","Raw"],block:["Block"]};function pb(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return this.parseRulePrelude?n=this.parseWithFallback(cM,fb):n=fb.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function fM(e){this.node(e.prelude),this.node(e.block)}var pM=ie({generate:()=>bM,name:()=>hM,parse:()=>hb,structure:()=>gM}),hM="Selector",gM={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function hb(){const e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function bM(e){this.children(e)}var yM=ie({generate:()=>wM,name:()=>vM,parse:()=>gb,structure:()=>SM,walkContext:()=>EM}),vM="SelectorList",EM="selector",SM={children:[["Selector","Raw"]]};function gb(){const e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function wM(e){this.children(e,()=>this.token(18,","))}var zu=92,bb=34,yb=39;function vb(e){const t=e.length,n=e.charCodeAt(0),r=n===bb||n===yb?1:0,o=r===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let i="";for(let s=r;s<=o;s++){let a=e.charCodeAt(s);if(a===zu){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),En(zu,a)){const l=s-1,c=fo(e,l);s=c-1,i+=Eh(e.substring(l+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function Vu(e,t){const n=t?"'":'"',r=t?yb:bb;let o="",i=!1;for(let s=0;s<e.length;s++){const a=e.charCodeAt(s);if(a===0){o+="�";continue}if(a<=31||a===127){o+="\\"+a.toString(16),i=!0;continue}a===r||a===zu?(o+="\\"+e.charAt(s),i=!1):(i&&(er(a)||Cr(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var CM=ie({generate:()=>_M,name:()=>AM,parse:()=>Eb,structure:()=>TM}),AM="String",TM={value:String};function Eb(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:vb(this.consume(5))}}function _M(e){this.token(5,Vu(e.value))}var kM=ie({generate:()=>RM,name:()=>NM,parse:()=>wb,structure:()=>MM,walkContext:()=>xM}),LM=33;function Sb(e){return this.Raw(e,null,!1)}var NM="StyleSheet",xM="stylesheet",MM={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function wb(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==LM){this.next();continue}n=this.Comment();break;case 14:n=this.CDO();break;case 15:n=this.CDC();break;case 3:n=this.parseWithFallback(this.Atrule,Sb);break;default:n=this.parseWithFallback(this.Rule,Sb)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function RM(e){this.children(e)}var OM=ie({generate:()=>BM,name:()=>IM,parse:()=>Ab,structure:()=>DM}),PM=42,Cb=124;function Uu(){this.tokenType!==1&&this.isDelim(PM)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var IM="TypeSelector",DM={name:String};function Ab(){const e=this.tokenStart;return this.isDelim(Cb)?(this.next(),Uu.call(this)):(Uu.call(this),this.isDelim(Cb)&&(this.next(),Uu.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function BM(e){this.tokenize(e.name)}var HM=ie({generate:()=>zM,name:()=>WM,parse:()=>kb,structure:()=>qM}),Tb=43,_b=45,ju=63;function Ti(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===_b&&t&&n!==0)return Ti.call(this,e+n+1,!1),-1;er(o)||this.error(t&&n!==0?"Hyphen minus"+(n<6?" or hex digit":"")+" is expected":n<6?"Hex digit is expected":"Unexpected input",r),++n>6&&this.error("Too many hex digits",r)}return this.next(),n}function Da(e){let t=0;for(;this.isDelim(ju);)++t>e&&this.error("Too many question marks"),this.next()}function FM(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===Tb?"Plus sign":"Hyphen minus")+" is expected")}function $M(){let e=0;switch(this.tokenType){case 10:if(e=Ti.call(this,1,!0),this.isDelim(ju)){Da.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){FM.call(this,_b),Ti.call(this,1,!1);break}break;case 12:e=Ti.call(this,1,!0),e>0&&Da.call(this,6-e);break;default:if(this.eatDelim(Tb),this.tokenType===1){e=Ti.call(this,0,!0),e>0&&Da.call(this,6-e);break}if(this.isDelim(ju)){this.next(),Da.call(this,5);break}this.error("Hex digit or question mark is expected")}}var WM="UnicodeRange",qM={value:String};function kb(){const e=this.tokenStart;return this.eatIdent("u"),$M.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function zM(e){this.tokenize(e.value)}var VM=32,Gu=92,UM=34,jM=39,GM=40,Lb=41;function XM(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===Lb?t-2:t-1,o="";for(;n<r&&Cr(e.charCodeAt(n));)n++;for(;n<r&&Cr(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===Gu){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),En(Gu,s)){const a=i-1,l=fo(e,a);i=l-1,o+=Eh(e.substring(a+1,l))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function Nb(e){let t="",n=!1;for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);if(o===0){t+="�";continue}if(o<=31||o===127){t+="\\"+o.toString(16),n=!0;continue}o===VM||o===Gu||o===UM||o===jM||o===GM||o===Lb?(t+="\\"+e.charAt(r),n=!1):(n&&er(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var YM=ie({generate:()=>ZM,name:()=>"Url",parse:()=>xb,structure:()=>KM}),kq="Url",KM={value:String};function xb(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=XM(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),t=vb(this.consume(5)),this.skipSC(),this.eof||this.eat(22);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function ZM(e){this.token(7,Nb(e.value))}var QM=ie({generate:()=>tR,name:()=>JM,parse:()=>Mb,structure:()=>eR}),JM="Value",eR={children:[[]]};function Mb(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function tR(e){this.children(e)}var nR=ie({generate:()=>sR,name:()=>oR,parse:()=>Rb,structure:()=>iR}),rR=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),oR="WhiteSpace",iR={value:String};function Rb(){return this.eat(13),rR}function sR(e){this.token(13,e.value)}var Ob=ie({AnPlusB:()=>y2,Atrule:()=>C2,AtrulePrelude:()=>N2,AttributeSelector:()=>P2,Block:()=>z2,Brackets:()=>K2,CDC:()=>eN,CDO:()=>rN,ClassSelector:()=>sN,Combinator:()=>dN,Comment:()=>yN,Declaration:()=>AN,DeclarationList:()=>FN,Dimension:()=>VN,Function:()=>XN,Hash:()=>JN,IdSelector:()=>ax,Identifier:()=>rx,MediaFeature:()=>dx,MediaQuery:()=>hx,MediaQueryList:()=>vx,Nth:()=>Cx,Number:()=>_x,Operator:()=>xx,Parentheses:()=>Px,Percentage:()=>Hx,PseudoClassSelector:()=>qx,PseudoElementSelector:()=>Gx,Ratio:()=>Qx,Raw:()=>oM,Rule:()=>lM,Selector:()=>pM,SelectorList:()=>yM,String:()=>CM,StyleSheet:()=>kM,TypeSelector:()=>OM,UnicodeRange:()=>HM,Url:()=>YM,Value:()=>QM,WhiteSpace:()=>nR}),aR={generic:!0,...b2,node:Ob},lR=35,cR=42,Pb=43,uR=45,dR=47,mR=117;function Ib(e){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,e.recognizer);case 19:return this.Brackets(this.readSequence,e.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,mR)&&this.cmpChar(this.tokenStart+1,Pb)?this.UnicodeRange():this.Identifier();case 9:{const t=this.charCodeAt(this.tokenStart);if(t===dR||t===cR||t===Pb||t===uR)return this.Operator();t===lR&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var fR={getNode:Ib},pR=35,hR=42,gR=43,bR=47,Db=46,yR=62,vR=124,ER=126;function SR(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function wR(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===Db&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case gR:case yR:case ER:case bR:return this.Combinator();case Db:return this.ClassSelector();case hR:case vR:return this.TypeSelector();case pR:return this.IdSelector()}}}var CR={onWhiteSpace:SR,getNode:wR};function AR(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function TR(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===18){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.tokenIndex,this.consumeUntilExclamationMarkOrSemicolon,!1);if(n.type==="Value"&&n.children.isEmpty){for(let r=t-this.tokenIndex;r<=0;r++)if(this.lookupType(r)===13){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(n)}return e}function Bb(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var _R={getNode:Ib,onWhiteSpace(e,t){Bb(e)&&(e.value=" "+e.value),Bb(t.last)&&(t.last.value+=" ")},expression:AR,var:TR},kR=ie({AtrulePrelude:()=>fR,Selector:()=>CR,Value:()=>_R}),LR={parse:{prelude:null,block(){return this.Block(!0)}}},NR={parse:{prelude(){const e=this.createList();switch(this.skipSC(),this.tokenType){case 5:e.push(this.String());break;case 7:case 2:e.push(this.Url());break;default:this.error("String or url() is expected")}return(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&e.push(this.MediaQueryList()),e},block:null}},xR={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(){return this.Block(!1)}}},MR={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function RR(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function OR(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):Hb.call(this)}function Hb(){const e=this.createList();let t;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 25:case 13:this.next();continue;case 2:t=this.Function(RR,this.scope.AtrulePrelude);break;case 1:t=this.Identifier();break;case 21:t=this.Parentheses(OR,this.scope.AtrulePrelude);break;default:break e}e.push(t)}return e}var PR={parse:{prelude(){const e=Hb.call(this);return this.getFirstListNode(e)===null&&this.error("Condition is expected"),e},block(){return this.Block(!1)}}},IR={"font-face":LR,import:NR,media:xR,page:MR,supports:PR},Tr={parse(){return this.createSingleNodeList(this.SelectorList())}},DR={parse(){return this.createSingleNodeList(this.Selector())}},Fb={parse(){return this.createSingleNodeList(this.Identifier())}},Ba={parse(){return this.createSingleNodeList(this.Nth())}},BR={dir:Fb,has:Tr,lang:Fb,matches:Tr,is:Tr,"-moz-any":Tr,"-webkit-any":Tr,where:Tr,not:Tr,"nth-child":Ba,"nth-last-child":Ba,"nth-last-of-type":Ba,"nth-of-type":Ba,slotted:DR},HR=ie({AnPlusB:()=>Ng,Atrule:()=>Mg,AtrulePrelude:()=>Rg,AttributeSelector:()=>Pg,Block:()=>Bg,Brackets:()=>Hg,CDC:()=>Fg,CDO:()=>$g,ClassSelector:()=>Wg,Combinator:()=>zg,Comment:()=>Vg,Declaration:()=>Gg,DeclarationList:()=>Xg,Dimension:()=>Yg,Function:()=>Kg,Hash:()=>Zg,IdSelector:()=>Jg,Identifier:()=>Qg,MediaFeature:()=>eb,MediaQuery:()=>tb,MediaQueryList:()=>nb,Nth:()=>rb,Number:()=>ob,Operator:()=>ib,Parentheses:()=>sb,Percentage:()=>ab,PseudoClassSelector:()=>lb,PseudoElementSelector:()=>cb,Ratio:()=>db,Raw:()=>mb,Rule:()=>pb,Selector:()=>hb,SelectorList:()=>gb,String:()=>Eb,StyleSheet:()=>wb,TypeSelector:()=>Ab,UnicodeRange:()=>kb,Url:()=>xb,Value:()=>Mb,WhiteSpace:()=>Rb}),FR={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},scope:kR,atrule:IR,pseudo:BR,node:HR},$R={node:Ob},WR=g2({...aR,...FR,...$R});function Xu(e){const t={};for(const n in e){let r=e[n];r&&(Array.isArray(r)||r instanceof Ve?r=r.map(Xu):r.constructor===Object&&(r=Xu(r))),t[n]=r}return t}var{tokenize:Lq,parse:qR,generate:Cn,lexer:$b,createLexer:Nq,walk:At,find:xq,findLast:Mq,findAll:Rq,toPlainObject:Oq,fromPlainObject:Pq,fork:zR}=WR,{hasOwnProperty:VR}=Object.prototype;function Yu(e,t){const n=Object.create(null);if(!Array.isArray(e))return null;for(let r of e)t&&(r=r.toLowerCase()),n[r]=!0;return n}function Wb(e){if(!e)return null;const t=Yu(e.tags,!0),n=Yu(e.ids),r=Yu(e.classes);return t===null&&n===null&&r===null?null:{tags:t,ids:n,classes:r}}function UR(e){let t=!1;if(e.scopes&&Array.isArray(e.scopes)){t=Object.create(null);for(let n=0;n<e.scopes.length;n++){const r=e.scopes[n];if(!r||!Array.isArray(r))throw new Error("Wrong usage format");for(const o of r){if(VR.call(t,o))throw new Error(`Class can't be used for several scopes: ${o}`);t[o]=n+1}}}return{whitelist:Wb(e),blacklist:Wb(e.blacklist),scopes:t}}function _r(e){return!e||!e.children||e.children.isEmpty}function qb(e,t){return e!==null&&e.children===t}function jR(e,t,n){if(e.block&&(this.stylesheet!==null&&(this.stylesheet.firstAtrulesAllowed=!1),_r(e.block))){n.remove(t);return}switch(e.name){case"charset":if(_r(e.prelude)){n.remove(t);return}if(t.prev){n.remove(t);return}break;case"import":if(this.stylesheet===null||!this.stylesheet.firstAtrulesAllowed){n.remove(t);return}n.prevUntil(t.prev,function(r){if(!(r.type==="Atrule"&&(r.name==="import"||r.name==="charset")))return this.root.firstAtrulesAllowed=!1,n.remove(t),!0},this);break;default:{const r=nn(e.name).basename;(r==="keyframes"||r==="media"||r==="supports")&&(_r(e.prelude)||_r(e.block))&&n.remove(t)}}}function GR(e,t,n){n.remove(t)}function XR(e,t,n){if(e.value.children&&e.value.children.isEmpty){n.remove(t);return}go(e.property).custom&&/\S/.test(e.value.value)&&(e.value.value=e.value.value.trim())}function YR(e,t,n){(qb(this.stylesheet,n)||qb(this.block,n))&&n.remove(t)}var{hasOwnProperty:Co}=Object.prototype,KR=new Set(["keyframes"]);function zb(e,t){return e.children.forEach((n,r,o)=>{let i=!1;At(n,function(s){if(this.selector===null||this.selector===e)switch(s.type){case"SelectorList":(this.function===null||this.function.name.toLowerCase()!=="not")&&zb(s,t)&&(i=!0);break;case"ClassSelector":t.whitelist!==null&&t.whitelist.classes!==null&&!Co.call(t.whitelist.classes,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.classes!==null&&Co.call(t.blacklist.classes,s.name)&&(i=!0);break;case"IdSelector":t.whitelist!==null&&t.whitelist.ids!==null&&!Co.call(t.whitelist.ids,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.ids!==null&&Co.call(t.blacklist.ids,s.name)&&(i=!0);break;case"TypeSelector":s.name.charAt(s.name.length-1)!=="*"&&(t.whitelist!==null&&t.whitelist.tags!==null&&!Co.call(t.whitelist.tags,s.name.toLowerCase())&&(i=!0),t.blacklist!==null&&t.blacklist.tags!==null&&Co.call(t.blacklist.tags,s.name.toLowerCase())&&(i=!0))}}),i&&o.remove(r)}),e.children.isEmpty}function ZR(e,t,n,r){if(_r(e.prelude)||_r(e.block)){n.remove(t);return}if(this.atrule&&KR.has(nn(this.atrule.name).basename))return;const{usage:o}=r;if(o&&(o.whitelist!==null||o.blacklist!==null)&&(zb(e.prelude,o),_r(e.prelude))){n.remove(t);return}}function QR(e,t,n){if(t.data.name!=="*")return;const r=t.next&&t.next.data.type;(r==="IdSelector"||r==="ClassSelector"||r==="AttributeSelector"||r==="PseudoClassSelector"||r==="PseudoElementSelector")&&n.remove(t)}function JR(e,t,n){n.remove(t)}var Vb={Atrule:jR,Comment:GR,Declaration:XR,Raw:YR,Rule:ZR,TypeSelector:QR,WhiteSpace:JR};function eO(e,t){At(e,{leave(n,r,o){Vb.hasOwnProperty(n.type)&&Vb[n.type].call(this,n,r,o,t)}})}function tO(e){e.block.children.forEach(t=>{t.prelude.children.forEach(n=>{n.children.forEach((r,o)=>{r.type==="Percentage"&&r.value==="100"?o.data={type:"TypeSelector",loc:r.loc,name:"to"}:r.type==="TypeSelector"&&r.name==="from"&&(o.data={type:"Percentage",loc:r.loc,value:"0"})})})})}function nO(e){nn(e.name).basename==="keyframes"&&tO(e)}var rO=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;function oO(e){return e===""||e==="-"?!1:!rO.test(e)}function iO(e){const t=e.value;!t||t.type!=="String"||oO(t.value)&&(e.value={type:"Identifier",loc:t.loc,name:t.value})}function sO(e){const t=e.children;t.forEachRight(function(n,r){if(n.type==="Identifier"){if(n.name==="bold")r.data={type:"Number",loc:n.loc,value:"700"};else if(n.name==="normal"){const o=r.prev;o&&o.data.type==="Operator"&&o.data.value==="/"&&this.remove(o),this.remove(r)}}}),t.isEmpty&&t.insert(t.createItem({type:"Identifier",name:"normal"}))}function aO(e){const t=e.children.head.data;if(t.type==="Identifier")switch(t.name){case"normal":e.children.head.data={type:"Number",loc:t.loc,value:"400"};break;case"bold":e.children.head.data={type:"Number",loc:t.loc,value:"700"}}}function lO(e){function t(){r.length||r.unshift({type:"Number",loc:null,value:"0"},{type:"Number",loc:null,value:"0"}),n.push.apply(n,r),r=[]}let n=[],r=[];e.children.forEach(o=>{if(o.type==="Operator"&&o.value===","){t(),n.push(o);return}o.type==="Identifier"&&(o.name==="transparent"||o.name==="none"||o.name==="repeat"||o.name==="scroll")||r.push(o)}),t(),e.children=new Ve().fromArray(n)}function Ub(e){e.children.forEach((t,n,r)=>{t.type==="Identifier"&&t.name.toLowerCase()==="none"&&(r.head===r.tail?n.data={type:"Number",loc:t.loc,value:"0"}:r.remove(n))})}var jb={font:sO,"font-weight":aO,background:lO,border:Ub,outline:Ub};function cO(e){if(!this.declaration)return;const t=go(this.declaration.property);jb.hasOwnProperty(t.basename)&&jb[t.basename](e)}var uO=/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,dO=/^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,mO=new Set(["Dimension","Hash","Identifier","Number","Raw","UnicodeRange"]);function Ha(e,t){const n=t&&t.prev!==null&&mO.has(t.prev.data.type)?dO:uO;return e=String(e).replace(n,"$1$2$3"),(e===""||e==="-")&&(e="0"),e}function fO(e){e.value=Ha(e.value)}var pO=new Set(["calc","min","max","clamp"]),hO=new Set(["px","mm","cm","in","pt","pc","em","ex","ch","rem","vh","vw","vmin","vmax","vm"]);function gO(e,t){const n=Ha(e.value);if(e.value=n,n==="0"&&this.declaration!==null&&this.atrulePrelude===null){const r=e.unit.toLowerCase();if(!hO.has(r)||this.declaration.property==="-ms-flex"||this.declaration.property==="flex"||this.function&&pO.has(this.function.name))return;t.data={type:"Number",loc:e.loc,value:n}}}var bO=new Set(["width","min-width","max-width","height","min-height","max-height","flex","-ms-flex"]);function yO(e,t){e.value=Ha(e.value),e.value==="0"&&this.declaration&&!bO.has(this.declaration.property)&&(t.data={type:"Number",loc:e.loc,value:e.value},$b.matchDeclaration(this.declaration).isType(t.data,"length")||(t.data=e))}function vO(e){e.value=e.value.replace(/\\/g,"/")}var Gb={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Xb={8e5:"maroon",800080:"purple",808e3:"olive",808080:"gray","00ffff":"cyan",f0ffff:"azure",f5f5dc:"beige",ffe4c4:"bisque","000000":"black","0000ff":"blue",a52a2a:"brown",ff7f50:"coral",ffd700:"gold","008000":"green","4b0082":"indigo",fffff0:"ivory",f0e68c:"khaki","00ff00":"lime",faf0e6:"linen","000080":"navy",ffa500:"orange",da70d6:"orchid",cd853f:"peru",ffc0cb:"pink",dda0dd:"plum",f00:"red",ff0000:"red",fa8072:"salmon",a0522d:"sienna",c0c0c0:"silver",fffafa:"snow",d2b48c:"tan","008080":"teal",ff6347:"tomato",ee82ee:"violet",f5deb3:"wheat",ffffff:"white",ffff00:"yellow"};function Ku(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Yb(e,t,n,r){let o,i,s;if(t===0)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Ku(l,a,e+1/3),i=Ku(l,a,e),s=Ku(l,a,e-1/3)}return[Math.round(o*255),Math.round(i*255),Math.round(s*255),r]}function Zu(e){return e=e.toString(16),e.length===1?"0"+e:e}function Qu(e,t,n){let r=e.head,o=[],i=!1;for(;r!==null;){const{type:s,value:a}=r.data;switch(s){case"Number":case"Percentage":if(i)return;i=!0,o.push({type:s,value:Number(a)});break;case"Operator":if(a===","){if(!i)return;i=!1}else if(i||a!=="+")return;break;default:return}r=r.next}if(o.length===t){if(o.length===4){if(o[3].type!=="Number")return;o[3].type="Alpha"}if(n){if(o[0].type!==o[1].type||o[0].type!==o[2].type)return}else{if(o[0].type!=="Number"||o[1].type!=="Percentage"||o[2].type!=="Percentage")return;o[0].type="Angle"}return o.map(function(s){let a=Math.max(0,s.value);switch(s.type){case"Number":a=Math.min(a,255);break;case"Percentage":if(a=Math.min(a,100)/100,!n)return a;a=255*a;break;case"Angle":return(a%360+360)%360/360;case"Alpha":return Math.min(a,1)}return Math.round(a)})}}function EO(e,t){let n=e.name,r;if(n==="rgba"||n==="hsla"){if(r=Qu(e.children,4,n==="rgba"),!r)return;if(n==="hsla"&&(r=Yb(...r),e.name="rgba"),r[3]===0){const o=this.function&&this.function.name;if(r[0]===0&&r[1]===0&&r[2]===0||!/^(?:to|from|color-stop)$|gradient$/i.test(o)){t.data={type:"Identifier",loc:e.loc,name:"transparent"};return}}if(r[3]!==1){e.children.forEach((o,i,s)=>{if(o.type==="Operator"){o.value!==","&&s.remove(i);return}i.data={type:"Number",loc:o.loc,value:Ha(r.shift())}});return}n="rgb"}if(n==="hsl"){if(r=r||Qu(e.children,3,!1),!r)return;r=Yb(...r),n="rgb"}if(n==="rgb"){if(r=r||Qu(e.children,3,!0),!r)return;t.data={type:"Hash",loc:e.loc,value:Zu(r[0])+Zu(r[1])+Zu(r[2])},Kb(t.data,t)}}function SO(e,t){if(this.declaration===null)return;let n=e.name.toLowerCase();if(Gb.hasOwnProperty(n)&&$b.matchDeclaration(this.declaration).isType(e,"color")){const r=Gb[n];r.length+1<=n.length?t.data={type:"Hash",loc:e.loc,value:r}:(n==="grey"&&(n="gray"),e.name=n)}}function Kb(e,t){let n=e.value.toLowerCase();n.length===6&&n[0]===n[1]&&n[2]===n[3]&&n[4]===n[5]&&(n=n[0]+n[2]+n[4]),Xb[n]?t.data={type:"Identifier",loc:e.loc,name:Xb[n]}:e.value=n}var Zb={Atrule:nO,AttributeSelector:iO,Value:cO,Dimension:gO,Percentage:yO,Number:fO,Url:vO,Hash:Kb,Identifier:SO,Function:EO};function wO(e){At(e,{leave(t,n,r){Zb.hasOwnProperty(t.type)&&Zb[t.type].call(this,t,n,r)}})}var CO=class{constructor(){this.map=new Map}resolve(e){let t=this.map.get(e);return t===void 0&&(t=this.map.size+1,this.map.set(e,t)),t}};function AO(){const e=new CO;return function(n){const r=Cn(n);return n.id=e.resolve(r),n.length=r.length,n.fingerprint=null,n}}function TO(e){return e.type==="Raw"?qR(e.value,{context:"selectorList"}):e}function _O(e,t){for(let n=0;n<3;n++)if(e[n]!==t[n])return e[n]>t[n]?e:t;return e}function Qb(e){return TO(e).children.reduce((t,n)=>_O(Ju(n),t),[0,0,0])}function Ju(e){let t=0,n=0,r=0;return e.children.forEach(o=>{switch(o.type){case"IdSelector":t++;break;case"ClassSelector":case"AttributeSelector":n++;break;case"PseudoClassSelector":switch(o.name.toLowerCase()){case"not":case"has":case"is":case"matches":case"-webkit-any":case"-moz-any":{const[i,s,a]=Qb(o.children.first);t+=i,n+=s,r+=a;break}case"nth-child":case"nth-last-child":{const i=o.children.first;if(i.type==="Nth"&&i.selector){const[s,a,l]=Qb(i.selector);t+=s,n+=a+1,r+=l}else n++;break}case"where":break;case"before":case"after":case"first-line":case"first-letter":r++;break;default:n++}break;case"TypeSelector":o.name.endsWith("*")||r++;break;case"PseudoElementSelector":r++}}),[t,n,r]}var kO=new Set(["first-letter","first-line","after","before"]),LO=new Set(["link","visited","hover","active","first-letter","first-line","after","before"]);function NO(e,t){const n=new Set;e.prelude.children.forEach(function(r){let o="*",i=0;r.children.forEach(function(s){switch(s.type){case"ClassSelector":if(t&&t.scopes){const a=t.scopes[s.name]||0;if(i!==0&&a!==i)throw new Error("Selector can't has classes from different scopes: "+Cn(r));i=a}break;case"PseudoClassSelector":{const a=s.name.toLowerCase();LO.has(a)||n.add(`:${a}`);break}case"PseudoElementSelector":{const a=s.name.toLowerCase();kO.has(a)||n.add(`::${a}`);break}case"TypeSelector":o=s.name.toLowerCase();break;case"AttributeSelector":s.flags&&n.add(`[${s.flags.toLowerCase()}]`);break;case"Combinator":o="*"}}),r.compareMarker=Ju(r).toString(),r.id=null,r.id=Cn(r),i&&(r.compareMarker+=":"+i),o!=="*"&&(r.compareMarker+=","+o)}),e.pseudoSignature=n.size>0?[...n].sort().join(","):!1}function xO(e,t){const n=AO();return At(e,{visit:"Rule",enter(r){r.block.children.forEach(n),NO(r,t.usage)}}),At(e,{visit:"Atrule",enter(r){r.prelude&&(r.prelude.id=null,r.prelude.id=Cn(r.prelude)),nn(r.name).basename==="keyframes"&&(r.block.avoidRulesMerge=!0,r.block.children.forEach(function(o){o.prelude.children.forEach(function(i){i.compareMarker=i.id})}))}}),{declaration:n}}var{hasOwnProperty:Jb}=Object.prototype;function ey(e,t,n,r){const o=t.data,i=nn(o.name).basename,s=o.name.toLowerCase()+"/"+(o.prelude?o.prelude.id:null);Jb.call(e,i)||(e[i]=Object.create(null)),r&&delete e[i][s],Jb.call(e[i],s)||(e[i][s]=new Ve),e[i][s].append(n.remove(t))}function MO(e,t){const n=Object.create(null);let r=null;e.children.forEach(function(o,i,s){if(o.type==="Atrule"){const a=nn(o.name).basename;switch(a){case"keyframes":ey(n,i,s,!0);return;case"media":if(t.forceMediaMerge){ey(n,i,s,!1);return}}r===null&&a!=="charset"&&a!=="import"&&(r=i)}else r===null&&(r=i)});for(const o in n)for(const i in n[o])e.children.insertList(n[o][i],o==="media"?null:r)}function ty(e){return e.type==="Atrule"&&e.name==="media"}function RO(e,t,n){if(!ty(e))return;const r=t.prev&&t.prev.data;!r||!ty(r)||e.prelude&&r.prelude&&e.prelude.id===r.prelude.id&&(r.block.children.appendList(e.block.children),n.remove(t))}function OO(e,t){MO(e,t),At(e,{visit:"Atrule",reverse:!0,enter:RO})}var{hasOwnProperty:PO}=Object.prototype;function ny(e,t){let n=e.head,r=t.head;for(;n!==null&&r!==null&&n.data.id===r.data.id;)n=n.next,r=r.next;return n===null&&r===null}function ry(e,t){let n=e.head,r=t.head;for(;n!==null&&r!==null&&n.data.id===r.data.id;)n=n.next,r=r.next;return n===null&&r===null}function IO(e,t){const n={eq:[],ne1:[],ne2:[],ne2overrided:[]},r=Object.create(null),o=Object.create(null);for(let i=t.head;i;i=i.next)o[i.data.id]=!0;for(let i=e.head;i;i=i.next){const s=i.data;s.fingerprint&&(r[s.fingerprint]=s.important),o[s.id]?(o[s.id]=!1,n.eq.push(s)):n.ne1.push(s)}for(let i=t.head;i;i=i.next){const s=i.data;o[s.id]&&((!PO.call(r,s.fingerprint)||!r[s.fingerprint]&&s.important)&&n.ne2.push(s),n.ne2overrided.push(s))}return n}function _i(e,t){return t.forEach(n=>{const r=n.id;let o=e.head;for(;o;){const i=o.data.id;if(i===r)return;if(i>r)break;o=o.next}e.insert(e.createItem(n),o)}),e}function oy(e,t){let n=e.head;for(;n!==null;){let r=t.head;for(;r!==null;){if(n.data.compareMarker===r.data.compareMarker)return!0;r=r.next}n=n.next}return!1}function Fa(e){switch(e.type){case"Rule":return oy(e.prelude.children,this);case"Atrule":if(e.block)return e.block.children.some(Fa,this);break;case"Declaration":return!1}return!0}function DO(e,t,n){const r=e.prelude.children,o=e.block.children;n.prevUntil(t.prev,function(i){if(i.type!=="Rule")return Fa.call(r,i);const s=i.prelude.children,a=i.block.children;if(e.pseudoSignature===i.pseudoSignature){if(ny(s,r))return a.appendList(o),n.remove(t),!0;if(ry(o,a))return _i(s,r),n.remove(t),!0}return oy(r,s)})}function BO(e){At(e,{visit:"Rule",enter:DO})}function HO(e,t,n){const r=e.prelude.children;for(;r.head!==r.tail;){const o=new Ve;o.insert(r.remove(r.head)),n.insert(n.createItem({type:"Rule",loc:e.loc,prelude:{type:"SelectorList",loc:e.prelude.loc,children:o},block:{type:"Block",loc:e.block.loc,children:e.block.children.copy()},pseudoSignature:e.pseudoSignature}),t)}}function FO(e){At(e,{visit:"Rule",reverse:!0,enter:HO})}var iy=1,$O=2,Ao=0,ki=1,ed=2,$a=3,sy=["top","right","bottom","left"],WO={"margin-top":"top","margin-right":"right","margin-bottom":"bottom","margin-left":"left","padding-top":"top","padding-right":"right","padding-bottom":"bottom","padding-left":"left","border-top-color":"top","border-right-color":"right","border-bottom-color":"bottom","border-left-color":"left","border-top-width":"top","border-right-width":"right","border-bottom-width":"bottom","border-left-width":"left","border-top-style":"top","border-right-style":"right","border-bottom-style":"bottom","border-left-style":"left"},ay={margin:"margin","margin-top":"margin","margin-right":"margin","margin-bottom":"margin","margin-left":"margin",padding:"padding","padding-top":"padding","padding-right":"padding","padding-bottom":"padding","padding-left":"padding","border-color":"border-color","border-top-color":"border-color","border-right-color":"border-color","border-bottom-color":"border-color","border-left-color":"border-color","border-width":"border-width","border-top-width":"border-width","border-right-width":"border-width","border-bottom-width":"border-width","border-left-width":"border-width","border-style":"border-style","border-top-style":"border-style","border-right-style":"border-style","border-bottom-style":"border-style","border-left-style":"border-style"},qO=class{constructor(e){this.name=e,this.loc=null,this.iehack=void 0,this.sides={top:null,right:null,bottom:null,left:null}}getValueSequence(e,t){const n=[];let r="";return e.value.type!=="Value"||e.value.children.some(function(o){let i=!1;switch(o.type){case"Identifier":switch(o.name){case"\\0":case"\\9":r=o.name;return;case"inherit":case"initial":case"unset":case"revert":i=o.name}break;case"Dimension":switch(o.unit){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":i=o.unit}break;case"Hash":case"Number":case"Percentage":break;case"Function":if(o.name==="var")return!0;i=o.name;break;default:return!0}n.push({node:o,special:i,important:e.important})})||n.length>t||typeof this.iehack=="string"&&this.iehack!==r?!1:(this.iehack=r,n)}canOverride(e,t){const n=this.sides[e];return!n||t.important&&!n.important}add(e,t){function n(){const r=this.sides,o=WO[e];if(o){if(!(o in r))return!1;const i=this.getValueSequence(t,1);if(!i||!i.length)return!1;for(const s in r)if(r[s]!==null&&r[s].special!==i[0].special)return!1;return this.canOverride(o,i[0])&&(r[o]=i[0]),!0}else if(e===this.name){const i=this.getValueSequence(t,4);if(!i||!i.length)return!1;switch(i.length){case 1:i[ki]=i[Ao],i[ed]=i[Ao],i[$a]=i[Ao];break;case 2:i[ed]=i[Ao],i[$a]=i[ki];break;case 3:i[$a]=i[ki]}for(let s=0;s<4;s++)for(const a in r)if(r[a]!==null&&r[a].special!==i[s].special)return!1;for(let s=0;s<4;s++)this.canOverride(sy[s],i[s])&&(r[sy[s]]=i[s]);return!0}}return n.call(this)?(this.loc||(this.loc=t.loc),!0):!1}isOkToMinimize(){const e=this.sides.top,t=this.sides.right,n=this.sides.bottom,r=this.sides.left;if(e&&t&&n&&r){const o=e.important+t.important+n.important+r.important;return o===0||o===4}return!1}getValue(){const e=new Ve,t=this.sides,n=[t.top,t.right,t.bottom,t.left],r=[Cn(t.top.node),Cn(t.right.node),Cn(t.bottom.node),Cn(t.left.node)];r[$a]===r[ki]&&(n.pop(),r[ed]===r[Ao]&&(n.pop(),r[ki]===r[Ao]&&n.pop()));for(let o=0;o<n.length;o++)e.appendData(n[o].node);return this.iehack&&e.appendData({type:"Identifier",loc:null,name:this.iehack}),{type:"Value",loc:null,children:e}}getDeclaration(){return{type:"Declaration",loc:this.loc,important:this.sides.top.important,property:this.name,value:this.getValue()}}};function zO(e,t,n,r){const o=e.block.children,i=e.prelude.children.first.id;return e.block.children.forEachRight(function(s,a){const l=s.property;if(!ay.hasOwnProperty(l))return;const c=ay[l];let u,d;if((!r||i===r)&&c in t&&(d=$O,u=t[c]),(!u||!u.add(l,s))&&(d=iy,u=new qO(c),!u.add(l,s))){r=null;return}t[c]=u,n.push({operation:d,block:o,item:a,shorthand:u}),r=i}),r}function VO(e,t){e.forEach(function(n){const r=n.shorthand;r.isOkToMinimize()&&(n.operation===iy?n.item.data=t(r.getDeclaration()):n.block.remove(n.item))})}function UO(e,t){const n={},r=[];At(e,{visit:"Rule",reverse:!0,enter(o){const i=this.block||this.stylesheet,s=(o.pseudoSignature||"")+"|"+o.prelude.children.first.id;let a,l;n.hasOwnProperty(i.id)?a=n[i.id]:(a={lastShortSelector:null},n[i.id]=a),a.hasOwnProperty(s)?l=a[s]:(l={},a[s]=l),a.lastShortSelector=zO.call(this,o,l,r,a.lastShortSelector)}}),VO(r,t.declaration)}var jO=1,GO=new Set(["src"]),ly={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},cy={cursor:["auto","crosshair","default","move","text","wait","help","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","pointer","progress","not-allowed","no-drop","vertical-text","all-scroll","col-resize","row-resize"],overflow:["hidden","visible","scroll","auto"],position:["static","relative","absolute","fixed"]},uy={"border-width":["border"],"border-style":["border"],"border-color":["border"],"border-top":["border"],"border-right":["border"],"border-bottom":["border"],"border-left":["border"],"border-top-width":["border-top","border-width","border"],"border-right-width":["border-right","border-width","border"],"border-bottom-width":["border-bottom","border-width","border"],"border-left-width":["border-left","border-width","border"],"border-top-style":["border-top","border-style","border"],"border-right-style":["border-right","border-style","border"],"border-bottom-style":["border-bottom","border-style","border"],"border-left-style":["border-left","border-style","border"],"border-top-color":["border-top","border-color","border"],"border-right-color":["border-right","border-color","border"],"border-bottom-color":["border-bottom","border-color","border"],"border-left-color":["border-left","border-color","border"],"margin-top":["margin"],"margin-right":["margin"],"margin-bottom":["margin"],"margin-left":["margin"],"padding-top":["padding"],"padding-right":["padding"],"padding-bottom":["padding"],"padding-left":["padding"],"font-style":["font"],"font-variant":["font"],"font-weight":["font"],"font-size":["font"],"font-family":["font"],"list-style-type":["list-style"],"list-style-position":["list-style"],"list-style-image":["list-style"]};function dy(e,t,n){const r=go(e).basename;if(r==="background")return e+":"+Cn(t.value);const o=t.id;let i=n[o];if(!i){switch(t.value.type){case"Value":const s={};let a="",l="",c=!1;t.value.children.forEach(function u(d){switch(d.type){case"Value":case"Brackets":case"Parentheses":d.children.forEach(u);break;case"Raw":c=!0;break;case"Identifier":{const{name:m}=d;a||(a=nn(m).vendor),/\\[09]/.test(m)&&(l=RegExp.lastMatch),cy.hasOwnProperty(r)?cy[r].indexOf(m)===-1&&(s[m]=!0):ly.hasOwnProperty(r)&&ly[r].test(m)&&(s[m]=!0);break}case"Function":{let{name:m}=d;a||(a=nn(m).vendor),m==="rect"&&(d.children.some(p=>p.type==="Operator"&&p.value===",")||(m="rect-backward")),s[m+"()"]=!0,d.children.forEach(u);break}case"Dimension":{const{unit:m}=d;switch(/\\[09]/.test(m)&&(l=RegExp.lastMatch),m){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":s[m]=!0}break}}}),i=c?"!"+jO++:"!"+Object.keys(s).sort()+"|"+l+a;break;case"Raw":i="!"+t.value.value;break;default:i=Cn(t.value)}n[o]=i}return e+i}function XO(e,t,n){const r=go(t.property);if(uy.hasOwnProperty(r.basename)){const o=uy[r.basename];for(const i of o){const s=dy(r.prefix+i,t,n),a=e.hasOwnProperty(s)?e[s]:null;if(a&&(!t.important||a.item.data.important))return a}}}function YO(e,t,n,r,o){const i=e.block.children;i.forEachRight(function(s,a){const{property:l}=s,c=dy(l,s,o),u=r[c];u&&!GO.has(l)?s.important&&!u.item.data.important?(r[c]={block:i,item:a},u.block.remove(u.item)):i.remove(a):XO(r,s,o)?i.remove(a):(s.fingerprint=c,r[c]={block:i,item:a})}),i.isEmpty&&n.remove(t)}function KO(e){const t={},n=Object.create(null);At(e,{visit:"Rule",reverse:!0,enter(r,o,i){const s=this.block||this.stylesheet,a=(r.pseudoSignature||"")+"|"+r.prelude.children.first.id;let l,c;t.hasOwnProperty(s.id)?l=t[s.id]:(l={},t[s.id]=l),l.hasOwnProperty(a)?c=l[a]:(c={},l[a]=c),YO.call(this,r,o,i,c,n)}})}function ZO(e,t,n){const r=e.prelude.children,o=e.block.children,i=r.first.compareMarker,s={};n.nextUntil(t.next,function(a,l){if(a.type!=="Rule")return Fa.call(r,a);if(e.pseudoSignature!==a.pseudoSignature)return!0;const c=a.prelude.children.head,u=a.block.children,d=c.data.compareMarker;if(d in s)return!0;if(r.head===r.tail&&r.first.id===c.data.id){o.appendList(u),n.remove(l);return}if(ry(o,u)){const m=c.data.id;r.some((p,f)=>{const h=p.id;if(m<h)return r.insert(c,f),!0;if(!f.next)return r.insert(c),!0}),n.remove(l);return}if(d===i)return!0;s[d]=!0})}function QO(e){At(e,{visit:"Rule",enter:ZO})}function td(e){return e.reduce((t,n)=>t+n.id.length+1,0)-1}function nd(e){let t=0;for(const n of e)t+=n.length;return t+e.length-1}function JO(e,t,n){const r=this.block!==null?this.block.avoidRulesMerge:!1,o=e.prelude.children,i=e.block,s=Object.create(null);let a=!0,l=!0;n.prevUntil(t.prev,function(c,u){const d=c.block,m=c.type;if(m!=="Rule"){const h=Fa.call(o,c);return!h&&m==="Atrule"&&d&&At(d,{visit:"Rule",enter(y){y.prelude.children.forEach(E=>{s[E.compareMarker]=!0})}}),h}if(e.pseudoSignature!==c.pseudoSignature)return!0;const p=c.prelude.children;if(l=!p.some(h=>h.compareMarker in s),!l&&!a)return!0;if(a&&ny(p,o))return d.children.appendList(i.children),n.remove(t),!0;const f=IO(i.children,d.children);if(f.eq.length){if(!f.ne1.length&&!f.ne2.length)return l&&(_i(o,p),n.remove(u)),!0;if(!r)if(f.ne1.length&&!f.ne2.length){const h=td(o),y=nd(f.eq);a&&h<y&&(_i(p,o),i.children.fromArray(f.ne1))}else if(!f.ne1.length&&f.ne2.length){const h=td(p),y=nd(f.eq);l&&h<y&&(_i(o,p),d.children.fromArray(f.ne2))}else{const h={type:"SelectorList",loc:null,children:_i(p.copy(),o)},y=td(h.children)+2;if(nd(f.eq)>=y){const E=n.createItem({type:"Rule",loc:null,prelude:h,block:{type:"Block",loc:null,children:new Ve().fromArray(f.eq)},pseudoSignature:e.pseudoSignature});return i.children.fromArray(f.ne1),d.children.fromArray(f.ne2overrided),a?n.insert(E,u):n.insert(E,t),!0}}}a&&(a=!p.some(h=>o.some(y=>y.compareMarker===h.compareMarker))),p.forEach(h=>{s[h.compareMarker]=!0})})}function e5(e){At(e,{visit:"Rule",reverse:!0,enter:JO})}function t5(e,t){const n=xO(e,t);t.logger("prepare",e),OO(e,t),t.logger("mergeAtrule",e),BO(e),t.logger("initialMergeRuleset",e),FO(e),t.logger("disjoinRuleset",e),UO(e,n),t.logger("restructShorthand",e),KO(e),t.logger("restructBlock",e),QO(e),t.logger("mergeRuleset",e),e5(e),t.logger("restructRuleset",e)}function n5(e,t){const n=new Ve;let r=!1,o;return e.nextUntil(e.head,(i,s,a)=>{if(i.type==="Comment"){if(!t||i.value.charAt(0)!=="!"){a.remove(s);return}if(r||o)return!0;a.remove(s),o=i;return}i.type!=="WhiteSpace"&&(r=!0),n.insert(a.remove(s))}),{comment:o,stylesheet:{type:"StyleSheet",loc:null,children:n}}}function r5(e,t,n,r){r.logger(`Compress block #${n}`,null,!0);let o=1;return e.type==="StyleSheet"&&(e.firstAtrulesAllowed=t,e.id=o++),At(e,{visit:"Atrule",enter(i){i.block!==null&&(i.block.id=o++)}}),r.logger("init",e),eO(e,r),r.logger("clean",e),wO(e,r),r.logger("replace",e),r.restructuring&&t5(e,r),e}function o5(e){let t="comments"in e?e.comments:"exclamation";return typeof t=="boolean"?t=t?"exclamation":!1:t!=="exclamation"&&t!=="first-exclamation"&&(t=!1),t}function i5(e){return"restructure"in e?e.restructure:"restructuring"in e?e.restructuring:!0}function s5(e){return new Ve().appendData({type:"Rule",loc:null,prelude:{type:"SelectorList",loc:null,children:new Ve().appendData({type:"Selector",loc:null,children:new Ve().appendData({type:"TypeSelector",loc:null,name:"x"})})},block:e})}function a5(e,t){e=e||{type:"StyleSheet",loc:null,children:new Ve},t=t||{};const n={logger:typeof t.logger=="function"?t.logger:function(){},restructuring:i5(t),forceMediaMerge:!!t.forceMediaMerge,usage:t.usage?UR(t.usage):!1},r=new Ve;let o=o5(t),i=!0,s,a,l=1,c;t.clone&&(e=Xu(e)),e.type==="StyleSheet"?(s=e.children,e.children=r):s=s5(e);do{if(a=n5(s,!!o),r5(a.stylesheet,i,l++,n),c=a.stylesheet.children,a.comment&&(r.isEmpty||r.insert(Ve.createItem({type:"Raw",value:`
40
+ `})),r.insert(Ve.createItem(a.comment)),c.isEmpty||r.insert(Ve.createItem({type:"Raw",value:`
41
+ `}))),i&&!c.isEmpty){const u=c.last;(u.type!=="Atrule"||u.name!=="import"&&u.name!=="charset")&&(i=!1)}o!=="exclamation"&&(o=!1),r.appendList(c)}while(!s.isEmpty);return{ast:e}}var l5=ie({compress:()=>a5,find:()=>p5,findAll:()=>g5,findLast:()=>h5,fromPlainObject:()=>b5,generate:()=>m5,lexer:()=>c5,parse:()=>d5,specificity:()=>Ju,toPlainObject:()=>y5,tokenize:()=>u5,walk:()=>f5});function my(e){const t=Vu(e,!0),n=Vu(e);return t.length<n.length?t:n}var{lexer:c5,tokenize:u5,parse:d5,generate:m5,walk:f5,find:p5,findLast:h5,findAll:g5,fromPlainObject:b5,toPlainObject:y5}=zR({node:{String:{generate(e){this.token(5,my(e.value))}},Url:{generate(e){const t=Nb(e.value),n=my(e.value);this.token(7,t.length<=n.length+5?t:"url("+n+")")}}}}),{parse:v5,generate:rd,compress:E5}=l5;function To(e,t,n,r){return t.debug,r}function S5(e){let t;return function(r,o){let i=r;if(o&&(i=`[${((Date.now()-t)/1e3).toFixed(3)}s] ${i}`),e>1&&o){let s=rd(o);e===2&&s.length>256&&(s=s.substr(0,256)+"..."),i+=`
42
+ ${s}
43
+ `}t=Date.now()}}function w5(e){return e={...e},typeof e.logger!="function"&&e.debug&&(e.logger=S5(e.debug)),e}function fy(e,t,n){Array.isArray(n)||(n=[n]),n.forEach(r=>r(e,t))}function C5(e,t,n){n=n||{};const r=n.filename||"<unknown>";let o;const i=To("parsing",n,Date.now(),v5(t,{context:e,filename:r,positions:!!n.sourceMap}));n.beforeCompress&&To("beforeCompress",n,Date.now(),fy(i,n,n.beforeCompress));const s=To("compress",n,Date.now(),E5(i,w5(n)));return n.afterCompress&&To("afterCompress",n,Date.now(),fy(s,n,n.afterCompress)),n.sourceMap?o=To("generate(sourceMap: true)",n,Date.now(),(()=>{const a=rd(s.ast,{sourceMap:!0});return a.map._file=r,a.map.setSourceContent(r,t),a})()):o=To("generate",n,Date.now(),{css:rd(s.ast),map:null}),o}function kr(e,t){return C5("stylesheet",e,t)}var py={restructure:!0,forceMediaMerge:!0};function hy(e,t=[...e.querySelectorAll("style")],n={forceMediaMerge:!1}){if(!cssbeautify)return!1;let r=!1;if((!e.isConnected||e.ownerDocument===null)&&!(e instanceof Document)){const s=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null);if(e instanceof HTMLHtmlElement)s.replaceChild(e,s.documentElement);else if(e instanceof HTMLBodyElement||e instanceof HTMLHeadElement)s.documentElement.appendChild(e);else{const a=s.createElement("body");s.documentElement.appendChild(a),a.appendChild(e)}}const o=!!e.querySelector('[class*="noresp-em"]'),i=new Map;for(const s of t){if(n.forceMediaMerge&&s.innerHTML){const a=`
44
+ `+cssbeautify(kr(s.innerHTML,py).css,{indent:" ",autosemicolon:!0})+`
45
+ `;s.innerHTML!==a&&(s.textContent=a,r=!0)}if(s.sheet&&gy(e,s.sheet,o,i)){let a=T5(s.sheet);a=kr(a,py).css,a=`
46
+ `+cssbeautify(a,{indent:" ",autosemicolon:!0})+`
47
+ `,s.innerHTML!==a&&(s.textContent=a,r=!0)}}return r}function gy(e,t,n,r,o=new Set){let i=!1,s;try{s=t.cssRules}catch{return!1}for(let a=s.length-1;a>=0;a--){const l=s[a];if(l instanceof CSSStyleRule){let c=l.selectorText;n&&c.includes(".em-")&&(c=`${c}, ${c.replace(/\.em-/g,".noresp-em-")}`),A5(e,c,r)||(t.deleteRule(a),i=!0)}else if(l instanceof CSSGroupingRule)i=gy(e,l,n,r,o)||i,l.cssRules.length||(t.deleteRule(a),i=!0);else if(l instanceof CSSFontFaceRule){const c=l.cssText;o.has(c)?(t.deleteRule(a),i=!0):o.add(c)}}return i}function A5(e,t,n){if(n.has(t))return n.get(t);let r=!1;try{r=!!e.querySelector(t)}catch{r=!0}return n.set(t,r),r}function T5(e){return Array.from(e.cssRules,t=>t.cssText).join(`
48
+ `)}var by=/device-width/i,_5="not all",_o=new Map,od=!1;function k5(e){return"media"in e&&"cssRules"in e}function yy(e,t){for(const n of Array.from(e))k5(n)&&t(n),"cssRules"in n&&yy(n.cssRules,t)}function L5(e){try{return e.cssRules}catch{return}}function N5(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n&&!by.test(n));return t.length?t.join(", "):_5}function id(e){_o.forEach((t,n)=>{n.parentStyleSheet?.ownerNode?.isConnected||_o.delete(n)});for(const t of Array.from(e.styleSheets)){const n=L5(t);n&&yy(n,r=>{const o=r.media.mediaText;_o.has(r)||!by.test(o)||(_o.set(r,o),r.media.mediaText=N5(o))})}}function vy(){_o.forEach((e,t)=>{t.media.mediaText=e}),_o.clear()}function x5(e){if(!od)return e();vy();try{return e()}finally{id(document)}}function M5(e){return e.some(t=>{const n=t.target;return n.nodeName==="STYLE"||n.parentNode?.nodeName==="STYLE"?!0:Array.from(t.addedNodes).some(r=>r.nodeName==="STYLE"||r instanceof Element&&!!r.querySelector("style"))})}function R5(e=window){if(!e.matchMedia("(pointer: coarse)").matches)return()=>{};const t=e.document;od=!0,id(t);const n=new MutationObserver(r=>{M5(r)&&id(t)});return n.observe(t.documentElement,{childList:!0,characterData:!0,subtree:!0}),()=>{n.disconnect(),vy(),od=!1}}function Li(e){return de(e)}var Iq=de("extensions.atomsHandlers"),Dq=Li("HANDLE_ATOM_INSERT"),Bq=de("HeadlessMode"),Hq=de("extensions.sandboxExtensions"),O5="SANDBOX_EXTENSION_SCRIPT_STATUS",Fq=de("MESSAGE_SERVICE"),$q=Li("SETTINGS_PANEL_EVENT"),Wq=Li("MODAL_SHOW_EVENT"),qq=Li("MODAL_CLOSE_EVENT"),zq=Li("MODAL_UPDATE_EVENT");function Vq(e){return e}var Uq="SandboxApp",P5="IframePluginRegistry",I5="__sandbox__";function Ey(){return rc(I5)}function D5(e=Ey()){return e.getOrCreateInstance(P5,()=>new YS)}var sd=new KS(()=>D5()),Wa=class AS{constructor(){L(this,"container",Ey()),L(this,"pluginCollection",new XS(this,sd)),this.pluginCollection.activateSync()}static get instance(){return this._instance||(this._instance=new AS)}static registerPlugin(t,n){sd.add(t,n)}static registerAll(t){for(const n of Object.keys(t)){let r=n;const o=t[r];o&&sd.add(r,o)}}static use(t){return this.instance.pluginCollection.use(t)}static initFeatures(t){this.instance.initFeatures(t)}static onLifecycle(t){return this.instance.onLifecycle(t)}use(t){return typeof t=="function"?this.pluginCollection.useByCtor(t):this.pluginCollection.useByKey(t)}initFeatures(t){this.pluginCollection.initSync(t)}onLifecycle(t){return this.pluginCollection.onLifecycle(t)}dispose(){this.pluginCollection.dispose()}};L(Wa,"_instance",void 0);var Ni="data-extension";function xi(e,t,n,r){Z.send(O5,{key:e,phase:t,status:n,error:r})}function B5(){if(typeof document>"u")return;const e=document.currentScript;if(e instanceof HTMLScriptElement)return e.getAttribute(Ni)||void 0}function Sy(e){return{key:e,hasSyncPlugins:!1,pendingPlugins:new Set,loadedNotified:!1,readyNotified:!1,readyFailed:!1}}function ad(e){!e.loadedNotified||e.readyNotified||e.readyFailed||(!e.hasSyncPlugins||e.pendingPlugins.size===0)&&(e.readyNotified=!0,xi(e.key,"ready","success"))}function H5({type:e,attributes:t,key:n,innerHTML:r}){const o=document.createElement(e);if(t)for(const[i,s]of Object.entries(t))s!=null&&o.setAttribute(i,String(s));return o.setAttribute(Ni,n),r&&(o.innerHTML=r),e==="script"?t.type||o.setAttribute("type","text/javascript"):e==="style"&&(t.type||o.setAttribute("type","text/css")),o}function F5(e,t={}){const n=new Ee,r=new Map,o=new Map,i=new Map,s=new WeakMap,a=c=>{let u=i.get(c);return u||(u=Sy(c),i.set(c,u)),u},l=c=>{if(c.type==="created"){const m=B5();if(!m)return;const p=a(m);p.hasSyncPlugins=!0,p.pendingPlugins.add(c.plugin),s.set(c.plugin,m);return}if(c.type==="create:error")return;const u=s.get(c.plugin);if(!u)return;const d=i.get(u);if(d){if(c.type==="afterInit:success"){d.pendingPlugins.delete(c.plugin),ad(d);return}(c.type==="init:error"||c.type==="afterInit:error")&&(d.pendingPlugins.delete(c.plugin),d.readyFailed=!0,xi(u,"ready","error",`Sandbox plugin "${c.name}" failed during ${c.type==="init:error"?"init":"afterInit"}.`))}};return n.addDisposable(Wa.onLifecycle(l)),n.addDisposable(Z.addListener(Pe.SANDBOX_ADD_EXTENSIONS,c=>{for(const u of c){if(t.surface&&u.surfaces&&!u.surfaces.includes(t.surface))continue;let d=r.get(u.key);d&&d.remove(),u.type==="script"&&i.set(u.key,Sy(u.key));const m=u.parent&&document.querySelector(u.parent)||document.head;if(d=H5(u),u.type==="script"){const p=d;p.src&&(p.onload=()=>{const f=a(u.key);f.loadedNotified=!0,xi(u.key,"load","success"),ad(f)},p.onerror=()=>xi(u.key,"load","error",`Failed to load sandbox script: ${p.src}`))}if(m.appendChild(d),u.type==="script"&&!d.src){const p=a(u.key);p.loadedNotified=!0,xi(u.key,"load","success"),ad(p)}r.set(u.key,d),o.set(u.key,u)}})),n.addDisposable(Z.addListener(Pe.SANDBOX_REMOVE_EXTENSIONS,c=>{for(const u of c){const d=o.get(u),m=document.querySelector(`${d?.type}[${Ni}]`);m&&m.remove(),r.delete(u),o.delete(u)}})),n.addDisposable(e.onChange(()=>{for(const[c,u]of r){const d=o.get(c),m=document.querySelector(`${d?.type}[${Ni}]`);let p=d.parent?[...document.querySelectorAll(d.parent)]:[];p.length||(p=[document.head]),m?m!==u?r.set(c,m):p.some(f=>m.parentNode===f)||p[0]?.appendChild(m):p[0]?.appendChild(u)}})),n}function $5(e){e.querySelectorAll(`[${Ni}]`).forEach(t=>t.remove())}var se="remove-basic-cell",wy="remove-basic-row",oe="em-active-table-cell",An="em-temporary-class",Ue="em-temporary-active-cell-background-color",or="temporary-cell-class",Cy="cursor: pointer; margin: auto; margin-top: 5px",Ay="display: none; position: absolute; top: -3px; left: 0; width: 24px; background: #FFFFFF; border: 1px solid #ccc; box-shadow: 0 2px 5px rgba(0,0,0,0.2); border-radius: 5px; z-index: 1000; list-style: none; padding: 5px 0; margin: 0; text-align: left;",Mi="em_version";function qa(e){if(!e||!e.includes("em_version"))return e;try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.has("em_version")?(n.searchParams.delete(Mi),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash):e}catch{return e}}function W5(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.set(Mi,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash}catch{return`${e}${e.includes("?")?"&":"?"}${Mi}=${Date.now()}`}}var q5=class extends Ee{constructor(...e){super(...e),L(this,"_transforms",[]),L(this,"_byAttribute",new Map)}register(e){this._transforms.push(e);for(const t of e.attributes){const n=t.toLowerCase(),r=this._byAttribute.get(n);r?r.push(e):this._byAttribute.set(n,[e])}return{dispose:()=>this._remove(e)}}_remove(e){const t=this._transforms.indexOf(e);if(t!==-1){this._transforms.splice(t,1);for(const n of e.attributes){const r=n.toLowerCase(),o=this._byAttribute.get(r);if(!o)continue;const i=o.indexOf(e);i!==-1&&o.splice(i,1),o.length||this._byAttribute.delete(r)}}}get isEmpty(){return this._transforms.length===0}handles(e){return this._byAttribute.has(e.toLowerCase())}get attributes(){return[...this._byAttribute.keys()]}render(e,t){return this._run("render",e,t)}serialize(e,t){return this._run("serialize",e,t)}_run(e,t,n){const r=this._byAttribute.get(n.attribute.toLowerCase());if(!r?.length)return t;const o=e==="render"?r:[...r].reverse();let i=t;for(const s of o){if(i===null)break;const a=e==="render"?s.render?.(i,n):s.serialize?.(i,n);a!==void 0&&(i=a)}return i}dispose(){this._transforms.length=0,this._byAttribute.clear(),super.dispose()}};function ld(){return Et.getInstance(qr)}var za=new WeakMap;function z5(e,t,n){const r=za.get(e);r?r.set(t.toLowerCase(),n):za.set(e,new Map([[t.toLowerCase(),n]]))}function V5(e,t){const n=za.get(e);n?.size&&za.set(t,new Map(n))}function Ty(e,t,n){const r=e.tagName.toLowerCase();for(const o of t.attributes){if(!e.hasAttribute(o))continue;const i=e.getAttribute(o)??"",s=t.serialize(i,{element:e,tag:r,attribute:o,stage:n});s===null?e.removeAttribute(o):s!==i&&e.setAttribute(o,s)}}function cd(e,t={}){const n=t.pipeline??ld(),r=t.stage??"build";let o=e;if(t.clone&&(o=e.cloneNode(!0),n&&!n.isEmpty&&_y(e,o)),!n||n.isEmpty)return o;o instanceof Element&&Ty(o,n,r);const i=o.querySelectorAll?.("*");if(i)for(const s of i)Ty(s,n,r);return o}function Va(e,t={}){const n=t.pipeline??ld();return!n||n.isEmpty?e.outerHTML:cd(e,{...t,pipeline:n,clone:!0}).outerHTML}function _y(e,t){V5(e,t);const n=e.childNodes,r=t.childNodes;for(let o=0;o<n.length&&o<r.length;o++)_y(n[o],r[o])}function Tt(e,t,n,r={}){const o=ud(e,t,n,{stage:"settings",...r});o===null?e.removeAttribute(t):e.setAttribute(t,o)}function ud(e,t,n,r={}){const o=r.pipeline??ld();if(!o||!o.handles(t))return n;const i=e?.tagName.toLowerCase()??"",s=o.render(n,{element:e,tag:i,attribute:t,stage:r.stage??"build"});if(s!==n){const a=r.owner??e;a&&z5(a,t,n)}return s}function U5(e){const t=new q5,n=A0((o,i,s)=>t.isEmpty?s:ud(o,i,s,{pipeline:t})),r=T0((o,i,s)=>t.isEmpty?s:t.serialize(s,{element:o,tag:o.tagName.toLowerCase(),attribute:i,stage:"apply"}));return e.inject(qr,t),{pipeline:t,dispose(){r(),n(),t.dispose(),Jt(e,qr)}}}function j5(e){return qa(e)}function ky(e){const t=(n,r)=>{const o=n.getAttribute(r);if(!o)return;const i=j5(o);i!==o&&n.setAttribute(r,i)};e.querySelectorAll("[src]").forEach(n=>t(n,"src")),e.querySelectorAll("[___src]").forEach(n=>t(n,"___src"))}var G5=new Set(["normal","400"]),X5=new Set(["normal"]),Y5=new Set(["baseline","unset","initial",""]),Ly=new Set(["none",""]),K5=["b","strong","em","i","u","s","strike","sup","sub"],Z5="___em-internal";function Ua(e){e.querySelectorAll(".em-block-insert").forEach(n=>{n.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_top-document")}),e.querySelectorAll(".em-block-insert_bottom").forEach(n=>{n.classList.remove("em-block-insert_bottom")}),e.querySelectorAll(".em-block-insert_top").forEach(n=>{n.classList.remove("em-block-insert_top")}),e.querySelectorAll(".em-blockatom-insert").forEach(n=>{n.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_top-document")}),e.querySelectorAll(".em-atom-insert").forEach(n=>{n.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}),["em-block-insert-empty","em-atom-insert-empty","em-block-insert-body","em-atom-insert-body","em-resize-start","sortable-chosen","sortable-ghost","em-vindent-table","em-vindent_low","em-vindent","em-relative","em-display-block","em-sandbox-discuss_set-target","em-sandbox-discuss","em-native-img-uploading","em-native-img-drop-target","em-native-img-drop-loading","em-native-file-drag"].forEach(n=>{e.querySelectorAll(`.${n}`).forEach(r=>r.classList.remove(n))}),e.querySelectorAll(".em-powered-logo").forEach(n=>n.remove());for(const n of e.querySelectorAll("[class='']"))n.removeAttribute("class");const t=e instanceof Document?e.documentElement:e;t&&(ft(t,"[data-mce-caret=before]",!0),ft(t,"span.em-element-resize-img-container"),ft(t,"div.em-element-img-change-group",!0),ft(t,"div.em-element-block-add",!0),ft(t,"meta[http-equiv=Content-Security-Policy]",!0),ft(t,"[class*=mce-]"),ft(t,"script[em=initial]",!0),ft(t,".em-editor-wrapper",!0),ft(t,".em-element-resize-height",!0),ft(t,".em-element-vindent-remove",!0),ft(t,".em-element-vindent",!0),ft(t,".em-element-vindent-value",!0),ft(t,"div.iframe-resizer-inner"))}function Q5(e){e.querySelectorAll("tbody").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll(".em-code").forEach(t=>t.remove()),e.querySelectorAll(':not(editor)[contenteditable="false"]').forEach(t=>t.remove()),e.querySelectorAll('.em-vindent[class*="em-vindent-padding"]').forEach(t=>t.remove()),e.querySelectorAll(".em-code").forEach(t=>t.remove()),e.querySelectorAll("[contenteditable]").forEach(t=>t.removeAttribute("contenteditable")),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")),e.querySelectorAll("[em-state]").forEach(t=>t.removeAttribute("em-state")),e.querySelectorAll("[em-hover]").forEach(t=>t.removeAttribute("em-hover")),e.querySelectorAll("#gtx-anchor").forEach(t=>t.remove()),e.querySelectorAll('[data-mce-bogus="1"]').forEach(t=>t.remove()),e.querySelectorAll("strike").forEach(t=>t.removeAttribute("style")),e.querySelectorAll("u").forEach(t=>t.removeAttribute("style")),e.querySelectorAll('style[data-theme-varibalse="true"]').forEach(t=>t.remove()),e.querySelectorAll('style[data-em-localization="true"]').forEach(t=>t.remove()),e.querySelectorAll(".em-element-img-change-group").forEach(t=>t.remove()),e.querySelectorAll(".em-element-resize-img").forEach(t=>t.remove()),e.querySelectorAll(".em-element-editor").forEach(t=>t.remove()),e.querySelectorAll(".em-element-vindent-bg").forEach(t=>t.remove()),e.querySelectorAll(".em-element-vindent-value").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap-marker").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap-bg").forEach(t=>t.remove()),e.querySelectorAll(".em-gap").forEach(t=>t.remove()),e.querySelectorAll(".em-just-inserted").forEach(t=>t.classList.remove("em-just-inserted")),e.querySelectorAll(".em-native-img-uploading").forEach(t=>t.classList.remove("em-native-img-uploading")),e.querySelectorAll(".em-native-img-drop-target").forEach(t=>t.classList.remove("em-native-img-drop-target")),e.querySelectorAll(".em-native-img-upload-spin-overlay").forEach(t=>t.remove()),e.querySelectorAll(".em-element-list-bullet").forEach(t=>t.classList.remove("em-element-list-bullet")),e.querySelectorAll(".remove-new-editor-element").forEach(t=>t.classList.remove("remove-new-editor-element")),e.querySelectorAll(`.${Ue}`).forEach(t=>t.classList.remove(Ue)),Ua(e),gh(e),ft(e,"editor",!1),xy(e),ky(e),Yp(e)}function Ri(e){return(e??"").trim().toLowerCase()}function J5(e){const t=Ri(e.style.fontWeight);t&&G5.has(t)&&e.style.removeProperty("font-weight");const n=Ri(e.style.fontStyle);n&&X5.has(n)&&e.style.removeProperty("font-style");const r=Ri(e.style.verticalAlign);r&&Y5.has(r)&&e.style.removeProperty("vertical-align");const o=Ri(e.style.textDecorationLine);o&&Ly.has(o)&&e.style.removeProperty("text-decoration-line");const i=Ri(e.style.textDecoration);i&&Ly.has(i)&&e.style.removeProperty("text-decoration");const s=e.getAttribute("style");s!==null&&s.trim()===""&&e.removeAttribute("style")}function e3(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function Ny(e){if(e.attributes.length===0)return!0;for(const t of Array.from(e.attributes))if(t.name!==Z5)return!1;return!0}function xy(e){const t=Array.from(e.querySelectorAll("span"));for(let n=t.length-1;n>=0;n-=1){const r=t[n];J5(r),Ny(r)&&e3(r)}for(const n of K5){const r=Array.from(e.querySelectorAll(n));for(let o=r.length-1;o>=0;o-=1){const i=r[o];i.childNodes.length===0&&Ny(i)&&i.remove()}}}function t3(e){e=e.replaceAll(/\uFEFF/gmu,""),e=e.replaceAll(/<link[^>]*?em="css.*?>/gis,""),e=e.replaceAll(/draggable="false"|draggable="true"/gi,""),e=e.replaceAll(/ style="\s*"/gi,""),e=e.replaceAll(/<tbody.*?>/gi,"").replaceAll(/<\/tbody>/gi,""),e=e.replaceAll(/&amp;nbsp;/gi,"&nbsp;").replaceAll(/&amp;zwnj;/gi,"&zwnj;"),e=e.replaceAll(/style="transform: translateZ\(0px\);"/gi,""),e=e.replaceAll(/ +>/gi,">"),e=e.replaceAll(/&amp;/gi,"&"),e=e.replaceAll(/&quot;/gi,""),e=e.replaceAll(/^\s*$(?:\r\n?|\n)/gm,""),e=e.replaceAll(/ em-floatblock-width=".*?"/gi,""),e=e.replaceAll(/<script.*?editor.*?script>/gi,""),e=e.replaceAll(/<script[^>]*\bdata-amd-module-id\s*=[^>]*>[\s\S]*?<\/script>/gi,""),e=e.replaceAll(/<script[^>]*\/iframe\/js\/[^>]*>[\s\S]*?<\/script>/gi,""),e=e.replaceAll(/<style[^>]*?ad-right-container.*?style>/gi,""),e=e.replaceAll(/<div[^>]*?class="jfk-bubble.*?jfk-bubble-arrowimplafter".*?><\/div><\/div><\/div>/gis,""),e=e.replaceAll(/<span[^>]*?style="text-decoration: underline;"[^>]*?>(<a[^>]*?href.*?a>)<\/span>/gis,"$1"),e=e.replaceAll(/ rel="noopener"/gi,""),e=e.replaceAll(/ em-insert-ignore/gi,""),e=e.replaceAll(/ class="\s*"/gi,""),e=e.replaceAll(/<!--<em-root-text>(.*?)-->/gis,"$1"),e=e.replaceAll(/class="em-block.*?"/gi,""),e=e.replaceAll(/data-percent="[^"]*"/g,""),e=e.replaceAll(/em-optimise="[^"]*"/g,""),e=e.replaceAll(/em-optimise-error="[^"]*"/g,""),e=oh.clear(e);const t=e.match(/((rgb)\(\d{1,3}(,\s?\d{1,3}){2}\))/gi);return t&&t.forEach(n=>{const r=X(n);r&&(e=e.replaceAll(n,r))}),e=e.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),e}function My(e){switch(e.toLowerCase()){case"tr":return document.createElement("table");case"td":return document.createElement("tr");case"head":case"body":return document.createElement("html");default:return document.createElement("div")}}function n3(e,t){if(t.some(l=>l.nodeName==="HTML")){for(const l of t)e.appendChild(l);return}const n=t.find(l=>l.nodeType===Node.DOCUMENT_TYPE_NODE),r=t.find(l=>l.nodeName==="HEAD"),o=t.find(l=>l.nodeName==="BODY");n&&e.appendChild(n);const i=e.createElement("html"),s=r??e.createElement("head"),a=o??e.createElement("body");i.append(s,a);for(const l of t)l===n||l===r||l===o||l.nodeName==="HTML"||l.nodeName==="HEAD"||l.nodeName==="BODY"||a.appendChild(l);e.appendChild(i)}function Ry(){const e=Array.from(document.querySelectorAll('style[em="styles"]'));return x5(()=>hy(document,e,{forceMediaMerge:!0}))}function r3(e){let t=!1;return e.beforeCommit(()=>{try{t||(t=!0,Ry())}finally{t=!1}})}function ko(e){let t=e.html??"";const n=e.node,r=e.isBlock??!1,o=e.isPartial??!1;if(r||o){let i,s="div";if(n){if(s=n.tagName??"div",s==="DOCTYPE"||s==="html")return ko({node:n});i=My(s),i.appendChild(n.cloneNode(!0))}else{const a=t.trim(),l=a.match(/<\!?([a-zA-Z]{1,})[^>]*>/i);if(s=l?l[1]:"div",s==="DOCTYPE"||s==="html")return ko({html:t});i=My(s);const c=Te(a);i.replaceChildren(...c)}cd(i,{stage:"apply"}),Q5(i),t=Ct(i),s.toLowerCase()==="head"&&(t=t.replace("<body></body>","")),s.toLowerCase()==="body"&&(t=t.replace("<head></head>",""))}else{const i=document.implementation.createHTMLDocument();for(const s of[...i.childNodes])s.remove();t?n3(i,Te(t)):n&&i.appendChild(n.cloneNode(!0)),i.documentElement&&(i.querySelectorAll("tbody").forEach(s=>s.replaceWith(...Array.from(s.childNodes))),i.querySelectorAll(".em-code").forEach(s=>s.remove()),i.querySelectorAll(':not(editor)[contenteditable="false"]').forEach(s=>s.remove()),i.querySelectorAll(".em-code").forEach(s=>s.remove()),i.querySelectorAll("[contenteditable]").forEach(s=>s.removeAttribute("contenteditable")),i.querySelectorAll("[em-edit]").forEach(s=>s.removeAttribute("em-edit")),i.querySelectorAll("[em-state]").forEach(s=>s.removeAttribute("em-state")),i.querySelectorAll("[em-hover]").forEach(s=>s.removeAttribute("em-hover")),i.querySelectorAll(".em-just-inserted").forEach(s=>s.classList.remove("em-just-inserted")),i.querySelectorAll(".em-native-img-uploading").forEach(s=>s.classList.remove("em-native-img-uploading")),i.querySelectorAll(".em-native-img-drop-target").forEach(s=>s.classList.remove("em-native-img-drop-target")),i.querySelectorAll(".em-native-img-upload-spin-overlay").forEach(s=>s.remove()),i.body?.classList.remove("em-native-img-drop-loading"),i.body?.classList.remove("em-native-file-drag"),i.querySelectorAll("#gtx-anchor").forEach(s=>s.remove()),i.documentElement.removeAttribute("style"),i.querySelectorAll('style[data-theme-varibalse="true"]').forEach(s=>s.remove()),i.querySelectorAll('style[data-em-localization="true"]').forEach(s=>s.remove()),$5(i),Ua(i),gh(i),i.documentElement&&ft(i.documentElement,"editor",!1),i.querySelectorAll("ya-tr-span").forEach(s=>{s.parentNode&&(Array.from(s.childNodes).forEach(a=>s.parentNode.insertBefore(a,s)),s.remove())}),xy(i)),cd(i,{stage:"apply"}),ky(i),Yp(i),t=Vt(i)}return dT(t3(t)).html}var Oy="__emOwnEditor";function o3(e){e[Oy]=!0}function Py(e){const t=[e.closest("editor"),...Array.from(e.querySelectorAll("editor"))],n=e.ownerDocument.activeElement;let r=!1;for(const o of t)o&&!o[Oy]&&!o.contains(n)&&(o.replaceWith(...Array.from(o.childNodes)),r=!0);return r}var i3={deleteContentBackward:"backward",deleteContentForward:"forward"};function s3(e){const{element:t,getVisibleText:n,mapFn:r,getTagNameForContainer:o,applyAttributesToTag:i,setCursorToElement:s,removeLastWord:a,hasOnlyTextNodesDeep:l,isRangeCoveringAllVisibleText:c,isEditorContentOnlyNbsp:u,commit:d}=e;return function(p){const f=p.target,h=window.getSelection();if(!h||h.rangeCount===0)return;const y=i3[p.inputType];if(y&&Z_(h.getRangeAt(0),y)){p.preventDefault();return}const E=n(f,r).trim(),C=n(h.getRangeAt(0)?.cloneContents(),r).trim(),k=h.getRangeAt(0),w=k.startContainer,b=w.nodeType===Node.TEXT_NODE?w.parentNode:w,v=b.closest("sup, sub")||b,A=v.outerHTML,g=v?.tagName?.toLowerCase();if(p.inputType==="deleteContentBackward"&&!h?.isCollapsed&&C){if((g==="sup"||g==="sub")&&A&&(v?.insertAdjacentHTML("beforebegin","&nbsp;"),v?.removeAttribute("em-edit"),v.remove()),c(k)){p.preventDefault();const S=o(f),T=f.firstElementChild||f,_=document.createElement(S);_.innerHTML=" ",i(_,f,T),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=_.innerHTML:f.innerHTML=_.outerHTML;const M=f.firstChild||f;s(M.firstChild||M),t.setAttribute("em-edit","active"),d(!0);return}t.setAttribute("em-edit","active"),d(!0)}if(p.inputType==="deleteContentBackward"&&h?.isCollapsed&&!C){w.length===1&&((g==="sup"||g==="sub")&&A&&(v?.insertAdjacentHTML("beforebegin","&nbsp;"),v?.removeAttribute("em-edit"),v.remove()),t.setAttribute("em-edit","active"),d(!0));const S=()=>{Iy(p)&&d(!0)};if(w.nodeType!==Node.TEXT_NODE&&!c(k))return S();const T=k.startOffset;if(T===0&&!c(k))return S();const _=w.parentNode;if(!_)return S();const M=Array.prototype.indexOf.call(_.childNodes,w);if(_.childNodes[M-1]?.nodeType===Node.COMMENT_NODE){p.preventDefault(),w.deleteData(T-1,1);const N=document.createRange();N.setStart(w,T-1),N.collapse(!0),h.removeAllRanges(),h.addRange(N),d(!0);return}f&&u(f)&&(p.preventDefault(),p.stopImmediatePropagation())}if(p.inputType==="insertText"&&!h?.isCollapsed){p.preventDefault();let S=p.data||"";const T=h.anchorNode;c(k)&&(T.tagName==="A"||T?.parentNode&&T.parentNode.tagName==="A")&&(S=" "+p.data),k.deleteContents();const _=document.createTextNode(S||" ");k.insertNode(_),k.setStartAfter(_),k.collapse(!0),h.removeAllRanges(),h.addRange(k),d(!0);return}if(p.inputType.includes("deleteSoftLine")||p.inputType.includes("deleteHardLine")||p.inputType.includes("deleteWord")){if(p.preventDefault(),!h||h.rangeCount===0)return;const S=h.getRangeAt(0),T=document.createRange();T.setStart(f,0),T.setEnd(S.startContainer,S.startOffset);const _=T.toString(),M=document.createRange();M.setStart(S.endContainer,S.endOffset),f.lastChild?M.setEndAfter(f.lastChild):M.setEnd(f,f.childNodes.length);const N=M.toString();if(!_)return;let W="";if(p.inputType.includes("deleteWord")){const we=_.trimEnd().split(/\s+/);we.pop(),W=we.length>0?we.join(" ")+" ":""}const P=(W+N).trim(),R=o(f),Y=f.firstElementChild||f,V=document.createElement(R);V.innerHTML=P||" ",i(V,f,Y),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=V.innerHTML:f.innerHTML=V.outerHTML;const G=f.firstChild?.firstChild||f.firstChild||f,Le=(G.textContent||"").length,ae=Math.min(W.length,Le),ne=document.createRange();G.nodeType===Node.TEXT_NODE?ne.setStart(G,ae):G.firstChild&&G.firstChild.nodeType===Node.TEXT_NODE?ne.setStart(G.firstChild,Math.min(ae,(G.firstChild.textContent||"").length)):ne.setStart(G,0),ne.collapse(!0),h.removeAllRanges(),h.addRange(ne),d();return}if(p.inputType.includes("deleteContent")&&(E.length<2||E===C)&&l(f)){p.preventDefault();const S=o(f),T=f.firstElementChild||f,_=document.createElement(S);_.innerHTML=" ",i(_,f,T),f.tagName==="A"||f.parentNode&&f.parentNode.tagName==="A"?f.innerHTML=_.innerHTML:f.innerHTML=_.outerHTML;const M=f.firstChild||f;s(M.firstChild||M),d(!0);return}if(p.inputType==="insertText"&&p.data){const S=h.anchorNode;if(S?.tagName==="A"&&!S.textContent?.trim().length){p.preventDefault(),p.stopImmediatePropagation(),S.insertAdjacentText("beforeend",p.data);const T=document.createRange();T.selectNodeContents(S),T.collapse(!1),h.removeAllRanges(),h.addRange(T),d(!0);return}if(S?.parentNode&&S.parentNode.tagName==="A"||S?.tagName==="A"){p.preventDefault(),p.stopImmediatePropagation();const T=h.getRangeAt(0),_=document.createTextNode(p.data||"");T.insertNode(_),T.setStartAfter(_),T.collapse(!0),h.removeAllRanges(),h.addRange(T),d(!0);return}}if(p.inputType==="deleteContentBackward"&&!h.isCollapsed&&!C&&f&&u(f)&&(p.preventDefault(),p.stopImmediatePropagation()),Iy(p)){d(!0);return}d()}}var a3={deleteContentBackward:"delete",deleteContentForward:"forwardDelete"},dd=!1;function Iy(e){const t=a3[e.inputType];if(!t||e.defaultPrevented||dd)return!1;e.preventDefault(),dd=!0;try{document.execCommand(t)}finally{dd=!1}return!0}function l3(e){return function(n,r){if(!n||(n.querySelectorAll("editor")?.forEach(s=>{s.onclick=null,s.onkeyup=null,s.onmousedown=null}),Ua(n),document.querySelectorAll(":not(.em-element-path) .em-element-path").forEach(s=>s.remove()),Py(n),G_(n,r)))return;mh(n,Te);const o=document.createElement("editor");if(o3(o),o.classList.add("em-text"),o.setAttribute("contenteditable","true"),r)n.before(o),o.replaceChildren(n);else{const s=[...n.childNodes];n.appendChild(o),o.replaceChildren(...s)}const i=o.parentElement;if(i&&!i.style.fontFamily&&!i.style.fontSize&&o.firstElementChild){const s=o.firstElementChild,a=s.getAttribute("style"),l=s.getAttribute("class"),c=s.getAttribute("href"),u=s.getAttribute("target"),d=s.getAttribute("align");a&&o.setAttribute("innerStyle",a),l&&o.setAttribute("innerClass",l),c!==null&&o.setAttribute("innerHref",c),u&&o.setAttribute("innerTarget",u),d&&o.setAttribute("innerAlign",d)}o.addEventListener("input",()=>e.commit(!0),!0),o.addEventListener("beforeinput",s3({element:n,getVisibleText:dh,mapFn:W_,getTagNameForContainer:q_,applyAttributesToTag:(s,a,l)=>z_(s,a,l,X),setCursorToElement:V_,removeLastWord:j_,hasOnlyTextNodesDeep:ch,isRangeCoveringAllVisibleText:M_,isEditorContentOnlyNbsp:x_,commit:e.commit}))}}function c3({commit:e,htmlDocument:t,documentMapping:n}){const r=l3({commit:e});return{now:r,deferred:(i,s)=>{const a=t.getRangeByElement(i,!0);a&&n.hasMappedReplacementRangeInRange(a)||N_(()=>r(i,s),"editor")}}}var Dy=e=>t=>t.some(n=>e(n).some(u3)),u3=e=>e instanceof Element&&(e.hasAttribute("em-edit")||e.querySelector("[em-edit]")),d3=Dy(({removed:e})=>e),m3=Dy(({added:e})=>e),f3=e=>t=>{d3(t)&&!m3(t)&&setTimeout(()=>{if(typeof document<"u"&&document.querySelector("[em-edit]"))return;const n=typeof document<"u"?document.querySelector('table[em-type="social"]'):null;if(n?.isConnected){Jn("em-edit"),n.setAttribute("em-edit","active"),e({elem:n});return}e({elem:null})},0)},je={drag:"em-icon-drag",moveUp:"em-icon-move-up",moveDown:"em-icon-move-down",merge:"em-icon-merge",unmerge:"em-icon-unmerge",add:"em-icon-add"},_e="em-icon";function p3(e,t,n){return(t=y3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wn(){return Wn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wn.apply(null,arguments)}function By(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?By(Object(n),!0).forEach(function(r){p3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):By(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function h3(e,t){if(e==null)return{};var n,r,o=g3(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function g3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function b3(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function y3(e){var t=b3(e,"string");return typeof t=="symbol"?t:t+""}function md(e){"@babel/helpers - typeof";return md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},md(e)}var v3="1.15.7";function qn(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var zn=qn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Oi=qn(/Edge/i),Hy=qn(/firefox/i),Pi=qn(/safari/i)&&!qn(/chrome/i)&&!qn(/android/i),fd=qn(/iP(ad|od|hone)/i),Fy=qn(/chrome/i)&&qn(/android/i),$y={capture:!1,passive:!1};function he(e,t,n){e.addEventListener(t,n,!zn&&$y)}function pe(e,t,n){e.removeEventListener(t,n,!zn&&$y)}function ja(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Wy(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function sn(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&ja(e,t):ja(e,t))||r&&e===n)return e;if(e===n)break}while(e=Wy(e))}return null}var qy=/\s+/g;function Rt(e,t,n){e&&t&&(e.classList?e.classList[n?"add":"remove"](t):e.className=((" "+e.className+" ").replace(qy," ").replace(" "+t+" "," ")+(n?" "+t:"")).replace(qy," "))}function re(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),r[t]=n+(typeof n=="string"?"":"px")}}function Lo(e,t){var n="";if(typeof e=="string")n=e;else do{var r=re(e,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function zy(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,i=r.length;if(n)for(;o<i;o++)n(r[o],o);return r}return[]}function _n(){var e=document.scrollingElement;return e||document.documentElement}function Qe(e,t,n,r,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,s,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==_n()?(i=e.getBoundingClientRect(),s=i.top,a=i.left,l=i.bottom,c=i.right,u=i.height,d=i.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!zn))do if(o&&o.getBoundingClientRect&&(re(o,"transform")!=="none"||n&&re(o,"position")!=="static")){var m=o.getBoundingClientRect();s-=m.top+parseInt(re(o,"border-top-width")),a-=m.left+parseInt(re(o,"border-left-width")),l=s+i.height,c=a+i.width;break}while(o=o.parentNode);if(r&&e!==window){var p=Lo(o||e),f=p&&p.a,h=p&&p.d;p&&(s/=h,a/=f,d/=f,u/=h,l=s+u,c=a+d)}return{top:s,left:a,bottom:l,right:c,width:d,height:u}}}function Vy(e,t,n){for(var r=ir(e,!0),o=Qe(e)[t];r;){var i=Qe(r)[n],s=void 0;if(n==="top"||n==="left"?s=o>=i:s=o<=i,!s)return r;if(r===_n())break;r=ir(r,!1)}return!1}function No(e,t,n,r){for(var o=0,i=0,s=e.children;i<s.length;){if(s[i].style.display!=="none"&&s[i]!==ee.ghost&&(r||s[i]!==ee.dragged)&&sn(s[i],n.draggable,e,!1)){if(o===t)return s[i];o++}i++}return null}function pd(e,t){for(var n=e.lastElementChild;n&&(n===ee.ghost||re(n,"display")==="none"||t&&!ja(n,t));)n=n.previousElementSibling;return n||null}function Xt(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==ee.clone&&(!t||ja(e,t))&&n++;return n}function Uy(e){var t=0,n=0,r=_n();if(e)do{var o=Lo(e),i=o.a,s=o.d;t+=e.scrollLeft*i,n+=e.scrollTop*s}while(e!==r&&(e=e.parentNode));return[t,n]}function E3(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function ir(e,t){if(!e||!e.getBoundingClientRect)return _n();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=re(n);if(n.clientWidth<n.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return _n();if(r||t)return n;r=!0}}while(n=n.parentNode);return _n()}function S3(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function hd(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Ii;function jy(e,t){return function(){if(!Ii){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),Ii=setTimeout(function(){Ii=void 0},t)}}}function w3(){clearTimeout(Ii),Ii=void 0}function Gy(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Xy(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function Yy(e,t,n){var r={};return Array.from(e.children).forEach(function(o){var i,s,a,l;if(!(!sn(o,t.draggable,e,!1)||o.animated||o===n)){var c=Qe(o);r.left=Math.min((i=r.left)!==null&&i!==void 0?i:1/0,c.left),r.top=Math.min((s=r.top)!==null&&s!==void 0?s:1/0,c.top),r.right=Math.max((a=r.right)!==null&&a!==void 0?a:-1/0,c.right),r.bottom=Math.max((l=r.bottom)!==null&&l!==void 0?l:-1/0,c.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var _t="Sortable"+new Date().getTime();function C3(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(r){if(!(re(r,"display")==="none"||r===ee.ghost)){e.push({target:r,rect:Qe(r)});var o=Tn({},e[e.length-1].rect);if(r.thisAnimationDuration){var i=Lo(r,!0);i&&(o.top-=i.f,o.left-=i.e)}r.fromRect=o}})},addAnimationState:function(r){e.push(r)},removeAnimationState:function(r){e.splice(E3(e,{target:r}),1)},animateAll:function(r){var o=this;if(!this.options.animation){clearTimeout(t),typeof r=="function"&&r();return}var i=!1,s=0;e.forEach(function(a){var l=0,c=a.target,u=c.fromRect,d=Qe(c),m=c.prevFromRect,p=c.prevToRect,f=a.rect,h=Lo(c,!0);h&&(d.top-=h.f,d.left-=h.e),c.toRect=d,c.thisAnimationDuration&&hd(m,d)&&!hd(u,d)&&(f.top-d.top)/(f.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=T3(f,m,p,o.options)),hd(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=o.options.animation),o.animate(c,f,d,l)),l&&(i=!0,s=Math.max(s,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),i?t=setTimeout(function(){typeof r=="function"&&r()},s):typeof r=="function"&&r(),e=[]},animate:function(r,o,i,s){if(s){re(r,"transition",""),re(r,"transform","");var a=Lo(this.el),l=a&&a.a,c=a&&a.d,u=(o.left-i.left)/(l||1),d=(o.top-i.top)/(c||1);r.animatingX=!!u,r.animatingY=!!d,re(r,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=A3(r),re(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),re(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){re(r,"transition",""),re(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function A3(e){return e.offsetWidth}function T3(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}var xo=[],gd={initializeByDefault:!0},Di={mount:function(t){for(var n in gd)gd.hasOwnProperty(n)&&!(n in t)&&(t[n]=gd[n]);xo.forEach(function(r){if(r.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),xo.push(t)},pluginEvent:function(t,n,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var i=t+"Global";xo.forEach(function(s){n[s.pluginName]&&(n[s.pluginName][i]&&n[s.pluginName][i](Tn({sortable:n},r)),n.options[s.pluginName]&&n[s.pluginName][t]&&n[s.pluginName][t](Tn({sortable:n},r)))})},initializePlugins:function(t,n,r,o){xo.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,n,t.options);c.sortable=t,c.options=t.options,t[l]=c,Wn(r,c.defaults)}});for(var i in t.options)if(t.options.hasOwnProperty(i)){var s=this.modifyOption(t,i,t.options[i]);typeof s<"u"&&(t.options[i]=s)}},getEventProperties:function(t,n){var r={};return xo.forEach(function(o){typeof o.eventProperties=="function"&&Wn(r,o.eventProperties.call(n[o.pluginName],t))}),r},modifyOption:function(t,n,r){var o;return xo.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],r))}),o}};function _3(e){var t=e.sortable,n=e.rootEl,r=e.name,o=e.targetEl,i=e.cloneEl,s=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,m=e.originalEvent,p=e.putSortable,f=e.extraEventProperties;if(t=t||n&&n[_t],!!t){var h,y=t.options,E="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!zn&&!Oi?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent("Event"),h.initEvent(r,!0,!0)),h.to=s||n,h.from=a||n,h.item=o||n,h.clone=i,h.oldIndex=l,h.newIndex=c,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=m,h.pullMode=p?p.lastPutMode:void 0;var C=Tn(Tn({},f),Di.getEventProperties(r,t));for(var k in C)h[k]=C[k];n&&n.dispatchEvent(h),y[E]&&y[E].call(t,h)}}var k3=["evt"],kt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,i=h3(r,k3);Di.pluginEvent.bind(ee)(t,n,Tn({dragEl:B,parentEl:Ge,ghostEl:le,rootEl:De,nextEl:Lr,lastDownEl:Ga,cloneEl:Fe,cloneHidden:sr,dragStarted:Hi,putSortable:ct,activeSortable:ee.active,originalEvent:o,oldIndex:Mo,oldDraggableIndex:Bi,newIndex:Ot,newDraggableIndex:ar,hideGhostForTarget:nv,unhideGhostForTarget:rv,cloneNowHidden:function(){sr=!0},cloneNowShown:function(){sr=!1},dispatchSortableEvent:function(a){pt({sortable:n,name:a,originalEvent:o})}},i))};function pt(e){_3(Tn({putSortable:ct,cloneEl:Fe,targetEl:B,rootEl:De,oldIndex:Mo,oldDraggableIndex:Bi,newIndex:Ot,newDraggableIndex:ar},e))}var B,Ge,le,De,Lr,Ga,Fe,sr,Mo,Ot,Bi,ar,Xa,ct,Ro=!1,Ya=!1,Ka=[],Nr,an,bd,yd,Ky,Zy,Hi,Oo,Fi,$i=!1,Za=!1,Qa,dt,vd=[],Ed=!1,Ja=[],el=typeof document<"u",tl=fd,Qy=Oi||zn?"cssFloat":"float",L3=el&&!Fy&&!fd&&"draggable"in document.createElement("div"),Jy=(function(){if(el){if(zn)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),ev=function(t,n){var r=re(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),i=No(t,0,n),s=No(t,1,n),a=i&&re(i),l=s&&re(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Qe(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Qe(s).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return i&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=o&&r[Qy]==="none"||s&&r[Qy]==="none"&&c+u>o)?"vertical":"horizontal"},N3=function(t,n,r){var o=r?t.left:t.top,i=r?t.right:t.bottom,s=r?t.width:t.height,a=r?n.left:n.top,l=r?n.right:n.bottom,c=r?n.width:n.height;return o===a||i===l||o+s/2===a+c/2},x3=function(t,n){var r;return Ka.some(function(o){var i=o[_t].options.emptyInsertThreshold;if(!(!i||pd(o))){var s=Qe(o),a=t>=s.left-i&&t<=s.right+i,l=n>=s.top-i&&n<=s.bottom+i;if(a&&l)return r=o}}),r},tv=function(t){function n(i,s){return function(a,l,c,u){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(i==null&&(s||d))return!0;if(i==null||i===!1)return!1;if(s&&i==="clone")return i;if(typeof i=="function")return n(i(a,l,c,u),s)(a,l,c,u);var m=(s?a:l).options.group.name;return i===!0||typeof i=="string"&&i===m||i.join&&i.indexOf(m)>-1}}var r={},o=t.group;(!o||md(o)!="object")&&(o={name:o}),r.name=o.name,r.checkPull=n(o.pull,!0),r.checkPut=n(o.put),r.revertClone=o.revertClone,t.group=r},nv=function(){!Jy&&le&&re(le,"display","none")},rv=function(){!Jy&&le&&re(le,"display","")};el&&!Fy&&document.addEventListener("click",function(e){if(Ya)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ya=!1,!1},!0);var xr=function(t){if(B){t=t.touches?t.touches[0]:t;var n=x3(t.clientX,t.clientY);if(n){var r={};for(var o in t)t.hasOwnProperty(o)&&(r[o]=t[o]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[_t]._onDragOver(r)}}},M3=function(t){B&&B.parentNode[_t]._isOutsideThisEl(t.target)};function ee(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Wn({},t),e[_t]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ev(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,a){s.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:ee.supportPointer!==!1&&"PointerEvent"in window&&(!Pi||fd),emptyInsertThreshold:5};Di.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);tv(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:L3,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?he(e,"pointerdown",this._onTapStart):(he(e,"mousedown",this._onTapStart),he(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(he(e,"dragover",this),he(e,"dragenter",this)),Ka.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Wn(this,C3())}ee.prototype={constructor:ee,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Oo=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,B):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,r=this.el,o=this.options,i=o.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=o.filter;if(F3(r),!B&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Pi&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=sn(l,o.draggable,r,!1),!(l&&l.animated)&&Ga!==l)){if(Mo=Xt(l),Bi=Xt(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){pt({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),kt("filter",n,{evt:t}),i&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=sn(c,d.trim(),r,!1),d)return pt({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),kt("filter",n,{evt:t}),!0}),u)){i&&t.preventDefault();return}o.handle&&!sn(c,o.handle,r,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,r){var o=this,i=o.el,s=o.options,a=i.ownerDocument,l;if(r&&!B&&r.parentNode===i){var c=Qe(r);if(De=i,B=r,Ge=B.parentNode,Lr=B.nextSibling,Ga=r,Xa=s.group,ee.dragged=B,Nr={target:B,clientX:(n||t).clientX,clientY:(n||t).clientY},Ky=Nr.clientX-c.left,Zy=Nr.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,B.style["will-change"]="all",l=function(){if(kt("delayEnded",o,{evt:t}),ee.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!Hy&&o.nativeDraggable&&(B.draggable=!0),o._triggerDragStart(t,n),pt({sortable:o,name:"choose",originalEvent:t}),Rt(B,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){zy(B,u.trim(),Sd)}),he(a,"dragover",xr),he(a,"mousemove",xr),he(a,"touchmove",xr),s.supportPointer?(he(a,"pointerup",o._onDrop),!this.nativeDraggable&&he(a,"pointercancel",o._onDrop)):(he(a,"mouseup",o._onDrop),he(a,"touchend",o._onDrop),he(a,"touchcancel",o._onDrop)),Hy&&this.nativeDraggable&&(this.options.touchStartThreshold=4,B.draggable=!0),kt("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Oi||zn))){if(ee.eventCanceled){this._onDrop();return}s.supportPointer?(he(a,"pointerup",o._disableDelayedDrag),he(a,"pointercancel",o._disableDelayedDrag)):(he(a,"mouseup",o._disableDelayedDrag),he(a,"touchend",o._disableDelayedDrag),he(a,"touchcancel",o._disableDelayedDrag)),he(a,"mousemove",o._delayedDragTouchMoveHandler),he(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&he(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,s.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){B&&Sd(B),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;pe(t,"mouseup",this._disableDelayedDrag),pe(t,"touchend",this._disableDelayedDrag),pe(t,"touchcancel",this._disableDelayedDrag),pe(t,"pointerup",this._disableDelayedDrag),pe(t,"pointercancel",this._disableDelayedDrag),pe(t,"mousemove",this._delayedDragTouchMoveHandler),pe(t,"touchmove",this._delayedDragTouchMoveHandler),pe(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?he(document,"pointermove",this._onTouchMove):n?he(document,"touchmove",this._onTouchMove):he(document,"mousemove",this._onTouchMove):(he(B,"dragend",this),he(De,"dragstart",this._onDragStart));try{document.selection?rl(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Ro=!1,De&&B){kt("dragStarted",this,{evt:n}),this.nativeDraggable&&he(document,"dragover",M3);var r=this.options;!t&&Rt(B,r.dragClass,!1),Rt(B,r.ghostClass,!0),ee.active=this,t&&this._appendGhost(),pt({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(an){this._lastX=an.clientX,this._lastY=an.clientY,nv();for(var t=document.elementFromPoint(an.clientX,an.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(an.clientX,an.clientY),t!==n);)n=t;if(B.parentNode[_t]._isOutsideThisEl(t),n)do{if(n[_t]){var r=void 0;if(r=n[_t]._onDragOver({clientX:an.clientX,clientY:an.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=Wy(n));rv()}},_onTouchMove:function(t){if(Nr){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,s=le&&Lo(le,!0),a=le&&s&&s.a,l=le&&s&&s.d,c=tl&&dt&&Uy(dt),u=(i.clientX-Nr.clientX+o.x)/(a||1)+(c?c[0]-vd[0]:0)/(a||1),d=(i.clientY-Nr.clientY+o.y)/(l||1)+(c?c[1]-vd[1]:0)/(l||1);if(!ee.active&&!Ro){if(r&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<r)return;this._onDragStart(t,!0)}if(le){s?(s.e+=u-(bd||0),s.f+=d-(yd||0)):s={a:1,b:0,c:0,d:1,e:u,f:d};var m="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");re(le,"webkitTransform",m),re(le,"mozTransform",m),re(le,"msTransform",m),re(le,"transform",m),bd=u,yd=d,an=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!le){var t=this.options.fallbackOnBody?document.body:De,n=Qe(B,!0,tl,!0,t),r=this.options;if(tl){for(dt=t;re(dt,"position")==="static"&&re(dt,"transform")==="none"&&dt!==document;)dt=dt.parentNode;dt!==document.body&&dt!==document.documentElement?(dt===document&&(dt=_n()),n.top+=dt.scrollTop,n.left+=dt.scrollLeft):dt=_n(),vd=Uy(dt)}le=B.cloneNode(!0),Rt(le,r.ghostClass,!1),Rt(le,r.fallbackClass,!0),Rt(le,r.dragClass,!0),re(le,"transition",""),re(le,"transform",""),re(le,"box-sizing","border-box"),re(le,"margin",0),re(le,"top",n.top),re(le,"left",n.left),re(le,"width",n.width),re(le,"height",n.height),re(le,"opacity","0.8"),re(le,"position",tl?"absolute":"fixed"),re(le,"zIndex","100000"),re(le,"pointerEvents","none"),ee.ghost=le,t.appendChild(le),re(le,"transform-origin",Ky/parseInt(le.style.width)*100+"% "+Zy/parseInt(le.style.height)*100+"%")}},_onDragStart:function(t,n){var r=this,o=t.dataTransfer,i=r.options;if(kt("dragStart",this,{evt:t}),ee.eventCanceled){this._onDrop();return}kt("setupClone",this),ee.eventCanceled||(Fe=Xy(B),Fe.removeAttribute("id"),Fe.draggable=!1,Fe.style["will-change"]="",this._hideClone(),Rt(Fe,this.options.chosenClass,!1),ee.clone=Fe),r.cloneId=rl(function(){kt("clone",r),!ee.eventCanceled&&(r.options.removeCloneOnHide||De.insertBefore(Fe,B),r._hideClone(),pt({sortable:r,name:"clone"}))}),!n&&Rt(B,i.dragClass,!0),n?(Ya=!0,r._loopId=setInterval(r._emulateDragOver,50)):(pe(document,"mouseup",r._onDrop),pe(document,"touchend",r._onDrop),pe(document,"touchcancel",r._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(r,o,B)),he(document,"drop",r),re(B,"transform","translateZ(0)")),Ro=!0,r._dragStartId=rl(r._dragStarted.bind(r,n,t)),he(document,"selectstart",r),Hi=!0,window.getSelection().removeAllRanges(),Pi&&re(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,r=t.target,o,i,s,a=this.options,l=a.group,c=ee.active,u=Xa===l,d=a.sort,m=ct||c,p,f=this,h=!1;if(Ed)return;function y(V,G){kt(V,f,Tn({evt:t,isOwner:u,axis:p?"vertical":"horizontal",revert:s,dragRect:o,targetRect:i,canSort:d,fromSortable:m,target:r,completed:C,onMove:function(ae,ne){return nl(De,n,B,o,ae,Qe(ae),t,ne)},changed:k},G))}function E(){y("dragOverAnimationCapture"),f.captureAnimationState(),f!==m&&m.captureAnimationState()}function C(V){return y("dragOverCompleted",{insertion:V}),V&&(u?c._hideClone():c._showClone(f),f!==m&&(Rt(B,ct?ct.options.ghostClass:c.options.ghostClass,!1),Rt(B,a.ghostClass,!0)),ct!==f&&f!==ee.active?ct=f:f===ee.active&&ct&&(ct=null),m===f&&(f._ignoreWhileAnimating=r),f.animateAll(function(){y("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(r===B&&!B.animated||r===n&&!r.animated)&&(Oo=null),!a.dragoverBubble&&!t.rootEl&&r!==document&&(B.parentNode[_t]._isOutsideThisEl(t.target),!V&&xr(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),h=!0}function k(){Ot=Xt(B),ar=Xt(B,a.draggable),pt({sortable:f,name:"change",toEl:n,newIndex:Ot,newDraggableIndex:ar,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=sn(r,a.draggable,n,!0),y("dragOver"),ee.eventCanceled)return h;if(B.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||f._ignoreWhileAnimating===r)return C(!1);if(Ya=!1,c&&!a.disabled&&(u?d||(s=Ge!==De):ct===this||(this.lastPutMode=Xa.checkPull(this,c,B,t))&&l.checkPut(this,c,B,t))){if(p=this._getDirection(t,r)==="vertical",o=Qe(B),y("dragOverValid"),ee.eventCanceled)return h;if(s)return Ge=De,E(),this._hideClone(),y("revert"),ee.eventCanceled||(Lr?De.insertBefore(B,Lr):De.appendChild(B)),C(!0);var w=pd(n,a.draggable);if(!w||I3(t,p,this)&&!w.animated){if(w===B)return C(!1);if(w&&n===t.target&&(r=w),r&&(i=Qe(r)),nl(De,n,B,o,r,i,t,!!r)!==!1)return E(),w&&w.nextSibling?n.insertBefore(B,w.nextSibling):n.appendChild(B),Ge=n,k(),C(!0)}else if(w&&P3(t,p,this)){var b=No(n,0,a,!0);if(b===B)return C(!1);if(r=b,i=Qe(r),nl(De,n,B,o,r,i,t,!1)!==!1)return E(),n.insertBefore(B,b),Ge=n,k(),C(!0)}else if(r.parentNode===n){i=Qe(r);var v=0,A,g=B.parentNode!==n,S=!N3(B.animated&&B.toRect||o,r.animated&&r.toRect||i,p),T=p?"top":"left",_=Vy(r,"top","top")||Vy(B,"top","top"),M=_?_.scrollTop:void 0;Oo!==r&&(A=i[T],$i=!1,Za=!S&&a.invertSwap||g),v=D3(t,r,i,p,S?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Za,Oo===r);var N;if(v!==0){var W=Xt(B);do W-=v,N=Ge.children[W];while(N&&(re(N,"display")==="none"||N===le))}if(v===0||N===r)return C(!1);Oo=r,Fi=v;var P=r.nextElementSibling,R=!1;R=v===1;var Y=nl(De,n,B,o,r,i,t,R);if(Y!==!1)return(Y===1||Y===-1)&&(R=Y===1),Ed=!0,setTimeout(O3,30),E(),R&&!P?n.appendChild(B):r.parentNode.insertBefore(B,R?P:r),_&&Gy(_,0,M-_.scrollTop),Ge=B.parentNode,A!==void 0&&!Za&&(Qa=Math.abs(A-Qe(r)[T])),k(),C(!0)}if(n.contains(B))return C(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){pe(document,"mousemove",this._onTouchMove),pe(document,"touchmove",this._onTouchMove),pe(document,"pointermove",this._onTouchMove),pe(document,"dragover",xr),pe(document,"mousemove",xr),pe(document,"touchmove",xr)},_offUpEvents:function(){var t=this.el.ownerDocument;pe(t,"mouseup",this._onDrop),pe(t,"touchend",this._onDrop),pe(t,"pointerup",this._onDrop),pe(t,"pointercancel",this._onDrop),pe(t,"touchcancel",this._onDrop),pe(document,"selectstart",this)},_onDrop:function(t){var n=this.el,r=this.options;if(Ot=Xt(B),ar=Xt(B,r.draggable),kt("drop",this,{evt:t}),Ge=B&&B.parentNode,Ot=Xt(B),ar=Xt(B,r.draggable),ee.eventCanceled){this._nulling();return}Ro=!1,Za=!1,$i=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),wd(this.cloneId),wd(this._dragStartId),this.nativeDraggable&&(pe(document,"drop",this),pe(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Pi&&re(document.body,"user-select",""),re(B,"transform",""),t&&(Hi&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),le&&le.parentNode&&le.parentNode.removeChild(le),(De===Ge||ct&&ct.lastPutMode!=="clone")&&Fe&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),B&&(this.nativeDraggable&&pe(B,"dragend",this),Sd(B),B.style["will-change"]="",Hi&&!Ro&&Rt(B,ct?ct.options.ghostClass:this.options.ghostClass,!1),Rt(B,this.options.chosenClass,!1),pt({sortable:this,name:"unchoose",toEl:Ge,newIndex:null,newDraggableIndex:null,originalEvent:t}),De!==Ge?(Ot>=0&&(pt({rootEl:Ge,name:"add",toEl:Ge,fromEl:De,originalEvent:t}),pt({sortable:this,name:"remove",toEl:Ge,originalEvent:t}),pt({rootEl:Ge,name:"sort",toEl:Ge,fromEl:De,originalEvent:t}),pt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),ct&&ct.save()):Ot!==Mo&&Ot>=0&&(pt({sortable:this,name:"update",toEl:Ge,originalEvent:t}),pt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),ee.active&&((Ot==null||Ot===-1)&&(Ot=Mo,ar=Bi),pt({sortable:this,name:"end",toEl:Ge,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){kt("nulling",this),De=B=Ge=le=Lr=Fe=Ga=sr=Nr=an=Hi=Ot=ar=Mo=Bi=Oo=Fi=ct=Xa=ee.dragged=ee.ghost=ee.clone=ee.active=null;var t=this.el;Ja.forEach(function(n){t.contains(n)&&(n.checked=!0)}),Ja.length=bd=yd=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":B&&(this._onDragOver(t),R3(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t=[],n,r=this.el.children,o=0,i=r.length,s=this.options;o<i;o++)n=r[o],sn(n,s.draggable,this.el,!1)&&t.push(n.getAttribute(s.dataIdAttr)||H3(n));return t},sort:function(t,n){var r={},o=this.el;this.toArray().forEach(function(i,s){var a=o.children[s];sn(a,this.options.draggable,o,!1)&&(r[i]=a)},this),n&&this.captureAnimationState(),t.forEach(function(i){r[i]&&(o.removeChild(r[i]),o.appendChild(r[i]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return sn(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var r=this.options;if(n===void 0)return r[t];var o=Di.modifyOption(this,t,n);typeof o<"u"?r[t]=o:r[t]=n,t==="group"&&tv(r)},destroy:function(){kt("destroy",this);var t=this.el;t[_t]=null,pe(t,"mousedown",this._onTapStart),pe(t,"touchstart",this._onTapStart),pe(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(pe(t,"dragover",this),pe(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ka.splice(Ka.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!sr){if(kt("hideClone",this),ee.eventCanceled)return;re(Fe,"display","none"),this.options.removeCloneOnHide&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),sr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(sr){if(kt("showClone",this),ee.eventCanceled)return;B.parentNode==De&&!this.options.group.revertClone?De.insertBefore(Fe,B):Lr?De.insertBefore(Fe,Lr):De.appendChild(Fe),this.options.group.revertClone&&this.animate(B,Fe),re(Fe,"display",""),sr=!1}}};function R3(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function nl(e,t,n,r,o,i,s,a){var l,c=e[_t],u=c.options.onMove,d;return window.CustomEvent&&!zn&&!Oi?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=r,l.related=o||t,l.relatedRect=i||Qe(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),u&&(d=u.call(c,l,s)),d}function Sd(e){e.draggable=!1}function O3(){Ed=!1}function P3(e,t,n){var r=Qe(No(n.el,0,n.options,!0)),o=Yy(n.el,n.options,le),i=10;return t?e.clientX<o.left-i||e.clientY<r.top&&e.clientX<r.right:e.clientY<o.top-i||e.clientY<r.bottom&&e.clientX<r.left}function I3(e,t,n){var r=Qe(pd(n.el,n.options.draggable)),o=Yy(n.el,n.options,le),i=10;return t?e.clientX>o.right+i||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>o.bottom+i||e.clientX>r.right&&e.clientY>r.top}function D3(e,t,n,r,o,i,s,a){var l=r?e.clientY:e.clientX,c=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,m=!1;if(!s){if(a&&Qa<c*o){if(!$i&&(Fi===1?l>u+c*i/2:l<d-c*i/2)&&($i=!0),$i)m=!0;else if(Fi===1?l<u+Qa:l>d-Qa)return-Fi}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return B3(t)}return m=m||s,m&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function B3(e){return Xt(B)<Xt(e)?1:-1}function H3(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function F3(e){Ja.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&Ja.push(r)}}function rl(e){return setTimeout(e,0)}function wd(e){return clearTimeout(e)}el&&he(document,"touchmove",function(e){(ee.active||Ro)&&e.cancelable&&e.preventDefault()}),ee.utils={on:he,off:pe,css:re,find:zy,is:function(t,n){return!!sn(t,n,t,!1)},extend:S3,throttle:jy,closest:sn,toggleClass:Rt,clone:Xy,index:Xt,nextTick:rl,cancelNextTick:wd,detectDirection:ev,getChild:No,expando:_t},ee.get=function(e){return e[_t]},ee.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(ee.utils=Tn(Tn({},ee.utils),r.utils)),Di.mount(r)})},ee.create=function(e,t){return new ee(e,t)},ee.version=v3;var Je=[],Wi,Cd,Ad=!1,Td,_d,ol,qi;function $3(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var r=n.originalEvent;this.sortable.nativeDraggable?he(document,"dragover",this._handleAutoScroll):this.options.supportPointer?he(document,"pointermove",this._handleFallbackAutoScroll):r.touches?he(document,"touchmove",this._handleFallbackAutoScroll):he(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?pe(document,"dragover",this._handleAutoScroll):(pe(document,"pointermove",this._handleFallbackAutoScroll),pe(document,"touchmove",this._handleFallbackAutoScroll),pe(document,"mousemove",this._handleFallbackAutoScroll)),ov(),il(),w3()},nulling:function(){ol=Cd=Wi=Ad=qi=Td=_d=null,Je.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,r){var o=this,i=(n.touches?n.touches[0]:n).clientX,s=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(i,s);if(ol=n,r||this.options.forceAutoScrollFallback||Oi||zn||Pi){kd(n,this.options,a,r);var l=ir(a,!0);Ad&&(!qi||i!==Td||s!==_d)&&(qi&&ov(),qi=setInterval(function(){var c=ir(document.elementFromPoint(i,s),!0);c!==l&&(l=c,il()),kd(n,o.options,c,r)},10),Td=i,_d=s)}else{if(!this.options.bubbleScroll||ir(a,!0)===_n()){il();return}kd(n,this.options,ir(a,!1),!1)}}},Wn(e,{pluginName:"scroll",initializeByDefault:!0})}function il(){Je.forEach(function(e){clearInterval(e.pid)}),Je=[]}function ov(){clearInterval(qi)}var kd=jy(function(e,t,n,r){if(t.scroll){var o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,a=t.scrollSpeed,l=_n(),c=!1,u;Cd!==n&&(Cd=n,il(),Wi=t.scroll,u=t.scrollFn,Wi===!0&&(Wi=ir(n,!0)));var d=0,m=Wi;do{var p=m,f=Qe(p),h=f.top,y=f.bottom,E=f.left,C=f.right,k=f.width,w=f.height,b=void 0,v=void 0,A=p.scrollWidth,g=p.scrollHeight,S=re(p),T=p.scrollLeft,_=p.scrollTop;p===l?(b=k<A&&(S.overflowX==="auto"||S.overflowX==="scroll"||S.overflowX==="visible"),v=w<g&&(S.overflowY==="auto"||S.overflowY==="scroll"||S.overflowY==="visible")):(b=k<A&&(S.overflowX==="auto"||S.overflowX==="scroll"),v=w<g&&(S.overflowY==="auto"||S.overflowY==="scroll"));var M=b&&(Math.abs(C-o)<=s&&T+k<A)-(Math.abs(E-o)<=s&&!!T),N=v&&(Math.abs(y-i)<=s&&_+w<g)-(Math.abs(h-i)<=s&&!!_);if(!Je[d])for(var W=0;W<=d;W++)Je[W]||(Je[W]={});(Je[d].vx!=M||Je[d].vy!=N||Je[d].el!==p)&&(Je[d].el=p,Je[d].vx=M,Je[d].vy=N,clearInterval(Je[d].pid),(M!=0||N!=0)&&(c=!0,Je[d].pid=setInterval(function(){r&&this.layer===0&&ee.active._onTouchMove(ol);var P=Je[this.layer].vy?Je[this.layer].vy*a:0,R=Je[this.layer].vx?Je[this.layer].vx*a:0;typeof u=="function"&&u.call(ee.dragged.parentNode[_t],R,P,e,ol,Je[this.layer].el)!=="continue"||Gy(Je[this.layer].el,R,P)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&m!==l&&(m=ir(m,!1)));Ad=c}},30),iv=function(t){var n=t.originalEvent,r=t.putSortable,o=t.dragEl,i=t.activeSortable,s=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var c=r||i;a();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(d)&&(s("spill"),this.onSpill({dragEl:o,putSortable:r}))}};function Ld(){}Ld.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,r=t.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var o=No(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(n,o):this.sortable.el.appendChild(n),this.sortable.animateAll(),r&&r.animateAll()},drop:iv},Wn(Ld,{pluginName:"revertOnSpill"});function Nd(){}Nd.prototype={onSpill:function(t){var n=t.dragEl,r=t.putSortable||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:iv},Wn(Nd,{pluginName:"removeOnSpill"}),ee.mount(new $3),ee.mount(Nd,Ld);var sv=100,av=Symbol("EMULATED_DRAG_EVENT");function W3(e,t){return e[av]===t}var lv=class{constructor(){L(this,"_target",null),L(this,"_interval",0),L(this,"_x",0),L(this,"_y",0)}_fireDragEvent(e,t,n,r,o){const i=new DragEvent(t,{dataTransfer:o,clientX:n,clientY:r,bubbles:!0,cancelable:!0});return i[av]=this,e.dispatchEvent(i),!i.defaultPrevented}start(e,t,n){const r=document.elementFromPoint(e,t);return r&&!this._target&&this._fireDragEvent(r,"dragstart",e,t,n)?(this._target=r,this._x=e,this._y=t,this._interval=setInterval(()=>{this._fireDragEvent(r,"drag",this._x,this._y,n)},sv),!0):!1}enter(e,t,n){const r=document.elementFromPoint(e,t);r&&r!==this._target&&(this._fireDragEvent(r,"dragenter",e,t,n),this._target=r,this._interval||(this._interval=setInterval(()=>{this._fireDragEvent(r,"drag",this._x,this._y,n)},sv)))}over(e,t,n){this._x=e,this._y=t;const r=document.elementFromPoint(e,t);r&&(r!==this._target&&this._fireDragEvent(r,"dragenter",e,t,n),this._fireDragEvent(r,"dragover",e,t,n)),this._target&&r!==this._target&&this._fireDragEvent(this._target,"dragleave",e,t,n),this._target=r}leave(e,t,n){this._target&&(this._fireDragEvent(this._target,"dragleave",e,t,n),this._target=null),this._target=null}drop(e,t,n){this._target&&(this._fireDragEvent(this._target,"drop",e,t,n),this._target=null),this._target=null,clearInterval(this._interval)}end(e,t,n){this._target&&this._fireDragEvent(this._target,"dragend",e,t,n),this._target=null,clearInterval(this._interval)}};function sl(e){document.querySelector(".noresp-em-narrow-table")&&e.querySelectorAll("img, amp-img").forEach(t=>{const n=t;n.style.removeProperty("width"),n.style.removeProperty("max-width")})}function zi(e){const t=getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}function xd(e){const t=document.createElement("div");t.replaceChildren(...Te(e.atomHTML));const n=t.querySelector("img");if(!n)return Ct(t);let r=0;return e.targetAtom.classList.contains("em-block-insert-empty")?r=600:e.targetAtom.classList.contains("em-mob-wrap")||e.targetAtom.classList.contains("noresp-em-mob-wrap")?r=zi(e.targetAtom):r=e.targetAtom.parentNode?zi(e.targetAtom.parentNode):zi(e.targetAtom),n.setAttribute("width",String(r)),document.querySelector(".noresp-em-narrow-table")?sl(t):n.style.maxWidth=r+"px",Ct(t)}function q3(e,t,n){const r=e.querySelectorAll("img"),o=r.length===1?r[0]:null,i=o?.getAttribute("width")??"";if(!o||o.classList.contains("em-countdown")||!i||i.endsWith("%"))return!1;const s=parseFloat(i),a=o.style.display;o.style.display="none";const l=zi(n);o.style.display=a;const c=s>=zi(t)?l:Math.min(s,l);return!c||c===s?!1:(o.setAttribute("width",String(c)),document.querySelector(".noresp-em-narrow-table")?sl(e):o.style.maxWidth=c+"px",!0)}function cv(e,t){const n=e.atomHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Te(e.atomHTML));const r=n.querySelector("img");if(!r)return!1;const o=new Image;return o.onload=function(){const i=Math.round(this.width/2);r.setAttribute("width",String(i)),document.querySelector(".noresp-em-narrow-table")?sl(n):(r.style.maxWidth=i+"px",r.style.width="100%"),qe(e.targetElem,e.targetPlace,`
49
+ `+Ct(n)+`
50
+ `),t()},o.src=r.getAttribute("src")||"",!1}function Md(e){const t=e.blockHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");t.replaceChildren(...Te(e.blockHTML));const n=t.querySelector("img.em-countdown");if(!n)return Ct(t);const r=n.getAttribute("em-cd-settings")||"",o=e.project==="useblocks"?"https://cdt3.useblocks.io/rndt?":"https://cdt3.emcdn.ru/rndt?",i=new URL(o+r),s=new Date;return i.searchParams.set("time",new Date(+s+432e6).toISOString()),Tt(n,"src",i.href),n.setAttribute("em-cd-settings",i.search.substring(1)),Ct(t)}function al(e){const t=e.blockIsTr?document.createElement("table"):document.createElement("div");return t.replaceChildren(...Te(e.blockHTML)),document.querySelector(".noresp-em-narrow-table")?t.querySelectorAll('[class^="em-mob-"], [class*=" em-mob-"]').forEach(n=>{n.className=n.className.split(" ").map(r=>r.startsWith("em-mob-")?"noresp-"+r:r).join(" ")}):t.querySelectorAll('[class^="noresp-"], [class*=" noresp-"]').forEach(n=>{n.className=n.className.split(" ").map(r=>r.startsWith("noresp-")?r.substring(7):r).join(" ")}),sl(t),Ct(t)}function z3(e){e&&(e.removeAttribute("em-edit"),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")))}var V3=class{constructor(){L(this,"_items",new Map)}gc(){for(const[e,t]of[...this._items])e.isConnected||(this._items.delete(e),t.destroy())}get(e){return this._items.get(e)}create(e,t){const n=ee.create(e,t);return this._items.set(e,n),n}entries(){return[...this._items]}},lr=new V3,U3=Number.MAX_VALUE,j3=0;function uv(e){return typeof e=="object"?e.name:e}var G3=class{constructor(){L(this,"emulator",new lv),L(this,"x",0),L(this,"y",0),L(this,"_tracked",!1),L(this,"handleMouseMove",e=>{this.x=e.clientX,this.y=e.clientY,this.emulator.over(this.x,this.y)})}track(){this._tracked||(this._tracked=!0,window.addEventListener("mousedown",e=>{this.x=e.clientX,this.y=e.clientY}),window.addEventListener("mouseup",()=>this.emulator.end(this.x,this.y)))}},Yt=new G3;function X3(e){lr.gc(),Yt.track();const t=document.querySelectorAll("[em=group]");ee.prototype._emulateDragOver=function(){};let n;const r=()=>{e.commit(!0)};function o(a,l){let c;function u(f,h){let y=null,E=Number.MAX_VALUE;const C=uv(ee.active?.options.group);for(const[k,w]of lr.entries())if(uv(w.options.group)===C&&(!a||c&&a(k,c)!==!1)){for(const b of k.children)if(!b.classList.contains("sortable-drag")){const v=b.getBoundingClientRect(),A=f<v.left?v.left-f:f>v.right?f-v.right:0,g=h<v.top?v.top-h:h>v.bottom?h-v.bottom:0;if(A<U3||g<j3){const S=Math.sqrt(A*A+g*g);S<E?(y=[w,b],E=S):S===E&&y[1].contains(b)&&(y=[w,b])}}}return y}function d(f){const h="TouchEvent"in window&&f instanceof TouchEvent?f.touches[0]:f,y=u(h.clientX,h.clientY);if(y){const[k,w]=y,b=w.getBoundingClientRect();var E={clientX:b.left+b.width/2,clientY:h.clientY};for(var C in f)f.hasOwnProperty(C)&&(E[C]=f[C]);E.target=w,E.rootEl=w.parentNode,E.preventDefault=void 0,E.stopPropagation=void 0,k._onDragOver(E)}}return{onStart:f=>{c=f.item,z3(ee.ghost),e.beginTextUpdate(),window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),Yt.emulator.start(Yt.x,Yt.y)?(window.addEventListener("mousemove",Yt.handleMouseMove),n&&(n.dispose(),n=void 0)):f.preventDefault()},onEnd:f=>{window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d);let h=!1;f.from===f.to?Yt.emulator.end(Yt.x,Yt.y):(h=!!l?.(f),Yt.emulator.drop(Yt.x,Yt.y)),window.removeEventListener("mousemove",Yt.handleMouseMove),e.endTextUpdate(),f.from===f.to&&f.oldIndex!==f.newIndex&&e.commit(!0),h&&e.commit(!0),n&&(n.dispose(),n=void 0),c=void 0}}}if(t.length)for(const a of t){const l=a.parentElement;l&&!lr.get(l)&&lr.create(l,{forceFallback:!0,group:"groups-sorting",handle:`.of-group .${je.drag}`,...o(),onMove:r})}const i=[...document.querySelectorAll("[em=block]")],s=[...document.querySelectorAll("[em=atom]")].map(a=>a.parentElement);for(const a of i){const l=a.querySelectorAll("td");for(const c of l)!c.innerHTML&&!c.hasAttribute("height")&&[...c.parentElement?.children||[]].indexOf(c)%2===0&&s.push(c)}if(s.length){const a=new Set;for(const l of s)l&&!a.has(l)&&(a.add(l),lr.get(l)||lr.create(l,{forceFallback:!0,group:"atoms-sorting",handle:`.of-atom .${je.drag}`,...o((c,u)=>{if(u.tagName==="TR"){if(c.tagName!=="TABLE"&&c.tagName!=="TBODY")return!1}else if(u.tagName==="TD"){if(c.tagName!=="TR")return!1}else if(u.tagName==="TABLE"){const d=e.getContext(c);if(d&&vn(d)&&d.tagName==="AMP-ACCORDION"&&c.tagName==="DIV"&&[...d.querySelectorAll("section > div")].indexOf(c)>=0||e.isInExternal(c)&&c.tagName==="DIV")return!0;if(c.tagName!=="TD")return!1}},c=>q3(c.item,c.from,c.to)),onMove:r,onSort:function(){l.innerHTML.trim()===""&&(l.innerHTML="")}}))}if(i.length){const a=new Set;for(const l of i){const c=l.parentElement;c&&!a.has(c)&&(a.add(c),lr.get(c)||lr.create(c,{forceFallback:!0,group:"blocks-sorting",handle:`.of-block .${je.drag}`,...o(),onMove:r}))}}}var Y3=class{constructor(){L(this,"_nodes",[])}add(e){const t=this._nodes,n=new Set;for(const r of t){if(r.contains(e))return;e.contains(r)&&n.add(r)}for(const r of n){const o=t.indexOf(r);o>=0&&t.splice(o,1)}t.push(e)}remove(e){const t=new Set;for(const n of this._nodes)(e===n||e.contains(n))&&t.add(n);for(const n of t){const r=this._nodes.indexOf(n);r>=0&&this._nodes.splice(r,1)}}get nodes(){return[...this._nodes]}clear(){this._nodes.splice(0,this._nodes.length)}},Rd={get textDocument(){return D(Et,Ko)},commit:Er};function K3(){const e=x.get("applicationTheme")||"light";let t=!1;try{Rd.textDocument.beginUpdate();const n=[...document.querySelectorAll('[em="css"]')].map(s=>s.getAttribute("href"));let r=document.getElementsByTagName("head")[0];if(!r)if(document.documentElement)r=document.createElement("head"),document.documentElement.insertBefore(r,document.documentElement.firstChild),t=!0;else return;const o="css/sandbox.css?d5e4bde1";if(n.indexOf(o)<0){const s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("em","css"),s.setAttribute("href",o),r.appendChild(s),t=!0}const i=`css/sandbox-${e}.css?d5e4bde1`;if(n.indexOf(i)<0){const s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("em","css"),s.setAttribute("href",i),r.appendChild(s),t=!0}}finally{Rd.textDocument.endUpdate()}t&&Rd.commit(!1)}var jq=".em-prevent-action";function Z3(e){const{fingerprint:t,applicationElementSettingsSet:n}=e,r=document.querySelector("[em-edit]"),o=t.take(r);if(t.differs(o)){if(document.body?.classList.contains("em-sandbox-discuss")){t.accept(o);return}if(r){r.closest(".em-prevent-action")||(t.accept(o),n({elem:r}));return}setTimeout(()=>{const i=document.querySelector("[em-edit]"),s=t.take(i);i?t.differs(s)&&(t.accept(s),i.closest(".em-prevent-action")||n({elem:i})):(t.accept(s),n({elem:null}))},0)}}function Q3(){const e=document.body;if(!e)return;const t=x.get("lockEdit")||x.get("lockEditor");(x.get("lockEdit")!==e.classList.contains("mceNonEditable")||x.get("lockEditor"))&&e.classList.toggle("mceNonEditable",!!t),e.classList.toggle("em-sandbox-preview",!!x.get("previewPage"))}function J3(e){const{htmlDocument:t,commit:n,focusController:r}=e;t.onChange(s=>{s.some(a=>a.added.length||a.characterDataChanged||a.reordered?.length||a.reparented?.length)&&X3(t)}),t.onChange(()=>{K3()}),t.onRefresh(()=>e.initPreview()),t.onChange(s=>{s.some(a=>a.removed.some(l=>l instanceof HTMLHeadElement||l instanceof HTMLLinkElement&&l.hasAttribute("em")))&&document.querySelector(".em-editor-wrapper")?.remove()});const o=new Y3;let i;t.onChange(s=>{for(const a of s)for(const l of a.added)o.add(l.parentElement??l);i||(i=setTimeout(()=>{r.whenEditorLostFocus(()=>{o.clear(),n(!1)}),i=void 0},1e3))}),t.onChange(f3(e.applicationElementSettingsSet)),t.onChange(()=>{x.get("activeElementLocked")>0||(Z3(e),Q3())})}function eP(e,t){if(!(e instanceof Element)||!e.closest(".em-prevent-action"))return;const n=document.querySelector(".em-editor-wrapper");if(!(!document.querySelector("[em-edit]")&&!n))try{x.increment("activeElementLocked"),document.querySelectorAll("[em-edit]").forEach(r=>r.removeAttribute("em-edit")),n&&(n.style.display="none"),document.querySelectorAll("editor").forEach(r=>r.blur()),t.forget()}finally{Promise.resolve().then(()=>x.decrement("activeElementLocked"))}}function tP(e){const t=n=>eP(n.target,e);return window.addEventListener("mousedown",t,!0),window.addEventListener("click",t,!0),{dispose(){window.removeEventListener("mousedown",t,!0),window.removeEventListener("click",t,!0)}}}var nP={name:"sandbox.fingerprint",provides:[Vr],awaits:{services:[te]},setup(e){const t=D(e,te),n=T_(r=>t.getOuterHtml(r));__(n),tP(n),e.inject(Vr,n)}},rP={name:"sandbox.setCursor",provides:[vt],awaits:{services:[te,Zt,mt]},setup(e){const t={HTMLDocument:D(e,te),documentMapping:D(e,Zt),remoteDocument:D(e,mt),messageService:Z};e.inject(vt,n=>L_(n,t))}},oP={name:"sandbox.wrapEditor",provides:[Qt],awaits:{services:[te,Zt,xe]},setup:e=>e.inject(Qt,c3({commit:lt(e),htmlDocument:D(e,te),documentMapping:D(e,Zt)}))};function iP(e){const{container:t}=e;Wa.registerAll({MessageService:()=>Z,FocusState:()=>e.focusController,SyncService:()=>t.getInstance(te),SyncServiceInternals:()=>t.getInstance(mt),TextDocument:()=>t.getInstance(Ko),Mapping:()=>t.getInstance(Zt),EditorSurface:()=>({surface:e.surface})}),e.features&&e.features.length>0&&Wa.initFeatures(e.features)}var sP=e=>e,aP=e=>`table:empty::before {
51
+ /*content: 'Paste block here';*/
52
+ }
53
+
54
+ table:is(:empty, :has(> tbody:only-child:empty))::after {
55
+ content: '${e.DROP_BLOCK_HINT}' !important;
56
+ }
57
+
58
+ [em="block"].empty-structure td:not([height]):not([width]):empty::before {
59
+ /*content: 'Paste atom here';*/
60
+ }
61
+
62
+ .em-block-insert:after {
63
+ content: '${e.PASTE_HERE}' !important;
64
+ }
65
+
66
+ .em-atom-insert:after,
67
+ .em-blockatom-insert:after {
68
+ content: '${e.PASTE_HERE}' !important;
69
+ }`,lP=class extends Ee{constructor(e){super(),L(this,"htmlDocument",void 0),L(this,"_localized",{...Fw(sP)}),L(this,"_styles",""),L(this,"_onChangeLocaleEmitter",new Me),L(this,"_onDomChanged",()=>{if(!document.querySelector('[data-em-localization="true"]')&&this._styles){const t=document.querySelector("head")||document.querySelector("body");if(t){const n=document.createElement("style");n.innerHTML=this._styles,n.dataset.emLocalization="true",t.insertBefore(n,t.firstChild)}}}),L(this,"onChangeLocale",this._onChangeLocaleEmitter.event),this.htmlDocument=e,this.addDisposable(e.onChange(this._onDomChanged))}get localized(){return this._localized}setTranslations({name:e,data:t}){this._localized=t;const n=document.createElement("style");n.dataset.emLocalization="true";const r=aP(t);if(r&&this._styles!==r){this._styles=r,n.innerHTML=r;const o=document.querySelector('[data-em-localization="true"]');if(o)o.replaceWith(n);else{const i=document.querySelector("head")||document.querySelector("body");i?.insertBefore(n,i.firstChild)}this.htmlDocument.commit(!1)}this._onChangeLocaleEmitter.fire({name:e,data:t})}};function cP(e){const t=new lP(e),n=r=>{t.setTranslations(r)};return t.addDisposable(Z.addListener(Pe.SANDBOX_TRANSLATIONS,n)),t}function uP(e,t,n){const r=new Ee;let o=[];return r.addDisposable(e.beforeChange(({treeMutations:i})=>{t.isEditorInFocus&&o.push(...i)})),r.addDisposable(t.editorLostFocus(()=>{if(o.length){const i=[];for(const s of o){const a=s.type;let l=null;a==="Add"?l=s.node:a==="Update"&&(l=s.next),l?.closed===!1&&i.push(l)}i.length&&(e.correctNodes(i),n.saveChanges(!1)),o=[]}})),r}function dP(e){const t=new Ee,n=r=>{W3(r,e)||Z.send(Pe.APPLICATION_IFRAME_DRAG_EVENT,{type:r.type,clientX:r.clientX,clientY:r.clientY,value:r.dataTransfer?.getData("Text")||""})};return window.addEventListener("dragstart",n),window.addEventListener("dragover",n),window.addEventListener("drag",n),window.addEventListener("dragleave",n),window.addEventListener("dragend",n),window.addEventListener("drop",n),window.addEventListener("dragenter",n),t.addDispose(()=>{window.removeEventListener("dragstart",n),window.removeEventListener("dragover",n),window.removeEventListener("drag",n),window.removeEventListener("dragleave",n),window.removeEventListener("dragend",n),window.removeEventListener("drop",n),window.removeEventListener("dragenter",n)}),t}function mP(){const e=new lv,t=r=>{const o=new DataTransfer;switch(o.setData("Text",r.value),r.type){case"dragenter":e.enter(r.clientX,r.clientY,o);break;case"dragover":e.over(r.clientX,r.clientY,o);break;case"dragleave":e.leave(r.clientX,r.clientY,o);break;case"dragend":e.end(r.clientX,r.clientY,o);break;case"drop":e.drop(r.clientX,r.clientY,o)}},n=new Ee;return n.addDisposable(Z.addListener(Pe.SANDBOX_DRAG_EVENT,t)),n.addDisposable(dP(e)),n}function fP(){return NodeFilter.FILTER_ACCEPT}function pP(e){if(e instanceof Comment)return[e];const t=[];if(e){const n=document.createNodeIterator(e,NodeFilter.SHOW_COMMENT,fP);let r;for(;r=n.nextNode();)t.push(r)}return t}var hP=new Pp,gP=new Set;function dv(e){return e?hP.getUnescapedText(e,!0,gP)!==e:!1}function mv(e){return e.nodeValue?dv(e.nodeValue):!1}function bP(e){const t=e.previousSibling;if(t instanceof HTMLSpanElement&&t.classList.contains("em-code")&&t.classList.contains("em-code_var"))return t}function ll(e){const t=e?.nextSibling;if(t instanceof Comment&&mv(t))return t}function fv(e,t){if(t.ownerDocument){const n=t.ownerDocument.createRange();try{n.selectNode(t)}catch{n.selectNodeContents(t)}const r=e.compareBoundaryPoints(Range.START_TO_START,n)===1,o=e.compareBoundaryPoints(Range.END_TO_END,n)===-1;if(r&&!o)return 0;if(!r&&o)return 1;if(r&&o)return 2}return 3}function yP(){let e=!1;document.addEventListener("keydown",n=>{n.key.toLowerCase()==="arrowleft"&&(e||(e=!0,setTimeout(()=>{e=!1},50)))});const t=()=>{const n=window.getSelection();if(n?.rangeCount){const r=n.getRangeAt(0),o=document.querySelectorAll(".em-code");for(const i of o){const s=i.nextSibling;if(s instanceof Comment){if(fv(r,i)===0&&fv(r,s)===1){e?(r.setStartBefore(i),r.setEndBefore(i)):(r.setStartAfter(s),r.setEndAfter(s));return}n.containsNode(s)&&!n.containsNode(i)&&r.setStartAfter(s)}}}};return document.addEventListener("selectionchange",t),{dispose(){document.removeEventListener("selectionchange",t)}}}var vP=e=>{if(!e)return;(!e.firstChild||e.firstChild.nodeType!==Node.TEXT_NODE)&&(e.textContent="",e.appendChild(document.createTextNode(" ")));const t=e.firstChild;t.textContent===""&&(t.textContent=" ");const n=window.getSelection();if(!n)return;const r=document.createRange();r.setStart(t,1),r.collapse(!0),n.removeAllRanges(),n.addRange(r);const o=e.closest('[contenteditable="true"]');o&&o.focus()},pv=e=>{const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n=null,r;for(;r=t.nextNode();)n=r;return n},EP=(e,t)=>{const n=e.startContainer,r=e.startOffset,o=pv(t);if(!o)return!1;const i=o.textContent?.length??0;return n===o&&r===i},SP=(e,t)=>{try{const n=window.getSelection();if(!n)return!1;const r=document.createRange();return r.setStart(e,t),r.collapse(!0),n.removeAllRanges(),n.addRange(r),!0}catch{return!1}};function hv(e){const t=e.startContainer;return co(t)?t:co(t.parentNode)?t.parentNode:null}function wP(e){const t=e.previousSibling;if(t?.nodeType===Node.ELEMENT_NODE&&t.tagName==="EM-REPLACE")return{em:t,side:"after"};const n=e.nextSibling;return n?.nodeType===Node.ELEMENT_NODE&&n.tagName==="EM-REPLACE"?{em:n,side:"before"}:null}function CP(e){return document.createTreeWalker(e,NodeFilter.SHOW_TEXT).nextNode()}function AP({em:e,side:t}){const n=t==="after"?pv(e):CP(e);if(!n)return;const r=document.createRange();r.setStart(n,t==="after"?Math.max(n.length-1,0):Math.min(1,n.length)),r.collapse(!0),window.getSelection()?.removeAllRanges(),window.getSelection()?.addRange(r)}function TP(e){const t=y=>e.renderOnly(y);let n=null,r=null,o=!1;const i=y=>!!n&&n.em===y.em&&n.side===y.side&&r===(y.side==="after"?"ArrowLeft":"ArrowRight"),s=()=>{const y=window.getSelection();if(o||!y?.rangeCount)return;const E=y.getRangeAt(0),C=ph(E);if(C&&i(C)){n=null,AP(C),nu(document,t);return}if(C){const w=ma(C.em,C.side,t);n=C,nu(document,t,w);return}const k=E.collapsed?hv(E):null;n=k?wP(k):null,nu(document,t,k)},a=()=>{const y=window.getSelection(),E=y?.rangeCount?hv(y.getRangeAt(0)):null;E&&K_(E,t)},l=y=>{y.isComposing||a()},c=()=>{o=!0},u=()=>{o=!1,a()},d=y=>{r=y.key},m=y=>{const E=window.getSelection();E?.rangeCount&&y?.closest?.('[contenteditable="true"]')&&ek(E.getRangeAt(0),t)},p=y=>{y.key?.length===1&&!y.ctrlKey&&!y.metaKey&&!y.altKey&&m(y.target)},f=y=>{y.inputType==="insertCompositionText"&&m(y.target)},h=()=>{r=null};return document.addEventListener("selectionchange",s),document.addEventListener("input",l,!0),document.addEventListener("compositionstart",c,!0),document.addEventListener("compositionend",u,!0),document.addEventListener("keydown",d,!0),document.addEventListener("pointerdown",h,!0),window.addEventListener("keydown",p,!0),window.addEventListener("beforeinput",f,!0),{dispose(){document.removeEventListener("selectionchange",s),document.removeEventListener("input",l,!0),document.removeEventListener("compositionstart",c,!0),document.removeEventListener("compositionend",u,!0),document.removeEventListener("keydown",d,!0),document.removeEventListener("pointerdown",h,!0),window.removeEventListener("keydown",p,!0),window.removeEventListener("beforeinput",f,!0)}}}function Od(){return x.get("commonStyles")}var cl={Thin:"100","Thin Italic":"100i",ExtraLight:"200","ExtraLight Italic":"200i",Light:"300","Light Italic":"300i",Regular:"400","Regular Italic":"400i",Medium:"500","Medium Italic":"500i",SemiBold:"600","SemiBold Italic":"600i",Bold:"700","Bold Italic":"700i",ExtraBold:"800","ExtraBold Italic":"800i",Black:"900","Black Italic":"900i"},_P={"Sans Serif":"sans-serif",Serif:"serif"},gv=":scope > td, :scope > tr > td, :scope > tbody > tr > td";function Po(e){return e.querySelector(gv)}function Vi(e){return Array.from(e.querySelectorAll(gv))}function Pd(e){const t=e.closest('[em="block"]');return t?Po(t)??t.querySelector("td"):null}function bv(e){const t=e.closest('[em="block"]');return!!t&&(e===t||Vi(t).includes(e))}var kP=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},cr=(e,t)=>{kP()},ur=new Map;function LP(e){return ur.get(e.toLowerCase())?.[0]}function Id(e){return ur.get(e.toLowerCase())??[]}function NP(){return ur.size>0}function yv(){return[...ur.values()].map(e=>e[0])}function xP(e){ur=new Map;for(const t of e??[]){const n=t.family.toLowerCase();ur.set(n,[...ur.get(n)??[],t])}return ur}var MP=e=>{const t=xP(e);cr("iframe: project fonts map received",{count:t.size,families:[...t.keys()],entries:e})};function RP(){const e=new Ee;return e.addDisposable(Z.addListener(Pe.SANDBOX_SET_PROJECT_FONTS,MP)),e}var OP={"sans-serif":"Helvetica, Arial, sans-serif",serif:'"Times New Roman", Times, serif'};function vv(e){return e.category==="serif"?"serif":"sans-serif"}function ul(e,t){const n=LP(t);return n?(e.style.fontFamily=OP[vv(n)],!0):!1}var PP=/(?:\/\*\s*em-project-font-[^*]*\*\/\s*)?@font-face\s*\{([^}]*)\}\s*/g,IP=/url\(\s*(['"]?)(.*?)\1\s*\)/,DP=e=>e.trim().replace(/^(['"])(.*)\1$/,"$2");function Dd(e){return Array.from(e.matchAll(PP),t=>{const n=new Map(t[1].split(";").map(r=>r.split(":")).filter(r=>r.length>1).map(([r,...o])=>[r.trim().toLowerCase(),o.join(":").trim()]));return{start:t.index??0,end:(t.index??0)+t[0].length,family:DP(n.get("font-family")??""),src:IP.exec(n.get("src")??"")?.[2]??"",weight:n.get("font-weight")||"400",style:n.get("font-style")||"normal"}})}function Ev(e){return[e.family.toLowerCase(),e.src,e.weight,e.style].join("|")}function Sv(e,t){return[...t].sort((n,r)=>r.start-n.start).reduce((n,r)=>n.slice(0,r.start)+n.slice(r.end),e)}function Bd(){return Et.getInstance(hf)?.()??document.head}function Hd(){return Bd().querySelector('style[em="styles"]')??document.querySelector('style[em="styles"]')}function $e(){if(!Hd()){const e=document.createElement("style");e.setAttribute("em","styles"),Bd().append(e)}}function BP(){const e=Bd(),t=()=>{const r=Hd(),o=Array.from(e.querySelectorAll("style"));return r&&!o.includes(r)?[...o,r]:o};if(!t().length){const r=document.createElement("style"),o=document.querySelector('[em="block"]');if(o){const i=o.offsetWidth;r.innerHTML=`@media only screen and (max-device-width: ${i}px), only screen and (max-width: ${i}px) {}`}e.appendChild(r)}let n=null;for(const r of t()){const o=r.innerHTML.match(/@media.*?max((.|\n|\r)*?){/);if(o){n=o[0];break}}return n===null&&(n="@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {"),n}function dl(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function wv(e){const t=e.elem.getAttribute("class");if(t){const n=t.split(" ");for(const r of n)r.indexOf("em-mob-padding_"+e.position)>-1&&e.elem.classList.remove(r)}}function Fd(e,t){if(!e)return;const{minify:n,cssbeautify:r,HTMLDocument:o}=t;let i=document.head.querySelector('style[em="styles"]'),s="";i?s=o.getInnerHtml(i):(i=document.createElement("style"),i.setAttribute("em","styles"),i=document.head.insertAdjacentElement("beforeend",i));const a=document.createElement("div");a.insertAdjacentHTML("afterbegin",typeof e=="string"?e:e.join(`
70
+ `));let l=n(s+`
71
+ `+[...a.querySelectorAll("style")].map(c=>c.innerHTML).join(`
72
+ `),{restructure:!0,forceMediaMerge:!0}).css;l=r(l,{indent:" ",autosemicolon:!0}),i.textContent=`
73
+ `+l+`
74
+ `}function Io(e){return(e||"").replace(/\s/g,"")}function ml(e,t){return`em-font-${Io(e)}-${Io(t)}`}function Cv(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function $d(e){return ml(e[2]||"",e[3]||"")}var Wd="em-font-custom";function HP(e){return e[1]==="Project Fonts"}function qd(e,t){HP(t)&&e.classList.add(Wd)}function zd(e,t){const n=[...e.classList].filter(r=>r.startsWith(t));n.length>0&&e.classList.remove(...n)}function FP(e,t,n){t.backgroundColor!==void 0&&(t.backgroundColor===""?(e.removeAttribute("bgcolor"),e.style.removeProperty("background-color"),document.body.style.removeProperty("background-color"),n&&(n.style.color="transparent")):(document.body.style.backgroundColor=t.backgroundColor,e.setAttribute("bgcolor",t.backgroundColor),e.style.backgroundColor=t.backgroundColor,n&&(n.style.color=t.backgroundColor),e.closest(".full-wrap")&&e.closest("body")?.setAttribute("bgcolor",t.backgroundColor))),t.backgroundImage&&(t.backgroundColor===""?(e.style.removeProperty("background-image"),e.removeAttribute("background")):(e.style.removeProperty("background-image"),e.style.backgroundImage=t.backgroundImage[0].type+"("+t.backgroundImage[0].value+")",Tt(e,"background",t.backgroundImage[0].value))),t.backgroundPositionX&&(t.backgroundPositionX==="none"?e.style.removeProperty("background-position-x"):e.style.backgroundPositionX=t.backgroundPositionX!=="initial"?t.backgroundPositionX:""),t.backgroundPositionY&&(t.backgroundPositionY==="none"?e.style.removeProperty("background-position-y"):e.style.backgroundPositionY=t.backgroundPositionY!=="initial"?t.backgroundPositionY:""),t.backgroundRepeat&&(t.backgroundRepeat==="none"?e.style.removeProperty("background-repeat"):e.style.backgroundRepeat=t.backgroundRepeat),t.backgroundSize!==void 0&&(t.backgroundSize===""?e.style.removeProperty("background-size"):e.style.backgroundSize=t.backgroundSize)}function fl(e){const t={all:{width:null,style:null,color:null},top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}};if(parseInt(e.style.border)||parseInt(e.style.borderTop)||parseInt(e.style.borderRight)||parseInt(e.style.borderBottom)||parseInt(e.style.borderLeft)||parseInt(e.style.borderTopWidth)||parseInt(e.style.borderRightWidth)||parseInt(e.style.borderBottomWidth)||parseInt(e.style.borderLeftWidth)||e.style.borderStyle||e.style.borderTopStyle||e.style.borderRightStyle||e.style.borderBottomStyle||e.style.borderLeftStyle||e.style.borderColor||e.style.borderTopColor||e.style.borderRightColor||e.style.borderBottomColor||e.style.borderLeftColor)if(e.style.border){const n=e.style.border.split(" "),r=parseInt(n[0]),o=n[1]||null,i=X(n[2]+n[3]+n[4])||null;t.all={width:r,style:o,color:i},t.top={width:r,style:o,color:i},t.right={width:r,style:o,color:i},t.bottom={width:r,style:o,color:i},t.left={width:r,style:o,color:i}}else if((e.style.borderWidth||e.style.borderStyle||e.style.borderColor)&&e.style.borderWidth.indexOf(" ")===-1&&e.style.borderStyle.indexOf(" ")===-1&&(!e.style.borderColor||(X(e.style.borderColor)||"").indexOf(" ")===-1))e.style.borderWidth&&e.style.borderWidth.indexOf(" ")===-1&&(t.all.width=parseInt(e.style.borderWidth)),e.style.borderStyle&&(t.all.style=e.style.borderStyle),e.style.borderColor&&(t.all.color=X(e.style.borderColor)||null);else{if(e.style.borderTop){const n=e.style.borderTop.split(" ");t.top.width=parseInt(n[0]),t.top.style=n[1]||null,t.top.color=X(n[2]+n[3]+n[4])||null}else e.style.borderTopWidth&&(t.top.width=parseInt(e.style.borderTopWidth)),e.style.borderTopStyle&&(t.top.style=e.style.borderTopStyle),e.style.borderTopColor&&(t.top.color=X(e.style.borderTopColor)||null);if(e.style.borderRight){const n=e.style.borderRight.split(" ");t.right.width=parseInt(n[0]),t.right.style=n[1]||null,t.right.color=X(n[2]+n[3]+n[4])||null}else e.style.borderRightWidth&&(t.right.width=parseInt(e.style.borderRightWidth)),e.style.borderRightStyle&&(t.right.style=e.style.borderRightStyle),e.style.borderRightColor&&(t.right.color=X(e.style.borderRightColor)||null);if(e.style.borderBottom){const n=e.style.borderBottom.split(" ");t.bottom.width=parseInt(n[0]),t.bottom.style=n[1]||null,t.bottom.color=X(n[2]+n[3]+n[4])||null}else e.style.borderBottomWidth&&(t.bottom.width=parseInt(e.style.borderBottomWidth)),e.style.borderBottomStyle&&(t.bottom.style=e.style.borderBottomStyle),e.style.borderBottomColor&&(t.bottom.color=X(e.style.borderBottomColor)||null);if(e.style.borderLeft){const n=e.style.borderLeft.split(" ");t.left.width=parseInt(n[0]),t.left.style=n[1]||null,t.left.color=X(n[2]+n[3]+n[4])||null}else e.style.borderLeftWidth&&(t.left.width=parseInt(e.style.borderLeftWidth)),e.style.borderLeftStyle&&(t.left.style=e.style.borderLeftStyle),e.style.borderLeftColor&&(t.left.color=X(e.style.borderLeftColor)||null)}return t}function Ui(e){const t={all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null};return(e.style.borderRadius||e.style.borderTopLeftRadius||e.style.borderTopRightRadius||e.style.borderBottomRightRadius||e.style.borderBottomLeftRadius)&&(!e.style.borderRadius||e.style.borderRadius.indexOf(" ")>-1?t.all=null:t.all=parseFloat(e.style.borderRadius),t.topLeft=e.style.borderTopLeftRadius?parseFloat(e.style.borderTopLeftRadius):null,t.topRight=e.style.borderTopRightRadius?parseFloat(e.style.borderTopRightRadius):null,t.bottomRight=e.style.borderBottomRightRadius?parseFloat(e.style.borderBottomRightRadius):null,t.bottomLeft=e.style.borderBottomLeftRadius?parseFloat(e.style.borderBottomLeftRadius):null),t}function ji(e){let t=null;if(e.style.boxShadow){const n=e.style.boxShadow.match(/[^\s\(]+(\(.+\))?/g);n&&(t={hOffset:n[1]?parseFloat(n[1]):null,vOffset:n[2]?parseFloat(n[2]):null,blurRadius:n[3]&&n[3]!=="inset"?parseFloat(n[3]):null,spreadRadius:n[4]&&n[4]!=="inset"?parseFloat(n[4]):null,color:n[0]&&X(n[0])||"",inset:n[3]==="inset"||n[4]==="inset"||n[5]==="inset"})}return t}function Av(e){if(!e)return null;const t=e.style;if(t.border&&parseInt(t.borderWidth||t.border)>0)return"all";const n=!!(t.borderTop||t.borderTopWidth&&parseInt(t.borderTopWidth)>0),r=!!(t.borderRight||t.borderRightWidth&&parseInt(t.borderRightWidth)>0),o=!!(t.borderBottom||t.borderBottomWidth&&parseInt(t.borderBottomWidth)>0),i=!!(t.borderLeft||t.borderLeftWidth&&parseInt(t.borderLeftWidth)>0);return n&&r&&o&&i?"all":n&&!r&&!o&&!i?"top":!n&&r&&!o&&!i?"right":!n&&!r&&o&&!i?"bottom":!n&&!r&&!o&&i?"left":n?"top":r?"right":o?"bottom":i?"left":null}function Pt(e){return e==null||e===""}function Vd(e){const{elem:t,settings:n}=e,{border:r}=n;r&&(r.all?!Pt(r.all.width)&&(r.all.style||r.all.color)?(t.style.borderWidth=r.all.width+"px",r.all.style&&(t.style.borderStyle=r.all.style),r.all.color&&(t.style.borderColor=r.all.color)):t.style.removeProperty("border"):(r.top&&(!Pt(r.top.width)&&(r.top.style||r.top.color)?(t.style.borderTopWidth=r.top.width+"px",r.top.style&&(t.style.borderTopStyle=r.top.style),r.top.color&&(t.style.borderTopColor=r.top.color)):t.style.removeProperty("border-top")),r.right&&(!Pt(r.right.width)&&(r.right.style||r.right.color)?(t.style.borderRightWidth=r.right.width+"px",r.right.style&&(t.style.borderRightStyle=r.right.style),r.right.color&&(t.style.borderRightColor=r.right.color)):t.style.removeProperty("border-right")),r.bottom&&(!Pt(r.bottom.width)&&(r.bottom.style||r.bottom.color)?(t.style.borderBottomWidth=r.bottom.width+"px",r.bottom.style&&(t.style.borderBottomStyle=r.bottom.style),r.bottom.color&&(t.style.borderBottomColor=r.bottom.color)):t.style.removeProperty("border-bottom")),r.left&&(!Pt(r.left.width)&&(r.left.style||r.left.color)?(t.style.borderLeftWidth=r.left.width+"px",r.left.style&&(t.style.borderLeftStyle=r.left.style),r.left.color&&(t.style.borderLeftColor=r.left.color)):t.style.removeProperty("border-left"))))}function $P(e){const{elem:t,settings:n}=e,{boxShadow:r}=n;if(r)if(!Pt(r.hOffset)&&!Pt(r.vOffset)){let o="";o=r.inset?"inset ":"",o+=r.hOffset+"px ",o+=r.vOffset+"px ",o+=Pt(r.blurRadius)?"":r.blurRadius+"px ",o+=Pt(r.spreadRadius)?"":r.spreadRadius+"px ",o+=r.color?r.color:"",t.style.boxShadow=o}else t.style.removeProperty("box-shadow")}function Gi(e){const{elem:t,settings:n}=e,{borderRadius:r}=n;r&&(r.all?t.style.borderRadius=r.all+"px":(Pt(r.topLeft)?t.style.removeProperty("border-top-left-radius"):t.style.borderTopLeftRadius=r.topLeft+"px",Pt(r.topRight)?t.style.removeProperty("border-top-right-radius"):t.style.borderTopRightRadius=r.topRight+"px",Pt(r.bottomRight)?t.style.removeProperty("border-bottom-right-radius"):t.style.borderBottomRightRadius=r.bottomRight+"px",Pt(r.bottomLeft)?t.style.removeProperty("border-bottom-left-radius"):t.style.borderBottomLeftRadius=r.bottomLeft+"px"))}function Tv(e){let t="";if(e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.includes("[if mso]")){const n=e.nodeValue.replace(/^\[if mso\]>/i,"").replace(/<!\[endif\]$/i,"").trim();t+=n}return e.childNodes.forEach(n=>{t+=Tv(n)}),t}function _v(e,t,n={value:0}){e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.includes("[if mso]")&&(n.value===0?e.nodeValue=`[if mso]>${t}<![endif]`:e.nodeValue="",n.value++),e.childNodes.forEach(r=>_v(r,t,n))}function WP(e){return e?e.backgroundImage!==void 0||e.backgroundColor!==void 0||e.backgroundSize!==void 0||e.backgroundRepeat!==void 0||e.width!==void 0||e.height!==void 0:!1}var kv=/\[if[^\]]*mso[^\]]*\]/i,Lv="[if gte mso 9]></v:textbox></v:rect><![endif]";function qP(e){const t=e.style.backgroundImage;if(t&&t!=="none"){const n=t.match(/url\(["']?([^"')]+)["']?\)/i);if(n)return n[1]}return e.getAttribute("background")||e.getAttribute("data-bg-image")||""}function zP(e){return(e.style.backgroundRepeat||"").trim().toLowerCase().startsWith("repeat")?"tile":"frame"}function VP(e){const t=Math.round(e.getBoundingClientRect().width);if(t)return t;const n=(e.getAttribute("width")||"").trim();return n&&!n.includes("%")&&parseInt(n,10)||0}function UP(e){const t=VP(e),n=Et.getInstance(gf);return n?n(e,t):t}function jP(e,t,n,r){const o=t?` color="${t}"`:"";return`[if gte mso 9]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="${r?`width:${r}px;`:"mso-width-percent:1000;"}"><v:fill type="${n}" src="${e}"${o} /><v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0"><![endif]`}function Nv(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function Xi(e){if(!Nv(e))return!1;const t=e.nodeValue||"";return kv.test(t)&&/src\s*=/i.test(t)&&/v:(fill|image|rect)/i.test(t)}function Ud(e){if(!Nv(e))return!1;const t=e.nodeValue||"";return kv.test(t)&&/<\/v:(rect|image|textbox)>/i.test(t)&&!/src\s*=/i.test(t)}function jd(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function xv(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function Mv(e){for(const t of Array.from(e.childNodes))(Xi(t)||Ud(t))&&e.removeChild(t)}function Yi(e,t="inside"){return t==="around"?Xi(jd(e)):Array.from(e.childNodes).some(n=>Xi(n))}function Rv(e,t="inside"){if(t==="around"){const n=e.parentNode;if(!n)return;const r=jd(e),o=xv(e);Xi(r)&&n.removeChild(r),Ud(o)&&n.removeChild(o);return}Mv(e)}function Ov(e,t="inside"){const n=qP(e);if(!n){Rv(e,t);return}const r=jP(n,(e.style.backgroundColor||e.getAttribute("bgcolor")||"").trim(),zP(e),UP(e)),o=e.ownerDocument;if(o){if(t==="around"){const i=e.parentNode;if(!i)return;const s=jd(e);Xi(s)&&i.removeChild(s);const a=xv(e);Ud(a)&&i.removeChild(a),i.insertBefore(o.createComment(r),e),i.insertBefore(o.createComment(Lv),e.nextSibling);return}Mv(e),e.insertBefore(o.createComment(r),e.firstChild),e.appendChild(o.createComment(Lv))}}function Ki(e,t,n="inside"){t?.outlookBackground===!0?Ov(e,n):t?.outlookBackground===!1?Rv(e,n):Yi(e,n)&&WP(t)&&Ov(e,n)}var Gd=/v:roundrect/i,Xd=/\[if\s*!\s*mso\]/i,Pv=/^\s*<!\[endif\]\s*$/i,Yd=["background-color","border-radius","border","border-top","border-right","border-bottom","border-left","border-color","border-style","border-width","box-shadow"],GP=[...Yd,"padding","padding-top","padding-right","padding-bottom","padding-left","color","font-family","font-size","font-weight","font-style","text-align","line-height","letter-spacing","width"];function Do(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function Kd(e){const t=[],n=r=>{r.childNodes.forEach(o=>{Do(o)&&Gd.test(o.nodeValue||"")&&t.push(o),n(o)})};return n(e),t}function Iv(e,t){const n=dr(e);if(!n)return!1;const r=n.nodeValue||"";if(!/<center\b[^>]*>[\s\S]*?<\/center>/i.test(r))return!1;const o=Bv((t||"").replace(/\s+/g," ").trim());return n.nodeValue=r.replace(/(<center\b[^>]*>)[\s\S]*?(<\/center>)/i,(i,s,a)=>`${s}${o}${a}`),!0}function dr(e){for(const t of Array.from(e.childNodes)){if(Do(t)&&Gd.test(t.nodeValue||""))return t;const n=dr(t);if(n)return n}return null}function Dv(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function XP(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function kn(e){const t=parseInt(String(e??""),10);return Number.isFinite(t)?t:0}function YP(e,t){const n=(e.textContent||"").replace(/\s+/g," ").trim();if(n)return n;for(const r of t){const o=(r.nodeValue||"").match(/<center[^>]*>([\s\S]*?)<\/center>/i);if(o)return o[1].replace(/\s+/g," ").trim()}return""}function Bv(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function KP(e,t){const n=e.getAttribute("bgcolor");n&&(t.style.backgroundColor||(t.style.backgroundColor=n),e.removeAttribute("bgcolor"));for(const r of Yd){const o=e.style.getPropertyValue(r);o&&(t.style.setProperty(r,o,e.style.getPropertyPriority(r)),e.style.removeProperty(r))}t.style.display||(t.style.display="block")}function ZP(e,t){const n=t.getAttribute("bgcolor");n&&(!e.style.backgroundColor&&!e.getAttribute("bgcolor")&&(e.style.backgroundColor=n),t.removeAttribute("bgcolor"));for(const r of Yd){const o=t.style.getPropertyValue(r);o&&(e.style.getPropertyValue(r)||e.style.setProperty(r,o,t.style.getPropertyPriority(r)),t.style.removeProperty(r))}}function QP(e){const t=e.style.display;return t!=="inline-block"&&t!=="block"?!1:!!(e.style.backgroundColor||e.style.borderRadius)}function Zd(e){if(!e)return null;for(const t of Array.from(e.querySelectorAll("[style]")))if(QP(t))return t;return null}function Qd(e){return e?!!Zd(e)||!!dr(e):!1}function JP(e,t){for(const n of GP){const r=e.style.getPropertyValue(n);r&&!t.style.getPropertyValue(n)&&t.style.setProperty(n,r,e.style.getPropertyPriority(n))}t.style.display||(t.style.display="block")}function e4(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function Hv(e,t){const n=Zd(t);return n?(JP(n,t),e4(n),Kd(t).forEach(r=>r.parentNode?.removeChild(r)),Jd(t),!0):!1}function t4(e){for(const t of e){const n=t.nodeValue||"";if(!Gd.test(n))continue;const r=/<v:roundrect[^>]*\bstyle="([^"]*)"/i.exec(n),o=r?r[1]:"",i=/width:\s*(\d+)\s*px/i.exec(o),s=/height:\s*(\d+)\s*px/i.exec(o),a=/arcsize="(\d+)%?"/i.exec(n);return{width:i?kn(i[1]):0,height:s?kn(s[1]):0,arcsize:a?kn(a[1]):0}}return{width:0,height:0,arcsize:0}}function n4(e){const t=e.style;let n=t.borderWidth||t.borderTopWidth||"",r=t.borderStyle||t.borderTopStyle||"",o=t.borderColor||t.borderTopColor||"";if((!n||!r)&&t.border){const a=t.border.trim().split(/\s+/);n||(n=a[0]||""),r||(r=a[1]||""),o||(o=a.slice(2).join(" ")||"")}if(!r||r==="none")return null;const i=parseFloat(n);if(!Number.isFinite(i)||i<=0)return null;const s=r==="dashed"?"dash":r==="dotted"?"dot":"";return{color:X(o)||o||"#000000",weight:`${i}px`,dash:s}}var r4=new Set(["bold","bolder","600","700","800","900"]);function o4(e){const t={bold:!1,italic:!1,underline:!1,strikethrough:!1};e.querySelector("b, strong")&&(t.bold=!0),e.querySelector("i, em")&&(t.italic=!0),e.querySelector("u")&&(t.underline=!0),e.querySelector("s, strike")&&(t.strikethrough=!0);const n=[e,...Array.from(e.querySelectorAll("*"))];for(const r of n){const o=r.style;if(!o)continue;const i=(o.fontWeight||"").toLowerCase();i&&r4.has(i)&&(t.bold=!0),o.fontStyle==="italic"&&(t.italic=!0);const s=o.textDecoration||o.textDecorationLine||"";s.includes("underline")&&(t.underline=!0),s.includes("line-through")&&(t.strikethrough=!0)}return t}function i4(e){const t=[e.height?`height:${e.height}px`:"","v-text-anchor:middle",e.width?`width:${e.width}px`:""].filter(Boolean),n=[e.underline?"underline":"",e.strikethrough?"line-through":""].filter(Boolean).join(" "),r=[e.color?`color:${e.color}`:"",e.fontFamily?`font-family:${e.fontFamily}`:"",e.fontSize?`font-size:${e.fontSize}`:"",e.bold?"font-weight:bold":"",e.italic?"font-style:italic":"",n?`text-decoration:${n}`:""].filter(Boolean),o=!!e.strokeColor&&!!e.strokeWeight,i=o?`stroke="t" strokecolor="${e.strokeColor}" strokeweight="${e.strokeWeight}"`:'stroke="f"',s=o&&e.strokeDash?`<v:stroke dashstyle="${e.strokeDash}"/>`:"",a=u=>u.replace(/"/g,"'"),l=a(`${t.join(";")};`),c=a(`${r.join(";")}${r.length?";":""}`);return`[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${a(e.href)}" style="${l}" arcsize="${e.arcsize}%" ${i} fillcolor="${e.fillcolor||"none"}"><w:anchorlock/>`+s+`<center style="${c}">${Bv(e.label)}</center></v:roundrect><![endif]`}function Jd(e){const t=[],n=r=>{r.childNodes.forEach(o=>{if(Do(o)){const i=o.nodeValue||"";(Xd.test(i)||Pv.test(i))&&t.push(o)}n(o)})};n(e),t.forEach(r=>r.parentNode?.removeChild(r))}function s4(e){const t=e.closest("td");if(!t)return;const n=e.closest("a")||t.querySelector("a");n&&Hv(t,n),Kd(t).forEach(r=>r.parentNode?.removeChild(r)),Jd(t),n&&ZP(t,n)}function a4(e){const t=e.ownerDocument;if(!t)return;const n=e.parentNode;if(!n)return;const r=Dv(e);Do(r)&&Xd.test(r.nodeValue||"")||n.insertBefore(t.createComment("[if !mso]><!"),e);const o=XP(e);Do(o)&&Pv.test(o.nodeValue||"")||n.insertBefore(t.createComment("<![endif]"),e.nextSibling)}function l4(e,t){return e?.backgroundColor!==void 0?e.backgroundColor===""?"none":e.backgroundColor:t.style.backgroundColor||t.getAttribute("bgcolor")||"none"}function c4(e,t){if(t?.width?.value&&t.width.dim==="px")return kn(t.width.value);const n=e?.getAttribute("width")||"";return n&&!n.includes("%")?kn(n):0}function u4(e,t){if(t?.height?.value&&t.height.dim==="px")return kn(t.height.value);const n=e.getAttribute("height")||"";return n&&!n.includes("%")?kn(n):kn(e.style.height)}function d4(e,t){return e?.borderRadius&&e.borderRadius.all!=null?kn(e.borderRadius.all):kn(t.style.borderRadius)}function m4(e,t,n){const r=[t,n].filter(i=>i>0);if(!r.length||e<=0)return 0;const o=Math.min(...r);return Math.max(0,Math.min(100,Math.round(e/o*100)))}function em(e,t){const n=e.closest("td");if(!n)return;const r=e.closest("a")||n.querySelector("a");if(!r)return;const o=Kd(n),i=YP(r,o),s=t4(o);Hv(n,r),KP(n,r),o.forEach(E=>E.parentNode?.removeChild(E)),Jd(n);const a=c4(n.closest("table"),t)||s.width,l=u4(n,t)||s.height,c=d4(t,r),u=o4(r),d=n4(r),m=m4(c,a,l)||s.arcsize,p={href:t?.href!==void 0?t.href:r.getAttribute("href")||"",fillcolor:l4(t,r),width:a,height:l,arcsize:m,label:i,color:r.style.color||"",fontFamily:r.style.fontFamily||"",fontSize:r.style.fontSize||"",bold:u.bold,italic:u.italic,underline:u.underline,strikethrough:u.strikethrough,strokeColor:d?.color||"",strokeWeight:d?.weight||"",strokeDash:d?.dash||""};a4(r);const f=n.ownerDocument;if(!f)return;const h=Dv(r),y=f.createComment(i4(p));Do(h)&&Xd.test(h.nodeValue||"")&&h.parentNode?h.parentNode.insertBefore(y,h):n.insertBefore(y,n.firstChild)}function pl(e,t){return e.replace(/(^|[;\s])color:\s*[^;]*;?/i,`$1color: ${t};`)}function Ln(e){return typeof e=="number"&&Number.isFinite(e)}function f4(e){return!e||typeof e!="object"?!1:Ln(e.all)||Ln(e.top)||Ln(e.right)||Ln(e.bottom)||Ln(e.left)}function p4(e,t){const n=Ln(t.all)?t.all:void 0,r=Ln(t.top)?t.top:n,o=Ln(t.right)?t.right:n,i=Ln(t.bottom)?t.bottom:n,s=Ln(t.left)?t.left:n;r!==void 0&&(e.style.paddingTop=`${r}px`),o!==void 0&&(e.style.paddingRight=`${o}px`),i!==void 0&&(e.style.paddingBottom=`${i}px`),s!==void 0&&(e.style.paddingLeft=`${s}px`)}function Fv(e,t){return Array.from(document.querySelectorAll("link[em-class]")).some(n=>n.getAttribute("em-class")===e&&(t===void 0||n.getAttribute("href")===t))}function $v(e){const t=document.querySelector("title");if(t){t.insertAdjacentElement("afterend",e);return}document.head.appendChild(e)}function Wv(e){return e.stylesheet??Hw(e.source_url)}function h4(e){return`/* ${`em-project-font-${Io(e.family)}-${e.weight}-${e.style}`} */
75
+ @font-face{font-family:${JSON.stringify(e.family)};src:url(${JSON.stringify(e.source_url)});font-weight:${e.weight};font-style:${e.style};font-display:swap;}`}var g4=e=>Ev({family:e.family,src:e.source_url,weight:e.weight,style:e.style});function b4(e,t){if(Fv(t,e))return;const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.setAttribute("em-class",t),$v(n)}function Zi(e,t){const n=e.fontFamilyArray[1],r=e.fontFamilyArray[2],o=e.fontFamilyArray[3],i=ml(r,o);if(n==="Project Fonts"){const d=Id(r),m=d[0];if(cr("iframe: addFontFamilyClass Project Fonts",{fontFamilyArray:e.fontFamilyArray,emClass:i,entryFound:!!m,faces:d}),m){$e();const p=document.querySelector('style[em="styles"]'),f=[...new Set(d.filter(Wv).map(h=>h.source_url))];if(f.forEach(h=>b4(h,i)),p){const h=new Set(Dd(p.textContent??"").map(Ev)),y=d.filter(w=>!Wv(w)).filter(w=>!h.has(g4(w))).map(h4).join(`
76
+ `),E=y!=="";E&&p.insertAdjacentHTML("afterbegin",`${y}
77
+ `);const C=`.${Cv(i)} {`,k=!p.textContent?.includes(C);if(k){const w=cl[o],b=(w||m.weight).replace(/i$/g,""),v=w?w.endsWith("i"):m.style!=="normal";let A=`font-family: ${JSON.stringify(m.family)}, ${vv(m)}!important;`;A+=` font-weight: ${b}!important;`,v&&(A+=" font-style: italic!important;"),p.insertAdjacentHTML("beforeend",`
78
+ ${C} ${A} }`)}cr("iframe: project font attached",{emClass:i,stylesheetUrls:f,faceInserted:E,classInserted:k})}else cr("iframe: style[em=styles] not found — @font-face not injected");setTimeout(()=>{Mr({elem:document.documentElement},t),mr(t),t&&t(!1)},0);return}cr("iframe: Project Fonts entry missing in map — skip Google Fonts fallback",{fontFamily:r,mapSize:document.querySelectorAll('style[em="styles"]').length}),setTimeout(()=>{Mr({elem:document.documentElement},t),mr(t)},0);return}if(!Fv(i)){const d=document.createElement("link");d.setAttribute("rel","stylesheet");const m=cl[o]||"400",p=m.indexOf("i")>-1,f=m.replaceAll("i","");d.setAttribute("href",`https://fonts.googleapis.com/css2?family=${r}:ital,wght@${p?"1":"0"},${f}&display=swap`),d.setAttribute("em-class",i),$v(d)}$e();const s=cl[o]||"400",a=s.replaceAll("i",""),l=s.indexOf("i")>-1;let c=`font-family: '${r}', ${_P[n]||"sans-serif"}!important;`;c+=` font-weight: ${a}!important;`,l&&(c+=" font-style: italic!important;");const u=document.querySelector('style[em="styles"]');u&&u.insertAdjacentHTML("beforeend",`
79
+ .${Cv(i)} { ${c} }`),setTimeout(()=>{Mr({elem:document.documentElement},t),mr(t)},0)}function y4(e){const t=Io(e);return!!document.querySelector(`[class*="em-font-${t}-"], [class*="em-font-${t.toLowerCase()}-"]`)}function mr(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=Dd(n).filter(o=>Id(o.family).length>0&&!y4(o.family));!t||r.length===0||(t.textContent=Sv(n,r),cr("iframe: clearProjectFontFaces removed stale @font-face",{removedFamilies:[...new Set(r.map(o=>o.family))]}),e&&e(!1))}function Mr(e,t){let n=!1;e.elem.querySelectorAll("link[em-class]").forEach(r=>{const o=r.getAttribute("em-class");o&&!document.querySelector("."+o)&&(n=!0,r.remove())}),n&&t&&t(!1)}function tm(e,t,n){t[0]==="Safe Fonts"?(e.style.fontFamily=t[1],Mr({elem:document.documentElement},n),mr(n)):t[0]==="Google Fonts"&&(t[1]==="Sans Serif"?e.style.fontFamily="Helvetica, Arial, sans-serif":t[1]==="Serif"?e.style.fontFamily='"Times New Roman", Times, serif':t[1]==="Project Fonts"&&ul(e,t[2]),e.classList.remove(...[...e.classList].filter(r=>r.startsWith("em-font"))),e.classList.add(ml(t[2],t[3])),Zi({fontFamilyArray:t},n))}function qv(e,t){if(t){const n=e.querySelector("b");n?n.replaceWith(...n.childNodes):e.querySelector("strong")||(e.innerHTML="<strong>"+e.innerHTML+"</strong>")}else{const n=e.querySelector("strong"),r=e.querySelector("b");n?n.replaceWith(...n.childNodes):r&&r.replaceWith(...r.childNodes)}if(e.style.fontWeight){const n=e.getAttribute("style")?.replace(/(\s+)?font-weight:(\s+)?(bold|[0-9]*)(;)?/,"")||"";e.setAttribute("style",n)}}function zv(e,t){if(t){const n=e.querySelector("i");n?n.replaceWith(...n.childNodes):e.querySelector("em")||(e.innerHTML="<em>"+e.innerHTML+"</em>")}else{const n=e.querySelector("em"),r=e.querySelector("i");n?n.replaceWith(...n.childNodes):r&&r.replaceWith(...r.childNodes)}if(e.style.fontStyle){const n=e.getAttribute("style")?.replace(/(\s+)?font-style:(\s+)?.*?;/,"")||"";e.setAttribute("style",n)}}function Vv(e,t){let n;t>0?n=e.style.letterSpacing?e.getAttribute("style").replace(/letter-spacing:(\s+)?.*?px/,`letter-spacing: ${t}px`):e.getAttribute("style")+` letter-spacing: ${t}px;`:n=e.getAttribute("style")?.replace(/(\s+)?letter-spacing:(\s+)?.*?px(;)?/,"")||"",e.setAttribute("style",n)}function Qi(e,t){e&&e.tagName==="TABLE"&&(e.classList.contains("em-vindent-table")||e.querySelector("td")?.innerHTML==="")&&e.querySelector("td")?.setAttribute("height",String(t))}function Uv(e,t){const n=Od(),r=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");return r.replaceChildren(...Te(e.html)),r.querySelectorAll('[em="atom"] div[style*="font-family"]').forEach(o=>{const i=o;if(!i.style.display&&parseFloat(i.style.fontSize)<=20){const s=n.text?.fontFamily||[],a=pl((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.text?.fontSize||16}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${n.text?.lineHeight||24}px`),n.text?.color||"#000000");i.setAttribute("style",a),tm(i,s,t);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingBottom?l.style.paddingBottom=(n.text?.paddingBottom||0)+"px":Qi(i.nextElementSibling??i.closest("table")?.nextElementSibling,n.text?.paddingBottom||0)}else if(!i.style.display&&parseFloat(i.style.fontSize)>20){const s=n.headings?.fontFamily||[],a=pl((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.headings?.fontSize||24}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${n.headings?.lineHeight||32}px`),n.headings?.color||"#000000");i.setAttribute("style",a),tm(i,s,t),Vv(i,n.headings?.letterSpacing||0),qv(i,n.headings?.bold||!1),zv(i,n.headings?.italic||!1);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingTop?l.style.paddingTop=(n.headings?.paddingTop||0)+"px":Qi(i.previousElementSibling,n.headings?.paddingTop||0),l?.style.paddingBottom?l.style.paddingBottom=(n.headings?.paddingBottom||0)+"px":Qi(i.nextElementSibling,n.headings?.paddingBottom||0)}}),r.querySelectorAll('[em="atom"] a[style*="color"]').forEach(o=>{const i=o;if(i.style.display){if(i.style.display==="block"){const s=n.buttons?.fontFamily||[],a=pl((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.buttons?.fontSize||16}px`),n.buttons?.color||"#FFFFFF");i.setAttribute("style",a),tm(i,s,t);const l=i.closest("td"),c=!!l&&!!dr(l)&&!dr(i),u=c?i:l,d=n.buttons?.backgroundColor||"#1677FF";u&&(u.style.backgroundColor=d,u.tagName==="TD"&&u.setAttribute("bgcolor",d)),l&&l.setAttribute("align",n.buttons?.textAlign||"center"),Vv(i,n.buttons?.letterSpacing||0),qv(i,n.buttons?.bold||!1),zv(i,n.buttons?.italic||!1);const m=i.closest('[em="atom"] > tr > td'),p=i.closest("table");m?.style.paddingTop?m.style.paddingTop=(n.buttons?.marginTop||0)+"px":p?.previousElementSibling&&Qi(p.previousElementSibling,n.buttons?.marginTop||0),m?.style.paddingBottom?m.style.paddingBottom=(n.buttons?.marginBottom||0)+"px":p?.nextElementSibling&&Qi(p.nextElementSibling,n.buttons?.marginBottom||0);const f=n.buttons?.padding||{};f.all&&(i.style.padding=f.all+"px"),f.top&&(i.style.paddingTop=f.top+"px"),f.right&&(i.style.paddingRight=f.right+"px"),f.bottom&&(i.style.paddingBottom=f.bottom+"px"),f.left&&(i.style.paddingLeft=f.left+"px"),u&&(n.buttons?.border&&Vd({settings:{border:n.buttons.border},elem:u}),n.buttons?.borderRadius&&Gi({settings:{borderRadius:n.buttons.borderRadius},elem:u})),c&&em(i,{backgroundColor:d})}}else{const s=pl(i.getAttribute("style"),n.links?.color||"#0000FF");i.setAttribute("style",s);let a;n.links?.underline?a=i.style.textDecoration?i.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: underline;"):i.getAttribute("style")+" text-decoration: underline;":a=i.style.textDecoration?i.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: none;"):i.getAttribute("style")+" text-decoration: none;",i.setAttribute("style",a)}}),r.querySelector('[em="block"]')&&n.block?.backgroundColor&&r.querySelectorAll('[em="block"]').forEach(o=>{Vi(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",n.block.backgroundColor),s.style.backgroundColor=n.block.backgroundColor})}),r.tagName==="DIV"?Ct(r):Ct(r.querySelector("tbody")||r)}function nm(e){const t=Od(),n=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Te(e.html)),n.querySelector('[em="block"]')&&t.block?.backgroundColor&&n.querySelectorAll('[em="block"]').forEach(o=>{Vi(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",t.block.backgroundColor),s.style.backgroundColor=t.block.backgroundColor})});const r=t.block?.padding;return f4(r)&&Array.from(n.querySelectorAll('[em="block"]')).flatMap(Vi).forEach(o=>{p4(o,r)}),n.tagName==="DIV"?Ct(n):Ct(n.querySelector("tbody")||n)}var v4=e=>{for(const t of Object.keys(cl))if(Io(t)===e)return t;return e};function E4(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=new Set(Id(e).filter(i=>i.stylesheet).map(i=>i.source_url)),o=Dd(n).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&r.has(i.src));t&&o.length&&(t.textContent=Sv(n,o),cr("iframe: dropped stylesheet @font-face",{family:e,count:o.length}))}function S4(e){if(!NP())return;const t=document.head.innerHTML,n=new Set;for(const r of yv()){E4(r.family);const o=`em-font-${Io(r.family)}-`;document.querySelectorAll(`[class*="${o}"]`).forEach(i=>{[...i.classList].forEach(s=>{if(!s.startsWith(o)||n.has(s))return;n.add(s);const a=s.slice(o.length),l=v4(a);Zi({fontFamilyArray:["Google Fonts","Project Fonts",r.family,l]})})})}n.size>0&&cr("iframe: hydrated project @font-face from DOM classes",{classes:[...n],families:yv().map(r=>r.family)}),mr(),e&&document.head.innerHTML!==t&&e(!1)}function w4(e,t){const n=new Ee,r=()=>{requestAnimationFrame(()=>{S4(t)})};return n.addDisposable(Z.addListener(Pe.SANDBOX_SET_PROJECT_FONTS,r)),n.addDisposable(e.onReady(r)),n}function jv(){Z.send({operation:"sandbox_resized"})}function C4(e,t){const n=new Ee,r=0;let o=0;n.addDisposable(t.beforeSave(()=>{o&&(clearTimeout(o),o=0)}));function i(){o||(o=setTimeout(()=>{jv(),o=0},r))}return n.addDisposable(e.onChange(s=>{const a=s.flatMap(function(l){return l.added.flatMap(c=>{if(vn(c))return z0(c)?c:[...c.querySelectorAll("img")]})}).filter(l=>!!l).map(l=>l.complete?Promise.resolve():new Promise((c,u)=>{l.addEventListener("load",c),l.addEventListener("error",c)}));a.length&&Promise.all(a).then(i)})),window.addEventListener("resize",i),n.addDispose(()=>window.removeEventListener("resize",i)),n}function A4(e=document,t=window){let n=e.body;const r=new MutationObserver(()=>{if(o(),e.body===n)return;n=e.body;const i=t.parentIFrame;i?.autoResize&&(i.autoResize(!1),i.autoResize(!0),i.size?.())});function o(){r.disconnect(),r.observe(e,{childList:!0}),e.documentElement&&r.observe(e.documentElement,{childList:!0})}return o(),{dispose:()=>r.disconnect()}}var T4=/^(?:ant|vscode|monaco|docs)-/;function _4(e){return T4.test(e)}function k4(){const e="em".trim();if(!/^[a-z][a-z0-9]*$/i.test(e))throw new Error(`[cssVars] REACT_APP_CSS_VAR_PREFIX="${e}" is not a valid CSS identifier fragment.`);return e}var L4=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function N4(){return L4}var x4=new Set;function M4(e,t,n=x4){return e.startsWith(`${t}-`)?!1:!_4(e)&&!n.has(e)}function R4(e,t){return`--${t}-${e}`}function O4(e){const t=k4();return M4(e,t,N4())?R4(e,t):`--${e}`}function P4(e){const t=new Ee;let n="";const r=o=>{document.querySelectorAll("style[em-variables]").forEach(a=>a.remove());const i=document.createElement("style");i.dataset.themeVaribalse="true";const s=Object.entries(o).map(([a,l])=>` ${O4(a)}: ${String(l)};
80
+ `).join("");if(s&&n!==s){n=s,i.innerHTML=`:root {
81
+ ${s}}`;const a=document.querySelector('[data-theme-varibalse="true"]');if(a)a.replaceWith(i);else{const l=document.querySelector("head")||document.querySelector("body");l?.insertBefore(i,l.firstChild)}e.commit(!1)}};return t.addDisposable(e.onChange(()=>{if(!document.querySelector('[data-theme-varibalse="true"]')&&n){const o=document.createElement("style");o.dataset.themeVaribalse="true",o.innerHTML=`:root {
82
+ ${n}}`;const i=document.querySelector("head")||document.querySelector("body");i?.insertBefore(o,i.firstChild),e.commit(!1)}})),t.addDisposable(Z.addListener(Pe.SANDBOX_SET_THEME_VARIABLES,r)),t}var I4={name:"sandbox.crossDomainDrag",setup:()=>mP()},D4={name:"sandbox.themeVariables",awaits:{services:[te]},setup:e=>P4(D(e,te))},B4={name:"sandbox.projectFonts",awaits:{services:[mt,xe]},setup(e){RP();const t=lt(e);w4(D(e,mt),n=>t(n))}},H4={name:"sandbox.variableSelection",setup:()=>yP()},F4={name:"sandbox.emReplaceCaret",awaits:{services:[te]},setup:e=>TP(D(e,te))},$4={name:"sandbox.resizeWatch",awaits:{services:[te,mt]},setup(e){C4(D(e,te),D(e,mt)),A4()}},W4={name:"sandbox.reset",awaits:{services:[te]},setup:e=>mT(D(e,te))},q4={name:"sandbox.correct",awaits:{services:[te,at,mt]},setup:e=>uP(D(e,te),D(e,at).controller,D(e,mt))},z4={name:"sandbox.extensionScripts",awaits:{services:[te,Qo]},setup:e=>F5(D(e,te),{surface:D(e,Qo)})},V4={name:"sandbox.localization",provides:[ac],awaits:{services:[te]},setup:e=>e.inject(ac,cP(D(e,te)))};function U4(e=[]){return{name:"sandbox.extensions",awaits:{services:[at,Qo,te]},setup:t=>iP({container:t,focusController:D(t,at).controller,surface:D(t,Qo),features:[...e]})}}function j4(e){const t=n=>function r(o,i=10){if(!G4(o)||i<0)return o;if(typeof o=="string")return n(o);if(o instanceof Array)return o.map(a=>r(a,i-1));const s=Object.entries(o).map(([a,l])=>[a,r(l,i-1)]);return Object.fromEntries(s)};return{escape:t(n=>e.escape(n,!0)),unescape:t(n=>e.unescape(n))}}function G4(e){return typeof e=="string"||typeof e=="object"&&e!==null&&!(e instanceof Element)}function Gv(e){return/^(data|blob):/i.test(e.trimStart())}function Xv(e,t){const n=/^(\s*)([\s\S]*?)(\s*)$/.exec(e);return!n||!n[2]?e:`${n[1]}${t(n[2])}${n[3]}`}function X4(e,t){try{let n="",r=0,o=0;for(;o<e.length;){for(;o<e.length&&/[\s,]/.test(e[o]);)o+=1;if(o>=e.length)break;const i=o;for(;o<e.length&&!/\s/.test(e[o]);)o+=1;let s=o;for(;s>i&&e[s-1]===",";)s-=1;if(n+=e.slice(r,i)+t(e.slice(i,s)),r=s,s!==o)continue;let a=0;for(;o<e.length&&(e[o]!==","||a>0);)e[o]==="("?a+=1:e[o]===")"&&(a=Math.max(0,a-1)),o+=1}return n+e.slice(r)}catch{return e}}function Y4(e,t){return e.replaceAll(/url\((\s*['"]?)([^'")]+)(['"]?\s*)\)/gi,(n,r,o,i)=>`url(${r}${Xv(o,t)}${i})`)}function rm(e,t,n){const r=e.toLowerCase();return r==="srcset"?X4(t,n):r==="style"?Y4(t,n):Xv(t,n)}var K4=["src","___src","background","poster","srcset","style"];function hl(e){return Gv(e)?e:qa(e)}function Z4(){const e=new Map,t=n=>{if(Gv(n))return n;const r=hl(n),o=e.get(r);return o?W5(r).replace(new RegExp(`${Mi}=\\d+`),`${Mi}=${o}`):n};return{transform:{name:"em-version",attributes:K4,render:(n,r)=>n&&rm(r.attribute,n,t),serialize:(n,r)=>n&&rm(r.attribute,n,hl)},requestReload(n){e.set(hl(n.trim()),String(Date.now()))},isPending(n){return e.has(hl(n.trim()))},clear(){e.clear()}}}var Yv=["src","background","poster","srcset","style"];function om(e,t=document){const n=Yv.map(o=>`[${o}]`).join(","),r=[...t.querySelectorAll(n)];for(const o of r){const i=o.tagName.toLowerCase();for(const s of Yv){const a=o.getAttribute(s);if(!a)continue;const l=e.serialize(a,{element:o,tag:i,attribute:s,stage:"apply"})??a,c=ud(o,s,l,{pipeline:e,stage:"apply"});c===null?a!==l&&o.removeAttribute(s):c!==a&&o.setAttribute(s,c)}}}function Q4(e,t){const{pipeline:n,htmlDocument:r}=t,o=Z4(),i=n.register(o.transform),s={reload(a){a&&(o.requestReload(a),r.renderOnly(()=>om(n)))},clear(){o.clear()}};return e.inject(sc,s),{reload:s,dispose(){i.dispose(),o.clear(),Jt(e,sc)}}}var J4=["https://emcdn.ru/843/20220715_113006_18.png","https://cdn.useblocks.io/843/230110_18_kXn4Evf.png"],eI="/static/media/",tI="empty-image";function nI(e){return e.replace(/[.-][A-Za-z0-9_-]{7,20}$/,"")}function Kv(e){let t;try{t=new URL(e,document.baseURI).pathname}catch{return null}return t.includes(eI)?t:null}function rI(e){return!!e&&Kv(e)!==null}function oI(e){if(!e)return!1;if(J4.includes(e))return!0;const t=Kv(e);return t===null?!1:nI(t.slice(t.lastIndexOf("/")+1).replace(/\.[^.]+$/,""))===tI}var iI=1e4;function sI(e=iI){const t=new Map,n=new Map,r=(o,i)=>{URL.revokeObjectURL(i.blobUrl),t.delete(o)};return{acquire(o,i){const s=t.get(o);if(s)return s.revokeTimer&&(clearTimeout(s.revokeTimer),s.revokeTimer=void 0),s.refs+=1,s.blobUrl;const a=URL.createObjectURL(i);return t.set(o,{blobUrl:a,refs:1}),n.set(a,o),a},release(o){const i=t.get(o);i&&(i.refs-=1,!(i.refs>0||i.revokeTimer)&&(i.revokeTimer=setTimeout(()=>r(o,i),e)))},peek(o){return t.get(o)?.blobUrl},sourceOf(o){return n.get(o)},forget(o){const i=t.get(o);i&&(i.revokeTimer&&clearTimeout(i.revokeTimer),r(o,i))},get size(){return t.size},dispose(){for(const[o,i]of Array.from(t))i.revokeTimer&&clearTimeout(i.revokeTimer),r(o,i);n.clear()}}}var aI=3e3,lI=["src","___src","background","poster","srcset","style"],im=e=>e.startsWith("blob:"),gl="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%220%22%20height%3D%220%22%2F%3E#em-wait=";function cI(e){const t=encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return`${gl}${t}`}var uI=new RegExp(String.raw`blob:[^\s"'()<>]+|`+gl.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+String.raw`[^\s"'()<>]*`,"g");function Zv(e){if(e.startsWith(gl))try{return decodeURIComponent(e.slice(130))}catch{return}}function dI(e){const t=e.attribute.toLowerCase();if(t==="background"||t==="style"||t==="poster")return!0;const n=(e.element?.tagName??e.tag??"").toLowerCase();return n===""?!1:hT(n)}function mI(e){try{return new URL(e,document.baseURI).hostname}catch{return}}function fI(e){const t=e.store??sI(),n=e.answerTimeoutMs??aI,r=new Map,o=new Set;let i={enabled:!1,sourceHosts:[]},s=!1,a=!1;const l={hits:0,misses:0,refused:0,failed:0},c=f=>{const h=mI(f);return h?h===window.location.hostname||i.sourceHosts.includes(h):!1},u=(f,h=!1)=>{if(r.has(f)||!h&&(o.has(f)||t.peek(f)))return;const y=Z.sendAsync(Pe.APPLICATION_CANVAS_IMAGE_GET,h?{url:f,fresh:h}:{url:f}).then(C=>{const k=C;if(k&&"blob"in k){t.acquire(f,k.blob),l.hits+=1;return}o.add(f),l.refused+=1}).catch(()=>{o.add(f),l.failed+=1}),E=Promise.race([y,new Promise(C=>{setTimeout(()=>{r.has(f)&&(s=!0,o.add(f),l.failed+=1),C()},n)})]).then(()=>{r.delete(f),e.refresh()});r.set(f,E)},d=f=>{const h=Zv(f);if(h!==void 0)return d(h);if(!f||a||im(f)||f.startsWith("data:")||rI(f))return f;const y=t.peek(f);return y||(s||!i.enabled||o.has(f)||!c(f)?f:(l.misses+=1,u(f),cI(f)))},m=f=>im(f)?t.sourceOf(f)??f:Zv(f)??f,p=(f,h,y)=>rm(h.attribute,f,y);return{configure(f){i={enabled:f.enabled,sourceHosts:[...f.sourceHosts??[]]}},transform:{name:"image-cache",attributes:lI,render:(f,h)=>f&&dI(h)?p(f,h,d):f,serialize:(f,h)=>f&&p(f,h,m)},forget(f){t.forget(f),o.delete(f),!a&&u(f,!0)},fail(f){const h=t.sourceOf(f);return h===void 0||t.peek(h)!==f?!1:(o.add(h),t.forget(h),l.failed+=1,!0)},block(){a=!0},restoreUrls(f){return sm(f,m)},stats(){return{...l,blobs:t.size}},dispose(){t.dispose(),r.clear(),o.clear()}}}function pI(e,t,n){let r=!1;const o=s=>{const a=s;r||!String(a.blockedURI??"").startsWith("blob")||a.effectiveDirective!=="img-src"||(r=!0,t.block(),n())},i=s=>{const a=s.target,l=a?.currentSrc||a?.src||"";im(l)&&t.fail(l)&&n()};return e.addEventListener("securitypolicyviolation",o),e.addEventListener("error",i,!0),{dispose:()=>{e.removeEventListener("securitypolicyviolation",o),e.removeEventListener("error",i,!0)}}}function hI(e,t){return!e.includes("blob:")&&!e.includes(gl)?e:e.replace(uI,n=>t(n))}function sm(e,t){if(typeof e=="string")return hI(e,t);if(Array.isArray(e)){let n=!1;const r=e.map(o=>{const i=sm(o,t);return n||(n=i!==o),i});return n?r:e}if(e&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype){let n=!1;const r={};for(const[o,i]of Object.entries(e)){const s=sm(i,t);n||(n=s!==i),r[o]=s}return n?r:e}return e}function gI(e,t){const{pipeline:n,htmlDocument:r}=t,o=()=>r.renderOnly(()=>om(n)),i=fI({refresh:o}),s=pI(document,i,o),a=n.register(i.transform),l=Z.addListener(Pe.SANDBOX_CANVAS_IMAGE_CACHE_SETUP,u=>{i.configure(u),r.renderOnly(()=>om(n))}),c=Z.setOutgoingFilter(u=>i.restoreUrls(u));return e.inject(Ms,i),{cache:i,dispose(){s.dispose(),c(),l.dispose(),a.dispose(),i.dispose(),Jt(e,Ms)}}}function bI(e,t){const n=new RA,r=new Zs,o=new OA(n,r),i=new lA(r,n,{prepareHtml:t.prepareHtml,mapHTMLRoots:e.mapHTMLRoots,...e.createRoot?{createRoot:e.createRoot}:{},...e.rootsParent?{rootsParent:e.rootsParent}:{}}),s=e.beforeCommit,a=s?i.beforeCommit(()=>s(i)):void 0;return{htmlDocument:i,remoteDocument:n,textDocument:r,documentMapping:o,onDocumentShown:l=>n.onReady(()=>l()),onDocumentReplaced:l=>n.onEntitySet(c=>l(c)),commit:l=>i.commit(l),commitLockedAsync:async l=>{try{t.lock?.increment(),await i.commit(l,!0)}finally{t.lock?.decrement()}},dispose(){a?.dispose(),i.dispose(),n.dispose(),r.dispose()}}}function yI(e,t){const n=e.getInstance(xs),r=bI(t,{prepareHtml:D(e,Rs),lock:n&&{increment:()=>n.increment("activeElementLocked"),decrement:()=>n.decrement("activeElementLocked")}}),o={commit:i=>r.commit(i),commitLockedAsync:i=>r.commitLockedAsync(i)};return e.inject(Zo,t),e.inject(mt,r.remoteDocument),e.inject(Ko,r.textDocument),e.inject(Zt,r.documentMapping),e.inject(te,r.htmlDocument),e.inject(xe,o),{...r,dispose(){r.dispose(),Jt(e,Zo),Jt(e,mt),Jt(e,Ko),Jt(e,Zt),Jt(e,te),Jt(e,xe)}}}function vI(e){e.inject(xs,x)}var EI=class extends Ee{get isEditorInFocus(){return!!this._isEditorInFocus}constructor(e){super(),L(this,"_isEditorInFocus",!1),L(this,"_context",new Map),L(this,"_editorLostFocusEmitter",this.addDisposable(new Me)),L(this,"_summaries",[]),L(this,"_onChange",t=>{this._isEditorInFocus&&this._summaries.push(...t)}),L(this,"editorLostFocus",this._editorLostFocusEmitter.event),this.addDisposable(e.onChange(this._onChange))}setFocus(e){this._isEditorInFocus!==e&&(this._isEditorInFocus=e,e||(this._editorLostFocusEmitter.fire(this._summaries),this._summaries=[],this._context.clear()))}whenEditorLostFocusAsync(e){return new Promise(t=>this.whenEditorLostFocus(t,e))}whenEditorLostFocus(e,t){if(this._isEditorInFocus){const n=this._editorLostFocusEmitter.once(e);if(t!==void 0){const r=this._context.get(t);r&&r.dispose(),this._context.set(t,n)}}else e([])}};function SI(e,t){const{htmlDocument:n,remoteDocument:r}=t,o=new EI(n);let i;const s=r.beforeSave(c=>{o.isEditorInFocus&&(i=i||c.value,c.preventDefault())}),a=()=>{typeof i=="boolean"&&(r.saveChanges(i),i=void 0)},l={controller:o,setEditorFocus(c){o.isEditorInFocus!==c&&(c&&a(),o.setFocus(c),c||a())},dispose(){s.dispose(),o.dispose(),Jt(e,at)}};return e.inject(at,l),l}var wI={name:"sandbox.state",provides:[xs],setup:vI},CI={name:"sandbox.attributePipeline",provides:[qr],setup:U5},AI={name:"sandbox.documentSync",provides:[te,mt,Ko,Zt,xe,Os],awaits:{services:[Zo,Rs,xs]},setup:e=>e.inject(Os,yI(e,D(e,Zo)))},TI={name:"sandbox.images",provides:[Ms,sc],awaits:{services:[qr,te,Os]},setup(e){const t=D(e,qr),n=D(e,te);gI(e,{pipeline:t,htmlDocument:n});const r=Q4(e,{pipeline:t,htmlDocument:n}).reload;D(e,Os).onDocumentReplaced(()=>r.clear()),Z.addListener(Pe.SANDBOX_IMAGE_RESET,({url:o})=>{o&&(e.getInstance(Ms)?.forget(o),r.reload(o))})}},_I={name:"sandbox.mapObj",provides:[zr],awaits:{services:[Zt]},setup:e=>e.inject(zr,j4(D(e,Zt)))},kI={name:"sandbox.focus",provides:[at],awaits:{services:[te,mt]},setup:e=>SI(e,{htmlDocument:D(e,te),remoteDocument:D(e,mt)})},LI=[wI,CI,AI,TI,$T,WT,qT,_I,kI,I4,D4,B4,H4,F4,$4,W4,q4,z4,V4,nP,rP,oP,...g_],am=null,lm=0,NI=6e5;function xI(e){am=e,lm=e?Date.now():0}function MI(){const e=am,t=lm;return am=null,lm=0,!e||!t||Date.now()-t>NI||!e.isConnected||!e.matches('[em="block"]')?null:e}function RI(e,t){const n=t.getOuterHtml(e),r=document.createElement("html").appendChild(document.createElement("body"));let o;e.tagName==="TR"?o=document.createElement("table"):o=document.createElement("div"),document.querySelectorAll("style").forEach(a=>{const l=t.getOuterHtml(a);l&&o.insertAdjacentHTML("beforeend",l)}),o.insertAdjacentHTML("beforeend",`
83
+ `);const i=Te(n)[0];if(!i)return null;i.querySelectorAll("style").forEach(a=>{a.remove()}),i.classList.remove("em-structure"),i.querySelectorAll(".em-structure").forEach(a=>a.classList.remove("em-structure")),o.appendChild(i),e.querySelectorAll('[class*="em-font-"]').forEach(a=>{const l=[...a.classList].find(c=>c.startsWith("em-font-")&&c!=="em-font-custom");if(l){const c=`link[em-class="${l}"]`;!o.querySelector(c)&&document.querySelector(c)&&(o.insertAdjacentHTML("afterbegin",`
84
+ `),o.prepend(document.querySelector(c).cloneNode(!0)))}}),r.append(o),hy(r,[...r.querySelectorAll("style")],{forceMediaMerge:!0});let s=Vt(r);return e.tagName==="TR"?s=s.replaceAll(/<body(.|\n|\r)*?><table>/gi,"").replaceAll(/<\/table><\/body>/gi,""):s=s.replaceAll(/<body(.|\n|\r)*?><div>/gi,"").replaceAll(/<\/div><\/body>/gi,""),s=s.replaceAll(/html {((.|\n|\r)*?)}/gi,"").replaceAll(/<style[^>]*>\s*<\/style>/gi,""),s}function OI(e,t){const{HTMLDocument:n,messageService:r}=t,o=e.closest('[em="block"]');if(!o)return;const i=RI(o,n);if(!i)return;xI(o);const s=o.getAttribute("em-block-id"),a=o.getAttribute("em-block-version");r.send({operation:"application_eblock_add",data:ko({html:i.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function bl(e){const t=document.querySelector(".em-element-editor:not(.of-atom)");if(!t)return;const n=(t.closest('[em="block"]')||t.closest('[em="group"]'))?.getBoundingClientRect().top||0;if(e.scrollTop>n+55){const r=e.scrollTop-n;t.style.top=r+8+"px"}else t.style.removeProperty("top")}function yl(e){const t=document.querySelector(".em-element-editor");if(!t)return;const n=t.getBoundingClientRect(),r=document.querySelector(".em-element-editor-widget");r&&(n.top<0?r.classList.add("sticky"):r.classList.remove("sticky"),n.top+t.offsetHeight-10-r.offsetHeight<0&&r.classList.remove("sticky"),e(!1))}var Ke=()=>ca(window.getSelection()?.toString())??"",PI=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],II={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:t=>window.getComputedStyle(t).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:t=>t.getAttribute(e)})},DI=/^#[\da-f]{6}$/i,Qv=()=>[...new Set(PI.flatMap(BI).map(X).filter(e=>DI.test(e)).map(e=>e.toUpperCase()))];function BI({type:e,name:t}){const n=II[e],{selector:r,toColor:o}=n(t);return Array.from(document.querySelectorAll(r)).map(o)}var HI=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"],cm=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">&nbsp;</div>`;function FI(e){return!!e.closest("editor.em-text")}function Jv(e){e.querySelectorAll(HI.join(",")).forEach(t=>{FI(t)||t.remove()})}function $I(e){const t=e.cloneNode(!0),n=t.querySelector("editor.em-text");if(n){Jv(t);const o=n.querySelector("div");if(o)return o.outerHTML;const i=n.getAttribute("innerclass")??"",s=n.getAttribute("innerstyle")??"";return`<div${i?` class="${Nn(i)}"`:""}${s?` style="${Nn(s)}"`:""}>${n.innerHTML}</div>`}Jv(t);const r=t.querySelector("div");return r?r.outerHTML:t.innerHTML}function Nn(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ln(e){if(!e)return;const t=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}function Ji(e){if(!e)return;const t=e.trim().split(/\s+/);if(t.length<3)return;const n=ln(t[0]),r=t[1],o=t.slice(2).join(" ");if(n!==void 0&&["none","solid","dashed","dotted","double"].includes(r))return{width:n,style:r,color:o}}function WI(e){const t=e.get("padding"),n=e.get("padding-top"),r=e.get("padding-right"),o=e.get("padding-bottom"),i=e.get("padding-left"),s={};if(t){const d=t.trim().split(/\s+/),m=ln(d[0]),p=ln(d[1]??d[0]),f=ln(d[2]??d[0]),h=ln(d[3]??d[1]??d[0]);m!==void 0&&(s.top=m),p!==void 0&&(s.right=p),f!==void 0&&(s.bottom=f),h!==void 0&&(s.left=h)}const a=ln(n??""),l=ln(r??""),c=ln(o??""),u=ln(i??"");return a!==void 0&&(s.top=a),l!==void 0&&(s.right=l),c!==void 0&&(s.bottom=c),u!==void 0&&(s.left=u),Object.keys(s).length?s:void 0}function e1(e){if(e)return e.trim()}function qI(e){if(!e)return;const t=e.trim().toLowerCase();return["left","center","right","justify"].includes(t)?t:void 0}function zI(e){if(!e)return;const t=e.trim().toLowerCase();if(t==="top"||t==="text-top")return"top";if(t==="bottom"||t==="text-bottom")return"bottom";if(t==="middle")return"middle"}function VI(e){const t=new Map;return e&&e.split(";").forEach(n=>{const[r,...o]=n.split(":");if(!r||o.length===0)return;const i=r.trim().toLowerCase(),s=o.join(":").trim();i&&t.set(i,s)}),t}function UI(e){if(!e)return;const t=e.trim().replace(/\s+/g," ");if(t&&/^(\d+(\.\d+)?\s*(px|em|rem|%|pt)\s*){1,4}$/i.test(t))return t}function jI(e){const t=VI(e.getAttribute("style")),n=t.get("font-family")??void 0,r=ln(t.get("font-size")??""),o=ln(t.get("line-height")??""),i=e1(t.get("color")??void 0),s=e1(t.get("background-color")??void 0),a=qI(t.get("text-align")??void 0),l=zI(t.get("vertical-align")??void 0),c={top:Ji(t.get("border-top")),right:Ji(t.get("border-right")),bottom:Ji(t.get("border-bottom")),left:Ji(t.get("border-left"))},u=Ji(t.get("border"));u&&(c.top=c.top??u,c.right=c.right??u,c.bottom=c.bottom??u,c.left=c.left??u);const d=WI(t),m=UI(t.get("border-radius")??void 0),p={};return n&&(p.fontFamily=n),r!==void 0&&(p.fontSize=r),o!==void 0&&(p.lineHeight=o),i&&(p.color=i),s&&(p.backgroundColor=s),a&&(p.textAlign=a),l&&(p.verticalAlign=l),d&&(p.padding=d),m&&(p.borderRadius=m),(c.top||c.right||c.bottom||c.left)&&(p.borders=c),Object.keys(p).length?p:void 0}function GI(e){const t=e.getAttribute("align")?.toLowerCase();if(t==="left"||t==="center"||t==="right")return t}function XI(e){const t=e.getAttribute("valign")?.toLowerCase();if(t==="top"||t==="middle"||t==="bottom")return t}function um(e){if(e==null)return;const t=Number(e);return Number.isFinite(t)?t:void 0}function es(e){const t=Array.from(e.classList),n={};Array.from(e.attributes).forEach(c=>{const u=c.name.toLowerCase();u!=="class"&&(n[u]=c.value)});const r={width:e.getAttribute("width")??void 0,cellpadding:um(e.getAttribute("cellpadding")),cellspacing:um(e.getAttribute("cellspacing")),border:um(e.getAttribute("border")),classList:t.length?t:void 0,attrs:Object.keys(n).length?n:void 0},o=[],i=[];let s=0;const a=Array.from(e.querySelectorAll(":scope > tr, :scope > tbody > tr, :scope > thead > tr, :scope > tfoot > tr")).filter(c=>c.querySelectorAll("td, th").length!==0);a.forEach(c=>{let u=0;Array.from(c.querySelectorAll("td, th")).forEach(d=>{const m=Math.max(1,d.colSpan||1);u+=m}),u>s&&(s=u)});let l=0;for(const c of a){i[l]||(i[l]=Array(s).fill(null));let u=0;const d=Array.from(c.querySelectorAll("td, th"));for(const m of d){for(;u<s&&i[l][u]!==null&&i[l][u]!==void 0;)u++;if(u>=s)continue;const p=Math.max(1,m.colSpan||1),f=Math.max(1,m.rowSpan||1),h=Math.min(f,a.length-l),y=`cell-${o.length}`,E=Array.from(m.classList),C=$I(m),k=GI(m),w=XI(m),b=jI(m),v={id:y,row:l,col:u,rowspan:h,colspan:p,contentHtml:C,classList:E,align:k,valign:w,style:b};o.push(v);for(let A=0;A<h;A++){const g=l+A;i[g]||(i[g]=Array(s).fill(null));for(let S=0;S<p;S++){const T=u+S;T>=s||i[g][T]!==null&&i[g][T]!==void 0||(i[g][T]=y)}}u+=p}l++}for(let c=0;c<i.length;c++)for(let u=0;u<s;u++)(i[c][u]===null||i[c][u]===void 0)&&(i[c][u]=null);new Set(i.flat().filter(c=>c!==null)),new Set(o.map(c=>c.id));for(const c of o)for(let u=c.row;u<c.row+c.rowspan;u++)for(let d=c.col;d<c.col+c.colspan;d++)i[u]&&(i[u][d],c.id);return{rows:i.length,cols:s,cells:o,grid:i,meta:r}}function t1(e,t,n){const r=JSON.parse(JSON.stringify(e));let o=-1;const i=typeof t=="string"?t.trim():"";if(i){for(const p of r.cells)if(Array.isArray(p.classList)&&p.classList.includes(i)){o=p.row;break}}o===-1&&(r.rows===0?(o=0,n=!0):(o=r.rows-1,n=!1));const s=r.cells.filter(p=>p.row===o).sort((p,f)=>p.col-f.col),a=r.cells.length===0;if(s.length===0)if(a)s.push({id:"cell-0",row:0,col:0,rowspan:1,colspan:1,contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}}),r.cols=1;else for(let p=0;p<r.cols;p++)s.push({id:`template-${p}`,row:o,col:p,rowspan:1,colspan:1,contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}});let l=1;for(const p of s)p.rowspan>l&&(l=p.rowspan);let c=n?o:o+l;const u=new Array(r.cols).fill(!1);for(const p of r.cells)if(p.row<c&&p.row+p.rowspan>c)for(let f=p.col;f<p.col+p.colspan;f++)u[f]=!0;for(const p of r.cells)p.row>=c&&(p.row+=1);const d=[];let m=r.cells.length;for(let p=0;p<r.cols;p++){if(u[p])continue;const f=s.find(y=>y.col<=p&&p<y.col+y.colspan)||s[0]||{contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}},h=JSON.parse(JSON.stringify(f));h.id=`cell-${m++}`,h.contentHtml=vl(f.contentHtml," "),h.classList=h.classList.filter(y=>y!==i),h.row=c,h.col=p,h.rowspan=1,h.colspan=1,d.push(h)}r.cells.push(...d),r.rows+=1,r.grid.splice(c,0,new Array(r.cols).fill(null));for(let p=0;p<r.rows;p++)for(let f=0;f<r.cols;f++){const h=r.cells.find(y=>y.row<=p&&y.row+y.rowspan>p&&y.col<=f&&y.col+y.colspan>f);r.grid[p][f]=h?h.id:null}for(let p=0;p<r.cols;p++)r.grid[c][p]===null&&u[p];return r}function YI(e){if(!e)return"";const t=[];if(e.fontFamily&&t.push(`font-family: ${e.fontFamily}`),e.fontSize!==void 0&&t.push(`font-size: ${e.fontSize}px`),e.lineHeight!==void 0&&t.push(`line-height: ${e.lineHeight}px`),e.color&&t.push(`color: ${e.color}`),e.backgroundColor&&t.push(`background-color: ${e.backgroundColor}`),e.textAlign&&t.push(`text-align: ${e.textAlign}`),e.verticalAlign&&t.push(`vertical-align: ${e.verticalAlign}`),e.borderRadius&&t.push(`border-radius: ${e.borderRadius}`),e.padding){const n=e.padding;n.top!==void 0&&n.right!==void 0&&n.bottom!==void 0&&n.left!==void 0&&n.top===n.right&&n.right===n.bottom&&n.bottom===n.left?t.push(`padding: ${n.top}px`):(n.top!==void 0&&t.push(`padding-top: ${n.top}px`),n.right!==void 0&&t.push(`padding-right: ${n.right}px`),n.bottom!==void 0&&t.push(`padding-bottom: ${n.bottom}px`),n.left!==void 0&&t.push(`padding-left: ${n.left}px`))}if(e.borders){const n=e.borders;n.border?t.push(`border: ${n.border.width}px ${n.border.style} ${n.border.color}`):(n.top&&t.push(`border-top: ${n.top.width}px ${n.top.style} ${n.top.color}`),n.right&&t.push(`border-right: ${n.right.width}px ${n.right.style} ${n.right.color}`),n.bottom&&t.push(`border-bottom: ${n.bottom.width}px ${n.bottom.style} ${n.bottom.color}`),n.left&&t.push(`border-left: ${n.left.width}px ${n.left.style} ${n.left.color}`))}return t.length?t.join("; "):""}function It(e){if(e.rows===0||e.cols===0||!e.cells.length)return"<table></table>";const t=[];if(e.meta&&(e.meta.width&&t.push(`width="${Nn(e.meta.width)}"`),e.meta.cellpadding!==void 0&&t.push(`cellpadding="${e.meta.cellpadding}"`),e.meta.cellspacing!==void 0&&t.push(`cellspacing="${e.meta.cellspacing}"`),e.meta.border!==void 0&&t.push(`border="${e.meta.border}"`),e.meta.classList?.length&&t.push(`class="${Nn(e.meta.classList.join(" "))}"`),e.meta.attrs))for(const[o,i]of Object.entries(e.meta.attrs))t.push(`${Nn(o)}="${Nn(i)}"`);const n=new Map;for(const o of e.cells)n.set(o.id,o);const r=[];for(let o=0;o<e.rows;o++){const i=[];for(let s=0;s<e.cols;s++){const a=e.grid[o][s];if(!a)continue;const l=n.get(a);if(!l||l.row!==o||l.col!==s)continue;const c=[];l.rowspan>1&&c.push(`rowspan="${l.rowspan}"`),l.colspan>1&&c.push(`colspan="${l.colspan}"`),l.align&&c.push(`align="${Nn(l.align)}"`),l.valign&&c.push(`valign="${Nn(l.valign)}"`),l.classList?.length&&c.push(`class="${Nn(l.classList.join(" "))}"`);const u=YI(l.style);u&&c.push(`style="${Nn(u)}"`),i.push(`<td${c.length?" "+c.join(" "):""}>${l.contentHtml}</td>`)}i.length&&r.push(`<tr>${i.join("")}</tr>`)}return`<table${t.length?" "+t.join(" "):""}>${r.join("")}</table>`}function KI(e,t){const n=JSON.parse(JSON.stringify(e));let r=-1;const o=typeof t=="string"?t.trim():"";if(o){for(const i of n.cells)if(Array.isArray(i.classList)&&i.classList.includes(o)){r=i.row;break}}if(r===-1||n.rows<=1||n.cells.filter(i=>i.row===r).some(i=>i.rowspan>1))return n;n.cells=n.cells.filter(i=>i.row!==r);for(const i of n.cells)i.row>r&&(i.row-=1);return n.grid.splice(r,1),n.rows-=1,n}function vl(e,t){if(typeof e!="string"||typeof t!="string")return e;const n=new DOMParser().parseFromString(e,"text/html").body.firstChild;if(!n)return e;let r=!1;function o(a){if(a.nodeType===Node.TEXT_NODE&&a.textContent?.trim()){r?a.textContent="":(a.textContent=t,r=!0);return}for(const l of Array.from(a.childNodes))o(l)}function i(a){if(a.nodeType===Node.TEXT_NODE){const l=a.textContent||"";return!l||/^\s*$/.test(l.replace(/\u00A0/g,"X"))}return a.nodeType!==Node.ELEMENT_NODE?!0:Array.from(a.childNodes).every(l=>i(l))}function s(a,l=!1){if(a.nodeType!==Node.ELEMENT_NODE)return;const c=Array.from(a.childNodes);for(const u of c)s(u);!l&&i(a)&&a.parentNode?.removeChild(a)}return o(n),s(n,!0),n.outerHTML||e}function n1(e,t,n){const r=JSON.parse(JSON.stringify(e));let o;const i=typeof t=="string"?t.trim():"";if(i){for(const u of r.cells)if(Array.isArray(u.classList)&&u.classList.includes(i)){o=u;break}}if(!o)return r;const s=o.col;let a=n?s:s+o.colspan;const l=[];let c=r.cells.length;for(let u=0;u<r.rows;u++){const d=JSON.parse(JSON.stringify(o));d.id=`cell-${c++}`,d.contentHtml=vl(o.contentHtml," "),d.row=u,d.col=a,d.rowspan=1,d.colspan=1,d.classList=o.classList.filter(m=>m!==i),l.push(d)}for(const u of r.cells)u.col>=a&&(u.col+=1);r.cells.push(...l),r.cols+=1;for(let u=0;u<r.rows;u++)r.grid[u].splice(a,0,null),r.grid[u][a]=l[u].id;return r}function ZI(e,t){const n=JSON.parse(JSON.stringify(e));let r;const o=typeof t=="string"?t.trim():"";if(o){for(const s of n.cells)if(Array.isArray(s.classList)&&s.classList.includes(o)){r=s;break}}if(!r)return n;const i=r.col;if(n.cols<=1||n.cells.filter(s=>s.col===i).some(s=>s.colspan>1))return n;n.cells=n.cells.filter(s=>s.col!==i);for(const s of n.cells)s.col>i&&(s.col-=1);for(let s=0;s<n.rows;s++)n.grid[s].splice(i,1);return n.cols-=1,n}function r1(e,t,n,r=1){const o=JSON.parse(JSON.stringify(e));if(r<=0)return o;let i;const s=typeof t=="string"?t.trim():"";if(s){for(const C of o.cells)if(Array.isArray(C.classList)&&C.classList.includes(s)){i=C;break}}if(!i)return o;const a=i.row,l=i.col,c=i.colspan,u=i.rowspan,d=[];if(n)for(let C=1;C<=r;C++)d.push(l-C);else for(let C=0;C<r;C++)d.push(l+c+C);for(const C of d)if(C<0||C>=o.cols)return o;const m=[];for(const C of d){const k=o.cells.find(w=>w.row===a&&w.col<=C&&C<w.col+w.colspan);if(!k)return o;m.push(k)}const p=Array.from(new Set(m));for(const C of p)if(C.rowspan!==u)return o;const f=c+p.reduce((C,k)=>C+k.colspan,0);let h=(n?[...p.reverse(),i]:[i,...p]).map(C=>{const k=new DOMParser().parseFromString(C.contentHtml,"text/html").body.firstChild,w=k?k.innerHTML:"";return w===""||/^\s*(&nbsp;)*\s*$/.test(w)?"":w}).filter(C=>C!=="").join("<br>");(h===""||/^\s*(&nbsp;|<br>)*\s*$/.test(h))&&(h="&nbsp;");const y=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;y?(y.innerHTML=h,i.contentHtml=y.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${h}</div>`,i.colspan=f,n&&d.length>0&&(i.col=Math.min(...d)),o.cells=o.cells.filter(C=>!p.includes(C));const E=n&&d.length>0?Math.min(...d):l;for(let C=E;C<E+f;C++)o.grid[a][C]=i.id;return o}function o1(e,t,n,r=1){const o=JSON.parse(JSON.stringify(e));if(r<=0)return o;let i;const s=typeof t=="string"?t.trim():"";if(s){for(const C of o.cells)if(Array.isArray(C.classList)&&C.classList.includes(s)){i=C;break}}if(!i)return o;const a=i.row,l=i.col,c=i.rowspan,u=i.colspan,d=[];if(n)for(let C=1;C<=r;C++)d.push(a-C);else for(let C=0;C<r;C++)d.push(a+c+C);for(const C of d)if(C<0||C>=o.rows)return o;const m=[];for(const C of d){const k=o.cells.find(w=>w.col===l&&w.row<=C&&C<w.row+w.rowspan);if(!k)return o;m.push(k)}const p=Array.from(new Set(m));for(const C of p)if(C.colspan!==u)return o;const f=c+p.reduce((C,k)=>C+k.rowspan,0);let h=(n?[...p.reverse(),i]:[i,...p]).map(C=>{const k=new DOMParser().parseFromString(C.contentHtml,"text/html").body.firstChild,w=k?k.innerHTML:"";return w===""||/^\s*(&nbsp;)*\s*$/.test(w)?"":w}).filter(C=>C!=="").join("<br>");h=h.replace(/&nbsp;$/g,""),(h===""||/^\s*(&nbsp;|<br>)*\s*$/.test(h))&&(h="&nbsp;");const y=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;y?(y.innerHTML=h,i.contentHtml=y.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${h}</div>`,i.rowspan=f,n&&d.length>0&&(i.row=Math.min(...d)),o.cells=o.cells.filter(C=>!p.includes(C));const E=n&&d.length>0?Math.min(...d):a;for(let C=E;C<E+f&&C<o.rows;C++)o.grid[C][l]=i.id;return o}function QI(e,t,n=1){const r=JSON.parse(JSON.stringify(e)),o=typeof t=="string"?t.trim():"";if(!o)return r;const i=r.cells.find(a=>Array.isArray(a.classList)&&a.classList.includes(o));if(!i||i.colspan<=1||n>=i.colspan)return r;i.colspan-=n;const s={id:`cell-${r.cells.length}`,row:i.row,col:i.col+i.colspan,colspan:n,rowspan:i.rowspan,contentHtml:vl(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};r.cells.push(s);for(let a=0;a<r.rows;a++)for(let l=0;l<r.cols;l++){const c=r.cells.find(u=>u.row<=a&&u.row+u.rowspan>a&&u.col<=l&&u.col+u.colspan>l);r.grid[a][l]=c?c.id:null}return r}function JI(e,t,n=1){const r=JSON.parse(JSON.stringify(e)),o=typeof t=="string"?t.trim():"";if(!o)return r;const i=r.cells.find(a=>Array.isArray(a.classList)&&a.classList.includes(o));if(!i||i.rowspan<=1||n>=i.rowspan)return r;i.rowspan-=n;const s={id:`cell-${r.cells.length}`,row:i.row+i.rowspan,col:i.col,rowspan:n,colspan:i.colspan,contentHtml:vl(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};r.cells.push(s);for(let a=0;a<r.rows;a++)for(let l=0;l<r.cols;l++){const c=r.cells.find(u=>u.row<=a&&u.row+u.rowspan>a&&u.col<=l&&u.col+u.colspan>l);r.grid[a][l]=c?c.id:null}for(let a=s.row;a<s.row+s.rowspan;a++)for(let l=s.col;l<s.col+s.colspan;l++)r.grid[a][l];return r}function dm(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return null;const r=e.cells.find(o=>Array.isArray(o.classList)&&o.classList.includes(n));return r?{row:r.row,col:r.col}:null}function i1(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return{row:null,col:null,isOverlapped:!1};const r=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(n));if(!r)return{row:null,col:null,isOverlapped:!1};const o=r.row;if(o<0||o>=e.rows)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.rowspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(n))&&i.row<=o&&o<i.row+i.rowspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function s1(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return{row:null,col:null,isOverlapped:!1};const r=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(n));if(!r)return{row:null,col:null,isOverlapped:!1};const o=r.col;if(o<0||o>=e.cols)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.colspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(n))&&i.col<=o&&o<i.col+i.colspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function a1(e,t,n){const r=JSON.parse(JSON.stringify(e)),o=r.cells.find(c=>c.classList?.includes(t));if(!o)return r;const i=r.cells.filter(c=>c.classList?.includes(n)&&c.id!==o.id);let s=o.colspan||1;i.forEach(c=>{const u=c.colspan||1;s+=u,c.colspan=1}),o.colspan=s;const a=c=>{const u=c.match(/<div[^>]*>(.*?)<\/div>/);return u?u[1].replace(/&nbsp;/g,"").trim():""};o.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[a(o.contentHtml),...i.sort((c,u)=>c.col-u.col).map(c=>a(c.contentHtml)).filter(c=>c.length>0)].filter(c=>c.length>0).join("<br>")}</div>`;const l=new Set(i.map(c=>c.id));return r.cells.forEach(c=>{if(c.row===o.row&&c.col>o.col&&!l.has(c.id)){let u=0;i.forEach(d=>{d.row===c.row&&d.col<c.col&&(u+=(d.colspan||1)-1)}),c.col-=u}}),r.grid=r.grid.map((c,u)=>{const d=new Array(r.cols).fill(null);return r.cells.filter(m=>{const p=m.row,f=m.row+(m.rowspan||1)-1;return p<=u&&u<=f&&!l.has(m.id)}).sort((m,p)=>m.col-p.col).forEach(m=>{const p=m.id,f=m.colspan||1,h=m.col;for(let y=0;y<f&&h+y<r.cols;y++)d[h+y]=p}),d}),r}function l1(e,t,n){const r=JSON.parse(JSON.stringify(e)),o=r.cells.find(u=>u.classList?.includes(t));if(!o)return r;const i=r.cells.filter(u=>u.classList?.includes(n)&&u.id!==o.id&&u.col===o.col);let s=o.rowspan||1;i.forEach(u=>{const d=u.rowspan||1;s+=d,u.rowspan=1}),o.rowspan=s;const a=u=>{const d=u.match(/<div[^>]*>(.*?)<\/div>/);return d?d[1].replace(/&nbsp;/g,"").trim():""};o.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[a(o.contentHtml),...i.sort((u,d)=>u.row-d.row).map(u=>a(u.contentHtml)).filter(u=>u.length>0)].filter(u=>u.length>0).join("<br>")}</div>`;const l=i.length>0?Math.min(...i.map(u=>u.row)):o.row;l<o.row&&(o.row=l);const c=new Set(i.map(u=>u.id));return r.cells.forEach(u=>{if(u.col===o.col&&u.id!==o.id&&!c.has(u.id)){let d=0;i.forEach(m=>{m.col===u.col&&m.row<=u.row&&(d+=(m.rowspan||1)-1)}),d>0&&(u.row-=d)}}),r.grid=r.grid.map((u,d)=>{const m=new Array(r.cols).fill(null);return r.cells.filter(p=>{const f=p.row,h=p.row+(p.rowspan||1)-1;return f<=d&&d<=h&&!c.has(p.id)}).sort((p,f)=>p.col-f.col).forEach(p=>{const f=p.col,h=p.colspan||1;for(let y=0;y<h&&f+y<r.cols;y++)m[f+y]=p.id}),m}),r}function El(e,t,n,r,o,i=!0){const{cells:s,grid:a}=e;function l(p,f){if(!a[p]||!a[p][f])return null;const h=a[p][f];return s.find(y=>y.id===h)}function c(p,f){const h=l(p,f);return h?{row:h.row,col:h.col,cell:h}:null}const u=c(t,n),d=c(r,o);if(!u||!d||u.cell.id===d.cell.id)return 0;function m(p,f,h,y){let E=0;const C=p<f?1:-1,k=new Set;for(let b=p;b!==f;b+=C){const v=l(y?h:b,y?b:h);v&&!k.has(v.id)&&(k.add(v.id),E++)}const w=l(y?h:f,y?f:h);return w&&!k.has(w.id)&&E++,E}return i?u.row===d.row?m(n,o,t,!0)-1:0:u.col===d.col?m(t,r,n,!1)-1:0}function eD(e,t){if(!t.settings)return e;const n=Object.keys(t.settings);if(n.length===0)return e;const r=["paddingLeftRight","paddingTopBottom","paddingLeft","paddingTop","paddingRight","paddingBottom"],o=n[0];if(!r.includes(o))return e;const i=t.settings[o];return typeof i!="number"||isNaN(i)||!e.cells||!Array.isArray(e.cells)||e.cells.forEach((s,a)=>{switch(s.id,s.style||(s.style={}),s.style.padding||(s.style.padding={top:0,right:0,bottom:0,left:0}),o){case"paddingLeftRight":s.style.padding.left=i,s.style.padding.right=i;break;case"paddingTopBottom":s.style.padding.top=i,s.style.padding.bottom=i;break;case"paddingLeft":s.style.padding.left=i;break;case"paddingTop":s.style.padding.top=i;break;case"paddingRight":s.style.padding.right=i;break;case"paddingBottom":s.style.padding.bottom=i}s.style.padding.top===0&&s.style.padding.right===0&&s.style.padding.bottom===0&&s.style.padding.left===0&&delete s.style.padding,Object.keys(s.style).length===0&&delete s.style}),e}function tD(e,t){const{backgroundPositionX:n,backgroundPositionY:r}=t.settings;if(n===void 0&&r===void 0)return e;const o=e.replace(/\s*;\s*/g,";").replace(/([^;])$/,"$1;").trim().split(";").filter(a=>a.trim());let i=!1;const s=o.map(a=>{const[l,c]=a.split(":").map(u=>u.trim());if(l==="background-position"){i=!0;const u=c.split(/\s+/).filter(p=>p.trim());let d=u[0],m=u[1]||u[0];return n!==void 0&&(d=`${n}px`),r!==void 0&&(m=`${r}px`),`background-position: ${d} ${m}`}return l==="background-position-x"&&n!==void 0?`background-position-x: ${n}px`:l==="background-position-y"&&r!==void 0?`background-position-y: ${r}px`:a});if(!i&&(n!==void 0||r!==void 0)){const a=n!==void 0?`${n}px`:"center",l=r!==void 0?`${r}px`:"center";s.push(`background-position: ${a} ${l}`)}return s.join("; ")}function nD(e){const t={};if(!e)return t;const n=e.split(";").map(r=>r.trim()).filter(r=>r.length>0);for(const r of n){const o=r.indexOf(":");if(o===-1)continue;const i=r.slice(0,o).trim(),s=r.slice(o+1).trim();if(!(!i||!s))switch(i.toLowerCase()){case"background-image":const a=s.match(/url\(['"]?(.+?)['"]?\)/i);a&&a[1]&&(t.backgroundImage=a[1]);break;case"background-size":t.backgroundSize=s;break;case"background-repeat":t.backgroundRepeat=s;break;case"background-position":const l=s.split(/\s+/).filter(c=>c.length>0);l.length>=1&&(t.backgroundPositionX=l[0]),l.length>=2&&(t.backgroundPositionY=l[1])}}return t}function rD(e,t){const n=[];for(const r of e.cells)t.some(o=>r.classList.includes(o))&&n.push(r.id);return n}function oD(e,t,n){const r={...e,cells:e.cells.map(o=>({...o,style:o.style?{...o.style}:void 0}))};for(const o of r.cells)t.includes(o.id)&&(o.style||(o.style={}),o.style.backgroundColor=n);return r}function iD(e,t,n){const r={...e,cells:e.cells.map(o=>({...o,classList:[...o.classList]}))};for(const o of r.cells)t.includes(o.id)&&(o.classList.includes(n)||o.classList.push(n));return r}function sD(e,t,n,r){const o={width:1,style:"solid",color:"#b9b1b1"},i={...e,cells:e.cells.map(s=>{const a={...s};return a.style&&(a.style={...a.style},a.style.borders&&(a.style.borders={...a.style.borders})),a})};for(const s of i.cells)if(t.includes(s.id)){s.style||(s.style={}),s.style.borders||(s.style.borders={});for(const a of n){const l=s.style.borders[a];l?s.style.borders[a]={...l,...r}:s.style.borders[a]={...o,...r}}}return i}function aD(e,t){const n=new Map(e.cells.map(u=>[u.id,u])),r=new Set,o=[];for(const u of t){const d=n.get(u);if(d)for(let m=0;m<d.rowspan;m++)for(let p=0;p<d.colspan;p++){const f=d.row+m,h=d.col+p,y=`${f}-${h}`;r.has(y)||(r.add(y),o.push({row:f,col:h,id:u}))}}const i=new Set(o.map(u=>u.row)),s=new Set(o.map(u=>u.col));let a=!1;if(i.size===1&&s.size===o.length)a=!0;else if(!(s.size===1&&i.size===o.length))return{};a?o.sort((u,d)=>u.col-d.col):o.sort((u,d)=>u.row-d.row);const l=new Map;for(const u of o)l.has(u.id)||l.set(u.id,[]),l.get(u.id).push({row:u.row,col:u.col});l.forEach((u,d)=>{const m=n.get(d);if(m.rowspan>1||m.colspan>1){const p=a?(f,h)=>f.col-h.col:(f,h)=>f.row-h.row;u.sort(p)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],m=d.id,p=n.get(m);let f=m;if(p.rowspan>1||p.colspan>1){const y=l.get(m).findIndex(E=>E.row===d.row&&E.col===d.col);y>0&&(f=`${m}-uni-${y+1}`)}const h=[];a?(h.push("top","bottom"),(u===0||o[u-1].col!==d.col-1)&&h.push("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&h.push("right")):(h.push("left","right"),(u===0||o[u-1].row!==d.row-1)&&h.push("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&h.push("bottom")),c[f]=h}return c}function lD(e,t,n,r){const o={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3},i={...e,cells:e.cells.map(s=>{const a={...s};return a.style&&(a.style={...a.style}),a})};for(const s of i.cells)if(t.includes(s.id)){s.style||(s.style={});let a=(s.style.borderRadius||"0px 0px 0px 0px").split(" ").map(l=>parseInt(l.replace("px",""),10));for(const l of n){const c=o[l];c!==void 0&&(a[c]=r)}a.every(l=>l===0)?delete s.style.borderRadius:s.style.borderRadius=a.map(l=>`${l}px`).join(" ")}return i}function cD(e,t){const n=new Map(e.cells.map(u=>[u.id,u])),r=new Set,o=[];for(const u of t){const d=n.get(u);if(d)for(let m=0;m<d.rowspan;m++)for(let p=0;p<d.colspan;p++){const f=d.row+m,h=d.col+p,y=`${f}-${h}`;r.has(y)||(r.add(y),o.push({row:f,col:h,id:u}))}}const i=new Set(o.map(u=>u.row)),s=new Set(o.map(u=>u.col));let a=!1;if(i.size===1&&s.size===o.length)a=!0;else if(!(s.size===1&&i.size===o.length))return{};a?o.sort((u,d)=>u.col-d.col):o.sort((u,d)=>u.row-d.row);const l=new Map;for(const u of o)l.has(u.id)||l.set(u.id,[]),l.get(u.id).push({row:u.row,col:u.col});l.forEach((u,d)=>{const m=n.get(d);if(m.rowspan>1||m.colspan>1){const p=a?(f,h)=>f.col-h.col:(f,h)=>f.row-h.row;u.sort(p)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],m=d.id,p=n.get(m);let f=m;if(p.rowspan>1||p.colspan>1){const E=l.get(m).findIndex(C=>C.row===d.row&&C.col===d.col);E>0&&(f=`${m}-uni-${E+1}`)}const h=new Set;a?(h.add("top"),h.add("bottom"),(u===0||o[u-1].col!==d.col-1)&&h.add("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&h.add("right")):(h.add("left"),h.add("right"),(u===0||o[u-1].row!==d.row-1)&&h.add("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&h.add("bottom"));const y=[];h.has("top")&&h.has("left")&&y.push("topLeft"),h.has("top")&&h.has("right")&&y.push("topRight"),h.has("bottom")&&h.has("left")&&y.push("bottomLeft"),h.has("bottom")&&h.has("right")&&y.push("bottomRight"),y.length>0&&(c[f]=y)}return c}function uD(e,t,n,r){const o={...e,cells:e.cells.map(i=>{const s={...i};return s.style&&(s.style={...s.style},s.style.padding&&(s.style.padding={...s.style.padding})),s})};for(const i of o.cells)if(t.includes(i.id)){i.style||(i.style={}),i.style.padding||(i.style.padding={top:0,right:0,bottom:0,left:0});for(const s of n){const a=s;i.style.padding[a]=r}["top","right","bottom","left"].forEach(s=>{i.style?.padding&&i.style.padding[s]===0&&delete i.style.padding[s]}),i.style.padding&&Object.keys(i.style.padding).length===0&&delete i.style.padding}return o}function dD(e,t){const n=new RegExp(`\\b${t}\\s*:[^;]*(;\\s*)?`,"gi");return e.replace(n,"").trim().replace(/\s*;\s*(?=;|$)/g,"").trim()}function mD(e){const t=e.match(/border-radius:\s*([^;]+)/);if(!t)return{full:null,first:null,firstNumber:null};const n=t[1].trim(),r=n.split(/\s+/)[0],o=parseInt(r),i=n.split(/\s+/)[1],s=parseInt(i),a=n.split(/\s+/)[2],l=parseInt(a),c=n.split(/\s+/)[3];return{full:n,first:r,firstNumber:o,second:i,secondNumber:s,third:a,thirdNumber:l,fourth:c,fourthNumber:parseInt(c)}}function fD(e,t,n){const r=/border-radius:\s*([^;]+)/,o=e.match(r);if(!o)return e+` border-radius: ${c1("0 0 0 0",t,n)};`;const i=c1(o[1].trim(),t,n);return e.replace(r,`border-radius: ${i}`)}function c1(e,t,n){const r=typeof n=="number"&&!isNaN(n)?Math.max(0,n):0;let o=e.split(/\s+/).filter(a=>a.trim()!=="").map(a=>{const l=parseFloat(a);return isNaN(l)?0:Math.max(0,l)}),i;if(o.length===0)i=[0,0,0,0];else if(o.length===1)i=[o[0],o[0],o[0],o[0]];else if(o.length===2)i=[o[0],o[1],o[0],o[1]];else if(o.length===3)i=[o[0],o[1],o[2],o[1]];else{const a=o.slice(0,4);i=[a[0]??0,a[1]??0,a[2]??0,a[3]??0]}const s={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3}[t];return s!==void 0&&(i[s]=r),i.map(a=>a===0?"0":`${a}px`).join(" ")}function pD(e){const t=JSON.parse(JSON.stringify(e)),n=t.rows,r=t.cols;return t.cells.forEach(o=>{const i=o.row===0,s=o.row+o.rowspan===n,a=o.col===0,l=o.col+o.colspan===r;i&&delete o.style.borders.top,s&&delete o.style.borders.bottom,a&&delete o.style.borders.left,l&&delete o.style.borders.right}),t}function hD(e){const t=JSON.parse(JSON.stringify(e));return t.cells.forEach(n=>{if(n.style?.borders?.top&&n.style?.borders?.bottom&&n.style?.borders?.left&&n.style?.borders?.right){const r=n.style.borders.top,o=n.style.borders.bottom,i=n.style.borders.left,s=n.style.borders.right;r?.width===o?.width&&r?.width===i?.width&&r?.width===s?.width&&r?.style===o?.style&&r?.style===i?.style&&r?.style===s?.style&&r?.color===o?.color&&r?.color===i?.color&&r?.color===s?.color&&(n.style.borders={border:{width:r.width,style:r.style,color:r.color}})}}),t}function gD(e,t){return typeof e!="string"&&(e=String(e||"")),typeof t!="string"&&(t=String(t||"")),e.split(" ").filter(n=>n&&!n.startsWith(t)).join(" ").trim()}function bD(e){const t={},n={};return Object.keys(e).forEach(r=>{const o=r.indexOf("-uni-");if(o===-1){const i=r;t[i]=[...e[r]],n[i]=new Set(e[r])}else{const i=r.substring(0,o);n[i]||(n[i]=new Set),e[r].forEach(s=>{n[i].add(s)}),e.hasOwnProperty(i)&&!t.hasOwnProperty(i)&&(t[i]=[...e[i]],e[i].forEach(s=>n[i].add(s)))}}),Object.keys(n).forEach(r=>{const o=r;t[o]||(t[o]=[]),t[o]=Array.from(n[o])}),t}var Gq="#1C52DC",Xq="#1C52DC",Yq="#1C52DC",Sl="none",u1="b64_",yD=/^(\d+(?:_\d+)?)(px|perc)$/;function vD(e){if(e===Sl)return Sl;let t="";return new TextEncoder().encode(qa(e)).forEach(n=>{t+=String.fromCharCode(n)}),u1+btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function ED(e){if(e===Sl)return Sl;if(!e.startsWith(u1))return e.replace(/em-doubledots/gi,":").replace(/em-dot/gi,".").replace(/em-slash/gi,"/");try{const t=atob(e.slice(4).replace(/-/g,"+").replace(/_/g,"/")),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{return""}}function SD(e){return`url("${e.replace(/[\n\r\f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function d1(e){return e.replace(/\./g,"_").replace(/%/g,"perc")}function m1(e){const t=e.match(yD);return t?t[1].replace("_",".")+(t[2]==="perc"?"%":"px"):e}function wD(){return Hd()}function Ie(e,t){const n=wD();n&&n.insertAdjacentHTML("beforeend",`
85
+ ${BP()}
86
+ .${e} { ${t} }
87
+ }
88
+ `)}function ge(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function f1(e){const t=e.settings.mobileWidth;if(t.value!=null){let n="";if(t.dim?n=t.classNamePrefix+t.value+(t.dim==="%"?"perc":"px"):n=t.classNamePrefix+t.value,ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim)Ie(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`);else{const r=t.value!=="auto"?t.value:"none";Ie(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${r} !important;`)}}else ge(e.elem,t.classNamePrefix)}function CD(e){const t=e.settings.mobileContentWidth;if(t.value!=null){let n="";t.dim?n=t.classNamePrefix+t.value+(t.dim==="%"?"perc":"px"):n=t.classNamePrefix+t.value,ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim?Ie(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`):Ie(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${t.value}${t.dim} !important;`)}else ge(e.elem,t.classNamePrefix)}function Bo(e){const t=e.settings.mobileHeight;if(t.value!=null){let n="";t.dim?n=t.classNamePrefix+t.value+(t.dim==="%"?"perc":"px"):n=t.classNamePrefix+t.value,ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim?Ie(n,`height: ${t.value}${t.dim} !important;`):Ie(n,`height: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function AD(e){const t=["all","top","right","bottom","left"],n={all:"em-mob-border_all-",top:"em-mob-border_top-",right:"em-mob-border_right-",bottom:"em-mob-border_bottom-",left:"em-mob-border_left-"},r=Object.values(n);e.elem.classList.forEach(i=>{r.some(s=>i.includes(s))&&e.elem.classList.remove(i)});const o=e.settings.mobileBorder;t.forEach(i=>{const s=o[i];if(s&&(parseInt(String(s.width))||s.style||s.color)){let a=(s.classNamePrefix||n[i])+(s.width!=null?s.width+"px":"")+(s.style?"_"+s.style:"")+(s.color?"_"+s.color.substring(1):"");e.elem.classList.add(a),$e();let l="";i==="all"?l=(s.width!=null?`border-width: ${s.width}px !important; `:"")+(s.style?`border-style: ${s.style} !important; `:"")+(s.color?`border-color: ${s.color} !important; `:""):l=(s.width!=null?`border-${i}-width: ${s.width}px !important; `:"")+(s.style?`border-${i}-style: ${s.style} !important; `:"")+(s.color?`border-${i}-color: ${s.color} !important; `:""),Ie(a,l)}})}function TD(e){const t=e.settings.mobileBorderRadius;if(!t)return;const n=["all","topLeft","topRight","bottomRight","bottomLeft"].find(s=>s in t);if(!n)return;const r=t.classNamePrefix||`em-mob-border_radius_${n}-`,o=t[n],i=typeof o=="object"&&o!==null&&"value"in o?o.value:o;if(n==="all"&&i==null){Array.from(e.elem.classList).forEach(s=>{s.startsWith("em-mob-border_radius_")&&e.elem.classList.remove(s)});return}if(i!=null){const s=r+i;e.elem.classList.forEach(a=>{a.indexOf(r)>-1&&e.elem.classList.remove(a)}),n==="all"&&Array.from(e.elem.classList).forEach(a=>{a.startsWith("em-mob-border_radius_")&&e.elem.classList.remove(a)}),e.elem.classList.add(s),$e(),Ie(s,`${{all:"border-radius",topLeft:"border-top-left-radius",topRight:"border-top-right-radius",bottomRight:"border-bottom-right-radius",bottomLeft:"border-bottom-left-radius"}[n]||"border-radius"}: ${i}px !important;`),n!=="all"&&["em-mob-border_radius_topLeft","em-mob-border_radius_topRight","em-mob-border_radius_bottomLeft","em-mob-border_radius_bottomRight"].every(a=>Array.from(e.elem.classList).some(l=>l.startsWith(a)))&&ge(e.elem,"em-mob-border_radius_all-")}else e.elem.classList.forEach(s=>{s.indexOf(r)>-1&&e.elem.classList.remove(s)})}function _D(e){const t=e.settings.mobileBoxShadow,n=t.classNamePrefix||"em-mob-box_shadow-";if(t.hOffset!=null||t.vOffset!=null||t.blurRadius!=null||t.spreadRadius!=null){const r=t.hOffset!=null?`${t.hOffset}px`:"0px",o=t.vOffset!=null?`${t.vOffset}px`:"0px",i=t.blurRadius!=null?`${t.blurRadius}px`:"0px",s=t.spreadRadius!=null?`${t.spreadRadius}px`:"0px",a=t.color||"#000000",l=t.inset?" inset":"",c=n+(t.hOffset!=null?t.hOffset+"px":"0px")+"_"+(t.vOffset!=null?t.vOffset+"px":"0px")+"_"+(t.blurRadius!=null?t.blurRadius+"px":"0px")+"_"+(t.spreadRadius!=null?t.spreadRadius+"px":"0px")+"_"+(t.color?t.color.substring(1):"000000")+(t.inset?"_inset":"");ge(e.elem,n),e.elem.classList.add(c),$e(),Ie(c,`box-shadow:${l} ${r} ${o} ${i} ${s} ${a} !important;`)}else if(t.value){const r=(t.classNamePrefix||"em-mob-boxshadow_")+t.value.replace(/\s/g,"_").replace(/\(/g,"").replace(/\)/g,"").replace(/,/g,"-");ge(e.elem,t.classNamePrefix||"em-mob-boxshadow_"),e.elem.classList.add(r),$e(),Ie(r,`box-shadow: ${t.value} !important;`)}else ge(e.elem,n)}function p1(e){const t=e.fieldName??"mobileAlign",n=e.settings[t];if(n.value){const r=n.classNamePrefix+n.value;ge(e.elem,n.classNamePrefix),e.elem.classList.add(r),$e(),Ie(r,`text-align: ${n.value} !important;`)}else ge(e.elem,n.classNamePrefix)}function kD(e){const t=e.settings.mobileAlign;if(t.value){const n=t.classNamePrefix+t.value;ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e();let r="";t.value==="left"||t.value==="right"?r=`float: ${t.value}`:r="margin: 0 auto",Ie(n,`${r} !important;`)}else ge(e.elem,t.classNamePrefix)}function h1(e){const t=e.settings.mobileVerticalAlign;if(t.value){const n=t.classNamePrefix+t.value;ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`vertical-align: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function LD(e){const t=e.settings.mobileDirection;if(t.value){const n=t.classNamePrefix+t.value;ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`direction: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function ND(e){const t=e.settings.mobileBackgroundColor;if(t.value){const n=t.value!=="none"?String(t.value).substring(1):"none",r=t.classNamePrefix+n;ge(e.elem,t.classNamePrefix),e.elem.classList.add(r),$e(),Ie(r,`background-color: ${t.value!=="none"?t.value:"transparent"} !important;`)}else ge(e.elem,t.classNamePrefix)}function xD(e){const t=e.settings.mobileBackgroundImage[0];if(t.value){const n=String(t.value),r=t.classNamePrefix+vD(n);ge(e.elem,t.classNamePrefix),e.elem.classList.add(r),$e(),Ie(r,`background-image: ${n!=="none"?SD(qa(n)):"none"} !important;`)}else ge(e.elem,t.classNamePrefix)}function MD(e){const t=e.settings.mobileBackgroundPositionX;if(t.value){const n=t.classNamePrefix+d1(String(t.value));ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`background-position-x: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function RD(e){const t=e.settings.mobileBackgroundPositionY;if(t.value){const n=t.classNamePrefix+d1(String(t.value));ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`background-position-y: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function OD(e){const t=e.settings.mobileBackgroundRepeat;if(t.value&&t.value!=="none"){const n=t.classNamePrefix+t.value;ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`background-repeat: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function PD(e){const t=e.settings.mobileBackgroundSize;if(t.value){const n=t.classNamePrefix+t.value;ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`background-size: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function ts(e){const t=e.settings.mobilePadding;$e(),["top","right","bottom","left"].forEach(n=>{const r=t[n];if(r!=null){wv({elem:e.elem,position:n});const o=t.classNamePrefix+n+"-"+r;e.elem.classList.add(o),Ie(o,`padding-${n}: ${r}px !important;`)}else r===null&&wv({elem:e.elem,position:n})})}function g1(e){const t=e.settings.mobileFontSize;if(t.value!=null){const n=t.classNamePrefix+t.value+"px";ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`font-size: ${t.value}px !important;`)}else ge(e.elem,t.classNamePrefix)}function b1(e){const t=e.settings.mobileLineHeight;if(t&&t.value!==null){const n=t.classNamePrefix+t.value+"px";ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Ie(n,`line-height: ${t.value}px !important;`)}else t&&ge(e.elem,t.classNamePrefix)}function y1(e){const t=e.settings.show,n=()=>{e.elem.style.removeProperty("display"),e.elem.tagName==="IMG"&&(e.elem.style.display="block"),e.elem.previousSibling&&e.elem.previousSibling.textContent?.indexOf("mso")!==-1&&e.elem.previousSibling.remove(),e.elem.nextSibling&&e.elem.nextSibling.textContent?.indexOf("endif")!==-1&&e.elem.nextSibling.remove()};if(t!=="all"){const r="em-show-"+e.elem.tagName?.toLowerCase()+"-"+t;if(e.elem.classList.forEach(o=>{o.indexOf("em-show-")>-1&&e.elem.classList.remove(o)}),e.elem.classList.add(r),$e(),t==="mobile"){e.elem.style.display="none",(!e.elem.previousSibling||e.elem.previousSibling.textContent?.indexOf("mso")===-1)&&(e.elem.insertAdjacentHTML("beforebegin","<!--[if !mso]><!-->"),e.elem.insertAdjacentHTML("afterend","<!--<![endif]-->"));let o="block";e.elem.tagName==="TD"?o="table-cell":e.elem.tagName==="IMG"?o="block":e.elem.tagName==="TABLE"&&(o="table"),Ie(r,`display: ${o} !important;`)}t==="desktop"&&(n(),Ie(r,"display: none !important;"))}else n(),e.elem.classList.forEach(r=>{r.indexOf("em-show-")>-1&&e.elem.classList.remove(r)})}function ID(e){const t=e.settings.isContrastBlock,n=Od();if(t){e.elem.closest('[em="block"]')?.classList.add("em-contrast-block");const r=n.block?.contrastBackgroundColor||"#1C52DC";e.elem.setAttribute("bgcolor",r),e.elem.style.backgroundColor=r;const o=e.elem.querySelectorAll('div[style*="font-family"]');o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)<=20&&(s.style.color=n.text?.contrastColor||"#FFFFFF")}),o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)>20&&(s.style.color=n.headings?.contrastColor||"#FFFFFF")}),e.elem.querySelectorAll('a[style*="color"]').forEach(i=>{const s=i;s.style.display||(s.style.color=n.links?.contrastColor||"#FFFFFF")}),e.elem.querySelectorAll('a[style*="font-family"]').forEach(i=>{const s=i;if(s.style.display&&s.style.display==="block"){s.style.color=n.buttons?.contrastColor||"#1C52DC";const a=s.closest("td");if(a){const l=n.buttons?.contrastBackgroundColor||"#FFFFFF";a.setAttribute("bgcolor",l),a.style.backgroundColor=l}}})}else{e.elem.closest('[em="block"]')?.classList.remove("em-contrast-block");const r=n.block?.backgroundColor||"#FFFFFF";e.elem.setAttribute("bgcolor",r),e.elem.style.backgroundColor=r;const o=e.elem.querySelectorAll('div[style*="font-family"]');o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)<=20&&(s.style.color=n.text?.color||"")}),o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)>20&&(s.style.color=n.headings?.color||"")}),e.elem.querySelectorAll('a[style*="color"]').forEach(i=>{const s=i;s.style.display||(s.style.color=n.links?.color||"")}),e.elem.querySelectorAll('a[style*="font-family"]').forEach(i=>{const s=i;if(s.style.display&&s.style.display==="block"){s.style.color=n.buttons?.color||"";const a=s.closest("td");if(a){const l=n.buttons?.backgroundColor||"";a.setAttribute("bgcolor",l),a.style.backgroundColor=l}}})}}function DD(){return{mobileWidth:null,mobileWidthDim:"px",mobileHeight:null,mobileHeightDim:"px",mobileBorder:{all:{width:null,style:null,color:null},top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}},mobileBorderRadius:{all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},mobileBoxShadow:{hOffset:null,vOffset:null,blurRadius:null,spreadRadius:null,color:null,inset:null},mobileAlign:{value:""},mobileTextAlign:{value:""},mobileVerticalAlign:{value:""},mobileDirection:{value:""},mobileBackgroundColor:{value:""},mobileBackgroundImage:[{type:"url",value:""}],mobileBackgroundPositionX:{value:""},mobileBackgroundPositionY:{value:""},mobileBackgroundRepeat:{value:"none"},mobileBackgroundSize:{value:""},mobilePadding:{all:null,bottom:null,left:null,right:null,top:null},show:"all",mobileFontSize:null,mobileFontSizeDim:"px"}}function We(e,t=!1){const n=DD();return e.elem?.classList?.forEach(r=>{if(r.indexOf("em-mob-width-")>-1&&(r.substring(r.length-2)==="px"?(n.mobileWidthDim="px",n.mobileWidth=parseFloat(r.substring(13,r.length-2))):r.substring(r.length-4)==="perc"?(n.mobileWidthDim="%",n.mobileWidth=parseFloat(r.substring(13,r.length-4))):r.substring(r.length-4)==="auto"&&(n.mobileWidthDim="px",n.mobileWidth="auto")),r.indexOf("em-mob-height-")>-1&&(r.substring(r.length-2)==="px"?(n.mobileHeightDim="px",n.mobileHeight=parseFloat(r.substring(14,r.length-2))):r.substring(r.length-4)==="perc"?(n.mobileHeightDim="%",n.mobileHeight=parseFloat(r.substring(14,r.length-4))):r.substring(r.length-4)==="auto"&&(n.mobileHeightDim="px",n.mobileHeight="auto")),r.indexOf("em-mob-border")>-1){if(r.substring(14,17)==="all"){const o=r.substring(18).split("_");n.mobileBorder.all.width=parseFloat(o[0]),n.mobileBorder.all.style=o[1],n.mobileBorder.all.color=o[2]?"#"+o[2]:""}if(r.substring(14,17)==="top"){const o=r.substring(18).split("_");n.mobileBorder.top.width=parseFloat(o[0]),n.mobileBorder.top.style=o[1],n.mobileBorder.top.color=o[2]?"#"+o[2]:""}if(r.substring(14,19)==="right"){const o=r.substring(20).split("_");n.mobileBorder.right.width=parseFloat(o[0]),n.mobileBorder.right.style=o[1],n.mobileBorder.right.color=o[2]?"#"+o[2]:""}if(r.substring(14,20)==="bottom"){const o=r.substring(21).split("_");n.mobileBorder.bottom.width=parseFloat(o[0]),n.mobileBorder.bottom.style=o[1],n.mobileBorder.bottom.color=o[2]?"#"+o[2]:""}if(r.substring(14,18)==="left"){const o=r.substring(19).split("_");n.mobileBorder.left.width=parseFloat(o[0]),n.mobileBorder.left.style=o[1],n.mobileBorder.left.color=o[2]?"#"+o[2]:""}}if(r.indexOf("em-mob-border_radius")>-1&&(r.substring(21,28)==="topLeft"&&(n.mobileBorderRadius.topLeft=parseFloat(r.substring(29))),r.substring(21,29)==="topRight"&&(n.mobileBorderRadius.topRight=parseFloat(r.substring(30))),r.substring(21,32)==="bottomRight"&&(n.mobileBorderRadius.bottomRight=parseFloat(r.substring(33))),r.substring(21,31)==="bottomLeft"&&(n.mobileBorderRadius.bottomLeft=parseFloat(r.substring(32))),r.substring(21,24)==="all"&&(n.mobileBorderRadius.all=parseFloat(r.substring(25)))),r.indexOf("em-mob-box_shadow")>-1){const o=r.substring(18).split("_");n.mobileBoxShadow.hOffset=parseFloat(o[0]),n.mobileBoxShadow.vOffset=parseFloat(o[1]),n.mobileBoxShadow.blurRadius=parseFloat(o[2]),n.mobileBoxShadow.spreadRadius=parseFloat(o[3]),n.mobileBoxShadow.color=o[4]?"#"+o[4]:"",n.mobileBoxShadow.inset=!!o[5]}r.indexOf("em-mob-text_align")>-1&&(n.mobileAlign.value=r.substring(18)),r.indexOf("em-mob-table_align")>-1&&(n.mobileAlign.value=r.substring(19)),r.indexOf("em-mob-vertical_align")>-1&&(n.mobileVerticalAlign.value=r.substring(22)),r.indexOf("em-mob-direction")>-1&&(n.mobileDirection.value=r.substring(17)),r.indexOf("em-mob-background_color")>-1&&(n.mobileBackgroundColor.value=r.substring(24)!=="none"?"#"+r.substring(24):"none"),r.indexOf("em-mob-background_image")>-1&&(n.mobileBackgroundImage[0].value=ED(r.substring(24))),r.indexOf("em-mob-background_position_x")>-1&&(n.mobileBackgroundPositionX.value=m1(r.substring(29))),r.indexOf("em-mob-background_position_y")>-1&&(n.mobileBackgroundPositionY.value=m1(r.substring(29))),r.indexOf("em-mob-background_repeat")>-1&&(n.mobileBackgroundRepeat.value=r.substring(25)),r.indexOf("em-mob-background_size")>-1&&(n.mobileBackgroundSize.value=r.substring(23)),r.indexOf("em-mob-padding")>-1&&(r.substring(15,18)==="all"&&(n.mobilePadding.all=parseFloat(r.substring(19))),r.substring(15,18)==="top"&&(n.mobilePadding.top=parseFloat(r.substring(19))),r.substring(15,20)==="right"&&(n.mobilePadding.right=parseFloat(r.substring(21))),r.substring(15,21)==="bottom"&&(n.mobilePadding.bottom=parseFloat(r.substring(22))),r.substring(15,19)==="left"&&(n.mobilePadding.left=parseFloat(r.substring(20)))),r.indexOf("em-show")>-1&&(r.substring(r.length-6)==="mobile"?n.show="mobile":r.substring(r.length-7)==="desktop"&&(n.show="desktop")),t&&(r==="em-amp-show-only"?n.ampShow="amp":r==="em-amp-show-disabled"&&(n.ampShow="html")),r.indexOf("em-mob-font_size")>-1&&(n.mobileFontSizeDim="px",n.mobileFontSize=r.substring(17,r.length-2)),r.indexOf("em-mob-line_height")>-1&&(n.mobileLineHeight=r.substring(19,r.length-2))}),n}function BD(e){const t={all:null,top:null,right:null,bottom:null,left:null},n={all:null,top:null,right:null,bottom:null,left:null},r=We({elem:e}),o=r.mobileWidth,i=r.mobileHeight;(e.style.padding||e.style.paddingTop||e.style.paddingRight||e.style.paddingBottom||e.style.paddingLeft)&&(!e.style.padding||e.style.padding.indexOf(" ")>-1?t.all=null:!e.style.padding&&e.style.paddingTop&&e.style.paddingRight&&e.style.paddingBottom&&e.style.paddingLeft&&e.style.paddingTop===e.style.paddingRight&&e.style.paddingRight===e.style.paddingBottom&&e.style.paddingBottom===e.style.paddingLeft?t.all=parseFloat(e.style.paddingTop):t.all=parseFloat(e.style.padding),t.top=e.style.paddingTop?parseFloat(e.style.paddingTop):null,t.right=e.style.paddingRight?parseFloat(e.style.paddingRight):null,t.bottom=e.style.paddingBottom?parseFloat(e.style.paddingBottom):null,t.left=e.style.paddingLeft?parseFloat(e.style.paddingLeft):null),(r.mobilePadding.all!==null||r.mobilePadding.top!==null||r.mobilePadding.right!==null||r.mobilePadding.bottom!==null||r.mobilePadding.left!==null)&&(r.mobilePadding.all?!r.mobilePadding.all&&r.mobilePadding.top&&r.mobilePadding.right&&r.mobilePadding.bottom&&r.mobilePadding.left&&r.mobilePadding.top===r.mobilePadding.right&&r.mobilePadding.right===r.mobilePadding.bottom&&r.mobilePadding.bottom===r.mobilePadding.left?n.all=parseFloat(String(r.mobilePadding.top)):n.all=r.mobilePadding.all!==null?parseFloat(String(r.mobilePadding.all)):null:n.all=null,n.top=r.mobilePadding.top!==null?parseFloat(String(r.mobilePadding.top)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.right=r.mobilePadding.right!==null?parseFloat(String(r.mobilePadding.right)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.bottom=r.mobilePadding.bottom!==null?parseFloat(String(r.mobilePadding.bottom)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.left=r.mobilePadding.left!==null?parseFloat(String(r.mobilePadding.left)):r.mobilePadding.all===null?null:r.mobilePadding.all);let s=e.getAttribute("align")??"";e.parentElement?.getAttribute("em")!=="group"&&e.querySelector('[em="atom"]')&&e.querySelectorAll('[em="atom"] > tr > td').forEach(c=>{c.getAttribute("align")!==s&&(s="")});const a={padding:t,borderRadius:Ui(e),backgroundColor:e.style.backgroundColor?X(e.style.backgroundColor):e.getAttribute("bgcolor")||"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:e.style.backgroundPositionX&&e.style.backgroundPositionX!=="initial"?e.style.backgroundPositionX:"",backgroundPositionY:e.style.backgroundPositionY&&e.style.backgroundPositionY!=="initial"?e.style.backgroundPositionY:"",backgroundRepeat:e.style.backgroundRepeat||"repeat",backgroundSize:e.style.backgroundSize||"auto",height:{value:e.getAttribute("height")&&e.getAttribute("height")!=="auto"?parseFloat(e.getAttribute("height")):null,dim:e.getAttribute("height")&&e.getAttribute("height")!=="auto"&&e.getAttribute("height").indexOf("%")>-1?"%":"px"},align:s,valign:e.getAttribute("valign")??"",border:fl(e),boxShadow:ji(e),mobileWidth:{value:o!==null?o:null,dim:r.mobileWidthDim},mobileHeight:{value:i!==null?i:null,dim:r.mobileHeightDim},mobileBorder:r.mobileBorder,mobileBorderRadius:r.mobileBorderRadius,mobileBoxShadow:r.mobileBoxShadow,mobileAlign:r.mobileAlign,mobileVerticalAlign:r.mobileVerticalAlign,mobileDirection:r.mobileDirection,mobileBackgroundColor:r.mobileBackgroundColor,mobileBackgroundImage:r.mobileBackgroundImage,mobileBackgroundPositionX:r.mobileBackgroundPositionX,mobileBackgroundPositionY:r.mobileBackgroundPositionY,mobileBackgroundRepeat:r.mobileBackgroundRepeat,mobileBackgroundSize:r.mobileBackgroundSize,mobilePadding:n,show:r.show,exportAsPicture:e.getAttribute("em-operation")==="exportAsPicture",outlookBackground:Yi(e,"inside")},l=e.closest("table");if(l&&l.getAttribute("em")==="atom"){const c=l.getAttribute("width");a.width={value:c&&c!=="auto"?parseFloat(c):null,dim:c&&c!=="auto"&&c.indexOf("%")>-1?"%":"px"}}else{const c=e.getAttribute("width");a.width={value:c&&c!=="auto"?parseFloat(c):null,dim:c&&c!=="auto"&&c.indexOf("%")>-1?"%":"px"}}if(e.style.backgroundImage){const c=e.style.backgroundImage;a.backgroundImage=[{type:"url",value:c?c.substring(5,c.length-2):""}]}else e.getAttribute("background")&&(a.backgroundImage=[{type:"url",value:e.getAttribute("background")||""}]);return a}function HD(e){let t=[],n=null,r=null,o="",i,s=!1;if(e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap")){const a=e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap");if(i=!0,a.parentElement.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1)a.parentElement.querySelectorAll(":scope > .em-mob-wrap:nth-child(odd), :scope > .noresp-em-mob-wrap:nth-child(odd)").forEach(l=>{t.push({width:parseFloat(l.getAttribute("width")||"0"),current:l===a});const c=a.parentElement.querySelector(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap");c?.nextElementSibling&&(n=parseFloat(c.nextElementSibling.getAttribute("width")||"0"),r=We({elem:c.nextElementSibling}).mobileHeight||0),(l.classList.contains("em-mob-wrap-cancel")||l.classList.contains("noresp-em-mob-wrap-cancel"))&&(i=!1)});else{const l=a.parentElement.querySelector(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap");t=[{width:parseFloat(l?.getAttribute("width")||"0"),current:!0}],n=0}o=a.parentElement.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.getAttribute("valign")||"",(e.elem.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap").parentElement.closest("td"))?.getAttribute("dir")==="rtl"&&(s=!0)}else{const a=e.elem.closest('div[style*="inline-block"]');if(a&&a.parentElement.querySelectorAll('div[style*="inline-block"]').length>1)a.parentElement.querySelectorAll('div[style*="inline-block"]').forEach(l=>{const c=l;if(!c.style.fontFamily){const u=l.firstElementChild;t.push({width:parseFloat(u?.getAttribute("width")||"0"),current:l===a});const d=u?.getAttribute("width"),m=parseFloat(c.style.width);n=m-(!d||d.indexOf("%")>-1?m:parseFloat(d))}});else{const l=a?.parentElement?.querySelector('div[style*="inline-block"]');t=[{width:parseFloat(l?.firstElementChild?.getAttribute("width")||"0"),current:!0}],n=0}o=a?.parentElement?.querySelector('div[style*="inline-block"]')?.style.verticalAlign||"",(e.elem.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.elem.closest('div[style*="inline-block"]')?.parentElement)?.getAttribute("dir")==="rtl"&&(s=!0)}return{items:t,gap:n,gapMobile:r,valign:o,wrap:i,dirRevers:s}}var FD='table[em-type="social"]';function $D(e){return e.closest(FD)}function WD(e,t){return t.contains(e)?!!(e.tagName==="IMG"||e.tagName==="TD"&&(e.hasAttribute("em-platform")||e.hasAttribute("data-em-platform"))||e.tagName==="A"&&e.querySelector(":scope > img")):!1}function wl(e){const t=$D(e);if(t&&e!==t&&WD(e,t))return t;const n=e.parentNode;if(!n)return!1;const r=n.tagName,o=n.style,i=n.parentNode;return r==="TD"||r==="TABLE"&&i?.style.display!=="inline-block"&&!e.closest(".em-narrow-table")&&n.getAttribute("em")!=="atom"||r==="DIV"&&(o.display==="inline-block"||o.display==="table-cell")&&o.verticalAlign||(r==="DIV"||r==="TABLE")&&qD(o)?n:wl(n)}function qD(e){return!!(e.width||e.minWidth||e.maxWidth||e.height||e.background||e.backgroundColor||e.backgroundPositionX||e.backgroundPositionY||e.backgroundImage||e.backgroundRepeat||e.backgroundSize||e.padding||e.paddingTop||e.paddingRight||e.paddingBottom||e.paddingLeft||e.border||e.borderBottom||e.borderBottomWidth||e.borderBottomStyle||e.borderBottomColor||e.borderLeft||e.borderLeftWidth||e.borderLeftStyle||e.borderLeftColor||e.borderTop||e.borderTopWidth||e.borderTopStyle||e.borderTopColor||e.borderRight||e.borderRightWidth||e.borderRightStyle||e.borderRightColor||e.borderRadius||e.borderTopLeftRadius||e.borderTopRightRadius||e.borderBottomLeftRadius||e.borderBottomRightRadius||e.boxShadow||e.textAlign||e.align||e.verticalAlign)}function ns(){return Et.getInstance(ac)?.localized??{}}var v1=[];function zD(){return v1}function E1(e){const t=ns();let n="",r="";switch(e.tagName){case"A":e.style.display==="block"?(n=t.ELEMENT_PATH_BUTTON,r="em-element-path-item-button"):(n=t.ELEMENT_PATH_LINK,r="em-element-path-item-link");break;case"IMG":e.closest('table[em-type="social"]')?n=t.ELEMENT_PATH_SOCIAL:n=t.ELEMENT_PATH_IMG,r="em-element-path-item-image";break;case"TD":e.parentElement?.getAttribute("em")==="block"?(n=t.ELEMENT_PATH_BLOCK,r="em-element-path-item-block"):e.parentElement?.getAttribute("em")==="atom"||e.closest("table")?.getAttribute("em")==="atom"?(n=t.ELEMENT_PATH_ATOM,r="em-element-path-item-atom"):e.parentElement?.getAttribute("em")==="group"?(n=t.ELEMENT_PATH_GROUP,r="em-element-path-item-group"):e.classList.contains("em-vindent")?(n=t.ELEMENT_PATH_VINDENT,r="em-element-path-item-vindent"):e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap")?(n=t.ELEMENT_PATH_FLOATBLOCK,r="em-element-path-item-column"):(n=t.ELEMENT_PATH_TD,r="em-element-path-item-block");break;case"TABLE":e.getAttribute("em")==="block"?(n=t.ELEMENT_PATH_BLOCK,r="em-element-path-item-block"):e.getAttribute("em")==="atom"&&e.getAttribute("em-type")==="social"?(n=t.ELEMENT_PATH_SOCIAL,r="em-element-path-item-atom"):e.getAttribute("em")==="atom"?(n=t.ELEMENT_PATH_ATOM,r="em-element-path-item-atom"):e.getAttribute("em")==="group"?(n=t.ELEMENT_PATH_GROUP,r="em-element-path-item-group"):e.parentElement?.tagName==="BODY"?(n=t.ELEMENT_PATH_EMAIL,r="em-element-path-item-email"):(n=t.ELEMENT_PATH_TABLE,r="em-element-path-item-table");break;case"SPAN":case"B":case"I":case"EM":case"STRONG":case"P":case"H1":case"H2":case"H3":case"H4":case"H5":case"DIV":case"STRIKE":case"S":case"U":e.style.display==="inline-block"?(n=t.ELEMENT_PATH_FLOATBLOCK,r="em-element-path-item-column"):e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight&&e.style.color?(n=t.ELEMENT_PATH_TEXT,r="em-element-path-item-text"):e.getAttribute("em")==="block"?(n=t.ELEMENT_PATH_BLOCK,r="em-element-path-item-block"):e.getAttribute("em")==="atom"?(n=t.ELEMENT_PATH_ATOM,r="em-element-path-item-atom"):e.getAttribute("em")==="group"?(n=t.ELEMENT_PATH_GROUP,r="em-element-path-item-group"):e.classList.contains("em-vindent")?(n=t.ELEMENT_PATH_VINDENT,r="em-element-path-item-vindent"):(n=t.ELEMENT_PATH_DIV,r="em-element-path-item-block")}const o=bT(e,t);return o?.title&&(n=o.title),o?.className&&(r=o.className),e.className&&e.className.indexOf&&e.className.indexOf("em-mob-")>-1&&(r+=" em-element-path-item-mob"),{elem:e,title:n,className:r}}var VD=new Set(["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"]);function UD(e){return Array.from(e.classList).some(t=>t.startsWith("em-element-"))}function jD(e){if(e.tagName!=="TD")return!1;const t=Array.from(e.getElementsByTagName("a")),n=t[0];if(t.length!==1||n.style.display!=="block")return!1;for(let r=n.parentElement;r&&r!==e;r=r.parentElement)if(VD.has(r.tagName))return!1;return Array.from(e.children).every(r=>r===n||r.contains(n)||UD(r))}var S1='.em-narrow-table, [em="block-contaner"]';function GD(e){const t=e.style;return jD(e)?!1:!!(e.tagName==="A"&&!e.closest(".em-element-resize-img-container")&&!e.closest('table[em-type="social"]')||e.tagName==="TD"&&!e.closest(S1)||e.tagName==="TABLE"&&e.parentElement?.style?.display!=="inline-block"&&!e.classList.contains("em-vindent-table")&&!e.closest(S1)&&e.getAttribute("em")!=="atom"&&e.parentElement?.tagName!=="BODY"||e.tagName==="DIV"&&(t.display==="inline-block"||t.display==="table-cell")&&t.verticalAlign||(e.tagName==="DIV"||e.tagName==="TABLE"||e.tagName==="TD")&&!e.classList.contains("em-narrow-table")&&!e.classList.contains("noresp-em-narrow-table")&&(t.width||t.minWidth||t.maxWidth||t.background||t.backgroundColor||t.backgroundPositionX||t.backgroundPositionY||t.backgroundImage||t.backgroundRepeat||t.backgroundSize||t.height||t.padding||t.paddingTop||t.paddingRight||t.paddingBottom||t.paddingLeft||t.border||t.borderBottom||t.borderBottomWidth||t.borderBottomStyle||t.borderBottomColor||t.borderLeft||t.borderLeftWidth||t.borderLeftStyle||t.borderLeftColor||t.borderTop||t.borderTopWidth||t.borderTopStyle||t.borderTopColor||t.borderRight||t.borderRightWidth||t.borderRightStyle||t.borderRightColor||t.borderRadius||t.borderTopLeftRadius||t.borderTopRightRadius||t.borderBottomLeftRadius||t.borderBottomRightRadius||t.boxShadow||t.textAlign||t.align||t.verticalAlign)||e.tagName!=="EDITOR"&&t.fontFamily&&t.fontSize&&t.lineHeight&&t.color||e.tagName==="TD"&&e.closest("table")?.getAttribute("em")==="atom"||e.tagName==="TD"&&e.closest("tr")?.getAttribute("em")==="block"||e.tagName==="TD"&&(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))||Zp(e))}function XD(e){let t=[];const n=e.style;(e.tagName==="IMG"||e.tagName==="TD"||e.tagName==="TABLE"||e.tagName!=="EDITOR"&&n.fontFamily&&n.fontSize&&n.lineHeight&&n.color||e.tagName==="DIV"&&n.height&&n.lineHeight||Zp(e))&&t.push(E1(e));let r=e;for(;r?.parentElement&&r.parentElement.tagName!=="BODY";)r=r.parentElement,GD(r)&&t.push(E1(r));return t=t.filter(o=>!(o.elem?.tagName==="TABLE"&&o.elem.parentElement?.tagName==="BODY")),t=t.reverse(),v1=t.map(o=>({...o})),t.map(o=>({title:o.title,className:o.className}))}function w1(e){const t=ns(),n=e.parentNode;if(!n)return;if(n.tagName==="A")return t.LINK;if(n.tagName==="TD")return t.TABLE_COLUMN;const r=n.parentNode;if(n.tagName==="TABLE"&&!(r?.tagName==="DIV"&&r.style.display==="inline-block"))return t.TABLE;if(n.tagName==="DIV"&&(n.style.display==="inline-block"||n.style.display==="table-cell")&&n.style.verticalAlign)return t.FLOAT_BLOCK;if(n.tagName==="DIV"){const o=n.style;if(o.width||o.minWidth||o.maxWidth||o.background||o.backgroundColor||o.backgroundPositionX||o.backgroundPositionY||o.backgroundImage||o.backgroundRepeat||o.backgroundSize||o.height||o.padding||o.paddingTop||o.paddingRight||o.paddingBottom||o.paddingLeft||o.border||o.borderBottom||o.borderBottomWidth||o.borderBottomStyle||o.borderBottomColor||o.borderLeft||o.borderLeftWidth||o.borderLeftStyle||o.borderLeftColor||o.borderTop||o.borderTopWidth||o.borderTopStyle||o.borderTopColor||o.borderRight||o.borderRightWidth||o.borderRightStyle||o.borderRightColor||o.borderRadius||o.borderTopLeftRadius||o.borderTopRightRadius||o.borderBottomLeftRadius||o.borderBottomRightRadius||o.boxShadow||o.textAlign||o.align||o.verticalAlign)return t.CONTAINER}return w1(n)}function YD(e,t,n){n.clearActiveEditElements();const r=e.elem.closest("amp-accordion");r.setAttribute("em-edit","active");const o=n.HTMLDocument.getOuterHtml(r),i=n.parseFromString(o)[0].querySelectorAll("section"),s=Array.from(i).map(a=>({expanded:a.hasAttribute("expanded")}));return{type:"accordion",caption:t.ACCORDION,animate:r.hasAttribute("animate"),expandSingleSection:r.hasAttribute("expand-single-section"),sections:s}}function KD(e){return e.tagName==="AMP-ACCORDION"}var C1="em-mob-text_align-",ZD=":scope > tr > td, :scope > tbody > tr > td",QD='div[style*="font-family"][style*="font-size"]';function mm(e){return e.querySelector(ZD)}function fm(e){return e.querySelector(QD)}function JD(e,t){for(let n=e;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!0;return!1}function A1(e){const t=e.closest('table[em="atom"]');if(!t||JD(e,t))return null;const n=mm(t);return n?{atomTd:n,textDiv:fm(n)}:null}function rs(e){const t=e.closest("div, p, td");if(!t)return null;if(t.style.textAlign)return t;const n=A1(e);return n?n.textDiv?.hasAttribute("align")?n.textDiv:n.atomTd:t}function T1(e){const t=rs(e);return t&&(t.style.textAlign||t.getAttribute("align"))||"left"}function e8(e){const t=rs(e);if(!t)return"";for(const n of t.classList)if(n.startsWith("em-mob-text_align-"))return n.slice(18);return""}function pm(e){return{value:e8(e)}}function t8(e,t,n=C1){const r=A1(e);if(r)for(const o of[r.atomTd,r.textDiv])o&&o!==t&&dl(o,n)}function n8(e){const t=mm(e);if(!t)return null;const n=fm(t);return n?.hasAttribute("align")?n:t}function r8(e,t){e.querySelectorAll('[em="atom"]').forEach(n=>{const r=n8(n);r&&t(r,n)})}function o8(e,t,n=C1){const r=mm(e),o=r?fm(r):null;for(const i of[r,o])i&&i!==t&&dl(i,n)}function Cl(e){if(!e)return null;const t=(e.closest('[style*="line-height"]')||e.querySelector('[style*="line-height"]'))?.style.lineHeight?.trim();if(!t||t.toLowerCase()==="normal")return null;if(t.includes("px")){const i=parseFloat(t);return Number.isFinite(i)?i:null}const n=e.closest('[style*="font-size"]')?.style.fontSize||getComputedStyle(e).fontSize,r=parseFloat(n);if(!Number.isFinite(r)||r<=0)return null;if(t.includes("%")){const i=parseFloat(t);return Number.isFinite(i)?r*(i/100):null}const o=parseFloat(t);return Number.isFinite(o)?r*o:null}function os(e){if(!e)return[];const t=[],n=e.style.fontFamily||getComputedStyle(e).fontFamily,r=[...(e.closest('[style*="font-family"]')||e).classList].filter(s=>s.startsWith("em-font-")),o=r.includes(Wd),i=r.filter(s=>s!==Wd);if(i.length>0){t.push("Google Fonts"),t.push(o?"Project Fonts":n.includes("sans-serif")?"Sans Serif":"Serif");const s=i[0].slice(8),a=s.lastIndexOf("-");a>0?t.push(s.slice(0,a),s.slice(a+1)):s&&t.push(s)}else n&&t.push("Safe Fonts",n.replaceAll('"',"'"));return t}function Ze(e,t,n){if(!e||e.tagName==="DIV")return!1;const r=window.getSelection();let o=null;if(r&&r.rangeCount>0){const a=r.getRangeAt(0).commonAncestorContainer;o=a.nodeType===1?a:a.parentElement}const i=a=>{if(!a)return!1;const l=a.tagName.toLowerCase();return l===t||l===n},s=e.closest(t)||(n?e.closest(n):null);return i(e)||!!o&&i(o)||!!s}function Al(e){if(!e)return!1;const t=e.style.fontWeight||getComputedStyle(e).fontWeight;return t==="bold"||t==="700"||parseInt(t,10)>=700}function Rr(e,t="background-color"){if(!e)return"";let n=e;for(;n;){const r=n.style.getPropertyValue(t);if(r&&r!=="transparent"&&r!=="inherit")return r;n=n.parentElement}return""}function i8(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0).commonAncestorContainer;return t.nodeType===1?t:t.parentElement}function is(e){return!!e.closest(".em-show-td-mobile")||!!e.closest(".em-show-table-mobile")||!!e.closest(".em-show-div-mobile")||e.classList.contains("em-show-img-mobile")||!!e.closest(".desktop_hide")}function _1(){const e=window.getSelection();if(!e||e.rangeCount===0)return!1;let t=e.anchorNode,n=e.focusNode;t?.nodeType===3&&(t=t.parentNode),n?.nodeType===3&&(n=n.parentNode);const r=t?.closest?.("a"),o=n?.closest?.("a");return!!(r?.getAttribute("href")||o?.getAttribute("href"))}function hm(e){if(!e)return!1;for(const t of Array.from(e.childNodes))if(t.nodeType===Node.COMMENT_NODE&&t.nodeValue?.includes("[if mso]")&&t.nodeValue.includes("v:roundrect")||t.nodeType===Node.ELEMENT_NODE&&hm(t))return!0;return!1}function k1(e,t){if(!e)return{value:null,dim:"px"};const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function L1(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function s8(e){const t={all:null,top:null,right:null,bottom:null,left:null};return!e.style.padding&&!e.style.paddingTop&&!e.style.paddingRight&&!e.style.paddingBottom&&!e.style.paddingLeft||(!e.style.padding||e.style.padding.includes(" ")?t.all=null:!e.style.padding&&e.style.paddingTop&&e.style.paddingRight&&e.style.paddingBottom&&e.style.paddingLeft&&e.style.paddingTop===e.style.paddingRight&&e.style.paddingRight===e.style.paddingBottom&&e.style.paddingBottom===e.style.paddingLeft?t.all=parseFloat(e.style.paddingTop):t.all=parseFloat(e.style.padding)||null,t.top=e.style.paddingTop?parseFloat(e.style.paddingTop):null,t.right=e.style.paddingRight?parseFloat(e.style.paddingRight):null,t.bottom=e.style.paddingBottom?parseFloat(e.style.paddingBottom):null,t.left=e.style.paddingLeft?parseFloat(e.style.paddingLeft):null),t}function a8(e){const t={all:null,top:null,right:null,bottom:null,left:null};if(!e.all&&!e.top&&!e.right&&!e.bottom&&!e.left)return t;e.all?!e.all&&e.top&&e.right&&e.bottom&&e.left&&e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?t.all=parseFloat(e.top):t.all=parseFloat(e.all)||null:t.all=null;const n=e.all||null;return t.top=e.top!=null?parseFloat(e.top):n,t.right=e.right!=null?parseFloat(e.right):n,t.bottom=e.bottom!=null?parseFloat(e.bottom):n,t.left=e.left!=null?parseFloat(e.left):n,t}function l8(e){if(e.style.backgroundImage){const t=e.style.backgroundImage;return[{type:"url",value:t.substring(5,t.length-2)}]}return e.getAttribute("background")?[{type:"url",value:e.getAttribute("background")||""}]:[{type:"url",value:""}]}function c8(e,t){const n=e.elem.closest("a")||e.elem,r=e.elem.closest("td"),o=Zd(n),i=hm(r)&&!hm(n)||!!o,s=o??(i?n:r),a=e.elem.closest("table"),l=a?.closest("td")?.closest("table")?.closest("td"),c=a?.closest("div, p, td"),u=c?.style.textAlign||c?.getAttribute("align")||"left",d=We({elem:e.elem}),m=We({elem:r}),p=l?We({elem:l}):null,f=We({elem:a}),h=e.elem.closest("a"),y={type:"button",caption:t.BUTTON,fontFamily:os(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:Cl(e.elem),lineHeightDim:"px",textStrong:Ze(e.elem,"strong","b")||Al(e.elem),textItalic:Ze(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&(h?.style?.fontStyle==="italic"||e.elem.style?.fontStyle==="italic"),textStrikethrough:Ze(e.elem,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1)||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("line-through"),textUnderline:Ze(e.elem,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("underline"),textColor:X(Rr(e.elem,"color"))||X(getComputedStyle(e.elem).color)||"",textBackgroundColor:X(Rr(e.elem,"background-color"))||"",padding:s8(o??n),borderRadius:Ui(s),backgroundColor:s.style.backgroundColor?X(s.style.backgroundColor):s.getAttribute("bgcolor")||"",backgroundImage:l8(r),backgroundPositionX:r.style.backgroundPositionX!=="initial"?r.style.backgroundPositionX:"",backgroundPositionY:r.style.backgroundPositionY!=="initial"?r.style.backgroundPositionY:"",backgroundRepeat:r.style.backgroundRepeat||"repeat",backgroundSize:r.style.backgroundSize||"auto",width:k1(a,"width"),height:k1(r,"height"),align:u,valign:r.getAttribute("valign")??"",textAlign:r.getAttribute("align")??"",border:fl(s),boxShadow:ji(s),href:n.getAttribute("href")??"",outlookRounding:i,outlookBackground:Yi(r,"inside"),mobileWidth:{value:L1(f.mobileWidth),dim:f.mobileWidthDim??"px"},mobileHeight:{value:L1(m.mobileHeight),dim:m.mobileHeightDim??"px"},mobileBorder:m.mobileBorder,mobileBorderRadius:m.mobileBorderRadius,mobileBoxShadow:m.mobileBoxShadow,mobileAlign:f.mobileAlign,mobileFontSize:{value:d.mobileFontSize,dim:d.mobileFontSizeDim||"px"},mobileTextAlign:pm(e.elem),mobileVerticalAlign:p?.mobileVerticalAlign,mobileBackgroundColor:m.mobileBackgroundColor,mobileBackgroundImage:m.mobileBackgroundImage,mobileBackgroundPositionX:m.mobileBackgroundPositionX,mobileBackgroundPositionY:m.mobileBackgroundPositionY,mobileBackgroundRepeat:m.mobileBackgroundRepeat,mobileBackgroundSize:m.mobileBackgroundSize,mobilePadding:a8(d.mobilePadding),mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},show:f.show,exportAsPicture:a?.getAttribute("em-operation")==="exportAsPicture"};return is(e.elem)&&(y.showOnMobile=!0),y}function u8(e){if(Qd(e.closest("a")))return!0;const t=e.getAttribute("style");if(!t||!t.includes("display"))return!1;const n=e.style.display;return!(n!=="block"&&n!=="inline-block"||t.includes("mso-style-priority"))}function d8(e,t){return t?!1:e.tagName==="A"||e.tagName==="EM-REPLACE"&&!!e.closest("a")}function m8(e){const t=e.closest("a"),n=e.closest('a[style*="display"]');if(Qd(t))return!0;if(t&&n){const r=n.style.display;if(r==="block"||r==="inline-block")return!0}if(e.tagName==="A"){const r=e.getAttribute("style");if(r&&r.includes("display")&&e.closest("td[height]"))return!0}return!1}function N1(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function x1(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function M1(e){return{src:e.getAttribute("src")??"",width:N1(e,"width"),height:N1(e,"height"),alt:e.getAttribute("alt")??"",title:e.getAttribute("title")??"",link:e.closest("a")?.getAttribute("href")??null,imgReplacer:e.closest("em-replace")?.getAttribute("src")??""}}function f8(e,t,n){n.clearActiveEditElements();const r=e.elem.closest("amp-carousel");r.setAttribute("em-edit","active");const o=r.querySelectorAll("amp-img"),i=p8(o),s=Array.from(o).map((u,d)=>{const m=We({elem:u}),p=M1(u);return{src:p.src,width:p.width,height:p.height,alt:p.alt,title:p.title,link:p.link,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:p.imgReplacer,mobileWidth:{value:x1(m.mobileWidth),dim:m.mobileWidthDim??"px"},mobileHeight:{value:x1(m.mobileHeight),dim:m.mobileHeightDim??"px"},mobileBorderRadius:m.mobileBorderRadius,slideIndex:d}}),a=We({elem:r}),l={type:"carousel",caption:t.CAROUSEL,carouselImages:s,borderRadius:Ui(r),mobileBorderRadius:a.mobileBorderRadius,loop:r.hasAttribute("loop"),autoplay:r.hasAttribute("autoplay"),link:i},c=r.closest("td");return c&&(l.maxWidth=Math.round(c.getBoundingClientRect().width)),l}function p8(e){const t=Array.from(e,n=>n.closest("a")?.getAttribute("href"));return t.length>0&&t.every(n=>n&&n===t[0])?t[0]??null:null}function h8(e){return!!e.closest("amp-carousel")}function ss(e,t,n){const r=n==="All"?"border":`border-${n.toLowerCase()}`,o=e?.includes(`${r}:`);if(n==="All")return{color:t.getAttribute("bordercolor")?X(t.getAttribute("bordercolor")):t.style?.border?X(t.style.borderColor):"",width:t.getAttribute("border")||(t.style?.border?t.style.borderWidth:""),style:e?.includes("border:")?t.style.borderStyle:t.getAttribute("border")?"solid":""};const i=`border${n}Color`,s=`border${n}Width`,a=`border${n}Style`;return{color:o?X(t.style[i]):"",width:o?t.style[s]:"",style:o?t.style[a]:""}}function as(e,t,n){const r=n==="All"?"border":`border-${n.toLowerCase()}`,o=!!e?.includes(`${r}:`);if(n==="All")return{color:o?X(t.style.borderColor):"",width:o?t.style.borderTopWidth:0,style:o?t.style.borderStyle:""};const i=`border${n}Color`,s=`border${n}Width`,a=`border${n}Style`;return{color:o?X(t.style[i]):"",width:o?t.style[s]:0,style:o?t.style[a]:""}}function g8(e){return!!e.closest(".em-element-custom-table")}function b8(e,t,n){const r=e.elem,o=r.tagName==="DIV"||r.querySelector(`.${n.CLASS_FOR_BASIC_CELL}`)||r.querySelector("EDITOR")?r.closest("TD"):r,i=o.closest("TABLE"),s=i.getAttribute("style"),a=o.getAttribute("style"),l=n.parseTableElementToModel(i);if(n.activeCell.length>1){const h=l.cells.find(y=>y.id===n.activeCell[0]);l.cells.find(y=>y.id===n.activeCell[n.activeCell.length-1])?.style,h?.style}const c=i?.style?.borderRadius?n.extractBorderRadius(s||""):null,u=c?c.firstNumber===c.secondNumber&&c.secondNumber===c.thirdNumber&&c.thirdNumber===c.fourthNumber:!1,d=n.parseBackgroundStyles(s||""),m=ji(i),p=We({elem:i}),f={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none",show:p.show,outlookBackground:Yi(r.closest(".em-element-custom-table")??r,"around"),customTable:{paddingLeftRight:o.style.paddingLeft===o.style.paddingRight?o.style.paddingLeft:"",paddingTopBottom:o.style.paddingTop===o.style.paddingBottom?o.style.paddingTop:"",paddingLeft:o.style.paddingLeft,paddingRight:o.style.paddingRight,paddingTop:o.style.paddingTop,paddingBottom:o.style.paddingBottom,backgroundColor:i.getAttribute("bgcolor")?X(i.getAttribute("bgcolor")):"",backgroundImage:[{type:"url",value:d?.backgroundImage??""}],backgroundPositionX:d?.backgroundPositionX??"center",backgroundPositionY:d?.backgroundPositionY??"center",backgroundRepeat:d?.backgroundRepeat??"repeat",backgroundSize:d?.backgroundSize??"cover",borderAll:ss(s,i,"All"),borderBottom:ss(s,i,"Bottom"),borderTop:ss(s,i,"Top"),borderRight:ss(s,i,"Right"),borderLeft:ss(s,i,"Left"),borderRadius:{all:s?.includes("border-radius:")&&u?+c.firstNumber:null,topLeft:s?.includes("border-radius:")&&!u?+c.firstNumber:null,topRight:s?.includes("border-radius:")&&!u?+c.secondNumber:null,bottomRight:s?.includes("border-radius:")&&!u?+c.thirdNumber:null,bottomLeft:s?.includes("border-radius:")&&!u?+c.fourthNumber:null},boxShadow:{color:m?.color??null,hOffset:m?.hOffset??null,vOffset:m?.vOffset??null,blurRadius:m?.blurRadius??null,spreadRadius:m?.spreadRadius??null,inset:m?.inset??null},mobileBoxShadow:p.mobileBoxShadow,mobileBackgroundColor:p.mobileBackgroundColor,mobileBackgroundImage:p.mobileBackgroundImage,mobileBackgroundPositionX:p.mobileBackgroundPositionX,mobileBackgroundPositionY:p.mobileBackgroundPositionY,mobileBackgroundRepeat:p.mobileBackgroundRepeat,mobileBackgroundSize:p.mobileBackgroundSize,mobileWidth:{value:p.mobileWidth!=null?p.mobileWidth:null,dim:p.mobileWidthDim},mobileHeight:{value:p.mobileHeight!=null?p.mobileHeight:null,dim:"px"},mobileBorderRadius:p.mobileBorderRadius,mobileBorder:p.mobileBorder,borderPosition:Av(i),cell_borderPosition:Av(o),cellBackgroundColor:a?.includes("background-color:")?X(o.style.backgroundColor):"",cell_borderAll:as(a,o,"All"),cell_borderBottom:as(a,o,"Bottom"),cell_borderTop:as(a,o,"Top"),cell_borderRight:as(a,o,"Right"),cell_borderLeft:as(a,o,"Left"),cell_paddingLeftRight:o.style.paddingLeft===o.style.paddingRight?o.style.paddingLeft:"",cell_paddingTopBottom:o.style.paddingTop===o.style.paddingBottom?o.style.paddingTop:"",cell_paddingLeft:o.style.paddingLeft,cell_paddingRight:o.style.paddingRight,cell_paddingTop:o.style.paddingTop,cell_paddingBottom:o.style.paddingBottom,linkHref:r.getAttribute("href")?.trim()??"",textLink:!!r.closest("a"),target:r.getAttribute("target")??"",fontFamily:n.getFontFamilyFromElement(n.requestElemWithStyle?.closest('[style*="font-family"]')||r),fontSize:n.requestElemWithStyle?.style?.fontSize?parseInt(n.requestElemWithStyle.style.fontSize,10):n.requestElemWithStyle?.closest('div[style*="font-size"]')?.style?.fontSize?parseInt(n.requestElemWithStyle.closest('div[style*="font-size"]').style.fontSize,10):null,textStrikethrough:n.textHasStyle(r,"s","strike")||n.requestElemWithStyle?.style.textDecoration.includes("line-through"),textUnderline:n.textHasStyle(r,"u")||n.requestElemWithStyle.style.textDecoration.includes("underline")||!n.requestElemWithStyle.style.textDecoration&&r.tagName==="A",lineHeight:n.getLineHeghtInPixels(n.requestElemWithStyle),textStrong:n.textHasStyle(r,"strong","b")||n.isElementHasBold(n.requestElemWithStyle),textItalic:n.textHasStyle(r,"i","em")||!n.requestElemWithStyle.closest('[style*="font-style: normal"]')&&n.requestElemWithStyle?.style?.fontStyle==="italic",textAlign:r.style?.textAlign||r.getAttribute("align")||r.closest("[align]")?.getAttribute("align")||"",textColor:X(r.closest('[style*="color"]')?.style.color)||X(getComputedStyle(r).color),textBackgroundColor:X(r.closest('[style*="background-color"]')?.style.backgroundColor)||X(getComputedStyle(r).backgroundColor),textValign:r.style?.verticalAlign||r.getAttribute("valign")||r.closest("[valign]")?.getAttribute("valign")||""}};return r.getAttribute("new")&&(r.removeAttribute("new"),f.customTable.isNewLink=!0,r.setAttribute("em-edit","active")),{type:"customTable",caption:t.ELEMENT,settings:f}}function Tl(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function y8(e,t,n){const r=e.elem;return{type:"div",caption:t.CONTAINER,...n.getElementTdDiv(r),width:Tl(r.style.width),maxWidth:Tl(r.style.maxWidth),minWidth:Tl(r.style.minWidth),height:Tl(r.style.height),valign:r.style.verticalAlign??"",align:r.style.textAlign??"",direction:r.getAttribute("dir")??"none"}}function R1(e,t){const n=e==null?null:typeof e=="number"?e:Number(e);return{value:n==null||Number.isNaN(n)?null:n,dim:t==="%"?"%":"px"}}function v8(e){return e.tagName==="TABLE"&&e.getAttribute("em")==="atom"}function O1(e,t,n){return e?{fontFamily:os(e.closest('[style*="font-family"]')||e),textStrong:Ze(e,"strong","b")||Al(e)||!!t?.querySelector("strong")||!!t?.querySelector("bold")||e.querySelector("span")?.style?.fontWeight?.includes("bold"),textItalic:!e.closest('[style*="font-style: normal"]')&&e.style?.fontStyle==="italic"||!!e.querySelector("em")||!!e.querySelector("i")||e.querySelector("span")?.style?.fontStyle?.includes("italic"),fontSize:parseFloat(e.closest('[style*="font-size"]')?.style.fontSize)||0,lineHeight:n.getLineHeghtInPixels(e),textColor:X(e.closest('[style*="color"]')?.style.color)||"",textBackgroundColor:X(e.closest('[style*="background-color"]')?.style.backgroundColor)||"",textStrikethrough:E8(e),textUnderline:S8(e)}:{}}function E8(e){return e.style?.textDecorationLine?.includes("line-through")||e.querySelector("em")?.style?.textDecorationLine?.includes("line-through")||e.querySelector("span")?.style?.textDecorationLine?.includes("line-through")||e.style?.textDecoration?.includes("line-through")||e.querySelector("em")?.style?.textDecoration?.includes("line-through")||e.querySelector("span")?.style?.textDecoration?.includes("line-through")||!!e.querySelector("strike")}function S8(e){return e.style?.textDecorationLine?.includes("underline")||e.querySelector("em")?.style?.textDecorationLine?.includes("underline")||e.querySelector("span")?.style?.textDecorationLine?.includes("underline")||e.style?.textDecoration?.includes("underline")||e.querySelector("em")?.style?.textDecoration?.includes("underline")||e.querySelector("span")?.style?.textDecoration?.includes("underline")||!!e.querySelector("underline")||!!e.querySelector("u")}function w8(e,t,n){const r=e.elem.querySelector(".em-element-list-ul")||e.elem.querySelector(".em-element-list-ol")||null,o=r?e.elem.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'):null,i=We({elem:e.elem}),s=e.elem.querySelector("td"),a=n.getElementTdDiv(s),l=r?O1(o,r,n):{};return{type:"td",caption:t.ELEMENT,...a,mobileWidth:R1(i.mobileWidth,i.mobileWidthDim),direction:s?.getAttribute("dir")??"none",elementName:r?"List":"",...l}}function C8(e,t,n){const r=e.elem.closest("table")?.closest("td"),o=e.elem.closest("table");if(!r&&!o)return{settings:null,editTargetTd:null,shouldResetProgrammaticSelection:!0};const i=r?.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'),s=!!(r?.querySelector(".em-element-list-ul")||r?.querySelector(".em-element-list-ol")),a=We({elem:r}),l=r?.querySelector("td"),c=n.getElementTdDiv(l),u=i?O1(i,o,n):{};return{settings:{type:"td",caption:t.ELEMENT,...c,mobileWidth:R1(a.mobileWidth,a.mobileWidthDim),direction:l?.getAttribute("dir")??"none",elementName:s?"List":"",...u},editTargetTd:l,shouldResetProgrammaticSelection:!0}}function P1(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function A8(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function I1(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function T8(e){const t=e.firstElementChild;if(!t)return 0;const n=t.getAttribute("width");return e.style.maxWidth?parseFloat(e.style.maxWidth)-parseFloat(n||"0"):e.style.width?n&&n.includes("0%")?0:parseFloat(e.style.width)-parseFloat(n||"0"):0}function _8(e,t){const n=e.elem,r=We({elem:n}),o=n.firstElementChild,i=o?We({elem:o}):null,s=P1(r.mobileWidth),a=i?P1(i.mobileWidth):null;return{type:"floatBlock",caption:t.FLOAT_BLOCK,width:A8(o?.getAttribute("width")),gap:{value:T8(n),dim:"px"},maxWidth:I1(n.style.maxWidth),minWidth:I1(n.style.minWidth),valign:n.style.verticalAlign??"",mobileWidth:{value:s,dim:r.mobileWidthDim??"px"},mobileContentWidth:{value:a,dim:i?.mobileWidthDim??"px"},mobileVerticalAlign:r.mobileVerticalAlign,show:r.show}}function k8(e){if(e.tagName!=="DIV")return!1;const t=e.style.display,n=t==="inline-block"||t==="table-cell",r=!!e.style.verticalAlign;return n&&r}function D1(e){return e.getAttribute("src")}function L8(e,t){const n=Gc(e.elem),r=D1(n),o=We({elem:n}),i=n.closest("td"),s=i?We({elem:i}):null;let a="img",l=t.PICTURE;e.elem.classList.contains("em-countdown")?(a="countdown",l=t.COUNTDOWN):e.elem.classList.contains("em-video")&&(a="video",l=t.VIDEO);const c=d=>d===null||d==="auto"?null:typeof d=="number"?d:null,u={type:a,caption:l,src:r??"",width:B1(n,"width"),height:B1(n,"height"),alt:n.getAttribute("alt")??"",title:n.getAttribute("title")??"",align:i?.getAttribute("align")??"undefined",valign:n.style?.verticalAlign??"undefined",border:fl(n),borderRadius:Ui(n),boxShadow:ji(n),mobileWidth:{value:c(o.mobileWidth),dim:o.mobileWidthDim??"px"},mobileHeight:{value:c(o.mobileHeight),dim:o.mobileHeightDim??"px"},mobileBorder:o.mobileBorder,mobileBorderRadius:o.mobileBorderRadius,mobileBoxShadow:o.mobileBoxShadow,mobileAlign:s?.mobileAlign,mobileVerticalAlign:o.mobileVerticalAlign,show:o.show,link:n.closest("a")?.getAttribute("href")??null,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:n.closest("em-replace")?.getAttribute("src")??""};if(a==="countdown"&&(u.countdown=e.elem.getAttribute("em-cd-settings")??void 0),a==="video"){const d=e.elem.getAttribute("em-video-settings");if(d)try{u.video=JSON.parse(d.replaceAll("'",'"'))}catch{u.video={}}}return is(e.elem)&&(u.showOnMobile=!0),i&&(u.maxWidth=Math.round(i.getBoundingClientRect().width)),u}function B1(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function N8(e){return e.tagName==="IMG"||e.tagName==="AMP-IMG"}function ls(e){const t=String(e??"").trim();return t?X(t)??t:""}var gm={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function x8(e){if(!e)return null;const t=e.getAttribute("width")?.trim();if(t){const i=parseInt(t,10);if(!Number.isNaN(i)&&i>0)return i}const n=e.getAttribute("style")??"",r=/(?:^|;)\s*width:\s*(\d+)px/i.exec(n);if(r){const i=parseInt(r[1],10);if(!Number.isNaN(i)&&i>0)return i}const o=e.style?.width?.trim()??"";if(o){const i=parseInt(o,10);if(!Number.isNaN(i)&&i>0)return i}return e.offsetWidth>0?Math.round(e.offsetWidth):null}function M8(e,t){if(e.length===0)return t;let n=null;for(const r of e){const o=r.iconWidth;if(o==null||Number.isNaN(o)||o<=0)return t;if(n===null)n=o;else if(o!==n)return t}return n??t}function bm(e){return e.closest('table[em-type="social"]')}function R8(e){const t=e.ownerDocument;return t?Array.from(t.querySelectorAll('table[em-type="social"]')).indexOf(e):-1}function H1(e){const t=e.querySelector(":scope > tr");if(t){const r=t.querySelector(":scope > td");if(r instanceof HTMLElement)return r}const n=e.querySelector("tbody > tr");if(n){const r=n.querySelector(":scope > td");if(r instanceof HTMLElement)return r}return null}function Ho(e){if(!e||!(e instanceof HTMLElement))return"";const t=e.style?.backgroundColor?.trim()??"";return!t||t==="transparent"||t==="rgba(0, 0, 0, 0)"?"":t}function xn(e,t){return e.hasAttribute(t)||e.hasAttribute(`data-${t}`)}function ym(e,t){return e?e.getAttribute(t)??e.getAttribute(`data-${t}`):null}function O8(e){if(!(e instanceof HTMLElement))return null;const t=e.getAttribute("width")?.trim(),n=e.style.width?.trim(),r=t||n;if(!r)return null;const o=/^(\d+)/.exec(r);if(!o)return null;const i=parseInt(o[1],10);return Number.isNaN(i)||i<0?null:i}function P8(e,t){for(let n=1;n<e.length-1;n+=1){const r=e[n-1],o=e[n],i=e[n+1];if(r instanceof HTMLElement&&i instanceof HTMLElement&&xn(r,"em-platform")&&xn(i,"em-platform")&&o instanceof HTMLElement&&!xn(o,"em-platform")){const s=O8(o);if(s!=null){t.gap=s;return}}}}function F1(e){const t=String(e??""),n=/(?:^|;)\s*border-radius:\s*(\d+)px/i.exec(t);if(!n)return null;const r=parseInt(n[1],10);return Number.isNaN(r)||r<0?null:r}function I8(e,t){const n=H1(e)?.getAttribute("align")?.trim().toLowerCase();(n==="left"||n==="right"||n==="center")&&(t.align=n)}function D8(e,t){for(const n of e){if(!(n instanceof HTMLElement)||!xn(n,"em-platform"))continue;const r=F1(n.getAttribute("style"));if(r!=null){t.borderRadius=r;return}const o=F1(n.querySelector("img")?.getAttribute("style")??null);if(o!=null){t.borderRadius=o;return}}}function B8(e,t){for(const n of e){if(!(n instanceof HTMLElement))continue;const r=n.querySelector("br"),o=r?.nextElementSibling?.tagName==="SPAN"?r.nextElementSibling:null;if(o&&o.textContent?.trim()){t.showLabel=!0;return}}t.showLabel=!1}function H8(e,t,n){const r=e.querySelector("[em-social-tray-shell], [data-em-social-tray-shell]"),o=e.querySelector("td[em-tray-cell-bg], td[data-em-tray-cell-bg]"),i=Ho(r),s=Ho(o instanceof HTMLElement?o:null),a=Ho(e.querySelector("[em-social-tray], [data-em-social-tray]")),l=Ho(t),c=Ho(e),u=i||s||a||l||c;u&&(n.bgEnabled=!0,n.bgColor=u)}function F8(e){const t=H1(e);if(!(t instanceof HTMLElement))return"";const n=Ho(t);return n||(t.getAttribute("bgcolor")?.trim()??"")}function vm(e){if(!e)return null;const t=e.style.border?.trim()??"",n=/^(\d+)px\s+solid\s+(.+)$/i.exec(t);if(!n)return null;const r=parseInt(n[1],10),o=n[2].trim();return Number.isNaN(r)||r<=0||!o?null:{w:r,color:o}}function $8(e,t){const n=vm(e);n&&(t.borderWidth=n.w,t.borderColor=n.color)}function W8(e){const t=e.closest("td[em-platform], td[data-em-platform]");if(t)return!!bm(t);const n=e.closest("td"),r=n?.previousElementSibling,o=n?.nextElementSibling;return!!(n&&!xn(n,"em-platform")&&r instanceof HTMLElement&&o instanceof HTMLElement&&xn(r,"em-platform")&&xn(o,"em-platform")&&bm(n))}function q8(e,t){const n=bm(e.elem);if(!n)return{type:"social",caption:t.SOCIAL??"Social media",...gm,hostCellBgForIconLuminance:"",blockIndex:-1,items:[]};const r={...gm};I8(n,r),$8(n,r);const o=n.querySelector('table[role="presentation"]')||n.querySelector("table");H8(n,o,r);const i=o?.querySelector("tr"),s=i?Array.from(i.querySelectorAll(":scope > td")):[],a=s.filter(f=>f instanceof HTMLElement&&xn(f,"em-platform")),l=a.length>0?a:s.filter(f=>f.querySelector("img"));P8(s,r),D8(l,r),B8(l,r);let c=typeof r.buttonBorderWidth=="number"&&!Number.isNaN(r.buttonBorderWidth)?r.buttonBorderWidth:0;const u=n.querySelector("[em-social-tray-shell], [data-em-social-tray-shell]"),d=u instanceof HTMLElement?vm(u):null;if(d)c=d.w;else for(const f of l){if(!(f instanceof HTMLElement))continue;const h=vm(f);if(h){c=h.w;break}}let m=l.map(f=>{if(!(f instanceof HTMLElement))return{platform:"unknown",customIcon:!1,href:"",alt:"",title:"",iconSrc:"",iconWidth:null,iconHeight:null,buttonBgColor:"",itemBorderColor:""};const h=f,y=ym(h,"em-platform")||"unknown",E=xn(h,"em-custom-icon"),C=h.querySelector("a"),k=h.querySelector("img"),w=C?.getAttribute("href")??"",b=C?.getAttribute("title")??k?.getAttribute("title")??"",v=k?.getAttribute("alt")??"",A=k?.getAttribute("src")??"",g=x8(k instanceof HTMLImageElement?k:null),S=k?.getAttribute("height")?.trim(),T=S?parseInt(S,10):NaN,_=!Number.isNaN(T)&&T>0,M=ym(h,"em-button-bg")?.trim()??"",N=!E&&xn(h,"em-tray-cell-bg");let W="",P="";if(!E&&(W=M,!W&&!N&&h.style?.backgroundColor&&(W=h.style.backgroundColor.trim()),P=ym(h,"em-item-border-color")?.trim()??"",!P)){const R=h.style.border?.trim()??"",Y=/^(\d+)px\s+solid\s+(.+)$/i.exec(R);Y?.[2]&&(P=Y[2].trim())}return{platform:y,customIcon:E,href:w,alt:v,title:b,iconSrc:A,iconWidth:g,iconHeight:_?T:g,buttonBgColor:W,itemBorderColor:P}});if(d&&m.length>0&&m.every(f=>f.customIcon||!String(f.itemBorderColor??"").trim())){const f=d.color;m=m.map(h=>h.customIcon?h:{...h,itemBorderColor:f})}const p=M8(m,gm.iconSize);return{type:"social",caption:t.SOCIAL??"Social media",align:r.align,iconSize:p,borderRadius:r.borderRadius,gap:r.gap,bgEnabled:r.bgEnabled,bgColor:ls(r.bgColor),borderWidth:r.borderWidth,borderColor:ls(r.borderColor),buttonBorderColor:"",buttonBorderWidth:c,showLabel:r.showLabel,hostCellBgForIconLuminance:ls(F8(n)),blockIndex:R8(n),items:m.map(f=>({...f,buttonBgColor:ls(f.buttonBgColor),itemBorderColor:ls(f.itemBorderColor)}))}}function $1(e){return e.tagName==="TBODY"&&Array.from(e.childNodes).every(W1)}function z8(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function W1(e){return e.nodeType===Node.COMMENT_NODE}function cn(e){if(e.tagName!=="TABLE")return!1;const t=Array.from(e.childNodes).filter(r=>!W1(r));if(t.length===0)return!0;const n=t.filter(r=>!z8(r));return n.length===1&&n[0]instanceof Element&&$1(n[0])}function q1(e=document){for(const t of Array.from(e.querySelectorAll("table")))if(cn(t))return t;return null}function Vn(e){const t=e.children.length===1?e.children[0]:null;return t&&$1(t)?t:e}function V8(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function z1(e,t){const n=e.style[t];return n?{value:parseFloat(n),dim:n.includes("%")?"%":"px"}:{value:null,dim:"px"}}function U8(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function j8(e){if(e.style.backgroundImage){const t=e.style.backgroundImage;return[{type:"url",value:t.substring(5,t.length-2)}]}return e.getAttribute("background")?[{type:"url",value:e.getAttribute("background")||""}]:[{type:"url",value:""}]}function G8(e,t){const n=e.elem;if(cn(n))return{type:"emptyTable",caption:t.TABLE};n.setAttribute("em-edit","active");const r=We({elem:n}),o={type:"table",caption:t.TABLE,backgroundColor:n.style.backgroundColor?X(n.style.backgroundColor):"",backgroundImage:j8(n),backgroundPositionX:n.style.backgroundPositionX!=="initial"?n.style.backgroundPositionX:"",backgroundPositionY:n.style.backgroundPositionY!=="initial"?n.style.backgroundPositionY:"",backgroundRepeat:n.style.backgroundRepeat||"repeat",backgroundSize:n.style.backgroundSize||"auto",width:V8(n,"width"),maxWidth:z1(n,"maxWidth"),minWidth:z1(n,"minWidth"),align:n.getAttribute("align")??"",border:fl(n),boxShadow:ji(n),borderRadius:Ui(n),mobileWidth:{value:U8(r.mobileWidth),dim:r.mobileWidthDim??"px"},mobileBorder:r.mobileBorder,mobileBorderRadius:r.mobileBorderRadius,mobileBoxShadow:r.mobileBoxShadow,show:r.show,mobileAlign:r.mobileAlign,mobileBackgroundColor:r.mobileBackgroundColor,mobileBackgroundImage:r.mobileBackgroundImage,mobileBackgroundPositionX:r.mobileBackgroundPositionX,mobileBackgroundPositionY:r.mobileBackgroundPositionY,mobileBackgroundRepeat:r.mobileBackgroundRepeat,mobileBackgroundSize:r.mobileBackgroundSize,exportAsPicture:n.getAttribute("em-operation")==="exportAsPicture",outlookBackground:Yi(n,"around")};return is(n)&&(o.showOnMobile=!0),o}function X8(e){return e.tagName==="TABLE"&&e.getAttribute("em")!=="atom"}function Y8(e){if(e.tagName!=="TD")return e.closest("table")?.parentElement?.tagName==="BODY";if(e.classList.contains("em-vindent")||e.innerHTML===""||e.closest("table")?.getAttribute("em")==="atom"||e.firstChild?.tagName==="EDITOR")return!1;const t=!!e.querySelector('div[style*="inline-block"]'),n=!!e.querySelector(":scope > table > tr > .em-mob-wrap, :scope > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap");return!!(!t&&!n||t&&e.parentElement?.getAttribute("em")!=="block"&&!e.querySelector(".em-mob-wrap, .noresp-em-mob-wrap"))}function K8(e){if(e.tagName!=="TD"||e.classList.contains("em-vindent")||e.innerHTML===""||e.firstChild?.tagName==="EDITOR"||!(e.parentElement?.getAttribute("em")==="block"||e.parentElement?.parentElement?.getAttribute("em")==="block"||e.parentElement?.parentElement?.parentElement?.getAttribute("em")==="block"))return!1;const t=!!e.querySelector('div[style*="inline-block"]'),n=!!e.querySelector(":scope > table > tr > .em-mob-wrap, :scope > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap");return t||n}function Z8(e){if(e.tagName==="TD"){if(e.innerHTML!==""||e.getAttribute("height"))return!1;const t=!e.getAttribute("width")||e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"),n=!!e.closest('[em="block"].empty-structure')||!!e.closest(".em-structure");return t&&n}return e.tagName==="DIV"?!!e.closest("amp-accordion")&&!e.innerHTML:!1}function Q8(e){if(e.tagName!=="TD")return!1;const t=!!e.firstChild&&e.firstChild.tagName==="EDITOR";return t&&e.closest("table")?.getAttribute("em")==="atom"?!0:!(t||e.classList.contains("em-vindent"))}function J8(e){const t={items:[],gap:null,gapMobile:null,valign:"",wrap:void 0,dirRevers:!1},n=".em-mob-wrap, .noresp-em-mob-wrap",r=e.querySelector(n),o=e.querySelectorAll(n).length;if(r&&e.querySelectorAll(".em-mob-wrap:first-child, .noresp-em-mob-wrap:first-child").length===1)t.wrap=!0,e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(i=>{if(t.items.push({width:parseFloat(i.getAttribute("width")||"0"),current:!1}),o>1){const s=r.nextElementSibling;t.gap=parseFloat(s?.getAttribute("width")||"0");const a=We({elem:s});t.gapMobile=a.mobileHeight||0}else t.gap=0;(i.classList.contains("em-mob-wrap-cancel")||i.classList.contains("noresp-em-mob-wrap-cancel"))&&(t.wrap=!1)}),t.valign=r.getAttribute("valign")||"",(r?document.querySelector('[em-edit="active"]'):e.closest(n)?.parentElement?.closest("td"))?.getAttribute("dir")==="rtl"&&(t.dirRevers=!0);else if(e.querySelector('div[style*="inline-block"]')){const i=e.querySelectorAll('div[style*="inline-block"]');if(i.length>1)i.forEach(a=>{const l=a,c=l.firstElementChild;t.items.push({width:parseFloat(c?.getAttribute("width")||"0"),current:!1});const u=c?.getAttribute("width"),d=parseFloat(l.style.width);!u||u.includes("%")?t.gap=d-d:t.gap=d-parseFloat(u)});else{const a=e.querySelector('div[style*="inline-block"]');t.items=[{width:parseFloat(a.firstElementChild?.getAttribute("width")||"0"),current:!0}],t.gap=0}const s=e.querySelector('div[style*="inline-block"]');t.valign=s?.style.verticalAlign||"",(s?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement)?.getAttribute("dir")==="rtl"&&(t.dirRevers=!0)}return t}function e9(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};let i="td",s=t.TABLE_COLUMN;return(r.classList.contains("em-mob-wrap")||r.classList.contains("noresp-em-mob-wrap"))&&(i="column"),r.parentElement?.getAttribute("em")==="group"?(s=t.ELEMENT_PATH_GROUP??t.GROUP,i="group"):r.closest("table")?.parentElement?.tagName==="BODY"?(s=t.GROUP,i="group"):r.classList.contains("em-mob-wrap")?s=t.FLOAT_BLOCK:r.parentElement?.getAttribute("em")==="block"&&(s=t.STRUCTURE),{type:i,caption:s,settings:o}}function t9(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};return o.floatBlocks=J8(r),o.isContrastBlock=!!r.closest(".em-contrast-block"),{type:"structure",caption:t.STRUCTURE,settings:o}}function n9(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};let i=t.TABLE_COLUMN,s="td";return r.parentElement?.getAttribute("em")==="group"?(i=t.ELEMENT_PATH_GROUP??t.GROUP,s="group"):r.closest("table")?.getAttribute("em")==="atom"?i=t.ELEMENT:r.parentElement?.getAttribute("em")==="block"&&(i=t.STRUCTURE),{type:s,caption:i,settings:o}}function r9(e,t,n){const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(o=>{const i=o.querySelectorAll("td");if(i.length>1){const s=i[1],a=(s.getAttribute("style")||"").split(";").filter(u=>u.trim()!==""),l={};a.forEach(u=>{const[d,m]=u.split(":").map(p=>p.trim());l[d]=m}),l[t]=`${n}px`;const c=Object.entries(l).map(([u,d])=>`${u}: ${d}`).join("; ");s.setAttribute("style",c)}}),r.innerHTML}function o9(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");i&&(i.innerHTML=t)}}),n.innerHTML}function i9(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(l=>l.trim()).filter(l=>l);if(a.some(l=>l.startsWith("color"))){const l=a.map(c=>c.startsWith("color")?`color: ${t};`:c);i.setAttribute("style",l.join("; "))}else i.setAttribute("style",s?`${s} color: ${t};`:`color: ${t};`)}}}),n.innerHTML}function s9(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(l=>l.trim()).filter(l=>l);if(a.some(l=>l.startsWith("font-size"))){const l=a.map(c=>c.startsWith("font-size")?`font-size: ${t}px;`:c);i.setAttribute("style",l.join("; "))}else i.setAttribute("style",s?`${s} font-size: ${t}px;`:`font-size: ${t}px;`)}}}),n.innerHTML}function a9(e,t){if(typeof t!="boolean")throw new Error("Invalid isBold value: must be a boolean");const n=t?"bold":"normal",r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(o=>{const i=o.querySelector("td:first-child");if(i){const s=i.querySelector("div");if(s){const a=s.getAttribute("style")||"",l=a.split(";").map(c=>c.trim()).filter(c=>c);if(l.some(c=>c.startsWith("font-weight"))){const c=l.map(u=>u.startsWith("font-weight")?`font-weight: ${n};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-weight: ${n};`:`font-weight: ${n};`)}}}),r.innerHTML}function l9(e,t){if(typeof t!="boolean")throw new Error("Invalid isItalic value: must be a boolean");const n=t?"italic":"normal",r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(o=>{const i=o.querySelector("td:first-child");if(i){const s=i.querySelector("div");if(s){const a=s.getAttribute("style")||"",l=a.split(";").map(c=>c.trim()).filter(c=>c);if(l.some(c=>c.startsWith("font-style"))){const c=l.map(u=>u.startsWith("font-style")?`font-style: ${n};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-style: ${n};`:`font-style: ${n};`)}}}),r.innerHTML}function c9(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldUnderline value: must be a boolean");const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(d=>d.trim()).filter(d=>d);let l="none";const c=a.findIndex(d=>d.startsWith("text-decoration"));if(c!==-1){const d=a[c].match(/^text-decoration\s*:\s*(.*)$/);d&&(l=d[1].trim())}let u;t?l.includes("line-through")?u="underline line-through":u="underline":l.includes("line-through")?u="line-through":u="none",c!==-1?(a[c]=`text-decoration: ${u};`,i.setAttribute("style",a.join("; "))):i.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),n.innerHTML}function u9(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldStrikethrough value: must be a boolean");const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(d=>d.trim()).filter(d=>d);let l="none";const c=a.findIndex(d=>d.startsWith("text-decoration"));if(c!==-1){const d=a[c].match(/^text-decoration\s*:\s*(.*)$/);d&&(l=d[1].trim())}let u;t?l.includes("underline")?u="underline line-through":u="line-through":l.includes("underline")?u="underline":u="none",c!==-1?(a[c]=`text-decoration: ${u};`,i.setAttribute("style",a.join("; "))):i.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),n.innerHTML}function d9(e){return!e||!(e instanceof Node)?null:document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:t=>t.nodeValue?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}).nextNode()}function m9(e){if(!e||!(e instanceof Node))return null;const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:o=>o.nodeValue?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let n=null,r;for(;r=t.nextNode();)n=r;return n}function f9(e){if(!e||!(e instanceof HTMLElement))return"inside";const t=window.getSelection();if(!t||t.rangeCount===0)return"inside";const n=t.getRangeAt(0);if(!n.collapsed)return"inside";let{startContainer:r,startOffset:o}=n;if(r===e)return o===0?"start":o===e.childNodes.length?"end":"inside";const i=d9(e),s=m9(e);let a=r;return a&&a.nodeType===Node.ELEMENT_NODE&&(a=a.childNodes[0]),i&&a===i&&o===0?"start":s&&r===s&&(o===s?.nodeValue?.length||o===s?.nodeValue?.trim().length)?"end":"inside"}function V1(e){const t=e.cloneNode(!0),n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let r;for(;r=n.nextNode();)r.nodeValue="";return t}function Em(e){let t="";for(const n of e.attributes)t+=` ${n.name}="${n.value}"`;return t}function p9(e,t){const n=e.closest(`table.${t}`);if(!n)return null;const r=n.querySelector("tbody"),o=r?r.innerHTML.trim():n.innerHTML.trim(),i=e.closest("tr");if(!i)return{rowHtml:o,firstCellText:"",secondCellText:"",firstCellHtmlNoText:"",secondCellHtmlNoText:"",secondCellWrapperHtml:"",secondCellInnerDivHtml:"",wrappedSecondCellHtml:"",secondCellInnerDivWrapperHtml:"",secondCellTextHTML:""};const s=i.querySelectorAll("td"),a=s[0]||null,l=s[1]||null,c=a?a.textContent.trim():"",u=l?l.textContent.trim():"",d=l?l.innerHTML.trim():"",m=a?V1(a).outerHTML:"",p=l?V1(l).outerHTML:"",f=l?`<td${Em(l)}></td>`:"",h=l?l.querySelector("div"):null;return{rowHtml:o,firstCellText:c,secondCellText:u,firstCellHtmlNoText:m,secondCellHtmlNoText:p,secondCellWrapperHtml:f,secondCellInnerDivHtml:h?h.outerHTML:"",wrappedSecondCellHtml:l&&h?`<td${Em(l)}>${h.outerHTML}</td>`:"",secondCellInnerDivWrapperHtml:h?`<div${Em(h)}></div>`:"",secondCellTextHTML:d}}function U1(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function j1(e,t){const n=document.createElement("template");n.innerHTML=e;const r=n.content.firstElementChild;if(!r||r.tagName.toLowerCase()!=="td")return e;const o=r.querySelector("div");return o?o.textContent=U1(t)||" ":r.insertAdjacentText("afterbegin",U1(t)),r.outerHTML}function Fo(e){const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("editor").forEach(n=>{n.replaceWith(...Array.from(n.childNodes))}),t.content.querySelectorAll('[em-edit="active"]').forEach(n=>{n.removeAttribute("em-edit")}),t.innerHTML}function h9(e,t,n,r=!0){const o=document.createElement("template");o.innerHTML=e.trim();const i=o.content.querySelector(`div.${n}`);if(i){const s=i.closest("tr");if(s){const a=r?"beforebegin":"afterend";s.insertAdjacentHTML(a,t)}}return o.innerHTML}function g9(e){let t=1;return e.map(n=>{if(n.cellOneText&&/^\d+\.$/.test(n.cellOneText.trim())){const o={...n,cellOneText:`${t}.`};return t++,o}if(!n.cellOneText||/^\s*$/.test(n.cellOneText))return{...n};const r={...n,cellOneText:`${t}.`};return t++,r})}function b9(e){return e.map(t=>({...t,cellOneText:t.cellOneText===""?" ":t.cellOneText,cellTwoText:t.cellTwoText===""?" ":t.cellTwoText}))}function y9(e){if(!Array.isArray(e)||e.length===0)return e;const t=" ",n=e.map(o=>{if(!o.cellOneText)return o;let i=o.cellOneText.trim();return i.endsWith(t)||(i+=t),{...o,cellOneText:i}}),r=Math.max(...n.map(o=>o.cellOneText?o.cellOneText.length:0));return n.map(o=>{if(!o.cellOneText)return o;let i=o.cellOneText;for(;i.length<r;)i+=t;return{...o,cellOneText:i}})}function Sm(e){const t=Array.from(e.querySelectorAll("tr")).map(r=>r.querySelectorAll("td")).filter(r=>r.length>=2).map(r=>r[0].querySelector("div")),n=y9(b9(g9(t.map(r=>({cellOneText:r?.textContent?.trim()??"",cellTwoText:""})))));t.forEach((r,o)=>{const i=n[o].cellOneText;r&&r.textContent!==i&&(r.textContent=i)})}function v9(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function E9(e,t,n){const r=[];let o=t;for(;o!==e;){const c=o.parentNode;if(!c)return null;r.unshift(Array.from(c.childNodes).indexOf(o)),o=c}const i=document.createRange();i.selectNodeContents(t),i.setStart(n.startContainer,n.startOffset);const s=i.extractContents(),a=e.cloneNode(!0),l=r.reduce((c,u)=>c.childNodes[u],a);return l.replaceChildren(s),[t,l].forEach(c=>{(c.textContent??"").trim()||(c.textContent=" ")}),{row:a,content:l}}function S9(e,t,n,r){const o=new DOMParser().parseFromString(e,"text/html"),i=o.querySelector(`div.${t}`);if(!i)return e;const s=i.closest("tr");if(!s)return e;const a=r==="ArrowUp"?s.previousElementSibling:s.nextElementSibling;if(a&&a.tagName==="TR"){const c=a.querySelectorAll("td")[1]||null;if(c){const u=c.querySelector("div");u&&u.classList.add(n)}}else i.classList.add(n);const l=o.querySelector("table");return l?l.outerHTML:e}function w9(e,t,n,r){const o=e.closest(`table.${t}`)||e.closest(`table.${n}`);o&&o.querySelectorAll("tr").forEach(i=>{const s=i.querySelector("td:nth-child(2)");if(!s)return;const a=s.querySelectorAll("div, strong");if(a.length===0){const l=document.createElement("div");l.innerHTML="&nbsp;",s.appendChild(l)}else a.forEach(l=>{let c=l.innerHTML.trim();!c||c.replace(r,"")===""?l.innerHTML="&nbsp;":(c=c.replace(r,""),c.endsWith("&nbsp;")||(c+="&nbsp;"),c=c.replace(/&nbsp;+$/,"&nbsp;"),l.innerHTML=c)})})}function C9(e){const t=`<table><tbody><tr>${e}</tr></tbody></table>`,n=new DOMParser().parseFromString(t,"text/html"),r=n.querySelector("div");return r&&(r.classList.add("remove-new-editor-element"),r.innerHTML.trim()?r.innerHTML+="&nbsp;":r.innerHTML="&nbsp;"),n.querySelector("td")?.outerHTML||""}function A9(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelectorAll("td");if(o.length>1){const i=o[1],s=(i.getAttribute("class")||"").split(" ").map(l=>l.trim()).filter(l=>l!=="");s.includes(t)||s.push(t);const a=s.join(" ");i.setAttribute("class",a)}}),n.innerHTML}var wm="em-element-list-ol",Cm="em-element-list-ul",T9="em-element-list-bullet",_9=`.${wm}, .${Cm}`,k9=["DIV","P","TD","H1","H2","H3","H4","H5","H6"],L9="div, p, td, h1, h2, h3, h4, h5, h6",Mn={LIST:"margin: 0; padding: 0 0 0 20px;",LIST_ITEM:"padding-bottom: 5px;"},cs=null;function Am(e){const t=window.getSelection();if(t&&t.rangeCount>0){const n=t.getRangeAt(0);if(e.contains(n.startContainer))return{container:n.startContainer,offset:n.startOffset}}return cs&&cs.container.isConnected&&e.contains(cs.container)?cs:null}function N9(e){const t=[],n=Array.from(e.childNodes);let r=[],o=0;return n.forEach((i,s)=>{i.nodeType===Node.ELEMENT_NODE&&i.tagName==="BR"?(r.length>0&&t.push({html:_l(r),nodes:[...r],startIndex:o,endIndex:s-1}),r=[],o=s+1):r.push(i)}),r.length>0&&t.push({html:_l(r),nodes:[...r],startIndex:o,endIndex:n.length-1}),t}function x9(e){const t=[],n=Array.from(e.childNodes);let r=[],o=0;const i=a=>{r.length>0&&(t.push({html:_l(r),nodes:[...r],startIndex:o,endIndex:a-1}),r=[])},s=a=>a.nodeType===Node.ELEMENT_NODE&&(a.tagName==="UL"||a.tagName==="OL");return n.forEach((a,l)=>{a.nodeType===Node.ELEMENT_NODE&&a.tagName==="BR"?(i(l),o=l+1):s(a)?(i(l),t.push({html:_l([a]),nodes:[a],startIndex:l,endIndex:l}),o=l+1):r.push(a)}),i(n.length),t}function _l(e){const t=document.createElement("div");return e.forEach(n=>t.appendChild(n.cloneNode(!0))),t.innerHTML}function Tm(e,t){const n=Am(t);if(!n)return 0;const r=n.container;if(!t.contains(r))return 0;for(let o=0;o<e.length;o++)for(const i of e[o].nodes)if(i===r||i.contains(r))return o;if(r===t){const o=n.offset;for(let i=0;i<e.length;i++)if(o>=e[i].startIndex&&o<=e[i].endIndex)return i;for(let i=0;i<e.length;i++)if(o===e[i].startIndex)return i;for(let i=0;i<e.length;i++)if(e[i].startIndex>=o)return i;if(e.length>0)return e.length-1}return 0}function G1(e,t,n,r){if(!n.contains(t))return r;for(let o=0;o<e.length;o++)for(const i of e[o].nodes)if(i===t||i.contains(t))return o;return r}function M9(e,t){const n=window.getSelection();if(!n||n.rangeCount===0){const a=Tm(e,t);return{start:a,end:a}}const r=n.getRangeAt(0);if(r.collapsed){const a=Tm(e,t);return{start:a,end:a}}const o=Tm(e,t),i=G1(e,r.startContainer,t,o),s=G1(e,r.endContainer,t,o);return{start:Math.min(i,s),end:Math.max(i,s)}}function R9(e){return e.querySelector("br")!==null}function O9(e){const t=Am(e);if(!t)return null;const n=t.container.nodeType===Node.ELEMENT_NODE?t.container:t.container.parentElement;if(!n)return null;const r=n.closest("ol, ul");return r&&e.contains(r)?r:null}function P9(e){const t=Am(e);if(!t)return;const{container:n,offset:r}=t;if(n!==e)return;const o=Array.from(e.childNodes),i=r>0?o[r-1]:null,s=r<o.length?o[r]:null,a=h=>h!==null&&h.nodeType===Node.ELEMENT_NODE&&h.tagName==="BR",l=h=>h!==null&&h.nodeType===Node.TEXT_NODE&&h.data.trim()==="",c=a(i),u=a(s),d=l(s),m=r>=o.length;if(!(c&&u||c&&m||r===0&&u||c&&d))return;let p;d?(p=s,p.data=" "):(p=document.createTextNode(" "),s?e.insertBefore(p,s):e.appendChild(p));const f=window.getSelection();if(f){const h=document.createRange();h.setStart(p,0),h.collapse(!0),f.removeAllRanges(),f.addRange(h)}cs={container:p,offset:0}}function I9(e,t){const n=t?"ol":"ul";if(e.querySelector("ol, ul")){const r=O9(e);if(r){if(r.tagName.toLowerCase()===n)return;const s=document.createElement(n);for(Array.from(r.attributes).forEach(a=>{a.name!=="style"&&s.setAttribute(a.name,a.value)}),s.setAttribute("style",Mn.LIST);r.firstChild;)s.appendChild(r.firstChild);r.parentNode?.replaceChild(s,r);return}const o=e.querySelector(":scope > ol, :scope > ul"),i=Array.from(e.childNodes).some(s=>s.nodeType===Node.ELEMENT_NODE&&s.tagName==="BR");if(o&&!i){if(o.tagName.toLowerCase()===n)return;const s=document.createElement(n);for(Array.from(o.attributes).forEach(a=>{a.name!=="style"&&s.setAttribute(a.name,a.value)}),s.setAttribute("style",Mn.LIST);o.firstChild;)s.appendChild(o.firstChild);o.parentNode?.replaceChild(s,o);return}}R9(e)||e.querySelector(":scope > ol, :scope > ul")?(P9(e),D9(e,n)):X1(e,n)}function X1(e,t){const n=document.createElement(t);n.setAttribute("style",Mn.LIST);const r=document.createElement("li");r.setAttribute("style",Mn.LIST_ITEM);const o=e.innerHTML.trim();o?r.innerHTML=o:r.innerHTML="&nbsp;",n.appendChild(r),e.innerHTML="",e.appendChild(n),Y1(r)}function D9(e,t){const n=x9(e);if(n.length===0){X1(e,t);return}const{start:r,end:o}=M9(n,e),i=document.createElement(t);i.setAttribute("style",Mn.LIST);let s=null;for(let c=r;c<=o;c++){const u=document.createElement("li");u.setAttribute("style",Mn.LIST_ITEM),u.innerHTML=n[c].html.trim()||"&nbsp;",i.appendChild(u),s=u}const a=n.slice(0,r).map(c=>c.html).join("<br>"),l=n.slice(o+1).map(c=>c.html).join("<br>");if(e.innerHTML="",a.trim()){const c=document.createElement("span");for(c.innerHTML=a;c.firstChild;)e.appendChild(c.firstChild);e.appendChild(document.createElement("br"))}if(e.appendChild(i),l.trim()){e.appendChild(document.createElement("br"));const c=document.createElement("span");for(c.innerHTML=l;c.firstChild;)e.appendChild(c.firstChild)}s&&Y1(s)}function Y1(e){try{const t=window.getSelection();if(t){const n=document.createRange();n.selectNodeContents(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}}catch{}}function B9(e,t){let n=0;const r=Array.from(e.childNodes);for(const o of r){if(o===t)return n;o.nodeType===Node.ELEMENT_NODE&&o.tagName==="BR"&&n++}return n}function H9(e,t){const n=N9(e);if(t<0||t>=n.length)return;const r=n[t];if(r.nodes.length!==0)try{const o=window.getSelection();if(!o)return;const i=r.nodes[0],s=document.createRange();if(i.nodeType===Node.TEXT_NODE)s.setStart(i,0),s.collapse(!0);else if(i.nodeType===Node.ELEMENT_NODE)s.selectNodeContents(i),s.collapse(!0);else return;o.removeAllRanges(),o.addRange(s)}catch{}}function F9(e){const t=e.querySelector("ol, ul");if(!t)return;const n=B9(e,t),r=t.querySelectorAll("li"),o=[];r.forEach(s=>{const a=s.innerHTML.trim();a&&a!=="&nbsp;"&&o.push(a)});const i=o.join("<br>");i?t.outerHTML=i:t.outerHTML="&nbsp;",H9(e,n)}function _m(e){if(!e)return!1;const t=e.closest("ul, ol");return t?!t.closest(_9):!1}function $9(e,t,n){const r=i8()||e.elem,o=r.tagName==="EDITOR"&&r.firstChild?.nodeType===1?r.firstChild:r,i=e.elem.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')||e.elem,s=o.style.fontFamily||o.style.fontSize||o.style.lineHeight||o.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')?o:i,a=e.elem.closest('[style*="line-height"]')||s.querySelector('[style*="line-height"]')||s,l=r.closest('[class*="em-mob-font_size"], [style*="font-size"]')||r,c=r.closest('[class*="em-mob-line_height"]')||r.closest('[style*="line-height"]')||r,u=We({elem:l}),d=We({elem:c}),m=K1(e.elem,n),p=Ze(o,"strong","b"),f=s!==o?Ze(s,"strong","b"):!1,h=e.elem&&o&&e.elem.isConnected&&(o===e.elem||o.contains(e.elem))?Ze(e.elem,"strong","b"):!1,y=p||f||h,E=Al(s),C=y||E,k={type:"text",caption:t.TEXT,fontFamily:os(s.closest('[style*="font-family"]')||e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||parseFloat(getComputedStyle(e.elem).fontSize),fontSizeDim:"px",lineHeight:Cl(a),lineHeightDim:"px",textAlign:T1(e.elem),textStrong:C,textItalic:Ze(e.elem,"i","em")||!s.closest('[style*="font-style: normal"]')&&s.style?.fontStyle==="italic",textStrikethrough:Ze(e.elem,"s","strike")||(s.style?.textDecoration?.includes("line-through")??!1),textUnderline:Ze(e.elem,"u")||(s.style?.textDecoration?.includes("underline")??!1)||!s.style?.textDecoration&&(e.elem.tagName==="A"&&e.elem.hasAttribute("href")||_1()),textColor:X(e.elem.closest('[style*="color"]')?.style.color)||X(getComputedStyle(e.elem).color)||"",textBackgroundColor:V9(e.elem),mobileFontSize:{value:u.mobileFontSize,dim:u.mobileFontSizeDim||"px"},mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},mobileTextAlign:pm(e.elem),linkHref:(()=>{const w=s.closest("a");if(!w)return;const b=w.getAttribute("href");if(b!==null)return b})(),textAnchor:(()=>{const w=s.closest("a");if(w&&!w.hasAttribute("href"))return w.getAttribute("name")?.trim()||void 0})(),textLink:(()=>{const w=s.closest("a");return w?!!w.hasAttribute("href"):Ze(e.elem,"a")||_1()})(),textReplacer:n.variableElement(e.elem),list:m,standardList:Z1(e.elem),textSuperscript:Ze(e.elem,"sup"),textSubscript:Ze(e.elem,"sub")};return is(r)&&(k.showOnMobile=!0),k}function K1(e,t){const{isElementList:n,isElementListOL:r,isElementListUL:o,requestElemBullet:i}=t;if(!n)return{isList:!1,listType:"UL"};const s=e.closest("td");return{isList:!0,listType:r?"OL":"UL",bulletsColor:n&&i?X(i.closest('[style*="color"]')?.style.color):"",betweenParagraphs:n&&parseInt(s?.style?.paddingBottom,10)||0,betweenRowCell:n&&parseInt(s?.style?.paddingLeft,10)||0,bulletFontSize:n&&i&&parseInt(i.style.fontSize,10)||0,bulletFontBold:n?i?.style.fontWeight==="bold":!1,bulletFontItalic:n?i?.style.fontStyle==="italic":!1,bulletFontFamily:r&&i?os(i):"",bulletFontUnderline:n?i?.style.textDecoration?.includes("underline")??!1:!1,bulletFontStrikethrough:n?i?.style.textDecoration?.includes("line-through")??!1:!1,bulletType:o&&i?i.innerHTML.replace(/\s|&nbsp;/g,""):""}}function Z1(e){return _m(e)?{listTypeOL:!!e.querySelector("ol")||!!e.closest("ol"),listTypeUL:!!e.querySelector("ul")||!!e.closest("ul")}:{listTypeOL:!1,listTypeUL:!1}}function km(e){if(!e)return!1;const t=e.trim().toLowerCase();return t!=="transparent"&&t!=="inherit"}var W9=new Set(["A","B","EM","I","MARK","S","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","U"]);function q9(e){let t=e;for(;t&&W9.has(t.tagName);){const n=t.style.backgroundColor;if(km(n))return n;t=t.parentElement}return""}function z9(e,t,n){let r=e;for(;r;){const o=r.style.getPropertyValue(t);if(km(o))return o;if(n&&r===n)break;r=r.parentElement}return""}function V9(e){const t=q9(e);if(km(t))return X(t)||"";if(e.closest(".em-element-custom-table"))return X(Rr(e,"background-color"))||"";const n=e.closest("div");return X(z9(e,"background-color",n))||""}function U9(e){return e.tagName==="DIV"?!!(e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight):e.tagName==="TD"?e.firstChild?.tagName==="EDITOR"||e.firstElementChild?.tagName==="EDITOR":!1}function j9(e,t,n){const{findElementWithSelectedText:r,selectedText:o,variableElement:i,requestElemBullet:s,isElementList:a,isElementListOL:l,isElementListUL:c}=n,u=r(o,e.elem)||e.elem,d=e.elem.closest('[class*="em-mob-font_size"]')||e.elem.closest('[style*="font-size"]')||e.elem,m=e.elem.closest('[class*="em-mob-line_height"]')||e.elem.closest('[style*="line-height"]')||e.elem,p=We({elem:d}),f=We({elem:m}),h=K1(e.elem,n),y={type:"text",caption:t.TEXT,linkHref:(()=>{const E=e.elem.getAttribute("href");if(E!==null)return E})(),textAnchor:(()=>{if(!e.elem.hasAttribute("href"))return e.elem.getAttribute("name")?.trim()||void 0})(),textLink:!!e.elem.hasAttribute("href"),target:e.elem.getAttribute("target")??"",fontFamily:os(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:Cl(e.elem),lineHeightDim:"px",textAlign:T1(e.elem),textStrong:Ze(u,"strong","b")||Al(u),textItalic:Ze(u,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&e.elem.style?.fontStyle==="italic",textStrikethrough:Ze(u,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1),textUnderline:Ze(u,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"&&e.elem.hasAttribute("href"),textColor:X(e.elem.tagName==="A"?Rr(e.elem.querySelector('[style*="color"]'),"color"):Rr(e.elem,"color"))||X(getComputedStyle(e.elem).color)||"",textBackgroundColor:X(e.elem.tagName==="A"?Rr(e.elem.querySelector('[style*="background-color"]'),"background-color"):Rr(e.elem,"background-color"))||"",mobileFontSize:{value:p.mobileFontSize,dim:p.mobileFontSizeDim||"px"},mobileLineHeight:{value:f.mobileLineHeight,dim:"px"},mobileTextAlign:pm(e.elem),textReplacer:i(e.elem),list:h,standardList:Z1(e.elem),textSuperscript:Ze(e.elem,"sup"),textSubscript:Ze(e.elem,"sub")};return is(e.elem)&&(y.showOnMobile=!0),y}function Q1(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function G9(e,t){const n=e.elem,r=We({elem:n}),o=Q1(r.mobileHeight);return{type:"vindent",caption:t.VERTICAL_INDENT,height:{value:parseFloat(n.getAttribute("height")||"0"),dim:"px"},mobileHeight:{value:o,dim:r.mobileHeightDim??"px"}}}function X9(e,t){const n=e.elem,r=We({elem:n}),o=Q1(r.mobileHeight);return{type:"vindent",caption:t.VERTICAL_INDENT,height:{value:parseFloat(n.style.height||"0"),dim:"px"},mobileHeight:{value:o,dim:r.mobileHeightDim??"px"}}}function Y9(e){if(e.tagName!=="TD")return!1;if(e.classList.contains("em-vindent"))return!0;const t=e.closest("table");return e.innerHTML===""&&t?.getAttribute("width")==="100%"}function K9(e){return e.tagName!=="DIV"?!1:!e.style.fontFamily&&!!e.style.height&&!!e.style.lineHeight&&!!e.style.fontSize}function Z9(e,t){return e.elem.tagName==="TD"?G9(e,t):X9(e,t)}var J1={START_POSITION:"remove-start-element-position",NEW_EDITOR:"remove-new-editor-element",ACTIVE_ELEMENT:"remove-active-element"},eE={TRIM_SPACES:/^(\s|&nbsp;)+|(\s|&nbsp;)+$/g,LT:/&lt;/g,GT:/&gt;/g,EMPTY_TEXT:/^(?:\s|&nbsp;)*$/};function tE(e,t){if(!e)return!1;const n=e.closest("tr");return n?n.closest("table")?.classList.contains(t)??!1:!1}function kl(e){const t=tE(e,wm),n=tE(e,Cm),r=t||n;let o=null;return e&&r&&(o=e.closest("table.em-element-list-ol")||e.closest("table.em-element-list-ul")),{classNameOl:wm,classNameUl:Cm,classNameBullet:T9,isListOL:t,isListUL:n,isList:r,listType:t?"ol":n?"ul":null,tableElement:o}}function Q9(e){if(!e)return null;const t=e.closest("tr");return t?t.querySelector("td:first-child div:first-child"):null}function J9(e){return e?e.querySelector(".em-element-list-ol")||e.querySelector(".em-element-list-ul"):null}function eB(e=Object.values(J1)){e.forEach(t=>{document.querySelectorAll(`.${t}`).forEach(n=>{n.classList.remove(t)})})}function tB(e){for(const t of e.classList)if(t.startsWith("em-element-"))return!1;return!0}function nE(e,t){for(const n of e.childNodes){if(n.nodeType===Node.TEXT_NODE&&n.textContent?.trim()!==""){t.push(e);break}n.nodeType===Node.ELEMENT_NODE&&nE(n,t)}}function nB(e,t,n){const r=e.getAttribute("style")||"",o={};r.split(";").forEach(function(s){if(s.trim()){const a=s.split(":");a.length>=2&&(o[a[0].trim()]=a[1].trim())}}),o[t]=n;const i=Object.keys(o).map(function(s){return o[s]?s+": "+o[s]:null}).filter(Boolean).join("; ");e.setAttribute("style",i)}function rB(e,t){let n=[];const r=t||e,o=e?.style.fontFamily||getComputedStyle(r).fontFamily,i=[...(e?.closest('[style*="font-family"]')||e).classList].filter(s=>s.startsWith("em-font-"));if(i.length>0){n=["Google Fonts"],n[1]=o.indexOf("sans-serif")>-1?"Sans Serif":"Serif";const s=i[0].match(/em-font-(.*?)-/);if(s){n[2]=s[1];const a=new RegExp(`${n[2]}-(.*)`),l=i[0].match(a);l&&(n[3]=l[1])}}else o&&(n=["Safe Fonts",o.replaceAll('"',"'")]);return n}function oB(e){if(!e)return null;try{return e.rangeCount>0?e.getRangeAt(0):null}catch{return null}}var iB="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub";function sB(e,t=iB){if(!e)return null;const n=t.split(", ").map(o=>o.trim().toLowerCase());let r=e.nodeType===Node.ELEMENT_NODE?e:e.parentNode;for(;r&&r.nodeType===Node.ELEMENT_NODE;){const o=r;if(n.includes(o.tagName.toLowerCase())&&o.style.fontSize)return o;r=r.parentNode}return null}function aB(e,t){const{elem:n,message:r,activateSection:o}=e;if(n.closest("table")?.parentElement?.tagName!=="BODY"){r.settings.parent=t.getElementParentCaption(n);let a=n;if(n.tagName==="IMG"){const l=n.closest('div[em="atom"]'),c=n.closest(".em-element-resize-img-container");a=l||c}else n.closest("editor")?a=n.parentElement:n.tagName==="TD"&&n.classList.contains("em-vindent")?a=n.closest(".em-vindent-table"):n.tagName==="TD"&&n.parentElement?.getAttribute("em")==="block"&&(a=n.parentElement);r.settings.nextElem=!!a?.nextElementSibling&&(!a.nextElementSibling.getAttribute("contenteditable")||a.nextElementSibling.getAttribute("contenteditable")!=="false"),r.settings.prevElem=!!a?.previousElementSibling&&(!a.previousElementSibling.getAttribute("contenteditable")||a.previousElementSibling.getAttribute("contenteditable")!=="false")}else r.settings.parent=void 0;(n.closest('div[style*="inline-block"]')||n.closest(".em-mob-wrap, .noresp-em-mob-wrap"))&&(r.settings.floatBlocks=t.getStructureColumns({elem:n})),o&&(r.settings.activateSection=o),n.classList.contains("em-mob-wrap")||n.classList.contains("noresp-em-mob-wrap")||n.parentElement?.hasAttribute("em")&&n.parentElement.getAttribute("em")==="group"&&document.querySelectorAll('[em="group"]').length===1?r.settings.deletable=!1:r.settings.deletable=!0,r.settings.usedColors=t.getUsedColors(),r.settings.path=t.getElementPath(n);const i=t.getCurrentElementPath();r.type==="button"&&(r.settings.commonStyles=t.commonStyles);const s=n?.classList;return t.ampService.hasAmp&&s&&(s.contains("em-amp-show-only")?r.settings.ampShow="amp":s.contains("em-amp-show-disabled")?r.settings.ampShow="html":r.settings.ampShow="all"),r.settings=t.mapObj.unescape(r.settings),{message:r,elementPath:i}}function lB(e,t,n,r){let o=!1,i=!1;if(t.shouldResetProgrammaticSelection&&(i=!0,!t.settings||Object.keys(t.settings).length===0))return o=!0,{shouldReturn:o,isProgrammaticSelectionReset:i};if(t.removeEmEdit){if(r.removeAllAttributes("em-edit"),t.setEmEditOnTd){for(const s of e.querySelectorAll("[contenteditable]"))s.removeAttribute("contenteditable");e.querySelector("td")?.setAttribute("em-edit","active")}if(t.editTargetTd){const s=e.closest("table")?.closest("td");if(s)for(const a of s.querySelectorAll("[contenteditable]"))a.removeAttribute("contenteditable");t.editTargetTd.setAttribute("em-edit","active")}}return t.isNewLink&&(e.removeAttribute("new"),n.settings.isNewLink=!0,e.setAttribute("em-edit","active")),{shouldReturn:o,isProgrammaticSelectionReset:i}}function cB(e,t,n,r){if(!document.body.classList.contains("mceNonEditable")&&!(!t&&n)){if(r.removeAllAttributes("em-edit"),e.tagName!=="TABLE"){Gc(e).setAttribute("em-edit","active");const o=e.closest("table");if(o){for(const a of o.querySelectorAll('[contenteditable="true"]'))a.tagName!=="EDITOR"&&a.removeAttribute("contenteditable");const i=o.querySelector("editor"),s=i?.firstChild;i?.childNodes.length===1&&s?.nodeType===1&&s?.tagName==="A"&&s?.childNodes.length===1&&s?.firstChild?.nodeType===3?s.setAttribute("contenteditable","true"):i?.setAttribute("contenteditable","true")}}[...e.parentElement?.querySelectorAll("strike, s")||[]].forEach(o=>o.style.textDecoration="line-through"),[...e.parentElement?.getElementsByTagName("u")||[]].forEach(o=>o.style.textDecoration="underline")}}function uB(e,t){const n=t.getSelectedText(),r=window.getSelection(),o=t.getRangeFromSelection(r);let i=null,s=null,a=null;function l(c){let u=c;u.nodeType===Node.TEXT_NODE&&(u=u.parentNode);const d=u?.closest("em-replace");return e?d?.textContent||null:d?.getAttribute("text")||null}return o&&(n?(s=l(o.startContainer),a=l(o.endContainer),s?.length&&a?.length&&s!==a&&(s=a=null)):i=l(o.commonAncestorContainer)),n?s||a:i}function dB(e,t){let n=t.getVariableByIcon(e)||!t.htmlDocument.getMappedParent(e)?e:t.htmlDocument.getVisibleNode(e);if(n.closest("a")&&t.findOutermostParentWithText(n,"a")&&n.tagName!=="IMG"&&n.tagName!=="AMP-IMG"&&(n=t.findOutermostParentWithText(n,"a")),n?.closest(".em-vindent")){const r=n.closest('div[style*="height"][style*="line-height"]');r?n=r:n=n.closest("td")}return n.tagName==="DIV"&&n.closest("amp-accordion")&&setTimeout(()=>{t.sendResizeEvent()},350),(n?.closest(".em-element-resize-img")||n?.closest(".em-element-img-change-group")||n?.closest(".em-element-resize-img-container"))&&(n=n.closest(".em-element-resize-img-container").querySelector("img")),(n.tagName==="TD"&&n.classList.contains("em-mob-wrap")&&(n.cellIndex+1)%2===0||n.closest(".em-gap"))&&(n=Pd(n)??n),n}function mB(e,t){const{elem:n,isCellCustomTable:r,listContext:o,requestElemBullet:i,variableElement:s}=e,{isListOL:a,isListUL:l,isList:c}=o;return{Locale:t.Locale,isProgrammaticSelection:t.isProgrammaticSelection,isCellCustomTable:r,extractorContext:{variableElement:s,requestElemBullet:i,isElementListOL:a,isElementListUL:l,isElementList:c},customTableContext:{getElementTdDiv:t.getElementTdDiv,parseTableElementToModel:t.parseTableElementToModel,extractBorderRadius:t.extractBorderRadius,parseBackgroundStyles:t.parseBackgroundStyles,getFontFamilyFromElement:t.getFontFamilyFromElement,textHasStyle:t.textHasStyle,isElementHasBold:t.isElementHasBold,getLineHeghtInPixels:t.getLineHeghtInPixels,activeCell:t.activeCell,CLASS_FOR_BASIC_CELL:t.CLASS_FOR_BASIC_CELL,requestElemWithStyle:t.requestElemWithStyle},elementContext:{getElementTdDiv:t.getElementTdDiv,getLineHeghtInPixels:t.getLineHeghtInPixels},linkTextContext:{variableElement:s,requestElemBullet:i,isElementListOL:a,isElementListUL:l,isElementList:c,findElementWithSelectedText:t.findElementWithSelectedText,selectedText:t.getSelectedText()},_isCarouselElement:t._isCarouselElement,_isAccordionElement:t._isAccordionElement,_isSocialBlockElement:t._isSocialBlockElement,_isImageElement:t._isImageElement,_isLinkElement:t._isLinkElement,_isButtonElement:t._isButtonElement,_isTableElement:t._isTableElement,_isCustomTableElement:t._isCustomTableElement,_isAtomElement:t._isAtomElement,_isTdColumnGroup:t._isTdColumnGroup,_isTdStructure:t._isTdStructure,_isEmptyTd:t._isEmptyTd,_isTdCell:t._isTdCell,_isVindentTd:t._isVindentTd,_isVindentDiv:t._isVindentDiv,_isFloatBlockElement:t._isFloatBlockElement,_isDivTextElement:t._isDivTextElement,_isInlineButtonElement:t._isInlineButtonElement,_extractTextSettings:t._extractTextSettings,_extractCarouselSettings:t._extractCarouselSettings,_extractAccordionSettings:t._extractAccordionSettings,_extractSocialSettings:t._extractSocialSettings,_extractImgSettings:t._extractImgSettings,_extractButtonSettings:t._extractButtonSettings,_extractLinkTextSettings:t._extractLinkTextSettings,_extractTableSettings:t._extractTableSettings,_extractCustomTableSettings:t._extractCustomTableSettings,_extractAtomElementSettings:t._extractAtomElementSettings,_extractProgrammaticElementSettings:t._extractProgrammaticElementSettings,_extractTdColumnGroupSettings:t._extractTdColumnGroupSettings,_extractTdStructureSettings:t._extractTdStructureSettings,_extractTdCellSettings:t._extractTdCellSettings,_extractVindentSettings:t._extractVindentSettings,_extractFloatBlockSettings:t._extractFloatBlockSettings,_extractDivContainerSettings:t._extractDivContainerSettings,_clearActiveEditElements:t._clearActiveEditElements,HTMLDocument:t.HTMLDocument,parseFromString:t.parseFromString,getParentElementOfSelection:t.getParentElementOfSelection}}function fB(e){return["EM-REPLACE","EDITOR","B","STRONG","U","S","STRIKE","SPAN","FONT","I","EM","P","A","H1","H2","H3","H4","H5","H6","SUP","SUB"].includes(e)}function pB(e,t,n){const{Locale:r,isProgrammaticSelection:o,isCellCustomTable:i}=n;if(!t&&!e.closest("a")&&!o&&!i){let s=e;e.querySelector("editor")&&(s=n.getParentElementOfSelection());const a=n._extractTextSettings({elem:s},r,n.extractorContext);return{type:a.type,caption:a.caption,settings:a}}if(n._isCarouselElement(e)){const s=n._extractCarouselSettings({elem:e},r,{clearActiveEditElements:n._clearActiveEditElements});return{type:s.type,caption:s.caption,settings:s}}if(n._isAccordionElement(e)){const s=n._extractAccordionSettings({elem:e},r,{clearActiveEditElements:n._clearActiveEditElements,HTMLDocument:n.HTMLDocument,parseFromString:n.parseFromString});return{type:s.type,caption:s.caption,settings:s}}if(n._isSocialBlockElement(e)){const s=n._extractSocialSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isImageElement(e)){const s=n._extractImgSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isLinkElement(e,i)){if(n._isButtonElement(e)){const l=n._extractButtonSettings({elem:e},r),c={type:l.type,caption:l.caption,settings:l};return e.getAttribute("new")&&(c.isNewLink=!0),c}const s=n._extractLinkTextSettings({elem:e},r,n.linkTextContext),a={type:s.type,caption:s.caption,settings:s};return e.getAttribute("new")&&(a.isNewLink=!0),a}if(n._isTableElement(e)){const s=n._extractTableSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s.type!=="emptyTable"?s:{}}}if(e.tagName==="LI"&&_m(e)){const s=n._extractTextSettings({elem:e},r,n.extractorContext);return{type:s.type,caption:s.caption,settings:s}}if(n._isCustomTableElement(e)){const s=n._extractCustomTableSettings({elem:e},r,n.customTableContext);return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isAtomElement(e)){const s=n._extractAtomElementSettings({elem:e},r,n.elementContext);return{type:s.type,caption:s.caption,settings:s,removeEmEdit:!0,setEmEditOnTd:!0}}if(o){const s=n._extractProgrammaticElementSettings({elem:e},r,n.elementContext);return s.settings?{type:s.settings.type,caption:s.settings.caption,settings:s.settings,removeEmEdit:!0,editTargetTd:s.editTargetTd,shouldResetProgrammaticSelection:s.shouldResetProgrammaticSelection}:{type:null,settings:{},shouldResetProgrammaticSelection:!0}}if(n._isTdColumnGroup(e)){const s=n._extractTdColumnGroupSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isTdStructure(e)){const s=n._extractTdStructureSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isEmptyTd(e))return{type:"emptyTd",settings:{}};if(n._isTdCell(e)){const s=n._extractTdCellSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isVindentTd(e)){const s=n._extractVindentSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isVindentDiv(e)){const s=n._extractVindentSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isFloatBlockElement(e)){const s=n._extractFloatBlockSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isDivTextElement(e)){const s=n._extractTextSettings({elem:e},r,n.extractorContext);return{type:s.type,caption:s.caption,settings:s}}if(e.tagName==="DIV"||e.tagName==="TD"&&e.firstChild?.tagName==="EDITOR"){const s=n._extractDivContainerSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s}}if(fB(e.tagName)&&(e.tagName!=="EM-REPLACE"||!e.closest("a"))){if(n._isInlineButtonElement(e)){const s=n._extractButtonSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(!o){const s=n._extractTextSettings({elem:e},r,n.extractorContext);return{type:s.type,caption:s.caption,settings:s}}}return{type:null,settings:{}}}var hB={_isCarouselElement:h8,_isAccordionElement:KD,_isSocialBlockElement:W8,_isImageElement:N8,_isLinkElement:d8,_isButtonElement:u8,_isTableElement:X8,_isCustomTableElement:g8,_isAtomElement:v8,_isTdColumnGroup:Y8,_isTdStructure:K8,_isEmptyTd:Z8,_isTdCell:Q8,_isVindentTd:Y9,_isVindentDiv:K9,_isFloatBlockElement:k8,_isDivTextElement:U9,_isInlineButtonElement:m8,_extractTextSettings:$9,_extractCarouselSettings:f8,_extractAccordionSettings:YD,_extractSocialSettings:q8,_extractImgSettings:L8,_extractButtonSettings:c8,_extractLinkTextSettings:j9,_extractTableSettings:G8,_extractCustomTableSettings:b8,_extractAtomElementSettings:w8,_extractProgrammaticElementSettings:C8,_extractTdColumnGroupSettings:e9,_extractTdStructureSettings:t9,_extractTdCellSettings:n9,_extractVindentSettings:Z9,_extractFloatBlockSettings:_8,_extractDivContainerSettings:y8,_clearActiveEditElements:X_};function gB(e){const t=e.programmaticSelection??{get:()=>!!x.get("isProgrammaticSelection"),reset:()=>x.set("isProgrammaticSelection",!1)},n=()=>{const o={operation:"application_element_settings_set",settings:e.getMapObj().unescape({parent:void 0,nextElem:!1,prevElem:!1}),type:null};Z.send(o)},r=o=>{if(x.isActiveElementLocked())return;const i=o.elem??document.querySelector("[em-edit]");try{if(x.increment("activeElementLocked"),Jn("em-edit"),!i){setTimeout(()=>{const y=document.querySelector("[em-edit]");y?.isConnected?r({elem:y}):n()},0);return}if(i.closest(".em-prevent-action"))return;const s=dB(i,{getVariableByIcon:ll,htmlDocument:e.htmlDocument,findOutermostParentWithText:Qc,sendResizeEvent:jv}),a=s.tagName==="EDITOR"&&s.firstChild?.nodeType===1?s.firstChild:s,l=kl(s),c=window.getSelection()?.isCollapsed??!0;cB(s,c,!!s.querySelector("editor"),{removeAllAttributes:Jn});const u={...hB,HTMLDocument:e.htmlDocument,parseFromString:Te,getParentElementOfSelection:ua,getSelectedText:Ke,findElementWithSelectedText:di,parseTableElementToModel:es,extractBorderRadius:mD,parseBackgroundStyles:nD,isElementHasBold:F_,Locale:ns(),isProgrammaticSelection:t.get(),getElementTdDiv:BD,getLineHeghtInPixels:Cl,getFontFamilyFromElement:y=>rB(y,a),textHasStyle:Ze,activeCell:x.get("activeCell"),CLASS_FOR_BASIC_CELL:se,requestElemWithStyle:a},d=mB({elem:s,isCellCustomTable:!!s.closest(".em-element-custom-table"),listContext:{isListOL:l.isListOL,isListUL:l.isListUL,isList:l.isList},requestElemBullet:l.isList?Q9(s):null,variableElement:(y,E=!1)=>uB(E,{getSelectedText:Ke,getRangeFromSelection:oB})},u),m=pB(s,c,d),p={operation:"application_element_settings_set",type:m.type,caption:m.caption,settings:m.settings},f=lB(s,m,p,{removeAllAttributes:Jn});if(f.isProgrammaticSelectionReset&&t.reset(),f.shouldReturn)return;const h=aB({elem:s,message:p,activateSection:o.activateSection},{getElementParentCaption:w1,getStructureColumns:HD,getUsedColors:Qv,getElementPath:XD,getCurrentElementPath:zD,mapObj:e.getMapObj(),commonStyles:x.get("commonStyles"),...e.enrichExtras()});x.update({elementPath:h.elementPath}),e.fingerprint.remember(s),Z.send(h.message)}finally{Promise.resolve().then(()=>{e.fingerprint.remember(document.querySelector("[em-edit]")),x.decrement("activeElementLocked")})}};return r}function rE(){return x.get("emailWidth")}function bB(e){const t=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let n=0;n<t.length;n++){const r=t[n];if(r.classList.contains("em-insert-ignore"))continue;const o=r.getAttribute("width");if(o!=null&&o!=="")return!0}return!1}function Lm(e){const t=[...e.children].filter(r=>r.tagName==="TR");if(t.length)return t.map(r=>Vt(r)).join(`
89
+ `);const n=e.querySelector("tr");return n?Vt(n):Ct(e)}function Nm(e,t){const n=rE(),r=document.createElement("table");r.replaceChildren(...Te(e.blockHTML));let o=660;if(e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){o=0;const s=r.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:e.project==="useblocks"?640:660;if(document.body.clientWidth>(n||s))o=e.targetBlock.clientWidth;else{const a=e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(a&&a.parentElement){a.parentElement.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").forEach(d=>{o+=parseFloat(d.getAttribute("width")||"0")});const l=a.parentElement.closest("td"),c=parseFloat(l?.style.paddingLeft||"0")||0,u=parseFloat(l?.style.paddingRight||"0")||0;o+=c,o+=u}}}else if(e.targetBlock.closest(".container-td"))o=parseInt(String(e.targetBlock.offsetWidth));else{const s=e.targetBlock.querySelector('table[style*="max-width"]'),a=e.targetBlock.querySelector('div[style*="max-width"]'),l=e.targetBlock.querySelector('.row-content[style*="width"]');s?o=parseInt(String(s.offsetWidth)):a?o=parseInt(String(a.offsetWidth)):l?o=parseInt(String(l.offsetWidth)):o=e.targetBlock.style.maxWidth?parseFloat(e.targetBlock.style.maxWidth):e.targetBlock.getBoundingClientRect().width}let i=r.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:e.project==="useblocks"?640:660;if(r.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){i=0;const s=r.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(s&&s.parentElement){s.parentElement.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").forEach(u=>{i+=parseFloat(u.getAttribute("width")||"0")});const a=s.parentElement.closest("td"),l=parseFloat(a?.style.paddingLeft||"0")||0,c=parseFloat(a?.style.paddingRight||"0")||0;i+=l,i+=c}}if(r.querySelector('div[style*="inline-block"]')){if(o<660&&r.querySelector('div[style*="inline-block"]'))if(r.querySelectorAll('div[style*="inline-block"]').length>1)r.querySelectorAll('div[style*="inline-block"]').forEach(s=>{const a=s,l=parseFloat(a.style.width),c=l/i,u=s.firstElementChild;if(!u)return;const d=l-parseFloat(u.getAttribute("width")||"0"),m=parseFloat(String(o*c));a.style.width=m+"px",u.setAttribute("width",String(m-d)),da({elem:a,width:m})});else{const s=r.querySelector('div[style*="inline-block"]');s.style.maxWidth=o+"px",da({elem:s,width:o}),s.firstElementChild&&(s.firstElementChild.setAttribute("width",String(Math.round(o*.91))),s.firstElementChild.style.maxWidth=Math.round(o*.91)+"px")}}else if(r.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){const s=[];r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(function(a){const l=lh(a);l&&s.indexOf(l)===-1&&s.push(l)}),s.forEach(a=>{const l=a.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(!l||!l.parentElement)return;const c=l.parentElement.closest("td"),u=parseFloat(c?.style.paddingLeft||"0")||0,d=parseFloat(c?.style.paddingRight||"0")||0;if(a.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length>1){if(!bB(a))return;const m=a.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),p=m?parseFloat(m.getAttribute("width")||"0"):0,f=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").length;let h=0,y=0;a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(k=>{if(k.getAttribute("width")&&!k.classList.contains("em-insert-ignore")){const w=parseFloat(k.getAttribute("width"))/i,b=Math.round(parseFloat(String(o*w))-p/(f*2));k.setAttribute("width",String(b)),h+=b}});const E=o-(u+d+p*(f-1)+h);a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(k=>{if(k.getAttribute("width")&&!k.classList.contains("em-insert-ignore")){const w=parseFloat(k.getAttribute("width"))+Math.round(E/f);y+=w,k.setAttribute("width",String(w)),k.querySelector("img")&&k.querySelectorAll("img").forEach(b=>{parseFloat(b.getAttribute("width")||"0")>parseFloat(k.getAttribute("width"))+Math.round(E/f)&&(b.setAttribute("width",k.getAttribute("width")),b.style.maxWidth=k.getAttribute("width")+"px")})}}),y=y+p*(f-1)+u+d;const C=o-y;if(C!==0&&h>0){const k=a.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(k&&!k.classList.contains("em-insert-ignore")){const w=parseFloat(k.getAttribute("width")||"0");k.setAttribute("width",String(w+C))}else{const w=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let b=w.length-1;b>=0;b--){const v=w[b];if(v.classList.contains("em-insert-ignore"))continue;const A=parseFloat(v.getAttribute("width")||"0");v.setAttribute("width",String(A+C));break}}}}else if(l.getAttribute("width")&&!l.classList.contains("em-insert-ignore")){const m=Math.round(o-u-d);l.setAttribute("width",String(m))}})}return Lm(r)}function xm(e){const t=document.createElement("table");t.replaceChildren(...Te(e));const n=!!document.querySelector(".noresp-em-narrow-table");return t.querySelectorAll(".em-mob-wrap[width], .noresp-em-mob-wrap[width]").forEach(r=>{const o=parseFloat(r.getAttribute("width")||"0");o&&r.querySelectorAll('[em="atom"] img:not(.em-countdown)').forEach(i=>{parseFloat(i.getAttribute("width")||"0")<=o||(i.setAttribute("width",String(o)),n||(i.style.maxWidth=o+"px"))})}),Lm(t)}function Mm(e,t){const n=rE(),r=document.createElement("table");r.replaceChildren(...Te(e.blockHTML));let o=660;const i=e.targetBlock.tagName==="TR"?document.createElement("table"):document.createElement("div");if(i.style.width=n+"px",i.style.height="1000px",i.style.borderCollapse="collapse",i.setAttribute("cellpadding","0"),i.setAttribute("cellspacing","0"),i.style.position="absolute",i.style.top="-9999px",i.style.left="-9999px",document.body.appendChild(i),i.innerHTML=t.getOuterHtml(e.targetBlock),n)o=n;else{const a=i.querySelector('table[style*="max-width"]'),l=i.querySelector('div[style*="max-width"]'),c=i.querySelector('.row-content[style*="width"]');if(a)o=parseInt(String(a.offsetWidth));else if(l)o=parseInt(String(l.offsetWidth));else if(c)o=parseInt(String(c.offsetWidth));else{const u=i.querySelector(e.targetBlock.tagName);o=u?.style.maxWidth?parseFloat(u.style.maxWidth):u?.getBoundingClientRect().width||660}}document.body.removeChild(i);const s=r.querySelector("table:first-child");return s?.style.maxWidth&&(s.style.maxWidth=o+"px",da({elem:s,width:o})),Lm(r)}function Ll(e){const t=e.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap");if(!t.length)return;const n=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),r=Array.from(n).filter(u=>!u.classList.contains("em-insert-ignore")&&u.getAttribute("width")!=null&&u.getAttribute("width")!=="");if(r.length===0)return;const o=e.parentElement?.getBoundingClientRect().width||0;let i=0,s=0;t.forEach(u=>{i+=parseFloat(u.getAttribute("width")||"0")});let a=e.querySelector(".em-mob-wrap");for(;a&&a!==e.parentElement?.parentElement;){const u=window.getComputedStyle(a),d=parseFloat(u.paddingLeft)||0,m=parseFloat(u.paddingRight)||0;(d>0||m>0)&&(s+=d+m),a=a.parentElement}const l=o-(i+s),c=r.length;r.forEach(u=>{const d=parseFloat(u.getAttribute("width")||"0")+Math.ceil(l/c);u.setAttribute("width",String(d))})}function yB(e,t){const n=t==="sup"?"sub":"sup";e.querySelectorAll(`${t}, ${n}`).forEach(r=>{const o=r.parentNode;if(o){for(;r.firstChild;)o.insertBefore(r.firstChild,r);r.remove()}})}function oE(e,t,n){const r=document.createElement(n);try{if(typeof t=="string")r.textContent=t||e.toString();else if(t instanceof DocumentFragment)r.appendChild(t);else if(t instanceof HTMLElement)for(;t.firstChild;)r.appendChild(t.firstChild);else r.textContent=e.toString();e.deleteContents(),e.insertNode(r)}catch{return null}return r}function vB(e){const t=e.parentNode;if(!t)return document.createTextNode("");if(Array.from(e.childNodes).some(n=>n.nodeType===1)){const n=document.createDocumentFragment(),r=Array.from(e.childNodes);for(;e.firstChild;)n.appendChild(e.firstChild);return t.replaceChild(n,e),r[0]||document.createTextNode("")}else{const n=e.textContent||"",r=document.createTextNode(n);return t.replaceChild(r,e),r}}function EB(e,t,n){if(!e)return!1;const r=e.textContent?.trim()||"";let o="";if(n){const i=t.cloneRange(),s=i;try{s.expand&&s.expand("word"),o=i.toString().trim()}catch{return!1}}else o=t.toString().trim();return r===o}function SB(e,t){const n=e.textContent||"",r=t.toString(),o=t.startOffset,i=t.endOffset,s=document.createTextNode(n.slice(0,o)),a=document.createTextNode(r),l=document.createTextNode(n.slice(i)),c=e.parentNode;return c&&(c.insertBefore(s,e),c.insertBefore(a,e),l.textContent&&c.insertBefore(l,e),e.remove()),t.setStart(a,0),t.setEnd(a,a.length),a}function wB(e,t=[]){const n=[...new Set(["strong","em","b","i","u","sub","sup","strike",...t])].join(", ");e.querySelectorAll(n).forEach(r=>{!r.textContent?.trim()&&(!r.hasChildNodes()||Array.from(r.childNodes).every(o=>o.nodeType===Node.TEXT_NODE&&!o.textContent?.trim()))&&r.remove()})}function CB(e,t=10){const n=e.length;return n===0?!1:(e.match(/[а-яА-ЯёЁ]/g)||[]).length/n*100>t}var AB={bold:"strong|s|b",italic:"em|i",strike:"strike",underline:"u",strikeUnderline:"strike|u"};function us(e,t){const n=AB[t]||t,r=new RegExp(`<\\/?(${n})>`,"gi");return e.replaceAll(r,"")}var TB=["strong","em","strike","sub","sup","b","i","s","u"];function _B(e,t){if(t)for(const n of TB)t.closest(n)&&e.querySelectorAll(n).forEach(r=>{const o=r.parentNode;if(o){for(;r.firstChild;)o.insertBefore(r.firstChild,r);r.remove()}})}function kB(e,t){t&&t.closest("a")&&e.querySelectorAll("a").forEach(n=>{const r=n.parentNode;if(r){for(;n.firstChild;)r.insertBefore(n.firstChild,n);n.remove()}})}var LB=new Set(["alt","title","link"]);function NB(e,t,n){const r=Object.keys(n.settings??{});return n.type==="img"&&r.length>0&&r.every(o=>LB.has(o))&&e.parentNode===t.parent}function xB(e){let t=e?.parentElement??null;for(;t&&!t.tagName.startsWith("AMP-");)t=t.parentElement;const n=e?.tagName??"",r=t&&e?Array.from(t.getElementsByTagName(n)).indexOf(e):-1;return{root:t,tag:n,index:r,parent:e?.parentNode??null}}function MB(e,t,n,r,o){const i=o.getMappedParent(e);if(!i?.isConnected||NB(e,n,r))return null;const s=i.tagName.startsWith("AMP-"),a=s&&i===n.root&&n.index>=0,l=s?Array.from(i.querySelectorAll("section"),m=>m.hasAttribute("expanded")):[],c=o.parseFromString(o.getOuterHtml(i))[0];i.parentNode?.replaceChild(c,i);let u=c;const d=a?c.getElementsByTagName(n.tag)[n.index]??null:null;return d?u=d:t?.tagName==="A"&&c.tagName!=="A"&&(u=c.querySelector("a")??c),u.setAttribute("em-edit","active"),{active:u,afterCommit:()=>{c.querySelectorAll("section").forEach((m,p)=>{l[p]&&m.setAttribute("expanded","")})}}}function RB(e,t){const{activeElement:n}=t;let r=!1;if(!e)return r;const o=n.closest("a"),i=n.closest("td"),s=i?dr(i):null,a=o?dr(o):null,l=!!s&&!a,c=Qd(o),u=e.outlookRounding===!0||e.outlookRounding!==!1&&(l||c)?o:i;if(e.exportAsPicture?n.closest("table")?.setAttribute("em-operation","exportAsPicture"):n?.closest("table")?.getAttribute("em-operation")==="exportAsPicture"&&n.closest("table")?.removeAttribute("em-operation"),e.href!==void 0&&n.closest("a")?.setAttribute("href",e.href),e.align){const f=n.closest("td")?.closest("table")?.closest("div, p, td");f&&(f.style.textAlign?f.style.textAlign=e.align:f.setAttribute("align",e.align))}else if(e.align===""){const f=n.closest("td")?.closest("table")?.closest("div, p, td");f&&(f.style.textAlign?f.style.removeProperty("text-align"):f.removeAttribute("align"))}if(e.textAlign){const f=n.closest("td");f&&(f.style.textAlign?f.style.textAlign=e.textAlign:f.setAttribute("align",e.textAlign))}else if(e.textAlign===""){const f=n.closest("td");f&&(f.style.textAlign?f.style.removeProperty("text-align"):f.removeAttribute("align"))}if(e.valign?n.closest("td")?.closest("table")?.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&n.closest("td")?.closest("table")?.closest("td")?.removeAttribute("valign"),e.width){const f=n.closest("table");f&&(e.width.value?(f.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),f.style.width=e.width.value+e.width.dim):(f.removeAttribute("width"),f.style.removeProperty("width")))}if(e.height){const f=n.closest("td"),h=n.closest("a");if(e.height.value){if(f&&(f.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),f.style.height=e.height.value+e.height.dim),h){const y=e.height.value+e.height.dim;h.style.height=y,h.style.lineHeight=y,h.firstElementChild&&(h.firstElementChild.style.lineHeight=y);const E=h.closest("editor")||h.querySelector("editor");E&&(E.style.height=y,E.style.lineHeight=y)}}else if(f&&(f.removeAttribute("height"),f.style.removeProperty("height")),h){h.style.removeProperty("height"),h.style.removeProperty("line-height");const y=h.closest("editor")||h.querySelector("editor");y&&(y.style.removeProperty("height"),y.style.removeProperty("line-height"))}}if(e.border&&u&&t.setElementBorder({settings:e,elem:u}),e.boxShadow&&u&&t.setElementBoxShadow({settings:e,elem:u}),e.backgroundColor!==void 0&&u&&(e.backgroundColor===""?(u.removeAttribute("bgcolor"),u.style.removeProperty("background-color")):(u.tagName==="TD"&&u.setAttribute("bgcolor",e.backgroundColor),u.style.backgroundColor=e.backgroundColor)),e.backgroundImage){const f=n.closest("td");f&&(e.backgroundImage[0].value===""?(f.style.removeProperty("background-image"),f.removeAttribute("background")):(f.style.removeProperty("background-image"),Tt(f,"background",PB(e))))}if(e.backgroundPositionX!==void 0){const f=n.closest("td");f&&(e.backgroundPositionX===""?f.style.removeProperty("background-position-x"):f.style.backgroundPositionX=e.backgroundPositionX)}if(e.backgroundPositionY!==void 0){const f=n.closest("td");f&&(e.backgroundPositionY===""?f.style.removeProperty("background-position-y"):f.style.backgroundPositionY=e.backgroundPositionY)}if(e.backgroundRepeat){const f=n.closest("td");f&&(e.backgroundRepeat==="none"?f.style.removeProperty("background-repeat"):f.style.backgroundRepeat=e.backgroundRepeat)}if(e.backgroundSize!==void 0){const f=n.closest("td");f&&(e.backgroundSize===""?f.style.removeProperty("background-size"):f.style.backgroundSize=e.backgroundSize)}if(e.padding){const f=n.closest("a");f&&(e.padding.all!==void 0?(f.style.paddingTop=e.padding.all+"px",f.style.paddingRight=e.padding.all+"px",f.style.paddingBottom=e.padding.all+"px",f.style.paddingLeft=e.padding.all+"px"):(e.padding.top!==void 0&&(f.style.paddingTop=e.padding.top+"px"),e.padding.right!==void 0&&(f.style.paddingRight=e.padding.right+"px"),e.padding.bottom!==void 0&&(f.style.paddingBottom=e.padding.bottom+"px"),e.padding.left!==void 0&&(f.style.paddingLeft=e.padding.left+"px")))}if(e.borderRadius&&u&&t.setElementBorderRadius({settings:e,elem:u}),e.mobileWidth){const f=n.closest("table");f&&t.setElementMobileWidth({settings:e,elem:f}),r=!0}if(e.mobileHeight){const f=n.closest("td");f&&t.setElementMobileHeight({settings:e,elem:f}),t.setElementMobileLineHeight({settings:e,elem:n}),r=!0}if(e.mobileBorder){const f=n.closest("td");f&&t.setElementMobileBorder({settings:e,elem:f}),r=!0}if(e.mobileBorderRadius){const f=n.closest("td");f&&t.setElementMobileBorderRadius({settings:e,elem:f}),r=!0}if(e.mobileBoxShadow){const f=n.closest("td");f&&t.setElementMobileBoxShadow({settings:e,elem:f}),r=!0}if(e.mobileTextAlign){const f=rs(n);f&&t.setElementMobileAlign({settings:e,elem:f,fieldName:"mobileTextAlign"}),r=!0}if(e.mobileAlign){const f=n.closest("td")?.closest("table");f&&t.setElementMobileTableAlign({settings:e,elem:f}),r=!0}if(e.mobileVerticalAlign){const f=n.closest("td");f&&t.setElementMobileVerticalAlign({settings:e,elem:f}),r=!0}if(e.mobileBackgroundColor){const f=n.closest("td");f&&t.setElementMobileBackgroundColor({settings:e,elem:f}),r=!0}if(e.mobileBackgroundImage){const f=n.closest("td");f&&t.setElementMobileBackgroundImage({settings:e,elem:f}),r=!0}if(e.mobileBackgroundPositionX){const f=n.closest("td");f&&t.setElementMobileBackgroundPositionX({settings:e,elem:f}),r=!0}if(e.mobileBackgroundPositionY){const f=n.closest("td");f&&t.setElementMobileBackgroundPositionY({settings:e,elem:f}),r=!0}if(e.mobileBackgroundRepeat){const f=n.closest("td");f&&t.setElementMobileBackgroundRepeat({settings:e,elem:f}),r=!0}const d=e;if(d.mobileBackgroundSize){const f=n.closest("td");f&&t.setElementMobileBackgroundSize?.({settings:d,elem:f}),r=!0}if(e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show){const f=n.closest("table");f&&t.setElementShow({settings:e,elem:f}),r=!0}const m=n.closest("a");if(m&&e.textColor!==void 0){const f=String(e.textColor||"");m.style.color=f,m.querySelectorAll('span[style*="color"], font[color]').forEach(h=>{h.style.removeProperty("color"),h.removeAttribute("color")})}if(m&&e.textBackgroundColor!==void 0){const f=String(e.textBackgroundColor||"");m.style.backgroundColor=f,m.querySelectorAll('span[style*="background-color"]').forEach(h=>{h.style.removeProperty("background-color")})}const p=["textColor","textBackgroundColor"];if(t.textStyleProperties.filter(f=>!p.includes(f)&&e.hasOwnProperty(f)).length>0)try{t.toggleTextStyle(n,{type:"button",settings:e})}catch{}return e.mobileFontSize&&(t.setElementMobileFontSize({settings:e,elem:n}),r=!0),e.textReplacer!==void 0&&OB(e.textReplacer,n,t.compareStrings),e.outlookRounding===!0?em(n,e):e.outlookRounding===!1?s4(n):(s||c)&&em(n,e),i&&Ki(i,e,"inside"),r}function OB(e,t,n){if(e){const r=window.getSelection();if(!r||r.rangeCount===0)return;const o=r.getRangeAt(0),i=e.replace(/~~.*$/,""),s=o?.commonAncestorContainer,a=s?.nodeType===1?s:s.parentElement;let l=a?.closest("em-replace");const c=!!(/~~/.test(e)&&l);if(c&&a){const u=e.replace(/~~.*$/,"");a.setAttribute("text",u),a.innerHTML=u}if(!l&&r.rangeCount>0&&!o.collapsed){const u=document.querySelectorAll("em-replace");if(l=Array.prototype.find.call(u,d=>d.textContent?.trim()===r.toString().trim()&&r.toString().trim()!==""),!l){const d=document.querySelector('[em-edit="active"]');d?.textContent===o.toString()&&o.selectNodeContents(d);const m=e.replace(/~~.*$/,""),p=document.createElement("em-replace");p.setAttribute("text",m),o.surroundContents(p)}}if(!l&&r.rangeCount>0&&o.collapsed){let u=document.querySelector("em-replace");if(u){const d=document.querySelectorAll("em-replace"),m=/~$/;l=Array.prototype.find.call(d,p=>{const f=e,h=p.textContent||"";return f.length===1&&m.test(h)?!0:n(h,f)}),l&&(l.setAttribute("text",e),l.textContent=e),l||(u=document.createElement("em-replace"),u.setAttribute("text",i),o.insertNode(u),u.innerHTML=i,o.collapse())}else u=document.createElement("em-replace"),u.setAttribute("text",i),o.insertNode(u),u.innerHTML=i,o.collapse()}l&&!c&&(l.getAttribute("text")===l.innerHTML&&(l.innerHTML=e),l.setAttribute("text",e))}else if(e===""){const r=t?.closest("em-replace")||t?.querySelector("em-replace");if(r){const o=r.parentNode,i=r.firstChild,s=r.lastChild;if(r.getAttribute("text")!==r.innerHTML&&o)for(;r.firstChild;)o.insertBefore(r.firstChild,r);const a=document.createRange(),l=window.getSelection();i&&s&&l&&(a.setStartBefore(i),a.setEndAfter(s),l.removeAllRanges(),l.addRange(a)),r.remove()}}}function PB(e){return e.backgroundImage?.[0]?.value??""}function IB(e,t){const n=t.activeElement;let r=!1;if(!e)return r;e.exportAsPicture?n.setAttribute("em-operation","exportAsPicture"):n.getAttribute("em-operation")==="exportAsPicture"&&n.removeAttribute("em-operation"),e.align?n.style.textAlign?n.style.textAlign=e.align:n.setAttribute("align",e.align):e.align===""&&(n.style.textAlign?n.style.removeProperty("text-align"):n.removeAttribute("align")),e.valign?n.style.verticalAlign=e.valign:e.valign===""&&n.style.removeProperty("vertical-align"),e.width&&(e.width.value?n.style.width=e.width.value+e.width.dim:n.style.removeProperty("width")),e.minWidth&&(e.minWidth.value?n.style.minWidth=e.minWidth.value+e.minWidth.dim:n.style.removeProperty("min-width")),e.maxWidth&&(e.maxWidth.value?n.style.maxWidth=e.maxWidth.value+e.maxWidth.dim:n.style.removeProperty("max-width")),e.height&&(e.height.value?n.style.height=e.height.value+e.height.dim:n.style.removeProperty("height")),e.border&&t.setElementBorder({settings:e,elem:n}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:n}),e.backgroundColor!==void 0&&(e.backgroundColor===""?n.style.removeProperty("background-color"):n.style.backgroundColor=e.backgroundColor),e.backgroundImage&&(e.backgroundImage[0].value===""?n.style.removeProperty("background-image"):n.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")"),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?n.style.removeProperty("background-position-x"):n.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?n.style.removeProperty("background-position-y"):n.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?n.style.removeProperty("background-repeat"):n.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?n.style.removeProperty("background-size"):n.style.backgroundSize=e.backgroundSize),e.padding&&(e.padding.all!==void 0?(n.style.paddingTop=e.padding.all+"px",n.style.paddingRight=e.padding.all+"px",n.style.paddingBottom=e.padding.all+"px",n.style.paddingLeft=e.padding.all+"px"):(e.padding.top&&(n.style.paddingTop=e.padding.top+"px"),e.padding.right&&(n.style.paddingRight=e.padding.right+"px"),e.padding.bottom&&(n.style.paddingBottom=e.padding.bottom+"px"),e.padding.left&&(n.style.paddingLeft=e.padding.left+"px"))),e.borderRadius&&t.setElementBorderRadius({settings:e,elem:n}),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:n}),r=!0),e.mobileHeight&&(t.setElementMobileHeight({settings:e,elem:n}),r=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:n}),r=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:n}),r=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:n}),r=!0),e.mobileAlign&&(t.setElementMobileAlign({settings:e,elem:n}),r=!0),e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:n}),r=!0),e.mobileDirection&&(t.setElementMobileDirection({settings:e,elem:n}),r=!0),e.mobileBackgroundColor&&(t.setElementMobileBackgroundColor({settings:e,elem:n}),r=!0),e.mobileBackgroundImage&&(t.setElementMobileBackgroundImage({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionX&&(t.setElementMobileBackgroundPositionX({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionY&&(t.setElementMobileBackgroundPositionY({settings:e,elem:n}),r=!0),e.mobileBackgroundRepeat&&(t.setElementMobileBackgroundRepeat({settings:e,elem:n}),r=!0);const o=e;return o.mobileBackgroundSize&&(t.setElementMobileBackgroundSize?.({settings:o,elem:n}),r=!0),e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),Ki(n,e,"inside"),r}function Rm(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replaceAll(/width=".*"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Rm({elem:e.elem.previousSibling,width:e.width})}function DB(e,t){const n=t.activeElement;let r=!1;if(!e)return r;e.exportAsPicture?n.setAttribute("em-operation","exportAsPicture"):n.getAttribute("em-operation")==="exportAsPicture"&&n.removeAttribute("em-operation"),e.align?n.setAttribute("align",e.align):e.align===""&&n.removeAttribute("align"),e.width&&(e.width.value?(n.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),n.style.width=e.width.value+e.width.dim,e.width.dim==="px"&&Rm({elem:n,width:e.width.value})):(n.removeAttribute("width"),n.style.removeProperty("width"))),e.maxWidth&&(e.maxWidth.value?(n.style.maxWidth=e.maxWidth.value+e.maxWidth.dim,Rm({elem:n,width:e.maxWidth.value})):n.style.removeProperty("max-width")),e.minWidth&&(e.minWidth.value?n.style.minWidth=e.minWidth.value+e.minWidth.dim:n.style.removeProperty("min-width")),e.border&&t.setElementBorder({settings:e,elem:n}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:n}),e.backgroundColor!==void 0&&(e.backgroundColor===""?(n.removeAttribute("bgcolor"),n.style.removeProperty("background-color")):(n.setAttribute("bgcolor",e.backgroundColor),n.style.backgroundColor=e.backgroundColor)),e.backgroundImage&&(e.backgroundImage[0].value===""?(n.style.removeProperty("background-image"),n.removeAttribute("background")):(n.style.removeProperty("background-image"),n.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")",Tt(n,"background",BB(e)))),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?n.style.removeProperty("background-position-x"):n.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?n.style.removeProperty("background-position-y"):n.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?n.style.removeProperty("background-repeat"):n.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?n.style.removeProperty("background-size"):n.style.backgroundSize=e.backgroundSize),e.borderRadius&&t.setElementBorderRadius({settings:e,elem:n}),e.mobileAlign&&(t.setElementMobileTableAlign({settings:e,elem:n}),r=!0),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:n}),r=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:n}),r=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:n}),r=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:n}),r=!0),e.mobileBackgroundColor&&(t.setElementMobileBackgroundColor({settings:e,elem:n}),r=!0),e.mobileBackgroundImage&&(t.setElementMobileBackgroundImage({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionX&&(t.setElementMobileBackgroundPositionX({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionY&&(t.setElementMobileBackgroundPositionY({settings:e,elem:n}),r=!0),e.mobileBackgroundRepeat&&(t.setElementMobileBackgroundRepeat({settings:e,elem:n}),r=!0);const o=e;return o.mobileBackgroundSize&&(t.setElementMobileBackgroundSize?.({settings:o,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),Ki(n,e,"around"),r}function BB(e){return e.backgroundImage?.[0]?.value??""}function ds(e){return!(!e.startsWith("#")||e.indexOf("#",1)!==-1)}function HB(e,t){const n=t.activeElement;let r=!1;if(!e)return r;if(typeof e.linkHref=="string"){const i=document.querySelector("[em-edit]"),s=i?.tagName==="A"?i:i?.closest("a")??n.querySelector("a");s&&(s.setAttribute("href",e.linkHref),ds(e.linkHref)&&s.removeAttribute("target"))}if(e.exportAsPicture?n.setAttribute("em-operation","exportAsPicture"):n.getAttribute("em-operation")==="exportAsPicture"&&n.removeAttribute("em-operation"),e.align){n.style.textAlign?n.style.textAlign=e.align:n.setAttribute("align",e.align);const i=n.querySelectorAll('[em="atom"]');i.length>0&&i.forEach(s=>{s.querySelector(":scope > tr > td")?.setAttribute("align",e.align);const a=s.querySelector('div[style*="font-family"][style*="font-size"]');a?.hasAttribute("align")&&a.setAttribute("align",e.align)})}else if(e.align===""){n.style.textAlign?n.style.removeProperty("text-align"):n.removeAttribute("align");const i=n.querySelectorAll('[em="atom"]');i.length>0&&i.forEach(a=>{a.querySelector(":scope > tr > td")?.removeAttribute("align")});const s=n.closest("table");if(s?.getAttribute("em")==="atom"){const a=s.querySelector('div[style*="font-family"][style*="font-size"]');a?.hasAttribute("align")&&a.removeAttribute("align")}}if(e.valign?(n.setAttribute("valign",e.valign),n.querySelectorAll('div[style*="display"]').forEach(i=>i.style.verticalAlign=e.valign)):e.valign===""&&n.removeAttribute("valign"),e.width){const i=n.closest("table");i?.getAttribute("em")==="atom"?e.width.value?i.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")):i.removeAttribute("width"):e.width.value?n.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")):n.removeAttribute("width")}if(e.height)if(e.height.value){n.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),n.style.height=e.height.value+e.height.dim;const i=n.firstElementChild;i?.tagName==="A"&&i.style.display==="block"&&(i.style.height=e.height.value+e.height.dim,i.style.lineHeight=e.height.value+e.height.dim)}else n.removeAttribute("height"),n.style.removeProperty("height");if(e.border&&t.setElementBorder({settings:e,elem:n}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:n}),e.backgroundColor!==void 0&&(e.backgroundColor===""?(n.removeAttribute("bgcolor"),n.style.removeProperty("background-color")):(n.setAttribute("bgcolor",e.backgroundColor),n.style.backgroundColor=e.backgroundColor)),e.backgroundImage&&(e.backgroundImage[0].value===""?(n.style.removeProperty("background-image"),n.removeAttribute("background")):(n.style.removeProperty("background-image"),n.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")",Tt(n,"background",WB(e)))),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?n.style.removeProperty("background-position-x"):n.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?n.style.removeProperty("background-position-y"):n.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?n.style.removeProperty("background-repeat"):n.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?n.style.removeProperty("background-size"):n.style.backgroundSize=e.backgroundSize),e.direction&&e.direction!=="none"?(n.setAttribute("dir",e.direction),e.direction==="rtl"&&n.querySelectorAll("td").forEach(i=>{for(let s=i.firstChild;s;s=s.nextSibling)if(s.nodeType===3){s.parentNode?.setAttribute("dir","ltr");break}})):(e.direction===""||e.direction==="none")&&(n.removeAttribute("dir"),n.querySelectorAll("[dir]").forEach(i=>i.removeAttribute("dir"))),e.padding){if(e.padding.all!==void 0)n.style.paddingTop=e.padding.all+"px",n.style.paddingRight=e.padding.all+"px",n.style.paddingBottom=e.padding.all+"px",n.style.paddingLeft=e.padding.all+"px",n.querySelectorAll(".em-vindent").forEach(l=>l.remove());else{if(e.padding.top!==void 0){n.style.paddingTop=e.padding.top+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingTop")&&l.remove()}if(e.padding.right!==void 0){n.style.paddingRight=e.padding.right+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingRight")&&l.remove()}if(e.padding.bottom!==void 0){n.style.paddingBottom=e.padding.bottom+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingBottom")&&l.remove()}if(e.padding.left!==void 0){n.style.paddingLeft=e.padding.left+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingLeft")&&l.remove()}}const i=n.querySelector(".em-mob-wrap"),s=n.parentElement?.getAttribute("em")==="block",a=e.padding.left!==void 0||e.padding.right!==void 0;i&&s&&a&&n.querySelectorAll(":scope > table").forEach(l=>t.setStructureBlocksWidth(l))}if(e.borderRadius&&t.setElementBorderRadius({settings:e,elem:n}),t.textStyleProperties.some(i=>e.hasOwnProperty(i))&&!t.isElementListContainer)try{t.toggleTextStyle(n,{settings:e})}catch{}if(t.isElementListContainer&&t.requestType!=="structure"&&t.requestType!=="column"&&t.textStyleProperties.some(i=>e.hasOwnProperty(i))&&$B(e,t),e.mobileWidth){const i=n.closest("table"),s=i?.getAttribute("em")==="atom";t.setElementMobileWidth({settings:e,elem:s?i:n}),r=!0}e.mobileHeight&&(t.setElementMobileHeight({settings:e,elem:n}),r=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:n}),r=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:n}),r=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:n}),r=!0),e.mobileAlign&&(FB(e,n,t),r=!0),e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:n}),r=!0),e.mobileDirection&&(t.setElementMobileDirection({settings:e,elem:n}),r=!0),e.mobileBackgroundColor&&(t.setElementMobileBackgroundColor({settings:e,elem:n}),r=!0),e.mobileBackgroundImage&&(t.setElementMobileBackgroundImage({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionX&&(t.setElementMobileBackgroundPositionX({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionY&&(t.setElementMobileBackgroundPositionY({settings:e,elem:n}),r=!0),e.mobileBackgroundRepeat&&(t.setElementMobileBackgroundRepeat({settings:e,elem:n}),r=!0);const o=e;return o.mobileBackgroundSize&&(t.setElementMobileBackgroundSize?.({settings:o,elem:n}),r=!0),e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),"isContrastBlock"in e&&t.setContrastBlock({settings:e,elem:n}),Ki(n,e,"inside"),r}function FB(e,t,n){n.setElementMobileAlign({settings:e,elem:t});const r=e.mobileAlign?.classNamePrefix||"em-mob-text_align-";r8(t,(s,a)=>{o8(a,s,r),n.setElementMobileAlign({settings:e,elem:s})});function o(s){const a=s.querySelectorAll("table"),l=s.querySelector("table");a.length===1&&(l?.hasAttribute("width")&&l?.getAttribute("width")!=="100%"||!l?.hasAttribute("width"))&&n.setElementMobileTableAlign({elem:l,settings:{mobileAlign:{classNamePrefix:"em-mob-table_align-",value:e.mobileAlign.value}}})}const i=t.closest("table");i?.getAttribute("em")==="atom"?o(i):t.querySelectorAll('[em="atom"]').forEach(s=>o(s))}function $B(e,t){const n=t.activeElement,r=t.removeEditorTags(t.isElementListContainer.outerHTML);n.innerHTML=`<td em-edit="active">${t.addClassToSecondCell(r,"em-list-temp-class")}</td>`;const o=window.getSelection();if(!o||o.rangeCount===0)return;let i=o.getRangeAt(0);const s=n.querySelectorAll(".em-list-temp-class");if(s.length>0){t.isProgrammaticSelection.value=!0;for(let a=0;a<s.length;a++){const l=s[a].querySelector("div");if(!l)continue;t.wrapEditor(l,!0),i=o.getRangeAt(0),i.selectNode(l),t.addNewRange(i);const c=l.innerHTML!=="&nbsp;"||l.innerHTML==="&nbsp;"&&(e.fontSize||e.textColor||e.lineHeight);if(t.textStyleProperties.some(u=>e.hasOwnProperty(u))&&c)try{t.toggleTextStyle(l,{settings:e})}catch{}}n.querySelectorAll(".em-list-temp-class").forEach(a=>a.classList.remove("em-list-temp-class")),n.removeAttribute("em-edit"),n.setAttribute("em-edit","active"),setTimeout(()=>{t.isProgrammaticSelection.value=!1},100),i=o.getRangeAt(0),i.selectNode(n),t.addNewRange(i)}}function WB(e){return e.backgroundImage?.[0]?.value??""}function Om(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Om({elem:e.elem.previousSibling,width:e.width})}function iE(e,t){let n=e.previousSibling;for(;n&&!(n.nodeName==="#comment"&&n.textContent?.includes("mso"));)n=n.previousSibling;const r=n?.textContent??"",o=r.lastIndexOf("<td");if(!n||o===-1)return;const i=r.slice(o),s=/\svalign="[^"]*"/i.test(i)?i.replace(/valign="[^"]*"/i,`valign="${t}"`):i.replace("<td",`<td valign="${t}"`);n.textContent=r.slice(0,o)+s}function qB(e,t){const n=t.activeElement;let r=!1;if(!e)return r;if(e.width){const o=e.gap?.value??0;if(e.width.value!==void 0&&e.width.value!==null)if(n.style.maxWidth)if(e.width.dim==="px"){const i=parseFloat(e.width.value+o),s=Math.round(parseFloat(e.width.value)/i*100);n.style.maxWidth=i+e.width.dim,Om({elem:n,width:i}),n.firstElementChild?.tagName==="TABLE"&&(n.firstElementChild.setAttribute("width",e.width.value),n.firstElementChild.style.width=s+"%",n.firstElementChild.style.maxWidth=e.width.value+"px")}else n.style.width=parseFloat(e.width.value)+e.width.dim;else e.width.dim==="px"?(n.style.width=parseFloat(e.width.value+o)+e.width.dim,Om({elem:n,width:parseFloat(e.width.value+o)}),n.firstElementChild?.tagName==="TABLE"&&n.firstElementChild.setAttribute("width",e.width.value)):n.style.width=parseFloat(e.width.value)+e.width.dim;else n.style.removeProperty("width")}if(e.gap&&!e.width){const o=parseFloat(e.gap.value??0);n.style.maxWidth?n.parentElement?.querySelectorAll('div[style*="inline-block"]').forEach(i=>{const s=i,a=parseFloat(s.style.maxWidth),l=Math.round((a-o)/a*100);s.firstElementChild?.tagName==="TABLE"&&(s.firstElementChild.setAttribute("width",String(a-o)),s.firstElementChild.style.width=l+"%",s.firstElementChild.style.maxWidth=a-o+"px")}):n.parentElement?.querySelectorAll('div[style*="inline-block"]').forEach(i=>{const s=i;s.firstElementChild?.tagName==="TABLE"&&s.firstElementChild.setAttribute("width",String(parseFloat(s.style.width)-o))})}return e.valign&&(n.style.verticalAlign=e.valign,iE(n,n.style.verticalAlign)),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:n}),r=!0),e.mobileContentWidth&&(t.setElementMobileContentWidth({settings:e,elem:n.firstElementChild}),r=!0),e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),r}function Pm(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Pm({elem:e.elem.previousSibling,width:e.width})}function Nl(e){return!!(e.querySelector(".em-mob-wrap")||e.closest(".em-mob-wrap")||e.querySelector(".noresp-em-mob-wrap")||e.closest(".noresp-em-mob-wrap"))}function xl(e){return e.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement||null}function Im(e){return e.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement||null}function zB(e,t){const n=t.activeElement;if(Nl(n)){const r=xl(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((o,i)=>{o.setAttribute("width",e.items[i])}),t.setPercentsForColumns(r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"))}else{const r=Im(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach((o,i)=>{const s=o;s.style.width=e.items[i]+e.gap+"px",Pm({elem:s.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),s.firstElementChild?.tagName==="TABLE"&&s.firstElementChild.setAttribute("width",e.items[i])})}}function VB(e,t){const n=t.activeElement;if(!Nl(n))return;const r=n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement:n.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement;if(!r)return;const o=r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),i=o.length,s=e.items.length,a=e.gap;i>=s?o.forEach((l,c)=>{if(c<s)l.setAttribute("width",e.items[c]);else{const u=l.previousElementSibling;(u?.classList.contains("em-mob-wrap")||u?.classList.contains("noresp-em-mob-wrap"))&&u?.remove(),l.remove()}}):(o.forEach((l,c)=>{l.setAttribute("width",e.items[c])}),e.items.forEach((l,c)=>{let u="";r.querySelector(".em-mob-wrap")?u=`<td width="${a}" class="em-mob-wrap"></td>
90
+ <td width="${l}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:r.querySelector(".noresp-em-mob-wrap")&&(u=`<td width="${a}" class="noresp-em-mob-wrap"></td>
91
+ <td width="${l}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`),c>=i&&u&&qe(r,"beforeend",u)}))}function UB(e,t){const n=t.activeElement;if(Nl(n)){const r=xl(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(o=>{o.setAttribute("valign",e.valign)})}else{const r=Im(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach(o=>{o.style.verticalAlign=e.valign,iE(o,o.style.verticalAlign)})}}function jB(e,t){const n=t.activeElement;if(Nl(n)){const r=xl(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((o,i)=>{o.setAttribute("width",e.items[i])}),t.setPercentsForColumns(r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)")),r.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(o=>{o.setAttribute("width",e.gap)})}else{const r=Im(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach((o,i)=>{const s=o;s.style.width=e.items[i]+e.gap+"px",Pm({elem:s.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),s.firstElementChild?.tagName==="TABLE"&&s.firstElementChild.setAttribute("width",e.items[i])})}}function GB(e,t){const n=t.activeElement;let r=!1;const o=xl(n);return o&&o.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(i=>{t.setElementMobileHeight({settings:e,elem:i}),r=!0}),r}var Dm="amp-img";function XB(e){const t=M1(e);return{src:t.src,alt:t.alt,title:t.title,width:t.width.value,height:t.height.value,link:t.link,imgReplacer:t.imgReplacer}}function sE(e){return e==null||e===""?null:Number(e)}function YB(e){return{src:e.src??"",alt:e.alt??"",title:e.title??"",width:sE(e.width?.value),height:sE(e.height?.value),link:e.link||null,imgReplacer:e.imgReplacer??""}}function Bm(e,t,n){const r=e.closest(n);return r&&r!==t&&t.contains(r)?r:null}function KB(e,t){let n=e;for(;n.parentElement&&n.parentElement!==t;)n=n.parentElement;if(n.parentElement===t&&n.querySelectorAll(Dm).length<=1)return n;let r=e;for(;r.parentElement&&r.parentElement!==t&&(r.parentElement.tagName==="A"||r.parentElement.tagName==="EM-REPLACE");)r=r.parentElement;return r}function aE(e){e.replaceWith(...Array.from(e.childNodes))}function lE(e,t){e.parentNode?.insertBefore(t,e),t.appendChild(e)}function ZB(e,t,n,r){if(r.src!==n.src&&Tt(e,"src",r.src),r.alt!==n.alt&&e.setAttribute("alt",r.alt),r.title!==n.title&&e.setAttribute("title",r.title),r.width!==n.width&&e.setAttribute("width",String(r.width??"")),r.height!==n.height&&e.setAttribute("height",String(r.height??"")),r.imgReplacer!==n.imgReplacer){const o=Bm(e,t,"em-replace");if(!r.imgReplacer)o&&aE(o);else if(o)Tt(o,"src",r.imgReplacer);else{const i=document.createElement("em-replace");Tt(i,"src",r.imgReplacer),lE(e,i)}}if(r.link!==n.link){const o=Bm(e,t,"a");if(!r.link)o&&aE(o);else if(o)o.setAttribute("href",r.link);else{const i=document.createElement("a");i.setAttribute("href",r.link),lE(Bm(e,t,"em-replace")??e,i)}}}function QB(e){const t=document.createElement(Dm);Tt(t,"src",e.src),t.setAttribute("alt",e.alt),t.setAttribute("title",e.title),t.setAttribute("width",String(e.width.value)),t.setAttribute("height",String(e.height.value)),t.setAttribute("layout","responsive");let n=t;if(e.imgReplacer){const r=document.createElement("em-replace");Tt(r,"src",e.imgReplacer),r.appendChild(t),n=r}if(e.link){const r=document.createElement("a");r.setAttribute("href",e.link),r.appendChild(n),n=r}return n}function JB(e){return e.some(t=>t.slideIndex!==void 0)?e.map(t=>t.slideIndex):e.map((t,n)=>n)}function e6(e,t){const n=Array.from(e.querySelectorAll(Dm)),r=new Set,o=[];JB(t).forEach((i,s)=>{const a=i===void 0?void 0:n[i];if(!a||r.has(a)){o.push(t[s]);return}r.add(a),ZB(a,e,XB(a),YB(t[s]))}),n.filter(i=>!r.has(i)).forEach(i=>KB(i,e).remove()),o.forEach(i=>e.appendChild(QB(i)))}function t6(e,t){const n=e,r=t.activeElement.closest("amp-carousel");if(!r)return;const o=t.HTMLDocument.getOuterHtml(r),i=t.parseFromString(o)[0];typeof n.loop=="boolean"&&(n.loop?i.setAttribute("loop",""):i.removeAttribute("loop")),typeof n.autoplay=="boolean"&&(n.autoplay?i.setAttribute("autoplay",""):i.removeAttribute("autoplay")),Array.isArray(n.carouselImages)&&e6(i,n.carouselImages),"borderRadius"in n&&t.setElementBorderRadius({settings:{borderRadius:n.borderRadius},elem:i}),i.setAttribute("em-edit","active"),r.replaceWith(i),t.commit(!0)}function n6(e,t){const n=e,r=t.activeElement.closest("amp-accordion");if(!r)return;const o=t.HTMLDocument.getOuterHtml(r),i=t.parseFromString(o)[0];n.animate?i.setAttribute("animate",""):i.removeAttribute("animate"),n.expandSingleSection?i.setAttribute("expand-single-section",""):i.removeAttribute("expand-single-section"),i.querySelectorAll("section").forEach((s,a)=>{n.sections[a]?.expanded?s.setAttribute("expanded",""):s.removeAttribute("expanded")}),i.setAttribute("em-edit","active"),r.replaceWith(i),t.commit(!0)}var Rn={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function r6(e){return e.closest('table[em-type="social"]')}function cE(e){const t=e.querySelector(":scope > tr");if(t){const r=t.querySelector(":scope > td");if(r instanceof HTMLElement)return r}const n=e.querySelector("tbody > tr");if(n){const r=n.querySelector(":scope > td");if(r instanceof HTMLElement)return r}return null}function o6(e,t,n){const r=cE(e),o=cE(t);if(!(!r||!o)){for(const{name:i,value:s}of Array.from(r.attributes))i.toLowerCase()!=="align"&&o.setAttribute(i,s);o.setAttribute("align",n)}}function On(e){return String(e??"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function i6(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function s6(){const e=[typeof document<"u"?document.baseURI:"",typeof window<"u"?window.location?.href:""];for(const t of e)if(t)try{const n=new URL(t);if(n.protocol==="http:"||n.protocol==="https:")return n.href}catch{}return""}function a6(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const n=s6();if(!n)return t;try{return new URL(t,n).href}catch{return t}}function l6(e){return e>0?`<td width="${e}">&nbsp;</td>`:""}function c6(e,t){const n=r6(t.activeElement);if(!n)return null;const r=Array.isArray(e.items)?e.items:[],o=e.align==="left"||e.align==="right"||e.align==="center"?e.align:Rn.align,i=typeof e.iconSize=="number"?e.iconSize:Rn.iconSize,s=typeof e.borderRadius=="number"?e.borderRadius:Rn.borderRadius,a=typeof e.gap=="number"?e.gap:Rn.gap,l=typeof e.bgEnabled=="boolean"?e.bgEnabled:Rn.bgEnabled,c=typeof e.bgColor=="string"?e.bgColor:Rn.bgColor,u=typeof e.borderWidth=="number"?e.borderWidth:Rn.borderWidth,d=typeof e.borderColor=="string"?e.borderColor:Rn.borderColor;let m=typeof e.buttonBorderWidth=="number"&&!Number.isNaN(e.buttonBorderWidth)?e.buttonBorderWidth:Rn.buttonBorderWidth;m=Math.max(0,Math.min(24,Math.round(m)));const p=typeof e.showLabel=="boolean"?e.showLabel:Rn.showLabel,f=[];u>0&&d&&f.push(`border:${u}px solid ${On(d)}`);const h=f.length?` style="${f.join(";")}"`:"",y=!!(l&&String(c).trim()),E=Math.max(0,Math.round(Number(a)||0)),C=r.length>1,k=`<table border="0" cellspacing="0" cellpadding="0">
92
+ <tr>${r.map(v=>{const A=On(v.platform||"unknown"),g=!!v.customIcon,S=On(v.href||""),T=String(v.title??"").trim(),_=T?` title="${On(T)}"`:"",M=On(v.alt||""),N=On(a6(v.iconSrc||"")),W=v.iconWidth!=null&&!Number.isNaN(Number(v.iconWidth))?Number(v.iconWidth):i,P=v.iconHeight!=null&&!Number.isNaN(Number(v.iconHeight))?Number(v.iconHeight):i,R=g?"":typeof v.buttonBgColor=="string"?v.buttonBgColor.trim():"",Y=!g&&y&&!R?String(c).trim():"",V=g?"":R||Y,G=!g&&!!Y,Le=g?"":typeof v.itemBorderColor=="string"?v.itemBorderColor.trim():"",ae=!g&&!!(R||Le&&m>0||G);let ne=`<a href="${S}" target="_blank"${_} draggable="false"><img src="${N}" width="${W}" height="${P}" border="0" alt="${M}" draggable="false" style="display:block;${!g&&!ae&&s>0?`border-radius:${s}px;`:""}" /></a>`;if(p&&(v.title||v.alt)){const Q=i6(String(v.title||v.alt||""));ne+=`<br/><span style="display:block;font-size:11px;line-height:1.2;margin-top:4px;max-width:96px;word-break:break-word;">${Q}</span>`}const we=[];V&&we.push(`background-color:${On(V)}`),Le&&m>0&&we.push(`border:${m}px solid ${On(Le)}`),ae&&s>0&&we.push(`border-radius:${s}px`);const j=G?' em-tray-cell-bg="1"':"",z=g?' em-custom-icon="1"':"",Se=V&&/^#[0-9A-Fa-f]{3,8}$/.test(V)?` bgcolor="${On(V)}"`:"",Ae=C?' draggable="true"':"";return`<td em-platform="${A}"${z}${j}${Se}${we.length?` style="${we.join(";")}"`:""}${Ae}>${ne}</td>`}).filter(Boolean).reduce((v,A,g)=>(g>0&&v.push(l6(E)),v.push(A),v),[]).join("")}
93
+ </tr>
94
+ </table>`,w=`<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"${h}><tr><td align="${On(o)}">
95
+ ${k}
96
+ </td></tr></table>`,b=t.parseFromString(w)[0];return b?(b instanceof HTMLTableElement&&o6(n,b,o),b.setAttribute("em-edit","active"),n.replaceWith(b),t.commit(!0),b):null}function u6(e,t){if(typeof e.textSuperscript!="boolean"&&typeof e.textSubscript!="boolean")return;const n=window.getSelection();if(!n||n.rangeCount===0)return;const r=n.getRangeAt(0),o=r.commonAncestorContainer;if(o?.tagName==="TABLE")return;const i=o.nodeType===1?o:o.parentElement;if(!i)return;function s(a,l){const c=i.closest(a),u=a==="sup"?"sub":"sup",d=i.closest(u);if(l){let m=!0;if(c&&t.isRangeMatching(c,r,r.collapsed))m=!1;else if(d)if(t.isRangeMatching(d,r,r.collapsed)){const p=t.unwrapTag(d);r.selectNodeContents(p)}else{const p=t.splitWrapper(d,r);r.selectNodeContents(p),setTimeout(()=>n.removeAllRanges(),100)}else if(c){const p=t.splitWrapper(c,r);r.selectNodeContents(p)}if(m)if(r.collapsed){const p=r.cloneRange();try{r.expand("word");const f=r.toString().trim();if(f){const h=t.wrapInTag(r,f,a),y=document.createRange();y.selectNodeContents(h),n.removeAllRanges(),n.addRange(y),t.cleanEmptyTags(h.parentNode)}else r.setStart(p.startContainer,p.startOffset),r.setEnd(p.endContainer,p.endOffset)}catch{r.setStart(p.startContainer,p.startOffset),r.setEnd(p.endContainer,p.endOffset)}}else{const p=r.cloneContents(),f=document.createElement("div");f.appendChild(p),t.unwrapNestedTags(f,a);const h=t.wrapInTag(r,f,a),y=document.createRange();y.selectNodeContents(h),n.removeAllRanges(),n.addRange(y),t.cleanEmptyTags(h.parentNode)}}else if(r.collapsed)if(c){const m=c.parentNode,p=t.unwrapTag(c),f=document.createRange();f.selectNodeContents(p),n.removeAllRanges(),n.addRange(f),t.cleanEmptyTags(m),c.parentNode||setTimeout(()=>n.removeAllRanges(),0)}else{const m=r.startContainer.parentElement?.closest(a);if(m){const p=t.unwrapTag(m),f=document.createRange();f.selectNodeContents(p),n.removeAllRanges(),n.addRange(f),t.cleanEmptyTags(m.parentNode)}}else{let m=[];const p=r.cloneContents(),f=document.createElement("div");if(f.appendChild(p),m=Array.from(f.querySelectorAll(a)),c){const y=Array.from(c.childNodes).some(k=>k.nodeType===1),E=t.unwrapTag(c),C=document.createRange();if(E.isConnected)C.selectNodeContents(E),n.removeAllRanges(),n.addRange(C);else{const k=c.parentNode;k&&(C.selectNodeContents(k),n.removeAllRanges(),n.addRange(C))}y&&t.applicationElementSettingsSet({elem:document.querySelector("[em-edit]")}),t.commit();return}else{const y=r.commonAncestorContainer.parentElement?.closest(a)||r.startContainer.parentElement?.closest(a);y&&m.push(y)}m.length>0&&m.forEach(y=>{y.parentNode&&t.unwrapTag(y)});const h=f.cloneNode(!0).querySelector('[em-edit="active"]');if(h){r.deleteContents(),r.insertNode(h);const y=document.createRange();y.selectNodeContents(h),n.removeAllRanges(),n.addRange(y),t.cleanEmptyTags(h.parentNode)}}t.commit()}typeof e.textSuperscript=="boolean"&&s("sup",e.textSuperscript),typeof e.textSubscript=="boolean"&&s("sub",e.textSubscript)}function d6(e,t){if(e!==void 0){if(e===""){m6(t.activeElement);return}f6(e,t)}}function m6(e){const t=e?.closest("em-replace")||e?.querySelector("em-replace");if(!t)return;const n=t.parentNode,r=t.firstChild,o=t.lastChild;if(t.getAttribute("text")!==t.innerHTML)for(;t.firstChild;)n?.insertBefore(t.firstChild,t);const i=document.createRange(),s=window.getSelection();r&&o&&s&&(i.setStartBefore(r),i.setEndAfter(o),s.removeAllRanges(),s.addRange(i)),t.remove()}function f6(e,t){const n=window.getSelection();if(!n||n.rangeCount===0)return;const r=n.getRangeAt(0),o=e.replace(/~~.*$/,""),i=r.commonAncestorContainer,s=i.nodeType===1?i:i.parentElement;let a=s?.closest("em-replace");const l=/~~/.test(e)&&a;if(l){const c=e.replace(/~~.*$/,"");s?.setAttribute("text",c),s&&(s.innerHTML=c)}if(!a&&n.rangeCount>0&&!r.collapsed){const c=document.querySelectorAll("em-replace");if(a=Array.prototype.find.call(c,u=>u.textContent?.trim()===n.toString().trim()&&n.toString().trim()!==""),!a){const u=document.querySelector('[em-edit="active"]');u?.textContent===r.toString()&&r.selectNodeContents(u);const d=e.replace(/~~.*$/,""),m=document.createElement("em-replace");m.setAttribute("text",d),r.surroundContents(m)}}if(!a&&n.rangeCount>0&&r.collapsed){let c=document.querySelector("em-replace");if(c){const u=document.querySelectorAll("em-replace"),d=/~$/;a=Array.prototype.find.call(u,m=>{const p=e,f=m.textContent||"";return p.length===1&&d.test(f)?!0:t.compareStrings(f,p)}),a&&(a.setAttribute("text",e),a.textContent=e),a||(c=document.createElement("em-replace"),c.setAttribute("text",o),r.insertNode(c),c.innerHTML=o,r.collapse(!1))}else c=document.createElement("em-replace"),c.setAttribute("text",o),r.insertNode(c),c.innerHTML=o,r.collapse(!1)}a&&!l&&(a.getAttribute("text")===a.innerHTML&&(a.innerHTML=e),a.setAttribute("text",e))}function p6(e){return e.trim().replace(/\s+/g,"_").replace(/[^\p{L}\p{N}\-_:.]/gu,"")}function uE(e){const t=e.commonAncestorContainer,n=(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest?.("a[name]");if(!n)return null;try{const r=document.createRange();return r.selectNodeContents(n),e.compareBoundaryPoints(Range.START_TO_START,r)>=0&&e.compareBoundaryPoints(Range.END_TO_END,r)<=0?n:null}catch{return null}}function h6(e,t){if(!e||!t)return;const n=document.createRange(),r=window.getSelection();if(r)try{if(!e.isConnected||!t.isConnected)return;n.setStartBefore(e),n.setEndAfter(t),r.removeAllRanges(),r.addRange(n)}catch{}}function g6(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function b6(e,t){const n=window.getSelection(),r=n?.rangeCount?n.getRangeAt(0):null;if(e===void 0||!e.trim()){let i=null;if(r&&!r.collapsed&&(i=uE(r)),i||(i=t.activeElement?.closest?.("a[name]")),i){const s=i.firstChild,a=i.lastChild;g6(i),t.commit(),h6(s,a)}return}const o=p6(e);if(o&&!(!n||!r||r.collapsed))try{const i=uE(r);if(i){i.setAttribute("name",o),t.commit();return}const s=document.createElement("a");s.setAttribute("name",o);const a=r.extractContents();s.appendChild(a),r.insertNode(s);const l=document.createRange();l.selectNodeContents(s),n.removeAllRanges(),n.addRange(l),t.commit()}catch{}}function y6(e,t){let n=!1,{activeElement:r,activeCell:o}=t;if(r||(r=document.querySelector(".remove-basic-cell")||document.querySelector(".em-temporary-active-cell-background-color")||document.querySelector(".em-active-table-cell")),!r)return n;const i=Object.keys(e)[0],s=r.closest(".em-element-custom-table");if(!s)return n;let a=t.parseTableElementToModel(s);if(r.tagName==="TD"&&(r=r.querySelector("div"),r?.setAttribute("em-edit","active")),r?.tagName==="TR"&&(r=r.querySelector("EDITOR")?.querySelector("div"),r?.setAttribute("em-edit","active")),i.includes("padding")&&!i.includes("cell_")&&v6(e,s,a,t),e.backgroundColor&&E6(e.backgroundColor,s),i.includes("backgroundImage")&&S6(e,s),i.includes("backgroundPosition")){const l=t.updateBackgroundPosition(s.getAttribute("style"),{settings:e});s.setAttribute("style",l)}return i.includes("backgroundSize")&&(s.style.backgroundSize=e.backgroundSize),i.includes("backgroundRepeat")&&(s.style.backgroundRepeat=e.backgroundRepeat),(e.borderAll||e.borderTop||e.borderRight||e.borderBottom||e.borderLeft)&&w6(e,i,s,t),i.includes("borderRadius")&&C6(e,s,t),i.includes("boxShadow")&&A6(e,s,t),n=T6(e,s,t)||n,i.includes("cell")&&_6(e,i,s,a,o,t),new Set(["fontFamily","fontSize","lineHeight","textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor","linkHref","textAlign","valign"]).has(i)&&M6(e,i,s,a,o,r,t),R6(s,t),Ki(s,e,"around"),n}function v6(e,t,n,r){const o=r.updateTablePadding(n,{settings:e});t.innerHTML=r.tableModelToHtml(o)}function E6(e,t){t.getAttribute("data-bg-image")&&(t.removeAttribute("data-bg-image"),t.style.backgroundImage="",t.style.backgroundSize="",t.style.backgroundRepeat="",t.style.backgroundPosition=""),t.setAttribute("bgcolor",e)}function S6(e,t){if(t.getAttribute("bgcolor")&&t.removeAttribute("bgcolor"),e.backgroundImage?.[0]?.type==="url"){const n=e.backgroundImage[0].value;t.setAttribute("data-bg-image",n),t.style.backgroundImage=`url('${n}')`,t.style.backgroundSize="cover",t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="center"}}function w6(e,t,n,r){const o=t,i=e[o];let s="",a="";switch(o){case"borderAll":s="border",a=n.style.border;break;case"borderTop":s="border-top",a=n.style.borderTop;break;case"borderRight":s="border-right",a=n.style.borderRight;break;case"borderBottom":s="border-bottom",a=n.style.borderBottom;break;case"borderLeft":s="border-left",a=n.style.borderLeft;break;default:s="border",a=n.style.border}const l=n.getAttribute("border")||"",c=n.getAttribute("bordercolor")||"";let u=n.getAttribute("style")||"";const d=n.style.borderCollapse?`border-collapse: ${n.style.borderCollapse};`:"border-collapse: collapse;";if(["borderTop","borderRight","borderBottom","borderLeft"].includes(o)&&(n.style.border||l)){u=r.removeStyleProperty(u,"border");const p=n.style.border?n.style.border:`${l||"1"}px solid ${c||"#b9b1b1"}`;u=`border-top: ${p}; border-right: ${p}; border-bottom: ${p}; border-left: ${p}; ${u};`}let m=a?`${s}: ${a};`:`${s}: ${l||"1"}px solid ${c||"#b9b1b1"};`;n.removeAttribute("border"),n.removeAttribute("bordercolor"),n.removeAttribute("border-collapse"),u=r.removeStyleProperty(u,s),u=r.removeStyleProperty(u,"border-collapse"),s==="border"&&["border-top","border-right","border-bottom","border-left"].forEach(p=>{u=r.removeStyleProperty(u,p)}),["borderTop","borderRight","borderBottom","borderLeft"].includes(o)&&(u=r.removeStyleProperty(u,"border")),i?.style===""&&(m=""),i?.color&&m&&(m=m.replace(/(#([0-9A-Fa-f]{3}){1,2}\b)|(rgba?\([^)]*\))/g,i.color)),i?.width&&m&&(m=m.replace(/\b\d+(\.\d+)?px\b/g,`${i.width}px`)),i?.style&&m&&(m=m.replace(/solid|dashed|dotted/g,i.style)),m=`${m}${u?` ${u}`:""}`,n.setAttribute("style",m?`${d} ${m}`:"")}function C6(e,t,n){const r=e.borderRadius,o=t.getAttribute("border")||"",i=t.getAttribute("bordercolor")||"";let s=t.getAttribute("style")||"";if(r?.all){const l=`border-radius: ${r.all}px ${r.all}px ${r.all}px ${r.all}px;`;if(s)s=n.removeStyleProperty(s,"border-radius"),s=n.removeStyleProperty(s,"border-collapse"),t.setAttribute("style",`${s}; border-collapse: separate; ${l}`);else{const c=`border-collapse: separate; border: ${o||"1"}px solid ${i||"#b9b1b1"}; ${l}`;t.setAttribute("style",c),t.removeAttribute("border"),t.removeAttribute("bordercolor")}}const a=["topLeft","topRight","bottomRight","bottomLeft"];a.forEach(l=>{if(r?.[l])if(s){const c=n.updateBorderRadius(t.getAttribute("style"),l,r[l]);t.setAttribute("style",c)}else{const c={topLeft:"0",topRight:"1",bottomRight:"2",bottomLeft:"3"},u=["0","0","0","0"];u[parseInt(c[l])]=`${r[l]}px`;const d=`border-radius: ${u.join(" ")};`,m=`border-collapse: separate; border: ${o||"1"}px solid ${i||"#b9b1b1"}; ${d}`;t.setAttribute("style",m)}}),(r?.all||a.some(l=>r?.[l]))&&(t.removeAttribute("border"),t.removeAttribute("bordercolor"))}function A6(e,t,n){const r=e.boxShadow;if(!r)return;const o=t.getAttribute("border")||"",i=t.getAttribute("bordercolor")||"";let s=t.getAttribute("style")||"";const a=`box-shadow: ${r.color} ${r.hOffset}px ${r.vOffset}px ${r.blurRadius}px ${r.spreadRadius}px${r.inset?" inset":""};`;if(s)s=n.removeStyleProperty(s,"box-shadow"),s=n.removeStyleProperty(s,"border-collapse"),t.setAttribute("style",`${s}; border-collapse: separate;${r.color?` ${a}`:""}`);else{const l=`border-collapse: separate; border: ${o||"1"}px solid ${i||"#b9b1b1"}; ${a}`;t.setAttribute("style",l),t.removeAttribute("border"),t.removeAttribute("bordercolor")}}function T6(e,t,n){let r=!1;e.mobileWidth&&(n.setElementMobileWidth({settings:e,elem:t}),t.removeAttribute("width"),r=!0),e.mobileHeight&&(n.setElementMobileHeight({settings:e,elem:t}),r=!0),e.show&&(n.setElementShow({settings:e,elem:t}),r=!0),e.mobileBackgroundColor&&(n.setElementMobileBackgroundColor({settings:e,elem:t}),r=!0);const o=e;if(o.mobileBackgroundImage&&(n.setElementMobileBackgroundImage?.({settings:o,elem:t}),r=!0),o.mobileBackgroundPositionX&&(n.setElementMobileBackgroundPositionX?.({settings:o,elem:t}),r=!0),o.mobileBackgroundPositionY&&(n.setElementMobileBackgroundPositionY?.({settings:o,elem:t}),r=!0),o.mobileBackgroundRepeat&&(n.setElementMobileBackgroundRepeat?.({settings:o,elem:t}),r=!0),o.mobileBackgroundSize&&(n.setElementMobileBackgroundSize?.({settings:o,elem:t}),r=!0),e.mobileBoxShadow){if(e.mobileBoxShadow.color!==""&&n.setElementMobileBoxShadow({settings:e,elem:t}),e.mobileBoxShadow.color===""){const i=t.getAttribute("class")||"",s=n.removeClassByPrefix(i,e.mobileBoxShadow.classNamePrefix);t.setAttribute("class",s)}r=!0}if(e.mobileBorder&&(t.removeAttribute("border"),t.removeAttribute("bordercolor"),n.setElementMobileBorder({settings:e,elem:t}),r=!0),e.mobileBorderRadius){if(t.getAttribute("border")&&t.getAttribute("bordercolor")){const s={mobileBorder:{all:{collor:t.getAttribute("bordercolor"),width:t.getAttribute("border"),style:"solid",classNamePrefix:"em-mob-border_all-"}}};n.setElementMobileBorder({settings:s,elem:t}),t.removeAttribute("border"),t.removeAttribute("bordercolor")}n.setElementMobileBorderRadius({settings:e,elem:t});const i=Object.keys(e.mobileBorderRadius).find(s=>s!=="classNamePrefix");if(i&&e.mobileBorderRadius[i]===0){const s=t.getAttribute("class")||"";t.setAttribute("class",n.removeClassByPrefix(s,e.mobileBorderRadius.classNamePrefix))}r=!0}return r}function _6(e,t,n,r,o,i){const s=[se,oe];if(t.includes("cellBackgroundColor")){n.querySelector(".remove-basic-cell")&&(o=i.getCellsWithClasses(r,s),i.state.set("activeCell",o));const a=i.updateTableCellBackgroundByIds(r,o,e.cellBackgroundColor),l=i.addClassToCellsByIds(a,o,or);n.innerHTML=i.tableModelToHtml(l)}if(e.cell_borderPosition){n.querySelector(".remove-basic-cell")&&(o=i.getCellsWithClasses(r,s),i.state.set("activeCell",o),document.querySelectorAll(`.${Ue}`).forEach(l=>{l.classList.remove(Ue)})),r=i.parseTableElementToModel(n);const a=i.addClassToCellsByIds(r,o,Ue);n.innerHTML=i.tableModelToHtml(a)}(e.cell_borderAll||e.cell_borderTop||e.cell_borderRight||e.cell_borderBottom||e.cell_borderLeft)&&k6(e,n,r,o,i,s),t.includes("cell_borderRadiusAll")&&L6(e,n,r,o,i,s),t.includes("cell_padding")&&N6(e,n,r,o,i,s)}function k6(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${Ue}`).forEach(l=>{l.classList.remove(Ue)}));const s=o.getExternalBorders(n,r),a=o.mergeUniCells(s);if(e.cell_borderAll){for(const l of Object.keys(a)){if(l.includes("-uni-"))continue;n=o.parseTableElementToModel(t);const c=[l],u=o.updateCellBordersByIds(n,c,a[l],e.cell_borderAll);let d=o.addClassToCellsByIds(u,c,or);d=o.addClassToCellsByIds(d,c,Ue),t.innerHTML=o.tableModelToHtml(d)}(e.cell_borderAll.style===""||e.cell_borderAll.width===0||e.cell_borderAll.color==="")&&t.querySelectorAll(`.${or}`).forEach(l=>{const c=l;c.style.removeProperty("border-top"),c.style.removeProperty("border-right"),c.style.removeProperty("border-bottom"),c.style.removeProperty("border-left")})}[{setting:"cell_borderTop",value:"top"},{setting:"cell_borderRight",value:"right"},{setting:"cell_borderBottom",value:"bottom"},{setting:"cell_borderLeft",value:"left"}].forEach(({setting:l,value:c})=>{if(e[l]){n=o.parseTableElementToModel(t);const u=Object.keys(a).filter(p=>a[p].includes(c)),d=o.updateCellBordersByIds(n,u,[c],e[l]),m=o.addClassToCellsByIds(d,r,or);t.innerHTML=o.tableModelToHtml(m)}})}function L6(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${Ue}`).forEach(a=>{a.classList.remove(Ue)}));const s=o.getExternalCorners(n,r);for(const a of Object.keys(s)){if(a.includes("-uni-"))continue;n=o.parseTableElementToModel(t);const l=o.updateCellBorderRadiusByIds(n,a,s[a],e.cell_borderRadiusAll),c=o.addClassToCellsByIds(l,a,or);t.innerHTML=o.tableModelToHtml(c)}}function N6(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${Ue}`).forEach(l=>{l.classList.remove(Ue)})),n=o.parseTableElementToModel(t);let s=o.addClassToCellsByIds(n,r,Ue);t.innerHTML=o.tableModelToHtml(s),[{key:"cell_paddingTop",sides:["top"]},{key:"cell_paddingBottom",sides:["bottom"]},{key:"cell_paddingLeft",sides:["left"]},{key:"cell_paddingRight",sides:["right"]},{key:"cell_paddingLeftRight",sides:["left","right"]},{key:"cell_paddingTopBottom",sides:["top","bottom"]}].forEach(({key:l,sides:c})=>{e[l]!==void 0&&(n=o.parseTableElementToModel(t),s=o.updateCellPaddingByIds(n,r,c,e[l]))}),e.cell_padding&&(n=o.parseTableElementToModel(t),s=o.updateCellPaddingByIds(n,r,["top"],e.cell_padding.top),s=o.updateCellPaddingByIds(s,r,["bottom"],e.cell_padding.bottom),s=o.updateCellPaddingByIds(s,r,["left"],e.cell_padding.left),s=o.updateCellPaddingByIds(s,r,["right"],e.cell_padding.right));const a=o.addClassToCellsByIds(s,r,or);t.innerHTML=o.tableModelToHtml(a)}function x6(e,t){if(e.collapsed)return!1;const{startContainer:n,endContainer:r}=e;return!n.isConnected||!r.isConnected?!1:t.contains(n)&&t.contains(r)}function M6(e,t,n,r,o,i,s){const a=[se,oe],l=window.getSelection();if(!l||l.rangeCount===0)return;const c=l.getRangeAt(0).cloneRange();if(n.querySelector(".remove-basic-cell")&&(o=s.getCellsWithClasses(r,a),s.state.set("activeCell",o),document.querySelectorAll(`.${Ue}`).forEach(d=>{d.classList.remove(Ue)})),!o.length)return;if(o.length===1){const d=n.querySelector(`td.${oe}, td.${Ue}, td.${se}`),m=d?.querySelector(":scope > div")??d?.querySelector(":scope > editor > div");if(m){if(s.wrapEditor(m,!0),s.textStyleProperties.some(p=>Object.prototype.hasOwnProperty.call(e,p))){if(x6(c,m))s.addNewRange(c);else{const p=document.createRange();p.selectNodeContents(m),s.addNewRange(p)}try{s.toggleTextStyle(m,{settings:e})}catch{}}if(t==="linkHref"&&typeof e.linkHref=="string"){const p=m.tagName==="A"?m:m.querySelector("a");p&&p.setAttribute("href",e.linkHref)}t==="textAlign"&&(e.textAlign?m.setAttribute("align",e.textAlign):i?.style?.textAlign?i.style.removeProperty("text-align"):m.removeAttribute("align")),e.valign?m.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&m.closest("td")?.removeAttribute("valign");return}}r=s.parseTableElementToModel(n);const u=s.addClassToCellsByIds(r,o,Ue);n.innerHTML=s.tableModelToHtml(u),n.querySelectorAll(`td.${Ue} > div`).forEach(d=>{s.wrapEditor(d,!0);const m=l.getRangeAt(0);if(m.selectNode(d),s.addNewRange(m),s.textStyleProperties.some(p=>Object.prototype.hasOwnProperty.call(e,p)))try{s.toggleTextStyle(d,{settings:e})}catch{}if(t==="linkHref"&&typeof e.linkHref=="string"){const p=d.tagName==="A"?d:d.querySelector("a");p&&p.setAttribute("href",e.linkHref)}t==="textAlign"&&(e.textAlign?d.setAttribute("align",e.textAlign):i?.style?.textAlign?i.style.removeProperty("text-align"):d.removeAttribute("align")),e.valign?d.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&d.closest("td")?.removeAttribute("valign")})}function R6(e,t){document.querySelectorAll(`.${se}`).forEach(o=>{o.classList.remove(se)}),document.querySelectorAll(`.${oe}`).forEach(o=>{o.classList.remove(oe)});let n=t.parseTableElementToModel(e);e.getAttribute("style")?.includes("border-collapse:")&&(n=t.removeOuterBorders(n)),e.getAttribute("class")?.includes("em-mob-border_")&&(n=t.removeOuterBorders(n)),n=t.simplifyBorders(n),e.innerHTML=t.tableModelToHtml(n);const r=e.querySelectorAll(`.${or}`);r.length>0&&(r[0].setAttribute("em-edit",""),r.forEach(o=>{o.classList.remove(or)})),t.commit()}var Oe=e=>ca(e?.innerText);function O6(e,t){return e.hasOwnProperty("textStrong")?{name:"textStrong",tags:["b","strong","a","[style*=font-weight]"],value:e.textStrong,command:"bold"}:e.hasOwnProperty("textItalic")?{name:"textItalic",tags:["em","i","[style*=font-style]","a"],value:e.textItalic,command:"italic"}:e.hasOwnProperty("textStrikethrough")?{name:"textStrikethrough",tags:["s","strike","u","[style*=text-decoration]","a"],value:e.textStrikethrough,command:"strikethrough"}:e.hasOwnProperty("textUnderline")?{name:"textUnderline",tags:["u","strike","[style*=text-decoration]","span","a"],value:e.textUnderline,command:"underline"}:e.hasOwnProperty("textColor")?{name:"textColor",tags:["a","[style*='color']","span"],value:t(e.textColor)||"",command:"foreColor"}:e.hasOwnProperty("textBackgroundColor")?{name:"textBackgroundColor",tags:["a","[style*='background-color']","[style*='color']","span"],value:t(e.textBackgroundColor)||"",command:"hilitecolor"}:e.hasOwnProperty("fontFamily")?{name:"fontFamily",tags:["[style*='font-family']","span","a"],value:e.fontFamily?.[e.fontFamily.length-1],command:"fontName"}:e.hasOwnProperty("textLink")?{name:"textLink",tags:["a","[href]","div","p","td"],value:e.textLink||"",command:"createLink"}:e.hasOwnProperty("fontSize")?{name:"fontSize",tags:["a","[style*='font-size']","span","div"],value:parseFloat(e.fontSize),command:"fontSize"}:e.hasOwnProperty("lineHeight")?{name:"lineHeight",tags:["div","[style*='line-height']","p","td"],value:parseFloat(e.lineHeight),command:null}:{}}function P6(e,t){if(!e?.rangeCount)return;const n=e.getRangeAt(0),r=n.commonAncestorContainer;let o=n.startOffset,i=n.endOffset;const s=r.data;if(!s)return;for(;o>0&&!/\s/.test(s[o-1]);)o--;for(;i<s.length&&!/\s/.test(s[i]);)i++;const a=document.createRange();a.setStart(r,o),a.setEnd(r,i),t(a)}var I6=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,D6=/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)$/i,Hm=e=>e.toString(16).padStart(2,"0");function B6(e){const t=D6.exec(e)?.groups;if(!t)return;const n=Number.parseInt(t.r,10),r=Number.parseInt(t.g,10),o=Number.parseInt(t.b,10);if(![n,r,o].some(i=>!Number.isFinite(i)||i<0||i>255))return`#${Hm(n)}${Hm(r)}${Hm(o)}`}function dE(e){return e.split("").map(t=>`${t}${t}`).join("")}function Pn(e,t){if(!e)return;const n=e.trim();if(!n)return;if(I6.test(n)){const o=n.slice(1);return o.length===3?`#${dE(o).toLowerCase()}`:o.length===4?`#${dE(o.slice(0,3)).toLowerCase()}`:o.length===8?`#${o.slice(0,6).toLowerCase()}`:`#${o.toLowerCase()}`}const r=B6(n);if(r)return r;if(t){const o=t(n);if(o&&o!==n)return Pn(o)}}function H6(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function Fm(e,t,n){const r=t.parentElement;let o=e.parentElement;for(;o&&o!==r;){const i=Pn(o.style.color,n);if(i)return i;o=o.parentElement}}function F6(e,t){Array.from(e.querySelectorAll("span")).reverse().forEach(n=>{if(!n.style.color)return;const r=Pn(n.style.color,t);if(!r)return;const o=Fm(n,e,t);!o||o!==r||(n.style.removeProperty("color"),n.getAttribute("style")||n.removeAttribute("style"),n.attributes.length===0&&H6(n))})}function $6(e){const t=e.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?e.commonAncestorContainer:e.commonAncestorContainer.parentElement;if(!t)return[];if(e.commonAncestorContainer.nodeType===Node.TEXT_NODE){const o=e.commonAncestorContainer;return o.data.trim()?[o]:[]}const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null),r=[];for(;n.nextNode();){const o=n.currentNode;!o.data.trim()||!e.intersectsNode(o)||r.push(o)}return r}function W6(e,t,n){const r=Pn(t,n);if(!r)return!1;const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const i=o.getRangeAt(0);if(i.collapsed||!i.toString().trim())return!1;const s=$6(i);if(!s.length||s.every(c=>{const u=c.parentElement;return u?Pn(u.style.color,n)===r?!0:Fm(u,e,n)===r:!1}))return!1;const a=document.createElement("span");a.style.color=t;try{i.surroundContents(a)}catch{a.appendChild(i.extractContents()),i.insertNode(a)}const l=document.createRange();return l.selectNodeContents(a),o.removeAllRanges(),o.addRange(l),!0}function q6(e,t,n){const r=Array.from(e.querySelectorAll('a[style*="color"]'));e.tagName==="A"&&e.style.color&&r.unshift(e),r.forEach(o=>{const i=Pn(o.style.color,t);if(!i)return;const s=Fm(o,e,t)||(n?Pn(n,t):void 0);s&&Array.from(o.querySelectorAll("span")).forEach(a=>{if(!a.style.color)return;const l=Pn(a.style.color,t);l&&l!==i&&l===s&&(a.style.color=o.style.color)})})}function z6(e){if(e.currentSettings.name!=="lineHeight")return!1;const t=e.parentElement.closest('[style*="line-height"]')||e.parentElement.closest("div, p, td");if(e.parentElement?.querySelector('[em-edit="active"]')){const n=[];e.checkForTextNodes(e.parentNode,n),n.forEach(r=>{const o=r.closest('[style*="line-height"]')||r.closest("div, p, td");o&&(o.style.lineHeight=e.currentSettings.value+"px")})}else if(e.isElementList){const n=!!e.parentElement.querySelector("div"),r=n?e.parentElement.closest("tr")?.querySelector(`.${e.classNameBullet}`):null;if(r&&(r.style.lineHeight=e.currentSettings.value+"px"),n){const o=e.parentElement.querySelector("div");o&&(o.style.lineHeight=e.currentSettings.value+"px")}else e.parentElement.style.lineHeight=e.currentSettings.value+"px"}else t&&(t.style.lineHeight=e.currentSettings.value+"px");return e.commit(),!0}function V6(e){if(e.currentSettings.name!=="fontFamily")return!1;let t=(e.findElementWithSelectedText(e.selectedText)||e.getParentElementOfSelection())?.closest('[style*="font-family"]')||e.parentWrapper;const n=!!e.parentElement?.querySelector('[em-edit="active"]');if(!n&&(!e.range?.collapsed||e.getSelectedText()))if(e.getInnerText(e.parentWrapper)===e.selectedText)t=e.parentWrapper;else if(e.getInnerText(e.parentElement)===e.selectedText)t=e.parentElement;else{const o=document.createElement("span");e.range.commonAncestorContainer.nodeType===3?e.range.surroundContents(o):(o.appendChild(e.range.extractContents()),e.range.insertNode(o)),t=o,e.range.deleteContents(),e.range.insertNode(t),e.range.selectNode(t),e.addNewRange(e.range)}e.fontFamilyArray?e.fontFamilyArray[0]==="Safe Fonts"?(t.style.fontFamily=e.fontFamilyArray[1],e.removeClassesByPrefix(t,"em-font"),e.clearLinkTags({elem:document.documentElement})):e.fontFamilyArray[0]==="Google Fonts"&&(e.fontFamilyArray[1]==="Sans Serif"?t.style.fontFamily="Helvetica, Arial, sans-serif":e.fontFamilyArray[1]==="Serif"?t.style.fontFamily='"Times New Roman", Times, serif':e.fontFamilyArray[1]==="Project Fonts"&&ul(t,e.fontFamilyArray[2]),e.removeClassesByPrefix(t,"em-font"),t.classList.add(e.createFontClassName(e.fontFamilyArray)),qd(t,e.fontFamilyArray),e.addFontFamilyClass({fontFamilyArray:e.fontFamilyArray})):t.style.removeProperty("font-family");let r;return n?(r=e.parentElement.querySelectorAll('[style*="font-family"]'),r.forEach(o=>o.style.fontFamily=t.style.fontFamily)):(r=t.querySelectorAll('[style*="font-family"]'),r.forEach(o=>o.style.fontFamily="")),e.cleanEmptySpans(e.selectedText),e.refreshElementSettings(t,e.selectedText),e.range.selectNode(t),e.addNewRange(e.range),e.commit(),!0}function U6(e){if(e.currentSettings.command==="bold"){if(e.hasItalicClass&&e.tempStyleClass&&e.parentWrapper&&e.parentWrapper.classList.add(e.tempStyleClass),!e.isEditorTagOutside){const t=[];e.checkForTextNodes(e.parentNode,t),t.filter(n=>e.checkForWorkClass(n)).forEach(n=>{n.innerHTML=e.removeFormattingTags(n.innerHTML,"bold"),n.tagName!=="STRONG"?e.currentSettings.value&&(n.innerHTML="<strong>"+n.innerHTML+"</strong>"):e.currentSettings.value||(n.outerHTML=n.innerHTML)})}if(e.currentSettings.value===!0)Array.from(e.parentNode?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");if(n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t),e.getInnerText(n)===e.selectedText){const r=n.closest("span");r?.textContent===n.innerText&&!r.getAttribute("style")&&r.childNodes[0]?.nodeType===3&&r.parentNode?.replaceChild(n,r),e.refreshElementSettings(n,e.selectedText),e.range.selectNode(n),e.addNewRange(e.range)}});else if(Array.from(e.parentWrapper?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t)}),e.getInnerText(e.parentWrapper)===e.selectedText){const t=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);t&&(e.range.selectNode(t),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function j6(e){if(e.currentSettings.command==="italic"){if(e.hasItalicClass&&e.tempStyleClass&&e.parentWrapper&&e.parentWrapper.classList.add(e.tempStyleClass),!e.isEditorTagOutside){const t=[];e.checkForTextNodes(e.parentNode,t),t.filter(n=>e.checkForWorkClass(n)).forEach(n=>{n.innerHTML=e.removeFormattingTags(n.innerHTML,"italic"),n.tagName!=="EM"?e.currentSettings.value&&(n.innerHTML="<em>"+n.innerHTML+"</em>"):e.currentSettings.value||(n.outerHTML=n.innerHTML)})}if(e.currentSettings.value)Array.from(e.parentNode?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");if(n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t),e.getInnerText(n)===e.selectedText){const r=n.closest("span");r?.textContent===n.innerText&&!r.getAttribute("style")&&r.childNodes[0]?.nodeType===3&&r.parentNode?.replaceChild(n,r),e.refreshElementSettings(n,e.selectedText),e.range.selectNode(n),e.addNewRange(e.range)}});else if(Array.from(e.parentElement?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t)}),e.getInnerText(e.parentWrapper)===e.selectedText){const t=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);t&&(e.range.selectNode(t),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function G6(e){if(e.currentSettings.name!=="fontSize")return;const{mutableState:t}=e;if(e.getInnerText(t.parentWrapper)!==e.selectedText){let i=!1;const s=e.findParentWithFontSizeAndTag(e.activeElement||t.parentNode)||t.parentWrapper;s&&s.style.fontSize.length&&(i=s.style.fontSize,s.style.fontSize=""),document.execCommand("fontSize",!1,"1"),i&&s&&(s.style.fontSize=i);const a=window.getSelection()?.getRangeAt(0).commonAncestorContainer;t.parentElement=t.parentNode.querySelector('[size="1"]')||(a?.nodeType===1?a:a?.parentElement),t.parentElement&&(t.parentElement.style.fontSize=e.currentSettings.value+"px")}let n=null;if(t.parentElement?.tagName==="FONT"){const i=document.createElement("span");i.innerHTML=t.parentElement.innerHTML,t.parentElement.getAttribute("size")?(i.style.fontSize=e.currentSettings.value+"px",i.removeAttribute("size")):Array.from(t.parentElement.attributes).forEach(s=>i.setAttribute(s.name,s.value)),t.parentElement.parentNode?.replaceChild(i,t.parentElement),e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range)}if((e.activeElement.tagName==="A"||e.activeElement.closest("a"))&&(t.parentWrapper=e.activeElement.closest("a")),e.getInnerText(t.parentWrapper)===e.selectedText){if(Array.from(t.parentWrapper?.getElementsByTagName("span")||[]).forEach(s=>s.style.fontSize=""),!t.parentWrapper?.hasAttribute("em-edit")&&e.isElementList&&t.parentWrapper&&e.isProgrammaticSelection){const s=t.parentWrapper.closest("tr")?.querySelector(`.${e.classNameBullet}`);s&&(s.style.fontSize=e.currentSettings.value+"px")}t.parentWrapper&&(t.parentWrapper.style.fontSize=e.currentSettings.value+"px");const i=t.parentWrapper?.firstChild;i?.nodeType===1&&i.tagName==="SPAN"&&i.innerText===e.selectedText&&(i.style.fontSize="")}else t.parentWrapper?.style.hasOwnProperty("font-size")&&(n=t.parentWrapper.style.fontSize,n&&t.parentWrapper.style.removeProperty("font-size"));n&&t.parentWrapper&&(t.parentWrapper.style.fontSize=n);const r=Array.from(t.parentNode?.querySelectorAll("font")||[]).reverse(),o=[];e.isEditorTagOutside?e.currentSettings.value||(t.selection=window.getSelection(),t.range=t.selection.getRangeAt(0),t.parentNode=t.selection.anchorNode?.nodeType===1?t.selection.anchorNode:t.selection.anchorNode?.parentElement,t.parentNode&&t.parentNode.style.removeProperty(e.currentStyle),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(t.parentNode,o),o.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.style.fontSize=e.currentSettings.value+"px",i.querySelectorAll('[style*="font-size"]').forEach(s=>{s.tagName!=="A"?s.style.removeProperty("font-size"):s.style.fontSize=e.currentSettings.value+"px"})})),e.isEditorTagOutside&&r.forEach(i=>{const s=document.createElement("span");s.innerHTML=i.innerHTML;const a=e.currentSettings.value+"px",l=i.children?.length===1&&i.firstChild?.nodeType===1?i.firstChild:null,c=[];if(e.checkForTextNodes(i,c),c.forEach(u=>{if(u.tagName==="FONT"){const d=document.createElement("span");d.innerHTML=u.innerHTML,u.getAttribute("size")?d.style.fontSize=e.getInnerText(u)===e.selectedText?a:"":Array.from(u.attributes).forEach(m=>d.setAttribute(m.name,m.value)),u.parentNode?.replaceChild(d,u)}}),l)i.parentNode?.replaceChild(l,i);else if(i.getAttribute("size")&&i.parentNode){const u=document.createElement("span");u.innerHTML=i.innerHTML,u.style.fontSize=a,i.parentNode.replaceChild(u,i)}if(!c.length&&i.tagName==="FONT"){const u=document.createElement("span");u.innerHTML=i.innerHTML,i.parentNode?.replaceChild(u,i)}}),Array.from(document.getElementsByTagName("span")).reverse().forEach(i=>{e.getInnerText(i)===e.selectedText&&i.closest('[em-edit="active"]')&&(e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range))}),e.cleanEmptySpans(e.selectedText)}function X6(e){if(e.currentSettings.command!=="strikethrough")return;const{mutableState:t}=e;let n=e.getSelectedText(),r=null;if(!e.isEditorTagOutside){const o=[];e.checkForTextNodes(e.parentNode,o),o.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.innerHTML=e.removeFormattingTags(i.innerHTML,"strike"),i.tagName!=="STRIKE"?e.currentSettings.value&&(i.innerHTML="<strike>"+i.innerHTML+"</strike>"):e.currentSettings.value||(i.outerHTML=i.innerHTML)})}if(e.currentSettings.value===!0){let o=n;Array.from(document?.getElementsByTagName("strike")||[]).reverse().forEach(i=>{if(e.getInnerText(i)===o&&(e.getInnerText(i.parentNode)===o&&i.parentNode.tagName==="U"&&(i.parentNode.outerHTML=i.parentNode.innerHTML),r=e.findElementWithSelectedText(o),r)){const s=e.findOutermostParentWithText(r,"A");s&&(s.style.textDecoration="none"),e.refreshElementSettings(r,o),t.range.selectNode(r),e.addNewRange(t.range)}})}else{let o=n;if(e.cleanEmptySpans(o),e.getInnerText(t.parentWrapper)===o){const i=window.getSelection();if(r=e.findElementWithSelectedText(o,e.activeElement),r&&(t.range.selectNode(r),e.addNewRange(t.range),t.range.cloneContents())){const s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||t.range.commonAncestorContainer;s&&e.request.type!=="button"&&e.refreshElementSettings(s,o)}if(i&&i.rangeCount>0&&e.isElementList&&!r){const s=i.getRangeAt(0);let a=s.commonAncestorContainer;a.nodeType!==Node.ELEMENT_NODE&&(a=a.parentNode),a.querySelectorAll("strike").forEach(l=>{l.outerHTML=l.innerHTML}),a.style.textDecoration="none",a.querySelectorAll('span[style*="text-decoration"]').forEach(l=>{l.style.textDecoration=""}),e.refreshElementSettings(a,o),s.selectNodeContents(a),i.removeAllRanges(),i.addRange(s),e.addNewRange(s)}}}if(e.request.type==="button"||e.activeElement.tagName==="A"){e.request.type!=="button"&&e.activeElement.tagName==="A"&&(t.parentWrapper=e.activeElement);let o=n;if(e.getInnerText(t.parentWrapper)===o&&t.parentWrapper)t.parentWrapper.style.textDecoration=e.currentSettings.value?"line-through":"none",Array.from(t.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),t.parentWrapper.innerHTML=e.removeFormattingTags(t.parentWrapper.innerHTML,"strikeUnderline"),e.refreshElementSettings(t.parentWrapper,o),t.range.selectNode(t.parentWrapper),e.addNewRange(t.range);else{const i=t.selection.getRangeAt(0),s=document.createElement("span");s.style.textDecoration=e.currentSettings.value?"line-through":"none",e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN"?(e.activeElement.style.textDecoration=e.activeElement.style.textDecoration==="line-through"?"none":"line-through",Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(a=>a.style.textDecoration=""),e.refreshElementSettings(e.activeElement,o)):(s.appendChild(i.extractContents()),Array.from(s.querySelectorAll('span[style*="text-decoration"]')).forEach(a=>a.style.textDecoration=""),i.insertNode(s),r=s,e.refreshElementSettings(s,o),e.addNewRange(i))}}if(t.range.cloneContents()){if(t.range=t.selection.getRangeAt(0),r&&e.getInnerText(r)===n)t.range.selectNode(r),e.addNewRange(t.range);else{const o=t.range.commonAncestorContainer,i=o.nodeType===1?o:o.parentElement,s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||i;s&&e.getInnerText(s)===n&&(t.range.selectNode(s),e.addNewRange(t.range))}r&&e.refreshElementSettings(r,n)}}function Y6(e){if(e.currentSettings.command!=="underline")return;const{mutableState:t}=e,n=o=>{const i=o.parentNode;if(i){for(;o.firstChild;)i.insertBefore(o.firstChild,o);i.removeChild(o)}},r=o=>{o.querySelectorAll("u").forEach(i=>{n(i)}),o.querySelectorAll('span[style*="text-decoration"], span[style*="text-decoration-line"]').forEach(i=>{i.style.removeProperty("text-decoration"),i.style.removeProperty("text-decoration-line"),i.getAttribute("style")||i.removeAttribute("style"),i.attributes.length===0&&n(i)})};if(!e.isEditorTagOutside){const o=[];e.checkForTextNodes(e.parentNode,o),o.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.innerHTML=e.removeFormattingTags(i.innerHTML,"underline"),i.tagName!=="U"?e.currentSettings.value&&(i.innerHTML="<u>"+i.innerHTML+"</u>"):e.currentSettings.value||(i.outerHTML=i.innerHTML)})}if(e.currentSettings.value){const o=Array.from(e.findOutermostParentWithText(e.parentElement)?.getElementsByTagName("u")||[]).reverse();o.push(...Array.from(e.findOutermostParentWithText(e.parentElement)?.querySelectorAll("a,span[style*=text-decoration]")||[]).reverse()),o.filter(i=>e.getInnerText(i)===e.selectedText).forEach(i=>{if(e.selectedText&&e.getInnerText(i)===e.selectedText){i.style.textDecoration="underline";const s=i.firstChild;s?.tagName==="STRIKE"&&e.getInnerText(s)===e.selectedText&&[...s.attributes].forEach(a=>{i.setAttribute(a.name,a.value),s.removeAttribute(a.name)}),e.cleanStrikesInElement(i,e.getParentElementOfSelection())}}),e.cleanEmptySpans(e.selectedText),e.getInnerText(e.parentElement)===e.selectedText&&e.cleanStrikesInElement(e.parentElement,e.getParentElementOfSelection())}else{const o=e.findElementWithSelectedText(e.selectedText,e.activeElement);if(!o&&e.isElementList){let i=null;const s=window.getSelection();if(s&&s.rangeCount>0){let l=s.getRangeAt(0).commonAncestorContainer;for(l.nodeType!==Node.ELEMENT_NODE&&(l=l.parentNode);l&&l!==e.activeElement&&!["DIV"].includes(l.tagName);)l=l.parentNode;l&&l.contains(e.activeElement)&&(i=l)}const a=i?e.findOutermostParentWithText(i,"A"):null;a&&(a.style.textDecoration="none"),e.getInnerText(t.parentWrapper)===e.selectedText&&i&&(e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range))}else{const i=e.findOutermostParentWithText(o,"A");i&&(i.style.textDecoration="none"),e.getInnerText(t.parentWrapper)===e.selectedText&&o&&(e.refreshElementSettings(o,e.selectedText),t.range.selectNode(o),e.addNewRange(t.range))}}if(e.request.type==="button"||e.activeElement.tagName==="A")if(e.request.type!=="button"&&e.activeElement.tagName==="A"&&(t.parentWrapper=e.activeElement),e.getInnerText(t.parentWrapper)===e.selectedText&&t.parentWrapper)t.parentWrapper.style.textDecoration=e.currentSettings.value?"underline solid":"none",Array.from(t.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(o=>o.style.textDecoration=""),e.cleanStrikesInElement(t.parentWrapper,e.getParentElementOfSelection());else{const o=t.selection.getRangeAt(0);if(e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN")e.currentSettings.value?e.activeElement.style.textDecoration="underline":(e.activeElement.style.removeProperty("text-decoration"),e.activeElement.style.removeProperty("text-decoration-line")),Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),e.activeElement.getAttribute("style")||e.activeElement.removeAttribute("style"),e.refreshElementSettings(e.activeElement,e.selectedText);else if(e.activeElement.tagName!=="A")if(e.currentSettings.value){const i=document.createElement("span");i.style.textDecoration="underline",i.appendChild(o.extractContents()),Array.from(i.querySelectorAll('span[style*="text-decoration"]')).forEach(s=>s.style.textDecoration=""),e.refreshElementSettings(i,e.selectedText),o.insertNode(i),e.addNewRange(o)}else{const i=o.extractContents(),s=document.createElement("span");s.appendChild(i),r(s);const a=document.createDocumentFragment();for(;s.firstChild;)a.appendChild(s.firstChild);o.insertNode(a),e.addNewRange(o)}}}function K6(e){if(!e.isColorChange)return;const{mutableState:t}=e;let n=[];if(e.tempColor&&e.isEditorTagOutside&&t.parentWrapper&&(t.parentWrapper.style[e.stylePropretyName]=e.tempColor,!t.parentWrapper?.hasAttribute("em-edit")&&e.isElementList&&t.parentWrapper&&e.isProgrammaticSelection)){const s=t.parentWrapper.closest("tr")?.querySelector(`.${e.classNameBullet}`);s&&(s.style[e.stylePropretyName]=e.tempColor)}if(e.outerContextColor&&e.outerContextElement&&(e.outerContextElement.style.color=e.outerContextColor),e.getInnerText(t.parentWrapper)===e.selectedText&&t.parentWrapper){const s=e.rgbToHex(e.currentSettings.value?.toString())||"";if(e.currentStyle==="color"){const a=(e.parentElement||t.parentNode).closest("a");if(e.request.type==="button"||a)a&&(a.style.color=s,a.querySelectorAll('span[style*="color"]').forEach(l=>l.style.color=""));else{t.parentWrapper.style.color=s,e.canselExecCommand&&(e.setCustomColor(t.parentWrapper,e.stylePropretyName,e.currentSettings.value),t.range.selectNode(t.parentWrapper),e.addNewRange(t.range));const l=t.parentWrapper.firstChild;l?.nodeType===1&&l.tagName==="SPAN"&&e.getInnerText(l)===e.selectedText&&(l.style[e.stylePropretyName]="")}}else if(!e.canselExecCommand){const a=document.createElement("span");a.style[e.stylePropretyName]=s;const l=t.parentWrapper.firstChild;if(l?.nodeType===1&&l.tagName==="SPAN"&&e.getInnerText(l)===e.selectedText)l.style[e.stylePropretyName]=s;else{for(;t.parentWrapper.firstChild;)a.appendChild(t.parentWrapper.firstChild);t.parentWrapper.appendChild(a)}}t.parentWrapper.querySelectorAll(`span[style*="${e.stylePropretyName}"]`).forEach(a=>{a.innerText!==t.parentWrapper.innerText&&a.style.removeProperty(e.stylePropretyName)})}e.isEditorTagOutside?!e.currentSettings.value&&t.selection.isCollapsed&&(t.parentNode=t.selection.anchorNode?.nodeType===1?t.selection.anchorNode:t.selection.anchorNode?.parentElement,t.parentNode&&t.parentNode.style.removeProperty(e.stylePropretyName),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(t.parentNode,n),n.forEach(s=>{s.classList&&s.classList.contains(e.classNameBullet)||e.checkForWorkClass(s)&&(s.style[e.stylePropretyName]=e.currentSettings.value,s.querySelectorAll(`[style*="${e.stylePropretyName}"]`).forEach(a=>{a.tagName!=="A"?a.style.removeProperty(e.currentStyle):a.style[e.stylePropretyName]=e.currentSettings.value}))}));const r=Array.from(t.parentNode?.querySelectorAll("font")||[]).reverse();e.isEditorTagOutside&&r.forEach(s=>{const a=document.createElement("span");a.innerHTML=s.innerHTML;const l=s.getAttribute(e.currentStyle),c=e.rgbToHex(l||"").toString(),u=s.children.length===1&&s.firstChild?.nodeType===1?s.firstChild:null;let d=[];if(e.checkForTextNodes(s,d),d.forEach(m=>{if(m.tagName==="FONT"){const p=document.createElement("span");p.innerHTML=m.innerHTML,p.style[e.stylePropretyName]=c,m.parentNode?.replaceChild(p,m),e.refreshElementSettings(p,e.selectedText),t.range.selectNode(p),e.addNewRange(t.range)}else m.style[e.stylePropretyName]=c}),u)s.parentNode?.replaceChild(u,s);else if(s.getAttribute(e.currentStyle)&&s.parentNode){const m=document.createElement("span");m.innerHTML=s.innerHTML,m.style[e.stylePropretyName]=c;const p=s.closest("a");p&&p.innerText===s.innerHTML&&(p.style[e.stylePropretyName]=c),s.parentNode.replaceChild(m,s)}});const o=Array.from(t.parentWrapper?.getElementsByTagName("span")||[]).reverse();e.isEditorTagOutside&&o.forEach(s=>{s.style[e.stylePropretyName]=e.rgbToHex(s.style[e.stylePropretyName]),e.getInnerText(s)===e.selectedText&&e.canselExecCommand&&(e.setCustomColor(s,e.stylePropretyName,e.currentSettings.value),t.range.selectNode(s),e.addNewRange(t.range))});const i=t.parentWrapper||t.parentNode;e.currentStyle==="color"&&i&&(q6(i,e.rgbToHex,e.outerContextColor||e.tempColor),F6(i,e.rgbToHex)),i&&e.cleanEmptySpans(e.selectedText,i)}function Z6(e){const t=e.parentElement;if(!t)return!1;let n=e,r=t;for(;r;){const o=r.tagName;if(o==="TD"||o==="TH")return r.childElementCount!==1||r.firstElementChild!==n?!1:!Array.from(r.childNodes).some(i=>i.nodeType===Node.TEXT_NODE&&i.textContent?.trim()!=="");if(o==="SPAN"||o==="EDITOR"){if(r.childElementCount!==1||r.firstElementChild!==n||Array.from(r.childNodes).some(i=>i.nodeType===Node.TEXT_NODE&&i.textContent?.trim()!==""))return!1;n=r,r=r.parentElement;continue}return!1}return!1}function mE(e,t){const n=e.style.color?.trim();if(!n)return null;const r=Pn(n),o=Pn(t??"");return!r||r===o?null:n}function Q6(e){if(e.currentSettings.name!=="textLink")return;const{mutableState:t}=e;let n=t.parentNode.querySelector('a[href=" "]');if(e.isEditorTagOutside||(n=e.findOutermostParentWithText(e.activeElement,"a")),e.currentSettings.value){const r=e.findOutermostParentWithText(e.activeElement,"a")||e.findOutermostParentWithText(t.parentNode,"a")||e.findOutermostParentWithText(t.parentWrapper,"a");if(!(n||r))return;const o=e.commonStyles?.links?.underline===void 0||e.commonStyles?.links?.underline?"underline":"none";n||(n=r);const i=e.findOutermostParentWithText(n);if(i&&i!==n&&i!==t.parentWrapper&&["b","strong","a","em","i","s","strike","u","br","span"].includes(i?.tagName.toLowerCase())){const s=n.cloneNode(!1),a=n.innerHTML;n.parentNode&&(n.parentNode.innerHTML=a),s.appendChild(i.cloneNode(!0)),i.parentNode&&i.parentNode.replaceChild(s,i),n=s,t.range.selectNode(n),e.addNewRange(t.range)}if(n){n.setAttribute("target","_blank"),n.setAttribute("href","");const s=e.commonStyles?.links?.color||n.closest('[style*="color"]')?.style?.color||"";n.setAttribute("style",`color: ${s}; text-decoration: ${o};`),n.setAttribute("new","true"),e.refreshElementSettings(n,e.selectedText)}}else if(n=t.parentNode.closest("a")||t.parentNode.querySelector('a[em-edit="active"]')||e.findOutermostParentWithText(e.activeElement,"a"),n)if(n.style.fontFamily||n.style.fontSize){const r=Z6(n)?"div":"span",o=document.createElement(r);if(o.innerHTML=n.innerHTML,Array.from(n.attributes).forEach(s=>{s.name!=="href"&&s.name!=="target"&&s.name!=="color"&&o.setAttribute(s.name,s.value)}),!o.style.lineHeight){const s=n.closest('[style*="line-height"]');s?.style.lineHeight&&(o.style.lineHeight=s.style.lineHeight)}o.style.textDecoration="";const i=mE(n,e.commonStyles?.links?.color);if(i?o.style.color=i:o.style.color="",n.parentNode?.replaceChild(o,n),r==="div"){let s=o.parentElement;for(;s&&s.tagName!=="TD"&&s.tagName!=="TH";){const a=s.parentElement;if(!a)break;a.replaceChild(o,s),s=o.parentElement}}e.cleanEmptySpansWithParent(e.selectedText,o),e.refreshElementSettings(o,e.selectedText),t.range.selectNodeContents(o),e.addNewRange(t.range)}else{const r=mE(n,e.commonStyles?.links?.color);if(r){const o=document.createElement("span");for(o.style.color=r;n.firstChild;)o.appendChild(n.firstChild);n.parentNode?.replaceChild(o,n),t.range=document.createRange(),t.range.selectNodeContents(o)}else{const o=Array.from(n.childNodes);o.forEach(i=>{n.parentNode?.insertBefore(i,n)}),n.parentNode?.removeChild(n),t.range=document.createRange(),t.range.setStartBefore(o[0]),t.range.setEndAfter(o[o.length-1])}if(e.addNewRange(t.range),t.range.cloneContents()){t.range=t.selection.getRangeAt(0);const o=t.range.commonAncestorContainer,i=o.nodeType===1?o:o.parentElement,s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||i;s&&e.refreshElementSettings(s,e.selectedText)}}}var $m='[class*="em-mob-font_size"]',J6=`${$m}, [style*="font-size"]`,e7="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub",t7=new Set(["SPAN","STRONG","B","EM","I","U","S","STRIKE","FONT","SUP","SUB","A"]);function n7(e,t,n){const{classNamePrefix:r,value:o}=t.mobileFontSize,i=o!=null?`${r}${o}px`:null,s=e.closest(e7)||e;s.querySelectorAll(".em-element-path").forEach(d=>d.remove());const a=r7(s,i!==null);if(!a||Oe(s)===Ke()){n({settings:t,elem:s.closest("editor")?s:s.closest(J6)||s}),Wm(s,r,i);return}const l=o7(s,a);if(i===null){(l?[l]:Array.from(s.querySelectorAll($m)).filter(d=>a.intersectsNode(d))).forEach(d=>{Wm(d,r,null),fE(d,r)});return}const c=l||oE(a,a.extractContents(),"span");if(!c)return;i7(c),n({settings:t,elem:c}),Wm(c,r,i);const u=document.createRange();u.selectNodeContents(c),lo(u)}function r7(e,t){const n=window.getSelection();if(!n?.rangeCount)return null;const r=n.getRangeAt(0);if(!e.contains(r.commonAncestorContainer))return null;if(!r.collapsed)return r;if(!t){const i=(r.startContainer.nodeType===Node.ELEMENT_NODE?r.startContainer:r.startContainer.parentElement)?.closest($m);if(!i||i===e||!e.contains(i))return null;const s=document.createRange();return s.selectNodeContents(i),lo(s),s}P6(n,lo);const o=n.rangeCount?n.getRangeAt(0):null;return o&&!o.collapsed?o:null}function o7(e,t){const n=Ke(),r=t.commonAncestorContainer;let o=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement,i=null;for(;o&&o!==e&&o.tagName!=="EDITOR"&&e.contains(o)&&Oe(o)===n;)i=o,o=o.parentElement;return i}function Wm(e,t,n){e.querySelectorAll("*").forEach(r=>{n&&r.style.fontSize?(dl(r,t),r.classList.add(n)):r.getAttribute("class")?.includes(t)&&fE(r,t)})}function fE(e,t){dl(e,t),e.classList.length||e.removeAttribute("class");const n=e.parentNode;if(!(e.tagName!=="SPAN"||e.attributes.length||!n)){for(;e.firstChild;)n.insertBefore(e.firstChild,e);e.remove()}}function i7(e){[e.previousSibling,e.nextSibling].forEach(t=>{if(!t||t.textContent!=="")return;if(t.nodeType===Node.TEXT_NODE){t.remove();return}const n=t,r=n.tagName==="A"&&(n.hasAttribute("name")||n.hasAttribute("id"));t7.has(n.tagName)&&!r&&!n.querySelector("img, br, hr, table, video, iframe")&&n.remove()})}function s7(e,t){let n=!1;const{activeElement:r}=t;if(typeof e.linkHref=="string"&&l7(e.linkHref,t),t.textStyleProperties.some(o=>e.hasOwnProperty(o)))try{t.toggleTextStyle(r,{settings:e})}catch{}if(e.mobileFontSize&&(n7(r,e,t.setElementMobileFontSize),n=!0),e.mobileLineHeight){const o=r.closest('[class*="em-mob-line_height"]')||r.closest('[style*="line-height"]');t.setElementMobileLineHeight({settings:e,elem:o}),n=!0}return e.textAlign!==void 0&&c7(e.textAlign,r),e.mobileTextAlign&&(u7(e,r,t),n=!0),(typeof e.textSuperscript=="boolean"||typeof e.textSubscript=="boolean")&&t.handleTextScriptSettings(e,{unwrapNestedTags:t.unwrapNestedTags,wrapInTag:t.wrapInTag,unwrapTag:t.unwrapTag,isRangeMatching:t.isRangeMatching,splitWrapper:t.splitWrapper,cleanEmptyTags:t.cleanEmptyTags,applicationElementSettingsSet:t.applicationElementSettingsSet,commit:t.commit}),e.textAnchor!==void 0&&t.handleTextAnchor(e.textAnchor,{activeElement:r,commit:t.commit}),e.textReplacer!==void 0&&t.handleTextReplacer(e.textReplacer,{activeElement:r,compareStrings:t.compareStrings}),(e.hasOwnProperty("listUL")||e.hasOwnProperty("listOL"))&&a7(e,r),t.isElementList&&d7(e,t),n}function a7(e,t){const n=k9.includes(t.tagName)?t:t.closest(L9);if(!n)return;const r=e.listOL!==void 0;(r?e.listOL:e.listUL)?I9(n,r):F9(n)}function l7(e,t){let n=document.querySelector("[em-edit]");if(!n)return;let r=n.tagName==="A"?n:n.closest("a"),o=n.closest(".alignment")||n.closest(".button_block")||n.closest("td");if(o||(o=n.closest("div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, a, sup, sub"),o||(o=document.querySelector("td")?.closest("div, p, td")||null)),!r&&o&&(r=o.querySelector("a")),r&&(r.setAttribute("href",e),ds(e)&&r.removeAttribute("target")),o){const i=t.collectVMLContent(o);if(i){const s=document.createElement("div");s.innerHTML=i;const a=s.querySelector("v\\:roundrect"),l=s.querySelector("a");(a||l)&&(a&&a.setAttribute("href",e),l&&l.setAttribute("href",e),t.updateVMLComments(o,s.innerHTML))}}}function c7(e,t){const n=rs(t);n&&(e?n.style.textAlign?n.style.textAlign=e:n.setAttribute("align",e):n.style.textAlign?n.style.removeProperty("text-align"):n.removeAttribute("align"))}function u7(e,t,n){const r=rs(t);if(!r)return;const o=e.mobileTextAlign?.classNamePrefix||"em-mob-text_align-";t8(t,r,o),n.setElementMobileAlign({settings:e,elem:r,fieldName:"mobileTextAlign"})}function d7(e,t){const{activeElement:n,classNameOl:r,classNameUl:o}=t,i=n.closest(`table.${r}`)||n.closest(`table.${o}`);if(!i)return;const s=i.outerHTML,a=t.removeEditorTags(s);e.SpacingBetweenParagraphs&&(i.innerHTML=t.updateTableStyle(a,"padding-bottom",e.SpacingBetweenParagraphs)),e.SpacingBetweenBulletsAndText&&(i.innerHTML=t.updateTableStyle(a,"padding-left",e.SpacingBetweenBulletsAndText)),e.BulletType&&(i.innerHTML=t.changeBullets(a,e.BulletType)),e.ColorBullets&&(i.innerHTML=t.changeBulletsColor(a,e.ColorBullets)),e.BulletsSize&&(i.innerHTML=t.changeBulletsSize(a,e.BulletsSize)),e.hasOwnProperty("BulletTextItalic")&&(i.innerHTML=t.changeBulletsItalic(a,e.BulletTextItalic)),e.hasOwnProperty("BulletTextStrong")&&(i.innerHTML=t.changeBulletsWeight(a,e.BulletTextStrong)),e.hasOwnProperty("BulletTextStrikethrough")&&(i.innerHTML=t.changeBulletsStrikethrough(a,e.BulletTextStrikethrough)),e.hasOwnProperty("BulletTextUnderline")&&(i.innerHTML=t.changeBulletsUnderline(a,e.BulletTextUnderline)),e.hasOwnProperty("BulletsFontFamily")&&t.isElementListOL&&(i.innerHTML=m7(e.BulletsFontFamily,a,t));let l=t.findElementWithSelectedText(n.textContent||"",i);l===null&&(l=i),l.hasAttribute("em-edit")||l.setAttribute("em-edit","active"),t.commit()}function m7(e,t,n){const r=document.createElement("div");r.innerHTML=t;const o=r.querySelector("table.em-element-list-ol");return o?(o.querySelectorAll("tr").forEach(i=>{const s=i.querySelector("td:first-child > div");s&&(e?e[0]==="Safe Fonts"?(s.style.fontFamily=e[1],n.removeClassesByPrefix(s,"em-font"),n.clearLinkTags({elem:document.documentElement})):e[0]==="Google Fonts"&&(e[1]==="Sans Serif"?s.style.fontFamily="Helvetica, Arial, sans-serif":e[1]==="Serif"?s.style.fontFamily='"Times New Roman", Times, serif':e[1]==="Project Fonts"&&ul(s,e[2]),n.removeClassesByPrefix(s,"em-font"),s.classList.add(n.createFontClassName(e)),qd(s,e),n.addFontFamilyClass({fontFamilyArray:e})):s.style.removeProperty("font-family"))}),r.innerHTML):t}var Ml=null;function pE(e){Ml=e}function hE(){return Ml}function Un(){Ml=null}function f7(){return Ml?.kind==="atom"}var p7=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"],h7=["em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"],g7=["em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function gE(){document.querySelectorAll(".em-block-insert").forEach(e=>{e.classList.remove(...p7)})}function b7(){document.querySelectorAll(".em-atom-insert").forEach(e=>{e.classList.remove(...h7)})}function Rl(){document.querySelectorAll(".em-blockatom-insert").forEach(e=>{e.classList.remove(...g7)})}function qm(e,t){const n=e.getBoundingClientRect();return t>n.top+n.height/2?"bottom":"top"}function bE(e,t){const n=e.getBoundingClientRect(),r=document.body.getBoundingClientRect();return t==="bottom"?n.bottom>r.height-21:n.top<2}function zm(e,t,n){const r=n==="atom"?"em-atom-insert":"em-block-insert",o=n==="blockatom"?"em-blockatom-insert":r;if(e.classList.add(o),t==="bottom"){e.classList.remove(`${r}_top`,`${r}_top-document`);const i=bE(e,"bottom")?`${r}_bottom-document`:`${r}_bottom`;e.classList.add(i)}else{e.classList.remove(`${r}_bottom`,`${r}_bottom-document`);const i=bE(e,"top")?`${r}_top-document`:`${r}_top`;e.classList.add(i)}}function Ol(e){return e.tagName==="TABLE"||e.tagName==="TR"?e.querySelector("[data-template-content]")??e.querySelector("td"):e}function yE(e){if(!e?.length)return null;for(let t=0;t<e.length;t++){const n=e.item(t);if(n?.type.startsWith("image/"))return n}return null}function y7(e){if(!e?.items?.length)return null;for(let t=0;t<e.items.length;t++){const n=e.items[t];if(n.kind!=="file")continue;const r=n.getAsFile();if(r&&r.type.startsWith("image/"))return r}return null}function v7(e){const t=yE(e.dataTransfer?.files??null);return t||y7(e.dataTransfer??null)}function Vm(e){const t=document.body?.parentElement??document.body;if(!t)return null;const n=document.elementFromPoint(e.clientX,e.clientY);if(!n)return null;const r=n.closest(".em-element-resize-img-container");if(r){const i=r.querySelector("img");if(i&&t.contains(i))return i}const o=n.closest("img");return!o||!t.contains(o)?null:o}function ms(e){const t=e.dataTransfer?.types;return!!t&&Array.from(t).includes("Files")}function Um(e){if(!ms(e))return!1;const t=e.dataTransfer;if(!t)return!1;if(t.files?.length)return!!yE(t.files);const n=t.items;if(!n?.length)return!0;for(let r=0;r<n.length;r++){const o=n[r];if(o.kind!=="file")continue;const i=o.type||"";if(i.startsWith("image/")||i==="")return!0}return!1}var vE="em-native-img-drop-target",jm="em-native-img-uploading",E7="em-native-img-drop-loading",Pl="em-native-file-drag",fs=null,Or=null;function EE(){Or&&(window.removeEventListener("scroll",Or.reposition,!0),window.removeEventListener("resize",Or.reposition),Or.resizeObserver?.disconnect(),Or.overlay.remove(),Or=null)}function S7(e){EE();const t=document.createElement("div");t.className="em-native-img-upload-spin-overlay",t.setAttribute("aria-hidden","true");const n=document.createElement("div");n.className="em-native-img-upload-spin",t.appendChild(n),document.body.appendChild(t);const r=()=>{const i=e.getBoundingClientRect();t.style.left=`${Math.round(i.left)}px`,t.style.top=`${Math.round(i.top)}px`,t.style.width=`${Math.max(Math.round(i.width),1)}px`,t.style.height=`${Math.max(Math.round(i.height),1)}px`};r(),window.addEventListener("scroll",r,!0),window.addEventListener("resize",r);let o=null;typeof ResizeObserver<"u"&&(o=new ResizeObserver(()=>r()),o.observe(e)),Or={overlay:t,reposition:r,resizeObserver:o}}function Gm(){fs&&(fs.classList.remove(vE),fs=null)}function Pr(){document.body.classList.remove(Pl),Gm()}function w7(e){if(!ms(e)){Pr();return}if(!Um(e)){Pr();return}document.body.classList.add(Pl);const t=Vm(e);if(!t){Gm();return}fs!==t&&(Gm(),fs=t,t.classList.add(vE))}function SE(){EE(),document.body.classList.remove(E7),document.body.classList.remove(Pl),document.querySelectorAll(`.${jm}`).forEach(e=>{e.classList.remove(jm)})}function C7(e,t){if(t.lockEditor||!ms(e))return!1;const n=v7(e);if(!n)return!1;const r=Vm(e);return r?(t.applicationElementSettingsSet({elem:r}),Pr(),r.classList.add(jm),S7(r),t.messageService.send({operation:Pe.APPLICATION_NATIVE_IMAGE_DROP,file:n}),!0):!1}function A7(e,t){if(t.lockEditor)return;document.body.classList.contains("em-block-insert-body")||t.messageService.send({operation:"application_scroll-block-show"});const n=e.target;n.getAttribute("em")==="atom"&&(document.body.classList.add("em-atom-insert-body-inside"),t.commit(!1),t.mutableState.atomReplaced=n)}function T7(e,t){t.lockEditor||(Pr(),e.preventDefault(),t.messageService.send({operation:"application_scroll-block-hide"}))}function _7(e,t){if(e.preventDefault(),t.lockEditor){Pr();return}ms(e)?(Um(e)&&Vm(e)&&(e.dataTransfer.dropEffect="copy"),w7(e)):Pr();const n=e.target;if(document.body.classList.contains("em-block-insert-body")){const r=cn(n)?null:n.closest('[em="block"]');if(r){t.mutableState.targetBlock=r;const o=Ol(r);o&&zm(o,qm(o,e.pageY),"block")}else gE()}else if(document.body.classList.contains("em-atom-insert-body")){const r=n.closest('[em="atom"]');if(r&&r.innerHTML.trim())t.mutableState.targetBlock=r,zm(r,qm(r,e.pageY),"atom"),Rl();else if(n.closest('[em="block"]')&&n.tagName==="TD"&&!n.innerHTML&&!n.hasAttribute("height")||n.tagName==="DIV"&&n.closest("amp-accordion")&&!n.innerHTML)Rl();else{const o=n.closest('[em="block"]');if(o){t.mutableState.targetBlock=o;const i=Ol(o);i&&(zm(i,qm(i,e.pageY),"blockatom"),b7())}}}}function k7(e,t){if(t.lockEditor)return;ms(e)&&Um(e)&&document.body.classList.add(Pl);const n=e.target;if(document.body.classList.contains("em-block-insert-body")){document.querySelectorAll(".em-block-insert-empty").forEach(o=>{o.classList.remove("em-block-insert-empty")});const r=n.closest('[em="block"]');cn(n)?(n.classList.add("em-block-insert-empty"),gE()):r&&(t.mutableState.targetBlock=r)}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside")){document.querySelectorAll(".em-atom-insert-empty").forEach(i=>{i.classList.remove("em-atom-insert-empty")});const r=n.closest('[em="atom"]');r&&r.innerHTML.trim()?(t.mutableState.targetBlock=r,document.querySelectorAll(".em-atom-insert, .em-blockatom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})):n.closest('[em="block"]')&&n.tagName==="TD"&&!n.innerHTML&&!n.hasAttribute("height")&&(t.requireEvenEmptyCell===!1||n.parentElement&&[...n.parentElement.children].indexOf(n)%2===0)||n.tagName==="DIV"&&n.closest("amp-accordion")&&!n.innerHTML?(n.classList.add("em-atom-insert-empty"),document.querySelectorAll(".em-atom-insert, .em-blockatom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})):document.querySelectorAll(".em-atom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}),document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert-empty")});const o=n.closest('[em="block"]');cn(n)?(n.classList.add("em-block-insert-empty"),Rl()):o?t.mutableState.targetBlock=o:Rl()}}var L7=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function N7(e){return e.clientX<=0||e.clientY<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight}function x7(e,t){if(t.lockEditor)return;const n=e.target;if(document.body.classList.contains("em-block-insert-body")){if(N7(e)){document.querySelectorAll(".em-block-insert").forEach(i=>i.classList.remove(...L7)),t.mutableState.newTargetblock=null,t.mutableState.targetBlock=null;return}const r=e.relatedTarget,o=n.closest('[em="block"]');if(r&&o&&o.contains(r))return;t.mutableState.newTargetblock=n.closest('[em="block"]'),t.mutableState.newTargetblock&&(n.closest('[em="block"]')&&(t.mutableState.newTargetblock!==t.mutableState.targetBlock||t.mutableState.newTargetblock.closest('[em="group"]')!==t.mutableState.targetBlock?.closest('[em="group"]'))?t.mutableState.newTargetblock.tagName==="DIV"?t.mutableState.newTargetblock.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"):t.mutableState.newTargetblock.querySelectorAll(".em-block-insert").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}):document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}))}else if(document.body.classList.contains("em-atom-insert-body")){const r=e.relatedTarget,o=n.closest('[em="atom"]');if(r&&o&&o.contains(r))return;const i=n.closest('[em="block"]');if(r&&i&&i.contains(r))return;t.mutableState.newTargetblock=n.closest('[em="atom"]'),t.mutableState.newTargetblock&&(n.getAttribute("em")==="atom"&&t.mutableState.newTargetblock!==t.mutableState.targetBlock?t.mutableState.newTargetblock.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"):document.querySelectorAll(".em-atom-insert-empty").forEach(a=>{a.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}));const s=n.closest('[em="block"]');s&&(n.closest('[em="block"]')&&(s!==t.mutableState.targetBlock||s.closest('[em="group"]')!==t.mutableState.targetBlock?.closest('[em="group"]'))?s.tagName==="DIV"?s.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"):s.querySelectorAll(".em-blockatom-insert").forEach(a=>{a.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}):document.querySelectorAll(".em-block-insert-empty").forEach(a=>{a.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}))}}function M7(e,t,n){if(!e)return;let r=document.head.querySelector('style[em="styles"]'),o="";r?o=n.HTMLDocument.getInnerHtml(r):(r=document.createElement("style"),r.setAttribute("em","styles"),r=document.head.insertAdjacentElement("beforeend",r));const i=document.createElement("div");t&&(e=e.replace(/(max-device-width:|max-width:)\d+px/g,a=>a.replace(/\d+/,String(t)))),i.insertAdjacentHTML("afterbegin",e);let s=n.minify(o+`
97
+ `+[...i.querySelectorAll("style")].map(a=>a.innerHTML).join(`
98
+ `),{restructure:!0,forceMediaMerge:!0}).css;s=n.cssbeautify(s,{indent:" ",autosemicolon:!0}),r&&(r.textContent=`
99
+ `+s+`
100
+ `)}function R7(e){for(const t of e.reverse())document.head?.prepend(t),document.head?.insertAdjacentHTML("afterbegin",`
101
+ `)}function O7(e){return e.classList.contains("em-block-insert_bottom-document")||e.classList.contains("em-block-insert_bottom")?"afterend":e.classList.contains("em-block-insert_top-document")||e.classList.contains("em-block-insert_top")?"beforebegin":"afterend"}function wE(){Un(),Pr(),document.body.classList.remove("em-block-insert-body"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>{e.classList.remove("em-block-insert-empty")}),document.body.classList.remove("em-atom-insert-body","em-atom-insert-body-inside"),document.querySelectorAll(".em-atom-insert-empty").forEach(e=>{e.classList.remove("em-atom-insert-empty")}),document.querySelectorAll(".sortable-chosen.sortable-ghost").forEach(e=>{e.classList.remove("sortable-chosen","sortable-ghost")})}function CE(e,t,n){const r=e.target,o=n.parseFromString(t.settings.blockHTML||"");let i=o.filter(l=>l.tagName&&l.tagName!=="LINK"&&l.tagName!=="STYLE").map(l=>n.getOuterHtml(l)).join("");const s=o.filter(l=>l.tagName==="STYLE").map(l=>n.getOuterHtml(l)).join(""),a=o.filter(l=>l.tagName==="LINK"&&l.getAttribute("em-class")).filter(l=>!document.head?.querySelector(`link[em-class="${l.getAttribute("em-class")}"]`));if(M7(s,n.emailWidth,{minify:n.minify,cssbeautify:n.cssbeautify,HTMLDocument:n.HTMLDocument}),R7(a),t.settings.type!=="project"&&(i=n.commonStylesApplyToBlock({html:i})),i.match(/class="em-countdown"/gi)&&(i=n.uptimeCountdown({blockHTML:i})),n.isTableElement(r)&&cn(r))r.getAttribute("em")==="block"&&r.removeAttribute("em"),(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:r}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:r,project:t.settings.project})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),i.substring(0,3)==="<tr"?n.insertAdjacentHTML(Vn(r),"beforeend",`
102
+ `+i+`
103
+ `):n.insertAdjacentHTML(Vn(r),"beforeend",`
104
+ <tr><td align="center">
105
+ `+i+`
106
+ </td></tr>
107
+ `),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),Un());else if(r.tagName==="BODY"){const l=document.querySelector('[em="block"]:last-child'),c="afterend";(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:l}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:l,project:t.settings.project})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"});const u=document.createElement("table");u.replaceChildren(...n.parseFromString(`
108
+ `+i+`
109
+ `)),[...u.querySelectorAll(":scope> tr")].reverse().forEach(d=>l.insertAdjacentElement(c,d)),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),Un())}else{const l=r.closest('[em="block"]');if(l){const c=Ol(l),u=c?O7(c):"afterend";if((i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:l}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:l,project:t.settings.project})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),l.tagName==="TR")if(i.substring(0,3)==="<tr"){const d=document.createElement("table");d.replaceChildren(...n.parseFromString(`
110
+ `+i+`
111
+ `)),[...d.querySelectorAll(":scope > tr")].reverse().forEach(m=>l.insertAdjacentElement(u,m))}else{const d=document.createElement("table");d.replaceChildren(...n.parseFromString(`
112
+ <tr em="block"><td align="center">
113
+ `+i+`
114
+ </td></tr>
115
+ `)),[...d.querySelectorAll(":scope > tr")].reverse().forEach(m=>l.insertAdjacentElement(u,m))}else if(i.substring(0,3)==="<tr")if(l.tagName==="TABLE"){const d=document.createElement("table");d.setAttribute("cellspacing","0"),d.setAttribute("cellpadding","0"),d.setAttribute("align","center"),d.setAttribute("border","0"),d.setAttribute("em","block"),d.setAttribute("width",l.hasAttribute("width")?l.getAttribute("width"):String(l.getBoundingClientRect().width)),d.classList.add("em-mob-width-100perc"),Qn(d,`
116
+ `+i+`
117
+ `),d.querySelectorAll('tr[em="block"]').forEach(m=>m.removeAttribute("em")),l.insertAdjacentElement(u,d)}else{const d=document.createElement("div");d.setAttribute("align","center"),d.setAttribute("em","block"),Qn(d,`<table cellpadding="0" cellspacing="0" border="0" width="100%">
118
+ `+i+`
119
+ </table>`),d.querySelectorAll('tr[em="block"]').forEach(m=>m.removeAttribute("em")),l.insertAdjacentElement(u,d)}else n.insertAdjacentHTML(l,u,`
120
+ `+i+`
121
+ `);l.querySelectorAll(".em-block-insert").forEach(d=>{d.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),Un())}}}function AE(e){return e==='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>'?`
122
+ <tr em="block" class="em-structure">
123
+ <td align="center">
124
+ ${e}
125
+ </td>
126
+ </tr>`:`
127
+ <style>
128
+ @media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
129
+ .em-mob-wrap {
130
+ display: block!important;
131
+ }
132
+ .em-mob-width-100perc {
133
+ width: 100%!important;
134
+ max-width: 100%!important;
135
+ }
136
+ .em-mob-padding_right-20 {
137
+ padding-right: 20px!important;
138
+ }
139
+ .em-mob-padding_left-20 {
140
+ padding-left: 20px!important;
141
+ }
142
+ </style>
143
+ <tr em="block" class="em-structure">
144
+ <td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
145
+ <table align="center" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
146
+ <tr>
147
+ <td width="600" valign="top" class="em-mob-wrap em-mob-width-100perc">
148
+ ${e}
149
+ </td>
150
+ </tr>
151
+ </table>
152
+ </td>
153
+ </tr>`}function P7(e,t,n,r,o){t.match(/em="atom"><tr><td>\s*<img/gi)&&!t.match(/class="em-countdown"/gi)&&(t=o.setImageWidth({atomHTML:t,targetAtom:e})),t.match(/class="em-countdown"/gi)?o.insertCountdown({targetElem:e,targetPlace:"beforeend",atomHTML:t}):qe(e,"beforeend",`
154
+ `+t+`
155
+ `),n!=null&&(e.closest(".empty-structure")||e.closest(".em-structure"))&&n.remove(),r.settings?.name&&(o.messageService.send("application_atom_inserted",r.settings.name),Un())}function I7(e,t,n,r,o){const i=e.target,s=!!document.querySelector(".em-blockatom-insert"),a=s?i.closest('[em="block"]'):i,l=s?document.querySelector(".em-blockatom-insert"):document.querySelector(".em-block-insert-empty");t.match(/em="atom"><tr><td>\s*<img/gi)&&(t=r.setImageWidth({atomHTML:t,targetAtom:l}));let c=AE(t);t!=='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>'&&o(c.match(/<style((.|\n|\r)*?)<\/style>/g)),n.settings?.type!=="project"&&(c=r.commonStylesApplyToBlock({html:c}));let u=null;a.tagName==="TABLE"||a.tagName==="TR"?u=a.querySelector("[data-template-content]")??a.querySelector("td"):u=a,(c.indexOf("empty-structure")>-1||c.indexOf("em-structure")>-1)&&(c=r.setFloatBlocksWidth({blockHTML:c,targetBlock:a,project:n.settings?.project}),c=r.fitImagesToColumns(c));let d="beforeend";s&&u&&(u.classList.contains("em-block-insert_bottom-document")||u.classList.contains("em-block-insert_bottom")?d="afterend":(u.classList.contains("em-block-insert_top-document")||u.classList.contains("em-block-insert_top"))&&(d="beforebegin"));const m=!!t.match(/class="em-countdown"/gi),p=c.substring(0,3)==="<tr";if(a.tagName==="TR")if(p)if(m)r.insertCountdown({targetElem:a,targetPlace:d,atomHTML:c});else{const f=document.createElement("tr");f.setAttribute("em","block"),f.classList.add("em-structure"),f.replaceChildren(...Te(`
156
+ `+c+`
157
+ `).flatMap(h=>h instanceof Element&&h.tagName==="TR"?Array.from(h.childNodes):[h])),a.insertAdjacentElement(d,f)}else if(m)r.insertCountdown({targetElem:a,targetPlace:d,atomHTML:`<tr em="block"><td align="center">
158
+ `+c+`
159
+ </td></tr>`});else{const f=document.createElement("tr");f.setAttribute("em","block"),Qn(f,`
160
+ <td align="center">
161
+ `+c+`
162
+ </td>
163
+ `),a.insertAdjacentElement(d,f)}else if(p)if(a.tagName==="TABLE")if(cn(i))m?r.insertCountdown({targetElem:d==="beforeend"?Vn(a):a,targetPlace:d,atomHTML:c}):qe(d==="beforeend"?Vn(a):a,d,c);else{const f=document.createElement("table");f.setAttribute("cellspacing","0"),f.setAttribute("cellpadding","0"),f.setAttribute("align","center"),f.setAttribute("border","0"),f.setAttribute("em","block"),f.setAttribute("width",a.hasAttribute("width")?a.getAttribute("width"):String(a.getBoundingClientRect().width)),f.classList.add("em-mob-width-100perc"),Qn(f,`
164
+ `+c+`
165
+ `),f.querySelectorAll('tr[em="block"]').forEach(h=>h.removeAttribute("em")),m?r.insertCountdown({targetElem:a,targetPlace:d,atomHTML:r.getOuterHtml(f)}):a.insertAdjacentElement(d,f)}else m?r.insertCountdown({targetElem:a,targetPlace:d,atomHTML:`<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
166
+ `+c+`
167
+ </table></div>`}):qe(a,d,`
168
+ <div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
169
+ `+c+`
170
+ </table></div>
171
+ `);else m?r.insertCountdown({targetElem:a,targetPlace:d,atomHTML:c}):qe(a,d,`
172
+ `+c+`
173
+ `);document.querySelectorAll(".em-blockatom-insert").forEach(f=>{f.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),n.settings?.name&&(r.messageService.send("application_atom_inserted",n.settings.name),Un())}function D7(e,t,n){const r=document.querySelector(".em-atom-insert");if(e.match(/em="atom"><tr><td>\s*<img/gi)&&r&&(e=n.setImageWidth({atomHTML:e,targetAtom:r})),!r)return;let o="afterend";r.classList.contains("em-atom-insert_bottom-document")||r.classList.contains("em-atom-insert_bottom")?o="afterend":(r.classList.contains("em-atom-insert_top-document")||r.classList.contains("em-atom-insert_top"))&&(o="beforebegin");const i=!!e.match(/class="em-countdown"/gi);if(r.tagName==="TR"){const s=document.createElement("div");Qn(s,e);const a=s.querySelector('[em="atom"]');a&&a.removeAttribute("em");let l=0;const c=r.querySelector("[colspan]");c?l=c.getAttribute("colspan")||0:l=r.childElementCount,i?n.insertCountdown({targetElem:r,targetPlace:o,atomHTML:`
174
+ <tr em="atom"><td colspan="`+l+`">
175
+ `+s.innerHTML+`
176
+ </td></tr>
177
+ `}):qe(r,o,`
178
+ <tr em="atom"><td colspan="`+l+`">
179
+ `+s.innerHTML+`
180
+ </td></tr>
181
+ `)}else i?n.insertCountdown({targetElem:r,targetPlace:o,atomHTML:e}):qe(r,o,`
182
+ `+e+`
183
+ `);r.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"),t.settings?.name&&(n.messageService.send("application_atom_inserted",t.settings.name),Un())}function TE(e,t){const n=t.mutableState.atomReplaced;let r={settings:{}};const o=e.target,i=u=>t._setDocumentStyles(u,{minify:t.minify,cssbeautify:t.cssbeautify,HTMLDocument:t.HTMLDocument}),s=e.dataTransfer?.getData("Text")||"";if(s&&t.isJsonString(s)?r=JSON.parse(s):n&&(r={settings:{atomHTML:Va(n)}}),!r.settings?.atomHTML)return;let a=r.settings.atomHTML.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();i(r.settings.atomHTML.match(/<style((.|\n|\r)*?)<\/style>/g)),a=t.commonStylesApply({html:a});const l=o.closest('[em="block"]')&&o.tagName==="TD"&&!o.innerHTML&&!o.hasAttribute("height")&&(o.classList.contains("em-atom-insert-empty")||f7()),c=o.tagName==="DIV"&&o.closest("amp-accordion")&&!o.innerHTML;if(l||c){P7(o,a,n,r,t);return}if(document.querySelector(".em-blockatom-insert")||cn(o)){I7(e,a,r,t,i);return}o.closest('[em="atom"]')&&D7(a,r,t)}var B7=/^[\t\n\f\r ]*$/;function H7(e,t){const n=[...e.childNodes],r=n.every(o=>o===t||o.nodeType===Node.TEXT_NODE&&B7.test(o.textContent??""));e.replaceWith(...r?[t]:n)}function F7(e,t){let n=!1;const{activeElement:r}=t;if(e.link!==void 0){const o=t.getActiveEditElement();if(!o)return n;if(e.link!==""){const i=o.closest("a");if(i)i.setAttribute("href",e.link);else{const s=document.createElement("a");s.setAttribute("href",e.link),s.setAttribute("target","_blank"),o.parentNode?.insertBefore(s,o),s.appendChild(o),t.setCursorPosition(s)}}else{const i=o.closest("a");i&&(H7(i,o),t.setCursorPosition(o))}}if(e.src!==void 0&&op(r)&&Tt(r,"src",e.src??""),e.src!==void 0&&SE(),e.alt!==void 0&&r.setAttribute("alt",e.alt),e.title?r.setAttribute("title",e.title):e.title===""&&r.removeAttribute("title"),e.border&&t.setElementBorder({settings:e,elem:r}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:r}),e.align&&e.align!=="undefined"?r.closest("div, p, td")?.setAttribute("align",e.align):e.align===""&&r.closest("div, p, td")?.removeAttribute("align"),e.valign?r.style.verticalAlign=e.valign:e.valign===""&&r.style.removeProperty("vertical-align"),e.width&&(e.width.value!==void 0&&e.width.value!==null?(r.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),r.style.width="100%",r.style.maxWidth=e.width.value+e.width.dim):(r.setAttribute("width","0"),r.style.width="100%",r.style.maxWidth="0")),e.height&&(e.height.value!==void 0&&e.height.value!==null?(r.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),r.style.height=e.height.value+e.height.dim):(r.removeAttribute("height"),r.style.removeProperty("height"))),e.borderRadius&&t.setElementBorderRadius({settings:e,elem:r}),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:r}),n=!0),e.mobileHeight&&(t.setElementMobileHeight({settings:e,elem:r}),n=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:r}),n=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:r}),n=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:r}),n=!0),e.mobileAlign){const o=r.closest("div, p, td");o&&t.setElementMobileAlign({settings:e,elem:o}),n=!0,e.mobileAlign.value?r.style.display="inline-block":r.style.display="block"}if(e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:r}),n=!0),e.show&&(t.setElementShow({settings:e,elem:r}),n=!0),e.countdown){const o=new Image;o.onload=function(){r.setAttribute("width",String(Math.round(this.width/2))),r.style.maxWidth=Math.round(this.width/2)+"px"};const i=e.countdown?.link??"";o.src=i,Tt(r,"src",i),r.setAttribute("em-cd-settings",e.countdown.params)}if(e.video&&r.setAttribute("em-video-settings",JSON.stringify(e.video)),e.imgReplacer){const o=e.imgReplacer??"",i=r.closest("em-replace");if(i)Tt(i,"src",o);else{const s=document.createElement("em-replace");Tt(s,"src",o),r.parentNode?.insertBefore(s,r),s.appendChild(r)}}else if(e.imgReplacer===""){const o=r.closest("em-replace");o&&(o.parentNode?.insertBefore(r,o),o.remove())}return n}function $7(e,t){const{activeElement:n,textStyleProperties:r,toggleTextStyle:o}=t;if(e.href!==void 0&&(n.setAttribute("href",e.href),ds(e.href)&&n.removeAttribute("target")),e.target&&!(e.href&&ds(e.href))&&n.setAttribute("target",e.target),r.some(i=>e.hasOwnProperty(i)))try{o(n,{settings:e})}catch{}}function W7(e,t){const{activeElement:n,setElementMobileHeight:r}=t;let o=!1;if(e.height)if(n.tagName==="DIV"){const i=e.height.value+e.height.dim;n.style.height=i,n.style.lineHeight=i,n.style.fontSize=e.height.value>10?parseInt(e.height.value)-2+e.height.dim:"8px"}else n.tagName==="TD"&&n.setAttribute("height",String(e.height.value));return e.mobileHeight&&(r({settings:e,elem:n}),o=!0),o}function q7(e,t){const{activeElement:n,isVariableText:r}=t,o=n.nextSibling?.nodeType===8?n.nextSibling:null;if(!o||!e.value)return;let i=e.value;i.startsWith("<!--")&&(i=i.substring(4)),i.endsWith("-->")&&(i=i.substring(0,i.length-3)),r(`<!--${i}-->`)?o.nodeValue=i:o.replaceWith(i)}function z7(e){const t=e.settings.textReplacer;return typeof t=="string"&&t.includes("~~")}var ps=["textStrong","textItalic","textStrikethrough","textUnderline","textColor","textBackgroundColor","textLink","lineHeight","fontSize","fontFamily"];function V7(e){const t=i=>{e.commit(i)},n={addFontFamilyClass:i=>Zi(i,t),clearLinkTags:i=>{Mr(i,t),mr(t)}},r=(i,s)=>{const{settings:a}=i,l=kl(s),c={setElementMobileWidth:f1,setElementMobileHeight:Bo,setElementMobileBorder:AD,setElementMobileBorderRadius:TD,setElementMobileBoxShadow:_D,setElementMobileAlign:p1,setElementMobileTableAlign:kD,setElementMobileVerticalAlign:h1,setElementMobileDirection:LD,setElementMobileBackgroundColor:ND,setElementMobileBackgroundImage:xD,setElementMobileBackgroundPositionX:MD,setElementMobileBackgroundPositionY:RD,setElementMobileBackgroundRepeat:OD,setElementMobileBackgroundSize:PD,setElementMobilePadding:ts,setElementMobileFontSize:g1,setElementMobileLineHeight:b1,setElementShow:y1},u={setElementBorder:Vd,setElementBoxShadow:$P,setElementBorderRadius:Gi},d={activeElement:s,setPercentsForColumns:Jc,setElementMobileHeight:Bo},m={parseTableElementToModel:es,tableModelToHtml:It,updateTablePadding:eD,updateBackgroundPosition:tD,removeStyleProperty:dD,updateBorderRadius:fD,removeClassByPrefix:gD,getCellsWithClasses:rD,updateTableCellBackgroundByIds:oD,addClassToCellsByIds:iD,getExternalBorders:aD,mergeUniCells:bD,updateCellBordersByIds:sD,getExternalCorners:cD,updateCellBorderRadiusByIds:lD,updateCellPaddingByIds:uD,removeOuterBorders:pD,simplifyBorders:hD};switch(i.type){case"img":case"countdown":case"video":F7(a,{activeElement:s,getActiveEditElement:eu,setCursorPosition:e.setCursorPosition,...u,...c});break;case"a":$7(a,{activeElement:s,textStyleProperties:ps,toggleTextStyle:e.toggleTextStyle});break;case"table":DB(a,{activeElement:s,...u,...c});break;case"td":case"structure":case"group":case"column":HB(a,{activeElement:s,requestType:i.type,textStyleProperties:ps,isElementListContainer:J9(s),isProgrammaticSelection:e.programmaticSelection,...u,...c,setContrastBlock:ID,setStructureBlocksWidth:Ll,toggleTextStyle:e.toggleTextStyle,removeEditorTags:Fo,addClassToSecondCell:A9,wrapEditor:e.wrapEditor,addNewRange:lo});break;case"button":RB(a,{activeElement:s,textStyleProperties:ps,...u,...c,toggleTextStyle:e.toggleTextStyle,compareStrings:uh});break;case"div":IB(a,{activeElement:s,...u,...c});break;case"vindent":W7(a,{activeElement:s,setElementMobileHeight:Bo});break;case"var":q7(a,{activeElement:s,isVariableText:dv});break;case"floatBlock":qB(a,{activeElement:s,setElementMobileWidth:f1,setElementMobileContentWidth:CD,setElementMobileVerticalAlign:h1,setElementShow:y1});break;case"text":s7(a,{activeElement:s,textStyleProperties:ps,toggleTextStyle:e.toggleTextStyle,collectVMLContent:Tv,updateVMLComments:_v,removeClassesByPrefix:zd,createFontClassName:$d,...n,handleTextScriptSettings:u6,handleTextReplacer:d6,handleTextAnchor:b6,unwrapNestedTags:yB,wrapInTag:oE,unwrapTag:vB,isRangeMatching:EB,splitWrapper:SB,cleanEmptyTags:wB,applicationElementSettingsSet:e.applicationElementSettingsSet,compareStrings:uh,setElementMobileFontSize:g1,setElementMobileLineHeight:b1,setElementMobileAlign:p1,updateTableStyle:r9,changeBullets:o9,changeBulletsColor:i9,changeBulletsSize:s9,changeBulletsItalic:l9,changeBulletsWeight:a9,changeBulletsStrikethrough:u9,changeBulletsUnderline:c9,findElementWithSelectedText:di,removeEditorTags:Fo,isElementList:l.isList,isElementListOL:l.isListOL,classNameOl:l.classNameOl,classNameUl:l.classNameUl,commit:t});break;case"floatBlocksWidths":zB(a,d);break;case"floatBlocksPreset":VB(a,d);break;case"floatBlocksValign":UB(a,d);break;case"floatBlocksGap":jB(a,d);break;case"floatBlocksGapMobile":GB(a,d);break;case"carousel":t6(a,{activeElement:s,HTMLDocument:e.htmlDocument,parseFromString:Te,setElementBorderRadius:Gi,commit:t});break;case"accordion":n6(a,{activeElement:s,HTMLDocument:e.htmlDocument,parseFromString:Te,setElementBorderRadius:Gi,commit:t});break;case"social":{const p=c6(a,{activeElement:s,parseFromString:Te,commit:t});if(p)return p;break}case"customTable":y6(a,{activeElement:s,activeCell:x.get("activeCell"),state:x,...m,wrapEditor:e.wrapEditor,addNewRange:lo,toggleTextStyle:e.toggleTextStyle,textStyleProperties:ps,commit:t,...c})}return s},o=(i,s,a,l)=>{x.increment("activeElementLocked");const c=i;let u=i;e.commitLockedAsync().finally(()=>{const d=MB(u,c,s,a,{getMappedParent:m=>e.htmlDocument.getMappedParent(m)??void 0,getOuterHtml:m=>e.htmlDocument.getOuterHtml(m),parseFromString:m=>Te(m)});if(!d){x.decrement("activeElementLocked"),e.setCursorPosition(u),l?.();return}u=d.active,e.commitLockedAsync().finally(()=>{d.afterCommit(),x.decrement("activeElementLocked"),e.setCursorPosition(u),l?.()})})};return i=>{try{x.increment("activeElementLocked");const s=i.data;s.settings=e.getMapObj().escape(s.settings);const a=eu();if(!a){s.type==="customTable"&&(r(s,null),e.commitLockedAsync());return}e.beforeApply?.(s,a);const l=xB(a),c=r(s,a);e.afterApply?.(s,c);const u=z7(s)?bh():null;try{Ry()}catch{}o(c,l,s,u?()=>tk(u,d=>e.htmlDocument.renderOnly(d)):void 0)}catch{}finally{Promise.resolve().then(()=>x.decrement("activeElementLocked"))}}}function U7(e,t){if(t)return e.keyCode===90?e.shiftKey?"redo":"undo":e.keyCode===89&&!e.shiftKey?"redo":void 0}function j7(e,t,n,r){if(!((window.navigator.platform.match("Mac")?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&!t&&n!=="start"&&!e.ctrlKey&&!e.metaKey))return!1;const o=e.target,i=o.tagName==="EDITOR"?o:o.closest("editor");if(i){if(i.querySelectorAll(".em-code")?.length){const u=()=>{const d=r.getAllComments(o);for(const m of d)r.isVariableComment(m)&&(r.getVariableIcon(m)||m.remove());i.removeEventListener("input",u)};i.addEventListener("input",u)}return!0}const s=document.querySelector("[em-edit]");if(!s||s.closest("editor"))return!1;const a=r.getElementParent(s);let l=s.parentNode;const c=s.closest("editor");if(r.setCursorPosition(a),s.classList.contains("em-mob-wrap")){r.removeElementEditors();const u=s.closest("tr");if(u&&[...u.cells].every(d=>!d.textContent?.trim())){const d=s.closest("table");l=d?.parentNode||null,d?.remove()}}else if(s.classList.contains("em-code")){const u=r.getVariableByIcon(s);u&&(u.parentNode?.removeChild(u),s.remove())}else if(s.tagName==="TD"&&s.innerHTML===""&&s.hasAttribute("height")){const u=s.closest("table");if(u){const d=u.previousSibling;d&&d.textContent?.trim()===""&&d.remove(),u.remove()}}else if(s.closest(".em-element-resize-img-container")){const u=s.closest(".em-element-resize-img-container");l=u.parentNode;const d=s.closest("td")?.querySelector("editor");d&&d.innerHTML===""&&d.remove(),u.remove()}else if(s.closest('[em="atom"]')){const u=s.closest('[em="atom"]');l=u.parentNode;const d=s.closest(".em-mob-wrap, .noresp-em-mob-wrap");s.tagName==="TD"&&s.previousElementSibling===null&&s.nextElementSibling===null?u.remove():s.remove(),s.tagName!=="TD"&&d&&d.textContent?.trim()===""&&(d.textContent="")}else if(s.parentElement?.tagName==="TR"&&s.parentElement.getAttribute("em")==="group"&&document.querySelectorAll('[em="group"]').length===1)s.querySelector(".em-narrow-table")?.replaceChildren();else{s.remove();const u=s.previousSibling;u&&u.textContent?.trim()===""&&u.remove()}return c&&c.remove(),l&&r.removeEmptyParents(l),r.commit(),r.messageService.send({operation:"application_element_settings_close"}),!0}function G7(e,t){if(!(e.keyCode===39||e.key==="ArrowRight"))return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0),o=r.startContainer,i=o.nodeType===Node.TEXT_NODE?o.parentElement:o;if(i?.closest("em-replace"))return!1;const s=co(i)?i.parentElement:i,a=["strong","em","u","b","i","span","a","sub","sup","strike"];let l=null;for(const p of a){const f=s?.closest(p);if(f){l=f;break}}if(!l||!t.isCaretAtEndOfStandardElement(r,l))return!1;e.preventDefault();const c=l.nextSibling;if(c&&c.nodeType===Node.TEXT_NODE&&(c.textContent?.length||0)>0){const p=c.textContent||"";return p[0]===" "||p[0]===" "?(t.setCursorPositionSimple(c,1),!0):(c.textContent=" "+p,t.setCursorPositionSimple(c,1),t.commit(),!0)}const u=l.parentNode;if(!u)return!0;if(c&&c.nodeType===Node.ELEMENT_NODE&&c.tagName==="SPAN"&&c.textContent===" ")return t.setCursorInsideSpan(c),!0;const d=document.createElement("span"),m=document.createTextNode(" ");return d.appendChild(m),c?u.insertBefore(d,c):u.appendChild(d),t.setCursorInsideSpan(d),!0}function X7(e,t,n,r,o){if(!(e.keyCode===13&&!n||(e.key==="Enter"||e.keyCode===13)&&e.shiftKey&&n&&r))return!1;if(e.preventDefault(),e.stopImmediatePropagation(),!t)return!0;const i=window.getSelection(),s=i&&i.rangeCount>0?i.getRangeAt(0):null;if(!s)return!0;const a=i.anchorNode,l=a?.parentNode,c=l?.tagName==="A";s.collapsed||s.deleteContents();const u=document.createElement("br");if(a?.nextSibling===null&&c&&a.nodeType===Node.TEXT_NODE){if(i.anchorOffset===0)return l.parentNode.insertBefore(u,l),o.commit(),!0;if(i.anchorOffset===(a.textContent?.length||0))return l.after(u),s.setStartAfter(u),s.setEndAfter(u),o.commit(),!0}if(n){const d=t.querySelector('div[em-edit="active"]');if(!(d&&d.contains(s.startContainer))&&d){const m=d.lastChild;m&&s.setStart(m,m.textContent?.length||0)}}return s.insertNode(u),s.setStartAfter(u),s.setEndAfter(u),i.removeAllRanges(),i.addRange(s),o.commit(),!0}function Y7(e){const t=e.target,n=t?.closest?.("a")||t?.querySelector?.("a");if(!n)return!1;const r=n.closest("td")||n.parentElement;return r?Iv(r,n.textContent||""):!1}function K7(e){const t=r=>{const o=r.target,i=o?.closest?.("a")||o?.querySelector?.("a"),s=i?.closest("td")||i?.parentElement;!i||!s||!dr(s)||e(!1).then(()=>{const a=!!i.closest("editor")||!!i.querySelector("editor")||!!s.querySelector("editor");s.isConnected&&i.isConnected&&a&&Iv(s,i.textContent||"")&&e(!1)})},n=r=>{Y7(r)&&e(!1)};return document.addEventListener("input",t,!1),document.addEventListener("focusout",n,!1),{dispose(){document.removeEventListener("input",t,!1),document.removeEventListener("focusout",n,!1)}}}var Z7=new Set(["textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor"]);function Q7(e){const{commit:t,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:o,getParentElementOfSelection:i,findOutermostParentWithText:s,clearLinkTags:a,addFontFamilyClass:l,getIsProgrammaticSelection:c,getCommonStyles:u}=e,d=o,m=i,p=s;function f(b,v,A){const g=!!b&&!!v&&v.tagName==="DIV"&&b.tagName==="EDITOR"&&b.parentElement===v&&v.childElementCount===1&&v.firstElementChild===b&&!Array.from(v.childNodes).some(N=>N!==b&&N.nodeType===Node.TEXT_NODE&&!!N.textContent?.trim()),S=!!b&&b.childElementCount===0&&Array.from(b.childNodes).some(N=>N.nodeType===Node.TEXT_NODE&&!!N.textContent?.trim()),T=!!b&&Oe(b).trim()===A.trim();if(!g||!S||!T||!b.hasAttribute("em-edit")||!v.parentNode)return;const _=v.parentNode,M=b.getAttribute("em-edit")||"active";for(;b.firstChild;)v.appendChild(b.firstChild);b.remove(),b.removeAttribute("em-edit"),v.setAttribute("em-edit",M),_.replaceChild(b,v),b.appendChild(v)}function h(b,v){try{return v.intersectsNode(b)}catch{const A=document.createRange();return A.selectNodeContents(b),v.compareBoundaryPoints(Range.END_TO_START,A)<0&&v.compareBoundaryPoints(Range.START_TO_END,A)>0}}function y(b){const v=b?.links||{},A=v.underline,g=v.color,S=typeof A=="boolean"?A?"underline":"none":"underline";return{color:typeof g=="string"&&g.trim()?g.trim():"inherit",textDecoration:S}}function E(b,v){if(!b||!v)return null;const A=v,g=Array.from(A.querySelectorAll("a"));A.tagName==="A"&&g.unshift(A);const S=typeof window<"u"&&window.Range?window.Range.START_TO_START:0,T=typeof window<"u"&&window.Range?window.Range.END_TO_END:2;for(const _ of g){const M=document.createRange();M.selectNodeContents(_);const N=M.compareBoundaryPoints(S,b)<=0,W=M.compareBoundaryPoints(T,b)>=0;if(N&&W)return _}return null}function C(b,v,A){const g=Array.from(v?.getElementsByTagName("span")||[]).reverse();let S=!1;Oe(v)===b&&g.length&&(S=!0),g.forEach(T=>{const _=T.getAttribute("style"),M=!!_&&_.trim().length>0;let N=Array.from(T.attributes).filter(P=>P.name!=="style");if(!M&&N.length===1&&N[0].name==="em-edit"&&T.parentElement&&!T.parentElement.hasAttribute("em-edit")){const P=T.getAttribute("em-edit")||"active";T.parentElement.setAttribute("em-edit",P),T.removeAttribute("em-edit"),N=Array.from(T.attributes).filter(R=>R.name!=="style")}const W=N.length>0;if(!M&&!W){const P=Oe(T);if(T.childNodes.length===1&&T.childNodes[0].nodeType===3){const R=T.childNodes[0];T.parentNode?.replaceChild(R,T),A.isEditorTagOutside&&Oe(v)!==b&&R.parentNode&&(A.range?.selectNode(R),n(A.range))}else{const R=Array.from(T.childNodes);R.forEach(Y=>{T.parentNode?.insertBefore(Y,T)}),b===P&&(A.range=document.createRange(),A.range.setStartBefore(R[0]),A.range.setEndAfter(R[R.length-1]),n(A.range)),T.parentNode?.removeChild(T)}}}),S&&(r(v,b),A.range.selectNode(v),n(A.range))}function k(b,v){if(b?.rangeCount>0){const A=b.getRangeAt(0),g=A.commonAncestorContainer;let S=A.startOffset,T=A.endOffset;for(;g.data&&S>0&&!/\s/.test(g.data[S-1]);)S--;for(;g.data&&T<g.length&&!/\s/.test(g.data[T]);)T++;v.setStart(g,S),v.setEnd(g,T),n(v)}}function w(b,v,A){b.innerHTML=b.innerHTML.replaceAll(/<\/?strike[^>]*>/gi,""),b.parentNode&&(A.selectNode(b),n(A),r(b,v))}return function(v,A){const g=O6(A.settings,X),S=A.settings.textColor??A.settings.textBackgroundColor;if(typeof S=="string"&&S.trim()!==""&&!X(S))return!1;const T=kl(v),{classNameOl:_,classNameUl:M,classNameBullet:N,isListOL:W,isListUL:P,isList:R}=T;R&&T.tableElement?.querySelectorAll("tbody > tr > td:first-child")?.forEach(F=>{const et=F.querySelector(":scope > div")||F.querySelector(":scope > editor div");et&&et.classList.add(`${N}`)}),v?.querySelectorAll(".em-element-path").forEach(F=>F.remove());const Y=Object.keys(A.settings)[0];let V=window.getSelection();if(!V||V.rangeCount===0){if(!v||!v.isConnected)return;const F=document.createRange();if(F.selectNodeContents(v),V=window.getSelection(),!V)return;V.removeAllRanges(),V.addRange(F)}let G=V.getRangeAt(0);const Le=G.commonAncestorContainer;let ae=Le.nodeType===1?Le:Le.parentElement,ne=V.anchorNode?.nodeType===1?V.anchorNode:V.anchorNode?.parentElement,we=!1,j=Ke();if(v||(v=V.anchorNode?.childNodes.length===1&&V.anchorNode.firstChild?.nodeType===1?V.anchorNode.firstChild:ae,v.tagName==="EDITOR"&&(v=v.parentElement)),g.name==="textLink"&&g.value===""){const F=ae?.closest?.("a, [href]")||null;F&&(G.selectNode(F),n(G),v=F)}if(g.name==="textUnderline"&&!g.value){let F=ae.closest(["u","strike","[style*=text-decoration]","span","a"].find(et=>ae?.closest(et))||"u");!F&&v?.tagName==="A"&&(F=v),F?.tagName==="A"&&(F.style.textDecoration="none",r(F,j),G.selectNode(F),n(G),v=F,we=!0)}let z=A.type==="button"?(v||ne)?.closest("a"):(v||ne)?.closest("a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");const Se=A.settings.fontFamily;let Ae=null;const Q=Array.from(z?.classList||[]).some(F=>(F.startsWith("em-font-")&&(Ae=F),F.startsWith("em-font-")&&F.includes(g.name==="textItalic"?"Italic":"Bold")));Q&&(g.name==="textItalic"||g.name==="textStrong")&&Ae&&z?.classList.remove(Ae);const Lt={range:G,isEditorTagOutside:!1},U=(F=Ke(),et=z)=>{C(F,et,Lt)},In=tB,gt=nE,Wr=(F,et)=>{w(F,j,Lt.range)};let dn,ot;Y==="textColor"?dn=ot="color":Y==="textBackgroundColor"&&(dn="backgroundColor",ot="background-color");const Bt=A.settings.hasOwnProperty("textColor")||A.settings.hasOwnProperty("textBackgroundColor"),Be=!!ae?.closest("editor")||Oe(ae)===j||Oe(ae.querySelector("editor"))===j;Lt.isEditorTagOutside=Be,A.settings.hasOwnProperty("textColor")&&g.value&&document.execCommand("styleWithCSS",!1,"true");const jn=nB,Cs=c(),As=u();if(z6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X})||V6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,fontFamilyArray:Se,removeClassesByPrefix:zd,createFontClassName:$d,clearLinkTags:a,addFontFamilyClass:l,cleanEmptySpans:U}))return!1;const Ht=ae.closest(g.tags.find(F=>ae?.closest(F))||"span");(G?.collapsed||!Ke())&&(g.value?g.value&&Be&&(A.type==="button"||v.tagName==="A"&&Ht?G.selectNodeContents(Ht):k(V,G)):Ht&&G.selectNodeContents(Ht)),(A.type==="button"||v.tagName==="A"||v?.closest("a"))&&Ke()&&Ke()!==Oe(v)&&Ht&&(A.settings.hasOwnProperty("textLink")||A.settings.hasOwnProperty("textUnderline"))&&(G.selectNode(Ht),n(G),A.settings.hasOwnProperty("textUnderline")&&v.tagName==="A"&&(v.style.textDecoration=g.value?"underline":"none",we=!0)),V=window.getSelection(),G=V.getRangeAt(0),Lt.range=G,j=Ke(),Array.from(z?.querySelectorAll("span,div")||[]).reverse().forEach(F=>{F.getAttribute("style")===""&&F.removeAttribute("style"),F.hasAttribute("contenteditable")&&F.removeAttribute("contenteditable"),F.hasAttribute("em-edit")&&F.removeAttribute("em-edit"),F.hasAttribute("em-relative")&&F.removeAttribute("em-relative"),F.hasAttribute("class")&&(F.classList.remove("em-relative"),F.classList.length===0&&F.removeAttribute("class"))});let Ts=null;Bt&&ot&&z?.style?.getPropertyValue?.(ot)?.trim()&&(Oe(z)===j&&(z.style[dn]=X(g.value?.toString())||"",we=!0),dn==="color"&&(ae===z||v?.closest('[style*="color"]')===z)&&(Ts=X(z.style[ot]),z.style.removeProperty(ot),!z?.hasAttribute("em-edit")&&R&&z&&Cs&&z.closest("tr")?.querySelector(`.${N}`)?.style.removeProperty(ot)));let of=null,ce=null;if(Bt&&dn==="color"&&z?.tagName==="A"){let F=z.parentElement;for(;F&&!["BODY","HTML","TD","TH"].includes(F.tagName);){const et=F.style.getPropertyValue("color")?.trim();if(et){of=X(et)||et,ce=F,F.style.removeProperty("color");break}F=F.parentElement}}ot&&!(g.value.length===7||g.value.length===4)&&(we=!0),Be&&(!g.value&&g.name!=="fontSize"&&g.name!=="textLink"||g.value)&&(!(g.name==="textUnderline"||g.name==="textStrikethrough")||A.type!=="button")&&!we&&(g.name!=="fontSize"&&!Bt&&Oe(z)===j?document.execCommand(g.command,!1,Bt?g.value:g.name==="textLink"?" ":void 0):Oe(z)!==j&&(A.settings.hasOwnProperty("textColor")&&document.execCommand("styleWithCSS",!1,"true"),document.execCommand(g.command,!1,Bt?String(g.value):g.name==="textLink"?" ":void 0),A.settings.hasOwnProperty("textColor")&&g.value&&W6(z||ae,String(g.value),X))),j=Ke();{const F={parentElement:ae,parentNode:ne,parentWrapper:z,selection:V,range:G};G6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,activeElement:v,hasItalicClass:Q,tempStyleClass:Ae,checkForWorkClass:In,removeFormattingTags:us,cleanEmptySpans:U,mutableState:F,currentStyle:dn,isProgrammaticSelection:Cs,findParentWithFontSizeAndTag:sB}),ae=F.parentElement,ne=F.parentNode,z=F.parentWrapper,V=F.selection,G=F.range,Lt.range=G}U6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,activeElement:v,hasItalicClass:Q,tempStyleClass:Ae,checkForWorkClass:In,removeFormattingTags:us,cleanEmptySpans:U}),j6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,activeElement:v,hasItalicClass:Q,tempStyleClass:Ae,checkForWorkClass:In,removeFormattingTags:us,cleanEmptySpans:U});const Ft={parentWrapper:z,range:G,selection:V};X6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,activeElement:v,hasItalicClass:Q,tempStyleClass:Ae,checkForWorkClass:In,removeFormattingTags:us,cleanEmptySpans:U,request:A,findOutermostParentWithText:p,mutableState:Ft}),z=Ft.parentWrapper,G=Ft.range,Lt.range=G;const Yl={parentWrapper:z,range:G,selection:V};if(Y6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,activeElement:v,hasItalicClass:Q,tempStyleClass:Ae,checkForWorkClass:In,removeFormattingTags:us,cleanEmptySpans:U,request:A,findOutermostParentWithText:p,cleanStrikesInElement:Wr,mutableState:Yl}),z=Yl.parentWrapper,g.value===!1&&z){const F=window.getSelection(),et=F&&F.rangeCount>0?F.getRangeAt(0):G,mn={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]}[g.name];let Dn=!1;mn&&mn.forEach(be=>{Array.from(z.getElementsByTagName(be)).reverse().forEach(bt=>{if(!h(bt,et))return;const fn=Oe(bt);if(!fn||fn.trim().length===0)return;const tt=bt.parentElement;bt.hasAttribute("em-edit")&&tt&&!tt.hasAttribute("em-edit")&&tt.setAttribute("em-edit",bt.getAttribute("em-edit")||"active"),bt.outerHTML=bt.innerHTML,Dn=!0,f(tt,z,j)})}),Dn&&setTimeout(()=>{const be=document.querySelector("[em-edit]")||d(j)||(z?.isConnected?z:null);be&&r(be,j)},0)}if(g.value===!0&&z&&Be){const F={textStrong:"strong",textItalic:"em",textStrikethrough:"s",textUnderline:"u"},et={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]},mn=F[g.name],Dn=et[g.name];if(mn&&Dn&&j&&j.trim().length>0){const be=z,bt=Dn.some($t=>be.getElementsByTagName($t).length>0),fn=(be.style?.textDecoration||"").toLowerCase(),tt=(be.style?.textDecorationLine||"").toLowerCase(),pn=fn.includes("underline")||tt.includes("underline"),yt=fn.includes("line-through")||tt.includes("line-through"),Kl=g.name==="textUnderline"&&pn||g.name==="textStrikethrough"&&yt,sf=Oe(be)===j;if(!bt&&!Kl&&sf){const $t=document.createElement(mn);for(;be.firstChild;)$t.appendChild(be.firstChild);be.appendChild($t);try{const hn=document.createRange();hn.selectNodeContents($t),n(hn),G=hn,Lt.range=hn}catch{}setTimeout(()=>{const hn=document.querySelector("[em-edit]")||d(j)||(be.isConnected?be:null);hn&&r(hn,j)},0)}}}const _s={parentWrapper:z,parentNode:ne,range:G,selection:V};K6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,isColorChange:Bt,tempColor:Ts,outerContextColor:of,outerContextElement:ce,stylePropretyName:ot,currentStyle:dn,canselExecCommand:we,isProgrammaticSelection:Cs,request:A,setCustomColor:jn,checkForWorkClass:In,cleanEmptySpans:U,mutableState:_s}),z=_s.parentWrapper,ne=_s.parentNode;const Gn={parentWrapper:z,parentNode:ne,range:G,selection:V};if(Q6({parentElement:ae,parentNode:ne,parentWrapper:z,currentSettings:g,isElementList:R,classNameBullet:N,isEditorTagOutside:Be,selectedText:j,range:G,selection:V,checkForTextNodes:gt,commit:t,getInnerText:Oe,getSelectedText:Ke,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:X,findOutermostParentWithText:p,activeElement:v,commonStyles:As,cleanEmptySpansWithParent:U,mutableState:Gn}),G=Gn.range,g.name==="textLink"&&g.value===!0&&Be&&z&&j?.trim().length>0){const F=Gn.range||G,et=j.trim(),mn=[...z?Array.from(z.querySelectorAll("a")):[],...z?.parentElement?Array.from(z.parentElement.querySelectorAll("a")):[]],Dn=mn.find(be=>Oe(be)?.trim()===et)||mn[0]||null;if(!(E(F,z)||E(F,z.parentElement)||Dn)&&F&&!F.collapsed){const be=document.createElement("a"),{color:bt,textDecoration:fn}=y(As);be.setAttribute("target","_blank"),be.setAttribute("href",""),be.setAttribute("new","true"),be.setAttribute("style",`color: ${bt}; text-decoration: ${fn};`);let tt=!1;const pn=z.querySelector("editor");if(pn&&Oe(pn)===j&&pn.querySelector("a")===null){for(;pn.firstChild;)be.appendChild(pn.firstChild);pn.appendChild(be),tt=!0}try{if(!tt){const yt=F.extractContents();yt.childNodes.length>0&&(be.appendChild(yt),F.insertNode(be),tt=!0)}}catch{tt=!1}if(!tt&&Oe(z)===j){for(;z.firstChild;)be.appendChild(z.firstChild);z.appendChild(be),tt=!0}if(tt){try{const yt=document.createRange();yt.selectNodeContents(be),n(yt),G=yt,Gn.range=yt,Lt.range=yt}catch{}r(be,j)}}}const st=g.name==="textUnderline"&&!g.value;if((!Bt&&we||st)&&U(j),Z7.has(g.name)){const F=Gn.parentWrapper||z||d(j)||m();F&&U(j,F)}R&&ae.querySelectorAll(`tr td:first-child > div.${N}, tr td:first-child > editor div.${N}`).forEach(F=>{F.classList.remove(`${N}`)});const ks=d(j);ks?.hasAttribute("em-edit")||ks?.setAttribute("em-edit","active"),t()}}function J7(e,t){e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state");const[n]=t.parseFromString(t.HTMLDocument.getOuterHtml(e));e.after(n),t.commit()}function eH(e,t){e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state");const[n]=t.parseFromString(t.HTMLDocument.getOuterHtml(e));e.after(n),t.commit(),t.setCursorPosition(n)}function tH(e,t){if(!e.previousElementSibling)return!1;const n=e.previousElementSibling;return n.before(e),t.commit(),Z.send({operation:"application_scroll-to",settings:{value:t.scrollTop-n.getBoundingClientRect().height}}),!0}function nH(e,t){if(!e.nextElementSibling)return!1;const n=e.nextElementSibling;return n.after(e),t.commit(),Z.send({operation:"application_scroll-to",settings:{value:t.scrollTop+n.getBoundingClientRect().height}}),!0}function _E(e){e.innerHTML="",e.getAttribute("em")==="block"&&e.removeAttribute("em")}function rH(e,t){const n=e.closest("table");e.querySelector("[em-edit]")&&Z.send({operation:"application_element_settings_close"});const r=e.closest('[em="group"]');r&&n&&r.querySelectorAll('[em="block"]').length===1?_E(n):e.remove(),t.commit(),n&&t.setCursorPosition(n)}function oH(e,t){if(!t.emFilter)return;const n=document.querySelector('[em-edit="active"]')?.closest('[em="block"]');if(!n)return;const r=[...n.parentElement.children].indexOf(n),o=Po(n),i=parseFloat(o?.style.paddingTop??"")||0,s=parseFloat(o?.style.paddingBottom??"")||0;if(e.tagName==="TR"||e.tagName==="TABLE"){const a=e.querySelector("td"),l=t.emFilter({html:a.innerHTML,isPartial:!0}),c=[...e.parentNode.children].indexOf(e),u=Po(e),d=parseFloat(u?.style.paddingTop??"")||0,m=parseFloat(u?.style.paddingBottom??"")||0,p=parseFloat(u?.style.borderTopLeftRadius??"")||0,f=parseFloat(u?.style.borderTopRightRadius??"")||0,h=parseFloat(u?.style.borderBottomLeftRadius??"")||0,y=parseFloat(u?.style.borderBottomRightRadius??"")||0,E=n.querySelector("td");r>c?(qe(E,"afterbegin",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${i+m}"></td></tr></table>`),qe(E,"afterbegin",l),o&&(o.style.paddingTop=d+"px",o.style.borderTopLeftRadius=p+"px",o.style.borderTopRightRadius=f+"px",o.querySelector(":scope > .em-vindent-paddingTop")?.remove())):(qe(E,"beforeend",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${s+d}"></td></tr></table>`),qe(E,"beforeend",l),o&&(o.style.paddingBottom=m+"px",o.style.borderBottomLeftRadius=h+"px",o.style.borderBottomRightRadius=y+"px",o.querySelector(":scope > .em-vindent-paddingBottom")?.remove()))}else if(e.tagName==="DIV"){const a=t.emFilter({html:e.innerHTML,isPartial:!0}),l=Array.prototype.indexOf.call(e.parentElement.children,e);qe(n,r>l?"afterbegin":"beforeend",a)}e.remove(),document.querySelector(".em-element-editor-widget-merge")?.remove(),t.commit(),t.setCursorPosition(n)}function iH(e,t){const n=Po(e),r=parseFloat(n?.style.paddingTop)||0,o=parseFloat(n?.style.paddingBottom)||0,i=parseFloat(n?.style.borderTopLeftRadius)||0,s=parseFloat(n?.style.borderTopRightRadius)||0,a=parseFloat(n?.style.borderBottomLeftRadius)||0,l=parseFloat(n?.style.borderBottomRightRadius)||0,c=n?.querySelectorAll(':scope > table:not([em="atom"])')??[],u=c.length;c.forEach((d,m)=>{const p=e.cloneNode(!0),f=Po(p);f.style.paddingTop="0",f.style.paddingBottom="0",f.style.borderRadius="0",Qn(f,d.outerHTML),m===0?(f.style.paddingTop=r+"px",f.style.borderTopLeftRadius=i+"px",f.style.borderTopRightRadius=s+"px"):m===u-1&&(f.style.paddingBottom=o+"px",f.style.borderBottomLeftRadius=a+"px",f.style.borderBottomRightRadius=l+"px");const h=d.nextElementSibling;if(h?.getAttribute("em")==="atom"&&h.querySelector("td")?.hasAttribute("height")){const E=parseFloat(h.querySelector("td").getAttribute("height"))/2;f.style.paddingBottom=E+"px"}const y=d.previousElementSibling;if(y?.getAttribute("em")==="atom"&&y.querySelector("td")?.hasAttribute("height")){const E=parseFloat(y.querySelector("td").getAttribute("height"))/2;f.style.paddingTop=E+"px"}e.insertAdjacentElement("beforebegin",p)}),e.remove(),t.commit()}function sH(e,t){return e.previousElementSibling?(e.previousElementSibling.before(e),t.commit(),!0):!1}function aH(e,t){return e.nextElementSibling?(e.nextElementSibling.after(e),t.commit(),!0):!1}function lH(e,t){const n=document.querySelector('[em="group"]')?.cloneNode(!0);if(!n)return;const r=n.querySelector("table");r&&_E(r),e.after(n),t.commit(),Z.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+n.getBoundingClientRect().height+(t.iframeOffsetTop||0)}})}function cH(e,t){e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state");const[n]=t.parseFromString(t.HTMLDocument.getOuterHtml(e));e.after(n),t.commit(),t.setCursorPosition(n)}function uH(e,t){e.querySelector("[em-edit]")&&Z.send({operation:"application_element_settings_close"}),e.remove(),t.commit()}function dH(e){return e.classList.contains("add-empty-block")?"empty":e.classList.contains("add-saved-block")?"project":e.classList.contains("add-common-block")?"common":e.classList.contains("add-template-block")?"template":e.classList.contains("add-search-block")?"search":""}function mH(e){const t=e.closest("i");return t?t.classList.contains("add-empty-block")||t.classList.contains("add-saved-block")||t.classList.contains("add-common-block")||t.classList.contains("add-template-block")||t.classList.contains("add-search-block"):!1}function fH(e,t,n){const r=t.closest("i");if(!r)return;n.removeAllAttributes("em-edit");const o=t.closest('[em="block"]');if(!o)return;o.tagName==="TR"?o.querySelector("TD")?.setAttribute("em-edit","active"):o.setAttribute("em-edit","active");const i={operation:"application_element_settings_set",type:"emptyTable",tab:dH(r)};try{n.state.increment("activeElementLocked"),Z.send(i)}finally{n.commitLockedAsync(!1).finally(()=>{n.state.decrement("activeElementLocked")})}}function pH(e,t,n){const r=t.parentNode;r&&(r.style.backgroundColor="rgba(0,255,0,0.3)");let o="";document.head.querySelectorAll("style").forEach(a=>{o+=n.HTMLDocument.getInnerHtml(a)});const i=document.createElement("style");i.setAttribute("em","styles"),i.innerHTML=o;const s=Va(i)+`
184
+ `+n.HTMLDocument.getOuterHtml(e);navigator.clipboard.writeText(s),setTimeout(()=>{r&&r.style.removeProperty("background-color")},2e3)}function hH(e,t,n){navigator.clipboard.readText().then(r=>{const o=n.parseFromString(r);let i=o.filter(c=>c.tagName&&c.tagName!=="LINK"&&c.tagName!=="STYLE").map(c=>n.getOuterHtml(c)).join(""),s=o.filter(c=>c.tagName==="STYLE").map(c=>n.getOuterHtml(c)).join("");const a=o.filter(c=>c.tagName==="LINK"&&c.getAttribute("em-class")).filter(c=>!document.head?.querySelector(`link[em-class="${c.getAttribute("em-class")}"]`));if(s){let c=document.head.querySelector('style[em="styles"]'),u="";c?u=n.HTMLDocument.getInnerHtml(c):(c=document.createElement("style"),c.setAttribute("em","styles"),c=document.head.insertAdjacentElement("beforeend",c));const d=document.createElement("div");n.emailWidth&&(s=s.replace(/(max-device-width:|max-width:)\d+px/g,p=>p.replace(/\d+/,String(n.emailWidth)))),n.insertAdjacentHTML(d,"afterbegin",s);let m=n.minify(u+`
185
+ `+[...d.querySelectorAll("style")].map(p=>p.innerHTML).join(`
186
+ `),{restructure:!0,forceMediaMerge:!0}).css;m=n.cssbeautify(m,{indent:" ",autosemicolon:!0}),c.textContent=`
187
+ `+m+`
188
+ `}for(const c of a.reverse())document.head?.prepend(c),document.head?.insertAdjacentHTML("afterbegin",`
189
+ `);(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:e}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:e,project:n.appName})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"});const l=t.parentNode;if(e.tagName==="TR"){const c=document.createElement("table");n.insertAdjacentHTML(c,"afterbegin",i),c.querySelector('[em="block"]')?(c.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),e.after(c.querySelector("tr")),n.commit(),n.setCursorPosition(e)):kE(l)}else{const c=document.createElement("div");n.insertAdjacentHTML(c,"afterbegin",i),c.querySelector('[em="block"]')?(c.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),e.after(c.querySelector('[em="block"]')),n.commit(),n.setCursorPosition(e)):kE(l)}}).catch(()=>{})}function kE(e){e&&(e.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(()=>{e.style.removeProperty("background-color")},2e3))}function gH(){return document.body?.classList.contains("em-sandbox-discuss")&&!document.body.classList.contains("em-sandbox-discuss_set-target")}function bH(){return document.body?.classList.contains("em-sandbox-discuss_set-target")??!1}function yH(e){const t=e.getAttribute("em-discuss-id");return t&&Z.send({operation:"application_discuss_get_comment",settings:{targetId:t}}),!1}function vH(e,t){let n=e;const r=n.getAttribute("em-discuss-id"),o=n.classList.contains("em-discuss-id-new");if(!r||r&&o){if(document.querySelectorAll(".em-discuss-id-new").forEach(i=>{i!==n&&(i.removeAttribute("em-discuss-id"),i.removeAttribute("contenteditable"),i.removeAttribute("em-edit"))}),n.tagName==="EDITOR"&&(n=n.parentElement),n.getAttribute("em-discuss-id"))n.removeAttribute("em-discuss-id"),n.removeAttribute("contenteditable"),n.removeAttribute("em-edit"),Z.send({operation:"application_discuss_set_id",settings:{value:""}});else{const i=t.makeId(5);n.setAttribute("em-discuss-id",i),n.setAttribute("em-edit","active"),n.setAttribute("contenteditable","true"),n.classList.add("em-discuss-id-new"),Z.send({operation:"application_discuss_set_id",settings:{value:i}})}t.commit()}return{handled:!0,newClickedElement:n}}function Il(e){e.nodeName==="#comment"&&e.textContent?.indexOf("mso")!==-1?e.remove():e.previousSibling&&Il(e.previousSibling)}function hs(e){if(!e)return;if(e.parentElement?.tagName==="SECTION"||e.classList.contains("em-narrow-table")&&Array.from(e.childNodes).every(n=>n.nodeType===Node.TEXT_NODE)){e.innerHTML="";return}e.querySelectorAll(".em-element-editor").forEach(n=>n.remove()),e.querySelectorAll(".em-element-path").forEach(n=>n.remove()),e.querySelectorAll(".em-element-block-add").forEach(n=>n.remove()),e.querySelectorAll(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft").forEach(n=>n.remove());const t=e.parentElement;if(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))e.innerHTML.trim()===""&&(e.parentElement.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1?e.innerHTML="":(e.remove(),hs(t)));else if(e.innerHTML.trim()==="")Il(e),e.remove(),hs(t);else if(t&&!t.querySelector('div[style*="display"]')){for(const n of Array.from(e.childNodes))n.nodeName==="#text"&&n.textContent?.trim()===""?(Il(n),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(Il(n),n.remove());e.innerHTML.trim()===""&&hs(e)}}function EH(e,t){const n=e;if(!n||n.closest("editor")||n.firstElementChild?.tagName==="EDITOR")return!1;const r=t.getElementParent(n);let o=n.parentNode;if(r&&t.setCursorPosition(r),n.classList.contains("em-code")){const i=t.getVariableByIcon(n);i&&(i.parentNode?.removeChild(i),n.remove())}else if(n.tagName==="TD"&&n.innerHTML===""&&n.hasAttribute("height")){const i=n.closest("table");if(i){const s=i.previousSibling;s&&s?.textContent?.trim()===""&&s.remove(),i.remove()}}else if(n.closest(".em-element-resize-img-container"))o=n.closest(".em-element-resize-img-container").parentNode,n.closest(".em-element-resize-img-container").remove();else if(n.closest('[em="atom"]')){const i=n.closest('[em="atom"]');o=i.parentNode;const s=n.closest(".em-mob-wrap, .noresp-em-mob-wrap");n.tagName==="TD"&&!n.previousElementSibling&&!n.nextElementSibling?i.remove():n.remove();const a=!!s&&Array.from(s.querySelectorAll('[em="atom"]')).some(l=>l!==i);n.tagName!=="TD"&&!a&&s?.textContent?.trim()===""&&(s.textContent="")}else{n.remove();const i=n.previousSibling;i&&i?.textContent?.trim()===""&&i.remove()}return hs(o),t.commit(),Z.send({operation:"application_element_settings_close"}),!0}function SH(e){return function(n){document.body&&!document.body.classList.contains("mceNonEditable")&&(n.stopPropagation(),n.preventDefault()),e.setEditorFocus(!1);const r=n.target;if(document.documentElement.classList.contains("em-resize-start")||r.classList.contains("em-element-editor-widget")||r.classList.contains("em-element-block-add"))return;let o=r;if(!e.getLockEditor()){const h=o.closest(".em-narrow-table");if(h&&(cn(h)||!h.innerHTML.trim())&&e.insertTextAtomIntoEmptyNarrowTable(h))return}const i=o.closest("a");if(i instanceof HTMLAnchorElement){const h=i.getAttribute("href")||i.href||"";if(ds(h)){const y=h.slice(1),E=document.querySelector(`a[name="${y}"]`);E&&(n.preventDefault(),E.scrollIntoView({behavior:"smooth",block:"start"}))}else i.href&&document.referrer.includes("raw")&&window.open(i.href);n.stopPropagation(),n.preventDefault()}if(o.tagName==="HTML"||o.classList.contains(je.drag)||o.classList.contains("em-element-editor"))return;const s=document.body,a=s?.classList.contains("mceNonEditable"),l=s?.classList.contains("em-sandbox-discuss"),c=document.referrer.includes("raw"),u=o.tagName==="A"||o.closest("a")||o.tagName==="IMG";if(a&&!l&&(!c||!u)){e.setCursorPosition(o);return}if(e.isDiscussViewMode()){e.handleDiscussViewClick(o);return}if(e.isDiscussSetTargetMode()){o=e.handleDiscussSetTargetClick(o).newClickedElement;return}o instanceof Element&&o.tagName==="EDITOR"&&(o=o.parentElement);const d=o.closest('[em="atom"]');if(d&&o.closest(".em-element-editor-widget-remove")){e.handleRemoveAtom(d);return}if(d&&o.closest(".em-element-editor-widget-edit")){e.applicationElementSettingsSet({elem:d}),e.setCursorPosition(d);return}if(d&&o.closest(".em-element-editor-widget-clone")){e.handleCloneAtom(d);return}const m=o.closest('[em="block"]');if(m&&o.classList.contains(je.moveUp)){e.handleMoveBlockUp(m);return}if(m&&o.classList.contains(je.moveDown)){e.handleMoveBlockDown(m);return}if(m&&o.closest(".em-element-editor-widget-edit")){const h=m.querySelector("td");h&&e.applicationElementSettingsSet({elem:h}),e.setCursorPosition(m);return}if(m&&o.closest(".em-element-editor-widget-remove")){e.handleRemoveBlock(m);return}if(m&&o.closest(".em-element-editor-widget-add-block")){e.addBlockToProject(o);return}if(m&&o.closest(".em-element-editor-widget-clone")){e.handleCloneBlock(m);return}if(m&&e.isAddBlockMenuClick(o)){e.handleAddBlockMenu(m,o);return}if(m&&o.closest(".em-element-editor-widget-copy")){e.handleCopyBlock(m,o);return}if(m&&o.closest(".em-element-editor-widget-paste")){e.handlePasteBlock(m,o);return}if(m&&o.classList.contains(je.merge)){e.handleMergeBlocks(m);return}if(m&&o.classList.contains(je.unmerge)){e.handleUnmergeBlocks(m);return}const p=o.closest('[em="group"]');if(p&&o.classList.contains(je.moveUp)){e.handleMoveGroupUp(p);return}if(p&&o.classList.contains(je.moveDown)){e.handleMoveGroupDown(p);return}if(p&&o.classList.contains(je.add)){e.handleAddGroup(p);return}if(p&&o.closest(".em-element-editor-widget-edit")){e.setCursorPosition(p);const h=p.tagName!=="TR"?p:p.querySelector("td");h&&e.applicationElementSettingsSet({elem:h});return}if(p&&o.closest(".em-element-editor-widget-clone")){e.handleCloneGroup(p);return}if(p&&o.closest(".em-element-editor-widget-remove")&&o.closest(".of-group")){e.handleRemoveGroup(p);return}if(!o.closest(".em-editor-wrapper")&&!o.closest(".em-element-path")&&!o.closest(".em-element-vindent-remove")){const h=window.getSelection();if(h?.isCollapsed)e.setCursorPosition(o);else if(h&&h.rangeCount>0){const E=h.getRangeAt(0).commonAncestorContainer,C=e.findOutermostParentWithText(E);C&&e.setCursorPosition(C);const k=e.getParentElementOfSelection();k&&(o=k)}e.applicationElementSettingsSet({elem:o});const y=document.querySelector(".em-editor-wrapper");y&&(y.style.display="none"),e.setBlockGroupControlsPosition()}const f=o?.tagName==="TD"?o?.querySelector("div"):o?.closest("div")||o;o.closest(".em-element-custom-table")&&f?.tagName==="DIV"&&e.handleCustomTableClick(o,n)}}function wH(e){const t=r=>{r.target?.closest(".em-element-editor-widget-clone")||(document.querySelectorAll('.em-element-editor-widget-clone[data-open="true"]').forEach(o=>{o.setAttribute("data-open","false");const i=o.querySelector("ul");i&&(i.style.display="none")}),yl(o=>{e.commit(o)}))},n=()=>{e.messageService.send({operation:"application_focus_in_iframe"})};return document.addEventListener("click",t),document.addEventListener("click",n),{dispose(){document.removeEventListener("click",t),document.removeEventListener("click",n)}}}function LE(e,t,n,r=!0){const o=document.querySelector(e);if(!o)return;const i=o.closest("td");if(!i)return;const s=i.parentElement;if(!s)return;const a=Array.from(s.cells),l=a.indexOf(i);let c=0,u=1;for(;c<t;){let d;if(r?d=l+u:d=l-u,d<0||d>=a.length)break;a[d].classList.add(n),c++,u++}}function NE(e,t,n,r=!0){const o=document.querySelector(e);if(!o)return;const i=o.closest("td");if(!i)return;const s=i.parentElement;if(!s||s.tagName!=="TR")return;const a=s.closest("table");if(!a)return;const l=Array.from(a.rows),c=l.indexOf(s);if(c===-1)return;const u=[],d=Math.max(...l.map(E=>Array.from(E.cells).reduce((C,k)=>C+(k.colSpan||1),0))),m=new Map;for(let E=0;E<l.length;E++){u[E]=[];let C=0;const k=Array.from(l[E].cells);for(const w of k){for(;m.has(`${E}:${C}`);){const A=m.get(`${E}:${C}`);u[E][C]=A.cell,C++}const b=w.colSpan||1,v=w.rowSpan||1;for(let A=0;A<b&&C<d;A++){u[E][C+A]=w;for(let g=0;g<v;g++)if(E+g<l.length){const S=`${E+g}:${C+A}`;m.set(S,{cell:w,rowSpan:v,colSpan:b,startRow:E})}}C+=b}for(;C<d;){if(m.has(`${E}:${C}`)){const w=m.get(`${E}:${C}`);u[E][C]=w.cell}else u[E][C]=null;C++}}let p=-1;for(let E=0;E<u[c].length;E++)if(u[c][E]===i){p=E;break}if(p===-1)return;let f=0,h=1;const y=new Set;for(;f<t;){const E=r?c+h:c-h;if(E<0||E>=l.length)break;const C=u[E][p];if(!C){h++;continue}const k=`${E}:${p}`,w=m.get(k);if(C.tagName!=="TD"){h++;continue}if(y.has(C)){h++;continue}if(w&&w.startRow!==E){h++;continue}C.classList.add(n),y.add(C),f++,h++}}var xE=`
190
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
191
+ <path d="M2.21128 13.375C1.83241 13.375 1.51172 13.2438 1.24922 12.9813C0.986719 12.7188 0.855469 12.3981 0.855469 12.0192V1.98081C0.855469 1.60194 0.986719 1.28125 1.24922 1.01875C1.51172 0.75625 1.83241 0.625 2.21128 0.625H4.74966C5.12853 0.625 5.44922 0.75625 5.71172 1.01875C5.97422 1.28125 6.10547 1.60194 6.10547 1.98081V12.0192C6.10547 12.3981 5.97422 12.7188 5.71172 12.9813C5.44922 13.2438 5.12853 13.375 4.74966 13.375H2.21128ZM9.24966 13.375C8.87078 13.375 8.55009 13.2438 8.28759 12.9813C8.02509 12.7188 7.89384 12.3981 7.89384 12.0192V1.98081C7.89384 1.60194 8.02509 1.28125 8.28759 1.01875C8.55009 0.75625 8.87078 0.625 9.24966 0.625H11.788C12.1669 0.625 12.4876 0.75625 12.7501 1.01875C13.0126 1.28125 13.1438 1.60194 13.1438 1.98081V12.0192C13.1438 12.3981 13.0126 12.7188 12.7501 12.9813C12.4876 13.2438 12.1669 13.375 11.788 13.375H9.24966ZM12.0188 1.98081C12.0188 1.92306 11.9948 1.87019 11.9467 1.82219C11.8987 1.77406 11.8458 1.75 11.788 1.75H9.24966C9.19191 1.75 9.13903 1.77406 9.09103 1.82219C9.04291 1.87019 9.01884 1.92306 9.01884 1.98081V12.0192C9.01884 12.0769 9.04291 12.1298 9.09103 12.1778C9.13903 12.2259 9.19191 12.25 9.24966 12.25H11.788C11.8458 12.25 11.8987 12.2259 11.9467 12.1778C11.9948 12.1298 12.0188 12.0769 12.0188 12.0192V1.98081Z" fill="#344966"/>
192
+ </svg>
193
+ `,ME=`
194
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
195
+ <path d="M1.98081 13.1442C1.60194 13.1442 1.28125 13.013 1.01875 12.7505C0.75625 12.488 0.625 12.1673 0.625 11.7884V9.25002C0.625 8.87115 0.75625 8.55046 1.01875 8.28796C1.28125 8.02546 1.60194 7.89421 1.98081 7.89421H12.0192C12.3981 7.89421 12.7188 8.02546 12.9813 8.28796C13.2438 8.55046 13.375 8.87115 13.375 9.25002V11.7884C13.375 12.1673 13.2438 12.488 12.9813 12.7505C12.7188 13.013 12.3981 13.1442 12.0192 13.1442H1.98081ZM1.98081 6.10583C1.60194 6.10583 1.28125 5.97459 1.01875 5.71209C0.75625 5.44958 0.625 5.1289 0.625 4.75002V2.21165C0.625 1.83277 0.75625 1.51208 1.01875 1.24958C1.28125 0.987085 1.60194 0.855835 1.98081 0.855835H12.0192C12.3981 0.855835 12.7188 0.987085 12.9813 1.24958C13.2438 1.51208 13.375 1.83277 13.375 2.21165V4.75002C13.375 5.1289 13.2438 5.44958 12.9813 5.71209C12.7188 5.97459 12.3981 6.10583 12.0192 6.10583H1.98081ZM12.0192 1.98083H1.98081C1.92306 1.98083 1.87019 2.0049 1.82219 2.05302C1.77406 2.10102 1.75 2.1539 1.75 2.21165V4.75002C1.75 4.80777 1.77406 4.86065 1.82219 4.90865C1.87019 4.95677 1.92306 4.98083 1.98081 4.98083H12.0192C12.0769 4.98083 12.1298 4.95677 12.1778 4.90865C12.2259 4.86065 12.25 4.80777 12.25 4.75002V2.21165C12.25 2.1539 12.2259 2.10102 12.1778 2.05302C12.1298 2.0049 12.0769 1.98083 12.0192 1.98083Z" fill="#344966"/>
196
+ </svg>
197
+ `,CH=`
198
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(-90deg); display: inline-block;">
199
+ <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
200
+ </svg>
201
+ `,AH=`
202
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(90deg); display: inline-block;">
203
+ <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
204
+ </svg>
205
+ `,TH=`
206
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(-90deg); display: inline-block;">
207
+ <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
208
+ <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
209
+ <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
210
+ </svg>
211
+ `,_H=`
212
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
213
+ <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
214
+ </svg>
215
+ `,kH=`
216
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(180deg); display: inline-block;">
217
+ <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
218
+ </svg>
219
+ `,LH=`
220
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(90deg); display: inline-block;">
221
+ <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
222
+ <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
223
+ <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
224
+ </svg>
225
+ `,NH=`
226
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
227
+ <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
228
+ <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
229
+ <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
230
+ </svg>
231
+ `,xH=`
232
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(180deg); display: inline-block;">
233
+ <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
234
+ <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
235
+ <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
236
+ </svg>
237
+ `,MH=`
238
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
239
+ <path d="M3 9H3.00666M5.99833 9H6.005M11.995 9H12.0017M8.99667 9H9.00333M14.9933 9H15M14.9933 15V14.4667C14.9933 13.7199 14.9933 13.3465 14.8481 13.0613C14.7204 12.8105 14.5165 12.6065 14.2657 12.4787C13.9807 12.3333 13.6075 12.3333 12.8612 12.3333H5.13215C4.38583 12.3333 4.01266 12.3333 3.72761 12.4787C3.47687 12.6065 3.273 12.8105 3.14525 13.0613C3 13.3465 3 13.7199 3 14.4667V15M14.9933 3V3.53333C14.9933 4.28007 14.9933 4.65344 14.8481 4.93865C14.7204 5.18954 14.5165 5.39351 14.2657 5.52134C13.9807 5.66667 13.6075 5.66667 12.8612 5.66667H5.13215C4.38583 5.66667 4.01266 5.66667 3.72761 5.52134C3.47686 5.39351 3.273 5.18954 3.14525 4.93865C3 4.65344 3 4.28007 3 3.53333V3" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
240
+ </svg>
241
+ `,RH=`
242
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(90deg); display: inline-block;">
243
+ <path d="M3 9H3.00666M5.99833 9H6.005M11.995 9H12.0017M8.99667 9H9.00333M14.9933 9H15M14.9933 15V14.4667C14.9933 13.7199 14.9933 13.3465 14.8481 13.0613C14.7204 12.8105 14.5165 12.6065 14.2657 12.4787C13.9807 12.3333 13.6075 12.3333 12.8612 12.3333H5.13215C4.38583 12.3333 4.01266 12.3333 3.72761 12.4787C3.47687 12.6065 3.273 12.8105 3.14525 13.0613C3 13.3465 3 13.7199 3 14.4667V15M14.9933 3V3.53333C14.9933 4.28007 14.9933 4.65344 14.8481 4.93865C14.7204 5.18954 14.5165 5.39351 14.2657 5.52134C13.9807 5.66667 13.6075 5.66667 12.8612 5.66667H5.13215C4.38583 5.66667 4.01266 5.66667 3.72761 5.52134C3.47686 5.39351 3.273 5.18954 3.14525 4.93865C3 4.65344 3 4.28007 3 3.53333V3" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
244
+ </svg>
245
+ `,RE=`
246
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
247
+ <path d="M7 3H11M3 5H15M13.6667 5L13.1991 12.0129C13.129 13.065 13.0939 13.5911 12.8667 13.99C12.6666 14.3412 12.3648 14.6235 12.0011 14.7998C11.588 15 11.0607 15 10.0062 15H7.9938C6.93927 15 6.41202 15 5.99889 14.7998C5.63517 14.6235 5.33339 14.3412 5.13332 13.99C4.90607 13.5911 4.871 13.065 4.80086 12.0129L4.33333 5" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
248
+ </svg>
249
+ `;function OH(e,t,n,r){const o=document.querySelector(".table-menu"),i=o?.closest("table");if(!i)return;const s=i?.querySelector(`.${se}`),a=es(i),{row:l}=dm(a,se),{row:c,isOverlapped:u}=i1(a,se),{isOverlapped:d}=s1(a,se);if(!i||!s)return;const m={addBottomRow:o.querySelector('[data-id="add-bottom-row"]'),addTopRow:o.querySelector('[data-id="add-top-row"]'),removeRow:o.querySelector('[data-id="remove-row"]'),mergeTopCell:o.querySelector('[data-id="merge-top-cell"]'),mergeBottomCell:o.querySelector('[data-id="merge-bottom-cell"]'),splitHorizontalCell:o.querySelector('[data-id="split-horizontal-cell"]'),addLeftColumn:o.querySelector('[data-id="add-left-column"]'),addRightColumn:o.querySelector('[data-id="add-right-column"]'),mergeRightCell:o.querySelector('[data-id="merge-right-cell"]'),mergeLeftCell:o.querySelector('[data-id="merge-left-cell"]'),splitVerticalCell:o.querySelector('[data-id="split-vertical-cell"]'),removeColumn:o.querySelector('[data-id="remove-column"]')};m.addBottomRow&&(m.addBottomRow.style.display="block"),m.addTopRow&&(m.addTopRow.style.display="block"),m.removeRow&&(m.removeRow.style.display="block"),m.mergeTopCell&&(m.mergeTopCell.style.display="block"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="block"),m.splitHorizontalCell&&(m.splitHorizontalCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="block"),m.addRightColumn&&(m.addRightColumn.style.display="block"),m.mergeRightCell&&(m.mergeRightCell.style.display="block"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="block"),m.splitVerticalCell&&(m.splitVerticalCell.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="block"),s.getAttribute("rowspan")&&m.splitHorizontalCell&&(m.splitHorizontalCell.style.display="block"),s.getAttribute("colspan")&&m.splitVerticalCell&&(m.splitVerticalCell.style.display="block"),e&&(m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addTopRow&&(m.addTopRow.style.display="none"),m.addBottomRow&&(m.addBottomRow.style.display="none"),m.removeRow&&(m.removeRow.style.display="none")),t&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addTopRow&&(m.addTopRow.style.display="none"),m.addBottomRow&&(m.addBottomRow.style.display="none"),m.removeRow&&(m.removeRow.style.display="none")),n&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="none"),m.addRightColumn&&(m.addRightColumn.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="none")),r&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="none"),m.addRightColumn&&(m.addRightColumn.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="none")),d&&m.removeColumn&&(m.removeColumn.style.display="none"),u&&c===l&&m.removeRow&&(m.removeRow.style.display="none"),s.getAttribute("colspan")&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none")),s.getAttribute("rowspan")&&(m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"))}var PH={INSERT_COLUMN_BEFORE_TABLE:"Insert column before",INSERT_COLUMN_AFTER_TABLE:"Insert column after",MERGE_RIGHT_CELL_TABLE:"Merge right",MERGE_LEFT_CELL_TABLE:"Merge left",SPLIT_CELL_TABLE:"Split cell",REMOVE_COLUMN_TABLE:"Remove column",INSERT_ROW_BEFORE_TABLE:"Insert row before",INSERT_ROW_AFTER_TABLE:"Insert row after",MERGE_TOP_CELL_TABLE:"Merge top",MERGE_BOTTOM_CELL_TABLE:"Merge bottom",REMOVE_ROW_TABLE:"Remove row",EDIT_ATOM:"Edit"},Dt=()=>window.Locale||PH;function IH(e,t){e.forEach(n=>{t.querySelectorAll(`.${n}`).forEach(r=>r.classList.remove(n))})}function DH(e,t){const n=e?.tagName==="TD"?e?.querySelector("div"):e?.closest("div")?e?.closest("div"):e;if(!e.closest(".em-element-custom-table")||n?.tagName!=="DIV")return!1;document.querySelectorAll(`.${Ue}`).forEach(E=>{E.classList.remove(Ue)});const r=[wy,se];let o=!1,i=!1;const s=n,a=document.querySelector(`.${se}`),l=document.querySelector(".table-menu");a&&a.classList.remove(se),l&&l.remove();const c=s.closest(".em-element-custom-table"),u=c.closest('[em="block"]'),d=I({targetElement:c,insertType:"append",className:"of-atom table-menu",style:"width: 48px; height: 28px; display: flex; position: absolute; right: 0; top: -30px; background: #FFDCC7; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); pointer-events: auto; z-index: 1001;"});let m=!1,p=1;const f=()=>({isDirectionUP:x.get("isDirectionUP"),isDirectionDOWN:x.get("isDirectionDOWN"),isDirectionLEFT:x.get("isDirectionLEFT"),isDirectionRIGHT:x.get("isDirectionRIGHT"),actualTargetCount:x.get("actualTargetCount")});c.addEventListener("mousedown",E=>{const C=E.target.tagName.toUpperCase();if(E.button===0&&C!=="UL"&&C!=="LI"&&C!=="SVG"&&C!=="PATH"&&C!=="CIRCLE"){m=!0;const k=c.querySelector(`.${se}`);document.querySelectorAll(`.${oe}`)?.forEach(w=>{w.classList.remove(oe),k?.classList.remove(se)})}}),c.addEventListener("mouseup",E=>{m=!1,E.target.closest("td")?.classList.contains("remove-basic-cell")&&x.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1})}),c.addEventListener("mouseover",E=>{const C=c.querySelector(`.${se}`);p=c.querySelectorAll(`.${oe}`).length,p=p===0?1:p;const k=E.target;if(m&&k.closest("TD")&&C){const w=k.closest("TD");c.querySelectorAll(`.${An}`).forEach(j=>j.classList.remove(An)),p===1&&c.querySelectorAll(`.${oe}`).forEach(j=>j.classList.remove(oe)),w.classList.add(An);const b=w.closest(".em-element-custom-table");if(!b)return;let v=es(b);const A=dm(v,se);if(!A)return;const{row:g,col:S}=A,{row:T,col:_,isOverlapped:M}=i1(v,se),{row:N,col:W,isOverlapped:P}=s1(v,se);!o&&!i&&p===1&&!(M||P)&&(b.querySelectorAll(`.${oe}`).forEach(j=>j.classList.remove(oe)),w.classList.add(oe));const R=dm(v,An);if(!R)return;const{row:Y,col:V}=R;if(b.querySelectorAll(`.${An}`).forEach(j=>j.classList.remove(An)),g!==Y&&S!==V){b.querySelectorAll(`.${oe}`).forEach(j=>j.classList.remove(oe)),o=!1,i=!1;return}const{isDirectionUP:G,isDirectionDOWN:Le,isDirectionLEFT:ae,isDirectionRIGHT:ne}=f();if(!o&&!i&&!w.classList.contains("remove-basic-cell")&&(x.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),g===Y?(o=!0,i=!1,S>V&&x.set("isDirectionLEFT",!0),S<V&&x.set("isDirectionRIGHT",!0)):S===V&&(i=!0,o=!1,g>Y&&x.set("isDirectionUP",!0),g<Y&&x.set("isDirectionDOWN",!0))),g===Y&&(Le||G)||S===V&&(ne||ae)||S===V&&g===Y){x.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),o=!1,i=!1;return}if(M&&_!==null){const{isDirectionRIGHT:j,isDirectionLEFT:z}=f();if(j&&_-V<=0&&_>S){b.querySelectorAll(`.${oe}`).forEach(Se=>Se.classList.remove(oe));return}if(z&&V-_<=0&&_<S){b.querySelectorAll(`.${oe}`).forEach(Se=>Se.classList.remove(oe));return}}if(P&&N!==null){const{isDirectionDOWN:j,isDirectionUP:z}=f();if(j&&N-Y<=0&&N>g){b.querySelectorAll(`.${oe}`).forEach(Se=>Se.classList.remove(oe));return}if(z&&Y-N<=0&&N<g){b.querySelectorAll(`.${oe}`).forEach(Se=>Se.classList.remove(oe));return}}if(g===Y&&o){i=!1;const{isDirectionRIGHT:j,isDirectionLEFT:z}=f();if(j){const Se=V-S;if(x.set("actualTargetCount",El(v,Y,V,g,S,!0)),Se<0){x.set("isDirectionRIGHT",!1),o=!1,i=!1;return}b.querySelectorAll(`.${oe}`).forEach(Ae=>Ae.classList.remove(oe)),LE(`.${se}`,x.get("actualTargetCount"),oe,!0)}if(z){const Se=S-V;if(x.set("actualTargetCount",El(v,g,S,Y,V,!0)),Se<0){x.set("isDirectionLEFT",!1),o=!1,i=!1;return}b.querySelectorAll(`.${oe}`).forEach(Ae=>Ae.classList.remove(oe)),LE(`.${se}`,x.get("actualTargetCount"),oe,!1)}b.querySelectorAll(`.${An}`).forEach(Se=>Se.classList.remove(An))}if(S===V&&i){o=!1;const{isDirectionDOWN:j,isDirectionUP:z}=f();if(j){const Se=Y-g;if(x.set("actualTargetCount",El(v,Y,V,g,S,!1)),Se<0){x.set("isDirectionDOWN",!1),o=!1,i=!1;return}b.querySelectorAll(`.${oe}`).forEach(Ae=>Ae.classList.remove(oe)),NE(`.${se}`,x.get("actualTargetCount"),oe,!0)}if(z){const Se=g-Y;x.set("actualTargetCount",El(v,g,S,Y,V,!1)),Se<0&&(x.set("isDirectionUP",!1),o=!1,i=!1),b.querySelectorAll(`.${oe}`).forEach(Ae=>Ae.classList.remove(oe)),NE(`.${se}`,x.get("actualTargetCount"),oe,!1)}b.querySelectorAll(`.${An}`).forEach(Se=>Se.classList.remove(An))}const we=b.querySelectorAll(`.${oe}`);w.classList.contains("remove-basic-cell")&&we?.length>1&&(we?.forEach(j=>{j.classList.remove(oe)}),o=!1,i=!1)}}),BH(d,c,u,t,r);const h=s.closest("td");h.classList.add(se);function y(E){const C=E.target;!u.contains(C)&&!d.contains(C)&&(d.remove(),h&&(document.querySelectorAll(`.${oe}`)?.forEach(k=>{k.classList.remove(oe)}),document.querySelectorAll(`.${Ue}`).forEach(k=>{k.classList.remove(Ue)}),h.classList.remove(se)),document.removeEventListener("click",y))}return document.addEventListener("click",y),!0}function BH(e,t,n,r,o){const i=OH;function s(E){const C=E.querySelector("ul"),k=E.getAttribute("data-open")==="true",w=r.target.closest("td")?.classList.contains(se),b=t.querySelectorAll(`.${oe}`);w&&b?.length===0&&x.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1});const{isDirectionUP:v,isDirectionDOWN:A,isDirectionLEFT:g,isDirectionRIGHT:S}={isDirectionUP:x.get("isDirectionUP"),isDirectionDOWN:x.get("isDirectionDOWN"),isDirectionLEFT:x.get("isDirectionLEFT"),isDirectionRIGHT:x.get("isDirectionRIGHT")};i(v,A,g,S),e.querySelectorAll("[data-open]").forEach(T=>{T!==E&&T.getAttribute("data-open")==="true"&&(T.setAttribute("data-open","false"),T.querySelector("ul").style.display="none")}),k||(E.setAttribute("data-open","true"),C.style.display="block")}function a(E){const C=E.querySelector("ul");E.getAttribute("data-open")==="true"&&(E.setAttribute("data-open","false"),C.style.display="none")}function l(E){E.stopPropagation(),E.preventDefault();const C=E.target,k=C.closest("li"),w=k?.getAttribute("data-id"),b=k?.closest("tr"),v=k?.closest("td");b?.classList.add(wy),v?.classList.add(se);const A=C.closest("table");if(!k||!A)return;const g=es(A),S=A.querySelectorAll(`.${oe}`).length;switch(w){case"add-bottom-row":{const N=t1(g,se,!1);A.innerHTML=It(N);break}case"add-top-row":{const N=t1(g,se,!0);A.innerHTML=It(N);break}case"remove-row":{const N=KI(g,se);A.innerHTML=It(N);break}case"merge-top-cell":{const N=S===0?o1(g,se,!0,S+1):l1(g,se,oe);A.innerHTML=It(N);break}case"merge-bottom-cell":{const N=S===0?o1(g,se,!1,S+1):l1(g,se,oe);A.innerHTML=It(N);break}case"split-horizontal-cell":{const N=JI(g,se);A.innerHTML=It(N);break}case"add-left-column":{const N=n1(g,se,!0);A.innerHTML=It(N);break}case"add-right-column":{const N=n1(g,se,!1);A.innerHTML=It(N);break}case"merge-right-cell":{const N=S===0?r1(g,se,!1,S+1):a1(g,se,oe);A.innerHTML=It(N);break}case"merge-left-cell":{const N=S===0?r1(g,se,!0,S+1):a1(g,se,oe);A.innerHTML=It(N);break}case"split-vertical-cell":{const N=QI(g,se);A.innerHTML=It(N);break}case"remove-column":{const N=ZI(g,se);A.innerHTML=It(N);break}}const T=k.closest("ul");T.parentElement.setAttribute("data-open","false"),T.style.display="none",e.querySelectorAll('[data-open="true"]').forEach(N=>{N.setAttribute("data-open","false"),N.querySelector("ul").style.display="none"});const _=document.querySelector(`.${se}`),M=document.querySelector(".table-menu");_?.classList.remove(se),M?.remove(),document.querySelectorAll(`.${oe}`).forEach(N=>{N.classList.remove(oe)}),IH(o,A),Er()}function c(E){s(E.currentTarget)}function u(E){a(E.currentTarget)}const d=I({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-edit",HTMLcontent:xE,title:"Колонки"});d.setAttribute("data-open","false");const m=I({targetElement:d,insertType:"append",tag:"ul",style:Ay}),p={targetElement:m,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:Cy};I({...p,HTMLcontent:xE,title:"",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px","data-id":"menu-item"}),I({...p,HTMLcontent:CH,title:Dt().INSERT_COLUMN_BEFORE_TABLE,"data-id":"add-left-column"}),I({...p,HTMLcontent:AH,title:Dt().INSERT_COLUMN_AFTER_TABLE,"data-id":"add-right-column"}),I({...p,HTMLcontent:LH,title:Dt().MERGE_RIGHT_CELL_TABLE,"data-id":"merge-right-cell"}),I({...p,HTMLcontent:TH,title:Dt().MERGE_LEFT_CELL_TABLE,"data-id":"merge-left-cell"}),I({...p,HTMLcontent:RH,title:Dt().SPLIT_CELL_TABLE,"data-id":"split-vertical-cell"}),I({...p,HTMLcontent:RE,title:Dt().REMOVE_COLUMN_TABLE,"data-id":"remove-column"}),m.addEventListener("click",l),d.addEventListener("mouseenter",c),d.addEventListener("mouseleave",u);const f=I({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-clone",HTMLcontent:ME,title:"Строки"});f.setAttribute("data-open","false");const h=I({targetElement:f,insertType:"append",tag:"ul",style:Ay}),y={targetElement:h,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:Cy};I({...y,HTMLcontent:ME,title:Dt().EDIT_ATOM||"Edit",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px"}),I({...y,HTMLcontent:_H,title:Dt().INSERT_ROW_BEFORE_TABLE,"data-id":"add-top-row"}),I({...y,HTMLcontent:kH,title:Dt().INSERT_ROW_AFTER_TABLE,"data-id":"add-bottom-row"}),I({...y,HTMLcontent:NH,title:Dt().MERGE_TOP_CELL_TABLE,"data-id":"merge-top-cell"}),I({...y,HTMLcontent:xH,title:Dt().MERGE_BOTTOM_CELL_TABLE,"data-id":"merge-bottom-cell"}),I({...y,HTMLcontent:MH,title:Dt().SPLIT_CELL_TABLE,"data-id":"split-horizontal-cell"}),I({...y,HTMLcontent:RE,title:Dt().REMOVE_ROW_TABLE,"data-id":"remove-row"}),h.addEventListener("click",l),f.addEventListener("mouseenter",c),f.addEventListener("mouseleave",u)}function HH(){bl({scrollTop:x.get("scrollTop")})}function FH(e){const{htmlDocument:t,commit:n}=e,r=()=>({parseFromString:o=>Te(o),HTMLDocument:t,commit:n,setCursorPosition:e.setCursorPosition,scrollTop:x.get("scrollTop"),iframeOffsetTop:x.get("iframeOffsetTop"),applicationElementSettingsSet:e.applicationElementSettingsSet,emFilter:ko});document.onclick=SH({getLockEditor:()=>!!x.get("lockEditor"),setEditorFocus:e.setEditorFocus,setCursorPosition:e.setCursorPosition,getParentElementOfSelection:ua,findOutermostParentWithText:Qc,setBlockGroupControlsPosition:HH,applicationElementSettingsSet:e.applicationElementSettingsSet,insertTextAtomIntoEmptyNarrowTable:e.insertTextAtomIntoEmptyNarrowTable??(()=>!1),handleRemoveAtom:o=>EH(o,{getElementParent:i=>wl(i),setCursorPosition:e.setCursorPosition,getVariableByIcon:ll,commit:n}),handleCloneAtom:o=>J7(o,r()),handleMoveBlockUp:o=>tH(o,r()),handleMoveBlockDown:o=>nH(o,r()),handleRemoveBlock:o=>rH(o,r()),handleCloneBlock:o=>eH(o,r()),handleCopyBlock:(o,i)=>pH(o,i,{HTMLDocument:t}),handlePasteBlock:(o,i)=>hH(o,i,{HTMLDocument:t,parseFromString:Te,getOuterHtml:Vt,minify:kr,cssbeautify,insertAdjacentHTML:qe,setBlockMaxWidth:s=>Mm(s,t),setFloatBlocksWidth:s=>Nm(s,t),checkBlockAdaptivity:al,commit:n,setCursorPosition:e.setCursorPosition,emailWidth:x.get("emailWidth"),appName:x.get("appName")}),handleMergeBlocks:o=>oH(o,r()),handleUnmergeBlocks:o=>iH(o,r()),isAddBlockMenuClick:mH,handleAddBlockMenu:(o,i)=>fH(o,i,{removeAllAttributes:Jn,state:x,commitLockedAsync:e.commitLockedAsync}),addBlockToProject:o=>OI(o,{HTMLDocument:t,messageService:e.messageService}),handleMoveGroupUp:o=>sH(o,r()),handleMoveGroupDown:o=>aH(o,r()),handleAddGroup:o=>lH(o,r()),handleCloneGroup:o=>cH(o,r()),handleRemoveGroup:o=>uH(o,r()),isDiscussViewMode:gH,isDiscussSetTargetMode:bH,handleDiscussViewClick:yH,handleDiscussSetTargetClick:o=>vH(o,{makeId:$_,commit:n}),handleCustomTableClick:DH}),wH({commit:n,messageService:e.messageService})}function OE(e,t){const n=JSON.stringify({settings:t});return{target:e,dataTransfer:{getData:r=>r==="Text"?n:""},preventDefault:()=>{},stopPropagation:()=>{}}}function $H(e){return!e.closest(".em-element-editor-widget")}function WH(e,t){if(t.lockEditor)return!1;const n=hE();if(!n)return!1;const r=e.target;if(!(r instanceof HTMLElement)||!$H(r))return!1;try{if(n.kind==="atom"){const o={settings:{atomHTML:typeof n.settings.atomHTML=="string"?n.settings.atomHTML:n.settings.atomHTML?.html,name:n.settings.name}};if(!o.settings.atomHTML)return!1;TE(OE(r,o.settings),t.atomDropCtx)}else if(n.kind==="block"&&document.body.classList.contains("em-block-insert-body")){const o={settings:{blockHTML:n.settings.blockHTML,type:n.settings.type,name:n.settings.name,project:n.settings.project,blockId:n.settings.blockId}};if(!o.settings.blockHTML)return!1;CE(OE(r,o.settings),o,t.blockDropCtx)}else return!1;if(!hE())return e.preventDefault(),e.stopPropagation(),wE(),t.commit(),!0}catch{return!1}return!1}var PE="application/x-emailmaker-social-reorder";function Xm(e){return e.closest('table[em-type="social"]')}function IE(e){return(e.querySelector('table[role="presentation"]')||e.querySelector("table"))?.querySelector("tr")}function DE(e){return Array.from(e.querySelectorAll(":scope > td[em-platform], :scope > td[data-em-platform]"))}function qH(e){return Array.from(e.querySelectorAll(":scope > td:not([em-platform]):not([data-em-platform])")).find(t=>{const n=t;return n.getAttribute("width")!=null||n.innerHTML==="&nbsp;"||n.textContent===" "})}function zH(e,t){const n=qH(e);e.replaceChildren(),t.forEach((r,o)=>{o>0&&n&&e.appendChild(n.cloneNode(!0)),r.removeAttribute("em-index"),r.removeAttribute("data-em-index"),e.appendChild(r)})}function VH(e,t){if(t.lockEditor)return;const n=e.target?.closest?.("td[em-platform], td[data-em-platform]");if(!n||n.getAttribute("draggable")!=="true")return;const r=Xm(n);if(!r)return;const o=IE(r);if(!o)return;const i=DE(o);if(i.length<2)return;const s=i.indexOf(n);if(s<0)return;const a=e.dataTransfer;if(!a)return;const l=String(s);a.setData("text/plain",l),a.setData(PE,l),a.effectAllowed="move"}function UH(e,t){const n=e.dataTransfer;if(!n||!Array.from(n.types||[]).includes("application/x-emailmaker-social-reorder"))return!1;let r=n.getData(PE);r||(r=n.getData("text/plain"));const o=parseInt(r,10);if(Number.isNaN(o))return!1;const i=e.target.closest?.("td[em-platform], td[data-em-platform]");if(!i)return!1;const s=Xm(i);if(!s)return!1;const a=IE(s);if(!a)return!1;const l=DE(a);if(l.length<2)return!1;const c=l.indexOf(i);if(c<0)return!1;const u=l[o];if(!u||Xm(u)!==s)return!1;if(o===c)return!0;const d=[...l];return d.splice(o,1),d.splice(c,0,u),zH(a,d),s.setAttribute("em-edit","active"),t.applicationElementSettingsSet({elem:s}),!0}function jH(){return{targetBlock:null,newTargetblock:null,atomReplaced:null}}function Ir(){return!!x.get("lockEditor")}function GH(e){const t=document.querySelector(".em-just-inserted");if(!t)return;e.applicationElementSettingsSet({elem:t}),t.classList.remove("em-just-inserted"),e.commit();const n=D1(t);setTimeout(()=>e.messageService.send({operation:"application_open-image-ai-popup",src:n}),1e3)}function XH(e,t,n){if(!Ir())try{e.preventDefault(),e.stopPropagation();const r=C7(e,{lockEditor:!1,applicationElementSettingsSet:t.applicationElementSettingsSet,messageService:t.messageService})||UH(e,{applicationElementSettingsSet:t.applicationElementSettingsSet});if(x.increment("activeElementLocked"),!r){if(document.body.classList.contains("em-block-insert-body"))try{const o=JSON.parse(e.dataTransfer?.getData("Text")||"{}");CE(e,o,{...t.blockDropContext(),mutableState:n})}catch{}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside"))try{TE(e,{...t.atomDropContext(),mutableState:n})}catch{}}wE(),t.commit()}finally{Promise.resolve().then(()=>{x.decrement("activeElementLocked"),GH(t)})}}function YH(e){const{dragState:t}=e;document.addEventListener("drag",n=>n.preventDefault(),!1),document.addEventListener("dragstart",n=>VH(n,{lockEditor:Ir()}),!0),document.addEventListener("dragstart",n=>A7(n,{lockEditor:Ir(),commit:r=>{e.commit(r)},messageService:e.messageService,mutableState:t}),!1),document.addEventListener("dragover",n=>_7(n,{lockEditor:Ir(),mutableState:t}),!1),document.addEventListener("dragenter",n=>k7(n,{lockEditor:Ir(),mutableState:t,requireEvenEmptyCell:e.requireEvenEmptyCell}),!1),document.addEventListener("dragleave",n=>x7(n,{lockEditor:Ir(),mutableState:t}),!1),document.addEventListener("drop",n=>XH(n,e,t),!1),document.addEventListener("dragend",n=>T7(n,{lockEditor:Ir(),messageService:e.messageService}),!1)}function KH(e){const{htmlDocument:t}=e,n=m=>e.commit(m),r=jH(),o=e.commonStylesApply??(m=>Uv(m,p=>e.commit(p))),i=m=>{cv(m,()=>e.commit())},s=m=>Mm(m,t),a=m=>Nm(m,t),l=()=>({messageService:e.messageService,isJsonString:H_,getOuterHtml:Vt,minify:kr,cssbeautify,HTMLDocument:t,_setDocumentStyles:(m,p)=>Fd(m,p),commonStylesApply:o,commonStylesApplyToBlock:nm,setImageWidth:xd,setFloatBlocksWidth:a,fitImagesToColumns:xm,insertCountdown:i}),c=()=>({...l(),lockEditor:!!x.get("lockEditor"),state:x,commit:n,emailWidth:x.get("emailWidth")??null,parseFromString:m=>Te(m),isTableElement:G0,insertAdjacentHTML:qe,uptimeCountdown:Md,setBlockMaxWidth:s,checkBlockAdaptivity:al,applicationElementSettingsSet:e.applicationElementSettingsSet});return{insertContext:()=>({state:x,commit:()=>e.commit(),lockEditor:!!x.get("lockEditor"),emailWidth:x.get("emailWidth"),iframeOffsetTop:x.get("iframeOffsetTop"),previewHeight:x.get("previewHeight"),parseFromString:m=>Te(m),getOuterHtml:Vt,HTMLDocument:t,minify:kr,cssbeautify,insertAdjacentHTML:qe,messageService:e.messageService,setDocumentStyles:m=>Fd(m,{minify:kr,cssbeautify,HTMLDocument:t}),setImageWidth:xd,commonStylesApply:o,commonStylesApplyToBlock:nm,insertCountdown:i,uptimeCountdown:Md,setBlockMaxWidth:s,setFloatBlocksWidth:a,fitImagesToColumns:xm,checkBlockAdaptivity:al,setAtomReplaced:m=>{r.atomReplaced=m},assetsRoot:e.assetsRoot}),register:()=>{document.addEventListener("click",m=>{x.get("lockEditor")||WH(m,{lockEditor:!1,commit:n,atomDropCtx:{...l(),mutableState:r},blockDropCtx:{...c(),mutableState:r}})},!0),YH({dragState:r,commit:n,messageService:e.messageService,applicationElementSettingsSet:e.applicationElementSettingsSet,atomDropContext:l,blockDropContext:c,requireEvenEmptyCell:e.requireEvenEmptyCell})}}}var ZH="./js/sanitize-html/sanitize-html.js",BE="data-sanitize-html-loader",Dl=null,gs=null;function QH(){return new URL(ZH,document.baseURI||window.location.href).href}function Ym(){const e=globalThis.sanitizeHtml;return typeof e!="function"||!("defaults"in e)?null:e}function JH(){if(Ym())return Promise.resolve();const e=QH();return document.querySelector(`script[${BE}]`)?gs??Promise.resolve():(gs||(gs=new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.async=!0,r.setAttribute(BE,"true"),r.onload=()=>t(),r.onerror=()=>{r.remove(),gs=null,n(new Error(`Failed to load sanitize-html script: ${e}`))},document.head.appendChild(r)})),gs)}async function eF(){const e=Ym();return e||(Dl||(Dl=(async()=>{await JH();const t=Ym();if(t)return t;throw new Error("sanitizeHtml not available after script load")})().catch(t=>{throw Dl=null,t})),Dl)}async function HE(e,t=!1,n,r,o){e.preventDefault(),e.stopPropagation();try{const i=e.clipboardData||window.clipboardData;if(!i)return;let s=i.getData("text/html");if(!s||t)s=i.getData("text/plain"),s=s.replace(/\n/g,"<br>");else{const l=n?.text?.fontSize||16;let c=(await eF())(s,{allowedTags:["strong","em","i","a","br","span","ul","ol","li","strike","sub","sup","s"],allowedAttributes:{a:["href"],span:["data-font-size","data-bold","data-italic"],strong:["data-italic"],ul:["data-list-type"],ol:["data-list-type","data-list-start"],li:["data-list-item"]},allowedStyles:{},transformTags:{span:function(y,E){let C="",k=!1,w=!1;if(E.style){const b=E.style.toLowerCase();(b.includes("font-weight: bold")||b.includes("font-weight:bold")||b.includes("font-weight: 700")||b.includes("font-weight:700"))&&(k=!0),(b.includes("font-style: italic")||b.includes("font-style:italic"))&&(w=!0),b.includes("text-decoration: underline")||b.includes("text-decoration:underline"),k&&w?(C="strong",E["data-italic"]="true"):k?C="strong":w&&(C="em")}return{tagName:C||"",attribs:E}},h1:function(y,E){return E["data-font-size"]=Math.round(1.5*l).toString(),E.style&&(E.style.toLowerCase().includes("font-style: italic")||E.style.toLowerCase().includes("font-style:italic"))&&(E["data-italic"]="true"),{tagName:"span",attribs:E}},h2:function(y,E){return E["data-font-size"]=Math.round(1.25*l).toString(),E.style&&(E.style.toLowerCase().includes("font-style: italic")||E.style.toLowerCase().includes("font-style:italic"))&&(E["data-italic"]="true"),{tagName:"span",attribs:E}},h3:function(y,E){return E["data-font-size"]=Math.round(1.125*l).toString(),E.style&&(E.style.toLowerCase().includes("font-style: italic")||E.style.toLowerCase().includes("font-style:italic"))&&(E["data-italic"]="true"),{tagName:"span",attribs:E}},h4:function(y,E){return E["data-font-size"]=l.toString(),E["data-bold"]="true",E.style&&(E.style.toLowerCase().includes("font-style: italic")||E.style.toLowerCase().includes("font-style:italic"))&&(E["data-italic"]="true"),{tagName:"span",attribs:E}},h5:function(y,E){return E["data-font-size"]=Math.round(.875*l).toString(),E.style&&(E.style.toLowerCase().includes("font-style: italic")||E.style.toLowerCase().includes("font-style:italic"))&&(E["data-italic"]="true"),{tagName:"span",attribs:E}},ul:function(y,E){return E["data-list-type"]="unordered",delete E.style,delete E["margin-top"],delete E["margin-bottom"],delete E["padding-inline-start"],{tagName:"ul",attribs:E}},ol:function(y,E){return E["data-list-type"]="ordered",E.start&&(E["data-list-start"]=E.start),delete E.style,delete E.start,{tagName:"ol",attribs:E}},li:function(y,E){return E["data-list-item"]="true",delete E.style,delete E.dir,delete E["aria-level"],delete E["list-style-type"],{tagName:"li",attribs:E}},p:function(y,E){return{tagName:"br",attribs:{}}},div:"br",b:function(y,E){if(E.style){const C=E.style.toLowerCase();return C.includes("font-weight: bold")||C.includes("font-weight:bold")||C.includes("font-weight: 700")||C.includes("font-weight:700")?{tagName:"strong"}:!1}return{tagName:"strong"}},i:function(y,E){if(E.style){const C=E.style.toLowerCase();return C.includes("font-style: italic")||C.includes("font-style:italic")?{tagName:"em"}:!1}return{tagName:"em"}},s:function(y,E){return{tagName:"strike",attribs:E}}},textFilter:function(y){return y.replace(/\s+/g," ")}});c=c.replace(/<[^\/>][^>]*>\s*<\/[^>]+>/g,"").replace(/(<br\s*\/?>){2,}/g,"<br>").trim();const u=document.createElement("div");u.innerHTML=c,(y=>{y.querySelectorAll("ul[data-list-type], ol[data-list-type]").forEach((E,C)=>{const k=E.getAttribute("data-list-type")==="ordered",w=E.querySelectorAll("li[data-list-item]");let b=1;k&&E.getAttribute("data-list-start")&&(b=parseInt(E.getAttribute("data-list-start"),10)||1);const v=document.createDocumentFragment(),A=E.previousSibling;A&&(A.nodeType===Node.TEXT_NODE&&A.textContent.trim()!==""||A.nodeType===Node.ELEMENT_NODE&&A.tagName!=="BR")&&v.appendChild(document.createElement("br")),w.forEach((g,S)=>{const T=document.createElement("span");T.innerHTML=k?`${b}. `:"• ",v.appendChild(T),(M=>{const N=document.createElement("div");N.innerHTML=M.innerHTML;let W=N.firstChild;for(;W&&W.nodeType===1&&W.tagName==="BR";)N.removeChild(W),W=N.firstChild;if(!N.hasChildNodes()){const P=document.createTextNode("");N.appendChild(P)}for(;N.firstChild;)v.appendChild(N.firstChild)})(g),S<w.length-1&&v.appendChild(document.createElement("br")),b++}),E.parentNode.replaceChild(v,E)}),y.querySelectorAll("[data-list-type], [data-list-item], [data-list-start]").forEach(E=>{E.removeAttribute("data-list-type"),E.removeAttribute("data-list-item"),E.removeAttribute("data-list-start")})})(u),u.firstChild&&u.firstChild.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="BR"&&u.removeChild(u.firstChild),u.querySelectorAll("[data-font-size]").forEach(y=>{let E=`font-size: ${y.getAttribute("data-font-size")}px;`;y.getAttribute("data-bold")==="true"&&(E+=" font-weight: bold;"),y.getAttribute("data-italic")==="true"&&(E+=" font-style: italic;"),y.setAttribute("style",E),y.removeAttribute("data-font-size"),y.removeAttribute("data-bold"),y.removeAttribute("data-italic")}),u.querySelectorAll("[data-italic]").forEach(y=>{const E=document.createElement("em");E.innerHTML=y.innerHTML,y.innerHTML="",y.appendChild(E),y.removeAttribute("data-italic")}),u.querySelectorAll("a").forEach(y=>{const E=y.getAttribute("href");if(!E||E.trim()==="")y.replaceWith(...y.childNodes);else{y.setAttribute("target","_blank");const C=n?.links?.color??"#1C52DC",k=n?.links?.underline??!0?"underline":"none";y.setAttribute("style",`color: ${C}; text-decoration: ${k};`)}});const m=u.querySelectorAll("*");let p=0;m.forEach(y=>{y.tagName!=="BR"&&y.tagName!=="SPAN"&&y.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&(y.parentNode.removeChild(y),p++)}),u.querySelectorAll("span").forEach(y=>{y.innerHTML==="• "||/^\d+\.&nbsp;$/.test(y.innerHTML)||y.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&y.children.length===0&&(y.parentNode.removeChild(y),p++)});const f=window.getSelection(),h=f?.anchorNode?.nodeType===Node.ELEMENT_NODE?f.anchorNode:f?.anchorNode?.parentElement||null;_B(u,h),kB(u,h),s=u.innerHTML}const a=window.getSelection();if(a&&a.rangeCount>0){const l=a.getRangeAt(0);l.deleteContents();const c=document.createRange().createContextualFragment(s);l.insertNode(c),l.collapse(!1)}}catch{const s=(e.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,s)}r(e),o()}function FE(e,t){const{target:n}=e;setTimeout(()=>{const r=n?.querySelector("a");if(!r)return;const o=r.closest("div, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");o&&(o.childNodes.forEach(i=>{if(i.nodeType===Node.COMMENT_NODE&&i.nodeValue?.includes("[if mso]")){const s=r.innerHTML.length*11+40;i.nodeValue=i.nodeValue.replace(/(<center[^>]*>)(.*?)(<\/center>)/s,(a,l,c,u)=>l+r.innerHTML+u).replace(/(width:)(\d+)(px)/,(a,l,c,u)=>`${l}${s}${u}`)}}),t(!1))},0)}function tF(e){let t=!1;const n=o=>{t=!!o.target?.nodeName},r=o=>{t&&e.handlePasteTextFragment(o,!1,e.getCommonStyles(),e.changeMsoValue,()=>{e.commit()})};return document.addEventListener("contextmenu",n),document.addEventListener("paste",r),{setFromContextMenu(o){t=o},dispose(){document.removeEventListener("contextmenu",n),document.removeEventListener("paste",r)}}}function nF(e,t){const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let r=0,o=null;for(;n.nextNode();){o=n.currentNode;const i=(o.textContent||"").length;if(r+i>=t){const s=t-r;return{node:o,offset:s}}r+=i}if(o){const i=o.textContent?.length||0;return{node:o,offset:i}}return null}function rF(e,t,n,r){try{if(!n||n.nodeType!==Node.TEXT_NODE)return!1;const o=n.textContent?n.textContent.length:0,i=Math.min(Math.max(0,r),o);return e.setStart(n,i),e.collapse(!0),t.removeAllRanges(),t.addRange(e),!0}catch{return!1}}var $E='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 4 L 15 24.0625 L 8.21875 17.28125 L 6.78125 18.71875 L 15.28125 27.21875 L 16 27.90625 L 16.71875 27.21875 L 25.21875 18.71875 L 23.78125 17.28125 L 17 24.0625 L 17 4 Z"/></svg>',WE='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 4.09375 L 15.28125 4.78125 L 6.78125 13.28125 L 8.21875 14.71875 L 15 7.9375 L 15 28 L 17 28 L 17 7.9375 L 23.78125 14.71875 L 25.21875 13.28125 L 16.71875 4.78125 Z"/></svg>',Km='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 12 6 C 10.894531 6 10 6.894531 10 8 C 10 9.105469 10.894531 10 12 10 C 13.105469 10 14 9.105469 14 8 C 14 6.894531 13.105469 6 12 6 Z M 20 6 C 18.894531 6 18 6.894531 18 8 C 18 9.105469 18.894531 10 20 10 C 21.105469 10 22 9.105469 22 8 C 22 6.894531 21.105469 6 20 6 Z M 12 14 C 10.894531 14 10 14.894531 10 16 C 10 17.105469 10.894531 18 12 18 C 13.105469 18 14 17.105469 14 16 C 14 14.894531 13.105469 14 12 14 Z M 20 14 C 18.894531 14 18 14.894531 18 16 C 18 17.105469 18.894531 18 20 18 C 21.105469 18 22 17.105469 22 16 C 22 14.894531 21.105469 14 20 14 Z M 12 22 C 10.894531 22 10 22.894531 10 24 C 10 25.105469 10.894531 26 12 26 C 13.105469 26 14 25.105469 14 24 C 14 22.894531 13.105469 22 12 22 Z M 20 22 C 18.894531 22 18 22.894531 18 24 C 18 25.105469 18.894531 26 20 26 C 21.105469 26 22 25.105469 22 24 C 22 22.894531 21.105469 22 20 22 Z"/></svg>',oF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 3 C 13.742188 3 12.847656 3.890625 12.40625 5 L 5 5 L 5 28 L 13 28 L 13 30 L 27 30 L 27 14 L 25 14 L 25 5 L 17.59375 5 C 17.152344 3.890625 16.257813 3 15 3 Z M 15 5 C 15.554688 5 16 5.445313 16 6 L 16 7 L 19 7 L 19 9 L 11 9 L 11 7 L 14 7 L 14 6 C 14 5.445313 14.445313 5 15 5 Z M 7 7 L 9 7 L 9 11 L 21 11 L 21 7 L 23 7 L 23 14 L 13 14 L 13 26 L 7 26 Z M 15 16 L 25 16 L 25 28 L 15 28 Z"/></svg>',iF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 2 C 14.742188 2 13.847656 2.890625 13.40625 4 L 5 4 L 5 29 L 27 29 L 27 4 L 18.59375 4 C 18.152344 2.890625 17.257813 2 16 2 Z M 16 4 C 16.554688 4 17 4.445313 17 5 L 17 6 L 20 6 L 20 8 L 12 8 L 12 6 L 15 6 L 15 5 C 15 4.445313 15.445313 4 16 4 Z M 7 6 L 10 6 L 10 10 L 22 10 L 22 6 L 25 6 L 25 27 L 7 27 Z M 21.28125 13.28125 L 15 19.5625 L 11.71875 16.28125 L 10.28125 17.71875 L 14.28125 21.71875 L 15 22.40625 L 15.71875 21.71875 L 22.71875 14.71875 Z"/></svg>',Bl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 4 4 L 4 24 L 11 24 L 11 22 L 6 22 L 6 6 L 18 6 L 18 7 L 20 7 L 20 4 Z M 12 8 L 12 28 L 28 28 L 28 8 Z M 14 10 L 26 10 L 26 26 L 14 26 Z"/></svg>',sF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 5 5 L 5 9 L 6 9 L 6 23 L 5 23 L 5 27 L 9 27 L 9 26 L 23 26 L 23 27 L 27 27 L 27 23 L 26 23 L 26 9 L 27 9 L 27 5 L 23 5 L 23 6 L 9 6 L 9 5 Z M 9 8 L 23 8 L 23 9 L 24 9 L 24 23 L 23 23 L 23 24 L 9 24 L 9 23 L 8 23 L 8 9 L 9 9 Z M 10 10 L 10 18 L 14 18 L 14 22 L 22 22 L 22 14 L 18 14 L 18 10 Z M 12 12 L 16 12 L 16 16 L 12 16 Z M 18 16 L 20 16 L 20 20 L 16 20 L 16 18 L 18 18 Z"/></svg>',aF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 5 5 L 5 9 L 6 9 L 6 19 L 5 19 L 5 23 L 9 23 L 9 22 L 11 22 L 11 24 L 10 24 L 10 28 L 14 28 L 14 27 L 24 27 L 24 28 L 28 28 L 28 24 L 27 24 L 27 14 L 28 14 L 28 10 L 24 10 L 24 11 L 22 11 L 22 9 L 23 9 L 23 5 L 19 5 L 19 6 L 9 6 L 9 5 Z M 9 8 L 19 8 L 19 9 L 20 9 L 20 19 L 19 19 L 19 20 L 9 20 L 9 19 L 8 19 L 8 9 L 9 9 Z M 22 13 L 24 13 L 24 14 L 25 14 L 25 24 L 24 24 L 24 25 L 14 25 L 14 24 L 13 24 L 13 22 L 19 22 L 19 23 L 23 23 L 23 19 L 22 19 Z"/></svg>',bs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 23.90625 3.96875 C 22.859375 3.96875 21.8125 4.375 21 5.1875 L 5.1875 21 L 5.125 21.3125 L 4.03125 26.8125 L 3.71875 28.28125 L 5.1875 27.96875 L 10.6875 26.875 L 11 26.8125 L 26.8125 11 C 28.4375 9.375 28.4375 6.8125 26.8125 5.1875 C 26 4.375 24.953125 3.96875 23.90625 3.96875 Z M 23.90625 5.875 C 24.410156 5.875 24.917969 6.105469 25.40625 6.59375 C 26.378906 7.566406 26.378906 8.621094 25.40625 9.59375 L 24.6875 10.28125 L 21.71875 7.3125 L 22.40625 6.59375 C 22.894531 6.105469 23.402344 5.875 23.90625 5.875 Z M 20.3125 8.71875 L 23.28125 11.6875 L 11.1875 23.78125 C 10.53125 22.5 9.5 21.46875 8.21875 20.8125 Z M 6.9375 22.4375 C 8.136719 22.921875 9.078125 23.863281 9.5625 25.0625 L 6.28125 25.71875 Z"/></svg>',qE='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 5 L 15 15 L 5 15 L 5 17 L 15 17 L 15 27 L 17 27 L 17 17 L 27 17 L 27 15 L 17 15 L 17 5 Z"/></svg>',lF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 5 5 L 5 27 L 27 27 L 27 9.59375 L 26.71875 9.28125 L 22.71875 5.28125 L 22.40625 5 Z M 7 7 L 10 7 L 10 13 L 22 13 L 22 7.4375 L 25 10.4375 L 25 25 L 23 25 L 23 16 L 9 16 L 9 25 L 7 25 Z M 12 7 L 16 7 L 16 9 L 18 9 L 18 7 L 20 7 L 20 11 L 12 11 Z M 11 18 L 21 18 L 21 25 L 11 25 Z"/></svg>',Zm='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 4 C 14.476563 4 13.941406 4.183594 13.5625 4.5625 C 13.183594 4.941406 13 5.476563 13 6 L 13 7 L 7 7 L 7 9 L 8 9 L 8 25 C 8 26.644531 9.355469 28 11 28 L 23 28 C 24.644531 28 26 26.644531 26 25 L 26 9 L 27 9 L 27 7 L 21 7 L 21 6 C 21 5.476563 20.816406 4.941406 20.4375 4.5625 C 20.058594 4.183594 19.523438 4 19 4 Z M 15 6 L 19 6 L 19 7 L 15 7 Z M 10 9 L 24 9 L 24 25 C 24 25.554688 23.554688 26 23 26 L 11 26 C 10.445313 26 10 25.554688 10 25 Z M 12 12 L 12 23 L 14 23 L 14 12 Z M 16 12 L 16 23 L 18 23 L 18 12 Z M 20 12 L 20 23 L 22 23 L 22 12 Z"/></svg>';function ke(e,t,n=""){const r=`class="${t}" width="1em" height="1em" fill="currentColor" aria-hidden="true"`;return e.replace("<svg",`<svg ${r}${n?` ${n}`:""}`)}var Hl={getLocale:ns,commit:Er},cF=".em-prevent-action";function uF(){return x.get("emailWidth")||475}function dF(){return x.get("copyPasteEnabled")||!1}function mF(){return x.get("saveBlockEnabled")||!1}function fF(){return x.get("blocksAddPanelEnabled")||!1}function pF(){return x.get("codeMode")||!1}var zE=".em-mob-wrap, .noresp-em-mob-wrap";function VE(e){return Array.from(document.querySelectorAll(e)).find(bv)??null}function Fl(e,t){const n=Hl.getLocale(),r=uF(),o=dF(),i=mF(),s=fF(),a=pF();if(t==="atom"){e.setAttribute("em-state","active"),e.getBoundingClientRect().left<50&&e.setAttribute("em-state","active-inside");const l=I({targetElement:e,insertType:"append",className:"em-element-editor",width:82,height:26});l.classList.add("of-atom"),document.body.getBoundingClientRect().height>70&&e.getBoundingClientRect().top+70>document.body.getBoundingClientRect().height&&l.classList.add("out-of-iframe"),e.getBoundingClientRect().top<25&&l.classList.add("em-top-crossed");const c=I({targetElement:l,insertType:"append",className:"em-element-editor-widget"});I({targetElement:c,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:ke(Km,`${_e} ${je.drag}`,'style="transform: rotate(90deg)"'),title:n.REORDER_ATOM}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:ke(bs,`${_e} em-analytics__atoms-panel-edit`),title:n.EDIT_ATOM}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:ke(Bl,`${_e} em-analytics__atoms-panel-clone`),title:n.CLONE_ATOM}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:ke(Zm,`${_e} em-analytics__atoms-panel-remove`),title:n.REMOVE_ATOM}),yl(Hl.commit)}if(t==="block"){e.setAttribute("em-state","active");const l=I({targetElement:e,insertType:"append",className:"em-element-editor"});l.classList.add("of-block"),e.getBoundingClientRect().left<35&&e.setAttribute("em-state","active-inside"),(document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height||document.documentElement.clientWidth<r&&e.getBoundingClientRect().top-34<0)&&l.classList.add("out-of-iframe");const c=I({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=I({targetElement:c,insertType:"append",className:"em-element-editor-group"});if(I({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:ke(Km,`${_e} ${je.drag}`),title:n.REORDER_BLOCK}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="block"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:ke(WE,`${_e} ${je.moveUp}`),title:n.REORDER_BLOCK_UP}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="block"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:ke($E,`${_e} ${je.moveDown}`),title:n.REORDER_BLOCK_DOWN}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:ke(bs,`${_e} em-analytics__blocks-panel-edit`),title:n.EDIT_BLOCK}),o){const f=I({targetElement:c,insertType:"append",className:"em-element-editor-group"});I({targetElement:f,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:ke(Bl,`${_e} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK}),I({targetElement:f,insertType:"append",className:"em-element-editor-widget-copy",HTMLcontent:ke(iF,`${_e} em-analytics__blocks-panel-copy`),title:n.COPY_BLOCK_TO_CLIPBOARD}),I({targetElement:f,insertType:"append",className:"em-element-editor-widget-paste",HTMLcontent:ke(oF,`${_e} em-analytics__blocks-panel-paste`),title:n.PASTE_BLOCK_FROM_CLIPBOARD})}else I({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:ke(Bl,`${_e} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK});if(e.closest(cF))return;const d=VE('[em-edit="active"]'),m=VE('[em-state^="active"]');if(d&&m&&(d.querySelector(zE)&&m.querySelector(zE)||d.closest(".em-structure")&&m.closest(".em-structure"))&&d!==c.closest('[em-edit="active"]')&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-merge",HTMLcontent:ke(sF,`${_e} ${je.merge} em-analytics__blocks-panel-merge`),title:n.MERGE_BLOCK}),Vi(c.closest('[em="block"]')??c).flatMap(f=>Array.from(f.querySelectorAll(":scope > table"))).length>1&&c.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap")&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-unmerge",HTMLcontent:ke(aF,`${_e} ${je.unmerge} em-analytics__blocks-panel-unmerge`),title:n.UNMERGE_BLOCK}),i&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-add-block",HTMLcontent:ke(lF,`${_e} em-analytics__blocks-panel-save`),title:n.SAVE_TO_BLOCKS}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:ke(Zm,`${_e} em-analytics__blocks-panel-remove`),title:n.REMOVE_BLOCK}),s&&!e.querySelector(".em-element-block-add")&&!a){const f=I({targetElement:e,insertType:"append",className:"em-element-block-add"});e.getBoundingClientRect().bottom+1>document.body.getBoundingClientRect().height&&f.classList.add("out-of-iframe"),I({targetElement:f,insertType:"append",className:"em-element-block-add-plus",HTMLcontent:`${ke(qE,`${_e} ${je.add}`)} ${n.ADD_BLOCK}`,title:n.ADD_BLOCK}),I({targetElement:f,insertType:"append",className:"add-empty-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="border-outer" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM484 366h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM302 548h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm364 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-182 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm0 182h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8z"></path></svg>',title:n.ADD_EMPTY_BLOCK}),I({targetElement:f,insertType:"append",className:"add-saved-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore-add" width="1em" height="1em" fill="currentColor" aria-hidden="true"><defs><style></style></defs><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"></path></svg>',title:n.ADD_SAVED_BLOCK}),I({targetElement:f,insertType:"append",className:"add-common-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"></path></svg>',title:n.ADD_COMMON_BLOCK}),I({targetElement:f,insertType:"append",className:"add-template-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="build" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M916 210H376c-17.7 0-32 14.3-32 32v236H108c-17.7 0-32 14.3-32 32v272c0 17.7 14.3 32 32 32h540c17.7 0 32-14.3 32-32V546h236c17.7 0 32-14.3 32-32V242c0-17.7-14.3-32-32-32zm-504 68h200v200H412V278zm-68 468H144V546h200v200zm268 0H412V546h200v200zm268-268H680V278h200v200z"></path></svg>',title:n.ADD_TEMPLATE_BLOCK}),I({targetElement:f,insertType:"append",className:"add-search-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg>',title:n.ADD_SEARCH_BLOCK})}yl(Hl.commit);const p=e.closest('[em="block"]');p&&(p.onmouseleave=function(){$o(void 0)})}if(t==="group"){e.tagName==="TR"?e.querySelector("td")?.setAttribute("em-state","active"):e.setAttribute("em-state","active");const l=I({targetElement:e,insertType:"append",className:"em-element-editor"});l.classList.add("of-group"),document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height&&l.classList.add("out-of-iframe");const c=I({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=I({targetElement:c,insertType:"append",className:"em-element-editor-group"});I({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:ke(Km,`${_e} ${je.drag}`),title:n.REORDER_BLOCK}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="group"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:ke(WE,`${_e} ${je.moveUp}`),title:n.REORDER_BLOCK_UP}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="group"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:ke($E,`${_e} ${je.moveDown}`),title:n.REORDER_BLOCK_DOWN}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-add",HTMLcontent:ke(qE,`${_e} ${je.add} em-analytics__groups-panel-add`),title:n.ADD_GROUP}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:ke(bs,`${_e} em-analytics__groups-panel-edit`),title:n.EDIT_GROUP}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:ke(Bl,`${_e} em-analytics__groups-panel-clone`),title:n.CLONE_GROUP}),document.querySelectorAll('[em="group"]').length>1&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:ke(Zm,`${_e} em-analytics__groups-panel-remove`),title:n.REMOVE_GROUP}),yl(Hl.commit)}}function $o(e){if(document.documentElement.classList.contains("em-resize-start"))return;const t=x.get("isLeftButtonDown")||!1;e&&e.closest("[em]")?.getAttribute("em")==="atom"?(document.querySelectorAll('[em="atom"] .em-element-editor, [em="atom"] .em-vindent-paddingTop, [em="atom"] .em-vindent-paddingRight, [em="atom"] .em-vindent-paddingBottom, [em="atom"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(n=>{n.closest('[em="atom"]')!==e&&!t&&n.remove()}),document.querySelectorAll('[em="group"] .em-element-editor.of-group').forEach(n=>{n.remove()}),document.querySelectorAll('[em="atom"][em-state], [em="atom"] [em-state]').forEach(n=>{n.closest('[em="atom"]')!==e&&n.removeAttribute("em-state")})):e&&e.closest("[em]")?.getAttribute("em")==="block"?(document.querySelectorAll('[em="block"] .em-element-editor, .em-element-block-add, [em="block"] .em-vindent-paddingTop, [em="block"] .em-vindent-paddingRight, [em="block"] .em-vindent-paddingBottom, [em="block"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value, .em-gap').forEach(n=>{n.closest('[em="block"]')!==e&&!t&&n.remove()}),document.querySelectorAll('[em="group"] .em-element-editor.of-group, [em="atom"] .em-element-editor').forEach(n=>{n.remove()}),document.querySelectorAll("[em-state]").forEach(n=>{(n.closest('[em="block"]')!==e||n.closest('[em="atom"]'))&&n.removeAttribute("em-state")})):(e&&e.closest("[em]")?.getAttribute("em")==="group"||e===void 0)&&(document.querySelectorAll('[em="block"] .em-element-editor, .em-element-block-add, [em="block"] .em-vindent-paddingTop, [em="block"] .em-vindent-paddingRight, [em="block"] .em-vindent-paddingBottom, [em="block"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value, .em-gap').forEach(n=>{t||n.remove()}),document.querySelectorAll('[em="atom"] .em-element-editor, [em="atom"] .em-vindent-paddingTop, [em="atom"] .em-vindent-paddingRight, [em="atom"] .em-vindent-paddingBottom, [em="atom"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(n=>{t||n.remove()}),document.querySelectorAll('[em="group"] .em-element-editor, [em="group"] .em-vindent-paddingTop, [em="group"] .em-vindent-paddingRight, [em="group"] .em-vindent-paddingBottom, [em="group"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(n=>{n.closest('[em="group"]')!==e&&!t&&n.remove()}),document.querySelectorAll("[em-state]").forEach(n=>{(n.closest('[em="group"]')!==e||n.closest('[em="block"]')||n.closest('[em="atom"]'))&&n.removeAttribute("em-state")})),document.querySelectorAll(".em-block-insert").forEach(n=>n.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")),document.querySelectorAll(".em-block-insert-empty").forEach(n=>n.classList.remove("em-block-insert-empty")),document.querySelectorAll('[em-hover="true"]').forEach(n=>n.removeAttribute("em-hover"))}function hF(e,t){if(!e?.isConnected)return;let n;if(n=e.closest('[em="atom"]')){if($o(n),n.querySelector(".em-element-editor.of-atom")||Fl(n.tagName==="TR"?n.querySelector("td"):n,"atom"),!n.closest('[em="block"]')?.querySelector(".em-element-editor.of-block")){document.querySelectorAll('[em="block"] > td > .em-element-editor, [em="block"] > td > .em-element-block-add').forEach(o=>{o.remove()}),document.querySelectorAll("[em-state]").forEach(o=>{o.removeAttribute("em-state")});const r=n.closest('[em="block"]');r&&Fl(r.tagName==="TR"?r.querySelector("td"):r,"block"),t.setBlockGroupControlsPosition()}}else(n=e.closest('[em="block"]'))?($o(n),n.querySelector(".em-element-editor.of-block")||(Fl(n.tagName==="TR"?n.querySelector("td"):n,"block"),t.setBlockGroupControlsPosition())):(n=e.closest('[em="group"]'))&&($o(n),n.querySelector(".em-element-editor.of-group")||(Fl(n.tagName==="TR"?n.querySelector("td"):n,"group"),t.setBlockGroupControlsPosition()));e.closest(".em-element-path")||document.querySelectorAll('[em-hover="true"]').forEach(function(r){r.removeAttribute("em-hover")}),!e.closest(".em-editor-wrapper")&&!e.closest(".em-element-editor")&&!e.closest(".em-vindent")&&!e.closest(".em-gap")&&!e.closest(".em-element-resize-img")&&!e.closest(".em-element-img-change-group")&&!e.closest(".em-element-block-add")&&!e.closest(".em-element-path")&&e.tagName!=="IMG"?e.setAttribute("em-hover","true"):e.tagName==="IMG"&&e.parentElement?.setAttribute("em-hover","true"),t.commit(!1)}var{START_POSITION:$l,NEW_EDITOR:Qm}=J1,{TRIM_SPACES:ys,EMPTY_TEXT:gF}=eE;function bF(e,t){const{activeElem:n,listContext:r,cursorPositionType:o,isTargetCell:i,commit:s,wrapEditor:a,removeTemporaryListClasses:l}=t,{classNameOl:c,classNameUl:u,isList:d}=r;if(!((e.key==="Enter"||e.keyCode===13)&&d&&i&&!e.shiftKey))return!1;if(e.preventDefault(),e.stopImmediatePropagation(),!n)return!0;const m=n.closest(`table.${c}`)||n.closest(`table.${u}`),p=n.closest(`table.${c}`)?c:u;if(!m)return!0;const f=p9(n,p);if(!f)return!0;const{firstCellText:h,firstCellHtmlNoText:y,wrappedSecondCellHtml:E}=f;return o==="start"||o==="end"?yF(n,m,p,c,u,o,h,y,E,a):o==="inside"&&vF(n,m,p,c,a),l(),s(),!0}function yF(e,t,n,r,o,i,s,a,l,c){const u=e.querySelector("div");u&&u.classList.add($l);const d=j1(a,s),m=j1(l," "),p=i==="end"?C9(m):m,f=t.outerHTML,h="<tr>"+d+p+"</tr>",y=Fo(f),E=h9(y,h,$l,i==="start");t.innerHTML=Fo(E),n===r&&Sm(t),w9(t,r,o,ys);const C=i==="start"?t.querySelector(".remove-start-element-position"):t.querySelector(".remove-new-editor-element");return C&&UE(C,t,c),C}function vF(e,t,n,r,o){const i=window.getSelection(),s=e.closest("tr"),a=e.querySelector("div");if(!i||i.rangeCount===0||!s||!a)return null;const l=i.getRangeAt(0),c=a.contains(l.startContainer)?E9(s,a,l):null;return c?(s.after(c.row),v9(t),c.content.classList.add(Qm),n===r&&Sm(t),UE(c.content,t,o,!0),c.content):null}function UE(e,t,n,r=!1){e.textContent&&e.textContent.length>0&&(e.innerHTML=e.innerHTML.replace(ys,"")),gF.test(e.textContent||"")&&(e.textContent=" "),n(e,!0);const o=t.querySelector("editor"),i=o?.querySelector("div");if(i){const s=window.getSelection();if(s&&s.rangeCount>0){const a=s.getRangeAt(0);a.selectNodeContents(i),a.collapse(!0),s.removeAllRanges(),s.addRange(a)}}r&&o&&o.focus()}function EF(e,t){const{activeElem:n,listContext:r,cursorPositionType:o,isTargetCell:i,isEmptyText:s,commit:a,wrapEditor:l,removeTemporaryListClasses:c}=t,{classNameOl:u,classNameUl:d,isList:m}=r,p=(e.keyCode===38||e.key==="ArrowUp")&&o==="start",f=(e.keyCode===40||e.key==="ArrowDown")&&(!s&&o==="end"||s&&o==="start");if(!(p||f)||!m||!i||!n)return!1;e.preventDefault(),e.stopImmediatePropagation();const h=e.key==="ArrowUp"?"ArrowUp":"ArrowDown",y=n.closest(`table.${u}`)||n.closest(`table.${d}`);if(!y)return!0;const E=n.querySelector("div");E&&E.classList.add($l);const C=y.outerHTML,k=Fo(C);y.innerHTML=S9(k,$l,Qm,h);const w=y.querySelector(".remove-new-editor-element");if(w){l(w,!0);const b=y.querySelector("editor"),v=b?.querySelector("div")?.childNodes[0],A=window.getSelection();if(A&&A.rangeCount>0){const g=A.getRangeAt(0);if(v&&v.nodeType===Node.TEXT_NODE){const S=v.textContent||"";g.setStart(v,S.replace(ys,"").length)}else b&&g.selectNodeContents(b);g.collapse(!0),A.removeAllRanges(),A.addRange(g)}}return c(),a(),!0}function SF(e,t,n){return(e.keyCode===39||e.key==="ArrowRight")&&(t==="end"||n)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1}function wF(e,t){const n=window.navigator.platform.match("Mac"),{activeElem:r,listContext:o,cursorPositionType:i,isTargetCell:s,isEmptyText:a,parentElement:l,commit:c,wrapEditor:u,removeTemporaryListClasses:d,findNodeAtPosition:m,setCursorSafely:p}=t,{classNameOl:f,classNameUl:h,isList:y}=o;if(!((n?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&y)||!(!s||s&&(i==="start"||a&&i==="inside"||a&&i==="end"))||!r||!l)return!1;e.preventDefault(),e.stopImmediatePropagation();const E=r.closest(`table.${f}`)?f:h,C=l.closest("tr");if(!C)return!0;const k=C.previousElementSibling;if(!k&&!s)return!0;const w=s?r.querySelector("div"):C.querySelector("tr td:nth-child(2)")?.querySelector("div"),b=w?w.innerHTML:"",v=b?b.split(" ")[0]:"";v.replace(ys,"");const A=k?.querySelector("tr td:nth-of-type(2)");if(!A)return!0;const g=A.querySelector("div");if(!g)return!0;g.classList.add(Qm);const S=g.innerHTML,T=`${S}${b}`;C.remove();const _=g.closest(`table.${f}`)||g.closest(`table.${h}`);if(!_)return!0;const M=_.innerHTML;_.innerHTML=Fo(M),E===f&&Sm(_);const N=_.querySelector(".remove-new-editor-element");if(!N)return d(),c(),!0;N.innerHTML=`${T.replace(ys,"")}&nbsp;`||"&nbsp;",u(N,!0);const W=N.closest("editor");if(!W)return d(),c(),!0;const P=window.getSelection(),R=document.createRange(),Y=W.querySelector("div");if(!Y||!P)return d(),c(),!0;const V=W.textContent||"",G=v?V.indexOf(v):-1;if(G!==-1&&v){const Le=m(Y,G);if(Le)p(R,P,Le.node,Le.offset);else{const ae=Y.childNodes[0];ae&&p(R,P,ae,0)}}else{const Le=document.createElement("div");Le.innerHTML=S;const ae=(Le.textContent||"").length,ne=m(Y,ae);if(ne)p(R,P,ne.node,ne.offset);else{const we=document.createTreeWalker(Y,NodeFilter.SHOW_TEXT,null);let j=null;for(;we.nextNode();)j=we.currentNode;j&&p(R,P,j,(j.textContent||"").length)}}return W.focus(),d(),c(),!0}function CF(e,t,n){return(window.navigator.platform.match("Mac")?e.code==="Backspace":e.keyCode===46||e.keyCode===8)?!1:t&&!n?(e.preventDefault(),e.stopPropagation(),!0):!1}function AF(e){if(!e)return!1;const t=e.closest("li");return _m(t)}function TF(e){const t=window.getSelection(),n=e.textContent||"",r=n.trim();if(!r||r===" ")return{position:"empty",offset:0,textContent:""};if(!t||t.rangeCount===0)return{position:"middle",offset:0,textContent:n};const o=t.getRangeAt(0);if(!e.contains(o.startContainer))return{position:"middle",offset:0,textContent:n};const i=document.createRange();i.selectNodeContents(e),i.setEnd(o.startContainer,o.startOffset);const s=i.toString().length;return s===0?{position:"start",offset:0,textContent:n}:s>=r.length?{position:"end",offset:s,textContent:n}:{position:"middle",offset:s,textContent:n}}function _F(e,t){const n=Array.from(t.querySelectorAll(":scope > li")),r=n.indexOf(e);return r===0?"first":r===n.length-1?"last":"middle"}function kF(e){const t=window.getSelection();if(!t||t.rangeCount===0)return e.innerHTML;const n=t.getRangeAt(0),r=document.createRange();r.selectNodeContents(e),r.setEnd(n.startContainer,n.startOffset);const o=r.cloneContents(),i=document.createElement("div");return i.appendChild(o),i.innerHTML}function LF(e){const t=window.getSelection();if(!t||t.rangeCount===0)return"";const n=t.getRangeAt(0),r=document.createRange();r.selectNodeContents(e),r.setStart(n.endContainer,n.endOffset);const o=r.cloneContents(),i=document.createElement("div");return i.appendChild(o),i.innerHTML}function Wo(e){const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}function vs(e,t){e.hasAttribute("em-edit")&&(e.removeAttribute("em-edit"),t.setAttribute("em-edit","active"))}function NF(e,t){const n=document.createElement("br"),r=document.createElement("span");return r.innerHTML="&nbsp;",vs(e,r),t.parentNode?.insertBefore(r,t),t.parentNode?.insertBefore(n,r),e.remove(),t.querySelectorAll("li").length===0&&t.remove(),Wo(r),r}function xF(e,t){const n=Array.from(t.querySelectorAll(":scope > li")),r=n.indexOf(e),o=n.slice(r+1),i=document.createElement(t.tagName.toLowerCase());t.getAttribute("style")&&i.setAttribute("style",t.getAttribute("style")),o.forEach(l=>{i.appendChild(l)});const s=document.createElement("br"),a=document.createElement("span");return a.innerHTML="&nbsp;",vs(e,a),i.children.length>0&&t.parentNode?.insertBefore(i,t.nextSibling),t.parentNode?.insertBefore(a,t.nextSibling),t.parentNode?.insertBefore(s,a),e.remove(),t.querySelectorAll("li").length===0&&t.remove(),Wo(a),a}function MF(e,t){if(!((e.key==="Enter"||e.keyCode===13)&&!e.shiftKey))return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0).startContainer,o=r.nodeType===Node.TEXT_NODE?r.parentElement:r;if(!AF(o))return!1;const i=o?.closest("li");if(!i)return!1;const s=i.closest("ul, ol");if(!s)return!1;e.preventDefault(),e.stopImmediatePropagation();const a=TF(i),l=_F(i,s);switch(a.position){case"empty":RF(i,s,l,t);break;case"start":OF(i,s,t);break;case"end":PF(i,s,t);break;case"middle":IF(i,s,t)}return t.commit(),!0}function RF(e,t,n,r){switch(n){case"last":const o=document.createElement("li");o.setAttribute("style",Mn.LIST_ITEM),o.innerHTML="&nbsp;",e.after(o),vs(e,o),Wo(o);break;case"first":NF(e,t);break;case"middle":xF(e,t)}}function OF(e,t,n){const r=document.createElement("li");r.setAttribute("style",Mn.LIST_ITEM),r.innerHTML="&nbsp;",e.before(r),Wo(e)}function PF(e,t,n){const r=document.createElement("li");r.setAttribute("style",Mn.LIST_ITEM),r.innerHTML="&nbsp;",e.after(r),vs(e,r),Wo(r)}function IF(e,t,n){const r=kF(e),o=LF(e);e.innerHTML=r||"&nbsp;";const i=document.createElement("li");i.setAttribute("style",Mn.LIST_ITEM),i.innerHTML=o||"&nbsp;",e.after(i),vs(e,i),Wo(i)}function DF(e){const t=r=>FE({target:r.target},o=>e.commit(o)),n=()=>x.get("commonStyles");return function(o){const i=window.getSelection(),s=(i?.rangeCount?i.getRangeAt(0):null)?.commonAncestorContainer,a=s?.nodeType===1?s:s?.parentElement,l=a?.closest("editor"),c=window.navigator.platform.match("Mac"),u=l?f9(l):null,d=l?.closest("tr")?.querySelector("tr td:nth-of-type(2) div"),m=o.target,p=kl(m),{isList:f}=p,h=d?.textContent===l?.textContent,y=l?eE.EMPTY_TEXT.test(l.textContent||""):!1,E=c?o.metaKey:o.ctrlKey;if(E&&o.keyCode===83){o.preventDefault(),e.messageService.send({operation:"application_action",action:"save_email"});return}const C=U7(o,!!E);if(C){o.preventDefault(),e.messageService.send({operation:"application_action",action:C});return}if(o.altKey&&o.keyCode===88){o.preventDefault(),e.messageService.send({operation:"application_action",action:"toggle_editor"});return}const k={getElementParent:g=>wl(g),setCursorPosition:e.setCursorPosition,removeElementEditors:()=>$o(void 0),getVariableByIcon:ll,removeEmptyParents:hs,getAllComments:pP,isVariableComment:mv,getVariableIcon:g=>bP(g),commit:e.commit,messageService:e.messageService};if(j7(o,f,u,k))return;if(o.keyCode===27){const g=document.querySelector(".em-editor-wrapper");g?.style&&(g.style.display="none"),Jn("em-edit"),document.querySelectorAll("editor").forEach(S=>S.blur()),i?.removeAllRanges(),e.applicationElementSettingsSet({elem:null}),e.messageService.send({operation:"application_close-image-edit-popup"});return}E&&o.keyCode===66&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strong"}));const w=c?o.keyCode===88:o.keyCode===53;if((c?o.metaKey:o.altKey)&&o.shiftKey&&w&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strikethrough"})),E&&o.shiftKey&&o.keyCode===76&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_left"})),E&&o.shiftKey&&o.keyCode===82&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_right"})),E&&o.shiftKey&&o.keyCode===69&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_center"})),E&&o.keyCode===73&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_italic"})),E&&o.keyCode===85&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_underline"})),MF(o,{commit:e.commit})||X7(o,l,f,h,{commit:e.commit}))return;if(E&&o.keyCode===86){e.setIsPasteFromContextMenu(!1);const g=S=>{HE(S,!1,n(),t,e.commit),document.removeEventListener("paste",g)};document.addEventListener("paste",g)}else t(o);const b={activeElem:l,listContext:p,cursorPositionType:u,isTargetCell:h,isEmptyText:y,commit:e.commit,wrapEditor:e.wrapEditor,removeTemporaryListClasses:()=>eB()};if(bF(o,b)||(SF(o,u,y),EF(o,b)))return;const v={...b,parentElement:a,findNodeAtPosition:nF,setCursorSafely:rF};if(wF(o,v)||CF(o,f,h))return;const A={setCursorInsideSpan:vP,isCaretAtEndOfStandardElement:EP,setCursorPositionSimple:SP,commit:e.commit};G7(o,A)&&e.commit()}}function jE(e){document.body?.classList.contains("mceNonEditable")||x.get("lockEditor")||!e.target?.closest?.('[contenteditable="true"]')||!e.key||e.ctrlKey||e.altKey||e.metaKey||e.key.length===1&&(e.preventDefault(),e.stopImmediatePropagation(),document.execCommand("insertText",!1,e.key))}function BF(){return document.addEventListener("keydown",jE,!0),{dispose(){document.removeEventListener("keydown",jE,!0)}}}function HF(e){const t=tF({handlePasteTextFragment:HE,getCommonStyles:()=>x.get("commonStyles"),changeMsoValue:n=>FE({target:n.target},r=>e.commit(r)),commit:e.commit});document.addEventListener("keydown",DF({...e,setIsPasteFromContextMenu:n=>t.setFromContextMenu(n)}),!1),BF()}var FF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 4 C 10.886719 4 6.617188 7.160156 4.875 11.625 L 6.71875 12.375 C 8.175781 8.640625 11.710938 6 16 6 C 19.242188 6 22.132813 7.589844 23.9375 10 L 20 10 L 20 12 L 27 12 L 27 5 L 25 5 L 25 8.09375 C 22.808594 5.582031 19.570313 4 16 4 Z M 25.28125 19.625 C 23.824219 23.359375 20.289063 26 16 26 C 12.722656 26 9.84375 24.386719 8.03125 22 L 12 22 L 12 20 L 5 20 L 5 27 L 7 27 L 7 23.90625 C 9.1875 26.386719 12.394531 28 16 28 C 21.113281 28 25.382813 24.839844 27.125 20.375 Z"/></svg>',Wl=4;function $F(e,t){return e.left<Wl||e.right-e.left>t-8?Wl-e.left:e.right>t-Wl?t-Wl-e.right:0}var qo=null,Jm=null;function ef(e,t){if(typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))return;qo||(qo=new CSSStyleSheet),document.adoptedStyleSheets.includes(qo)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,qo]),qo.replaceSync("");const n=e.getBoundingClientRect();if(n.width===0)return;Jm=e;const r=Math.round($F(n,document.documentElement.clientWidth));r!==0&&qo.replaceSync(`${t} { margin-left: ${r}px; }`)}function WF(e,t,n){e.addEventListener("mouseenter",()=>{Jm=null,ef(t,n)}),e.addEventListener("mousemove",()=>{Jm!==t&&ef(t,n)}),t.addEventListener("mouseenter",()=>ef(t,n))}function Dr(e,t){return{settings:e,elem:t}}var Xe={applicationElementSettingsSet:e=>D(Et,He)(e),setCursorPosition:e=>D(Et,vt)(e),commit:Er};function qF(){return x.get("emailWidth")||475}function ql(){return document.documentElement.clientWidth<=qF()}function tf(e,t,n,r){const o=e;o.style.cursor=n,o.mousemove=t;const i=()=>{window.getSelection()?.removeAllRanges(),Xe.applicationElementSettingsSet({elem:e});const s=document.querySelector("[em-edit]");s&&Xe.setCursorPosition(s),document.documentElement.classList.add("em-resize-start")};o.addEventListener("touchstart",s=>{const a=s.touches[0];if(s.touches.length!==1||!a)return;s.preventDefault(),i();let l={x:a.clientX,y:a.clientY};const c={x:0,y:0},u=document.documentElement,d=p=>{const f=p.touches[0];if(!f)return;p.preventDefault(),c.x+=f.clientX-l.x,c.y+=f.clientY-l.y,l={x:f.clientX,y:f.clientY};const h={x:Math.trunc(c.x),y:Math.trunc(c.y)};h.x===0&&h.y===0||(c.x-=h.x,c.y-=h.y,o.mousemove({movementX:h.x,movementY:h.y}))},m=()=>{u.removeEventListener("touchmove",d),u.removeEventListener("touchend",m),u.removeEventListener("touchcancel",m),o.stopDrag()};u.addEventListener("touchmove",d,{passive:!1}),u.addEventListener("touchend",m),u.addEventListener("touchcancel",m)},{passive:!1}),o.onmousedown=function(){i();try{document.documentElement.addEventListener("mousemove",o.doDrag,!1),document.documentElement.addEventListener("mouseup",o.stopDrag,!1)}catch{}},o.doDrag=function(s){if(s.which!=1){o.stopDrag();return}o.mousemove(s)},o.stopDrag=function(){document.documentElement.removeEventListener("mousemove",o.doDrag,!1),document.documentElement.removeEventListener("mouseup",o.stopDrag,!1),r&&r(),setTimeout(()=>{document.documentElement.classList.remove("em-resize-start"),Xe.commit(!1)})}}function Br(e,t,n){tf(e,t,"ns-resize",n)}function Es(e,t,n){tf(e,t,"ew-resize",n)}function zF(e,t,n){tf(e,t,"nwse-resize",n)}function Hr(e,t){let n=null,r=0;const o=ql();if(e.closest('div[style*="font-size"][style*="line-height"]')){if(n=e.closest('div[style*="height"][style*="line-height"]'),!n)return;r=n.clientHeight+t,o?Bo(Dr({mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},n)):(n.style.height=r+"px",n.style.lineHeight=r+"px")}else if(e.closest(".em-gap")){if(n=e.closest(".em-gap"),!n)return;n.classList.add("em-hover"),r=n.clientHeight+t,n.closest("tr")?.querySelectorAll(".em-gap").forEach(i=>{const s={mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},a=i.closest(".em-mob-wrap, .noresp-em-mob-wrap");Bo(Dr(s,a)),i.style.height=r+"px";const l=i.querySelector(".em-element-gap-value");l&&(l.innerHTML=r+"px")})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingTop")){if(n=e.closest(".em-vindent-paddingTop"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientHeight+t,n.style.height=r+"px",o&&i?ts(Dr({mobilePadding:{top:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingTop=r+"px")}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingBottom")){if(n=e.closest(".em-vindent-paddingBottom"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientHeight+t,n.style.height=r+"px",o&&i?ts(Dr({mobilePadding:{bottom:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingBottom=r+"px")}else{if(n=e.closest("td"),!n)return;r=n.clientHeight+t,o?Bo(Dr({mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},n)):n.setAttribute("height",String(r))}if(n&&!e.closest(".em-gap")){if(r>=0){const i=n.querySelector(".em-element-vindent-value");i&&(i.innerHTML=r+"px")}r<30?n.classList.add("em-vindent_low"):n.classList.remove("em-vindent_low")}n&&Xe.commit()}function Fr(e){let t=null;const n=ql();if(e.closest('div[style*="height"][style*="line-height"]')){if(t=e.closest('div[style*="height"][style*="line-height"]'),!t)return;parseInt(t.style.height)<=0?t.remove():Xe.applicationElementSettingsSet({elem:t})}else if(e.closest(".em-gap")){if(t=e.closest(".em-gap"),!t)return;Xe.applicationElementSettingsSet({elem:Pd(t)})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingTop")){if(t=e.closest(".em-vindent-paddingTop"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.height)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-top"):r&&Xe.applicationElementSettingsSet({elem:r})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingBottom")){if(t=e.closest(".em-vindent-paddingBottom"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.height)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-bottom"):r&&Xe.applicationElementSettingsSet({elem:r})}else{if(t=e.closest("td"),!t)return;const r=t.getAttribute("height");r&&parseInt(r)<=0?t.closest("table")?.remove():Xe.applicationElementSettingsSet({elem:t})}t&&Xe.commit()}function zo(e,t){let n=null,r=0;const o=ql();if(e.closest(".em-element-resize-img-container")){const i=e.closest(".em-element-resize-img-container")?.querySelector("img");if(!i)return;const s=i.clientWidth+t;i.style.maxWidth=s+"px",i.setAttribute("width",String(s)),Xe.commit()}else if(e.closest(".em-gap")){if(n=e.closest(".em-gap"),!n)return;if(n.classList.add("em-hover"),r=n.clientWidth+t,r>=0){const i=n.clientWidth,s=Array.from(n.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(odd)")||[]).map(u=>u.clientWidth),a=s.reduce((u,d)=>u+d,0),l=a+(s.length-1)*i,c=n.closest("tr");if(!c)return;if(l-3<=c.clientWidth||t<=0){let u=Array.from(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")).filter(y=>y.dataset.percent).map(y=>y.dataset.percent);u.length||(u=s.map(y=>((y||0)/a*100).toFixed(1)),Jc(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")));const d=l-(s.length-1)*r,m=(y,E)=>Math.round(E*parseFloat(y)/100);let p=s.map((y,E)=>m(u[E],d));const f=l-(p.reduce((y,E)=>y+E,0)+(s.length-1)*r);if(f!==0){const y=p.length-Math.abs(f);p=p.map((E,C)=>y<=C?E+(f>0?1:-1):E)}const h=p;c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((y,E)=>{Array.from(y.querySelectorAll("table[width]")).filter(C=>!C.getAttribute("width")?.includes("%")).forEach(C=>{+(C.getAttribute("width")||0)<=h[E]&&(C.style.maxWidth=String(h[E]),C.setAttribute("width","100%"))})}),n.style.width=r+"px",c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((y,E)=>y.setAttribute("width",String(h[E]))),c.querySelectorAll(".em-gap").forEach(y=>{y.parentElement?.setAttribute("width",String(r)),y.style.width=r+"px";const E=y.querySelector(".em-element-gap-value");E&&(E.innerHTML=r+"px")})}}}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingLeft")){if(n=e.closest(".em-vindent-paddingLeft"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientWidth+t,n.style.width=r+"px",o&&i?ts(Dr({mobilePadding:{left:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingLeft=r+"px",i.querySelectorAll(":scope > table").forEach(s=>Ll(s)))}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingRight")){if(n=e.closest(".em-vindent-paddingRight"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientWidth+t,n.style.width=r+"px",o&&i?ts(Dr({mobilePadding:{right:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingRight=r+"px",i.querySelectorAll(":scope > table").forEach(s=>Ll(s)))}if(n&&!e.closest(".em-gap")){if(r>=0){const i=n.querySelector(".em-element-vindent-value, .em-element-gap-value");i&&(i.innerHTML=r+"px")}r<30?n.classList.add("em-vindent_low"):n.classList.remove("em-vindent_low")}n&&Xe.commit()}function Vo(e){let t=null;const n=ql();if(e.closest(".em-element-resize-img-container")){const r=e.closest(".em-element-resize-img-container")?.querySelector("img");r&&(Xe.applicationElementSettingsSet({elem:r}),Xe.commit())}else if(e.closest(".em-gap"))t=e.closest(".em-gap"),t&&Xe.applicationElementSettingsSet({elem:Pd(t)});else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingLeft")){if(t=e.closest(".em-vindent-paddingLeft"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.width)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-left"):r&&Xe.applicationElementSettingsSet({elem:r})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingRight")){if(t=e.closest(".em-vindent-paddingRight"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.width)<=0?n&&r?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-right"):r&&Xe.applicationElementSettingsSet({elem:r})}t&&Xe.commit()}var GE={getLocale:ns,commit:Er,messageService:Z},VF=".em-prevent-action",XE=new WeakSet;function UF(){return x.get("emailWidth")||475}function jF(){return x.get("isLeftButtonDown")||!1}function GF(){return x.get("editImageControlEnabled")||!1}function YE(){return x.get("imageCenterEditorEnabled")||!1}function XF(){return x.get("imageCenterStockEnabled")||!1}function YF(){return x.get("imageCenterGifEnabled")||!1}function KF(){return x.get("elementAIimageEnabled")||!1}function ZF(e){if(document.body?.classList.contains("em-native-file-drag"))return;const t=GE.getLocale(),n=UF(),r=jF(),o=YE(),i=document.documentElement.clientWidth<=(n||475);if(document.body&&!document.body.classList.contains("mceNonEditable")&&!r){if(e.tagName==="TD"&&e.innerHTML===""&&e.getAttribute("height")&&!e.classList.contains("em-vindent")&&!e.closest("editor")){e.classList.add("em-vindent"),e.closest("table")?.classList.add("em-vindent-table"),parseInt(e.getAttribute("height")||"0")<30&&e.classList.add("em-vindent_low");const f=I({targetElement:e,insertType:"append",className:"em-element-resize-height"});I({targetElement:e,insertType:"append",className:"em-element-vindent"}),I({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),Br(f,function(h){Hr(f,h.movementY)},function(){Fr(f)})}if(e.closest(VF))return;if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.getAttribute("height")&&!e.querySelector(".em-element-vindent-value")){const f=Sr(e,"em-mob-height"),h=f?parseFloat(f.substring(14,f.length-2)):void 0;I({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(h||e.getAttribute("height"))+"px":e.getAttribute("height")+"px"}),!i||!h?parseInt(e.getAttribute("height")||"0")<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):h<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}if(e.tagName==="DIV"&&e.style.height&&e.style.fontSize&&!e.classList.contains("em-vindent")&&!e.closest("editor")&&e.style.height&&e.style.lineHeight&&!e.style.fontFamily){e.classList.add("em-vindent"),parseFloat(e.style.height)<30&&e.classList.add("em-vindent_low");const f=I({targetElement:e,insertType:"append",className:"em-element-resize-height"}),h=I({targetElement:e,insertType:"append",className:"em-element-vindent"});I({targetElement:h,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.style.height}),I({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),Br(f,function(y){Hr(f,y.movementY)},function(){Fr(f)})}if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.style.height&&e.style.fontSize&&!e.querySelector(".em-element-vindent-value")){const f=Sr(e,"em-mob-height"),h=f?parseFloat(f.substring(14,f.length-2)):void 0;I({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(h||parseFloat(e.style.height))+"px":parseFloat(e.style.height)+"px"}),!i||!h?parseFloat(e.style.height)<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):h<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}const s=Sr(e,"em-mob-padding_top"),a=s?parseFloat(s.substring(19)):void 0,l=Sr(e,"em-mob-padding_bottom"),c=l?parseFloat(l.substring(22)):void 0,u=Sr(e,"em-mob-padding_left"),d=u?parseFloat(u.substring(20)):void 0,m=Sr(e,"em-mob-padding_right"),p=m?parseFloat(m.substring(21)):void 0;if((e.style.padding||e.style.paddingTop||e.style.paddingBottom||e.style.paddingLeft||e.style.paddingRight)&&!e.closest("editor")&&(e.tagName!=="A"||e.style.height)){if(e.style.paddingTop&&!e.querySelector(":scope > .em-vindent-paddingTop")&&!e.querySelector(":scope > editor > .em-vindent-paddingTop")&&(!a||!i)){const f=I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${e.style.paddingTop}`});e.getBoundingClientRect().top<30&&f.classList.add("top-crossed")}e.style.paddingBottom&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&!e.querySelector(":scope > editor > .em-vindent-paddingBottom")&&(!c||!i)&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${e.style.paddingBottom}`}),e.style.paddingLeft&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&!e.querySelector(":scope > editor > .em-vindent-paddingLeft")&&(!d||!i)&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${e.style.paddingLeft}`}),e.style.paddingRight&&!e.querySelector(":scope > .em-vindent-paddingRight")&&!e.querySelector(":scope > editor > .em-vindent-paddingRight")&&(!p||!i)&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${e.style.paddingRight}`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(f=>{if(!f.querySelector(".em-element-resize-height")){const h=f;(parseFloat(h.style.height)<30||parseFloat(h.style.width)<30)&&f.classList.add("em-vindent_low");const y=I({targetElement:h,insertType:"append",className:"em-element-resize-height"});I({targetElement:h,insertType:"append",className:"em-element-vindent-marker"}),I({targetElement:h,insertType:"append",className:"em-element-vindent-bg"});const E=I({targetElement:h,insertType:"append",className:"em-element-vindent"});let C="";h.className.indexOf("paddingTop")>-1?(C=e.style.paddingTop,Br(y,function(k){Hr(y,k.movementY)},function(){Fr(y)})):h.className.indexOf("paddingBottom")>-1?(C=e.style.paddingBottom,Br(y,function(k){Hr(y,k.movementY)},function(){Fr(y)})):h.className.indexOf("paddingLeft")>-1?(C=e.style.paddingLeft,Es(y,function(k){zo(y,k.movementX)},function(){Vo(y)})):h.className.indexOf("paddingRight")>-1&&(C=e.style.paddingRight,Es(y,function(k){zo(y,-k.movementX)},function(){Vo(y)})),I({targetElement:E,insertType:"append",className:"em-element-vindent-value",HTMLcontent:C})}})}if(e.className.length&&e.className?.includes("em-mob-padding")&&!e.closest("editor")&&i&&(a&&!e.querySelector(":scope > .em-vindent-paddingTop")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${a}px`}),c&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${c}px`}),d&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${d}px`}),p&&!e.querySelector(":scope > .em-vindent-paddingRight")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${p}px`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(f=>{if(!f.querySelector(".em-element-resize-height")){const h=f;(parseFloat(h.style.height)<30||parseFloat(h.style.width)<30)&&f.classList.add("em-vindent_low");const y=I({targetElement:h,insertType:"append",className:"em-element-resize-height"});I({targetElement:h,insertType:"append",className:"em-element-vindent-marker"}),I({targetElement:h,insertType:"append",className:"em-element-vindent-bg"});const E=I({targetElement:h,insertType:"append",className:"em-element-vindent"});let C="";h.className.indexOf("paddingTop")>-1?(C=a,Br(y,function(k){Hr(y,k.movementY)},function(){Fr(y)})):h.className.indexOf("paddingBottom")>-1?(C=c,Br(y,function(k){Hr(y,k.movementY)},function(){Fr(y)})):h.className.indexOf("paddingLeft")>-1?(C=d,Es(y,function(k){zo(y,k.movementX)},function(){Vo(y)})):h.className.indexOf("paddingRight")>-1&&(C=p,Es(y,function(k){zo(y,-k.movementX)},function(){Vo(y)})),I({targetElement:E,insertType:"append",className:"em-element-vindent-value",HTMLcontent:String(C)})}})),e.closest('[em="block"]')?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length||0)>2&&!e.closest('[em="block"]')?.querySelector(".em-mob-wrap .em-gap, .noresp-em-mob-wrap .em-gap")){const f=Sr(e.closest('[em="block"]')?.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),"em-mob-height"),h=f?parseFloat(f.substring(14,f.length-2)):void 0;e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(y=>{I({targetElement:y,insertType:"append",className:"em-gap",style:i?`height: ${h}px;`:`width: ${y.getAttribute("width")}px;`})}),e.closest('[em="block"]')?.querySelectorAll(".em-gap").forEach(y=>{if(!y.querySelector(".em-element-resize-height")){const E=y,C=I({targetElement:E,insertType:"append",className:"em-element-resize-height"});I({targetElement:E,insertType:"append",className:"em-element-gap-marker"}),I({targetElement:E,insertType:"append",className:"em-element-gap-bg"});const k=I({targetElement:E,insertType:"append",className:"em-element-gap"});let w="";i?(w=E.style.height,Br(C,function(b){Hr(C,b.movementY)},function(){Fr(C)})):(w=E.style.width,Es(C,function(b){zo(C,b.movementX)},function(){Vo(C)})),I({targetElement:k,insertType:"append",className:"em-element-gap-value",HTMLcontent:w})}})}if(e.tagName==="IMG"){const f=e;if(f.closest("td[em-platform], td[data-em-platform]"))return;if(f.closest(".em-element-resize-img-container")||f.closest('div[style*="font-size"][style*="line-height"][style*="font-family"]')||f.closest("editor")||f.classList.contains("em-video")){if(f.closest(".em-element-resize-img-container")){const C=f.closest(".em-element-resize-img-container"),k=C.querySelector(".em-element-img-edit");!f.getAttribute("src")?.includes(".gif")&&o?k||I({targetElement:C.querySelector(".em-element-img-change-group"),insertType:"prepend",className:"em-element-img-edit",tag:"i",HTMLcontent:ke(bs,`${_e}`),title:t.CHANGE_IMAGE_EDIT}):C.querySelector(".em-element-img-edit")?.remove()}return}const h=document.createElement("span");h.classList.add("em-element-resize-img-container");const y=f.parentElement instanceof HTMLAnchorElement?f.parentElement:f;y.parentElement?.insertBefore(h,y),h.appendChild(y);const E=I({targetElement:h,insertType:"append",tag:"span",className:"em-element-resize-img"});zF(E,function(C){zo(E,C.movementX)},function(){Vo(E)}),f?.style.maxWidth&&f?.style.display==="block"&&f.closest(".em-element-resize-img-container")?.classList.add("em-display-block"),QF(f,h)}}}function QF(e,t){const n=GE;if(!n||t.querySelector(".em-element-img-change-group"))return;const r=n.getLocale(),o=GF(),i=YE(),s=XF(),a=YF(),l=KF();if(o&&e.getBoundingClientRect().width>40&&e.getBoundingClientRect().height>40&&!e.classList.contains("em-countdown")){const c=I({targetElement:t,insertType:"append",className:"em-element-img-change-group"});if(I({targetElement:c,insertType:"append",className:"em-element-img-change",HTMLcontent:'<svg viewBox="0 0 20 20" focusable="false" data-icon="bg-colors" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M3.75 17.5C3.41667 17.5 3.125 17.375 2.875 17.125C2.625 16.875 2.5 16.5833 2.5 16.25V3.75C2.5 3.41667 2.625 3.125 2.875 2.875C3.125 2.625 3.41667 2.5 3.75 2.5H16.25C16.5833 2.5 16.875 2.625 17.125 2.875C17.375 3.125 17.5 3.41667 17.5 3.75V16.25C17.5 16.5833 17.375 16.875 17.125 17.125C16.875 17.375 16.5833 17.5 16.25 17.5H3.75ZM3.75 16.25H16.25V3.75H3.75V16.25ZM4.91667 14.2292H15.1042L12.0417 10.1458L9.29167 13.7083L7.35417 11.0625L4.91667 14.2292Z"></path></svg>',title:r.CHANGE_IMAGE}),!e.getAttribute("src")?.includes(".gif")&&i&&I({targetElement:c,insertType:"append",className:"em-element-img-edit",tag:"i",HTMLcontent:ke(bs,`${_e}`),title:r.CHANGE_IMAGE_EDIT}),s&&I({targetElement:c,insertType:"append",className:"em-element-img-stock",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M4.12726 7.18183H9.6909L7.86364 4.76364L6.44545 6.63637L5.4909 5.49092L4.12726 7.18183ZM0.909082 11.3636C0.659082 11.3636 0.445068 11.2746 0.267041 11.0966C0.0890136 10.9186 0 10.7046 0 10.4546V2.99999H0.909082V10.4546H10.7273V11.3636H0.909082ZM2.72726 9.54546C2.47726 9.54546 2.26325 9.45644 2.08522 9.27842C1.90719 9.10039 1.81818 8.88638 1.81818 8.63638V1.90908C1.81818 1.65908 1.90719 1.44507 2.08522 1.26704C2.26325 1.08901 2.47726 1 2.72726 1H5.81817L6.90908 2.09091H11.0909C11.3409 2.09091 11.5549 2.17992 11.733 2.35795C11.911 2.53598 12 2.74999 12 2.99999V8.63638C12 8.88638 11.911 9.10039 11.733 9.27842C11.5549 9.45644 11.3409 9.54546 11.0909 9.54546H2.72726ZM2.72726 8.63638H11.0909V2.99999H6.53182L5.44091 1.90908H2.72726V8.63638Z"></path></svg>',title:r.CHANGE_IMAGE_STOCK}),I({targetElement:c,insertType:"append",className:"em-element-img-changeto",tag:"i",HTMLcontent:ke(FF,`${_e}`),title:r.CHANGE_IMAGE_CHANGETO}),a&&I({targetElement:c,insertType:"append",className:"em-element-img-gif",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><<path d="M5.68571 8.14286V3H6.79999V8.14286H5.68571ZM0.771429 8.14286C0.54 8.14286 0.353571 8.06786 0.212143 7.91786C0.0707142 7.76786 0 7.58571 0 7.37143V3.77143C0 3.55714 0.0707142 3.375 0.212143 3.225C0.353571 3.075 0.54 3 0.771429 3H3.40001C3.63144 3 3.81786 3.075 3.95929 3.225C4.10072 3.375 4.17144 3.55714 4.17144 3.77143V4.11429H1.11429V7.02857H3.05715V5.57143H4.17144V7.37143C4.17144 7.58571 4.10072 7.76786 3.95929 7.91786C3.81786 8.06786 3.63144 8.14286 3.40001 8.14286H0.771429ZM8.25714 8.14286V3H12V4.11429H9.37142V5.25714H11.1V6.37142H9.37142V8.14286H8.25714Z"></path></svg>',title:r.CHANGE_IMAGE_GIF}),l&&I({targetElement:c,insertType:"append",className:"em-element-img-ai",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z"></path><path d="M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z"></path><path d="M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z"></path><path d="M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z"></path></svg>',title:r.CHANGE_IMAGE_AI}),n.commit(!1),XE.has(c))return;XE.add(c),WF(t,c,".em-element-resize-img-container:hover > .em-element-img-change-group:hover"),c.addEventListener("click",function(u){const d=u.target.closest('i[class*="em-element-img"]'),m=e.getAttribute("src");let p="application_open-image-edit-popup";e.classList.contains("em-ai-img")||d?.classList.contains("em-element-img-ai")?p="application_open-image-ai-popup":oI(m)||d?.classList.contains("em-element-img-changeto")?p="application_open-image-upload-popup":d?.classList.contains("em-element-img-gif")?p="application_open-image-gif-popup":d?.classList.contains("em-element-img-stock")&&(p="application_open-image-stock-popup");const f={operation:p,src:m};setTimeout(()=>{n.messageService.send(f)},100)})}}function JF(e){return function(n){let r=n.target;try{r=e.getVisibleNode(r);const o=e.isInExternal(r);e.incrementActiveElementLocked();const i=document.body;if(i?.classList.contains("mceNonEditable")&&!i.classList.contains("em-sandbox-discuss")||i?.classList.contains("em-sandbox-discuss")&&!i.classList.contains("em-sandbox-discuss_set-target"))return;if(i?.classList.contains("em-sandbox-discuss_set-target")){document.querySelectorAll('[em-hover="true"]').forEach(u=>{u.removeAttribute("em-hover"),u.removeAttribute("contenteditable")}),r.closest(".em-element-vindent")||(r.setAttribute("em-hover","true"),r.setAttribute("contenteditable","true"));return}if(r.tagName!=="BODY"){const u=r.parentElement;Py(r)&&!r.isConnected&&u&&(r=u)}if(r&&(r?.closest('[em="atom"]')||!o)&&r.getAttribute("contenteditable")!=="false"&&r.parentElement?.getAttribute("contenteditable")!=="false"&&r.tagName!=="BODY"&&r.parentElement?.tagName!=="SECTION"){const u=!r.closest("editor"),d=!e.getLockEditorInit(),m=r.tagName!=="IMG",p=!(r.childElementCount===1&&r.firstElementChild?.tagName==="IMG"&&(r.textContent?.trim()??"")==="");if(u&&d&&m&&p){let f=r;do if(f=f.closest("div, p, h1, h2, h3, h4, h5")||f.closest("span, b, strong, i, em, s, a, sup, sub"),f)if(!e.isVisible(f))f=f.parentElement;else break;while(f);if(r.tagName==="LI"&&r.style.fontFamily&&r.style.fontSize){const h=r.closest("ul, ol");h&&e.wrapEditor(h,!0)}else if(r.tagName==="TD"&&r.style.fontFamily&&r.style.fontSize&&!r.querySelector("editor"))e.wrapEditor(r);else if(f&&f.style.fontFamily&&f.style.fontSize&&(r.tagName==="LI"||!r.querySelector("img")))if(r.tagName==="LI"){const h=r.closest("ul, ol");h&&e.wrapEditor(h,!0)}else r.querySelector("img")||e.wrapEditor(r,!0);else if(f&&f.closest('[style*="font-family"][style*="font-size"]')){const h=f.closest('[style*="font-family"][style*="font-size"]');h&&h.tagName!=="BODY"&&h.tagName!=="TD"&&h.tagName!=="TABLE"?e.wrapEditor(h,!1):h?.tagName==="TD"&&!h.querySelector("editor")&&!h.closest(".em-element-custom-table")&&e.wrapEditor(h)}else if(f&&f?.tagName==="DIV"&&!f.querySelector("table")){const h=!!f.style.height?.length,y=f.className.includes("em-element-img-change-group"),E=f.querySelector("img")?.parentNode,C=!!f.querySelector("img")&&E&&!e.hasTextNodeInElement(E);!h&&!y&&!C&&e.wrapEditor(f,!0)}else for(let h=0;h<r.childNodes.length;h++){const y=r.childNodes[h];if(y.nodeName==="#text"&&(y.textContent?.trim().length??0)>0&&!r.querySelector("table")){const E=r.tagName==="P"?r.parentElement:r;E&&e.wrapEditor(E);break}}}}(r?.closest('[em="atom"]')||!o)&&!e.getIsLeftButtonDown()&&e.implementElementsEditors(r),r?.classList.contains("em-element-vindent-bg")&&(r=r.closest(".em-vindent")),r?.closest(".em-gap")?r.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(even) .em-gap").forEach(u=>u.classList.add("em-hover")):e.getIsLeftButtonDown()||document.querySelectorAll(".em-gap").forEach(u=>u.classList.remove("em-hover"));const s=e.getLoadStylesTimer(),a=!!r.style.padding||!!r.style.paddingTop||!!r.style.paddingBottom||!!r.style.paddingLeft||!!r.style.paddingRight,l=r.closest('[em="block"]'),c=!!l?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(l?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length??0)>2;s&&(r.tagName==="TD"&&(r.innerHTML===""||r.querySelector(".em-element-vindent"))&&r.getAttribute("height")||r.tagName==="DIV"&&r.style.height&&r.style.fontSize||r.tagName==="IMG"||a||c)&&e.implementResizableElems(r)}catch{}finally{Promise.resolve().then(()=>e.decrementActiveElementLocked())}}}function e$(e){return function(){e.removeElementEditors(),document.querySelectorAll('[em="group"] .em-element-editor, .em-element-path, .em-element-block-add').forEach(n=>{n.remove(),e.commit(!1)})}}function zl(e){e.button===0&&x.set("isLeftButtonDown",!1)}function KE(e){e.shiftKey||e.button===2||window.getSelection()?.removeAllRanges(),e.button===0&&x.set("isLeftButtonDown",!0)}function ZE(){x.set("lockEditorInit",!1)}function t$(){return document.addEventListener("mousedown",KE),document.addEventListener("mouseup",zl),document.addEventListener("dragend",zl),window.addEventListener("mousemove",ZE),{dispose(){document.removeEventListener("mousedown",KE),document.removeEventListener("mouseup",zl),document.removeEventListener("dragend",zl),window.removeEventListener("mousemove",ZE)}}}var n$=1e3;function r$(e){setTimeout(()=>x.set("loadStylesTimer",!0),n$);const t=JF({getVisibleNode:n=>e.htmlDocument.getVisibleNode(n),isInExternal:n=>e.htmlDocument.isInExternal(n),isVisible:n=>e.htmlDocument.isVisible(n),incrementActiveElementLocked:()=>x.increment("activeElementLocked"),decrementActiveElementLocked:()=>x.decrement("activeElementLocked"),getLockEditorInit:()=>!!x.get("lockEditorInit"),getIsLeftButtonDown:()=>!!x.get("isLeftButtonDown"),getLoadStylesTimer:()=>!!x.get("loadStylesTimer"),hasTextNodeInElement:U_,wrapEditor:e.wrapEditor,implementElementsEditors:n=>hF(n,{setBlockGroupControlsPosition:()=>bl({scrollTop:x.get("scrollTop")}),commit:e.commit}),implementResizableElems:n=>ZF(e.htmlDocument.getVisibleNode(n)),commit:e.commit});document.onmouseover=n=>{t(n),e.onHover?.(n.target)},document.onmouseleave=e$({removeElementEditors:()=>$o(void 0),commit:e.commit}),t$()}function o$(e){return t=>D(e,Jo)(t)}function i$(e){return e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement??null}var s$={name:"sandbox.elementSettings",provides:[He],awaits:{services:[te,zr,Vr]},setup(e){const t=D(e,zr);e.inject(He,gB({htmlDocument:D(e,te),getMapObj:()=>t,fingerprint:D(e,Vr),enrichExtras:()=>e.getServices(yf).reduce((n,r)=>({...n,...r()}),{})}))}},a$={name:"sandbox.documentChange",awaits:{services:[te,Vr,He,at,xe,Jo]},setup:e=>J3({htmlDocument:D(e,te),fingerprint:D(e,Vr),initPreview:o$(e),applicationElementSettingsSet:D(e,He),commit:lt(e),focusController:D(e,at).controller})},l$={name:"sandbox.toggleTextStyle",provides:[Ps],awaits:{services:[He,xe]},setup(e){const t=D(e,He),n=lt(e),r=(o,i=Ke())=>{let s=i$(di(i,o)||o);if(s?.tagName==="EDITOR"&&(s=s.firstElementChild),!s)return;const a=x.get("activeElementLocked")>0;try{a&&x.decrement("activeElementLocked"),t({elem:s})}finally{a&&x.increment("activeElementLocked")}};e.inject(Ps,Q7({commit:n,addNewRange:lo,refreshElementSettings:r,findElementWithSelectedText:di,getParentElementOfSelection:ua,findOutermostParentWithText:Qc,clearLinkTags:o=>{Mr(o,n),mr(n)},addFontFamilyClass:o=>Zi(o,n),getIsProgrammaticSelection:()=>!!x.get("isProgrammaticSelection"),getCommonStyles:()=>x.get("commonStyles")??{}}))}},c$={name:"sandbox.insert",provides:[Ur],awaits:{services:[te,He,xe,lc]},setup:e=>e.inject(Ur,KH({htmlDocument:D(e,te),commit:lt(e),messageService:Z,applicationElementSettingsSet:D(e,He),...D(e,lc)}))},u$={name:"sandbox.elementSettingsApply",provides:[Is],awaits:{services:[te,zr,xe,vt,He,Ps,Qt,at]},setup(e){const t=D(e,xe),n=D(e,zr),r=D(e,vt),o=D(e,He);let i=null;const s=l=>{i??(i=V7({htmlDocument:D(e,te),getMapObj:()=>n,commit:lt(e),commitLockedAsync:c=>t.commitLockedAsync(c),setCursorPosition:r,applicationElementSettingsSet:o,toggleTextStyle:D(e,Ps),wrapEditor:D(e,Qt).now,programmaticSelection:{get value(){return!!x.get("isProgrammaticSelection")},set value(c){x.set("isProgrammaticSelection",c)}}})),i(l)},a=D(e,at).controller;e.inject(Is,l=>a.whenEditorLostFocus(()=>s(l)))}},d$={name:"sandbox.mouse",awaits:{services:[te,Qt,xe]},setup:e=>r$({htmlDocument:D(e,te),commit:lt(e),wrapEditor:D(e,Qt).deferred})},m$={name:"sandbox.click",awaits:{services:[te,xe,vt,at,He,Qt]},setup(e){const t=D(e,xe),n=D(e,at);FH({htmlDocument:D(e,te),commit:lt(e),commitLockedAsync:r=>t.commitLockedAsync(r),messageService:Z,setCursorPosition:D(e,vt),setEditorFocus:r=>n.setEditorFocus(r),applicationElementSettingsSet:D(e,He),wrapEditor:D(e,Qt).now,insertTextAtomIntoEmptyNarrowTable:r=>e.getInstance(bf)?.(r)??!1})}},f$={name:"sandbox.keyboard",awaits:{services:[xe,vt,He,Qt]},setup:e=>HF({commit:lt(e),messageService:Z,setCursorPosition:D(e,vt),applicationElementSettingsSet:D(e,He),wrapEditor:D(e,Qt).now})},p$={name:"sandbox.cssFilterOnCommit",awaits:{services:[te]},setup:e=>r3(D(e,te))},h$={name:"sandbox.vmlButtonLabelSync",awaits:{services:[xe]},setup(e){const t=D(e,xe);K7(n=>t.commit(n))}},g$={name:"sandbox.insertListeners",awaits:{services:[Ur]},setup:e=>D(e,Ur).register()};function b$(e,t){try{t.state.increment("activeElementLocked");const n=t.getActiveEditElement();if(!n)return;const r=n.closest("amp-accordion");if(!r)return;const o=t.HTMLDocument.getOuterHtml(r),i=t.parseFromString(o)[0];if(!i)return;const s=i.querySelector("section");if(!s)return;const a=s.cloneNode(!0),l=a.querySelector(":scope > header td div");if(l){const u=Array.from(l.childNodes).find(d=>d.nodeType===Node.TEXT_NODE);u&&(u.nodeValue=e.section)}const c=a.querySelector(":scope > div");c&&(c.innerHTML=`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom">
250
+ <tr>
251
+ <td style="padding: 10px 0;">
252
+ <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${e.text}</div>
253
+ </td>
254
+ </tr></table>`),i.append(a),i.setAttribute("em-edit","active"),r.replaceWith(i),t.commit(!0)}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function y$(e,t){try{t.state.increment("activeElementLocked");const n=t.getActiveEditElement();if(!n)return;const r=n.closest("amp-accordion");if(!r)return;const o=t.HTMLDocument.getOuterHtml(r),i=t.parseFromString(o)[0];if(!i)return;const s=i.querySelectorAll("section");s[e.index]&&s[e.index].remove(),i.setAttribute("em-edit","active"),r.replaceWith(i),t.commit(!0)}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function QE(e){return{state:e.state,commit:e.commit,getActiveEditElement:e.getActiveEditElement,HTMLDocument:e.HTMLDocument,parseFromString:e.parseFromString}}function v$(e,t){!t.state||!t.HTMLDocument||!t.getActiveEditElement||!t.parseFromString||b$(e.data.settings,QE(t))}function E$(e,t){!t.state||!t.HTMLDocument||!t.getActiveEditElement||!t.parseFromString||y$(e.data.settings,QE(t))}var S$={sandbox_accordion_add_section:v$,sandbox_accordion_remove_section:E$};function w$(e,t){Un(),document.body?.classList.contains("em-block-insert-body")&&document.body.classList.remove("em-block-insert-body"),document.body?.classList.contains("em-atom-insert-body")&&document.body.classList.remove("em-atom-insert-body");const n=document.querySelector(".em-block-insert");n&&n.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top");const r=document.querySelector(".em-block-insert-empty");r&&r.classList.remove("em-block-insert-empty");const o=document.querySelector(".em-atom-insert");o&&o.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top");const i=document.querySelector(".em-atom-insert-empty");i&&i.classList.remove("em-atom-insert-empty"),document.querySelectorAll(".em-blockatom-insert").forEach(s=>{s.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),t.messageService.send({operation:"application_scroll-block-hide"})}function C$(e,t){t.messageService.send({operation:"application_email_content_get",htmlCode:ko({node:document.body,isPartial:!0})})}var A$={"sandbox_drag-cancel":w$,sandbox_email_content_get:C$};function T$(e,t){const n=e.data.settings?.emBlockId;if(n==null||n==="")return;const r=e.data.settings?.emBlockVersion;let o=MI()??null;o||(o=(document.querySelector('[em-edit="active"]')||document.querySelector(".em-element-editor"))?.closest?.('[em="block"]')??document.querySelector('[em="block"]')),o&&(o.setAttribute("em-block-id",String(n)),r!=null&&r!==""&&o.setAttribute("em-block-version",String(r)),t.commit())}var _$={sandbox_eblock_set_em_block_id:T$},k$=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><rect width="28" height="28" rx="3" fill="#e5e7eb"/><circle cx="18.5" cy="9.5" r="2.5" fill="#9ca3af"/><path d="M5 21l6-7 4 4.5 3-3 5 5.5z" fill="#9ca3af"/></svg>')}`;function Vl(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem.previousSibling&&Vl({elem:e.elem.previousSibling})}function Ul(e){if(!e.elem)return!1;if(e.elem.parentElement?.tagName==="SECTION"||e.elem.classList.contains("em-narrow-table")&&Array.from(e.elem.childNodes).every(n=>n.nodeType===Node.TEXT_NODE))return e.elem.innerHTML="",!1;e.elem.querySelector(".em-element-editor")&&e.elem.querySelector(".em-element-editor")?.remove(),e.elem.querySelector(".em-element-path")&&e.elem.querySelectorAll(".em-element-path").forEach(n=>n.remove()),e.elem.querySelector(".em-element-block-add")&&e.elem.querySelectorAll(".em-element-block-add").forEach(n=>n.remove()),e.elem.querySelector(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft")&&e.elem.querySelectorAll(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft").forEach(n=>n.remove());const t=e.elem.parentElement;if(e.elem.classList.contains("em-mob-wrap")||e.elem.classList.contains("noresp-em-mob-wrap"))e.elem.innerHTML.trim()===""&&(e.elem.parentElement?.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1?e.elem.innerHTML="":(e.elem.remove(),Ul({elem:t})));else if(e.elem.innerHTML.trim()==="")Vl({elem:e.elem}),e.elem.remove(),Ul({elem:t});else if(t&&!t.querySelector('div[style*="display"]')){for(const n of e.elem.childNodes)n.nodeName==="#text"&&n.textContent?.trim()===""?(Vl({elem:n}),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(Vl({elem:n}),n.remove());e.elem.innerHTML.trim()===""&&Ul({elem:e.elem})}return!0}function L$(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=e.getElementParent(t);let r=t.parentNode;const o=t.closest("editor");if(e.setCursorPosition(n),t.classList.contains("em-code")){const i=e.getVariableByIcon?.(t);i&&(i.parentNode?.removeChild(i),t.remove())}else if(t.tagName==="TD"&&t.innerHTML===""&&t.hasAttribute("height")){const i=t.closest("table");if(i){const s=i.previousSibling;s&&s?.textContent?.trim()===""&&s.remove(),i.remove()}}else if(t.closest(".em-element-resize-img-container"))r=t.closest(".em-element-resize-img-container").parentNode,t.closest("td")?.querySelector("editor")?.innerHTML===""&&t.closest("td")?.querySelector("editor")?.remove(),t.closest(".em-element-resize-img-container")?.remove();else if(t.closest('[em="atom"]')){const i=t.closest(".em-mob-wrap, .noresp-em-mob-wrap"),s=t.closest('[em="atom"]');t.tagName==="TD"&&t.previousElementSibling===null&&t.nextElementSibling===null?(r=s.parentNode,s?.remove()):(r=t.closest("td"),t.remove());const a=!!i&&Array.from(i.querySelectorAll('[em="atom"]')).some(l=>l!==s);t.tagName!=="TD"&&i&&!a&&i.textContent?.trim()===""&&(i.textContent="")}else{t.remove();const i=t.previousSibling;i&&i?.textContent?.trim()===""&&i.remove(),t.remove()}o&&o.remove(),Ul({elem:r}),e.commit(),e.messageService.send({operation:"application_element_settings_close"})}function N$(e,t){const n=document.querySelector("[em-edit]");if(n)if(e.action==="add_p"){let r=null;if(["DIV","P","TD","EDITOR","B","STRONG","SPAN","I","EM","A"].includes(n.tagName)){if(n.closest("div")?.style.fontFamily?r=n.closest("div"):n.closest("p")?.style.fontFamily?r=n.closest("p"):r=n,r&&t.HTMLDocument){const o=t.HTMLDocument.getOuterHtml(r),i=r.closest("table"),s=`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td style="padding-bottom: 10px;">${o}</td></tr></table>`;qe(i?.getAttribute("em")==="atom"?i:r,"afterend",s)}t.commit()}t.setCursorPosition(n)}else if(e.action==="add_img"){if(window.getSelection){const r=document.createElement("img");r.setAttribute("src",k$),r.setAttribute("width","28"),r.setAttribute("border","0"),r.setAttribute("alt",""),r.style.display="inline-block",r.style.verticalAlign="text-bottom";const o=window.getSelection();if(o?.getRangeAt&&o.rangeCount){const i=o.getRangeAt(0);i.deleteContents(),i.insertNode(r)}else document.querySelector("[em-edit]")?.prepend(r);t.commit()}}else(e.action==="typograf"||e.action==="typograf_all")&&x$(e,t).catch(r=>{})}async function x$(e,t){const{default:n}=await Wc(async()=>{const{default:l}=await Promise.resolve().then(()=>Zl("./typograf.all.Mun9CrLC.js"));return{default:l}},void 0,{}.url);let r=document.querySelector("[em-edit]")?.closest("div")||document.querySelector("[em-edit]")?.closest("editor")||null;const o=e.action==="typograf"?r?.innerText:document.body.innerText,i=t.hasRussianText?.(o||"")??!1,s=new n({locale:[e.locale==="ru_RU"||i?"ru":"en-US"],htmlEntity:{type:"name",onlyInvisible:!0,list:["nbsp","shy","mdash","ndash","laquo","raquo"]}});s.disableRule("ru/punctuation/*"),s.disableRule("common/punctuation/*"),s.enableRule("common/punctuation/quote"),s.setSetting("common/punctuation/quote","ru",{left:"«",right:"»",removeDuplicateQuotes:!0}),s.setSetting("common/punctuation/quote","en-US",{left:'"',right:'"',removeDuplicateQuotes:!0}),s.disableRule("ru/dash/kakto"),s.disableRule("ru/dash/taki"),s.disableRule("ru/dash/izpod"),s.disableRule("ru/dash/izza"),s.disableRule("ru/dash/ka"),s.disableRule("ru/dash/to"),s.disableRule("ru/dash/koe"),s.disableRule("common/nbsp/nowrap"),s.disableRule("common/nbsp/dpi"),s.disableRule("common/nbsp/afterParagraphMark"),s.enableRule("common/nbsp/afterNumber"),s.disableRule("common/html/quot"),s.disableRule("ru/date/*"),s.disableRule("common/number/mathSigns"),s.disableRule("ru/number/ordinals"),s.disableRule("ru/number/comma"),s.disableRule("ru/symbols/NN"),s.disableRule("common/symbols/cf"),s.disableRule("ru/other/phone-number"),s.addSafeTag('<[^>]+class="preheader"[^>]*>',"</[^>]+>"),s.addSafeTag("<!--","-->");function a(l){let c=s.execute(l);return c=c.replace(/\b(\d{1,3}(?:[ \u00A0]\d{3})*(?:[.,]\d+)?)\b/g,function(u){return u.replace(/[ \u00A0]/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,"&nbsp;")}),c=c.replace(/(\d[\d&nbsp;]*[.,]?\d+)(?:\s|&nbsp;)?(?=(?:руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB))/gi,"$1&nbsp;"),c=c.replace(/(\d[\d&nbsp;]*[.,]?\d+)&nbsp;(руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB)/gi,"$1&nbsp;$2"),c}if(e.action==="typograf_all"){const l=document.body;l&&(l.innerHTML=a(l.innerHTML))}else r?.parentElement&&(r=r.parentElement,r?.parentElement&&(r.parentElement.innerHTML=a(r.parentElement.innerHTML)));document.querySelectorAll(".em-element-resize-img-container").forEach(l=>l.replaceWith(...l.childNodes)),document.querySelectorAll(".em-element-img-change-group").forEach(l=>l.remove()),document.querySelectorAll("editor").forEach(l=>l.replaceWith(...l.childNodes)),t.commit()}function JE(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function nf(e){if(!e||e.tagName!=="A")return!1;const t=e.getAttribute("style");if(!t||!t.includes("display"))return!1;const n=e.style.display;return!(n!=="block"&&n!=="inline-block"||t.includes("mso-style-priority"))}function M$(e,t){const n=e.closest("a");if(nf(n))return n;if(!t)return null;const r=JE(t.anchorNode)?.closest("a")??null;if(nf(r))return r;const o=JE(t.focusNode)?.closest("a")??null;return nf(o)?o:null}function eS(e){return e.tagName==="IMG"?e.closest('div[em="atom"]')||e.closest(".em-element-resize-img-container")||e:e.closest("editor")?e.closest('[style*="font-family"][style*="font-size"]')||e:e.tagName==="TD"&&e.classList.contains("em-vindent")?e.closest(".em-vindent-table")||e:e.tagName==="TD"&&bv(e)?e.closest('[em="block"]')??e:e}function tS(e){return e?e.classList.contains("em-vindent-table")?e.querySelector("td"):e.classList.contains("em-element-resize-img-container")?e.querySelector("img"):e.getAttribute("em")==="block"&&e.tagName!=="DIV"?Po(e)??e:e:null}function R$(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=window.getSelection();if(M$(t,n)&&n&&!n.isCollapsed)try{n.collapseToEnd()}catch{}const r=e.getElementParent(t);r instanceof Element&&(e.setCursorPosition(r),e.applicationElementSettingsSet({elem:r}))}function O$(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=tS(eS(t).previousElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function P$(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=tS(eS(t).nextElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function I$(e,t){t.removeAllAttributes("em-edit");const n=document.querySelector(".em-editor-wrapper");n&&(n.style.display="none"),document.querySelectorAll("editor").forEach(r=>{r.blur()})}function D$(e,t){const n=t.elementPath[e.data.index??0];if(n?.elem){const r=n.elem;t.applicationElementSettingsSet({elem:r}),t.setCursorPosition(r)}}function B$(e,t){t.removeAllAttributes("em-state");const n=t.elementPath[e.data.index??0];n?.elem&&n.elem.setAttribute("em-state","active")}function H$(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};R$(n)}function F$(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};O$(n)}function $$(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};P$(n)}function W$(e,t){if(!t.getElementParent||!t.state)return;const n={state:t.state,commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,getVariableByIcon:t.getVariableByIcon};L$(n)}function q$(e,t){if(!t.getElementParent||!t.state)return;const n={action:e.data.action,locale:e.data.locale},r={state:t.state,commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,HTMLDocument:t.HTMLDocument,hasRussianText:t.hasRussianText};N$(n,r)}var z$={sandbox_element_active_reset:I$,sandbox_element_active_set:D$,sandbox_element_hover_set:B$,sandbox_element_parent_get:H$,sandbox_element_prev_get:F$,sandbox_element_next_get:$$,sandbox_element_remove:W$,sandbox_element_text:q$},un=".em-mob-wrap, .noresp-em-mob-wrap",ht=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",rt='div[style*="inline-block"]';function $r(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replaceAll(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&$r({elem:e.elem.previousSibling,width:e.width})}function nS(e){const t=e.removedBlockIndex===0?"nextSibling":"previousSibling";e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem[t]&&nS({elem:e.elem[t],removedBlockIndex:e.removedBlockIndex})}function jl(e){return!!e.querySelector(un)||!!e.closest(un)}function Ss(e){return e.querySelector(un)?document.querySelector('[em-edit="active"]'):e.closest(un).parentElement}function Gl(e){return e.querySelector(rt)?document.querySelector('[em-edit="active"]'):e.closest(rt).parentElement}function V$(e,t){const n=document.querySelector("[em-edit]");if(n)try{if(t.state.increment("activeElementLocked"),jl(n)){const r=Ss(n),o=e.minWidth,i=r.querySelectorAll(ht).length,s=i>1?parseFloat(String(e.gap)):20,a=i>1?parseFloat(String(e.gapMobile||e.gap)):20;let l="";r.querySelector(".em-mob-wrap")?l=`<td width="${s}" class="em-mob-wrap em-mob-height-${a}px"></td>
255
+ <td width="${o}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:r.querySelector(".noresp-em-mob-wrap")&&(l=`<td width="${s}" class="noresp-em-mob-wrap noresp-em-mob-height-${a}px"></td>
256
+ <td width="${o}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`);let c=0,u=0,d=0;r.querySelectorAll(ht).forEach(p=>{parseFloat(p.getAttribute("width")||"0")>o&&d++,c+=parseFloat(p.getAttribute("width")||"0")});const m=(o+s)/d;if(r.querySelectorAll(ht).forEach(p=>{if(parseFloat(p.getAttribute("width")||"0")>o){const f=Math.round(parseFloat(p.getAttribute("width")||"0")-m);p.setAttribute("width",String(f))}}),qe(r.querySelectorAll(ht)[i-1],"afterend",l),r.querySelectorAll(ht).forEach(p=>{u+=parseFloat(p.getAttribute("width")||"0")}),c-u-s!==0){const p=r.querySelector(un),f=parseFloat(p.getAttribute("width")||"0")+(c-u-s);p.setAttribute("width",String(f))}t.setPercentsForColumns(r.querySelectorAll(ht)),t.commit()}else{const r=Gl(n),o=e.minWidth,i=r.querySelectorAll(rt).length,s=i>1?parseFloat(String(e.gap)):20,a='<!--[if (gte mso 9)|(IE)]></td><td width="'+(o+s)+`" valign="top"><![endif]-->
257
+ <div style="display: inline-block; width: `+(o+s)+`px; vertical-align: top;" class="em-mob-width-100perc">
258
+ <table width="`+o+`" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
259
+ <tr>
260
+ <td align="left"></td>
261
+ </tr>
262
+ </table>
263
+ <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
264
+ </div>`;let l=0,c=0,u=0;if(i===1){const m=n.querySelector(rt)?r.querySelector(rt):n.closest(rt);m.style.removeProperty("max-width"),m.firstElementChild?.style.removeProperty("max-width"),m.firstElementChild?.style.removeProperty("width")}r.querySelectorAll(rt).forEach(m=>{const p=parseFloat(m.firstElementChild?.getAttribute("width")||"0");p>o&&u++,l+=p});const d=(o+s)/u;if(r.querySelectorAll(rt).forEach(m=>{const p=m;if(parseFloat(p.firstElementChild?.getAttribute("width")||"0")>o){const f=Math.round(parseFloat(p.style.width)-d),h=f-s;p.style.width=f+"px",$r({elem:p,width:f}),p.firstElementChild?.tagName==="TABLE"&&p.firstElementChild.setAttribute("width",String(h))}}),qe(r.querySelectorAll(rt)[i-1],"afterend",a),r.querySelectorAll(rt).forEach(m=>{c+=parseFloat(m.firstElementChild?.getAttribute("width")||"0")}),l-c-s!==0){const m=r.querySelector(rt),p=parseFloat(m.style.width)+(l-c-s);m.style.width=p+"px",$r({elem:m,width:p}),m.firstElementChild?.tagName==="TABLE"&&m.firstElementChild.setAttribute("width",String(p-s))}t.commit()}}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function U$(e,t){const n=document.querySelector("[em-edit]");if(!n)return;let r=null;try{if(t.state.increment("activeElementLocked"),jl(n)){const o=Ss(n);let i=0;const s=parseFloat(String(e.gap));o.querySelectorAll(ht).forEach((c,u)=>{u===e.removedBlockIndex&&(i=parseFloat(c.getAttribute("width")||"0"),c===n.closest(un)&&(n.closest(".em-structure > td")?.setAttribute("em-edit","active"),r=n.closest(".em-structure > td")),c.nextElementSibling&&c.previousElementSibling?c.previousElementSibling.remove():c.nextElementSibling&&!c.previousElementSibling?c.nextElementSibling.remove():!c.nextElementSibling&&c.previousElementSibling&&c.previousElementSibling.remove(),c.remove())});const a=o.querySelectorAll(ht).length,l=Math.floor((i+s)/a);if(o.querySelectorAll(ht).forEach(c=>{const u=Math.round(parseFloat(c.getAttribute("width")||"0")+l);c.setAttribute("width",String(u))}),a===1){const c=o.querySelector(un),u=c.closest("table").parentElement;c.setAttribute("width",String(u.getBoundingClientRect().width-parseFloat(u.style.paddingLeft||"0")-parseFloat(u.style.paddingRight||"0")))}t.setPercentsForColumns(o.querySelectorAll(ht))}else{const o=Gl(n);let i=0;const s=parseFloat(String(e.gap));o.querySelectorAll(rt).forEach((c,u)=>{u===e.removedBlockIndex&&(i=parseFloat(c.style.width),c===n.closest(rt)&&n.closest(".em-structure > td")?.setAttribute("em-edit","active"),nS({elem:c,removedBlockIndex:e.removedBlockIndex}),c.remove())});const a=o.querySelectorAll(rt).length,l=Math.round(i/a);if(o.querySelectorAll(rt).forEach(c=>{const u=c,d=Math.round(parseFloat(u.style.width)+l),m=d-s;u.style.width=d+"px",$r({elem:u,width:d}),u.firstElementChild?.tagName==="TABLE"&&u.firstElementChild.setAttribute("width",String(m))}),a===1){const c=o.querySelector(rt);c.style.width="100%",c.style.maxWidth=o.closest("table")?.style.maxWidth||"",$r({elem:c,width:o.closest("table")?.style.maxWidth||""}),c.firstElementChild.style.width="91%",c.firstElementChild.style.maxWidth=parseFloat(c.firstElementChild?.getAttribute("width")||"0")+"px"}}}finally{t.commit(),Promise.resolve().then(()=>{t.state.decrement("activeElementLocked"),r&&t.applicationElementSettingsSet&&t.applicationElementSettingsSet({elem:r})})}}function rS(e,t){const n=document.createComment("em-swap");e.replaceWith(n),t.replaceWith(e),n.replaceWith(t)}function oS(e){const t=e.cloneNode(!0);return t.querySelectorAll("editor").forEach(n=>{n.replaceWith(...Array.from(n.childNodes))}),t.querySelectorAll("[em-edit]").forEach(n=>n.removeAttribute("em-edit")),t.hasAttribute("em-edit")&&t.removeAttribute("em-edit"),t.querySelectorAll("[em-temp]").forEach(n=>n.remove()),Va(t)}function j$(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{copiedBlockIndex:r,widths:o}=e,i=parseFloat(String(e.gap))||0;try{if(t.state.increment("activeElementLocked"),jl(n)){const s=Ss(n),a=s.querySelectorAll(ht)[r];if(!a)return;const l=a.nextElementSibling||a.previousElementSibling,c=l?Va(l):s.querySelector(".noresp-em-mob-wrap")?`<td width="${i}" class="noresp-em-mob-wrap noresp-em-mob-height-${i}px"></td>`:`<td width="${i}" class="em-mob-wrap em-mob-height-${i}px"></td>`;qe(a,"afterend",c+oS(a));const u=s.querySelectorAll(ht);u.forEach((d,m)=>{o[m]!=null&&d.setAttribute("width",String(o[m]))}),t.setPercentsForColumns(u),t.commit()}else{const s=Gl(n),a=s.querySelectorAll(rt)[r];if(!a)return;const l='<!--[if (gte mso 9)|(IE)]></td><td width="'+((o[r+1]??o[r]??0)+i)+`" valign="top"><![endif]-->
265
+ `;qe(a,"afterend",l+oS(a)),s.querySelectorAll(rt).forEach((c,u)=>{const d=c,m=o[u];if(m==null)return;const p=m+i;d.style.width=p+"px",$r({elem:d,width:p}),d.firstElementChild?.tagName==="TABLE"&&d.firstElementChild.setAttribute("width",String(m))}),t.commit()}}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function G$(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{indexA:r,indexB:o}=e;if(r!==o)try{if(t.state.increment("activeElementLocked"),jl(n)){const i=Ss(n),s=i.querySelectorAll(ht),a=s[r],l=s[o];if(!a||!l)return;rS(a,l),t.setPercentsForColumns(i.querySelectorAll(ht)),t.commit()}else{const i=Gl(n).querySelectorAll(rt),s=i[r],a=i[o];if(!s||!a)return;rS(s,a),[s,a].forEach(l=>{$r({elem:l,width:parseFloat(l.style.width)})}),t.commit()}}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function X$(e,t){try{t.state.increment("activeElementLocked");const n=document.querySelector("[em-edit]");if(!n)return;const r=Ss(n);if(e.wrap)r.querySelectorAll(un).forEach((o,i)=>{o.classList.remove("em-mob-wrap-cancel"),i%2===0&&(o.classList.forEach(s=>s.startsWith("em-mob-width-")&&o.classList.remove(s)),o.classList.add("em-mob-width-100perc"))});else{const o=r.querySelectorAll(ht).length,i=Math.round(100/o)-2;r.querySelectorAll(un).forEach((a,l)=>{a.classList.add("em-mob-wrap-cancel"),a.classList.remove("em-mob-width-100perc"),l%2===0&&a.classList.add("em-mob-width-"+i+"perc")});const s=t.emailWidth||660;document.querySelector('style[em="styles"]')?.insertAdjacentHTML("beforeend",`
266
+ @media only screen and (max-device-width:${s}px),only screen and (max-width:${s}px) {
267
+ .em-mob-wrap.em-mob-wrap-cancel, .noresp-em-mob-wrap.em-mob-wrap-cancel { display: table-cell !important; }
268
+ .em-mob-width-${i}perc { width: ${i}% !important; }
269
+ }
270
+ `)}t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function Y$(e,t){try{t.state.increment("activeElementLocked");const n=document.querySelector("[em-edit]");if(!n)return;const r=n.querySelector(un)?document.querySelector('[em-edit="active"]'):n.closest(un)?.parentElement?.closest("td");if(!r)return;e.dirRevert?(r.setAttribute("dir","rtl"),r.querySelectorAll("td").forEach(o=>{for(let i=o.firstChild;i;i=i.nextSibling)if(i.nodeType===3){i.parentNode?.setAttribute("dir","ltr");break}})):(r.removeAttribute("dir"),r.querySelectorAll("[dir]").forEach(o=>o.removeAttribute("dir"))),t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function Uo(e){return{state:e.state,commit:e.commit,setPercentsForColumns:e.setPercentsForColumns,emailWidth:e.emailWidth,applicationElementSettingsSet:e.applicationElementSettingsSet}}function K$(e,t){!t.state||!t.setPercentsForColumns||V$(e.data.settings,Uo(t))}function Z$(e,t){!t.state||!t.setPercentsForColumns||U$(e.data.settings,Uo(t))}function Q$(e,t){!t.state||!t.setPercentsForColumns||j$(e.data.settings,Uo(t))}function J$(e,t){!t.state||!t.setPercentsForColumns||G$(e.data.settings,Uo(t))}function eW(e,t){!t.state||!t.setPercentsForColumns||X$(e.data.settings,Uo(t))}function tW(e,t){!t.state||!t.setPercentsForColumns||Y$(e.data.settings,Uo(t))}var nW={sandbox_floatBlock_add:K$,sandbox_floatBlock_remove:Z$,sandbox_floatBlock_copy:Q$,sandbox_floatBlock_swap:J$,sandbox_floatblock_wrap:eW,sandbox_floatblock_dir:tW},rW='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>',oW=['[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width]):empty','[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width])','.em-structure td[em-edit="active"]:not([height]):not([width]):empty','.em-structure td[em-edit="active"]:not([height]):not([width])','.em-structure td.em-mob-wrap[em-edit="active"]','.em-structure td.noresp-em-mob-wrap[em-edit="active"]'];function iS(){Un(),document.body.classList.remove("em-block-insert-body","em-atom-insert-body","em-atom-insert-body-inside"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>e.classList.remove("em-block-insert-empty")),document.querySelectorAll(".em-atom-insert-empty").forEach(e=>e.classList.remove("em-atom-insert-empty"))}function iW(){const e=document.querySelectorAll('[em="block"]');return e.length?e[e.length-1]:null}function sW(){for(const e of oW){const t=document.querySelector(e);if(t)return t}return null}function aW(e){const t=e.querySelectorAll('[em="atom"]');return t.length?t[t.length-1]:e}function lW(e){const t=e.querySelectorAll('[em="atom"]');if(t.length)return t[t.length-1];const n=e.querySelector("td.em-mob-wrap")??e.querySelector("td.noresp-em-mob-wrap")??e.querySelector('td[em-edit="active"]:not([height]):not([width])');return n||(e instanceof HTMLElement?Ol(e):null)}function cW(e,t,n){const r=e.getAttribute("em")==="atom",o=r?"afterend":"beforeend",i=r?e.parentElement:e;return t.match(/class="em-countdown"/gi)?n.insertCountdown({targetElem:e,targetPlace:o,atomHTML:t}):n.insertAdjacentHTML(e,o,t),uW(i,e,r)}function uW(e,t,n){if(n){const r=t.nextElementSibling;if(r?.getAttribute("em")==="atom")return r}if(e){const r=e.querySelectorAll('[em="atom"]');if(r.length)return r[r.length-1]}return null}function sS(e,t,n){return t.match(/em="atom"><tr><td>\s*<img/gi)&&(t=n.setImageWidth({atomHTML:t,targetAtom:e})),t=n.commonStylesApply({html:t}),cW(e,t,n)}function dW(e,t){if(!e||document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')||document.documentElement.scrollHeight+(t.iframeOffsetTop||0)<=(t.previewHeight||0))return;const n=e.getBoundingClientRect();t.messageService.send({operation:"application_scroll-to",settings:{value:n.top+n.height}})}function mW(e,t){const n=q1();if(!n)return null;e.match(/em="atom"><tr><td>\s*<img/gi)&&(e=t.setImageWidth({atomHTML:e,targetAtom:n})),e=t.commonStylesApply({html:e});let r=AE(e);if(e!==rW){const i=r.match(/<style((.|\n|\r)*?)<\/style>/g);t.setDocumentStyles(i)}r=t.commonStylesApplyToBlock({html:r}),(r.indexOf("empty-structure")>-1||r.indexOf("em-structure")>-1)&&(r=t.setFloatBlocksWidth({blockHTML:r,targetBlock:n}),r=t.fitImagesToColumns(r));const o=!!e.match(/class="em-countdown"/gi);return r.substring(0,3)!=="<tr"||!cn(n)?null:(o?t.insertCountdown({targetElem:Vn(n),targetPlace:"beforeend",atomHTML:r}):t.insertAdjacentHTML(Vn(n),"beforeend",r),n.querySelector('[em="block"]:last-child')??n.lastElementChild)}function aS(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.html=="string"?e.html:""}function fW(e,t){e&&t.messageService.send(Pe.APPLICATION_ATOM_INSERTED,e),iS()}function pW(e,t){t.messageService.send("application_block_inserted",{type:e.type,name:e.name,blockId:e.blockId,project:e.project}),iS()}function hW(e,t){const n=aS(e.atomHTML),r=n.match(/<style((.|\n|\r)*?)<\/style>/g);return t.setDocumentStyles(r),n.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim()}function gW(e,t){let n=hW(e,t);if(!n)return!1;let r=null;const o=sW();if(o)r=sS(aW(o),n,t);else{const i=iW();if(i){const s=lW(i);s&&(r=sS(s,n,t))}else r=mW(n,t)}return r?(dW(r,t),!0):!1}function bW(e,t,n){if(e.tagName==="TR"){t.substring(0,3)==="<tr"?n.insertAdjacentHTML(e,"afterend",t):n.insertAdjacentHTML(e,"afterend",'<tr em="block"><td align="center">'+t+"</td></tr>");return}if(t.substring(0,3)==="<tr"){const r=document.createElement("table");r.setAttribute("cellspacing","0"),r.setAttribute("cellpadding","0"),r.setAttribute("align","center"),r.setAttribute("border","0"),r.setAttribute("em","block"),r.setAttribute("width",e.hasAttribute("width")?e.getAttribute("width"):String(e.getBoundingClientRect().width)),r.classList.add("em-mob-width-100perc"),Qn(r,`
271
+ `+t+`
272
+ `),r.querySelectorAll('tr[em="block"]').forEach(o=>o.removeAttribute("em")),e.insertAdjacentElement("afterend",r)}else n.insertAdjacentHTML(e,"afterend",t)}function lS(e,t,n){if(!e.blockHTML?.trim())return!1;const r=t.parseFromString(e.blockHTML);let o=r.filter(m=>m.tagName&&m.tagName!=="LINK"&&m.tagName!=="STYLE").map(m=>t.getOuterHtml(m)).join(""),i=r.filter(m=>m.tagName==="STYLE").map(m=>t.getOuterHtml(m)).join("");const s=t.assetsRoot?.()??document.head,a=r.filter(m=>m.tagName==="LINK"&&m.getAttribute("em-class")).filter(m=>!s?.querySelector(`link[em-class="${m.getAttribute("em-class")}"]`));if(i){let m=s?.querySelector('style[em="styles"]'),p="";m?p=t.HTMLDocument.getInnerHtml(m):(m=document.createElement("style"),m.setAttribute("em","styles"),m=s?.insertAdjacentElement("beforeend",m));const f=document.createElement("div");t.emailWidth&&(i=i.replace(/(max-device-width:|max-width:)\d+px/g,y=>y.replace(/\d+/,String(t.emailWidth)))),f.insertAdjacentHTML("afterbegin",i);let h=t.minify(p+`
273
+ `+[...f.querySelectorAll("style")].map(y=>y.innerHTML).join(`
274
+ `),{restructure:!0,forceMediaMerge:!0}).css;h=t.cssbeautify(h,{indent:" ",autosemicolon:!0}),m.textContent=`
275
+ `+h+`
276
+ `}for(const m of a.reverse())s?.prepend(m),s?.insertAdjacentHTML("afterbegin",`
277
+ `);if(e.type!=="project"&&(o=t.commonStylesApplyToBlock({html:o})),o.match(/class="em-countdown"/gi)&&(o=t.uptimeCountdown({blockHTML:o})),n)return(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:n}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:n,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),bW(n,o,t),!0;let l=null,c=null,u=!1;const d=q1();if(d)l=d,c=l,(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:l}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:l,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),o.substring(0,3)==="<tr"?t.insertAdjacentHTML(Vn(d),"beforeend",o):t.insertAdjacentHTML(Vn(d),"beforeend",'<tr><td align="center">'+o+"</td></tr>"),u=!0;else if(document.querySelector('[em="group"]:last-child [em="block"]')||document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')){const m=document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]');if(l=m?m.closest('[em="block"]'):document.querySelector('[em="group"]:last-child [em="block"]:last-child'),(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:l}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:l,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),l?.tagName==="TR")o.substring(0,3)==="<tr"?t.insertAdjacentHTML(l,"afterend",o):t.insertAdjacentHTML(l,"afterend",'<tr em="block"><td align="center">'+o+"</td></tr>"),u=!0;else if(l){if(o.substring(0,3)==="<tr"){const p=document.createElement("table");p.setAttribute("cellspacing","0"),p.setAttribute("cellpadding","0"),p.setAttribute("align","center"),p.setAttribute("border","0"),p.setAttribute("em","block"),p.setAttribute("width",l.hasAttribute("width")?l.getAttribute("width"):String(l.getBoundingClientRect().width)),p.classList.add("em-mob-width-100perc"),Qn(p,`
278
+ `+o+`
279
+ `),p.querySelectorAll('tr[em="block"]').forEach(f=>f.removeAttribute("em")),l.insertAdjacentElement("afterend",p)}else t.insertAdjacentHTML(l,"afterend",o);u=!0}c=l?.nextSibling}return u&&!document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')&&document.documentElement.scrollHeight+(t.iframeOffsetTop||0)>(t.previewHeight||0)&&c&&t.messageService.send({operation:"application_scroll-to",settings:{value:c.getBoundingClientRect().top+c.getBoundingClientRect().height}}),u}function yW(e,t){if(!t.lockEditor&&aS(e.atomHTML).trim())try{t.state.increment("activeElementLocked"),t.setAtomReplaced?.(null),pE({kind:"atom",settings:e}),e.action!=="insert"&&document.body.classList.add("em-atom-insert-body"),e.action==="insert"&&gW(e,t)&&fW(e.name,t),t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function vW(e){return e.replace(/["\\]/g,"\\$&")}function EW(e,t){if(t.lockEditor)return 0;const n=e.emBlockId;if(!n||!e.blockHTML?.trim())return 0;const r=`[em="block"][em-block-id="${vW(String(n))}"]`,o=Array.from(document.querySelectorAll(r));if(!o.length)return 0;let i=0;try{t.state.increment("activeElementLocked");for(const s of o)lS({action:"insert",blockHTML:e.blockHTML,type:e.type,project:e.project,name:e.name},t,s)&&(s.remove(),i+=1);t.commit()}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}return i}function SW(e,t){if(!t.lockEditor&&e.blockHTML?.trim())try{t.state.increment("activeElementLocked"),pE({kind:"block",settings:e}),document.body.classList.add("em-block-insert-body"),e.action==="insert"&&lS(e,t)&&pW(e,t),t.commit()}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function wW(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};yW({action:e.data.action,atomHTML:r.atomHTML,name:r.name},n)}function CW(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};SW({action:e.data.action,blockHTML:r.blockHTML,type:r.type,project:r.project,name:r.name,blockId:r.blockId},n)}function AW(e,t){t.setElementSettings?.(e)}var TW={"sandbox_atom-insert":wW,"sandbox_block-insert":CW,sandbox_element_settings_set:AW},_W=tn("elements",z$,{services:[He,vt,xe,Kn]},e=>{const t=D(e,He),n=D(e,vt),r=lt(e),o=D(e,Kn);return()=>({HTMLDocument:{getOuterHtml:Vt},applicationElementSettingsSet:t,commit:r,elementPath:o.elementPath,getElementParent:i=>wl(i),getVariableByIcon:ll,hasRussianText:CB,messageService:Z,removeAllAttributes:Jn,setCursorPosition:i=>n(i),state:Yc})}),kW=tn("display",A$,void 0,()=>()=>({messageService:Z})),LW=tn("floatBlock",nW,{services:[He,xe]},e=>{const t=D(e,He),n=lt(e);let r=600;return x.subscribe(o=>{o.emailWidth!==void 0&&(r=o.emailWidth)}),()=>({applicationElementSettingsSet:t,commit:n,emailWidth:r,state:Yc,setPercentsForColumns:o=>Jc(o)})}),NW=tn("accordion",S$,{services:[xe]},e=>{const t=lt(e);return()=>({HTMLDocument:{getOuterHtml:Vt},commit:t,state:Yc,getActiveEditElement:eu,parseFromString:n=>Te(n)})}),xW=tn("eblock",_$,{services:[xe]},e=>{const t=lt(e);return()=>({commit:t})}),MW=tn("palette",TW,{services:[Ur,Is]},e=>{const t=D(e,Ur),n=D(e,Is);return()=>({getInsertContext:t.insertContext,setElementSettings:n})}),RW=tn("nativeImageDrop",{[Pe.SANDBOX_NATIVE_IMAGE_DROP_CLEAR]:()=>SE()},void 0,()=>()=>({})),OW=[_W,kW,LW,NW,xW,MW,RW],PW={name:"sandbox.prepareHtml",provides:[Rs],setup:e=>e.inject(Rs,t=>ko({node:t,isPartial:!0}))},IW={name:"sandbox.blockControlsViewport",setup:e=>e.addService(vf,()=>bl({scrollTop:x.get("scrollTop")}))},DW=[PW,IW,s$,a$,l$,c$,u$,...OW,d$,m$,f$,p$,h$,g$],BW="__emmDiagnostics__",HW="diagnostics";function FW(){try{const e=new URLSearchParams(window.location.search).get(HW);return e!==null&&e!=="0"}catch{return!1}}function rf(e){try{window.parent.postMessage({mark:BW,...e},"*")}catch{}}function $W(){const e=window.performance.getEntriesByType("resource").map(t=>{const n=t;return{name:n.name,initiatorType:n.initiatorType,startTime:n.startTime,responseEnd:n.responseEnd,transferSize:n.transferSize,decodedBodySize:n.decodedBodySize}});rf({type:"resources",timeOrigin:window.performance.timeOrigin,items:e})}function jo(){return window.performance.timeOrigin+window.performance.now()}function WW(){return Array.from(document.images).every(e=>e.complete)}function qW(e,t){const r=window.setInterval(()=>{!WW()||jo()-e()<500||(window.clearInterval(r),rf({type:"settled",at:Math.max(e(),t)}),$W())},100)}function zW(){if(!FW()||typeof MutationObserver!="function")return;let e=!1,t=jo();new MutationObserver(()=>{t=jo(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const n=jo();rf({type:"paint",at:n}),qW(()=>t,n)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{t=jo()}),document.addEventListener("load",()=>{t=jo()},!0)}var VW=500,UW=300,ws,Xl=!1;function cS(){if(Xl)return;Xl=!0;let e=!1;const t=window.setTimeout(()=>{e||(e=!0,ws=!1,Xl=!1)},UW);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(t),ws=!0,Xl=!1)})}function jW(){return ws===!1?(cS(),Promise.resolve()):new Promise(e=>{let t=!1;const n=()=>{t||(t=!0,e())},r=window.setTimeout(()=>{ws=!1,n()},VW);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(r),ws=!0,n()})})})}var GW=1;function XW(){cS();const e=async(t,n)=>{await n?.(t),await jW()};Z.addListenerAsync(Pe.SANDBOX_INITED,e,GW)}var YW=16,uS=100,KW=.95,dS=.02;function mS(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*YW:t===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function fS(e,t,n){if(n===0)return!1;const r=getComputedStyle(e),o=t==="y"?r.overflowY:r.overflowX;if(o!=="auto"&&o!=="scroll"&&o!=="overlay")return!1;const i=t==="y"?e.scrollTop:Math.abs(e.scrollLeft),s=t==="y"?e.scrollHeight-e.clientHeight:e.scrollWidth-e.clientWidth;return s<=0?!1:(t==="x"&&e.scrollLeft<0?-n:n)>0?i<s-.5:i>.5}function pS(e,t,n){const r=document.scrollingElement??document.documentElement;for(let o=e instanceof Element?e:null;o;o=o.parentElement){if(o===r||o===document.body)return!1;if(fS(o,"y",n)||fS(o,"x",t))return!0}return!1}function ZW(){let e=0,t=0,n=!1;const r=()=>{n=!1;const d=e,m=t;e=0,t=0,!(d===0&&m===0)&&Z.send(Pe.SANDBOX_WHEEL,{deltaX:d,deltaY:m})},o=(d,m)=>{e+=d,t+=m,n||(n=!0,window.requestAnimationFrame(r))};window.addEventListener("wheel",d=>{d.ctrlKey||pS(d.target,d.deltaX,d.deltaY)||(d.preventDefault(),o(mS(d.deltaX,d.deltaMode),mS(d.deltaY,d.deltaMode)))},{passive:!1});let i,s=!1,a={x:0,y:0},l;const c=()=>{l!==void 0&&(window.cancelAnimationFrame(l),l=void 0)},u=()=>{let{x:d,y:m}=a,p=performance.now();const f=h=>{const y=h>p?Math.min(h-p,50):16;p=h;const E=Math.pow(KW,y/16);if(d*=E,m*=E,Math.abs(d)<dS&&Math.abs(m)<dS){l=void 0;return}o(d*y,m*y),l=window.requestAnimationFrame(f)};l=window.requestAnimationFrame(f)};window.addEventListener("touchstart",d=>{c(),s=!1,a={x:0,y:0};const m=d.touches.length===1?d.touches[0]:void 0;i=m?{x:m.screenX,y:m.screenY,at:d.timeStamp}:void 0},{passive:!0}),window.addEventListener("touchmove",d=>{const m=d.touches.length===1?d.touches[0]:void 0;if(document.documentElement.classList.contains("em-resize-start")){i=void 0,s=!1;return}if(!m||!i){i=void 0,s=!1;return}const p=i.x-m.screenX,f=i.y-m.screenY,h=d.timeStamp-i.at;if(i={x:m.screenX,y:m.screenY,at:d.timeStamp},!pS(d.target,p,f)){if(d.cancelable&&d.preventDefault(),s=!0,h>0){const y=Math.min(h/uS,1);a={x:a.x*(1-y)+p/h*y,y:a.y*(1-y)+f/h*y}}o(p,f)}},{passive:!1}),window.addEventListener("touchend",d=>{const m=i?d.timeStamp-i.at:1/0;s&&d.touches.length===0&&m<uS&&u(),i=void 0,s=!1},{passive:!0}),window.addEventListener("touchcancel",()=>{i=void 0,s=!1})}var QW={name:"sandbox.diagnosticsAgent",setup:()=>zW()},JW={name:"sandbox.paintGate",setup:()=>XW()},eq={name:"sandbox.wheelBridge",setup:()=>ZW()},tq={name:"sandbox.deviceWidthMediaGuard",setup:()=>R5()};function nq(){return Math.ceil(document.documentElement.getBoundingClientRect().height)}window.iFrameResizer={heightCalculationMethod:nq};var rq=Yn(((e,t)=>{(function(n){if(typeof window<"u"){var r=!0,o=10,i="",s=0,a="",l=null,c="",u=!1,d={resize:1,click:1},m=128,p=!0,f=1,h="bodyOffset",y=h,E=!0,C="",k={},w=32,b=null,v=!1,A=!1,g="[iFrameSizer]",S=g.length,T="",_={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="child",N=!0,W=window.parent,P="*",R=0,Y=!1,V=null,G=16,Le=1,ae="scroll",ne=ae,we=window,j=function(){Ft("onMessage function not defined")},z=function(){},Se=function(){},Ae={height:function(){return Ft("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return Ft("Custom width calculation function not defined"),document.body.scrollWidth}},Q={},Lt=!1;try{var U=Object.create({},{passive:{get:function(){Lt=!0}}});window.addEventListener("test",As,U),window.removeEventListener("test",As,U)}catch{}var In,gt,Wr,dn,ot,Bt,Be={bodyOffset:function(){return document.body.offsetHeight+bt("marginTop")+bt("marginBottom")},offset:function(){return Be.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return Ae.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,tt(Be))},min:function(){return Math.min.apply(null,tt(Be))},grow:function(){return Be.max()},lowestElement:function(){return Math.max(Be.bodyOffset()||Be.documentElementOffset(),fn("bottom",yt()))},taggedElement:function(){return pn("bottom","data-iframe-height")}},jn={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return Ae.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(jn.bodyScroll(),jn.documentElementScroll())},max:function(){return Math.max.apply(null,tt(jn))},min:function(){return Math.min.apply(null,tt(jn))},rightMostElement:function(){return fn("right",yt())},taggedElement:function(){return pn("right","data-iframe-width")}},Cs=(In=Kl,ot=null,Bt=0,function(){var O=Date.now(),H=G-(O-(Bt=Bt||O));return gt=this,Wr=arguments,H<=0||G<H?(ot&&(clearTimeout(ot),ot=null),Bt=O,dn=In.apply(gt,Wr),ot||(gt=Wr=null)):ot=ot||setTimeout(sf,H),dn});Ht(window,"message",function(O){var H={init:function(){C=O.data,W=O.source,Yl(),p=!1,setTimeout(function(){E=!1},m)},reset:function(){E?ce("Page reset ignored by init"):(ce("Page size reset by host page"),gS("resetPage"))},resize:function(){$t("resizeParent","Parent window requested size check")},moveToAnchor:function(){k.findTarget(ve())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var Ne=ve();ce("PageInfoFromParent called from parent: "+Ne),Se(JSON.parse(Ne)),ce(" --")},message:function(){var Ne=ve();ce("onMessage called from parent: "+Ne),j(JSON.parse(Ne)),ce(" --")}};function fe(){return O.data.split("]")[1].split(":")[0]}function ve(){return O.data.substr(O.data.indexOf(":")+1)}function K(){return O.data.split(":")[2]in{true:1,false:1}}function J(){var Ne=fe();Ne in H?H[Ne]():(typeof t>"u"||!t.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||K()||Ft("Unexpected message ("+O.data+")")}g===(""+O.data).substr(0,S)&&(p===!1?J():K()?H.init():ce('Ignored message of type "'+fe()+'". Received before initialization.'))}),Ht(window,"readystatechange",yS),yS()}function As(){}function Ht(O,H,fe,ve){O.addEventListener(H,fe,!!Lt&&(ve||{}))}function Ts(O){return O.charAt(0).toUpperCase()+O.slice(1)}function of(O){return g+"["+T+"] "+O}function ce(O){v&&window.console}function Ft(O){window.console}function Yl(){function O(K){return K==="true"}var H;function fe(K){Kt(0,0,K.type,K.screenY+":"+K.screenX)}function ve(K,J){ce("Add event listener: "+J),Ht(window.document,K,fe)}H=C.substr(S).split(":"),T=H[0],s=n!==H[1]?Number(H[1]):s,u=n!==H[2]?O(H[2]):u,v=n!==H[3]?O(H[3]):v,w=n!==H[4]?Number(H[4]):w,r=n!==H[6]?O(H[6]):r,a=H[7],y=n!==H[8]?H[8]:y,i=H[9],c=H[10],R=n!==H[11]?Number(H[11]):R,k.enable=n!==H[12]&&O(H[12]),M=n!==H[13]?H[13]:M,ne=n!==H[14]?H[14]:ne,A=n!==H[15]?!!H[15]:A,ce("Initialising iFrame ("+window.location.href+")"),(function(){function K(J,Ne){return typeof J=="function"&&(ce("Setup custom "+Ne+"CalcMethod"),Ae[Ne]=J,J="custom"),J}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var J=window.iFrameResizer;ce("Reading data from page: "+JSON.stringify(J)),Object.keys(J).forEach(_s,J),j="onMessage"in J?J.onMessage:j,z="onReady"in J?J.onReady:z,P="targetOrigin"in J?J.targetOrigin:P,y="heightCalculationMethod"in J?J.heightCalculationMethod:y,ne="widthCalculationMethod"in J?J.widthCalculationMethod:ne})(),y=K(y,"height"),ne=K(ne,"width")),ce("TargetOrigin for parent set to: "+P)})(),(function(){n===a&&(a=s+"px"),Gn("margin",(function(K,J){return J.indexOf("-")!==-1&&(Ft("Negative CSS value ignored for "+K),J=""),J})("margin",a))})(),Gn("background",i),Gn("padding",c),(H=document.createElement("div")).style.clear="both",H.classList.add("iframe-resizer-inner"),H.style.display="block",H.style.height="0",document.body.appendChild(H),et(),mn(),document.documentElement.style.height="",document.body.style.height="",ce('HTML & body height set to "auto"'),ce("Enable public methods"),we.parentIFrame={autoResize:function(K){return K===!0&&r===!1?(r=!0,Dn()):K===!1&&r===!0&&(r=!1,ks("remove"),l!==null&&l.disconnect(),clearInterval(b)),Kt(0,0,"autoResize",JSON.stringify(r)),r},close:function(){Kt(0,0,"close")},getId:function(){return T},getPageInfo:function(K){typeof K=="function"?(Se=K,Kt(0,0,"pageInfo")):(Se=function(){},Kt(0,0,"pageInfoStop"))},moveToAnchor:function(K){k.findTarget(K)},reset:function(){bS("parentIFrame.reset")},scrollTo:function(K,J){Kt(J,K,"scrollTo")},scrollToOffset:function(K,J){Kt(J,K,"scrollToOffset")},sendMessage:function(K,J){Kt(0,0,"message",JSON.stringify(K),J)},setHeightCalculationMethod:function(K){y=K,et()},setWidthCalculationMethod:function(K){ne=K,mn()},setTargetOrigin:function(K){ce("Set targetOrigin: "+K),P=K},size:function(K,J){$t("size","parentIFrame.size("+((K||"")+(J?","+J:""))+")",K,J)}},A===!0&&(ve("mouseenter","Mouse Enter"),ve("mouseleave","Mouse Leave")),Dn(),k=(function(){function K(xt){var me=xt.getBoundingClientRect(),xt={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(me.left,10)+parseInt(xt.x,10),y:parseInt(me.top,10)+parseInt(xt.y,10)}}function J(qt){var me,xt=qt.split("#")[1]||qt,qt=decodeURIComponent(xt),vS=document.getElementById(qt)||document.getElementsByName(qt)[0];n!==vS?(me=K(me=vS),ce("Moving to in page link (#"+xt+") at x: "+me.x+" y: "+me.y),Kt(me.y,me.x,"scrollToOffset")):(ce("In page link (#"+xt+") not found in iFrame, so sending to parent"),Kt(0,0,"inPageLink","#"+xt))}function Ne(){var Wt=window.location.hash,me=window.location.href;Wt!==""&&Wt!=="#"&&J(me)}function Nt(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(Wt){Wt.getAttribute("href")!=="#"&&Ht(Wt,"click",function(me){me.preventDefault(),J(this.getAttribute("href"))})})}function Ls(){Array.prototype.forEach&&document.querySelectorAll?(ce("Setting up location.hash handlers"),Nt(),Ht(window,"hashchange",Ne),setTimeout(Ne,m)):Ft("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return k.enable?Ls():ce("In page linking not enabled"),{findTarget:J}})(),$t("init","Init message from host page"),z()}function _s(O){var H=O.split("Callback");H.length===2&&(this[H="on"+H[0].charAt(0).toUpperCase()+H[0].slice(1)]=this[O],delete this[O],Ft("Deprecated: '"+O+"' has been renamed '"+H+"'. The old method will be removed in the next major version."))}function Gn(O,H){n!==H&&H!==""&&H!=="null"&&ce("Body "+O+' set to "'+(document.body.style[O]=H)+'"')}function st(O){var H={add:function(fe){function ve(){$t(O.eventName,O.eventType)}Q[fe]=ve,Ht(window,fe,ve,{passive:!0})},remove:function(fe){var ve,K=Q[fe];delete Q[fe],ve=window,fe=fe,K=K,ve.removeEventListener(fe,K,!1)}};O.eventNames&&Array.prototype.map?(O.eventName=O.eventNames[0],O.eventNames.map(H[O.method])):H[O.method](O.eventName),ce(Ts(O.method)+" event listener: "+O.eventType)}function ks(O){st({method:O,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),st({method:O,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),st({method:O,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),st({method:O,eventType:"Input",eventName:"input"}),st({method:O,eventType:"Mouse Up",eventName:"mouseup"}),st({method:O,eventType:"Mouse Down",eventName:"mousedown"}),st({method:O,eventType:"Orientation Change",eventName:"orientationchange"}),st({method:O,eventType:"Print",eventNames:["afterprint","beforeprint"]}),st({method:O,eventType:"Ready State Change",eventName:"readystatechange"}),st({method:O,eventType:"Touch Start",eventName:"touchstart"}),st({method:O,eventType:"Touch End",eventName:"touchend"}),st({method:O,eventType:"Touch Cancel",eventName:"touchcancel"}),st({method:O,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),st({method:O,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),st({method:O,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),M==="child"&&st({method:O,eventType:"IFrame Resized",eventName:"resize"})}function F(O,H,fe,ve){return H!==O&&(O in fe||(Ft(O+" is not a valid option for "+ve+"CalculationMethod."),O=H),ce(ve+' calculation method set to "'+O+'"')),O}function et(){y=F(y,h,Be,"height")}function mn(){ne=F(ne,ae,jn,"width")}function Dn(){var O;r===!0?(ks("add"),O=w<0,window.MutationObserver||window.WebKitMutationObserver?O?be():l=(function(){function H(me){function xt(qt){qt.complete===!1&&(ce("Attach listeners to "+qt.src),qt.addEventListener("load",K,!1),qt.addEventListener("error",J,!1),Nt.push(qt))}me.type==="attributes"&&me.attributeName==="src"?xt(me.target):me.type==="childList"&&Array.prototype.forEach.call(me.target.querySelectorAll("img"),xt)}function fe(me){ce("Remove listeners from "+me.src),me.removeEventListener("load",K,!1),me.removeEventListener("error",J,!1),me=me,Nt.splice(Nt.indexOf(me),1)}function ve(me,xt,qt){fe(me.target),$t(xt,qt+": "+me.target.src)}function K(me){ve(me,"imageLoad","Image loaded")}function J(me){ve(me,"imageLoadFailed","Image load failed")}function Ne(me){$t("mutationObserver","mutationObserver: "+me[0].target+" "+me[0].type),me.forEach(H)}var Nt=[],Ls=window.MutationObserver||window.WebKitMutationObserver,Wt=(function(){var me=document.querySelector("body");return Wt=new Ls(Ne),ce("Create body MutationObserver"),Wt.observe(me,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),Wt})();return{disconnect:function(){"disconnect"in Wt&&(ce("Disconnect body MutationObserver"),Wt.disconnect(),Nt.forEach(fe))}}})():(ce("MutationObserver not supported in this browser!"),be())):ce("Auto Resize disabled")}function be(){w!==0&&(ce("setInterval: "+w+"ms"),b=setInterval(function(){$t("interval","setInterval: "+w)},Math.abs(w)))}function bt(O,H){var fe=0;return H=H||document.body,fe=(fe=document.defaultView.getComputedStyle(H,null))!==null?fe[O]:0,parseInt(fe,o)}function fn(O,H){for(var fe,ve=H.length,K=0,J=Ts(O),Ne=Date.now(),Nt=0;Nt<ve;Nt++)K<(fe=H[Nt].getBoundingClientRect()[O]+bt("margin"+J,H[Nt]))&&(K=fe);return Ne=Date.now()-Ne,ce("Parsed "+ve+" HTML elements"),ce("Element position calculated in "+Ne+"ms"),G/2<(Ne=Ne)&&ce("Event throttle increased to "+(G=2*Ne)+"ms"),K}function tt(O){return[O.bodyOffset(),O.bodyScroll(),O.documentElementOffset(),O.documentElementScroll()]}function pn(O,H){var fe=document.querySelectorAll("["+H+"]");return fe.length===0&&(Ft("No tagged elements ("+H+") found on page"),document.querySelectorAll("body *")),fn(O,fe)}function yt(){return document.querySelectorAll("body *")}function Kl(O,H,fe,ve){function K(){O in{init:1,interval:1,size:1}||!(y in _||u&&ne in _)?O in{interval:1}||ce("No change in size detected"):bS(H)}var J,Ne;function Nt(Ls,Wt){return!(Math.abs(Ls-Wt)<=R)}J=n!==fe?fe:Be[y](),Ne=n!==ve?ve:jn[ne](),Nt(f,J)||u&&Nt(Le,Ne)||O==="init"?(hn(),Kt(f=J,Le=Ne,O)):K()}function sf(){Bt=Date.now(),ot=null,dn=In.apply(gt,Wr),ot||(gt=Wr=null)}function $t(O,H,fe,ve){Y&&O in d?ce("Trigger event cancelled: "+O):(O in{reset:1,resetPage:1,init:1}||ce("Trigger event: "+H),(O==="init"?Kl:Cs)(O,H,fe,ve))}function hn(){Y||(Y=!0,ce("Trigger event lock on")),clearTimeout(V),V=setTimeout(function(){Y=!1,ce("Trigger event lock off"),ce("--")},m)}function gS(O){f=Be[y](),Le=jn[ne](),Kt(f,Le,O)}function bS(O){var H=y;y=h,ce("Reset trigger event: "+O),hn(),gS("reset"),y=H}function Kt(O,H,fe,ve,K){var J;N===!0&&(n===K?K=P:ce("Message targetOrigin: "+K),ce("Sending message to host page ("+(J=T+":"+(O+":"+H)+":"+fe+(n!==ve?":"+ve:""))+")"),W.postMessage(g+J,K))}function yS(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),oq=[{name:"Stripo (es-header/content/footer)",detect:()=>!!(document.querySelector(".es-header")||document.querySelector(".es-content")||document.querySelector(".es-footer")),apply:()=>{document.querySelectorAll(".es-header, .es-content, .es-footer").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".es-header-body > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll(".es-content-body > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll(".es-footer-body > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Stripo (es-wrapper)",detect:()=>!!document.querySelector(".es-wrapper"),apply:()=>{document.querySelectorAll(".es-wrapper > tr > td > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".es-wrapper > tr > td > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Sandsay",detect:()=>!!(document.querySelector("[data-template-wrapper]")&&document.querySelector("[data-template-content]")),apply:()=>{document.querySelectorAll("[data-template-wrapper] > table[data-block-id]").forEach(e=>{e.setAttribute("em","block")})}},{name:"Beefree",detect:()=>!!(document.querySelector(".nl-container")&&document.querySelector(".row")),apply:()=>{document.querySelectorAll('.row[em="block"]').forEach(e=>{e.removeAttribute("em")}),document.querySelectorAll(".row").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".row-content").forEach(e=>{e.setAttribute("em","block")})}},{name:"Chamaileon",detect:()=>!!document.querySelector(".main-container"),apply:()=>{document.querySelectorAll(".main-container > tr > td > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"Chamaileon (email-container)",detect:()=>!!document.querySelector(".email-container"),apply:()=>{document.querySelectorAll(".email-container > tr > td > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Mindbox",detect:()=>!!(document.querySelector(".nl-container")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll(".nl-container > tr > td > div").forEach(e=>{e.setAttribute("em","block")})}},{name:"Unlayer",detect:()=>!!(document.querySelector(".clean-body.u_body")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll(".u-row-container").forEach(e=>{e.setAttribute("em","block")})}},{name:"Postcards",detect:()=>!!(document.querySelector(".pc-email-body")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll('.pc-email-container > tr > td > table[role="presentation"]').forEach(e=>{e.setAttribute("em","block")})}},{name:"Topol",detect:()=>!!(document.querySelector(".hide_section_on_mobile")||document.querySelector(".mj-column-per-100")||document.querySelector(".outlook-group-fix")),apply:()=>{document.querySelectorAll("body > div > div").forEach(e=>{e.setAttribute("em","block")})}},{name:"Sender",detect:()=>!!document.querySelector(".e-c.sect"),apply:()=>{document.querySelectorAll(".e-c.sect").forEach(e=>{e.setAttribute("em","block")})}},{name:"Letteros",detect:()=>!!(!document.querySelector("[mailfit-module]")&&(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]"))),apply:()=>{document.querySelectorAll("body > div > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("body > div > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll('[style*="overflow"]').forEach(e=>{e.style.removeProperty("overflow")})}},{name:"Letteros (letteros-element)",detect:()=>!!document.querySelector("[letteros-element]"),apply:()=>{document.querySelectorAll("[letteros-body]").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("[letteros-element]").forEach(e=>{e.setAttribute("em","block")})}},{name:"Ascona",detect:()=>!!(document.querySelector(".mail_preheader")&&document.body.classList.contains("body")),apply:()=>{document.querySelectorAll("#mailsub > table > tr").forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > div > table > tr").forEach(t=>{t.setAttribute("em","block")})})}},{name:"Mailfit",detect:()=>!!document.querySelector("[mailfit-module]"),apply:()=>{document.querySelectorAll("body > div > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("[mailfit-module]").forEach(e=>{e.setAttribute("em","block")})}},{name:"CashCowAgency",detect:()=>!!document.querySelector(".container-div"),apply:()=>{document.querySelectorAll("body > center").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".container-td > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"MakeMail",detect:()=>!!(document.querySelector(".mail")&&document.querySelector(".container")),apply:()=>{document.querySelectorAll(".container").forEach(e=>{e.setAttribute("em","block")})}},{name:"data-axle.com",detect:()=>!!document.querySelector(".full-width-container-inner"),apply:()=>{document.querySelectorAll(".full-width-container-inner > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"Miro",detect:()=>!!document.querySelector(".content__tablet_fullWidth"),apply:()=>{document.querySelectorAll(".content__tablet_fullWidth").forEach(e=>{for(const t of Array.from(e.children))if(t.children.length>1)for(const n of Array.from(t.children))n.setAttribute("em","block");else for(const n of Array.from(t.children))for(const r of Array.from(n.children))for(const o of Array.from(r.children))o.setAttribute("em","block")})}},{name:"WIM (full-wrap)",detect:()=>!!(document.body.classList.contains("body")&&document.querySelector("[alink]")&&document.querySelector(".full-wrap")),apply:()=>{document.querySelectorAll(".full-wrap > tr > td > div > table > tr").forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > div > table > tr, :scope > td > table > tr").forEach(t=>{t.setAttribute("em","block")})})}},{name:"WIM",detect:()=>!!(document.body.classList.contains("body")&&document.querySelector("[alink]")&&!document.querySelector(".full-wrap")),apply:()=>{document.querySelectorAll('body > table > tr > td > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr > td > table > tr, body > table > tbody > tr > td > table > tbody > tr, body > div[style*="-webkit-text-size-adjust"] > table > tbody > tr > td > table > tbody > tr').forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > table > tr > td > table > tr").forEach(t=>{t.setAttribute("em","block")})})}},{name:"Emailify",detect:()=>document.body.classList.contains("emailify"),apply:()=>{document.querySelectorAll("body > div > div > table > tr").forEach(e=>{e.setAttribute("em","block")})}}];function iq(){document.querySelectorAll('body > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr').forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll('body > table > tr > td > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr > td > table > tr, body > table > tbody > tr > td > table > tbody > tr, body > div[style*="-webkit-text-size-adjust"] > table > tbody > tr > td > table > tbody > tr').forEach(e=>{e.setAttribute("em","block")})}function sq(e){const t=document.querySelector("[em=blocks]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","block");t.removeAttribute("em"),Er();return}if(e){let n=!1;for(const r of oq)if(r.detect()){r.apply(),n=!0;break}n||iq()}hS(),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||Z.send({operation:"application_template_not_em_alert_show"}),Er()}function hS(){const e=document.querySelector("[em=atoms]");if(e){for(const t of Array.from(e.children))t.setAttribute("em","atom");e.removeAttribute("em")}document.documentElement?.style.height&&document.documentElement.style.removeProperty("height"),document.body?.style.height&&document.body.style.removeProperty("height")}Object.defineProperty(q,"CANVAS_CORE_UNITS",{enumerable:!0,get:function(){return LI}}),Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(q,"EMAIL_LAYOUT_UNITS",{enumerable:!0,get:function(){return DW}}),Object.defineProperty(q,"EVENT_TYPES",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(q,"FOCUS_ID",{enumerable:!0,get:function(){return at}}),Object.defineProperty(q,"HTML_DOCUMENT_ID",{enumerable:!0,get:function(){return te}}),Object.defineProperty(q,"INIT_PREVIEW_ID",{enumerable:!0,get:function(){return Jo}}),Object.defineProperty(q,"INSERT_POLICY_ID",{enumerable:!0,get:function(){return lc}}),Object.defineProperty(q,"NARROW_TABLE_TEXT_ATOM_ID",{enumerable:!0,get:function(){return bf}}),Object.defineProperty(q,"Node",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(q,"NodeType",{enumerable:!0,get:function(){return $}}),Object.defineProperty(q,"SET_CURSOR_ID",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(q,"STYLE_ROOT_ID",{enumerable:!0,get:function(){return hf}}),Object.defineProperty(q,"SYNC_COMMIT_ID",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(q,"VML_WIDTH_RESOLVER_ID",{enumerable:!0,get:function(){return gf}}),Object.defineProperty(q,"WRAP_EDITOR_ID",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(q,"_defineProperty",{enumerable:!0,get:function(){return L}}),Object.defineProperty(q,"addFontFamilyClass",{enumerable:!0,get:function(){return Zi}}),Object.defineProperty(q,"ampUnit",{enumerable:!0,get:function(){return TT}}),Object.defineProperty(q,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return ul}}),Object.defineProperty(q,"applyRootScale",{enumerable:!0,get:function(){return ci}}),Object.defineProperty(q,"buildEmFontClassName",{enumerable:!0,get:function(){return ml}}),Object.defineProperty(q,"checkBlockAdaptivity",{enumerable:!0,get:function(){return al}}),Object.defineProperty(q,"clearLinkTags",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(q,"clearProjectFontFaces",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(q,"commitOf",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(q,"commonStylesApply",{enumerable:!0,get:function(){return Uv}}),Object.defineProperty(q,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return nm}}),Object.defineProperty(q,"createFontClassName",{enumerable:!0,get:function(){return $d}}),Object.defineProperty(q,"createIdentifier",{enumerable:!0,get:function(){return de}}),Object.defineProperty(q,"defineSurface",{enumerable:!0,get:function(){return QS}}),Object.defineProperty(q,"defineUnit",{enumerable:!0,get:function(){return kS}}),Object.defineProperty(q,"deviceWidthMediaGuardUnit",{enumerable:!0,get:function(){return tq}}),Object.defineProperty(q,"diagnosticsAgentUnit",{enumerable:!0,get:function(){return QW}}),Object.defineProperty(q,"elMarkupHelper",{enumerable:!0,get:function(){return sq}}),Object.defineProperty(q,"extensionsUnit",{enumerable:!0,get:function(){return U4}}),Object.defineProperty(q,"findParentTr",{enumerable:!0,get:function(){return lh}}),Object.defineProperty(q,"fitEmailToWidth",{enumerable:!0,get:function(){return xT}}),Object.defineProperty(q,"fitImagesToColumns",{enumerable:!0,get:function(){return xm}}),Object.defineProperty(q,"getElementInnerHTML",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(q,"getOuterHtml",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(q,"getUsedColors",{enumerable:!0,get:function(){return Qv}}),Object.defineProperty(q,"globalBlockReplace",{enumerable:!0,get:function(){return EW}}),Object.defineProperty(q,"iframeSetSize",{enumerable:!0,get:function(){return MT}}),Object.defineProperty(q,"implementPolyfills",{enumerable:!0,get:function(){return df}}),Object.defineProperty(q,"insertAdjacentHTML",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(q,"insertCountdown",{enumerable:!0,get:function(){return cv}}),Object.defineProperty(q,"isComment",{enumerable:!0,get:function(){return Vs}}),Object.defineProperty(q,"isEmptyTable",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(q,"isTextNode",{enumerable:!0,get:function(){return oi}}),Object.defineProperty(q,"markAtomsAndClearRootHeight",{enumerable:!0,get:function(){return hS}}),Object.defineProperty(q,"markProjectFontClass",{enumerable:!0,get:function(){return qd}}),Object.defineProperty(q,"messageService",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(q,"minifyStylesheet",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(q,"paintGateUnit",{enumerable:!0,get:function(){return JW}}),Object.defineProperty(q,"parseFromString",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(q,"removeClassesByPrefix",{enumerable:!0,get:function(){return zd}}),Object.defineProperty(q,"removeHiddenClasses",{enumerable:!0,get:function(){return Ua}}),Object.defineProperty(q,"requireService",{enumerable:!0,get:function(){return D}}),Object.defineProperty(q,"require_iframeResizer_contentWindow_min",{enumerable:!0,get:function(){return rq}}),Object.defineProperty(q,"rgbToHex",{enumerable:!0,get:function(){return X}}),Object.defineProperty(q,"rowsHost",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(q,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return bl}}),Object.defineProperty(q,"setBlockMaxWidth",{enumerable:!0,get:function(){return Mm}}),Object.defineProperty(q,"setDocumentStyles",{enumerable:!0,get:function(){return Fd}}),Object.defineProperty(q,"setElementBorder",{enumerable:!0,get:function(){return Vd}}),Object.defineProperty(q,"setElementBorderRadius",{enumerable:!0,get:function(){return Gi}}),Object.defineProperty(q,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return FP}}),Object.defineProperty(q,"setFloatBlocksWidth",{enumerable:!0,get:function(){return Nm}}),Object.defineProperty(q,"setImageWidth",{enumerable:!0,get:function(){return xd}}),Object.defineProperty(q,"setStructureBlocksWidth",{enumerable:!0,get:function(){return Ll}}),Object.defineProperty(q,"startSandbox",{enumerable:!0,get:function(){return JS}}),Object.defineProperty(q,"state",{enumerable:!0,get:function(){return x}}),Object.defineProperty(q,"stripSubjectTags",{enumerable:!0,get:function(){return Pw}}),Object.defineProperty(q,"uptimeCountdown",{enumerable:!0,get:function(){return Md}}),Object.defineProperty(q,"wheelBridgeUnit",{enumerable:!0,get:function(){return eq}})});