@emailmaker/emailmaker 1.2.5 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/emailmaker-core.a4e11bd0.js +859 -0
- package/emailmaker-esm.js +11 -11
- package/{emailmaker-po.ee1618fa.js → emailmaker-po.a4e11bd0.js} +1 -1
- package/emailmaker.js +12 -12
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/css/sandbox.css +19 -0
- package/iframe/{iframe-eblock.ee1618fa.html → iframe-eblock.a4e11bd0.html} +2 -2
- package/iframe/{iframe.ee1618fa.html → iframe.a4e11bd0.html} +2 -2
- package/iframe/js/elMarkupHelper.Dc_IFMml.js +278 -0
- package/iframe/js/iframe-eblock.body.a4e11bd0.js +9 -0
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.a4e11bd0.js +129 -0
- package/iframe/js/iframe.js +2 -2
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/0c2b284d.js +1 -0
- package/static/core/{c3d00c5e.js → 1708db7c.js} +1 -1
- package/static/core/{abcacabc.js → 1922419a.js} +1 -1
- package/static/core/{2a042fe3.js → 1c5fcd3e.js} +1 -1
- package/static/core/{6b16159c.js → 1d705ef4.js} +1 -1
- package/static/core/{63e7f8c1.js → 2f2b6a03.js} +2 -2
- package/static/core/{659796a7.js → 44ad0bec.js} +11 -11
- package/static/core/{dd230bbb.js → 462ebf44.js} +1 -1
- package/static/core/{b7289065.js → 5b124cab.js} +1 -1
- package/static/core/{d2780737.js → 5c396b20.js} +1 -1
- package/static/core/{7e167222.js → 64c240c3.js} +1 -1
- package/static/core/{d503c406.js → 6dfc3524.js} +1 -1
- package/static/core/{683a6a53.js → 762d0d48.js} +1 -1
- package/static/core/{c67df236.js → 76d1e927.js} +1 -1
- package/static/core/{4de9c323.js → 7c519fb4.js} +3 -3
- package/static/core/{a8b4352d.js → 8608a2b9.js} +1 -1
- package/static/core/{155e871a.js → 892bb74e.js} +3 -3
- package/static/core/{5b6e2acb.js → 9c4c7364.js} +1 -1
- package/static/core/{b712bb05.js → 9f7f5230.js} +1 -1
- package/static/core/{64711257.js → a30b0fae.js} +2 -2
- package/static/core/a4d994c7.js +28 -0
- package/static/core/aa75c19b.js +2 -0
- package/static/core/{82f8beb4.js → b0c57adf.js} +1 -1
- package/static/core/{17fba7af.js → b9f59067.js} +1 -1
- package/static/core/{c03be019.js → c16f27f8.js} +2 -2
- package/static/core/{f35181ec.js → cd998f60.js} +1 -1
- package/static/core/{50ba806c.js → e123b734.js} +1 -1
- package/static/core/e6f6edff.js +1 -0
- package/static/core/{9eaed676.js → e70683db.js} +1 -1
- package/static/core/{c8443fab.js → ec552634.js} +1 -1
- package/static/esm/{b4f8dfdc.js → 74f083c2.js} +1 -1
- package/static/umd-runtime/{runtime.Bsid8PpY.js → runtime.C95Dj7XR.js} +1 -1
- package/vendor/@emailmaker/ui-kit/package.json +1 -1
- package/emailmaker-core.ee1618fa.js +0 -859
- package/iframe/js/elMarkupHelper.Buog1r0c.js +0 -278
- package/iframe/js/iframe-eblock.body.ee1618fa.js +0 -9
- package/iframe/js/iframe.body.ee1618fa.js +0 -129
- package/static/core/987afc3f.js +0 -1
- package/static/core/b96e571d.js +0 -2
- package/static/core/e7fa68c2.js +0 -28
- package/static/core/e88db487.js +0 -1
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
__emailmaker__.define("js/elMarkupHelper.Dc_IFMml.js",["require","exports","module"],function(Iu,H,DJ){var qp=Object.defineProperty,yr=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),oe=(e,t)=>{let n={};for(var r in e)qp(n,r,{get:e[r],enumerable:!0});return t||qp(n,Symbol.toStringTag,{value:"Module"}),n};function Bi(e){"@babel/helpers - typeof";return Bi=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},Bi(e)}function pA(e,t){if(Bi(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Bi(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gA(e){var t=pA(e,"string");return Bi(t)=="symbol"?t:t+""}function A(e,t,n){return(t=gA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zp;zp=Symbol.toStringTag;var Du=class{constructor(){A(this,"_valuesMap",new Map),A(this,zp,"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 Up(){const e=new Du;return new Proxy(e,{set:function(t,n,r){return typeof n=="string"&&Du.prototype.hasOwnProperty(n)?e[n]=r:typeof n=="string"&&e.setItem(n,String(r)),!0},get:function(t,n){if(typeof n=="string"){if(Du.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 jp(){const e=Up(),t=Up();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)})}jp();var Vp=Symbol.for("emailmaker.commandInputPause");function Gp(){const e=window,t=e[Vp];if(t)return t;const n=new Set;return e[Vp]=n,window.addEventListener("input",r=>n.forEach(o=>o(r)),!0),n}function bA(){Gp()}function yA(e){const t=Gp();return t.add(e),()=>{t.delete(e)}}bA();var Xp=class{constructor(e){A(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.BogusComment=22]="BogusComment",e[e.AdvancedStart=100]="AdvancedStart",e[e.AdvancedEnd=101]="AdvancedEnd",e})({}),vA=class{constructor(e,t){A(this,"source",void 0),A(this,"len",void 0),A(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===CA||e===TA||e===SA||e===_A||e===wA)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},Bu=33,_o=45,Hi=60,Jt=62,Fi=47,EA=61,Kp=34,Yp=39,SA=10,wA=13,_A=12,CA=32,TA=9,Zp=63,AA=65,kA=90,LA=97,NA=122;function Qp(e){return e>=LA&&e<=NA||e>=AA&&e<=kA}function Jp(e){return Qp(e)||e===Fi||e===Bu||e===Zp}var La="(?=[\\s/>])",xA=new RegExp(`<!--|-->|<\\/?script${La}\\s*\\/?>?`,"i"),OA=new RegExp(`<\\/style${La}`,"i"),RA={"text/x-handlebars-template":!0,"text/html":!0};function MA(e,t=0,n=0,r=!1){const o=new vA(e,t);let i=n,s=0,a=18,l,c,u=!1,d,m,h;function f(){return o.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function g(){const v=o.pos();for(;!o.eos();){const C=o.nextChar();if(C===Jt)return!0;if(C===Hi)break;if(C===Kp||C===Yp){if(!o.advanceUntilChar(C))break;o.advance(1)}}return o.goBackTo(v),!1}function E(){for(;o.advanceUntilChar(Hi)&&!Jp(o.peekChar(1));)o.advance(1)}function w(v){return o.advanceUntilChar(Jt)&&o.advance(1),L(v,22)}function T(){return o.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function L(v,C,b){return a=C,s=v,l=b,C}function y(){const v=o.pos(),C=i,b=p();return b!==21&&v===o.pos()&&!(r&&(b===4||b===8))?(o.advance(1),L(v,18)):b}function p(){const v=o.pos();if(o.eos())return L(v,21);let C;switch(i){case 6:return o.advanceIfChars([_o,_o,Jt])?(i=0,L(v,2)):(o.advanceUntilChars([_o,_o,Jt]),L(v,1));case 3:return o.advanceIfChar(Jt)?(i=0,L(v,15)):(o.advanceUntilChar(Jt),L(v,14));case 0:return o.peekChar()===Hi&&Jp(o.peekChar(1))?(o.advance(1),o.peekChar()===Bu?o.advanceIfChars([Bu,_o,_o])?(i=6,L(v,0)):o.advanceIfRegExp(/^!doctype/i)?(i=3,L(v,13)):w(v):o.peekChar()===Zp?w(v):o.advanceIfChar(Fi)?Qp(o.peekChar())?(i=2,L(v,7)):w(v):(i=1,L(v,3))):(E(),L(v,16));case 2:return f().length>0?(i=5,u=!1,L(v,9)):o.skipWhitespace()?L(v,17,"Tag name must directly follow the open bracket."):(i=5,o.advanceUntilChar(Jt),v<o.pos()?L(v,18,"End tag name expected."):p());case 5:if(o.skipWhitespace())return u=!0,L(v,17);if(o.advanceIfChar(Jt))return i=0,L(v,8);if(r&&o.peekChar()===Hi)return i=0,L(v,8,"Closing bracket missing.");if((u||o.peekChar()===Fi)&&g())return i=0,L(v,8);C="Closing bracket expected.";break;case 1:return d=f(),h=void 0,m=void 0,d.length>0?(c=!1,i=4,L(v,6)):o.skipWhitespace()?L(v,17,"Tag name must directly follow the open bracket."):(i=4,o.advanceUntilChar(Jt),v<o.pos()?L(v,18,"Start tag name expected."):p());case 4:return o.skipWhitespace()?(c=!0,L(v,17)):c&&(m=T(),m.length>0)?(i=9,c=!1,L(v,11)):o.advanceIfChars([Fi,Jt])?(i=0,L(v,5)):o.advanceIfChar(Jt)?(d==="script"?h&&RA[h]?i=0:i=7:d==="style"?i=8:i=0,L(v,4)):r&&o.peekChar()===Hi?(i=0,L(v,4,"Closing bracket missing.")):(o.advance(1),L(v,18,"Unexpected character in tag."));case 9:return o.skipWhitespace()?(c=!0,L(v,17)):o.advanceIfChar(EA)?(i=10,L(v,10)):(i=4,p());case 10:if(o.skipWhitespace())return L(v,17);let b=o.advanceIfRegExp(/^[^\s"'`=<>]+/);if(b.length>0)return o.peekChar()===Jt&&o.peekChar(-1)===Fi&&(o.goBack(1),b=b.substr(0,b.length-1)),m==="type"&&(h=b),i=4,c=!1,L(v,12);const S=o.peekChar();return S===Yp||S===Kp?(o.advance(1),o.advanceUntilChar(S)&&o.advance(1),m==="type"&&(h=o.getSource().substring(v+1,o.pos()-1)),i=4,c=!1,L(v,12)):(i=4,c=!1,p());case 7:let _=1;for(;!o.eos();){const k=o.advanceIfRegExp(xA);if(k.length===0)return o.goToEnd(),L(v,19);if(k==="<!--")_===1&&(_=2);else if(k==="-->")_=1;else if(k[1]!=="/")_===2&&(_=3);else if(_===3)_=2;else{o.goBack(k.length);break}}return i=0,v<o.pos()?L(v,19):p();case 8:return o.advanceUntilRegExp(OA),i=0,v<o.pos()?L(v,20):p()}return o.advance(1),i=0,L(v,18,C)}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 PA(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function IA(e,t){const n=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+n.length,n}function DA(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function BA(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 Hu=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function HA(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}var eg=Object.create(null);function FA(e,t){const n=eg[e]||(eg[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[HA(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function Fu(e,t){if(e.start===e.end||t)return"";switch(e.type){case I.ELEMENT:return Wu(e,t);case I.ROOT:return[...e.children].map(n=>Fu(n,t)).join("");case I.DOCTYPE:return PA(e,t);case I.COMMENT:return DA(e,t);default:return e.content||""}}function $u(){return{exact:new WeakMap,collapsed:new WeakMap}}function Zn(e,t=!1,n){if(e.start===e.end&&e.type!==I.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=>Zn(a,t,n)).join("");let s;switch(e.type){case I.ELEMENT:{const a=e.tag?.toLowerCase();s=`<${a}${e.attributeNames.map(l=>` ${l}=${JSON.stringify(e.attributes?.[l]??null)}`).join("")}>${i()}</${a}>`;break}case I.ROOT:s=i();break;case I.COMMENT:s=`<!--${e.content??""}-->`;break;case I.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 Na(e,t=0){if(e.start===e.end)return"";switch(e.type){case I.ELEMENT:return WA(e,t);case I.ROOT:return ng(e,t);case I.DOCTYPE:return IA(e,t);case I.COMMENT:return BA(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function tg(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"&&!FA(t,i)?` ${i}`:` ${i}="${s.replaceAll('"',"'")}"`)}}}return n}function $A(e,t){let n="";if(e.startTagEnd!==e.endTagStart||t)for(const r of e.children)n+=Fu(r);return n}function ng(e,t){let n="";if(e.startTagEnd!==e.endTagStart)for(const r of e.children)n+=Na(r,t+n.length);return n}function rg(e,t){if(e.start!==e.startTagEnd||t){const n=e.tag?.toLowerCase()||"div",r=tg(e);return n==="vk-snippet-end"?`<${n}${r}/>`:`<${n}${r}>`}return""}function og(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function Wu(e,t,n=!0){const r=e.tag?.toLowerCase()||"div",o=rg(e,t);if(Hu.has(r))return o;{const i=og(e,t);return`${o}${n?$A(e,t):""}${i}`}}function WA(e,t){const n=e.tag?.toLowerCase()||"div",r=rg(e);if(e.start=t,e.startTagEnd=t+r.length,Hu.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=ng(e,e.startTagEnd);e.endTagStart=e.startTagEnd+o.length;const i=og(e);return e.end=e.endTagStart+i.length,`${r}${o}${i}`}}function qu(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 I=(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})({}),xa=e=>e.type===0?e.start-1:e.start,qA=e=>e.type===0?e.end+1:e.end,wt=class uA{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(t,n,r,o){A(this,"start",void 0),A(this,"end",void 0),A(this,"children",void 0),A(this,"parent",void 0),A(this,"content",void 0),A(this,"type",1),A(this,"tag",void 0),A(this,"closed",!1),A(this,"startTagEnd",void 0),A(this,"endTagStart",void 0),A(this,"attributes",void 0),A(this,"createdBy",void 0),A(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=qu(this.children,r=>t<=xa(r))-1;if(n>=0){const r=this.children[n];if(t>xa(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=qu(this.children,r=>t<=xa(r))-1;if(n>=0){const r=this.children[n];if(t>=xa(r)&&t<=qA(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 uA(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 zA(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 ig=class{constructor(e,t){A(this,"text",void 0),A(this,"type",void 0),A(this,"node",void 0),A(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}}},sg=class{constructor(e){A(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const n=MA(e,void 0,void 0,!0),r=new wt(0,e.length,[],void 0);r.type=I.ROOT;let o=r,i=-1,s,a=null,l=n.scan();const c=()=>{if(!o.tag){const g=o.parent.children,E=g[g.length-2],w=e.substring(o.start,o.end);E?.type===I.HTML?(E.content=(E.content||"")+w,E.end=o.end,g.splice(g.length-1,1)):(o.type=I.HTML,o.content=w,o.children=[]),o.type=I.HTML}o=o.parent},u=new ig(e,I.COMMENT),d=new ig(e,I.DOCTYPE),m=g=>{o.children.push(g)},h=(g,E)=>{const w=new wt(g,E,[],o);w.type=I.HTML,w.content=e.substring(g,E),m(w)};for(;l!==St.EOS;){switch(l){case St.StartDoctypeTag:d.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case St.EndDoctypeTag:{const L=o.lastChild,y=d.node;if(!y)throw new Error("");const p=L?L.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(p!==y.start){const v=e.substring(p,y.start);if(v){const C=new wt(p,y.start,[],o);C.type=I.HTML,C.content=v,m(C)}}d.finish(n.getTokenOffset(),n.getTokenLength());break}case St.StartCommentTag:u.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case St.EndCommentTag:{const L=o.lastChild,y=u.node;if(!y)throw new Error("");const p=L?L.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(p!==y.start){const v=e.substring(p,y.start);if(v){const C=new wt(p,y.start,[],o);C.type=I.HTML,C.content=v,m(C)}}u.finish(n.getTokenOffset(),n.getTokenLength());break}case St.StartTagOpen:const g=o.lastChild,E=new wt(n.getTokenOffset(),e.length,[],o),w=g?g.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(w!==E.start){const L=e.substring(w,E.start);if(L){const y=new wt(w,E.start,[],o);y.type=I.HTML,y.content=L,m(y)}}m(E),o=E;break;case St.BogusComment:{const L=o.lastChild?.end??o.startTagEnd??o.start;L<n.getTokenOffset()&&h(L,n.getTokenOffset()),h(n.getTokenOffset(),n.getTokenEnd());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 T=o;for(;!T.isSameTag(s)&&T.parent;)T=T.parent;if(T.parent){const L=o.lastChild,y=L?L.end:o.startTagEnd===void 0?o.start:o.startTagEnd;if(y!==i){const p=e.substring(y,i);if(p){const v=new wt(y,i,[],o);v.type=I.HTML,v.content=p,m(v)}}for(;o!==T;)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 L=o.attributes;L||(o.attributes=L={}),L[a]=null;break}case St.AttributeValue:{const L=n.getTokenText(),y=o.attributes;y&&a&&(y[a]=zA(L),a=null);break}}l=n.scan()}for(;o.parent;)o.end=e.length,o.closed=!1,c();u.hasNode,u.finish(e.length);const f=r.lastChild?.end||0;if(f<e.length){const g=e.substring(f);if(g){const E=new wt(f,e.length,[],r);E.type=I.HTML,E.content=g,m(E)}}return{roots:r.children,findNodeBefore:r.findNodeBefore.bind(r),findNodeAt:r.findNodeAt.bind(r)}}},BJ=new sg(new Xp(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),UA=new Xp(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),jA=new sg(UA);function fn(e){return jA.parse(e)}var zu=Symbol("bogusCommentSource");function vr(e){if(e){const t=document.createElement("div");t.insertAdjacentHTML("afterbegin",e);const n=t.firstChild??document.createTextNode("");return n.nodeType===Node.COMMENT_NODE&&VA(n,e),n}else return document.createTextNode("")}function VA(e,t){const n={source:t,data:e.data};Object.defineProperty(e,zu,{value:n,configurable:!0})}function $i(e){const t=e[zu];return t&&t.data===e.data?t:void 0}function Oa(e){return $i(e)?.source}function ag(e,t){if(e.nodeType===Node.COMMENT_NODE){t.push(e);return}(e.nodeName==="TEMPLATE"?e.content:e).childNodes.forEach(n=>ag(n,t))}function Ra(...e){const t=[];return e.forEach(n=>ag(n,t)),t}function GA(e,t){return e.data===t.data&&(e.parent===void 0||t.parent===void 0||e.parent===t.parent)}function lg(e,t){$i(e)||Object.defineProperty(e,zu,{value:t,configurable:!0})}function XA(e){const t=new Map,n=new Set;for(const{data:r,mark:o}of e){const i=t.get(r);!o||i&&i.source!==o.source?n.add(r):i||t.set(r,o)}return n.forEach(r=>t.delete(r)),t}function KA(e,t,n){if(!t.length||!e.some(o=>o.mark))return;const r=[];for(let o=0;o+t.length<=e.length;o++)n.every((i,s)=>GA(e[o+s],i))&&r.push(o);if(!r.length){const o=XA(e);t.forEach(i=>{const s=o.get(i.data);s&&lg(i,s)});return}t.forEach((o,i)=>{const s=r.map(l=>e[l+i].mark),[a]=s;a&&s.every(l=>l?.source===a.source)&&lg(o,a)})}function cg(e,t){const n=e.parentNode,r=n&&n.nodeType===Node.ELEMENT_NODE&&!t.includes(n);return{data:e.data,mark:$i(e),parent:r?n.nodeName.toLowerCase():void 0}}function ug(e,t,n){const r=Ra(...t),o=n?[...t,n]:t;KA(e,r,r.map(i=>cg(i,o)))}function en(e,t){ug(Ra(e).map(n=>cg(n,[e])),[t],null)}var YA=/<[!?]|<\/[^a-zA-Z]/,ZA=/^<[!?/]/;function QA(e){const t=[],n=r=>{const o=r.parent?.tag?.toLowerCase();if(r.type===I.COMMENT)t.push({data:r.content??"",mark:void 0,parent:o});else if(r.type===I.HTML&&r.content&&ZA.test(r.content)){const i=vr(r.content);i.nodeType===Node.COMMENT_NODE&&t.push({data:i.data,mark:$i(i),parent:o})}r.children.forEach(n)};try{fn(e).roots.forEach(n)}catch{return[]}return t}function dg(e,t,n=null){YA.test(t)&&ug(QA(t),e,n)}function Uu(e,t){dg([e],t)}var Wi="",JA=4,fg=0;function ek(){return fg+=1,`${Math.random().toString(36).slice(2)}${fg.toString(36)}`}function tk(e,t,n){if(e.split(`${Wi}${t}:`).length-1!==n.length)return;const r=e.split(new RegExp(`<!--${Wi}${t}:(\\d+)${Wi}-->`)),o=r.filter((i,s)=>s%2===1).map(Number);if(!(o.length!==n.length||new Set(o).size!==n.length||o.some(i=>i>=n.length)))return r.map((i,s)=>s%2?n[Number(i)]:i).join("")}function Ma(e,t,n){const r=Ra(e),o=r.map(l=>$i(l)?.source);if(o.every(l=>l===void 0))return t?e.outerHTML:e.innerHTML;const i=n?e:e.cloneNode(!0),s=n?r:Ra(i),a=r.map(l=>l.data);for(let l=0;l<JA;l++){const c=ek(),u=[];s.forEach((m,h)=>{const f=o[h];f!==void 0&&(m.data=`${Wi}${c}:${u.length}${Wi}`,u.push(f))});const d=tk(t?i.outerHTML:i.innerHTML,c,u);if(d!==void 0)return d}return s.forEach((l,c)=>{l.data=a[c]}),t?i.outerHTML:i.innerHTML}function Er(e){return Ma(e,!0,!1)}function Xe(e){return Ma(e,!1,!1)}function mg(e){return Ma(e,!0,!0)}function nk(e){return Ma(e,!1,!0)}function Ce(e,t){e.innerHTML=t,Uu(e,t)}function zt(e,t){Ce(e,Xe(t))}function ju(e){qi(e,Xe(e))}function qi(e,t){const n=e.parentNode,r=e.previousSibling,o=e.nextSibling;if(e.outerHTML=t,!n)return;const i=[];for(let s=r?r.nextSibling:n.firstChild;s&&s!==o;s=s.nextSibling)i.push(s);dg(i,t,n)}var hg=new Set(["text/x-handlebars-template","text/html"]);function Pa(e,t){if(e.type!==I.HTML||!t)return!1;const n=t.tag?.toLowerCase(),r=t.attributes?.type;return n==="style"||n==="script"&&!hg.has(typeof r=="string"?r:"")}var rk={amp:"&",lt:"<",gt:">",nbsp:String.fromCodePoint(160),quot:'"'};function Vu(e){return e.replaceAll(/&(amp|lt|gt|nbsp|quot);/g,(t,n)=>rk[n])}var pg=Symbol("rawTextSource");function Gu(e){const t=document.createTextNode(Vu(e));return gg(t,e),t}function gg(e,t){Object.defineProperty(e,pg,{value:t,configurable:!0})}function ok(e,t){e.data=Vu(t),gg(e,t)}function bg(e){const t=e[pg];return t!==void 0&&Vu(t)===e.textContent?t:void 0}var Co,Xr;function yg(e){const t=Co;return Co=e,()=>{Co===e&&(Co=t)}}function ik(e){const t=Xr;return Xr=e,()=>{Xr===e&&(Xr=t)}}function vg(e,t,n){return Co?Co(e,t,n):n}function sk(){return Xr!==void 0}function Eg(e,t,n){return Xr?Xr(e,t,n):n}var Xu;function ak(){return Xu||(Xu=document.implementation.createHTMLDocument("")),Xu}function lk(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 ck=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),uk=new Set(["script","style","xmp"]);function dk(e,t){return!(t&&uk.has(t.toLowerCase())||ck.has(e.toLowerCase()))}var fk=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1},mk=new Set(["head","body"]);function Sg(e,t,n){let r=e.tagName.toLowerCase();r==="html"&&(r="div");const o=`<${r} ${t}="${n}"/>`,i=ak(),s=mk.has(r)?lk(i,r):i.createElement("template");if(s instanceof Document)return;s.innerHTML=o;const a=(s.tagName==="TEMPLATE"?s.content:s).querySelector(r);if(!a)throw new Error("targetElement is not defined");const l=a.getAttributeNode(t);l&&e.setAttributeNode(l.cloneNode())}function Qn(e,t,n){try{dk(t,e.tagName)&&!fk(n)?e.setAttribute(t,n):Sg(e,t,n)}catch{Sg(e,t,n)}}function wg(){return vr("<script><\/script>")}var hk="text/x-em-dormant",zi=Symbol("dormantScriptType");function Ku(e){e[zi]=e.getAttribute("type"),e.setAttribute("type",hk)}function Ia(e){return zi in e}function pk(e){const t=[...e].filter(n=>!Ia(n));return t.forEach(Ku),t}function gk(e,t){return Ia(e)?(e[zi]=t,!0):!1}function _g(e){const t=new Set;for(const n of e){const r="querySelectorAll"in n?n.querySelectorAll("script"):[];for(const o of[n,...r])Ia(o)&&t.add(o)}return[...t]}function Cg(e){if(!Ia(e))return;const t=e[zi];delete e[zi],typeof t=="string"?e.setAttribute("type",t):e.removeAttribute("type")}var bk=["application/ecmascript","application/javascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript"];function yk(e){const t=e.getAttribute("type"),n=e.getAttribute("language");return t===""||t===null&&!n?"text/javascript":(t===null?`text/${n}`:t.trim()).toLowerCase()}function Tg(e){const t=yk(e);return bk.includes(t)?"classic":t==="module"||t==="importmap"||t==="speculationrules"?t:void 0}function vk(e){return Tg(e)==="classic"}function Ek(e){const t=e.getAttribute("for"),n=e.getAttribute("event");return t===null||n===null?!0:t.trim().toLowerCase()==="window"&&["onload","onload()"].includes(n.trim().toLowerCase())}function Sk(e){const t=Tg(e);return!t||t==="speculationrules"||Da(e)?!1:t!=="classic"||!e.hasAttribute("nomodule")&&Ek(e)}function wk(e){return e.hasAttribute("src")&&!["async","defer","nomodule"].some(t=>e.hasAttribute(t))&&vk(e)}function Da(e){for(let t=e.parentElement;t;t=t.parentElement)if(t.localName==="template"&&t.namespaceURI==="http://www.w3.org/1999/xhtml")return!0;return!1}function Ag(e,t){const n=e.parentNode;!n||!e.isConnected||(e.hasAttribute("src")&&!e.hasAttribute("async")&&(e.async=!1),t.run(e,()=>n.insertBefore(e,e.nextSibling)))}function kg(e,t){[...t.attributes].forEach(r=>t.removeAttributeNode(r)),[...e.attributes].forEach(r=>t.setAttributeNode(r.cloneNode()));const n=Object.getOwnPropertyDescriptor(e,"$$tagName");n&&!Object.getOwnPropertyDescriptor(t,"$$tagName")&&Object.defineProperty(t,"$$tagName",n)}function Lg(e,t,n){e.replaceWith(t),t.append(...e.childNodes),n.substitute?.(e,t)}function Ng(e,t){const n=wg();return kg(e,n),t.quiet(()=>Lg(e,n,t)),n}function _k(e,t,n){const r=Ng(t,n),o=()=>{e.removeEventListener("load",o),e.removeEventListener("error",o),r.isConnected&&(n.quiet(()=>{kg(r,t),Ku(t),Lg(r,t,n),Cg(t)}),Ag(t,n))};e.addEventListener("load",o),e.addEventListener("error",o)}function xg(e,t){e.forEach(Cg);const n=e.filter(Da),r=e.filter(i=>i.isConnected&&!Da(i));if(!r.length&&!n.length)return;r.sort((i,s)=>i.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t.awake?.(),n.forEach(i=>Ng(i,t));let o;for(const i of r)o&&!i.hasAttribute("src")?_k(o,i,t):(Ag(i,t),o=wk(i)?i:o)}function Kr(e,t=!0,n=!1){const r=e.content;switch(e.type){case I.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(Kr(i,!0,n));return o}case I.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case I.COMMENT:return document.createComment(r||"");case I.ELEMENT:if(e.tag){const o=e.tag.toLowerCase()==="script",i=n===!0&&o?wg():document.createElement(e.tag);if(Object.defineProperty(i,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const s of e.attributeNames){const a=e.attributes[s];try{const l=vg(i,s,typeof a=="string"?a:"");l!==null&&Qn(i,s,l)}catch{}}if(n==="dormant"&&o&&Ku(i),t){const s=e.tag.toLowerCase()==="template"?!0:n;for(const a of e.children)i.appendChild(Pa(a,e)?Gu(a.content||""):Kr(a,!0,s))}return i}return document.createTextNode("<");case I.HTML:return vr(r||"");default:throw new Error("unsupported node")}}function Re(e,t=!1){return fn(e).roots.map(n=>Kr(n,!0,t))}function Ba(e,t,n){switch(t){case"afterend":e.after(...n);break;case"afterbegin":e.prepend(...n);break;case"beforeend":e.append(...n);break;case"beforebegin":e.before(...n)}}function Ck(e,t){e.replaceChildren(...Re(t,!0))}function Jn(e,t,n){Ba(e,t,Re(n,!0))}var Og=Symbol.for("emailmaker.documentWriteGuard"),Ui=Symbol.for("emailmaker.documentWriteSink");function Tk(e,t=document){const n=t,r=n[Ui];return n[Ui]=e,()=>{n[Ui]===e&&(n[Ui]=r)}}function HJ(e){}function Yu(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0,writable:!0})}function Ak(e,t,n){for(let r=e.writerOf.get(t);r;r=e.writerOf.get(r))if(r===n)return!0;return!1}function kk(e,t){let n=t;for(;n.nextSibling&&Ak(e,n.nextSibling,t);)n=n.nextSibling;return n}function Rg(e,t,n){if(!n.length)return;n.forEach(i=>e.writerOf.set(i,t));const r=()=>{for(const i of n){const s=t.parentNode;if(!s)return;s.insertBefore(i,kk(e,t).nextSibling)}},o=e.doc[Ui];o?o(n,r,t):r()}function Mg(e,t){return!!e&&e.type===I.ELEMENT&&!e.closed&&e.end===t}function Lk(e,t){let n="";for(let r=e;Mg(r,t);r=r.lastChild)n=`</${r.tag}>${n}`;return n}function Nk(e){const t=fn(e).roots,n=t[t.length-1],r=Mg(n,e.length);return{nodes:(r?t.slice(0,-1):t).map(o=>Kr(o)),rest:r?e.slice(n.start):""}}function xk(e){const t=[...e.pending];e.pending.clear();for(const[n,r]of t){const o=fn(r).roots,i=r+Lk(o[o.length-1],r.length);Rg(e,n,fn(i).roots.map(s=>Kr(s)))}}function Pg(e,t,n){const r=e.doc.currentScript;if(!r?.parentNode){return}const{nodes:o,rest:i}=Nk((e.pending.get(r)??"")+n);i?(e.pending.size||queueMicrotask(()=>xk(e)),e.pending.set(r,i)):e.pending.delete(r),Rg(e,r,o)}function Ok(e=document){const t=e;if(t[Og])return;t[Og]=!0;const n={doc:t,writerOf:new WeakMap,pending:new Map};Yu(e,"write",(...r)=>Pg(n,"write",r.join(""))),Yu(e,"writeln",(...r)=>Pg(n,"writeln",`${r.join("")}
|
|
2
|
+
`)),Yu(e,"open",(...r)=>r.length>=3?e.defaultView?.open(r[0],r[1],r[2])??null:e)}Ok();function Rk(e){return e}var Mk=class extends Error{constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),A(this,"cycle",void 0),this.cycle=e}};function Pk(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 Ik(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 Dk(e){const t=Pk(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 Mk([...o.slice(l),a].map(c=>c.name))}i.add(a),o.push(a);for(const l of Ik(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 ve=class dA{constructor(t=[]){A(this,"_inner",void 0),A(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof dA&&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 Zu(e){return`service_container_${e}`}var ji=new Set,Qu;function Bk(){if(!Qu)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,Ig.prototype.getInstanceAsync),e.stack}function Ju(e){ji.delete(e)&&Qu?.end(e)}var Ig=class Wp extends ve{_runCallbacks(t){[...this._injectCallbacks].forEach(n=>n(t))}constructor(t=null){super(),A(this,"_parent",void 0),A(this,"_injectCallbacks",[]),A(this,"_injections",Object.create(null)),A(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 ve){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=Bk();return new Promise((o,i)=>{const s={id:String(t),startedAt:Date.now(),origin:r,container:this,reject:i};ji.add(s),Qu?.start(s),this._onInject(t,()=>{Ju(s),o(this.getInstance(t))})})}failPendingWaits(t){for(const n of Array.from(ji))n.container===this&&(Ju(n),n.reject(t))}pendingWaits(){return[...ji].filter(t=>t.container===this)}addService(t,n){const r=Zu(t);this.injectFactory(r,(i,s=[])=>s.indexOf(n)<0?[...s,n]:s);const o=new ve;return o.addDispose(()=>{this.injectFactory(r,(i,s=[])=>s.filter(a=>a!==n))}),o}addServiceFactory(t,n,r){const o=Zu(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 ve;return s.addDispose(()=>{this.injectFactory(o,(a,l=[])=>i===void 0?l:l.filter(c=>c!==i))}),s}getServices(t){const n=Zu(t);return[...this.getInstance(n,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new Wp(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const n=this._parent?.getOrCreateIsolatedContainer(t);return new Wp(n)})}remove(t){const n=this._injections;delete n[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(ji))t.container===this&&Ju(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function ed(e){return e.startsWith("__")?e:`__${e}__`}function Hk(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=ed(e),n=globalThis;return n[t]??(n[t]={})}function Fk(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function $k(e){if(e)return ed(e);const t="emailmaker".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return ed(t)}function td(e){const t=$k(e),n=Hk(t);if(Fk(n.container))return n.container;const r=new Ig(null);return n.container=r,r}function Wk(){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 qk(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Wk()}function le(e=qk()){return e}function Dg(){return"iframe".trim()||"unknown"}function zk(e){if(typeof globalThis>"u")return;const t=Dg(),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 Uk(){const e="emailmaker".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function jk(e,t){if(zk(t),typeof globalThis>"u")return e;const n=Dg(),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 Ha;function Vk(){if(Ha)return Ha;const e=Uk();return Ha=jk(td(e),e),Ha}var FJ=new Proxy({},{get(e,t,n){const r=Vk(),o=Reflect.get(r,t,n);return typeof o=="function"?o.bind(r):o}}),Gk=new Function("url","return import(url)");function Xk(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function nd(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function Bg(e){return e.type==="umd"||e.resolve==="registry"}var Kk="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 Yk(e){const t=Array.isArray(e)?e[0]:e;return nd(t)?t.name??t.url:typeof t=="function"?t.name||"anonymous plugin":String(t)}function Zk(e,t){const n=Yk(e),r=nd(e)?e:void 0,o=t instanceof Error?t.message:String(t),i=r&&Bg(r)&&!/compat/iu.test(o)?` ${Kk}`:"",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 Qk(e){return!e.filename&&!e.error&&/^Script error\.?$/.test(e.message)}function $J(e){return e}var Jk=class{constructor(e,t,n={}){A(this,"_context",void 0),A(this,"_pluginRegistry",void 0),A(this,"_options",void 0),A(this,"_map",new Map),A(this,"_optionsMap",new Map),A(this,"_readyMap",new Map),A(this,"_resolveMap",new Map),A(this,"_initializingPlugins",new Map),A(this,"_creatingPlugins",new Set),A(this,"_initializedPlugins",new Set),A(this,"_creationOrder",[]),A(this,"_lifecycleListeners",new Set),A(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(nd(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(Bg(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const n=await Gk(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):Qk(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=Zk(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 Xk(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)}))}},eL=class{constructor(){A(this,"_plugins",new Map),A(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)}}}},tL=class{constructor(e){A(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()}},K=le("SandboxHtmlDocument"),_t=le("SandboxRemoteDocument"),Vi=le("SandboxTextDocument"),mn=le("SandboxDocumentMapping"),Te=le("SandboxSyncCommit"),Gi=le("SandboxLayoutProfile"),Hg=le("SandboxState"),Me=le("SandboxSelectionLock"),nt=le("SandboxEditLock"),To=le("SandboxAttributePipeline"),rd=le("SandboxAmpService"),od=le("SandboxImageReload"),Fa=le("SandboxImageCache"),ft=le("SandboxFocus"),id=le("SandboxLocalization"),He=le("SandboxElementSettings"),Ot=le("SandboxSetCursor"),Fg=le("SandboxStyleRoot"),$g=le("SandboxVmlWidthResolver"),$a=le("SandboxPrepareHtml"),Xi=le("SandboxSurfaceName"),Ao=le("SandboxDocumentSync"),ko=le("SandboxMapObj"),Lo=le("SandboxActiveElementFingerprint"),Wa=le("SandboxToggleTextStyle"),hn=le("SandboxWrapEditor"),No=le("SandboxInsertServices"),Ki=le("SandboxInitPreview"),sd=le("SandboxInsertPolicy"),xo=le("SandboxTableSelections"),Wg=le("SandboxNarrowTableTextAtom"),qg=le("SandboxSettingsExtras"),zg=le("SandboxViewportHandlers"),Ug=le("SandboxOperations"),qa=le("SandboxApplyElementSettings"),Sr=le("SandboxOperationEnvironment"),Oo=le("SandboxHostFacts"),nL="__sandbox__",Rt=td(nL);function rL(e){return e}function oL(e,t=Rt){t.inject(Xi,e.name),t.inject(Gi,e.profile);for(const n of Dk(e.units))n.setup(t);return t}function pn(e,t){e.remove?.(t)}function R(e,t){const n=e.getInstance(t);if(n===void 0)throw new Error(`[sandbox] служба «${String(t)}» не зарегистрирована: её фича не подключена или ещё не зарегистрирована`);return n}var jg=class extends ve{constructor(e={}){super(),A(this,"_options",void 0),A(this,"_listeners",[]),A(this,"on",this._addListener.bind(this)),A(this,"event",this._addListener.bind(this)),A(this,"once",(t,n=0,r)=>{const o=this._addListener((...i)=>(o?.dispose(),r?t.call(r,...i):t(...i)),n);return o}),A(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()}},iL=class extends jg{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}}},he=class extends iL{execute([e],t){for(const n of t)try{n(e)}catch{}}},sL=class extends jg{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 aL(e,t,n){let r;const o=new he({onFirstListenerAdd(){r=o.addDisposable(new ve),r.addDisposable(e(i=>{t(i)!==!1&&o.fire(i)}))},onLastListenerRemove(){r?.dispose(),r=void 0}});return n?.addDisposable(o),o.event}function lL(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 cL(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 WJ(e){return e}function uL(e){return e&&typeof e=="object"}function Vg(e,t){return e&&typeof e=="object"&&e.operationId===t}var On="INIT_MESSAGE",dL="em:port-ready",fL="em:window-drained",ad="";function Gg(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var mL=class extends ve{constructor(...e){super(...e),A(this,"_listeners",Object.create(null)),A(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)}}}),A(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)}}),A(this,"addListener",(t,n,r=0)=>this.addListenerAsync(t,(o,i)=>{try{n(o)}catch{}return i&&i(o)},r))}},hL=class extends ve{constructor(e,t){super(),A(this,"_singleton",void 0),A(this,"_target",void 0),A(this,"_transport",void 0),A(this,"_transportSubscription",void 0),A(this,"_ports",new Map),A(this,"_drained",new WeakSet),A(this,"_portSendHeld",new WeakSet),A(this,"_inited",!1),A(this,"_emitter",this.addDisposable(new mL)),A(this,"_handshaken",new WeakSet),A(this,"_greeted",new WeakSet),A(this,"_outgoingFilter",void 0),A(this,"_outgoingObservers",new Set),A(this,"_offTargetListeners",new Map),A(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)&&Vg(o,On)){this._greeted.delete(i),this._handshaken.add(i),this._postMessage(i,{operationId:On,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),uL(o)&&l||this._singleton&&Vg(o,On)){if(s&&l){const m=this._target;Promise.resolve().then(()=>this.usePort(s,!0,m))}const c=this._emitter.fireAsync(o.operationId||ad,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=lL({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(On,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(On))}),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(On,void 0);return}this._inited=!1,this._postMessage(e,{operationId:On,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:On,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:On,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=cL(e),o=r.subscribe(this._onTransportMessage);this._ports.set(n,{transport:r,subscription:o}),t&&(r.send({operationId:dL,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:fL,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(ad,e,t)}sendAsync(e,t,n=!0){if(!n&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const r=Gg(),o=Gg();return new Promise((i,s)=>{const a=this.addDisposable(new ve);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(ad,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 ve);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(On,()=>{e(this._target)},n)),r}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}};function Xg(e,t){if(e===t)return;let n=0;const r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;let o=e.length,i=t.length;for(;o>n&&i>n&&e[o-1]===t[i-1];)o--,i--;return{start:n,fromEnd:o,toEnd:i}}function Kg(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return{length:e.length,hash:t>>>0}}var pL=/<\/?[a-zA-Z][a-zA-Z0-9:_.-]*(?:\s[^<>]*)?\/?>/g;function gL(e){return e.replace(pL,t=>/^<br\b/i.test(t)?" ":"")}var bL={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"},yL=15e3,ld=3e3,vL="fonts.googleapis.com",EL=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},SL=e=>{const t=EL(String(e??""));return t?t.hostname===vL&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},Ae={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_EBLOCK_CLEAR_EM_BLOCK_ID:"sandbox_eblock_clear_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",SANDBOX_CANVAS_SYNCED:"sandbox_canvas_synced"},wL=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"),TABLE_MENU_COLUMNS:e("Columns"),TABLE_MENU_ROWS:e("Rows"),DROP_BLOCK_HINT:e("Click or drag a block")}),G=new hL(window.parent,!0),za,Yi,Yg=Math.random().toString(36).slice(2,8),_L=0,Ua;function Zg(e,t){const n=za;za=e;try{return t()}finally{za=n}}function ja(e,t){const n=Yi;Yi=e;try{return t()}finally{Yi=n}}function CL(){return Yi}function TL(){try{return za?.()}catch{return}}function AL(){return Ua||(Ua=`${Yg}:${++_L}`,Promise.resolve().then(()=>{Ua=void 0})),Ua}function rt(e,t){const n=TL();return G.send(Ae.APPLICATION_DOMPARSER_ERROR,{message:e,stack:new Error().stack,...n?{mutation:n}:{},source:Yi??"other",batch:AL(),instance:Yg}),t}function cd(e,t){let n=t.children,r=e(t)||0;if(r!=0||!n)return r!==1;for(const o of n)if(cd(e,o)===!1)return!1;return!0}function Qg(e,t,n=[t]){for(;t=t.parent;)if(e(n=[t,...n])===!1)return!1;return!0}function kL(e,t){return Qg(([n,r])=>{const{children:o}=n;if(o){for(let i=o.indexOf(r)+1,s=o.length;i<s;i++)if(cd(e,o[i])===!1)return!1}},t)}function er(e,t,n){cd(r=>{r.start+=t,r.startTagEnd!==void 0&&(r.startTagEnd+=t),r.end+=t,r.endTagStart!==void 0&&(r.endTagStart+=t)},e),n&&(Qg(([r])=>{r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e),kL(r=>{r.start+=n,r.startTagEnd!==void 0&&(r.startTagEnd+=n),r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e))}var LL=e=>e.type===I.HTML?e.start-1:e.start,NL=e=>e.type===I.HTML?e.end+1:e.end;function xL(e,t){const{start:n,end:r}=e;let o=t.findNodeAt(n);for(;o&&(LL(o)>=n||NL(o)<=r||o.start===o.startTagEnd);)o=o.parent;return o}function OL(e){return{start:e.start+(e.tag?.length||0)+1,end:(e.startTagEnd!==void 0?e.startTagEnd:e.start)-1}}function Jg(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n>0)return t[n-1]}}function wr(e){let t=e;do t=RL(t);while(t&&t.type===I.HTML&&!t.content);return t}function RL(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n<0)return rt("parent and child not sync",e);if(n<t.length-1)return t[n+1]||null}return null}var Yr=class{constructor(e,t,n,r){A(this,"originalStart",void 0),A(this,"originalLength",void 0),A(this,"modifiedStart",void 0),A(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 eb(e,t){return(t<<5)-t+e|0}function ML(e,t){t=eb(149417,t);for(let n=0,r=e.length;n<r;n++)t=eb(e.charCodeAt(n),t);return t}var tb=class{constructor(e){A(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 nb(e,t,n){return new PL(new tb(e),new tb(t)).ComputeDiff(n).changes}var Ro=class{static Assert(e,t){if(!e)throw new Error(t)}},Mo=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]}},rb=class{constructor(){A(this,"m_changes",void 0),A(this,"m_originalStart",void 0),A(this,"m_modifiedStart",void 0),A(this,"m_originalCount",void 0),A(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 Yr(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}},PL=class Di{constructor(t,n,r=null){A(this,"ContinueProcessingPredicate",void 0),A(this,"_originalSequence",void 0),A(this,"_modifiedSequence",void 0),A(this,"_hasStrings",void 0),A(this,"_originalStringElements",void 0),A(this,"_originalElementsOrHash",void 0),A(this,"_modifiedStringElements",void 0),A(this,"_modifiedElementsOrHash",void 0),A(this,"m_forwardHistory",void 0),A(this,"m_reverseHistory",void 0),this.ContinueProcessingPredicate=r,this._originalSequence=t,this._modifiedSequence=n;const[o,i,s]=Di._getElements(t),[a,l,c]=Di._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(Di._isStringArray(n)){const r=new Int32Array(n.length);for(let o=0,i=n.length;o<i;o++)r[o]=ML(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)?Di._getStrictElement(this._originalSequence,t)===Di._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?(Ro.Assert(t===n+1,"originalStart should only be one more than originalEnd"),c=[new Yr(t,0,r,o-r+1)]):t<=n?(Ro.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[new Yr(t,n-t+1,r,0)]):(Ro.Assert(t===n+1,"originalStart should only be one more than originalEnd"),Ro.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 Yr(t,n-t+1,r,o-r+1)]}WALKTRACE(t,n,r,o,i,s,a,l,c,u,d,m,h,f,g,E,w,T){let L=null,y=null,p=new rb,v=n,C=r,b=h[0]-E[0]-o,S=-1073741824,_=this.m_forwardHistory.length-1;do{const k=b+t;k===v||k<C&&c[k-1]<c[k+1]?(d=c[k+1],f=d-b-o,d<S&&p.MarkNextChange(),S=d,p.AddModifiedElement(d+1,f),b=k+1-t):(d=c[k-1]+1,f=d-b-o,d<S&&p.MarkNextChange(),S=d-1,p.AddOriginalElement(d,f+1),b=k-1-t),_>=0&&(c=this.m_forwardHistory[_],t=c[0],v=1,C=c.length-1)}while(--_>=-1);if(L=p.getReverseChanges(),T[0]){let k=h[0]+1,x=E[0]+1;if(L!==null&&L.length>0){const N=L[L.length-1];k=Math.max(k,N.getOriginalEnd()),x=Math.max(x,N.getModifiedEnd())}y=[new Yr(k,m-k+1,x,g-x+1)]}else{p=new rb,v=s,C=a,b=h[0]-E[0]-l,S=1073741824,_=w?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const k=b+i;k===v||k<C&&u[k-1]>=u[k+1]?(d=u[k+1]-1,f=d-b-l,d>S&&p.MarkNextChange(),S=d+1,p.AddOriginalElement(d+1,f+1),b=k+1-i):(d=u[k-1],f=d-b-l,d>S&&p.MarkNextChange(),S=d,p.AddModifiedElement(d+1,f+1),b=k-1-i),_>=0&&(u=this.m_reverseHistory[_],i=u[0],v=1,C=u.length-1)}while(--_>=-1);y=p.getChanges()}return this.ConcatenateChanges(L,y)}ComputeRecursionPoint(t,n,r,o,i,s,a){let l=0,c=0,u=0,d=0,m=0,h=0;t--,r--,i[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const f=n-t+(o-r),g=f+1,E=new Int32Array(g),w=new Int32Array(g),T=o-r,L=n-t,y=t-r,p=n-o,v=(L-T)%2===0;E[T]=t,w[L]=n,a[0]=!1;for(let C=1;C<=f/2+1;C++){let b=0,S=0;if(C>100)return null;u=this.ClipDiagonalBound(T-C,C,T,g),d=this.ClipDiagonalBound(T+C,C,T,g);for(let k=u;k<=d;k+=2){k===u||k<d&&E[k-1]<E[k+1]?l=E[k+1]:l=E[k-1]+1,c=l-(k-T)-y;const x=l;for(;l<n&&c<o&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(E[k]=l,l+c>b+S&&(b=l,S=c),!v&&Math.abs(k-L)<=C-1&&l>=w[k])return i[0]=l,s[0]=c,x<=w[k]&&C<=1448?this.WALKTRACE(T,u,d,y,L,m,h,p,E,w,l,n,i,c,o,s,v,a):null}const _=(b-t+(S-r)-C)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(b,_))return a[0]=!0,i[0]=b,s[0]=S,_>0&&C<=1448?this.WALKTRACE(T,u,d,y,L,m,h,p,E,w,l,n,i,c,o,s,v,a):(t++,r++,[new Yr(t,n-t+1,r,o-r+1)]);m=this.ClipDiagonalBound(L-C,C,L,g),h=this.ClipDiagonalBound(L+C,C,L,g);for(let k=m;k<=h;k+=2){k===m||k<h&&w[k-1]>=w[k+1]?l=w[k+1]-1:l=w[k-1],c=l-(k-L)-p;const x=l;for(;l>t&&c>r&&this.ElementsAreEqual(l,c);)l--,c--;if(w[k]=l,v&&Math.abs(k-T)<=C&&l<=E[k])return i[0]=l,s[0]=c,x>=E[k]&&C<=1448?this.WALKTRACE(T,u,d,y,L,m,h,p,E,w,l,n,i,c,o,s,v,a):null}if(C<=1447){let k=new Int32Array(d-u+2);k[0]=T-u+1,Mo.Copy2(E,u,k,1,d-u+1),this.m_forwardHistory.push(k),k=new Int32Array(h-m+2),k[0]=L-m+1,Mo.Copy2(w,m,k,1,h-m+1),this.m_reverseHistory.push(k)}}return this.WALKTRACE(T,u,d,y,L,m,h,p,E,w,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,h=r.modifiedStart-d;if(m<o||h<i||s&&!this.OriginalElementsAreEqual(m,m+r.originalLength)||a&&!this.ModifiedElementsAreEqual(h,h+r.modifiedLength))break;const f=(m===o&&h===i?5:0)+this._boundaryScore(m,r.originalLength,h,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 h=this._findBetterContiguousSequence(a,c,u,m,s);if(h){const[f,g]=h;(f!==o.originalStart+o.originalLength||g!==o.modifiedStart+o.modifiedLength)&&(o.originalLength=f-o.originalStart,o.modifiedLength=g-o.modifiedStart,i.originalStart=f+s,i.modifiedStart=g+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 h=this._contiguousSequenceScore(d,m,i);h>0&&h>l&&(l=h,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 Mo.Copy(t,0,o,0,t.length-1),o[t.length-1]=r[0],Mo.Copy(n,1,o,t.length,n.length-1),o}else{const o=new Array(t.length+n.length);return Mo.Copy(t,0,o,0,t.length),Mo.Copy(n,0,o,t.length,n.length),o}}ChangesOverlap(t,n,r){if(Ro.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),Ro.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 Yr(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 Va(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var Ut=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){A(this,"oldPosition",void 0),A(this,"oldText",void 0),A(this,"newPosition",void 0),A(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} "${Va(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Va(this.oldText)}")`:`(replace@${this.oldPosition} "${Va(this.oldText)}" with "${Va(this.newText)}")`}};function Ct(e,t){return e===null||e.length===0?t:new IL(e,t).compress()}var IL=class br{constructor(t,n){A(this,"_prevEdits",void 0),A(this,"_currEdits",void 0),A(this,"_result",void 0),A(this,"_resultLen",void 0),A(this,"_prevLen",void 0),A(this,"_prevDeltaOffset",void 0),A(this,"_currLen",void 0),A(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]=br._splitCurr(o,r.newPosition-o.oldPosition);this._acceptCurr(l),o=c;continue}if(r.newPosition<o.oldPosition){const[l,c]=br._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]=br._splitPrev(r,o.oldLength);s=l,a=o,r=c,o=this._getCurr(++n)}else{const[l,c]=br._splitCurr(o,r.newLength);s=r,a=l,r=this._getPrev(++t),o=c}this._result[this._resultLen++]=new Ut(s.oldPosition,s.oldText,a.newPosition,a.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=a.newLength-a.oldLength}const i=br._merge(this._result);return br._removeNoOps(i)}_acceptCurr(t){this._result[this._resultLen++]=br._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++]=br._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 Ut(n.oldPosition-t,n.oldText,n.newPosition,n.newText)}static _rebasePrev(t,n){return new Ut(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 Ut(t.oldPosition,t.oldText,t.newPosition,r),new Ut(t.oldEnd,"",t.newPosition+n,o)]}static _splitCurr(t,n){const r=t.oldText.substr(0,n),o=t.oldText.substr(n);return[new Ut(t.oldPosition,r,t.newPosition,t.newText),new Ut(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 Ut(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 ob(e){return new Ut(e.newPosition,e.newText,e.oldPosition,e.oldText)}function Rn(e){return e.map(ob)}function DL(e,t){let n=e;for(let r=t.length-1;r>=0;r-=1){const o=t[r];n=n.slice(0,o.oldPosition)+o.newText+n.slice(o.oldEnd)}return n}function BL(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 Ga(e,t,n){if(!t.length)return[...e];const r=[];let o=0;for(const i of e){const s=BL({start:i.oldPosition,end:i.oldEnd},t,n);if(!s)return null;r.push(new Ut(s.start,i.oldText,s.start+o,i.newText)),o+=i.newLength-i.oldLength}return r}function ib(e,t,n=0){const r=e.range;return new Ut(e.range.start,typeof t=="string"?t.substring(r.start,r.end):t.getText(r),r.start+n,e.text)}function Po(e,t){let n=0;return e.map(({text:r,range:{start:o,end:i}})=>{let s=n;return n+=r.length-(i-o),ib({text:r,range:{start:o,end:i}},t,s)})}function HL(e){return{range:{start:e.oldPosition,end:e.oldEnd},text:e.newText}}function Zr(e){return e.map(t=>HL(t))}function FL(e,t=Zi(e)){const n=e.getLength(),{start:r,end:o}=t;return r>n||o<0?null:{start:r,end:o}}var qJ=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function $L(e,{start:t,end:n}){return{start:t,end:n+(e.newLength-e.oldLength)}}function Zi(e){return{start:0,end:e.getLength()}}function WL(e,t,n){return`${e.substring(0,n.start)}${t}${e.substring(n.end)}`}function Qi(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 qL(e,t){return t=Xa(t).sort(({range:n},{range:r})=>n.start-r.start),Qi(e,t)}function Ji(e,t){return e>=t.start&&e<=t.end}function Xa(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(Ji(i.start,l)&&Ji(i.start,l))c=l;else if(Ji(l.start,i))Ji(l.end,i)?c=i:c={start:i.start,end:l.end};else if(Ji(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 h=WL(u,a.text,{start:d,end:m});e[r]=o={range:i=c,text:h},e.splice(s--,1),n--}}return e}function zL(e,t){if(e.length<=1)return e[0]||null;e=Xa(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:Qi(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 UL(e,t){const n=Rn(e),r=zL(Zr(n),t);if(r){const o=ib(r,t);return ob(o)}return null}function jL(e,{range:t,text:n}){const r=e.getText(t);return nb(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 sb({oldText:e,newText:t,oldPosition:n,newPosition:r}){return nb(e,t,!0).map(o=>new Ut(n+o.originalStart,e.substring(o.originalStart,o.originalStart+o.originalLength),r+o.modifiedStart,t.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)))}var VL=class{constructor(e,t){A(this,"index",void 0),A(this,"values",void 0),A(this,"type","insert"),this.index=e,this.values=t}},GL=class{constructor(e,t){A(this,"index",void 0),A(this,"howMany",void 0),A(this,"type","remove"),this.index=e,this.howMany=t}},XL=class{constructor(e,t,n){A(this,"from",void 0),A(this,"to",void 0),A(this,"howMany",void 0),A(this,"type","move"),this.from=e,this.to=t,this.howMany=n}};function KL(e,t){return e===t}function YL(e,t,n=KL){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,h=0;do s[l++]=a[u++]=!0,h++;while(l<r&&u<o&&n(e[l],t[u])&&!a[u]);i.push(new XL(d,m,h)),l--;break}var f=[];for(l=0;l<r;){if(s[l]){l++;continue}for(var g=l,h=0;l<r&&!s[l++];)h++;f.push(new GL(g,h))}for(var E=[],u=0;u<o;){if(a[u]){u++;continue}for(var g=u,h=0;u<o&&!a[u++];)h++;var w=t.slice(g,g+h);E.push(new VL(g,w))}var T=E.length,L=f.length,y=i.length,p,v,C=0;for(p=0;p<L;p++){var b=f[p];for(b.index-=C,C+=b.howMany,v=0;v<y;v++){var S=i[v];S.from>=b.index&&(S.from-=b.howMany)}}for(p=T;p--;){var _=E[p],h=_.values.length;for(v=y;v--;){var S=i[v];S.to>=_.index&&(S.to-=h)}}for(p=y;p-- >1;){var S=i[p];if(S.to!==S.from)for(v=p;v--;){var k=i[v];k.to>=S.to&&(k.to-=S.howMany),k.to>=S.from&&(k.to+=S.howMany)}}var x=[];for(p=0;p<y;p++){var S=i[p];if(S.to!==S.from)for(x.push(S),v=p+1;v<y;v++){var N=i[v];N.from>=S.from&&(N.from-=S.howMany),N.from>=S.to&&(N.from+=S.howMany)}}return[...f,...x,...E]}var ab=class{constructor(){A(this,"_byKey",new Map),A(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}},ie;(function(e){function t(d,m,h){return{type:"Add",node:m,nextSibling:h,parent:d}}e.add=t;function n(d){return{type:"Remove",node:d}}e.remove=n;function r(d,m,h){return{type:"Attribute",node:d,name:m,value:h}}e.attribute=r;function o(d,m,h){return h?{type:"Update",prev:d,next:m,soft:h}:{type:"Update",prev:d,next:m}}e.update=o;function i(d,m,h,f){return[{type:"Remove",node:d},{type:"Add",node:h,nextSibling:f,parent:m,replaces:d}]}e.recreate=i;function s(d,m,h){return{type:"Move",node:m,nextSibling:h,parent:d}}e.move=s;function a(d,m){return{type:"Set",node:d,data:m}}e.set=a;function l(d,m,h){return{type:"ClassList",node:d,addedClasses:m,removedClasses:h}}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})(ie||(ie={}));function lb(e,t){return e.push(t),{dispose:()=>{const n=e.indexOf(t);n!==-1&&e.splice(n,1)}}}var cb=[],ub=[];function ZL(e){return lb(cb,e)}function ud(e){return e?cb.some(t=>t(e)):!1}function QL(e){return lb(ub,e)}function JL(e){return ub.some(t=>t(e))}function eN(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(ie.attribute(t,m,void 0))}break}else r[u]!==n[u]&&l.push(ie.attribute(t,u,r[u]))}for(;c<a;c++){const u=i[c];l.push(ie.attribute(t,u,r[u]))}return l}function tN(e){let t=[];const n=e.children.filter(o=>o.type!==I.HTML||!!o.content);let r;for(let o=n.length-1;o>=0;o--)t.push(ie.add(e,n[o],r)),r=n[o];return t}function nN(e){return ie.remove(e)}var rN=new Set(["head","body","html"]),oN=e=>e.type===I.ROOT||e.type===I.DOCTYPE||e.type===I.ELEMENT&&e.tag&&rN.has(e.tag.toLowerCase()),iN=/^<[!?/]/;function dd(e){return e.type===I.ELEMENT?String(e.tag):e.type===I.HTML&&iN.test(e.content??"")?"bogus":String(e.type)}function Ka(e){const t=new ab,n=Object.create(null);for(const r of e){const o=dd(r)+(!oN(r)&&r.start===r.end?"_hidden":"");let i="";r.type===I.ELEMENT&&r.attributes?.id?i=`id_${r.attributes.id}`:i=n[o]=(n[o]||0)+1,t.set(`${o}_${i}`,r)}return t}function db(e){const t=[];let n=0;for(const r of[...e].sort((o,i)=>o.oldPosition-i.oldPosition)){const o=r.newLength-r.oldLength,i=t[t.length-1];i&&r.oldPosition<i.oldEnd?(i.oldEnd=Math.max(i.oldEnd,r.oldEnd),i.delta+=o):t.push({oldPosition:r.oldPosition,oldEnd:r.oldEnd,shift:n,delta:o}),n+=o}return t}function Ya(e,t){const n=e[t-1];return t<e.length?e[t].shift:n.shift+n.delta}function fd(e,t){return(e.type===I.HTML?e.end+1:e.end)<=t.oldPosition}function sN(e,t){return(e.type===I.HTML?e.start-1:e.start)>=t.oldEnd}function md(e,t,n){return!!t&&t.start===n&&t.type===e.type&&t.tag===e.tag&&t.attributes?.id===e.attributes?.id&&t.end-t.start===e.end-e.start}function hd(e,t){return t.type===e.type&&dd(t)===dd(e)&&t.attributes?.id===e.attributes?.id}function es(e,t,n){return Zn(e,!1,n)===Zn(t,!1,n)}function pd(e,t,n){let r=t,o=e;for(;r<o;){const i=r+o>>1;n(i)?o=i:r=i+1}return r}function Za(e,t,n=0){return pd(t.length,n,r=>!sN(e,t[r]))}function gd(e,t){const n=Za(e,t);return t.slice(n,hb(e,t,n))}function fb(e,t){const n=Za(e,t);return n<t.length&&!fd(e,t[n])?void 0:e.start+Ya(t,n)}function Qa(e){return e.type===I.ELEMENT?e.attributes?.id:void 0}function mb(e){const t=new Set,n=new Set;for(const r of e){const o=Qa(r);o&&(t.has(o)?n:t).add(o)}return n}function aN(e,t,n){const r=new Set([...mb(t),...mb(n)]),o=new Map;e.forEach((s,a)=>{for(let l=s.prevFrom;l<s.prevTo;l++){const c=Qa(t[l]);c&&o.set(c,{node:t[l],gap:a})}});const i=new Map;return e.forEach((s,a)=>{for(let l=s.nextFrom;l<s.nextTo;l++){const c=Qa(n[l]),u=c?o.get(c):void 0;c&&u&&u.gap!==a&&!r.has(c)&&hd(u.node,n[l])&&i.set(c,u.node)}}),i}function lN(e,t,n){const r=[];let o={prevFrom:0,prevTo:0,nextFrom:0,nextTo:0},i=0,s=0,a=0;const l=(c,u,d)=>{(c>o.prevFrom||u>o.nextFrom)&&r.push({...o,prevTo:c,nextTo:u,edits:n.slice(i,d)})};for(let c=0;c<e.length;c++){const u=e[c];if(s=Za(u,n,s),s<n.length&&!fd(u,n[s]))continue;const d=u.start+Ya(n,s),m=pd(t.length,a,h=>t[h].start>=d);md(u,t[m],d)&&(a=m,l(c,a,s),o={prevFrom:c+1,prevTo:c+1,nextFrom:a+1,nextTo:a+1},i=s,a++)}return l(e.length,t.length,n.length),r}function hb(e,t,n){return pd(t.length,n,r=>fd(e,t[r]))}function pb(e,t,n,r,o,i,s){const a=Za(e,o),l=hb(e,o,a),c=(g,E=()=>!0)=>g?.find(w=>w>=n&&w<r&&hd(e,t[w])&&E(t[w]))??-1,u=e.start+Ya(o,a),d=e.end+Ya(o,l),m=a===o.length||e.start<o[a].oldPosition,h=m?c(s.byStart.get(u)):-1,f=l>a&&e.end>o[l-1].oldEnd?c(s.byEnd.get(d),g=>!(m&&uN(e,g,u))):-1;return h>=0&&f>=0&&h!==f?es(e,t[h],i)||es(e,t[f],i)?es(e,t[h],i)?h:f:bb(e,t[f],o)>bb(e,t[h],o)?f:h:h>=0?h:f}function gb(e,t,n){const r=e.get(t);r?r.push(n):e.set(t,[n])}function cN(e,t,n){const r={byStart:new Map,byEnd:new Map};for(let o=t;o<n;o++)gb(r.byStart,e[o].start,o),gb(r.byEnd,e[o].end,o);return r}function uN(e,t,n){for(let r=t.lastChild;r&&r.end===t.end;r=r.lastChild)if(r.start===n&&hd(e,r))return!0;return!1}function bb(e,t,n){const r=new Map(t.children.map(o=>[o.start,o]));return e.children.filter(o=>{const i=fb(o,n);return i!==void 0&&md(o,r.get(i),i)}).length}function yb(e,t){return gd(e,t).reduce((n,r)=>n-Math.max(0,Math.min(e.end,r.oldEnd)-Math.max(e.start,r.oldPosition)),e.end-e.start)}function dN(e,t,n,r,o,i){const s=es(e,t,i),a=es(n,r,i);return s!==a?a:yb(n,o)>yb(e,o)}function fN(e,t,n,r){const o=n.edits??[],i=[],s=[];let{prevFrom:a,prevTo:l,nextFrom:c,nextTo:u}=n;const d=cN(t,c,u);for(;o.length&&a<l&&c<u;){const m=pb(e[l-1],t,c,u,o,r,d);if(l-1===a){m>=0&&s.unshift([a,m]);break}const h=pb(e[a],t,c,u,o,r,d);let f=h>=0,g=m>=0;if(f&&g&&h>=m&&(g=dN(e[a],t[h],e[l-1],t[m],o,r),f=!g),!f&&!g)break;f&&(i.push([a,h]),a++,c=h+1),g&&(s.unshift([l-1,m]),l--,u=m)}return[...i,...s]}function mN(e,t){const n=[];let r=e.prevFrom,o=e.nextFrom;for(const[i,s]of[...t,[e.prevTo,e.nextTo]])(i>r||s>o)&&n.push({prevFrom:r,prevTo:i,nextFrom:o,nextTo:s,edits:e.edits}),r=i+1,o=s+1;return n}function hN(e,t,n,r,o){const i=o?.length?fb(e,o):void 0;return(i===void 0?void 0:t.children.find(s=>md(e,s,i)))??r.getByKey(n.getByValue(e)??"")}function ts(e,t){for(const n of t)e.push(n)}function vb(e,t,n,r,o,i,s,a,l=new Map){const c=[],u=r.prevFrom,d=t.slice(u,r.prevTo),m=n.slice(r.nextFrom,r.nextTo),[h,f]=o??[Ka(d),Ka(m)],g=YL(d,m,(w,T)=>h.getByValue(w)===f.getByValue(T)),E=w=>{const T=Qa(w);return T?l.get(T):void 0};for(const w of g)switch(w.type){case"insert":{const T=u+w.index;let L=t[T];for(const y of w.values.reverse()){t.splice(T,0,y),i.add(y);const p=E(y);p?(ts(c,Ja(p,y,s,a)),c.push(ie.move(e,y,L))):c.push(ie.add(e,y,L)),L=y}break}case"remove":{const T=t.splice(u+w.index,w.howMany);for(const L of T)E(L)!==L&&c.push(ie.remove(L));break}case"move":{const T=t.splice(u+w.from,w.howMany);let L=t[u+w.to];t.splice(u+w.to,0,...T);for(const y of T.reverse()){const p=f.getByKey(h.getByValue(y)??"");if(!p)return rt("error while sync",c);i.add(p),ts(c,Ja(y,p,s,a,r.edits&&gd(y,r.edits))),c.push(ie.move(e,p,L)),L=y}break}}return c}function bd(e,t,n=!1,r=$u(),o){const i=[],s=Ka(e.children),a=Ka(t.children);for(let g=e.children.length-1;g>=0;g--){const E=e.children[g];if(E.type===I.ELEMENT&&E.start===E.end){const w=s.getByValue(E);if(!a.getByKey(w)){let T=!1;for(let L=g+1;L<e.children.length;L++){const y=e.children[L];if(y){const p=hN(y,t,s,a,o);if(p){const v=p.start,C=E.clone();t.children.splice(t.children.indexOf(p),0,C),er(C,v-E.start),C.parent=t,a.set(w,C),T=!0;break}}}if(!T){const L=t.endTagStart===void 0?t.end:t.endTagStart,y=E.clone();t.children.push(y),a.set(w,y),er(y,L-E.start),y.parent=t}}}}const l=e.children.filter(g=>g.type!==I.HTML||!!g.content),c=t.children.filter(g=>g.type!==I.HTML||!!g.content),u=o?.length?lN(l,c,o):null,d=u?aN(u,l,c):new Map,m=new Set;for(const g of u?[...u].reverse():[]){const E=mN(g,fN(l,c,g,r)).reverse();for(const w of E)ts(i,vb(t,l,c,w,void 0,m,n,r,d))}const h={prevFrom:0,prevTo:l.length,nextFrom:0,nextTo:c.length,edits:o};u||ts(i,vb(t,l,c,h,[s,a],m,n,r)),c.length!==l.length&&rt("error while sync");const f=new Map;for(const g of u??[h])for(let E=g.nextFrom;E<g.nextTo;E++)f.set(E,g.edits);for(let g=c.length-1;g>=0;g--){const E=c[g];if(!m.has(E)){const w=f.get(g);ts(i,Ja(l[g],E,n,r,w&&gd(l[g],w)))}}return i}function yd(e){return e.type===I.ELEMENT&&ud(e.tag)}function Ja(e,t,n=!1,r=$u(),o){if(e.type===t.type&&!(e.isDirty||t.isDirty)){if(yd(e)&&e.tag===t.tag){if(Zn(e,!1,r)===Zn(t,!1,r))return[ie.update(e,t,n),...bd(e,t,!0,r)]}else if((e.type===I.ELEMENT||e.type===I.ROOT)&&e.tag===t.tag)return[ie.update(e,t,n),...eN(e,t),...bd(e,t,n,r,o)];if(e.type===I.HTML||e.type===I.COMMENT)return e.content===t.content?[ie.update(e,t,n)]:[ie.update(e,t,n),ie.set(t,t.content)]}return!e.parent||!t.parent?rt("cannot replace document",[]):yd(e)&&e.tag===t.tag?ie.recreate(e,t.parent,t,wr(t)||void 0):[ie.remove(e),ie.add(t.parent,t,wr(t)||void 0)]}var tr="FROM_DOM",nr="FROM_REMOTE",pN=/<\/.*>/i;function gN(e){return pN.test(e)}var bN=/^<[!?/][^>]*$/,yN=class extends ve{constructor(e,t){super(),A(this,"_baseDocument",void 0),A(this,"_createRoot",void 0),A(this,"_beforeTextChangeEmitter",this.addDisposable(new he)),A(this,"_onTextChangeEmitter",this.addDisposable(new he)),A(this,"_onMutateEmitter",this.addDisposable(new he)),A(this,"_beforeRefreshEmitter",this.addDisposable(new he)),A(this,"_onRefreshEmitter",this.addDisposable(new he)),A(this,"_root",new wt(0,0,[])),A(this,"_applyingMutation",void 0),A(this,"_insertRun",void 0),A(this,"beforeTextChange",this._beforeTextChangeEmitter.event),A(this,"beforeRefresh",this._beforeRefreshEmitter.event),A(this,"onTextChange",this._onTextChangeEmitter.event),A(this,"onRefresh",this._onRefreshEmitter.event),A(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=I.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,n){const r=this._root;this._beforeRefreshEmitter.fire();let{roots:o}=fn(e),i=this._root=this._createRoot?this._createRoot(o,e):new wt(0,e.length,o);if(i.type=I.ROOT,this._createRoot||o.forEach(s=>s.parent=i),!t){const s=n&&db(n);this._onRefreshEmitter.fire(r?bd(r,i,!1,void 0,s):tN(i))}}_onTextChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=UL(t,this._baseDocument.getText());if(n)try{this._beforeTextChangeEmitter.fire(),ja("text",()=>this.replaceWithHtml(n,nr,t))}finally{this._onTextChangeEmitter.fire()}}}insertBefore(e,t,n,r){if(t.parent){if(t.parent===e&&wr(t)===n)return t;this.remove(t,r)}const o=this.contains(e),i=Na(t),s=e.children,a=n?s.indexOf(n):s.length;if(a<0)return rt("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,er(t,l-t.start,i.length),o&&(r!=="FROM_DOM"&&this._onMutateEmitter.fire([ie.add(e,t,n||void 0)]),r!=="FROM_REMOTE"&&this._baseDocument.applyEdits(r,[{text:i,range:{start:l,end:l}}])),t}_batchInsert(e,t,n){const r=this._insertRun;if(t.parent||!this.contains(e))return!1;const o=n?n.start:e.endTagStart===void 0?e.end:e.endTagStart,i=e.children,s=n?r?.items[0].node===n?r.start:i.indexOf(n):i.length;if(s<0||r&&r.parent!==e)return!1;const a=s-(r?r.start:s);if(r&&(a<0||a>r.items.length))return!1;const l=Na(t),c=r??(this._insertRun={parent:e,start:s,offset:o,items:[],length:0});return i.splice(s,0,t),t.parent=e,c.items.splice(a,0,{node:t,text:l}),c.length+=l.length,!0}_flushInsertRun(e){const t=this._insertRun;if(!t)return;this._insertRun=void 0;let n=t.offset;for(const{node:r,text:o}of t.items)er(r,n-r.start),n+=o.length;er(t.items[t.items.length-1].node,0,t.length),e!=="FROM_REMOTE"&&this._baseDocument.applyEdits(e,[{text:t.items.map(r=>r.text).join(""),range:{start:t.offset,end:t.offset}}])}getContext(e){return e.closest(t=>ud(t.tag))}replaceWithHtml(e,t,n=[e]){const r=this._baseDocument,o=u=>{const d=this.getContext(u);if(d)return d.isDirty=!0,Promise.resolve().then(()=>{d.isDirty=!1}),!1;if(u.type!==I.HTML){if(!u.closed)return!1}else return!u.content||!gN(u.content)&&!bN.test(u.content);return!0};if(!this._root)return this.initialize(r.getText(),!1,n);let i={start:e.oldPosition,end:e.oldEnd},s=xL(i,this._root);if(!s)return this.initialize(r.getText(),!1,n);let a,l,c;do{const u=$L(e,s);a=this._baseDocument.getText(u),[l,...c]=fn(a).roots}while((!l||c.length||!o(s)||!o(l)||l.end-l.start!==a.length)&&(s=s.parent));if(!s||!s.parent)return this.initialize(r.getText(),!1,n);this.replaceChild(s.parent,{node:l,text:a},s,t,n)}replaceChild(e,t,n,r,o){const{text:i,node:s}=t,a=e.children,l=a.indexOf(n);if(l<0)return rt("referenced node is not a child of parent node",s);a.splice(l,1,s);const c=i.length-(n.end-n.start);return s.parent=e,er(s,n.start-s.start,c),this._baseDocument.getText(s)!==i?(rt("Error while sync"),s):(r!=="FROM_DOM"&&this._onMutateEmitter.fire(Ja(n,s,!1,void 0,o&&db(o))),n.parent=void 0,s)}remove(e,t){const n=this.contains(e),r=e.parent;if(!r)return rt("node is not in tree");const o=r.children,i=o.indexOf(e);if(i<0)return rt("referenced node is not a child of parent node");const s=e.end-e.start;er(e,0,-s),o.splice(i,1),n&&(t!=="FROM_DOM"&&this._onMutateEmitter.fire([nN(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=tg(e),a=e.startTagEnd===void 0?0:e.startTagEnd-e.start-(e.tag?.length||0)-2,l=OL(e),c=s.length-a,u=e.start;er(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=Na(e,o),l=a.length-s;er(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=wr(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=fn(t).roots;i.length!==1&&rt("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){if(this._applyingMutation=t,t.type==="Add"){const n=t.parent||this.root,r=t.nextSibling||null;this._batchInsert(n,t.node,r)||(this._flushInsertRun(tr),this.insertBefore(n,t.node,r,tr));continue}switch(this._flushInsertRun(tr),t.type){case"Remove":this.remove(t.node,tr);break;case"Set":this.setContent(t.node,t.data,tr);break;case"Hidden":this.setHidden(t.node,t.value,tr);break;case"Attribute":this.setAttribute(t.node,t.name,t.value===void 0?null:t.value,tr)}}}finally{try{this._flushInsertRun(tr)}finally{this._applyingMutation=void 0,this._baseDocument.endUpdate()}}}getNodeByPosition(e){return this._root?.findNodeAt(e)}};function vN(e,t){return e.replace(new RegExp(`<(?=/${t.tagName}${La})`,"gi"),"<")}function Eb(e,t){return bg(e)??vN(e.textContent??"",t)}function gn(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e.tagName.toUpperCase();return t==="STYLE"||t==="SCRIPT"&&!hg.has(e.getAttribute("type")??"")}var EN=4,SN=3,wN=80,Sb={Add:"insertBefore",Remove:"remove",Set:"set",Hidden:"hidden",Attribute:"attribute",Update:"update",Move:"move"},_N={[I.HTML]:"text",[I.ELEMENT]:"element",[I.ROOT]:"root",[I.COMMENT]:"comment",[I.DOCTYPE]:"doctype",[I.ADVANCED]:"advanced"},CN=new Set(["head","body"]);function vd(e){return(e??"").replace(/^(['"])(.*)\1$/s,"$2")}function wb(e,t,n,r){const o=n.split(/\s+/).filter(Boolean).slice(0,SN);return(e+(t?`#${t}`:"")+o.map(i=>`.${i}`).join("")+(r?`[em=${r}]`:"")).slice(0,wN)}function TN(e){if(!e.tag)return`#${e.type}`;const t=e.attributes??{};return wb(e.tag,vd(t.id),vd(t.class),vd(t.em))}function _b(e){return e instanceof Element?wb(e.localName,e.id,e.getAttribute("class")??"",e.getAttribute("em")??""):e.nodeName.toLowerCase()}function Ed(e,t,n){const r=[];let o=e;for(;o&&r.length<EN;)r.unshift(n(o)),o=t(o);return r.join(" > ")}function AN(e){let t,n=e;for(;;){const r=n.tag?.toLowerCase();if(!t&&r&&CN.has(r)?t=r:r==="html"&&(t??(t="html")),!n.parent)break;n=n.parent}return n.type!==I.ROOT?"outside":t??"top"}function Sd(e,t,n){const r=t(e);return{path:Ed(e,o=>o.parent,TN),inTree:n(e),inDom:!!r?.isConnected,...r?{domPath:Ed(r,o=>o.parentNode,_b)}:{},inMap:!!r,hasParent:!!e.parent,kind:_N[e.type]??String(e.type),root:AN(e)}}function Cb(e,t,n){if(!e)return;const r=i=>Sd(i,t,n);if(e.type==="Update")return{type:Sb.Update,node:r(e.prev),...e.next.parent?{parent:r(e.next.parent)}:{}};if(!("node"in e))return;const o={type:Sb[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 wd(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t.type===I.ROOT}function kN(e,t,n,r){const o=s=>Sd(s,a=>r.getByNode(a),wd),i=Ed(e,s=>s.parentNode,_b);return{type:"insertBefore",node:{path:i,inTree:!1,inDom:e.isConnected,domPath:i},parent:o(t),reference:o(n)}}function LN(e,t){const n=r=>Sd(r,o=>t.getByNode(o),wd);return{type:"remove",node:n(e),...e.parent?{parent:n(e.parent)}:{}}}function NN(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}function Tb(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var Ab=Object.create(null);function kb(e,t){const n=Ab[e]||(Ab[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[NN(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function Mn(e){return e.nodeType===Node.ELEMENT_NODE}function Lb(e){return Mn(e)?e.tagName==="AMP-IMG"?!0:kb(e.tagName.toLowerCase(),"src"):!1}function _d(e){return Mn(e)&&!e.ownerSVGElement}function xN(e){return e.tagName==="IMG"}function ON(e){return e.tagName==="FORM"}function RN(e){return e.tagName==="SCRIPT"}function MN(e){return e.tagName==="STYLE"}function Cd(e){return e.nodeType===Node.DOCUMENT_NODE}function Nb(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var ns;(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})(ns||(ns={}));function Td(e){return e.nodeType===Node.COMMENT_NODE}function Io(e){return e.nodeType===Node.TEXT_NODE}function PN(e){return e.tagName==="TABLE"}async function IN(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 tn(e){if(Mn(e))return xb(e);if(Cd(e))return[...e.childNodes].map(r=>tn(r)).join("");if(Nb(e))return Tb(e);const t=Oa(e);if(t!==void 0)return t;const n=document.createElement("div");return n.appendChild(e.cloneNode(!0)),n.innerHTML}function DN(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"&&!kb(t,o)?` ${o}`:` ${o}="${i.replaceAll('"',"'")}"`}return n}function Tt(e){let t="";for(const n of e.childNodes)t+=bg(n)??tn(n);return t}function xb(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),n=DN(e);return Hu.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${n}/>`:`<${t}${n}>`:MN(e)?`<${t}${n}>${e.innerHTML}</${t}>`:`<${t}${n}>${Tt(e)}</${t}>`}function BN(e){return typeof e=="string"?e:""}function Ob(e,t,n){if(n&&e.type===I.DOCTYPE&&n?.type!==I.ROOT){const o=document.createTextNode(e.content||"");return t.set(e,o),o}const r=Pa(e,n)?Gu(e.content||""):Kr(e,!1,"dormant");t.set(e,r);for(const o of e.children){const i=Ob(o,t,e);r.appendChild(i)}return r}function Do(e,t,n,r){let o=e,i;for(let s=e.parentNode;s&&s!==t;s=s.parentNode)r?.(s)?i=s.parentNode?{host:s.parentNode,before:s}:void 0:n(s)?i??(i={host:s,before:o}):i=void 0,o=s;return i}function HN(e,t,n=wd,r=()=>!1,o=()=>!1){let i,s;const a=new Map,l=()=>{const u=Cb(i,d=>t.getByNode(d)||a.get(d),n);return u&&{...u,stage:"dom",...s?{cause:s}:{}}},c=u=>{s=u;try{rt("Element node not in tree")}finally{s=void 0}};return Zg(l,()=>FN(e,t,a,u=>i=u,c,r,o))}function FN(e,t,n,r,o,i,s){const a=[],l=new Map,c=g=>t.getByNode(g)||n.get(g),u=g=>{if(g){const E=g.lastChild;let w=(E?c(E)?.nextSibling:c(g)?.firstChild)||void 0;for(;w&&l.has(w);)w=w.nextSibling||void 0;return w?.parentNode===c(g)?w:void 0}},d=new Map(e.flatMap(g=>g.type==="Update"?[[g.next,g.prev]]:[])),m=(g,E)=>{for(let w=Jg(g);w;w=Jg(w)){const T=d.get(w),L=c(w)??(T&&c(T));if(L&&!l.has(L)&&E.contains(L)){const y=Do(L,E,i,s);if(y)return y;let p=L;for(;p.parentNode&&p.parentNode!==E;)p=p.parentNode;return{host:E,before:p}}}},h=g=>!!t.getByElement(g)||i(g)||s(g),f=(g,E,w)=>{const T=m(g,w);if(!T)return{host:w,before:u(E)};let L=T.before.nextSibling??void 0;for(;L&&(l.has(L)||!h(L));)L=L.nextSibling??void 0;return{host:T.host,before:L}};for(const g of e)switch(r(g),g.type){case"Add":{let{node:E,nextSibling:w}=g;const T=E.parent;if(T){const L=Ob(E,n,T);if(T.type===I.ROOT)a.push(ie.add(null,L,w&&c(w)));else{const y=c(T);if(y){let p,v=y;for(;w;){const C=n.get(w);if(C){const S=Do(C,y,i,s);p=S?.before??C,v=S?.host??y;break}let b=t.getByNode(w);if(b&&!l.has(b)&&y.contains(b)){p=b;const S=Do(b,y,i,s);if(S){v=S.host,p=S.before;break}for(;b.parentNode!==y&&b.parentNode;)b=b.parentNode,Mn(b)&&b.replaceWith(...b.childNodes);break}w=wr(w)||void 0}p||({host:v,before:p}=f(E,T,y)),a.push(ie.add(v,L,p))}else o("parent-not-mapped")}}else o("no-parent");break}case"Move":{let{node:E,nextSibling:w}=g;const T=E.parent,L=c(E);if(T&&L)if(T.type===I.ROOT)a.push(ie.move(null,L,w&&c(w)));else{const y=c(T);if(y){let p,v=y;for(;w;){const C=n.get(w);if(C){const S=Do(C,y,i,s);p=S?.before??C,v=S?.host??y;break}let b=t.getByNode(w);if(b&&!l.has(b)&&y.contains(b)){const S=Do(b,y,i,s);if(S)v=S.host,b=S.before;else for(;b.parentNode!==y&&b.parentNode;)b=b.parentNode;b||rt("error while calculating next sibling"),p=b;break}w=wr(w)||void 0}p||({host:v,before:p}=f(E,T,y)),a.push(ie.move(v,L,p))}else o("parent-not-mapped")}else o(T?"node-not-mapped":"no-parent");break}case"Remove":{const E=g.node,w=c(E);if(E.type===I.HTML&&!E.content)continue;w?(l.set(w,E),a.push(ie.remove(w))):o("node-not-mapped");break}case"Update":{const E=g.prev,w=c(E);w?n.set(g.next,w):g.soft||o("node-not-mapped");break}case"Attribute":{const E=c(g.node);E?a.push(ie.attribute(E,g.name,g.value)):o("node-not-mapped");break}case"Set":{const E=g.node,w=c(E);w?E.type===I.HTML&&$N(w,String(g.data??""))||Nb(w)&&E.type===I.DOCTYPE?a.push(ie.set(w,g.data||"")):e.push(ie.remove(E),ie.add(E.parent||null,E,wr(E)||void 0)):o("node-not-mapped");break}}return{mutations:a,toAdd:n,toRemove:l,isService:i}}function $N(e,t){return Io(e)?!t.includes("<")||gn(e.parentNode)||Io(vr(t)):!1}function WN({mutations:e}){return _g(e.flatMap(t=>t.type==="Add"?[t.node]:[]))}var qN=["src","type"];function zN({mutations:e}){const t=new Set,n=r=>{r instanceof HTMLScriptElement&&r.isConnected&&!Da(r)&&t.add(r)};for(const r of e)r.type==="Add"||r.type==="Move"?(n(r.parent),n(r.node.parentNode)):r.type==="Remove"||r.type==="Set"?n(r.node.parentNode):r.type==="Attribute"&&qN.includes(r.name.toLowerCase())&&n(r.node);return[...t]}function UN(e,t,n){const r=e.data,o=Math.min(r.length,t.length),i=e.ownerDocument.getSelection(),s=!!i?.isCollapsed&&i.anchorNode===e&&i.anchorOffset===0&&t.length>r.length&&t.endsWith(r);let a=0;for(;!s&&a<o&&r[a]===t[a];)a++;let l=0;for(;l<o-a&&r[r.length-1-l]===t[t.length-1-l];)l++;const c=r.length-a-l,u=t.slice(a,t.length-l),d=!!i?.isCollapsed&&i.anchorNode===e&&i.anchorOffset>=a&&i.anchorOffset<=a+c,m=d&&n.get(e)===i.anchorOffset;e.replaceData(a,c,u),u&&i?.anchorNode!==e&&n.set(e,a),d&&i.collapse(e,m?a:a+u.length)}function Rb(e){const t=e.ownerDocument?.getSelection();return t?.anchorNode&&e.contains(t.anchorNode)?t:null}function jN(e,t){const n=e?.ownerDocument;if(!e||!n)return null;if(e.nodeType===Node.TEXT_NODE)return e;const r=n.createTreeWalker(e,NodeFilter.SHOW_TEXT);let o=null;for(let i=r.nextNode();i&&(o=i,!!t);i=r.nextNode());return o}function VN(e,t,n){const r=Rb(t),{anchorNode:o,anchorOffset:i,focusNode:s,focusOffset:a}=r??{};if(e.insertBefore(t,n),!(!r||!o||!s))try{const l=t.contains(o),c=t.contains(s);r.setBaseAndExtent(l?o:r.anchorNode??o,l?i??0:r.anchorOffset,c?s:r.focusNode??s,c?a??0:r.focusOffset)}catch{}}function GN(e){return!!e&&e.prev!==e.next&&e.prev.at(-1)!==e.next.at(-1)}function XN(e){return!!e&&e.next.length>e.prev.length&&e.next.endsWith(e.prev)}function Ad(e,t,n,r){let o;for(let i=t?e.previousSibling:e.nextSibling;i;i=t?i.previousSibling:i.nextSibling){if(n?.has(i))continue;const s=jN(i,t),a=s?.parentElement?.closest("a")??s?.parentElement?.closest("em-replace");if(!s&&o)break;if(!s){o=i;continue}if(o&&!(t&&i===s&&GN(r?.get(s))))break;return a&&i.contains(a)?{beside:a}:{text:s}}return o?{beside:o}:null}function Mb(e,t,n){const r=t.parentNode;r&&e.collapse(r,[...r.childNodes].indexOf(t)+(n?1:0))}function KN(e,t,{removed:n,rewrites:r}){const o=Rb(e),i=o&&Ad(e,!0,n,r),s=o&&!i?Ad(e,!1,n,r):null;if(e.parentNode?.removeChild(e),!!o)try{if(i?.text){const a=t.get(i.text)??i.text.length;t.set(i.text,a),o.collapse(i.text,a)}else{if(i)return Mb(o,i.beside,!0),i.beside.nodeName==="BR"?i.beside:void 0;s?.text?o.collapse(s.text,0):s&&Mb(o,s.beside,!1)}}catch{}}function YN(e){const t=e.ownerDocument?.getSelection(),{anchorNode:n,anchorOffset:r}=t??{};return!!t?.isCollapsed&&n===e.parentNode&&n?.childNodes[(r??0)-1]===e}function Pb(e,t,{removed:n,moved:r,edited:o,rewrites:i}){if(e.nodeType!==Node.ELEMENT_NODE)return{node:e,offset:t};const[s,a]=[e.childNodes[t-1],e.childNodes[t]];return![s,a].some(l=>l&&n.has(l))||s&&r.has(s)?{node:e,offset:t}:s?.nodeType===Node.TEXT_NODE?{node:s,offset:s.length}:(!s||n.has(s))&&a?.nodeType===Node.TEXT_NODE&&!r.has(a)&&(!o.has(a)||XN(i.get(a)))&&(!n.has(a)||Ad(a,!0,n,i)?.text)?{node:a,offset:0}:{node:e,offset:t}}function ZN(e,t){const n=e?.getSelection(),{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=n??{};if(!(!n||!r||!i||!t.removed.size)&&!/^(INPUT|TEXTAREA)$/.test(e?.activeElement?.tagName??""))try{const a=Pb(r,o??0,t),l=Pb(i,s??0,t);(a.node!==r||l.node!==i)&&n.setBaseAndExtent(a.node,a.offset,l.node,l.offset)}catch{}}function Ib(e,t,n){if(t?.parentNode===e)return[e,t];const r=t&&n?Do(t,e,n):void 0;return r&&e.contains(r.host)?[r.host,r.before]:[e,null]}function QN(e){const t=new Map;for(const n of e)n.type==="Set"&&n.node instanceof Text&&!gn(n.node.parentNode)&&t.set(n.node,{prev:n.node.data,next:vr(String(n.data??"")).textContent??""});return t}function JN({mutations:e,toAdd:t,toRemove:n,isService:r},o,i){const s=m=>new Set(e.flatMap(h=>h.type===m?[h.node]:[])),a=s("Remove"),l={removed:a,moved:s("Move"),edited:s("Set"),rewrites:QN(e)};ZN([...a].find(m=>m.ownerDocument)?.ownerDocument,l);const c=(m,h,f)=>{if(!m)return rt("Element node not in tree");if(!(m instanceof Element))return rt("node is not HTMLEement");const g=f===void 0?void 0:vg(m,h,BN(f));if(!(h.toLowerCase()==="type"&&gk(m,g??null)))try{g!=null?Qn(m,h,g):m.removeAttribute(h)}catch{}},u=new Map;let d;for(const m of e)switch(m.type){case"Add":{const{node:h,nextSibling:f,parent:g}=m;if(g){const[E,w]=Ib(g,f,r);E.insertBefore(h,w)}break}case"Move":{const{node:h,nextSibling:f,parent:g}=m;if(g){const[E,w]=Ib(g,f,r);VN(E,h,w)}break}case"Remove":{const{node:h}=m;if(h instanceof Document)for(const f of[...h.childNodes])f.parentNode?.removeChild(f);else d=KN(h,u,l)??d;break}case"Attribute":c(m.node,m.name,m.value);break;case"Set":{const{node:h,data:f}=m;if(h instanceof Comment)h.data=f;else if(h instanceof Text){const g=String(f??"");gn(h.parentNode)?ok(h,g):UN(h,vr(g).textContent??"",u)}break}}for(const[m,h]of n)o.remove(h);for(const[m,h]of t){const f=o.getByElement(h);f&&o.remove(f),o.set(m,h)}if(i&&d?.isConnected&&YN(d))try{i(d)}catch{}}var e2=class{constructor(){A(this,"_byKey",new WeakMap),A(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))}},t2=class{constructor(){A(this,"_map",new e2)}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 Db(e,t){for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function n2(e){let t;for(let n=e;n;n=n.parent)yd(n)&&(t=n);return t}function r2(e){return e.type==="Update"?e.prev:e.node}function o2(e,t){const n=new Map;for(const o of e){if(o.type!=="Update"||!o.soft)continue;const i=n2(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=r2(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(Db(i,l)||Db(i,c)||s&&u?.contains(s)){a=!0,o.type==="Update"&&o.next===l&&l.parent&&r.push(...ie.recreate(c,l.parent,l,wr(l)||void 0));break}}a||r.push(o)}return r}var kd;(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})(kd||(kd={}));var el=new Set;function _r(e,t){el.has(e)||(el.size||Promise.resolve().then(()=>el.clear()),el.add(e),G.send(Ae.APPLICATION_SYNC_DRIFT,{reason:e,...t()}))}var Bb=new WeakMap;function i2(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 s2(e){return{added:e,removed:[],reparented:[],reordered:[]}}function a2(e,t){let n=Bb.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=i2(o),n={added:o,removed:i},Bb.set(e,n)}return n}function Hb(e,t){const n={};for(const[r,o]of Object.entries(t))n[r]={value:o,enumerable:!0};return Object.create(e,n)}function Fb(e){return new Set((e??"").split(/\s+/).filter(Boolean))}function l2(e,t){const n=i=>{for(let s=i;s&&!t.isMapped(s);s=s.parentNode)if(s instanceof Element&&t.isServicePanel(s))return!0;return!1},r=i=>t.isWrapper(i)||n(i),o=[];return{summaries:e.map(i=>{const s=new Set(i.added.filter(r));return o.push(...[...s].filter(a=>!a.parentNode||!s.has(a.parentNode))),Hb(i,{added:i.added.filter(a=>!s.has(a)),reparented:i.reparented?.filter(a=>!n(a)),reordered:i.reordered?.filter(a=>!n(a)),characterDataChanged:i.characterDataChanged?.filter(a=>!n(a)),attributeChanged:c2(i,t,r)})}),service:o}}function c2(e,t,n){const r={};for(const[o,i]of Object.entries(e.attributeChanged??{})){if(t.isServiceAttribute(o))continue;const s=i.filter(a=>!n(a)&&!(o==="class"&&u2(e,a,t)));s.length&&(r[o]=s)}return r}function u2(e,t,n){const r=Fb(e.getOldAttribute(t,"class")),o=Fb(t.getAttribute("class")),i=[...r,...o].filter(s=>r.has(s)!==o.has(s));return i.length>0&&i.every(s=>n.isServiceClass(s))}var $b=Object.getPrototypeOf(customElements),d2=Reflect.get($b,"define"),Ld=new he,Nd=new he,f2=Ld.event,m2=Nd.event,h2=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","connectedMoveCallback","formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"];function p2(e){Ld.fire();try{return e()}finally{Nd.fire()}}$b.define=function(e,t,n){const r=t.prototype,o=class extends t{constructor(...i){Ld.fire();try{super(...i)}finally{Nd.fire()}}};Object.defineProperty(o,"name",{configurable:!0,value:t.name});for(const i of h2){const s=r[i];typeof s=="function"&&Object.defineProperty(o.prototype,i,{configurable:!0,writable:!0,value:function(...a){return p2(()=>s.call(this,...a))}})}d2.call(this,e,o,n)};function Wb(e,t,n,r){const o=[...e.childNodes],i=t(e,r);for(const s of o)n(i,Wb(s,t,n,i));return i}function Bo(e,t,n){if(t(e,n)!==!1)for(const r of[...e.childNodes])Bo(r,t,e)}var rr="___em-internal";function xd(e,t=!0,n=!1){let r=e.content;switch(e.type){case I.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(xd(i,t,n));return o}case I.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case I.COMMENT:return document.createComment(r||"");case I.ELEMENT:if(e.tag){if(n&&customElements.get(e.tag)){const i=document.createElement("div");return i.innerHTML=Fu(e),i.firstChild}const o=document.createElement(e.tag);if(e.attributes)for(const i of e.attributeNames){const s=e.attributes[i];try{Qn(o,i,typeof s=="string"?s:"")}catch{}}if(t)for(const i of e.children)o.appendChild(Pa(i,e)?Gu(i.content||""):xd(i,t,n));return o}return document.createTextNode("<");case I.HTML:return vr(r||"");default:throw new Error("unsupported node")}}function g2(e){return fn(e).roots.map(t=>xd(t,!0,!0))}function qb(){const e=document.implementation.createHTMLDocument();for(const t of[...e.childNodes])t.remove();return e}function b2(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 qb();default:t=document.createElement("div")}return t}function y2(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}function tl(e){if(e instanceof Element)return xb(e);if(e instanceof Document)return[...e.childNodes].map(r=>tl(r)).join("");if(e instanceof DocumentType)return y2(e);if(e instanceof DocumentFragment)return[...e.childNodes].map(r=>tl(r)).join("");const t=Oa(e);if(t!==void 0)return t;const n=document.createElement("div");return n.appendChild(e.cloneNode(!0)),n.innerHTML}function zb(e,t=e.parentNode){return gn(t)?Eb(e,t):tl(e)}function v2(e,t,n){let r=1;const o=new ab,i=new Map,s=new Map,a=new Map;let l=!1;const c=Wb(e,h=>{const f=String(r++);let g;if(Lb(h)||h instanceof Element&&h.hasAttribute("src")){const E=document.createElement(h.tagName);for(const{name:w,value:T}of h.attributes){const L=Eg(h,w,T);L!==null&&Qn(E,w==="src"?"___src":w,L)}g=E}else g=h.cloneNode(),N2(h,g);if(g)g instanceof DocumentType&&(l=!0),a.set(g,f),i.set(h,f);else return document.createDocumentFragment();return g},(h,f)=>h&&f&&h.appendChild(f));let u=l?qb():document.createDocumentFragment();u.appendChild(c),Bo(u,(h,f)=>{if(f){const g=a.get(h);if(gn(f))return;if(!g)return rt("Error while mapping: not found element");h instanceof Element?h.setAttribute(rr,g):f.insertBefore(document.createComment(`${rr}${g}`),h)}});let d=g2(t(u)).filter(h=>!!h),m;if(!d.length)return o;if(u instanceof Document){const h=b2("html");for(const f of d)h.appendChild(f);m=h}else{m=document.createDocumentFragment();for(const h of d)m.appendChild(h)}return Bo(m,(h,f)=>{let g=null;if(h instanceof HTMLHtmlElement)s.set("1",h);else{if(h instanceof Element&&h.hasAttribute(rr)){g=h.getAttribute(rr),g&&s.set(g,h);return}const E=h.previousSibling;if(E instanceof Comment&&(!(h instanceof Comment)||h.data.indexOf(rr)<0)){const w=E.data,T=w.indexOf(rr);T>=0&&(g=w.substring(T+14),g&&s.set(g,h))}}}),Bo(m,h=>{if(h instanceof Element&&h.hasAttribute(rr)){h.removeAttribute(rr);return}h instanceof Comment&&h.data.indexOf(rr)>=0&&h.remove()}),Bo(e,h=>{const f=i.get(h),g=s.get(f);g&&(o.set(h,g),gn(h)&&h.firstChild&&g.firstChild&&o.set(h.firstChild,g.firstChild))}),o}function E2(e){const t=Ub(e.cloneNode()),n=Wu(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=I.ELEMENT,t}var Ho;(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})({})})(Ho||(Ho={}));function Ub(e){if(Io(e)&&gn(e.parentNode))return jb(Eb(e,e.parentNode));const t=Oa(e);if(t!==void 0)return jb(t);let n=fn(tl(e.cloneNode())).roots[0];return n||(n=new wt(0,0,[]),n.type=I.HTML,n.content=""),n}function jb(e){const t=new wt(0,e.length,[]);return t.type=I.HTML,t.content=e,t}function Vb(e,t=Ho.HiddenResult.node){if(t&Ho.HiddenResult.node&&(e.end=e.start=e.startTagEnd=e.endTagStart=e.end=0),t&Ho.HiddenResult.children)for(const n of e.children)Vb(n,Ho.HiddenResult.all)}function S2(e,t=[],n){let r;return e instanceof Element?r=E2(e):r=Ub(e),r.children=t,r.parent=void 0,n&&Vb(r,n(r)),r}function Od(e,t,n){let r=t.getByElement(e);if(r)return n?.(e)?void 0:r;for(const o of e.childNodes)if(r=Od(o,t,n),r)return r}function Gb(e,t,n,r){_r("tree-node-out-of-place",()=>({mutation:n()}))}function Xb(e,t,n,r,o){let i=e.parentNode,s=e.nextSibling,a;const l=(c,u)=>!o||o(c,u)?!0:(Gb("insertBefore",c,()=>kN(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=Od(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=Od(s,t,r);if(u){a=u,s=s.nextSibling;break}s=s.nextSibling}s||(s=i.nextSibling),i=i.parentNode}}function w2(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(ie.attribute(a,o,typeof l=="string"?l:void 0))}}}return n}function Kb(e,t){return e.type===I.HTML?Oa(t)??`<!--${t.data}-->`:t.data}function _2(e,t){const n=[],r=e.characterDataChanged;if(r)for(const o of r){const i=t.getByElement(o);i&&n.push(ie.set(i,Td(o)?Kb(i,o):zb(o)))}return n}function C2(e){return(e instanceof Element?e:e.parentElement)?.closest(".sortable-fallback")??null}function T2(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 A2(e,t,n,r){const o=s=>{let a=s.parentNode;if(!a||a===n?.node||t.getByElement(a))return!1;for(;a&&a!==n?.node&&!t.getByElement(a);a=a.parentNode)if(!r(a))return!1;return!0},i=new Set;for(const s of B2(e)){const a=t.getByElement(s),l=a?.parent?.children,c=a&&l?l.indexOf(a):-1;if(!a||!l||c<0||!o(s))continue;const{parentTreeNode:u,nextSiblingTreeNode:d}=Xb(s,t,n)||{};u===a.parent&&d===l[c+1]&&i.add(s)}return i}function k2(e,t,n,r=new Set){const o=[],i=new Set,s=new Map,a=(l,c)=>{const u=s.get(l);return u?u===c:l.parent===c&&c.children.includes(l)};for(const l of e){const{added:c,removed:u}=a2(l,d=>!!t.getByElement(d));for(const d of u)if(!i.has(d)&&!r.has(d)){const m=t.getByElement(d);if(m){const h=s.get(m)??m.parent;!h||!a(m,h)?Gb("remove",m,()=>LN(m,t)):o.push(ie.remove(m)),s.delete(m),i.add(d)}}for(const d of c){if(r.has(d)||T2(d))continue;const m=C2(d);if(m&&!t.getByElement(m))continue;const{parentTreeNode:h,nextSiblingTreeNode:f}=Xb(d,t,n,g=>i.has(g),a)||{};if(h){let g=t.getByElement(d);g||(g=S2(d),t.set(g,d)),o.push(ie.add(h,g,f)),s.set(g,h),i.delete(d)}}o.push(...w2(l,t)),o.push(..._2(l,t))}return o}function L2(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(ie.attribute(e,a,c))}else r.push(ie.attribute(e,a,void 0))}for(const s of i){const a=s.name==="___src"?"src":s.name;o.getNamedItem(a)||r.push(ie.attribute(e,a,s.value))}return r}function N2(e,t){if(!(!sk()||!(e instanceof Element)||!(t instanceof Element)))for(const{name:n,value:r}of Array.from(e.attributes)){const o=Eg(e,n,r);o===null?t.removeAttribute(n):o!==r&&Qn(t,n,o)}}function x2(e,t,n,r=()=>!1){const o=[],i=v2(e,n,t);return Bo(e,s=>{const a=t.getByElement(s);if(!a)return;const l=i.getByKey(s);if(l){if(l instanceof Element){if(!(s instanceof Element))return rt("CharacterData mapped to Element");o.push(...L2(a,s,l))}else if(l instanceof CharacterData){if(!(s instanceof CharacterData))return rt("Element mapped to CharacterData");const c=gn(s.parentNode)&&(s.parentNode?.nodeName==="SCRIPT"||!r(s));l.data!==s.data&&!c&&o.push(ie.set(a,Td(l)?Kb(a,l):zb(l,s.parentNode)))}else if(l instanceof Document&&!(s instanceof Document))return rt("Node mapped to Document")}else{const c=d=>{for(const m of d.childNodes)if(i.getByKey(m)||!c(m))return!1;return!0};let u;return c(s)?(o.push(ie.hidden(a,!0)),u=!1):o.push(ie.hidden(a,!1)),u}}),o}function O2(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 R2(e){return[...new Set(e)]}function M2(e,t){return R2([...e.added,...e.reparented||[],...e.reordered||[],...Object.values(e.characterDataChanged||{}),...Object.values(e.attributeChanged||{})].flat().map(n=>O2(n,t)||n))}function P2(e,t){let n=[];for(const r of e){const o=M2(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 I2(e,t,n){const r=P2(e,t),o=D2(e);return r.flatMap(i=>x2(i,t,n,o))}function D2(e){const t=new Set(e.flatMap(n=>[...n.added,...Object.values(n.characterDataChanged||{}).flat()]));return n=>{for(let r=n;r;r=r.parentNode)if(t.has(r))return!0;return!1}}function B2(e){return e.flatMap(t=>[...t.reparented??[],...t.reordered??[]])}function H2(e,t){return Hb(e,{reparented:e.reparented?.filter(n=>!t.has(n)),reordered:e.reordered?.filter(n=>!t.has(n))})}function F2(e,t,n,r,o=()=>!1){const i=A2(e,t,r,o),s=i.size?e.map(a=>H2(a,i)):e;return[...k2(e,t,r,i),...I2(s,t,n)]}function $2(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 W2=class{constructor(){A(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))}},Yb=class{constructor(e=10){A(this,"_max",void 0),A(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}},Zb=new Yb(1e3);function Fo(e){if(e=e?.trim(),e){let t=Zb.get(e);return t||(t=new Set(e.split(" ").filter(n=>!!n).map(n=>n)),Zb.put(e,t)),t}else return new Set}function nl(e){e||(e="");const t=document.createElement("div");return t.setAttribute("style",e),t.style}var Qb=new Yb(1e3);function rs(e){e||(e="");let t=Qb.get(e);return t||(t=nl(e),Qb.put(e,t)),t}function q2(e,t,n){const r=e?e.split(" "):[],o=Fo(n),i=Fo(t),s=r.filter(a=>(a=a.trim(),o.has(a)?i.has(a):!0));return s.length===r.length?e:s.join(" ")}function z2(e,t,n){const r=nl(e),o=rs(n),i=rs(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 Jb(e,t,n,r){return typeof r!="string"?t:e==="class"?q2(t,n,r)||null:e==="style"?z2(t,n,r)||null:n!==t&&t===r?null:t}function U2(e,t){const n=Fo(e),r=Fo(t);for(const o of r)n.has(o)||(e=e?`${e.trimEnd()} ${o}`:o);return e}function j2(e,t){const n=nl(e),r=rs(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 V2(e,t,n){return typeof n!="string"?t:e==="class"?U2(t,n)||null:e==="style"?j2(t,n)||null:t}function G2(e,t,n){if(!t)return t;const r=Fo(e),o=Fo(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 X2(e,t,n){if(!t)return t;const r=rs(e),o=nl(t),i=rs(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 ey(e){return e.type===I.ELEMENT&&e.start!==e.end}function ty(e){return e.filter(t=>t.type===I.ELEMENT)}function K2(e,t,n){const r=ty(e),o=ty(t),i=[],s=new Set,a=new Set,l=u=>{const d=(h,f)=>{const g=new Map;for(const E of h){const w=f.has(E)?void 0:u(E);w!==void 0&&g.set(w,g.has(w)?null:E)}return g},m=d(r,s);for(const[h,f]of d(o,a)){const g=m.get(h);f&&g&&(i.push([g,f,!0]),s.add(g),a.add(f))}};l(u=>typeof u.attributes?.id=="string"?`${u.tag}#${u.attributes.id}`:void 0),l(u=>Zn(u,!1,n)),l(u=>Zn(u,!0,n));const c=new Set(o.map(u=>u.tag));for(const u of c){const d=f=>f.filter(g=>g.tag===u),m=d(r).filter(f=>!s.has(f)),h=d(o).filter(f=>!a.has(f));if(m.length===h.length&&d(r).length===d(o).length){const f=m.length===1&&!m[0].attributes?.id&&!h[0].attributes?.id;h.forEach((g,E)=>i.push([m[E],g,f]))}}return i}var Y2=class{constructor(e,t,n,r){A(this,"element",void 0),A(this,"name",void 0),A(this,"nextValue",void 0),A(this,"prevValue",void 0),this.element=e,this.name=t,this.nextValue=n,this.prevValue=r}},Z2=class{constructor(e){A(this,"_nodeMap",void 0),A(this,"_map",new W2),A(this,"_hiddenMutations",[]),A(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=G2(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=X2(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 Y2(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=Jb(r,i,o.attributes?.[r]||null,this._map.getAttribute(o,r));if(s!==i){t.push(ie.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=Jb(i,s,null,a);l!==s&&t.push(ie.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=V2(r,i,this._map.getAttribute(o,r));if(s!==i){t.push(ie.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,$u());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&&!ud(t.tag)&&o){const i=[];for(const[s,a]of Object.entries(o))JL(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&&Zn(e,!1,r)===Zn(t,!1,r)){const i=t.children.filter(ey);e.children.filter(ey).forEach((s,a)=>{i[a]&&this._carryHidden(s,i[a],!0,r)});return}for(const[i,s,a]of K2(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)}}}},Q2=class{constructor(e){A(this,"_isMapped",void 0),A(this,"_foreign",new WeakSet),A(this,"_movedTo",new WeakMap),A(this,"_output",new WeakSet),A(this,"_service",new WeakSet),A(this,"_wrappers",new WeakSet),A(this,"_outer",new WeakSet),A(this,"_hasForeign",!1),A(this,"_hasOutput",!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)}}markForeign(e){this._hasForeign=!0,this._foreign.add(e)}markOutput(e){this.markForeign(e),this._hasOutput=!0,this._output.add(e)}isOutput(e){return this._hasOutput&&this._isInside(e,this._output)}get hasOutput(){return this._hasOutput}isMarked(e){return this._foreign.has(e)}isOffModel(e){return this._hasForeign&&this._isInside(e,this._foreign)}isForeign(e){return this._hasForeign&&this._nearestMark(e)==="foreign"}markService(e){this._service.add(e)}markWrapper(e){this._wrappers.add(e)}isWrapper(e){return this._wrappers.has(e)}forgetService(e){this._service.delete(e)}markOuterWrapper(e){this._outer.add(e)}isOuterWrapper(e){return this._outer.has(e)}isService(e){return this._isInside(e,this._service)}markOf(e){return this._service.has(e)?"service":this._foreign.has(e)?"foreign":void 0}_nearestMark(e){for(let t=e;t&&!this._isMapped(t);t=t.parentNode){const n=this.markOf(t);if(n)return n}}_isInside(e,t){for(let n=e;n;n=n.parentNode){if(this._isMapped(n))return!1;if(t.has(n))return!0}return!1}isPlacedInForeign(e){return this._hasForeign&&this.isForeign(this._isMapped(e)?e.parentNode:e)}movedTo(e){return this._movedTo.get(e)}forget(e){this._movedTo.delete(e)}},ny="foreign-structure-in-commit";function J2(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 rl(e){if(!(e instanceof Element))return{tag:e.nodeName.toLowerCase()};const t=e.getAttribute("class");return{tag:e.tagName.toLowerCase(),...t?{class:t}:{}}}var ry="implicit-tbody-in-canvas";function ex(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 tx(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:rl(n),parent:n.parentNode?rl(n.parentNode):void 0};t.add(ry),_r(ry,()=>({foreign:r}))}function nx(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:rl(n.node),parent:n.node.parentNode?rl(n.node.parentNode):void 0};t.has("foreign-structure-in-commit")||(t.add(ny),_r(ny,()=>({foreign:o})))}var Rd="unaccounted-node";function oy(e,t,n,r){if(t.isMapped(e))return"own";const o=t.markOf(e)??n;return o==="foreign"||o==="service"?o:!r||t.isCanvasNode(e)?"interface":"unaccounted"}function iy(e,t){let n,r=!1,o=t.isMapped(e);for(let i=e.parentNode;i;i=i.parentNode)r||(r=t.roots.has(i)),!o&&!n&&(o=t.isMapped(i),n=o?void 0:t.markOf(i));return oy(e,t,n,r||t.roots.has(e))}function sy(e,t){const n=[],r=[];for(let o=e.lastChild;o;o=o.previousSibling)r.push([o,void 0,!1]);for(let o=r.pop();o;o=r.pop()){const[i,s,a]=o,l=a||t.roots.has(i),c=oy(i,t,s,l);c==="unaccounted"&&s!=="unaccounted"&&n.push(i);const u=c==="own"||c==="interface"?void 0:c;for(let d=i.lastChild;d;d=d.previousSibling)r.push([d,u,l])}return n}function rx(e){const t=new WeakSet,n=(e.ownerDocument??e).createTreeWalker(e,NodeFilter.SHOW_ALL);for(let r=n.nextNode();r;r=n.nextNode())t.add(r);return t}function ox(e,t){const n=new Set;for(const r of e)r.isConnected&&iy(r,t)==="unaccounted"&&n.add(r);return[...n].filter(r=>!r.parentNode||!n.has(r.parentNode))}function ix(e){const t=e.nodeType===Node.ELEMENT_NODE?e.tagName.toLowerCase():e.nodeName,n=e.parentNode;return n?`${t}:${Array.prototype.indexOf.call(n.childNodes,e)+1}`:t}function ay(e){const t=[];for(let o=e;o&&o.nodeType!==Node.DOCUMENT_NODE;o=o.parentNode)t.unshift(ix(o));const n=e instanceof Element?e.getAttribute("class"):null,r=e instanceof Element?e.tagName.toLowerCase():e.nodeName;return{path:t.join(" > "),tag:r,...n?{class:n}:{}}}function ly(e,t){if(!e.length)return;const n={count:e.length,node:ay(e[0])};t.has(Rd)||(t.add(Rd),_r(Rd,()=>({unaccounted:n})))}var sx=yr(((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 y(){this._nodes=[],this._values=[]}return y._isIndex=function(p){return+p===p>>>0},y._nodeId=function(p){var v=p[y._ID_PROP];return v||(v=p[y._ID_PROP]=y._NEXT_ID++),v},y.prototype.set=function(p,v){var C=y._nodeId(p);this._nodes[C]=p,this._values[C]=v},y.prototype.get=function(p){var v=y._nodeId(p);return v!==void 0?this._values[v]:void 0},y.prototype.has=function(p){return y._nodeId(p)in this._nodes},y.prototype.delete=function(p){var v=y._nodeId(p);delete this._nodes[v],this._values[v]=void 0},y.prototype.keys=function(){var p=[];for(var v in this._nodes)y._isIndex(v)&&p.push(this._nodes[v]);return p},y._ID_PROP="__mutation_summary_node_map_id__",y._NEXT_ID=1,y})(),o=(function(){function y(){this.added=new r,this.removed=new r,this.maybeMoved=new r,this.oldPrevious=new r,this.moved=void 0}return y})();n.Movement=void 0,(function(y){y[y.STAYED_OUT=0]="STAYED_OUT",y[y.ENTERED=1]="ENTERED",y[y.STAYED_IN=2]="STAYED_IN",y[y.REPARENTED=3]="REPARENTED",y[y.REORDERED=4]="REORDERED",y[y.EXITED=5]="EXITED"})(n.Movement||(n.Movement={}));var i=function(y,p){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,C){v.__proto__=C}||function(v,C){for(var b in C)Object.prototype.hasOwnProperty.call(C,b)&&(v[b]=C[b])},i(y,p)};function s(y,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");i(y,p);function v(){this.constructor=y}y.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}var a=(function(){function y(p,v,C,b,S,_,k,x){v===void 0&&(v=!1),C===void 0&&(C=!1),b===void 0&&(b=!1),S===void 0&&(S=null),_===void 0&&(_=!1),k===void 0&&(k=null),x===void 0&&(x=null),this.node=p,this.childList=v,this.attributes=C,this.characterData=b,this.oldParentNode=S,this.added=_,this.attributeOldValues=k,this.characterDataOldValue=x,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return y.prototype.getAttributeOldValue=function(p){if(this.attributeOldValues)return this.isCaseInsensitive&&(p=p.toLowerCase()),this.attributeOldValues[p]},y.prototype.getAttributeNamesMutated=function(){var p=[];if(!this.attributeOldValues)return p;for(var v in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(v)&&p.push(v);return p},y.prototype.attributeMutated=function(p,v){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(p in this.attributeOldValues)&&(this.attributeOldValues[p]=v)},y.prototype.characterDataMutated=function(p){this.characterData||(this.characterData=!0,this.characterDataOldValue=p)},y.prototype.removedFromParent=function(p){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=p},y.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},y.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},y})(),l=(function(y){s(p,y);function p(v,C){var b=y.call(this)||this;b.rootNode=v,b.reachableCache=void 0,b.wasReachableCache=void 0,b.anyParentsChanged=!1,b.anyAttributesChanged=!1,b.anyCharacterDataChanged=!1;for(var S=0;S<C.length;S++){var _=C[S];switch(_.type){case"childList":b.anyParentsChanged=!0;for(var k=0;k<_.removedNodes.length;k++){var x=_.removedNodes[k];b.getChange(x).removedFromParent(_.target)}for(var k=0;k<_.addedNodes.length;k++){var x=_.addedNodes[k];b.getChange(x).insertedIntoParent()}break;case"attributes":b.anyAttributesChanged=!0;var N=b.getChange(_.target);N.attributeMutated(_.attributeName,_.oldValue);break;case"characterData":b.anyCharacterDataChanged=!0;var N=b.getChange(_.target);N.characterDataMutated(_.oldValue)}}return b}return p.prototype.getChange=function(v){var C=this.get(v);return C||(C=new a(v),this.set(v,C)),C},p.prototype.getOldParent=function(v){var C=this.get(v);return C?C.getOldParent():v.parentNode},p.prototype.getIsReachable=function(v){if(v===this.rootNode)return!0;if(!v)return!1;this.reachableCache=this.reachableCache||new r;var C=this.reachableCache.get(v);return C===void 0&&(C=this.getIsReachable(v.parentNode),this.reachableCache.set(v,C)),C},p.prototype.getWasReachable=function(v){if(v===this.rootNode)return!0;if(!v)return!1;this.wasReachableCache=this.wasReachableCache||new r;var C=this.wasReachableCache.get(v);return C===void 0&&(C=this.getWasReachable(this.getOldParent(v)),this.wasReachableCache.set(v,C)),C},p.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},p})(r),c=(function(){function y(p,v,C,b,S){this.rootNode=p,this.mutations=v,this.selectors=C,this.calcReordered=b,this.calcOldPreviousSibling=S,this.treeChanges=new l(p,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 y.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var p=this.treeChanges.keys(),v=0;v<p.length;v++)this.visitNode(p[v],void 0)},y.prototype.visitNode=function(p,v){if(!this.visited.has(p)){this.visited.set(p,!0);var C=this.treeChanges.get(p),b=v;if((C&&C.childList||b==null)&&(b=this.treeChanges.reachabilityChange(p)),b!==n.Movement.STAYED_OUT){if(this.matchabilityChange(p),b===n.Movement.ENTERED)this.entered.push(p);else if(b===n.Movement.EXITED)this.exited.push(p),this.ensureHasOldPreviousSiblingIfNeeded(p);else if(b===n.Movement.STAYED_IN){var S=n.Movement.STAYED_IN;C&&C.childList&&(C.oldParentNode!==p.parentNode?(S=n.Movement.REPARENTED,this.ensureHasOldPreviousSiblingIfNeeded(p)):this.calcReordered&&this.wasReordered(p)&&(S=n.Movement.REORDERED)),this.stayedIn.set(p,S)}if(b!==n.Movement.STAYED_IN)for(var _=p.firstChild;_;_=_.nextSibling)this.visitNode(_,b)}}},y.prototype.ensureHasOldPreviousSiblingIfNeeded=function(p){if(this.calcOldPreviousSibling){this.processChildlistChanges();var v=p.parentNode,C=this.treeChanges.get(p);C&&C.oldParentNode&&(v=C.oldParentNode);var b=this.childListChangeMap.get(v);b||(b=new o,this.childListChangeMap.set(v,b)),b.oldPrevious.has(p)||b.oldPrevious.set(p,p.previousSibling)}},y.prototype.getChanged=function(p,v,C){this.selectors=v,this.characterDataOnly=C;for(var b=0;b<this.entered.length;b++){var S=this.entered[b],_=this.matchabilityChange(S);(_===n.Movement.ENTERED||_===n.Movement.STAYED_IN)&&p.added.push(S)}for(var k=this.stayedIn.keys(),b=0;b<k.length;b++){var S=k[b],_=this.matchabilityChange(S);if(_===n.Movement.ENTERED)p.added.push(S);else if(_===n.Movement.EXITED)p.removed.push(S);else if(_===n.Movement.STAYED_IN&&(p.reparented||p.reordered)){var x=this.stayedIn.get(S);p.reparented&&x===n.Movement.REPARENTED?p.reparented.push(S):p.reordered&&x===n.Movement.REORDERED&&p.reordered.push(S)}}for(var b=0;b<this.exited.length;b++){var S=this.exited[b],_=this.matchabilityChange(S);(_===n.Movement.EXITED||_===n.Movement.STAYED_IN)&&p.removed.push(S)}},y.prototype.getOldParentNode=function(p){var v=this.treeChanges.get(p);if(v&&v.childList)return v.oldParentNode?v.oldParentNode:null;var C=this.treeChanges.reachabilityChange(p);if(C===n.Movement.STAYED_OUT||C===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return p.parentNode},y.prototype.getOldPreviousSibling=function(p){var v=p.parentNode,C=this.treeChanges.get(p);C&&C.oldParentNode&&(v=C.oldParentNode);var b=this.childListChangeMap.get(v);if(!b)throw Error("getOldPreviousSibling requested on invalid node.");return b.oldPrevious.get(p)},y.prototype.getOldAttribute=function(p,v){var C=this.treeChanges.get(p);if(!C||!C.attributes)throw Error("getOldAttribute requested on invalid node.");var b=C.getAttributeOldValue(v);if(b===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return b},y.prototype.attributeChangedNodes=function(p){if(!this.treeChanges.anyAttributesChanged)return{};var v,C;if(p){v={},C={};for(var b=0;b<p.length;b++){var S=p[b];v[S]=!0,C[S.toLowerCase()]=S}}for(var _={},k=this.treeChanges.keys(),b=0;b<k.length;b++){var x=k[b],N=this.treeChanges.get(x);if(N.attributes&&!(n.Movement.STAYED_IN!==this.treeChanges.reachabilityChange(x)||n.Movement.STAYED_IN!==this.matchabilityChange(x)))for(var W=x,O=N.getAttributeNamesMutated(),P=0;P<O.length;P++){var S=O[P];v&&!v[S]&&!(N.isCaseInsensitive&&C[S])||N.getAttributeOldValue(S)!==W.getAttribute(S)&&(C&&N.isCaseInsensitive&&(S=C[S]),_[S]=_[S]||[],_[S].push(W))}}return _},y.prototype.getOldCharacterData=function(p){var v=this.treeChanges.get(p);if(!v||!v.characterData)throw Error("getOldCharacterData requested on invalid node.");return v.characterDataOldValue},y.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var p=this.treeChanges.keys(),v=[],C=0;C<p.length;C++){var b=p[C];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(b)){var S=this.treeChanges.get(b);!S.characterData||b.textContent==S.characterDataOldValue||v.push(b)}}return v},y.prototype.computeMatchabilityChange=function(p,v){this.matchCache||(this.matchCache=[]),this.matchCache[p.uid]||(this.matchCache[p.uid]=new r);var C=this.matchCache[p.uid],b=C.get(v);return b===void 0&&(b=p.matchabilityChange(v,this.treeChanges.get(v)),C.set(v,b)),b},y.prototype.matchabilityChange=function(p){var v=this;if(this.characterDataOnly)switch(p.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(p.nodeType!==Node.ELEMENT_NODE)return n.Movement.STAYED_OUT;for(var C=p,b=this.selectors.map(function(k){return v.computeMatchabilityChange(k,C)}),S=n.Movement.STAYED_OUT,_=0;S!==n.Movement.STAYED_IN&&_<b.length;){switch(b[_]){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}_++}return S},y.prototype.getChildlistChange=function(p){var v=this.childListChangeMap.get(p);return v||(v=new o,this.childListChangeMap.set(p,v)),v},y.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r;for(var p=function(b){var S=v.mutations[b];if(S.type!="childList"||v.treeChanges.reachabilityChange(S.target)!==n.Movement.STAYED_IN&&!v.calcOldPreviousSibling)return"continue";for(var _=v.getChildlistChange(S.target),k=S.previousSibling,x=function(O,P){!O||_.oldPrevious.has(O)||_.added.has(O)||_.maybeMoved.has(O)||P&&(_.added.has(P)||_.maybeMoved.has(P))||_.oldPrevious.set(O,P)},N=0;N<S.removedNodes.length;N++){var W=S.removedNodes[N];x(W,k),_.added.has(W)?_.added.delete(W):(_.removed.set(W,!0),_.maybeMoved.delete(W)),k=W}x(S.nextSibling,k);for(var N=0;N<S.addedNodes.length;N++){var W=S.addedNodes[N];_.removed.has(W)?(_.removed.delete(W),_.maybeMoved.set(W,!0)):_.added.set(W,!0)}},v=this,C=0;C<this.mutations.length;C++)p(C)}},y.prototype.wasReordered=function(p){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var v=p.parentNode,C=this.treeChanges.get(p);C&&C.oldParentNode&&(v=C.oldParentNode);var b=this.childListChangeMap.get(v);if(!b)return!1;if(b.moved)return b.moved.get(p);b.moved=new r;var S=new r;function _(O){if(!O||!b.maybeMoved.has(O))return!1;var P=b.moved.get(O);return P!==void 0||(S.has(O)?P=!0:(S.set(O,!0),P=W(O)!==x(O)),S.has(O)?(S.delete(O),b.moved.set(O,P)):P=b.moved.get(O)),P}var k=new r;function x(O){var P=k.get(O);if(P!==void 0)return P;for(P=b.oldPrevious.get(O);P&&(b.removed.has(P)||_(P));)P=x(P);return P===void 0&&(P=O.previousSibling),k.set(O,P),P}var N=new r;function W(O){if(N.has(O))return N.get(O);for(var P=O.previousSibling;P&&(b.added.has(P)||_(P));)P=P.previousSibling;return N.set(O,P),P}return b.maybeMoved.keys().forEach(_),b.moved.get(p)},y})(),u=(function(){function y(p,v){var C=this;if(this.projection=p,this.added=[],this.removed=[],this.reparented=v.all||v.element||v.characterData?[]:void 0,this.reordered=v.all?[]:void 0,p.getChanged(this,v.elementFilter,v.characterData),v.all||v.attribute||v.attributeList){var b=v.attribute?[v.attribute]:v.attributeList,S=p.attributeChangedNodes(b);v.attribute?this.valueChanged=S[v.attribute]||[]:(this.attributeChanged=S,v.attributeList&&v.attributeList.forEach(function(k){C.attributeChanged.hasOwnProperty(k)||(C.attributeChanged[k]=[])}))}if(v.all||v.characterData){var _=p.getCharacterDataChanged();v.characterData?this.valueChanged=_:this.characterDataChanged=_}this.reordered&&(this.getOldPreviousSibling=p.getOldPreviousSibling.bind(p))}return y.prototype.getOldParentNode=function(p){return this.projection.getOldParentNode(p)},y.prototype.getOldAttribute=function(p,v){return this.projection.getOldAttribute(p,v)},y.prototype.getOldCharacterData=function(p){return this.projection.getOldCharacterData(p)},y.prototype.getOldPreviousSibling=function(p){return this.projection.getOldPreviousSibling(p)},y})(),d=(function(){function y(){}return y.prototype.matches=function(p){if(p===null)return!1;if(this.attrValue===void 0)return!0;if(!this.contains)return this.attrValue==p;for(var v=p.split(" "),C=0;C<v.length;C++)if(this.attrValue===v[C])return!0;return!1},y.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+"]"},y})();function m(y){return'"'+y.replace(/"/,'\\"')+'"'}var h=/[a-zA-Z_]+/,f=/[a-zA-Z0-9_\-]+/,g=(function(){function y(){this.uid=y.nextUid++,this.qualifiers=[]}return Object.defineProperty(y.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),y.prototype.isMatching=function(p){return p[y.matchesSelector](this.selectorString)},y.prototype.wasMatching=function(p,v,C){if(!v||!v.attributes)return C;var b=v.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(b!=="*"&&b!==p.tagName)return!1;for(var S=[],_=!1,k=0;k<this.qualifiers.length;k++){var x=this.qualifiers[k],N=v.getAttributeOldValue(x.attrName);S.push(N),_=_||N!==void 0}if(!_)return C;for(var k=0;k<this.qualifiers.length;k++){var x=this.qualifiers[k],N=S[k];if(N===void 0&&(N=p.getAttribute(x.attrName)),!x.matches(N))return!1}return!0},y.prototype.matchabilityChange=function(p,v){var C=this.isMatching(p);return C?this.wasMatching(p,v,C)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.wasMatching(p,v,C)?n.Movement.EXITED:n.Movement.STAYED_OUT},y.parseSelectors=function(p){var v=[],C,b;function S(){C&&(b&&(C.qualifiers.push(b),b=void 0),v.push(C)),C=new y}function _(){b&&C.qualifiers.push(b),b=new d}for(var k=/\s/,x=void 0,N="Invalid or unsupported selector syntax.",W=1,O=2,P=3,Q=4,te=5,fe=6,ne=7,Y=8,be=9,ce=10,Se=11,st=12,J=13,q=14,re=W,Ft=0;Ft<p.length;){var z=p[Ft++];switch(re){case W:if(z.match(h)){S(),C.tagName=z,re=O;break}if(z=="*"){S(),C.tagName="*",re=P;break}if(z=="."){S(),_(),C.tagName="*",b.attrName="class",b.contains=!0,re=Q;break}if(z=="#"){S(),_(),C.tagName="*",b.attrName="id",re=Q;break}if(z=="["){S(),_(),C.tagName="*",b.attrName="",re=fe;break}if(z.match(k))break;throw Error(N);case O:if(z.match(f)){C.tagName+=z;break}if(z=="."){_(),b.attrName="class",b.contains=!0,re=Q;break}if(z=="#"){_(),b.attrName="id",re=Q;break}if(z=="["){_(),b.attrName="",re=fe;break}if(z.match(k)){re=q;break}if(z==","){re=W;break}throw Error(N);case P:if(z=="."){_(),b.attrName="class",b.contains=!0,re=Q;break}if(z=="#"){_(),b.attrName="id",re=Q;break}if(z=="["){_(),b.attrName="",re=fe;break}if(z.match(k)){re=q;break}if(z==","){re=W;break}throw Error(N);case Q:if(z.match(h)){b.attrValue=z,re=te;break}throw Error(N);case te:if(z.match(f)){b.attrValue+=z;break}if(z=="."){_(),b.attrName="class",b.contains=!0,re=Q;break}if(z=="#"){_(),b.attrName="id",re=Q;break}if(z=="["){_(),re=fe;break}if(z.match(k)){re=q;break}if(z==","){re=W;break}throw Error(N);case fe:if(z.match(h)){b.attrName=z,re=ne;break}if(z.match(k))break;throw Error(N);case ne:if(z.match(f)){b.attrName+=z;break}if(z.match(k)){re=Y;break}if(z=="~"){b.contains=!0,re=be;break}if(z=="="){b.attrValue="",re=Se;break}if(z=="]"){re=P;break}throw Error(N);case Y:if(z=="~"){b.contains=!0,re=be;break}if(z=="="){b.attrValue="",re=Se;break}if(z=="]"){re=P;break}if(z.match(k))break;throw Error(N);case be:if(z=="="){b.attrValue="",re=Se;break}throw Error(N);case ce:if(z=="]"){re=P;break}if(z.match(k))break;throw Error(N);case Se:if(z.match(k))break;if(z=='"'||z=="'"){x=z,re=J;break}b.attrValue+=z,re=st;break;case st:if(z.match(k)){re=ce;break}if(z=="]"){re=P;break}if(z=="'"||z=='"')throw Error(N);b.attrValue+=z;break;case J:if(z==x){re=ce;break}b.attrValue+=z;break;case q:if(z.match(k))break;if(z==","){re=W;break}throw Error(N)}}switch(re){case W:case O:case P:case te:case q:S();break;default:throw Error(N)}if(!v.length)throw Error(N);return v},y.nextUid=1,y.matchesSelector="matches",y})(),E=(function(){function y(){}return y.createObserverOptions=function(p){var v={childList:!0,subtree:!0},C;function b(S){if(!(v.attributes&&!C)){if(v.attributes=!0,v.attributeOldValue=!0,!S){C=void 0;return}C=C||{},S.forEach(function(_){C[_]=!0,C[_.toLowerCase()]=!0})}}return p.forEach(function(S){if(S.characterData){v.characterData=!0,v.characterDataOldValue=!0;return}if(S.all){b(),v.characterData=!0,v.characterDataOldValue=!0;return}if(S.attribute){b([S.attribute.trim()]);return}var _=y._elementFilterAttributes(S.elementFilter).concat(S.attributeList||[]);_.length&&b(_)}),C&&(v.attributeFilter=Object.keys(C)),v},y.validateOptions=function(p){for(var v in p)if(!(v in y._optionKeys))throw Error("Invalid option: "+v);if(typeof p.callback!="function")throw Error("Invalid options: callback is required and must be a function");if(!p.queries||!p.queries.length)throw Error("Invalid options: queries must contain at least one query request object.");for(var C={callback:p.callback,rootNode:p.rootNode||document,observeOwnChanges:!!p.observeOwnChanges,oldPreviousSibling:!!p.oldPreviousSibling,queries:[]},b=0;b<p.queries.length;b++){var S=p.queries[b];if(S.all){if(Object.keys(S).length>1)throw Error("Invalid request option. all has no options.");C.queries.push({all:!0});continue}if("attribute"in S){var _={attribute:y._validateAttribute(S.attribute)};if(_.elementFilter=g.parseSelectors("*["+_.attribute+"]"),Object.keys(S).length>1)throw Error("Invalid request option. attribute has no options.");C.queries.push(_);continue}if("element"in S){var k=Object.keys(S).length,_={element:S.element,elementFilter:g.parseSelectors(S.element)};if(S.hasOwnProperty("elementAttributes")&&(_.attributeList=y._validateElementAttributes(S.elementAttributes),k--),k>1)throw Error("Invalid request option. element only allows elementAttributes option.");C.queries.push(_);continue}if(S.characterData){if(Object.keys(S).length>1)throw Error("Invalid request option. characterData has no options.");C.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return C},y._validateElementAttributes=function(p){if(!p.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var v={},C={},b=p.split(/\s+/),S=0;S<b.length;S++){var _=b[S];if(_){_=y._validateAttribute(_);var k=_.toLowerCase();if(v[k])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");C[_]=!0,v[k]=!0}}return Object.keys(C)},y._elementFilterAttributes=function(p){var v={};return p.forEach(function(C){C.qualifiers.forEach(function(b){v[b.attrName]=!0})}),Object.keys(v)},y._validateAttribute=function(p){if(typeof p!="string"||(p=p.trim(),!p))throw Error("Invalid request option. attribute must be a non-zero length string.");if(!p.match(y._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+p);return p},y._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,y._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},y})(),w=(function(){function y(p){var v=this;this._connected=!1,this._options=E.validateOptions(p),this._observerOptions=E.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(C){return C.elementFilter?C.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(C){return C.all}),this._queryValidators=[],y.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(C){return y.createQueryValidator(v._root,C)})),this._observer=new MutationObserver(function(C){v._observerCallback(C)}),this.reconnect()}return y.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},y.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var p=this._createSummaries(this._observer.takeRecords());return this._changesToReport(p)?p:void 0},y.prototype.disconnect=function(){var p=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,p},y.prototype._observerCallback=function(p){this._options.observeOwnChanges||this._observer.disconnect();var v=this._createSummaries(p);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))},y.prototype._createSummaries=function(p){if(!p||!p.length)return[];for(var v=new c(this._root,p,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),C=[],b=0;b<this._options.queries.length;b++)C.push(new u(v,this._options.queries[b]));return C},y.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(p){p&&p.recordPreviousState()})},y.prototype._runQueryValidators=function(p){this._queryValidators.forEach(function(v,C){v&&v.validate(p[C])})},y.prototype._changesToReport=function(p){return p.some(function(v){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(C){return v[C]&&v[C].length})||v.attributeChanged&&Object.keys(v.attributeChanged).some(function(C){return!!v.attributeChanged[C].length}))})},y})(),T=(function(){function y(p,v){this.root=p,this.delegate=v,this.idMap={}}return y.prototype.initialize=function(p,v){this.idMap[p]=this.root;for(var C=0;C<v.length;C++)this.deserializeNode(v[C],this.root)},y.prototype.applyChanged=function(p,v,C,b){var S=this;v.forEach(function(_){var k=S.deserializeNode(_);S.deserializeNode(_.parentNode),S.deserializeNode(_.previousSibling),k.parentNode&&k.parentNode.removeChild(k)}),p.forEach(function(_){var k=S.deserializeNode(_);k.parentNode&&k.parentNode.removeChild(k)}),v.forEach(function(_){var k=S.deserializeNode(_),x=S.deserializeNode(_.parentNode),N=S.deserializeNode(_.previousSibling);x.insertBefore(k,N?N.nextSibling:x.firstChild)}),C.forEach(function(_){var k=S.deserializeNode(_);Object.keys(_.attributes).forEach(function(x){var N=_.attributes[x];N===null?k.removeAttribute(x):(!S.delegate||!S.delegate.setAttribute||!S.delegate.setAttribute(k,x,N))&&k.setAttribute(x,N)})}),b.forEach(function(_){var k=S.deserializeNode(_);k.textContent=_.textContent}),p.forEach(function(_){delete S.idMap[_.id]})},y.prototype.deserializeNode=function(p,v){var C=this;if(p===null)return null;var b=this.idMap[p.id];if(b)return b;var S=this.root.ownerDocument;switch(S===null&&(S=this.root),p.nodeType){case Node.COMMENT_NODE:b=S.createComment(p.textContent);break;case Node.TEXT_NODE:b=S.createTextNode(p.textContent);break;case Node.DOCUMENT_TYPE_NODE:b=S.implementation.createDocumentType(p.name,p.publicId,p.systemId);break;case Node.ELEMENT_NODE:this.delegate&&this.delegate.createElement&&(b=this.delegate.createElement(p.tagName)),b||(b=S.createElement(p.tagName)),Object.keys(p.attributes).forEach(function(k){(!C.delegate||!C.delegate.setAttribute||!C.delegate.setAttribute(b,k,p.attributes[k]))&&b.setAttribute(k,p.attributes[k])});break;default:throw"Unsupported node type: "+p.nodeType}if(this.idMap[p.id]=b,v&&v.appendChild(b),p.childNodes)for(var _=0;_<p.childNodes.length;_++)this.deserializeNode(p.childNodes[_],b);return b},y})(),L=(function(){function y(p,v,C){var b=this;this.target=p,this.mirror=v,this.nextId=1,this.knownNodes=new r;for(var S=this.serializeNode(p).id,_=[],k=p.firstChild;k;k=k.nextSibling)_.push(this.serializeNode(k,!0));this.mirror.initialize(S,_);var x=[{all:!0}];C&&(x=x.concat(C)),this.mutationSummary=new w({rootNode:p,callback:function(N){b.applyChanged(N)},queries:x})}return y.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},y.prototype.rememberNode=function(p){var v=this.nextId++;return this.knownNodes.set(p,v),v},y.prototype.forgetNode=function(p){this.knownNodes.delete(p)},y.prototype.serializeNode=function(p,v){if(p===null)return null;var C=this.knownNodes.get(p);if(C!==void 0)return{id:C};var b={nodeType:p.nodeType,id:this.rememberNode(p)};switch(b.nodeType){case Node.DOCUMENT_TYPE_NODE:var S=p;b.name=S.name,b.publicId=S.publicId,b.systemId=S.systemId;break;case Node.COMMENT_NODE:case Node.TEXT_NODE:b.textContent=p.textContent;break;case Node.ELEMENT_NODE:var _=p;b.tagName=_.tagName,b.attributes={};for(var k=0;k<_.attributes.length;k++){var x=_.attributes[k];b.attributes[x.name]=x.value}if(v&&_.childNodes.length){b.childNodes=[];for(var N=_.firstChild;N;N=N.nextSibling)b.childNodes.push(this.serializeNode(N,!0))}}return b},y.prototype.serializeAddedAndMoved=function(p,v,C){var b=this,S=p.concat(v).concat(C),_=new r;S.forEach(function(x){var N=x.parentNode,W=_.get(N);W||(W=new r,_.set(N,W)),W.set(x,!0)});var k=[];return _.keys().forEach(function(x){for(var N=_.get(x),W=N.keys();W.length;){for(var O=W[0];O.previousSibling&&N.has(O.previousSibling);)O=O.previousSibling;for(;O&&N.has(O);){var P=b.serializeNode(O);P.previousSibling=b.serializeNode(O.previousSibling),P.parentNode=b.serializeNode(O.parentNode),k.push(P),N.delete(O),O=O.nextSibling}W=N.keys()}}),k},y.prototype.serializeAttributeChanges=function(p){var v=this,C=new r;return Object.keys(p).forEach(function(b){p[b].forEach(function(S){var _=C.get(S);_||(_=v.serializeNode(S),_.attributes={},C.set(S,_)),_.attributes[b]=S.getAttribute(b)})}),C.keys().map(function(b){return C.get(b)})},y.prototype.applyChanged=function(p){var v=this,C=p[0],b=C.removed.map(function(x){return v.serializeNode(x)}),S=this.serializeAddedAndMoved(C.added,C.reparented,C.reordered),_=this.serializeAttributeChanges(C.attributeChanged),k=C.characterDataChanged.map(function(x){var N=v.serializeNode(x);return N.textContent=x.textContent,N});this.mirror.applyChanged(b,S,_,k),C.removed.forEach(function(x){v.forgetNode(x)})},y})();if(MutationObserver===void 0)throw Error("DOM Mutation Observers are required");n.ChildListChange=o,n.MutationProjection=c,n.MutationSummary=w,n.NodeChange=a,n.NodeMap=r,n.Qualifier=d,n.Selector=g,n.Summary=u,n.TreeChanges=l,n.TreeMirror=T,n.TreeMirrorClient=L,Object.defineProperty(n,"__esModule",{value:!0})}))})),ax=sx(),$o=0,Wo=new Array(1e3);function lx(){for(let e=0;e<$o;e+=2){const t=Wo[e],n=Wo[e+1];t(...n),Wo[e]=void 0,Wo[e+1]=void 0}$o=0}function cx(e,...t){Wo[$o]=e,Wo[$o+1]=t,$o+=2,$o===2&&dx()}function ux(){let e=0;const t=new MutationObserver(lx),n=document.createTextNode("");return t.observe(n,{characterData:!0}),()=>{n.data=String(e=++e%2)}}var dx=ux();function cy(){cx(()=>{Md.hasListeners()&&(Md.fire(),cy())})}var Md=new he({onFirstListenerAdd:cy}),ol=Md.once;function fx(e,t,n){const r=new he;let o=[];return r.addDisposable(e(i=>{ol(()=>{r.fire(t(o)),o=[]}),o.push(i)})),n?.addDisposable(r),r.event}var mx=class extends he{constructor(e={}){super(),A(this,"_mutationSummary",void 0),this._mutationSummary=new ax.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}},hx=class extends ve{_nextTickHandler(){ol(()=>{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(),A(this,"_mutationEmitter",void 0),A(this,"_innerEmitter",this.addDisposable(new he({onFirstListenerAdd:()=>{this._nextTickHandler()}}))),A(this,"_lostEmitter",this.addDisposable(new he)),A(this,"_paused",0),A(this,"_stopped",0),A(this,"_foreignCode",0),A(this,"_summaries",[]),A(this,"onMutate",this._innerEmitter.event),A(this,"onLost",this._lostEmitter.event),A(this,"onNativeMutate",void 0),this._mutationEmitter=this.addDisposable(new mx(e)),this.onNativeMutate=this._mutationEmitter.event,this.addDisposable(this._mutationEmitter.event(t=>{(!this._stopped||this._foreignCode)&&(this._paused?this._lostEmitter.fire(t):(this._summaries.push(...t),ol(()=>{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--}pauseForForeignCode(){this.pause(),this._foreignCode++}resumeAfterForeignCode(){this.resume(),this._foreignCode--}unpaused(e){if(!this._paused||this._stopped)return e();this._mutationEmitter.trigger();const t=this._paused;this._paused=0;try{return e()}finally{try{this._mutationEmitter.trigger()}finally{this._paused+=t}}}trigger(){this._mutationEmitter.trigger(!0)}takeRecords(){this._mutationEmitter.trigger()}flush(){if(this._mutationEmitter.trigger(),this._summaries.length&&this._innerEmitter.hasListeners()){const e=this._summaries;this._summaries=[],this._innerEmitter.fire(e)}}},px=1,uy=e=>e.nodeType===px,Pd=e=>e?.nodeName==="STYLE";function gx(e){return e.some(t=>t.attributeChanged&&Object.keys(t.attributeChanged).length||t.reparented?.length||t.reordered?.length||t.added?.some(n=>uy(n)||Pd(n.parentNode))||t.removed?.some(n=>uy(n)||Pd(t.getOldParentNode(n)))?!0:!!t.characterDataChanged?.some(n=>Pd(n.parentNode)))}var bx=ol;function yx(e,t){let n=0;for(const r of t){if(r.oldPosition>e)break;const o=r.oldLength>0&&r.newLength>0,i=e===r.oldPosition||e===r.oldEnd;if(o&&i||r.oldPosition<e&&e<r.oldEnd)return;r.oldEnd<=e&&(n=r.newEnd-r.oldEnd)}return e+n}var dy=/&(?:#\d+|#x[\da-f]+|[a-z][a-z\d]*);/iy;function fy(e,t){dy.lastIndex=t;const n=dy.exec(e);return n?n[0].length:e.startsWith(`\r
|
|
3
|
+
`,t)?2:1}function my(e){return e.length===1?1:(vr(e).textContent??"").length}function vx(e,t,n){if(n)return Math.min(t,e.length);let r=0,o=0;for(;o<e.length&&r<t;){const i=fy(e,o);r+=my(e.slice(o,o+i)),o+=i}return o}function Ex(e,t,n){if(n)return Math.min(t,e.length);let r=0;for(let o=0;o<e.length;){const i=fy(e,o);if(o+i>t)break;r+=my(e.slice(o,o+i)),o+=i}return r}function os(e,t){const n=t.nodeMap.getByElement(e);return n&&t.isAttached(n)?n:void 0}var Sx='[contenteditable="true"], editor';function hy(e,t,n){const r=e.childNodes;for(let i=t;i<r.length;i++){const s=os(r[i],n);if(s)return s.start}for(let i=Math.min(t,r.length)-1;i>=0;i--){const s=os(r[i],n);if(s)return s.end}const o=os(e,n);return o&&(o.startTagEnd??o.start)}function py(e,t){if((e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(Sx))for(let n=e,r=e.parentNode;r;n=r,r=r.parentNode){const o=hy(r,Array.from(r.childNodes).indexOf(n),t);if(o!==void 0)return o}}function wx({node:e,offset:t},n){if(e.nodeType===Node.TEXT_NODE){const r=os(e,n);if(r?.type!==I.HTML)return py(e,n);const o=n.textAt(r.start,r.end);return r.start+vx(o,t,gn(e.parentNode))}return hy(e,t,n)??(os(e,n)?void 0:py(e,n))}function Id(e,t,n){const r=n.nodeMap.getByNode(e),o=r?.parentNode;if(!(!r||!o))return{node:o,offset:Array.from(o.childNodes).indexOf(r)+(t?1:0)}}function _x(e,t){const n=t.nodeAt(e);if(!n)return;if(n.type===I.HTML){const s=t.nodeMap.getByNode(n);return s?.nodeType!==Node.TEXT_NODE?void 0:{node:s,offset:Ex(t.textAt(n.start,n.end),Math.max(0,Math.min(e,n.end)-n.start),gn(s.parentNode))}}if(e<=n.start||e>=n.end)return Id(n,e>=n.end&&e>n.start,t);const r=n.children.find(s=>s.start>=e);if(r)return Id(r,!1,t);const o=n.children[n.children.length-1];if(o)return Id(o,!0,t);const i=t.nodeMap.getByNode(n);return i&&{node:i,offset:0}}var zJ=400,gy=3e3,Cx=class extends ve{constructor(e,t=400){super(),A(this,"_waitMs",void 0),A(this,"_actionId",void 0),A(this,"_queue",[]),A(this,"_timer",void 0),A(this,"_guid",void 0),A(this,"_releaseOnReady",!1),A(this,"_releasing",!1),this._waitMs=t,this.addDisposable(e.onHistoryAction(n=>this._wait(n))),this.addDisposable(e.onHistoryActionSent(n=>this._sent(n))),this.addDisposable(e.onHistoryActionAnswered(n=>this._answered(n))),this.addDisposable(e.onEntitySet(n=>this._entitySet(n))),this.addDisposable(e.onReady(()=>this._ready())),this.addDispose(()=>this._drop())}hold(e){return this._actionId===void 0?!1:(this._queue.push(e),!0)}holdBehindQueued(e){return!this._queue.length||this._releasing?!1:(this._queue.push(e),!0)}isWaiting(){return this._actionId!==void 0}hasQueued(){return this._queue.length>0&&!this._releasing}releaseNow(){this._queue.length&&this._release()}_wait(e){this._actionId=e,this._restartTimer(gy)}_sent(e){e===this._actionId&&!this._releaseOnReady&&this._restartTimer(this._waitMs)}_restartTimer(e){clearTimeout(this._timer),this._timer=setTimeout(()=>this._release(),e)}_answered(e){e===this._actionId&&this._release()}_release(){clearTimeout(this._timer),this._actionId=void 0,this._releaseOnReady=!1,this._releasing=!0;try{for(;this._actionId===void 0&&this._queue.length;){const e=this._queue.shift();try{e?.()}catch{}}}finally{this._releasing=!1}}_entitySet(e){const t=e===this._guid;this._guid=e,t?this._actionId!==void 0&&(this._restartTimer(this._waitMs),this._releaseOnReady=!0):this._drop()}_ready(){this._releaseOnReady&&(this._releaseOnReady=!1,this._release())}_drop(){clearTimeout(this._timer),this._actionId=void 0,this._releaseOnReady=!1,this._queue=[]}},by=2e3,Tx=3;function Ax(e,t,n){const r=e.data.indexOf(n,Math.max(0,t-n.length));return n.trim().length>=Tx&&r>=0&&r<=t}function yy(e,t){if(!e||e.nodeType===Node.TEXT_NODE)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r;for(let o=n.nextNode();o&&(t||!r);o=n.nextNode())r=o;return r}function kx(e,t){if(e.nodeType===Node.TEXT_NODE)return{text:e,offset:t};const n=yy(e.childNodes[t-1],!0),r=n?void 0:yy(e.childNodes[t],!1);return n?{text:n,offset:n.length}:r&&{text:r,offset:0}}var Lx=class extends ve{beginTextUpdate(){this._baseDocument.beginUpdate()}endTextUpdate(){this._baseDocument.endUpdate()}constructor(e,t,n){super(),A(this,"_baseDocument",void 0),A(this,"_remoteDocument",void 0),A(this,"_parsedDocument",void 0),A(this,"_nodeMap",void 0),A(this,"_beforeChangeEmitter",this.addDisposable(new he)),A(this,"_beforeCommitEmitter",this.addDisposable(new he)),A(this,"_beforeTextCommitEmitter",this.addDisposable(new he)),A(this,"_onTextCommitEmitter",this.addDisposable(new he)),A(this,"_onRefreshEmitter",this.addDisposable(new he)),A(this,"_documentElement",void 0),A(this,"_docType",void 0),A(this,"_parseFn",void 0),A(this,"_serviceMarkup",void 0),A(this,"_mapHTMLRoots",void 0),A(this,"_roots",void 0),A(this,"_getRootsParent",void 0),A(this,"_mutationCollector",this.addDisposable(new hx)),A(this,"_attributeMapper",void 0),A(this,"_trackedOffsets",new Set),A(this,"_inputHold",void 0),A(this,"_shownEntity",void 0),A(this,"_savedCaret",void 0),A(this,"ownership",void 0),A(this,"holdCaretAfterBreak",void 0),A(this,"_reportedDrifts",new Set),A(this,"_hiddenEmptyTexts",new WeakSet),A(this,"_canvasNodes",rx(document)),A(this,"_accountingTimer",void 0),A(this,"_lastAccounting",0),A(this,"_capture",void 0),A(this,"_openBatches",0),A(this,"_pushUndoStop",!1),A(this,"_locked",!1),A(this,"_beforeCommitPending",!1),A(this,"_closeStep",!1),A(this,"_styleDirty",!0),A(this,"_outputs",new Map),A(this,"_runningScripts",[]),A(this,"scriptRunner",{run:(o,i)=>this.runScript(o,i),quiet:o=>this.renderOnly(o),substitute:(o,i)=>{const s=this._nodeMap.getByElement(o);s&&(this._nodeMap.remove(s,!1),this._nodeMap.set(s,i))}}),A(this,"_commands",[]),A(this,"_pauseOnCommandInput",o=>{const i=this._commands[this._commands.length-1];if(i){i.paused||(i.paused=!0,this._mutationCollector.pause());return}o.isTrusted&&(this._pushUndoStop=!0,this.recordNow())}),A(this,"_treeMutations",[]),A(this,"beforeChange",this._beforeChangeEmitter.event),A(this,"beforeCommit",this._beforeCommitEmitter.event),A(this,"beforeTextCommit",this._beforeTextCommitEmitter.event),A(this,"onTextCommit",this._onTextCommitEmitter.event),A(this,"onChange",aL(fx(this._mutationCollector.onNativeMutate,o=>o.flat(),this),o=>o.length>0,this)),A(this,"onRefresh",this._onRefreshEmitter.event),this._baseDocument=e,this._remoteDocument=t,this._parseFn=n.prepareHtml,this._serviceMarkup=n.serviceMarkup,this._mapHTMLRoots=n.mapHTMLRoots,this._getRootsParent=n.rootsParent,this._roots=[...document.childNodes];const r=this._parsedDocument=new yN(e,n.createRoot);this._nodeMap=new t2,this.addDisposable(r.onRefresh(this._onRefresh.bind(this))),this.addDisposable(r.onMutate(this._onRemoteMutate.bind(this))),this._attributeMapper=new Z2(this._nodeMap),this.addDisposable(f2(()=>this._mutationCollector.pauseForForeignCode())),this.addDisposable(m2(()=>this._mutationCollector.resumeAfterForeignCode())),this.addDisposable(this._mutationCollector.onNativeMutate(o=>{this._styleDirty||(this._styleDirty=gx(o))})),this.addDisposable(this._mutationCollector.onLost(o=>this._attributeMapper.onHiddenMutate(o))),this.ownership=new Q2(o=>!!this._nodeMap.getByElement(o)),this.addDisposable(this._mutationCollector.onLost(o=>this._bindScriptOutput(o))),this.addDisposable(this._mutationCollector.onLost(o=>this.ownership.observeLost(o))),this.addDispose(yA(this._pauseOnCommandInput)),t.collectCanvasEdits=()=>this.commit(!1),this.addDispose(()=>clearTimeout(this._accountingTimer)),this.addDisposable(t.onEntitySet(o=>this._rememberCaret(o))),this.addDisposable(t.onReady(()=>this._dropForeignCaret())),this._inputHold=this.addDisposable(new Cx(t)),this.addDisposable(e.onChanged(({changes:o})=>this._rebaseTracked(o))),this.addDisposable(t.onEntitySet(()=>this._forgetTracked()))}trackOffset(e){const t={offset:e};return this._trackedOffsets.add(t),{current:()=>t.offset,release:()=>this._trackedOffsets.delete(t)}}_rebaseTracked(e){for(const t of this._trackedOffsets)t.offset=t.offset===void 0?void 0:yx(t.offset,e)}_forgetTracked(){for(const e of this._trackedOffsets)e.offset=void 0;this._trackedOffsets.clear()}holdInput(e){return this._inputHold.hold(e)}holdInputBehindQueued(e){return this._inputHold.holdBehindQueued(e)}isHoldingInput(){return this._inputHold.isWaiting()}hasHeldInput(){return this._inputHold.hasQueued()}releaseHeldInput(){this._inputHold.releaseNow()}_rememberCaret(e){const t=e===this._shownEntity;this._shownEntity=e,this._savedCaret=void 0;const n=document.getSelection();if(!t||!n?.isCollapsed||document.activeElement?.closest("input, textarea, select, .monaco-editor"))return;const r=n.anchorNode,o=r?.childNodes,i=r?.nodeType===Node.TEXT_NODE?r:[o?.[n.anchorOffset-1],o?.[n.anchorOffset]].find(s=>s?.nodeType===Node.TEXT_NODE);i&&(this._savedCaret={node:i,text:i.data})}_dropForeignCaret(){const e=this._savedCaret;if(this._savedCaret=void 0,!e||document.activeElement?.closest("input, textarea, select, .monaco-editor"))return;const t=document.getSelection(),n=t?.anchorNode;if(!e.node.isConnected){const l=n?kx(n,t?.anchorOffset??0):void 0;l&&l.text!==e.node&&!Ax(l.text,l.offset,e.text)&&t?.removeAllRanges();return}const{text:r}=e,o=e.node.data,i=Math.min(r.length,o.length);let s=0;for(;s<i&&r[s]===o[s];)s++;let a=0;for(;a<i-s&&r[r.length-1-a]===o[o.length-1-a];)a++;s+a<Math.ceil(i/2)&&(n===e.node||n===e.node.parentNode)&&t?.removeAllRanges()}_typedIntoHidden(e){const t=e.flatMap(n=>n.characterDataChanged??[]).filter(n=>this._hiddenEmptyTexts.has(n)&&n.isConnected&&n.data!==""&&!this.isBehindHidden(n));for(const n of t)this._hiddenEmptyTexts.delete(n),this.ownership.forgetService(n);return t.length?[s2(t)]:[]}isBehindHidden(e){for(let t=e.parentNode;t&&!this._nodeMap.getByElement(t);t=t.parentNode)if(!this.ownership.isWrapper(t)&&this.ownership.markOf(t))return!0;return!1}isUntracked(e){return this.ownership.isMarked(e)||this.ownership.isOffModel(e.parentNode)||this.ownership.isService(e)}markUntracked(e){this.ownership.markForeign(e)}_reportSafely(e){try{e()}catch{}}_reportForeignStructure(e){this._reportSafely(()=>{const t=n=>!!this._nodeMap.getByElement(n);nx(J2(e,this.ownership,t),this._reportedDrifts),tx(ex(e,t),this._reportedDrifts)})}_accountingRules(){const e=new Set;for(const t of this._parsedDocument.root.children){const n=this._nodeMap.getByNode(t);n&&e.add(n)}return this._getRootsParent?.()?.childNodes.forEach(t=>e.add(t)),{isMapped:t=>!!this._nodeMap.getByElement(t),markOf:t=>this.ownership.markOf(t),isCanvasNode:t=>this._canvasNodes.has(t),roots:e}}nodeBucket(e){return iy(e,this._accountingRules())}auditNodes(){return sy(document,this._accountingRules()).map(ay)}checkAccounting(){this._reportSafely(()=>ly(sy(document,this._accountingRules()),this._reportedDrifts))}_checkCommitted(e){this._reportSafely(()=>{const t=e.flatMap(n=>[...n.added,...n.reparented??[],...n.reordered??[]]);ly(ox(t,this._accountingRules()),this._reportedDrifts)})}_scheduleAccountingCheck(){if(this._accountingTimer!==void 0||this.isDisposed())return;const e=()=>{this._accountingTimer=void 0,this._lastAccounting=Date.now(),this.isDisposed()||this.checkAccounting()},t=Math.max(0,this._lastAccounting+by-Date.now());this._accountingTimer=setTimeout(()=>{const n=window.requestIdleCallback;n?n(e,{timeout:by}):e()},t)}closeUndoStep(){this._closeStep=!0}commit(e=!0,t=!1){this._pushUndoStop||(this._pushUndoStop=e),this._locked||(this._locked=t);const n=this._capture??this._startCapture();return this._runBeforeCommit(),n}takeStyleDirty(){this._mutationCollector.takeRecords();const e=this._styleDirty;return this._styleDirty=!1,e}_runBeforeCommit(){this._beforeCommitPending&&!this.isDisposed()&&(this._beforeCommitPending=!1,this._mutationCollector.unpaused(()=>this._beforeCommitEmitter.fire()))}flushCommit(){this._capture!==void 0&&this._mutationCollector.flush()}recordNow(){this._capture===void 0&&this._startCapture(),this._mutationCollector.flush()}_startCapture(){let e;const t=new Promise(n=>e=n);return this._capture=t,this._openBatches++,this._beforeCommitPending=!0,this._sealOnNextTick(e),t}_letterEdits(e){const t=this._serviceMarkup;if(!t)return e;const n=l2(e,{...t,isWrapper:r=>this.ownership.isWrapper(r),isMapped:r=>!!this._nodeMap.getByElement(r)});return n.service.forEach(r=>this.ownership.markService(r)),n.summaries}_sealOnNextTick(e){const t=this._mutationCollector.onMutate(n=>{n.length&&(this._reportSafely(()=>this._beforeTextCommitEmitter.fire()),this._dropForeignOutput(n),this._reportForeignStructure(n),ja("commit",()=>{const r=F2(this._letterEdits([...n,...this._typedIntoHidden(n)]),this._nodeMap,this._parseFn,this._rootsParent(),o=>this.ownership.isWrapper(o));this._commit(r)}),this._reportSafely(()=>this._onTextCommitEmitter.fire()),this._checkCommitted(n),this._dropOrphanedOutput())});bx(()=>{this._beforeCommitPending&&this._reportSafely(()=>this._runBeforeCommit()),this._reportSafely(()=>this._mutationCollector.flush()),this._beforeCommitPending=!1,t.dispose();const{_pushUndoStop:n,_locked:r}=this;this._capture=void 0,this._pushUndoStop=this._locked=!1,this._closeStep&&n&&(this._closeStep=!1,this._remoteDocument.closeStep());const o=()=>{this._openBatches--,e()};if(r&&!this.isDisposed()){this._remoteDocument.saveChangesAsync(n).finally(o);return}try{this.isDisposed()||this._remoteDocument.saveChanges(n)}finally{o()}})}get entityId(){return this._remoteDocument.entityId}whenSent(e=!1){return this._remoteDocument.whenSent(e)}sendAfterCurrentEdits(e){const t=this._pushUndoStop;return this._pushUndoStop=!1,this._remoteDocument.sendAfterCurrentEdits(e,t)}holdsTypedEdits(){return this._remoteDocument.holdsTypedEdits()}hasEditsAfterBoundary(){return this._remoteDocument.hasEditsAfterBoundary()}markHistoryAction(){return this._remoteDocument.markHistoryAction()}noteHistoryActionSent(e){this._remoteDocument.noteHistoryActionSent(e)}_textPoints(){return{nodeMap:this._nodeMap,textAt:(e,t)=>this._baseDocument.getText({start:e,end:t}),nodeAt:e=>this._parsedDocument.getNodeByPosition(e),isAttached:e=>this._parsedDocument.isAttached(e)}}pointToOffset(e){return wx(e,this._textPoints())}offsetToPoint(e){return _x(e,this._textPoints())}renderOnly(e){this._mutationCollector.stop();try{return e()}finally{this._mutationCollector.start()}}applyHidden(e){this._mutationCollector.pause();try{return e()}finally{this._mutationCollector.resume()}}applyForeignOutput(e,t,n){e.forEach(r=>this.ownership.markOutput(r)),this.applyHidden(t),this._keepOutput(n,e)}_keepOutput(e,t){t.length&&this._outputs.set(e,[...this._outputs.get(e)??[],...t])}_isGone(e){return!e.isConnected&&!this.isInLetter(e)}isInLetter(e){const t=this._nodeMap.getByElement(e);return!!t&&this._parsedDocument.isAttached(t)}letterChildren(e){return(this._nodeMap.getByElement(e)?.children??[]).flatMap(t=>{const n=this._nodeMap.getByNode(t);return n?[n]:[]})}runScript(e,t){this._mutationCollector.pauseForForeignCode(),this._runningScripts.push(e);try{t()}finally{try{this._mutationCollector.resumeAfterForeignCode()}finally{this._runningScripts.pop()}}}_scriptOf(){if(this._runningScripts.length)return this._runningScripts[this._runningScripts.length-1]??void 0;const e=document.currentScript;return e&&(this._nodeMap.getByElement(e)||this.ownership.isOutput(e))?e:void 0}_bindScriptOutput(e){const t=this._scriptOf();if(!t)return;const n=new Set(e.flatMap(o=>o.added)),r=[...n].filter(o=>!(o.parentNode&&n.has(o.parentNode))&&!this._nodeMap.getByElement(o)&&!this.ownership.isOutput(o)&&!this.ownership.isService(o)&&!this._runningScripts.includes(o));r.forEach(o=>this.ownership.markOutput(o)),this._keepOutput(t,r)}_dropOrphanedOutput(){let e=[...this._outputs.keys()].filter(t=>this._isGone(t));for(;e.length;){const t=e.flatMap(n=>this._outputs.get(n)??[]);e.forEach(n=>this._outputs.delete(n)),this.applyHidden(()=>t.flatMap(n=>this._unwrapOutput(n))).forEach(n=>this.ownership.forget(n)),e=[...this._outputs.keys()].filter(n=>this._isGone(n))}}_unwrapOutput(e){const t=[],n=r=>r.childNodes.forEach(o=>this.isInLetter(o)?t.push(o):n(o));return n(e),e.parentNode&&e.replaceWith(...t),t}_dropForeignOutput(e){if(this.ownership.hasOutput){const t=n=>!(this.ownership.isMarked(n)&&this.ownership.isOutput(n));for(const n of e)n.added=n.added.filter(t),n.reparented=n.reparented?.filter(t),n.reordered=n.reordered?.filter(t)}}applyOwn(e){this._mutationCollector.takeRecords(),this._runningScripts.push(null);try{return this._mutationCollector.unpaused(e)}finally{this._runningScripts.pop()}}applyCommand(e){const t={paused:!1};this._commands.push(t);try{return this._mutationCollector.unpaused(e)}finally{this._commands.pop(),t.paused&&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=$2(e);try{this._baseDocument.beginUpdate();const t=this._parsedDocument;Zg(()=>{const n=Cb(t.applyingMutation,r=>this._nodeMap.getByNode(r),r=>t.isAttached(r));return n&&{...n,stage:"tree"}},()=>t.applyMutations(e));for(const n of e)if(n.type==="Hidden"){const r=this._nodeMap.getByNode(n.node);r&&(this.ownership.markService(r),r.nodeType===Node.TEXT_NODE&&r.data===""&&this._hiddenEmptyTexts.add(r)),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===I.ELEMENT){const r=Wu(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,tr),i=this._nodeMap.getByNode(n);i&&(this._nodeMap.remove(n),this._nodeMap.set(o,i))}}finally{this._baseDocument.endUpdate()}}_onRefresh(e){try{ja("refresh",()=>this._onRemoteMutate(e,!0))}finally{this._onRefreshEmitter.fire()}}_onRemoteMutate(e,t){if(this._treeMutations.push([e,t,CL()??"other"]),!(this._remoteDocument.hasChanges()&&!this._remoteDocument.isApplyingRemote()))for(const[n,r,o]of this._treeMutations)ja(o,()=>this._doOnRemoteMutate(n,r))}_doOnRemoteMutate(e,t){try{if(this._mutationCollector.stop(),e=o2(this._attributeMapper.onRemoteMutate(e),this._nodeMap),this._treeMutations=[],!t){const o=this._parsedDocument.root;for(const i of e)if(i.type==="Add"){if(i.parent===o){t=!0;break}}else if(i.type==="Remove"){if(i.node.parent===o){t=!0;break}}else if(i.type==="Move"&&(i.node.parent===o||i.parent===o)){t=!0;break}}const n=HN(e,this._nodeMap,o=>this._parsedDocument.isAttached(o),o=>this.ownership.markOf(o)==="service",o=>this.ownership.isOuterWrapper(o)),r=WN(n);this._beforeChangeEmitter.fire({domMutations:n.mutations,treeMutations:e}),r.push(...pk(zN(n)));try{if(JN(n,this._nodeMap,this.holdCaretAfterBreak),this._dropOrphanedOutput(),this._attributeMapper.restoreHidden(),t){const o=this._parsedDocument.root?.children;if(o){const i=o.map(a=>this._nodeMap.getByNode(a)).filter(a=>!!a),s=this._roots=this._mapHTMLRoots(i,this);kd.isEqual(i,s)}}}finally{xg(r,this.scriptRunner)}}finally{this._mutationCollector.start(),this._scheduleAccountingCheck()}}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(ie.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}):""}getRootsHtml(){const e=this._getRootsParent?.();return e?[...e.childNodes].map(t=>this.getOuterHtml(t)).join(""):""}setInnerHtml(e,t){if(e instanceof Element)e.innerHTML=t;else if(e instanceof Comment)e.data=t;else if(e instanceof Document){rt("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}}}},UJ=1500,jJ=2,Nx=100,xx=class{constructor(e){A(this,"_options",void 0),A(this,"_watches",new Map),A(this,"_timer",void 0),A(this,"_last",0),A(this,"_tick",()=>{const t=Date.now(),n=Math.min(Math.max(t-this._last,0),200);this._last=t;for(const[r,o]of this._watches){if(!this._options.isAwaiting(r)){this._watches.delete(r);continue}if(o.waited+=n,!(o.waited<1500)){if(o.retries<2){o.retries+=1,o.waited=0,o.resend();continue}t-o.startedAt<15e3||(this._watches.delete(r),this._options.onGiveUp(r,o.retries))}}this._watches.size||this._stop()}),this._options=e}watch(e,t){this._watches.set(e,{startedAt:Date.now(),waited:0,retries:0,resend:t}),this._timer===void 0&&(this._last=Date.now(),this._timer=setInterval(this._tick,Nx))}resendNow(e){const t=this._watches.get(e);t&&(t.waited=0,t.resend())}giveUpNow(e){const t=this._watches.get(e);this._watches.delete(e),this._options.onGiveUp(e,t?.retries??0)}dispose(){this._watches.clear(),this._stop()}_stop(){this._timer!==void 0&&(clearInterval(this._timer),this._timer=void 0)}},Dd=class{constructor(){A(this,"_changes",null),A(this,"_typedAt",null),A(this,"_selection",null),A(this,"_closesStep",!1)}get(){return this._changes}hasChanges(){return!!this._changes?.length}add(e){this.hasChanges()||(this._selection=null);const t=Ct(this._changes,e);this._changes=t.length?t:null;const n=Date.now();this._typedAt=this._changes?{from:this._typedAt?.from??n,to:n}:null}clear(){this._changes=null,this._typedAt=null,this._selection=null,this._closesStep=!1}closeStep(){this._closesStep=!0}closesStep(){return this._closesStep}replace(e){this._changes=e.length?e:null,this._selection=null,this._changes||(this._typedAt=null)}typedAt(){return this._typedAt}selection(){return this._selection}noteSelection(e,t){this.hasChanges()&&(this._selection=t?e:this._selection&&{before:this._selection.before,after:e.after})}takeFrom(e){this._changes=e._changes,this._typedAt=e._typedAt,this._selection=e._selection,this._closesStep=e._closesStep,e.clear()}absorb(e){const t=this._typedAt,n=e._typedAt,r=this.hasChanges()?this._selection&&e._selection&&{...this._selection,after:e._selection.after}:e._selection;e._changes&&this.add(e._changes),this._closesStep=e._closesStep,this._selection=this._changes?r:null,this._changes&&(this._typedAt=t&&n?{from:Math.min(t.from,n.from),to:Math.max(t.to,n.to)}:n??t)}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)}}},vy=60;function Ox(e,t){const n=Xg(e,t);if(!n)return;const r=n.start;return{offset:r,ownLength:e.length,cachedLength:t.length,own:e.substring(r,r+vy),cached:t.substring(r,r+vy)}}var Rx=64,Mx=class extends ve{constructor(...e){super(...e),A(this,"_onApplyEmitter",this.addDisposable(new he)),A(this,"_onEmptyEmitter",this.addDisposable(new he)),A(this,"_dispatched",[]),A(this,"_echoed",new Set),A(this,"_revertedAwaiting",new Set),A(this,"onApply",this._onApplyEmitter.event),A(this,"onEmpty",this._onEmptyEmitter.event)}_emit(e){e.length&&this._onApplyEmitter.fire(e),this.hasDispatched()||this._onEmptyEmitter.fire()}hasDispatched(){return!!this._dispatched.length}isInFlight(e){return this._dispatched.some(t=>t.changeId===e)}hasRevertedAwaiting(){return this._revertedAwaiting.size>0}revertedAwaitingIds(){return new Set(this._revertedAwaiting)}awaitingIds(){return[...this._dispatched.flatMap(e=>e.changeId===void 0?[]:[e.changeId]),...this._revertedAwaiting]}isRevertedAwaiting(e){return this._revertedAwaiting.has(e)}forgetReverted(e){for(const t of e)this._revertedAwaiting.delete(t)}wasEchoed(e){return e!==void 0&&this._echoed.has(e)}countDispatched(){return this._dispatched.reduce((e,t)=>e+t.textChanges.length,0)}_remember(e){this._echoed.add(e),this._echoed.size>Rx&&this._echoed.delete(this._echoed.values().next().value)}append(e,t){this._dispatched.unshift({changeId:t,textChanges:e})}apply(e,t,n=!1,r=[e]){const o=t===void 0?-1:this._dispatched.findIndex(i=>i.changeId===t);if(t!==void 0&&(this._remember(t),this._revertedAwaiting.delete(t)),o>=0){this._confirmEcho(o,e);return}n&&this._rebaseDispatched(r)||this._applyExternal(e)}_rebaseDispatched(e){const t=[...this._dispatched].reverse().map(r=>({...r}));let n=[];for(const r of e){let o=r;for(const i of t){const s=Ga(i.textChanges,o,"after"),a=s&&Ga(o,i.textChanges,"before");if(!s||!a)return!1;i.textChanges=s,o=a}n=Ct(n,o)}return this._dispatched=t.reverse(),this._emit(n),!0}_confirmEcho(e,t){const[n]=this._dispatched.splice(e,1);this._emit(Ct(Rn(n.textChanges),t))}_applyExternal(e){let t=[];for(const n of this._dispatched)t=Ct(t,Rn(n.textChanges)),n.changeId!==void 0&&this._revertedAwaiting.add(n.changeId);this._dispatched=[],this._emit(Ct(t,e))}clear(){const e=this.hasDispatched();this._dispatched=[],this._revertedAwaiting.clear(),e&&this._onEmptyEmitter.fire()}},Px=class fA extends ve{constructor(t=""){super(),A(this,"_text",void 0),this._text=t}getText(t){const n=FL(this,t);return n?this._text.substring(n.start,n.end):""}getLength(){return this._text.length}clone(){return new fA(this._text)}},il=class mA extends Px{constructor(t=""){super(t),A(this,"_eventQueue",void 0),A(this,"_lockCounter",0),A(this,"_onChangeEmitter",this.addDisposable(new he)),A(this,"_onChangedEmitter",this.addDisposable(new he)),A(this,"onChanged",this._onChangedEmitter.event)}applyEdits(t,n){if(n=n.flatMap(r=>jL(this,r)),n.length){const r=Po(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=qL(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=Ct(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 mA(this._text)}};function Ey(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function sl(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 Ix(e){return(t,n,r)=>sl(t)?e(t,n,r):!1}function Dx(e){return t=>sl(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function Bx(e){return(t,n,r)=>sl(t)?Ey(t)?e(t,n,r):t:!1}function Hx(e){return t=>{const n=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return sl(n)?Ey(n)?e(t):t:!1}}function Fx(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function Bd(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 $x(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 Wx=8,qx=class{constructor(){A(this,"_byKey",Object.create(null)),A(this,"_byValue",Object.create(null))}getOrCreateByKey(e){let t=this._byKey[e];return t===void 0&&(t=$x(Wx),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},al=new qx;function Sy(e,t){return t!==void 0&&!Bd(e,t)?`%|{${al.getOrCreateByKey(e)}}|%`:e}function zx(e){const t=al.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function Ke(e,t,n){return t!==void 0?Bd(e,t)?e:`%|{${al.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function Ux(e){return e.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function qe(e){return e.startsWith("<!--")&&e.endsWith("-->")?Ux(e.slice(4,-3)):e}function jx(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 Vx(e,t,n){return t!==void 0?Bd(e,t)?e:`%|{${al.getOrCreateByKey(e)}}|%`:n||Fx(e)||jx(e)?`<!--${e}-->`:e}var Qr=Ix(Ke),Jr=Dx(qe),Gx=Bx(Ke),Xx=Hx(qe),Kx=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",zx),e.escape("@{","}",Ke,!0).unescape("<!--@{","}-->",qe,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",Sy,!0),e.escape("{{","}}",Sy,!0),e.createSyntax("brace-percent").escape("{%","%}",Ke).unescape("<!--{%","%}-->",qe),e.createSyntax("brace-hash").escape("{#","#}",Ke).unescape("<!--{#","#}-->",qe),e.createSyntax("proscript").escape("[%","%]",Vx,!0).unescape("<!--[%","%]-->",qe,!0),e.createSyntax("getresponse").escape("[[IF","]]",Ke).escape("[[if","]]",Ke).escape("[[ELSE]]","",Ke).escape("[[else]]","",Ke).escape("[[ENDIF]]","",Ke).escape("[[endif]]","",Ke).unescape("<!--[[IF","]]-->",qe).unescape("<!--[[if","]]-->",qe).unescape("<!--[[ELSE]]","-->",qe).unescape("<!--[[else]]","-->",qe).unescape("<!--[[ENDIF]]","-->",qe).unescape("<!--[[endif]]","-->",qe),e.createSyntax("expert-sender").escape("<if",">",Ke).escape("</if",">",Ke).escape("<else",">",Ke).escape("</else",">",Ke).escape("<var ",">",Ke,!0).unescape("<!--<if ",">-->",qe).unescape("<!--</if",">-->",qe).unescape("<!--<else ",">-->",qe).unescape("<!--</else",">-->",qe).unescape("<!--<var",">-->",qe,!0),e.createSyntax("velocity").escape("#if",")",Qr).escape("#elseif",")",Qr).escape("#else","",Ke).escape("#foreach",")",Qr).escape("#macro",")",Qr).escape("#set",")",Gx,!0).escape("#parse",")",Qr).escape("#include",")",Qr).escape("#evaluate",")",Qr).escape("#end","",Ke).escape("#break","",Ke).escape("#stop","",Ke).unescape("<!--#macro","-->",Jr).unescape("<!--#if","-->",Jr).unescape("<!--#elseif","-->",Jr).unescape("<!--#else","-->",qe).unescape("<!--#foreach","-->",Jr).unescape("<!--#parse","-->",Jr).unescape("<!--#include","-->",Jr).unescape("<!--#evaluate","-->",Jr).unescape("<!--#end","-->",qe).unescape("<!--#break","-->",qe).unescape("<!--#stop","-->",qe).unescape("<!--#set","-->",Xx,!0),e.createSyntax("mailchimp").escape("*|","|*",Ke).unescape("<!--*|","|*-->",qe)},wy="bare",Hd=new Map;function Yx(e){for(const t of Object.keys(e)){const n=e[t];n&&Hd.set(t,n)}}function Zx(e){return e?Hd.get(e)??wy:wy}function Qx(){Hd.clear()}function _y(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 is(e,t){return e.start<t.end&&t.start<e.end}function Cy(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:h,isVariable:f}of i){if(r?(l.insideAttributeValue=!0,l.attributeQuoteChar='"'):_y(e,c,u.start,l),c=u.end,a.some(T=>is(T,u)))continue;const g=l.insideAttributeValue?l.attributeQuoteChar??"":void 0,E=e.substring(u.start,u.end),w=d(E,g,l.insideTag);w!==!1&&w!==E&&(s.push({range:u,text:w,overrideBuiltins:m,syntax:h,isVariable:f}),a.push(u))}return s.sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end)}function Jx(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 Fd(e,t,n,r,o=!1){const i=[];if(n&&(t=t.filter(c=>c.isVariable)),!t.length)return i;const s=Jx(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='"'):_y(e,l,u,a),l=u;const h=a.insideAttributeValue?a.attributeQuoteChar??"":void 0;let f=!1;for(const{mapFn:g,value:E,syntax:w,isVariable:T}of m){let L=u+d.length,y=e.indexOf(E,L);for(;y!==-1;){let p=y,v=u+d.length,C=0;for(;p!==-1;){const x=e.indexOf(d,v);if(x!==-1&&x<p)C++,v=x+d.length,p=e.indexOf(E,v);else if(C>0)C--,v=p+E.length,p=e.indexOf(E,v);else break}if(p<0)break;const b=p+E.length,S=e.substring(u,b),_=g(S,h,a.insideTag);if(_===!1){L=y+Math.max(E.length,1),y=e.indexOf(E,L);continue}(o||_!==S)&&i.push({range:{start:u,end:b},text:o?S:_,syntax:w,isVariable:T});const k=s.findIndex(({start:x})=>x>=b);k>c?c=k-1:c=s.length,f=!0;break}if(f)break}}return i}function ll(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 Ty=class{constructor(e=Kx){A(this,"_disposables",[]),A(this,"_escapes",[]),A(this,"_unescapes",[]),A(this,"_escapeMatchers",[]),A(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=Fd(e,this._escapes,t,n),o=Cy(e,this._escapeMatchers,t,n),i=o.filter(l=>l.overrideBuiltins).map(l=>l.range),s=r.filter(l=>!i.some(c=>is(c,l.range))),a=o.filter(l=>l.overrideBuiltins||!s.some(c=>is(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=Fd(e,this._unescapes,t),r=Cy(e,this._unescapeMatchers,t,!1),o=r.filter(a=>a.overrideBuiltins).map(a=>a.range),i=n.filter(a=>!o.some(l=>is(l,a.range))),s=r.filter(a=>a.overrideBuiltins||!i.some(l=>is(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=>Zx(o)==="html-comment";return this._collectRevertMappings(e,t).filter(o=>o.isVariable||!r(o.syntax))}getDetectedMappings(e,t,n){return Fd(e,this._escapes,t,n,!0)}getEscapedText(e,t){return ll(e,this.getMappings(e,t))}getUnescapedText(e,t,n){return ll(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=ll(o,this._collectRevertMappings(o).filter(i=>n(i.syntax)==="bare"))),r.includes("html-comment")&&(o=ll(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()}},eO=1e4,Ay=3,tO=yL+ld;function nO(e){return(e??[]).reduce((t,n)=>t+n.oldLength,0)}function rO(e,t){return e.stack.closesStep()?!1:e.undoStop===t.undoStop||e.serviceRemoval+t.serviceRemoval<=200}var oO=class extends il{constructor(){super(),A(this,"_editStack",new Dd),A(this,"_frozenStack",new Dd),A(this,"_frozenUndoStop",!0),A(this,"_barrierSends",[]),A(this,"_barrierResolves",[]),A(this,"_queuedBarriers",[]),A(this,"_editLog",[]),A(this,"_entityId",void 0),A(this,"_versionController",this.addDisposable(new Mx)),A(this,"_beforeSaveEmitter",this.addDisposable(new sL)),A(this,"_onReadyEmitter",this.addDisposable(new he)),A(this,"_onEntitySetEmitter",this.addDisposable(new he)),A(this,"_onPendingSentEmitter",this.addDisposable(new he)),A(this,"_onHistoryAnswerEmitter",this.addDisposable(new he)),A(this,"_onHistoryActionEmitter",this.addDisposable(new he)),A(this,"_onHistoryActionSentEmitter",this.addDisposable(new he)),A(this,"_onHistoryActionAnsweredEmitter",this.addDisposable(new he)),A(this,"_canvasEdits",0),A(this,"_nextActionId",1),A(this,"_historyAction",null),A(this,"_cache",new il),A(this,"beforeSave",this._beforeSaveEmitter.event),A(this,"_reverting",!1),A(this,"_inited",!1),A(this,"_nextChangeId",1),A(this,"_originId",`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`),A(this,"_rev",null),A(this,"_sealed",[]),A(this,"_saveHeld",!1),A(this,"_releasing",!1),A(this,"_applyingRemote",!1),A(this,"collectCanvasEdits",()=>Promise.resolve()),A(this,"_echoLost",!1),A(this,"_reportedText",null),A(this,"_reportId",0),A(this,"_lostChangeIds",new Set),A(this,"_recoveryTimer",void 0),A(this,"_recoveryOverdue",!1),A(this,"_coveredRev",null),A(this,"_awaitingRefill",!1),A(this,"_resyncing",!1),A(this,"_onEchoLostEmitter",this.addDisposable(new he)),A(this,"_onEchoRecoveredEmitter",this.addDisposable(new he)),A(this,"_echoWatchdog",this.addDisposable(new xx({isAwaiting:e=>this._versionController.isInFlight(e)||this._versionController.isRevertedAwaiting(e),onGiveUp:(e,t)=>this._onEchoLost(e,t)}))),A(this,"_handleUpdateEntity",e=>{const{edits:t,guid:n,changeId:r,rev:o}=e;if(e.resync&&n===this._entityId){const{reportId:i,textFingerprint:s}=e.resync,a=this._awaitingRefill?null:this._reportedText;return a!==null&&i===this._reportId?this._applyResync(e,s,a):void 0}if(this._versionController.wasEchoed(r)||this._isCovered(e)){e.historyAnswer?.actionId!==void 0&&n===this._entityId&&this._takeHistoryAnswer({actionId:e.historyAnswer.actionId});return}if(n===this._entityId){this._reportSyncDrift("update-entity");const i=this._onRemoteChange(t,r,o);return e.historyAnswer&&this._takeHistoryAnswer(e.historyAnswer),i}}),A(this,"_handleSetEntity",e=>{this._reportSyncDrift("set-entity"),Qx(),Yx(e.templateDirectivesPolicy??{});const t=e.guid===this._entityId,n=this._unsentLayers().some(r=>r.hasChanges());this._entityId=e.guid,this._onEntitySetEmitter.fire(e.guid),this._historyAction=null,this._editStack.clear(),this._sealed=[],this._releasing=!1,this._clearFrozen(),this._finishBarrier(t&&!this._holdsUnsent()&&!n),this._versionController.clear(),this._saveHeld=!1,this._awaitingRefill=!1,this._clearEchoLost(),this._onPendingSentEmitter.fire(),this._replaceText(e.html),this._rev=e.rev??null,this._coveredRev=this._rev,this._onReadyEmitter.fire()}),A(this,"_onRemoteChange",(e,t,n)=>t===void 0&&this._echoLost&&e.every(r=>!r.length)?this._whenNoneDispatched():new Promise((r,o)=>{const i=this._applyGroupsToCache(e),s=i.reduce((c,u)=>Ct(c,u),[]);this._rev=n??null;const a=this._versionController.revertedAwaitingIds();this._versionController.apply(s,t,n!==void 0&&!this._echoLost,i);const l=[...this._lostChangeIds].filter(c=>a.has(c)&&this._versionController.isRevertedAwaiting(c)&&this.hasChanges());!this._versionController.hasDispatched()&&!this._awaitingRefill&&!l.length&&(this._versionController.forgetReverted(this._lostChangeIds),this._clearEchoLost(),this._flushPendingSave()),this._whenNoneDispatched().then(r)})),A(this,"onReady",this._onReadyEmitter.event),A(this,"onEntitySet",this._onEntitySetEmitter.event),A(this,"onHistoryAnswer",this._onHistoryAnswerEmitter.event),A(this,"onHistoryAction",this._onHistoryActionEmitter.event),A(this,"onHistoryActionSent",this._onHistoryActionSentEmitter.event),A(this,"onHistoryActionAnswered",this._onHistoryActionAnsweredEmitter.event),this.addDisposable(G.addListenerAsync(Ae.SANDBOX_SET_ENTITY,this._handleSetEntity)),this.addDisposable(G.addListenerAsync(Ae.SANDBOX_UPDATE_ENTITY,this._handleUpdateEntity)),this.addDisposable(G.addListenerAsync(Ae.SANDBOX_CANVAS_SYNCED,e=>this.whenSynced(e?.applied))),this._versionController.onApply(this._onApply.bind(this)),this.addDisposable({dispose:()=>clearTimeout(this._recoveryTimer)})}loadState(e){this._entityId=e.entityId;const t=[[{range:Zi(this._cache),text:e.text}]];this._onRemoteChange(t)}get entityId(){return this._entityId}saveState(){return{entityId:this._entityId,text:this.getText()}}_onApply(e){const t=this._unsentLayers();if(t.every(i=>!i.hasChanges())){super.applyEdits(nr,Zr(e));return}let n=e;const r=[];let o=-1;for(const[i,s]of t.entries()){const a=s.get();if(!a){r.push(null);continue}const l=Ga(a,n,"after"),c=l&&Ga(n,a,"before");if(!l||!c){o=i;break}r.push(l),n=c}if(o>=0){this._dropLayersFrom(o,t,n),t.slice(0,o).forEach((i,s)=>{const a=r[s];a&&i.replace(a)}),this._compactSealed();return}try{this._applyingRemote=!0,super.applyEdits(nr,Zr(n))}finally{this._applyingRemote=!1}t.forEach((i,s)=>{const a=r[s];a&&i.replace(a)}),this._compactSealed()}_dropLayersFrom(e,t,n){const r=t.slice(e).reduce((a,l)=>Ct(a,l.get()??[]),[]),o=[],i=[],s=Math.max(e-1,0);this._sealed.splice(Math.max(e-1-this._queuedBarriers.length,0));for(const a of this._queuedBarriers.splice(s))o.push(...a.sends),i.push(...a.resolves);e===0&&(this._frozenStack.clear(),o.unshift(...this._barrierSends.splice(0)),i.unshift(...this._barrierResolves.splice(0))),this._editStack.clear(),this._setSaveHeld(this._saveHeld&&this._sealed.length>0),super.applyEdits(nr,Zr(Ct(Rn(r),n))),this._runBarrier(o,i,!1)}_unsentLayers(){return[this._frozenStack,...this._queuedBarriers.map(e=>e.stack),...this._sealed.map(e=>e.stack),this._editStack]}_unsentChanges(){return this._unsentLayers().reduce((e,t)=>Ct(e,t.get()??[]),[])}_textWithoutUnsent(){return DL(this.getText(),Rn(this._unsentChanges()))}isApplyingRemote(){return this._applyingRemote}_flushPendingSave(){this._versionController.hasRevertedAwaiting()||(this._releaseBarrier(),this._sealed.length&&(this._sendSealed(),this._onPendingSentEmitter.fire()))}_setSaveHeld(e){const t=this._saveHeld&&!e;this._saveHeld=e,t&&this._onPendingSentEmitter.fire()}_isSent(e=!1){return!this._frozenStack.hasChanges()&&(!this._sealed.length||e&&this._saveHeld)}_seal(e){if(this._editStack.hasChanges()){const t=e?0:nO(this._editStack.get()),n=new Dd;n.takeFrom(this._editStack),this._sealed.push({stack:n,undoStop:e,serviceRemoval:t})}this._compactSealed()}_compactSealed(){const e=this._sealed.length>0,t=[];for(const n of this._sealed){const r=t[t.length-1];if(n.stack.hasChanges()){if(!r||!rO(r,n)){t.push(n);continue}r.stack.absorb(n.stack),r.undoStop||(r.undoStop=n.undoStop),r.serviceRemoval+=n.serviceRemoval,r.stack.hasChanges()||t.pop()}}this._sealed=t,e&&!t.length&&(this._releasing=!1,this._saveHeld=!1,this._onPendingSentEmitter.fire())}_sendSealed(e=!1,t=!1){if(this._compactSealed(),this._rev!==null&&(this._awaitsEcho()||this._frozenStack.hasChanges()||this._holdsUnsent()))return!0;const n=e||this._sealed.some(o=>o.undoStop);if(!t&&!this._releasing&&this._beforeSaveEmitter.fire(n)===!1)return this._setSaveHeld(this._sealed.length>0),!1;const r=this._entityId;if(!r)return!1;for(;this._sealed.length;){const[o]=this._sealed.splice(0,1),i=o?.stack.get()?.flatMap(s=>sb(s));if(o&&i?.length&&(this._dispatch(r,i,o.undoStop,o.stack.typedAt(),o.stack.selection(),o.stack.closesStep()),this._rev!==null))break}return this._compactSealed(),this._setSaveHeld(!1),!0}whenSent(e=!1){return this._isSent(e)?Promise.resolve():new Promise(t=>{const n=this._onPendingSentEmitter.event(()=>{this._isSent(e)&&(n.dispose(),t())})})}_countUnsent(){const e=this._unsentLayers().reduce((t,n)=>t+(n.get()?.length??0),0);return this._versionController.countDispatched()+e}_onEchoLost(e,t){if(this._lostChangeIds.add(e),this._echoLost)return;this._echoLost=!0,this._armRecoveryDeadline();const n=this._countUnsent(),r=this._textWithoutUnsent(),o=++this._reportId;this._reportedText=r,_r("echo-timeout",()=>({guid:this._entityId,at:"update-entity",unsent:n,textFingerprint:Kg(r),canvasText:r,reportId:o,dropsCovered:!0,originId:this._originId})),this._onEchoLostEmitter.fire()}holdsTypedEdits(){return this._frozenStack.hasChanges()}hasEditsAfterBoundary(){return this._editStack.hasChanges()||this._sealed.length>0}markHistoryAction(){const e=this._nextActionId++;return this._historyAction={id:e,edits:this._canvasEdits,answered:!1},this._onHistoryActionEmitter.fire(e),e}noteHistoryActionSent(e){this._onHistoryActionSentEmitter.fire(e)}noteSelection(e,t){const n=this._sealed.length>0&&this._editStack.selection()===null;this._editStack.noteSelection(e,t||n)}_takeHistoryAnswer({actionId:e,selection:t}){const n=this._historyAction,r=e!==void 0,o=r&&n?.id===e?n:void 0;o&&(o.answered=!0);const i=r?o?.edits===this._canvasEdits:!n||n.answered;t&&i&&!this.hasChanges()&&!this._awaitsEcho()&&!this._holdsUnsent()&&this._onHistoryAnswerEmitter.fire({selection:t,own:r}),o&&this._onHistoryActionAnsweredEmitter.fire(o.id)}_holdsUnsent(){return this._echoLost||this._awaitingRefill}async whenSynced(e){const t=new he;let n=!1;const r=setTimeout(()=>{n=!0,t.fire()},tO),o=e!==void 0&&e.guid!==this._entityId;try{return e&&!o&&this._settleByReceipt(e),await this.collectCanvasEdits(),o?this._syncState():await this._syncedBefore(t,()=>n)}finally{clearTimeout(r),t.dispose(),this._releasing=!1}}async _syncedBefore(e,t){const n=()=>({synced:!1,unsent:this._countUnsent()});let r=0;if(t())return this._syncState();for(;;){if(this._echoLost){if(!await this._awaitEchoRecovery(e)||t())return n();continue}if(this._saveHeld&&r++<Ay&&(this._releasing=!0,this._sendSealed(!0,!0)),await this._awaitAny([this._onEchoLostEmitter.event,e.event],this.whenSent(!this._releasing)),t())return n();if(!this._echoLost&&!(this._sealed.length>0&&!this._saveHeld)){if(this._saveHeld){if(r<Ay)continue;return n()}if(!this._versionController.hasDispatched())return{synced:!0,unsent:0};if(await this._awaitAny([this._versionController.onEmpty,this._onEchoLostEmitter.event,e.event]),t())return n()}}}_syncState(){return this._hasUnsynced()?{synced:!1,unsent:this._countUnsent()}:{synced:!0,unsent:0}}_settleByReceipt(e){const t=e.originId===void 0||e.originId===this._originId?e.changeId:0;for(const n of this._versionController.awaitingIds())n<=t?this._echoWatchdog.giveUpNow(n):this._echoWatchdog.resendNow(n)}_hasUnsynced(){return this._holdsUnsent()||this._sealed.length>0||this._frozenStack.hasChanges()||this._versionController.hasDispatched()}_awaitAny(e,t){return new Promise(n=>{const r=()=>{o.forEach(i=>i.dispose()),n()},o=e.map(i=>i(r));t?.then(r)})}_awaitEchoRecovery(e){return new Promise(t=>{const n=setTimeout(()=>i(!1),ld),r=this._onEchoRecoveredEmitter.event(()=>i(!0)),o=e.event(()=>i(!1)),i=s=>{clearTimeout(n),r.dispose(),o.dispose(),t(s)}})}_armRecoveryDeadline(){clearTimeout(this._recoveryTimer),this._recoveryTimer=setTimeout(()=>{this._recoveryOverdue=!0,this._finishBarrier(!1)},ld)}_connectionLost(){return this._recoveryOverdue||this._awaitingRefill}_clearEchoLost(){const e=this._echoLost;clearTimeout(this._recoveryTimer),this._recoveryOverdue=!1,this._echoLost=!1,this._reportedText=null,this._lostChangeIds.clear(),e&&this._onEchoRecoveredEmitter.fire()}_isCovered({guid:e,rev:t,changeId:n}){return this._coveredRev===null||t===void 0||e!==this._entityId||t>this._coveredRev?!1:!(n!==void 0&&(this._versionController.isInFlight(n)||this._versionController.isRevertedAwaiting(n)))}_applyResync({edits:e,rev:t},n,r){this._versionController.clear();try{this._resyncing=!0,this._cache.applyEdits(nr,[{range:Zi(this._cache),text:r}]),this._rev=t??null,this._applyToCache(e),this._versionController.apply(this._changesToCache())}catch{}finally{this._resyncing=!1}const o=Kg(this._cache.getText());if(o.length!==n.length||o.hash!==n.hash){this._awaitingRefill=!0,this._finishBarrier(!1),_r("resync-failed",()=>({guid:this._entityId,textFingerprint:o}));return}this._coveredRev=this._rev,this._clearEchoLost(),this._flushPendingSave(),this._onReadyEmitter.fire()}_replaceText(e){this._cache.applyEdits(nr,[{range:Zi(this._cache),text:e}]),super.applyEdits(nr,[{range:Zi(this),text:e}])}_reportSyncDrift(e){if(this.hasChanges()||this._versionController.hasDispatched())return;const t=Ox(this.getText(),this._cache.getText());if(t){const{offset:n,ownLength:r,cachedLength:o}=t;_r("host-copy-drift",()=>({at:e,text:{offset:n,ownLength:r,cachedLength:o}}))}}_changesToCache(){const e=this._textWithoutUnsent(),t=this._cache.getText(),n=Xg(e,t);if(!n)return[];const{start:r,fromEnd:o,toEnd:i}=n;return[new Ut(r,e.slice(r,o),r,t.slice(r,i))]}_applyToCache(e){return this._applyGroupsToCache(e).reduce((t,n)=>Ct(t,n),[])}_applyGroupsToCache(e){const t=[];for(const n of e){const r=n.reverse();t.push(Po(r,this._cache)),this._cache.applyEdits(nr,r)}return t}_whenNoneDispatched(){return new Promise(e=>{if(!this._versionController.hasDispatched()){this._onReadyEmitter.fire(),e();return}const t=this._versionController.onEmpty(()=>{t.dispose(),e()})})}applyEdits(e,t){if(!this._reverting){const n=Po(t,this);n.length&&this._canvasEdits++,this._editStack.add(n),super.applyEdits(e,t),this._editLog.push(t)}}correctOffset(e,t){const n=this._unsentLayers();return t?n.reduce((r,o)=>o.correctOffset(r,!0),e):n.reduceRight((r,o)=>o.correctOffset(r),e)}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}_awaitsEcho(){return this._versionController.hasDispatched()||this._versionController.hasRevertedAwaiting()}saveChanges(e=!0,t=!1){return this._reverting?!1:(this._seal(e),this._sendSealed(e,t))}closeStep(){this._editStack.closeStep()}_dispatch(e,t,n,r,o=null,i=!1){const s=this._nextChangeId++;this._versionController.append(t,s);const a={guid:e,pushUndoStop:n,edits:Zr(t),changeId:s,originId:this._originId,...this._rev!==null?{baseRev:this._rev}:{},...r?{typedAt:r}:{},...o?{selection:o}:{},...i?{closesStep:i}:{}},l=()=>G.send(Ae.APPLICATION_UPDATE_ENTITY,a);l(),this._echoWatchdog.watch(s,()=>{this._versionController.isInFlight(s)&&l()})}async sendAfterCurrentEdits(e,t=!1){if(this._connectionLost()&&this.hasChanges())return!1;this._seal(t);const n=this._frozenStack.hasChanges();if(!n&&!this._sealed.length)return e(),!0;const r=this._rev!==null&&(this._awaitsEcho()||this._holdsUnsent());return!n&&!r&&(this._sendSealed(),!this._sealed.length||this._saveHeld)?(e(),!0):new Promise(o=>this._freezeSealed(e,o))}_freezeSealed(e,t){this._compactSealed();for(const{stack:r,undoStop:o}of this._sealed.splice(0))this._frozenStack.hasChanges()||this._queuedBarriers.length?this._queuedBarriers.push({stack:r,undoStop:o,sends:[],resolves:[]}):(this._frozenStack.takeFrom(r),this._frozenUndoStop=o);this._setSaveHeld(!1);const n=this._queuedBarriers[this._queuedBarriers.length-1];(n?.sends??this._barrierSends).push(e),(n?.resolves??this._barrierResolves).push(t)}_releaseBarrier(){const e=this._frozenStack.get();if(!e)return;const t=this._frozenStack.typedAt(),n=this._frozenStack.selection(),r=this._frozenStack.closesStep();this._frozenStack.clear(),this._entityId&&this._dispatch(this._entityId,e.flatMap(a=>sb(a)),this._frozenUndoStop,t,n,r);const o=this._barrierSends,i=this._barrierResolves,s=this._queuedBarriers.shift();this._barrierSends=s?.sends??[],this._barrierResolves=s?.resolves??[],s&&(this._frozenStack.takeFrom(s.stack),this._frozenUndoStop=s.undoStop),this._runBarrier(o,i,!0)}_clearFrozen(){this._frozenStack.clear();for(const e of this._queuedBarriers.splice(0))this._barrierSends.push(...e.sends),this._barrierResolves.push(...e.resolves)}_finishBarrier(e){const t=this._barrierSends,n=this._barrierResolves;this._barrierSends=[],this._barrierResolves=[];for(const r of this._queuedBarriers)t.push(...r.sends.splice(0)),n.push(...r.resolves.splice(0));this._runBarrier(t,n,e)}_runBarrier(e,t,n){n&&e.forEach(r=>r()),t.forEach(r=>r(n)),this._onPendingSentEmitter.fire()}saveChangesAsync(e=!0){return new Promise(t=>{if(this.saveChanges(e),this._entityId||!this.hasChanges()||this._saveHeld){t();return}const n=setTimeout(()=>{r.dispose(),this._reportSaveTimeout(),t()},eO),r=this.onReady(()=>{r.dispose(),clearTimeout(n),t()})})}_reportSaveTimeout(){_r("save-timeout",()=>({}))}hasChanges(){return this._editStack.hasChanges()||this._frozenStack.hasChanges()||this._sealed.length>0}},iO=class extends Ty{constructor(e,t){super(),A(this,"_baseDocument",void 0),A(this,"_mappedDocument",void 0),A(this,"_mappings",[]),A(this,"_cachedMappedDocument",new il),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=Po(this.getMappings(n),this._baseDocument),o=Rn(this._mappings);if(t=Ct(o,t),t=Ct(t,r),this._mappings=r,t.length){const i=Zr(t);this._mappedDocument.applyEdits(e,Xa(i))}}}correctOffset(e,t){const n=t?this._mappings:Rn(this._mappings),r=qu(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=Rn(this._mappings).find(({oldPosition:n,oldEnd:r})=>e>=n&&e<r);return t?{start:t.oldPosition,end:t.oldEnd}:null}hasMappedReplacementRangeInRange(e){return Rn(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 Qi(e,n)}unescape(e){const t=this.getRevertMappings(e);return Qi(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=nr){const t=this._baseDocument.getText(),n=this.getMappings(t),r=Qi(t,n);this._mappings=Po(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=Po(this.getRevertMappings(n),this._mappedDocument),o=this._mappings;if(t=Ct(o,t),t=Ct(t,r),this._mappings=Rn(r),t.length){const i=Zr(t);this._baseDocument.applyEdits(e,Xa(i))}}}},sO="input, textarea, select, .monaco-editor",aO=/^(Arrow(Left|Right|Up|Down)|Home|End|PageUp|PageDown|Tab)$/;function ky(e,t){return e?.node===t?.node&&e?.offset===t?.offset}function lO(e,t){return ky(e?.anchor,t?.anchor)&&ky(e?.focus,t?.focus)}function cl(){const e=document.getSelection();if(!(!e?.rangeCount||!e.anchorNode||!e.focusNode))return{anchor:{node:e.anchorNode,offset:e.anchorOffset},focus:{node:e.focusNode,offset:e.focusOffset}}}var cO=class extends ve{constructor(e,t,n){super(),A(this,"_htmlDocument",void 0),A(this,"_mapping",void 0),A(this,"_remoteDocument",void 0),A(this,"_mark",void 0),A(this,"_pending",void 0),A(this,"_actionMark",void 0),A(this,"_moved",!1),this._htmlDocument=e,this._mapping=t,this._remoteDocument=n,this._listen(window,"keydown",!0),this._listen(window,"beforeinput",!0),this._listen(document,"selectionchange",!1,()=>{this._moved||(this._moved=!lO(this._mark,this._actionMark))}),this._listen(window,"pointerdown",!0,()=>{this._moved=!0}),this._listen(window,"keydown",!1,r=>{this._moved||(this._moved=!r.defaultPrevented&&aO.test(r.key??""))}),this.addDisposable(e.beforeTextCommit(()=>this._beforeCommit())),this.addDisposable(e.onTextCommit(()=>this._afterCommit())),this.addDisposable(n.onHistoryAnswer(r=>this._restore(r))),this.addDisposable(n.onHistoryAction(()=>{this._actionMark=cl(),this._moved=!1}))}_listen(e,t,n,r){const o=i=>{this._mark=cl(),r?.(i)};e.addEventListener(t,o,n),this.addDispose(()=>e.removeEventListener(t,o,n))}_beforeCommit(){this._pending={before:this._toText(this._mark),opened:!this._remoteDocument.hasEditsAfterBoundary()}}_afterCommit(){const e=this._pending;if(this._pending=void 0,this._mark=cl(),e){const t={before:e.before,after:this._toText(this._mark)};this._remoteDocument.noteSelection(t,e.opened)}}_toText(e){const t=e&&this._htmlDocument.pointToOffset(e.anchor),n=e&&this._htmlDocument.pointToOffset(e.focus);if(t===void 0||n===void 0)return;const[r,o]=[this._mapping.correctOffset(t),this._mapping.correctOffset(n)].sort((i,s)=>i-s);return{start:r,end:o}}_toPoint(e){return this._htmlDocument.offsetToPoint(this._mapping.correctOffset(this._remoteDocument.correctOffset(e,!0),!0))}_restore({selection:e,own:t}){if(t&&this._moved||!t&&!document.hasFocus()||document.activeElement?.closest(sO))return;const n=this._toPoint(e.start),r=e.end===e.start?n:this._toPoint(e.end);!n||!r||(document.getSelection()?.setBaseAndExtent(n.node,n.offset,r.node,r.offset),this._mark=cl())}};function uO(e){let t=e.documentElement;return t||(t=e.createElement("html"),e.appendChild(t)),t}function ss(e){let t=e.head;if(!t){t=e.createElement("head");const n=uO(e);n.insertBefore(t,n.firstChild)}return t}function dO(e){const t=Object.create(null),n=e.getAttributeNames();for(const r of n)t[r]=e.getAttribute(r);return t}function fO(e){for(const t of document.querySelectorAll("iframe"))if(t.contentDocument===e.ownerDocument)return t}function mO(e){const t=ss(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 Ly="amp-custom";function hO(e,t){return`em-${e.replaceAll("-","_")}-${t.toLowerCase()}`}function Ny(e,t,n){for(const r of t)if(ns.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(_d(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 ns.isMediaRule(r)&&Ny(e,r.cssRules,n)}function xy(e,t){const n=t.sheet;if(n){const i=new Set;Ny(e,n.cssRules,(s,a)=>{const l=hO(s,a),c=[...n.cssRules],u=`.${l} { ${s}: ${a} }`;return!c.find(d=>ns.isStyleRule(d)&&d.selectorText===`.${l}`)&&!i.has(u)&&(i.add(u),t.innerHTML=`
|
|
4
|
+
.${l} { ${s}: ${a} };
|
|
5
|
+
${t.innerHTML}`),l}),i.size&&(t.innerHTML=`
|
|
6
|
+
${[...i].join(`
|
|
7
|
+
`)};
|
|
8
|
+
${t.innerHTML}`)}const r=t.innerHTML,o=r.replace(/!important/g,"");r!==o&&(t.innerHTML=o)}function pO(e){const t=ss(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(Ly)===""){xy(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=`
|
|
9
|
+
${o.join("")}
|
|
10
|
+
`,i.setAttribute(Ly,""),t.append(i),xy(e,i)}for(const i of n)i.remove()}var $d="<!doctype html>";function gO(e){const t=e.doctype;if(t){if(Tb(t)===$d)return;const n=new DOMParser().parseFromString($d,"text/html").doctype;e.replaceChild(n,t)}else{const n=new DOMParser().parseFromString($d,"text/html").doctype;e.insertBefore(n,e.firstChild)}}async function Oy(e,t={}){const n=document.createElement("amp-img"),r=await IN(e)||void 0,o=[];try{let i=e;for(;i&&_d(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=fO(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={...dO(e),alt:e.alt,width:a,height:s,src:u,layout:c?"responsive":"fixed",...t};for(const d of Object.keys(t))Qn(n,d,t[d])}finally{for(const[i,s]of o)i.style.display=s}return n}async function bO(e,t){const n=[...e.querySelectorAll("img")],r=[];for(const i of n)r.push(Oy(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(Oy(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 yO(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=ss(e),r=e.createElement("meta");r.setAttribute("charset","utf-8"),n.insertBefore(r,n.firstChild)}function vO(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 Ry="https://cdn.ampproject.org/v0",My=`${Ry}.js`,EO=`script[src='${My}']`;function SO(e,t){return`${Ry}/${e.toLowerCase()}-${t}.js`}async function wO(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=ss(e),a=n.createElementFn("script"),l=SO(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(`
|
|
11
|
+
`))}}}var VJ=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),GJ=function(e,t){return new URL(e,t).href},XJ={},Wd=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)})},Py=void 0;async function ul(){return Py||(Py=await Wd(()=>Promise.resolve().then(()=>Iu("./rules.CnnzdMsj.js")).then(e=>e.default),void 0,{}.url))}var qd=new Map;async function _O(){if(!qd.size){const e=await ul(),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))||[];qd.set(o,{...r,priority:n,attrs:new Map([...i,...a].map(l=>[l.name,l]))})}}return qd}var zd=new Map;async function CO(){if(!zd.size){const e=await ul();for(const t of e.declarations)zd.set(t.name,t)}return zd}var TO="$GLOBAL_ATTRS",Ud=new Map;async function AO(){if(!Ud.size){const e=(await ul()).attrLists.find(t=>t.name===TO)?.attrs;if(e)for(const t of e)Ud.set(t.name,t)}return Ud}function kO(e){return Mn(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function Iy(e){return RN(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}function Dy(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--)Dy(i[s],t,n)}if(Mn(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 Cd(e)?o():Io(e)&&(e.textContent?.trim()||e.nextSibling?.textContent?.trim()&&Io(e.nextSibling))&&r()}async function LO(e,t){const n=new Set,r=t.commit,o=h=>t.replaceSelectors(h.toLowerCase());if(t.replaceImages&&await bO(e,r),t.injectExtensions){const h=t.replaceSelectors(EO);if(!e.querySelector(h)){const f=t.createElementFn("script");f.setAttribute("src",My),f.setAttribute("async",""),ss(e).appendChild(f),r?.()}}t.injectRequiredTags&&(vO(e,t.createElementFn,o),gO(e),mO(e),yO(e),r?.()),t.replaceStylesAndLinks&&(pO(e),r?.());const i=await ul(),s=await _O(),a=new Set(t.removeUnsupportedTags?e.querySelectorAll("*"):[]),l=new Map;for(let[h,f]of s)if(!f.deprecation){h=o(h);let g=[...e.querySelectorAll(h)].filter(E=>!l.has(E));f.unique&&g.length&&(g=[g[0]]),t.injectRequiredTags&&f.required&&!g.length&&(g=[...g,t.createElementFn(f.name)]);for(const E of g){if(t.injectRequiredAttributes&&E.getAttribute("on")&&!E.getAttribute("tabindex")&&E.setAttribute("tabindex","0"),t.removeUnsupportedStyles){let T=!1;for(const L of[...E.classList])L.startsWith("i-amphtml")&&(T=!0,E.classList.remove(L));T&&!E.classList.length&&E.removeAttribute("class")}const w=l.get(E);w&&w.priority>f.priority||l.set(E,f)}}r?.();for(const[h,f]of l){if(t.injectExtensions&&f.requiresExtension)for(const w of f.requiresExtension)n.add(w);const g=f.requiredParent?f.requiredParent==="$ROOT"?e:e.querySelector(f.requiredParent):null;g&&(!h.parentNode||t.moveInvalidTagPosition)?g!==h.parentNode&&(f.name==="HEAD"||Mn(g)&&g.tagName==="HEAD"?g.insertBefore(h,g.firstChild):g.appendChild(h)):h.parentNode||e.body.appendChild(h),t.removeUnsupportedTags&&a.delete(h),r?.();const E=await AO();if(t.removeUnsupportedAttributes||t.injectRequiredAttributes){const w=f.attrs,T=t.injectRequiredAttributes?new Set([...w].map(([y,p])=>p).filter(y=>y.required&&y.value)):void 0,L=h.getAttributeNames();for(const y of L){const p=w.get(y)||E.get(y);if(p){if(y==="id"||y==="class"||y==="style"){T?.delete(p);continue}if(t.removeUnsupportedAttributes){const v=h.getAttribute(y);if(p.value&&p.value.indexOf(v)<0){h.removeAttribute(y);continue}if(p.valueRegex&&!new RegExp(p.valueRegex).test(v)){h.removeAttribute(y);continue}if(p.disallowedValueRegex&&new RegExp(p.disallowedValueRegex).test(v)){h.removeAttribute(y);continue}const C=p.valueUrl;if(C){if(v===""){if(!C.allowEmpty){h.removeAttribute(y);continue}}else if(!(v.indexOf("<!--")>0&&v.indexOf("-->")>0)){if(!C.allowRelative)if(v.startsWith("#")||v.startsWith("/")){h.removeAttribute(y);continue}else{const b=C.protocol.length?C.protocol:["https"],S=v.substring(0,v.indexOf(":"));if(S){if(b.indexOf(S)<0){const _=b[0]+v.substring(v.indexOf(":"));if(URL.canParse(_))Qn(h,y,_);else{h.removeAttribute(y);continue}}else if(!URL.canParse(v)){h.removeAttribute(y);continue}}else{const _=b[0]+v;if(URL.canParse(_))Qn(h,y,_);else{h.removeAttribute(y);continue}}}}}}T?.delete(p)}else{if(y==="id"||y==="class"||y==="style")continue;t.removeUnsupportedAttributes&&h.removeAttribute(y)}}if(T)for(const y of T)Qn(h,y.name,y.value[0])}r?.()}t.moveInvalidTagPosition&&(Dy(e,e.body,o),r?.());for(const h of a)h.remove();if(r?.(),t.removeUnsupportedStyles){let g=function(y){const p=y.cssText.replaceAll(/\".*\"/g,"").replaceAll(/\'.*\'/g,"").replaceAll(/\/\*.*\*\/|(-moz-|-ms-|-o-|-webkit-)+\w+(?=:)/g,"").match(/[a-z-]+(?=:[^before|after|hover])/gi)||[];for(const v of p){if(!v)continue;const C=y.getPropertyValue(v);y.getPropertyPriority(v)==="important"&&y.setProperty(v,C);const b=f.get(v);b?b.value?b.value.indexOf(C)<0&&y.removeProperty(v):b.valueRegex&&(new RegExp(b.valueRegex).test(C)||y.removeProperty(v)):y.removeProperty(v)}r?.()},E=function(y){return y.constructor.name==="CSSStyleRule"},w=function(y){return y.constructor.name==="CSSMediaRule"},T=function(y){const p=y.cssRules;for(let v=p.length-1;v>=0;v--){const C=p[v];E(C)?C.selectorText.indexOf("[")>=0||C.selectorText.indexOf(":")>=0?y.deleteRule(v):(g(C.style),C.style.cssText||y.deleteRule(v)):w(C)?(T(C),C.cssRules.length||y.deleteRule(v)):y.deleteRule(v)}};var c=g,u=E,d=w,m=T;const h=e.querySelectorAll("*"),f=await CO();for(const y of h)if(_d(y)){const p=y.getAttribute("style");p&&(g(y.style),y.style.length?y.style.cssText!==p&&y.setAttribute("style",y.style.cssText):y.removeAttribute("style"))}const L=e.querySelector("style[amp-custom]");if(L){const y=L.sheet;y&&(T(y),L.innerHTML=[...y.cssRules].map(p=>p.cssText).join(`
|
|
12
|
+
`)),r?.()}}await wO(e,i.extensions.filter(({name:h})=>n.has(h)),t)}function NO(e,t){return Object.keys(t).reduce((n,r)=>n.replaceAll(r,t[r]),e)}function By(e,t={}){const{correct:n=!0,injectExtensions:r=!0,mappedTags:o={}}=t;return LO(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=>NO(i.toLowerCase(),o),commit:t.commit})}function jd(){G.send(Ae.RELOAD),window.location.reload()}function xO(e){const t=new ve;let n=[];function r(){n=[...new Set([...n,...document.querySelectorAll("script")])].filter(s=>Sk(s)&&e.isInLetter(s));const i=new Set;for(const s of n){const a=(s.src||s.innerHTML).trim();a&&i.add(a)}return i}let o=r();return t.addDisposable(G.addListener(Ae.RELOAD,jd)),t.addDisposable(e.onChange(()=>{let i=r();for(const s of o)i.has(s)||jd();o=i})),t}var dl=[];function OO(e){return dl.push(e),{dispose:()=>{const t=dl.indexOf(e);t!==-1&&dl.splice(t,1)}}}function Vd(e){for(const t of dl){const n=t(e);if(n)return n}return e}function RO(){const e=document.querySelector("[em-edit]");return e?Vd(e):null}var fl=new Set(["img","image","input","video","source","em-replace"]);function Hy(e){const t=e.toLowerCase(),n=fl.has(t);return fl.add(t),{dispose:()=>{n||fl.delete(t)}}}function MO(e){return fl.has(e.toLowerCase())}var as=[];function PO(e){return as.push(e),{dispose:()=>{const t=as.indexOf(e);t!==-1&&as.splice(t,1)}}}function Fy(e){return as.some(t=>t.isPathElement?.(e))}function IO(e,t){let n;for(const r of as){const o=r.caption?.(e,t);o&&(n={...n,...o})}return n}function $y(e){return e.tagName==="TD"&&e===e.closest("amp-accordion")?.querySelector(":scope > section header td")}var DO={isPathElement(e){return e.tagName==="AMP-ACCORDION"||e.tagName==="AMP-CAROUSEL"||$y(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($y(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}}},BO=class extends ve{constructor(...e){super(...e),A(this,"hasAmp",!1)}};function HO(e,t,n=""){for(const r of e.classList)if(r.startsWith(`${t}-`))return r.replaceAll(`${t}-`,"");return n}function FO(e,t,n){const r=HO(e,t);r!==n&&(e.classList.remove(`${t}-${r}`),n&&e.classList.add(`${t}-${n}`))}function $O(){const e=new ve;return e.addDisposable(ZL(t=>t.startsWith("amp"))),e.addDisposable(QL(t=>t==="class"||t==="style")),e}function WO(e){const t=o=>Iy(o)&&e.getOuterHtml(o)!==""||kO(o)||ON(o),n=o=>{if(t(o))return!0;if(Mn(o)||Cd(o)){for(const i of o.querySelectorAll("*"))if(t(i))return!0}return!1},r=new BO;return r.addDisposable(OO(o=>o.closest("amp-img"))),r.addDisposable(PO(DO)),r.addDisposable($O()),r.addDisposable(Hy("amp-img")),r.addDisposable(Hy("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,G.send(Ae.APPLICATION_HAS_AMP,i),setTimeout(()=>{if(i)By(document,{correct:!1});else{const a=[...document.querySelectorAll("script")];for(const l of a)Iy(l)&&l.remove();jd()}})):s&&setTimeout(()=>{By(document,{correct:!1})})})),r.addDisposable(G.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&&(FO(i,"em-amp-show",s==="amp"?"only":s==="html"?"disabled":void 0),e.commit())}}})),r}function qO(e,t){const n=WO(t);return e.inject(rd,n),{service:n,dispose(){n.dispose(),pn(e,rd)}}}var zO={name:"sandbox.amp",provides:[rd],awaits:{services:[K]},setup(e){const{service:t}=qO(e,R(e,K));e.addService(qg,()=>({ampService:t}))}};(function(){"use strict";function e(t,n){var r,o=0,i=t.length,s,a="",l,c,u,d,m,h,f,g,E=!0,w=!1,T;r=arguments.length>1?n:{},typeof r.indent>"u"&&(r.indent=" "),typeof r.openbrace=="string"&&(E=r.openbrace==="end-of-line"),typeof r.autosemicolon=="boolean"&&(w=r.autosemicolon);function L(S){return S===" "||S===`
|
|
13
|
+
`||S===" "||S==="\r"||S==="\f"}function y(S){return S==="'"||S==='"'}function p(S){return l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||"-_*.:#[]".indexOf(S)>=0}function v(){for(var S=h;S>0;S-=1)a+=r.indent}function C(){a=T(a),E?a+=" {":(a+=`
|
|
14
|
+
`,v(),a+="{"),c!==`
|
|
15
|
+
`&&(a+=`
|
|
16
|
+
`),h+=1}function b(){var S;h-=1,a=T(a),a.length>0&&w&&(S=a.charAt(a.length-1),S!==";"&&S!=="{"&&(a+=";")),a+=`
|
|
17
|
+
`,v(),a+="}",s.push(a),a=""}for(String.prototype.trimRight?T=function(S){return S.trimRight()}:T=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},h=0,d=m.Start,g=!1,s=[],t=t.replace(/\r\n/g,`
|
|
18
|
+
`);o<i;){if(l=t.charAt(o),c=t.charAt(o+1),o+=1,y(f)){a+=l,l===f&&(f=null),l==="\\"&&c===f&&(a+=c,o+=1);continue}if(y(l)){a+=l,f=l;continue}if(g){a+=l,l==="*"&&c==="/"&&(g=!1,a+=c,o+=1);continue}if(l==="/"&&c==="*"){g=!0,a+=l,a+=c,o+=1;continue}if(d===m.Start){if(s.length===0&&L(l)&&a.length===0)continue;if(l<=" "||l.charCodeAt(0)>=128){d=m.Start,a+=l;continue}if(p(l)||l==="@"){if(u=T(a),u.length===0)s.length>0&&(a=`
|
|
19
|
+
|
|
20
|
+
`);else if(u.charAt(u.length-1)==="}"||u.charAt(u.length-1)===";")a=u+`
|
|
21
|
+
|
|
22
|
+
`;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=T(a),C(),d=u==="@font-face"?m.Ruleset:m.Block;continue}a+=l;continue}if(d===m.Block){if(p(l)){if(u=T(a),u.length===0)s.length>0&&(a=`
|
|
23
|
+
|
|
24
|
+
`);else if(u.charAt(u.length-1)==="}")a=u+`
|
|
25
|
+
|
|
26
|
+
`;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==="}"){b(),d=m.Start;continue}a+=l;continue}if(d===m.Selector){if(l==="{"){C(),d=m.Ruleset;continue}if(l==="}"){b(),d=m.Start;continue}a+=l;continue}if(d===m.Ruleset){if(l==="}"){b(),d=m.Start,h>0&&(d=m.Block);continue}if(l===`
|
|
27
|
+
`){a=T(a),a+=`
|
|
28
|
+
`;continue}if(!L(l)){a=T(a),a+=`
|
|
29
|
+
`,v(),a+=l,d=m.Property;continue}a+=l;continue}if(d===m.Property){if(l===":"){a=T(a),a+=": ",d=m.Expression,L(c)&&(d=m.Separator);continue}if(l==="}"){b(),d=m.Start,h>0&&(d=m.Block);continue}a+=l;continue}if(d===m.Separator){if(!L(l)){a+=l,d=m.Expression;continue}y(c)&&(d=m.Expression);continue}if(d===m.Expression){if(l==="}"){b(),d=m.Start,h>0&&(d=m.Block);continue}if(l===";"){a=T(a),a+=`;
|
|
30
|
+
`,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 UO(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 jO=["transform","transform-origin","overflow-x","height"];function VO(e,t){return!(e>0)||!(t>0)||e<=t?1:t/e}function ls(e,t){const n=t<1?`scale(${t})`:"";if(e.style.transform===n)return!1;for(const r of jO)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 GO(e,t){const n=e,r=n?.querySelector("table:first-child"),o=Math.max(n?.offsetWidth??0,r?.offsetWidth??0);return o>0?o:(ls(t,1),t.scrollWidth)}function XO(e,t=window){const n=t.document.documentElement,r=n.style.transform,o=VO(GO(e,n),t.innerWidth);return ls(n,o),n.style.transform!==r&&t.parentIFrame?.size?.(),o}function KO(e,t){ls(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;ls(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=R(e,Te);return n=>{t.commit(n)}}function ot(){return R(Rt,K)}function YO(){return R(Rt,_t)}function ZO(){return R(Rt,mn)}function ct(){return Rt.getInstance(K)!==void 0}function qo(e){R(Rt,Te).commit(e)}function QO(e){if(!ct())return e(),Promise.resolve(!0);const t=ot();return t.commit(!1),t.flushCommit(),t.sendAfterCurrentEdits(e)}function JO(){if(!ct())return!1;const e=ot();return e.commit(!1),e.flushCommit(),e.hasEditsAfterBoundary()}function eR(){return ct()?ot().markHistoryAction():void 0}function tR(e){ct()&&ot().noteHistoryActionSent(e)}function Gd(e){return ct()&&ot().holdInput(e)}function Wy(e){return ct()&&ot().holdInputBehindQueued(e)}function qy(){ct()&&ot().closeUndoStep()}function Xd(){return ct()&&ot().isHoldingInput()}function zy(){return ct()&&ot().hasHeldInput()}function Uy(){ct()&&ot().releaseHeldInput()}function jy(){return ct()&&ot().holdsTypedEdits()}function cs(e){return ct()?ot().renderOnly(e):e()}function ml(e){return e.nodeType===1&&e.localName==="template"&&e.namespaceURI==="http://www.w3.org/1999/xhtml"}function Kd(e){return[...e.querySelectorAll?.("template")??[]].filter(ml)}function nR(e){return ml(e)||Kd(e).length>0}function nn(e){const t=[...ml(e)?[e]:[],...Kd(e)];for(const n of t)if(n.content.firstChild){for(;n.content.firstChild;)n.appendChild(n.content.firstChild);for(const r of n.children)nn(r)}}function zo(e){const t=[...ml(e)?[e]:[],...Kd(e)];for(const n of t)for(;n.firstChild;)n.content.appendChild(n.firstChild)}function jt(){return ct()?ot():void 0}function Mt(e){const t=jt();return t?t.applyHidden(e):e()}function Ie(e,t,...n){e&&Mt(()=>t?e.classList.add(...n):e.classList.remove(...n))}function eo(e){const t=document.activeElement;t instanceof HTMLElement&&t!==document.body&&e.contains(t)&&Mt(()=>t.blur())}function Yd(e){jt()?.ownership.markService(e)}function Vy(e){jt()?.ownership.markWrapper(e)}function rR(e){jt()?.ownership.markOuterWrapper(e)}function us(e,t){e.removeAllRanges(),Mt(()=>e.addRange(t))}function hl(e){const t=document.implementation.createHTMLDocument("").importNode(e,!0);en(e,t);const n=new Map([[e,t]]),r=jt()?.ownership,o=(i,s)=>{const a=[...s.childNodes];i.childNodes.forEach((l,c)=>{const u=a[c];n.set(l,u),o(l,u),r?.isOffModel(l)&&u.replaceWith(...u.childNodes)})};return o(e,t),zo(t),{copy:t,counterpart:i=>n.get(i)}}function pl(e){return mg(hl(e).copy)}function ze(e){return nk(hl(e).copy)}function ds(e){const t=jt();return t?(t.flushCommit(),t.getOuterHtml(e)):e.outerHTML}function Zd(e){return Gy(e)}function Gy(e){const t=jt();return!t||t.isInLetter(e)||!t.isUntracked(e)&&!t.ownership.isService(e)}function Qd(e){const t=jt();return t?t.ownership.markOf(e)?"foreign":t.isInLetter(e)?"letter":t.isBehindHidden(e)?"foreign":"new":"letter"}function Jd(e,t){const n=[...e.querySelectorAll(t)].filter(Zd);return n[n.length-1]??null}function Xy(e,t){const n=o=>t==="next"?o.nextElementSibling:o.previousElementSibling;let r=n(e);for(;r&&!Zd(r);)r=n(r);return r}function Ky(e,t){return[...e.childNodes].flatMap(n=>t.isInLetter(n)?[n]:Ky(n,t))}function ef(e){eo(e);const t=jt();if(!t)return;t.flushCommit();const n=[...e.querySelectorAll("*")].filter(r=>t.ownership.markOf(r)==="service");for(const r of n)e.contains(r)&&r.replaceWith(...Ky(r,t))}function oR(e){const t=[...e.childNodes],n=jt();if(!n)return t;let r;for(const o of n.letterChildren(e))o.isConnected||t.splice(r?t.indexOf(r)+1:0,0,o),r=o;return t}function iR(){const e=jt();return e?{...e.scriptRunner,awake:()=>e.recordNow()}:{run:(t,n)=>n(),quiet:t=>t()}}function or(e,t){const n=Re(e,"dormant"),r=_g(n);try{return t(n)}finally{xg(r,iR())}}function Yy(e,t,n){or(n,r=>Ba(e,t,r))}function fs(e,t,n){return e==="new"?or(t,n):n(Re(t,!0))}function ir(e,t,n,r){fs(e,r,o=>Ba(t,n,o))}function mt(e){return function(...t){const n=jt(),r=()=>Reflect.apply(e,this,t);return n?n.applyOwn(r):r()}}function sr(e,t=!1,n){const r=()=>document.execCommand(e,t,n),o=jt();return o?o.applyCommand(r):r()}function Zy(e){const t=()=>{Ie(document.body,e,"mceNonEditable"),document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable",e?"false":"true")})};ct()?ot().applyHidden(t):t()}function sR(){let e=!1,t=!0,n=!0;const r=new Set,o=i=>{t!==i&&(t=i,[...r].forEach(s=>{try{s()}catch{}}))};return{setApp(i){e=i},setIntegrator:o,isAppLocked:()=>e,isIntegratorLocked:()=>t,isTextLocked:()=>e||t,closeEditorInit(){n=!0},openEditorInit(){n=!1},isEditorInitClosed:()=>n,onIntegratorChange(i){const s=()=>i();return r.add(s),()=>r.delete(s)},reset(){e=!1,o(!0),n=!0}}}var tf=sR();function aR(e){return{dispose:e.onIntegratorChange(()=>Zy(e.isTextLocked()))}}function lR(e,t){return e.beforeChange(({domMutations:n})=>{const r=n.flatMap(o=>o.type==="Add"&&o.node instanceof Element?[o.node]:[]);r.length&&queueMicrotask(()=>{if(!t.isTextLocked())return;const o=r.flatMap(i=>[...i.tagName==="EDITOR"?[i]:[],...Array.from(i.querySelectorAll("editor"))]);e.applyHidden(()=>{for(const i of o)i.isConnected&&i.setAttribute("contenteditable","false")})})})}function nf(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)=>nf(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)&&nf(e[i],t[i]))}function Qy(e,t){const n={watch(r){let o,i=!1;return e.watch(s=>{const a=t(s);i&&nf(o,a)||(o=a,i=!0,r(a))})},select(r){return Qy(n,r)}};return n}function Jy(...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 Qy(o,i)}};return o}var gl={applicationTheme:"light",applicationMode:"default",previewHeight:0,emailWidth:0,previewPage:!1,globalHolder:null,elementPath:[],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,activeCell:[],commonStyles:{},loadStylesTimer:!1,_pushUndoStop:!1},ms=Jy({...gl});function Pn(){return ms.get()}var bl=new he,Uo=new Map,U={source:ms,get(e){return Pn()[e]},getState(){return{...Pn()}},getStateRef(){return Pn()},set(e,t){if(Pn()[e]===t)return;ms.set({...Pn(),[e]:t}),bl.fire({[e]:t});const n=Uo.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(Pn()[r]!==o){ms.set({...Pn(),[r]:o}),n[r]=o,t=!0;const i=Uo.get(r);i&&i.forEach(s=>s(o))}}t&&bl.fire(n)},increment(e,t=1){const n=Pn()[e];typeof n=="number"&&U.set(e,n+t)},decrement(e,t=1){const n=Pn()[e];typeof n=="number"&&U.set(e,n-t)},subscribe(e){return bl.event(e)},subscribeToKey(e,t){Uo.has(e)||Uo.set(e,new Set);const n=Uo.get(e),r=t;return n.add(r),()=>{n.delete(r),n.size===0&&Uo.delete(e)}},reset(){ms.set({...gl}),bl.fire(Pn())},resetKey(e){this.set(e,gl[e])},getInitialState(){return gl}};function cR(e,t){const n=Jy(),r=e.addListener(t,o=>n.set(o));return{source:n,dispose:()=>r.dispose()}}var uR=["copyPasteEnabled","saveBlockEnabled","editImageControlEnabled","elementAIimageEnabled","imageCenterStockEnabled","imageCenterGifEnabled","imageCenterEditorEnabled","blocksAddPanelEnabled"];function dR(e){const t="a4e11bd0";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 fR={name:"sandbox.hostFacts",provides:[Oo],setup(e){const t=Object.fromEntries(Object.entries(bL).map(([n,r])=>[n,cR(G,r).source]));e.inject(Oo,t)}},mR={name:"sandbox.hostFactsToState",awaits:{services:[Oo,Te,K,nt]},setup(e){const t=R(e,Oo),n=lt(e),r=R(e,nt);t.theme.watch(o=>{U.set("applicationTheme",o),dR(o),n(!1)}),t.commonStyles.watch(o=>{o&&U.set("commonStyles",o)}),t.flags.watch(o=>{for(const i of uR)typeof o[i]<"u"&&U.set(i,o[i])}),aR(r),lR(R(e,K),r),t.lockEditor.watch(o=>r.setIntegrator(o)),t.codeMode.watch(o=>U.set("codeMode",o)),t.appName.watch(o=>U.set("appName",o)),t.previewPage.watch(o=>{U.set("previewPage",o),Ie(document.body,!!o,"em-sandbox-preview")})}},hR={name:"sandbox.viewport",awaits:{services:[Oo]},setup(e){R(e,Oo).viewport.watch(t=>UO(t,void 0,{state:U,previewHeight:t.previewHeight,iframeOffsetTop:t.iframeOffsetTop,scrollTop:t.scrollTop,globalHolder:U.get("globalHolder"),setBlockGroupControlsPosition:()=>e.getServices(zg).forEach(n=>n()),messageService:G}))}};function Cr(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function At(e,t,n=!1){for(const r of e.querySelectorAll(t))n||!r.childNodes.length?r.remove():r.replaceWith(...r.childNodes)}function pR(e,t){if(e.data.value)document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable","false")}),Ie(document.body,!0,"em-sandbox-discuss");else{const n=t.editLock.isTextLocked()?"false":"true";document.querySelectorAll("editor").forEach(r=>{r.setAttribute("contenteditable",n)}),Ie(document.body,!1,"em-sandbox-discuss","em-sandbox-discuss_set-target")}}function gR(e,t){Ie(document.body,!!e.data.value,"em-sandbox-discuss_set-target")}function bR(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}}),Ie(document.body,!1,"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 yR(e,t){Ie(document.body,!1,"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 vR(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 ER={sandbox_lock_discuss:pR,sandbox_discuss_set_target:gR,sandbox_discuss_remove_target:bR,sandbox_discuss_reset:yR,sandbox_discuss_get_target:vR};function SR(e,t){t.editLock.setApp(!!e.data.data),Zy(t.editLock.isTextLocked())}function wR(e,t){t.setEditorFocus(e.data.data)}function _R(e,t){let n=e.data.data;if(typeof n!="number")return;n=YO().correctOffset(n,!0),n=ZO().correctOffset(n,!0);let r=ot().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-U.get("previewHeight")/2+i.height/2;t.messageService.send({operation:"application_scroll-to",settings:{value:U.get("applicationMode")==="default"?s+U.get("iframeOffsetTop"):s}})}var CR={sandbox_lock_edit:SR,editor_change_focus:wR,update_position_from_editor:_R};function TR(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 AR(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 kR(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 LR(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 NR={sandbox_set_attr_to_images:TR,sandbox_set_attr_to_links:AR,sandbox_set_position_to_img:kR,sandbox_set_position_to_link:LR},xR={brightness:100,contrast:100,sepia:0},yl={DARK:"dark",LIGHT:"light"},ev=!1;function OR(e){ev||(e.setFetchMethod(t=>window.fetch(t)),ev=!0)}function RR(){let e=null,t=yl.LIGHT;return{set(n){if(t=n,n===yl.DARK){e??(e=Wd(()=>Promise.resolve().then(()=>Iu("./darkreader.CLd5EML2.js")),void 0,{}.url)),e.then(r=>{t===yl.DARK&&(OR(r),r.enable(xR))}).catch(r=>{e=null});return}e?.then(r=>{t===yl.LIGHT&&r.disable()})},clear(n){return n.replaceAll(/\s*?--darkreader.+?: .*?;/g,"")}}}var vl=RR();function MR(e,t){t.initPreview(!0)}function PR(e){const t=e.data?.data?.theme;(t==="light"||t==="dark")&&vl.set(t)}var IR={init_preview:MR,sandbox_switch_theme:PR};function bn(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(Ug,{owner:e,handlers:s})}}}var DR={name:"sandbox.operationEnvironment",provides:[Sr],setup(e){const t={iframeOffsetTop:0,previewHeight:0,elementPath:[]};U.subscribe(n=>{for(const r of["iframeOffsetTop","previewHeight","elementPath"])r in n&&n[r]!==void 0&&Object.assign(t,{[r]:n[r]})}),e.inject(Sr,t)}},BR=bn("discuss",ER,{services:[Te,Sr,nt]},e=>{const t=lt(e),n=R(e,Sr),r=R(e,nt);return()=>({commit:t,editLock:r,iframeOffsetTop:n.iframeOffsetTop,previewHeight:n.previewHeight,messageService:G,removeAllAttributes:Cr})}),HR=bn("editor",CR,{services:[He,ft,nt]},e=>{const t=R(e,He),n=R(e,ft),r=R(e,nt);return()=>({applicationElementSettingsSet:t,editLock:r,messageService:G,setEditorFocus:o=>n.setEditorFocus(o)})}),FR=bn("images",NR,{services:[He,Ot,Te,Sr]},e=>{const t=R(e,He),n=R(e,Ot),r=lt(e),o=R(e,Sr);return()=>({applicationElementSettingsSet:t,commit:r,iframeOffsetTop:o.iframeOffsetTop,previewHeight:o.previewHeight,messageService:G,setCursorPosition:i=>n(i)})}),$R=bn("preview",IR,{services:[Ki]},e=>()=>({initPreview:t=>R(e,Ki)(t)})),WR={name:"sandbox.operationsDispatcher",setup(e){G.addListener(t=>{const n=t.data?.operation;if(!n)return;const r=e.getServices(Ug).map(i=>i.handlers[n]).filter(Boolean).pop();if(!r)return;const o=i=>{};try{Promise.resolve(r(t)).catch(o)}catch(i){o(i)}})}},qR=[DR,BR,HR,FR,$R,WR],zR=["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"],UR=["style","class","align","href"],jR=new Set([...zR,"em-element-path_img"]);function VR(e){return e.split(/\s+/).filter(t=>t&&!jR.has(t)).join(" ")}var GR=32;function XR(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function KR(e){const t=[e.tagName];for(const n of UR){const r=e.getAttribute(n),o=n==="class"&&r!==null?VR(r):r;o!==null&&o!==""&&t.push(`${n}=${o}`)}return t.join("|")}function YR(e){if(!e||!e.isConnected)return"";const t=[];let n=e,r=0;for(;n&&r<GR&&(t.push(KR(n)),!XR(n));)n=n.parentElement,r++;return t.join("||")}function ZR(e){let t={text:"",ancestors:""};const n=r=>({text:r?e(r):"",ancestors:YR(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 QR(e,t){t.onReleased(()=>{Promise.resolve().then(()=>{t.isLocked()||e.remember(document.querySelector("[em-edit]"))})})}var tv=Promise.resolve(),nv=null;function JR(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 eM(e,t){nv=e,tv=tv.finally(()=>{nv===e&&JR(e,t)})}function tM(e,t="unknown"){const n=Rt.getInstance(ft);if(!n){e();return}n.controller.whenEditorLostFocus(e,t)}function nM(e){const t=e.innerHTML.trim();return[t===" ",t==="<div> </div>",/^<div[^>]*> <\/div>$/.test(t),/^<[^>]*> <\/[^>]*>$/.test(t),t.replace(/<[^>]*>/g,"").trim()===" ",e.textContent?.trim()===" "||e.textContent?.trim().charCodeAt(0)===160].some(n=>n===!0)}function rM(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}var KJ="br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object",hs="data-em-caret",YJ="",ar=e=>e();function Pt(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-em-caret")}function to(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.tagName==="EM-REPLACE"&&!e.hasAttribute("src")}function Tr(e){return(e??"").replaceAll("","")}function rf(e){return Tr(e.textContent)}function oM(e){return(e.nodeType===Node.TEXT_NODE||Pt(e))&&Tr(e.textContent)===""}function of(e,t){const n=document.createRange();n.setStart(e,t),n.collapse(!0);const r=window.getSelection();r&&us(r,n)}function rv(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(!to(r))return null;const o=document.createRange();if(o.selectNodeContents(r),o.setEnd(t,n),Tr(o.toString())==="")return{em:r,side:"before"};const i=document.createRange();return i.selectNodeContents(r),i.setStart(t,n),Tr(i.toString())===""?{em:r,side:"after"}:null}function sf(e,t){if(!e.collapsed)return null;const n=rv(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(Tr(t==="backward"?s.slice(0,o):s.slice(o))!=="")return null;const a=r.parentNode,l=Pt(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&&oM(i);)i=t==="backward"?i.previousSibling:i.nextSibling;return to(i)?i:null}function El(e,t,n=ar){return af(e,t,n)}function af(e,t,n=ar){const r=t==="after"?e.nextSibling:e.previousSibling;let o;if(Pt(r))o=r;else{const s=document.createElement("span");s.setAttribute(hs,""),Yd(s),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 of(i,i.length),o}var iM="p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote";function lf(e,t=ar,n=e.parentElement?.closest('[contenteditable="true"]')){ov(e,n)&&af(e,"after",t)}function ov(e,t){if(!t)return!1;const n=e.parentElement?.closest(iM),r=n&&t.contains(n)?n:t,o=document.createRange();o.setStartAfter(e),o.setEnd(r,r.childNodes.length);const i=o.cloneContents();return i.querySelectorAll(`[${hs}]`).forEach(s=>s.remove()),!/[^ \t\n\r]/.test(i.textContent??"")&&!i.querySelector("br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object")}function iv(e){const t=Pt(e)&&rf(e)===""?e.previousSibling:null;return t?.nodeName==="BR"&&ov(t,t.parentElement?.closest('[contenteditable="true"]'))}function cf(e,t=ar){if(!iv(e)||!e.parentNode)return null;const n=window.getSelection(),r=!!n?.anchorNode&&e.contains(n.anchorNode),o=document.createElement("br");e.before(o),t(()=>e.remove());const i=o.parentNode;return r&&of(i,Array.prototype.indexOf.call(i.childNodes,o)),o}function sv(){const e=window.getSelection(),t=e?.rangeCount?e.getRangeAt(0):null,n=t?.collapsed?t.startContainer:null,r=Pt(n)?n:n?.parentNode;return iv(r)?r:null}function sM(e,t=ar,n){return Array.from(e.querySelectorAll(`[${hs}]`)).filter(r=>r!==n).map(r=>cf(r,t)).some(Boolean)}function aM(e,t=ar,n){const r=Array.from(e.querySelectorAll(`[${hs}]`)).filter(o=>o!==n&&Tr(o.textContent)==="");r.length&&t(()=>r.forEach(o=>o.remove()))}function lM(e,t=ar){const n=Tr(e.textContent);if(n==="")return null;const r=document.createTextNode(n);return e.before(r),t(()=>e.remove()),of(r,r.length),r}function av(e){if(!e.collapsed)return;const{startContainer:t}=e,n=Pt(t)?t:t.parentNode;Pt(n)&&(to(n.previousSibling)?e.setStartAfter(n):e.setStartBefore(n),e.collapse(!0))}function lv(e){e.querySelectorAll(`[${hs}]`).forEach(t=>{const n=Tr(t.textContent);n===""?t.remove():t.replaceWith(t.ownerDocument.createTextNode(n))})}function cM(e,t){const n=sf(e,t);if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o&&us(o,r),n}function uM(e,t){const n=Array.from(e.querySelectorAll("em-replace")).find(i=>to(i)&&t.intersectsNode(i)&&!cv(t,i));if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o?.removeAllRanges(),o?.addRange(r),n}function cv(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 dM(){document.execCommand("delete")}function fM(){const e=window.getSelection()?.getRangeAt(0);e?.deleteContents(),e?.collapse(!0)}function uv(e,t=ar,n=dM){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=>to(l)&&cv(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;to(l)?El(l,"after",t):!l&&to(c)&&El(c,"before",t)}return!0}function dv(){const e=window.getSelection();return e?.rangeCount?sf(e.getRangeAt(0),"backward"):null}function mM(e,t=ar){const n=e.isConnected?e:dv();if(!n)return;const r=n.closest('[contenteditable="true"]');Mt(()=>r?.focus({preventScroll:!0})),El(n,"after",t)}var fv=Symbol("held-input-replay"),mv={insertText:"insertText",insertReplacementText:"insertText",deleteContentBackward:"delete",deleteContentForward:"forwardDelete",insertParagraph:"insertParagraph",insertLineBreak:"insertLineBreak",insertOrderedList:"insertOrderedList",insertUnorderedList:"insertUnorderedList",insertHorizontalRule:"insertHorizontalRule",formatBold:"bold",formatItalic:"italic",formatUnderline:"underline",formatStrikeThrough:"strikeThrough",formatSuperscript:"superscript",formatSubscript:"subscript",formatJustifyLeft:"justifyLeft",formatJustifyCenter:"justifyCenter",formatJustifyRight:"justifyRight",formatJustifyFull:"justifyFull",formatIndent:"indent",formatOutdent:"outdent",formatRemove:"removeFormat"},hv={deleteWordBackward:["backward","word"],deleteWordForward:["forward","word"],deleteSoftLineBackward:["backward","lineboundary"],deleteSoftLineForward:["forward","lineboundary"],deleteHardLineBackward:["backward","paragraphboundary"],deleteHardLineForward:["forward","paragraphboundary"]};function hM(e){return e in mv||e in hv}var pM={Backspace:["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward"],Delete:["deleteContentForward","deleteWordForward","deleteSoftLineForward"]},pv={ArrowLeft:["backward","character","word"],ArrowRight:["forward","character","word"],ArrowUp:["backward","line","paragraphboundary"],ArrowDown:["forward","line","paragraphboundary"],Home:["backward","lineboundary","documentboundary"],End:["forward","lineboundary","documentboundary"]};function uf(){return/Mac/.test(window.navigator.platform)}function gv(e){return uf()?e.altKey:e.ctrlKey}function gM(e){const t=e.ctrlKey||e.metaKey;return t&&/^[cxv]$/i.test(e.key)||e.key==="Insert"&&(t||e.shiftKey)}function bM(e){return e.key in pv||(e.ctrlKey||e.metaKey)&&e.key.length===1&&!gM(e)}function df(e){return fv in e}function ff(e){return e.target?.closest?.('[contenteditable="true"], editor')??void 0}function bv(e){if(e.key.length===1&&!e.metaKey&&(!e.ctrlKey||e.altKey))return"insertText";if(e.key==="Enter"&&!e.ctrlKey&&!e.metaKey&&!e.altKey)return e.shiftKey?"insertLineBreak":"insertParagraph";const t=pM[e.key];if(t)return uf()&&e.metaKey?t[2]:gv(e)?t[1]:t[0]}function yM(e){const t=pv[e.key];if(!t)return;const n=uf()&&e.metaKey&&(e.key==="ArrowLeft"||e.key==="ArrowRight")?"lineboundary":gv(e)?t[2]:t[1];document.getSelection()?.modify?.(e.shiftKey?"extend":"move",t[0],n)}function mf(e){return Object.defineProperty(e,fv,{value:!0}),e}function yv(e,t){return e.isConnected&&t<=(e.nodeType===Node.TEXT_NODE?e.length:e.childNodes.length)}function vv(e){if(!yv(e.startContainer,e.startOffset)||!yv(e.endContainer,e.endOffset))return;const t=document.createRange();return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t.toString()}function vM(e,t){return t===void 0||vv(e)!==t?!1:(document.getSelection()?.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),!0)}function EM({inputType:e,data:t}){const n=hv[e];if(n){const o=document.getSelection();o?.isCollapsed&&o.modify?.("extend",n[0],n[1]),sr(n[0]==="backward"?"delete":"forwardDelete");return}const r=mv[e];r&&sr(r,!1,t??void 0)}function Ev(e,t){if(t.target&&!vM(t.target,t.targetText))return;const{inputType:n,data:r}=t,o=mf(new window.InputEvent("beforeinput",{inputType:n,data:r,bubbles:!0,cancelable:!0}));e.dispatchEvent(o)&&EM(t)}function SM(e,t){const n=mf(new window.KeyboardEvent("keydown",{...t,bubbles:!0,cancelable:!0}));if(Object.defineProperty(n,"keyCode",{value:t.keyCode}),!e.dispatchEvent(n))return;const r=bv(t);r?Ev(e,{inputType:r,data:r==="insertText"?t.key:null}):(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()==="a"?sr("selectAll"):yM(t)}var wM='[contenteditable="true"], editor';function hf(e){return(e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement)?.closest(wM)??void 0}function _M(){const e=document.getSelection();if(!e?.rangeCount||!e.anchorNode||!e.focusNode||!ct())return;const t=ot(),n=t.pointToOffset({node:e.anchorNode,offset:e.anchorOffset}),r=t.pointToOffset({node:e.focusNode,offset:e.focusOffset});return n===void 0||r===void 0?void 0:{anchor:t.trackOffset(n),focus:t.trackOffset(r)}}function Sv(e){e?.anchor.release(),e?.focus.release()}function wv({node:e}){const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement,n=e.nodeType===Node.TEXT_NODE&&/^\s*$/.test(e.data)&&/\n/.test(e.data);return e.isConnected&&!!hf(e)&&!n&&!t?.closest("em-replace, [data-em-caret]")}function _v(e){const t=e.current(),n=t===void 0||!ct()?void 0:ot().offsetToPoint(t);return n&&wv(n)?n:void 0}function CM(e){const t=e&&_v(e.anchor),n=e&&_v(e.focus);if(!(!t||!n))return document.getSelection()?.setBaseAndExtent(t.node,t.offset,n.node,n.offset),hf(t.node)}function TM(){const e=document.getSelection(),t=e?.rangeCount?e.anchorNode:null;return t&&wv({node:t})?hf(t):void 0}function AM(e){const t=CM(e)??TM();return t}function Sl(e,t){const n=_M(),r=e(()=>{ct()&&ot().flushCommit();const o=AM(n);Sv(n),o&&t(o)});return r||Sv(n),r}function pf(e){e.preventDefault(),e.stopImmediatePropagation()}function kM(e){return/^(Tab|Escape|PageUp|PageDown|F\d{1,2})$/.test(e.key)||e.key==="Enter"&&(e.ctrlKey||e.metaKey)}var Cv=e=>{if(!ff(e)||df(e)||e.isComposing||e.keyCode===229)return;const{key:t,code:n,keyCode:r,shiftKey:o,ctrlKey:i,metaKey:s,altKey:a}=e,l={key:t,code:n,keyCode:r,shiftKey:o,ctrlKey:i,metaKey:s,altKey:a},c=u=>SM(u,l);bv(l)?Xd()&&Sl(Gd,c)&&pf(e):bM(l)?zy()&&Sl(Wy,c)&&pf(e):kM(l)&&zy()&&Uy()},Tv=()=>{Uy()},Av=e=>{if(!ff(e)||!hM(e.inputType)||e.isComposing||df(e)||!Xd())return;const t=e.inputType==="insertReplacementText",n=t?e.getTargetRanges?.()[0]:void 0;if(t&&!n)return;const r={inputType:e.inputType,data:t&&e.dataTransfer?.getData("text/plain")||e.data,target:n,targetText:n&&vv(n)};Sl(Gd,o=>Ev(o,r))&&pf(e)};function LM(e){return"clipboardData"in e?e.clipboardData:e.dataTransfer}var NM=["text/html","text/plain"];function xM(e,t){const n=Array.from(t.types??[]),r=Object.fromEntries(NM.filter(o=>n.includes(o)).map(o=>[o,t.getData(o)]));return mf({target:e.target,clipboardData:{types:Object.keys(r),files:[],getData:o=>r[o]??""},preventDefault:()=>{},stopPropagation:()=>{}})}function OM(e,t){if(df(e)||!Xd()||!ff(e))return!1;try{const n=LM(e);if(!n||n.files?.length)return!1;const r=xM(e,n);if(!Sl(Gd,()=>t(r)))return!1}catch{return e.preventDefault(),!1}return e.preventDefault(),e.stopPropagation(),!0}function RM(){return window.addEventListener("keydown",Cv,!0),window.addEventListener("beforeinput",Av,!0),window.addEventListener("pointerdown",Tv,!0),{dispose(){window.removeEventListener("keydown",Cv,!0),window.removeEventListener("beforeinput",Av,!0),window.removeEventListener("pointerdown",Tv,!0)}}}function MM(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 kv(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 PM(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 IM(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 DM(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 BM(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 HM(e,t=10){const n=e.length;return n===0?!1:(e.match(/[а-яА-ЯёЁ]/g)||[]).length/n*100>t}var FM={bold:"strong|s|b",italic:"em|i",strike:"strike",underline:"u",strikeUnderline:"strike|u"};function ps(e,t){const n=FM[t]||t,r=new RegExp(`<\\/?(${n})>`,"gi");return e.replaceAll(r,"")}var $M=["strong","em","strike","sub","sup","b","i","s","u"];function WM(e,t){if(t)for(const n of $M)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 qM(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 ZJ="#1C52DC",QJ="#1C52DC",JJ="#1C52DC";function zM(e){if(typeof e.isContentEditable=="boolean")return e.isContentEditable;const t=e.closest("[contenteditable]");return!!t&&t.getAttribute("contenteditable")!=="false"}function Lv(e,t,n,r){const o=document.createRange();return o.selectNodeContents(e),r?o.setStart(t,n):o.setEnd(t,n),o.toString()!==""||!!o.cloneContents().querySelector("br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object")}function UM(e){const{startContainer:t,startOffset:n}=e,r=(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest("a"),o=r?.parentElement;if(!e.collapsed||!r?.textContent||!o||!zM(o))return;const{display:i}=getComputedStyle(r);if(!(i&&i!=="inline")){if(!Lv(r,t,n,!0))e.setStartAfter(r);else if(!Lv(r,t,n,!1))e.setStartBefore(r);else return;e.collapse(!0)}}var jM="./js/sanitize-html/sanitize-html.js",Nv="data-sanitize-html-loader",wl=null,gs=null;function xv(){return typeof __emailmaker__<"u"?__emailmaker__:void 0}function VM(e){const t=xv();if(typeof t?.moduleTransport!="function"||t.blobBlocked)return null;try{return t.moduleTransport(e)}catch{return null}}function GM(){const e=xv();e&&(e.blobBlocked=!0)}function XM(){return new URL(jM,document.baseURI||window.location.href).href}function gf(){const e=globalThis.sanitizeHtml;return typeof e!="function"||!("defaults"in e)?null:e}function KM(){if(gf())return Promise.resolve();const e=XM();return document.querySelector(`script[${Nv}]`)?gs??Promise.resolve():(gs||(gs=YM(e).catch(t=>{throw gs=null,t})),gs)}async function YM(e){const t=VM(e);if(!t)return _l(e);const n=await t.catch(()=>null);if(!n)return _l(e);const r=URL.createObjectURL(n),o=await _l(r).then(()=>!0,()=>!1);URL.revokeObjectURL(r),o||(GM(),await _l(e))}function _l(e){return new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.async=!0,r.setAttribute(Nv,"true"),r.onload=()=>t(),r.onerror=()=>{r.remove(),n(new Error(`Failed to load sanitize-html script: ${e}`))},document.head.appendChild(r)})}async function Ov(){const e=gf();return e||(wl||(wl=(async()=>{await KM();const t=gf();if(t)return t;throw new Error("sanitizeHtml not available after script load")})().catch(t=>{throw wl=null,t})),wl)}function Cl(e){return e?.nodeType===Node.TEXT_NODE}function ZM(e,t,n){if(t?.nodeType===Node.TEXT_NODE)return e.includes(t)?{text:t,offset:n}:null;if(!t||t!==e[0]?.parentNode)return null;const r=t.childNodes[n-1];if(r?.nodeType===Node.TEXT_NODE&&e.includes(r))return{text:r,offset:r.length};const o=t.childNodes[n];return o?.nodeType===Node.TEXT_NODE&&e.includes(o)?{text:o,offset:0}:null}function Rv(e,t,n,r){const o=ZM(e,n,r);if(!o)return null;let i=o.text,s=0;for(;i!==t&&i.previousSibling?.nodeType===Node.TEXT_NODE;)i=i.previousSibling,s+=i.length;return{head:i,offset:s+o.offset}}function Mv(e,t,n,r){return e.node===t&&e.offset>n?{...e,offset:e.offset-r}:e}function bf(e,t,n=()=>"letter"){const r=e?.previousSibling,o=t?.nextSibling,i=Cl(r)&&n(r)==="letter",s=i&&Cl(e),a=Cl(t)&&Cl(o)&&(n(o)==="letter"||i&&n(o)==="new");if(!s&&!a)return;const l=window.getSelection(),c=s?r:e,u=a?o:t;if(!c||!u)return;const d=[];for(let y=c;y;y=y===u?null:y.nextSibling)d.push(y);const m=c.parentNode,h=Array.prototype.indexOf.call(m?.childNodes??[],u),f={node:l?.anchorNode??null,offset:l?.anchorOffset??0},g={node:l?.focusNode??null,offset:l?.focusOffset??0},E=Rv(d,c,f.node,f.offset),w=Rv(d,c,g.node,g.offset);let T=null,L=0;for(let y=c;y;){const p=y===u?null:y.nextSibling;y.nodeType!==Node.TEXT_NODE?T=null:T?(T.appendData(y.data),y.parentNode?.removeChild(y),L++):T=y,y=p}if(l&&(E||w)){const y=E?{node:E.head,offset:E.offset}:Mv(f,m,h,L),p=w?{node:w.head,offset:w.offset}:Mv(g,m,h,L);y.node&&p.node&&l.setBaseAndExtent(y.node,y.offset,p.node,p.offset)}}var QM=["strong","em","i","a","br","span","ul","ol","li","strike","sub","sup","s"],JM={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"]};function eP(e){const t=/^\s*(\d+(?:\.\d+)?)(px|pt|em)?\s*$/i.exec(e??"");return t?`${t[1]}${(t[2]||"px").toLowerCase()}`:null}var tP=/<span\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,nP=/\sdata-(?:buffer|metadata)=(?:"[^"]*"|'[^']*')/gi;function rP(e){return e.replace(tP,t=>t.replace(nP,""))}function oP(e){const t=window.clipboardData;return("clipboardData"in e?e.clipboardData:e.dataTransfer)||t}function iP(e){return sP(e.replace(/\r\n?/g,`
|
|
31
|
+
`).replace(/\n$/,"").replace(/&/g,"&").replace(/\n/g,"<br>"))}function sP(e){const t=new DOMParser().parseFromString(`<body>${e}`,"text/html").body;return t.querySelectorAll("script").forEach(n=>n.remove()),t.querySelectorAll("*").forEach(n=>{Array.from(n.attributes).forEach(r=>{/^on/i.test(r.name)&&n.removeAttribute(r.name)})}),t.innerHTML}var Ar=new Map,aP=3e3,lP=1e4;function cP(){const e=performance.now();return[...Ar.values()].some(t=>t.waiting&&e-t.startedAt<lP)}function uP(){for(const[e,t]of Ar)t.waiting&&(t.superseded=!0,Ar.delete(e))}function dP(){return Ar.size>0}async function fP(){let e;const t=new Promise(r=>{e=setTimeout(()=>{r()},aP)}),n=(async()=>{for(;Ar.size;)await Promise.allSettled(Ar.keys())})();await Promise.race([n,t]),clearTimeout(e)}function Tl(e,t=!1,n,r,o){if(OM(e,a=>{Tl(a,t,n,r,o)}))return Promise.resolve();if(cP())return e.preventDefault(),e.stopPropagation(),Promise.resolve();uP();const i={startedAt:performance.now(),waiting:!0,superseded:!1},s=mP(e,t,n,r,o,i);return Ar.set(s,i),s.finally(()=>Ar.delete(s))}function Pv(){const e=window.getSelection();e?.rangeCount&&UM(e.getRangeAt(0))}async function mP(e,t,n,r,o,i){e.preventDefault(),e.stopPropagation();const s=oP(e);if(!s)return;const a=s.getData("text/html"),l=s.getData("text/plain");try{let c=a;if(!c||t)Pv(),c=iP(l);else{const d=await Ov();if(i.superseded)return;Pv();const m=n?.text?.fontSize||16;let h=d(rP(c),{allowedTags:QM,allowedAttributes:JM,allowedStyles:{},transformTags:{span:function(y,p){let v="",C=!1,b=!1;if(p.style){const S=p.style.toLowerCase();(S.includes("font-weight: bold")||S.includes("font-weight:bold")||S.includes("font-weight: 700")||S.includes("font-weight:700"))&&(C=!0),(S.includes("font-style: italic")||S.includes("font-style:italic"))&&(b=!0),S.includes("text-decoration: underline")||S.includes("text-decoration:underline"),C&&b?(v="strong",p["data-italic"]="true"):C?v="strong":b&&(v="em")}return{tagName:v||"",attribs:p}},h1:function(y,p){return p["data-font-size"]=Math.round(1.5*m).toString(),p.style&&(p.style.toLowerCase().includes("font-style: italic")||p.style.toLowerCase().includes("font-style:italic"))&&(p["data-italic"]="true"),{tagName:"span",attribs:p}},h2:function(y,p){return p["data-font-size"]=Math.round(1.25*m).toString(),p.style&&(p.style.toLowerCase().includes("font-style: italic")||p.style.toLowerCase().includes("font-style:italic"))&&(p["data-italic"]="true"),{tagName:"span",attribs:p}},h3:function(y,p){return p["data-font-size"]=Math.round(1.125*m).toString(),p.style&&(p.style.toLowerCase().includes("font-style: italic")||p.style.toLowerCase().includes("font-style:italic"))&&(p["data-italic"]="true"),{tagName:"span",attribs:p}},h4:function(y,p){return p["data-font-size"]=m.toString(),p["data-bold"]="true",p.style&&(p.style.toLowerCase().includes("font-style: italic")||p.style.toLowerCase().includes("font-style:italic"))&&(p["data-italic"]="true"),{tagName:"span",attribs:p}},h5:function(y,p){return p["data-font-size"]=Math.round(.875*m).toString(),p.style&&(p.style.toLowerCase().includes("font-style: italic")||p.style.toLowerCase().includes("font-style:italic"))&&(p["data-italic"]="true"),{tagName:"span",attribs:p}},ul:function(y,p){return p["data-list-type"]="unordered",delete p.style,delete p["margin-top"],delete p["margin-bottom"],delete p["padding-inline-start"],{tagName:"ul",attribs:p}},ol:function(y,p){return p["data-list-type"]="ordered",p.start&&(p["data-list-start"]=p.start),delete p.style,delete p.start,{tagName:"ol",attribs:p}},li:function(y,p){return p["data-list-item"]="true",delete p.style,delete p.dir,delete p["aria-level"],delete p["list-style-type"],{tagName:"li",attribs:p}},p:function(y,p){return{tagName:"br",attribs:{}}},div:"br",b:function(y,p){if(p.style){const v=p.style.toLowerCase();return v.includes("font-weight: bold")||v.includes("font-weight:bold")||v.includes("font-weight: 700")||v.includes("font-weight:700")?{tagName:"strong"}:!1}return{tagName:"strong"}},i:function(y,p){if(p.style){const v=p.style.toLowerCase();return v.includes("font-style: italic")||v.includes("font-style:italic")?{tagName:"em"}:!1}return{tagName:"em"}},s:function(y,p){return{tagName:"strike",attribs:p}}},textFilter:function(y){return y.replace(/\s+/g," ")}});h=h.replace(/<[^\/>][^>]*>\s*<\/[^>]+>/g,"").replace(/(<br\s*\/?>){2,}/g,"<br>").trim();const f=document.createElement("div");f.innerHTML=h,(y=>{y.querySelectorAll("ul[data-list-type], ol[data-list-type]").forEach((p,v)=>{const C=p.getAttribute("data-list-type")==="ordered",b=p.querySelectorAll("li[data-list-item]");let S=1;C&&p.getAttribute("data-list-start")&&(S=parseInt(p.getAttribute("data-list-start"),10)||1);const _=document.createDocumentFragment(),k=p.previousSibling;k&&(k.nodeType===Node.TEXT_NODE&&k.textContent.trim()!==""||k.nodeType===Node.ELEMENT_NODE&&k.tagName!=="BR")&&_.appendChild(document.createElement("br")),b.forEach((x,N)=>{const W=document.createElement("span");W.innerHTML=C?`${S}. `:"• ",_.appendChild(W),(P=>{const Q=document.createElement("div");Q.innerHTML=P.innerHTML;let te=Q.firstChild;for(;te&&te.nodeType===1&&te.tagName==="BR";)Q.removeChild(te),te=Q.firstChild;if(!Q.hasChildNodes()){const fe=document.createTextNode("");Q.appendChild(fe)}for(;Q.firstChild;)_.appendChild(Q.firstChild)})(x),N<b.length-1&&_.appendChild(document.createElement("br")),S++}),p.parentNode.replaceChild(_,p)}),y.querySelectorAll("[data-list-type], [data-list-item], [data-list-start]").forEach(p=>{p.removeAttribute("data-list-type"),p.removeAttribute("data-list-item"),p.removeAttribute("data-list-start")})})(f),f.firstChild&&f.firstChild.nodeType===Node.ELEMENT_NODE&&f.firstChild.tagName==="BR"&&f.removeChild(f.firstChild),f.querySelectorAll("[data-font-size]").forEach(y=>{const p=eP(y.getAttribute("data-font-size"));let v=p?`font-size: ${p};`:"";y.getAttribute("data-bold")==="true"&&(v+=" font-weight: bold;"),y.getAttribute("data-italic")==="true"&&(v+=" font-style: italic;"),v&&y.setAttribute("style",v.trim()),y.removeAttribute("data-font-size"),y.removeAttribute("data-bold"),y.removeAttribute("data-italic")}),f.querySelectorAll("[data-italic]").forEach(y=>{const p=document.createElement("em");p.innerHTML=y.innerHTML,y.innerHTML="",y.appendChild(p),y.removeAttribute("data-italic")}),f.querySelectorAll("a").forEach(y=>{const p=y.getAttribute("href");if(!p||p.trim()==="")y.replaceWith(...y.childNodes);else{y.setAttribute("target","_blank");const v=n?.links?.color??"#1C52DC",C=n?.links?.underline??!0?"underline":"none";y.setAttribute("style",`color: ${v}; text-decoration: ${C};`)}});const E=f.querySelectorAll("*");let w=0;E.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),w++)}),f.querySelectorAll("span").forEach(y=>{y.innerHTML==="• "||/^\d+\. $/.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),w++)});const T=window.getSelection(),L=T?.anchorNode?.nodeType===Node.ELEMENT_NODE?T.anchorNode:T?.anchorNode?.parentElement||null;WM(f,L),qM(f,L),c=f.innerHTML}const u=window.getSelection();if(u&&u.rangeCount>0){const d=u.getRangeAt(0);av(d),d.deleteContents();const m=document.createRange().createContextualFragment(c),h=m.firstChild,f=m.lastChild;d.insertNode(m),f?.nodeType===Node.TEXT_NODE&&d.setEnd(f,f.length),d.collapse(!1),bf(h,f,Qd)}}catch{if(i.superseded)return;sr("insertText",!1,l)}i.waiting=!1,r(e),o(),await new Promise(c=>setTimeout(c,0))}var Al=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function Iv(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function no(e,t){return Array.from(e.classList).find(n=>n.includes(t))}function Dv(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?Dv(t):!1)}function D(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 hP(e){try{return JSON.parse(e),!0}catch{return!1}}function Bv(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 jo(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function pP(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 kl(){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 yf(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 bs(e,t=kl()){e=Al(e)??"";const n=i=>Al(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=bs(e,s),o))break}return o}function vf(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 Ll(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&&Ll({elem:e.elem.previousSibling,width:e.width})}function gP(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 bP=e=>{if(e instanceof Text)return e.textContent||"";if(e instanceof Element){if(e.tagName==="BR")return`
|
|
32
|
+
`;if(e.classList?.contains(".em-element-path"))return"";if(e.classList?.contains("em-code"))return"⃠";if(e.tagName==="EM-REPLACE")return"⃡"}};function Hv(e,t){if(!e)return"";const n=t(e);return n===void 0?[...e.childNodes].map(r=>Hv(r,t)).join(""):n}function yP(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 vP(e,t=!0){const n=document.createRange(),r=window.getSelection();r&&(n.selectNodeContents(e),n.collapse(t),r.removeAllRanges(),r.addRange(n))}function EP(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 Ef(){return RO()}function SP(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 Fv(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)Fv(r,t)}}function wP(e=document){e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function j(e){if(_P(e))return CP(e)?e.trim():TP(e)}var $v={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},_P=e=>typeof e=="string"&&e.trim()!=="",CP=e=>$v.HEX.test(e);function TP(e){const t=$v.RGB.exec(e)?.groups;if(!t)return;const n=AP(t);return LP(n)}var AP=e=>({r:Sf(e.r),g:Sf(e.g),b:Sf(e.b),a:kP(e.a)}),Sf=e=>parseInt(e||"0",10),kP=e=>parseFloat(e||"1"),LP=e=>`#${wf(e.r)}${wf(e.g)}${wf(e.b)}`,wf=e=>e.toString(16).padStart(2,"0"),NP=0;function ut(e){return e>=48&&e<=57}function kr(e){return ut(e)||e>=65&&e<=70||e>=97&&e<=102}function _f(e){return e>=65&&e<=90}function xP(e){return e>=97&&e<=122}function OP(e){return _f(e)||xP(e)}function RP(e){return e>=128}function Nl(e){return OP(e)||RP(e)||e===95}function Wv(e){return Nl(e)||ut(e)||e===45}function MP(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function xl(e){return e===10||e===13||e===12}function ro(e){return xl(e)||e===32||e===9}function In(e,t){return!(e!==92||xl(t)||t===NP)}function Ol(e,t,n){return e===45?Nl(t)||t===45||In(t,n):Nl(e)?!0:e===92?In(e,t):!1}function Cf(e,t,n){return e===43||e===45?ut(t)?2:t===46&&ut(n)?3:0:e===46?ut(t)?2:0:ut(e)?1:0}function qv(e){return e===65279||e===65534?1:0}var Tf=new Array(128),eee=128,tee=130,nee=131,ree=132,oee=133;for(let e=0;e<Tf.length;e++)Tf[e]=ro(e)&&130||ut(e)&&131||Nl(e)&&132||MP(e)&&133||e||128;function Af(e){return e<128?Tf[e]:132}function Vo(e,t){return t<e.length?e.charCodeAt(t):0}function kf(e,t,n){return n===13&&Vo(e,t+1)===10?2:1}function Go(e,t,n){let r=e.charCodeAt(t);return _f(r)&&(r=r|32),r===n}function ys(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(_f(s)&&(s=s|32),s!==i)return!1}return!0}function PP(e,t){for(;t>=0&&ro(e.charCodeAt(t));t--);return t+1}function Rl(e,t){for(;t<e.length&&ro(e.charCodeAt(t));t++);return t}function Lf(e,t){for(;t<e.length&&ut(e.charCodeAt(t));t++);return t}function Xo(e,t){if(t+=2,kr(Vo(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&kr(Vo(e,t));t++);const n=Vo(e,t);ro(n)&&(t+=kf(e,t,n))}return t}function Ml(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!Wv(n)){if(In(n,Vo(e,t+1))){t=Xo(e,t)-1;continue}break}}return t}function Pl(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),ut(n)&&(t=Lf(e,t+1),n=e.charCodeAt(t)),n===46&&ut(e.charCodeAt(t+1))&&(t+=2,t=Lf(e,t)),Go(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),ut(n)&&(t=Lf(e,t+1+r+1))}return t}function Nf(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}In(n,Vo(e,t+1))&&(t=Xo(e,t))}return t}function zv(e){if(e.length===1&&!kr(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 Uv=["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"],IP=16384;function Il(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,IP)):e}var jv=10,DP=12,Vv=13;function Gv(e){const t=e.source,n=t.length,r=t.length>0?qv(t.charCodeAt(0)):0,o=Il(e.lines,n),i=Il(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===jv||c===Vv||c===DP)&&(c===Vv&&l+1<n&&t.charCodeAt(l+1)===jv&&(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 BP=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||Gv(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||Gv(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]}}}},rn=16777215,Lr=24,HP=new Map([[2,22],[21,22],[19,20],[23,24]]),FP=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=Il(this.offsetAndType,e.length+1),o=Il(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&rn;for(a=o[m],s=a>>Lr,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=HP.get(c),a=s<<Lr|i}r[i++]=c<<Lr|d,l===-1&&(l=u)}),r[i]=0<<Lr|n,o[i]=n,o[n]=n;a!==0;){const c=a&rn;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]>>Lr:0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&rn:this.source.length}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount?ys(this.source,this.offsetAndType[e-1]&rn,this.offsetAndType[e]&rn,t):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&rn:this.offsetAndType[this.tokenCount]&rn: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]&rn,t=this.offsetAndType[t],this.tokenType=t>>Lr,this.tokenEnd=t&rn):(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>>Lr,this.tokenEnd=e&rn):(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]&rn: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&rn,s=o>>Lr;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:Uv[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}};function Dl(e,t){function n(d){return d<a?e.charCodeAt(d):0}function r(){if(c=Pl(e,c),Ol(n(c),n(c+1),n(c+2))){u=12,c=Ml(e,c);return}if(n(c)===37){u=11,c++;return}u=10}function o(){const d=c;if(c=Ml(e,c),ys(e,d,c,"url")&&n(c)===40){if(c=Rl(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(Af(m)){case d:c++;return;case 130:if(xl(m)){c+=kf(e,c,m),u=6;return}break;case 92:if(c===e.length-1)break;const h=n(c+1);xl(h)?c+=kf(e,c+1,h):In(m,h)&&(c=Xo(e,c)-1)}}}function s(){for(u=7,c=Rl(e,c);c<e.length;c++){const d=e.charCodeAt(c);switch(Af(d)){case 41:c++;return;case 130:if(c=Rl(e,c),n(c)===41||c>=e.length){c<e.length&&c++;return}c=Nf(e,c),u=8;return;case 34:case 39:case 40:case 133:c=Nf(e,c),u=8;return;case 92:if(In(d,n(c+1))){c=Xo(e,c)-1;break}c=Nf(e,c),u=8;return}}}e=String(e||"");const a=e.length;let l=qv(n(0)),c=l,u;for(;c<a;){const d=e.charCodeAt(c);switch(Af(d)){case 130:u=13,c=Rl(e,c+1);break;case 34:i();break;case 35:Wv(n(c+1))||In(n(c+1),n(c+2))?(u=4,c=Ml(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:Cf(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 44:u=18,c++;break;case 45:Cf(d,n(c+1),n(c+2))?r():n(c+1)===45&&n(c+2)===62?(u=15,c=c+3):Ol(d,n(c+1),n(c+2))?o():(u=9,c++);break;case 46:Cf(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:Ol(n(c+1),n(c+2),n(c+3))?(u=3,c=Ml(e,c+1)):(u=9,c++);break;case 91:u=19,c++;break;case 92:In(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 Ko=null,Ue=class xn{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return xn.createItem(t)}allocateCursor(t,n){let r;return Ko!==null?(r=Ko,Ko=Ko.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=Ko,Ko=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=xn.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 xn;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 xn;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 xn;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(xn.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(xn.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(xn.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(xn.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(xn.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 Bl(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}
|
|
33
|
+
`)}})}var Xv=100,$P=60,WP=" ";function Kv({source:e,line:t,column:n},r){function o(u,d){return i.slice(u,d).map((m,h)=>String(u+h+1).padStart(l)+" |"+m).join(`
|
|
34
|
+
`)}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>Xv&&(c=n-$P+3,n=58);for(let u=s;u<=a;u++)u>=0&&u<i.length&&(i[u]=i[u].replace(/\t/g,WP),i[u]=(c>0&&i[u].length>c?"…":"")+i[u].substr(c,98)+(i[u].length>c+Xv-1?"…":""));return[o(s,t),new Array(n+l+2).join("-")+"^",o(t,a)].filter(Boolean).join(`
|
|
35
|
+
`)}function Yv(e,t,n,r,o){return Object.assign(Bl("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment(i){return Kv({source:t,line:r,column:o},isNaN(i)?0:i)},get formattedMessage(){return`Parse error: ${e}
|
|
36
|
+
`+Kv({source:t,line:r,column:o},2)}})}function qP(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 Zv=()=>{},zP=33,UP=35,xf=59,Qv=123,Jv=0;function jP(e){return function(){return this[e]()}}function Of(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 VP(e){const t={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:Of(e.atrule),pseudo:Of(e.pseudo),node:Of(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]=jP(e.parseContext[n])}return{config:t,...t,...t.node}}function GP(e){let t="",n="<unknown>",r=!1,o=Zv,i=!1;const s=new BP,a=Object.assign(new FP,VP(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:qP,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(c){return c===Qv?1:0},consumeUntilLeftCurlyBracketOrSemicolon(c){return c===Qv||c===xf?1:0},consumeUntilExclamationMarkOrSemicolon(c){return c===zP||c===xf?1:0},consumeUntilSemicolonIncluded(c){return c===xf?2:0},createList(){return new Ue},createSingleNodeList(c){return new Ue().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 h=u.call(this,d);return i=!0,o(m,h),i=!1,h}},lookupNonWSType(c){let u;do if(u=this.lookupType(c++),u!==13)return u;while(u!==Jv);return Jv},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 Go(t,c,u)},cmpStr(c,u,d){return ys(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,Pl(t,this.tokenStart));return this.eat(c),u},eat(c){if(this.tokenType!==c){const u=Uv[c].slice(0,-6).replace(/-/g," ").replace(/^./,h=>h.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(UP)&&(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(PP(t,t.length-1)):s.getLocation(this.tokenStart);throw new Yv(c||"Unexpected input",t,d.offset,d.line,d.column)}});return Object.assign(function(c,u){t=c,u=u||{},a.setSource(t,Dl),s.setSource(t,u.offset,u.line,u.column),n=u.filename||"<unknown>",r=!!u.positions,o=typeof u.onParseError=="function"?u.onParseError:Zv,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,g,E)=>{if(f===25){const w=a.getLocation(g,E),T=ys(t,E-2,E,"*/")?t.slice(g+2,E-2):t.slice(g+2,E);m(T,w)}});const h=a.context[d].call(a,u);return a.eof||a.error(),h},{SyntaxError:Yv,config:a.config})}var XP=yr((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}})),KP=yr((e=>{var t=XP(),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,h=0,f=0,g,E;do{if(u>=m)throw new Error("Expected more digits in base 64 VLQ value.");if(E=t.decode(c.charCodeAt(u++)),E===-1)throw new Error("Invalid base64 digit: "+c.charAt(u-1));g=!!(E&i),E&=o,h=h+(E<<f),f+=n}while(g);d.value=a(h),d.rest=u}})),Rf=yr((e=>{function t(b,S,_){if(S in b)return b[S];if(arguments.length===3)return _;throw new Error('"'+S+'" is a required argument.')}e.getArg=t;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(b){var S=b.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(b){var S="";return b.scheme&&(S+=b.scheme+":"),S+="//",b.auth&&(S+=b.auth+"@"),b.host&&(S+=b.host),b.port&&(S+=":"+b.port),b.path&&(S+=b.path),S}e.urlGenerate=i;var s=32;function a(b){var S=[];return function(_){for(var k=0;k<S.length;k++)if(S[k].input===_){var x=S[0];return S[0]=S[k],S[k]=x,S[0].result}var N=b(_);return S.unshift({input:_,result:N}),S.length>s&&S.pop(),N}}var l=a(function(S){var _=S,k=o(S);if(k){if(!k.path)return S;_=k.path}for(var x=e.isAbsolute(_),N=[],W=0,O=0;;)if(W=O,O=_.indexOf("/",W),O===-1){N.push(_.slice(W));break}else for(N.push(_.slice(W,O));O<_.length&&_[O]==="/";)O++;for(var P,Q=0,O=N.length-1;O>=0;O--)P=N[O],P==="."?N.splice(O,1):P===".."?Q++:Q>0&&(P===""?(N.splice(O+1,Q),Q=0):(N.splice(O,2),Q--));return _=N.join("/"),_===""&&(_=x?"/":"."),k?(k.path=_,i(k)):_});e.normalize=l;function c(b,S){b===""&&(b="."),S===""&&(S=".");var _=o(S),k=o(b);if(k&&(b=k.path||"/"),_&&!_.scheme)return k&&(_.scheme=k.scheme),i(_);if(_||S.match(r))return S;if(k&&!k.host&&!k.path)return k.host=S,i(k);var x=S.charAt(0)==="/"?S:l(b.replace(/\/+$/,"")+"/"+S);return k?(k.path=x,i(k)):x}e.join=c,e.isAbsolute=function(b){return b.charAt(0)==="/"||n.test(b)};function u(b,S){b===""&&(b="."),b=b.replace(/\/$/,"");for(var _=0;S.indexOf(b+"/")!==0;){var k=b.lastIndexOf("/");if(k<0||(b=b.slice(0,k),b.match(/^([^\/]+:\/)?\/*$/)))return S;++_}return Array(_+1).join("../")+S.substr(b.length+1)}e.relative=u;var d=(function(){return!("__proto__"in Object.create(null))})();function m(b){return b}function h(b){return g(b)?"$"+b:b}e.toSetString=d?m:h;function f(b){return g(b)?b.slice(1):b}e.fromSetString=d?m:f;function g(b){if(!b)return!1;var S=b.length;if(S<9||b.charCodeAt(S-1)!==95||b.charCodeAt(S-2)!==95||b.charCodeAt(S-3)!==111||b.charCodeAt(S-4)!==116||b.charCodeAt(S-5)!==111||b.charCodeAt(S-6)!==114||b.charCodeAt(S-7)!==112||b.charCodeAt(S-8)!==95||b.charCodeAt(S-9)!==95)return!1;for(var _=S-10;_>=0;_--)if(b.charCodeAt(_)!==36)return!1;return!0}function E(b,S,_){var k=y(b.source,S.source);return k!==0||(k=b.originalLine-S.originalLine,k!==0)||(k=b.originalColumn-S.originalColumn,k!==0||_)||(k=b.generatedColumn-S.generatedColumn,k!==0)||(k=b.generatedLine-S.generatedLine,k!==0)?k:y(b.name,S.name)}e.compareByOriginalPositions=E;function w(b,S,_){var k=b.originalLine-S.originalLine;return k!==0||(k=b.originalColumn-S.originalColumn,k!==0||_)||(k=b.generatedColumn-S.generatedColumn,k!==0)||(k=b.generatedLine-S.generatedLine,k!==0)?k:y(b.name,S.name)}e.compareByOriginalPositionsNoSource=w;function T(b,S,_){var k=b.generatedLine-S.generatedLine;return k!==0||(k=b.generatedColumn-S.generatedColumn,k!==0||_)||(k=y(b.source,S.source),k!==0)||(k=b.originalLine-S.originalLine,k!==0)||(k=b.originalColumn-S.originalColumn,k!==0)?k:y(b.name,S.name)}e.compareByGeneratedPositionsDeflated=T;function L(b,S,_){var k=b.generatedColumn-S.generatedColumn;return k!==0||_||(k=y(b.source,S.source),k!==0)||(k=b.originalLine-S.originalLine,k!==0)||(k=b.originalColumn-S.originalColumn,k!==0)?k:y(b.name,S.name)}e.compareByGeneratedPositionsDeflatedNoLine=L;function y(b,S){return b===S?0:b===null?1:S===null?-1:b>S?1:-1}function p(b,S){var _=b.generatedLine-S.generatedLine;return _!==0||(_=b.generatedColumn-S.generatedColumn,_!==0)||(_=y(b.source,S.source),_!==0)||(_=b.originalLine-S.originalLine,_!==0)||(_=b.originalColumn-S.originalColumn,_!==0)?_:y(b.name,S.name)}e.compareByGeneratedPositionsInflated=p;function v(b){return JSON.parse(b.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=v;function C(b,S,_){if(S=S||"",b&&(b[b.length-1]!=="/"&&S[0]!=="/"&&(b+="/"),S=b+S),_){var k=o(_);if(!k)throw new Error("sourceMapURL could not be parsed");if(k.path){var x=k.path.lastIndexOf("/");x>=0&&(k.path=k.path.substring(0,x+1))}S=c(i(k),S)}return l(S)}e.computeSourceURL=C})),YP=yr((e=>{var t=Rf(),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})),ZP=yr((e=>{var t=Rf();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})),QP=yr((e=>{var t=KP(),n=Rf(),r=YP().ArraySet,o=ZP().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 h=a.sourceContentFor(d);h!=null&&u.setSourceContent(d,h)}),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,h=new r;this._mappings.unsortedForEach(function(f){if(f.source===u&&f.originalLine!=null){var g=a.originalPositionFor({line:f.originalLine,column:f.originalColumn});g.source!=null&&(f.source=g.source,c!=null&&(f.source=n.join(c,f.source)),d!=null&&(f.source=n.relative(d,f.source)),f.originalLine=g.line,f.originalColumn=g.column,g.name!=null&&(f.name=g.name))}var E=f.source;E!=null&&!m.has(E)&&m.add(E);var w=f.name;w!=null&&!h.has(w)&&h.add(w)},this),this._sources=m,this._names=h,a.sources.forEach(function(f){var g=a.sourceContentFor(f);g!=null&&(c!=null&&(f=n.join(c,f)),d!=null&&(f=n.relative(d,f)),this.setSourceContent(f,g))},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,h="",f,g,E,w,T=this._mappings.toArray(),L=0,y=T.length;L<y;L++){if(g=T[L],f="",g.generatedLine!==l)for(a=0;g.generatedLine!==l;)f+=";",l++;else if(L>0){if(!n.compareByGeneratedPositionsInflated(g,T[L-1]))continue;f+=","}f+=t.encode(g.generatedColumn-a),a=g.generatedColumn,g.source!=null&&(w=this._sources.indexOf(g.source),f+=t.encode(w-m),m=w,f+=t.encode(g.originalLine-1-u),u=g.originalLine-1,f+=t.encode(g.originalColumn-c),c=g.originalColumn,g.name!=null&&(E=this._names.indexOf(g.name),f+=t.encode(E-d),d=E)),h+=f}return h},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})),JP=QP(),eE=new Set(["Atrule","Selector","Declaration"]);function eI(e){const t=new JP.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&&eE.has(m.type)){const h=m.loc.start.line,f=m.loc.start.column-1;(r.line!==h||r.column!==f)&&(r.line=h,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&&eE.has(m.type)&&(o.line=s,o.column=a)};const u=e.emit;e.emit=function(m,h,f){for(let g=0;g<m.length;g++)m.charCodeAt(g)===10?(s++,a=0):a++;u(m,h,f)};const d=e.result;return e.result=function(){return l&&t.addMapping(i),{css:d(),map:t}},e}var tE=oe({safe:()=>oE,spec:()=>oI}),tI=43,nI=45,Mf=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},nE=[[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],["/","*"]],rI=nE.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 rE(e){const t=new Set(e.map(([n,r])=>Mf(n)<<16|Mf(r)));return function(n,r,o){const i=Mf(r,o),s=o.charCodeAt(0);return(s===nI&&r!==1&&r!==2&&r!==15||s===tI?t.has(n<<16|s<<8):t.has(n<<16|i))&&this.emit(" ",13,!0),i}}var oI=rE(nE),oE=rE(rI),iI=92;function sI(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 aI(e){Dl(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}function lI(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:oE,token(l,c){i=this.tokenBefore(i,l,c),this.emit(c,l,!1),l===9&&c.charCodeAt(0)===iI&&this.emit(`
|
|
37
|
+
`,13,!0)},emit(l){o+=l},result(){return o}};r&&(typeof r.decorator=="function"&&(s=r.decorator(s)),r.sourceMap&&(s=eI(s)),r.mode in tE&&(s.tokenBefore=tE[r.mode]));const a={node:l=>s.node(l),children:sI,token:(l,c)=>s.token(l,c),tokenize:aI};return s.node(n),s.result()}}function cI(e){return{fromPlainObject(t){return e(t,{enter(n){n.children&&!(n.children instanceof Ue)&&(n.children=new Ue().fromArray(n.children))}}),t},toPlainObject(t){return e(t,{leave(n){n.children&&n.children instanceof Ue&&(n.children=n.children.toArray())}}),t}}}var{hasOwnProperty:Pf}=Object.prototype,vs=function(){};function iE(e){return typeof e=="function"?e:vs}function sE(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function uI(e,t){const n=t.structure,r=[];for(const o in n){if(Pf.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 dI(e){const t={};for(const n in e.node)if(Pf.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]=uI(n,r)}return t}function aE(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 lE({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 fI(e){const t=dI(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(const c in t)Pf.call(t,c)&&t[c]!==null&&(n[c]=aE(t[c],!1),r[c]=aE(t[c],!0));const s=lE(n),a=lE(r),l=function(c,u){function d(w,T,L){const y=m.call(E,w,T,L);return y===o?!0:y===i?!1:!!(f.hasOwnProperty(w.type)&&f[w.type](w,E,d,g)||h.call(E,w,T,L)===o)}let m=vs,h=vs,f=n,g=(w,T,L,y)=>w||d(T,L,y);const E={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=iE(u.enter),h=iE(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=sE(m,u.visit),h=sE(h,u.visit)}if(m===vs&&h===vs)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,h,f){if(u.call(this,m,h,f))return d=m,o}),d},l.findLast=function(c,u){let d=null;return l(c,{reverse:!0,enter(m,h,f){if(u.call(this,m,h,f))return d=m,o}}),d},l.findAll=function(c,u){const d=[];return l(c,function(m,h,f){u.call(this,m,h,f)&&d.push(m)}),d},l}function mI(e){return e}function hI(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 pI(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 gI(e,t,n,r){const o=e.combinator===" "||r?e.combinator:" "+e.combinator+" ",i=e.terms.map(s=>If(s,t,n,r)).join(o);return e.explicit||n?(r||i[0]===","?"[":"[ ")+i+(r?"]":" ]"):i}function If(e,t,n,r){let o;switch(e.type){case"Group":o=gI(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return If(e.term,t,n,r)+t(hI(e),e);case"Type":o="<"+e.name+(e.opts?t(pI(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 Df(e,t){let n=mI,r=!1,o=!1;return typeof t=="function"?n=t:t&&(r=!!t.forceBraces,o=!!t.compact,typeof t.decorate=="function"&&(n=t.decorate)),If(e,n,r,o)}var cE={offset:0,line:1,column:1};function bI(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 h=n[m].value;m===r&&(a=h.length,s=c.length),i!==null&&n[m].node===i&&(m<=r?l++:l=0),c+=h}return r===n.length||l>1?(u=Hl(i||t,"end")||Es(cE,c),d=Es(u)):(u=Hl(i,"start")||Es(Hl(t,"start")||cE,c.slice(0,s)),d=Hl(i,"end")||Es(u,c.substr(s,a))),{css:c,mismatchOffset:s,mismatchLength:a,start:u,end:d}}function Hl(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?Es(n):n:null}function Es({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 Ss=function(e,t){const n=Bl("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},yI=function(e,t,n,r){const o=Bl("SyntaxMatchError",e),{css:i,mismatchOffset:s,mismatchLength:a,start:l,end:c}=bI(r,n);return o.rawMessage=e,o.syntax=t?Df(t):"<generic>",o.css=i,o.mismatchOffset=s,o.mismatchLength=a,o.message=e+`
|
|
38
|
+
syntax: `+o.syntax+`
|
|
39
|
+
value: `+(i||"<empty string>")+`
|
|
40
|
+
--------`+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},Fl=new Map,Yo=new Map,$l=45,yn=vI,Zo=EI;function Bf(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===$l&&e.charCodeAt(t+1)===$l}function uE(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===$l&&e.charCodeAt(t+1)!==$l){const n=e.indexOf("-",t+2);if(n!==-1)return e.substring(t,n+1)}return""}function vI(e){if(Fl.has(e))return Fl.get(e);const t=e.toLowerCase();let n=Fl.get(t);if(n===void 0){const r=Bf(t,0),o=r?"":uE(t,0);n=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:r})}return Fl.set(e,n),n}function EI(e){if(Yo.has(e))return Yo.get(e);let t=e,n=e[0];n==="/"?n=e[1]==="/"?"//":"/":n!=="_"&&n!=="*"&&n!=="$"&&n!=="#"&&n!=="+"&&n!=="&"&&(n="");const r=Bf(t,n.length);if(!r&&(t=t.toLowerCase(),Yo.has(t))){const a=Yo.get(t);return Yo.set(e,a),a}const o=r?"":uE(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 Yo.set(e,s),s}var dE=["initial","inherit","unset","revert","revert-layer"],ws=43,Dn=45,Hf=110,Qo=!0,SI=!1;function Ff(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function _s(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===ws||o===Dn){if(n)return 0;t++}for(;t<e.value.length;t++)if(!ut(e.value.charCodeAt(t)))return 0;return r+1}function $f(e,t,n){let r=!1,o=_s(e,t,n);if(e=n(o),e===null)return t;if(e.type!==10)if(Ff(e,ws)||Ff(e,Dn)){if(r=!0,o=_s(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!==ws&&i!==Dn)return 0}return Nr(e,r?0:1,r,o)}function wI(e,t){let n=0;if(!e)return 0;if(e.type===10)return Nr(e,0,SI,n);if(e.type===1&&e.value.charCodeAt(0)===Dn){if(!Go(e.value,1,Hf))return 0;switch(e.value.length){case 2:return $f(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==Dn?0:(n=_s(t(++n),n,t),e=t(n),Nr(e,0,Qo,n));default:return e.value.charCodeAt(2)!==Dn?0:Nr(e,3,Qo,n)}}else if(e.type===1||Ff(e,ws)&&t(n+1).type===1){if(e.type!==1&&(e=t(++n)),e===null||!Go(e.value,0,Hf))return 0;switch(e.value.length){case 1:return $f(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==Dn?0:(n=_s(t(++n),n,t),e=t(n),Nr(e,0,Qo,n));default:return e.value.charCodeAt(1)!==Dn?0:Nr(e,2,Qo,n)}}else if(e.type===12){let r=e.value.charCodeAt(0),o=r===ws||r===Dn?1:0,i=o;for(;i<e.value.length&&ut(e.value.charCodeAt(i));i++);return i===o||!Go(e.value,i,Hf)?0:i+1===e.value.length?$f(t(++n),n,t):e.value.charCodeAt(i+1)!==Dn?0:i+2===e.value.length?(n=_s(t(++n),n,t),e=t(n),Nr(e,0,Qo,n)):Nr(e,i+2,Qo,n)}return 0}var _I=43,fE=45,mE=63,CI=117;function Wf(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function TI(e,t){return e.value.charCodeAt(0)===t}function Cs(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){const i=e.value.charCodeAt(o);if(i===fE&&n&&r!==0)return Cs(e,t+r+1,!1),6;if(!kr(i)||++r>6)return 0}return r}function Wl(e,t,n){if(!e)return 0;for(;Wf(n(t),mE);){if(++e>6)return 0;t++}return t}function AI(e,t){let n=0;if(e===null||e.type!==1||!Go(e.value,0,CI)||(e=t(++n),e===null))return 0;if(Wf(e,_I))return e=t(++n),e===null?0:e.type===1?Wl(Cs(e,0,!0),++n,t):Wf(e,mE)?Wl(1,++n,t):0;if(e.type===10){const r=Cs(e,1,!0);return r===0?0:(e=t(++n),e===null?n:e.type===12||e.type===10?!TI(e,fE)||!Cs(e,1,!1)?0:n+1:Wl(r,n,t))}return e.type===12?Wl(Cs(e,1,!0),++n,t):0}var kI=["calc(","-moz-calc(","-webkit-calc("],qf=new Map([[2,22],[21,22],[19,20],[23,24]]),LI=["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"],NI=["deg","grad","rad","turn"],xI=["s","ms"],OI=["hz","khz"],RI=["dpi","dpcm","dppx","x"],MI=["fr"],PI=["db"],II=["st"];function vn(e,t){return t<e.length?e.charCodeAt(t):0}function hE(e,t){return ys(e,0,e.length,t)}function pE(e,t){for(let n=0;n<t.length;n++)if(hE(e,t[n]))return!0;return!1}function gE(e,t){return t!==e.length-2?!1:vn(e,t)===92&&ut(vn(e,t+1))}function ql(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 DI(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=qf.get(e.type)}o++}while(e=t(o));return o}function on(e){return function(t,n,r){return t===null?0:t.type===2&&pE(t.value,kI)?DI(t,n):e(t,n,r)}}function xe(e){return function(t){return t===null||t.type!==e?0:1}}function BI(e){if(e===null||e.type!==1)return 0;const t=e.value.toLowerCase();return pE(t,dE)||hE(t,"default")?0:1}function HI(e){return e===null||e.type!==1||vn(e.value,0)!==45||vn(e.value,1)!==45?0:1}function FI(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(!kr(vn(e.value,n)))return 0;return 1}function $I(e){return e===null||e.type!==4||!Ol(vn(e.value,1),vn(e.value,2),vn(e.value,3))?0:1}function WI(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=qf.get(e.type)}o++}while(e=t(o));return o}function qI(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=qf.get(e.type)}o++}while(e=t(o));return o}function lr(e){return e&&(e=new Set(e)),function(t,n,r){if(t===null||t.type!==12)return 0;const o=Pl(t.value,0);if(e!==null){const i=t.value.indexOf("\\",o),s=i===-1||!gE(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(s.toLowerCase())===!1)return 0}return ql(r,t.value,o)?0:1}}function zI(e,t,n){return e===null||e.type!==11||ql(n,e.value,e.value.length-1)?0:1}function bE(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 UI(e,t,n){if(e===null)return 0;const r=Pl(e.value,0);return r!==e.value.length&&!gE(e.value,r)||ql(n,e.value,r)?0:1}function jI(e,t,n){if(e===null||e.type!==10)return 0;let r=vn(e.value,0)===43||vn(e.value,0)===45?1:0;for(;r<e.value.length;r++)if(!ut(vn(e.value,r)))return 0;return ql(n,e.value,r)?0:1}var yE={"ident-token":xe(1),"function-token":xe(2),"at-keyword-token":xe(3),"hash-token":xe(4),"string-token":xe(5),"bad-string-token":xe(6),"url-token":xe(7),"bad-url-token":xe(8),"delim-token":xe(9),"number-token":xe(10),"percentage-token":xe(11),"dimension-token":xe(12),"whitespace-token":xe(13),"CDO-token":xe(14),"CDC-token":xe(15),"colon-token":xe(16),"semicolon-token":xe(17),"comma-token":xe(18),"[-token":xe(19),"]-token":xe(20),"(-token":xe(21),")-token":xe(22),"{-token":xe(23),"}-token":xe(24),string:xe(5),ident:xe(1),"custom-ident":BI,"custom-property-name":HI,"hex-color":FI,"id-selector":$I,"an-plus-b":wI,urange:AI,"declaration-value":WI,"any-value":qI,dimension:on(lr(null)),angle:on(lr(NI)),decibel:on(lr(PI)),frequency:on(lr(OI)),flex:on(lr(MI)),length:on(bE(lr(LI))),resolution:on(lr(RI)),semitones:on(lr(II)),time:on(lr(xI)),percentage:on(zI),zero:bE(),number:on(UI),integer:on(jI)};function VI(e,t,n){return Object.assign(Bl("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+`
|
|
41
|
+
`+t+`
|
|
42
|
+
--`+new Array((n||t.length)+1).join("-")+"^"})}var GI=9,XI=10,KI=12,YI=13,ZI=32,QI=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!==YI&&t!==XI&&t!==KI&&t!==ZI&&t!==GI)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 VI(e,this.str,this.pos)}},JI=9,e5=10,t5=12,n5=13,r5=32,vE=33,zf=35,EE=38,zl=39,SE=40,o5=41,wE=42,Uf=43,jf=44,_E=45,Vf=60,CE=62,Gf=63,i5=64,Ul=91,Xf=93,jl=123,TE=124,AE=125,kE=8734,Ts=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),LE={" ":1,"&&":2,"||":3,"|":4};function Vl(e){return e.substringToPos(e.findWsEnd(e.pos))}function Jo(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n>=128||Ts[n]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function Gl(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 s5(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 NE(e){let t=null,n=null;return e.eat(jl),t=Gl(e),e.charCode()===jf?(e.pos++,e.charCode()!==AE&&(n=Gl(e))):n=t,e.eat(AE),{min:Number(t),max:n?Number(n):0}}function a5(e){let t=null,n=!1;switch(e.charCode()){case wE:e.pos++,t={min:0,max:0};break;case Uf:e.pos++,t={min:1,max:0};break;case Gf:e.pos++,t={min:0,max:1};break;case zf:e.pos++,n=!0,e.charCode()===jl?t=NE(e):e.charCode()===Gf?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case jl:t=NE(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function ei(e,t){const n=a5(e);return n!==null?(n.term=t,e.charCode()===zf&&e.charCodeAt(e.pos-1)===Uf?ei(e,n):n):t}function Kf(e){const t=e.peek();return t===""?null:{type:"Token",value:t}}function l5(e){let t;return e.eat(Vf),e.eat(zl),t=Jo(e),e.eat(zl),e.eat(CE),ei(e,{type:"Property",name:t})}function c5(e){let t=null,n=null,r=1;return e.eat(Ul),e.charCode()===_E&&(e.peek(),r=-1),r==-1&&e.charCode()===kE?e.peek():(t=r*Number(Gl(e)),Ts[e.charCode()]!==0&&(t+=Jo(e))),Vl(e),e.eat(jf),Vl(e),e.charCode()===kE?e.peek():(r=1,e.charCode()===_E&&(e.peek(),r=-1),n=r*Number(Gl(e)),Ts[e.charCode()]!==0&&(n+=Jo(e))),e.eat(Xf),{type:"Range",min:t,max:n}}function u5(e){let t,n=null;return e.eat(Vf),t=Jo(e),e.charCode()===SE&&e.nextCharCode()===o5&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===Ul&&(Vl(e),n=c5(e)),e.eat(CE),ei(e,{type:"Type",name:t,opts:n})}function d5(e){const t=Jo(e);return e.charCode()===SE?(e.pos++,{type:"Function",name:t}):ei(e,{type:"Keyword",name:t})}function f5(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)=>LE[o]-LE[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 xE(e){const t=[],n={};let r,o=null,i=e.pos;for(;r=h5(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:f5(t,n)||" ",disallowEmpty:!1,explicit:!1}}function m5(e){let t;return e.eat(Ul),t=xE(e),e.eat(Xf),t.explicit=!0,e.charCode()===vE&&(e.pos++,t.disallowEmpty=!0),t}function h5(e){let t=e.charCode();if(t<128&&Ts[t]===1)return d5(e);switch(t){case Xf:break;case Ul:return ei(e,m5(e));case Vf:return e.nextCharCode()===zl?l5(e):u5(e);case TE:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===TE?2:1))};case EE:return e.pos++,e.eat(EE),{type:"Combinator",value:"&&"};case jf:return e.pos++,{type:"Comma"};case zl:return ei(e,{type:"String",value:s5(e)});case r5:case JI:case e5:case n5:case t5:return{type:"Spaces",value:Vl(e)};case i5:return t=e.nextCharCode(),t<128&&Ts[t]===1?(e.pos++,{type:"AtKeyword",name:Jo(e)}):Kf(e);case wE:case Uf:case Gf:case zf:case vE:break;case jl:if(t=e.nextCharCode(),t<48||t>57)return Kf(e);break;default:return Kf(e)}}function OE(e){const t=new QI(e),n=xE(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var As=function(){};function RE(e){return typeof e=="function"?e:As}function p5(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=As,i=As;if(typeof t=="function"?o=t:t&&(o=RE(t.enter),i=RE(t.leave)),o===As&&i===As)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var g5={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 b5(e){const t=[];return Dl(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function y5(e,t){return typeof e=="string"?b5(e):t.generate(e,g5)}var Ee={type:"Match"},_e={type:"Mismatch"},Yf={type:"DisallowEmpty"},v5=40,E5=41;function gt(e,t,n){return t===Ee&&n===_e||e===Ee&&t===Ee&&n===Ee?e:(e.type==="If"&&e.else===_e&&t===Ee&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function ME(e){return e.length>2&&e.charCodeAt(e.length-2)===v5&&e.charCodeAt(e.length-1)===E5}function PE(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&ME(e.name)}function Zf(e,t,n){switch(e){case" ":{let r=Ee;for(let o=t.length-1;o>=0;o--){const i=t[o];r=gt(i,r,_e)}return r}case"|":{let r=_e,o=null;for(let i=t.length-1;i>=0;i--){let s=t[i];if(PE(s)&&(o===null&&i>0&&PE(t[i-1])&&(o=Object.create(null),r=gt({type:"Enum",map:o},Ee,r)),o!==null)){const a=(ME(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=gt(s,Ee,r)}return r}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let r=_e;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Zf(e,t.filter(function(a){return a!==i}),!1):s=Ee,r=gt(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?Ee:_e;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Zf(e,t.filter(function(a){return a!==i}),!0):s=Ee,r=gt(i,s,r)}return r}}}function S5(e){let t=Ee,n=Qf(e.term);if(e.max===0)n=gt(n,Yf,_e),t=gt(n,null,_e),t.then=gt(Ee,Ee,t),e.comma&&(t.then.else=gt({type:"Comma",syntax:e},t,_e));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==Ee&&(t=gt({type:"Comma",syntax:e},t,_e)),t=gt(n,gt(Ee,Ee,t),_e);if(e.min===0)t=gt(Ee,Ee,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==Ee&&(t=gt({type:"Comma",syntax:e},t,_e)),t=gt(n,t,_e);return t}function Qf(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Zf(e.combinator,e.terms.map(Qf),!1);return e.disallowEmpty&&(t=gt(t,Yf,_e)),t}case"Multiplier":return S5(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 Jf(e,t){return typeof e=="string"&&(e=OE(e)),{type:"MatchGraph",match:Qf(e),syntax:t||null,source:e}}var{hasOwnProperty:IE}=Object.prototype,w5=0,_5=1,em=2,DE=3,BE="Match",C5="Mismatch",T5="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",A5=15e3,k5=0;function L5(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function tm(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 N5(e){return e.type!==9?!1:e.value!=="?"}function HE(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||N5(e)}function FE(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function x5(e,t,n){function r(){do T++,w=T<e.length?e[T]:null;while(w!==null&&(w.type===13||w.type===25))}function o(p){const v=T+p;return v<e.length?e[v]:null}function i(p,v){return{nextState:p,matchStack:y,syntaxStack:d,thenStack:m,tokenIndex:T,prev:v}}function s(p){m={nextState:p,matchStack:y,syntaxStack:d,prev:m}}function a(p){h=i(p,h)}function l(){y={type:_5,syntax:t.syntax,token:w,prev:y},r(),f=null,T>L&&(L=T)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},y={type:em,syntax:t.syntax,token:y.token,prev:y}}function u(){y.type===em?y=y.prev:y={type:DE,syntax:d.syntax,token:y.token,prev:y},d=d.prev}let d=null,m=null,h=null,f=null,g=0,E=null,w=null,T=-1,L=0,y={type:w5,syntax:null,token:null,prev:null};for(r();E===null&&++g<A5;)switch(t.type){case"Match":if(m===null){if(w!==null&&(T!==e.length-1||w.value!=="\\0"&&w.value!=="\\9")){t=_e;break}E=BE;break}if(t=m.nextState,t===Yf)if(m.matchStack===y){t=_e;break}else t=Ee;for(;m.syntaxStack!==d;)u();m=m.prev;break;case"Mismatch":if(f!==null&&f!==!1)(h===null||T>h.tokenIndex)&&(h=f,f=!1);else if(h===null){E=C5;break}t=h.nextState,m=h.thenStack,d=h.syntaxStack,y=h.matchStack,T=h.tokenIndex,w=T<e.length?e[T]:null,h=h.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==_e&&a(t.else),t.then!==Ee&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const C=t.syntax.terms;if(t.index===C.length){if(t.mask===0||t.syntax.all){t=_e;break}t=Ee;break}if(t.mask===(1<<C.length)-1){t=Ee;break}for(;t.index<C.length;t.index++){const b=1<<t.index;if((t.mask&b)===0){a(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|b}),t=C[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(w!==null){let C=w.value.toLowerCase();if(C.indexOf("\\")!==-1&&(C=C.replace(/\\[09].*$/,"")),IE.call(t.map,C)){t=t.map[C];break}}t=_e;break;case"Generic":{const C=d!==null?d.opts:null,b=T+Math.floor(t.fn(w,o,C));if(!isNaN(b)&&b>T){for(;T<b;)l();t=Ee}else t=_e;break}case"Type":case"Property":{const C=t.type==="Type"?"types":"properties",b=IE.call(n,C)?n[C][t.name]:null;if(!b||!b.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(f!==!1&&w!==null&&t.type==="Type"&&(t.name==="custom-ident"&&w.type===1||t.name==="length"&&w.value==="0")){f===null&&(f=i(t,h)),t=_e;break}c(),t=b.match;break}case"Keyword":{const C=t.name;if(w!==null){let b=w.value;if(b.indexOf("\\")!==-1&&(b=b.replace(/\\[09].*$/,"")),tm(b,C)){l(),t=Ee;break}}t=_e;break}case"AtKeyword":case"Function":if(w!==null&&tm(w.value,t.name)){l(),t=Ee;break}t=_e;break;case"Token":if(w!==null&&w.value===t.value){l(),t=Ee;break}t=_e;break;case"Comma":w!==null&&w.type===18?HE(y.token)?t=_e:(l(),t=FE(w)?_e:Ee):t=HE(y.token)||FE(w)?Ee:_e;break;case"String":let p="",v=T;for(;v<e.length&&p.length<t.value.length;v++)p+=e[v].value;if(tm(p,t.value)){for(;T<v;)l();t=Ee}else t=_e;break;default:throw new Error("Unknown node type: "+t.type)}switch(k5+=g,E){case null:E=T5,y=null;break;case BE:for(;d!==null;)u();break;default:y=null}return{tokens:e,reason:E,iterations:g,match:y,longestMatch:L}}function $E(e,t,n){const r=x5(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=L5(o).prev;o!==null;){switch(o.type){case em:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case DE: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 O5=oe({getTrace:()=>WE,isKeyword:()=>P5,isProperty:()=>M5,isType:()=>R5});function WE(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 R5(e,t){return nm(this,e,n=>n.type==="Type"&&n.name===t)}function M5(e,t){return nm(this,e,n=>n.type==="Property"&&n.name===t)}function P5(e){return nm(this,e,t=>t.type==="Keyword")}function nm(e,t,n){const r=WE.call(e,t);return r===null?!1:r.some(n)}function qE(e){return"node"in e?e.node:qE(e.match[0])}function zE(e){return"node"in e?e.node:zE(e.match[e.match.length-1])}function UE(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){const l=qE(a),c=zE(a);e.syntax.walk(t,function(u,d,m){if(u===l){const h=new Ue;do{if(h.appendData(d.data),d.data===c)break;d=d.next}while(d!==null);s.push({parent:m,nodes:h})}})}Array.isArray(a.match)&&a.match.forEach(i)}const s=[];return n.matched!==null&&i(n.matched),s}var{hasOwnProperty:ks}=Object.prototype;function rm(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function jE(e){return!!e&&rm(e.offset)&&rm(e.line)&&rm(e.column)}function I5(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(ks.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(!jE(r.loc.start))i+=".start";else if(!jE(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 Ue)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(const i in t)ks.call(t,i)&&ks.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function D5(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const i in n){if(ks.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:I5(e,r)}}function B5(e){const t={};if(e.node){for(const n in e.node)if(ks.call(e.node,n)){const r=e.node[n];if(r.structure)t[n]=D5(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var H5=Jf(dE.join(" | "));function om(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:Df(e[o].syntax,{compact:t}));return r}function F5(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:Df(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&om(i.descriptors,t,n)};return r}function $5(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function En(e,t,n){return{matched:e,iterations:n,error:t,...O5}}function ti(e,t,n,r){const o=y5(n,e.syntax);let i;return $5(o)?En(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=$E(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=$E(o,t.match,e),!i.match)?En(null,new yI(i.reason,t.syntax,n,i),i.iterations):En(i.match,null,i.iterations))}var VE=class{constructor(e,t,n){if(this.cssWideKeywordsSyntax=H5,this.syntax=t,this.generic=!1,this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||B5(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 yE)this.addType_(r,yE[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=Jf(e,o):(typeof e=="string"?Object.defineProperty(i,"syntax",{get(){return Object.defineProperty(i,"syntax",{value:OE(e)}),i.syntax}}):i.syntax=e,Object.defineProperty(i,"match",{get(){return Object.defineProperty(i,"match",{value:Jf(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 Ss("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&&!ti(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=yn(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 Ss("Unknown at-rule descriptor",t)}checkPropertyName(e){if(!this.getProperty(e))return new Ss("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return En(null,n);const r=this.getAtrule(e);return r.prelude?ti(this,r.prelude,t||"",!1):En(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return En(null,r);const o=this.getAtrule(e),i=yn(t);return ti(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return e.type!=="Declaration"?En(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(Zo(e).custom)return En(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?En(null,n):ti(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?ti(this,n,t,!1):En(null,new Ss("Unknown type",e))}match(e,t){return typeof e!="string"&&(!e||!e.type)?En(null,new Ss("Bad syntax")):((typeof e=="string"||!e.match)&&(e=this.createDescriptor(e,"Type","anonymous")),ti(this,e,t,!1))}findValueFragments(e,t,n,r){return UE(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return UE(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=yn(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=Zo(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&&p5(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:om(this.types,!t,e),properties:om(this.properties,!t,e),atrules:F5(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}},{hasOwnProperty:ni}=Object.prototype,W5={generic:!0,types:im,atrules:{prelude:YE,descriptors:YE},properties:im,parseContext:q5,scope:XE,atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function Xl(e){return e&&e.constructor===Object}function GE(e){return Xl(e)?{...e}:e}function q5(e,t){return Object.assign(e,t)}function XE(e,t){for(const n in t)ni.call(t,n)&&(Xl(e[n])?XE(e[n],t[n]):e[n]=GE(t[n]));return e}function KE(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function im(e,t){if(typeof t=="string")return KE(e,t);const n={...e};for(let r in t)ni.call(t,r)&&(n[r]=KE(ni.call(e,r)?e[r]:void 0,t[r]));return n}function YE(e,t){const n=im(e,t);return!Xl(n)||Object.keys(n).length?n:null}function Ls(e,t,n){for(const r in n)if(ni.call(n,r)!==!1){if(n[r]===!0)ni.call(t,r)&&(e[r]=GE(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(Xl(n[r])){const o={};for(let i in e[r])o[i]=Ls({},e[r][i],n[r]);for(let i in t[r])o[i]=Ls(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&&Ls(o[s],a,i);for(const s in t[r])ni.call(t[r],s)&&(o[s]||(o[s]={}),t[r]&&t[r][s]&&Ls(o[s],t[r][s],i));e[r]=o}}}return e}var sm=(e,t)=>Ls(e,t,W5);function ZE(e){const t=GP(e),n=fI(e),r=lI(e),{fromPlainObject:o,toPlainObject:i}=cI(n),s={lexer:null,createLexer:a=>new VE(a,s,s.lexer.structure),tokenize:Dl,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){const l=sm({},e);return ZE(typeof a=="function"?a(l,Object.assign):sm(l,a))}};return s.lexer=new VE({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var z5=e=>ZE(sm({},e)),U5={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>"}}}},j5=oe({generate:()=>K5,name:()=>G5,parse:()=>QE,structure:()=>X5}),Bn=43,Vt=45,Kl=110,oo=!0,V5=!1;function Yl(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===Bn||r===Vt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)ut(this.charCodeAt(n))||this.error("Integer is expected",n)}function ri(e){return Yl.call(this,0,e)}function xr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Kl:n="N is expected";break;case Vt:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function am(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10)if(this.isDelim(Bn,e)||this.isDelim(Vt,e)){t=this.isDelim(Bn,e)?Bn:Vt;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),ri.call(this,oo))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==Bn&&n!==Vt&&this.error("Number sign is expected")),ri.call(this,t!==0),t===Vt?"-"+this.consume(10):this.consume(10)}var G5="AnPlusB",X5={a:[String,null],b:[String,null]};function QE(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===10)ri.call(this,V5),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Vt))switch(t="-1",xr.call(this,1,Kl),this.tokenEnd-this.tokenStart){case 2:this.next(),n=am.call(this);break;case 3:xr.call(this,2,Vt),this.next(),this.skipSC(),ri.call(this,oo),n="-"+this.consume(10);break;default:xr.call(this,2,Vt),Yl.call(this,3,oo),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Bn)&&this.lookupType(1)===1){let r=0;switch(t="1",this.isDelim(Bn)&&(r=1,this.next()),xr.call(this,0,Kl),this.tokenEnd-this.tokenStart){case 1:this.next(),n=am.call(this);break;case 2:xr.call(this,1,Vt),this.next(),this.skipSC(),ri.call(this,oo),n="-"+this.consume(10);break;default:xr.call(this,1,Vt),Yl.call(this,2,oo),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){const r=this.charCodeAt(this.tokenStart),o=r===Bn||r===Vt;let i=this.tokenStart+o;for(;i<this.tokenEnd&&ut(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),xr.call(this,i-this.tokenStart,Kl),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=am.call(this)):(xr.call(this,i-this.tokenStart+1,Vt),i+2===this.tokenEnd?(this.next(),this.skipSC(),ri.call(this,oo),n="-"+this.consume(10)):(Yl.call(this,i-this.tokenStart+2,oo),this.next(),n=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===Bn&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===Bn&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function K5(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 Y5=oe({generate:()=>t3,name:()=>Q5,parse:()=>eS,structure:()=>e3,walkContext:()=>J5});function JE(e){return this.Raw(e,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function Z5(){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 Q5="Atrule",J5="atrule",e3={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function eS(){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),JE):r=JE.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(Z5.call(this))}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:t,prelude:r,block:o}}function t3(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var n3=oe({generate:()=>s3,name:()=>r3,parse:()=>tS,structure:()=>i3,walkContext:()=>o3}),r3="AtrulePrelude",o3="atrulePrelude",i3={children:[[]]};function tS(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 s3(e){this.children(e)}var a3=oe({generate:()=>p3,name:()=>m3,parse:()=>rS,structure:()=>h3}),l3=36,nS=42,Zl=61,c3=94,lm=124,u3=126;function d3(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(nS)?(t=!0,this.next()):this.isDelim(lm)||this.eat(1),this.isDelim(lm)?this.charCodeAt(this.tokenStart+1)!==Zl?(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 f3(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==Zl&&t!==u3&&t!==c3&&t!==l3&&t!==nS&&t!==lm&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==Zl&&(this.isDelim(Zl)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var m3="AttributeSelector",h3={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function rS(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=d3.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=f3.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 p3(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 g3=oe({generate:()=>w3,name:()=>v3,parse:()=>sS,structure:()=>S3,walkContext:()=>E3});function oS(e){return this.Raw(e,null,!0)}function b3(){return this.parseWithFallback(this.Rule,oS)}function iS(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function y3(){if(this.tokenType===17)return iS.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,iS);return this.tokenType===17&&this.next(),e}var v3="Block",E3="block",S3={children:[["Atrule","Rule","Declaration"]]};function sS(e){const t=e?y3:b3,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,oS));break;default:r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function w3(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var _3=oe({generate:()=>A3,name:()=>C3,parse:()=>aS,structure:()=>T3}),C3="Brackets",T3={children:[[]]};function aS(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 A3(e){this.token(9,"["),this.children(e),this.token(9,"]")}var k3=oe({generate:()=>N3,name:()=>"CDC",parse:()=>lS,structure:()=>L3}),iee="CDC",L3=[];function lS(){const e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function N3(){this.token(15,"-->")}var x3=oe({generate:()=>R3,name:()=>"CDO",parse:()=>cS,structure:()=>O3}),see="CDO",O3=[];function cS(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function R3(){this.token(14,"<!--")}var M3=oe({generate:()=>B3,name:()=>I3,parse:()=>uS,structure:()=>D3}),P3=46,I3="ClassSelector",D3={name:String};function uS(){return this.eatDelim(P3),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function B3(e){this.token(9,"."),this.token(1,e.name)}var H3=oe({generate:()=>U3,name:()=>q3,parse:()=>fS,structure:()=>z3}),F3=43,dS=47,$3=62,W3=126,q3="Combinator",z3={name:String};function fS(){const e=this.tokenStart;let t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case $3:case F3:case W3:this.next();break;case dS:this.next(),this.eatIdent("deep"),this.eatDelim(dS);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function U3(e){this.tokenize(e.name)}var j3=oe({generate:()=>Y3,name:()=>X3,parse:()=>mS,structure:()=>K3}),V3=42,G3=47,X3="Comment",K3={value:String};function mS(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===V3&&this.charCodeAt(t-1)===G3&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function Y3(e){this.token(25,"/*"+e.value+"*/")}var Z3=oe({generate:()=>cD,name:()=>sD,parse:()=>gS,structure:()=>lD,walkContext:()=>aD}),hS=33,Q3=35,J3=36,eD=38,tD=42,nD=43,pS=47;function rD(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function oD(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function iD(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(hS)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var sD="Declaration",aD="declaration",lD={important:[Boolean,String],property:String,value:["Value","Raw"]};function gS(){const e=this.tokenStart,t=this.tokenIndex,n=uD.call(this),r=Bf(n),o=r?this.parseCustomProperty:this.parseValue,i=r?oD:rD;let s=!1,a;this.skipSC(),this.eat(16);const l=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback(iD,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(hS)&&(s=dD.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 cD(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 uD(){const e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case tD:case J3:case nD:case Q3:case eD:this.next();break;case pS:this.next(),this.isDelim(pS)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function dD(){this.eat(9),this.skipSC();const e=this.consume(1);return e==="important"?!0:e}var fD=oe({generate:()=>gD,name:()=>hD,parse:()=>bS,structure:()=>pD});function mD(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}var hD="DeclarationList",pD={children:[["Declaration"]]};function bS(){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,mD))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function gD(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var bD=oe({generate:()=>ED,name:()=>yD,parse:()=>yS,structure:()=>vD}),yD="Dimension",vD={value:String,unit:String};function yS(){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 ED(e){this.token(12,e.value+e.unit)}var SD=oe({generate:()=>TD,name:()=>wD,parse:()=>vS,structure:()=>CD,walkContext:()=>_D}),wD="Function",_D="function",CD={name:String,children:[[]]};function vS(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 TD(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var AD=oe({generate:()=>ND,name:()=>kD,parse:()=>ES,structure:()=>LD,xxx:()=>"XXX"}),aee="XXX",kD="Hash",LD={value:String};function ES(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function ND(e){this.token(4,"#"+e.value)}var xD=oe({generate:()=>MD,name:()=>OD,parse:()=>SS,structure:()=>RD}),OD="Identifier",RD={name:String};function SS(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function MD(e){this.token(1,e.name)}var PD=oe({generate:()=>BD,name:()=>ID,parse:()=>wS,structure:()=>DD}),ID="IdSelector",DD={name:String};function wS(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function BD(e){this.token(9,"#"+e.name)}var HD=oe({generate:()=>WD,name:()=>FD,parse:()=>_S,structure:()=>$D}),FD="MediaFeature",$D={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function _S(){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 WD(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var qD=oe({generate:()=>jD,name:()=>zD,parse:()=>CS,structure:()=>UD}),zD="MediaQuery",UD={children:[["Identifier","MediaFeature","WhiteSpace"]]};function CS(){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 jD(e){this.children(e)}var VD=oe({generate:()=>KD,name:()=>GD,parse:()=>TS,structure:()=>XD}),GD="MediaQueryList",XD={children:[["MediaQuery"]]};function TS(){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 KD(e){this.children(e,()=>this.token(18,","))}var YD=oe({generate:()=>QD,name:()=>"Nth",parse:()=>AS,structure:()=>ZD}),lee="Nth",ZD={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function AS(){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 QD(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var JD=oe({generate:()=>n4,name:()=>e4,parse:()=>kS,structure:()=>t4}),e4="Number",t4={value:String};function kS(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function n4(e){this.token(10,e.value)}var r4=oe({generate:()=>s4,name:()=>o4,parse:()=>LS,structure:()=>i4}),o4="Operator",i4={value:String};function LS(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function s4(e){this.tokenize(e.value)}var a4=oe({generate:()=>u4,name:()=>l4,parse:()=>NS,structure:()=>c4}),l4="Parentheses",c4={children:[[]]};function NS(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 u4(e){this.token(21,"("),this.children(e),this.token(22,")")}var d4=oe({generate:()=>h4,name:()=>f4,parse:()=>xS,structure:()=>m4}),f4="Percentage",m4={value:String};function xS(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function h4(e){this.token(11,e.value+"%")}var p4=oe({generate:()=>v4,name:()=>g4,parse:()=>OS,structure:()=>y4,walkContext:()=>b4}),g4="PseudoClassSelector",b4="function",y4={name:String,children:[["Raw"],null]};function OS(){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 v4(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var E4=oe({generate:()=>C4,name:()=>S4,parse:()=>RS,structure:()=>_4,walkContext:()=>w4}),S4="PseudoElementSelector",w4="function",_4={name:String,children:[["Raw"],null]};function RS(){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 C4(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 T4=oe({generate:()=>x4,name:()=>L4,parse:()=>PS,structure:()=>N4}),A4=47,k4=46;function MS(){this.skipSC();const e=this.consume(10);for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);!ut(n)&&n!==k4&&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 L4="Ratio",N4={left:String,right:String};function PS(){const e=this.tokenStart,t=MS.call(this);let n;return this.skipSC(),this.eatDelim(A4),n=MS.call(this),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function x4(e){this.token(10,e.left),this.token(9,"/"),this.token(10,e.right)}var O4=oe({generate:()=>P4,name:()=>"Raw",parse:()=>IS,structure:()=>M4});function R4(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var cee="Raw",M4={value:String};function IS(e,t,n){const r=this.getTokenStart(e);let o;return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),n&&this.tokenStart>r?o=R4.call(this):o=this.tokenStart,{type:"Raw",loc:this.getLocation(r,o),value:this.substring(r,o)}}function P4(e){this.tokenize(e.value)}var I4=oe({generate:()=>$4,name:()=>B4,parse:()=>BS,structure:()=>F4,walkContext:()=>H4});function DS(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function D4(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var B4="Rule",H4="rule",F4={prelude:["SelectorList","Raw"],block:["Block"]};function BS(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return this.parseRulePrelude?n=this.parseWithFallback(D4,DS):n=DS.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function $4(e){this.node(e.prelude),this.node(e.block)}var W4=oe({generate:()=>U4,name:()=>q4,parse:()=>HS,structure:()=>z4}),q4="Selector",z4={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function HS(){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 U4(e){this.children(e)}var j4=oe({generate:()=>K4,name:()=>V4,parse:()=>FS,structure:()=>X4,walkContext:()=>G4}),V4="SelectorList",G4="selector",X4={children:[["Selector","Raw"]]};function FS(){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 K4(e){this.children(e,()=>this.token(18,","))}var cm=92,$S=34,WS=39;function qS(e){const t=e.length,n=e.charCodeAt(0),r=n===$S||n===WS?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===cm){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),In(cm,a)){const l=s-1,c=Xo(e,l);s=c-1,i+=zv(e.substring(l+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function um(e,t){const n=t?"'":'"',r=t?WS:$S;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===cm?(o+="\\"+e.charAt(s),i=!1):(i&&(kr(a)||ro(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var Y4=oe({generate:()=>J4,name:()=>Z4,parse:()=>zS,structure:()=>Q4}),Z4="String",Q4={value:String};function zS(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:qS(this.consume(5))}}function J4(e){this.token(5,um(e.value))}var e8=oe({generate:()=>i8,name:()=>n8,parse:()=>jS,structure:()=>o8,walkContext:()=>r8}),t8=33;function US(e){return this.Raw(e,null,!1)}var n8="StyleSheet",r8="stylesheet",o8={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function jS(){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)!==t8){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,US);break;default:n=this.parseWithFallback(this.Rule,US)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function i8(e){this.children(e)}var s8=oe({generate:()=>u8,name:()=>l8,parse:()=>GS,structure:()=>c8}),a8=42,VS=124;function dm(){this.tokenType!==1&&this.isDelim(a8)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var l8="TypeSelector",c8={name:String};function GS(){const e=this.tokenStart;return this.isDelim(VS)?(this.next(),dm.call(this)):(dm.call(this),this.isDelim(VS)&&(this.next(),dm.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function u8(e){this.tokenize(e.name)}var d8=oe({generate:()=>g8,name:()=>h8,parse:()=>YS,structure:()=>p8}),XS=43,KS=45,fm=63;function Ns(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===KS&&t&&n!==0)return Ns.call(this,e+n+1,!1),-1;kr(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 Ql(e){let t=0;for(;this.isDelim(fm);)++t>e&&this.error("Too many question marks"),this.next()}function f8(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===XS?"Plus sign":"Hyphen minus")+" is expected")}function m8(){let e=0;switch(this.tokenType){case 10:if(e=Ns.call(this,1,!0),this.isDelim(fm)){Ql.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){f8.call(this,KS),Ns.call(this,1,!1);break}break;case 12:e=Ns.call(this,1,!0),e>0&&Ql.call(this,6-e);break;default:if(this.eatDelim(XS),this.tokenType===1){e=Ns.call(this,0,!0),e>0&&Ql.call(this,6-e);break}if(this.isDelim(fm)){this.next(),Ql.call(this,5);break}this.error("Hex digit or question mark is expected")}}var h8="UnicodeRange",p8={value:String};function YS(){const e=this.tokenStart;return this.eatIdent("u"),m8.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function g8(e){this.tokenize(e.value)}var b8=32,mm=92,y8=34,v8=39,E8=40,ZS=41;function S8(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===ZS?t-2:t-1,o="";for(;n<r&&ro(e.charCodeAt(n));)n++;for(;n<r&&ro(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===mm){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),In(mm,s)){const a=i-1,l=Xo(e,a);i=l-1,o+=zv(e.substring(a+1,l))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function QS(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===b8||o===mm||o===y8||o===v8||o===E8||o===ZS?(t+="\\"+e.charAt(r),n=!1):(n&&kr(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var w8=oe({generate:()=>C8,name:()=>"Url",parse:()=>JS,structure:()=>_8}),uee="Url",_8={value:String};function JS(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=S8(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=qS(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 C8(e){this.token(7,QS(e.value))}var T8=oe({generate:()=>L8,name:()=>A8,parse:()=>e1,structure:()=>k8}),A8="Value",k8={children:[[]]};function e1(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function L8(e){this.children(e)}var N8=oe({generate:()=>M8,name:()=>O8,parse:()=>t1,structure:()=>R8}),x8=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),O8="WhiteSpace",R8={value:String};function t1(){return this.eat(13),x8}function M8(e){this.token(13,e.value)}var n1=oe({AnPlusB:()=>j5,Atrule:()=>Y5,AtrulePrelude:()=>n3,AttributeSelector:()=>a3,Block:()=>g3,Brackets:()=>_3,CDC:()=>k3,CDO:()=>x3,ClassSelector:()=>M3,Combinator:()=>H3,Comment:()=>j3,Declaration:()=>Z3,DeclarationList:()=>fD,Dimension:()=>bD,Function:()=>SD,Hash:()=>AD,IdSelector:()=>PD,Identifier:()=>xD,MediaFeature:()=>HD,MediaQuery:()=>qD,MediaQueryList:()=>VD,Nth:()=>YD,Number:()=>JD,Operator:()=>r4,Parentheses:()=>a4,Percentage:()=>d4,PseudoClassSelector:()=>p4,PseudoElementSelector:()=>E4,Ratio:()=>T4,Raw:()=>O4,Rule:()=>I4,Selector:()=>W4,SelectorList:()=>j4,String:()=>Y4,StyleSheet:()=>e8,TypeSelector:()=>s8,UnicodeRange:()=>d8,Url:()=>w8,Value:()=>T8,WhiteSpace:()=>N8}),P8={generic:!0,...U5,node:n1},I8=35,D8=42,r1=43,B8=45,H8=47,F8=117;function o1(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,F8)&&this.cmpChar(this.tokenStart+1,r1)?this.UnicodeRange():this.Identifier();case 9:{const t=this.charCodeAt(this.tokenStart);if(t===H8||t===D8||t===r1||t===B8)return this.Operator();t===I8&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var $8={getNode:o1},W8=35,q8=42,z8=43,U8=47,i1=46,j8=62,V8=124,G8=126;function X8(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function K8(){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)===i1&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case z8:case j8:case G8:case U8:return this.Combinator();case i1:return this.ClassSelector();case q8:case V8:return this.TypeSelector();case W8:return this.IdSelector()}}}var Y8={onWhiteSpace:X8,getNode:K8};function Z8(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function Q8(){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 s1(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var J8={getNode:o1,onWhiteSpace(e,t){s1(e)&&(e.value=" "+e.value),s1(t.last)&&(t.last.value+=" ")},expression:Z8,var:Q8},eB=oe({AtrulePrelude:()=>$8,Selector:()=>Y8,Value:()=>J8}),tB={parse:{prelude:null,block(){return this.Block(!0)}}},nB={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}},rB={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(){return this.Block(!1)}}},oB={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function iB(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function sB(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):a1.call(this)}function a1(){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(iB,this.scope.AtrulePrelude);break;case 1:t=this.Identifier();break;case 21:t=this.Parentheses(sB,this.scope.AtrulePrelude);break;default:break e}e.push(t)}return e}var aB={parse:{prelude(){const e=a1.call(this);return this.getFirstListNode(e)===null&&this.error("Condition is expected"),e},block(){return this.Block(!1)}}},lB={"font-face":tB,import:nB,media:rB,page:oB,supports:aB},io={parse(){return this.createSingleNodeList(this.SelectorList())}},cB={parse(){return this.createSingleNodeList(this.Selector())}},l1={parse(){return this.createSingleNodeList(this.Identifier())}},Jl={parse(){return this.createSingleNodeList(this.Nth())}},uB={dir:l1,has:io,lang:l1,matches:io,is:io,"-moz-any":io,"-webkit-any":io,where:io,not:io,"nth-child":Jl,"nth-last-child":Jl,"nth-last-of-type":Jl,"nth-of-type":Jl,slotted:cB},dB=oe({AnPlusB:()=>QE,Atrule:()=>eS,AtrulePrelude:()=>tS,AttributeSelector:()=>rS,Block:()=>sS,Brackets:()=>aS,CDC:()=>lS,CDO:()=>cS,ClassSelector:()=>uS,Combinator:()=>fS,Comment:()=>mS,Declaration:()=>gS,DeclarationList:()=>bS,Dimension:()=>yS,Function:()=>vS,Hash:()=>ES,IdSelector:()=>wS,Identifier:()=>SS,MediaFeature:()=>_S,MediaQuery:()=>CS,MediaQueryList:()=>TS,Nth:()=>AS,Number:()=>kS,Operator:()=>LS,Parentheses:()=>NS,Percentage:()=>xS,PseudoClassSelector:()=>OS,PseudoElementSelector:()=>RS,Ratio:()=>PS,Raw:()=>IS,Rule:()=>BS,Selector:()=>HS,SelectorList:()=>FS,String:()=>zS,StyleSheet:()=>jS,TypeSelector:()=>GS,UnicodeRange:()=>YS,Url:()=>JS,Value:()=>e1,WhiteSpace:()=>t1}),fB={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:eB,atrule:lB,pseudo:uB,node:dB},mB={node:n1},hB=z5({...P8,...fB,...mB});function hm(e){const t={};for(const n in e){let r=e[n];r&&(Array.isArray(r)||r instanceof Ue?r=r.map(hm):r.constructor===Object&&(r=hm(r))),t[n]=r}return t}var{tokenize:dee,parse:pB,generate:Hn,lexer:c1,createLexer:fee,walk:It,find:mee,findLast:hee,findAll:pee,toPlainObject:gee,fromPlainObject:bee,fork:gB}=hB,{hasOwnProperty:bB}=Object.prototype;function pm(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 u1(e){if(!e)return null;const t=pm(e.tags,!0),n=pm(e.ids),r=pm(e.classes);return t===null&&n===null&&r===null?null:{tags:t,ids:n,classes:r}}function yB(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(bB.call(t,o))throw new Error(`Class can't be used for several scopes: ${o}`);t[o]=n+1}}}return{whitelist:u1(e),blacklist:u1(e.blacklist),scopes:t}}function so(e){return!e||!e.children||e.children.isEmpty}function d1(e,t){return e!==null&&e.children===t}function vB(e,t,n){if(e.block&&(this.stylesheet!==null&&(this.stylesheet.firstAtrulesAllowed=!1),so(e.block))){n.remove(t);return}switch(e.name){case"charset":if(so(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=yn(e.name).basename;(r==="keyframes"||r==="media"||r==="supports")&&(so(e.prelude)||so(e.block))&&n.remove(t)}}}function EB(e,t,n){n.remove(t)}function SB(e,t,n){if(e.value.children&&e.value.children.isEmpty){n.remove(t);return}Zo(e.property).custom&&/\S/.test(e.value.value)&&(e.value.value=e.value.value.trim())}function wB(e,t,n){(d1(this.stylesheet,n)||d1(this.block,n))&&n.remove(t)}var{hasOwnProperty:oi}=Object.prototype,_B=new Set(["keyframes"]);function f1(e,t){return e.children.forEach((n,r,o)=>{let i=!1;It(n,function(s){if(this.selector===null||this.selector===e)switch(s.type){case"SelectorList":(this.function===null||this.function.name.toLowerCase()!=="not")&&f1(s,t)&&(i=!0);break;case"ClassSelector":t.whitelist!==null&&t.whitelist.classes!==null&&!oi.call(t.whitelist.classes,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.classes!==null&&oi.call(t.blacklist.classes,s.name)&&(i=!0);break;case"IdSelector":t.whitelist!==null&&t.whitelist.ids!==null&&!oi.call(t.whitelist.ids,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.ids!==null&&oi.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&&!oi.call(t.whitelist.tags,s.name.toLowerCase())&&(i=!0),t.blacklist!==null&&t.blacklist.tags!==null&&oi.call(t.blacklist.tags,s.name.toLowerCase())&&(i=!0))}}),i&&o.remove(r)}),e.children.isEmpty}function CB(e,t,n,r){if(so(e.prelude)||so(e.block)){n.remove(t);return}if(this.atrule&&_B.has(yn(this.atrule.name).basename))return;const{usage:o}=r;if(o&&(o.whitelist!==null||o.blacklist!==null)&&(f1(e.prelude,o),so(e.prelude))){n.remove(t);return}}function TB(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 AB(e,t,n){n.remove(t)}var m1={Atrule:vB,Comment:EB,Declaration:SB,Raw:wB,Rule:CB,TypeSelector:TB,WhiteSpace:AB};function kB(e,t){It(e,{leave(n,r,o){m1.hasOwnProperty(n.type)&&m1[n.type].call(this,n,r,o,t)}})}function LB(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 NB(e){yn(e.name).basename==="keyframes"&&LB(e)}var xB=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;function OB(e){return e===""||e==="-"?!1:!xB.test(e)}function RB(e){const t=e.value;!t||t.type!=="String"||OB(t.value)&&(e.value={type:"Identifier",loc:t.loc,name:t.value})}function MB(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 PB(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 IB(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 Ue().fromArray(n)}function h1(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 p1={font:MB,"font-weight":PB,background:IB,border:h1,outline:h1};function DB(e){if(!this.declaration)return;const t=Zo(this.declaration.property);p1.hasOwnProperty(t.basename)&&p1[t.basename](e)}var BB=/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,HB=/^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,FB=new Set(["Dimension","Hash","Identifier","Number","Raw","UnicodeRange"]);function ec(e,t){const n=t&&t.prev!==null&&FB.has(t.prev.data.type)?HB:BB;return e=String(e).replace(n,"$1$2$3"),(e===""||e==="-")&&(e="0"),e}function $B(e){e.value=ec(e.value)}var WB=new Set(["calc","min","max","clamp"]),qB=new Set(["px","mm","cm","in","pt","pc","em","ex","ch","rem","vh","vw","vmin","vmax","vm"]);function zB(e,t){const n=ec(e.value);if(e.value=n,n==="0"&&this.declaration!==null&&this.atrulePrelude===null){const r=e.unit.toLowerCase();if(!qB.has(r)||this.declaration.property==="-ms-flex"||this.declaration.property==="flex"||this.function&&WB.has(this.function.name))return;t.data={type:"Number",loc:e.loc,value:n}}}var UB=new Set(["width","min-width","max-width","height","min-height","max-height","flex","-ms-flex"]);function jB(e,t){e.value=ec(e.value),e.value==="0"&&this.declaration&&!UB.has(this.declaration.property)&&(t.data={type:"Number",loc:e.loc,value:e.value},c1.matchDeclaration(this.declaration).isType(t.data,"length")||(t.data=e))}function VB(e){e.value=e.value.replace(/\\/g,"/")}var g1={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"},b1={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 gm(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 y1(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=gm(l,a,e+1/3),i=gm(l,a,e),s=gm(l,a,e-1/3)}return[Math.round(o*255),Math.round(i*255),Math.round(s*255),r]}function bm(e){return e=e.toString(16),e.length===1?"0"+e:e}function ym(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 GB(e,t){let n=e.name,r;if(n==="rgba"||n==="hsla"){if(r=ym(e.children,4,n==="rgba"),!r)return;if(n==="hsla"&&(r=y1(...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:ec(r.shift())}});return}n="rgb"}if(n==="hsl"){if(r=r||ym(e.children,3,!1),!r)return;r=y1(...r),n="rgb"}if(n==="rgb"){if(r=r||ym(e.children,3,!0),!r)return;t.data={type:"Hash",loc:e.loc,value:bm(r[0])+bm(r[1])+bm(r[2])},v1(t.data,t)}}function XB(e,t){if(this.declaration===null)return;let n=e.name.toLowerCase();if(g1.hasOwnProperty(n)&&c1.matchDeclaration(this.declaration).isType(e,"color")){const r=g1[n];r.length+1<=n.length?t.data={type:"Hash",loc:e.loc,value:r}:(n==="grey"&&(n="gray"),e.name=n)}}function v1(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]),b1[n]?t.data={type:"Identifier",loc:e.loc,name:b1[n]}:e.value=n}var E1={Atrule:NB,AttributeSelector:RB,Value:DB,Dimension:zB,Percentage:jB,Number:$B,Url:VB,Hash:v1,Identifier:XB,Function:GB};function KB(e){It(e,{leave(t,n,r){E1.hasOwnProperty(t.type)&&E1[t.type].call(this,t,n,r)}})}var YB=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 ZB(){const e=new YB;return function(n){const r=Hn(n);return n.id=e.resolve(r),n.length=r.length,n.fingerprint=null,n}}function QB(e){return e.type==="Raw"?pB(e.value,{context:"selectorList"}):e}function JB(e,t){for(let n=0;n<3;n++)if(e[n]!==t[n])return e[n]>t[n]?e:t;return e}function S1(e){return QB(e).children.reduce((t,n)=>JB(vm(n),t),[0,0,0])}function vm(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]=S1(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]=S1(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 e9=new Set(["first-letter","first-line","after","before"]),t9=new Set(["link","visited","hover","active","first-letter","first-line","after","before"]);function n9(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: "+Hn(r));i=a}break;case"PseudoClassSelector":{const a=s.name.toLowerCase();t9.has(a)||n.add(`:${a}`);break}case"PseudoElementSelector":{const a=s.name.toLowerCase();e9.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=vm(r).toString(),r.id=null,r.id=Hn(r),i&&(r.compareMarker+=":"+i),o!=="*"&&(r.compareMarker+=","+o)}),e.pseudoSignature=n.size>0?[...n].sort().join(","):!1}function r9(e,t){const n=ZB();return It(e,{visit:"Rule",enter(r){r.block.children.forEach(n),n9(r,t.usage)}}),It(e,{visit:"Atrule",enter(r){r.prelude&&(r.prelude.id=null,r.prelude.id=Hn(r.prelude)),yn(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:w1}=Object.prototype;function _1(e,t,n,r){const o=t.data,i=yn(o.name).basename,s=o.name.toLowerCase()+"/"+(o.prelude?o.prelude.id:null);w1.call(e,i)||(e[i]=Object.create(null)),r&&delete e[i][s],w1.call(e[i],s)||(e[i][s]=new Ue),e[i][s].append(n.remove(t))}function o9(e,t){const n=Object.create(null);let r=null;e.children.forEach(function(o,i,s){if(o.type==="Atrule"){const a=yn(o.name).basename;switch(a){case"keyframes":_1(n,i,s,!0);return;case"media":if(t.forceMediaMerge){_1(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 C1(e){return e.type==="Atrule"&&e.name==="media"}function i9(e,t,n){if(!C1(e))return;const r=t.prev&&t.prev.data;!r||!C1(r)||e.prelude&&r.prelude&&e.prelude.id===r.prelude.id&&(r.block.children.appendList(e.block.children),n.remove(t))}function s9(e,t){o9(e,t),It(e,{visit:"Atrule",reverse:!0,enter:i9})}var{hasOwnProperty:a9}=Object.prototype;function T1(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 A1(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 l9(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]&&((!a9.call(r,s.fingerprint)||!r[s.fingerprint]&&s.important)&&n.ne2.push(s),n.ne2overrided.push(s))}return n}function xs(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 k1(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 tc(e){switch(e.type){case"Rule":return k1(e.prelude.children,this);case"Atrule":if(e.block)return e.block.children.some(tc,this);break;case"Declaration":return!1}return!0}function c9(e,t,n){const r=e.prelude.children,o=e.block.children;n.prevUntil(t.prev,function(i){if(i.type!=="Rule")return tc.call(r,i);const s=i.prelude.children,a=i.block.children;if(e.pseudoSignature===i.pseudoSignature){if(T1(s,r))return a.appendList(o),n.remove(t),!0;if(A1(o,a))return xs(s,r),n.remove(t),!0}return k1(r,s)})}function u9(e){It(e,{visit:"Rule",enter:c9})}function d9(e,t,n){const r=e.prelude.children;for(;r.head!==r.tail;){const o=new Ue;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 f9(e){It(e,{visit:"Rule",reverse:!0,enter:d9})}var L1=1,m9=2,ii=0,Os=1,Em=2,nc=3,N1=["top","right","bottom","left"],h9={"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"},x1={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"},p9=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=h9[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[Os]=i[ii],i[Em]=i[ii],i[nc]=i[ii];break;case 2:i[Em]=i[ii],i[nc]=i[Os];break;case 3:i[nc]=i[Os]}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(N1[s],i[s])&&(r[N1[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 Ue,t=this.sides,n=[t.top,t.right,t.bottom,t.left],r=[Hn(t.top.node),Hn(t.right.node),Hn(t.bottom.node),Hn(t.left.node)];r[nc]===r[Os]&&(n.pop(),r[Em]===r[ii]&&(n.pop(),r[Os]===r[ii]&&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 g9(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(!x1.hasOwnProperty(l))return;const c=x1[l];let u,d;if((!r||i===r)&&c in t&&(d=m9,u=t[c]),(!u||!u.add(l,s))&&(d=L1,u=new p9(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 b9(e,t){e.forEach(function(n){const r=n.shorthand;r.isOkToMinimize()&&(n.operation===L1?n.item.data=t(r.getDeclaration()):n.block.remove(n.item))})}function y9(e,t){const n={},r=[];It(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=g9.call(this,o,l,r,a.lastShortSelector)}}),b9(r,t.declaration)}var v9=1,E9=new Set(["src"]),O1={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},R1={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"]},M1={"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 P1(e,t,n){const r=Zo(e).basename;if(r==="background")return e+":"+Hn(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=yn(m).vendor),/\\[09]/.test(m)&&(l=RegExp.lastMatch),R1.hasOwnProperty(r)?R1[r].indexOf(m)===-1&&(s[m]=!0):O1.hasOwnProperty(r)&&O1[r].test(m)&&(s[m]=!0);break}case"Function":{let{name:m}=d;a||(a=yn(m).vendor),m==="rect"&&(d.children.some(h=>h.type==="Operator"&&h.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?"!"+v9++:"!"+Object.keys(s).sort()+"|"+l+a;break;case"Raw":i="!"+t.value.value;break;default:i=Hn(t.value)}n[o]=i}return e+i}function S9(e,t,n){const r=Zo(t.property);if(M1.hasOwnProperty(r.basename)){const o=M1[r.basename];for(const i of o){const s=P1(r.prefix+i,t,n),a=e.hasOwnProperty(s)?e[s]:null;if(a&&(!t.important||a.item.data.important))return a}}}function w9(e,t,n,r,o){const i=e.block.children;i.forEachRight(function(s,a){const{property:l}=s,c=P1(l,s,o),u=r[c];u&&!E9.has(l)?s.important&&!u.item.data.important?(r[c]={block:i,item:a},u.block.remove(u.item)):i.remove(a):S9(r,s,o)?i.remove(a):(s.fingerprint=c,r[c]={block:i,item:a})}),i.isEmpty&&n.remove(t)}function _9(e){const t={},n=Object.create(null);It(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),w9.call(this,r,o,i,c,n)}})}function C9(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 tc.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(A1(o,u)){const m=c.data.id;r.some((h,f)=>{const g=h.id;if(m<g)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 T9(e){It(e,{visit:"Rule",enter:C9})}function Sm(e){return e.reduce((t,n)=>t+n.id.length+1,0)-1}function wm(e){let t=0;for(const n of e)t+=n.length;return t+e.length-1}function A9(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 g=tc.call(o,c);return!g&&m==="Atrule"&&d&&It(d,{visit:"Rule",enter(E){E.prelude.children.forEach(w=>{s[w.compareMarker]=!0})}}),g}if(e.pseudoSignature!==c.pseudoSignature)return!0;const h=c.prelude.children;if(l=!h.some(g=>g.compareMarker in s),!l&&!a)return!0;if(a&&T1(h,o))return d.children.appendList(i.children),n.remove(t),!0;const f=l9(i.children,d.children);if(f.eq.length){if(!f.ne1.length&&!f.ne2.length)return l&&(xs(o,h),n.remove(u)),!0;if(!r)if(f.ne1.length&&!f.ne2.length){const g=Sm(o),E=wm(f.eq);a&&g<E&&(xs(h,o),i.children.fromArray(f.ne1))}else if(!f.ne1.length&&f.ne2.length){const g=Sm(h),E=wm(f.eq);l&&g<E&&(xs(o,h),d.children.fromArray(f.ne2))}else{const g={type:"SelectorList",loc:null,children:xs(h.copy(),o)},E=Sm(g.children)+2;if(wm(f.eq)>=E){const w=n.createItem({type:"Rule",loc:null,prelude:g,block:{type:"Block",loc:null,children:new Ue().fromArray(f.eq)},pseudoSignature:e.pseudoSignature});return i.children.fromArray(f.ne1),d.children.fromArray(f.ne2overrided),a?n.insert(w,u):n.insert(w,t),!0}}}a&&(a=!h.some(g=>o.some(E=>E.compareMarker===g.compareMarker))),h.forEach(g=>{s[g.compareMarker]=!0})})}function k9(e){It(e,{visit:"Rule",reverse:!0,enter:A9})}function L9(e,t){const n=r9(e,t);t.logger("prepare",e),s9(e,t),t.logger("mergeAtrule",e),u9(e),t.logger("initialMergeRuleset",e),f9(e),t.logger("disjoinRuleset",e),y9(e,n),t.logger("restructShorthand",e),_9(e),t.logger("restructBlock",e),T9(e),t.logger("mergeRuleset",e),k9(e),t.logger("restructRuleset",e)}function N9(e,t){const n=new Ue;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 x9(e,t,n,r){r.logger(`Compress block #${n}`,null,!0);let o=1;return e.type==="StyleSheet"&&(e.firstAtrulesAllowed=t,e.id=o++),It(e,{visit:"Atrule",enter(i){i.block!==null&&(i.block.id=o++)}}),r.logger("init",e),kB(e,r),r.logger("clean",e),KB(e,r),r.logger("replace",e),r.restructuring&&L9(e,r),e}function O9(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 R9(e){return"restructure"in e?e.restructure:"restructuring"in e?e.restructuring:!0}function M9(e){return new Ue().appendData({type:"Rule",loc:null,prelude:{type:"SelectorList",loc:null,children:new Ue().appendData({type:"Selector",loc:null,children:new Ue().appendData({type:"TypeSelector",loc:null,name:"x"})})},block:e})}function P9(e,t){e=e||{type:"StyleSheet",loc:null,children:new Ue},t=t||{};const n={logger:typeof t.logger=="function"?t.logger:function(){},restructuring:R9(t),forceMediaMerge:!!t.forceMediaMerge,usage:t.usage?yB(t.usage):!1},r=new Ue;let o=O9(t),i=!0,s,a,l=1,c;t.clone&&(e=hm(e)),e.type==="StyleSheet"?(s=e.children,e.children=r):s=M9(e);do{if(a=N9(s,!!o),x9(a.stylesheet,i,l++,n),c=a.stylesheet.children,a.comment&&(r.isEmpty||r.insert(Ue.createItem({type:"Raw",value:`
|
|
43
|
+
`})),r.insert(Ue.createItem(a.comment)),c.isEmpty||r.insert(Ue.createItem({type:"Raw",value:`
|
|
44
|
+
`}))),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 I9=oe({compress:()=>P9,find:()=>W9,findAll:()=>z9,findLast:()=>q9,fromPlainObject:()=>U9,generate:()=>F9,lexer:()=>D9,parse:()=>H9,specificity:()=>vm,toPlainObject:()=>j9,tokenize:()=>B9,walk:()=>$9});function I1(e){const t=um(e,!0),n=um(e);return t.length<n.length?t:n}var{lexer:D9,tokenize:B9,parse:H9,generate:F9,walk:$9,find:W9,findLast:q9,findAll:z9,fromPlainObject:U9,toPlainObject:j9}=gB({node:{String:{generate(e){this.token(5,I1(e.value))}},Url:{generate(e){const t=QS(e.value),n=I1(e.value);this.token(7,t.length<=n.length+5?t:"url("+n+")")}}}}),{parse:V9,generate:_m,compress:G9}=I9;function si(e,t,n,r){return t.debug,r}function X9(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=_m(o);e===2&&s.length>256&&(s=s.substr(0,256)+"..."),i+=`
|
|
45
|
+
${s}
|
|
46
|
+
`}t=Date.now()}}function K9(e){return e={...e},typeof e.logger!="function"&&e.debug&&(e.logger=X9(e.debug)),e}function D1(e,t,n){Array.isArray(n)||(n=[n]),n.forEach(r=>r(e,t))}function Y9(e,t,n){n=n||{};const r=n.filename||"<unknown>";let o;const i=si("parsing",n,Date.now(),V9(t,{context:e,filename:r,positions:!!n.sourceMap}));n.beforeCompress&&si("beforeCompress",n,Date.now(),D1(i,n,n.beforeCompress));const s=si("compress",n,Date.now(),G9(i,K9(n)));return n.afterCompress&&si("afterCompress",n,Date.now(),D1(s,n,n.afterCompress)),n.sourceMap?o=si("generate(sourceMap: true)",n,Date.now(),(()=>{const a=_m(s.ast,{sourceMap:!0});return a.map._file=r,a.map.setSourceContent(r,t),a})()):o=si("generate",n,Date.now(),{css:_m(s.ast),map:null}),o}function ao(e,t){return Y9("stylesheet",e,t)}var B1={restructure:!0,forceMediaMerge:!0};function H1(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=`
|
|
47
|
+
`+cssbeautify(ao(s.innerHTML,B1).css,{indent:" ",autosemicolon:!0})+`
|
|
48
|
+
`;s.innerHTML!==a&&(s.textContent=a,r=!0)}if(s.sheet&&F1(e,s.sheet,o,i)){let a=Q9(s.sheet);a=ao(a,B1).css,a=`
|
|
49
|
+
`+cssbeautify(a,{indent:" ",autosemicolon:!0})+`
|
|
50
|
+
`,s.innerHTML!==a&&(s.textContent=a,r=!0)}}return r}function F1(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-")}`),Z9(e,c,r)||(t.deleteRule(a),i=!0)}else if(l instanceof CSSGroupingRule)i=F1(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 Z9(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 Q9(e){return Array.from(e.cssRules,t=>t.cssText).join(`
|
|
51
|
+
`)}var $1=/device-width/i,J9="not all",ai=new Map,Cm=!1;function e6(e){return"media"in e&&"cssRules"in e}function W1(e,t){for(const n of Array.from(e))e6(n)&&t(n),"cssRules"in n&&W1(n.cssRules,t)}function t6(e){try{return e.cssRules}catch{return}}function n6(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n&&!$1.test(n));return t.length?t.join(", "):J9}function Tm(e){ai.forEach((t,n)=>{n.parentStyleSheet?.ownerNode?.isConnected||ai.delete(n)});for(const t of Array.from(e.styleSheets)){const n=t6(t);n&&W1(n,r=>{const o=r.media.mediaText;ai.has(r)||!$1.test(o)||(ai.set(r,o),r.media.mediaText=n6(o))})}}function q1(){ai.forEach((e,t)=>{t.media.mediaText=e}),ai.clear()}function r6(e){if(!Cm)return e();q1();try{return e()}finally{Tm(document)}}function o6(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 i6(e=window){if(!e.matchMedia("(pointer: coarse)").matches)return()=>{};const t=e.document;Cm=!0,Tm(t);const n=new MutationObserver(r=>{o6(r)&&Tm(t)});return n.observe(t.documentElement,{childList:!0,characterData:!0,subtree:!0}),()=>{n.disconnect(),q1(),Cm=!1}}function Rs(e){return le(e)}var yee=le("extensions.atomsHandlers"),vee=Rs("HANDLE_ATOM_INSERT"),Eee=le("HeadlessMode"),See=le("extensions.sandboxExtensions"),s6="SANDBOX_EXTENSION_SCRIPT_STATUS",wee=le("MESSAGE_SERVICE"),_ee=Rs("SETTINGS_PANEL_EVENT"),Cee=Rs("MODAL_SHOW_EVENT"),Tee=Rs("MODAL_CLOSE_EVENT"),Aee=Rs("MODAL_UPDATE_EVENT");function kee(e){return e}var Lee="SandboxApp",a6="IframePluginRegistry",l6="__sandbox__";function z1(){return td(l6)}function c6(e=z1()){return e.getOrCreateInstance(a6,()=>new eL)}var Am=new tL(()=>c6()),rc=class hA{constructor(){A(this,"container",z1()),A(this,"pluginCollection",new Jk(this,Am)),this.pluginCollection.activateSync()}static get instance(){return this._instance||(this._instance=new hA)}static registerPlugin(t,n){Am.add(t,n)}static registerAll(t){for(const n of Object.keys(t)){let r=n;const o=t[r];o&&Am.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()}};A(rc,"_instance",void 0);var Ms="data-extension";function Ps(e,t,n,r){G.send(s6,{key:e,phase:t,status:n,error:r})}function u6(){if(typeof document>"u")return;const e=document.currentScript;if(e instanceof HTMLScriptElement)return e.getAttribute(Ms)||void 0}function U1(e){return{key:e,hasSyncPlugins:!1,pendingPlugins:new Set,loadedNotified:!1,readyNotified:!1,readyFailed:!1}}function km(e){!e.loadedNotified||e.readyNotified||e.readyFailed||(!e.hasSyncPlugins||e.pendingPlugins.size===0)&&(e.readyNotified=!0,Ps(e.key,"ready","success"))}function j1(e,t){return[...document.querySelectorAll(`${e}[${Ms}]`)].find(n=>n.getAttribute(Ms)===t)}function d6({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(Ms,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 f6(e,t={}){const n=new ve,r=new Map,o=new Map,i=new Map,s=new WeakMap,a=u=>{let d=i.get(u);return d||(d=U1(u),i.set(u,d)),d},l=u=>{if(u.type==="created"){const h=u6();if(!h)return;const f=a(h);f.hasSyncPlugins=!0,f.pendingPlugins.add(u.plugin),s.set(u.plugin,h);return}if(u.type==="create:error")return;const d=s.get(u.plugin);if(!d)return;const m=i.get(d);if(m){if(u.type==="afterInit:success"){m.pendingPlugins.delete(u.plugin),km(m);return}(u.type==="init:error"||u.type==="afterInit:error")&&(m.pendingPlugins.delete(u.plugin),m.readyFailed=!0,Ps(d,"ready","error",`Sandbox plugin "${u.name}" failed during ${u.type==="init:error"?"init":"afterInit"}.`))}};n.addDisposable(rc.onLifecycle(l)),n.addDisposable(G.addListener(Ae.SANDBOX_ADD_EXTENSIONS,u=>{for(const d of u){if(t.surface&&d.surfaces&&!d.surfaces.includes(t.surface))continue;let m=r.get(d.key);m&&m.remove(),d.type==="script"&&i.set(d.key,U1(d.key));const h=d.parent&&document.querySelector(d.parent)||document.head;if(m=d6(d),e.ownership.markService(m),d.type==="script"){const f=m;f.src&&(f.onload=()=>{const g=a(d.key);g.loadedNotified=!0,Ps(d.key,"load","success"),km(g)},f.onerror=()=>Ps(d.key,"load","error",`Failed to load sandbox script: ${f.src}`))}if(h.appendChild(m),d.type==="script"&&!m.src){const f=a(d.key);f.loadedNotified=!0,Ps(d.key,"load","success"),km(f)}r.set(d.key,m),o.set(d.key,d)}})),n.addDisposable(G.addListener(Ae.SANDBOX_REMOVE_EXTENSIONS,u=>{for(const d of u){const m=j1(o.get(d)?.type,d);m&&m.remove(),r.delete(d),o.delete(d)}})),n.addDisposable(e.onChange(()=>{e.applyHidden(()=>c())}));function c(){for(const[u,d]of r){const m=o.get(u);if(!m)continue;const h=j1(m.type,u);let f=m.parent?[...document.querySelectorAll(m.parent)]:[];f.length||(f=[document.head]),h?h!==d?r.set(u,h):f.some(g=>h.parentNode===g)||f[0]?.appendChild(h):f[0]?.appendChild(d)}}return n}function m6(e){e.querySelectorAll(`[${Ms}]`).forEach(t=>t.remove())}var lo="remove-basic-cell",h6="remove-basic-row",co="em-active-table-cell",p6="em-temporary-class",Or="em-temporary-active-cell-background-color",Rr="temporary-cell-class",oc=[lo,h6,co,p6,Rr,Or],g6=["contenteditable","em-edit","em-state","em-hover"],V1=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;"> </div>`,Is="em-table-menu",Ds="em_version";function ic(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(Ds),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash):e}catch{return e}}function b6(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.set(Ds,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash}catch{return`${e}${e.includes("?")?"&":"?"}${Ds}=${Date.now()}`}}var y6=/^(chrome-extension|moz-extension|safari-extension):\/\//i,v6=/local\.adguard\.org/i,E6=/^bis_/i,S6=new Set(["data-bis-config"]),li=/<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,w6=/\s(?:bis_[a-z0-9_-]+|data-bis-config|data-dynamic-id)=(["'])(?:(?!\1).)*\1/gi,sc=/<style\b[^>]*>[\s\S]*?<\/style>/gi,G1=/display:\s*none\s*!important/gi,_6=[".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; }"],X1=new Set(["em","data-theme-varibalse","data-em-localization"]);function C6(e){return G1.lastIndex=0,(e.match(G1)||[]).length}function Lm(e){const t=e.trim(),n=C6(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=_6.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 T6(e){if(X1.has("em")&&e.getAttribute("em")==="styles")return!1;for(const t of X1)if(e.hasAttribute(t))return!1;return Lm(e.textContent||"")}function A6(e){return y6.test(e.src)||v6.test(e.src)?!0:e.hasAttribute("bis_use")||e.hasAttribute("data-bis-config")}function K1(e){let t=!1;for(const n of[...e.attributes])(E6.test(n.name)||S6.has(n.name))&&(e.removeAttribute(n.name),t=!0);return t}function k6(e){sc.lastIndex=0;for(const t of e.matchAll(sc))if(Lm(t[0].replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,"")))return!0;return!1}function L6(e){let t=!1;return sc.lastIndex=0,{html:e.replace(sc,n=>Lm(n.replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,""))?(t=!0,""):n),found:t}}function Y1(e){let t=!1;return e instanceof Element&&K1(e)&&(t=!0),e.querySelectorAll("script").forEach(n=>{A6(n)&&(n.remove(),t=!0)}),e.querySelectorAll("style").forEach(n=>{n.tagName==="STYLE"&&T6(n)&&(n.remove(),t=!0)}),e.querySelectorAll("*").forEach(n=>{K1(n)&&(t=!0)}),t}function N6(e){return li.lastIndex=0,li.test(e)||/\sbis_[a-z0-9_-]+\s*=/.test(e)||/\sdata-bis-config\s*=/.test(e)||k6(e)}function x6(e){if(!N6(e))return{html:e,found:!1};let t=!1,n=e;li.lastIndex=0,li.test(n)&&(li.lastIndex=0,n=n.replace(li,""),t=!0),(/\sbis_[a-z0-9_-]+\s*=/.test(n)||/\sdata-bis-config\s*=/.test(n))&&(n=n.replace(w6,""),t=!0);const r=L6(n);return n=r.html,t=t||r.found,{html:n,found:t}}var O6=class extends ve{constructor(...e){super(...e),A(this,"_transforms",[]),A(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 Nm(){return Rt.getInstance(To)}var ac=new WeakMap;function R6(e,t,n){const r=ac.get(e);r?r.set(t.toLowerCase(),n):ac.set(e,new Map([[t.toLowerCase(),n]]))}function M6(e,t){const n=ac.get(e);n?.size&&ac.set(t,new Map(n))}function Z1(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 xm(e,t={}){const n=t.pipeline??Nm(),r=t.stage??"build";let o=e;if(t.clone&&(o=e.cloneNode(!0),en(e,o),n&&!n.isEmpty&&Q1(e,o)),!n||n.isEmpty)return o;o instanceof Element&&Z1(o,n,r);const i=o.querySelectorAll?.("*");if(i)for(const s of i)Z1(s,n,r);return o}function P6(e,t={}){const n=t.pipeline??Nm(),r=nR(e);if((!n||n.isEmpty)&&!r)return Er(e);const o=xm(e,{...t,pipeline:n,clone:!0});return zo(o),mg(o)}function Q1(e,t){M6(e,t);const n=e.childNodes,r=t.childNodes;for(let o=0;o<n.length&&o<r.length;o++)Q1(n[o],r[o])}function Dt(e,t,n,r={}){const o=Om(e,t,n,{stage:"settings",...r});o===null?e.removeAttribute(t):e.setAttribute(t,o)}function Om(e,t,n,r={}){const o=r.pipeline??Nm();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&&R6(a,t,n)}return s}function I6(e){const t=new O6,n=yg((o,i,s)=>t.isEmpty?s:Om(o,i,s,{pipeline:t})),r=ik((o,i,s)=>t.isEmpty?s:t.serialize(s,{element:o,tag:o.tagName.toLowerCase(),attribute:i,stage:"apply"}));return e.inject(To,t),{pipeline:t,dispose(){r(),n(),t.dispose(),pn(e,To)}}}function D6(e){return ic(e)}function J1(e){const t=(n,r)=>{const o=n.getAttribute(r);if(!o)return;const i=D6(o);i!==o&&n.setAttribute(r,i)};e.querySelectorAll("[src]").forEach(n=>t(n,"src")),e.querySelectorAll("[___src]").forEach(n=>t(n,"___src"))}var ew=[".em-code",':not(editor)[contenteditable="false"]','.em-vindent[class*="em-vindent-padding"]',"#gtx-anchor",'[data-mce-bogus="1"]','style[data-theme-varibalse="true"]','style[data-em-localization="true"]',".em-element-img-change-group",".em-element-resize-img",".em-element-editor",".em-element-vindent-bg",".em-element-gap",".em-element-gap-marker",".em-element-gap-bg",".em-gap",".em-powered-logo",".em-element-vindent-value"],B6=["contenteditable","em-edit","em-state","em-hover"],H6=["[data-mce-caret=before]","span.em-element-resize-img-container","div.em-element-img-change-group","div.em-element-block-add","meta[http-equiv=Content-Security-Policy]","[class*=mce-]","script[em=initial]",".em-editor-wrapper",".em-element-resize-height",".em-element-vindent-remove",".em-element-vindent",".em-element-vindent-value","div.iframe-resizer-inner"],F6=new Set(["normal","400"]),$6=new Set(["normal"]),W6=new Set(["baseline","unset","initial",""]),tw=new Set(["none",""]),q6=["b","strong","em","i","u","s","strike","sup","sub"],z6="___em-internal",nw=["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"],U6=["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"],j6=[...ew,...H6].filter(e=>/\.em-(element-|gap|vindent)/.test(e)&&e!=="span.em-element-resize-img-container").join(", "),V6=B6.filter(e=>!ew.some(t=>t.includes(`[${e}`))),G6=[...nw,...U6],X6={isServiceAttribute:e=>V6.includes(e),isServiceClass:e=>G6.includes(e),isServicePanel:e=>e.matches(j6)||e.hasAttribute("data-em-caret")};function rw(e){oc.forEach(t=>{e.querySelectorAll(`.${t}`).forEach(n=>n.classList.remove(t))})}function lc(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")}),nw.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&&(At(t,"[data-mce-caret=before]",!0),At(t,"span.em-element-resize-img-container"),At(t,"div.em-element-img-change-group",!0),At(t,"div.em-element-block-add",!0),At(t,"meta[http-equiv=Content-Security-Policy]",!0),At(t,"[class*=mce-]"),At(t,"script[em=initial]",!0),At(t,".em-editor-wrapper",!0),At(t,".em-element-resize-height",!0),At(t,".em-element-vindent-remove",!0),At(t,".em-element-vindent",!0),At(t,".em-element-vindent-value",!0),At(t,"div.iframe-resizer-inner"))}function K6(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")),rw(e),lc(e),lv(e),At(e,"editor",!1),iw(e),J1(e),Y1(e)}function Bs(e){return(e??"").trim().toLowerCase()}function Y6(e){const t=Bs(e.style.fontWeight);t&&F6.has(t)&&e.style.removeProperty("font-weight");const n=Bs(e.style.fontStyle);n&&$6.has(n)&&e.style.removeProperty("font-style");const r=Bs(e.style.verticalAlign);r&&W6.has(r)&&e.style.removeProperty("vertical-align");const o=Bs(e.style.textDecorationLine);o&&tw.has(o)&&e.style.removeProperty("text-decoration-line");const i=Bs(e.style.textDecoration);i&&tw.has(i)&&e.style.removeProperty("text-decoration");const s=e.getAttribute("style");s!==null&&s.trim()===""&&e.removeAttribute("style")}function Z6(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function ow(e){if(e.attributes.length===0)return!0;for(const t of Array.from(e.attributes))if(t.name!==z6)return!1;return!0}function iw(e){const t=Array.from(e.querySelectorAll("span"));for(let n=t.length-1;n>=0;n-=1){const r=t[n];Y6(r),ow(r)&&Z6(r)}for(const n of q6){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&&ow(i)&&i.remove()}}}function Q6(e){const t=[],n=r7(e);return e=t7(e,t,n),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\b[^>]*ad-right-container[^>]*>[\s\S]*?<\/style>/gi,""),e=vl.clear(e),e=Rm(e),t.length===0?e:i7(e,t,n)}var sw=`(<(script|style)\\b[^>]*>)([\\s\\S]*?)(?=<\\/\\2${La})`,J6=new RegExp(sw,"gi"),e7=new RegExp(`<!--[\\s\\S]*?-->|${sw}`,"gi");function t7(e,t,n){const r=(o,i,s,a)=>!a||!o7(s,i)?i+a:(t.push(s.toLowerCase()==="style"?n7(a):a),`${i}${n}${t.length-1}${lw}`);return e.replaceAll(e7,(o,i,s,a)=>i===void 0?o.replaceAll(J6,r):r(o,i,s??"",a??""))}function n7(e){const t=Rm(vl.clear(`>${e}`));return t.startsWith(">")?t.slice(1):Rm(vl.clear(e))}var aw="",lw="";function r7(e){let t=aw;for(;e.includes(t);)t+=aw;return t}function o7(e,t){const n=document.createElement(e),r=/\btype\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(t);return r&&n.setAttribute("type",r[1]??r[2]??r[3]),gn(n)}function i7(e,t,n){return e.replaceAll(new RegExp(`${n}(\\d+)${lw}`,"g"),(r,o)=>t[Number(o)]??r)}function Rm(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(/&nbsp;/gi," ").replaceAll(/&zwnj;/gi,"‌"),e=e.replaceAll(/style="transform: translateZ\(0px\);"/gi,""),e=e.replaceAll(/ +>/gi,">"),e=e.replaceAll(/&/gi,"&"),e=e.replaceAll(/"/gi,""),e=e.replaceAll(/^\s*$(?:\r\n?|\n)/gm,""),e=e.replaceAll(/ em-floatblock-width=".*?"/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,"");const t=e.match(/((rgb)\(\d{1,3}(,\s?\d{1,3}){2}\))/gi);return t&&t.forEach(n=>{const r=j(n);r&&(e=e.replaceAll(n,r))}),e=e.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),e}function cw(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 s7(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 uw(){const e=Array.from(document.querySelectorAll('style[em="styles"]'));return r6(()=>H1(document,e,{forceMediaMerge:!0}))}function a7(e){let t=!1;return e.beforeCommit(()=>{try{!t&&e.takeStyleDirty()&&(t=!0,uw(),e.takeStyleDirty())}finally{t=!1}})}function cc(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 cc({node:n});i=cw(s);const a=n.cloneNode(!0);en(n,a),i.appendChild(a)}else{const a=t.trim(),l=a.match(/<\!?([a-zA-Z]{1,})[^>]*>/i);if(s=l?l[1]:"div",s==="DOCTYPE"||s==="html")return cc({html:t});i=cw(s);const c=Re(a);i.replaceChildren(...c)}xm(i,{stage:"apply"}),K6(i),t=Tt(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();if(t)s7(i,Re(t));else if(n){const s=n.cloneNode(!0);en(n,s),i.appendChild(s)}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()),m6(i),rw(i),lc(i),lv(i),i.documentElement&&At(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())}),iw(i)),xm(i,{stage:"apply"}),J1(i),Y1(i),t=tn(i)}return x6(Q6(t)).html}function Mm(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)}var dw="__emOwnEditor";function l7(e){e[dw]=!0,Vy(e)}function fw(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[dw]&&!o.contains(n)&&(o.replaceWith(...Array.from(o.childNodes)),r=!0);return r}var c7=["deleteContentBackward","deleteContentForward","deleteByCut"],u7={deleteContentBackward:"backward",deleteContentForward:"forward"};function d7(e){const{element:t,getVisibleText:n,setCursorToElement:r,hasOnlyTextNodesDeep:o,isRangeCoveringAllVisibleText:i,isEditorContentOnlyNbsp:s,commit:a,pasteFragment:l}=e,c=w=>Pt(w)?rf(w):e.mapFn(w);function u(w){return!n(w,c).trim()&&!w.querySelector(mw)}const d=w=>n(w,c).trim();function m(w,T){const L=document.createRange();L.selectNodeContents(T);const y=w.cloneRange();return y.compareBoundaryPoints(y.START_TO_START,L)<0&&y.setStart(L.startContainer,L.startOffset),y.compareBoundaryPoints(y.END_TO_END,L)>0&&y.setEnd(L.endContainer,L.endOffset),hw(n(y.cloneContents(),c).trim(),d(T))}function h(w){w.insertAdjacentHTML("beforebegin"," "),w.removeAttribute("em-edit"),w.remove()}function f(w,T){if(!T.collapsed)return!1;const L=document.createRange();return L.setStart(T.endContainer,T.endOffset),L.setEnd(w,w.childNodes.length),!n(L.cloneContents(),c).trim()}function g(w,T=Im(w,d)){const[L,...y]=T,p=L??w;if(!L&&m7(w)){const b=document.createTextNode(" ");w.replaceChildren(b),r(b);return}const v=document.createElement(L&&L.tagName!=="EDITOR"?L.tagName:"div"),C=document.createTextNode(" ");if(L&&p.tagName===v.tagName)for(const{name:b,value:S}of Array.from(p.attributes))v.setAttribute(b,S);yP(v,L?w:y7(w),p,v7),v.getAttribute("style")||v.removeAttribute("style"),y.filter(b=>b.tagName!=="TBODY").reduce((b,S)=>b.appendChild(b7(S)),v).append(C),w.tagName==="A"||w.parentNode&&w.parentNode.tagName==="A"?w.replaceChildren(C):w.replaceChildren(v),r(C)}function E(w,T){if(T.collapsed)return!1;const L=Im(w,d);return uv(T,void 0,fM)?(u(w)&&g(w,L),t.setAttribute("em-edit","active"),a(!0),!0):!1}return function(T){const L=T.target,y=window.getSelection();if(!y||y.rangeCount===0)return;if(T.inputType==="insertFromPaste"&&l&&!T.defaultPrevented){l(T);return}const p=u7[T.inputType];if(p&&cM(y.getRangeAt(0),p)){T.preventDefault();return}if(c7.includes(T.inputType)&&E(L,y.getRangeAt(0))){T.preventDefault();return}const v=n(L,c).trim(),C=n(y.getRangeAt(0)?.cloneContents(),c).trim(),b=y.getRangeAt(0),S=b.startContainer,_=(S.nodeType===Node.TEXT_NODE?S.parentNode:S).closest("sup, sub");if((T.inputType==="deleteContentBackward"||T.inputType==="deleteByCut")&&!y?.isCollapsed&&C){if(_&&m(b,_)&&h(_),i(b)&&hw(C,v)&&!L.querySelector(Pm)){T.preventDefault(),g(L),t.setAttribute("em-edit","active"),a(!0);return}t.setAttribute("em-edit","active"),a(!0)}if(T.inputType==="deleteContentBackward"&&y?.isCollapsed&&!C){S.length===1&&(_&&d(_).length===1&&h(_),t.setAttribute("em-edit","active"),a(!0));const k=()=>{Ew(T)&&a(!0)};if(S.nodeType!==Node.TEXT_NODE&&!i(b))return k();const x=b.startOffset;if(x===0&&!i(b))return k();const N=S.parentNode;if(!N)return k();const W=Array.prototype.indexOf.call(N.childNodes,S);if(N.childNodes[W-1]?.nodeType===Node.COMMENT_NODE){T.preventDefault(),S.deleteData(x-1,1);const O=document.createRange();O.setStart(S,x-1),O.collapse(!0),y.removeAllRanges(),y.addRange(O),a(!0);return}L&&s(L)&&(T.preventDefault(),T.stopImmediatePropagation())}if(T.inputType==="insertText"&&!y?.isCollapsed){T.preventDefault();let k=T.data||"";const x=y.anchorNode;i(b)&&(x.tagName==="A"||x?.parentNode&&x.parentNode.tagName==="A")&&(k=" "+T.data),b.deleteContents();const N=document.createTextNode(k||" ");b.insertNode(N),b.setStartAfter(N),b.collapse(!0),y.removeAllRanges(),y.addRange(b),bf(N,N,Qd),a(!0);return}if(f7.test(T.inputType)){const k=S7(T,y.getRangeAt(0));if(!k||(T.preventDefault(),uM(L,k))||(y.removeAllRanges(),y.addRange(k),E(L,k)))return;const x=Im(L,d);vw("delete"),u(L)&&g(L,x),a();return}if(T.inputType.includes("deleteContent")&&(v.length<2||v===C)&&o(L)&&!L.querySelector(Pm)&&!(T.inputType==="deleteContentForward"&&f(L,b))){T.preventDefault(),g(L),a(!0);return}if(T.inputType==="insertText"&&T.data){const k=y.anchorNode;if(k?.tagName==="A"&&!k.textContent?.trim().length){T.preventDefault(),T.stopImmediatePropagation(),k.insertAdjacentText("beforeend",T.data);const x=document.createRange();x.selectNodeContents(k),x.collapse(!1),y.removeAllRanges(),y.addRange(x),a(!0);return}if(k?.parentNode&&k.parentNode.tagName==="A"||k?.tagName==="A"){T.preventDefault(),T.stopImmediatePropagation();const x=y.getRangeAt(0),N=document.createTextNode(T.data||"");x.insertNode(N),x.setStartAfter(N),x.collapse(!0),y.removeAllRanges(),y.addRange(x),bf(N,N,Qd),a(!0);return}}if(T.inputType==="deleteContentBackward"&&!y.isCollapsed&&!C&&L&&s(L)&&(T.preventDefault(),T.stopImmediatePropagation()),Ew(T)){a(!0);return}a()}}var Pm="em-replace, img, picture, video, audio, svg, canvas, iframe, object, hr, input, button",mw=`${Pm}, table`,f7=/^delete(Word|SoftLine|HardLine)/;function hw(e,t){return e.replace(/\s+/g," ")===t.replace(/\s+/g," ")}function m7(e){return[pw(e,"previousSibling"),pw(e,"nextSibling")].some(t=>t?.nodeType===Node.TEXT_NODE?!0:t instanceof HTMLElement&&/^(EM-REPLACE|A|IMG|SUB|SUP|SPAN|B|STRONG|I|EM|U|S|FONT)$/.test(t.tagName))}function pw(e,t){let n=e[t];for(;n?.nodeType===Node.TEXT_NODE&&!n.textContent?.trim();)n=n[t];return n}var h7=/^(AREA|BASE|BR|COL|EMBED|HR|IMG|INPUT|LINK|META|SOURCE|TRACK|WBR)$/,gw=/^(SPAN|B|STRONG|I|EM|U|S|STRIKE|FONT|SMALL|BIG|MARK)$/,p7={TABLE:["THEAD","TBODY","TFOOT","TR"],THEAD:["TR"],TBODY:["TR"],TFOOT:["TR"],TR:["TD","TH"]};function Im(e,t){const n=t(e),r=[];for(let o=bw(e,n,t);o;o=g7(o,n,t))r.push(o);return r}function bw(e,t,n){const r=yw(e,n);if(!(!r||h7.test(r.tagName)||r.tagName!=="TABLE"&&r.matches(mw)))return!(r.tagName==="A"||gw.test(r.tagName))||n(r)===t?r:void 0}function g7(e,t,n){const r=p7[e.tagName];if(r)return Array.from(e.children).find(i=>r.includes(i.tagName));if(e.tagName==="TD"||e.tagName==="TH")return bw(e,t,n);const o=yw(e,n);return o&&gw.test(o.tagName)&&n(o)===t?o:void 0}function yw(e,t){for(const n of Array.from(e.childNodes))if(!(Pt(n)&&!t(n))){if(n.nodeType===Node.ELEMENT_NODE)return n;if(t(n))return}}function b7(e){const t=e.cloneNode(!1);return t.removeAttribute("em-edit"),t}function y7(e){const t=e.cloneNode(!1);return t.removeAttribute("innerStyle"),t.removeAttribute("innerClass"),t}var v7=e=>j(e)??e;function E7(e){const[t]=e.getTargetRanges();if(!t||t.collapsed)return;const n=document.createRange();return n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset),n}function S7(e,t){const n=sf(t,e.inputType.endsWith("Backward")?"backward":"forward");if(!n)return E7(e);const r=document.createRange();return r.selectNode(n),r}var w7={deleteContentBackward:"delete",deleteContentForward:"forwardDelete",deleteByCut:"delete",deleteContent:"delete",insertText:"insertText",insertReplacementText:"insertText",formatBold:"bold",formatItalic:"italic",formatUnderline:"underline",formatStrikeThrough:"strikeThrough",formatSuperscript:"superscript",formatSubscript:"subscript",formatJustifyLeft:"justifyLeft",formatJustifyCenter:"justifyCenter",formatJustifyRight:"justifyRight",formatJustifyFull:"justifyFull",formatRemove:"removeFormat"},_7=["insertText"],Dm=!1;function vw(e,t){Dm=!0;try{sr(e,!1,t)}finally{Dm=!1}}function C7(e){const t=e.dataTransfer?.getData("text/plain")||e.data||void 0,n=e.getTargetRanges?.()[0],r=window.getSelection();if(!t||!n||!r)return;const o=document.createRange();return o.setStart(n.startContainer,n.startOffset),o.setEnd(n.endContainer,n.endOffset),r.removeAllRanges(),r.addRange(o),t}function Ew(e){const t=w7[e.inputType];if(!t||e.defaultPrevented||e.isComposing||Dm)return!1;const n=e.inputType==="insertReplacementText"?C7(e):e.data??void 0;return _7.includes(t)&&!n?!1:(e.preventDefault(),vw(t,n),!0)}function T7(e){return function(n,r){if(!n||(n.querySelectorAll("editor")?.forEach(s=>{s.onclick=null,s.onkeyup=null,s.onmousedown=null}),lc(n),document.querySelectorAll(":not(.em-element-path) .em-element-path").forEach(s=>s.remove()),fw(n),SP(n,r)))return;Fv(n,Re);const o=document.createElement("editor");if(l7(o),o.classList.add("em-text"),o.setAttribute("contenteditable","true"),r)n.before(o),o.replaceChildren(n),rR(o);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",mt(()=>e.commit(!0)),!0),o.addEventListener("beforeinput",d7({element:n,getVisibleText:Hv,mapFn:bP,setCursorToElement:vP,hasOnlyTextNodesDeep:Dv,isRangeCoveringAllVisibleText:rM,isEditorContentOnlyNbsp:nM,commit:e.commit,pasteFragment:s=>{const a=l=>Mm({target:l.target},c=>e.commit(c));Tl(s,!1,U.get("commonStyles"),a,e.commit)}}))}}function A7({commit:e,htmlDocument:t,documentMapping:n}){const r=T7({commit:e});return{now:r,deferred:(i,s)=>{const a=t.getRangeByElement(i,!0);a&&n.hasMappedReplacementRangeInRange(a)||tM(()=>r(i,s),"editor")}}}var Sw=e=>t=>t.some(n=>e(n).some(k7)),k7=e=>e instanceof Element&&(e.hasAttribute("em-edit")||e.querySelector("[em-edit]")),L7=Sw(({removed:e})=>e),N7=Sw(({added:e})=>e),x7=e=>t=>{L7(t)&&!N7(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){Cr("em-edit"),n.setAttribute("em-edit","active"),e({elem:n});return}e({elem:null})},0)},O7=200;function R7(e){let t=!1;return()=>{if(t)return;t=!0;let n;const r=()=>{t&&(t=!1,clearTimeout(n),e())};n=setTimeout(r,O7),window.requestAnimationFrame(()=>setTimeout(r,0))}}var 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"},ke="em-icon";function M7(e,t,n){return(t=B7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cr(){return cr=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},cr.apply(null,arguments)}function ww(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 Fn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ww(Object(n),!0).forEach(function(r){M7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ww(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P7(e,t){if(e==null)return{};var n,r,o=I7(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 I7(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 D7(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 B7(e){var t=D7(e,"string");return typeof t=="symbol"?t:t+""}function Bm(e){"@babel/helpers - typeof";return Bm=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},Bm(e)}var H7="1.15.7";function ur(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var dr=ur(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Hs=ur(/Edge/i),_w=ur(/firefox/i),Fs=ur(/safari/i)&&!ur(/chrome/i)&&!ur(/android/i),Hm=ur(/iP(ad|od|hone)/i),Cw=ur(/chrome/i)&&ur(/android/i),Tw={capture:!1,passive:!1};function pe(e,t,n){e.addEventListener(t,n,!dr&&Tw)}function me(e,t,n){e.removeEventListener(t,n,!dr&&Tw)}function uc(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 Aw(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&&uc(e,t):uc(e,t))||r&&e===n)return e;if(e===n)break}while(e=Aw(e))}return null}var kw=/\s+/g;function Gt(e,t,n){e&&t&&(e.classList?e.classList[n?"add":"remove"](t):e.className=((" "+e.className+" ").replace(kw," ").replace(" "+t+" "," ")+(n?" "+t:"")).replace(kw," "))}function ee(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 ci(e,t){var n="";if(typeof e=="string")n=e;else do{var r=ee(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 Lw(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,!dr))do if(o&&o.getBoundingClientRect&&(ee(o,"transform")!=="none"||n&&ee(o,"position")!=="static")){var m=o.getBoundingClientRect();s-=m.top+parseInt(ee(o,"border-top-width")),a-=m.left+parseInt(ee(o,"border-left-width")),l=s+i.height,c=a+i.width;break}while(o=o.parentNode);if(r&&e!==window){var h=ci(o||e),f=h&&h.a,g=h&&h.d;h&&(s/=g,a/=f,d/=f,u/=g,l=s+u,c=a+d)}return{top:s,left:a,bottom:l,right:c,width:d,height:u}}}function Nw(e,t,n){for(var r=Mr(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=Mr(r,!1)}return!1}function ui(e,t,n,r){for(var o=0,i=0,s=e.children;i<s.length;){if(s[i].style.display!=="none"&&s[i]!==X.ghost&&(r||s[i]!==X.dragged)&&Sn(s[i],n.draggable,e,!1)){if(o===t)return s[i];o++}i++}return null}function Fm(e,t){for(var n=e.lastElementChild;n&&(n===X.ghost||ee(n,"display")==="none"||t&&!uc(n,t));)n=n.previousElementSibling;return n||null}function sn(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==X.clone&&(!t||uc(e,t))&&n++;return n}function xw(e){var t=0,n=0,r=$n();if(e)do{var o=ci(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 F7(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 Mr(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=ee(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 $7(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function $m(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 $s;function Ow(e,t){return function(){if(!$s){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),$s=setTimeout(function(){$s=void 0},t)}}}function W7(){clearTimeout($s),$s=void 0}function Rw(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Mw(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 Pw(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 Bt="Sortable"+new Date().getTime();function q7(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(r){if(!(ee(r,"display")==="none"||r===X.ghost)){e.push({target:r,rect:Qe(r)});var o=Fn({},e[e.length-1].rect);if(r.thisAnimationDuration){var i=ci(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(F7(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,h=c.prevToRect,f=a.rect,g=ci(c,!0);g&&(d.top-=g.f,d.left-=g.e),c.toRect=d,c.thisAnimationDuration&&$m(m,d)&&!$m(u,d)&&(f.top-d.top)/(f.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=U7(f,m,h,o.options)),$m(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){ee(r,"transition",""),ee(r,"transform","");var a=ci(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,ee(r,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=z7(r),ee(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),ee(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){ee(r,"transition",""),ee(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function z7(e){return e.offsetWidth}function U7(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 di=[],Wm={initializeByDefault:!0},Ws={mount:function(t){for(var n in Wm)Wm.hasOwnProperty(n)&&!(n in t)&&(t[n]=Wm[n]);di.forEach(function(r){if(r.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),di.push(t)},pluginEvent:function(t,n,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var i=t+"Global";di.forEach(function(s){n[s.pluginName]&&(n[s.pluginName][i]&&n[s.pluginName][i](Fn({sortable:n},r)),n.options[s.pluginName]&&n[s.pluginName][t]&&n[s.pluginName][t](Fn({sortable:n},r)))})},initializePlugins:function(t,n,r,o){di.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,cr(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 di.forEach(function(o){typeof o.eventProperties=="function"&&cr(r,o.eventProperties.call(n[o.pluginName],t))}),r},modifyOption:function(t,n,r){var o;return di.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],r))}),o}};function j7(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,h=e.putSortable,f=e.extraEventProperties;if(t=t||n&&n[Bt],!!t){var g,E=t.options,w="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!dr&&!Hs?g=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(r,!0,!0)),g.to=s||n,g.from=a||n,g.item=o||n,g.clone=i,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=m,g.pullMode=h?h.lastPutMode:void 0;var T=Fn(Fn({},f),Ws.getEventProperties(r,t));for(var L in T)g[L]=T[L];n&&n.dispatchEvent(g),E[w]&&E[w].call(t,g)}}var V7=["evt"],Ht=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,i=P7(r,V7);Ws.pluginEvent.bind(X)(t,n,Fn({dragEl:B,parentEl:Ve,ghostEl:se,rootEl:De,nextEl:uo,lastDownEl:dc,cloneEl:Fe,cloneHidden:Pr,dragStarted:zs,putSortable:ht,activeSortable:X.active,originalEvent:o,oldIndex:fi,oldDraggableIndex:qs,newIndex:Xt,newDraggableIndex:Ir,hideGhostForTarget:Ww,unhideGhostForTarget:qw,cloneNowHidden:function(){Pr=!0},cloneNowShown:function(){Pr=!1},dispatchSortableEvent:function(a){kt({sortable:n,name:a,originalEvent:o})}},i))};function kt(e){j7(Fn({putSortable:ht,cloneEl:Fe,targetEl:B,rootEl:De,oldIndex:fi,oldDraggableIndex:qs,newIndex:Xt,newDraggableIndex:Ir},e))}var B,Ve,se,De,uo,dc,Fe,Pr,fi,Xt,qs,Ir,fc,ht,mi=!1,mc=!1,hc=[],fo,wn,qm,zm,Iw,Dw,zs,hi,Us,js=!1,pc=!1,gc,bt,Um=[],jm=!1,bc=[],yc=typeof document<"u",vc=Hm,Bw=Hs||dr?"cssFloat":"float",G7=yc&&!Cw&&!Hm&&"draggable"in document.createElement("div"),Hw=(function(){if(yc){if(dr)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),Fw=function(t,n){var r=ee(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),i=ui(t,0,n),s=ui(t,1,n),a=i&&ee(i),l=s&&ee(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[Bw]==="none"||s&&r[Bw]==="none"&&c+u>o)?"vertical":"horizontal"},X7=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},K7=function(t,n){var r;return hc.some(function(o){var i=o[Bt].options.emptyInsertThreshold;if(!(!i||Fm(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},$w=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||Bm(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},Ww=function(){!Hw&&se&&ee(se,"display","none")},qw=function(){!Hw&&se&&ee(se,"display","")};yc&&!Cw&&document.addEventListener("click",function(e){if(mc)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),mc=!1,!1},!0);var mo=function(t){if(B){t=t.touches?t.touches[0]:t;var n=K7(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[Bt]._onDragOver(r)}}},Y7=function(t){B&&B.parentNode[Bt]._isOutsideThisEl(t.target)};function X(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=cr({},t),e[Bt]=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 Fw(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:X.supportPointer!==!1&&"PointerEvent"in window&&(!Fs||Hm),emptyInsertThreshold:5};Ws.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);$w(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:G7,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?pe(e,"pointerdown",this._onTapStart):(pe(e,"mousedown",this._onTapStart),pe(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(pe(e,"dragover",this),pe(e,"dragenter",this)),hc.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),cr(this,q7())}X.prototype={constructor:X,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(hi=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(oH(r),!B&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Fs&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=Sn(l,o.draggable,r,!1),!(l&&l.animated)&&dc!==l)){if(fi=sn(l),qs=sn(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){kt({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),Ht("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 kt({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),Ht("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,Ve=B.parentNode,uo=B.nextSibling,dc=r,fc=s.group,X.dragged=B,fo={target:B,clientX:(n||t).clientX,clientY:(n||t).clientY},Iw=fo.clientX-c.left,Dw=fo.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,B.style["will-change"]="all",l=function(){if(Ht("delayEnded",o,{evt:t}),X.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!_w&&o.nativeDraggable&&(B.draggable=!0),o._triggerDragStart(t,n),kt({sortable:o,name:"choose",originalEvent:t}),Gt(B,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){Lw(B,u.trim(),Vm)}),pe(a,"dragover",mo),pe(a,"mousemove",mo),pe(a,"touchmove",mo),s.supportPointer?(pe(a,"pointerup",o._onDrop),!this.nativeDraggable&&pe(a,"pointercancel",o._onDrop)):(pe(a,"mouseup",o._onDrop),pe(a,"touchend",o._onDrop),pe(a,"touchcancel",o._onDrop)),_w&&this.nativeDraggable&&(this.options.touchStartThreshold=4,B.draggable=!0),Ht("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Hs||dr))){if(X.eventCanceled){this._onDrop();return}s.supportPointer?(pe(a,"pointerup",o._disableDelayedDrag),pe(a,"pointercancel",o._disableDelayedDrag)):(pe(a,"mouseup",o._disableDelayedDrag),pe(a,"touchend",o._disableDelayedDrag),pe(a,"touchcancel",o._disableDelayedDrag)),pe(a,"mousemove",o._delayedDragTouchMoveHandler),pe(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&pe(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&&Vm(B),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;me(t,"mouseup",this._disableDelayedDrag),me(t,"touchend",this._disableDelayedDrag),me(t,"touchcancel",this._disableDelayedDrag),me(t,"pointerup",this._disableDelayedDrag),me(t,"pointercancel",this._disableDelayedDrag),me(t,"mousemove",this._delayedDragTouchMoveHandler),me(t,"touchmove",this._delayedDragTouchMoveHandler),me(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?pe(document,"pointermove",this._onTouchMove):n?pe(document,"touchmove",this._onTouchMove):pe(document,"mousemove",this._onTouchMove):(pe(B,"dragend",this),pe(De,"dragstart",this._onDragStart));try{document.selection?Sc(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(mi=!1,De&&B){Ht("dragStarted",this,{evt:n}),this.nativeDraggable&&pe(document,"dragover",Y7);var r=this.options;!t&&Gt(B,r.dragClass,!1),Gt(B,r.ghostClass,!0),X.active=this,t&&this._appendGhost(),kt({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(wn){this._lastX=wn.clientX,this._lastY=wn.clientY,Ww();for(var t=document.elementFromPoint(wn.clientX,wn.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(wn.clientX,wn.clientY),t!==n);)n=t;if(B.parentNode[Bt]._isOutsideThisEl(t),n)do{if(n[Bt]){var r=void 0;if(r=n[Bt]._onDragOver({clientX:wn.clientX,clientY:wn.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=Aw(n));qw()}},_onTouchMove:function(t){if(fo){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,s=se&&ci(se,!0),a=se&&s&&s.a,l=se&&s&&s.d,c=vc&&bt&&xw(bt),u=(i.clientX-fo.clientX+o.x)/(a||1)+(c?c[0]-Um[0]:0)/(a||1),d=(i.clientY-fo.clientY+o.y)/(l||1)+(c?c[1]-Um[1]:0)/(l||1);if(!X.active&&!mi){if(r&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<r)return;this._onDragStart(t,!0)}if(se){s?(s.e+=u-(qm||0),s.f+=d-(zm||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,")");ee(se,"webkitTransform",m),ee(se,"mozTransform",m),ee(se,"msTransform",m),ee(se,"transform",m),qm=u,zm=d,wn=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!se){var t=this.options.fallbackOnBody?document.body:De,n=Qe(B,!0,vc,!0,t),r=this.options;if(vc){for(bt=t;ee(bt,"position")==="static"&&ee(bt,"transform")==="none"&&bt!==document;)bt=bt.parentNode;bt!==document.body&&bt!==document.documentElement?(bt===document&&(bt=$n()),n.top+=bt.scrollTop,n.left+=bt.scrollLeft):bt=$n(),Um=xw(bt)}se=B.cloneNode(!0),Gt(se,r.ghostClass,!1),Gt(se,r.fallbackClass,!0),Gt(se,r.dragClass,!0),ee(se,"transition",""),ee(se,"transform",""),ee(se,"box-sizing","border-box"),ee(se,"margin",0),ee(se,"top",n.top),ee(se,"left",n.left),ee(se,"width",n.width),ee(se,"height",n.height),ee(se,"opacity","0.8"),ee(se,"position",vc?"absolute":"fixed"),ee(se,"zIndex","100000"),ee(se,"pointerEvents","none"),X.ghost=se,t.appendChild(se),ee(se,"transform-origin",Iw/parseInt(se.style.width)*100+"% "+Dw/parseInt(se.style.height)*100+"%")}},_onDragStart:function(t,n){var r=this,o=t.dataTransfer,i=r.options;if(Ht("dragStart",this,{evt:t}),X.eventCanceled){this._onDrop();return}Ht("setupClone",this),X.eventCanceled||(Fe=Mw(B),Fe.removeAttribute("id"),Fe.draggable=!1,Fe.style["will-change"]="",this._hideClone(),Gt(Fe,this.options.chosenClass,!1),X.clone=Fe),r.cloneId=Sc(function(){Ht("clone",r),!X.eventCanceled&&(r.options.removeCloneOnHide||De.insertBefore(Fe,B),r._hideClone(),kt({sortable:r,name:"clone"}))}),!n&&Gt(B,i.dragClass,!0),n?(mc=!0,r._loopId=setInterval(r._emulateDragOver,50)):(me(document,"mouseup",r._onDrop),me(document,"touchend",r._onDrop),me(document,"touchcancel",r._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(r,o,B)),pe(document,"drop",r),ee(B,"transform","translateZ(0)")),mi=!0,r._dragStartId=Sc(r._dragStarted.bind(r,n,t)),pe(document,"selectstart",r),zs=!0,window.getSelection().removeAllRanges(),Fs&&ee(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=X.active,u=fc===l,d=a.sort,m=ht||c,h,f=this,g=!1;if(jm)return;function E(te,fe){Ht(te,f,Fn({evt:t,isOwner:u,axis:h?"vertical":"horizontal",revert:s,dragRect:o,targetRect:i,canSort:d,fromSortable:m,target:r,completed:T,onMove:function(Y,be){return Ec(De,n,B,o,Y,Qe(Y),t,be)},changed:L},fe))}function w(){E("dragOverAnimationCapture"),f.captureAnimationState(),f!==m&&m.captureAnimationState()}function T(te){return E("dragOverCompleted",{insertion:te}),te&&(u?c._hideClone():c._showClone(f),f!==m&&(Gt(B,ht?ht.options.ghostClass:c.options.ghostClass,!1),Gt(B,a.ghostClass,!0)),ht!==f&&f!==X.active?ht=f:f===X.active&&ht&&(ht=null),m===f&&(f._ignoreWhileAnimating=r),f.animateAll(function(){E("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(r===B&&!B.animated||r===n&&!r.animated)&&(hi=null),!a.dragoverBubble&&!t.rootEl&&r!==document&&(B.parentNode[Bt]._isOutsideThisEl(t.target),!te&&mo(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function L(){Xt=sn(B),Ir=sn(B,a.draggable),kt({sortable:f,name:"change",toEl:n,newIndex:Xt,newDraggableIndex:Ir,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=Sn(r,a.draggable,n,!0),E("dragOver"),X.eventCanceled)return g;if(B.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||f._ignoreWhileAnimating===r)return T(!1);if(mc=!1,c&&!a.disabled&&(u?d||(s=Ve!==De):ht===this||(this.lastPutMode=fc.checkPull(this,c,B,t))&&l.checkPut(this,c,B,t))){if(h=this._getDirection(t,r)==="vertical",o=Qe(B),E("dragOverValid"),X.eventCanceled)return g;if(s)return Ve=De,w(),this._hideClone(),E("revert"),X.eventCanceled||(uo?De.insertBefore(B,uo):De.appendChild(B)),T(!0);var y=Fm(n,a.draggable);if(!y||eH(t,h,this)&&!y.animated){if(y===B)return T(!1);if(y&&n===t.target&&(r=y),r&&(i=Qe(r)),Ec(De,n,B,o,r,i,t,!!r)!==!1)return w(),y&&y.nextSibling?n.insertBefore(B,y.nextSibling):n.appendChild(B),Ve=n,L(),T(!0)}else if(y&&J7(t,h,this)){var p=ui(n,0,a,!0);if(p===B)return T(!1);if(r=p,i=Qe(r),Ec(De,n,B,o,r,i,t,!1)!==!1)return w(),n.insertBefore(B,p),Ve=n,L(),T(!0)}else if(r.parentNode===n){i=Qe(r);var v=0,C,b=B.parentNode!==n,S=!X7(B.animated&&B.toRect||o,r.animated&&r.toRect||i,h),_=h?"top":"left",k=Nw(r,"top","top")||Nw(B,"top","top"),x=k?k.scrollTop:void 0;hi!==r&&(C=i[_],js=!1,pc=!S&&a.invertSwap||b),v=tH(t,r,i,h,S?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,pc,hi===r);var N;if(v!==0){var W=sn(B);do W-=v,N=Ve.children[W];while(N&&(ee(N,"display")==="none"||N===se))}if(v===0||N===r)return T(!1);hi=r,Us=v;var O=r.nextElementSibling,P=!1;P=v===1;var Q=Ec(De,n,B,o,r,i,t,P);if(Q!==!1)return(Q===1||Q===-1)&&(P=Q===1),jm=!0,setTimeout(Q7,30),w(),P&&!O?n.appendChild(B):r.parentNode.insertBefore(B,P?O:r),k&&Rw(k,0,x-k.scrollTop),Ve=B.parentNode,C!==void 0&&!pc&&(gc=Math.abs(C-Qe(r)[_])),L(),T(!0)}if(n.contains(B))return T(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){me(document,"mousemove",this._onTouchMove),me(document,"touchmove",this._onTouchMove),me(document,"pointermove",this._onTouchMove),me(document,"dragover",mo),me(document,"mousemove",mo),me(document,"touchmove",mo)},_offUpEvents:function(){var t=this.el.ownerDocument;me(t,"mouseup",this._onDrop),me(t,"touchend",this._onDrop),me(t,"pointerup",this._onDrop),me(t,"pointercancel",this._onDrop),me(t,"touchcancel",this._onDrop),me(document,"selectstart",this)},_onDrop:function(t){var n=this.el,r=this.options;if(Xt=sn(B),Ir=sn(B,r.draggable),Ht("drop",this,{evt:t}),Ve=B&&B.parentNode,Xt=sn(B),Ir=sn(B,r.draggable),X.eventCanceled){this._nulling();return}mi=!1,pc=!1,js=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Gm(this.cloneId),Gm(this._dragStartId),this.nativeDraggable&&(me(document,"drop",this),me(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Fs&&ee(document.body,"user-select",""),ee(B,"transform",""),t&&(zs&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),se&&se.parentNode&&se.parentNode.removeChild(se),(De===Ve||ht&&ht.lastPutMode!=="clone")&&Fe&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),B&&(this.nativeDraggable&&me(B,"dragend",this),Vm(B),B.style["will-change"]="",zs&&!mi&&Gt(B,ht?ht.options.ghostClass:this.options.ghostClass,!1),Gt(B,this.options.chosenClass,!1),kt({sortable:this,name:"unchoose",toEl:Ve,newIndex:null,newDraggableIndex:null,originalEvent:t}),De!==Ve?(Xt>=0&&(kt({rootEl:Ve,name:"add",toEl:Ve,fromEl:De,originalEvent:t}),kt({sortable:this,name:"remove",toEl:Ve,originalEvent:t}),kt({rootEl:Ve,name:"sort",toEl:Ve,fromEl:De,originalEvent:t}),kt({sortable:this,name:"sort",toEl:Ve,originalEvent:t})),ht&&ht.save()):Xt!==fi&&Xt>=0&&(kt({sortable:this,name:"update",toEl:Ve,originalEvent:t}),kt({sortable:this,name:"sort",toEl:Ve,originalEvent:t})),X.active&&((Xt==null||Xt===-1)&&(Xt=fi,Ir=qs),kt({sortable:this,name:"end",toEl:Ve,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Ht("nulling",this),De=B=Ve=se=uo=Fe=dc=Pr=fo=wn=zs=Xt=Ir=fi=qs=hi=Us=ht=fc=X.dragged=X.ghost=X.clone=X.active=null;var t=this.el;bc.forEach(function(n){t.contains(n)&&(n.checked=!0)}),bc.length=qm=zm=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":B&&(this._onDragOver(t),Z7(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)||rH(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=Ws.modifyOption(this,t,n);typeof o<"u"?r[t]=o:r[t]=n,t==="group"&&$w(r)},destroy:function(){Ht("destroy",this);var t=this.el;t[Bt]=null,me(t,"mousedown",this._onTapStart),me(t,"touchstart",this._onTapStart),me(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(me(t,"dragover",this),me(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),hc.splice(hc.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Pr){if(Ht("hideClone",this),X.eventCanceled)return;ee(Fe,"display","none"),this.options.removeCloneOnHide&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),Pr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Pr){if(Ht("showClone",this),X.eventCanceled)return;B.parentNode==De&&!this.options.group.revertClone?De.insertBefore(Fe,B):uo?De.insertBefore(Fe,uo):De.appendChild(Fe),this.options.group.revertClone&&this.animate(B,Fe),ee(Fe,"display",""),Pr=!1}}};function Z7(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Ec(e,t,n,r,o,i,s,a){var l,c=e[Bt],u=c.options.onMove,d;return window.CustomEvent&&!dr&&!Hs?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 Vm(e){e.draggable=!1}function Q7(){jm=!1}function J7(e,t,n){var r=Qe(ui(n.el,0,n.options,!0)),o=Pw(n.el,n.options,se),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 eH(e,t,n){var r=Qe(Fm(n.el,n.options.draggable)),o=Pw(n.el,n.options,se),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 tH(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&&gc<c*o){if(!js&&(Us===1?l>u+c*i/2:l<d-c*i/2)&&(js=!0),js)m=!0;else if(Us===1?l<u+gc:l>d-gc)return-Us}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return nH(t)}return m=m||s,m&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function nH(e){return sn(B)<sn(e)?1:-1}function rH(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 oH(e){bc.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&bc.push(r)}}function Sc(e){return setTimeout(e,0)}function Gm(e){return clearTimeout(e)}yc&&pe(document,"touchmove",function(e){(X.active||mi)&&e.cancelable&&e.preventDefault()}),X.utils={on:pe,off:me,css:ee,find:Lw,is:function(t,n){return!!Sn(t,n,t,!1)},extend:$7,throttle:Ow,closest:Sn,toggleClass:Gt,clone:Mw,index:sn,nextTick:Sc,cancelNextTick:Gm,detectDirection:Fw,getChild:ui,expando:Bt},X.get=function(e){return e[Bt]},X.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&&(X.utils=Fn(Fn({},X.utils),r.utils)),Ws.mount(r)})},X.create=function(e,t){return new X(e,t)},X.version=H7;var Je=[],Vs,Xm,Km=!1,Ym,Zm,wc,Gs;function iH(){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?pe(document,"dragover",this._handleAutoScroll):this.options.supportPointer?pe(document,"pointermove",this._handleFallbackAutoScroll):r.touches?pe(document,"touchmove",this._handleFallbackAutoScroll):pe(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?me(document,"dragover",this._handleAutoScroll):(me(document,"pointermove",this._handleFallbackAutoScroll),me(document,"touchmove",this._handleFallbackAutoScroll),me(document,"mousemove",this._handleFallbackAutoScroll)),zw(),_c(),W7()},nulling:function(){wc=Xm=Vs=Km=Gs=Ym=Zm=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(wc=n,r||this.options.forceAutoScrollFallback||Hs||dr||Fs){Qm(n,this.options,a,r);var l=Mr(a,!0);Km&&(!Gs||i!==Ym||s!==Zm)&&(Gs&&zw(),Gs=setInterval(function(){var c=Mr(document.elementFromPoint(i,s),!0);c!==l&&(l=c,_c()),Qm(n,o.options,c,r)},10),Ym=i,Zm=s)}else{if(!this.options.bubbleScroll||Mr(a,!0)===$n()){_c();return}Qm(n,this.options,Mr(a,!1),!1)}}},cr(e,{pluginName:"scroll",initializeByDefault:!0})}function _c(){Je.forEach(function(e){clearInterval(e.pid)}),Je=[]}function zw(){clearInterval(Gs)}var Qm=Ow(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;Xm!==n&&(Xm=n,_c(),Vs=t.scroll,u=t.scrollFn,Vs===!0&&(Vs=Mr(n,!0)));var d=0,m=Vs;do{var h=m,f=Qe(h),g=f.top,E=f.bottom,w=f.left,T=f.right,L=f.width,y=f.height,p=void 0,v=void 0,C=h.scrollWidth,b=h.scrollHeight,S=ee(h),_=h.scrollLeft,k=h.scrollTop;h===l?(p=L<C&&(S.overflowX==="auto"||S.overflowX==="scroll"||S.overflowX==="visible"),v=y<b&&(S.overflowY==="auto"||S.overflowY==="scroll"||S.overflowY==="visible")):(p=L<C&&(S.overflowX==="auto"||S.overflowX==="scroll"),v=y<b&&(S.overflowY==="auto"||S.overflowY==="scroll"));var x=p&&(Math.abs(T-o)<=s&&_+L<C)-(Math.abs(w-o)<=s&&!!_),N=v&&(Math.abs(E-i)<=s&&k+y<b)-(Math.abs(g-i)<=s&&!!k);if(!Je[d])for(var W=0;W<=d;W++)Je[W]||(Je[W]={});(Je[d].vx!=x||Je[d].vy!=N||Je[d].el!==h)&&(Je[d].el=h,Je[d].vx=x,Je[d].vy=N,clearInterval(Je[d].pid),(x!=0||N!=0)&&(c=!0,Je[d].pid=setInterval(function(){r&&this.layer===0&&X.active._onTouchMove(wc);var O=Je[this.layer].vy?Je[this.layer].vy*a:0,P=Je[this.layer].vx?Je[this.layer].vx*a:0;typeof u=="function"&&u.call(X.dragged.parentNode[Bt],P,O,e,wc,Je[this.layer].el)!=="continue"||Rw(Je[this.layer].el,P,O)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&m!==l&&(m=Mr(m,!1)));Km=c}},30),Uw=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 Jm(){}Jm.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=ui(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:Uw},cr(Jm,{pluginName:"revertOnSpill"});function eh(){}eh.prototype={onSpill:function(t){var n=t.dragEl,r=t.putSortable||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:Uw},cr(eh,{pluginName:"removeOnSpill"}),X.mount(new iH),X.mount(eh,Jm);var jw=100,Vw=Symbol("EMULATED_DRAG_EVENT");function sH(e,t){return e[Vw]===t}var Gw=class{constructor(){A(this,"_target",null),A(this,"_interval",0),A(this,"_x",0),A(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[Vw]=this,Mt(()=>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)},jw),!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)},jw)))}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 Cc(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 Xs(e){const t=getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}function th(e){const t=document.createElement("div");t.replaceChildren(...Re(e.atomHTML));const n=t.querySelector("img");if(!n)return Tt(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=Xs(e.targetAtom):r=e.targetAtom.parentNode?Xs(e.targetAtom.parentNode):Xs(e.targetAtom),n.setAttribute("width",String(r)),document.querySelector(".noresp-em-narrow-table")?Cc(t):n.style.maxWidth=r+"px",Tt(t)}function Xw(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=Xs(n);o.style.display=a;const c=s>=Xs(t)?l:Math.min(s,l);return!c||c===s?!1:(o.setAttribute("width",String(c)),document.querySelector(".noresp-em-narrow-table")?Cc(e):o.style.maxWidth=c+"px",!0)}function Kw(e,t){const n=e.atomHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Re(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")?Cc(n):(r.style.maxWidth=i+"px",r.style.width="100%"),Jn(e.targetElem,e.targetPlace,`
|
|
52
|
+
`+Tt(n)+`
|
|
53
|
+
`),t()},o.src=r.getAttribute("src")||"",!1}function nh(e){const t=e.blockHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");t.replaceChildren(...Re(e.blockHTML));const n=t.querySelector("img.em-countdown");if(!n)return Tt(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()),Dt(n,"src",i.href),n.setAttribute("em-cd-settings",i.search.substring(1)),Tt(t)}function Tc(e){const t=e.blockIsTr?document.createElement("table"):document.createElement("div");return t.replaceChildren(...Re(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(" ")}),Cc(t),Tt(t)}function aH(e){e&&(e.removeAttribute("em-edit"),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")))}var lH=class{constructor(){A(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=X.create(e,t);return this._items.set(e,n),n}entries(){return[...this._items]}},Dr=new lH,cH=Number.MAX_VALUE,uH=0;function Yw(e){return typeof e=="object"?e.name:e}var dH=class{constructor(){A(this,"emulator",new Gw),A(this,"x",0),A(this,"y",0),A(this,"_tracked",!1),A(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)))}},an=new dH,Zw=X.prototype,fH=mt(Zw._onDragOver);function mH(e){Dr.gc(),an.track(),Zw._onDragOver=fH;const t=document.querySelectorAll("[em=group]");X.prototype._emulateDragOver=function(){};let n;const r=()=>{e.commit(!0)};function o(a,l){let c;function u(f,g){let E=null,w=Number.MAX_VALUE;const T=Yw(X.active?.options.group);for(const[L,y]of Dr.entries())if(Yw(y.options.group)===T&&(!a||c&&a(L,c)!==!1)){for(const p of L.children)if(!p.classList.contains("sortable-drag")){const v=p.getBoundingClientRect(),C=f<v.left?v.left-f:f>v.right?f-v.right:0,b=g<v.top?v.top-g:g>v.bottom?g-v.bottom:0;if(C<cH||b<uH){const S=Math.sqrt(C*C+b*b);S<w?(E=[y,p],w=S):S===w&&E[1].contains(p)&&(E=[y,p])}}}return E}function d(f){const g="TouchEvent"in window&&f instanceof TouchEvent?f.touches[0]:f,E=u(g.clientX,g.clientY);if(E){const[L,y]=E,p=y.getBoundingClientRect();var w={clientX:p.left+p.width/2,clientY:g.clientY};for(var T in f)f.hasOwnProperty(T)&&(w[T]=f[T]);w.target=y,w.rootEl=y.parentNode,w.preventDefault=void 0,w.stopPropagation=void 0,L._onDragOver(w)}}return{onStart:f=>{c=f.item,X.ghost&&Yd(X.ghost),aH(X.ghost),e.beginTextUpdate(),window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),an.emulator.start(an.x,an.y)?(window.addEventListener("mousemove",an.handleMouseMove),n&&(n.dispose(),n=void 0)):f.preventDefault()},onEnd:f=>{window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d);let g=!1;f.from===f.to?an.emulator.end(an.x,an.y):(g=!!l?.(f),an.emulator.drop(an.x,an.y)),window.removeEventListener("mousemove",an.handleMouseMove),e.endTextUpdate(),f.from===f.to&&f.oldIndex!==f.newIndex&&e.commit(!0),g&&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&&!Dr.get(l)&&Dr.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),Dr.get(l)||Dr.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&&Mn(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=>Xw(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),Dr.get(c)||Dr.create(c,{forceFallback:!0,group:"blocks-sorting",handle:`.of-block .${je.drag}`,...o(),onMove:r}))}}}var hH=class{constructor(){A(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)}},rh={get textDocument(){return R(Rt,Vi)},commit:qo};function pH(){const e=U.get("applicationTheme")||"light";let t=!1;try{rh.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?a4e11bd0";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?a4e11bd0`;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{rh.textDocument.endUpdate()}t&&rh.commit(!1)}var Nee=".em-prevent-action";function gH(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 bH(e){const t=document.body;if(!t)return;const n=e.isAppLocked()||e.isIntegratorLocked();(e.isAppLocked()!==t.classList.contains("mceNonEditable")||e.isIntegratorLocked())&&Ie(t,!!n,"mceNonEditable"),Ie(t,!!U.get("previewPage"),"em-sandbox-preview")}function yH(e){const{htmlDocument:t,commit:n,focusController:r}=e,o=R7(()=>mH(t));t.onChange(a=>{a.some(l=>l.added.length||l.characterDataChanged||l.reordered?.length||l.reparented?.length)&&o()}),t.onChange(()=>{pH()}),t.onRefresh(()=>e.initPreview()),t.onChange(a=>{a.some(l=>l.removed.some(c=>c instanceof HTMLHeadElement||c instanceof HTMLLinkElement&&c.hasAttribute("em")))&&document.querySelector(".em-editor-wrapper")?.remove()});const i=new hH;let s;t.onChange(a=>{for(const l of a)for(const c of l.added)i.add(c.parentElement??c);s||(s=setTimeout(()=>{r.whenEditorLostFocus(()=>{i.clear(),n(!1)}),s=void 0},1e3))}),t.onChange(x7(e.applicationElementSettingsSet)),t.onChange(()=>{e.selectionLock.isLocked()||(gH(e),bH(e.editLock))})}function vH(e,t,n){if(!(e instanceof Element)||!e.closest(".em-prevent-action"))return;const r=document.querySelector(".em-editor-wrapper");if(!document.querySelector("[em-edit]")&&!r)return;const o=n.acquire();try{document.querySelectorAll("[em-edit]").forEach(i=>i.removeAttribute("em-edit")),r&&(r.style.display="none"),Mt(()=>document.querySelectorAll("editor").forEach(i=>i.blur())),t.forget()}finally{o.releaseLater()}}function EH(e,t){const n=mt(r=>vH(r.target,e,t));return window.addEventListener("mousedown",n,!0),window.addEventListener("click",n,!0),{dispose(){window.removeEventListener("mousedown",n,!0),window.removeEventListener("click",n,!0)}}}var SH={name:"sandbox.fingerprint",provides:[Lo],awaits:{services:[K,Me]},setup(e){const t=R(e,K),n=R(e,Me),r=ZR(o=>t.getOuterHtml(o));QR(r,n),EH(r,n),e.inject(Lo,r)}},wH={name:"sandbox.setCursor",provides:[Ot],awaits:{services:[K,mn,_t]},setup(e){const t={HTMLDocument:R(e,K),documentMapping:R(e,mn),remoteDocument:R(e,_t),messageService:G};e.inject(Ot,n=>eM(n,t))}},_H={name:"sandbox.wrapEditor",provides:[hn],awaits:{services:[K,mn,Te]},setup:e=>e.inject(hn,A7({commit:lt(e),htmlDocument:R(e,K),documentMapping:R(e,mn)}))};function CH(e){const{container:t}=e;rc.registerAll({MessageService:()=>G,FocusState:()=>e.focusController,SyncService:()=>t.getInstance(K),SyncServiceInternals:()=>t.getInstance(_t),TextDocument:()=>t.getInstance(Vi),Mapping:()=>t.getInstance(mn),EditorSurface:()=>({surface:e.surface})}),e.features&&e.features.length>0&&rc.initFeatures(e.features)}var TH=e=>e,AH=e=>`table:empty::before {
|
|
54
|
+
/*content: 'Paste block here';*/
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
table:is(:empty, :has(> tbody:only-child:empty))::after {
|
|
58
|
+
content: '${e.DROP_BLOCK_HINT}' !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[em="block"].empty-structure td:not([height]):not([width]):empty::before {
|
|
62
|
+
/*content: 'Paste atom here';*/
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.em-block-insert:after {
|
|
66
|
+
content: '${e.PASTE_HERE}' !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.em-atom-insert:after,
|
|
70
|
+
.em-blockatom-insert:after {
|
|
71
|
+
content: '${e.PASTE_HERE}' !important;
|
|
72
|
+
}`,kH=class extends ve{constructor(e){super(),A(this,"htmlDocument",void 0),A(this,"_localized",{...wL(TH)}),A(this,"_styles",""),A(this,"_onChangeLocaleEmitter",new he),A(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)}}}),A(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=AH(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 LH(e){const t=new kH(e),n=r=>{t.setTranslations(r)};return t.addDisposable(G.addListener(Ae.SANDBOX_TRANSLATIONS,n)),t}function NH(e,t,n){const r=new ve;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 xH(e){const t=new ve,n=r=>{sH(r,e)||G.send(Ae.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 OH(){const e=new Gw,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 ve;return n.addDisposable(G.addListener(Ae.SANDBOX_DRAG_EVENT,t)),n.addDisposable(xH(e)),n}function RH(){return NodeFilter.FILTER_ACCEPT}function MH(e){if(e instanceof Comment)return[e];const t=[];if(e){const n=document.createNodeIterator(e,NodeFilter.SHOW_COMMENT,RH);let r;for(;r=n.nextNode();)t.push(r)}return t}var PH=new Ty,IH=new Set;function Qw(e){return e?PH.getUnescapedText(e,!0,IH)!==e:!1}function Jw(e){return e.nodeValue?Qw(e.nodeValue):!1}function DH(e){const t=e.previousSibling;if(t instanceof HTMLSpanElement&&t.classList.contains("em-code")&&t.classList.contains("em-code_var"))return t}function Ac(e){const t=e?.nextSibling;if(t instanceof Comment&&Jw(t))return t}function e_(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 BH(){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(e_(r,i)===0&&e_(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 HH=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();const o=e.closest('[contenteditable="true"]');Mt(()=>{n.addRange(r),o?.focus()})},t_=e=>{const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n=null,r;for(;r=t.nextNode();)n=r;return n},FH=(e,t)=>{const n=e.startContainer,r=e.startOffset,o=t_(t);if(!o)return!1;const i=o.textContent?.length??0;return n===o&&r===i},$H=(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 WH(e,t,n){const{startContainer:r}=e;if(!e.collapsed||!t.isForeign(r))return null;let o=r;for(;o.parentNode&&t.isForeign(o.parentNode);)o=o.parentNode;if(!o.parentElement?.closest('[contenteditable="true"]'))return null;if(n==="ArrowLeft"||n==="ArrowRight")return{node:o,side:n==="ArrowLeft"?"before":"after"};const i=document.createRange();return i.selectNodeContents(o),i.setEnd(e.startContainer,e.startOffset),{node:o,side:i.toString()===""?"before":"after"}}function n_(e){const t=e.startContainer;return Pt(t)?t:Pt(t.parentNode)?t.parentNode:null}function qH(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 zH(e){return document.createTreeWalker(e,NodeFilter.SHOW_TEXT).nextNode()}function UH({em:e,side:t}){const n=t==="after"?t_(e):zH(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);const o=window.getSelection();o&&us(o,r)}function jH(e){const t=T=>e.renderOnly(T);let n=null,r=null,o=!1;const i=T=>!!n&&n.em===T.em&&n.side===T.side&&r===(T.side==="after"?"ArrowLeft":"ArrowRight"),s=T=>{sM(document,t,T)&&e.commit(!1),aM(document,t,T)},a=()=>{const T=window.getSelection();if(o||!T?.rangeCount)return;const L=T.getRangeAt(0),y=e.ownership?WH(L,e.ownership,r):null;if(y){n=null;const C=af(y.node,y.side,t);s(C);return}const p=rv(L);if(p&&i(p)){n=null,UH(p),s();return}if(p){const C=El(p.em,p.side,t);n=p,s(C);return}const v=L.collapsed?n_(L):null;n=v?qH(v):null,s(v)},l=()=>{const T=window.getSelection(),L=T?.rangeCount?n_(T.getRangeAt(0)):null;return!!L&&e.applyOwn(()=>lM(L,t))!==null},c=T=>{!T.isComposing&&l()&&e.commit(!0)},u=()=>{o=!0},d=()=>{o=!1,l(),e.commit(!0)},m=T=>{r=T.key},h=T=>{const L=window.getSelection();L?.rangeCount&&T?.closest?.('[contenteditable="true"]')&&uv(L.getRangeAt(0),t)},f=T=>{T.key?.length===1&&!T.ctrlKey&&!T.metaKey&&!T.altKey&&h(T.target)},g=T=>{T.inputType==="insertCompositionText"&&h(T.target)},E=()=>{r=null},w=T=>lf(T,t);return e.holdCaretAfterBreak=w,document.addEventListener("selectionchange",a),document.addEventListener("input",c),document.addEventListener("compositionstart",u,!0),document.addEventListener("compositionend",d,!0),document.addEventListener("keydown",m,!0),document.addEventListener("pointerdown",E,!0),window.addEventListener("keydown",f,!0),window.addEventListener("beforeinput",g,!0),{dispose(){e.holdCaretAfterBreak===w&&(e.holdCaretAfterBreak=void 0),document.removeEventListener("selectionchange",a),document.removeEventListener("input",c),document.removeEventListener("compositionstart",u,!0),document.removeEventListener("compositionend",d,!0),document.removeEventListener("keydown",m,!0),document.removeEventListener("pointerdown",E,!0),window.removeEventListener("keydown",f,!0),window.removeEventListener("beforeinput",g,!0)}}}function oh(){return U.get("commonStyles")}var kc={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"},VH={"Sans Serif":"sans-serif",Serif:"serif"},r_=":scope > td, :scope > tr > td, :scope > tbody > tr > td";function pi(e){return e.querySelector(r_)}function Ks(e){return Array.from(e.querySelectorAll(r_))}function ih(e){const t=e.closest('[em="block"]');return t?pi(t)??t.querySelector("td"):null}function o_(e){const t=e.closest('[em="block"]');return!!t&&(e===t||Ks(t).includes(e))}var GH=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},Br=(e,t)=>{GH()},Hr=new Map;function XH(e){return Hr.get(e.toLowerCase())?.[0]}function sh(e){return Hr.get(e.toLowerCase())??[]}function KH(){return Hr.size>0}function i_(){return[...Hr.values()].map(e=>e[0])}function YH(e){Hr=new Map;for(const t of e??[]){const n=t.family.toLowerCase();Hr.set(n,[...Hr.get(n)??[],t])}return Hr}var ZH=e=>{const t=YH(e);Br("iframe: project fonts map received",{count:t.size,families:[...t.keys()],entries:e})};function QH(){const e=new ve;return e.addDisposable(G.addListener(Ae.SANDBOX_SET_PROJECT_FONTS,ZH)),e}var JH={"sans-serif":"Helvetica, Arial, sans-serif",serif:'"Times New Roman", Times, serif'};function s_(e){return e.category==="serif"?"serif":"sans-serif"}function Lc(e,t){const n=XH(t);return n?(e.style.fontFamily=JH[s_(n)],!0):!1}var eF=/(?:\/\*\s*em-project-font-[^*]*\*\/\s*)?@font-face\s*\{([^}]*)\}\s*/g,tF=/url\(\s*(['"]?)(.*?)\1\s*\)/,nF=e=>e.trim().replace(/^(['"])(.*)\1$/,"$2");function ah(e){return Array.from(e.matchAll(eF),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:nF(n.get("font-family")??""),src:tF.exec(n.get("src")??"")?.[2]??"",weight:n.get("font-weight")||"400",style:n.get("font-style")||"normal"}})}function a_(e){return[e.family.toLowerCase(),e.src,e.weight,e.style].join("|")}function l_(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 lh(){return Rt.getInstance(Fg)?.()??document.head}function ch(){return lh().querySelector('style[em="styles"]')??document.querySelector('style[em="styles"]')}function $e(){if(!ch()){const e=document.createElement("style");e.setAttribute("em","styles"),lh().append(e)}}function rF(){const e=lh(),t=()=>{const r=ch(),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 Nc(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function c_(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 uh(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(`
|
|
73
|
+
`));let l=n(s+`
|
|
74
|
+
`+[...a.querySelectorAll("style")].map(c=>c.innerHTML).join(`
|
|
75
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;l=r(l,{indent:" ",autosemicolon:!0}),i.textContent=`
|
|
76
|
+
`+l+`
|
|
77
|
+
`}function gi(e){return(e||"").replace(/\s/g,"")}function xc(e,t){return`em-font-${gi(e)}-${gi(t)}`}function u_(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function dh(e){return xc(e[2]||"",e[3]||"")}var fh="em-font-custom";function oF(e){return e[1]==="Project Fonts"}function mh(e,t){oF(t)&&e.classList.add(fh)}function Ys(e,t){const n=[...e.classList].filter(r=>r.startsWith(t));n.length>0&&e.classList.remove(...n)}function hh(e,t){t.forEach(n=>e.style.removeProperty(n))}function d_(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+")",Dt(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 Oc(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=j(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||(j(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=j(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=j(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=j(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=j(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=j(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=j(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=j(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=j(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=j(e.style.borderLeftColor)||null)}return t}function bi(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 Zs(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]&&j(n[0])||"",inset:n[3]==="inset"||n[4]==="inset"||n[5]==="inset"})}return t}function Be(e){return e==null||e===""}function ph(e){const{elem:t,settings:n}=e,{border:r}=n;r&&(r.all?!Be(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&&(!Be(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&&(!Be(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&&(!Be(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&&(!Be(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 f_(e){const{elem:t,settings:n}=e,{boxShadow:r}=n;if(r)if(!Be(r.hOffset)&&!Be(r.vOffset)){let o="";o=r.inset?"inset ":"",o+=r.hOffset+"px ",o+=r.vOffset+"px ",o+=Be(r.blurRadius)?"":r.blurRadius+"px ",o+=Be(r.spreadRadius)?"":r.spreadRadius+"px ",o+=r.color?r.color:"",t.style.boxShadow=o}else t.style.removeProperty("box-shadow")}function yi(e){const{elem:t,settings:n}=e,{borderRadius:r}=n;r&&(r.all?t.style.borderRadius=r.all+"px":(Be(r.topLeft)?t.style.removeProperty("border-top-left-radius"):t.style.borderTopLeftRadius=r.topLeft+"px",Be(r.topRight)?t.style.removeProperty("border-top-right-radius"):t.style.borderTopRightRadius=r.topRight+"px",Be(r.bottomRight)?t.style.removeProperty("border-bottom-right-radius"):t.style.borderBottomRightRadius=r.bottomRight+"px",Be(r.bottomLeft)?t.style.removeProperty("border-bottom-left-radius"):t.style.borderBottomLeftRadius=r.bottomLeft+"px"))}function m_(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+=m_(n)}),t}function h_(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=>h_(r,t,n))}function iF(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 p_=/\[if[^\]]*mso[^\]]*\]/i,g_="[if gte mso 9]></v:textbox></v:rect><![endif]";function sF(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 aF(e){return(e.style.backgroundRepeat||"").trim().toLowerCase().startsWith("repeat")?"tile":"frame"}function lF(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 cF(e){const t=lF(e),n=Rt.getInstance($g);return n?n(e,t):t}function uF(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 b_(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function Qs(e){if(!b_(e))return!1;const t=e.nodeValue||"";return p_.test(t)&&/src\s*=/i.test(t)&&/v:(fill|image|rect)/i.test(t)}function gh(e){if(!b_(e))return!1;const t=e.nodeValue||"";return p_.test(t)&&/<\/v:(rect|image|textbox)>/i.test(t)&&!/src\s*=/i.test(t)}function bh(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function y_(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function v_(e){for(const t of Array.from(e.childNodes))(Qs(t)||gh(t))&&e.removeChild(t)}function Js(e,t="inside"){return t==="around"?Qs(bh(e)):Array.from(e.childNodes).some(n=>Qs(n))}function E_(e,t="inside"){if(t==="around"){const n=e.parentNode;if(!n)return;const r=bh(e),o=y_(e);Qs(r)&&n.removeChild(r),gh(o)&&n.removeChild(o);return}v_(e)}function S_(e,t="inside"){const n=sF(e);if(!n){E_(e,t);return}const r=uF(n,(e.style.backgroundColor||e.getAttribute("bgcolor")||"").trim(),aF(e),cF(e)),o=e.ownerDocument;if(o){if(t==="around"){const i=e.parentNode;if(!i)return;const s=bh(e);Qs(s)&&i.removeChild(s);const a=y_(e);gh(a)&&i.removeChild(a),i.insertBefore(o.createComment(r),e),i.insertBefore(o.createComment(g_),e.nextSibling);return}v_(e),e.insertBefore(o.createComment(r),e.firstChild),e.appendChild(o.createComment(g_))}}function ea(e,t,n="inside"){t?.outlookBackground===!0?S_(e,n):t?.outlookBackground===!1?E_(e,n):Js(e,n)&&iF(t)&&S_(e,n)}var yh=/v:roundrect/i,vh=/\[if\s*!\s*mso\]/i,w_=/^\s*(?:<!)?\[endif\]\s*$/i,Eh=["background-color","border-radius","border","border-top","border-right","border-bottom","border-left","border-color","border-style","border-width","box-shadow"],dF=[...Eh,"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 vi(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function Sh(e){const t=[],n=r=>{r.childNodes.forEach(o=>{vi(o)&&yh.test(o.nodeValue||"")&&t.push(o),n(o)})};return n(e),t}function __(e,t){const n=Fr(e);if(!n)return!1;const r=n.nodeValue||"";if(!/<center\b[^>]*>[\s\S]*?<\/center>/i.test(r))return!1;const o=T_((t||"").replace(/\s+/g," ").trim());return n.nodeValue=r.replace(/(<center\b[^>]*>)[\s\S]*?(<\/center>)/i,(i,s,a)=>`${s}${o}${a}`),!0}function Fr(e){for(const t of Array.from(e.childNodes)){if(vi(t)&&yh.test(t.nodeValue||""))return t;const n=Fr(t);if(n)return n}return null}function C_(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function fF(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function Wn(e){const t=parseInt(String(e??""),10);return Number.isFinite(t)?t:0}function mF(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 T_(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function hF(e,t){const n=e.getAttribute("bgcolor");n&&(t.style.backgroundColor||(t.style.backgroundColor=n),e.removeAttribute("bgcolor"));for(const r of Eh){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 pF(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 Eh){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 gF(e){const t=e.style.display;return t!=="inline-block"&&t!=="block"?!1:!!(e.style.backgroundColor||e.style.borderRadius)}function wh(e){if(!e)return null;for(const t of Array.from(e.querySelectorAll("[style]")))if(gF(t))return t;return null}function _h(e){return e?!!wh(e)||!!Fr(e):!1}function bF(e,t){for(const n of dF){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 yF(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function A_(e,t){const n=wh(t);return n?(bF(n,t),yF(n),Sh(t).forEach(r=>r.parentNode?.removeChild(r)),Ch(t),!0):!1}function vF(e){for(const t of e){const n=t.nodeValue||"";if(!yh.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?Wn(i[1]):0,height:s?Wn(s[1]):0,arcsize:a?Wn(a[1]):0}}return{width:0,height:0,arcsize:0}}function EF(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:j(o)||o||"#000000",weight:`${i}px`,dash:s}}var SF=new Set(["bold","bolder","600","700","800","900"]);function wF(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&&SF.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 _F(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}">${T_(e.label)}</center></v:roundrect><![endif]`}function Ch(e){const t=[],n=r=>{r.childNodes.forEach(o=>{if(vi(o)){const i=o.nodeValue||"";(vh.test(i)||w_.test(i))&&t.push(o)}n(o)})};n(e),t.forEach(r=>r.parentNode?.removeChild(r))}function CF(e){const t=e.closest("td");if(!t)return;const n=e.closest("a")||t.querySelector("a");n&&A_(t,n),Sh(t).forEach(r=>r.parentNode?.removeChild(r)),Ch(t),n&&pF(t,n)}function TF(e){const t=e.ownerDocument;if(!t)return;const n=e.parentNode;if(!n)return;const r=C_(e);vi(r)&&vh.test(r.nodeValue||"")||n.insertBefore(t.createComment("[if !mso]><!"),e);const o=fF(e);vi(o)&&w_.test(o.nodeValue||"")||n.insertBefore(t.createComment("<![endif]"),e.nextSibling)}function AF(e,t){return e?.backgroundColor!==void 0?e.backgroundColor===""?"none":e.backgroundColor:t.style.backgroundColor||t.getAttribute("bgcolor")||"none"}function kF(e,t){if(t?.width?.value&&t.width.dim==="px")return Wn(t.width.value);const n=e?.getAttribute("width")||"";return n&&!n.includes("%")?Wn(n):0}function LF(e,t){if(t?.height?.value&&t.height.dim==="px")return Wn(t.height.value);const n=e.getAttribute("height")||"";return n&&!n.includes("%")?Wn(n):Wn(e.style.height)}function NF(e,t){return e?.borderRadius&&e.borderRadius.all!=null?Wn(e.borderRadius.all):Wn(t.style.borderRadius)}function xF(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 Th(e,t){const n=e.closest("td");if(!n)return;const r=e.closest("a")||n.querySelector("a");if(!r)return;const o=Sh(n),i=mF(r,o),s=vF(o);A_(n,r),hF(n,r),o.forEach(w=>w.parentNode?.removeChild(w)),Ch(n);const a=kF(n.closest("table"),t)||s.width,l=LF(n,t)||s.height,c=NF(t,r),u=wF(r),d=EF(r),m=xF(c,a,l)||s.arcsize,h={href:t?.href!==void 0?t.href:r.getAttribute("href")||"",fillcolor:AF(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||""};TF(r);const f=n.ownerDocument;if(!f)return;const g=C_(r),E=f.createComment(_F(h));vi(g)&&vh.test(g.nodeValue||"")&&g.parentNode?g.parentNode.insertBefore(E,g):n.insertBefore(E,n.firstChild)}function Rc(e,t){return e.replace(/(^|[;\s])color:\s*[^;]*;?/i,`$1color: ${t};`)}function qn(e){return typeof e=="number"&&Number.isFinite(e)}function OF(e){return!e||typeof e!="object"?!1:qn(e.all)||qn(e.top)||qn(e.right)||qn(e.bottom)||qn(e.left)}function RF(e,t){const n=qn(t.all)?t.all:void 0,r=qn(t.top)?t.top:n,o=qn(t.right)?t.right:n,i=qn(t.bottom)?t.bottom:n,s=qn(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 k_(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 L_(e){const t=document.querySelector("title");if(t){t.insertAdjacentElement("afterend",e);return}document.head.appendChild(e)}function N_(e){return e.stylesheet??SL(e.source_url)}function MF(e){return`/* ${`em-project-font-${gi(e.family)}-${e.weight}-${e.style}`} */
|
|
78
|
+
@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 PF=e=>a_({family:e.family,src:e.source_url,weight:e.weight,style:e.style});function IF(e,t){if(k_(t,e))return;const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.setAttribute("em-class",t),L_(n)}function ta(e,t){const n=e.fontFamilyArray[1],r=e.fontFamilyArray[2],o=e.fontFamilyArray[3],i=xc(r,o);if(n==="Project Fonts"){const d=sh(r),m=d[0];if(Br("iframe: addFontFamilyClass Project Fonts",{fontFamilyArray:e.fontFamilyArray,emClass:i,entryFound:!!m,faces:d}),m){$e();const h=document.querySelector('style[em="styles"]'),f=[...new Set(d.filter(N_).map(g=>g.source_url))];if(f.forEach(g=>IF(g,i)),h){const g=new Set(ah(h.textContent??"").map(a_)),E=d.filter(y=>!N_(y)).filter(y=>!g.has(PF(y))).map(MF).join(`
|
|
79
|
+
`),w=E!=="";w&&h.insertAdjacentHTML("afterbegin",`${E}
|
|
80
|
+
`);const T=`.${u_(i)} {`,L=!h.textContent?.includes(T);if(L){const y=kc[o],p=(y||m.weight).replace(/i$/g,""),v=y?y.endsWith("i"):m.style!=="normal";let C=`font-family: ${JSON.stringify(m.family)}, ${s_(m)}!important;`;C+=` font-weight: ${p}!important;`,v&&(C+=" font-style: italic!important;"),h.insertAdjacentHTML("beforeend",`
|
|
81
|
+
${T} ${C} }`)}Br("iframe: project font attached",{emClass:i,stylesheetUrls:f,faceInserted:w,classInserted:L})}else Br("iframe: style[em=styles] not found — @font-face not injected");setTimeout(()=>{ho({elem:document.documentElement},t),$r(t),t&&t(!1)},0);return}Br("iframe: Project Fonts entry missing in map — skip Google Fonts fallback",{fontFamily:r,mapSize:document.querySelectorAll('style[em="styles"]').length}),setTimeout(()=>{ho({elem:document.documentElement},t),$r(t)},0);return}if(!k_(i)){const d=document.createElement("link");d.setAttribute("rel","stylesheet");const m=kc[o]||"400",h=m.indexOf("i")>-1,f=m.replaceAll("i","");d.setAttribute("href",`https://fonts.googleapis.com/css2?family=${r}:ital,wght@${h?"1":"0"},${f}&display=swap`),d.setAttribute("em-class",i),L_(d)}$e();const s=kc[o]||"400",a=s.replaceAll("i",""),l=s.indexOf("i")>-1;let c=`font-family: '${r}', ${VH[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",`
|
|
82
|
+
.${u_(i)} { ${c} }`),setTimeout(()=>{ho({elem:document.documentElement},t),$r(t)},0)}function DF(e){const t=gi(e);return!!document.querySelector(`[class*="em-font-${t}-"], [class*="em-font-${t.toLowerCase()}-"]`)}function $r(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=ah(n).filter(o=>sh(o.family).length>0&&!DF(o.family));!t||r.length===0||(t.textContent=l_(n,r),Br("iframe: clearProjectFontFaces removed stale @font-face",{removedFamilies:[...new Set(r.map(o=>o.family))]}),e&&e(!1))}function ho(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 Ah(e,t,n){t[0]==="Safe Fonts"?(e.style.fontFamily=t[1],ho({elem:document.documentElement},n),$r(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"&&Lc(e,t[2]),e.classList.remove(...[...e.classList].filter(r=>r.startsWith("em-font"))),e.classList.add(xc(t[2],t[3])),ta({fontFamilyArray:t},n))}function x_(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 O_(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 R_(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 na(e,t){e&&e.tagName==="TABLE"&&(e.classList.contains("em-vindent-table")||e.querySelector("td")?.innerHTML==="")&&e.querySelector("td")?.setAttribute("height",String(t))}function M_(e,t){const n=oh(),r=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");return r.replaceChildren(...Re(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=Rc((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),Ah(i,s,t);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingBottom?l.style.paddingBottom=(n.text?.paddingBottom||0)+"px":na(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=Rc((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),Ah(i,s,t),R_(i,n.headings?.letterSpacing||0),x_(i,n.headings?.bold||!1),O_(i,n.headings?.italic||!1);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingTop?l.style.paddingTop=(n.headings?.paddingTop||0)+"px":na(i.previousElementSibling,n.headings?.paddingTop||0),l?.style.paddingBottom?l.style.paddingBottom=(n.headings?.paddingBottom||0)+"px":na(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=Rc((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.buttons?.fontSize||16}px`),n.buttons?.color||"#FFFFFF");i.setAttribute("style",a),Ah(i,s,t);const l=i.closest("td"),c=!!l&&!!Fr(l)&&!Fr(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"),R_(i,n.buttons?.letterSpacing||0),x_(i,n.buttons?.bold||!1),O_(i,n.buttons?.italic||!1);const m=i.closest('[em="atom"] > tr > td'),h=i.closest("table");m?.style.paddingTop?m.style.paddingTop=(n.buttons?.marginTop||0)+"px":h?.previousElementSibling&&na(h.previousElementSibling,n.buttons?.marginTop||0),m?.style.paddingBottom?m.style.paddingBottom=(n.buttons?.marginBottom||0)+"px":h?.nextElementSibling&&na(h.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&&ph({settings:{border:n.buttons.border},elem:u}),n.buttons?.borderRadius&&yi({settings:{borderRadius:n.buttons.borderRadius},elem:u})),c&&Th(i,{backgroundColor:d})}}else{const s=Rc(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=>{Ks(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",n.block.backgroundColor),s.style.backgroundColor=n.block.backgroundColor})}),r.tagName==="DIV"?Tt(r):Tt(r.querySelector("tbody")||r)}function kh(e){const t=oh(),n=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Re(e.html)),n.querySelector('[em="block"]')&&t.block?.backgroundColor&&n.querySelectorAll('[em="block"]').forEach(o=>{Ks(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",t.block.backgroundColor),s.style.backgroundColor=t.block.backgroundColor})});const r=t.block?.padding;return OF(r)&&Array.from(n.querySelectorAll('[em="block"]')).flatMap(Ks).forEach(o=>{RF(o,r)}),n.tagName==="DIV"?Tt(n):Tt(n.querySelector("tbody")||n)}var BF=e=>{for(const t of Object.keys(kc))if(gi(t)===e)return t;return e};function HF(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=new Set(sh(e).filter(i=>i.stylesheet).map(i=>i.source_url)),o=ah(n).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&r.has(i.src));t&&o.length&&(t.textContent=l_(n,o),Br("iframe: dropped stylesheet @font-face",{family:e,count:o.length}))}function FF(e){if(!KH())return;const t=document.head.innerHTML,n=new Set;for(const r of i_()){HF(r.family);const o=`em-font-${gi(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=BF(a);ta({fontFamilyArray:["Google Fonts","Project Fonts",r.family,l]})})})}n.size>0&&Br("iframe: hydrated project @font-face from DOM classes",{classes:[...n],families:i_().map(r=>r.family)}),$r(),e&&document.head.innerHTML!==t&&e(!1)}function $F(e,t){const n=new ve,r=()=>{requestAnimationFrame(()=>{FF(t)})};return n.addDisposable(G.addListener(Ae.SANDBOX_SET_PROJECT_FONTS,r)),n.addDisposable(e.onReady(r)),n}function P_(){G.send({operation:"sandbox_resized"})}function WF(e,t){const n=new ve,r=0;let o=0;n.addDisposable(t.beforeSave(()=>{o&&(clearTimeout(o),o=0)}));function i(){o||(o=setTimeout(()=>{P_(),o=0},r))}return n.addDisposable(e.onChange(s=>{const a=s.flatMap(function(l){return l.added.flatMap(c=>{if(Mn(c))return xN(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 qF(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),n&&(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 zF=/^(?:ant|vscode|monaco|docs)-/;function UF(e){return zF.test(e)}function jF(){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 VF=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function GF(){return VF}var XF=new Set;function KF(e,t,n=XF){return e.startsWith(`${t}-`)?!1:!UF(e)&&!n.has(e)}function YF(e,t){return`--${t}-${e}`}function ZF(e){const t=jF();return KF(e,t,GF())?YF(e,t):`--${e}`}function QF(e){const t=new ve;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])=>` ${ZF(a)}: ${String(l)};
|
|
83
|
+
`).join("");if(s&&n!==s){n=s,i.innerHTML=`:root {
|
|
84
|
+
${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 {
|
|
85
|
+
${n}}`;const i=document.querySelector("head")||document.querySelector("body");i?.insertBefore(o,i.firstChild),e.commit(!1)}})),t.addDisposable(G.addListener(Ae.SANDBOX_SET_THEME_VARIABLES,r)),t}var I_=4e3;function JF(e){const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:I_});return}window.setTimeout(e,I_)}function e$(e){const t=e.onDocumentShown(()=>{t.dispose(),JF(()=>{Ov().catch(()=>{})})})}var t$={name:"sandbox.crossDomainDrag",setup:()=>OH()},n$={name:"sandbox.themeVariables",awaits:{services:[K]},setup:e=>QF(R(e,K))},r$={name:"sandbox.projectFonts",awaits:{services:[_t,Te]},setup(e){QH();const t=lt(e);$F(R(e,_t),n=>t(n))}},o$={name:"sandbox.pasteSanitizerPrewarm",awaits:{services:[Ao]},setup:e=>e$(R(e,Ao))},i$={name:"sandbox.variableSelection",setup:()=>BH()},s$={name:"sandbox.emReplaceCaret",awaits:{services:[K]},setup:e=>jH(R(e,K))},a$={name:"sandbox.resizeWatch",awaits:{services:[K,_t]},setup(e){WF(R(e,K),R(e,_t)),qF()}},l$={name:"sandbox.reset",awaits:{services:[K]},setup:e=>xO(R(e,K))},c$={name:"sandbox.correct",awaits:{services:[K,ft,_t]},setup:e=>NH(R(e,K),R(e,ft).controller,R(e,_t))},u$={name:"sandbox.extensionScripts",awaits:{services:[K,Xi]},setup:e=>f6(R(e,K),{surface:R(e,Xi)})},d$={name:"sandbox.localization",provides:[id],awaits:{services:[K]},setup:e=>e.inject(id,LH(R(e,K)))};function f$(e=[]){return{name:"sandbox.extensions",awaits:{services:[ft,Xi,K]},setup:t=>CH({container:t,focusController:R(t,ft).controller,surface:R(t,Xi),features:[...e]})}}function m$(e){const t=n=>function r(o,i=10){if(!h$(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 h$(e){return typeof e=="string"||typeof e=="object"&&e!==null&&!(e instanceof Element)}function D_(e){return/^(data|blob):/i.test(e.trimStart())}function B_(e,t){const n=/^(\s*)([\s\S]*?)(\s*)$/.exec(e);return!n||!n[2]?e:`${n[1]}${t(n[2])}${n[3]}`}function p$(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 g$(e,t){return e.replaceAll(/url\((\s*['"]?)([^'")]+)(['"]?\s*)\)/gi,(n,r,o,i)=>`url(${r}${B_(o,t)}${i})`)}function Lh(e,t,n){const r=e.toLowerCase();return r==="srcset"?p$(t,n):r==="style"?g$(t,n):B_(t,n)}var b$=["src","___src","background","poster","srcset","style"];function Mc(e){return D_(e)?e:ic(e)}function y$(){const e=new Map,t=n=>{if(D_(n))return n;const r=Mc(n),o=e.get(r);return o?b6(r).replace(new RegExp(`${Ds}=\\d+`),`${Ds}=${o}`):n};return{transform:{name:"em-version",attributes:b$,render:(n,r)=>n&&Lh(r.attribute,n,t),serialize:(n,r)=>n&&Lh(r.attribute,n,Mc)},requestReload(n){e.set(Mc(n.trim()),String(Date.now()))},isPending(n){return e.has(Mc(n.trim()))},clear(){e.clear()}}}var H_=["src","background","poster","srcset","style"];function Nh(e,t=document){const n=H_.map(o=>`[${o}]`).join(","),r=[...t.querySelectorAll(n)];for(const o of r){const i=o.tagName.toLowerCase();for(const s of H_){const a=o.getAttribute(s);if(!a)continue;const l=e.serialize(a,{element:o,tag:i,attribute:s,stage:"apply"})??a,c=Om(o,s,l,{pipeline:e,stage:"apply"});c===null?a!==l&&o.removeAttribute(s):c!==a&&o.setAttribute(s,c)}}}function v$(e,t){const{pipeline:n,htmlDocument:r}=t,o=y$(),i=n.register(o.transform),s={reload(a){a&&(o.requestReload(a),r.renderOnly(()=>Nh(n)))},clear(){o.clear()}};return e.inject(od,s),{reload:s,dispose(){i.dispose(),o.clear(),pn(e,od)}}}var E$=["https://emcdn.ru/843/20220715_113006_18.png","https://cdn.useblocks.io/843/230110_18_kXn4Evf.png"],S$="/static/media/",w$="empty-image";function _$(e){return e.replace(/[.-][A-Za-z0-9_-]{7,20}$/,"")}function F_(e){let t;try{t=new URL(e,document.baseURI).pathname}catch{return null}return t.includes(S$)?t:null}function C$(e){return!!e&&F_(e)!==null}function T$(e){if(!e)return!1;if(E$.includes(e))return!0;const t=F_(e);return t===null?!1:_$(t.slice(t.lastIndexOf("/")+1).replace(/\.[^.]+$/,""))===w$}var A$=1e4;function k$(e=A$){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 L$=3e3,N$=["src","___src","background","poster","srcset","style"],xh=e=>e.startsWith("blob:"),Pc="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 x$(e){const t=encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return`${Pc}${t}`}var O$=new RegExp(String.raw`blob:[^\s"'()<>]+|`+Pc.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+String.raw`[^\s"'()<>]*`,"g");function $_(e){if(e.startsWith(Pc))try{return decodeURIComponent(e.slice(130))}catch{return}}function R$(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:MO(n)}function M$(e){try{return new URL(e,document.baseURI).hostname}catch{return}}function P$(e){const t=e.store??k$(),n=e.answerTimeoutMs??L$,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 g=M$(f);return g?g===window.location.hostname||i.sourceHosts.includes(g):!1},u=(f,g=!1)=>{if(r.has(f)||!g&&(o.has(f)||t.peek(f)))return;const E=G.sendAsync(Ae.APPLICATION_CANVAS_IMAGE_GET,g?{url:f,fresh:g}:{url:f}).then(T=>{const L=T;if(L&&"blob"in L){t.acquire(f,L.blob),l.hits+=1;return}o.add(f),l.refused+=1}).catch(()=>{o.add(f),l.failed+=1}),w=Promise.race([E,new Promise(T=>{setTimeout(()=>{r.has(f)&&(s=!0,o.add(f),l.failed+=1),T()},n)})]).then(()=>{r.delete(f),e.refresh()});r.set(f,w)},d=f=>{const g=$_(f);if(g!==void 0)return d(g);if(!f||a||xh(f)||f.startsWith("data:")||C$(f))return f;const E=t.peek(f);return E||(s||!i.enabled||o.has(f)||!c(f)?f:(l.misses+=1,u(f),x$(f)))},m=f=>xh(f)?t.sourceOf(f)??f:$_(f)??f,h=(f,g,E)=>Lh(g.attribute,f,E);return{configure(f){i={enabled:f.enabled,sourceHosts:[...f.sourceHosts??[]]}},transform:{name:"image-cache",attributes:N$,render:(f,g)=>f&&R$(g)?h(f,g,d):f,serialize:(f,g)=>f&&h(f,g,m)},forget(f){t.forget(f),o.delete(f),!a&&u(f,!0)},fail(f){const g=t.sourceOf(f);return g===void 0||t.peek(g)!==f?!1:(o.add(g),t.forget(g),l.failed+=1,!0)},block(){a=!0},restoreUrls(f){return Oh(f,m)},stats(){return{...l,blobs:t.size}},dispose(){t.dispose(),r.clear(),o.clear()}}}function I$(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||"";xh(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 D$(e,t){return!e.includes("blob:")&&!e.includes(Pc)?e:e.replace(O$,n=>t(n))}function Oh(e,t){if(typeof e=="string")return D$(e,t);if(Array.isArray(e)){let n=!1;const r=e.map(o=>{const i=Oh(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=Oh(i,t);n||(n=s!==i),r[o]=s}return n?r:e}return e}function B$(e,t){const{pipeline:n,htmlDocument:r}=t,o=()=>r.renderOnly(()=>Nh(n)),i=P$({refresh:o}),s=I$(document,i,o),a=n.register(i.transform),l=G.addListener(Ae.SANDBOX_CANVAS_IMAGE_CACHE_SETUP,u=>{i.configure(u),r.renderOnly(()=>Nh(n))}),c=G.setOutgoingFilter(u=>i.restoreUrls(u));return e.inject(Fa,i),{cache:i,dispose(){s.dispose(),c(),l.dispose(),a.dispose(),i.dispose(),pn(e,Fa)}}}function H$(e,t){const n=new oO,r=new il,o=new iO(n,r),i=new Lx(r,n,{prepareHtml:t.prepareHtml,serviceMarkup:X6,mapHTMLRoots:e.mapHTMLRoots,...e.createRoot?{createRoot:e.createRoot}:{},...e.rootsParent?{rootsParent:e.rootsParent}:{}});i.addDisposable(new cO(i,o,n));const s=e.beforeCommit,a=s?i.beforeCommit(()=>s(i)):void 0,l=Tk((c,u,d)=>i.applyForeignOutput(c,u,d));return{htmlDocument:i,remoteDocument:n,textDocument:r,documentMapping:o,onDocumentShown:c=>n.onReady(()=>c()),onDocumentReplaced:c=>n.onEntitySet(u=>c(u)),commit:c=>i.commit(c),commitLockedAsync:async c=>{const u=t.lock?.acquire();try{await i.commit(c,!0)}finally{u?.release()}},dispose(){a?.dispose(),l(),i.dispose(),n.dispose(),r.dispose()}}}function F$(e,t){const n=H$(t,{prepareHtml:R(e,$a),lock:e.getInstance(Me)}),r={commit:i=>n.commit(i),commitLockedAsync:i=>n.commitLockedAsync(i)},o=RM();return e.inject(Gi,t),e.inject(_t,n.remoteDocument),e.inject(Vi,n.textDocument),e.inject(mn,n.documentMapping),e.inject(K,n.htmlDocument),e.inject(Te,r),{...n,dispose(){o.dispose(),n.dispose(),pn(e,Gi),pn(e,_t),pn(e,Vi),pn(e,mn),pn(e,K),pn(e,Te)}}}function $$(){const e=new Set,t=new Set;let n=0;const r=()=>{t.forEach(i=>{try{i()}catch{}})},o=()=>{e.size===0&&n===0&&r()};return{acquire(){const i={suspended:!1};e.add(i);const s=()=>{e.delete(i)&&o()};return{release:s,releaseLater(){Promise.resolve().then(s)}}},isLocked(){for(const i of e)if(!i.suspended)return!0;return!1},lift(i){let s;for(const a of e)a.suspended||(s=a);if(!s)return i();s.suspended=!0,n+=1;try{return i()}finally{s.suspended=!1,n-=1,o()}},onReleased(i){const s=()=>i();return t.add(s),()=>t.delete(s)}}}var W$=$$();function q$(e){e.inject(Hg,U),e.inject(Me,W$),e.inject(nt,tf)}var z$=class extends ve{get isEditorInFocus(){return!!this._isEditorInFocus}constructor(e){super(),A(this,"_isEditorInFocus",!1),A(this,"_context",new Map),A(this,"_editorLostFocusEmitter",this.addDisposable(new he)),A(this,"_summaries",[]),A(this,"_onChange",t=>{this._isEditorInFocus&&this._summaries.push(...t)}),A(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 U$(e,t){const{htmlDocument:n,remoteDocument:r}=t,o=new z$(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(),pn(e,ft)}};return e.inject(ft,l),l}var j$={name:"sandbox.state",provides:[Hg,Me,nt],setup:q$},V$={name:"sandbox.attributePipeline",provides:[To],setup:I6},G$={name:"sandbox.documentSync",provides:[K,_t,Vi,mn,Te,Ao],awaits:{services:[Gi,$a,Me]},setup:e=>e.inject(Ao,F$(e,R(e,Gi)))},X$={name:"sandbox.images",provides:[Fa,od],awaits:{services:[To,K,Ao]},setup(e){const t=R(e,To),n=R(e,K);B$(e,{pipeline:t,htmlDocument:n});const r=v$(e,{pipeline:t,htmlDocument:n}).reload;R(e,Ao).onDocumentReplaced(()=>r.clear()),G.addListener(Ae.SANDBOX_IMAGE_RESET,({url:o})=>{o&&(e.getInstance(Fa)?.forget(o),r.reload(o))})}},K$={name:"sandbox.mapObj",provides:[ko],awaits:{services:[mn]},setup:e=>e.inject(ko,m$(R(e,mn)))},Y$={name:"sandbox.focus",provides:[ft],awaits:{services:[K,_t]},setup:e=>U$(e,{htmlDocument:R(e,K),remoteDocument:R(e,_t)})},Z$=[j$,V$,G$,X$,fR,mR,hR,K$,Y$,t$,n$,r$,i$,s$,a$,l$,c$,u$,d$,o$,SH,wH,_H,...qR],Rh=null,Mh=0,Q$=6e5;function J$(e){Rh=e,Mh=e?Date.now():0}function W_(){const e=Rh,t=Mh;return Rh=null,Mh=0,!e||!t||Date.now()-t>Q$||!e.isConnected||!e.matches('[em="block"]')?null:e}function eW(e,t){const n=t.getOuterHtml(e),r=document.implementation.createHTMLDocument("").body,o=r.ownerDocument.createElement(e.tagName==="TR"?"table":"div");document.querySelectorAll("style").forEach(a=>{const l=t.getOuterHtml(a);l&&o.insertAdjacentHTML("beforeend",l)}),o.insertAdjacentHTML("beforeend",`
|
|
86
|
+
`);const i=Re(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",`
|
|
87
|
+
`),o.prepend(document.querySelector(c).cloneNode(!0)))}}),r.append(o),H1(r,[...r.querySelectorAll("style")],{forceMediaMerge:!0});let s=tn(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 tW(e,t){const{HTMLDocument:n,messageService:r}=t,o=e.closest('[em="block"]');if(!o)return;const i=eW(o,n);if(!i)return;J$(o);const s=o.getAttribute("em-block-id"),a=o.getAttribute("em-block-version");r.send({operation:"application_eblock_add",data:cc({html:i.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function Ic(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 Dc(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 Ye=()=>Al(window.getSelection()?.toString())??"",nW=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],rW={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:t=>window.getComputedStyle(t).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:t=>t.getAttribute(e)})},oW=/^#[\da-f]{6}$/i,q_=()=>[...new Set(nW.flatMap(iW).map(j).filter(e=>oW.test(e)).map(e=>e.toUpperCase()))];function iW({type:e,name:t}){const n=rW[e],{selector:r,toColor:o}=n(t);return Array.from(document.querySelectorAll(r)).map(o)}function z_(e){return e.filter(t=>!oc.includes(t))}function sW(e){return oc.some(t=>e.classList.contains(t))?(e.classList.remove(...oc),e.classList.length||e.removeAttribute("class"),!0):!1}function aW(e){return Array.from(e.rows).flatMap(t=>[t,...Array.from(t.cells)]).map(sW).includes(!0)}function lW(e){const t=[];let n="",r=0,o=0;for(let i=0;i<e.length;i++){const s=e[i];n?s==="\\"?i++:s===n&&(n=""):s==='"'||s==="'"?n=s:s==="("?r++:s===")"?r=Math.max(0,r-1):s===";"&&r===0&&(t.push(e.slice(o,i)),o=i+1)}return t.push(e.slice(o)),t}function U_(e){return lW(e??"").flatMap(t=>{const n=t.indexOf(":"),r=t.slice(0,Math.max(n,0)).trim();return r?[{name:r,value:t.slice(n+1).trim()}]:[]})}var Wr=["top","right","bottom","left"],j_=["width","style","color"];function Ph(e,t){return e===t?Wr:Wr.filter(n=>e===`${t}-${n}`)}function cW(e,t){const n=e.toLowerCase();if(t==="padding")return Ph(n,"padding");const[r,o,i,...s]=n.split("-");return r!=="border"||s.length?[]:o===void 0||i===void 0&&j_.includes(o)?Wr:i===void 0||j_.includes(i)?Wr.filter(a=>a===o):[]}function Bc(e,t,n){const r=[];let o=-1,i=0;for(const a of e){const l="managed"in a?[]:cW(a.name,t);if("managed"in a?a.managed===t:l.length>0&&l.every(c=>n.includes(c))){o=o<0?r.length:o;continue}r.push(a),i=l.some(c=>n.includes(c))?r.length:i}const s=Math.max(o<0?r.length:o,i);return[...r.slice(0,s),{managed:t},...r.slice(s)]}var uW=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"];function dW(e){return!!e.closest("editor.em-text")}function fW(e){e.querySelectorAll(uW.join(",")).forEach(t=>{dW(t)||t.remove()})}function mW(e){e.querySelectorAll("editor").forEach(t=>{const n=Array.from(t.childNodes);if(t.parentNode!==e||t.querySelector("div")){t.replaceWith(...n);return}const r=t.ownerDocument.createElement("div");r.append(...n),t.replaceWith(r)})}var hW=".em-element-resize-img, .em-element-img-change-group";function pW(e){e.querySelectorAll(hW).forEach(t=>t.remove()),e.querySelectorAll("span.em-element-resize-img-container").forEach(t=>t.replaceWith(...Array.from(t.childNodes)))}function gW(e){const t=e.cloneNode(!0);return en(e,t),zo(t),fW(t),pW(t),mW(t),Xe(t)}function Hc(e){if(!e)return;const t=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}function bW(e){if(!e)return;const t=e.trim().split(/\s+/);if(t.length<3)return;const n=Hc(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 yW(e,t,n){const r=t.split(/\s+/).map(Hc),o=Ph(e,"padding"),i=e==="padding"?4:1;if(!o.length||r.length>i||r.some(m=>m===void 0))return!1;const[s,a=s,l=s,c=a]=r,u={top:s,right:a,bottom:l,left:c},d={...n.padding};return o.forEach(m=>d[m]=u[m]),n.padding=d,!0}function vW(e,t,n){const r=bW(t);if(!r)return!1;const o={...n.borders};return Ph(e,"border").forEach(i=>o[i]={...r}),n.borders=o,!0}function qr(e,t,n){return n===void 0||n===""?!1:(e[t]=n,!0)}var EW={"font-family":{family:"font-family",consume:(e,t,n)=>qr(n,"fontFamily",t)},"font-size":{family:"font-size",consume:(e,t,n)=>qr(n,"fontSize",Hc(t))},"line-height":{family:"line-height",consume:(e,t,n)=>qr(n,"lineHeight",Hc(t))},color:{family:"color",consume:(e,t,n)=>qr(n,"color",V_(t))},"background-color":{family:"background-color",consume:(e,t,n)=>qr(n,"backgroundColor",V_(t))},"text-align":{family:"text-align",consume:(e,t,n)=>qr(n,"textAlign",SW(t))},"vertical-align":{family:"vertical-align",consume:(e,t,n)=>qr(n,"verticalAlign",wW(t))},"border-radius":{family:"border-radius",consume:(e,t,n)=>qr(n,"borderRadius",_W(t))},...Object.fromEntries(["padding",...Wr.map(e=>`padding-${e}`)].map(e=>[e,{family:"padding",consume:yW}])),...Object.fromEntries(["border",...Wr.map(e=>`border-${e}`)].map(e=>[e,{family:"border",consume:vW}]))};function V_(e){if(e)return e.trim()}function SW(e){if(!e)return;const t=e.trim().toLowerCase();return["left","center","right","justify"].find(n=>n===t)}function wW(e){if(!e)return;const t=e.trim().toLowerCase();return["top","middle","bottom"].find(n=>n===t)}function _W(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 CW(e){const t={},n=[],r=new Set;for(const o of U_(e.getAttribute("style"))){const i=o.name.toLowerCase(),s=EW[i];s?.consume(i,o.value,t)?r.has(s.family)||(r.add(s.family),n.push({managed:s.family})):n.push(o)}return{style:Object.keys(t).length?t:void 0,styleEntries:n}}function TW(e){const t=e.getAttribute("align")?.toLowerCase();if(t==="left"||t==="center"||t==="right")return t}function AW(e){const t=e.getAttribute("valign")?.toLowerCase();if(t==="top"||t==="middle"||t==="bottom")return t}var kW=["rowspan","colspan","class","style"];function Fc(e){return Array.from(e.attributes).filter(t=>!g6.includes(t.name)).map(t=>({name:t.name,value:t.value}))}function LW(e,t,n){return Fc(e).filter(({name:r})=>!kW.includes(r)&&!(r==="align"&&t)&&!(r==="valign"&&n))}function NW(e){return Fc(e).flatMap(t=>{if(t.name!=="class")return[t];const n=t.value.split(/\s+/).filter(Boolean),r=z_(n);return r.length===n.length?[t]:r.length?[{name:"class",value:r.join(" ")}]:[]})}function G_(e){const t=e.parentElement?.tagName;return t==="THEAD"?"thead":t==="TFOOT"?"tfoot":"tbody"}function xW(e){const t=[];for(let n=0;n<e.length;){let r=n+1;for(;r<e.length&&e[r].parentElement===e[n].parentElement;)r++;t.push(...Array(r-n).fill(r)),n=r}return t}function OW(e,t){const n=TW(e),r=AW(e);return{...t,contentHtml:gW(e),classList:Array.from(e.classList),tag:e.tagName==="TH"?"th":"td",attrs:LW(e,n,r),...CW(e),align:n,valign:r}}function RW(e,t){for(let o=t.row;o<t.row+t.rowspan;o++)for(let i=t.col;i<t.col+t.colspan;i++){var n,r;(n=e[o])[r=i]??(n[r]=t.id)}}function MW(e){const t=xW(e),n=e.map(()=>[]),r=[];e.forEach((i,s)=>{let a=0;for(const l of Array.from(i.cells)){for(;n[s][a];)a++;const c=t[s]-s,u=l.rowSpan===0?c:Math.min(Math.max(1,l.rowSpan||1),c),d=Math.max(1,l.colSpan||1),m=OW(l,{id:`cell-${r.length}`,row:s,col:a,rowspan:u,colspan:d});r.push(m),RW(n,m),a+=d}});const o=Math.max(0,...n.map(i=>i.length));return{cells:r,cols:o,grid:n.map(i=>Array.from({length:o},(s,a)=>i[a]??null))}}function PW(e,t){const n={};for(const r of t){const o=G_(r);o!=="tbody"&&r.parentElement&&!n[o]&&(n[o]=Fc(r.parentElement))}return{attrs:Fc(e),...Object.keys(n).length?{sectionAttrs:n}:{}}}function Ih(e,t){const n=Number(/^cell-(\d+)$/.exec(t)?.[1]??NaN);return Array.from(e.rows).flatMap(r=>Array.from(r.cells))[n]}function ra(e,t){const n=Array.from(e.rows).flatMap(r=>Array.from(r.cells)).indexOf(t);return n<0?void 0:`cell-${n}`}function Ei(e){const t=Array.from(e.rows),n=t.map(r=>({section:G_(r),attrs:NW(r)}));return{rows:t.length,...MW(t),rowsMeta:n,meta:PW(e,t)}}function X_(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}var $c=["top","right","bottom","left"];function IW(e){if(!e)return[];const t=$c.map(n=>e[n]);return t[0]!==void 0&&t.every(n=>n===t[0])?[`padding: ${t[0]}px`]:$c.flatMap(n=>e[n]===void 0?[]:[`padding-${n}: ${e[n]}px`])}function K_(e){return`${e.width}px ${e.style} ${e.color}`}function DW(e,t){return!!e&&e.width===t.width&&e.style===t.style&&e.color===t.color}function BW(e){if(!e)return[];const{top:t}=e;return t&&$c.every(n=>DW(e[n],t))?[`border: ${K_(t)}`]:$c.flatMap(n=>{const r=e[n];return r?[`border-${n}: ${K_(r)}`]:[]})}function HW(e){const t=new Map;if(!e)return t;const n=[["font-family",e.fontFamily?[`font-family: ${e.fontFamily}`]:[]],["font-size",e.fontSize===void 0?[]:[`font-size: ${e.fontSize}px`]],["line-height",e.lineHeight===void 0?[]:[`line-height: ${e.lineHeight}px`]],["color",e.color?[`color: ${e.color}`]:[]],["background-color",e.backgroundColor?[`background-color: ${e.backgroundColor}`]:[]],["text-align",e.textAlign?[`text-align: ${e.textAlign}`]:[]],["vertical-align",e.verticalAlign?[`vertical-align: ${e.verticalAlign}`]:[]],["border-radius",e.borderRadius?[`border-radius: ${e.borderRadius}`]:[]],["padding",IW(e.padding)],["border",BW(e.borders)]];for(const[r,o]of n)o.length&&t.set(r,o);return t}function FW(e){const t=HW(e.style),n=[];for(const r of e.styleEntries)"managed"in r?(n.push(...t.get(r.managed)??[]),t.delete(r.managed)):n.push(`${r.name}: ${r.value}`);return t.forEach(r=>n.push(...r)),n.join("; ")}function Wc(e){return e.map(({name:t,value:n})=>` ${X_(t)}="${X_(n)}"`).join("")}function $W(e){const t=[["rowspan",e.rowspan>1?String(e.rowspan):void 0],["colspan",e.colspan>1?String(e.colspan):void 0],["align",e.align],["valign",e.valign],["class",e.classList.filter(Boolean).join(" ")||void 0],["style",FW(e)||void 0]].flatMap(([n,r])=>r===void 0?[]:[{name:n,value:r}]);return`<${e.tag}${Wc([...t,...e.attrs])}>${e.contentHtml}</${e.tag}>`}function WW(e,t,n){const r=e.grid[t].flatMap((o,i)=>{const s=o?n.get(o):void 0;return s&&s.row===t&&s.col===i?[$W(s)]:[]});return`<tr${Wc(e.rowsMeta[t]?.attrs??[])}>${r.join("")}</tr>`}function qW(e,t){let n="";for(let r=0;r<t.length;){const o=e.rowsMeta[r]?.section??"tbody";let i=r+1;for(;i<t.length&&(e.rowsMeta[i]?.section??"tbody")===o;)i++;const s=t.slice(r,i).join("");n+=o==="tbody"?s:`<${o}${Wc(e.meta?.sectionAttrs?.[o]??[])}>${s}</${o}>`,r=i}return n}function Y_(e){if(e.rows===0||e.cols===0||!e.cells.length)return"<table></table>";const t=new Map(e.cells.map(r=>[r.id,r])),n=e.grid.map((r,o)=>WW(e,o,t));return`<table${Wc(e.meta?.attrs??[])}>${qW(e,n)}</table>`}function pt(e){return{rejected:e}}function Dh(e){return"rejected"in e}function fr(e,t){return e.cells.find(n=>n.id===t)}function Si(e,t,n){const r=e.grid[t]?.[n];return r?fr(e,r):void 0}function Bh(e){let t=-1;for(const n of e.cells){const r=/^cell-(\d+)$/.exec(n.id);t=r?Math.max(t,Number(r[1])):t}return()=>`cell-${++t}`}function zW(e){return Bh(e)()}function UW(e,t,n){if(!(n.rowspan>=1&&n.colspan>=1&&n.row>=0&&n.col>=0&&n.row+n.rowspan<=e.length&&n.col+n.colspan<=t))return!1;for(let r=n.row;r<n.row+n.rowspan;r++)for(let o=n.col;o<n.col+n.colspan;o++){if(e[r][o]!==null)return!1;e[r][o]=n.id}return!0}function wi(e){const t=Array.from({length:e.rows},()=>Array(e.cols).fill(null)),n=new Set;for(const r of e.cells){if(n.has(r.id)||!UW(t,e.cols,r))return pt("invalid-layout");n.add(r.id)}return e.rowsMeta.length!==e.rows?pt("invalid-layout"):{...e,grid:t}}function mr(e){return JSON.parse(JSON.stringify(e))}function jW(e,t){return new DOMParser().parseFromString(e,"text/html").body.firstChild?.nodeType===Node.ELEMENT_NODE?XW(e,t):" "}function VW(e){const t=mr(e);return t.contentHtml=jW(e.contentHtml," "),t.classList=z_(t.classList),t.attrs=t.attrs.filter(n=>n.name!=="id"),t}function GW(e){return{...e,contentHtml:V1,classList:[""],tag:"td",attrs:[],styleEntries:[],align:"center",valign:"top",style:{}}}function qc(e,t){return e?{...VW(e),...t}:GW(t)}function Z_(e){if(e.nodeType===Node.TEXT_NODE){const t=e.textContent||"";return!t||/^\s*$/.test(t.replace(/\u00A0/g,"X"))}return e.nodeType!==Node.ELEMENT_NODE?!0:Array.from(e.childNodes).every(t=>Z_(t))}function XW(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(s){if(s.nodeType===Node.TEXT_NODE&&s.textContent?.trim()){r?s.textContent="":(s.textContent=t,r=!0);return}for(const a of Array.from(s.childNodes))o(a)}function i(s,a=!1){if(s.nodeType!==Node.ELEMENT_NODE)return;const l=Array.from(s.childNodes);for(const c of l)i(c);!a&&Z_(s)&&s.parentNode?.removeChild(s)}return o(n),i(n,!0),n.outerHTML||e}function KW(e){return e?{section:e.section,attrs:e.attrs.filter(t=>t.name!=="id")}:{section:"tbody",attrs:[]}}function Q_(e,t,n){const r=mr(e),o=new Set;for(const s of r.cells)if(s.row<t&&t<s.row+s.rowspan){s.rowspan+=1;for(let a=s.col;a<s.col+s.colspan;a++)o.add(a)}else s.row>=t&&(s.row+=1);const i=Bh(e);for(let s=0;s<r.cols;s++)o.has(s)||r.cells.push(qc(Si(e,n,s),{id:i(),row:t,col:s,rowspan:1,colspan:1}));return r.rowsMeta.splice(t,0,KW(e.rowsMeta[n])),r.rows+=1,wi(r)}function J_(e,t,n){const r=fr(e,t);if(!r)return pt("no-cell");const o=r.row+r.rowspan-1;return n==="above"?Q_(e,r.row,r.row):Q_(e,o+1,o)}function YW(e,t){const n=fr(e,t);if(!n)return pt("no-cell");if(e.rows<=1)return pt("last-line");const r=n.row,o=mr(e);o.cells=o.cells.filter(i=>i.row!==r||i.rowspan>1);for(const i of o.cells)i.row>r?i.row-=1:r<i.row+i.rowspan&&(i.rowspan-=1);return o.rowsMeta.splice(r,1),o.rows-=1,wi(o)}function eC(e,t,n){const r=mr(e),o=new Set;for(const s of r.cells)if(s.col<t&&t<s.col+s.colspan){s.colspan+=1;for(let a=s.row;a<s.row+s.rowspan;a++)o.add(a)}else s.col>=t&&(s.col+=1);const i=Bh(e);for(let s=0;s<r.rows;s++)o.has(s)||r.cells.push(qc(Si(e,s,n),{id:i(),row:s,col:t,rowspan:1,colspan:1}));return r.cols+=1,wi(r)}function tC(e,t,n){const r=fr(e,t);if(!r)return pt("no-cell");const o=r.col+r.colspan-1;return n==="left"?eC(e,r.col,r.col):eC(e,o+1,o)}function ZW(e,t){const n=fr(e,t);if(!n)return pt("no-cell");if(e.cols<=1)return pt("last-line");const r=n.col,o=mr(e);o.cells=o.cells.filter(i=>i.col!==r||i.colspan>1);for(const i of o.cells)i.col>r?i.col-=1:r<i.col+i.colspan&&(i.colspan-=1);return o.cols-=1,wi(o)}var QW="img, table, hr, svg, video, iframe, picture";function nC(e){const t=document.createElement("div");return Ce(t,e),t}function rC(e){const t=Array.from(e.childNodes).filter(r=>r.nodeType!==Node.TEXT_NODE||(r.textContent??"").trim()!==""),[n]=t;return t.length===1&&n instanceof Element&&n.tagName==="DIV"?n:null}function JW(e){return(e.textContent??"").replace(/ /g," ").trim()===""&&!e.querySelector(QW)}function eq(e){const t=nC(e);if(JW(t))return"";const n=rC(t);return n?Xe(n):e.trim()}function tq(e,t){const n=t.map(o=>eq(o.contentHtml)).filter(o=>o!=="").join("<br>").replace(/ $/,""),r=n===""?" ":n;for(const o of[e,...t]){const i=nC(o.contentHtml),s=rC(i);if(s)return Ce(s,r),Xe(i)}return n===""?V1:n}function nq(e){const t=Math.min(...e.map(r=>r.row)),n=Math.min(...e.map(r=>r.col));return{row:t,col:n,rows:Math.max(...e.map(r=>r.row+r.rowspan))-t,cols:Math.max(...e.map(r=>r.col+r.colspan))-n}}function rq(e,t,n){for(let r=t.row;r<t.row+t.rows;r++)for(let o=t.col;o<t.col+t.cols;o++){const i=e.grid[r]?.[o];if(!i||!n.has(i))return!1}return!0}function Hh(e,t,n){const r=new Set([t,...n]),o=e.cells.filter(c=>r.has(c.id));if(o.length!==r.size)return pt("no-cell");if(r.size<2)return pt("nothing-to-merge");const i=nq(o);if(!rq(e,i,r))return pt("not-rectangular");const s=mr(e),a=fr(s,t),l=[...o].sort((c,u)=>c.row-u.row||c.col-u.col);return a.contentHtml=tq(a,l),Object.assign(a,{row:i.row,col:i.col,rowspan:i.rows,colspan:i.cols}),s.cells=s.cells.filter(c=>c===a||!r.has(c.id)),wi(s)}function oq(e,t,n){switch(t){case"left":return{row:e.row,col:e.col-n,rows:e.rowspan,cols:n};case"right":return{row:e.row,col:e.col+e.colspan,rows:e.rowspan,cols:n};case"top":return{row:e.row-n,col:e.col,rows:n,cols:e.colspan};default:return{row:e.row+e.rowspan,col:e.col,rows:n,cols:e.colspan}}}function iq(e,t){if(t.row<0||t.col<0||t.row+t.rows>e.rows||t.col+t.cols>e.cols)return null;const n=[];for(let r=t.row;r<t.row+t.rows;r++)for(let o=t.col;o<t.col+t.cols;o++)n.push(Si(e,r,o)?.id??"");return n}function sq(e,t,n,r=1){const o=fr(e,t);if(!o)return pt("no-cell");if(r<1)return pt("nothing-to-merge");const i=iq(e,oq(o,n,r));return i?i.includes("")?pt("not-rectangular"):Hh(e,t,i):pt("out-of-table")}function oC(e,t,n,r=1){const o=fr(e,t),i=n==="cols"?o?.colspan:o?.rowspan;if(!o||i===void 0)return pt("no-cell");if(r<1||r>=i)return pt("nothing-to-split");const s=mr(e),a=fr(s,t),l={id:zW(e),row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan};return n==="cols"?(a.colspan-=r,s.cells.push(qc(a,{...l,col:a.col+a.colspan,colspan:r}))):(a.rowspan-=r,s.cells.push(qc(a,{...l,row:a.row+a.rowspan,rowspan:r}))),wi(s)}function aq(e,t){return e.row===t.row?t.col>e.col?"right":"left":e.col===t.col?t.row>e.row?"bottom":"top":null}function zc(e,t){return Array.from({length:Math.max(0,t-e+1)},(n,r)=>e+r)}function lq(e,t,n){switch(n){case"right":return zc(e.col+e.colspan,t.col+t.colspan-1).map(r=>({row:e.row,col:r}));case"left":return zc(t.col,e.col-1).map(r=>({row:e.row,col:r}));case"bottom":return zc(e.row+e.rowspan,t.row+t.rowspan-1).map(r=>({row:r,col:e.col}));default:return zc(t.row,e.row-1).map(r=>({row:r,col:e.col}))}}function cq(e,t,n){const r=Si(e,t.row,t.col),o=Si(e,n.row,n.col),i=r&&o&&r.id!==o.id?aq(r,o):null;if(!r||!o||!i)return null;const s=[...new Set(lq(r,o,i).map(a=>Si(e,a.row,a.col)?.id??""))];return s.includes("")||Dh(Hh(e,r.id,s))?null:{direction:i,cellIds:s}}function uq(e,t){const n=[];for(const r of e.cells)t.some(o=>r.classList.includes(o))&&n.push(r.id);return n}function dq(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 Uc(e,t){return Array.from({length:t},(n,r)=>e+r)}function fq(e,t){switch(t){case"top":return Uc(e.col,e.colspan).map(n=>[e.row-1,n]);case"bottom":return Uc(e.col,e.colspan).map(n=>[e.row+e.rowspan,n]);case"left":return Uc(e.row,e.rowspan).map(n=>[n,e.col-1]);default:return Uc(e.row,e.rowspan).map(n=>[n,e.col+e.colspan])}}function iC(e,t){const n=new Set(t),r=e.cells.filter(s=>n.has(s.id)),o=([s,a])=>n.has(e.grid[s]?.[a]??""),i={};for(const s of r){const a=[];for(const l of Wr){const c=fq(s,l),u=c.filter(d=>!o(d)).length;if(u>0&&u<c.length)return Object.fromEntries(r.map(d=>[d.id,[...Wr]]));u>0&&a.push(l)}i[s.id]=a}return i}function mq(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}}s.styleEntries=Bc(s.styleEntries,"border",n)}return i}function hq(e,t,n){const r=mr(e);for(const o of r.cells){if(!t.includes(o.id))continue;const i=o.style?.borders;n.forEach(s=>delete i?.[s]),o.style&&i&&!Object.keys(i).length&&delete o.style.borders,o.styleEntries=Bc(o.styleEntries,"border",n)}return r}function pq(e,t){return iC(e,t)}function gq(e){const t=mr(e);return t.cells.forEach(n=>{const r=n.style?.borders;if(!r)return;const o={top:n.row===0,bottom:n.row+n.rowspan===t.rows,left:n.col===0,right:n.col+n.colspan===t.cols};Object.keys(o).filter(i=>o[i]).forEach(i=>delete r[i])}),t}function bq(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={});const 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}var yq=[["topLeft","top","left"],["topRight","top","right"],["bottomLeft","bottom","left"],["bottomRight","bottom","right"]];function vq(e,t){const n={};for(const[r,o]of Object.entries(iC(e,t))){const i=yq.filter(([,s,a])=>o.includes(s)&&o.includes(a)).map(([s])=>s);i.length&&(n[r]=i)}return n}var Eq={paddingLeftRight:["left","right"],paddingTopBottom:["top","bottom"],paddingLeft:["left"],paddingTop:["top"],paddingRight:["right"],paddingBottom:["bottom"]};function Sq(e,t){if(!t.settings)return e;const n=Object.keys(t.settings);if(n.length===0)return e;const r=n[0],o=Eq[r];if(!o)return e;const i=t.settings[r];return typeof i!="number"||isNaN(i)||!e.cells||!Array.isArray(e.cells)||e.cells.forEach(s=>{s.style||(s.style={}),s.style.padding||(s.style.padding={top:0,right:0,bottom:0,left:0});const a=s.style.padding;o.forEach(l=>a[l]=i),s.styleEntries=Bc(s.styleEntries,"padding",o),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 wq(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}i.styleEntries=Bc(i.styleEntries,"padding",n),["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 _q(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}var jc="none",sC="b64_",Cq=/^(\d+(?:_\d+)?)(px|perc)$/;function Tq(e){if(e===jc)return jc;let t="";return new TextEncoder().encode(ic(e)).forEach(n=>{t+=String.fromCharCode(n)}),sC+btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Aq(e){if(e===jc)return jc;if(!e.startsWith(sC))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 kq(e){return`url("${e.replace(/[\n\r\f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function aC(e){return e.replace(/\./g,"_").replace(/%/g,"perc")}function lC(e){const t=e.match(Cq);return t?t[1].replace("_",".")+(t[2]==="perc"?"%":"px"):e}function Lq(){return ch()}function Pe(e,t){const n=Lq();n&&n.insertAdjacentHTML("beforeend",`
|
|
88
|
+
${rF()}
|
|
89
|
+
.${e} { ${t} }
|
|
90
|
+
}
|
|
91
|
+
`)}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 cC(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)Pe(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";Pe(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${r} !important;`)}}else ge(e.elem,t.classNamePrefix)}function Nq(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?Pe(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`):Pe(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${t.value}${t.dim} !important;`)}else ge(e.elem,t.classNamePrefix)}function _i(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?Pe(n,`height: ${t.value}${t.dim} !important;`):Pe(n,`height: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function xq(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; `:""),Pe(a,l)}})}function Oq(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(),Pe(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 Rq(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(),Pe(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(),Pe(r,`box-shadow: ${t.value} !important;`)}else ge(e.elem,n)}function uC(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(),Pe(r,`text-align: ${n.value} !important;`)}else ge(e.elem,n.classNamePrefix)}function Mq(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",Pe(n,`${r} !important;`)}else ge(e.elem,t.classNamePrefix)}function dC(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(),Pe(n,`vertical-align: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function Pq(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(),Pe(n,`direction: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function Iq(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(),Pe(r,`background-color: ${t.value!=="none"?t.value:"transparent"} !important;`)}else ge(e.elem,t.classNamePrefix)}function Dq(e){const t=e.settings.mobileBackgroundImage[0];if(t.value){const n=String(t.value),r=t.classNamePrefix+Tq(n);ge(e.elem,t.classNamePrefix),e.elem.classList.add(r),$e(),Pe(r,`background-image: ${n!=="none"?kq(ic(n)):"none"} !important;`)}else ge(e.elem,t.classNamePrefix)}function Bq(e){const t=e.settings.mobileBackgroundPositionX;if(t.value){const n=t.classNamePrefix+aC(String(t.value));ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Pe(n,`background-position-x: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function Hq(e){const t=e.settings.mobileBackgroundPositionY;if(t.value){const n=t.classNamePrefix+aC(String(t.value));ge(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Pe(n,`background-position-y: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function Fq(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(),Pe(n,`background-repeat: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function $q(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(),Pe(n,`background-size: ${t.value} !important;`)}else ge(e.elem,t.classNamePrefix)}function oa(e){const t=e.settings.mobilePadding;$e(),["top","right","bottom","left"].forEach(n=>{const r=t[n];if(r!=null){c_({elem:e.elem,position:n});const o=t.classNamePrefix+n+"-"+r;e.elem.classList.add(o),Pe(o,`padding-${n}: ${r}px !important;`)}else r===null&&c_({elem:e.elem,position:n})})}function fC(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(),Pe(n,`font-size: ${t.value}px !important;`)}else ge(e.elem,t.classNamePrefix)}function mC(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(),Pe(n,`line-height: ${t.value}px !important;`)}else t&&ge(e.elem,t.classNamePrefix)}function hC(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"),Pe(r,`display: ${o} !important;`)}t==="desktop"&&(n(),Pe(r,"display: none !important;"))}else n(),e.elem.classList.forEach(r=>{r.indexOf("em-show-")>-1&&e.elem.classList.remove(r)})}function Wq(e){const t=e.settings.isContrastBlock,n=oh();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 qq(){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=qq();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=Aq(r.substring(24))),r.indexOf("em-mob-background_position_x")>-1&&(n.mobileBackgroundPositionX.value=lC(r.substring(29))),r.indexOf("em-mob-background_position_y")>-1&&(n.mobileBackgroundPositionY.value=lC(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 zq(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:bi(e),backgroundColor:e.style.backgroundColor?j(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:Oc(e),boxShadow:Zs(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:Js(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 Uq(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 jq='table[em-type="social"]';function Vq(e){return e.closest(jq)}function Gq(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 Vc(e){const t=Vq(e);if(t&&e!==t&&Gq(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")&&Xq(o)?n:Vc(n)}function Xq(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 Ci(){return Rt.getInstance(id)?.localized??{}}var pC=[];function Kq(){return pC}function gC(e){const t=Ci();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=IO(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 Yq=new Set(["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"]);function Zq(e){return Array.from(e.classList).some(t=>t.startsWith("em-element-"))}function Qq(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(Yq.has(r.tagName))return!1;return Array.from(e.children).every(r=>r===n||r.contains(n)||Zq(r))}var bC='.em-narrow-table, [em="block-contaner"]';function Jq(e){const t=e.style;return Qq(e)?!1:!!(e.tagName==="A"&&!e.closest(".em-element-resize-img-container")&&!e.closest('table[em-type="social"]')||e.tagName==="TD"&&!e.closest(bC)||e.tagName==="TABLE"&&e.parentElement?.style?.display!=="inline-block"&&!e.classList.contains("em-vindent-table")&&!e.closest(bC)&&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"))||Fy(e))}function ez(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||Fy(e))&&t.push(gC(e));let r=e;for(;r?.parentElement&&r.parentElement.tagName!=="BODY";)r=r.parentElement,Jq(r)&&t.push(gC(r));return t=t.filter(o=>!(o.elem?.tagName==="TABLE"&&o.elem.parentElement?.tagName==="BODY")),t=t.reverse(),pC=t.map(o=>({...o})),t.map(o=>({title:o.title,className:o.className}))}function yC(e){const t=Ci(),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 yC(n)}function tz(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 nz(e){return e.tagName==="AMP-ACCORDION"}var vC="em-mob-text_align-",rz=":scope > tr > td, :scope > tbody > tr > td",oz='div[style*="font-family"][style*="font-size"]';function Fh(e){return e.querySelector(rz)}function $h(e){return e.querySelector(oz)}function iz(e,t){for(let n=e;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!0;return!1}function EC(e){const t=e.closest('table[em="atom"]');if(!t||iz(e,t))return null;const n=Fh(t);return n?{atomTd:n,textDiv:$h(n)}:null}function ia(e){const t=e.closest("div, p, td");if(!t)return null;if(t.style.textAlign)return t;const n=EC(e);return n?n.textDiv?.hasAttribute("align")?n.textDiv:n.atomTd:t}function SC(e){const t=ia(e);return t&&(t.style.textAlign||t.getAttribute("align"))||"left"}function sz(e){const t=ia(e);if(!t)return"";for(const n of t.classList)if(n.startsWith("em-mob-text_align-"))return n.slice(18);return""}function Wh(e){return{value:sz(e)}}function az(e,t,n=vC){const r=EC(e);if(r)for(const o of[r.atomTd,r.textDiv])o&&o!==t&&Nc(o,n)}function lz(e){const t=Fh(e);if(!t)return null;const n=$h(t);return n?.hasAttribute("align")?n:t}function cz(e,t){e.querySelectorAll('[em="atom"]').forEach(n=>{const r=lz(n);r&&t(r,n)})}function uz(e,t,n=vC){const r=Fh(e),o=r?$h(r):null;for(const i of[r,o])i&&i!==t&&Nc(i,n)}function Gc(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 sa(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(fh),i=r.filter(s=>s!==fh);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 Xc(e){if(!e)return!1;const t=e.style.fontWeight||getComputedStyle(e).fontWeight;return t==="bold"||t==="700"||parseInt(t,10)>=700}function zr(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 dz(e){const t=e.style.backgroundImage,n=e.getAttribute("background");if(t&&t!=="none"){const r=t.match(/url\(['"]?(.*?)['"]?\)/);if(r)return[{type:"url",value:r[1]}]}return n?[{type:"url",value:n}]:[{type:"url",value:""}]}function fz(){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 aa(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 wC(){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 qh(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&&qh(t))return!0;return!1}function _C(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 CC(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function mz(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 hz(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 pz(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 gz(e,t){const n=e.elem.closest("a")||e.elem,r=e.elem.closest("td"),o=wh(n),i=qh(r)&&!qh(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}),h=l?We({elem:l}):null,f=We({elem:a}),g=e.elem.closest("a"),E={type:"button",caption:t.BUTTON,fontFamily:sa(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:Gc(e.elem),lineHeightDim:"px",textStrong:Ze(e.elem,"strong","b")||Xc(e.elem),textItalic:Ze(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&(g?.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:j(zr(e.elem,"color"))||j(getComputedStyle(e.elem).color)||"",textBackgroundColor:j(zr(e.elem,"background-color"))||"",padding:mz(o??n),borderRadius:bi(s),backgroundColor:s.style.backgroundColor?j(s.style.backgroundColor):s.getAttribute("bgcolor")||"",backgroundImage:pz(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:_C(a,"width"),height:_C(r,"height"),align:u,valign:r.getAttribute("valign")??"",textAlign:r.getAttribute("align")??"",border:Oc(s),boxShadow:Zs(s),href:n.getAttribute("href")??"",outlookRounding:i,outlookBackground:Js(r,"inside"),mobileWidth:{value:CC(f.mobileWidth),dim:f.mobileWidthDim??"px"},mobileHeight:{value:CC(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:Wh(e.elem),mobileVerticalAlign:h?.mobileVerticalAlign,mobileBackgroundColor:m.mobileBackgroundColor,mobileBackgroundImage:m.mobileBackgroundImage,mobileBackgroundPositionX:m.mobileBackgroundPositionX,mobileBackgroundPositionY:m.mobileBackgroundPositionY,mobileBackgroundRepeat:m.mobileBackgroundRepeat,mobileBackgroundSize:m.mobileBackgroundSize,mobilePadding:hz(d.mobilePadding),mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},show:f.show,exportAsPicture:a?.getAttribute("em-operation")==="exportAsPicture"};return aa(e.elem)&&(E.showOnMobile=!0),E}function bz(e){if(_h(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 yz(e,t){return t?!1:e.tagName==="A"||e.tagName==="EM-REPLACE"&&!!e.closest("a")}function vz(e){const t=e.closest("a"),n=e.closest('a[style*="display"]');if(_h(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 TC(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function AC(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function kC(e){return{src:e.getAttribute("src")??"",width:TC(e,"width"),height:TC(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 Ez(e,t,n){n.clearActiveEditElements();const r=e.elem.closest("amp-carousel");r.setAttribute("em-edit","active");const o=r.querySelectorAll("amp-img"),i=Sz(o),s=Array.from(o).map((u,d)=>{const m=We({elem:u}),h=kC(u);return{src:h.src,width:h.width,height:h.height,alt:h.alt,title:h.title,link:h.link,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:h.imgReplacer,mobileWidth:{value:AC(m.mobileWidth),dim:m.mobileWidthDim??"px"},mobileHeight:{value:AC(m.mobileHeight),dim:m.mobileHeightDim??"px"},mobileBorderRadius:m.mobileBorderRadius,slideIndex:d}}),a=We({elem:r}),l={type:"carousel",caption:t.CAROUSEL,carouselImages:s,borderRadius:bi(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 Sz(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 wz(e){return!!e.closest("amp-carousel")}function zn(e){return typeof e=="string"?e:typeof e=="number"?String(e):""}function yt(e){return typeof e=="number"?Number.isFinite(e)?e:null:typeof e!="string"||!/^\s*-?\d+(\.\d+)?(px)?\s*$/.test(e)?null:parseFloat(e)}var Kc=["top","right","bottom","left"],Yc={borderAll:"all",borderTop:"top",borderRight:"right",borderBottom:"bottom",borderLeft:"left"},Zc={width:1,style:"solid",color:"#b9b1b1"},LC={width:null,style:null,color:null};function Qc(e,t){if(t==="all"){const r=Kc.map(i=>Qc(e,i)),[o]=r;return r.every(i=>JSON.stringify(i)===JSON.stringify(o))?o:LC}const n=e.style.getPropertyValue(`border-${t}-style`);return!n||n==="none"?LC:{width:yt(e.style.getPropertyValue(`border-${t}-width`)),style:n,color:j(e.style.getPropertyValue(`border-${t}-color`))||null}}function zh(e){return e.style===""||"width"in e&&Be(e.width)&&!e.style&&!e.color}function NC(e){return e==="all"?"border":`border-${e}`}function Jc(e){const t=NC(e),n=[t,`${t}-width`,`${t}-style`,`${t}-color`];return e==="all"?[...n,...Kc.flatMap(Jc)]:n}function xC(e,t,n){hh(e,Jc(t)),e.style.setProperty(NC(t),`${n.width}px ${n.style} ${n.color}`)}function _z(e){const t=Qc(e,"all");if(t.style===null)return;hh(e,Jc("all"));const n={width:t.width??0,style:t.style,color:t.color??Zc.color};Kc.forEach(r=>xC(e,r,n))}function OC(e,t,n){if(t!=="all"&&_z(e),zh(n)){hh(e,Jc(t));return}const r=Qc(e,t==="all"?"top":t);xC(e,t,{width:yt(n.width)??r.width??Zc.width,style:n.style||r.style||Zc.style,color:n.color||r.color||Zc.color})}var Uh=/^border(-(top|right|bottom|left))?(-(width|style|color))?$/i;function Cz(e,t){const n=e.style.getPropertyValue(`border-${t}-style`);if(!n||n==="none")return null;const r=e.style.getPropertyValue(`border-${t}-color`);return[e.style.getPropertyValue(`border-${t}-width`),n,j(r)||r].filter(Boolean).join(" ")}function Tz(e){const t=U_(e.getAttribute("style")),n=t.findIndex(({name:a})=>Uh.test(a));if(n<0||t.some(({name:a,value:l})=>Uh.test(a)&&/!important/i.test(l)))return;const r=Kc.map(a=>[a,Cz(e,a)]),[,o]=r[0],i=o&&r.every(([,a])=>a===o)?[`border: ${o}`]:r.flatMap(([a,l])=>l?[`border-${a}: ${l}`]:[]),s=t.filter(({name:a})=>!Uh.test(a)).map(({name:a,value:l})=>`${a}: ${l}`);s.splice(n,0,...i),e.setAttribute("style",s.length?`${s.join("; ")};`:"")}function Az(e){const t=yt(e.getAttribute("border"));return t?{width:t,style:"solid",color:j(e.getAttribute("bordercolor")??"")||null}:null}function RC(e){const t=Az(e),n=Object.keys(Yc),r=Object.fromEntries(n.map(i=>[i,t??Qc(e,Yc[i])])),o=n.find(i=>r[i].style!==null)??"borderAll";return{...r,position:o}}function kz(e){return!!e.closest(".em-element-custom-table")}function MC(e){const{paddingTop:t,paddingRight:n,paddingBottom:r,paddingLeft:o}=e.style;return{paddingLeftRight:o===n?o:"",paddingTopBottom:t===r?t:"",paddingLeft:o,paddingRight:n,paddingTop:t,paddingBottom:r}}function Lz(e){return{backgroundColor:j(e.style.backgroundColor||e.getAttribute("bgcolor")||"")||"",backgroundImage:dz(e),backgroundPositionX:e.style.backgroundPositionX||"center",backgroundPositionY:e.style.backgroundPositionY||"center",backgroundRepeat:e.style.backgroundRepeat||"repeat",backgroundSize:e.style.backgroundSize||"cover"}}function Nz(e){const{position:t,...n}=RC(e),r=Zs(e);return{...n,borderPosition:t,borderRadius:bi(e),boxShadow:{color:r?.color??null,hOffset:r?.hOffset??null,vOffset:r?.vOffset??null,blurRadius:r?.blurRadius??null,spreadRadius:r?.spreadRadius??null,inset:r?.inset??null}}}function xz(e){return{mobileBoxShadow:e.mobileBoxShadow,mobileBackgroundColor:e.mobileBackgroundColor,mobileBackgroundImage:e.mobileBackgroundImage,mobileBackgroundPositionX:e.mobileBackgroundPositionX,mobileBackgroundPositionY:e.mobileBackgroundPositionY,mobileBackgroundRepeat:e.mobileBackgroundRepeat,mobileBackgroundSize:e.mobileBackgroundSize,mobileWidth:{value:e.mobileWidth!=null?e.mobileWidth:null,dim:e.mobileWidthDim},mobileHeight:{value:e.mobileHeight!=null?e.mobileHeight:null,dim:"px"},mobileBorderRadius:e.mobileBorderRadius,mobileBorder:e.mobileBorder}}function Oz(e){const{position:t,borderAll:n,borderTop:r,borderRight:o,borderBottom:i,borderLeft:s}=RC(e),a=Object.fromEntries(Object.entries(MC(e)).map(([l,c])=>[`cell_${l}`,c]));return{cell_borderPosition:`cell_${t}`,cellBackgroundColor:e.getAttribute("style")?.includes("background-color:")?j(e.style.backgroundColor):"",cell_borderAll:n,cell_borderTop:r,cell_borderRight:o,cell_borderBottom:i,cell_borderLeft:s,...a}}function Rz(e){const t=e.closest("a");return{linkHref:t?.getAttribute("href")?.trim()??"",textLink:!!t,linkTarget:t?.getAttribute("target")??""}}function Mz(e){const t=e?.closest('div[style*="font-size"]');return e?.style?.fontSize?parseInt(e.style.fontSize,10):t?.style?.fontSize?parseInt(t.style.fontSize,10):null}function Pz(e,t){const n=t.requestElemWithStyle;return{fontFamily:t.getFontFamilyFromElement(n?.closest('[style*="font-family"]')||e),fontSize:Mz(n),textStrikethrough:t.textHasStyle(e,"s","strike")||n?.style.textDecoration.includes("line-through"),textUnderline:t.textHasStyle(e,"u")||n.style.textDecoration.includes("underline")||!n.style.textDecoration&&e.tagName==="A",lineHeight:t.getLineHeghtInPixels(n),textStrong:t.textHasStyle(e,"strong","b")||t.isElementHasBold(n),textItalic:t.textHasStyle(e,"i","em")||!n.closest('[style*="font-style: normal"]')&&n?.style?.fontStyle==="italic",textAlign:e.style?.textAlign||e.getAttribute("align")||e.closest("[align]")?.getAttribute("align")||"",textColor:j(e.closest('[style*="color"]')?.style.color)||j(getComputedStyle(e).color),textBackgroundColor:j(e.closest('[style*="background-color"]')?.style.backgroundColor)||j(getComputedStyle(e).backgroundColor),textValign:e.style?.verticalAlign||e.getAttribute("valign")||e.closest("[valign]")?.getAttribute("valign")||""}}function Iz(e,t,n){const r=e.elem,o=r.closest("td, th")??r,i=o.closest("table"),s=We({elem:i}),a={direction:r.getAttribute("dir")??"none",show:s.show,outlookBackground:Js(r.closest(".em-element-custom-table")??r,"around"),customTable:{tableKey:n.tableKey(i),...MC(o),...Lz(i),...Nz(i),...xz(s),...Oz(o),...Rz(r),...Pz(r,n)}};return r.getAttribute("new")&&(r.removeAttribute("new"),a.customTable.isNewLink=!0,r.setAttribute("em-edit","active")),{type:"customTable",caption:t.ELEMENT,settings:a}}function Dz(){const e=new WeakMap;let t=0;return n=>{let r=e.get(n);return r||(t+=1,r=`table-${t}`,e.set(n,r)),r}}function eu(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function Bz(e,t,n){const r=e.elem;return{type:"div",caption:t.CONTAINER,...n.getElementTdDiv(r),width:eu(r.style.width),maxWidth:eu(r.style.maxWidth),minWidth:eu(r.style.minWidth),height:eu(r.style.height),valign:r.style.verticalAlign??"",align:r.style.textAlign??"",direction:r.getAttribute("dir")??"none"}}function PC(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 Hz(e){return e.tagName==="TABLE"&&e.getAttribute("em")==="atom"}function IC(e,t,n){return e?{fontFamily:sa(e.closest('[style*="font-family"]')||e),textStrong:Ze(e,"strong","b")||Xc(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:j(e.closest('[style*="color"]')?.style.color)||"",textBackgroundColor:j(e.closest('[style*="background-color"]')?.style.backgroundColor)||"",textStrikethrough:Fz(e),textUnderline:$z(e)}:{}}function Fz(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 $z(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 Wz(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?IC(o,r,n):{};return{type:"td",caption:t.ELEMENT,...a,mobileWidth:PC(i.mobileWidth,i.mobileWidthDim),direction:s?.getAttribute("dir")??"none",elementName:r?"List":"",...l}}function qz(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?IC(i,o,n):{};return{settings:{type:"td",caption:t.ELEMENT,...c,mobileWidth:PC(a.mobileWidth,a.mobileWidthDim),direction:l?.getAttribute("dir")??"none",elementName:s?"List":"",...u},editTargetTd:l,shouldResetProgrammaticSelection:!0}}function DC(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function zz(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function BC(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function Uz(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 jz(e,t){const n=e.elem,r=We({elem:n}),o=n.firstElementChild,i=o?We({elem:o}):null,s=DC(r.mobileWidth),a=i?DC(i.mobileWidth):null;return{type:"floatBlock",caption:t.FLOAT_BLOCK,width:zz(o?.getAttribute("width")),gap:{value:Uz(n),dim:"px"},maxWidth:BC(n.style.maxWidth),minWidth:BC(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 Vz(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 HC(e){return e.getAttribute("src")}function Gz(e,t){const n=Vd(e.elem),r=HC(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:FC(n,"width"),height:FC(n,"height"),alt:n.getAttribute("alt")??"",title:n.getAttribute("title")??"",align:i?.getAttribute("align")??"undefined",valign:n.style?.verticalAlign??"undefined",border:Oc(n),borderRadius:bi(n),boxShadow:Zs(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 aa(e.elem)&&(u.showOnMobile=!0),i&&(u.maxWidth=Math.round(i.getBoundingClientRect().width)),u}function FC(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function Xz(e){return e.tagName==="IMG"||e.tagName==="AMP-IMG"}function la(e){const t=String(e??"").trim();return t?j(t)??t:""}var jh={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function Kz(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 Yz(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 Vh(e){return e.closest('table[em-type="social"]')}function Zz(e){const t=e.ownerDocument;return t?Array.from(t.querySelectorAll('table[em-type="social"]')).indexOf(e):-1}function $C(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 Ti(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 Un(e,t){return e.hasAttribute(t)||e.hasAttribute(`data-${t}`)}function Gh(e,t){return e?e.getAttribute(t)??e.getAttribute(`data-${t}`):null}function Qz(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 Jz(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&&Un(r,"em-platform")&&Un(i,"em-platform")&&o instanceof HTMLElement&&!Un(o,"em-platform")){const s=Qz(o);if(s!=null){t.gap=s;return}}}}function WC(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 eU(e,t){const n=$C(e)?.getAttribute("align")?.trim().toLowerCase();(n==="left"||n==="right"||n==="center")&&(t.align=n)}function tU(e,t){for(const n of e){if(!(n instanceof HTMLElement)||!Un(n,"em-platform"))continue;const r=WC(n.getAttribute("style"));if(r!=null){t.borderRadius=r;return}const o=WC(n.querySelector("img")?.getAttribute("style")??null);if(o!=null){t.borderRadius=o;return}}}function nU(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 rU(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=Ti(r),s=Ti(o instanceof HTMLElement?o:null),a=Ti(e.querySelector("[em-social-tray], [data-em-social-tray]")),l=Ti(t),c=Ti(e),u=i||s||a||l||c;u&&(n.bgEnabled=!0,n.bgColor=u)}function oU(e){const t=$C(e);if(!(t instanceof HTMLElement))return"";const n=Ti(t);return n||(t.getAttribute("bgcolor")?.trim()??"")}function Xh(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 iU(e,t){const n=Xh(e);n&&(t.borderWidth=n.w,t.borderColor=n.color)}function sU(e){const t=e.closest("td[em-platform], td[data-em-platform]");if(t)return!!Vh(t);const n=e.closest("td"),r=n?.previousElementSibling,o=n?.nextElementSibling;return!!(n&&!Un(n,"em-platform")&&r instanceof HTMLElement&&o instanceof HTMLElement&&Un(r,"em-platform")&&Un(o,"em-platform")&&Vh(n))}function aU(e,t){const n=Vh(e.elem);if(!n)return{type:"social",caption:t.SOCIAL??"Social media",...jh,hostCellBgForIconLuminance:"",blockIndex:-1,items:[]};const r={...jh};eU(n,r),iU(n,r);const o=n.querySelector('table[role="presentation"]')||n.querySelector("table");rU(n,o,r);const i=o?.querySelector("tr"),s=i?Array.from(i.querySelectorAll(":scope > td")):[],a=s.filter(f=>f instanceof HTMLElement&&Un(f,"em-platform")),l=a.length>0?a:s.filter(f=>f.querySelector("img"));Jz(s,r),tU(l,r),nU(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?Xh(u):null;if(d)c=d.w;else for(const f of l){if(!(f instanceof HTMLElement))continue;const g=Xh(f);if(g){c=g.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 g=f,E=Gh(g,"em-platform")||"unknown",w=Un(g,"em-custom-icon"),T=g.querySelector("a"),L=g.querySelector("img"),y=T?.getAttribute("href")??"",p=T?.getAttribute("title")??L?.getAttribute("title")??"",v=L?.getAttribute("alt")??"",C=L?.getAttribute("src")??"",b=Kz(L instanceof HTMLImageElement?L:null),S=L?.getAttribute("height")?.trim(),_=S?parseInt(S,10):NaN,k=!Number.isNaN(_)&&_>0,x=Gh(g,"em-button-bg")?.trim()??"",N=!w&&Un(g,"em-tray-cell-bg");let W="",O="";if(!w&&(W=x,!W&&!N&&g.style?.backgroundColor&&(W=g.style.backgroundColor.trim()),O=Gh(g,"em-item-border-color")?.trim()??"",!O)){const P=g.style.border?.trim()??"",Q=/^(\d+)px\s+solid\s+(.+)$/i.exec(P);Q?.[2]&&(O=Q[2].trim())}return{platform:E,customIcon:w,href:y,alt:v,title:p,iconSrc:C,iconWidth:b,iconHeight:k?_:b,buttonBgColor:W,itemBorderColor:O}});if(d&&m.length>0&&m.every(f=>f.customIcon||!String(f.itemBorderColor??"").trim())){const f=d.color;m=m.map(g=>g.customIcon?g:{...g,itemBorderColor:f})}const h=Yz(m,jh.iconSize);return{type:"social",caption:t.SOCIAL??"Social media",align:r.align,iconSize:h,borderRadius:r.borderRadius,gap:r.gap,bgEnabled:r.bgEnabled,bgColor:la(r.bgColor),borderWidth:r.borderWidth,borderColor:la(r.borderColor),buttonBorderColor:"",buttonBorderWidth:c,showLabel:r.showLabel,hostCellBgForIconLuminance:la(oU(n)),blockIndex:Zz(n),items:m.map(f=>({...f,buttonBgColor:la(f.buttonBgColor),itemBorderColor:la(f.itemBorderColor)}))}}function qC(e){return e.tagName==="TBODY"&&Array.from(e.childNodes).every(zC)}function lU(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function zC(e){return e.nodeType===Node.COMMENT_NODE}function _n(e){if(e.tagName!=="TABLE")return!1;const t=Array.from(e.childNodes).filter(r=>!zC(r));if(t.length===0)return!0;const n=t.filter(r=>!lU(r));return n.length===1&&n[0]instanceof Element&&qC(n[0])}function UC(e=document){for(const t of Array.from(e.querySelectorAll("table")))if(_n(t))return t;return null}function jC(){const e=Jd(document,'[em="group"]');return Jd(e||document,'[em="block"]')}function hr(e){const t=e.children.length===1?e.children[0]:null;return t&&qC(t)?t:e}function cU(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function VC(e,t){const n=e.style[t];return n?{value:parseFloat(n),dim:n.includes("%")?"%":"px"}:{value:null,dim:"px"}}function uU(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function dU(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 fU(e,t){const n=e.elem;if(_n(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?j(n.style.backgroundColor):"",backgroundImage:dU(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:cU(n,"width"),maxWidth:VC(n,"maxWidth"),minWidth:VC(n,"minWidth"),align:n.getAttribute("align")??"",border:Oc(n),boxShadow:Zs(n),borderRadius:bi(n),mobileWidth:{value:uU(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:Js(n,"around")};return aa(n)&&(o.showOnMobile=!0),o}function mU(e){return e.tagName==="TABLE"&&e.getAttribute("em")!=="atom"}function hU(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 pU(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 gU(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 bU(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 yU(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 vU(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 EU(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};return o.floatBlocks=yU(r),o.isContrastBlock=!!r.closest(".em-contrast-block"),{type:"structure",caption:t.STRUCTURE,settings:o}}function SU(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 wU(e){if(e.nodeType!==Node.ELEMENT_NODE)return[e];const t=e;return t.querySelectorAll("tbody").forEach(n=>n.replaceWith(...Array.from(n.childNodes))),t.tagName==="TBODY"?Array.from(t.childNodes):[t]}function GC(e){return Re(e,!0).flatMap(wU)}function Ai(e,t){e.replaceChildren(...GC(t))}function _U(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function ca(e,t){const n=GC(t),r=n.filter(s=>!_U(s)),[o]=r,i=r.length===1&&o.nodeType===Node.ELEMENT_NODE&&o.tagName==="TABLE";e.replaceChildren(...i?Array.from(o.childNodes):n)}function CU(e,t,n){const r=document.createElement("div");return Ce(r,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(h=>h.trim());l[d]=m}),l[t]=`${n}px`;const c=Object.entries(l).map(([u,d])=>`${u}: ${d}`).join("; ");s.setAttribute("style",c)}}),Xe(r)}function TU(e,t){const n=document.createElement("div");return Ce(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");i&&(i.innerHTML=t)}}),Xe(n)}function AU(e,t){const n=document.createElement("div");return Ce(n,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};`)}}}),Xe(n)}function kU(e,t){const n=document.createElement("div");return Ce(n,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;`)}}}),Xe(n)}function LU(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 Ce(r,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};`)}}}),Xe(r)}function NU(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 Ce(r,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};`)}}}),Xe(r)}function xU(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldUnderline value: must be a boolean");const n=document.createElement("div");return Ce(n,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};`)}}}),Xe(n)}function OU(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldStrikethrough value: must be a boolean");const n=document.createElement("div");return Ce(n,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};`)}}}),Xe(n)}function RU(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 MU(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 PU(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=RU(e),s=MU(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 XC(e){const t=e.cloneNode(!0);en(e,t);const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let r;for(;r=n.nextNode();)r.nodeValue="";return t}function Kh(e){let t="";for(const n of e.attributes)t+=` ${n.name}="${n.value}"`;return t}function IU(e,t){const n=e.closest(`table.${t}`);if(!n)return null;const r=n.querySelector("tbody"),o=Xe(r??n).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?Xe(l).trim():"",m=a?Er(XC(a)):"",h=l?Er(XC(l)):"",f=l?`<td${Kh(l)}></td>`:"",g=l?l.querySelector("div"):null;return{rowHtml:o,firstCellText:c,secondCellText:u,firstCellHtmlNoText:m,secondCellHtmlNoText:h,secondCellWrapperHtml:f,secondCellInnerDivHtml:g?Er(g):"",wrappedSecondCellHtml:l&&g?`<td${Kh(l)}>${Er(g)}</td>`:"",secondCellInnerDivWrapperHtml:g?`<div${Kh(g)}></div>`:"",secondCellTextHTML:d}}function KC(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function YC(e,t){const n=document.createElement("template");Ce(n,e);const r=n.content.firstElementChild;if(!r||r.tagName.toLowerCase()!=="td")return e;const o=r.querySelector("div");return o?o.textContent=KC(t)||" ":r.insertAdjacentText("afterbegin",KC(t)),Er(r)}function ki(e){const t=document.createElement("template");return Ce(t,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")}),Xe(t)}function ZC(e){e.removeAttribute("id"),e.querySelectorAll("[id]").forEach(t=>t.removeAttribute("id"))}function DU(e,t,n,r=!0){const o=document.createElement("template");Ce(o,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 Xe(o)}function BU(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 HU(e){return e.map(t=>({...t,cellOneText:t.cellOneText===""?" ":t.cellOneText,cellTwoText:t.cellTwoText===""?" ":t.cellTwoText}))}function FU(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 Yh(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=FU(HU(BU(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 $U(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function WU(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);en(e,a);const 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 qU(e,t,n,r){const o=new DOMParser().parseFromString(e,"text/html");Uu(o,e);const 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?Er(l):e}function zU(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=Array.from(s.querySelectorAll("div, strong")).filter(l=>!l.closest("template"));if(a.length===0){const l=document.createElement("div");l.innerHTML=" ",s.appendChild(l)}else a.forEach(l=>{let c=ze(l).trim();!c||c.replace(r,"")===""?l.innerHTML=" ":(c=c.replace(r,""),c.endsWith(" ")||(c+=" "),c=c.replace(/ +$/," "),Ai(l,c))})})}function UU(e){const t=`<table><tbody><tr>${e}</tr></tbody></table>`,n=new DOMParser().parseFromString(t,"text/html");Uu(n,t);const r=n.querySelector("div");r&&(r.classList.add("remove-new-editor-element"),r.innerHTML.trim()?r.insertAdjacentHTML("beforeend"," "):r.innerHTML=" ");const o=n.querySelector("td");return o?Er(o):""}function jU(e,t){const n=document.createElement("div");return Ce(n,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)}}),Xe(n)}var Zh="em-element-list-ol",Qh="em-element-list-ul",VU="em-element-list-bullet",GU=`.${Zh}, .${Qh}`,XU=["DIV","P","TD","H1","H2","H3","H4","H5","H6"],KU="div, p, td, h1, h2, h3, h4, h5, h6",jn={LIST:"margin: 0; padding: 0 0 0 20px;",LIST_ITEM:"padding-bottom: 5px;"},ua=null;function Jh(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 ua&&ua.container.isConnected&&e.contains(ua.container)?ua:null}function YU(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:tu(r),nodes:[...r],startIndex:o,endIndex:s-1}),r=[],o=s+1):r.push(i)}),r.length>0&&t.push({html:tu(r),nodes:[...r],startIndex:o,endIndex:n.length-1}),t}function ZU(e){const t=[],n=Array.from(e.childNodes);let r=[],o=0;const i=a=>{r.length>0&&(t.push({html:tu(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:tu([a]),nodes:[a],startIndex:l,endIndex:l}),o=l+1):r.push(a)}),i(n.length),t}function tu(e){const t=document.createElement("div");return e.forEach(n=>{const r=n.cloneNode(!0);en(n,r),t.appendChild(r)}),zo(t),Xe(t)}function ep(e,t){const n=Jh(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 QC(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 QU(e,t){const n=window.getSelection();if(!n||n.rangeCount===0){const a=ep(e,t);return{start:a,end:a}}const r=n.getRangeAt(0);if(r.collapsed){const a=ep(e,t);return{start:a,end:a}}const o=ep(e,t),i=QC(e,r.startContainer,t,o),s=QC(e,r.endContainer,t,o);return{start:Math.min(i,s),end:Math.max(i,s)}}function JC(e){const t=Array.from(e.childNodes).filter(r=>r.nodeType!==Node.TEXT_NODE||(r.textContent??"").trim()!==""),n=t.length===1?t[0]:null;return n?.nodeName==="EDITOR"?n:e}function JU(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes)))}function e0(e){return e.nodeType===Node.TEXT_NODE&&/^[\t\n\f\r ]*$/.test(e.data)}function t0(e,t){const n=n0(t);if(n.length===0){e.append(" ");return}e.append(...n),JU(e)}function n0(e){let t=0,n=e.length-1;for(;t<=n&&e0(e[t]);)t++;for(;n>=t&&e0(e[n]);)n--;return e.slice(t,n+1)}var ej=["color","background-color","font-family","font-size","font-weight","font-style","text-decoration"];function tj(e){const t=n0(Array.from(e.childNodes)),n=document.createElement("span");return ej.forEach(r=>{const o=e.style.getPropertyValue(r);o&&n.style.setProperty(r,o,e.style.getPropertyPriority(r))}),e.className&&(n.className=e.className),!n.hasAttribute("style")&&!n.hasAttribute("class")?t:(n.append(...t),[n])}function nu(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const{startContainer:n,startOffset:r,endContainer:o,endOffset:i}=t.getRangeAt(0),s=a=>a.nodeType===Node.TEXT_NODE&&e.contains(a);return s(n)&&s(o)?{startContainer:n,startOffset:r,endContainer:o,endOffset:i}:null}function ru(e,t){const n=window.getSelection();if(!t||!n||!e.contains(t.startContainer)||!e.contains(t.endContainer))return!1;const r=document.createRange();return r.setStart(t.startContainer,t.startOffset),r.setEnd(t.endContainer,t.endOffset),n.removeAllRanges(),n.addRange(r),!0}function r0(e,t,n){const r=nu(e),o=document.createElement(n);Array.from(t.attributes).forEach(s=>{o.setAttribute(s.name,s.value)}),Array.from(o.style).filter(s=>s.startsWith("margin")||s.startsWith("padding")).forEach(s=>o.style.removeProperty(s));const i=o.style.cssText;o.setAttribute("style",i?`${jn.LIST} ${i}`:jn.LIST),o.append(...Array.from(t.childNodes)),t.replaceWith(o),ru(e,r)}function nj(e){return e.querySelector("br")!==null}function rj(e){const t=Jh(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 oj(e){const t=Jh(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=g=>g!==null&&g.nodeType===Node.ELEMENT_NODE&&g.tagName==="BR",l=g=>g!==null&&g.nodeType===Node.TEXT_NODE&&g.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 h;d?(h=s,h.data=" "):(h=document.createTextNode(" "),s?e.insertBefore(h,s):e.appendChild(h));const f=window.getSelection();if(f){const g=document.createRange();g.setStart(h,0),g.collapse(!0),f.removeAllRanges(),f.addRange(g)}ua={container:h,offset:0}}function ij(e,t){const n=JC(e),r=t?"ol":"ul";if(n.querySelector("ol, ul")){const o=rj(n);if(o){o.tagName.toLowerCase()!==r&&r0(n,o,r);return}const i=n.querySelector(":scope > ol, :scope > ul"),s=Array.from(n.childNodes).some(a=>a.nodeType===Node.ELEMENT_NODE&&a.tagName==="BR");if(i&&!s){i.tagName.toLowerCase()!==r&&r0(n,i,r);return}}nj(n)||n.querySelector(":scope > ol, :scope > ul")?(oj(n),sj(n,r)):o0(n,r)}function o0(e,t){const n=nu(e),r=document.createElement(t);r.setAttribute("style",jn.LIST);const o=document.createElement("li");o.setAttribute("style",jn.LIST_ITEM),t0(o,Array.from(e.childNodes)),r.appendChild(o),e.replaceChildren(r),ru(e,n)||i0(o)}function sj(e,t){const n=ZU(e);if(n.length===0){o0(e,t);return}const{start:r,end:o}=QU(n,e),i=nu(e),s=document.createElement(t);s.setAttribute("style",jn.LIST);let a=null;for(let h=r;h<=o;h++){const f=document.createElement("li");f.setAttribute("style",jn.LIST_ITEM),t0(f,n[h].nodes),s.appendChild(f),a=f}const l=document.createDocumentFragment(),c=h=>h.forEach((f,g)=>{g>0&&l.appendChild(document.createElement("br")),l.append(...f.nodes)}),u=h=>h.map(f=>f.html).join("<br>").trim()!=="",d=n.slice(0,r);u(d)&&(c(d),l.appendChild(document.createElement("br"))),l.appendChild(s);const m=n.slice(o+1);u(m)&&(l.appendChild(document.createElement("br")),c(m)),e.replaceChildren(l),!ru(e,i)&&a&&i0(a)}function i0(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 aj(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 lj(e,t){const n=YU(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 cj(e){const t=JC(e),n=t.querySelector("ol, ul");if(!n)return;const r=nu(t),o=aj(t,n),i=document.createDocumentFragment();n.querySelectorAll(":scope > li").forEach(s=>{const a=ze(s).trim();!a||a===" "||(i.hasChildNodes()&&i.appendChild(document.createElement("br")),i.append(...tj(s)))}),n.replaceWith(i.hasChildNodes()?i:" "),ru(t,r)||lj(t,o)}function ou(e){if(!e)return!1;const t=e.closest("ul, ol");return t?!t.closest(GU):!1}function uj(e,t,n){const r=fz()||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=s0(e.elem,n),h=Ze(o,"strong","b"),f=s!==o?Ze(s,"strong","b"):!1,g=e.elem&&o&&e.elem.isConnected&&(o===e.elem||o.contains(e.elem))?Ze(e.elem,"strong","b"):!1,E=h||f||g,w=Xc(s),T=E||w,L={type:"text",caption:t.TEXT,fontFamily:sa(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:Gc(a),lineHeightDim:"px",textAlign:SC(e.elem),textStrong:T,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")||wC()),textColor:ou(r)&&j(zr(r,"color"))||j(e.elem.closest('[style*="color"]')?.style.color)||j(getComputedStyle(e.elem).color)||"",textBackgroundColor:hj(e.elem),mobileFontSize:{value:u.mobileFontSize,dim:u.mobileFontSizeDim||"px"},mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},mobileTextAlign:Wh(e.elem),linkHref:(()=>{const y=s.closest("a");if(!y)return;const p=y.getAttribute("href");if(p!==null)return p})(),textAnchor:(()=>{const y=s.closest("a");if(y&&!y.hasAttribute("href"))return y.getAttribute("name")?.trim()||void 0})(),textLink:(()=>{const y=s.closest("a");return y?!!y.hasAttribute("href"):Ze(e.elem,"a")||wC()})(),textReplacer:n.variableElement(e.elem),list:m,standardList:a0(e.elem),textSuperscript:Ze(e.elem,"sup"),textSubscript:Ze(e.elem,"sub")};return aa(r)&&(L.showOnMobile=!0),L}function s0(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?j(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?sa(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| /g,""):""}}function a0(e){return ou(e)?{listTypeOL:!!e.querySelector("ol")||!!e.closest("ol"),listTypeUL:!!e.querySelector("ul")||!!e.closest("ul")}:{listTypeOL:!1,listTypeUL:!1}}function tp(e){if(!e)return!1;const t=e.trim().toLowerCase();return t!=="transparent"&&t!=="inherit"}var dj=new Set(["A","B","EM","I","MARK","S","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","U"]);function fj(e){let t=e;for(;t&&dj.has(t.tagName);){const n=t.style.backgroundColor;if(tp(n))return n;t=t.parentElement}return""}function mj(e,t,n){let r=e;for(;r;){const o=r.style.getPropertyValue(t);if(tp(o))return o;if(n&&r===n)break;r=r.parentElement}return""}function hj(e){const t=fj(e);if(tp(t))return j(t)||"";if(e.closest(".em-element-custom-table"))return j(zr(e,"background-color"))||"";const n=e.closest("div");return j(mj(e,"background-color",n))||""}function pj(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 gj(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,h=We({elem:d}),f=We({elem:m}),g=s0(e.elem,n),E={type:"text",caption:t.TEXT,linkHref:(()=>{const w=e.elem.getAttribute("href");if(w!==null)return w})(),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:sa(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:Gc(e.elem),lineHeightDim:"px",textAlign:SC(e.elem),textStrong:Ze(u,"strong","b")||Xc(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:j(e.elem.tagName==="A"?zr(e.elem.querySelector('[style*="color"]'),"color"):zr(e.elem,"color"))||j(getComputedStyle(e.elem).color)||"",textBackgroundColor:j(e.elem.tagName==="A"?zr(e.elem.querySelector('[style*="background-color"]'),"background-color"):zr(e.elem,"background-color"))||"",mobileFontSize:{value:h.mobileFontSize,dim:h.mobileFontSizeDim||"px"},mobileLineHeight:{value:f.mobileLineHeight,dim:"px"},mobileTextAlign:Wh(e.elem),textReplacer:i(e.elem),list:g,standardList:a0(e.elem),textSuperscript:Ze(e.elem,"sup"),textSubscript:Ze(e.elem,"sub")};return aa(e.elem)&&(E.showOnMobile=!0),E}function l0(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function bj(e,t){const n=e.elem,r=We({elem:n}),o=l0(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 yj(e,t){const n=e.elem,r=We({elem:n}),o=l0(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 vj(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 Ej(e){return e.tagName!=="DIV"?!1:!e.style.fontFamily&&!!e.style.height&&!!e.style.lineHeight&&!!e.style.fontSize}function Sj(e,t){return e.elem.tagName==="TD"?bj(e,t):yj(e,t)}var c0={START_POSITION:"remove-start-element-position",NEW_EDITOR:"remove-new-editor-element",ACTIVE_ELEMENT:"remove-active-element"},u0={TRIM_SPACES:/^(\s| )+|(\s| )+$/g,LT:/</g,GT:/>/g,EMPTY_TEXT:/^(?:\s| )*$/};function d0(e,t){if(!e)return!1;const n=e.closest("tr");return n?n.closest("table")?.classList.contains(t)??!1:!1}function iu(e){const t=d0(e,Zh),n=d0(e,Qh),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:Zh,classNameUl:Qh,classNameBullet:VU,isListOL:t,isListUL:n,isList:r,listType:t?"ol":n?"ul":null,tableElement:o}}function wj(e){if(!e)return null;const t=e.closest("tr");return t?t.querySelector("td:first-child div:first-child"):null}function _j(e){return e?e.querySelector(".em-element-list-ol")||e.querySelector(".em-element-list-ul"):null}function Cj(e=Object.values(c0)){e.forEach(t=>{document.querySelectorAll(`.${t}`).forEach(n=>{n.classList.remove(t)})})}function Tj(e){for(const t of e.classList)if(t.startsWith("em-element-"))return!1;return!0}function f0(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&&f0(n,t)}}function Aj(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 kj(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 Lj(e){if(!e)return null;try{return e.rangeCount>0?e.getRangeAt(0):null}catch{return null}}var Nj="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub";function xj(e,t=Nj){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 Oj(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 Rj(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 Mj(e,t,n,r){if(!document.body.classList.contains("mceNonEditable")&&!(!t&&n)){if(r.removeAllAttributes("em-edit"),e.tagName!=="TABLE"){Vd(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 Pj(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 Ij(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=ih(n)??n),n}function Dj(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:{tableKey:t.tableKey,parseTableElementToModel:t.parseTableElementToModel,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 Bj(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 Hj(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"&&ou(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(Bj(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 Fj={_isCarouselElement:wz,_isAccordionElement:nz,_isSocialBlockElement:sU,_isImageElement:Xz,_isLinkElement:yz,_isButtonElement:bz,_isTableElement:mU,_isCustomTableElement:kz,_isAtomElement:Hz,_isTdColumnGroup:hU,_isTdStructure:pU,_isEmptyTd:gU,_isTdCell:bU,_isVindentTd:vj,_isVindentDiv:Ej,_isFloatBlockElement:Vz,_isDivTextElement:pj,_isInlineButtonElement:vz,_extractTextSettings:uj,_extractCarouselSettings:Ez,_extractAccordionSettings:tz,_extractSocialSettings:aU,_extractImgSettings:Gz,_extractButtonSettings:gz,_extractLinkTextSettings:gj,_extractTableSettings:fU,_extractCustomTableSettings:Iz,_extractAtomElementSettings:Wz,_extractProgrammaticElementSettings:qz,_extractTdColumnGroupSettings:vU,_extractTdStructureSettings:EU,_extractTdCellSettings:SU,_extractVindentSettings:Sj,_extractFloatBlockSettings:jz,_extractDivContainerSettings:Bz,_clearActiveEditElements:wP};function $j(e){const t=e.programmaticSelection??{get:()=>!!U.get("isProgrammaticSelection"),reset:()=>U.set("isProgrammaticSelection",!1)},n=Dz(),r=()=>{const i={operation:"application_element_settings_set",settings:e.getMapObj().unescape({parent:void 0,nextElem:!1,prevElem:!1}),type:null};G.send(i)},o=i=>{if(e.selectionLock.isLocked())return;const s=i.elem??document.querySelector("[em-edit]"),a=e.selectionLock.acquire();try{if(Cr("em-edit"),!s){setTimeout(()=>{const T=document.querySelector("[em-edit]");T?.isConnected?o({elem:T}):r()},0);return}if(s.closest(".em-prevent-action"))return;const l=Ij(s,{getVariableByIcon:Ac,htmlDocument:e.htmlDocument,findOutermostParentWithText:yf,sendResizeEvent:P_}),c=l.tagName==="EDITOR"&&l.firstChild?.nodeType===1?l.firstChild:l,u=iu(l),d=window.getSelection()?.isCollapsed??!0;Mj(l,d,!!l.querySelector("editor"),{removeAllAttributes:Cr});const m={...Fj,HTMLDocument:e.htmlDocument,parseFromString:Re,getParentElementOfSelection:kl,getSelectedText:Ye,findElementWithSelectedText:bs,parseTableElementToModel:Ei,tableKey:n,isElementHasBold:pP,Locale:Ci(),isProgrammaticSelection:t.get(),getElementTdDiv:zq,getLineHeghtInPixels:Gc,getFontFamilyFromElement:T=>kj(T,c),textHasStyle:Ze,activeCell:U.get("activeCell"),CLASS_FOR_BASIC_CELL:lo,requestElemWithStyle:c},h=Dj({elem:l,isCellCustomTable:!!l.closest(".em-element-custom-table"),listContext:{isListOL:u.isListOL,isListUL:u.isListUL,isList:u.isList},requestElemBullet:u.isList?wj(l):null,variableElement:(T,L=!1)=>Pj(L,{getSelectedText:Ye,getRangeFromSelection:Lj})},m),f=Hj(l,d,h),g={operation:"application_element_settings_set",type:f.type,caption:f.caption,settings:f.settings},E=Rj(l,f,g,{removeAllAttributes:Cr});if(E.isProgrammaticSelectionReset&&t.reset(),E.shouldReturn)return;const w=Oj({elem:l,message:g,activateSection:i.activateSection},{getElementParentCaption:yC,getStructureColumns:Uq,getUsedColors:q_,getElementPath:ez,getCurrentElementPath:Kq,mapObj:e.getMapObj(),commonStyles:U.get("commonStyles"),...e.enrichExtras()});U.update({elementPath:w.elementPath}),e.fingerprint.remember(l),G.send(w.message)}finally{Promise.resolve().then(()=>{try{e.fingerprint.remember(document.querySelector("[em-edit]"))}finally{a.release()}})}};return o}function m0(){return U.get("emailWidth")}function Wj(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 np(e){const t=document.createElement("table");return t.replaceChildren(...Re(e,!0)),t}function rp(e){const t=[...e.children].filter(r=>r.tagName==="TR");if(t.length)return t.map(r=>tn(r)).join(`
|
|
92
|
+
`);const n=e.querySelector("tr");return n?tn(n):Tt(e)}function op(e,t){const n=m0(),r=np(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)),Ll({elem:a,width:m})});else{const s=r.querySelector('div[style*="inline-block"]');s.style.maxWidth=o+"px",Ll({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=Iv(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(!Wj(a))return;const m=a.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),h=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 g=0,E=0;a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(L=>{if(L.getAttribute("width")&&!L.classList.contains("em-insert-ignore")){const y=parseFloat(L.getAttribute("width"))/i,p=Math.round(parseFloat(String(o*y))-h/(f*2));L.setAttribute("width",String(p)),g+=p}});const w=o-(u+d+h*(f-1)+g);a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(L=>{if(L.getAttribute("width")&&!L.classList.contains("em-insert-ignore")){const y=parseFloat(L.getAttribute("width"))+Math.round(w/f);E+=y,L.setAttribute("width",String(y)),L.querySelector("img")&&L.querySelectorAll("img").forEach(p=>{parseFloat(p.getAttribute("width")||"0")>parseFloat(L.getAttribute("width"))+Math.round(w/f)&&(p.setAttribute("width",L.getAttribute("width")),p.style.maxWidth=L.getAttribute("width")+"px")})}}),E=E+h*(f-1)+u+d;const T=o-E;if(T!==0&&g>0){const L=a.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(L&&!L.classList.contains("em-insert-ignore")){const y=parseFloat(L.getAttribute("width")||"0");L.setAttribute("width",String(y+T))}else{const y=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let p=y.length-1;p>=0;p--){const v=y[p];if(v.classList.contains("em-insert-ignore"))continue;const C=parseFloat(v.getAttribute("width")||"0");v.setAttribute("width",String(C+T));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 rp(r)}function ip(e){const t=np(e),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"))})}),rp(t)}function sp(e,t){const n=m0(),r=np(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",Ll({elem:s,width:o})),rp(r)}function su(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 h0(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 qj(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}}function zj(e,t,n){const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let o=0;for(;r.nextNode();){const i=r.currentNode;if(i===t)return o+n;o+=i.textContent?.length||0}return-1}function p0(e){return Array.from(e.rows).flatMap(t=>Array.from(t.cells))}function g0(e,t,n){const r=e.findIndex(i=>i.contains(t));if(r<0||t.nodeType!==Node.TEXT_NODE)return null;const o=zj(e[r],t,n);return o<0?null:{cell:r,offset:o}}function Uj(e){const t=window.getSelection();if(!t?.rangeCount)return null;const n=t.getRangeAt(0),r=p0(e),o=g0(r,n.startContainer,n.startOffset),i=g0(r,n.endContainer,n.endOffset),s=!!n.startContainer.parentElement?.closest("editor");return o&&i?{start:o,end:i,inEditor:s}:null}function jj(e,t,n){const r=p0(e),o=r[t.start.cell]?.querySelector(":scope > div");t.inEditor&&o&&n&&n(o,!0);const i=({cell:u,offset:d})=>r[u]?h0(r[u],d):null,s=i(t.start),a=i(t.end),l=window.getSelection();if(!s||!a||!l)return;const c=document.createRange();c.setStart(s.node,s.offset),c.setEnd(a.node,a.offset),l.removeAllRanges(),l.addRange(c)}function Ur(e,t){return t===void 0?{rejected:e}:{rejected:e,key:t}}function Vj(e){return"rejected"in e}function au(e){return{status:"rejected",reason:e.rejected,...e.key===void 0?{}:{key:e.key}}}function Gj(e,t){Array.from(e.attributes).forEach(n=>e.removeAttribute(n.name)),Array.from(t.attributes).forEach(n=>e.setAttribute(n.name,n.value)),e.replaceChildren(...Array.from(t.childNodes))}function b0(e,t,n){if(t.isEditLocked())return au(Ur("locked"));const r=e.outerHTML,o=e.cloneNode(!0),i=n.movesCells?null:Uj(e),s=()=>{i&&jj(e,i,t.wrapEditor)},a=()=>{Gj(e,o),s()};try{const l=n.edit(e);return Vj(l)?(e.outerHTML!==r&&a(),au(l)):(ca(e,t.tableModelToHtml(l)),s(),n.afterWrite?.(e),{status:"applied"})}catch(l){throw a(),l}}var y0=["top","right","bottom","left"],v0={cell_borderAll:"all",cell_borderTop:"top",cell_borderRight:"right",cell_borderBottom:"bottom",cell_borderLeft:"left"},ap={paddingTop:["top"],paddingRight:["right"],paddingBottom:["bottom"],paddingLeft:["left"],paddingLeftRight:["left","right"],paddingTopBottom:["top","bottom"]},Xj={top:"paddingTop",right:"paddingRight",bottom:"paddingBottom",left:"paddingLeft"},E0=e=>t=>[[e,yt(t)??0]];function S0(e){const t=e??{};return y0.map(n=>[Xj[n],yt(t.all??t[n])??0])}function w0(e){const t=yt(e.width);return{...t===null?{}:{width:t},...Be(e.style)?{}:{style:e.style},...Be(e.color)?{}:{color:zn(e.color)}}}function Kj(e){return zh(e)||e.width===0||e.color===""}function Yj(e){return(t,n,{ids:r,ctx:o})=>{const i=n??{},s=o.getExternalBorders(t,r),a=v0[e];let l=t;if(a==="all"){const u=Kj(i);for(const d of Object.keys(s))l=u?o.clearCellBorders(l,[d],y0):o.updateCellBordersByIds(l,[d],s[d],w0(i)),l=o.addClassToCellsByIds(l,[d],Or);return o.addClassToCellsByIds(l,Object.keys(s),Rr)}const c=Object.keys(s).filter(u=>s[u].includes(a));return l=zh(i)?o.clearCellBorders(l,c,[a]):o.updateCellBordersByIds(l,c,[a],w0(i)),o.addClassToCellsByIds(l,r,Rr)}}var Zj=(e,t,{ids:n,ctx:r})=>{const o=r.getExternalCorners(e,n);let i=e;for(const s of Object.keys(o))i=r.updateCellBorderRadiusByIds(i,[s],o[s],yt(t)??0),i=r.addClassToCellsByIds(i,[s],Rr);return i};function _0(e){return(t,n,{ids:r,ctx:o})=>{let i=o.addClassToCellsByIds(t,r,Or);for(const[s,a]of e(n))i=o.updateCellPaddingByIds(i,r,ap[s],a);return o.addClassToCellsByIds(i,r,Rr)}}function C0(e){return(t,n,{ctx:r})=>e(n).reduce((o,[i,s])=>r.updateTablePadding(o,{settings:{[i]:s}}),t)}var T0={...Object.fromEntries(Object.keys(ap).map(e=>[e,C0(E0(e))])),...Object.fromEntries(Object.keys(ap).map(e=>[`cell_${e}`,_0(E0(e))])),padding:C0(S0),cell_padding:_0(S0),...Object.fromEntries(Object.keys(v0).map(e=>[e,Yj(e)])),cellBackgroundColor:(e,t,{ids:n,ctx:r})=>r.addClassToCellsByIds(r.updateTableCellBackgroundByIds(e,n,zn(t)),n,Rr),cell_borderPosition:(e,t,{ids:n,ctx:r})=>r.addClassToCellsByIds(e,n,Or),cell_borderRadiusAll:Zj},Qj=["all","topLeft","topRight","bottomRight","bottomLeft"];function jr(e){return(t,n,{settings:r,ctx:o})=>o[e]({settings:r,elem:t})}function A0(e,t){return(n,r,{ctx:o})=>{const i=r??{},s={...i,value:Be(i.value)?null:i.value};o[t]({settings:{[e]:s},elem:n})}}var Jj=(e,t,{ctx:n})=>{const r=t??{};if(Be(r.hOffset)&&Be(r.vOffset)||r.color===""){Ys(e,r.classNamePrefix||"em-mob-box_shadow-");return}n.setElementMobileBoxShadow({settings:{mobileBoxShadow:r},elem:e})},eV=(e,t,{ctx:n})=>{const r=t??{},o=Qj.find(i=>i in r);if(o){if(yt(r[o])){n.setElementMobileBorderRadius({settings:{mobileBorderRadius:r},elem:e});return}Ys(e,o==="all"?"em-mob-border_radius_":r.classNamePrefix||`em-mob-border_radius_${o}-`)}},tV={mobileWidth:A0("mobileWidth","setElementMobileWidth"),mobileHeight:A0("mobileHeight","setElementMobileHeight"),show:jr("setElementShow"),mobileBackgroundColor:jr("setElementMobileBackgroundColor"),mobileBackgroundImage:jr("setElementMobileBackgroundImage"),mobileBackgroundPositionX:jr("setElementMobileBackgroundPositionX"),mobileBackgroundPositionY:jr("setElementMobileBackgroundPositionY"),mobileBackgroundRepeat:jr("setElementMobileBackgroundRepeat"),mobileBackgroundSize:jr("setElementMobileBackgroundSize"),mobileBorder:jr("setElementMobileBorder"),mobileBoxShadow:Jj,mobileBorderRadius:eV},lu={topLeft:"border-top-left-radius",topRight:"border-top-right-radius",bottomRight:"border-bottom-right-radius",bottomLeft:"border-bottom-left-radius"},nV={"background-size":"cover","background-repeat":"no-repeat","background-position":"center"};function lp(e){const t=yt(e.getAttribute("border"));t&&OC(e,"all",{width:t,style:"solid",color:e.getAttribute("bordercolor")||null}),["border","bordercolor","border-collapse"].forEach(n=>e.removeAttribute(n))}function k0(e){["border-radius",...Object.values(lu)].some(t=>!/^(0px\s*)*$/.test(e.style.getPropertyValue(t)))||e.style.boxShadow?e.style.borderCollapse="separate":e.style.borderCollapse==="separate"&&e.style.removeProperty("border-collapse")}function rV(e){return(t,n)=>{lp(t),OC(t,Yc[e],n??{}),t.style.borderCollapse||(t.style.borderCollapse="collapse")}}var oV=(e,t)=>{const n=t??{};lp(e);const r=yt(n.all);r?yi({elem:e,settings:{borderRadius:{all:r}}}):("all"in n&&e.style.removeProperty("border-radius"),Object.keys(lu).forEach(o=>{const i=yt(n[o]);i?e.style.setProperty(lu[o],`${i}px`):("all"in n||o in n)&&e.style.removeProperty(lu[o])})),k0(e)},iV=(e,t)=>{const n=t??{};lp(e);const r=!Be(n.color)&&!Be(n.hOffset)&&!Be(n.vOffset)?{hOffset:yt(n.hOffset),vOffset:yt(n.vOffset),blurRadius:yt(n.blurRadius),spreadRadius:yt(n.spreadRadius),color:zn(n.color),inset:!!n.inset}:{hOffset:null,vOffset:null};f_({elem:e,settings:{boxShadow:r}}),k0(e)},sV=(e,t)=>{if(Be(t)){e.removeAttribute("bgcolor"),e.style.removeProperty("background-color");return}e.setAttribute("bgcolor",zn(t)),e.style.backgroundColor&&(e.style.backgroundColor=zn(t))},aV=(e,t)=>{const n=t?.[0]?.value;if(Be(n)){e.removeAttribute("data-bg-image"),e.style.removeProperty("background-image");return}e.setAttribute("data-bg-image",zn(n)),e.style.setProperty("background-image",`url('${n}')`),Object.entries(nV).forEach(([r,o])=>{(r==="background-position"?e.style.backgroundPositionX:e.style.getPropertyValue(r))||e.style.setProperty(r,o)})};function L0(e){return(t,n)=>{const r=yt(n);d_(t,{[e]:r===null?void 0:`${r}px`})}}var lV={...Object.fromEntries(Object.keys(Yc).map(e=>[e,rV(e)])),borderRadius:oV,boxShadow:iV,backgroundColor:sV,backgroundImage:aV,backgroundPositionX:L0("backgroundPositionX"),backgroundPositionY:L0("backgroundPositionY"),backgroundSize:(e,t)=>{e.style.backgroundSize=zn(t)},backgroundRepeat:(e,t)=>{e.style.backgroundRepeat=zn(t)}},cV=["fontFamily","fontSize","lineHeight","textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor","linkHref","textAlign","valign"];function uV(e){return e?.querySelector(":scope > div, :scope > editor > div")??null}function dV(e){const t=window.getSelection(),n=t&&t.rangeCount?t.getRangeAt(0):null;if(!n||n.collapsed||!e.contains(n.startContainer)||!e.contains(n.endContainer))return null;const{startContainer:r,startOffset:o,endContainer:i,endOffset:s}=n;return{startContainer:r,startOffset:o,endContainer:i,endOffset:s}}function N0(e,t){const n=document.createRange();return t&&e.contains(t.startContainer)&&e.contains(t.endContainer)?(n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n.selectNodeContents(e),n}function x0(e){const t=window.getSelection()?.anchorNode,n=(t instanceof Element?t:t?.parentElement)?.closest("a");if(n&&e.contains(n))return n;if(e.tagName==="A")return e;const r=e.querySelectorAll("a");return e.querySelector("a[em-edit]")??(r.length===1?r[0]:null)}function O0(e,{settings:t,activeElement:n}){"textAlign"in t&&(t.textAlign?e.setAttribute("align",zn(t.textAlign)):n.style?.textAlign?n.style.removeProperty("text-align"):e.removeAttribute("align")),t.valign?e.closest("td")?.setAttribute("valign",zn(t.valign)):t.valign===""&&e.closest("td")?.removeAttribute("valign")}function R0(e,t,n,r){const{settings:o,ctx:i}=n;i.wrapEditor(e,!0),i.textStyleProperties.some(s=>s in o)&&(i.addNewRange(t?N0(e,t):r()),i.toggleTextStyle(e,{settings:o}))}function fV(e,t){const n=dV(e),r="linkHref"in t.settings?x0(e):null;if("linkHref"in t.settings&&!r)return Ur("invalid-value","linkHref");R0(e,n,t,()=>N0(e,null)),r&&typeof t.settings.linkHref=="string"&&r.setAttribute("href",t.settings.linkHref),O0(e,t)}function mV(e,t){for(const n of e){R0(n,null,t,()=>{const o=document.createRange();return o.selectNode(n),o});const r="linkHref"in t.settings?x0(n):null;r&&typeof t.settings.linkHref=="string"&&r.setAttribute("href",t.settings.linkHref),O0(n,t)}}function hV(e,t,n){if(!t.length)return;const r=e.querySelector(`td.${co}, td.${Or}, td.${lo}`),o=(t.length===1&&r?[r]:t.map(i=>Ih(e,i))).map(uV).filter(i=>!!i);if(t.length===1&&o.length===1)return fV(o[0],n);mV(o,n)}var pV=["borderPosition","mobileBorderPosition","outlookBackground","exportAsPicture"],M0={...lV,...tV};function gV(e){if(!e||typeof e!="object"||!Object.keys(e).length)return Ur("empty");const t={live:[],cells:[],text:!1,forCells:!1};for(const[n,r]of Object.entries(e))if(M0[n])t.live.push([M0[n],r]);else if(T0[n])t.cells.push([T0[n],r]),t.forCells||(t.forCells=n.startsWith("cell"));else if(cV.includes(n))t.text=!0,t.forCells=!0;else if(!pV.includes(n))return Ur("unknown-setting",n);return t}function P0(){return document.querySelector(`.${lo}, .${Or}, .${co}`)}function bV(e){const t=e.activeElement??P0(),n=t?.closest(".em-element-custom-table");return t&&n?{table:n,activeElement:t}:null}function yV(e){const t=e.tagName==="TD"?e.querySelector("div"):e.tagName==="TR"?e.querySelector("editor div"):null;return t?.setAttribute("em-edit","active"),t??e}function vV(e,t){if(!e.querySelector(".remove-basic-cell"))return t.activeCell??[];document.querySelectorAll(`.${Or}`).forEach(r=>{r.classList.remove(Or)});const n=t.getCellsWithClasses(t.parseTableElementToModel(e),[lo,co]);return t.state.set("activeCell",n),n}function EV(e,t,n,r){const o=gV(t);if("rejected"in o)return o;const i=vV(e,r);if(o.forCells&&!i.length)return Ur("no-cell");const s=yV(n.activeElement);o.live.forEach(([c,u])=>c(e,u,{settings:t,ctx:r})),Tz(e);const a=o.text?hV(e,i,{settings:t,activeElement:s,ctx:r}):void 0;if(a)return a;let l=o.cells.reduce((c,[u,d])=>u(c,d,{ids:i,ctx:r}),r.parseTableElementToModel(e));return(/border-collapse:/.test(e.getAttribute("style")??"")||e.className.includes("em-mob-border_"))&&(l=r.removeOuterBorders(l)),l}function SV(e,t){[lo,co].forEach(r=>{document.querySelectorAll(`.${r}`).forEach(o=>o.classList.remove(r))});const n=e.querySelectorAll(`.${Rr}`);n[0]?.setAttribute("em-edit",""),n.forEach(r=>r.classList.remove(Rr)),ea(e,t,"around")}function wV(e,t){const n=bV(t);return n?b0(n.table,t,{edit:r=>EV(r,e,n,t),afterWrite:r=>SV(r,e)}):au(Ur("no-table"))}var _V=new Set(["alt","title","link"]);function CV(e,t,n){const r=Object.keys(n.settings??{});return n.type==="img"&&r.length>0&&r.every(o=>_V.has(o))&&e.parentNode===t.parent}function TV(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 AV(e,t,n,r,o){const i=o.getMappedParent(e);if(!i?.isConnected||CV(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=or(o.getOuterHtml(i),([m])=>(i.parentNode?.replaceChild(m,i),m));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:()=>{o.applyHidden(()=>c.querySelectorAll("section").forEach((m,h)=>{l[h]&&m.setAttribute("expanded","")}))}}}function kV(e,t){const{activeElement:n}=t;let r=!1;if(!e)return r;const o=n.closest("a"),i=n.closest("td"),s=i?Fr(i):null,a=o?Fr(o):null,l=!!s&&!a,c=_h(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"),g=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),g){const E=e.height.value+e.height.dim;g.style.height=E,g.style.lineHeight=E,g.firstElementChild&&(g.firstElementChild.style.lineHeight=E);const w=g.closest("editor")||g.querySelector("editor");w&&(w.style.height=E,w.style.lineHeight=E)}}else if(f&&(f.removeAttribute("height"),f.style.removeProperty("height")),g){g.style.removeProperty("height"),g.style.removeProperty("line-height");const E=g.closest("editor")||g.querySelector("editor");E&&(E.style.removeProperty("height"),E.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"),Dt(f,"background",NV(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=ia(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(g=>{g.style.removeProperty("color"),g.removeAttribute("color")})}if(m&&e.textBackgroundColor!==void 0){const f=String(e.textBackgroundColor||"");m.style.backgroundColor=f,m.querySelectorAll('span[style*="background-color"]').forEach(g=>{g.style.removeProperty("background-color")})}const h=["textColor","textBackgroundColor"];if(t.textStyleProperties.filter(f=>!h.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&&LV(e.textReplacer,n,t.compareStrings),e.outlookRounding===!0?Th(n,e):e.outlookRounding===!1?CF(n):(s||c)&&Th(n,e),i&&ea(i,e,"inside"),r}function LV(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(/~~.*$/,""),h=document.createElement("em-replace");h.setAttribute("text",m),o.surroundContents(h)}}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,h=>{const f=e,g=h.textContent||"";return f.length===1&&m.test(g)?!0:n(g,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 NV(e){return e.backgroundImage?.[0]?.value??""}function xV(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),ea(n,e,"inside"),r}function cp(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&&cp({elem:e.elem.previousSibling,width:e.width})}function OV(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"&&cp({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,cp({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+")",Dt(n,"background",RV(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),ea(n,e,"around"),r}function RV(e){return e.backgroundImage?.[0]?.value??""}function da(e){return!(!e.startsWith("#")||e.indexOf("#",1)!==-1)}function MV(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),da(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+")",Dt(n,"background",DV(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))&&IV(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&&(PV(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}),ea(n,e,"inside"),r}function PV(e,t,n){n.setElementMobileAlign({settings:e,elem:t});const r=e.mobileAlign?.classNamePrefix||"em-mob-text_align-";cz(t,(s,a)=>{uz(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 IV(e,t){const n=t.activeElement,r=t.removeEditorTags(pl(t.isElementListContainer)),o=t.addClassToSecondCell(r,"em-list-temp-class");Ai(n,n.tagName==="TR"?`<td em-edit="active">${o}</td>`:o);const i=window.getSelection();if(!i||i.rangeCount===0)return;let s=i.getRangeAt(0);const a=n.querySelectorAll(".em-list-temp-class");if(a.length>0){t.isProgrammaticSelection.value=!0;for(let l=0;l<a.length;l++){const c=a[l].querySelector("div");if(!c)continue;t.wrapEditor(c,!0),s=i.getRangeAt(0),s.selectNode(c),t.addNewRange(s);const u=c.innerHTML!==" "||c.innerHTML===" "&&(e.fontSize||e.textColor||e.lineHeight);if(t.textStyleProperties.some(d=>e.hasOwnProperty(d))&&u)try{t.toggleTextStyle(c,{settings:e})}catch{}}n.querySelectorAll(".em-list-temp-class").forEach(l=>l.classList.remove("em-list-temp-class")),n.removeAttribute("em-edit"),n.setAttribute("em-edit","active"),setTimeout(()=>{t.isProgrammaticSelection.value=!1},100),s=i.getRangeAt(0),s.selectNode(n),t.addNewRange(s)}}function DV(e){return e.backgroundImage?.[0]?.value??""}function up(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&&up({elem:e.elem.previousSibling,width:e.width})}function I0(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 BV(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,up({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,up({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,I0(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 dp(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&&dp({elem:e.elem.previousSibling,width:e.width})}function cu(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 uu(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 fp(e){return e.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement||null}function HV(e,t){const n=t.activeElement;if(cu(n)){const r=uu(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=fp(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",dp({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 FV(e,t){const n=t.activeElement;if(!cu(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>
|
|
93
|
+
<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>
|
|
94
|
+
<td width="${l}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`),c>=i&&u&&Jn(r,"beforeend",u)}))}function $V(e,t){const n=t.activeElement;if(cu(n)){const r=uu(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=fp(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach(o=>{o.style.verticalAlign=e.valign,I0(o,o.style.verticalAlign)})}}function WV(e,t){const n=t.activeElement;if(cu(n)){const r=uu(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=fp(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",dp({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 qV(e,t){const n=t.activeElement;let r=!1;const o=uu(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 mp="amp-img";function zV(e){const t=kC(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 D0(e){return e==null||e===""?null:Number(e)}function UV(e){return{src:e.src??"",alt:e.alt??"",title:e.title??"",width:D0(e.width?.value),height:D0(e.height?.value),link:e.link||null,imgReplacer:e.imgReplacer??""}}function hp(e,t,n){const r=e.closest(n);return r&&r!==t&&t.contains(r)?r:null}function jV(e,t){let n=e;for(;n.parentElement&&n.parentElement!==t;)n=n.parentElement;if(n.parentElement===t&&n.querySelectorAll(mp).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 B0(e){e.replaceWith(...Array.from(e.childNodes))}function H0(e,t){e.parentNode?.insertBefore(t,e),t.appendChild(e)}function VV(e,t,n,r){if(r.src!==n.src&&Dt(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=hp(e,t,"em-replace");if(!r.imgReplacer)o&&B0(o);else if(o)Dt(o,"src",r.imgReplacer);else{const i=document.createElement("em-replace");Dt(i,"src",r.imgReplacer),H0(e,i)}}if(r.link!==n.link){const o=hp(e,t,"a");if(!r.link)o&&B0(o);else if(o)o.setAttribute("href",r.link);else{const i=document.createElement("a");i.setAttribute("href",r.link),H0(hp(e,t,"em-replace")??e,i)}}}function GV(e){const t=document.createElement(mp);Dt(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");Dt(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 XV(e){return e.some(t=>t.slideIndex!==void 0)?e.map(t=>t.slideIndex):e.map((t,n)=>n)}function KV(e,t){const n=Array.from(e.querySelectorAll(mp)),r=new Set,o=[];XV(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),VV(a,e,zV(a),UV(t[s]))}),n.filter(i=>!r.has(i)).forEach(i=>jV(i,e).remove()),o.forEach(i=>e.appendChild(GV(i)))}function YV(e,t){const n=e,r=t.activeElement.closest("amp-carousel");r&&F0(r,t,o=>ZV(o,n,t))}function F0(e,t,n){or(t.HTMLDocument.getOuterHtml(e),([r])=>{r instanceof Element&&(n(r),r.setAttribute("em-edit","active"),e.replaceWith(r))}),t.commit(!0)}function ZV(e,t,n){typeof t.loop=="boolean"&&(t.loop?e.setAttribute("loop",""):e.removeAttribute("loop")),typeof t.autoplay=="boolean"&&(t.autoplay?e.setAttribute("autoplay",""):e.removeAttribute("autoplay")),Array.isArray(t.carouselImages)&&KV(e,t.carouselImages),"borderRadius"in t&&n.setElementBorderRadius({settings:{borderRadius:t.borderRadius},elem:e})}function QV(e,t){const n=e,r=t.activeElement.closest("amp-accordion");r&&F0(r,t,o=>JV(o,n))}function JV(e,t){t.animate?e.setAttribute("animate",""):e.removeAttribute("animate"),t.expandSingleSection?e.setAttribute("expand-single-section",""):e.removeAttribute("expand-single-section"),e.querySelectorAll("section").forEach((n,r)=>{t.sections[r]?.expanded?n.setAttribute("expanded",""):n.removeAttribute("expanded")})}var Vn={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function eG(e){return e.closest('table[em-type="social"]')}function $0(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 tG(e,t,n){const r=$0(e),o=$0(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 Gn(e){return String(e??"").replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}function nG(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function rG(){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 oG(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const n=rG();if(!n)return t;try{return new URL(t,n).href}catch{return t}}function iG(e){return e>0?`<td width="${e}"> </td>`:""}function sG(e,t){const n=eG(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:Vn.align,i=typeof e.iconSize=="number"?e.iconSize:Vn.iconSize,s=typeof e.borderRadius=="number"?e.borderRadius:Vn.borderRadius,a=typeof e.gap=="number"?e.gap:Vn.gap,l=typeof e.bgEnabled=="boolean"?e.bgEnabled:Vn.bgEnabled,c=typeof e.bgColor=="string"?e.bgColor:Vn.bgColor,u=typeof e.borderWidth=="number"?e.borderWidth:Vn.borderWidth,d=typeof e.borderColor=="string"?e.borderColor:Vn.borderColor;let m=typeof e.buttonBorderWidth=="number"&&!Number.isNaN(e.buttonBorderWidth)?e.buttonBorderWidth:Vn.buttonBorderWidth;m=Math.max(0,Math.min(24,Math.round(m)));const h=typeof e.showLabel=="boolean"?e.showLabel:Vn.showLabel,f=[];u>0&&d&&f.push(`border:${u}px solid ${Gn(d)}`);const g=f.length?` style="${f.join(";")}"`:"",E=!!(l&&String(c).trim()),w=Math.max(0,Math.round(Number(a)||0)),T=r.length>1,L=`<table border="0" cellspacing="0" cellpadding="0">
|
|
95
|
+
<tr>${r.map(v=>{const C=Gn(v.platform||"unknown"),b=!!v.customIcon,S=Gn(v.href||""),_=String(v.title??"").trim(),k=_?` title="${Gn(_)}"`:"",x=Gn(v.alt||""),N=Gn(oG(v.iconSrc||"")),W=v.iconWidth!=null&&!Number.isNaN(Number(v.iconWidth))?Number(v.iconWidth):i,O=v.iconHeight!=null&&!Number.isNaN(Number(v.iconHeight))?Number(v.iconHeight):i,P=b?"":typeof v.buttonBgColor=="string"?v.buttonBgColor.trim():"",Q=!b&&E&&!P?String(c).trim():"",te=b?"":P||Q,fe=!b&&!!Q,ne=b?"":typeof v.itemBorderColor=="string"?v.itemBorderColor.trim():"",Y=!b&&!!(P||ne&&m>0||fe);let be=`<a href="${S}" target="_blank"${k} draggable="false"><img src="${N}" width="${W}" height="${O}" border="0" alt="${x}" draggable="false" style="display:block;${!b&&!Y&&s>0?`border-radius:${s}px;`:""}" /></a>`;if(h&&(v.title||v.alt)){const re=nG(String(v.title||v.alt||""));be+=`<br/><span style="display:block;font-size:11px;line-height:1.2;margin-top:4px;max-width:96px;word-break:break-word;">${re}</span>`}const ce=[];te&&ce.push(`background-color:${Gn(te)}`),ne&&m>0&&ce.push(`border:${m}px solid ${Gn(ne)}`),Y&&s>0&&ce.push(`border-radius:${s}px`);const Se=fe?' em-tray-cell-bg="1"':"",st=b?' em-custom-icon="1"':"",J=te&&/^#[0-9A-Fa-f]{3,8}$/.test(te)?` bgcolor="${Gn(te)}"`:"",q=T?' draggable="true"':"";return`<td em-platform="${C}"${st}${Se}${J}${ce.length?` style="${ce.join(";")}"`:""}${q}>${be}</td>`}).filter(Boolean).reduce((v,C,b)=>(b>0&&v.push(iG(w)),v.push(C),v),[]).join("")}
|
|
96
|
+
</tr>
|
|
97
|
+
</table>`,y=`<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"${g}><tr><td align="${Gn(o)}">
|
|
98
|
+
${L}
|
|
99
|
+
</td></tr></table>`,p=Re(y,!0)[0];return p?(p instanceof HTMLTableElement&&tG(n,p,o),p.setAttribute("em-edit","active"),n.replaceWith(p),t.commit(!0),p):null}function aG(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 h=t.unwrapTag(d);r.selectNodeContents(h)}else{const h=t.splitWrapper(d,r);r.selectNodeContents(h),setTimeout(()=>n.removeAllRanges(),100)}else if(c){const h=t.splitWrapper(c,r);r.selectNodeContents(h)}if(m)if(r.collapsed){const h=r.cloneRange();try{r.expand("word");const f=r.toString().trim();if(f){const g=t.wrapInTag(r,f,a),E=document.createRange();E.selectNodeContents(g),n.removeAllRanges(),n.addRange(E),t.cleanEmptyTags(g.parentNode)}else r.setStart(h.startContainer,h.startOffset),r.setEnd(h.endContainer,h.endOffset)}catch{r.setStart(h.startContainer,h.startOffset),r.setEnd(h.endContainer,h.endOffset)}}else{const h=r.cloneContents(),f=document.createElement("div");f.appendChild(h),en(r.commonAncestorContainer,f),t.unwrapNestedTags(f,a);const g=t.wrapInTag(r,f,a),E=document.createRange();E.selectNodeContents(g),n.removeAllRanges(),n.addRange(E),t.cleanEmptyTags(g.parentNode)}}else if(r.collapsed)if(c){const m=c.parentNode,h=t.unwrapTag(c),f=document.createRange();f.selectNodeContents(h),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 h=t.unwrapTag(m),f=document.createRange();f.selectNodeContents(h),n.removeAllRanges(),n.addRange(f),t.cleanEmptyTags(m.parentNode)}}else{let m=[];const h=r.cloneContents(),f=document.createElement("div");if(f.appendChild(h),en(r.commonAncestorContainer,f),m=Array.from(f.querySelectorAll(a)),c){const w=Array.from(c.childNodes).some(y=>y.nodeType===1),T=t.unwrapTag(c),L=document.createRange();if(T.isConnected)L.selectNodeContents(T),n.removeAllRanges(),n.addRange(L);else{const y=c.parentNode;y&&(L.selectNodeContents(y),n.removeAllRanges(),n.addRange(L))}w&&t.applicationElementSettingsSet({elem:document.querySelector("[em-edit]")}),t.commit();return}else{const w=r.commonAncestorContainer.parentElement?.closest(a)||r.startContainer.parentElement?.closest(a);w&&m.push(w)}m.length>0&&m.forEach(w=>{w.parentNode&&t.unwrapTag(w)});const g=f.cloneNode(!0);en(f,g);const E=g.querySelector('[em-edit="active"]');if(E){r.deleteContents(),r.insertNode(E);const w=document.createRange();w.selectNodeContents(E),n.removeAllRanges(),n.addRange(w),t.cleanEmptyTags(E.parentNode)}}t.commit()}typeof e.textSuperscript=="boolean"&&s("sup",e.textSuperscript),typeof e.textSubscript=="boolean"&&s("sub",e.textSubscript)}function lG(e,t){if(e!==void 0){if(e===""){cG(t.activeElement);return}uG(e,t)}}function cG(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 uG(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 h=e,f=m.textContent||"";return h.length===1&&d.test(f)?!0:t.compareStrings(f,h)}),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 dG(e){return e.trim().replace(/\s+/g,"_").replace(/[^\p{L}\p{N}\-_:.]/gu,"")}function W0(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 fG(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 mG(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function hG(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=W0(r)),i||(i=t.activeElement?.closest?.("a[name]")),i){const s=i.firstChild,a=i.lastChild;mG(i),t.commit(),fG(s,a)}return}const o=dG(e);if(o&&!(!n||!r||r.collapsed))try{const i=W0(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{}}var Oe=e=>Al(e?.innerText);function pG(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 gG(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 bG=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,yG=/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)$/i,pp=e=>e.toString(16).padStart(2,"0");function vG(e){const t=yG.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`#${pp(n)}${pp(r)}${pp(o)}`}function q0(e){return e.split("").map(t=>`${t}${t}`).join("")}function Xn(e,t){if(!e)return;const n=e.trim();if(!n)return;if(bG.test(n)){const o=n.slice(1);return o.length===3?`#${q0(o).toLowerCase()}`:o.length===4?`#${q0(o.slice(0,3)).toLowerCase()}`:o.length===8?`#${o.slice(0,6).toLowerCase()}`:`#${o.toLowerCase()}`}const r=vG(n);if(r)return r;if(t){const o=t(n);if(o&&o!==n)return Xn(o)}}function EG(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function gp(e,t,n){const r=t.parentElement;let o=e.parentElement;for(;o&&o!==r;){const i=Xn(o.style.color,n);if(i)return i;o=o.parentElement}}function SG(e,t){Array.from(e.querySelectorAll("span")).reverse().forEach(n=>{if(!n.style.color)return;const r=Xn(n.style.color,t);if(!r)return;const o=gp(n,e,t);!o||o!==r||(n.style.removeProperty("color"),n.getAttribute("style")||n.removeAttribute("style"),n.attributes.length===0&&EG(n))})}function wG(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 _G(e,t,n){const r=Xn(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=wG(i);if(!s.length||s.every(c=>{const u=c.parentElement;return u?Xn(u.style.color,n)===r?!0:gp(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 CG(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=Xn(o.style.color,t);if(!i)return;const s=gp(o,e,t)||(n?Xn(n,t):void 0);s&&Array.from(o.querySelectorAll("span")).forEach(a=>{if(!a.style.color)return;const l=Xn(a.style.color,t);l&&l!==i&&l===s&&(a.style.color=o.style.color)})})}function TG(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 AG(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"&&Lc(t,e.fontFamilyArray[2]),e.removeClassesByPrefix(t,"em-font"),t.classList.add(e.createFontClassName(e.fontFamilyArray)),mh(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 kG(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=>{const r=n.parentElement??n;Ce(n,e.removeFormattingTags(ze(n),"bold")),nn(n),n.tagName!=="STRONG"?e.currentSettings.value&&Ce(n,"<strong>"+ze(n)+"</strong>"):e.currentSettings.value||qi(n,ze(n)),nn(r)})}if(e.currentSettings.value===!0)Array.from(e.parentNode?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");if(zt(n,t),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");zt(n,t),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 LG(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=>{const r=n.parentElement??n;Ce(n,e.removeFormattingTags(ze(n),"italic")),nn(n),n.tagName!=="EM"?e.currentSettings.value&&Ce(n,"<em>"+ze(n)+"</em>"):e.currentSettings.value||qi(n,ze(n)),nn(r)})}if(e.currentSettings.value)Array.from(e.parentNode?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");if(zt(n,t),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");zt(n,t),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 NG(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=""),sr("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");zt(i,t.parentElement),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");zt(s,i);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");zt(d,u),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");zt(u,i),u.style.fontSize=a,i.parentNode.replaceChild(u,i)}if(!c.length&&i.tagName==="FONT"){const u=document.createElement("span");zt(u,i),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 xG(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=>{const s=i.parentElement??i;Ce(i,e.removeFormattingTags(ze(i),"strike")),nn(i),i.tagName!=="STRIKE"?e.currentSettings.value&&Ce(i,"<strike>"+ze(i)+"</strike>"):e.currentSettings.value||qi(i,ze(i)),nn(s)})}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"&&ju(i.parentNode),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=>{ju(l)}),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=""),Ce(t.parentWrapper,e.removeFormattingTags(ze(t.parentWrapper),"strikeUnderline")),nn(t.parentWrapper),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 OG(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=>{const s=i.parentElement??i;Ce(i,e.removeFormattingTags(ze(i),"underline")),nn(i),i.tagName!=="U"?e.currentSettings.value&&Ce(i,"<u>"+ze(i)+"</u>"):e.currentSettings.value||qi(i,ze(i)),nn(s)})}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 RG(e){if(!e.isColorChange)return;const{mutableState:t}=e;let n=[];if(e.tempColor&&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");e.request.type==="button"||a?a&&(a.style.color=s,a.querySelectorAll('span[style*="color"]').forEach(l=>l.style.color="")):(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)),t.parentWrapper.querySelectorAll(":not(a)").forEach(l=>{l.style.color&&e.getInnerText(l)===e.selectedText&&(l.style.color="")}))}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");zt(a,s);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 h=document.createElement("span");zt(h,m),h.style[e.stylePropretyName]=c,m.parentNode?.replaceChild(h,m),e.refreshElementSettings(h,e.selectedText),t.range.selectNode(h),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");zt(m,s),m.style[e.stylePropretyName]=c;const h=s.closest("a");h&&h.innerText===s.innerHTML&&(h.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&&(CG(i,e.rgbToHex,e.outerContextColor||e.tempColor),SG(i,e.rgbToHex)),i&&e.cleanEmptySpans(e.selectedText,i)}function MG(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 z0(e,t){const n=e.style.color?.trim();if(!n)return null;const r=Xn(n),o=Xn(t??"");return!r||r===o?null:n}function PG(e){if(e.currentSettings.name!=="textLink")return;const{mutableState:t}=e;let n=t.parentNode.closest('a[href=" "]')||t.parentNode.querySelector('a[href=" "]')||e.parentElement?.querySelector('a[href=" "]')||null;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=ze(n),l=n?.parentNode;l&&(Ce(l,a),nn(l)),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=MG(n)?"div":"span",o=document.createElement(r);if(zt(o,n),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=z0(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=z0(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 bp='[class*="em-mob-font_size"]',IG=`${bp}, [style*="font-size"]`,DG="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub",BG=new Set(["SPAN","STRONG","B","EM","I","U","S","STRIKE","FONT","SUP","SUB","A"]);function HG(e,t,n){const{classNamePrefix:r,value:o}=t.mobileFontSize,i=o!=null?`${r}${o}px`:null,s=e.closest(DG)||e;s.querySelectorAll(".em-element-path").forEach(d=>d.remove());const a=FG(s,i!==null);if(!a||Oe(s)===Ye()){n({settings:t,elem:s.closest("editor")?s:s.closest(IG)||s}),yp(s,r,i);return}const l=$G(s,a);if(i===null){(l?[l]:Array.from(s.querySelectorAll(bp)).filter(d=>a.intersectsNode(d))).forEach(d=>{yp(d,r,null),U0(d,r)});return}const c=l||kv(a,a.extractContents(),"span");if(!c)return;WG(c),n({settings:t,elem:c}),yp(c,r,i);const u=document.createRange();u.selectNodeContents(c),jo(u)}function FG(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(bp);if(!i||i===e||!e.contains(i))return null;const s=document.createRange();return s.selectNodeContents(i),jo(s),s}gG(n,jo);const o=n.rangeCount?n.getRangeAt(0):null;return o&&!o.collapsed?o:null}function $G(e,t){const n=Ye(),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 yp(e,t,n){e.querySelectorAll("*").forEach(r=>{n&&r.style.fontSize?(Nc(r,t),r.classList.add(n)):r.getAttribute("class")?.includes(t)&&U0(r,t)})}function U0(e,t){Nc(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 WG(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"));BG.has(n.tagName)&&!r&&!n.querySelector("img, br, hr, table, video, iframe")&&n.remove()})}function qG(e,t){let n=!1;const{activeElement:r}=t;if(typeof e.linkHref=="string"&&UG(e.linkHref,t),t.textStyleProperties.some(o=>e.hasOwnProperty(o)))try{t.toggleTextStyle(r,{settings:e})}catch{}if(e.mobileFontSize&&(HG(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&&jG(e.textAlign,r),e.mobileTextAlign&&(VG(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"))&&zG(e,r),t.isElementList&&XG(e,t),n}function zG(e,t){const n=XU.includes(t.tagName)?t:t.closest(KU);if(!n)return;const r=e.listOL!==void 0;(r?e.listOL:e.listUL)?ij(n,r):cj(n)}function UG(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),da(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 jG(e,t){const n=ia(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 VG(e,t,n){const r=ia(t);if(!r)return;const o=e.mobileTextAlign?.classNamePrefix||"em-mob-text_align-";az(t,r,o),n.setElementMobileAlign({settings:e,elem:r,fieldName:"mobileTextAlign"})}function GG(e,t){const n=c=>c in e,{SpacingBetweenParagraphs:r,SpacingBetweenBulletsAndText:o,BulletType:i}=e,{ColorBullets:s,BulletsSize:a,BulletsFontFamily:l=null}=e;return[!!r&&(c=>t.updateTableStyle(c,"padding-bottom",r)),!!o&&(c=>t.updateTableStyle(c,"padding-left",o)),!!i&&(c=>t.changeBullets(c,i)),!!s&&(c=>t.changeBulletsColor(c,s)),!!a&&(c=>t.changeBulletsSize(c,a)),n("BulletTextItalic")&&(c=>t.changeBulletsItalic(c,!!e.BulletTextItalic)),n("BulletTextStrong")&&(c=>t.changeBulletsWeight(c,!!e.BulletTextStrong)),n("BulletTextStrikethrough")&&(c=>t.changeBulletsStrikethrough(c,!!e.BulletTextStrikethrough)),n("BulletTextUnderline")&&(c=>t.changeBulletsUnderline(c,!!e.BulletTextUnderline)),n("BulletsFontFamily")&&t.isElementListOL&&(c=>KG(l,c,t))].filter(c=>!!c)}function XG(e,t){const{activeElement:n,classNameOl:r,classNameUl:o}=t,i=n.closest(`table.${r}`)||n.closest(`table.${o}`);if(!i)return;const s=GG(e,t);if(s.length){const l=t.removeEditorTags(pl(i));ca(i,s.reduce((c,u)=>u(c),l))}let a=t.findElementWithSelectedText(n.textContent||"",i);a===null&&(a=i),a.hasAttribute("em-edit")||a.setAttribute("em-edit","active"),t.commit()}function KG(e,t,n){const r=document.createElement("div");Ce(r,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"&&Lc(s,e[2]),n.removeClassesByPrefix(s,"em-font"),s.classList.add(n.createFontClassName(e)),mh(s,e),n.addFontFamilyClass({fontFamilyArray:e})):s.style.removeProperty("font-family"))}),Xe(r)):t}var du=null;function j0(e){du=e}function V0(){return du}function pr(){du=null}function YG(){return du?.kind==="atom"}function vp(e,t,n,r){fs(e,t,o=>{const i=document.createElement("table");i.replaceChildren(...o),[...i.querySelectorAll(":scope > tr")].reverse().forEach(s=>n.insertAdjacentElement(r,s))})}function G0(e,t){e.replaceChildren(...t),e.querySelectorAll('tr[em="block"]').forEach(n=>n.removeAttribute("em"))}function Ep(e,t,n,r,o){fs(e,n,i=>{G0(t,i),r.insertAdjacentElement(o,t)})}var ZG=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"],QG=["em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"],JG=["em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function X0(){document.querySelectorAll(".em-block-insert").forEach(e=>{e.classList.remove(...ZG)})}function eX(){document.querySelectorAll(".em-atom-insert").forEach(e=>{e.classList.remove(...QG)})}function fu(){document.querySelectorAll(".em-blockatom-insert").forEach(e=>{e.classList.remove(...JG)})}function Sp(e,t){const n=e.getBoundingClientRect();return t>n.top+n.height/2?"bottom":"top"}function K0(e,t){const n=e.getBoundingClientRect(),r=document.body.getBoundingClientRect();return t==="bottom"?n.bottom>r.height-21:n.top<2}function wp(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=K0(e,"bottom")?`${r}_bottom-document`:`${r}_bottom`;e.classList.add(i)}else{e.classList.remove(`${r}_bottom`,`${r}_bottom-document`);const i=K0(e,"top")?`${r}_top-document`:`${r}_top`;e.classList.add(i)}}function mu(e){return e.tagName==="TABLE"||e.tagName==="TR"?e.querySelector("[data-template-content]")??e.querySelector("td"):e}function Y0(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 tX(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 nX(e){const t=Y0(e.dataTransfer?.files??null);return t||tX(e.dataTransfer??null)}function _p(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 fa(e){const t=e.dataTransfer?.types;return!!t&&Array.from(t).includes("Files")}function Cp(e){if(!fa(e))return!1;const t=e.dataTransfer;if(!t)return!1;if(t.files?.length)return!!Y0(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 Z0="em-native-img-drop-target",Tp="em-native-img-uploading",rX="em-native-img-drop-loading",hu="em-native-file-drag",ma=null,po=null;function Q0(){po&&(window.removeEventListener("scroll",po.reposition,!0),window.removeEventListener("resize",po.reposition),po.resizeObserver?.disconnect(),po.overlay.remove(),po=null)}function oX(e){Q0();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)),po={overlay:t,reposition:r,resizeObserver:o}}function Ap(){ma&&(ma.classList.remove(Z0),ma=null)}function go(){Ie(document.body,!1,hu),Ap()}function iX(e){if(!fa(e)){go();return}if(!Cp(e)){go();return}Ie(document.body,!0,hu);const t=_p(e);if(!t){Ap();return}ma!==t&&(Ap(),ma=t,t.classList.add(Z0))}function J0(){Q0(),Ie(document.body,!1,rX,hu),document.querySelectorAll(`.${Tp}`).forEach(e=>{e.classList.remove(Tp)})}function sX(e,t){if(t.lockEditor||!fa(e))return!1;const n=nX(e);if(!n)return!1;const r=_p(e);return r?(t.applicationElementSettingsSet({elem:r}),go(),r.classList.add(Tp),oX(r),t.messageService.send({operation:Ae.APPLICATION_NATIVE_IMAGE_DROP,file:n}),!0):!1}function aX(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"&&(Ie(document.body,!0,"em-atom-insert-body-inside"),t.commit(!1),t.mutableState.atomReplaced=n)}function lX(e,t){t.lockEditor||(go(),e.preventDefault(),t.messageService.send({operation:"application_scroll-block-hide"}))}function cX(e,t){if(e.preventDefault(),t.lockEditor){go();return}fa(e)?(Cp(e)&&_p(e)&&(e.dataTransfer.dropEffect="copy"),iX(e)):go();const n=e.target;if(document.body.classList.contains("em-block-insert-body")){const r=_n(n)?null:n.closest('[em="block"]');if(r){t.mutableState.targetBlock=r;const o=mu(r);o&&wp(o,Sp(o,e.pageY),"block")}else X0()}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,wp(r,Sp(r,e.pageY),"atom"),fu();else if(n.closest('[em="block"]')&&n.tagName==="TD"&&!n.innerHTML&&!n.hasAttribute("height")||n.tagName==="DIV"&&n.closest("amp-accordion")&&!n.innerHTML)fu();else{const o=n.closest('[em="block"]');if(o){t.mutableState.targetBlock=o;const i=mu(o);i&&(wp(i,Sp(i,e.pageY),"blockatom"),eX())}}}}function uX(e,t){if(t.lockEditor)return;fa(e)&&Cp(e)&&Ie(document.body,!0,hu);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"]');_n(n)?(n.classList.add("em-block-insert-empty"),X0()):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"]');_n(n)?(n.classList.add("em-block-insert-empty"),fu()):o?t.mutableState.targetBlock=o:fu()}}var dX=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function fX(e){return e.clientX<=0||e.clientY<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight}function mX(e,t){if(t.lockEditor)return;const n=e.target;if(document.body.classList.contains("em-block-insert-body")){if(fX(e)){document.querySelectorAll(".em-block-insert").forEach(i=>i.classList.remove(...dX)),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 hX(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+`
|
|
100
|
+
`+[...i.querySelectorAll("style")].map(a=>a.innerHTML).join(`
|
|
101
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;s=n.cssbeautify(s,{indent:" ",autosemicolon:!0}),r&&(r.textContent=`
|
|
102
|
+
`+s+`
|
|
103
|
+
`)}function pX(e){for(const t of e.reverse())document.head?.prepend(t),document.head?.insertAdjacentHTML("afterbegin",`
|
|
104
|
+
`)}function gX(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 eT(){pr(),go(),Ie(document.body,!1,"em-block-insert-body"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>{e.classList.remove("em-block-insert-empty")}),Ie(document.body,!1,"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 tT(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(hX(s,n.emailWidth,{minify:n.minify,cssbeautify:n.cssbeautify,HTMLDocument:n.HTMLDocument}),pX(a),t.settings.type!=="project"&&(i=n.commonStylesApplyToBlock({html:i})),i.match(/class="em-countdown"/gi)&&(i=n.uptimeCountdown({blockHTML:i})),n.isTableElement(r)&&_n(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"?ir("new",hr(r),"beforeend",`
|
|
105
|
+
`+i+`
|
|
106
|
+
`):ir("new",hr(r),"beforeend",`
|
|
107
|
+
<tr><td align="center">
|
|
108
|
+
`+i+`
|
|
109
|
+
</td></tr>
|
|
110
|
+
`),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),pr());else if(r.tagName==="BODY"){const l=jC();if(!l)return;const 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"}),vp("new",`
|
|
111
|
+
`+i+`
|
|
112
|
+
`,l,c),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),pr())}else{const l=r.closest('[em="block"]');if(l){const c=mu(l),u=c?gX(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")i.substring(0,3)==="<tr"?vp("new",`
|
|
113
|
+
`+i+`
|
|
114
|
+
`,l,u):vp("new",`
|
|
115
|
+
<tr em="block"><td align="center">
|
|
116
|
+
`+i+`
|
|
117
|
+
</td></tr>
|
|
118
|
+
`,l,u);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"),Ep("new",d,`
|
|
119
|
+
`+i+`
|
|
120
|
+
`,l,u)}else{const d=document.createElement("div");d.setAttribute("align","center"),d.setAttribute("em","block"),Ep("new",d,`<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
121
|
+
`+i+`
|
|
122
|
+
</table>`,l,u)}else ir("new",l,u,`
|
|
123
|
+
`+i+`
|
|
124
|
+
`);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}),pr())}}}var kp="em-live-atom";function pu(e,t){return t?`<${kp}></${kp}>`:e}function bX(e,t){const[n,...r]=document.querySelectorAll(kp);if(r.forEach(i=>i.remove()),!n||e.contains(n)){n?.remove();return}const o=e.parentElement;ef(e),n.replaceWith(e),o&&e.parentElement&&t(e,o,e.parentElement)}function nT(e,t=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>'?`
|
|
125
|
+
<tr em="block" class="em-structure">
|
|
126
|
+
<td align="center">
|
|
127
|
+
${t}
|
|
128
|
+
</td>
|
|
129
|
+
</tr>`:`
|
|
130
|
+
<style>
|
|
131
|
+
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
132
|
+
.em-mob-wrap {
|
|
133
|
+
display: block!important;
|
|
134
|
+
}
|
|
135
|
+
.em-mob-width-100perc {
|
|
136
|
+
width: 100%!important;
|
|
137
|
+
max-width: 100%!important;
|
|
138
|
+
}
|
|
139
|
+
.em-mob-padding_right-20 {
|
|
140
|
+
padding-right: 20px!important;
|
|
141
|
+
}
|
|
142
|
+
.em-mob-padding_left-20 {
|
|
143
|
+
padding-left: 20px!important;
|
|
144
|
+
}
|
|
145
|
+
</style>
|
|
146
|
+
<tr em="block" class="em-structure">
|
|
147
|
+
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
148
|
+
<table align="center" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
149
|
+
<tr>
|
|
150
|
+
<td width="600" valign="top" class="em-mob-wrap em-mob-width-100perc">
|
|
151
|
+
${t}
|
|
152
|
+
</td>
|
|
153
|
+
</tr>
|
|
154
|
+
</table>
|
|
155
|
+
</td>
|
|
156
|
+
</tr>`}function yX(e,t,n,r,o,i,s){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}):ir(i,e,"beforeend",`
|
|
157
|
+
`+pu(t,s)+`
|
|
158
|
+
`),n!=null&&!s&&(e.closest(".empty-structure")||e.closest(".em-structure"))&&n.remove(),r.settings?.name&&(o.messageService.send("application_atom_inserted",r.settings.name),pr())}function vX(e,t,n,r,o,i,s){const a=e.target,l=!!document.querySelector(".em-blockatom-insert"),c=l?a.closest('[em="block"]'):a,u=l?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:u}));let d=nT(t,pu(t,s));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(d.match(/<style((.|\n|\r)*?)<\/style>/g)),n.settings?.type!=="project"&&(d=r.commonStylesApplyToBlock({html:d}));let m=null;c.tagName==="TABLE"||c.tagName==="TR"?m=c.querySelector("[data-template-content]")??c.querySelector("td"):m=c,(d.indexOf("empty-structure")>-1||d.indexOf("em-structure")>-1)&&(d=r.setFloatBlocksWidth({blockHTML:d,targetBlock:c,project:n.settings?.project}),d=r.fitImagesToColumns(d));let h="beforeend";l&&m&&(m.classList.contains("em-block-insert_bottom-document")||m.classList.contains("em-block-insert_bottom")?h="afterend":(m.classList.contains("em-block-insert_top-document")||m.classList.contains("em-block-insert_top"))&&(h="beforebegin"));const f=!!t.match(/class="em-countdown"/gi),g=d.substring(0,3)==="<tr";if(c.tagName==="TR")if(g)if(f)r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:d});else{const E=document.createElement("tr");E.setAttribute("em","block"),E.classList.add("em-structure"),fs(i,`
|
|
159
|
+
`+d+`
|
|
160
|
+
`,w=>{E.replaceChildren(...w.flatMap(T=>T instanceof Element&&T.tagName==="TR"?Array.from(T.childNodes):[T])),c.insertAdjacentElement(h,E)})}else if(f)r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:`<tr em="block"><td align="center">
|
|
161
|
+
`+d+`
|
|
162
|
+
</td></tr>`});else{const E=document.createElement("tr");E.setAttribute("em","block"),fs(i,`
|
|
163
|
+
<td align="center">
|
|
164
|
+
`+d+`
|
|
165
|
+
</td>
|
|
166
|
+
`,w=>{E.replaceChildren(...w),c.insertAdjacentElement(h,E)})}else if(g)if(c.tagName==="TABLE")if(_n(a))f?r.insertCountdown({targetElem:h==="beforeend"?hr(c):c,targetPlace:h,atomHTML:d}):ir(i,h==="beforeend"?hr(c):c,h,d);else{const E=document.createElement("table");E.setAttribute("cellspacing","0"),E.setAttribute("cellpadding","0"),E.setAttribute("align","center"),E.setAttribute("border","0"),E.setAttribute("em","block"),E.setAttribute("width",c.hasAttribute("width")?c.getAttribute("width"):String(c.getBoundingClientRect().width)),E.classList.add("em-mob-width-100perc"),f?(G0(E,Re(`
|
|
167
|
+
`+d+`
|
|
168
|
+
`,!0)),r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:r.getOuterHtml(E)})):Ep(i,E,`
|
|
169
|
+
`+d+`
|
|
170
|
+
`,c,h)}else f?r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:`<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
171
|
+
`+d+`
|
|
172
|
+
</table></div>`}):ir(i,c,h,`
|
|
173
|
+
<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
174
|
+
`+d+`
|
|
175
|
+
</table></div>
|
|
176
|
+
`);else f?r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:d}):ir(i,c,h,`
|
|
177
|
+
`+d+`
|
|
178
|
+
`);document.querySelectorAll(".em-blockatom-insert").forEach(E=>{E.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),pr())}function EX(e,t,n,r,o){const i=document.querySelector(".em-atom-insert");if(e.match(/em="atom"><tr><td>\s*<img/gi)&&i&&(e=n.setImageWidth({atomHTML:e,targetAtom:i})),!i)return;let s="afterend";i.classList.contains("em-atom-insert_bottom-document")||i.classList.contains("em-atom-insert_bottom")?s="afterend":(i.classList.contains("em-atom-insert_top-document")||i.classList.contains("em-atom-insert_top"))&&(s="beforebegin");const a=!!e.match(/class="em-countdown"/gi);if(i.tagName==="TR"){const l=document.createElement("div");Ck(l,e);const c=l.querySelector('[em="atom"]');c&&c.removeAttribute("em");let u=0;const d=i.querySelector("[colspan]");d?u=d.getAttribute("colspan")||0:u=i.childElementCount,o?.removeAttribute("em");const m=o?pu(e,o):Tt(l),h=`
|
|
179
|
+
<tr em="atom"><td colspan="`+u+`">
|
|
180
|
+
`+m+`
|
|
181
|
+
</td></tr>
|
|
182
|
+
`;a?n.insertCountdown({targetElem:i,targetPlace:s,atomHTML:h}):ir(r,i,s,h)}else a?n.insertCountdown({targetElem:i,targetPlace:s,atomHTML:e}):ir(r,i,s,`
|
|
183
|
+
`+pu(e,o)+`
|
|
184
|
+
`);i.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),pr())}function rT(e,t){const n=t.mutableState.atomReplaced,r=e.dataTransfer?.getData("Text")||"",o=r&&t.isJsonString(r)?"new":"moved",i=o==="new"?JSON.parse(r):{settings:{atomHTML:n?ds(n):""}},s=o==="moved"?i.settings.atomHTML:"",a=n&&s&&!s.match(/class="em-countdown"/gi)?n:null;try{SX(e,t,o,i,a)}finally{a&&bX(a,t.fitMovedImage)}}function SX(e,t,n,r,o){const i=t.mutableState.atomReplaced,s=e.target,a=d=>t._setDocumentStyles(d,{minify:t.minify,cssbeautify:t.cssbeautify,HTMLDocument:t.HTMLDocument});if(!r.settings?.atomHTML)return;let l=r.settings.atomHTML.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();o||a(r.settings.atomHTML.match(/<style((.|\n|\r)*?)<\/style>/g)),l=t.commonStylesApply({html:l});const c=s.closest('[em="block"]')&&s.tagName==="TD"&&!s.innerHTML&&!s.hasAttribute("height")&&(s.classList.contains("em-atom-insert-empty")||YG()),u=s.tagName==="DIV"&&s.closest("amp-accordion")&&!s.innerHTML;if(c||u){yX(s,l,i,r,t,n,o);return}if(document.querySelector(".em-blockatom-insert")||_n(s)){vX(e,l,r,t,a,n,o);return}s.closest('[em="atom"]')&&EX(l,r,t,n,o)}var wX=/^[\t\n\f\r ]*$/;function _X(e,t){const n=[...e.childNodes],r=n.every(o=>o===t||o.nodeType===Node.TEXT_NODE&&wX.test(o.textContent??""));e.replaceWith(...r?[t]:n)}function CX(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&&(_X(i,o),t.setCursorPosition(o))}}if(e.src!==void 0&&Lb(r)&&Dt(r,"src",e.src??""),e.src!==void 0&&J0(),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,Dt(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)Dt(i,"src",o);else{const s=document.createElement("em-replace");Dt(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 TX(e,t){const{activeElement:n,textStyleProperties:r,toggleTextStyle:o}=t;if(e.href!==void 0&&(n.setAttribute("href",e.href),da(e.href)&&n.removeAttribute("target")),e.target&&!(e.href&&da(e.href))&&n.setAttribute("target",e.target),r.some(i=>e.hasOwnProperty(i)))try{o(n,{settings:e})}catch{}}function AX(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 kX(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 LX(e){const t=e.settings.textReplacer;return typeof t=="string"&&t.includes("~~")}var ha=["textStrong","textItalic","textStrikethrough","textUnderline","textColor","textBackgroundColor","textLink","lineHeight","fontSize","fontFamily"];function NX(e){const t=u=>{e.commit(u)},n={addFontFamilyClass:u=>ta(u,t),clearLinkTags:u=>{ho(u,t),$r(t)}},r={setElementMobileWidth:cC,setElementMobileHeight:_i,setElementMobileBorder:xq,setElementMobileBorderRadius:Oq,setElementMobileBoxShadow:Rq,setElementMobileAlign:uC,setElementMobileTableAlign:Mq,setElementMobileVerticalAlign:dC,setElementMobileDirection:Pq,setElementMobileBackgroundColor:Iq,setElementMobileBackgroundImage:Dq,setElementMobileBackgroundPositionX:Bq,setElementMobileBackgroundPositionY:Hq,setElementMobileBackgroundRepeat:Fq,setElementMobileBackgroundSize:$q,setElementMobilePadding:oa,setElementMobileFontSize:fC,setElementMobileLineHeight:mC,setElementShow:hC},o={parseTableElementToModel:Ei,tableModelToHtml:Y_,updateTablePadding:Sq,getCellsWithClasses:uq,clearCellBorders:hq,updateTableCellBackgroundByIds:_q,addClassToCellsByIds:dq,getExternalBorders:pq,updateCellBordersByIds:mq,getExternalCorners:vq,updateCellBorderRadiusByIds:bq,updateCellPaddingByIds:wq,removeOuterBorders:gq},i=e.editLock??tf,s=u=>({activeElement:u,activeCell:U.get("activeCell"),state:U,...o,wrapEditor:e.wrapEditor,addNewRange:jo,toggleTextStyle:e.toggleTextStyle,textStyleProperties:ha,isEditLocked:()=>i.isTextLocked(),...r}),a=(u,d)=>{const m=()=>{const f=d??P0();f&&e.selectionLock.lift(()=>e.applicationElementSettingsSet({elem:f}))};let h;try{h=wV(u,s(d))}catch(f){throw m(),f}if(h.status==="applied")return!0;if(h.reason!=="empty"&&m(),h.reason!=="locked")throw new Error(`customTable: refused "${h.key??""}" (${h.reason})`);return!1},l=(u,d)=>{const{settings:m}=u,h=iu(d),f={setElementBorder:ph,setElementBoxShadow:f_,setElementBorderRadius:yi},g={activeElement:d,setPercentsForColumns:vf,setElementMobileHeight:_i};switch(u.type){case"img":case"countdown":case"video":CX(m,{activeElement:d,getActiveEditElement:Ef,setCursorPosition:e.setCursorPosition,...f,...r});break;case"a":TX(m,{activeElement:d,textStyleProperties:ha,toggleTextStyle:e.toggleTextStyle});break;case"table":OV(m,{activeElement:d,...f,...r});break;case"td":case"structure":case"group":case"column":MV(m,{activeElement:d,requestType:u.type,textStyleProperties:ha,isElementListContainer:_j(d),isProgrammaticSelection:e.programmaticSelection,...f,...r,setContrastBlock:Wq,setStructureBlocksWidth:su,toggleTextStyle:e.toggleTextStyle,removeEditorTags:ki,addClassToSecondCell:jU,wrapEditor:e.wrapEditor,addNewRange:jo});break;case"button":kV(m,{activeElement:d,textStyleProperties:ha,...f,...r,toggleTextStyle:e.toggleTextStyle,compareStrings:Bv});break;case"div":xV(m,{activeElement:d,...f,...r});break;case"vindent":AX(m,{activeElement:d,setElementMobileHeight:_i});break;case"var":kX(m,{activeElement:d,isVariableText:Qw});break;case"floatBlock":BV(m,{activeElement:d,setElementMobileWidth:cC,setElementMobileContentWidth:Nq,setElementMobileVerticalAlign:dC,setElementShow:hC});break;case"text":qG(m,{activeElement:d,textStyleProperties:ha,toggleTextStyle:e.toggleTextStyle,collectVMLContent:m_,updateVMLComments:h_,removeClassesByPrefix:Ys,createFontClassName:dh,...n,handleTextScriptSettings:aG,handleTextReplacer:lG,handleTextAnchor:hG,unwrapNestedTags:MM,wrapInTag:kv,unwrapTag:PM,isRangeMatching:IM,splitWrapper:DM,cleanEmptyTags:BM,applicationElementSettingsSet:e.applicationElementSettingsSet,compareStrings:Bv,setElementMobileFontSize:fC,setElementMobileLineHeight:mC,setElementMobileAlign:uC,updateTableStyle:CU,changeBullets:TU,changeBulletsColor:AU,changeBulletsSize:kU,changeBulletsItalic:NU,changeBulletsWeight:LU,changeBulletsStrikethrough:OU,changeBulletsUnderline:xU,findElementWithSelectedText:bs,removeEditorTags:ki,isElementList:h.isList,isElementListOL:h.isListOL,classNameOl:h.classNameOl,classNameUl:h.classNameUl,commit:t});break;case"floatBlocksWidths":HV(m,g);break;case"floatBlocksPreset":FV(m,g);break;case"floatBlocksValign":$V(m,g);break;case"floatBlocksGap":WV(m,g);break;case"floatBlocksGapMobile":qV(m,g);break;case"carousel":YV(m,{activeElement:d,HTMLDocument:e.htmlDocument,setElementBorderRadius:yi,commit:t});break;case"accordion":QV(m,{activeElement:d,HTMLDocument:e.htmlDocument,setElementBorderRadius:yi,commit:t});break;case"social":{const E=sG(m,{activeElement:d,commit:t});if(E)return E;break}case"customTable":return a(m,d)?d:null}return d},c=(u,d,m,h)=>{const f=e.selectionLock.acquire(),g=u;let E=u;e.commitLockedAsync().finally(()=>{let w;try{w=AV(E,g,d,m,{getMappedParent:T=>e.htmlDocument.getMappedParent(T)??void 0,getOuterHtml:T=>e.htmlDocument.getOuterHtml(T),applyHidden:T=>e.htmlDocument.applyHidden(T)})}catch(T){throw f.release(),T}if(!w){f.release(),e.setCursorPosition(E),h?.();return}E=w.active,e.commitLockedAsync().finally(()=>{try{w.afterCommit()}finally{f.release()}e.setCursorPosition(E),h?.()})})};return u=>{const d=e.selectionLock.acquire();try{const m=u.data;m.settings=e.getMapObj().escape(m.settings);const h=Ef();if(!h){m.type==="customTable"&&a(m.settings,null)&&e.commitLockedAsync();return}e.beforeApply?.(m,h);const f=TV(h),g=l(m,h);if(!g)return;e.afterApply?.(m,g);const E=LX(m)?dv():null;try{uw()}catch{}c(g,f,m,E?()=>mM(E,w=>e.htmlDocument.renderOnly(w)):void 0)}catch{}finally{d.releaseLater()}}}var xX=gy,OX=3,Lp=Promise.resolve(),Np={waiting:0},xp=0;function oT(){return ct()?ot().entityId:void 0}async function RX(e,t){let n=!1,r=!1;const o=()=>{n||(n=!0,e())},i=(async()=>{t&&await fP(),r=!0,await QO(o)})();let s;const a=new Promise(l=>{s=setTimeout(()=>{r&&jy()||(jy()?n=!0:o(),l())},xX)});try{await Promise.race([i,a])}catch{o()}finally{clearTimeout(s)}}function iT(e,t){Wy(()=>sT(e,t))||sT(e,t)}function sT(e,t){const n=xp>0||dP();if(!n&&JO()&&(Np={waiting:0}),Np.waiting>=OX)return;const r=Np;r.waiting++;const o=oT(),i=eR(),s=async()=>{try{await RX(()=>{oT()===o&&(e.send({operation:Ae.APPLICATION_ACTION,action:t,...i!==void 0?{actionId:i}:{}}),i!==void 0&&tR(i))},n)}finally{r.waiting--,n&&xp--}};n?(xp++,Lp=Lp.then(s,s)):Lp=s()}function aT(e,t){return!!e&&Array.from(e.querySelectorAll('[em="atom"]')).some(n=>n!==t)}function gu(e){e.nodeName==="#comment"&&e.textContent?.indexOf("mso")!==-1?e.remove():e.previousSibling&&gu(e.previousSibling)}function pa(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(),pa(t)));else if(e.innerHTML.trim()==="")gu(e),e.remove(),pa(t);else if(t&&!t.querySelector('div[style*="display"]')){for(const n of Array.from(e.childNodes))n.nodeName==="#text"&&n.textContent?.trim()===""?(gu(n),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(gu(n),n.remove());e.innerHTML.trim()===""&&pa(e)}}function MX(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(),n.tagName!=="TD"&&!aT(s,i)&&s?.textContent?.trim()===""&&(s.textContent="")}else{n.remove();const i=n.previousSibling;i&&i?.textContent?.trim()===""&&i.remove()}return pa(o),t.commit(),G.send({operation:"application_element_settings_close"}),!0}function PX(e,t){if(t)return e.keyCode===90?e.shiftKey?"redo":"undo":e.keyCode===89&&!e.shiftKey?"redo":void 0}var IX={historyUndo:"undo",historyRedo:"redo"};function DX(e,t){const n=IX[e.inputType];return!n||!e.target?.closest?.("editor")?!1:(e.preventDefault(),e.stopPropagation(),iT(t.messageService,n),!0)}function BX(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=mt(()=>{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&&!aT(d,u)&&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 HX(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=Pt(i)?i.parentElement:i,a=["strong","em","u","b","i","span","a","sub","sup","strike"];let l=null;for(const h of a){const f=s?.closest(h);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 h=c.textContent||"";return h[0]===" "||h[0]===" "?(t.setCursorPositionSimple(c,1),!0):(c.textContent=" "+h,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 lT(e,t){lf(e,cs,t)}function FX(e,t){if(e.key!=="Backspace"&&e.keyCode!==8||e.ctrlKey||e.metaKey||e.altKey)return!1;const n=window.getSelection(),r=n?.rangeCount?n.getRangeAt(0):null,o=r?.collapsed?r.startContainer:null,i=Pt(o)?o:Pt(o?.parentNode)?o.parentNode:null,s=i?.previousSibling,a=s?.parentNode;if(!n||!i||rf(i)||s?.nodeName!=="BR"||!a)return!1;e.preventDefault(),e.stopImmediatePropagation(),cs(()=>i.remove());const l=s.previousSibling,c=Array.prototype.indexOf.call(a.childNodes,s);return a.removeChild(s),l?.nodeType===Node.TEXT_NODE?n.collapse(l,l.length):n.collapse(a,c),l?.nodeName==="BR"&&lf(l,cs),t.commit(!0),!0}var $X=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"];function WX(e,t){return!$X.includes(e.key)||cf(sv(),cs)===null||t.commit(!1),!1}function qX(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;qy();const a=i.anchorNode,l=a?.parentNode,c=l?.tagName==="A";s.collapsed||s.deleteContents(),av(s);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),lT(u,t),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),lT(u,t),o.commit(),!0}function zX(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?__(r,n.textContent||""):!1}function UX(e){const t=mt(r=>{const o=r.target,i=o?.closest?.("a")||o?.querySelector?.("a"),s=i?.closest("td")||i?.parentElement;!i||!s||!Fr(s)||e(!1).then(()=>{const a=!!i.closest("editor")||!!i.querySelector("editor")||!!s.querySelector("editor");s.isConnected&&i.isConnected&&a&&__(s,i.textContent||"")&&e(!1)})}),n=mt(r=>{zX(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 jX=new Set(["textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor"]);function VX(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,h=s;function f(b,S,_){const k=!!b&&!!S&&S.tagName==="DIV"&&b.tagName==="EDITOR"&&b.parentElement===S&&S.childElementCount===1&&S.firstElementChild===b&&!Array.from(S.childNodes).some(P=>P!==b&&P.nodeType===Node.TEXT_NODE&&!!P.textContent?.trim()),x=!!b&&b.childElementCount===0&&Array.from(b.childNodes).some(P=>P.nodeType===Node.TEXT_NODE&&!!P.textContent?.trim()),N=!!b&&Oe(b).trim()===_.trim();if(!k||!x||!N||!b.hasAttribute("em-edit")||!S.parentNode)return;const W=S.parentNode,O=b.getAttribute("em-edit")||"active";for(;b.firstChild;)S.appendChild(b.firstChild);b.remove(),b.removeAttribute("em-edit"),S.setAttribute("em-edit",O),W.replaceChild(b,S),b.appendChild(S)}function g(b,S){try{return S.intersectsNode(b)}catch{const _=document.createRange();return _.selectNodeContents(b),S.compareBoundaryPoints(Range.END_TO_START,_)<0&&S.compareBoundaryPoints(Range.START_TO_END,_)>0}}function E(b){const S=b?.links||{},_=S.underline,k=S.color,x=typeof _=="boolean"?_?"underline":"none":"underline";return{color:typeof k=="string"&&k.trim()?k.trim():"inherit",textDecoration:x}}function w(b,S){if(!b||!S)return null;const _=S,k=Array.from(_.querySelectorAll("a"));_.tagName==="A"&&k.unshift(_);const x=typeof window<"u"&&window.Range?window.Range.START_TO_START:0,N=typeof window<"u"&&window.Range?window.Range.END_TO_END:2;for(const W of k){const O=document.createRange();O.selectNodeContents(W);const P=O.compareBoundaryPoints(x,b)<=0,Q=O.compareBoundaryPoints(N,b)>=0;if(P&&Q)return W}return null}function T(b,S,_){const k=Array.from(S?.getElementsByTagName("span")||[]).reverse();let x=!1;Oe(S)===b&&k.length&&(x=!0),k.forEach(N=>{const W=N.getAttribute("style"),O=!!W&&W.trim().length>0;let P=Array.from(N.attributes).filter(te=>te.name!=="style");if(!O&&P.length===1&&P[0].name==="em-edit"&&N.parentElement&&!N.parentElement.hasAttribute("em-edit")){const te=N.getAttribute("em-edit")||"active";N.parentElement.setAttribute("em-edit",te),N.removeAttribute("em-edit"),P=Array.from(N.attributes).filter(fe=>fe.name!=="style")}const Q=P.length>0;if(!O&&!Q){const te=Oe(N);if(N.childNodes.length===1&&N.childNodes[0].nodeType===3){const fe=N.childNodes[0];N.parentNode?.replaceChild(fe,N),_.isEditorTagOutside&&Oe(S)!==b&&fe.parentNode&&(_.range?.selectNode(fe),n(_.range))}else{const fe=Array.from(N.childNodes);fe.forEach(ne=>{N.parentNode?.insertBefore(ne,N)}),b===te&&(_.range=document.createRange(),_.range.setStartBefore(fe[0]),_.range.setEndAfter(fe[fe.length-1]),n(_.range)),N.parentNode?.removeChild(N)}}}),x&&(r(S,b),_.range.selectNode(S),n(_.range))}function L(b,S){if(b?.rangeCount>0){const _=b.getRangeAt(0),k=_.commonAncestorContainer;let x=_.startOffset,N=_.endOffset;for(;k.data&&x>0&&!/\s/.test(k.data[x-1]);)x--;for(;k.data&&N<k.length&&!/\s/.test(k.data[N]);)N++;S.setStart(k,x),S.setEnd(k,N),n(S)}}function y(b,S,_){Ce(b,ze(b).replaceAll(/<\/?strike[^>]*>/gi,"")),nn(b),b.parentNode&&(_.selectNode(b),n(_),r(b,S))}let p=!1;function v(){document.execCommand("styleWithCSS",!1,"true"),p=!0}function C(b,S){const _=pG(S.settings,j),k=S.settings.textColor??S.settings.textBackgroundColor;if(typeof k=="string"&&k.trim()!==""&&!j(k))return!1;const x=iu(b),{classNameOl:N,classNameUl:W,classNameBullet:O,isListOL:P,isListUL:Q,isList:te}=x;te&&x.tableElement?.querySelectorAll("tbody > tr > td:first-child")?.forEach($=>{const tt=$.querySelector(":scope > div")||$.querySelector(":scope > editor div");tt&&tt.classList.add(`${O}`)}),b?.querySelectorAll(".em-element-path").forEach($=>$.remove()),cf(sv(),cs);const fe=Object.keys(S.settings)[0];let ne=window.getSelection();if(!ne||ne.rangeCount===0){if(!b||!b.isConnected)return;const $=document.createRange();if($.selectNodeContents(b),ne=window.getSelection(),!ne)return;ne.removeAllRanges(),ne.addRange($)}let Y=ne.getRangeAt(0);const be=Y.commonAncestorContainer;let ce=be.nodeType===1?be:be.parentElement,Se=ne.anchorNode?.nodeType===1?ne.anchorNode:ne.anchorNode?.parentElement,st=!1,J=Ye();if(b||(b=ne.anchorNode?.childNodes.length===1&&ne.anchorNode.firstChild?.nodeType===1?ne.anchorNode.firstChild:ce,b.tagName==="EDITOR"&&(b=b.parentElement)),_.name==="textLink"&&_.value===""){const $=ce?.closest?.("a, [href]")||null;$&&(Y.selectNode($),n(Y),b=$)}if(_.name==="textUnderline"&&!_.value){let $=ce.closest(["u","strike","[style*=text-decoration]","span","a"].find(tt=>ce?.closest(tt))||"u");!$&&b?.tagName==="A"&&($=b),$?.tagName==="A"&&($.style.textDecoration="none",r($,J),Y.selectNode($),n(Y),b=$,st=!0)}let q=S.type==="button"?(b||Se)?.closest("a"):(b||Se)?.closest("a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");const re=S.settings.fontFamily;let Ft=null;const z=Array.from(q?.classList||[]).some($=>($.startsWith("em-font-")&&(Ft=$),$.startsWith("em-font-")&&$.includes(_.name==="textItalic"?"Italic":"Bold")));z&&(_.name==="textItalic"||_.name==="textStrong")&&Ft&&q?.classList.remove(Ft);const ln={range:Y,isEditorTagOutside:!1},vt=($=Ye(),tt=q)=>{T($,tt,ln)},cn=Tj,Kt=f0,Tn=($,tt)=>{y($,J,ln.range)};let Yt,at;fe==="textColor"?Yt=at="color":fe==="textBackgroundColor"&&(Yt="backgroundColor",at="background-color");const Nt=S.settings.hasOwnProperty("textColor")||S.settings.hasOwnProperty("textBackgroundColor"),Et=!!ce?.closest("editor")||Oe(ce)===J||Oe(ce.querySelector("editor"))===J;ln.isEditorTagOutside=Et,S.settings.hasOwnProperty("textColor")&&_.value&&v();const Ou=Aj,Kn=c(),Ca=u();if(TG({parentElement:ce,parentNode:Se,parentWrapper:q,currentSettings:_,isElementList:te,classNameBullet:O,isEditorTagOutside:Et,selectedText:J,range:Y,selection:ne,checkForTextNodes:Kt,commit:t,getInnerText:Oe,getSelectedText:Ye,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:j})||AG({parentElement:ce,parentNode:Se,parentWrapper:q,currentSettings:_,isElementList:te,classNameBullet:O,isEditorTagOutside:Et,selectedText:J,range:Y,selection:ne,checkForTextNodes:Kt,commit:t,getInnerText:Oe,getSelectedText:Ye,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:j,fontFamilyArray:re,removeClassesByPrefix:Ys,createFontClassName:dh,clearLinkTags:a,addFontFamilyClass:l,cleanEmptySpans:vt}))return!1;const wo=ce.closest(_.tags.find($=>ce?.closest($))||"span");(Y?.collapsed||!Ye())&&(_.value?_.value&&Et&&(S.type==="button"||b.tagName==="A"&&wo?Y.selectNodeContents(wo):L(ne,Y)):wo&&Y.selectNodeContents(wo)),(S.type==="button"||b.tagName==="A"||b?.closest("a"))&&Ye()&&Ye()!==Oe(b)&&wo&&(S.settings.hasOwnProperty("textLink")||S.settings.hasOwnProperty("textUnderline"))&&(Y.selectNode(wo),n(Y),S.settings.hasOwnProperty("textUnderline")&&b.tagName==="A"&&(b.style.textDecoration=_.value?"underline":"none",st=!0)),ne=window.getSelection(),Y=ne.getRangeAt(0),ln.range=Y,J=Ye(),Array.from(q?.querySelectorAll("span,div")||[]).reverse().forEach($=>{$.getAttribute("style")===""&&$.removeAttribute("style"),$.hasAttribute("contenteditable")&&$.removeAttribute("contenteditable"),$.hasAttribute("em-edit")&&$.removeAttribute("em-edit"),$.hasAttribute("em-relative")&&$.removeAttribute("em-relative"),$.hasAttribute("class")&&($.classList.remove("em-relative"),$.classList.length===0&&$.removeAttribute("class"))});let ae=null;Nt&&at&&q?.style?.getPropertyValue?.(at)?.trim()&&(Oe(q)===J&&(q.style[Yt]=j(_.value?.toString())||"",st=!0),Yt==="color"&&(ce===q||b?.closest('[style*="color"]')===q)&&(ae=j(q.style[at]),q.style.removeProperty(at),!q?.hasAttribute("em-edit")&&te&&q&&Kn&&q.closest("tr")?.querySelector(`.${O}`)?.style.removeProperty(at)));let un=null,Ru=null;if(Nt&&Yt==="color"&&["A","LI"].includes(q?.tagName)){let $=q.parentElement;for(;$&&!["BODY","HTML","TD","TH"].includes($.tagName);){const tt=$.style.getPropertyValue("color")?.trim();if(tt){un=j(tt)||tt,Ru=$,$.style.removeProperty("color");break}$=$.parentElement}}at&&!(_.value.length===7||_.value.length===4)&&(st=!0),Et&&(!_.value&&_.name!=="fontSize"&&_.name!=="textLink"||_.value)&&(!(_.name==="textUnderline"||_.name==="textStrikethrough")||S.type!=="button")&&!st&&(_.name!=="fontSize"&&!Nt&&Oe(q)===J?sr(_.command,!1,Nt?_.value:_.name==="textLink"?" ":void 0):Oe(q)!==J&&(S.settings.hasOwnProperty("textColor")&&v(),sr(_.command,!1,Nt?String(_.value):_.name==="textLink"?" ":void 0),S.settings.hasOwnProperty("textColor")&&_.value&&_G(q||ce,String(_.value),j))),J=Ye();{const $={parentElement:ce,parentNode:Se,parentWrapper:q,selection:ne,range:Y};NG({parentElement:ce,parentNode:Se,parentWrapper:q,currentSettings:_,isElementList:te,classNameBullet:O,isEditorTagOutside:Et,selectedText:J,range:Y,selection:ne,checkForTextNodes:Kt,commit:t,getInnerText:Oe,getSelectedText:Ye,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:j,activeElement:b,hasItalicClass:z,tempStyleClass:Ft,checkForWorkClass:cn,removeFormattingTags:ps,cleanEmptySpans:vt,mutableState:$,currentStyle:Yt,isProgrammaticSelection:Kn,findParentWithFontSizeAndTag:xj}),ce=$.parentElement,Se=$.parentNode,q=$.parentWrapper,ne=$.selection,Y=$.range,ln.range=Y}kG({parentElement:ce,parentNode:Se,parentWrapper:q,currentSettings:_,isElementList:te,classNameBullet:O,isEditorTagOutside:Et,selectedText:J,range:Y,selection:ne,checkForTextNodes:Kt,commit:t,getInnerText:Oe,getSelectedText:Ye,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:j,activeElement:b,hasItalicClass:z,tempStyleClass:Ft,checkForWorkClass:cn,removeFormattingTags:ps,cleanEmptySpans:vt}),LG({parentElement:ce,parentNode:Se,parentWrapper:q,currentSettings:_,isElementList:te,classNameBullet:O,isEditorTagOutside:Et,selectedText:J,range:Y,selection:ne,checkForTextNodes:Kt,commit:t,getInnerText:Oe,getSelectedText:Ye,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:j,activeElement:b,hasItalicClass:z,tempStyleClass:Ft,checkForWorkClass:cn,removeFormattingTags:ps,cleanEmptySpans:vt});const Ta={parentWrapper:q,range:Y,selection:ne};xG({parentElement:ce,parentNode:Se,parentWrapper:q,currentSettings:_,isElementList:te,classNameBullet:O,isEditorTagOutside:Et,selectedText:J,range:Y,selection:ne,checkForTextNodes:Kt,commit:t,getInnerText:Oe,getSelectedText:Ye,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:j,activeElement:b,hasItalicClass:z,tempStyleClass:Ft,checkForWorkClass:cn,removeFormattingTags:ps,cleanEmptySpans:vt,request:S,findOutermostParentWithText:h,mutableState:Ta}),q=Ta.parentWrapper,Y=Ta.range,ln.range=Y;const Ii={parentWrapper:q,range:Y,selection:ne};if(OG({parentElement:ce,parentNode:Se,parentWrapper:q,currentSettings:_,isElementList:te,classNameBullet:O,isEditorTagOutside:Et,selectedText:J,range:Y,selection:ne,checkForTextNodes:Kt,commit:t,getInnerText:Oe,getSelectedText:Ye,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:j,activeElement:b,hasItalicClass:z,tempStyleClass:Ft,checkForWorkClass:cn,removeFormattingTags:ps,cleanEmptySpans:vt,request:S,findOutermostParentWithText:h,cleanStrikesInElement:Tn,mutableState:Ii}),q=Ii.parentWrapper,_.value===!1&&q){const $=window.getSelection(),tt=$&&$.rangeCount>0?$.getRangeAt(0):Y,An={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]}[_.name];let kn=!1;An&&An.forEach(ye=>{Array.from(q.getElementsByTagName(ye)).reverse().forEach(xt=>{if(!g(xt,tt))return;const Yn=Oe(xt);if(!Yn||Yn.trim().length===0)return;const dt=xt.parentElement;xt.hasAttribute("em-edit")&&dt&&!dt.hasAttribute("em-edit")&&dt.setAttribute("em-edit",xt.getAttribute("em-edit")||"active"),ju(xt),kn=!0,f(dt,q,J)})}),kn&&setTimeout(()=>{const ye=document.querySelector("[em-edit]")||d(J)||(q?.isConnected?q:null);ye&&r(ye,J)},0)}if(_.value===!0&&q&&Et){const $={textStrong:"strong",textItalic:"em",textStrikethrough:"s",textUnderline:"u"},tt={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]},An=$[_.name],kn=tt[_.name];if(An&&kn&&J&&J.trim().length>0){const ye=q,xt=kn.some(Gr=>ye.getElementsByTagName(Gr).length>0),Yn=(ye.style?.textDecoration||"").toLowerCase(),dt=(ye.style?.textDecorationLine||"").toLowerCase(),Ln=Yn.includes("underline")||dt.includes("underline"),$t=Yn.includes("line-through")||dt.includes("line-through"),gr=_.name==="textUnderline"&&Ln||_.name==="textStrikethrough"&&$t,Pu=Oe(ye)===J;if(!xt&&!gr&&Pu){const Gr=document.createElement(An);for(;ye.firstChild;)Gr.appendChild(ye.firstChild);ye.appendChild(Gr);try{const Nn=document.createRange();Nn.selectNodeContents(Gr),n(Nn),Y=Nn,ln.range=Nn}catch{}setTimeout(()=>{const Nn=document.querySelector("[em-edit]")||d(J)||(ye.isConnected?ye:null);Nn&&r(Nn,J)},0)}}}const et={parentWrapper:q,parentNode:Se,range:Y,selection:ne};RG({parentElement:ce,parentNode:Se,parentWrapper:q,currentSettings:_,isElementList:te,classNameBullet:O,isEditorTagOutside:Et,selectedText:J,range:Y,selection:ne,checkForTextNodes:Kt,commit:t,getInnerText:Oe,getSelectedText:Ye,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:j,isColorChange:Nt,tempColor:ae,outerContextColor:un,outerContextElement:Ru,stylePropretyName:at,currentStyle:Yt,canselExecCommand:st,isProgrammaticSelection:Kn,request:S,setCustomColor:Ou,checkForWorkClass:cn,cleanEmptySpans:vt,mutableState:et}),q=et.parentWrapper,Se=et.parentNode;const Vr={parentWrapper:q,parentNode:Se,range:Y,selection:ne};if(PG({parentElement:ce,parentNode:Se,parentWrapper:q,currentSettings:_,isElementList:te,classNameBullet:O,isEditorTagOutside:Et,selectedText:J,range:Y,selection:ne,checkForTextNodes:Kt,commit:t,getInnerText:Oe,getSelectedText:Ye,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:m,rgbToHex:j,findOutermostParentWithText:h,activeElement:b,commonStyles:Ca,cleanEmptySpansWithParent:vt,mutableState:Vr}),Y=Vr.range,_.name==="textLink"&&_.value===!0&&Et&&q&&J?.trim().length>0){const $=Vr.range||Y,tt=J.trim(),An=[...q?Array.from(q.querySelectorAll("a")):[],...q?.parentElement?Array.from(q.parentElement.querySelectorAll("a")):[]],kn=An.find(ye=>Oe(ye)?.trim()===tt)||An[0]||null;if(!(w($,q)||w($,q.parentElement)||kn)&&$&&!$.collapsed){const ye=document.createElement("a"),{color:xt,textDecoration:Yn}=E(Ca);ye.setAttribute("target","_blank"),ye.setAttribute("href",""),ye.setAttribute("new","true"),ye.setAttribute("style",`color: ${xt}; text-decoration: ${Yn};`);let dt=!1;const Ln=q.querySelector("editor");if(Ln&&Oe(Ln)===J&&Ln.querySelector("a")===null){for(;Ln.firstChild;)ye.appendChild(Ln.firstChild);Ln.appendChild(ye),dt=!0}try{if(!dt){const $t=$.extractContents();$t.childNodes.length>0&&(ye.appendChild($t),$.insertNode(ye),dt=!0)}}catch{dt=!1}if(!dt&&Oe(q)===J){for(;q.firstChild;)ye.appendChild(q.firstChild);q.appendChild(ye),dt=!0}if(dt){try{const $t=document.createRange();$t.selectNodeContents(ye),n($t),Y=$t,Vr.range=$t,ln.range=$t}catch{}r(ye,J)}}}const Mu=_.name==="textUnderline"&&!_.value;if((!Nt&&st||Mu)&&vt(J),jX.has(_.name)){const $=Vr.parentWrapper||q||d(J)||m();$&&vt(J,$)}te&&ce.querySelectorAll(`tr td:first-child > div.${O}, tr td:first-child > editor div.${O}`).forEach($=>{$.classList.remove(`${O}`)});const Aa=d(J);Aa?.hasAttribute("em-edit")||Aa?.setAttribute("em-edit","active"),t()}return function(S,_){try{return C(S,_)}finally{p&&(p=!1,document.execCommand("styleWithCSS",!1,"false"))}}}function cT(e){return e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),or(ds(e),([t])=>(t&&e.after(t),t))}function uT(e,t){const n=cT(e);t.commit(),n&&t.setCursorPosition(n)}function GX(e,t){cT(e),t.commit()}function XX(e,t){uT(e,t)}function KX(e,t){if(!e.previousElementSibling)return!1;const n=e.previousElementSibling;return n.before(e),t.commit(),G.send({operation:"application_scroll-to",settings:{value:t.scrollTop-n.getBoundingClientRect().height}}),!0}function YX(e,t){if(!e.nextElementSibling)return!1;const n=e.nextElementSibling;return n.after(e),t.commit(),G.send({operation:"application_scroll-to",settings:{value:t.scrollTop+n.getBoundingClientRect().height}}),!0}function dT(e){e.innerHTML="",e.getAttribute("em")==="block"&&e.removeAttribute("em")}function ZX(e,t){const n=e.closest("table");e.querySelector("[em-edit]")&&G.send({operation:"application_element_settings_close"});const r=e.closest('[em="group"]');r&&n&&r.querySelectorAll('[em="block"]').length===1?dT(n):e.remove(),t.commit(),n&&t.setCursorPosition(n)}function fT(e,t){return ef(e),oR(t)}function QX(e,t){const n=document.querySelector('[em-edit="active"]')?.closest('[em="block"]');if(!n)return;const r=[...n.parentElement.children].indexOf(n),o=pi(n),i=parseFloat(o?.style.paddingTop??"")||0,s=parseFloat(o?.style.paddingBottom??"")||0;if(e.tagName==="TR"||e.tagName==="TABLE"){const a=fT(e,e.querySelector("td")),l=[...e.parentNode.children].indexOf(e),c=pi(e),u=parseFloat(c?.style.paddingTop??"")||0,d=parseFloat(c?.style.paddingBottom??"")||0,m=parseFloat(c?.style.borderTopLeftRadius??"")||0,h=parseFloat(c?.style.borderTopRightRadius??"")||0,f=parseFloat(c?.style.borderBottomLeftRadius??"")||0,g=parseFloat(c?.style.borderBottomRightRadius??"")||0,E=n.querySelector("td");r>l?(Jn(E,"afterbegin",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${i+d}"></td></tr></table>`),E.prepend(...a),o&&(o.style.paddingTop=u+"px",o.style.borderTopLeftRadius=m+"px",o.style.borderTopRightRadius=h+"px",o.querySelector(":scope > .em-vindent-paddingTop")?.remove())):(Jn(E,"beforeend",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${s+u}"></td></tr></table>`),E.append(...a),o&&(o.style.paddingBottom=d+"px",o.style.borderBottomLeftRadius=f+"px",o.style.borderBottomRightRadius=g+"px",o.querySelector(":scope > .em-vindent-paddingBottom")?.remove()))}else if(e.tagName==="DIV"){const a=fT(e,e),l=Array.prototype.indexOf.call(e.parentElement.children,e);Ba(n,r>l?"afterbegin":"beforeend",a)}e.remove(),document.querySelector(".em-element-editor-widget-merge")?.remove(),t.commit(),t.setCursorPosition(n)}function JX(e,t){const n=pi(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=ds(e);if(!c)return;ef(e);const u=[...n?.querySelectorAll(':scope > table:not([em="atom"])')??[]].filter(Zd).map(m=>({table:m,next:Xy(m,"next"),prev:Xy(m,"previous")})),d=u.length;u.forEach(({table:m,next:h,prev:f},g)=>{const[E]=Re(c,!0),w=pi(E);if(w.style.paddingTop="0",w.style.paddingBottom="0",w.style.borderRadius="0",w.replaceChildren(m),g===0?(w.style.paddingTop=r+"px",w.style.borderTopLeftRadius=i+"px",w.style.borderTopRightRadius=s+"px"):g===d-1&&(w.style.paddingBottom=o+"px",w.style.borderBottomLeftRadius=a+"px",w.style.borderBottomRightRadius=l+"px"),h?.getAttribute("em")==="atom"&&h.querySelector("td")?.hasAttribute("height")){const T=parseFloat(h.querySelector("td").getAttribute("height"))/2;w.style.paddingBottom=T+"px"}if(f?.getAttribute("em")==="atom"&&f.querySelector("td")?.hasAttribute("height")){const T=parseFloat(f.querySelector("td").getAttribute("height"))/2;w.style.paddingTop=T+"px"}e.insertAdjacentElement("beforebegin",E)}),e.remove(),t.commit()}function eK(e,t){return e.previousElementSibling?(e.previousElementSibling.before(e),t.commit(),!0):!1}function tK(e,t){return e.nextElementSibling?(e.nextElementSibling.after(e),t.commit(),!0):!1}function nK(e,t){const n=document.querySelector('[em="group"]')?.cloneNode(!0);if(!n)return;const r=n.querySelector("table");r&&dT(r),e.after(n),t.commit(),G.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+n.getBoundingClientRect().height+(t.iframeOffsetTop||0)}})}function rK(e,t){uT(e,t)}function oK(e,t){e.querySelector("[em-edit]")&&G.send({operation:"application_element_settings_close"}),e.remove(),t.commit()}function iK(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 sK(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 aK(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:iK(r)},s=n.selectionLock.acquire();try{G.send(i)}finally{n.commitLockedAsync(!1).finally(()=>{s.release()})}}function lK(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=P6(i)+`
|
|
185
|
+
`+n.HTMLDocument.getOuterHtml(e);navigator.clipboard.writeText(s),setTimeout(()=>{r&&r.style.removeProperty("background-color")},2e3)}function cK(e,t,n){navigator.clipboard.readText().then(r=>{const o=n.parseFromString(r);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((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"}),!or(i,l=>{const c=uK(e,l);if(!c)return!1;s&&dK(s,n);for(const u of a.reverse())document.head?.prepend(u),document.head?.insertAdjacentHTML("afterbegin",`
|
|
186
|
+
`);return e.removeAttribute("em-state"),e.after(c),!0})){fK(t.parentNode);return}n.commit(),n.setCursorPosition(e)}).catch(()=>{})}function uK(e,t){const n=e.tagName==="TR",r=document.createElement(n?"table":"div");return r.append(...t),r.querySelector('[em="block"]')?(r.querySelector(".em-element-editor")?.remove(),r.querySelector(n?"tr":'[em="block"]')):null}function dK(e,t){let n=document.head.querySelector('style[em="styles"]'),r="";n?r=t.HTMLDocument.getInnerHtml(n):(n=document.createElement("style"),n.setAttribute("em","styles"),n=document.head.insertAdjacentElement("beforeend",n));const o=document.createElement("div");t.emailWidth&&(e=e.replace(/(max-device-width:|max-width:)\d+px/g,s=>s.replace(/\d+/,String(t.emailWidth)))),t.insertAdjacentHTML(o,"afterbegin",e);let i=t.minify(r+`
|
|
187
|
+
`+[...o.querySelectorAll("style")].map(s=>s.innerHTML).join(`
|
|
188
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;i=t.cssbeautify(i,{indent:" ",autosemicolon:!0}),n.textContent=`
|
|
189
|
+
`+i+`
|
|
190
|
+
`}function fK(e){e&&(e.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(()=>{e.style.removeProperty("background-color")},2e3))}function mK(){return document.body?.classList.contains("em-sandbox-discuss")&&!document.body.classList.contains("em-sandbox-discuss_set-target")}function hK(){return document.body?.classList.contains("em-sandbox-discuss_set-target")??!1}function pK(e){const t=e.getAttribute("em-discuss-id");return t&&G.send({operation:"application_discuss_get_comment",settings:{targetId:t}}),!1}function gK(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"),G.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"),G.send({operation:"application_discuss_set_id",settings:{value:i}})}t.commit()}return{handled:!0,newClickedElement:n}}function bK(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 f=o.closest(".em-narrow-table");if(f&&(_n(f)||!f.innerHTML.trim())&&e.insertTextAtomIntoEmptyNarrowTable(f))return}const i=o.closest("a");if(i instanceof HTMLAnchorElement){const f=i.getAttribute("href")||i.href||"";if(da(f)){const g=f.slice(1),E=document.querySelector(`a[name="${g}"]`);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 f=m.querySelector("td");f&&e.applicationElementSettingsSet({elem:f}),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 h=o.closest('[em="group"]');if(h&&o.classList.contains(je.moveUp)){e.handleMoveGroupUp(h);return}if(h&&o.classList.contains(je.moveDown)){e.handleMoveGroupDown(h);return}if(h&&o.classList.contains(je.add)){e.handleAddGroup(h);return}if(h&&o.closest(".em-element-editor-widget-edit")){e.setCursorPosition(h);const f=h.tagName!=="TR"?h:h.querySelector("td");f&&e.applicationElementSettingsSet({elem:f});return}if(h&&o.closest(".em-element-editor-widget-clone")){e.handleCloneGroup(h);return}if(h&&o.closest(".em-element-editor-widget-remove")&&o.closest(".of-group")){e.handleRemoveGroup(h);return}if(!o.closest(".em-editor-wrapper")&&!o.closest(".em-element-path")&&!o.closest(".em-element-vindent-remove")){const f=window.getSelection();if(f?.isCollapsed)e.setCursorPosition(o);else if(f&&f.rangeCount>0){const E=f.getRangeAt(0).commonAncestorContainer,w=e.findOutermostParentWithText(E);w&&e.setCursorPosition(w);const T=e.getParentElementOfSelection();T&&(o=T)}e.applicationElementSettingsSet({elem:o});const g=document.querySelector(".em-editor-wrapper");g&&(g.style.display="none"),e.setBlockGroupControlsPosition()}o.closest(".em-element-custom-table")&&e.handleCustomTableClick(o)}}function yK(e){const t=mt(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")}),Dc(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)}}}var vK=`
|
|
191
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
192
|
+
<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"/>
|
|
193
|
+
</svg>
|
|
194
|
+
`,EK=`
|
|
195
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
196
|
+
<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"/>
|
|
197
|
+
</svg>
|
|
198
|
+
`,SK=`
|
|
199
|
+
<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;">
|
|
200
|
+
<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"/>
|
|
201
|
+
</svg>
|
|
202
|
+
`,wK=`
|
|
203
|
+
<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;">
|
|
204
|
+
<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"/>
|
|
205
|
+
</svg>
|
|
206
|
+
`,_K=`
|
|
207
|
+
<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;">
|
|
208
|
+
<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"/>
|
|
209
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
210
|
+
<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"/>
|
|
211
|
+
</svg>
|
|
212
|
+
`,CK=`
|
|
213
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
|
|
214
|
+
<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"/>
|
|
215
|
+
</svg>
|
|
216
|
+
`,TK=`
|
|
217
|
+
<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;">
|
|
218
|
+
<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"/>
|
|
219
|
+
</svg>
|
|
220
|
+
`,AK=`
|
|
221
|
+
<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;">
|
|
222
|
+
<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"/>
|
|
223
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
224
|
+
<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"/>
|
|
225
|
+
</svg>
|
|
226
|
+
`,kK=`
|
|
227
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
228
|
+
<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"/>
|
|
229
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
230
|
+
<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"/>
|
|
231
|
+
</svg>
|
|
232
|
+
`,LK=`
|
|
233
|
+
<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;">
|
|
234
|
+
<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"/>
|
|
235
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
236
|
+
<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"/>
|
|
237
|
+
</svg>
|
|
238
|
+
`,NK=`
|
|
239
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
240
|
+
<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"/>
|
|
241
|
+
</svg>
|
|
242
|
+
`,xK=`
|
|
243
|
+
<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;">
|
|
244
|
+
<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"/>
|
|
245
|
+
</svg>
|
|
246
|
+
`,mT=`
|
|
247
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
248
|
+
<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"/>
|
|
249
|
+
</svg>
|
|
250
|
+
`,bu=e=>(t,{cellId:n,selected:r})=>r.length?Hh(t,n,r):sq(t,n,e),hT={"add-left-column":(e,{cellId:t})=>tC(e,t,"left"),"add-right-column":(e,{cellId:t})=>tC(e,t,"right"),"merge-right-cell":bu("right"),"merge-left-cell":bu("left"),"split-vertical-cell":(e,{cellId:t})=>oC(e,t,"cols"),"remove-column":(e,{cellId:t})=>ZW(e,t),"add-top-row":(e,{cellId:t})=>J_(e,t,"above"),"add-bottom-row":(e,{cellId:t})=>J_(e,t,"below"),"merge-top-cell":bu("top"),"merge-bottom-cell":bu("bottom"),"split-horizontal-cell":(e,{cellId:t})=>oC(e,t,"rows"),"remove-row":(e,{cellId:t})=>YW(e,t)};function OK(e,t,n){const r=t.cells.find(i=>i.id===n);if(r)return{row:r.row,col:r.col};const o=e.cells.find(i=>i.id===n);return{row:Math.max(0,Math.min(o?.row??0,t.rows-1)),col:Math.max(0,Math.min(o?.col??0,t.cols-1))}}var RK=[{group:"columns",icon:vK,localeKey:"TABLE_MENU_COLUMNS"},{group:"rows",icon:EK,localeKey:"TABLE_MENU_ROWS"}],pT=[{group:"columns",id:"add-left-column",icon:SK,localeKey:"INSERT_COLUMN_BEFORE_TABLE"},{group:"columns",id:"add-right-column",icon:wK,localeKey:"INSERT_COLUMN_AFTER_TABLE"},{group:"columns",id:"merge-right-cell",icon:AK,localeKey:"MERGE_RIGHT_CELL_TABLE"},{group:"columns",id:"merge-left-cell",icon:_K,localeKey:"MERGE_LEFT_CELL_TABLE"},{group:"columns",id:"split-vertical-cell",icon:xK,localeKey:"SPLIT_CELL_TABLE"},{group:"columns",id:"remove-column",icon:mT,localeKey:"REMOVE_COLUMN_TABLE"},{group:"rows",id:"add-top-row",icon:CK,localeKey:"INSERT_ROW_BEFORE_TABLE"},{group:"rows",id:"add-bottom-row",icon:TK,localeKey:"INSERT_ROW_AFTER_TABLE"},{group:"rows",id:"merge-top-cell",icon:kK,localeKey:"MERGE_TOP_CELL_TABLE"},{group:"rows",id:"merge-bottom-cell",icon:LK,localeKey:"MERGE_BOTTOM_CELL_TABLE"},{group:"rows",id:"split-horizontal-cell",icon:NK,localeKey:"SPLIT_CELL_TABLE"},{group:"rows",id:"remove-row",icon:mT,localeKey:"REMOVE_ROW_TABLE"}],gT={left:"merge-left-cell",right:"merge-right-cell",top:"merge-top-cell",bottom:"merge-bottom-cell"},MK={row:["add-left-column","add-right-column","remove-column"],col:["add-top-row","add-bottom-row","remove-row"]};function PK(e){const t=e==="left"||e==="right"?"row":"col";return[...Object.values(gT).filter(n=>n!==gT[e]),...MK[t]]}function IK(e,t,n,r){const o=r&&n.length?PK(r):[],i=r?n:[];return new Set(pT.map(s=>s.id).filter(s=>!o.includes(s)&&!Dh(hT[s](e,{cellId:t,selected:i}))))}var DK="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;",BK="cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",HK="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;",FK="padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px",$K="cursor: pointer; margin: auto; margin-top: 5px";function yu(e,t){return D({...t,targetElement:e,insertType:"append"})}function ga(e){Mt(e)}function WK(){const e=Ci(),t=D({className:Is,style:DK});for(const{group:n,icon:r,localeKey:o}of RK){const i=yu(t,{className:`${Is}-group`,style:BK,HTMLcontent:r,title:e[o]});i.setAttribute("data-group",n);const s=yu(i,{tag:"ul",className:`${Is}-list`,style:HK});yu(s,{tag:"li",className:`${Is}-head`,style:FK,HTMLcontent:r});for(const a of pT.filter(l=>l.group===n))yu(s,{tag:"li",className:`${Is}-item`,style:$K,HTMLcontent:a.icon,title:e[a.localeKey],"data-id":a.id})}return t}function qK(e){return e.querySelector(":scope > ul")}function zK(e,{target:t,selection:n}){const r=n.base(),o=Ei(t.table),i=r&&ra(t.table,r);if(!i)return!1;const s=n.selected().map(l=>ra(t.table,l)).filter(l=>!!l),a=IK(o,i,s,n.direction());return e.querySelectorAll("[data-id]").forEach(l=>{l.style.display=a.has(l.getAttribute("data-id"))?"block":"none"}),!0}function bT(e,t){e.querySelectorAll(":scope > div > ul").forEach(n=>{n!==t&&(n.style.display="none")})}function UK(e,t){e.stopPropagation(),e.preventDefault();const n=e.target instanceof Element?e.target:null,r=n?.closest("[data-id]");if(r){t.choose(r.getAttribute("data-id"));return}const o=n?.closest("[data-group]");o&&!n?.closest("ul")&&ga(()=>t.show(o))}function jK(e,t){e.addEventListener("click",mt(n=>UK(n,t))),e.querySelectorAll("[data-group]").forEach(n=>{n.addEventListener("mouseenter",mt(()=>ga(()=>t.show(n)))),n.addEventListener("mouseleave",mt(()=>ga(()=>t.hide())))})}function VK(e){let t=null,n=!1;const r=()=>{const s=t?.root;t=null,s&&ga(()=>s.remove())},o={show(s){const a=qK(s);if(!t||!a||e.isEditLocked()||!zK(a,t)){r();return}bT(t.root,a),a.style.display="block"},hide(){t&&bT(t.root)},choose(s){const a=t;r(),a&&e.run(s,a.target,a.selection)}},i=mt(s=>{const a=t?.target.table;a&&(!a.isConnected||!(s.target instanceof Node)||!a.contains(s.target))&&r()});return document.addEventListener("click",i),{open(s,a){if(r(),n||e.isEditLocked())return;const l=WK();Yd(l),jK(l,o),t={root:l,target:s,selection:a},ga(()=>s.table.append(l))},close:r,destroy(){r(),n=!0,document.removeEventListener("click",i)}}}function GK(e,t){return t.map(n=>ra(e,n)).filter(n=>!!n)}function XK(e,t){const n=Ei(e).grid[t.row]?.[t.col];return n&&Ih(e,n)||null}function KK(e,t,n,r){const o=XK(t.table,e);o&&(n.start(o),r.reopen({...t,td:o},n),r.applicationElementSettingsSet({elem:o}))}function YK(e,t,n,r){const o=n.base();if(!o)return au(Ur("no-cell"));const i={},s=b0(t.table,{isEditLocked:r.isEditLocked,tableModelToHtml:Y_},{movesCells:!0,edit:a=>{const l=Ei(a),c=ra(a,o);if(!c)return Ur("no-cell");const u=hT[e](l,{cellId:c,selected:GK(a,n.selected())});return Dh(u)||(i.focus=OK(l,u,c)),u}});if(s.status==="rejected"){if(s.reason!=="locked")throw new Error(`tableMenu: refused "${e}" (${s.reason})`);return s}return r.commit(),i.focus&&KK(i.focus,t,n,r),s}var ZK=".em-element-custom-table";function QK(e,t){let n=t.closest("td, th");for(;n&&e.contains(n);){if(n.parentElement?.closest("table")===e)return n;n=n.parentElement?.closest("td, th")??null}return null}function JK(e){return e.closest('[em="block"]')??e}function Op(e){if(!(e instanceof Element)||e.closest(".em-table-menu"))return null;const t=e.closest(ZK),n=t&&QK(t,e);return t&&n?{table:t,td:n,block:JK(t)}:null}function eY(e){const t=VK({isEditLocked:e.isEditLocked,run:(n,r,o)=>{YK(n,r,o,{...e,reopen:(i,s)=>t.open(i,s)})}});return n=>{const r=Op(n);if(!r)return!1;const o=e.selections.of(r.table);return o.base()!==r.td&&o.start(r.td),t.open(r,o),!0}}function tY(){Ic({scrollTop:U.get("scrollTop")})}function nY(e){const{htmlDocument:t,commit:n}=e,r=()=>({commit:n,setCursorPosition:e.setCursorPosition,scrollTop:U.get("scrollTop"),iframeOffsetTop:U.get("iframeOffsetTop"),applicationElementSettingsSet:e.applicationElementSettingsSet}),o=bK({getLockEditor:()=>e.editLock.isIntegratorLocked(),setEditorFocus:e.setEditorFocus,setCursorPosition:e.setCursorPosition,getParentElementOfSelection:kl,findOutermostParentWithText:yf,setBlockGroupControlsPosition:tY,applicationElementSettingsSet:e.applicationElementSettingsSet,insertTextAtomIntoEmptyNarrowTable:e.insertTextAtomIntoEmptyNarrowTable??(()=>!1),handleRemoveAtom:i=>MX(i,{getElementParent:s=>Vc(s),setCursorPosition:e.setCursorPosition,getVariableByIcon:Ac,commit:n}),handleCloneAtom:i=>GX(i,r()),handleMoveBlockUp:i=>KX(i,r()),handleMoveBlockDown:i=>YX(i,r()),handleRemoveBlock:i=>ZX(i,r()),handleCloneBlock:i=>XX(i,r()),handleCopyBlock:(i,s)=>lK(i,s,{HTMLDocument:t}),handlePasteBlock:(i,s)=>cK(i,s,{HTMLDocument:t,parseFromString:Re,getOuterHtml:tn,minify:ao,cssbeautify,insertAdjacentHTML:Jn,setBlockMaxWidth:a=>sp(a,t),setFloatBlocksWidth:a=>op(a,t),checkBlockAdaptivity:Tc,commit:n,setCursorPosition:e.setCursorPosition,emailWidth:U.get("emailWidth"),appName:U.get("appName")}),handleMergeBlocks:i=>QX(i,r()),handleUnmergeBlocks:i=>JX(i,r()),isAddBlockMenuClick:sK,handleAddBlockMenu:(i,s)=>aK(i,s,{removeAllAttributes:Cr,selectionLock:e.selectionLock,commitLockedAsync:e.commitLockedAsync}),addBlockToProject:i=>tW(i,{HTMLDocument:t,messageService:e.messageService}),handleMoveGroupUp:i=>eK(i,r()),handleMoveGroupDown:i=>tK(i,r()),handleAddGroup:i=>nK(i,r()),handleCloneGroup:i=>rK(i,r()),handleRemoveGroup:i=>oK(i,r()),isDiscussViewMode:mK,isDiscussSetTargetMode:hK,handleDiscussViewClick:pK,handleDiscussSetTargetClick:i=>gK(i,{makeId:gP,commit:n}),handleCustomTableClick:eY({selections:e.tableSelections,isEditLocked:()=>e.editLock.isTextLocked(),commit:()=>n(),applicationElementSettingsSet:e.applicationElementSettingsSet})});document.onclick=mt(o),yK({commit:n,messageService:e.messageService})}function yT(e,t){const n=JSON.stringify({settings:t});return{target:e,dataTransfer:{getData:r=>r==="Text"?n:""},preventDefault:()=>{},stopPropagation:()=>{}}}function rY(e){return!e.closest(".em-element-editor-widget")}function oY(e,t){if(t.lockEditor||!e.isTrusted)return!1;const n=V0();if(!n)return!1;const r=e.target;if(!(r instanceof HTMLElement)||!rY(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;rT(yT(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;tT(yT(r,o.settings),o,t.blockDropCtx)}else return!1;if(!V0())return e.preventDefault(),e.stopPropagation(),eT(),t.commit(),!0}catch{return!1}return!1}var vT="application/x-emailmaker-social-reorder";function Rp(e){return e.closest('table[em-type="social"]')}function ET(e){return(e.querySelector('table[role="presentation"]')||e.querySelector("table"))?.querySelector("tr")}function ST(e){return Array.from(e.querySelectorAll(":scope > td[em-platform], :scope > td[data-em-platform]"))}function iY(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===" "||n.textContent===" "})}function sY(e,t){const n=iY(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 aY(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=Rp(n);if(!r)return;const o=ET(r);if(!o)return;const i=ST(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(vT,l),a.effectAllowed="move"}function lY(e,t){const n=e.dataTransfer;if(!n||!Array.from(n.types||[]).includes("application/x-emailmaker-social-reorder"))return!1;let r=n.getData(vT);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=Rp(i);if(!s)return!1;const a=ET(s);if(!a)return!1;const l=ST(a);if(l.length<2)return!1;const c=l.indexOf(i);if(c<0)return!1;const u=l[o];if(!u||Rp(u)!==s)return!1;if(o===c)return!0;const d=[...l];return d.splice(o,1),d.splice(c,0,u),sY(a,d),s.setAttribute("em-edit","active"),t.applicationElementSettingsSet({elem:s}),!0}function cY(){return{targetBlock:null,newTargetblock:null,atomReplaced:null}}function uY(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=HC(t);setTimeout(()=>e.messageService.send({operation:"application_open-image-ai-popup",src:n}),1e3)}function dY(e,t,n){if(t.editLock.isIntegratorLocked())return;let r;try{e.preventDefault(),e.stopPropagation();const o=sX(e,{lockEditor:!1,applicationElementSettingsSet:t.applicationElementSettingsSet,messageService:t.messageService})||lY(e,{applicationElementSettingsSet:t.applicationElementSettingsSet});if(r=t.selectionLock.acquire(),!o){if(document.body.classList.contains("em-block-insert-body"))try{const i=JSON.parse(e.dataTransfer?.getData("Text")||"{}");tT(e,i,{...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{rT(e,{...t.atomDropContext(),mutableState:n})}catch{}}eT(),t.commit()}finally{Promise.resolve().then(()=>{r?.release(),uY(t)})}}function fY(e){const{dragState:t}=e,n=(r,o,i)=>document.addEventListener(r,mt(o),i);document.addEventListener("drag",r=>r.preventDefault(),!1),n("dragstart",r=>aY(r,{lockEditor:e.editLock.isIntegratorLocked()}),!0),n("dragstart",r=>aX(r,{lockEditor:e.editLock.isIntegratorLocked(),commit:o=>{e.commit(o)},messageService:e.messageService,mutableState:t}),!1),n("dragover",r=>cX(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t}),!1),n("dragenter",r=>uX(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t,requireEvenEmptyCell:e.requireEvenEmptyCell}),!1),n("dragleave",r=>mX(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t}),!1),n("drop",r=>dY(r,e,t),!1),n("dragend",r=>lX(r,{lockEditor:e.editLock.isIntegratorLocked(),messageService:e.messageService}),!1)}function mY(e){const{htmlDocument:t}=e,n=m=>e.commit(m),r=cY(),o=e.commonStylesApply??(m=>M_(m,h=>e.commit(h))),i=m=>{Kw(m,()=>e.commit())},s=m=>sp(m,t),a=m=>op(m,t),l=()=>({messageService:e.messageService,isJsonString:hP,getOuterHtml:tn,minify:ao,cssbeautify,HTMLDocument:t,_setDocumentStyles:(m,h)=>uh(m,h),commonStylesApply:o,commonStylesApplyToBlock:kh,setImageWidth:th,fitMovedImage:Xw,setFloatBlocksWidth:a,fitImagesToColumns:ip,insertCountdown:i}),c=()=>({...l(),lockEditor:e.editLock.isIntegratorLocked(),commit:n,emailWidth:U.get("emailWidth")??null,parseFromString:m=>Re(m),isTableElement:PN,uptimeCountdown:nh,setBlockMaxWidth:s,checkBlockAdaptivity:Tc,applicationElementSettingsSet:e.applicationElementSettingsSet});return{insertContext:()=>({selectionLock:e.selectionLock,commit:()=>e.commit(),lockEditor:e.editLock.isIntegratorLocked(),emailWidth:U.get("emailWidth"),iframeOffsetTop:U.get("iframeOffsetTop"),previewHeight:U.get("previewHeight"),parseFromString:m=>Re(m),getOuterHtml:tn,HTMLDocument:t,minify:ao,cssbeautify,insertAdjacentHTML:(m,h,f)=>Yy(m,h,f),messageService:e.messageService,setDocumentStyles:m=>uh(m,{minify:ao,cssbeautify,HTMLDocument:t}),setImageWidth:th,commonStylesApply:o,commonStylesApplyToBlock:kh,insertCountdown:i,uptimeCountdown:nh,setBlockMaxWidth:s,setFloatBlocksWidth:a,fitImagesToColumns:ip,checkBlockAdaptivity:Tc,setAtomReplaced:m=>{r.atomReplaced=m},assetsRoot:e.assetsRoot}),register:()=>{document.addEventListener("click",mt(m=>{e.editLock.isIntegratorLocked()||oY(m,{lockEditor:!1,commit:n,atomDropCtx:{...l(),mutableState:r},blockDropCtx:{...c(),mutableState:r}})}),!0),fY({dragState:r,commit:n,messageService:e.messageService,applicationElementSettingsSet:e.applicationElementSettingsSet,selectionLock:e.selectionLock,editLock:e.editLock,atomDropContext:l,blockDropContext:c,requireEvenEmptyCell:e.requireEvenEmptyCell})}}}function hY(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)}}}var wT='<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>',_T='<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>',Mp='<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>',pY='<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>',gY='<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>',vu='<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>',bY='<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>',yY='<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>',ba='<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>',CT='<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>',vY='<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>',Pp='<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 Le(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 Eu={getLocale:Ci,commit:qo},EY=".em-prevent-action";function SY(){return U.get("emailWidth")||475}function wY(){return U.get("copyPasteEnabled")||!1}function _Y(){return U.get("saveBlockEnabled")||!1}function CY(){return U.get("blocksAddPanelEnabled")||!1}function TY(){return U.get("codeMode")||!1}var TT=".em-mob-wrap, .noresp-em-mob-wrap";function AT(e){return Array.from(document.querySelectorAll(e)).find(o_)??null}function Su(e,t){const n=Eu.getLocale(),r=SY(),o=wY(),i=_Y(),s=CY(),a=TY();if(t==="atom"){e.setAttribute("em-state","active"),e.getBoundingClientRect().left<50&&e.setAttribute("em-state","active-inside");const l=D({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=D({targetElement:l,insertType:"append",className:"em-element-editor-widget"});D({targetElement:c,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Le(Mp,`${ke} ${je.drag}`,'style="transform: rotate(90deg)"'),title:n.REORDER_ATOM}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Le(ba,`${ke} em-analytics__atoms-panel-edit`),title:n.EDIT_ATOM}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Le(vu,`${ke} em-analytics__atoms-panel-clone`),title:n.CLONE_ATOM}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Le(Pp,`${ke} em-analytics__atoms-panel-remove`),title:n.REMOVE_ATOM}),Dc(Eu.commit)}if(t==="block"){e.setAttribute("em-state","active");const l=D({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=D({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=D({targetElement:c,insertType:"append",className:"em-element-editor-group"});if(D({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Le(Mp,`${ke} ${je.drag}`),title:n.REORDER_BLOCK}),D({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="block"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Le(_T,`${ke} ${je.moveUp}`),title:n.REORDER_BLOCK_UP}),D({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="block"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Le(wT,`${ke} ${je.moveDown}`),title:n.REORDER_BLOCK_DOWN}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Le(ba,`${ke} em-analytics__blocks-panel-edit`),title:n.EDIT_BLOCK}),o){const f=D({targetElement:c,insertType:"append",className:"em-element-editor-group"});D({targetElement:f,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Le(vu,`${ke} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK}),D({targetElement:f,insertType:"append",className:"em-element-editor-widget-copy",HTMLcontent:Le(gY,`${ke} em-analytics__blocks-panel-copy`),title:n.COPY_BLOCK_TO_CLIPBOARD}),D({targetElement:f,insertType:"append",className:"em-element-editor-widget-paste",HTMLcontent:Le(pY,`${ke} em-analytics__blocks-panel-paste`),title:n.PASTE_BLOCK_FROM_CLIPBOARD})}else D({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Le(vu,`${ke} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK});if(e.closest(EY))return;const d=AT('[em-edit="active"]'),m=AT('[em-state^="active"]');if(d&&m&&(d.querySelector(TT)&&m.querySelector(TT)||d.closest(".em-structure")&&m.closest(".em-structure"))&&d!==c.closest('[em-edit="active"]')&&D({targetElement:c,insertType:"append",className:"em-element-editor-widget-merge",HTMLcontent:Le(bY,`${ke} ${je.merge} em-analytics__blocks-panel-merge`),title:n.MERGE_BLOCK}),Ks(c.closest('[em="block"]')??c).flatMap(f=>Array.from(f.querySelectorAll(":scope > table"))).length>1&&c.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap")&&D({targetElement:c,insertType:"append",className:"em-element-editor-widget-unmerge",HTMLcontent:Le(yY,`${ke} ${je.unmerge} em-analytics__blocks-panel-unmerge`),title:n.UNMERGE_BLOCK}),i&&D({targetElement:c,insertType:"append",className:"em-element-editor-widget-add-block",HTMLcontent:Le(vY,`${ke} em-analytics__blocks-panel-save`),title:n.SAVE_TO_BLOCKS}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Le(Pp,`${ke} em-analytics__blocks-panel-remove`),title:n.REMOVE_BLOCK}),s&&!e.querySelector(".em-element-block-add")&&!a){const f=D({targetElement:e,insertType:"append",className:"em-element-block-add"});e.getBoundingClientRect().bottom+1>document.body.getBoundingClientRect().height&&f.classList.add("out-of-iframe"),D({targetElement:f,insertType:"append",className:"em-element-block-add-plus",HTMLcontent:`${Le(CT,`${ke} ${je.add}`)} ${n.ADD_BLOCK}`,title:n.ADD_BLOCK}),D({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}),D({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}),D({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}),D({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}),D({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})}Dc(Eu.commit);const h=e.closest('[em="block"]');h&&(h.onmouseleave=function(){Li(void 0)})}if(t==="group"){e.tagName==="TR"?e.querySelector("td")?.setAttribute("em-state","active"):e.setAttribute("em-state","active");const l=D({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=D({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=D({targetElement:c,insertType:"append",className:"em-element-editor-group"});D({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Le(Mp,`${ke} ${je.drag}`),title:n.REORDER_BLOCK}),D({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="group"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Le(_T,`${ke} ${je.moveUp}`),title:n.REORDER_BLOCK_UP}),D({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="group"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Le(wT,`${ke} ${je.moveDown}`),title:n.REORDER_BLOCK_DOWN}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-add",HTMLcontent:Le(CT,`${ke} ${je.add} em-analytics__groups-panel-add`),title:n.ADD_GROUP}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Le(ba,`${ke} em-analytics__groups-panel-edit`),title:n.EDIT_GROUP}),D({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Le(vu,`${ke} em-analytics__groups-panel-clone`),title:n.CLONE_GROUP}),document.querySelectorAll('[em="group"]').length>1&&D({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Le(Pp,`${ke} em-analytics__groups-panel-remove`),title:n.REMOVE_GROUP}),Dc(Eu.commit)}}function Li(e){if(document.documentElement.classList.contains("em-resize-start"))return;const t=U.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 AY(e,t){if(!e?.isConnected)return;let n;if(n=e.closest('[em="atom"]')){if(Li(n),n.querySelector(".em-element-editor.of-atom")||Su(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&&Su(r.tagName==="TR"?r.querySelector("td"):r,"block"),t.setBlockGroupControlsPosition()}}else(n=e.closest('[em="block"]'))?(Li(n),n.querySelector(".em-element-editor.of-block")||(Su(n.tagName==="TR"?n.querySelector("td"):n,"block"),t.setBlockGroupControlsPosition())):(n=e.closest('[em="group"]'))&&(Li(n),n.querySelector(".em-element-editor.of-group")||(Su(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:ya,NEW_EDITOR:Ip}=c0,{TRIM_SPACES:va,EMPTY_TEXT:kY}=u0;function LY(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}`),h=n.closest(`table.${c}`)?c:u;if(!m)return!0;const f=hl(m).counterpart(n)??n,g=IU(f,h);if(!g)return!0;const{firstCellText:E,firstCellHtmlNoText:w,wrappedSecondCellHtml:T}=g;return o==="start"||o==="end"?NY(n,m,h,c,u,o,E,w,T,a):o==="inside"&&xY(n,m,h,c,a),l(),s(),!0}function NY(e,t,n,r,o,i,s,a,l,c){const u=e.querySelector("div");u&&u.classList.add(ya);const d=YC(a,s),m=YC(l," "),h=i==="end"?UU(m):m,f=pl(t),g="<tr>"+d+h+"</tr>",E=ki(f),w=DU(E,g,ya,i==="start"),T=ki(w);eo(t),ca(t,T);const L=t.querySelector(`.${ya}`)?.closest("tr"),y=i==="start"?L?.previousElementSibling:L?.nextElementSibling;y&&ZC(y),n===r&&Yh(t),zU(t,r,o,va);const p=i==="start"?t.querySelector(".remove-start-element-position"):t.querySelector(".remove-new-editor-element");return p&&kT(p,t,c),p}function xY(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)?WU(s,a,l):null;return c?(ZC(c.row),s.after(c.row),eo(t),$U(t),c.content.classList.add(Ip),n===r&&Yh(t),kT(c.content,t,o,!0),c.content):null}function kT(e,t,n,r=!1){e.textContent&&e.textContent.length>0&&Ai(e,ze(e).replace(va,"")),kY.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),us(s,a)}}r&&o&&Mt(()=>o.focus())}function OY(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,h=(e.keyCode===38||e.key==="ArrowUp")&&o==="start",f=(e.keyCode===40||e.key==="ArrowDown")&&(!s&&o==="end"||s&&o==="start");if(!(h||f)||!m||!i||!n)return!1;e.preventDefault(),e.stopImmediatePropagation();const g=e.key==="ArrowUp"?"ArrowUp":"ArrowDown",E=n.closest(`table.${u}`)||n.closest(`table.${d}`);if(!E)return!0;const w=n.querySelector("div");w&&w.classList.add(ya);const T=pl(E),L=ki(T),y=qU(L,ya,Ip,g);eo(E),ca(E,y);const p=E.querySelector(".remove-new-editor-element");if(p){l(p,!0);const v=E.querySelector("editor"),C=v?.querySelector("div")?.childNodes[0],b=window.getSelection();if(b&&b.rangeCount>0){const S=b.getRangeAt(0);if(C&&C.nodeType===Node.TEXT_NODE){const _=C.textContent||"";S.setStart(C,_.replace(va,"").length)}else v&&S.selectNodeContents(v);S.collapse(!0),us(b,S)}}return c(),a(),!0}function RY(e,t,n){return(e.keyCode===39||e.key==="ArrowRight")&&(t==="end"||n)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1}function MY(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}=t,h=(...be)=>Mt(()=>t.setCursorSafely(...be)),{classNameOl:f,classNameUl:g,isList:E}=o;if(!((n?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&E)||!(!s||s&&(i==="start"||a&&i==="inside"||a&&i==="end"))||!r||!l)return!1;e.preventDefault(),e.stopImmediatePropagation();const w=r.closest(`table.${f}`)?f:g,T=l.closest("tr");if(!T)return!0;const L=T.previousElementSibling;if(!L&&!s)return!0;const y=s?r.querySelector("div"):T.querySelector("tr td:nth-child(2)")?.querySelector("div"),p=y?ze(y):"",v=p?p.split(" ")[0]:"";v.replace(va,"");const C=L?.querySelector("tr td:nth-of-type(2)");if(!C)return!0;const b=C.querySelector("div");if(!b)return!0;b.classList.add(Ip);const S=ze(b),_=`${S}${p}`;eo(T.parentNode??T),T.remove();const k=b.closest(`table.${f}`)||b.closest(`table.${g}`);if(!k)return!0;const x=ze(k),N=ki(x);ca(k,N),w===f&&Yh(k);const W=k.querySelector(".remove-new-editor-element");if(!W)return d(),c(),!0;const O=_.replace(va,"");Ai(W,`${O} `),u(W,!0);const P=W.closest("editor");if(!P)return d(),c(),!0;const Q=window.getSelection(),te=document.createRange(),fe=P.querySelector("div");if(!fe||!Q)return d(),c(),!0;const ne=P.textContent||"",Y=v?ne.indexOf(v):-1;if(Y!==-1&&v){const be=m(fe,Y);if(be)h(te,Q,be.node,be.offset);else{const ce=fe.childNodes[0];ce&&h(te,Q,ce,0)}}else{const be=document.createElement("div");be.innerHTML=S;const ce=(be.textContent||"").length,Se=m(fe,ce);if(Se)h(te,Q,Se.node,Se.offset);else{const st=document.createTreeWalker(fe,NodeFilter.SHOW_TEXT,null);let J=null;for(;st.nextNode();)J=st.currentNode;J&&h(te,Q,J,(J.textContent||"").length)}}return Mt(()=>P.focus()),d(),c(),!0}function PY(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 IY(e){if(!e)return!1;const t=e.closest("li");return ou(t)}function DY(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 BY(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 HY(e){const t=window.getSelection();if(!t||t.rangeCount===0)return ze(e);const n=t.getRangeAt(0),r=document.createRange();return r.selectNodeContents(e),r.setEnd(n.startContainer,n.startOffset),LT(e,r)}function LT(e,t){const n=document.createElement("div");return n.appendChild(t.cloneContents()),en(e,n),zo(n),Xe(n)}function FY(e){const t=window.getSelection();if(!t||t.rangeCount===0)return"";const n=t.getRangeAt(0),r=document.createRange();return r.selectNodeContents(e),r.setStart(n.endContainer,n.endOffset),LT(e,r)}function Ni(e){const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}function Ea(e,t){e.hasAttribute("em-edit")&&(e.removeAttribute("em-edit"),t.setAttribute("em-edit","active"))}function $Y(e,t){const n=document.createElement("br"),r=document.createElement("span");return r.innerHTML=" ",Ea(e,r),t.parentNode?.insertBefore(r,t),t.parentNode?.insertBefore(n,r),e.remove(),t.querySelectorAll("li").length===0&&t.remove(),Ni(r),r}function WY(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=" ",Ea(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(),Ni(a),a}function qY(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(!IY(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=DY(i),l=BY(i,s);switch(a.position){case"empty":zY(i,s,l,t);break;case"start":UY(i,s,t);break;case"end":jY(i,s,t);break;case"middle":VY(i,s,t)}return t.commit(),!0}function zY(e,t,n,r){switch(n){case"last":const o=document.createElement("li");o.setAttribute("style",jn.LIST_ITEM),o.innerHTML=" ",e.after(o),Ea(e,o),Ni(o);break;case"first":$Y(e,t);break;case"middle":WY(e,t)}}function UY(e,t,n){const r=document.createElement("li");r.setAttribute("style",jn.LIST_ITEM),r.innerHTML=" ",e.before(r),Ni(e)}function jY(e,t,n){const r=document.createElement("li");r.setAttribute("style",jn.LIST_ITEM),r.innerHTML=" ",e.after(r),Ea(e,r),Ni(r)}function VY(e,t,n){const r=HY(e),o=FY(e);Ai(e,r||" ");const i=document.createElement("li");i.setAttribute("style",jn.LIST_ITEM),Ai(i,o||" "),e.after(i),Ea(e,i),Ni(i)}function GY(e){const t=r=>Mm({target:r.target},o=>e.commit(o)),n=()=>U.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?PU(l):null,d=l?.closest("tr")?.querySelector("tr td:nth-of-type(2) div"),m=o.target,h=iu(m),{isList:f}=h,g=d?.textContent===l?.textContent,E=l?u0.EMPTY_TEXT.test(l.textContent||""):!1,w=c?o.metaKey:o.ctrlKey;if(w&&o.keyCode===83){o.preventDefault(),e.messageService.send({operation:"application_action",action:"save_email"});return}const T=PX(o,!!w);if(T){o.preventDefault(),iT(e.messageService,T);return}if(o.altKey&&o.keyCode===88){o.preventDefault(),e.messageService.send({operation:"application_action",action:"toggle_editor"});return}if(FX(o,{commit:e.commit}))return;WX(o,{commit:e.commit}),o.key==="Enter"&&!o.ctrlKey&&!o.metaKey&&!o.altKey&&!o.isComposing&&qy();const L={getElementParent:b=>Vc(b),setCursorPosition:e.setCursorPosition,removeElementEditors:()=>Li(void 0),getVariableByIcon:Ac,removeEmptyParents:pa,getAllComments:MH,isVariableComment:Jw,getVariableIcon:b=>DH(b),commit:e.commit,messageService:e.messageService};if(BX(o,f,u,L))return;if(o.keyCode===27){const b=document.querySelector(".em-editor-wrapper");b?.style&&(b.style.display="none"),Cr("em-edit"),Mt(()=>document.querySelectorAll("editor").forEach(S=>S.blur())),i?.removeAllRanges(),e.applicationElementSettingsSet({elem:null}),e.messageService.send({operation:"application_close-image-edit-popup"});return}w&&o.keyCode===66&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strong"}));const y=c?o.keyCode===88:o.keyCode===53;if((c?o.metaKey:o.altKey)&&o.shiftKey&&y&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strikethrough"})),w&&o.shiftKey&&o.keyCode===76&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_left"})),w&&o.shiftKey&&o.keyCode===82&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_right"})),w&&o.shiftKey&&o.keyCode===69&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_center"})),w&&o.keyCode===73&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_italic"})),w&&o.keyCode===85&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_underline"})),qY(o,{commit:e.commit})||qX(o,l,f,g,{commit:e.commit}))return;if(w&&o.keyCode===86){e.setIsPasteFromContextMenu(!1);const b=S=>{Tl(S,!1,n(),t,e.commit),document.removeEventListener("paste",b)};document.addEventListener("paste",b)}else t(o);const p={activeElem:l,listContext:h,cursorPositionType:u,isTargetCell:g,isEmptyText:E,commit:e.commit,wrapEditor:e.wrapEditor,removeTemporaryListClasses:()=>Cj()};if(LY(o,p)||(RY(o,u,E),OY(o,p)))return;const v={...p,parentElement:a,findNodeAtPosition:h0,setCursorSafely:qj};if(MY(o,v)||PY(o,f,g))return;const C={setCursorInsideSpan:HH,isCaretAtEndOfStandardElement:FH,setCursorPositionSimple:$H,commit:e.commit};HX(o,C)&&e.commit()}}function XY(e,t){document.body?.classList.contains("mceNonEditable")||t.isIntegratorLocked()||!e.target?.closest?.('[contenteditable="true"]')||!e.key||e.ctrlKey||e.altKey||e.metaKey||e.key.length===1&&(e.preventDefault(),e.stopImmediatePropagation(),sr("insertText",!1,e.key))}function KY(e){const t=n=>XY(n,e);return document.addEventListener("keydown",t,!0),{dispose(){document.removeEventListener("keydown",t,!0)}}}function YY(e){const t=hY({handlePasteTextFragment:Tl,getCommonStyles:()=>U.get("commonStyles"),changeMsoValue:n=>Mm({target:n.target},r=>e.commit(r)),commit:e.commit});document.addEventListener("keydown",GY({...e,setIsPasteFromContextMenu:n=>t.setFromContextMenu(n)}),!1),document.addEventListener("beforeinput",n=>DX(n,e),!0),KY(e.editLock)}var ZY='<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>',wu=4;function QY(e,t){return e.left<wu||e.right-e.left>t-8?wu-e.left:e.right>t-wu?t-wu-e.right:0}var xi=null,Dp=null;function Bp(e,t){if(typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))return;xi||(xi=new CSSStyleSheet),document.adoptedStyleSheets.includes(xi)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,xi]),xi.replaceSync("");const n=e.getBoundingClientRect();if(n.width===0)return;Dp=e;const r=Math.round(QY(n,document.documentElement.clientWidth));r!==0&&xi.replaceSync(`${t} { margin-left: ${r}px; }`)}function JY(e,t,n){e.addEventListener("mouseenter",()=>{Dp=null,Bp(t,n)}),e.addEventListener("mousemove",()=>{Dp!==t&&Bp(t,n)}),t.addEventListener("mouseenter",()=>Bp(t,n))}function bo(e,t){return{settings:e,elem:t}}var Ge={applicationElementSettingsSet:e=>R(Rt,He)(e),setCursorPosition:e=>R(Rt,Ot)(e),commit:qo};function eZ(){return U.get("emailWidth")||475}function _u(){return document.documentElement.clientWidth<=eZ()}function Hp(e,t,n,r){const o=e;o.style.cursor=n,o.mousemove=t;const i=()=>{window.getSelection()?.removeAllRanges(),Ge.applicationElementSettingsSet({elem:e});const s=document.querySelector("[em-edit]");s&&Ge.setCursorPosition(s),Ie(document.documentElement,!0,"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=h=>{const f=h.touches[0];if(!f)return;h.preventDefault(),c.x+=f.clientX-l.x,c.y+=f.clientY-l.y,l={x:f.clientX,y:f.clientY};const g={x:Math.trunc(c.x),y:Math.trunc(c.y)};g.x===0&&g.y===0||(c.x-=g.x,c.y-=g.y,o.mousemove({movementX:g.x,movementY:g.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(()=>{Ie(document.documentElement,!1,"em-resize-start"),Ge.commit(!1)})}}function yo(e,t,n){Hp(e,t,"ns-resize",n)}function Sa(e,t,n){Hp(e,t,"ew-resize",n)}function tZ(e,t,n){Hp(e,t,"nwse-resize",n)}function vo(e,t){let n=null,r=0;const o=_u();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?_i(bo({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");_i(bo(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?oa(bo({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?oa(bo({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?_i(bo({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&&Ge.commit()}function Eo(e){let t=null;const n=_u();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():Ge.applicationElementSettingsSet({elem:t})}else if(e.closest(".em-gap")){if(t=e.closest(".em-gap"),!t)return;Ge.applicationElementSettingsSet({elem:ih(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?Ge.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-top"):r&&Ge.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?Ge.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-bottom"):r&&Ge.applicationElementSettingsSet({elem:r})}else{if(t=e.closest("td"),!t)return;const r=t.getAttribute("height");r&&parseInt(r)<=0?t.closest("table")?.remove():Ge.applicationElementSettingsSet({elem:t})}t&&Ge.commit()}function Oi(e,t){let n=null,r=0;const o=_u();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)),Ge.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(E=>E.dataset.percent).map(E=>E.dataset.percent);u.length||(u=s.map(E=>((E||0)/a*100).toFixed(1)),vf(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")));const d=l-(s.length-1)*r,m=(E,w)=>Math.round(w*parseFloat(E)/100);let h=s.map((E,w)=>m(u[w],d));const f=l-(h.reduce((E,w)=>E+w,0)+(s.length-1)*r);if(f!==0){const E=h.length-Math.abs(f);h=h.map((w,T)=>E<=T?w+(f>0?1:-1):w)}const g=h;c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((E,w)=>{Array.from(E.querySelectorAll("table[width]")).filter(T=>!T.getAttribute("width")?.includes("%")).forEach(T=>{+(T.getAttribute("width")||0)<=g[w]&&(T.style.maxWidth=String(g[w]),T.setAttribute("width","100%"))})}),n.style.width=r+"px",c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((E,w)=>E.setAttribute("width",String(g[w]))),c.querySelectorAll(".em-gap").forEach(E=>{E.parentElement?.setAttribute("width",String(r)),E.style.width=r+"px";const w=E.querySelector(".em-element-gap-value");w&&(w.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?oa(bo({mobilePadding:{left:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingLeft=r+"px",i.querySelectorAll(":scope > table").forEach(s=>su(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?oa(bo({mobilePadding:{right:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingRight=r+"px",i.querySelectorAll(":scope > table").forEach(s=>su(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&&Ge.commit()}function Ri(e){let t=null;const n=_u();if(e.closest(".em-element-resize-img-container")){const r=e.closest(".em-element-resize-img-container")?.querySelector("img");r&&(Ge.applicationElementSettingsSet({elem:r}),Ge.commit())}else if(e.closest(".em-gap"))t=e.closest(".em-gap"),t&&Ge.applicationElementSettingsSet({elem:ih(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?Ge.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-left"):r&&Ge.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?Ge.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-right"):r&&Ge.applicationElementSettingsSet({elem:r})}t&&Ge.commit()}var NT={getLocale:Ci,commit:qo,messageService:G},nZ=".em-prevent-action",xT=new WeakSet;function rZ(){return U.get("emailWidth")||475}function oZ(){return U.get("isLeftButtonDown")||!1}function iZ(){return U.get("editImageControlEnabled")||!1}function OT(){return U.get("imageCenterEditorEnabled")||!1}function sZ(){return U.get("imageCenterStockEnabled")||!1}function aZ(){return U.get("imageCenterGifEnabled")||!1}function lZ(){return U.get("elementAIimageEnabled")||!1}function cZ(e){if(document.body?.classList.contains("em-native-file-drag"))return;const t=NT.getLocale(),n=rZ(),r=oZ(),o=OT(),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=D({targetElement:e,insertType:"append",className:"em-element-resize-height"});D({targetElement:e,insertType:"append",className:"em-element-vindent"}),D({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),yo(f,function(g){vo(f,g.movementY)},function(){Eo(f)})}if(e.closest(nZ))return;if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.getAttribute("height")&&!e.querySelector(".em-element-vindent-value")){const f=no(e,"em-mob-height"),g=f?parseFloat(f.substring(14,f.length-2)):void 0;D({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(g||e.getAttribute("height"))+"px":e.getAttribute("height")+"px"}),!i||!g?parseInt(e.getAttribute("height")||"0")<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):g<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=D({targetElement:e,insertType:"append",className:"em-element-resize-height"}),g=D({targetElement:e,insertType:"append",className:"em-element-vindent"});D({targetElement:g,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.style.height}),D({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),yo(f,function(E){vo(f,E.movementY)},function(){Eo(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=no(e,"em-mob-height"),g=f?parseFloat(f.substring(14,f.length-2)):void 0;D({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(g||parseFloat(e.style.height))+"px":parseFloat(e.style.height)+"px"}),!i||!g?parseFloat(e.style.height)<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):g<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}const s=no(e,"em-mob-padding_top"),a=s?parseFloat(s.substring(19)):void 0,l=no(e,"em-mob-padding_bottom"),c=l?parseFloat(l.substring(22)):void 0,u=no(e,"em-mob-padding_left"),d=u?parseFloat(u.substring(20)):void 0,m=no(e,"em-mob-padding_right"),h=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=D({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)&&D({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)&&D({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")&&(!h||!i)&&D({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 g=f;(parseFloat(g.style.height)<30||parseFloat(g.style.width)<30)&&f.classList.add("em-vindent_low");const E=D({targetElement:g,insertType:"append",className:"em-element-resize-height"});D({targetElement:g,insertType:"append",className:"em-element-vindent-marker"}),D({targetElement:g,insertType:"append",className:"em-element-vindent-bg"});const w=D({targetElement:g,insertType:"append",className:"em-element-vindent"});let T="";g.className.indexOf("paddingTop")>-1?(T=e.style.paddingTop,yo(E,function(L){vo(E,L.movementY)},function(){Eo(E)})):g.className.indexOf("paddingBottom")>-1?(T=e.style.paddingBottom,yo(E,function(L){vo(E,L.movementY)},function(){Eo(E)})):g.className.indexOf("paddingLeft")>-1?(T=e.style.paddingLeft,Sa(E,function(L){Oi(E,L.movementX)},function(){Ri(E)})):g.className.indexOf("paddingRight")>-1&&(T=e.style.paddingRight,Sa(E,function(L){Oi(E,-L.movementX)},function(){Ri(E)})),D({targetElement:w,insertType:"append",className:"em-element-vindent-value",HTMLcontent:T})}})}if(e.className.length&&e.className?.includes("em-mob-padding")&&!e.closest("editor")&&i&&(a&&!e.querySelector(":scope > .em-vindent-paddingTop")&&D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${a}px`}),c&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${c}px`}),d&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${d}px`}),h&&!e.querySelector(":scope > .em-vindent-paddingRight")&&D({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${h}px`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(f=>{if(!f.querySelector(".em-element-resize-height")){const g=f;(parseFloat(g.style.height)<30||parseFloat(g.style.width)<30)&&f.classList.add("em-vindent_low");const E=D({targetElement:g,insertType:"append",className:"em-element-resize-height"});D({targetElement:g,insertType:"append",className:"em-element-vindent-marker"}),D({targetElement:g,insertType:"append",className:"em-element-vindent-bg"});const w=D({targetElement:g,insertType:"append",className:"em-element-vindent"});let T="";g.className.indexOf("paddingTop")>-1?(T=a,yo(E,function(L){vo(E,L.movementY)},function(){Eo(E)})):g.className.indexOf("paddingBottom")>-1?(T=c,yo(E,function(L){vo(E,L.movementY)},function(){Eo(E)})):g.className.indexOf("paddingLeft")>-1?(T=d,Sa(E,function(L){Oi(E,L.movementX)},function(){Ri(E)})):g.className.indexOf("paddingRight")>-1&&(T=h,Sa(E,function(L){Oi(E,-L.movementX)},function(){Ri(E)})),D({targetElement:w,insertType:"append",className:"em-element-vindent-value",HTMLcontent:String(T)})}})),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=no(e.closest('[em="block"]')?.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),"em-mob-height"),g=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(E=>{D({targetElement:E,insertType:"append",className:"em-gap",style:i?`height: ${g}px;`:`width: ${E.getAttribute("width")}px;`})}),e.closest('[em="block"]')?.querySelectorAll(".em-gap").forEach(E=>{if(!E.querySelector(".em-element-resize-height")){const w=E,T=D({targetElement:w,insertType:"append",className:"em-element-resize-height"});D({targetElement:w,insertType:"append",className:"em-element-gap-marker"}),D({targetElement:w,insertType:"append",className:"em-element-gap-bg"});const L=D({targetElement:w,insertType:"append",className:"em-element-gap"});let y="";i?(y=w.style.height,yo(T,function(p){vo(T,p.movementY)},function(){Eo(T)})):(y=w.style.width,Sa(T,function(p){Oi(T,p.movementX)},function(){Ri(T)})),D({targetElement:L,insertType:"append",className:"em-element-gap-value",HTMLcontent:y})}})}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 T=f.closest(".em-element-resize-img-container"),L=T.querySelector(".em-element-img-edit");!f.getAttribute("src")?.includes(".gif")&&o?L||D({targetElement:T.querySelector(".em-element-img-change-group"),insertType:"prepend",className:"em-element-img-edit",tag:"i",HTMLcontent:Le(ba,`${ke}`),title:t.CHANGE_IMAGE_EDIT}):T.querySelector(".em-element-img-edit")?.remove()}return}const g=document.createElement("span");g.classList.add("em-element-resize-img-container"),Vy(g);const E=f.parentElement instanceof HTMLAnchorElement?f.parentElement:f;E.parentElement?.insertBefore(g,E),g.appendChild(E);const w=D({targetElement:g,insertType:"append",tag:"span",className:"em-element-resize-img"});tZ(w,function(T){Oi(w,T.movementX)},function(){Ri(w)}),f?.style.maxWidth&&f?.style.display==="block"&&f.closest(".em-element-resize-img-container")?.classList.add("em-display-block"),uZ(f,g)}}}function uZ(e,t){const n=NT;if(!n||t.querySelector(".em-element-img-change-group"))return;const r=n.getLocale(),o=iZ(),i=OT(),s=sZ(),a=aZ(),l=lZ();if(o&&e.getBoundingClientRect().width>40&&e.getBoundingClientRect().height>40&&!e.classList.contains("em-countdown")){const c=D({targetElement:t,insertType:"append",className:"em-element-img-change-group"});if(D({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&&D({targetElement:c,insertType:"append",className:"em-element-img-edit",tag:"i",HTMLcontent:Le(ba,`${ke}`),title:r.CHANGE_IMAGE_EDIT}),s&&D({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}),D({targetElement:c,insertType:"append",className:"em-element-img-changeto",tag:"i",HTMLcontent:Le(ZY,`${ke}`),title:r.CHANGE_IMAGE_CHANGETO}),a&&D({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&&D({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),xT.has(c))return;xT.add(c),JY(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 h="application_open-image-edit-popup";e.classList.contains("em-ai-img")||d?.classList.contains("em-element-img-ai")?h="application_open-image-ai-popup":T$(m)||d?.classList.contains("em-element-img-changeto")?h="application_open-image-upload-popup":d?.classList.contains("em-element-img-gif")?h="application_open-image-gif-popup":d?.classList.contains("em-element-img-stock")&&(h="application_open-image-stock-popup");const f={operation:h,src:m};setTimeout(()=>{n.messageService.send(f)},100)})}}function RT(e){const t=e.ownerDocument.activeElement;return t instanceof HTMLElement&&t!==e.ownerDocument.body&&t.closest('[contenteditable="true"]')!==null&&e.contains(t)}function dZ(e){const t=(n,r)=>{RT(n)||e.wrapEditor(n,r)};return function(r){let o=r.target;const i=e.selectionLock.acquire();try{o=e.getVisibleNode(o);const s=e.isInExternal(o),a=document.body;if(a?.classList.contains("mceNonEditable")&&!a.classList.contains("em-sandbox-discuss")||a?.classList.contains("em-sandbox-discuss")&&!a.classList.contains("em-sandbox-discuss_set-target"))return;if(a?.classList.contains("em-sandbox-discuss_set-target")){document.querySelectorAll('[em-hover="true"]').forEach(m=>{m.removeAttribute("em-hover"),m.removeAttribute("contenteditable")}),o.closest(".em-element-vindent")||(o.setAttribute("em-hover","true"),o.setAttribute("contenteditable","true"));return}if(o.tagName!=="BODY"){const m=o.parentElement;fw(o)&&!o.isConnected&&m&&(o=m)}if(o&&(o?.closest('[em="atom"]')||!s)&&o.getAttribute("contenteditable")!=="false"&&o.parentElement?.getAttribute("contenteditable")!=="false"&&o.tagName!=="BODY"&&o.parentElement?.tagName!=="SECTION"){const m=!o.closest("editor")&&!RT(o),h=!e.getLockEditorInit(),f=o.tagName!=="IMG",g=!(o.childElementCount===1&&o.firstElementChild?.tagName==="IMG"&&(o.textContent?.trim()??"")==="");if(m&&h&&f&&g){let E=o;do if(E=E.closest("div, p, h1, h2, h3, h4, h5")||E.closest("span, b, strong, i, em, s, a, sup, sub"),E)if(!e.isVisible(E))E=E.parentElement;else break;while(E);if(o.tagName==="LI"&&o.style.fontFamily&&o.style.fontSize){const w=o.closest("ul, ol");w&&t(w,!0)}else if(o.tagName==="TD"&&o.style.fontFamily&&o.style.fontSize&&!o.querySelector("editor"))t(o);else if(E&&E.style.fontFamily&&E.style.fontSize&&(o.tagName==="LI"||!o.querySelector("img")))if(o.tagName==="LI"){const w=o.closest("ul, ol");w&&t(w,!0)}else o.querySelector("img")||t(o,!0);else if(E&&E.closest('[style*="font-family"][style*="font-size"]')){const w=E.closest('[style*="font-family"][style*="font-size"]');w&&w.tagName!=="BODY"&&w.tagName!=="TD"&&w.tagName!=="TABLE"?t(w,!1):w?.tagName==="TD"&&!w.querySelector("editor")&&!w.closest(".em-element-custom-table")&&t(w)}else if(E&&E?.tagName==="DIV"&&!E.querySelector("table")){const w=!!E.style.height?.length,T=E.className.includes("em-element-img-change-group"),L=E.querySelector("img")?.parentNode,y=!!E.querySelector("img")&&L&&!e.hasTextNodeInElement(L);!w&&!T&&!y&&t(E,!0)}else for(let w=0;w<o.childNodes.length;w++){const T=o.childNodes[w];if(T.nodeName==="#text"&&(T.textContent?.trim().length??0)>0&&!o.querySelector("table")){const L=o.tagName==="P"?o.parentElement:o;L&&t(L);break}}}}(o?.closest('[em="atom"]')||!s)&&!e.getIsLeftButtonDown()&&e.implementElementsEditors(o),o?.classList.contains("em-element-vindent-bg")&&(o=o.closest(".em-vindent")),o?.closest(".em-gap")?o.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(even) .em-gap").forEach(m=>m.classList.add("em-hover")):e.getIsLeftButtonDown()||document.querySelectorAll(".em-gap").forEach(m=>m.classList.remove("em-hover"));const l=e.getLoadStylesTimer(),c=!!o.style.padding||!!o.style.paddingTop||!!o.style.paddingBottom||!!o.style.paddingLeft||!!o.style.paddingRight,u=o.closest('[em="block"]'),d=!!u?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(u?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length??0)>2;l&&(o.tagName==="TD"&&(o.innerHTML===""||o.querySelector(".em-element-vindent"))&&o.getAttribute("height")||o.tagName==="DIV"&&o.style.height&&o.style.fontSize||o.tagName==="IMG"||c||d)&&e.implementResizableElems(o)}catch{}finally{i.releaseLater()}}}function fZ(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 Cu(e){e.button===0&&U.set("isLeftButtonDown",!1)}function MT(e){e.shiftKey||e.button===2||window.getSelection()?.removeAllRanges(),e.button===0&&U.set("isLeftButtonDown",!0)}function mZ(e){const t=()=>e.openEditorInit();return document.addEventListener("mousedown",MT),document.addEventListener("mouseup",Cu),document.addEventListener("dragend",Cu),window.addEventListener("mousemove",t),{dispose(){document.removeEventListener("mousedown",MT),document.removeEventListener("mouseup",Cu),document.removeEventListener("dragend",Cu),window.removeEventListener("mousemove",t)}}}function hZ(e,t,n){if(e.caretPositionFromPoint){const r=e.caretPositionFromPoint(t,n);if(!r)return null;const o=e.createRange();return o.setStart(r.offsetNode,r.offset),o.collapse(!0),o}return e.caretRangeFromPoint?.(t,n)??null}function pZ(e){return function(n){const r=n.target;if(n.button!==0||n.shiftKey||!(r instanceof HTMLElement)||e.isEditLocked()||document.body?.classList.contains("mceNonEditable")||r.closest("editor")||(e.unlockEditorInit(),e.handleMouseover(n),r.closest("em-replace")))return;const o=(r.isConnected?r:document.elementFromPoint(n.clientX,n.clientY))?.closest("editor");if(!o)return;const i=hZ(document,n.clientX,n.clientY);if(i&&o.contains(i.startContainer)){const s=window.getSelection();s?.removeAllRanges(),s?.addRange(i)}}}function PT(e,t,n){const r=ra(e,n),o=r===void 0?void 0:t.cells.find(i=>i.id===r);return o?{row:o.row,col:o.col}:null}function gZ(){const e=new Map,t=r=>{Ie(r,!1,e.get(r)),e.delete(r)},n=(r,o)=>{Ie(r,!0,o),e.set(r,o)};return{paint(r){const o=new Set(r);[...e].filter(([i,s])=>s==="em-active-table-cell"&&!o.has(i)).forEach(([i])=>t(i)),r.filter(i=>!e.has(i)).forEach(i=>n(i,co))},mark:n,highlighted(){return[...e].filter(([,r])=>r===co).map(([r])=>r)},clear(){[...e.keys()].forEach(t)}}}function bZ(e,t){const n=gZ();let r=null,o=null,i=null;const s=()=>r&&e.contains(r)&&r.classList.contains("remove-basic-cell")?r:null,a={base:s,direction:()=>s()?i:null,selected:()=>s()?n.highlighted().filter(l=>e.contains(l)):[],start(l){t.activate(a),a.clear(),r=l,n.mark(l,lo)},clear(){r=null,o=null,i=null,n.clear(),aW(e)&&e.isConnected&&t.commit(!0)}};return{selection:a,press(l){a.start(l);const c=Ei(e),u=PT(e,c,l);o=u?{model:c,base:u}:null},hover(l){const c=o&&PT(e,o.model,l);if(!o||!c)return;const u=cq(o.model,o.base,c);i=u?.direction??null;const d=(u?.cellIds??[]).map(m=>Ih(e,m));n.paint(d.filter(m=>!!m))},release(){o=null}}}function Tu(e,t,n,r){const o=mt(r);t.addEventListener(n,o),e.addEventListener("abort",()=>t.removeEventListener(n,o),{once:!0})}function yZ(e,t,n){const r=new AbortController,o=()=>e.isConnected?!1:(r.abort(),t.selection.clear(),n.forget(e,t.selection),!0),i=u=>{const d=Op(u.target);return d?.table===e?d.td:null},s=u=>{const d=u.button===0?i(u):null;d&&t.press(d)},a=u=>{if((u.buttons&1)===0){t.release();return}const d=i(u);d&&t.hover(d)},l=()=>{o()||t.release()},c=u=>{!o()&&u.target instanceof Node&&!e.contains(u.target)&&t.selection.clear()};Tu(r.signal,e,"mousedown",s),Tu(r.signal,e,"mouseover",a),Tu(r.signal,document,"mouseup",l),Tu(r.signal,document,"click",c)}function vZ(e){return t=>{const n=Op(t.target);n&&e.of(n.table)}}function EZ(e){const t=new WeakMap;let n=null;const r={commit:e.commit,activate(o){n&&n!==o&&n.clear(),n=o},forget(o,i){t.delete(o),n=n===i?null:n}};return{of(o){const i=t.get(o);if(i)return i;const s=bZ(o,r);return yZ(o,s,r),t.set(o,s.selection),s.selection}}}var SZ=1e3;function wZ(e){setTimeout(()=>U.set("loadStylesTimer",!0),SZ);const t=dZ({getVisibleNode:n=>e.htmlDocument.getVisibleNode(n),isInExternal:n=>e.htmlDocument.isInExternal(n),isVisible:n=>e.htmlDocument.isVisible(n),selectionLock:e.selectionLock,getLockEditorInit:()=>e.editLock.isEditorInitClosed(),getIsLeftButtonDown:()=>!!U.get("isLeftButtonDown"),getLoadStylesTimer:()=>!!U.get("loadStylesTimer"),hasTextNodeInElement:EP,wrapEditor:e.wrapEditor,implementElementsEditors:n=>AY(n,{setBlockGroupControlsPosition:()=>Ic({scrollTop:U.get("scrollTop")}),commit:e.commit}),implementResizableElems:n=>cZ(e.htmlDocument.getVisibleNode(n)),commit:e.commit});document.onmouseover=mt(n=>{t(n),e.onHover?.(n.target)}),document.onmouseleave=fZ({removeElementEditors:()=>Li(void 0),commit:e.commit}),document.addEventListener("mousedown",pZ({isEditLocked:()=>e.editLock.isTextLocked(),unlockEditorInit:()=>e.editLock.openEditorInit(),handleMouseover:t}),!0),document.addEventListener("mousedown",mt(vZ(e.tableSelections)),!0),mZ(e.editLock)}function _Z(e){return t=>R(e,Ki)(t)}function CZ(e){return e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement??null}var TZ={name:"sandbox.elementSettings",provides:[He],awaits:{services:[K,ko,Lo,Me]},setup(e){const t=R(e,ko);e.inject(He,$j({htmlDocument:R(e,K),getMapObj:()=>t,fingerprint:R(e,Lo),selectionLock:R(e,Me),enrichExtras:()=>e.getServices(qg).reduce((n,r)=>({...n,...r()}),{})}))}},AZ={name:"sandbox.documentChange",awaits:{services:[K,Lo,He,ft,Te,Ki,Me,nt]},setup:e=>yH({htmlDocument:R(e,K),fingerprint:R(e,Lo),initPreview:_Z(e),applicationElementSettingsSet:R(e,He),commit:lt(e),focusController:R(e,ft).controller,selectionLock:R(e,Me),editLock:R(e,nt)})},kZ={name:"sandbox.toggleTextStyle",provides:[Wa],awaits:{services:[He,Te,Me]},setup(e){const t=R(e,He),n=lt(e),r=R(e,Me),o=(i,s=Ye())=>{let a=CZ(bs(s,i)||i);if(a?.tagName==="EDITOR"&&(a=a.firstElementChild),!a)return;const l=a;r.lift(()=>t({elem:l}))};e.inject(Wa,VX({commit:n,addNewRange:jo,refreshElementSettings:o,findElementWithSelectedText:bs,getParentElementOfSelection:kl,findOutermostParentWithText:yf,clearLinkTags:i=>{ho(i,n),$r(n)},addFontFamilyClass:i=>ta(i,n),getIsProgrammaticSelection:()=>!!U.get("isProgrammaticSelection"),getCommonStyles:()=>U.get("commonStyles")??{}}))}},LZ={name:"sandbox.insert",provides:[No],awaits:{services:[K,He,Te,sd,Me,nt]},setup:e=>e.inject(No,mY({htmlDocument:R(e,K),commit:lt(e),messageService:G,applicationElementSettingsSet:R(e,He),selectionLock:R(e,Me),editLock:R(e,nt),...R(e,sd)}))},NZ={name:"sandbox.elementSettingsApply",provides:[qa],awaits:{services:[K,ko,Te,Ot,He,Wa,hn,ft,Me]},setup(e){const t=R(e,Te),n=R(e,ko),r=R(e,Ot),o=R(e,He);let i=null;const s=l=>{i??(i=NX({htmlDocument:R(e,K),getMapObj:()=>n,commit:lt(e),commitLockedAsync:c=>t.commitLockedAsync(c),setCursorPosition:r,applicationElementSettingsSet:o,selectionLock:R(e,Me),toggleTextStyle:R(e,Wa),wrapEditor:R(e,hn).now,programmaticSelection:{get value(){return!!U.get("isProgrammaticSelection")},set value(c){U.set("isProgrammaticSelection",c)}}})),i(l)},a=R(e,ft).controller;e.inject(qa,l=>a.whenEditorLostFocus(()=>s(l)))}},xZ={name:"sandbox.tableSelections",provides:[xo],awaits:{services:[Te]},setup:e=>e.inject(xo,EZ({commit:lt(e)}))},OZ={name:"sandbox.mouse",awaits:{services:[K,hn,Te,Me,nt,xo]},setup:e=>wZ({htmlDocument:R(e,K),commit:lt(e),selectionLock:R(e,Me),editLock:R(e,nt),wrapEditor:R(e,hn).deferred,tableSelections:R(e,xo)})},RZ={name:"sandbox.click",awaits:{services:[K,Te,Ot,ft,He,hn,Me,nt,xo]},setup(e){const t=R(e,Te),n=R(e,ft);nY({htmlDocument:R(e,K),commit:lt(e),commitLockedAsync:r=>t.commitLockedAsync(r),messageService:G,setCursorPosition:R(e,Ot),setEditorFocus:r=>n.setEditorFocus(r),applicationElementSettingsSet:R(e,He),selectionLock:R(e,Me),editLock:R(e,nt),wrapEditor:R(e,hn).now,tableSelections:R(e,xo),insertTextAtomIntoEmptyNarrowTable:r=>e.getInstance(Wg)?.(r)??!1})}},MZ={name:"sandbox.keyboard",awaits:{services:[Te,Ot,He,hn,nt]},setup:e=>YY({editLock:R(e,nt),commit:lt(e),messageService:G,setCursorPosition:R(e,Ot),applicationElementSettingsSet:R(e,He),wrapEditor:R(e,hn).now})},PZ={name:"sandbox.cssFilterOnCommit",awaits:{services:[K]},setup:e=>a7(R(e,K))},IZ={name:"sandbox.vmlButtonLabelSync",awaits:{services:[Te]},setup(e){const t=R(e,Te);UX(n=>t.commit(n))}},DZ={name:"sandbox.insertListeners",awaits:{services:[No]},setup:e=>R(e,No).register()};function IT(e,t,n,r=""){or(t.HTMLDocument.getOuterHtml(e)+r,([o,...i])=>!(o instanceof Element)||!n(o,i)?!1:(o.setAttribute("em-edit","active"),e.replaceWith(o),!0))&&t.commit(!0)}function BZ(e,t){const n=t.selectionLock.acquire();try{const r=t.getActiveEditElement();if(!r)return;const o=r.closest("amp-accordion");if(!o)return;const i=o.querySelector("section");if(!i)return;IT(o,t,(a,[l])=>{if(!(l instanceof Element))return!1;const c=l.querySelector(":scope > header td div");if(c){const d=Array.from(c.childNodes).find(m=>m.nodeType===Node.TEXT_NODE);d&&(d.nodeValue=e.section)}const u=l.querySelector(":scope > div");return u&&(u.innerHTML=`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom">
|
|
251
|
+
<tr>
|
|
252
|
+
<td style="padding: 10px 0;">
|
|
253
|
+
<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>
|
|
254
|
+
</td>
|
|
255
|
+
</tr></table>`),a.append(l),!0},t.HTMLDocument.getOuterHtml(i))}catch{}finally{n.releaseLater()}}function HZ(e,t){const n=t.selectionLock.acquire();try{const r=t.getActiveEditElement();if(!r)return;const o=r.closest("amp-accordion");if(!o)return;IT(o,t,i=>(i.querySelectorAll("section")[e.index]?.remove(),!0))}catch{}finally{n.releaseLater()}}function DT(e){return{selectionLock:e.selectionLock,commit:e.commit,getActiveEditElement:e.getActiveEditElement,HTMLDocument:e.HTMLDocument}}function FZ(e,t){!t.selectionLock||!t.HTMLDocument||!t.getActiveEditElement||BZ(e.data.settings,DT(t))}function $Z(e,t){!t.selectionLock||!t.HTMLDocument||!t.getActiveEditElement||HZ(e.data.settings,DT(t))}var WZ={sandbox_accordion_add_section:FZ,sandbox_accordion_remove_section:$Z};function qZ(e,t){pr(),Ie(document.body,!1,"em-block-insert-body","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 zZ(e,t){const{htmlDocument:n}=t;t.messageService.send({operation:"application_email_content_get",htmlCode:n.getOuterHtml(document.body)||n.getRootsHtml()})}var UZ={"sandbox_drag-cancel":qZ,sandbox_email_content_get:zZ};function jZ(e,t){const n=e.data.settings?.emBlockId;if(n==null||n==="")return;const r=e.data.settings?.emBlockVersion;let o=W_()??null;if(!o){const i=Array.from(document.querySelectorAll('[em="block"]:not([em="block"] [em="block"])')),s=i.filter(a=>a.getAttribute("em-block-id")===String(n));o=s.length===1?s[0]:s.length===0&&i.length===1?i[0]:null}o&&(o.setAttribute("em-block-id",String(n)),r!=null&&r!==""&&o.setAttribute("em-block-version",String(r)),t.commit())}function VZ(e,t){const n=W_();!n||!n.hasAttribute("em-block-id")||(n.removeAttribute("em-block-id"),n.removeAttribute("em-block-version"),t.commit())}var GZ={sandbox_eblock_set_em_block_id:jZ,sandbox_eblock_clear_em_block_id:VZ};function BT(e){return e.replace(/\b(\d{1,3}(?:[ \xA0]\d{3})*(?:[.,]\d+)?)\b/g,t=>t.replace(/[ \xA0]/g,"").replace(/\B(?=(\d{3})+(?!\d))/g," ")).replace(/(\d[\d ]*[.,]?\d+)(?:\s| )?(?=(?:руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB))/gi,"$1 ").replace(/(\d[\d ]*[.,]?\d+) (руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB)/gi,"$1 $2")}function HT(e,t){for(const n of e)n.type===I.HTML&&!Pa(n,n.parent)&&(n.content=t(n.content??"")),HT(n.children,t)}function XZ(e,t){const n=fn(e);HT(n.roots,t);const r=document.createDocumentFragment(),o=yg(void 0);try{r.append(...n.roots.map(i=>Kr(i,!0,!0)))}finally{o()}return zo(r),r}var KZ=`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 Au(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem.previousSibling&&Au({elem:e.elem.previousSibling})}function ku(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(),ku({elem:t})));else if(e.elem.innerHTML.trim()==="")Au({elem:e.elem}),e.elem.remove(),ku({elem:t});else if(t&&!t.querySelector('div[style*="display"]')){for(const n of e.elem.childNodes)n.nodeName==="#text"&&n.textContent?.trim()===""?(Au({elem:n}),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(Au({elem:n}),n.remove());e.elem.innerHTML.trim()===""&&ku({elem:e.elem})}return!0}function YZ(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&&(eo(o),o.remove()),ku({elem:r}),e.commit(),e.messageService.send({operation:"application_element_settings_close"})}function ZZ(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>`;Jn(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",KZ),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")&&rQ(e,t).catch(r=>{})}var QZ=/^(script|style|noscript|xmp|iframe|noembed|noframes)$/i,FT=/^[ \t\n\r\f]*$/;function $T(e,t,n){const{copy:r,counterpart:o}=hl(e),i=JZ(e,o),s=c=>{const u=i.get(c);return!!u&&Gy(u)},a=XZ(t(r.innerHTML),n),l=new Map;qT(r,a,l,s)&&i.forEach((c,u)=>l.get(u)?.(c))}function JZ(e,t){const n=new Map,r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ALL);for(let o=r.nextNode();o;o=r.nextNode()){const i=t(o);i&&n.set(i,o)}return n}function WT(e){return[...(e instanceof HTMLTemplateElement?e.content:e).childNodes]}function qT(e,t,n,r){const o=WT(e),i=WT(t);let s=0;for(let a=0;a<o.length;){const l=o[a],c=i[s];if(l.nodeType===Node.TEXT_NODE){const u=tQ(o,a);a+=u.length;const d=c?.nodeType===Node.TEXT_NODE;if(!d&&!u.every(m=>FT.test(m.data))||(s+=d?1:0,!zT(u,d?c.data:"",n,r)))return!1;continue}if(!c||c.nodeType!==l.nodeType||!eQ(l,c,r(l)))return!1;if(a+=1,s+=1,l.nodeType===Node.COMMENT_NODE){if(!zT([l],c.data,n,r))return!1}else if(l.nodeType===Node.ELEMENT_NODE&&(r(l)&&nQ(l,c,n),!QZ.test(l.nodeName)&&!qT(l,c,n,r)))return!1}return s===i.length}function eQ(e,t,n){return t.nodeName===e.nodeName||!n&&t.nodeName.toLowerCase()===e.nodeName.toLowerCase()}function tQ(e,t){const n=[];for(let r=t;r<e.length&&e[r].nodeType===Node.TEXT_NODE;r+=1)n.push(e[r]);return n}function zT(e,t,n,r){if(e.map(i=>i.data).join("")===t)return!0;const o=e.filter(r);return o.length===0?!0:e.some(i=>!r(i)&&!FT.test(i.data))?!1:(o.forEach((i,s)=>n.set(i,a=>a.data=s===0?t:"")),!0)}function nQ(e,t,n){const r=[...t.attributes].filter(i=>e.getAttribute(i.name)!==i.value),o=[...e.attributes].filter(i=>!t.hasAttribute(i.name));r.length===0&&o.length===0||n.set(e,i=>{o.forEach(s=>i.removeAttribute(s.name)),r.forEach(s=>i.setAttribute(s.name,s.value))})}async function rQ(e,t){const{default:n}=await Wd(async()=>{const{default:l}=await Promise.resolve().then(()=>Iu("./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("<!--","-->");const a=l=>s.execute(l);eo(document.body),e.action==="typograf_all"?$T(document.body,a,BT):r?.parentElement&&(r=r.parentElement,r?.parentElement&&$T(r.parentElement,a,BT)),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 UT(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function Fp(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 oQ(e,t){const n=e.closest("a");if(Fp(n))return n;if(!t)return null;const r=UT(t.anchorNode)?.closest("a")??null;if(Fp(r))return r;const o=UT(t.focusNode)?.closest("a")??null;return Fp(o)?o:null}function jT(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"&&o_(e)?e.closest('[em="block"]')??e:e}function VT(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"?pi(e)??e:e:null}function iQ(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=window.getSelection();if(oQ(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 sQ(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=VT(jT(t).previousElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function aQ(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=VT(jT(t).nextElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function lQ(e,t){t.removeAllAttributes("em-edit");const n=document.querySelector(".em-editor-wrapper");n&&(n.style.display="none"),Mt(()=>document.querySelectorAll("editor").forEach(r=>{r.blur()}))}function cQ(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 uQ(e,t){t.removeAllAttributes("em-state");const n=t.elementPath[e.data.index??0];n?.elem&&n.elem.setAttribute("em-state","active")}function dQ(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};iQ(n)}function fQ(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};sQ(n)}function mQ(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};aQ(n)}function hQ(e,t){if(!t.getElementParent)return;const n={commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,getVariableByIcon:t.getVariableByIcon};YZ(n)}function pQ(e,t){if(!t.getElementParent)return;const n={action:e.data.action,locale:e.data.locale},r={commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,HTMLDocument:t.HTMLDocument,hasRussianText:t.hasRussianText};ZZ(n,r)}var gQ={sandbox_element_active_reset:lQ,sandbox_element_active_set:cQ,sandbox_element_hover_set:uQ,sandbox_element_parent_get:dQ,sandbox_element_prev_get:fQ,sandbox_element_next_get:mQ,sandbox_element_remove:hQ,sandbox_element_text:pQ},Cn=".em-mob-wrap, .noresp-em-mob-wrap",Lt=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",it='div[style*="inline-block"]';function So(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&&So({elem:e.elem.previousSibling,width:e.width})}function GT(e){const t=e.removedBlockIndex===0?"nextSibling":"previousSibling";e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem[t]&>({elem:e.elem[t],removedBlockIndex:e.removedBlockIndex})}function Lu(e){return!!e.querySelector(Cn)||!!e.closest(Cn)}function wa(e){return e.querySelector(Cn)?document.querySelector('[em-edit="active"]'):e.closest(Cn).parentElement}function Nu(e){return e.querySelector(it)?document.querySelector('[em-edit="active"]'):e.closest(it).parentElement}function bQ(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const r=t.selectionLock.acquire();try{if(Lu(n)){const o=wa(n),i=e.minWidth,s=o.querySelectorAll(Lt).length,a=s>1?parseFloat(String(e.gap)):20,l=s>1?parseFloat(String(e.gapMobile||e.gap)):20;let c="";o.querySelector(".em-mob-wrap")?c=`<td width="${a}" class="em-mob-wrap em-mob-height-${l}px"></td>
|
|
256
|
+
<td width="${i}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:o.querySelector(".noresp-em-mob-wrap")&&(c=`<td width="${a}" class="noresp-em-mob-wrap noresp-em-mob-height-${l}px"></td>
|
|
257
|
+
<td width="${i}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`);let u=0,d=0,m=0;o.querySelectorAll(Lt).forEach(f=>{parseFloat(f.getAttribute("width")||"0")>i&&m++,u+=parseFloat(f.getAttribute("width")||"0")});const h=(i+a)/m;if(o.querySelectorAll(Lt).forEach(f=>{if(parseFloat(f.getAttribute("width")||"0")>i){const g=Math.round(parseFloat(f.getAttribute("width")||"0")-h);f.setAttribute("width",String(g))}}),Jn(o.querySelectorAll(Lt)[s-1],"afterend",c),o.querySelectorAll(Lt).forEach(f=>{d+=parseFloat(f.getAttribute("width")||"0")}),u-d-a!==0){const f=o.querySelector(Cn),g=parseFloat(f.getAttribute("width")||"0")+(u-d-a);f.setAttribute("width",String(g))}t.setPercentsForColumns(o.querySelectorAll(Lt)),t.commit()}else{const o=Nu(n),i=e.minWidth,s=o.querySelectorAll(it).length,a=s>1?parseFloat(String(e.gap)):20,l='<!--[if (gte mso 9)|(IE)]></td><td width="'+(i+a)+`" valign="top"><![endif]-->
|
|
258
|
+
<div style="display: inline-block; width: `+(i+a)+`px; vertical-align: top;" class="em-mob-width-100perc">
|
|
259
|
+
<table width="`+i+`" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
260
|
+
<tr>
|
|
261
|
+
<td align="left"></td>
|
|
262
|
+
</tr>
|
|
263
|
+
</table>
|
|
264
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
265
|
+
</div>`;let c=0,u=0,d=0;if(s===1){const h=n.querySelector(it)?o.querySelector(it):n.closest(it);h.style.removeProperty("max-width"),h.firstElementChild?.style.removeProperty("max-width"),h.firstElementChild?.style.removeProperty("width")}o.querySelectorAll(it).forEach(h=>{const f=parseFloat(h.firstElementChild?.getAttribute("width")||"0");f>i&&d++,c+=f});const m=(i+a)/d;if(o.querySelectorAll(it).forEach(h=>{const f=h;if(parseFloat(f.firstElementChild?.getAttribute("width")||"0")>i){const g=Math.round(parseFloat(f.style.width)-m),E=g-a;f.style.width=g+"px",So({elem:f,width:g}),f.firstElementChild?.tagName==="TABLE"&&f.firstElementChild.setAttribute("width",String(E))}}),Jn(o.querySelectorAll(it)[s-1],"afterend",l),o.querySelectorAll(it).forEach(h=>{u+=parseFloat(h.firstElementChild?.getAttribute("width")||"0")}),c-u-a!==0){const h=o.querySelector(it),f=parseFloat(h.style.width)+(c-u-a);h.style.width=f+"px",So({elem:h,width:f}),h.firstElementChild?.tagName==="TABLE"&&h.firstElementChild.setAttribute("width",String(f-a))}t.commit()}}catch{}finally{r.releaseLater()}}function yQ(e,t){const n=document.querySelector("[em-edit]");if(!n)return;let r=null;const o=t.selectionLock.acquire();try{if(Lu(n)){const i=wa(n);let s=0;const a=parseFloat(String(e.gap));i.querySelectorAll(Lt).forEach((u,d)=>{d===e.removedBlockIndex&&(s=parseFloat(u.getAttribute("width")||"0"),u===n.closest(Cn)&&(n.closest(".em-structure > td")?.setAttribute("em-edit","active"),r=n.closest(".em-structure > td")),u.nextElementSibling&&u.previousElementSibling?u.previousElementSibling.remove():u.nextElementSibling&&!u.previousElementSibling?u.nextElementSibling.remove():!u.nextElementSibling&&u.previousElementSibling&&u.previousElementSibling.remove(),u.remove())});const l=i.querySelectorAll(Lt).length,c=Math.floor((s+a)/l);if(i.querySelectorAll(Lt).forEach(u=>{const d=Math.round(parseFloat(u.getAttribute("width")||"0")+c);u.setAttribute("width",String(d))}),l===1){const u=i.querySelector(Cn),d=u.closest("table").parentElement;u.setAttribute("width",String(d.getBoundingClientRect().width-parseFloat(d.style.paddingLeft||"0")-parseFloat(d.style.paddingRight||"0")))}t.setPercentsForColumns(i.querySelectorAll(Lt))}else{const i=Nu(n);let s=0;const a=parseFloat(String(e.gap));i.querySelectorAll(it).forEach((u,d)=>{d===e.removedBlockIndex&&(s=parseFloat(u.style.width),u===n.closest(it)&&n.closest(".em-structure > td")?.setAttribute("em-edit","active"),GT({elem:u,removedBlockIndex:e.removedBlockIndex}),u.remove())});const l=i.querySelectorAll(it).length,c=Math.round(s/l);if(i.querySelectorAll(it).forEach(u=>{const d=u,m=Math.round(parseFloat(d.style.width)+c),h=m-a;d.style.width=m+"px",So({elem:d,width:m}),d.firstElementChild?.tagName==="TABLE"&&d.firstElementChild.setAttribute("width",String(h))}),l===1){const u=i.querySelector(it);u.style.width="100%",u.style.maxWidth=i.closest("table")?.style.maxWidth||"",So({elem:u,width:i.closest("table")?.style.maxWidth||""}),u.firstElementChild.style.width="91%",u.firstElementChild.style.maxWidth=parseFloat(u.firstElementChild?.getAttribute("width")||"0")+"px"}}}finally{t.commit(),Promise.resolve().then(()=>{o.release(),r&&t.applicationElementSettingsSet&&t.applicationElementSettingsSet({elem:r})})}}function XT(e,t){const n=document.createComment("em-swap");e.replaceWith(n),t.replaceWith(e),n.replaceWith(t)}function vQ(e){e instanceof Element&&(e.querySelectorAll("editor").forEach(t=>{t.replaceWith(...Array.from(t.childNodes))}),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")),e.removeAttribute("em-edit"),e.querySelectorAll("[em-temp]").forEach(t=>t.remove()))}function KT(e,t=""){or(t+ds(e),n=>{n.forEach(vQ),e.after(...n)})}function EQ(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{copiedBlockIndex:r,widths:o}=e,i=parseFloat(String(e.gap))||0,s=t.selectionLock.acquire();try{if(Lu(n)){const a=wa(n),l=a.querySelectorAll(Lt)[r];if(!l)return;const c=l.nextElementSibling||l.previousElementSibling;KT(l,c?ds(c):a.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>`);const u=a.querySelectorAll(Lt);u.forEach((d,m)=>{o[m]!=null&&d.setAttribute("width",String(o[m]))}),t.setPercentsForColumns(u),t.commit()}else{const a=Nu(n),l=a.querySelectorAll(it)[r];if(!l)return;KT(l,'<!--[if (gte mso 9)|(IE)]></td><td width="'+((o[r+1]??o[r]??0)+i)+`" valign="top"><![endif]-->
|
|
266
|
+
`),a.querySelectorAll(it).forEach((c,u)=>{const d=c,m=o[u];if(m==null)return;const h=m+i;d.style.width=h+"px",So({elem:d,width:h}),d.firstElementChild?.tagName==="TABLE"&&d.firstElementChild.setAttribute("width",String(m))}),t.commit()}}catch{}finally{s.releaseLater()}}function SQ(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{indexA:r,indexB:o}=e;if(r===o)return;const i=t.selectionLock.acquire();try{if(Lu(n)){const s=wa(n),a=s.querySelectorAll(Lt),l=a[r],c=a[o];if(!l||!c)return;XT(l,c),t.setPercentsForColumns(s.querySelectorAll(Lt)),t.commit()}else{const s=Nu(n).querySelectorAll(it),a=s[r],l=s[o];if(!a||!l)return;XT(a,l),[a,l].forEach(c=>{So({elem:c,width:parseFloat(c.style.width)})}),t.commit()}}finally{i.releaseLater()}}function wQ(e,t){const n=t.selectionLock.acquire();try{const r=document.querySelector("[em-edit]");if(!r)return;const o=wa(r);if(e.wrap)o.querySelectorAll(Cn).forEach((i,s)=>{i.classList.remove("em-mob-wrap-cancel"),s%2===0&&(i.classList.forEach(a=>a.startsWith("em-mob-width-")&&i.classList.remove(a)),i.classList.add("em-mob-width-100perc"))});else{const i=o.querySelectorAll(Lt).length,s=Math.round(100/i)-2;o.querySelectorAll(Cn).forEach((l,c)=>{l.classList.add("em-mob-wrap-cancel"),l.classList.remove("em-mob-width-100perc"),c%2===0&&l.classList.add("em-mob-width-"+s+"perc")});const a=t.emailWidth||660;document.querySelector('style[em="styles"]')?.insertAdjacentHTML("beforeend",`
|
|
267
|
+
@media only screen and (max-device-width:${a}px),only screen and (max-width:${a}px) {
|
|
268
|
+
.em-mob-wrap.em-mob-wrap-cancel, .noresp-em-mob-wrap.em-mob-wrap-cancel { display: table-cell !important; }
|
|
269
|
+
.em-mob-width-${s}perc { width: ${s}% !important; }
|
|
270
|
+
}
|
|
271
|
+
`)}t.commit()}catch{}finally{n.releaseLater()}}function _Q(e,t){const n=t.selectionLock.acquire();try{const r=document.querySelector("[em-edit]");if(!r)return;const o=r.querySelector(Cn)?document.querySelector('[em-edit="active"]'):r.closest(Cn)?.parentElement?.closest("td");if(!o)return;e.dirRevert?(o.setAttribute("dir","rtl"),o.querySelectorAll("td").forEach(i=>{for(let s=i.firstChild;s;s=s.nextSibling)if(s.nodeType===3){s.parentNode?.setAttribute("dir","ltr");break}})):(o.removeAttribute("dir"),o.querySelectorAll("[dir]").forEach(i=>i.removeAttribute("dir"))),t.commit()}catch{}finally{n.releaseLater()}}function Mi(e){return{selectionLock:e.selectionLock,commit:e.commit,setPercentsForColumns:e.setPercentsForColumns,emailWidth:e.emailWidth,applicationElementSettingsSet:e.applicationElementSettingsSet}}function CQ(e,t){!t.selectionLock||!t.setPercentsForColumns||bQ(e.data.settings,Mi(t))}function TQ(e,t){!t.selectionLock||!t.setPercentsForColumns||yQ(e.data.settings,Mi(t))}function AQ(e,t){!t.selectionLock||!t.setPercentsForColumns||EQ(e.data.settings,Mi(t))}function kQ(e,t){!t.selectionLock||!t.setPercentsForColumns||SQ(e.data.settings,Mi(t))}function LQ(e,t){!t.selectionLock||!t.setPercentsForColumns||wQ(e.data.settings,Mi(t))}function NQ(e,t){!t.selectionLock||!t.setPercentsForColumns||_Q(e.data.settings,Mi(t))}var xQ={sandbox_floatBlock_add:CQ,sandbox_floatBlock_remove:TQ,sandbox_floatBlock_copy:AQ,sandbox_floatBlock_swap:kQ,sandbox_floatblock_wrap:LQ,sandbox_floatblock_dir:NQ},OQ='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>',RQ=['[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 YT(){pr(),Ie(document.body,!1,"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 MQ(){const e=document.querySelectorAll('[em="block"]');return e.length?e[e.length-1]:null}function PQ(){for(const e of RQ){const t=document.querySelector(e);if(t)return t}return null}function IQ(e){const t=e.querySelectorAll('[em="atom"]');return t.length?t[t.length-1]:e}function DQ(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?mu(e):null)}function BQ(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),HQ(i,e,r)}function HQ(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 ZT(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}),BQ(e,t,n)}function FQ(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 $Q(e,t){const n=UC();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=nT(e);if(e!==OQ){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"||!_n(n)?null:(o?t.insertCountdown({targetElem:hr(n),targetPlace:"beforeend",atomHTML:r}):t.insertAdjacentHTML(hr(n),"beforeend",r),n.querySelector('[em="block"]:last-child')??n.lastElementChild)}function QT(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.html=="string"?e.html:""}function WQ(e,t){e&&t.messageService.send(Ae.APPLICATION_ATOM_INSERTED,e),YT()}function qQ(e,t){t.messageService.send("application_block_inserted",{type:e.type,name:e.name,blockId:e.blockId,project:e.project}),YT()}function zQ(e,t){const n=QT(e.atomHTML),r=n.match(/<style((.|\n|\r)*?)<\/style>/g);return t.setDocumentStyles(r),n.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim()}function UQ(e,t){let n=zQ(e,t);if(!n)return!1;let r=null;const o=PQ();if(o)r=ZT(IQ(o),n,t);else{const i=MQ();if(i){const s=DQ(i);s&&(r=ZT(s,n,t))}else r=$Q(n,t)}return r?(FQ(r,t),!0):!1}function JT(e,t){const n=document.createElement("table");n.setAttribute("cellspacing","0"),n.setAttribute("cellpadding","0"),n.setAttribute("align","center"),n.setAttribute("border","0"),n.setAttribute("em","block"),n.setAttribute("width",e.getAttribute("width")??String(e.getBoundingClientRect().width)),n.classList.add("em-mob-width-100perc"),or(`
|
|
272
|
+
`+t+`
|
|
273
|
+
`,r=>{n.replaceChildren(...r),n.querySelectorAll('tr[em="block"]').forEach(o=>o.removeAttribute("em")),e.insertAdjacentElement("afterend",n)})}function jQ(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}t.substring(0,3)==="<tr"?JT(e,t):n.insertAdjacentHTML(e,"afterend",t)}function eA(e,t,n){if(!e.blockHTML?.trim())return!1;const r=t.parseFromString(e.blockHTML);let o=r.filter(h=>h.tagName&&h.tagName!=="LINK"&&h.tagName!=="STYLE").map(h=>t.getOuterHtml(h)).join(""),i=r.filter(h=>h.tagName==="STYLE").map(h=>t.getOuterHtml(h)).join("");const s=t.assetsRoot?.()??document.head,a=r.filter(h=>h.tagName==="LINK"&&h.getAttribute("em-class")).filter(h=>!s?.querySelector(`link[em-class="${h.getAttribute("em-class")}"]`));if(i){let h=s?.querySelector('style[em="styles"]'),f="";h?f=t.HTMLDocument.getInnerHtml(h):(h=document.createElement("style"),h.setAttribute("em","styles"),h=s?.insertAdjacentElement("beforeend",h));const g=document.createElement("div");t.emailWidth&&(i=i.replace(/(max-device-width:|max-width:)\d+px/g,w=>w.replace(/\d+/,String(t.emailWidth)))),g.insertAdjacentHTML("afterbegin",i);let E=t.minify(f+`
|
|
274
|
+
`+[...g.querySelectorAll("style")].map(w=>w.innerHTML).join(`
|
|
275
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;E=t.cssbeautify(E,{indent:" ",autosemicolon:!0}),h.textContent=`
|
|
276
|
+
`+E+`
|
|
277
|
+
`}for(const h of a.reverse())s?.prepend(h),s?.insertAdjacentHTML("afterbegin",`
|
|
278
|
+
`);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"}),jQ(n,o,t),!0;let l=null,c=null,u=!1;const d=UC(),m=d?null:document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')?.closest('[em="block"]')??jC();return 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(hr(d),"beforeend",o):t.insertAdjacentHTML(hr(d),"beforeend",'<tr><td align="center">'+o+"</td></tr>"),u=!0):m&&(l=m,(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):l&&(o.substring(0,3)==="<tr"?JT(l,o):t.insertAdjacentHTML(l,"afterend",o),u=!0),c=l?.nextSibling),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 VQ(e,t){if(t.lockEditor||!QT(e.atomHTML).trim())return;const n=t.selectionLock.acquire();try{t.setAtomReplaced?.(null),j0({kind:"atom",settings:e}),e.action!=="insert"&&Ie(document.body,!0,"em-atom-insert-body"),e.action==="insert"&&UQ(e,t)&&WQ(e.name,t),t.commit()}catch{}finally{n.releaseLater()}}function GQ(e){return e.replace(/["\\]/g,"\\$&")}function XQ(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="${GQ(String(n))}"]`,o=Array.from(document.querySelectorAll(r));if(!o.length)return 0;let i=0;const s=t.selectionLock.acquire();try{for(const a of o)eA({action:"insert",blockHTML:e.blockHTML,type:e.type,project:e.project,name:e.name},t,a)&&(a.remove(),i+=1);t.commit()}finally{s.releaseLater()}return i}function KQ(e,t){if(t.lockEditor||!e.blockHTML?.trim())return;const n=t.selectionLock.acquire();try{j0({kind:"block",settings:e}),Ie(document.body,!0,"em-block-insert-body"),e.action==="insert"&&eA(e,t)&&qQ(e,t),t.commit()}finally{n.releaseLater()}}function YQ(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};VQ({action:e.data.action,atomHTML:r.atomHTML,name:r.name},n)}function ZQ(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};KQ({action:e.data.action,blockHTML:r.blockHTML,type:r.type,project:r.project,name:r.name,blockId:r.blockId},n)}function QQ(e,t){t.setElementSettings?.(e)}var JQ={"sandbox_atom-insert":YQ,"sandbox_block-insert":ZQ,sandbox_element_settings_set:QQ},eJ=bn("elements",gQ,{services:[He,Ot,Te,Sr]},e=>{const t=R(e,He),n=R(e,Ot),r=lt(e),o=R(e,Sr);return()=>({HTMLDocument:{getOuterHtml:tn},applicationElementSettingsSet:t,commit:r,elementPath:o.elementPath,getElementParent:i=>Vc(i),getVariableByIcon:Ac,hasRussianText:HM,messageService:G,removeAllAttributes:Cr,setCursorPosition:i=>n(i)})}),tJ=bn("display",UZ,{services:[K]},e=>{const t=R(e,K);return()=>({messageService:G,htmlDocument:t})}),nJ=bn("floatBlock",xQ,{services:[He,Te,Me]},e=>{const t=R(e,He),n=lt(e),r=R(e,Me);let o=600;return U.subscribe(i=>{i.emailWidth!==void 0&&(o=i.emailWidth)}),()=>({applicationElementSettingsSet:t,commit:n,emailWidth:o,selectionLock:r,setPercentsForColumns:i=>vf(i)})}),rJ=bn("accordion",WZ,{services:[Te,Me]},e=>{const t=lt(e),n=R(e,Me);return()=>({HTMLDocument:{getOuterHtml:tn},commit:t,selectionLock:n,getActiveEditElement:Ef,parseFromString:r=>Re(r)})}),oJ=bn("eblock",GZ,{services:[Te]},e=>{const t=lt(e);return()=>({commit:t})}),iJ=bn("palette",JQ,{services:[No,qa]},e=>{const t=R(e,No),n=R(e,qa);return()=>({getInsertContext:t.insertContext,setElementSettings:n})}),sJ=bn("nativeImageDrop",{[Ae.SANDBOX_NATIVE_IMAGE_DROP_CLEAR]:()=>J0()},void 0,()=>()=>({})),aJ=[eJ,tJ,nJ,rJ,oJ,iJ,sJ],lJ={name:"sandbox.prepareHtml",provides:[$a],setup:e=>e.inject($a,t=>cc({node:t,isPartial:!0}))},cJ={name:"sandbox.blockControlsViewport",setup:e=>e.addService(zg,()=>Ic({scrollTop:U.get("scrollTop")}))},uJ=[lJ,cJ,TZ,AZ,kZ,LZ,NZ,...aJ,xZ,OZ,RZ,MZ,PZ,IZ,DZ],dJ="__emmDiagnostics__",fJ="diagnostics";function mJ(){try{const e=new URLSearchParams(window.location.search).get(fJ);return e!==null&&e!=="0"}catch{return!1}}function $p(e){try{window.parent.postMessage({mark:dJ,...e},"*")}catch{}}function hJ(){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}});$p({type:"resources",timeOrigin:window.performance.timeOrigin,items:e})}function Pi(){return window.performance.timeOrigin+window.performance.now()}function pJ(){return Array.from(document.images).every(e=>e.complete)}function gJ(e,t){const r=window.setInterval(()=>{!pJ()||Pi()-e()<500||(window.clearInterval(r),$p({type:"settled",at:Math.max(e(),t)}),hJ())},100)}function bJ(){if(!mJ()||typeof MutationObserver!="function")return;let e=!1,t=Pi();new MutationObserver(()=>{t=Pi(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const n=Pi();$p({type:"paint",at:n}),gJ(()=>t,n)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{t=Pi()}),document.addEventListener("load",()=>{t=Pi()},!0)}var yJ=500,vJ=300,_a,xu=!1;function tA(){if(xu)return;xu=!0;let e=!1;const t=window.setTimeout(()=>{e||(e=!0,_a=!1,xu=!1)},vJ);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(t),_a=!0,xu=!1)})}function EJ(){return _a===!1?(tA(),Promise.resolve()):new Promise(e=>{let t=!1;const n=()=>{t||(t=!0,e())},r=window.setTimeout(()=>{_a=!1,n()},yJ);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(r),_a=!0,n()})})})}var SJ=1;function wJ(){tA();const e=async(t,n)=>{await n?.(t),await EJ()};G.addListenerAsync(Ae.SANDBOX_INITED,e,SJ)}var _J=16,nA=100,CJ=.95,rA=.02;function oA(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*_J:t===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function iA(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 sA(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(iA(o,"y",n)||iA(o,"x",t))return!0}return!1}function TJ(){let e=0,t=0,n=!1;const r=()=>{n=!1;const d=e,m=t;e=0,t=0,!(d===0&&m===0)&&G.send(Ae.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||sA(d.target,d.deltaX,d.deltaY)||(d.preventDefault(),o(oA(d.deltaX,d.deltaMode),oA(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,h=performance.now();const f=g=>{const E=g>h?Math.min(g-h,50):16;h=g;const w=Math.pow(CJ,E/16);if(d*=w,m*=w,Math.abs(d)<rA&&Math.abs(m)<rA){l=void 0;return}o(d*E,m*E),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 h=i.x-m.screenX,f=i.y-m.screenY,g=d.timeStamp-i.at;if(i={x:m.screenX,y:m.screenY,at:d.timeStamp},!sA(d.target,h,f)){if(d.cancelable&&d.preventDefault(),s=!0,g>0){const E=Math.min(g/nA,1);a={x:a.x*(1-E)+h/g*E,y:a.y*(1-E)+f/g*E}}o(h,f)}},{passive:!1}),window.addEventListener("touchend",d=>{const m=i?d.timeStamp-i.at:1/0;s&&d.touches.length===0&&m<nA&&u(),i=void 0,s=!1},{passive:!0}),window.addEventListener("touchcancel",()=>{i=void 0,s=!1})}var AJ={name:"sandbox.diagnosticsAgent",setup:()=>bJ()},kJ={name:"sandbox.paintGate",setup:()=>wJ()},LJ={name:"sandbox.wheelBridge",setup:()=>TJ()},NJ={name:"sandbox.deviceWidthMediaGuard",setup:()=>i6()};function xJ(){return Math.ceil(document.documentElement.getBoundingClientRect().height)}function OJ(){return Math.max(document.body?.scrollWidth??0,document.documentElement?.scrollWidth??0)}window.iFrameResizer={heightCalculationMethod:xJ,widthCalculationMethod:OJ};var RJ=yr(((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,h=!0,f=1,g="bodyOffset",E=g,w=!0,T="",L={},y=32,p=null,v=!1,C=!1,b="[iFrameSizer]",S=b.length,_="",k={max:1,min:1,bodyScroll:1,documentElementScroll:1},x="child",N=!0,W=window.parent,O="*",P=0,Q=!1,te=null,fe=16,ne=1,Y="scroll",be=Y,ce=window,Se=function(){un("onMessage function not defined")},st=function(){},J=function(){},q={height:function(){return un("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return un("Custom width calculation function not defined"),document.body.scrollWidth}},re={},Ft=!1;try{var z=Object.create({},{passive:{get:function(){Ft=!0}}});window.addEventListener("test",Ou,z),window.removeEventListener("test",Ou,z)}catch{}var ln,vt,cn,Kt,Tn,Yt,at={bodyOffset:function(){return document.body.offsetHeight+kn("marginTop")+kn("marginBottom")},offset:function(){return at.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return q.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,xt(at))},min:function(){return Math.min.apply(null,xt(at))},grow:function(){return at.max()},lowestElement:function(){return Math.max(at.bodyOffset()||at.documentElementOffset(),ye("bottom",dt()))},taggedElement:function(){return Yn("bottom","data-iframe-height")}},Nt={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return q.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(Nt.bodyScroll(),Nt.documentElementScroll())},max:function(){return Math.max.apply(null,xt(Nt))},min:function(){return Math.min.apply(null,xt(Nt))},rightMostElement:function(){return ye("right",dt())},taggedElement:function(){return Yn("right","data-iframe-width")}},Et=(ln=Ln,Tn=null,Yt=0,function(){var M=Date.now(),F=fe-(M-(Yt=Yt||M));return vt=this,cn=arguments,F<=0||fe<F?(Tn&&(clearTimeout(Tn),Tn=null),Yt=M,Kt=ln.apply(vt,cn),Tn||(vt=cn=null)):Tn=Tn||setTimeout($t,F),Kt});Kn(window,"message",function(M){var F={init:function(){T=M.data,W=M.source,Ru(),h=!1,setTimeout(function(){w=!1},m)},reset:function(){w?ae("Page reset ignored by init"):(ae("Page size reset by host page"),Gr("resetPage"))},resize:function(){gr("resizeParent","Parent window requested size check")},moveToAnchor:function(){L.findTarget(we())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var Ne=we();ae("PageInfoFromParent called from parent: "+Ne),J(JSON.parse(Ne)),ae(" --")},message:function(){var Ne=we();ae("onMessage called from parent: "+Ne),Se(JSON.parse(Ne)),ae(" --")}};function de(){return M.data.split("]")[1].split(":")[0]}function we(){return M.data.substr(M.data.indexOf(":")+1)}function V(){return M.data.split(":")[2]in{true:1,false:1}}function Z(){var Ne=de();Ne in F?F[Ne]():(typeof t>"u"||!t.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||V()||un("Unexpected message ("+M.data+")")}b===(""+M.data).substr(0,S)&&(h===!1?Z():V()?F.init():ae('Ignored message of type "'+de()+'". Received before initialization.'))}),Kn(window,"readystatechange",lA),lA()}function Ou(){}function Kn(M,F,de,we){M.addEventListener(F,de,!!Ft&&(we||{}))}function Ca(M){return M.charAt(0).toUpperCase()+M.slice(1)}function wo(M){return b+"["+_+"] "+M}function ae(M){v&&window.console}function un(M){window.console}function Ru(){function M(V){return V==="true"}var F;function de(V){dn(0,0,V.type,V.screenY+":"+V.screenX)}function we(V,Z){ae("Add event listener: "+Z),Kn(window.document,V,de)}F=T.substr(S).split(":"),_=F[0],s=n!==F[1]?Number(F[1]):s,u=n!==F[2]?M(F[2]):u,v=n!==F[3]?M(F[3]):v,y=n!==F[4]?Number(F[4]):y,r=n!==F[6]?M(F[6]):r,a=F[7],E=n!==F[8]?F[8]:E,i=F[9],c=F[10],P=n!==F[11]?Number(F[11]):P,L.enable=n!==F[12]&&M(F[12]),x=n!==F[13]?F[13]:x,be=n!==F[14]?F[14]:be,C=n!==F[15]?!!F[15]:C,ae("Initialising iFrame ("+window.location.href+")"),(function(){function V(Z,Ne){return typeof Z=="function"&&(ae("Setup custom "+Ne+"CalcMethod"),q[Ne]=Z,Z="custom"),Z}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var Z=window.iFrameResizer;ae("Reading data from page: "+JSON.stringify(Z)),Object.keys(Z).forEach(Ta,Z),Se="onMessage"in Z?Z.onMessage:Se,st="onReady"in Z?Z.onReady:st,O="targetOrigin"in Z?Z.targetOrigin:O,E="heightCalculationMethod"in Z?Z.heightCalculationMethod:E,be="widthCalculationMethod"in Z?Z.widthCalculationMethod:be})(),E=V(E,"height"),be=V(be,"width")),ae("TargetOrigin for parent set to: "+O)})(),(function(){n===a&&(a=s+"px"),Ii("margin",(function(V,Z){return Z.indexOf("-")!==-1&&(un("Negative CSS value ignored for "+V),Z=""),Z})("margin",a))})(),Ii("background",i),Ii("padding",c),(F=document.createElement("div")).style.clear="both",F.classList.add("iframe-resizer-inner"),F.style.display="block",F.style.height="0",document.body.appendChild(F),Aa(),$(),document.documentElement.style.height="",document.body.style.height="",ae('HTML & body height set to "auto"'),ae("Enable public methods"),ce.parentIFrame={autoResize:function(V){return V===!0&&r===!1?(r=!0,tt()):V===!1&&r===!0&&(r=!1,Vr("remove"),l!==null&&l.disconnect(),clearInterval(p)),dn(0,0,"autoResize",JSON.stringify(r)),r},close:function(){dn(0,0,"close")},getId:function(){return _},getPageInfo:function(V){typeof V=="function"?(J=V,dn(0,0,"pageInfo")):(J=function(){},dn(0,0,"pageInfoStop"))},moveToAnchor:function(V){L.findTarget(V)},reset:function(){Nn("parentIFrame.reset")},scrollTo:function(V,Z){dn(Z,V,"scrollTo")},scrollToOffset:function(V,Z){dn(Z,V,"scrollToOffset")},sendMessage:function(V,Z){dn(0,0,"message",JSON.stringify(V),Z)},setHeightCalculationMethod:function(V){E=V,Aa()},setWidthCalculationMethod:function(V){be=V,$()},setTargetOrigin:function(V){ae("Set targetOrigin: "+V),O=V},size:function(V,Z){gr("size","parentIFrame.size("+((V||"")+(Z?","+Z:""))+")",V,Z)}},C===!0&&(we("mouseenter","Mouse Enter"),we("mouseleave","Mouse Leave")),tt(),L=(function(){function V(qt){var ue=qt.getBoundingClientRect(),qt={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(ue.left,10)+parseInt(qt.x,10),y:parseInt(ue.top,10)+parseInt(qt.y,10)}}function Z(Qt){var ue,qt=Qt.split("#")[1]||Qt,Qt=decodeURIComponent(qt),cA=document.getElementById(Qt)||document.getElementsByName(Qt)[0];n!==cA?(ue=V(ue=cA),ae("Moving to in page link (#"+qt+") at x: "+ue.x+" y: "+ue.y),dn(ue.y,ue.x,"scrollToOffset")):(ae("In page link (#"+qt+") not found in iFrame, so sending to parent"),dn(0,0,"inPageLink","#"+qt))}function Ne(){var Zt=window.location.hash,ue=window.location.href;Zt!==""&&Zt!=="#"&&Z(ue)}function Wt(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(Zt){Zt.getAttribute("href")!=="#"&&Kn(Zt,"click",function(ue){ue.preventDefault(),Z(this.getAttribute("href"))})})}function ka(){Array.prototype.forEach&&document.querySelectorAll?(ae("Setting up location.hash handlers"),Wt(),Kn(window,"hashchange",Ne),setTimeout(Ne,m)):un("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return L.enable?ka():ae("In page linking not enabled"),{findTarget:Z}})(),gr("init","Init message from host page"),st()}function Ta(M){var F=M.split("Callback");F.length===2&&(this[F="on"+F[0].charAt(0).toUpperCase()+F[0].slice(1)]=this[M],delete this[M],un("Deprecated: '"+M+"' has been renamed '"+F+"'. The old method will be removed in the next major version."))}function Ii(M,F){n!==F&&F!==""&&F!=="null"&&ae("Body "+M+' set to "'+(document.body.style[M]=F)+'"')}function et(M){var F={add:function(de){function we(){gr(M.eventName,M.eventType)}re[de]=we,Kn(window,de,we,{passive:!0})},remove:function(de){var we,V=re[de];delete re[de],we=window,de=de,V=V,we.removeEventListener(de,V,!1)}};M.eventNames&&Array.prototype.map?(M.eventName=M.eventNames[0],M.eventNames.map(F[M.method])):F[M.method](M.eventName),ae(Ca(M.method)+" event listener: "+M.eventType)}function Vr(M){et({method:M,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),et({method:M,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),et({method:M,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),et({method:M,eventType:"Input",eventName:"input"}),et({method:M,eventType:"Mouse Up",eventName:"mouseup"}),et({method:M,eventType:"Mouse Down",eventName:"mousedown"}),et({method:M,eventType:"Orientation Change",eventName:"orientationchange"}),et({method:M,eventType:"Print",eventNames:["afterprint","beforeprint"]}),et({method:M,eventType:"Ready State Change",eventName:"readystatechange"}),et({method:M,eventType:"Touch Start",eventName:"touchstart"}),et({method:M,eventType:"Touch End",eventName:"touchend"}),et({method:M,eventType:"Touch Cancel",eventName:"touchcancel"}),et({method:M,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),et({method:M,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),et({method:M,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),x==="child"&&et({method:M,eventType:"IFrame Resized",eventName:"resize"})}function Mu(M,F,de,we){return F!==M&&(M in de||(un(M+" is not a valid option for "+we+"CalculationMethod."),M=F),ae(we+' calculation method set to "'+M+'"')),M}function Aa(){E=Mu(E,g,at,"height")}function $(){be=Mu(be,Y,Nt,"width")}function tt(){var M;r===!0?(Vr("add"),M=y<0,window.MutationObserver||window.WebKitMutationObserver?M?An():l=(function(){function F(ue){function qt(Qt){Qt.complete===!1&&(ae("Attach listeners to "+Qt.src),Qt.addEventListener("load",V,!1),Qt.addEventListener("error",Z,!1),Wt.push(Qt))}ue.type==="attributes"&&ue.attributeName==="src"?qt(ue.target):ue.type==="childList"&&Array.prototype.forEach.call(ue.target.querySelectorAll("img"),qt)}function de(ue){ae("Remove listeners from "+ue.src),ue.removeEventListener("load",V,!1),ue.removeEventListener("error",Z,!1),ue=ue,Wt.splice(Wt.indexOf(ue),1)}function we(ue,qt,Qt){de(ue.target),gr(qt,Qt+": "+ue.target.src)}function V(ue){we(ue,"imageLoad","Image loaded")}function Z(ue){we(ue,"imageLoadFailed","Image load failed")}function Ne(ue){gr("mutationObserver","mutationObserver: "+ue[0].target+" "+ue[0].type),ue.forEach(F)}var Wt=[],ka=window.MutationObserver||window.WebKitMutationObserver,Zt=(function(){var ue=document.querySelector("body");return Zt=new ka(Ne),ae("Create body MutationObserver"),Zt.observe(ue,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),Zt})();return{disconnect:function(){"disconnect"in Zt&&(ae("Disconnect body MutationObserver"),Zt.disconnect(),Wt.forEach(de))}}})():(ae("MutationObserver not supported in this browser!"),An())):ae("Auto Resize disabled")}function An(){y!==0&&(ae("setInterval: "+y+"ms"),p=setInterval(function(){gr("interval","setInterval: "+y)},Math.abs(y)))}function kn(M,F){var de=0;return F=F||document.body,de=(de=document.defaultView.getComputedStyle(F,null))!==null?de[M]:0,parseInt(de,o)}function ye(M,F){for(var de,we=F.length,V=0,Z=Ca(M),Ne=Date.now(),Wt=0;Wt<we;Wt++)V<(de=F[Wt].getBoundingClientRect()[M]+kn("margin"+Z,F[Wt]))&&(V=de);return Ne=Date.now()-Ne,ae("Parsed "+we+" HTML elements"),ae("Element position calculated in "+Ne+"ms"),fe/2<(Ne=Ne)&&ae("Event throttle increased to "+(fe=2*Ne)+"ms"),V}function xt(M){return[M.bodyOffset(),M.bodyScroll(),M.documentElementOffset(),M.documentElementScroll()]}function Yn(M,F){var de=document.querySelectorAll("["+F+"]");return de.length===0&&(un("No tagged elements ("+F+") found on page"),document.querySelectorAll("body *")),ye(M,de)}function dt(){return document.querySelectorAll("body *")}function Ln(M,F,de,we){function V(){M in{init:1,interval:1,size:1}||!(E in k||u&&be in k)?M in{interval:1}||ae("No change in size detected"):Nn(F)}var Z,Ne;function Wt(ka,Zt){return!(Math.abs(ka-Zt)<=P)}Z=n!==de?de:at[E](),Ne=n!==we?we:Nt[be](),Wt(f,Z)||u&&Wt(ne,Ne)||M==="init"?(Pu(),dn(f=Z,ne=Ne,M)):V()}function $t(){Yt=Date.now(),Tn=null,Kt=ln.apply(vt,cn),Tn||(vt=cn=null)}function gr(M,F,de,we){Q&&M in d?ae("Trigger event cancelled: "+M):(M in{reset:1,resetPage:1,init:1}||ae("Trigger event: "+F),(M==="init"?Ln:Et)(M,F,de,we))}function Pu(){Q||(Q=!0,ae("Trigger event lock on")),clearTimeout(te),te=setTimeout(function(){Q=!1,ae("Trigger event lock off"),ae("--")},m)}function Gr(M){f=at[E](),ne=Nt[be](),dn(f,ne,M)}function Nn(M){var F=E;E=g,ae("Reset trigger event: "+M),Pu(),Gr("reset"),E=F}function dn(M,F,de,we,V){var Z;N===!0&&(n===V?V=O:ae("Message targetOrigin: "+V),ae("Sending message to host page ("+(Z=_+":"+(M+":"+F)+":"+de+(n!==we?":"+we:""))+")"),W.postMessage(b+Z,V))}function lA(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),MJ=[{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 PJ(){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 IJ(e){const t=document.querySelector("[em=blocks]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","block");t.removeAttribute("em"),qo();return}if(e){let n=!1;for(const r of MJ)if(r.detect()){r.apply(),n=!0;break}n||PJ()}aA(),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||G.send({operation:"application_template_not_em_alert_show"}),qo()}function aA(){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(H,"CANVAS_CORE_UNITS",{enumerable:!0,get:function(){return Z$}}),Object.defineProperty(H,"Disposable",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(H,"EDIT_LOCK_ID",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(H,"EMAIL_LAYOUT_UNITS",{enumerable:!0,get:function(){return uJ}}),Object.defineProperty(H,"EVENT_TYPES",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(H,"FOCUS_ID",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(H,"HTML_DOCUMENT_ID",{enumerable:!0,get:function(){return K}}),Object.defineProperty(H,"INIT_PREVIEW_ID",{enumerable:!0,get:function(){return Ki}}),Object.defineProperty(H,"INSERT_POLICY_ID",{enumerable:!0,get:function(){return sd}}),Object.defineProperty(H,"NARROW_TABLE_TEXT_ATOM_ID",{enumerable:!0,get:function(){return Wg}}),Object.defineProperty(H,"Node",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(H,"NodeType",{enumerable:!0,get:function(){return I}}),Object.defineProperty(H,"SELECTION_LOCK_ID",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(H,"SET_CURSOR_ID",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(H,"STYLE_ROOT_ID",{enumerable:!0,get:function(){return Fg}}),Object.defineProperty(H,"SYNC_COMMIT_ID",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(H,"VML_WIDTH_RESOLVER_ID",{enumerable:!0,get:function(){return $g}}),Object.defineProperty(H,"WRAP_EDITOR_ID",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(H,"_defineProperty",{enumerable:!0,get:function(){return A}}),Object.defineProperty(H,"addFontFamilyClass",{enumerable:!0,get:function(){return ta}}),Object.defineProperty(H,"ampUnit",{enumerable:!0,get:function(){return zO}}),Object.defineProperty(H,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return Lc}}),Object.defineProperty(H,"applyRootScale",{enumerable:!0,get:function(){return ls}}),Object.defineProperty(H,"buildEmFontClassName",{enumerable:!0,get:function(){return xc}}),Object.defineProperty(H,"checkBlockAdaptivity",{enumerable:!0,get:function(){return Tc}}),Object.defineProperty(H,"clearLinkTags",{enumerable:!0,get:function(){return ho}}),Object.defineProperty(H,"clearProjectFontFaces",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(H,"commitOf",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(H,"commonStylesApply",{enumerable:!0,get:function(){return M_}}),Object.defineProperty(H,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return kh}}),Object.defineProperty(H,"createFontClassName",{enumerable:!0,get:function(){return dh}}),Object.defineProperty(H,"createIdentifier",{enumerable:!0,get:function(){return le}}),Object.defineProperty(H,"defineSurface",{enumerable:!0,get:function(){return rL}}),Object.defineProperty(H,"defineUnit",{enumerable:!0,get:function(){return Rk}}),Object.defineProperty(H,"deviceWidthMediaGuardUnit",{enumerable:!0,get:function(){return NJ}}),Object.defineProperty(H,"diagnosticsAgentUnit",{enumerable:!0,get:function(){return AJ}}),Object.defineProperty(H,"editLock",{enumerable:!0,get:function(){return tf}}),Object.defineProperty(H,"elMarkupHelper",{enumerable:!0,get:function(){return IJ}}),Object.defineProperty(H,"extensionsUnit",{enumerable:!0,get:function(){return f$}}),Object.defineProperty(H,"findParentTr",{enumerable:!0,get:function(){return Iv}}),Object.defineProperty(H,"fitEmailToWidth",{enumerable:!0,get:function(){return XO}}),Object.defineProperty(H,"fitImagesToColumns",{enumerable:!0,get:function(){return ip}}),Object.defineProperty(H,"getElementInnerHTML",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(H,"getOuterHtml",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(H,"getUsedColors",{enumerable:!0,get:function(){return q_}}),Object.defineProperty(H,"globalBlockReplace",{enumerable:!0,get:function(){return XQ}}),Object.defineProperty(H,"iframeSetSize",{enumerable:!0,get:function(){return KO}}),Object.defineProperty(H,"implementPolyfills",{enumerable:!0,get:function(){return jp}}),Object.defineProperty(H,"insertAdjacentHTML",{enumerable:!0,get:function(){return Jn}}),Object.defineProperty(H,"insertCountdown",{enumerable:!0,get:function(){return Kw}}),Object.defineProperty(H,"insertNewHTML",{enumerable:!0,get:function(){return Yy}}),Object.defineProperty(H,"isComment",{enumerable:!0,get:function(){return Td}}),Object.defineProperty(H,"isEmptyTable",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(H,"isTextNode",{enumerable:!0,get:function(){return Io}}),Object.defineProperty(H,"markAtomsAndClearRootHeight",{enumerable:!0,get:function(){return aA}}),Object.defineProperty(H,"markProjectFontClass",{enumerable:!0,get:function(){return mh}}),Object.defineProperty(H,"messageService",{enumerable:!0,get:function(){return G}}),Object.defineProperty(H,"minifyStylesheet",{enumerable:!0,get:function(){return ao}}),Object.defineProperty(H,"paintGateUnit",{enumerable:!0,get:function(){return kJ}}),Object.defineProperty(H,"parseFromString",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(H,"removeClassesByPrefix",{enumerable:!0,get:function(){return Ys}}),Object.defineProperty(H,"removeHiddenClasses",{enumerable:!0,get:function(){return lc}}),Object.defineProperty(H,"requireService",{enumerable:!0,get:function(){return R}}),Object.defineProperty(H,"require_iframeResizer_contentWindow_min",{enumerable:!0,get:function(){return RJ}}),Object.defineProperty(H,"rgbToHex",{enumerable:!0,get:function(){return j}}),Object.defineProperty(H,"rowsHost",{enumerable:!0,get:function(){return hr}}),Object.defineProperty(H,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return Ic}}),Object.defineProperty(H,"setBlockMaxWidth",{enumerable:!0,get:function(){return sp}}),Object.defineProperty(H,"setDocumentStyles",{enumerable:!0,get:function(){return uh}}),Object.defineProperty(H,"setElementBorder",{enumerable:!0,get:function(){return ph}}),Object.defineProperty(H,"setElementBorderRadius",{enumerable:!0,get:function(){return yi}}),Object.defineProperty(H,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return d_}}),Object.defineProperty(H,"setFloatBlocksWidth",{enumerable:!0,get:function(){return op}}),Object.defineProperty(H,"setImageWidth",{enumerable:!0,get:function(){return th}}),Object.defineProperty(H,"setStructureBlocksWidth",{enumerable:!0,get:function(){return su}}),Object.defineProperty(H,"startSandbox",{enumerable:!0,get:function(){return oL}}),Object.defineProperty(H,"state",{enumerable:!0,get:function(){return U}}),Object.defineProperty(H,"stripSubjectTags",{enumerable:!0,get:function(){return gL}}),Object.defineProperty(H,"uptimeCountdown",{enumerable:!0,get:function(){return nh}}),Object.defineProperty(H,"wheelBridgeUnit",{enumerable:!0,get:function(){return LJ}}),Object.defineProperty(H,"withForeignListenersPaused",{enumerable:!0,get:function(){return Mt}})});
|